/* Assistant REGINE (lot A1) : panneau latéral. Charte : #1A365D, #00C8FF, #40E0D0 ; textes ≥ 4,5:1 ; cibles ≥ 40 px. */
:root { --assistant-largeur: 400px; }

.assistant-ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.assistant-declencheur { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; min-width: 40px; justify-content: center; padding: 0 .75rem;
    border-radius: .5rem; background: #1A365D; color: #fff; font-size: .875rem; font-weight: 600; }
.assistant-declencheur:hover { background: #12263F; }
.assistant-declencheur[aria-expanded="true"] { background: #00C8FF; color: #1A365D; }
.assistant-kbd { font: 500 11px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 6px; border-radius: 4px; background: rgba(255, 255, 255, .2); }
.assistant-declencheur[aria-expanded="true"] .assistant-kbd { background: rgba(26, 54, 93, .15); }
.assistant-declencheur:focus-visible, .assistant-panneau :focus-visible { outline: 2px solid #00C8FF; outline-offset: 2px; }

/* Panneau : pousse le contenu (≥ 900 px), superposé en dessous */
.assistant-panneau { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: var(--assistant-largeur); max-width: 100vw;
    display: flex; flex-direction: column; background: #fff; border-left: 1px solid #e5e7eb; color: #1f2937; font-size: .875rem; }
.assistant-panneau[hidden] { display: none; }
@media (min-width: 900px) {
    body.assistant-ouvert > main { margin-right: var(--assistant-largeur); }
}
@media (max-width: 899.98px) {
    .assistant-panneau { width: min(100vw, 420px); box-shadow: -12px 0 32px rgba(15, 23, 42, .25); z-index: 60; }
}

.assistant-entete { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid #e5e7eb; }
.assistant-logo { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; background: #1A365D; color: #40E0D0; }
.assistant-titre { font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif; font-size: 1rem; font-weight: 600; color: #1A365D; margin: 0; }
.assistant-beta { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: #e0f7fb; color: #1A365D; }
.assistant-icone { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px; color: #4b5563; background: transparent; }
.assistant-icone:hover { background: #f1f5f9; color: #1A365D; }
.assistant-icone[aria-pressed="true"] { background: #e0f7fb; color: #1A365D; }

.assistant-contexte { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; padding: .625rem 1rem; border-bottom: 1px solid #e5e7eb; background: #f8fafc; }
.assistant-contexte-titre { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #4b5563; margin-right: .25rem; }
.assistant-contexte-vide { font-size: 12px; color: #4b5563; }
.assistant-pastille { display: inline-flex; align-items: center; gap: .25rem; padding-left: .625rem; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; font-size: 12px; color: #1A365D; }
.assistant-pastille button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -8px -6px -8px -8px; border-radius: 999px; color: #4b5563; }
.assistant-pastille button:hover { color: #b91c1c; }

.assistant-fil { flex: 1 1 auto; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.assistant-accueil { color: #4b5563; }
.assistant-question { align-self: flex-end; max-width: 90%; padding: .625rem .875rem; border-radius: .75rem .75rem .25rem .75rem; background: #1A365D; color: #fff; white-space: pre-wrap; }
.assistant-reponse { display: flex; flex-direction: column; gap: .75rem; }
.assistant-texte { line-height: 1.55; }
.assistant-texte p { margin: 0 0 .5rem; } .assistant-texte p:last-child { margin-bottom: 0; }
.assistant-texte ol, .assistant-texte ul { margin: 0 0 .5rem 1.25rem; } .assistant-texte ol { list-style: decimal; } .assistant-texte ul { list-style: disc; }
.assistant-texte code { font: 600 .8rem ui-monospace, SFMono-Regular, Menlo, monospace; color: #1A365D; }
.assistant-texte a { color: #1d4ed8; text-decoration: underline; }
.assistant-etapes-bouton { display: inline-flex; align-items: center; gap: .375rem; min-height: 40px; padding: 0 .5rem; margin-left: -.5rem; border-radius: 6px; color: #4b5563; font-size: 12px; }
.assistant-etapes-bouton:hover { background: #f1f5f9; }
.assistant-etapes { margin: 0; padding-left: 1.25rem; list-style: decimal; font-size: 12px; color: #374151; }
.assistant-etapes li { padding: .125rem 0; }
.assistant-mono { font: 500 12px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.assistant-erreur { padding: .625rem .875rem; border: 1px solid #fecaca; border-radius: .5rem; background: #fef2f2; color: #991b1b; }

/* Cartes */
.assistant-carte { border: 1px solid #e5e7eb; border-radius: .625rem; background: #fff; overflow: hidden; }
.assistant-carte-entete { display: flex; align-items: center; gap: .5rem; padding: .625rem .875rem; background: #f8fafc; border-bottom: 1px solid #e5e7eb; }
.assistant-carte-code { font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: #1A365D; }
.assistant-carte-type { font-size: 11px; color: #4b5563; }
.assistant-carte-total { margin-left: auto; font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; color: #1A365D; }
.assistant-factice { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #fef3c7; color: #78350f; }
.assistant-lignes { padding: .25rem 0; }
.assistant-ligne { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto auto; align-items: center; gap: .5rem; padding: .375rem .875rem; font-size: 12px; }
.assistant-ligne .signe { font: 700 13px ui-monospace, monospace; text-align: center; }
.assistant-ligne .signe-plus { color: #047857; } .assistant-ligne .signe-moins { color: #b91c1c; } .assistant-ligne .signe-nul { color: #4b5563; }
.assistant-ligne .code { overflow-wrap: anywhere; }
.assistant-ligne .montant { font: 500 12px ui-monospace, monospace; font-variant-numeric: tabular-nums; text-align: right; }
.assistant-ligne.exoneree { color: #4b5563; }
.assistant-ligne.exoneree .montant { text-decoration: line-through; }
.assistant-niveau { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.assistant-niveau-NOYAU { background: #e5e7eb; color: #1f2937; }
.assistant-niveau-PAYS { background: #dbeafe; color: #1e3a8a; }
.assistant-niveau-SECTEUR { background: #ccfbf1; color: #134e4a; }
.assistant-niveau-SOCIETE { background: #ede9fe; color: #4c1d95; }
.assistant-niveau-ETABLISSEMENT { background: #fce7f3; color: #831843; }
.assistant-carte-pied { display: flex; align-items: center; gap: .75rem; padding: .5rem .875rem; border-top: 1px solid #e5e7eb; font-size: 12px; color: #4b5563; }
.assistant-source { display: flex; gap: .75rem; padding: .75rem .875rem; }
.assistant-source-titre { font-weight: 600; color: #1A365D; }
.assistant-source a, .assistant-carte-pied a { display: inline-flex; align-items: center; min-height: 40px; color: #1d4ed8; text-decoration: underline; }
.assistant-apercu { width: 100%; border-collapse: collapse; font-size: 12px; }
.assistant-apercu th, .assistant-apercu td { padding: .375rem .875rem; text-align: left; border-top: 1px solid #f1f5f9; }
.assistant-apercu td { white-space: nowrap; }
.assistant-apercu th { font-weight: 600; color: #4b5563; }
.assistant-bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 .875rem; border-radius: .5rem; font-weight: 600; font-size: .8125rem; }
.assistant-bouton-primaire { background: #1A365D; color: #fff; }
.assistant-bouton-primaire:disabled { background: #e5e7eb; color: #4b5563; cursor: not-allowed; }
.assistant-bouton-neutre { border: 1px solid #cbd5e1; background: #fff; color: #1f2937; }
.assistant-bouton-neutre:hover { background: #f8fafc; }

.assistant-retours { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.assistant-signalement { display: flex; flex-direction: column; gap: .375rem; width: 100%; }
.assistant-signalement textarea, .assistant-saisie textarea { width: 100%; padding: .5rem .625rem; border: 1px solid #cbd5e1; border-radius: .5rem; font: inherit; resize: vertical; }
.assistant-merci { font-size: 12px; color: #047857; }

.assistant-saisie { padding: .75rem 1rem 1rem; border-top: 1px solid #e5e7eb; }
.assistant-label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: .375rem; }
.assistant-saisie-ligne { display: flex; align-items: flex-end; gap: .5rem; }
.assistant-saisie textarea:focus { outline: none; border-color: #00C8FF; box-shadow: 0 0 0 2px #00C8FF; }
.assistant-envoyer { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: .5rem; background: #1A365D; color: #fff; flex-shrink: 0; }
.assistant-envoyer:disabled { background: #e5e7eb; color: #4b5563; }
.assistant-mention { margin: .5rem 0 0; font-size: 11px; color: #4b5563; }

/* Bouton ✦ « Expliquer » des lignes du bulletin */
.assistant-expliquer { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px; color: #4b5563; }
.assistant-expliquer:hover, .assistant-expliquer[aria-pressed="true"] { background: #e0f7fb; color: #1A365D; }
tr.assistant-ligne-selectionnee { background: #e0f7fb; }
