/* AERO-ASSIST : interface vocale sobre. Un bouton au départ, une conversation type appel ensuite. */
/* Noir et blanc, fond blanc. Mêmes jetons de couleur et mêmes polices qu'avant. */
:root {
  --fond: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f1f1;
  --trait: #e3e3e3;
  --texte: #111111;
  --texte-2: #666666;
  --texte-3: #9b9b9b;     /* traits et textes d'exemple ; trop pâle pour du texte lisible */
  --os: #111111;          /* le bouton */
  --os-icone: #ffffff;
  --survol: #333333;
  --glace: rgba(255, 255, 255, .92);
  --glace-forte: rgba(255, 255, 255, .9);
  --glace-carte: rgba(255, 255, 255, .86);
  --papier: #ffffff;
  --marque: #111111;
  --tag: #6b6b6b;
  --rouge-fond: #fdecec;
  --rouge-bord: #f0c2c2;
  --rouge: #b71c1c;
  --orange: #e65100;
  --vert: #1b5e20;
  --ombre-dialogue: 0 24px 80px rgba(17, 17, 17, .22);
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --panneau: clamp(400px, 36vw, 560px);
  --historique: 420px;
  --marge: clamp(16px, 3vw, 32px);
  --ombre: 0 1px 2px rgba(0, 0, 0, .08);
  color-scheme: light;
}
html[data-theme="sombre"] {
  --fond: #101010;
  --surface: #171717;
  --surface-2: #242424;
  --trait: #343434;
  --texte: #f2f2f2;
  --texte-2: #b5b5b5;
  --texte-3: #8d8d8d;
  --os: #f2f2f2;
  --os-icone: #111111;
  --survol: #d4d4d4;
  --glace: rgba(16, 16, 16, .92);
  --glace-forte: rgba(16, 16, 16, .9);
  --glace-carte: rgba(23, 23, 23, .92);
  --papier: #ffffff;
  --marque: #f2f2f2;
  --tag: #9a9a9a;
  --rouge-fond: #3a2222;
  --rouge-bord: #6a3838;
  --rouge: #ff8a80;
  --orange: #ffab91;
  --vert: #a5d6a7;
  --ombre-dialogue: 0 24px 80px rgba(0, 0, 0, .55);
  --ombre: 0 1px 2px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--fond); color: var(--texte); font: 16px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; padding: 0; }
input, select { font: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--texte); outline-offset: 3px; border-radius: 8px; }

/* ---------- fond : filaments (canvas) */
/* Boucle continue, indépendante du clic et du survol. */
.filaments { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

.app { height: 100dvh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; position: relative; z-index: 1; }
.corps, .haut, .identification { position: relative; z-index: 1; }
.identification-ouverte .corps, .identification-ouverte .haut { display: none; }

/* ---------- boutons communs */
.bouton-plein { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; background: var(--texte); color: var(--fond); font-weight: 600; font-size: 14px; }
.bouton-plein:hover { background: var(--survol); }
.bouton-plein svg { width: 18px; height: 18px; }
.bouton-trait { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--trait); background: var(--surface); font-weight: 500; font-size: 14px; }
.bouton-trait:hover { border-color: var(--texte-2); }
.pastille { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--trait); background: var(--surface); font-size: 14px; font-weight: 500; }
.pastille:hover { border-color: var(--texte-2); }
.pastille svg { width: 16px; height: 16px; }
.pastille.grande { height: 44px; padding: 0 18px; border-radius: 22px; }
.pastille-nb { font-family: var(--mono); font-size: 12px; color: var(--texte-2); }

/* ---------- écran d'identification */
.identification { position: fixed; inset: 0; z-index: 50; background: transparent; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.identification-contenu { position: relative; z-index: 1; width: 100%; max-width: 380px; text-align: center; padding: 32px 24px; border-radius: 16px; background: var(--glace-carte); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#b-theme-id { position: absolute; top: 12px; right: 12px; }
.identification h1 { font-size: 24px; font-weight: 700; letter-spacing: .16em; margin: 0 0 8px; }
.identification-sous { color: var(--texte-2); font-size: 15px; margin: 0 0 32px; }
.identification .champ { text-align: left; margin-bottom: 16px; }
.identification label { display: block; font-size: 13px; font-weight: 600; color: var(--texte-2); margin-bottom: 6px; }
.identification .optionnel { font-weight: 400; color: var(--texte-2); }
.identification input { width: 100%; height: 48px; border-radius: 10px; border: 1px solid var(--trait); background: var(--surface); color: var(--texte); padding: 0 14px; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.identification input::placeholder { color: var(--texte-3); }
.identification input:focus { outline: none; border-color: var(--texte-2); box-shadow: 0 0 0 3px var(--surface-2); }
#tech-matricule { font-family: var(--mono); letter-spacing: .04em; }
.identification-valider { width: 100%; height: 52px; border-radius: 10px; background: var(--texte); color: var(--fond); font-weight: 600; font-size: 16px; margin-top: 8px; }
.identification-valider:hover { background: var(--survol); }

/* ---------- barre haute */
.haut { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px var(--marge); padding-top: max(12px, env(safe-area-inset-top)); min-height: 68px; border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; }
.app:not(.repos) .haut { border-color: var(--trait); background: var(--glace-forte); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.haut-gauche { display: flex; align-items: center; gap: 12px; }
.marque { display: inline-flex; color: var(--marque); }
/* logo officiel : ecrou + AERO (trace) + ASSIST + sous-titre, proportions du fichier source */
.lockup { display: inline-flex; align-items: center; gap: .7em; color: var(--marque); font-family: Inter, "Segoe UI", sans-serif; line-height: 1; }
.lk-ecrou { width: 2.43em; height: 2.43em; flex: none; }
.lk-texte { display: flex; flex-direction: column; gap: .3em; align-items: flex-start; }
.lk-mot { letter-spacing: .2em; white-space: nowrap; }
.lk-aero { display: inline-block; height: .757em; width: 2.1em; overflow: visible; vertical-align: -.02em; margin-right: .2em; }
.lk-assist { font-weight: 500; letter-spacing: .06em; font-size: .913em; }
.lk-tag { font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace; font-size: .26em; letter-spacing: .24em; text-transform: uppercase; color: var(--tag); }
.lockup svg { fill: none; stroke: none; }
.lk-aero path, .lk-ecrou path { fill: currentColor; }
.lk-ecrou polygon { fill: none; stroke: currentColor; stroke-width: 4; stroke-linejoin: round; }
.lockup-grand { font-size: 30px; }
.lockup-petit { font-size: 15px; }
.lockup-petit .lk-ecrou { width: 1.9em; height: 1.9em; }
.titre-logo { margin: 0 0 22px; display: flex; justify-content: center; }
.haut-droite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
@keyframes clignote { 50% { opacity: .25; } }
.lien { font-size: 14px; color: var(--texte-2); text-decoration: underline; text-decoration-color: var(--trait); text-underline-offset: 4px; min-height: 44px; }
.lien:hover { color: var(--texte); text-decoration-color: var(--texte-2); }
.profil { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 4px; border-radius: 18px; border: 1px solid var(--trait); background: var(--surface); font-size: 13px; font-weight: 500; }
.profil:hover { border-color: var(--texte-2); }
.profil:empty, .profil:has(.initiales:empty) { display: none; }
.initiales { width: 28px; height: 28px; border-radius: 14px; background: var(--texte); color: var(--fond); display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.repos #b-sources, .repos #b-raccrocher { display: none; }

/* ---------- scène */
.corps { position: relative; display: grid; grid-template-rows: 1fr auto auto; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.scene { grid-row: 1; position: relative; overflow: hidden; display: grid; grid-template-rows: 1fr; justify-items: center; min-height: 0; }
.dossier-courant { position: absolute; z-index: 2; top: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; max-width: min(720px, calc(100% - 2 * var(--marge))); margin: 0; padding: 4px 10px; border-radius: 8px; background: var(--glace); font-size: 12px; line-height: 1.35; color: var(--texte-2); }
.dossier-courant #dossier-uuid { font-family: var(--mono); font-size: 12px; color: var(--texte); user-select: all; overflow-wrap: anywhere; }
.sous-titre { grid-row: 2; }
.zone-saisie { grid-row: 3; }
.repos .scene { place-items: center; }
.repos .journal { display: none; }

/* ---------- écran de repos */
.centre-repos { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 20px; text-align: center; }
.app:not(.repos) .centre-repos { display: none; }
.bouton-repos { --taille: clamp(150px, 34vmin, 200px); position: relative; width: var(--taille); height: var(--taille); border-radius: 50%; display: grid; place-items: center;
  background: var(--os); color: var(--os-icone); transition: transform .15s; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.bouton-repos:hover { transform: scale(1.02); }
.bouton-repos:active { transform: scale(.97); }
.bouton-repos svg { width: 34%; height: 34%; stroke-width: 1.6; }
.bouton-repos::after { content: ""; position: absolute; inset: -18px; border-radius: 50%; border: 1px solid var(--trait); }
.repos-texte { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.repos-titre { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.repos-aide { margin: 0; max-width: 300px; font-size: 15px; color: var(--texte-2); }
.repos-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------- journal de la conversation */
.journal { list-style: none; width: min(720px, calc(100% - 2 * var(--marge))); margin: 0; padding: 24px 0 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 28px; mask-image: linear-gradient(to bottom, transparent 0, #000 32px); }
.journal > li { width: 100%; margin: 0; animation: entree .3s ease; }
.journal > li:first-child { margin-top: auto; }
@keyframes entree { from { opacity: 0; transform: translateY(8px); } }
.qui { display: block; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--texte-2); margin-bottom: 6px; }
.qui b { color: var(--texte); font-weight: 700; }
.tech .texte { color: var(--texte-2); font-size: 17px; }
.tech .texte p { margin: 0; }
.agent .texte { font-size: 17.5px; line-height: 1.6; }
.agent .texte p { margin: 0 0 8px; } .agent .texte p:last-child { margin: 0; }
.agent .texte ul, .agent .texte ol { margin: 0 0 8px; padding-left: 22px; }
.agent .texte li + li { margin-top: 4px; }
.agent .texte h3 { font-size: 16px; margin: 4px 0; }
.agent .texte code { font-family: var(--mono); font-size: 15px; }
.agent .texte .tableau { overflow-x: auto; margin: 6px 0 10px; }
.agent .texte table { border-collapse: collapse; font-size: 14.5px; min-width: 100%; }
.agent .texte th, .agent .texte td { border-bottom: 1px solid var(--trait); padding: 6px 10px 6px 0; text-align: left; vertical-align: top; }
.agent .texte th { color: var(--texte-2); font-weight: 600; }
.agent.erreur .texte { color: var(--texte-2); font-style: italic; }
.agent.erreur .reessayer { margin-top: 8px; height: 40px; padding: 0 14px; border-radius: 8px; background: var(--texte); color: var(--fond); font-size: 14px; font-weight: 600; font-style: normal; }
.agent.attente .texte { color: var(--texte-2); }
.charge-reponse { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 28px; font-size: 15px; }
.charge-points { display: inline-flex; align-items: center; gap: 4px; }
.charge-points i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: charge-point 1.1s ease-in-out infinite; }
.charge-points i:nth-child(2) { animation-delay: .15s; }
.charge-points i:nth-child(3) { animation-delay: .3s; }
@keyframes charge-point { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- fiabilité : provenance de la réponse et valeurs vérifiées */
.fiabilite { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.fiab-ligne { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; line-height: 1.45; color: var(--texte-2); }
.fiab-ligne svg { width: 16px; height: 16px; margin-top: 2px; }
.fiab-modele { color: var(--texte); }
.fiab-secours { color: var(--texte); font-style: italic; }
.fiab-alerte { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--texte); color: var(--texte); }
.fiab-valeur { display: inline-block; font-family: var(--mono); font-size: 12px; padding: 0 6px; border-radius: 4px; background: var(--surface-2); color: var(--texte); margin: 1px 0; }
.sources-question .carte { border-style: dashed; }

/* ---------- extraits sous la réponse : cartes */
.sources { margin-top: 14px; }
.sources-titre { display: block; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--texte-2); margin-bottom: 8px; }
.sources-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.carte { display: flex; gap: 10px; align-items: flex-start; padding: 10px; min-height: 64px; border-radius: 10px; border: 1px solid var(--trait); background: var(--surface); text-align: left; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.carte:hover { border-color: var(--texte-2); }
.carte[aria-current="true"] { border-color: var(--texte); box-shadow: 0 0 0 1px var(--texte); }
.carte-vignette { flex: none; width: 44px; height: 56px; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--trait); overflow: hidden; }
.carte-vignette img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.carte-texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.carte-ref { font-family: var(--mono); font-size: 11px; color: var(--texte-2); overflow-wrap: anywhere; }
.carte-titre { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carte-type { font-size: 12px; color: var(--texte-2); }
/* ---------- zone de saisie : une barre, comme un champ de conversation */
.zone-saisie { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px var(--marge) 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: var(--glace); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.zone-saisie > * { width: min(720px, 100%); margin: 0; }
.repos .zone-saisie { display: none; }
.statut { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding-left: 16px; font-size: 13px; color: var(--texte-2); min-height: 1.4em; }
.statut-point { width: 7px; height: 7px; border-radius: 4px; background: var(--texte-3); }
.app[data-etat="ecoute"] .statut-point, .app[data-etat="parole"] .statut-point { background: var(--texte); animation: clignote 1.4s ease-in-out infinite; }
.app[data-etat="reflexion"] .statut-point { background: transparent; border: 2px solid var(--trait); border-top-color: var(--texte); animation: tour 1s linear infinite; }
label.voix { display: inline-flex; align-items: center; }
.voix select { font-size: 13px; color: var(--texte); background: transparent; border: 1px solid var(--trait); border-radius: 18px; height: 36px; width: 158px; max-width: 34vw; padding: 0 10px; }
.voix select:hover { border-color: var(--texte-2); }
.voix select:focus { outline: none; border-color: var(--texte); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.composer { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 6px 8px 6px 6px; border: 1px solid var(--trait); border-radius: 26px; background: var(--surface); }
.composer:focus-within { border-color: var(--texte-2); }
.composer-ico { width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; color: var(--texte-2); background: transparent; flex: none; }
.composer-ico:hover { background: var(--surface-2); color: var(--texte); }
.composer-ico svg { width: 18px; height: 18px; }
.ico-plus, .ico-micro-off, .voix-fin { display: none; }
#bouton[aria-pressed="true"] .ico-micro { display: none; }
#bouton[aria-pressed="true"] .ico-micro-off { display: block; }
.composer-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.clavier { display: flex; flex: 1; min-width: 0; }
.clavier input { flex: 1; min-width: 0; height: 40px; border: none; background: transparent; color: var(--texte); padding: 0 8px; font-size: 16px; }
.clavier input::placeholder { color: var(--texte-3); }
.clavier input:focus { outline: none; }
.clavier[hidden] ~ .composer-actions .composer-envoyer { display: none; }
.raccourcis { display: none; margin: 0 auto; font-size: 13px; color: var(--texte-2); text-align: center; }
.app.source-ouverte .raccourcis { display: block; }

/* ---------- FAB (bouton micro) */
.fab { --taille: 64px; --niveau: 0; position: relative; width: var(--taille); height: var(--taille); border-radius: 50%; display: grid; place-items: center;
  background: var(--os); color: var(--os-icone); transition: background .25s, width .35s, height .35s, transform .15s; flex-shrink: 0; }
.fab:active { transform: scale(.97); }
.fab svg { width: 26px; height: 26px; stroke-width: 1.6; position: relative; }
.ico-stop { display: none; }
.anneau { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; transform: scale(calc(1 + var(--niveau) * .35)); transition: transform .08s linear, opacity .2s; pointer-events: none; }
.arc { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--texte); opacity: 0; pointer-events: none; }
/* États lus par le mouvement et par le texte du statut :
   écoute = l'anneau suit la voix ; vérification = arc qui tourne ; réponse = ondes qui respirent. */
.app[data-etat="ecoute"] .anneau { opacity: .35; color: var(--texte); }
.app[data-etat="ecoute"] .fab { --taille: 72px; }
.app[data-etat="reflexion"] .fab { background: var(--surface); color: var(--texte-2); box-shadow: inset 0 0 0 1px var(--trait); }
.app[data-etat="reflexion"] .arc { opacity: 1; animation: tour 1.1s linear infinite; }
@keyframes tour { to { transform: rotate(360deg); } }
.app[data-etat="parole"] .ico-micro { display: none; }
.app[data-etat="parole"] .ico-stop { display: block; fill: currentColor; stroke: none; width: 28px; height: 28px; }
.app[data-etat="parole"] .anneau { opacity: .25; color: var(--texte); animation: respire 1.8s ease-in-out infinite; }
.app[data-etat="parole"] .fab::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--texte); opacity: 0; animation: onde 1.8s ease-out infinite .9s; }
.app[data-utilisateur="1"] .anneau { opacity: .5; animation: none; transform: scale(calc(1 + var(--niveau) * .4)); }
.app[data-utilisateur="1"] .fab { --taille: 72px; }
.app[data-utilisateur="1"][data-etat="parole"] .ico-stop { display: none; }
.app[data-utilisateur="1"][data-etat="parole"] .ico-micro { display: block; }
@keyframes respire { 50% { transform: scale(1.1); } }
@keyframes onde { from { opacity: .3; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }

.sous-titre { margin: 0; max-width: 640px; justify-self: center; text-align: center; color: var(--texte); font-size: 15px; min-height: 0; padding: 0 20px; }
.sous-titre:not(:empty) { padding: 0 20px 8px; }
.repos .sous-titre { display: none; }

/* ---------- boutons ronds */
.rond { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--texte); transition: background .15s; }
.rond:hover { background: var(--trait); }
.rond svg { width: 20px; height: 20px; }
.rond.petit { width: 40px; height: 40px; }
.rond.petit svg { width: 18px; height: 18px; }
.theme .ico-soleil { display: none; }
html[data-theme="sombre"] .theme .ico-lune { display: none; }
html[data-theme="sombre"] .theme .ico-soleil { display: block; }
.theme-voix { display: none; }
.app.voix .theme-voix { display: grid; }
.raccrocher { color: var(--texte); }
.raccrocher:hover { background: var(--texte); color: var(--fond); }
.composer .fab,
.app[data-etat="ecoute"] .composer .fab,
.app[data-utilisateur="1"] .composer .fab { --taille: 36px; background: transparent; color: var(--texte); }
.app[data-etat="ecoute"] .composer .fab { background: var(--texte); color: var(--fond); }
.composer .fab svg, .app[data-etat="parole"] .composer .ico-stop { width: 18px; height: 18px; }
.app[data-etat="parole"] .composer .ico-micro { display: block; }
.app[data-etat="parole"] .composer .ico-stop { display: none; }
.composer .anneau { inset: -3px; }
.raccrocher svg { fill: currentColor; stroke: none; width: 22px; height: 22px; }
#b-hp .hp-off, #b-hp[aria-pressed="false"] .hp-on { display: none; }
#b-hp[aria-pressed="false"] .hp-off { display: block; }
#b-hp[aria-pressed="false"] { color: var(--texte-2); }
#b-historique[aria-expanded="true"] { background: var(--texte); color: var(--fond); }
#b-clavier[aria-pressed="true"] { background: var(--surface-2); color: var(--texte); }

/* ---------- panneau source (extraits) */
.panneau { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--surface); border-left: 1px solid var(--trait); }
.poignee { display: none; }
.panneau-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--trait); }
.p-defile { display: flex; align-items: center; gap: 4px; }
.p-compteur { min-width: 104px; text-align: center; font-size: 13px; color: var(--texte-2); }
.p-compteur b { color: var(--texte); }
.p-retour { display: none; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--texte); color: var(--fond); font-weight: 600; font-size: 14px; }
.panneau-entete { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px 12px; }
.surtitre { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--texte-2); }
.panneau h2 { font-size: 18px; line-height: 1.35; margin: 0; font-weight: 600; }
.p-meta { margin: 0; font-family: var(--mono); font-size: 12.5px; color: var(--texte-2); overflow-wrap: anywhere; }
.p-meta .externe { font-style: italic; }
.p-externe { display: flex; gap: 10px; align-items: flex-start; margin: 0 20px 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--texte); font-size: 13.5px; line-height: 1.45; }
.p-externe svg { width: 18px; height: 18px; margin-top: 1px; }
.p-outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 0 20px 12px; }
.segment { display: inline-flex; padding: 4px; border-radius: 10px; background: var(--surface-2); }
.segment button { height: 32px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--texte-2); }
.segment button[aria-selected="true"] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); }
.p-seule { font-size: 13px; color: var(--texte-2); }
.zoom { display: inline-flex; gap: 4px; }
.zoom button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--trait); background: var(--surface); }
.zoom button:hover:not(:disabled) { border-color: var(--texte-2); }
.zoom button:disabled { opacity: .4; cursor: default; }
.zoom svg { width: 16px; height: 16px; }
.zoom .z-valeur { width: auto; min-width: 64px; padding: 0 8px; font-family: var(--mono); font-size: 12.5px; }
.p-image { position: relative; flex: 1; min-height: 0; overflow: auto; margin: 0 20px; border-radius: 8px; background: var(--surface-2); padding: 12px; overscroll-behavior: contain; }
.p-image img { display: block; width: calc(var(--zoom, 1) * 100%); max-width: none; height: auto; background: var(--papier); border-radius: 3px; cursor: zoom-in; box-shadow: var(--ombre); }
.vue-source:has(.p-image[data-etat="erreur"]) #p-agrandir,
.vue-source:has(.p-image[data-etat="charge"]) #p-agrandir { display: none; }
.p-image[data-zoom="max"] img { cursor: zoom-out; }
.p-chargement, .p-erreur { display: none; }
.p-image[data-etat="charge"] img { visibility: hidden; position: absolute; }
.p-image[data-etat="charge"] .p-chargement { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--papier); border-radius: 3px; min-height: 240px; }
.p-chargement span { height: 9px; border-radius: 3px; background: var(--surface-2); animation: clignote 1.4s ease-in-out infinite; }
.p-chargement span:nth-child(1) { width: 50%; height: 12px; } .p-chargement span:nth-child(2) { width: 92%; } .p-chargement span:nth-child(3) { width: 84%; } .p-chargement span:nth-child(4) { width: 88%; } .p-chargement span:nth-child(5) { width: 60%; }
.p-image[data-etat="erreur"] img { display: none; }
.p-image[data-etat="erreur"] .p-erreur { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 240px; height: 100%; text-align: center; padding: 20px; }
.p-erreur svg { width: 32px; height: 32px; color: var(--texte-2); }
.p-erreur p { margin: 0; font-size: 14px; }
.p-erreur-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.p-note { font-size: 12px; line-height: 1.5; color: var(--texte-2); margin: 10px 20px 16px; }
.lecture { width: min(1120px, calc(100vw - 32px)); height: min(920px, calc(100dvh - 32px)); margin: auto; padding: 0; border: 1px solid var(--trait); border-radius: 16px; background: var(--surface); color: var(--texte); box-shadow: var(--ombre-dialogue); }
.lecture[open] { display: flex; flex-direction: column; }
.lecture::backdrop { background: rgba(17, 17, 17, .46); }
.lecture-barre { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 16px 4px 20px; }
.lecture-titres { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lecture-titres h2 { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 600; }
.lecture-nav { display: flex; align-items: center; gap: 4px; flex: none; }
.lecture-outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 20px 12px; }
.lecture-cadre { flex: 1; min-height: 0; overflow: auto; margin: 0 16px 16px; border-radius: 8px; background: var(--surface-2); padding: 12px; }
.lecture-cadre img { display: block; width: calc(var(--zoom, 1) * 100%); max-width: none; height: auto; background: var(--papier); border-radius: 3px; box-shadow: var(--ombre); }
.vue-source { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.vue-stats { display: none; }
.app.stats-ouverte .vue-source, .app.stats-ouverte .p-defile { display: none; }
.app.stats-ouverte .vue-stats { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; }
.stats-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; }
.stats-entete h2 { font-size: 22px; line-height: 1.25; }
.stats-maj { margin: 4px 0 0; font-size: 13px; color: var(--texte-2); }
.stats-erreur { margin: 0 20px 12px; padding: 12px 14px; border: 1px solid var(--trait); border-radius: 10px; font-size: 15px; }
.stats-synthese { margin: 0 20px 14px; font-size: 16px; line-height: 1.45; }
.stats-cartes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 20px 12px; }
.stats-carte { display: flex; flex-direction: column; gap: 4px; min-height: 118px; padding: 14px 14px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--trait); min-width: 0; }
.stats-carte .stats-k { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; line-height: 1.3; color: var(--texte-2); }
.stats-carte .stats-point { width: 6px; height: 6px; border-radius: 50%; background: var(--texte-3); flex: none; }
.stats-carte b { font-size: 30px; line-height: 1; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats-carte small { margin-top: auto; font-size: 12.5px; line-height: 1.35; color: var(--texte-2); }
.stats-carte[data-statut="rouge"] { background: var(--rouge-fond); border-color: var(--rouge-bord); }
.stats-carte[data-statut="rouge"] .stats-point { background: var(--rouge); }
.stats-carte[data-statut="rouge"] .stats-k,
.stats-carte[data-statut="rouge"] b,
.stats-carte[data-statut="rouge"] small,
.statut-rouge { color: var(--rouge); }
.stats-carte[data-statut="orange"] .stats-point { background: var(--orange); }
.stats-carte[data-statut="orange"] b, .statut-orange { color: var(--orange); }
.stats-carte[data-statut="vert"] .stats-point { background: var(--vert); }
.stats-carte[data-statut="vert"] b, .statut-vert { color: var(--vert); }
.stats-valeur[data-statut="rouge"] { color: var(--rouge); }
.stats-valeur[data-statut="orange"] { color: var(--orange); }
.stats-valeur[data-statut="vert"] { color: var(--vert); }
.stats-bloc { padding: 14px 20px 0; }
.stats-bloc h3, .stats-rubrique h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-2); }
.stats-fait { margin: 0 0 4px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.stats-phrase { margin: 0; font-size: 14px; line-height: 1.4; color: var(--texte-2); text-align: right; }
.stats-barres { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.stats-barres li { display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.stats-nom { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.stats-piste { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.stats-plein { display: block; height: 100%; border-radius: 4px; background: var(--texte); }
.stats-nb { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.stats-liste { list-style: none; margin: 0; padding: 0 0 4px; display: flex; flex-direction: column; gap: 14px; }
#stats-liste { margin: 8px 0 0; padding: 8px 20px 12px; }
.stats-liste li { display: flex; flex-direction: column; gap: 3px; }
.stats-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.stats-ligne.phrase { flex-direction: column; align-items: flex-start; gap: 2px; }
.stats-ligne.phrase .stats-phrase { text-align: left; }
.stats-valeur { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-expl, .stats-source { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--texte-2); }
#b-stats-repos[aria-expanded="true"] { background: var(--texte); color: var(--fond); border-color: var(--texte); }

/* ---------- historique des dossiers */
.historique { position: fixed; top: 0; left: 0; bottom: 0; z-index: 40; width: min(var(--historique), 88vw); display: flex; flex-direction: column; gap: 12px; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); background: var(--surface); border-right: 1px solid var(--trait);
  transform: translateX(-105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 20px 0 60px rgba(0, 0, 0, .12); }
.app.historique-ouvert .historique { transform: none; }
.historique-entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.h-entete-actions { display: flex; align-items: center; gap: 4px; }
.historique h2 { margin: 0; font-size: 18px; font-weight: 600; }
.h-nouveau { width: 100%; }
#h-chercher[aria-expanded="true"] { background: var(--surface-2); color: var(--texte); }
.h-recherche { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); color: var(--texte-2); }
.h-recherche input { flex: 1; width: 100%; min-width: 0; border: none; background: none; color: var(--texte); font-size: 14px; }
.h-recherche input::placeholder { color: var(--texte-2); }
.h-recherche input:focus { outline: none; }
.h-recherche:focus-within { box-shadow: inset 0 0 0 1px var(--texte-2); }
.h-liste { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; padding: 0 8px; }
.h-groupe { margin: 10px 0 4px 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--texte-2); }
.h-ligne { position: relative; display: flex; align-items: center; border-radius: 10px; }
.h-ligne:hover, .h-ligne:focus-within { background: var(--surface-2); }
.h-ouvrir { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px; text-align: left; border-radius: 10px; min-height: 52px; }
.h-ligne[aria-current="true"] .h-ouvrir { padding-left: 22px; }
.h-ligne[aria-current="true"] .h-ouvrir::before { content: ""; position: absolute; left: 10px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: var(--texte); }
.h-ligne[aria-current="true"] .h-titre { font-weight: 600; }
.h-titre { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-detail { font-size: 12px; color: var(--texte-2); }
.h-id { font-family: var(--mono); font-size: 11px; line-height: 1.35; color: var(--texte-2); overflow-wrap: anywhere; user-select: all; }
.h-ligne[aria-current="true"] .h-id { color: var(--texte); }
.h-renommer, .h-supprimer { flex: none; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--texte-2); }
.h-supprimer { margin-right: 6px; }
.h-renommer:hover, .h-supprimer:hover { color: var(--texte); background: var(--trait); }
.h-renommer svg, .h-supprimer svg { width: 16px; height: 16px; }
.h-renommer-champ { width: 100%; min-width: 0; height: 28px; margin: 0; padding: 0 2px; border: none; border-bottom: 1px solid var(--texte); border-radius: 0; background: transparent; color: var(--texte); font: inherit; font-size: 14px; font-weight: 500; }
.h-renommer-champ:focus { outline: none; }
.h-effacer { align-self: flex-start; min-height: 36px; font-size: 13px; }
.voile { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .45); }
.historique-ouvert .voile { z-index: 35; }

/* poste fixe : panneau source à côté de la conversation */
@media (min-width: 1100px) {
  .panneau { display: none; }
  .app.source-ouverte .corps { grid-template-columns: minmax(0, 1fr) var(--panneau); }
  .app.source-ouverte .panneau { display: flex; grid-column: 2; grid-row: 1 / span 3; animation: glisse .25s ease; }
  .app.source-ouverte .scene, .app.source-ouverte .zone-saisie, .app.source-ouverte .sous-titre { grid-column: 1; }
  @keyframes glisse { from { opacity: 0; transform: translateX(20px); } }
}
/* tablette et téléphone : feuille par-dessus */
@media (max-width: 1099.98px) {
  .panneau { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(560px, 88vw); transform: translateX(105%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: -20px 0 60px rgba(0, 0, 0, .25);
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .app.source-ouverte .panneau { transform: none; }
}
@media (max-width: 640px) {
  .panneau { top: auto; left: 0; width: 100vw; height: calc(100dvh - 56px); border-left: none; border-radius: 20px 20px 0 0; transform: translateY(105%); }
  .lecture { width: 100vw; height: 100dvh; max-height: 100dvh; border: none; border-radius: 0; }
  .lecture-titres h2 { font-size: 16px; }
  .poignee { display: block; align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--trait); margin-top: 8px; }
  .panneau-nav { border-bottom: none; padding: 6px 16px; }
  .p-fermer { display: none; }
  .p-retour { display: inline-flex; align-items: center; }
  .panneau-entete { padding-top: 4px; }
  .agent .texte { font-size: 16.5px; }
  .sources-grille { grid-template-columns: 1fr; }
  .haut .lockup-petit .lk-texte { display: none; }
  .haut, .haut-droite { flex-wrap: nowrap; }
  .haut-droite { gap: 8px; }
  #b-sources > span[data-i18n] { display: none; }
  .profil-nom { display: none; }
  .profil { padding: 0 4px; }
  .voix select { width: 112px; }
}
/* ---------- mode voix : même fond, mêmes couleurs, orbe au centre */
.app.voix { display: grid; width: 100%; background: transparent; grid-template-rows: 1fr; }
body.voix { display: block; width: 100%; }
.app.voix .corps { height: 100%; width: 100%; min-height: 0; }
.app.voix .scene, .app.voix .zone-saisie { width: 100%; }
.app.voix .composer { width: min(720px, 100%); }
.app.voix .haut { display: none; }
.app.voix .statut, .app.voix .raccourcis, .app.voix #b-hp, .app.voix .composer-envoyer { display: none; }
.app.voix .zone-saisie { background: transparent; }
.app.voix .composer { background: var(--glace); }
.app.voix .ico-clavier { display: none; }
.app.voix .ico-plus { display: block; }
.app.voix .sous-titre { color: var(--texte); }
.app.voix .voix-fin { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--texte); color: var(--fond); flex: none; }
.app.voix .voix-fin:hover { background: var(--survol); }
.app.voix .voix-fin svg { width: 16px; height: 16px; stroke-width: 2.2; }
.app.voix .composer .fab,
.app.voix[data-etat="ecoute"] .composer .fab,
.app.voix[data-utilisateur="1"] .composer .fab { --taille: 36px; background: transparent; color: var(--texte); }
.app.voix .composer .anneau, .app.voix .composer .arc { display: none; }
.app.voix .ico-stop { display: none; }
.app.voix[data-etat="parole"] .composer .ico-micro,
.app.voix[data-etat="parole"] .composer .ico-micro-off { display: none; }
.app.voix[data-etat="parole"] .composer .fab { background: var(--texte); color: var(--fond); }
.app.voix[data-etat="parole"] .composer .ico-stop { display: block; fill: currentColor; stroke: none; width: 14px; height: 14px; }
.orbe { display: none; }
.app.voix:not(:has(#journal > li)) .orbe { display: grid; place-items: center; position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.app.voix .journal, .app.voix .zone-saisie, .app.voix .sous-titre { position: relative; z-index: 1; }
.orbe-lueur, .orbe-coeur, .orbe-reflet { grid-area: 1 / 1; }
.orbe-lueur { width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(17, 17, 17, .14), transparent 68%); filter: blur(8px); }
.orbe-coeur { width: 148px; height: 148px; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #fff 0 12%, transparent 28%),
    radial-gradient(circle at 50% 55%, #3a3a3a 0 30%, #111 72%);
  box-shadow: 0 16px 40px rgba(17, 17, 17, .16);
  animation: orbe-vie 3.4s ease-in-out infinite;
}
.orbe-reflet { width: 72px; height: 52px; border-radius: 50%; align-self: center; justify-self: center; transform: translate(-18px, -24px);
  background: radial-gradient(circle, rgba(255, 255, 255, .9), transparent 70%); filter: blur(6px); animation: orbe-reflet 4.6s ease-in-out infinite; }
html[data-theme="sombre"] .orbe-lueur { background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 68%); }
html[data-theme="sombre"] .orbe-coeur {
  background:
    radial-gradient(circle at 34% 30%, #fff 0 12%, transparent 28%),
    radial-gradient(circle at 50% 55%, #d0d0d0 0 30%, #f4f4f4 72%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.app.voix[data-etat="parole"] .orbe-coeur { animation-duration: 1.5s; }
.app.voix[data-etat="ecoute"] .orbe-coeur { transform: scale(calc(1 + var(--niveau, 0) * .12)); }
.app.voix[data-utilisateur="1"] .orbe-coeur { transform: scale(calc(1.04 + var(--niveau, 0) * .2)); }
@keyframes orbe-vie { 50% { transform: scale(1.05); } }
@keyframes orbe-reflet { 50% { transform: translate(-10px, -16px) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
