/*
 * Toutes les couleurs et tous les espacements du projet vivent ici. Aucune
 * valeur en dur ailleurs : c'est ce qui garde la console cohérente sans
 * framework ni design system.
 *
 * Les jetons reprennent le système visuel du prototype Yelda (yelda-prototype/
 * assets/styles.css) : top bar bleue, sidebar sur canvas clair, grandes
 * surfaces blanches à sections filetées, pilules de statut à fond doux.
 */
:root {
  /* Lot DB1. Les cinq classes d'issue, dans cet ordre fixe : la couleur suit la
     classe, jamais son rang. Aucune teinte nouvelle — des jetons existants. */
  --issue-resolved: var(--ok);
  --issue-routed: var(--blue);
  --issue-unidentified: var(--stage-tts);
  --issue-abandoned: var(--danger);
  --issue-other: var(--violet);
  /* La période précédente et les paliers de l'entonnoir, sur les mêmes jetons. */
  --db-prev: var(--border-strong);
  --db-funnel-mid: var(--stage-llm2);
  --db-funnel-high: var(--blue-dark);
  --usage-voice: var(--blue);
  --usage-text: var(--ok);
  --usage-demo: var(--amber);
  --usage-architect: var(--cyan);
  --usage-test: var(--blue-deep);
  --usage-ingest: var(--violet);
  --usage-phone_lines: var(--neutral);
  /* Architect mark and contextual focus. */
  --cyan: #17a8ba;
  /* Lot AU1. La marque de l'Architect (architect-mark.js) : l'exception
     documentée au « pas de couleur nouvelle ». Les arrêts du dégradé du glyphe
     et de ceux de la tuile — un dégradé de marque, jamais un fond. */
  --arch-mark-0: #17a8ba;
  --arch-mark-1: #2f6ded;
  --arch-mark-2: #2450c4;
  --arch-tile-0: #22b4cc;
  --arch-tile-1: #2f6ded;
  --arch-tile-2: #2a50c8;
  /* Utilise par .tl-kind.api depuis le lot T8 sans avoir jamais ete defini. */
  --cyan-bg: #e3f4f6;
  --blue-deep: #21489c;
  /* Marque */
  --blue: #2f6ded;
  --blue-dark: #2558c9;
  --blue-soft: #eaf1fe;
  --blue-line: #c7dbfb;

  /* Le violet est la couleur du RAG sur toute la page d'un appel : la phrase
     d'attente dans le fil, l'étage de recherche dans le waterfall. Une seule
     teinte, déclarée une seule fois. */
  --violet: #6b4bc8;
  --violet-bg: #f3effc;
  --violet-line: #ddd2f4;

  /* Canvas et surfaces */
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #fafcff;
  --track: #eef2f7;
  --hover: #f0f4fa;
  --border: #e4eaf1;
  --border-strong: #c7d4e4;

  /* Texte */
  --text: #33475b;
  --text-sec: #7c8fa4;
  --text-faint: #9aabbd;

  /* Accent (alias, pour les composants génériques) */
  --accent: var(--blue);
  --accent-hover: var(--blue-dark);
  --on-accent: #ffffff;

  /* Encres et fonds d'état */
  --ok: #1a7f52;
  --ok-bg: #e9f5ef;
  --warn: #9a6a12;
  --warn-bg: #fdf3e2;
  --warn-line: #f0d6a0;
  --danger: #b23b2e;
  --danger-bg: #fbeae7;
  --danger-line: #f0c4bd;
  --danger-hover: #9a3226;
  --neutral: #94a3b8;
  --amber: #f59e0b;

  /* Encodage des étages d'un tour, au même titre que les classes .chart-*.
     Cinq teintes distinctes sont nécessaires pour cinq étages ; elles ne
     servent à rien d'autre, et aucune n'apparaît en dur dans un composant. */
  --stage-detect: var(--blue);
  --stage-retrieval: var(--violet);
  --stage-llm2: #7aa9f7;
  --stage-sentence: var(--ok);
  --stage-tts: #b8790a; /* var(--amber) assombri, pour du texte blanc */
  --stage-speech: var(--border-strong);
  --stage-remainder: var(--neutral);
  --ink-dark: #1a1a2e;

  /* Espacements */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Formes */
  --radius: 12px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --panel-shadow: 0 1px 2px rgba(16, 32, 60, 0.04), 0 4px 16px rgba(16, 32, 60, 0.05);
  --pop-shadow: 0 12px 32px rgba(16, 32, 60, 0.18);
  --modal-shadow: 0 24px 60px rgba(16, 32, 60, 0.3);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Chrome */
  --topbar-h: 62px;
  --sidebar-w: 240px;
  --content-max: 1320px;
  --gutter: clamp(16px, 2vw, 40px);
}

/* Architect: persistent chrome, sharing the layout discipline of Chat. */
.architect-drawer { width: 440px; flex: 0 0 440px; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); overflow: hidden; }
.arch-full > .sidebar { display: none; }
/* Lot AU1. Le logo (architect-mark.js) : immobile au repos, tracé une fois
   (am-once), en boucle pendant un tour (am-think). Les classes d'état valent
   sur le SVG ou sur un ancêtre ; am-think est déclaré après am-once pour
   gagner quand les deux s'appliquent (survol du bouton pendant un tour). */
.am-mark { flex: none; display: block; overflow: visible; }
.am-legs, .am-bar { stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.am-once .am-legs { animation: am-once-legs 1.1s ease-out 1 both; }
.am-once .am-bar { animation: am-once-bar 1.1s ease-out 1 both; }
.am-think .am-legs { animation: am-think-legs 2s ease-in-out infinite; }
.am-think .am-bar { animation: am-think-bar 2s ease-in-out infinite; }
@keyframes am-once-legs { 0% { stroke-dashoffset: 1; } 65%, 100% { stroke-dashoffset: 0; } }
@keyframes am-once-bar { 0%, 55% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes am-think-legs { 0% { stroke-dashoffset: 1; } 40%, 72% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@keyframes am-think-bar { 0%, 36% { stroke-dashoffset: 1; } 52%, 72% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@media (prefers-reduced-motion: reduce) {
  .am-once .am-legs, .am-once .am-bar, .am-think .am-legs, .am-think .am-bar { animation: none; stroke-dashoffset: 0; }
}
/* Le bouton de la barre du haut : glyphe blanc fermé, glyphe en dégradé sur fond
   blanc ouvert. Le CSS montre l'un ou l'autre selon aria-pressed. */
.architect-toggle { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 11px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.14); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.architect-toggle:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
.architect-toggle:disabled { opacity: .6; cursor: default; }
.architect-toggle .am-on { display: none; }
.architect-toggle[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22); }
.architect-toggle[aria-pressed='true'] .am-on { display: block; }
.architect-toggle[aria-pressed='true'] .am-off { display: none; }
.arch-head { height: 56px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--border); }
.arch-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; }
.arch-name small { min-width: 0; font-weight: 500; font-size: 12.5px; color: var(--text-sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arch-ib { width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-sec); display: grid; place-items: center; cursor: pointer; }
.arch-ib:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.arch-ib[aria-pressed='true'] { background: var(--track); color: var(--text); }
.arch-ib:disabled { opacity: .45; cursor: default; }
.arch-welcome { display: flex; flex-direction: column; align-items: flex-start; padding: 8vh 4px 0; }
.arch-welcome .am-tile { filter: drop-shadow(0 6px 14px rgba(47, 109, 237, 0.28)); }
.arch-welcome h2 { margin: 16px 0 18px; font-size: 19px; font-weight: 650; line-height: 1.3; }
.arch-welcome h2 span { color: var(--text-sec); font-weight: 500; }
.arch-starters { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.arch-starter { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.arch-starter:hover:not(:disabled) { border-color: var(--blue-line); background: var(--surface-2); }
.arch-starter:disabled { opacity: .55; cursor: default; }
.arch-starter-ic { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--track); display: grid; place-items: center; }
.arch-body { flex: 1; min-height: 0; display: flex; }
.arch-conversation { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.arch-messages { flex: 1; min-height: 0; overflow: auto; padding: 20px 20px 8px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.arch-bubble { line-height: 1.6; overflow-wrap: break-word; font-size: 13px; }
.arch-bubble.user { align-self: flex-end; max-width: 86%; padding: 9px 13px; border-radius: 16px 16px 4px 16px; background: var(--track); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.arch-bubble.system { color: var(--text-sec); background: var(--surface-2); padding: 10px 12px; border-radius: 8px; font-size: 12.5px; }
.architect-md p { margin: 0 0 8px; white-space: pre-wrap; }
.architect-md p:last-child { margin-bottom: 0; }
.architect-md code { font-size: 12px; background: var(--track); border-radius: 3px; padding: 1px 4px; }
.streaming::after { content: '▍'; color: var(--cyan); animation: arch-pulse 1s steps(2) infinite; }
.arch-args { display: grid; grid-template-columns: minmax(60px, auto) minmax(0, 1fr); gap: 4px 10px; margin: 8px 0 0; font-size: 12px; }
.arch-args dt { color: var(--text-sec); }
.arch-args dd { margin: 0; overflow-wrap: break-word; max-height: 80px; overflow: auto; }
.arch-warning { color: var(--warn); font-size: 11px; }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
/* Lot AU2 — le fil en mots. Un tour commence par le glyphe ; le texte de
   l'assistant est du texte courant, sans bulle. */
.arch-turn { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.arch-turn-head { display: flex; align-items: center; min-height: 22px; }
.arch-text { font-size: 13.5px; line-height: 1.62; overflow-wrap: break-word; }
.arch-trail-head { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.arch-trail-btn { display: inline-flex; align-items: center; gap: 4px; margin-left: -4px; padding: 2px 6px; border: 0; border-radius: 6px; background: none; color: var(--text-sec); font: inherit; font-size: 12.5px; cursor: pointer; }
.arch-trail-btn:hover { background: var(--hover); color: var(--text); }
.arch-chev { transition: transform .15s; }
.arch-trail-btn[aria-expanded='true'] .arch-chev { transform: rotate(90deg); }
.arch-steps { position: relative; list-style: none; margin: 4px 0 0; padding: 2px 0 2px 2px; display: flex; flex-direction: column; gap: 2px; }
.arch-steps::before { content: ''; position: absolute; left: 10px; top: 12px; bottom: 12px; width: 1px; background: var(--border); }
.arch-step { position: relative; display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 12.5px; color: var(--text-sec); }
.arch-step-ic { z-index: 1; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--text-sec); }
.arch-step-label { min-width: 0; }
.arch-step b { color: var(--text); font-weight: 600; }
.arch-step.run { color: var(--text); }
.arch-step.run .arch-step-ic { color: var(--blue); }
.arch-step.wait .arch-step-ic { color: var(--warn); }
.arch-step.fail .arch-step-ic { color: var(--danger); }
.arch-step-open { margin-left: auto; font-size: 12px; }
.arch-spin { animation: arch-spin .9s linear infinite; transform-origin: center; }
@keyframes arch-spin { to { transform: rotate(360deg); } }
.arch-tech { margin: 4px 0 0 28px; }
.arch-tech-btn { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--text-faint); font: inherit; font-size: 11.5px; cursor: pointer; }
.arch-tech-btn:hover { color: var(--text-sec); }
.arch-tech-body { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font: 11px/1.55 var(--mono); color: var(--text-sec); }
.arch-tech-step + .arch-tech-step { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.arch-tech-step p { margin: 4px 0 0; white-space: pre-wrap; }
.arch-trail-extras { display: flex; flex-direction: column; gap: 10px; }
.arch-trail-extras:empty { display: none; }
.arch-card-ic { width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--track); display: grid; place-items: center; color: var(--text); }
.arch-change, .arch-result { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.arch-change-head, .arch-result-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 6px; font-size: 13px; }
.arch-change-meta { margin-left: auto; font-size: 12px; color: var(--text-sec); white-space: nowrap; }
.arch-change-main { padding: 2px 12px 10px 50px; font-size: 12.5px; color: var(--text-sec); }
.arch-change-show { padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-size: 12.5px; cursor: pointer; }
.arch-change-body { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow: auto; }
.arch-change-legend { margin: 0; font-size: 11.5px; color: var(--text-faint); }
.arch-change-path { font-size: 12px; color: var(--text); }
.arch-change-foot { display: flex; gap: 14px; padding: 8px 12px 8px 50px; border-top: 1px solid var(--border); font-size: 12.5px; }
.arch-change-foot a { display: inline-flex; align-items: center; gap: 5px; }
.arch-result { padding-bottom: 10px; }
.arch-result .arch-stats { padding: 0 12px; }
.arch-result-link { display: inline-block; margin: 8px 12px 0; font-size: 12.5px; }
.arch-decide { padding: 14px 14px 12px; border: 1px solid var(--warn-line); border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 4px var(--warn-bg); }
.arch-decide-head { display: flex; align-items: flex-start; gap: 11px; }
.arch-decide-ic { width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--warn-bg); color: var(--warn); display: grid; place-items: center; }
.arch-decide-head strong { display: block; font-size: 14px; line-height: 1.35; }
.arch-decide-head strong b { font-weight: 700; }
.arch-decide-head small { color: var(--warn); font-size: 12px; font-weight: 500; }
.arch-decide-body { margin: 10px 0 8px 43px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: break-word; }
.arch-decide-details { margin: 0 0 12px 43px; font-size: 12.5px; }
.arch-decide-details summary { color: var(--text-sec); cursor: pointer; }
.arch-decide-state { margin: 0 0 8px 43px; color: var(--danger); font-size: 12px; }
.arch-decide-actions { display: flex; gap: 8px; margin-left: 43px; }
.arch-decided { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 12.5px; color: var(--text-sec); }
.arch-decided b { color: var(--text); }
.arch-decided.fail svg { color: var(--danger); }
.arch-decided-state::before { content: '· '; }
.arch-navline { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-sec); }
.arch-link-btn { margin-left: 6px; padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-size: 12px; cursor: pointer; }
.arch-term { padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; text-decoration: underline dotted var(--blue) 1.5px; text-underline-offset: 3px; cursor: pointer; }
.arch-term:hover, .arch-term[aria-expanded='true'] { color: var(--blue); }
.arch-def { position: relative; margin: 8px 0; padding: 12px 36px 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.arch-def h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 4px; font-size: 13px; }
.arch-def h4 svg { color: var(--blue); }
.arch-def p { margin: 0 0 6px; font-size: 12.5px; color: var(--text-sec); line-height: 1.55; white-space: normal; }
.arch-def a { font-size: 12px; }
.arch-def-close { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; }
.arch-stats { overflow: auto; }
.arch-stats table { font-size: 11px; }
/* Un tableau écrit par l'Architect : la table cadrée de la console, en version
   compacte, dans un cadre qui défile horizontalement — le panneau fait 440 px. */
.arch-table-wrap { max-width: 100%; overflow-x: auto; margin: 4px 0 8px; }
.arch-table-wrap:last-child { margin-bottom: 0; }
.architect-md .arch-table { box-sizing: border-box; width: auto; min-width: 100%; }
.architect-md .arch-table th, .architect-md .arch-table td { padding: 6px 10px; font-size: 12.5px; line-height: 1.45; vertical-align: top; }
.architect-md .arch-table th { font-size: 10.5px; }
.architect-md .arch-table td { white-space: normal; overflow-wrap: break-word; min-width: 48px; }
.arch-followups { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; }
.arch-progress { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 8px 20px; font-size: 12.5px; }
.arch-progress-label { font-weight: 500; color: transparent; background: linear-gradient(90deg, var(--text-sec) 0%, var(--text-sec) 40%, var(--blue) 50%, var(--text-sec) 60%, var(--text-sec) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; animation: arch-shimmer 2.2s linear infinite; }
@keyframes arch-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.arch-followups .fu { border: 1px solid var(--blue-line); border-radius: 14px; padding: 6px 10px; color: var(--blue); background: var(--blue-soft); font-size: 11px; cursor: pointer; }
.arch-followups .fu:disabled { opacity: .5; cursor: default; }
/* La règle globale `textarea { min-height: 220px }` est faite pour le prompt :
   le champ de l'Architect la neutralise, avec la bordure et l'anneau globaux,
   portés ici par le bloc arrondi. */
.arch-composer { margin: 8px 16px 16px; padding: 8px 8px 8px 14px; display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); }
.arch-composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.arch-composer textarea { flex: 1; min-width: 0; min-height: 32px; max-height: 160px; padding: 5px 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; resize: none; background: transparent; font-family: inherit; font-size: 13.5px; line-height: 1.5; }
.arch-composer textarea:focus { box-shadow: none; }
.arch-composer textarea:disabled { background: transparent; }
.arch-composer textarea::placeholder { color: var(--text-faint); }
.arch-composer textarea:disabled::placeholder { color: var(--warn); }
.arch-send { width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; }
.arch-send:disabled { background: var(--track); color: var(--text-faint); cursor: default; }
.arch-send.stop { background: var(--text); }
/* Lot AU3. Les conversations : un écran du panneau, la colonne de gauche en plein écran. */
.arch-hist { flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: 12px 12px 0; display: flex; flex-direction: column; }
.arch-hist-searchbox { position: relative; margin: 0 4px 6px; color: var(--text-faint); }
.arch-hist-searchbox svg { position: absolute; left: 10px; top: 9px; }
.arch-hist .arch-hist-search { width: 100%; height: 34px; padding: 0 10px 0 33px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.arch-hist .arch-hist-search:focus { background: var(--surface); }
.arch-hist-group { margin: 14px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--text-faint); }
.arch-hist-item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.arch-hist-item:hover { background: var(--hover); }
.arch-hist-item.on { background: var(--track); }
.arch-hist-title { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arch-hist-item small { color: var(--text-sec); font-size: 11.5px; }
.arch-hist-empty { margin: 16px 10px; }
.arch-hist-more { align-self: flex-start; margin: 10px; }
.arch-hist-foot { margin-top: auto; padding: 14px 10px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-faint); }
.architect-drawer.full { flex: 1; width: auto; }
.architect-drawer.full .arch-hist { flex: 0 0 260px; border-right: 1px solid var(--border); background: var(--surface-2); }
/* Le fil, les suggestions et la saisie se centrent à 720 px ; la barre de défilement reste au bord. */
.architect-drawer.full .arch-messages { padding-left: max(20px, calc((100% - 720px) / 2)); padding-right: max(20px, calc((100% - 720px) / 2)); }
.architect-drawer.full .arch-followups, .architect-drawer.full .arch-progress, .architect-drawer.full .arch-composer { width: calc(100% - 32px); max-width: 720px; margin-left: auto; margin-right: auto; }
.architect-drawer.full .arch-followups, .architect-drawer.full .arch-progress { padding-left: 0; padding-right: 0; }
.architect-drawer.full .arch-composer { margin-bottom: 22px; }
.anchor-spot { box-shadow: 0 0 0 3px var(--cyan); border-radius: 4px; }
@keyframes arch-pulse { 50% { opacity: .35; } }
@media (max-width: 1179px) { .architect-drawer { position: fixed; right: 0; top: var(--topbar-h, 56px); bottom: 0; width: min(440px, 100vw); z-index: 80; box-shadow: var(--shadow); } .architect-drawer.full { width: 100%; } }
@media (max-width: 680px) { .architect-drawer.full .arch-hist { flex-basis: 150px; padding: 8px 6px 0; } }
@media (prefers-reduced-motion: reduce) { .streaming::after, .arch-spin { animation: none; } .arch-progress-label { animation: none; background: none; color: var(--text-sec); } .arch-messages { scroll-behavior: auto; } }

* {
  box-sizing: border-box;
}

/* `[hidden]` gagne toujours (lot TP1). Le `display: none` du navigateur
   perd contre n'importe quelle règle d'auteur qui pose un `display` — `.grid-2`,
   `.field`, un popover en `flex` —, et chaque classe a fini par porter sa
   propre règle `[hidden]`, jusqu'au jour où l'une l'a oubliée : les champs de
   fin de tour restaient affichés avec Soniox. Une règle, globale et
   `!important` : on ne cache jamais un élément autrement que par l'attribut,
   et un élément qui doit garder sa place passe par une classe. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  overflow: hidden;
}

#app {
  height: 100%;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}
h1 {
  font-size: 20px;
  font-weight: 700;
}
h2 {
  font-size: 16px;
}
h3 {
  font-size: 14px;
}

code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--track);
  padding: 1px 6px;
  border-radius: 5px;
}

/* ---------- chrome : top bar bleue + sidebar + contenu ---------- */

.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex-shrink: 0;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  background: var(--blue);
  /* Lot PT4 : --on-blue est posé par la console partenaire depuis la marque. */
  color: var(--on-blue, #fff);
  padding: 0 var(--gutter) 0 0;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 11px;
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 8px 14px 8px 20px;
  color: #fff;
}
.logo-block:hover {
  text-decoration: none;
}
.logo-block:hover .logo {
  transform: scale(1.06);
}

/* Le glyphe blanc de la marque, servi par /brand : c'est une image, et non
   plus une pastille portant une lettre. */
.logo {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: block;
  flex-shrink: 0;
  transition: transform 0.12s;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand-kind {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  padding-left: 26px;
  white-space: nowrap;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 18px;
  font-size: 13px;
}

/* A compact two-choice control: chrome on blue, and the same control on the
   white sign-in card before a session exists. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-2);
}
button.lang-option {
  min-width: 30px;
  padding: 3px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-sec);
  font-size: 11px;
  letter-spacing: 0.04em;
}
button.lang-option[aria-pressed='true'] {
  background: var(--blue);
  color: var(--on-accent);
}
.topbar .lang-switch {
  border-color: color-mix(in srgb, white 38%, transparent);
  background: color-mix(in srgb, white 12%, transparent);
}
.topbar button.lang-option {
  color: #fff;
}
.topbar button.lang-option:hover:not(:disabled) {
  background: color-mix(in srgb, white 18%, transparent);
}
.topbar button.lang-option[aria-pressed='true'] {
  background: #fff;
  color: var(--blue-dark);
}

/* ---------- l'identité, à droite de la barre du haut ---------- */

/* Qui est connecté. Sur la top bar bleue, donc en encre blanche : la pilule
   `admin` s'éclaircit toute seule par la règle `.topbar .badge`. */
.identity {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  color: #fff;
  font-size: 13px;
}
.identity:hover {
  text-decoration: none;
}
.identity:hover .identity-name {
  text-decoration: underline;
}

.identity-name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

/* Rond de 28 px, ici comme dans la table Team : un seul jeton de taille. */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--track);
}

/* Le repli quand Google n'a pas donné de photo. */
.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--blue-soft);
  color: var(--blue);
}

/* Dans une table, la colonne d'avatar ne prend que sa largeur. */
td.avatar-cell,
th.avatar-cell {
  width: 28px;
  padding-right: 0;
}

/* Le rôle dans la table Team. Sans largeur minimale, la colonne se réduit à la
   flèche du select et « Member » devient illisible. */
.role-select {
  min-width: 110px;
}

.btn-top {
  background: #fff;
  color: var(--text);
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-top:hover:not(:disabled) {
  background: var(--blue-soft);
  border-color: transparent;
}

.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ---------- le panneau de chat écrit (chrome) ---------- */

/* L'état pressé du bouton de la barre du haut. `.btn-top` est déjà blanc sur
   le bleu : deux jetons existants suffisent à le teinter, et aucune couleur
   n'est inventée ici. */
.btn-top[aria-pressed='true'] {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

/* Les deux façons d'essayer un agent, dans la barre du haut. Vide, le slot ne
   prend pas de place — `display: contents` laisse les boutons dans le flex de
   `.topbar-right`. */
.try-slot {
  display: contents;
}

/* Le popover de Test call. `position: relative` sur son bloc, pour qu'il
   s'ancre sous son bouton et non sous la barre entière. */
.try-block {
  position: relative;
  display: inline-flex;
}

.try-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--pop-shadow);
  padding: var(--space-4);
  color: var(--text);
}
.try-popover .field {
  margin-bottom: 0;
}

/* Test pool call : un champ par variable déclarée, donc plus large et
   défilable. Le plafond est celui du schéma — vingt variables — et sans lui le
   panneau sortirait de la fenêtre sur un agent bavard. */
.try-popover.pool {
  width: 340px;
  max-height: min(70vh, 620px);
  overflow-y: auto;
}

.pool-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pool-result {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}

/* Gros et sélectionnable : c'est ce qu'on lit sur un écran en tenant un
   téléphone de l'autre main. */
.pool-number {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  user-select: all;
}

.pool-field-note {
  font-style: italic;
}
.pool-persona-notes {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-2);
}
.pool-persona-notes p {
  margin: 0;
}
/* Un avertissement, pas une erreur : ambre, jamais rouge. */
.pool-warning {
  padding: var(--space-1) var(--space-2);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  color: var(--warn);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.pool-cheat {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}
.pool-cheat > summary {
  cursor: pointer;
  font-weight: 600;
}
.pool-cheat p {
  margin: var(--space-1) 0;
}
.pool-cheat-values {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px var(--space-2);
  margin: var(--space-2) 0 0;
  font-size: 12.5px;
}
.pool-cheat-values dt {
  font-family: var(--mono);
  color: var(--text-sec);
}
.pool-cheat-values dd {
  margin: 0;
  overflow-wrap: anywhere;
  user-select: all;
}

.pool-advanced {
  margin: var(--space-2) 0;
  font-size: 13px;
}
.pool-advanced > summary {
  cursor: pointer;
  color: var(--text-sec);
}
.pool-actions {
  flex-wrap: wrap;
}
/* Le remède, dans l'avertissement même : un bouton compact, sur sa ligne. */
.pool-warning .pool-inline {
  display: block;
  margin-top: var(--space-1);
  padding: 2px var(--space-2);
  font-size: 12px;
}

.pool-reuse {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  margin: var(--space-2) 0;
}
/* Neutralise la hauteur de la règle globale, faite pour le prompt système. */
.try-popover textarea.pool-raw {
  min-height: 0;
  font-family: var(--mono);
  font-size: 12px;
}
.pool-refused,
.pool-requests {
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
}
.pool-requests > summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* Une requête émise et sa réponse (http-exchange.js). Le défilement horizontal
   vit sur le bloc, jamais sur la page : une URL longue ne doit pas élargir le
   panneau au-delà de l'écran d'un téléphone. */
.http-exchange {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.http-exchange + .http-exchange {
  border-top: 1px dashed var(--border);
  padding-top: var(--space-3);
  margin-top: var(--space-2);
}
.http-exchange-block {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.45;
  white-space: pre;
  color: var(--text);
  user-select: text;
}
/* Sous la ligne `Cookie`, et replié : dans un bloc `white-space: pre` elle
   partirait hors du cadre, là où personne ne la lit. */
.http-exchange-note {
  display: block;
  white-space: normal;
  color: var(--text-sec);
  font-style: italic;
}
.http-exchange-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.http-exchange-code {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
}
.http-exchange-actions {
  flex-wrap: wrap;
}

/* Troisième enfant de `.layout`, après `.content`. Il ne touche pas à
   `main > *` : `.content` rétrécit par flex, et le porteur de largeur reste
   unique. */
.chat-drawer {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
}

.chat-head {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

/* Deux rangées : le nom et la fermeture d'abord, les actions ensuite. Le × doit
   rester en haut à droite quoi qu'il arrive à la seconde rangée. */
.chat-head-top,
.chat-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.chat-title {
  font-weight: 600;
  margin-right: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-head-actions .chat-link {
  margin-right: auto;
}

.chat-version {
  width: auto;
  max-width: 150px;
  font-size: 12.5px;
  padding: 4px 8px;
}

.chat-link {
  font-size: 12px;
  color: var(--blue);
}

/* Le × ferme la conversation : il est désactivé le temps d'un tour, parce qu'un
   raccroché en plein tour écrirait un rapport sans le dernier échange. */
.chat-x {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  padding: 0 var(--space-2);
  color: var(--text-sec);
  cursor: pointer;
}
.chat-x:hover:not(:disabled) {
  color: var(--text);
}
.chat-x:disabled {
  opacity: 0.4;
  cursor: default;
}

/* L'enveloppe et le mode d'exécution, avant le premier message : qui appelle, et
   qui répond aux intégrations. Deux axes orthogonaux, deux rangées. */
/* Ce qui est sorti de Yelda Air, compté dans les deux sens : vert et à zéro par
   défaut, rouge et chiffré en réel. C'est la ligne qu'on montre à un client. */
.sandbox {
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: 12.5px;
  margin: 0 0 var(--space-3);
}
.sandbox.ok {
  background: var(--ok-bg);
  border: 1px solid var(--border);
  color: var(--text-sec);
}
.sandbox.live {
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  color: var(--danger);
}

/* La requête telle qu'elle serait partie, dépliable sous un appel d'outil. */
.tool-request {
  font-size: 11.5px;
  margin-top: 4px;
}
.tool-request summary {
  cursor: pointer;
  color: var(--text-sec);
}
.tool-request-url,
.tool-request-body {
  display: block;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: var(--text-sec);
}

/* Le réglage par famille, replié : voir .chat-advanced, même raison. */
.test-advanced {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-sec);
}
.test-advanced summary {
  cursor: pointer;
  padding: 2px 0;
}

/* Le plafond dit **avant** le refus serveur, jamais à sa place. */
.estimate-warn {
  color: var(--danger);
}
.estimate-live {
  color: var(--warn);
}

.chat-setup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  align-items: start;
}

.chat-setup .field {
  gap: 2px;
}

.chat-field {
  width: 100%;
  font-size: 12.5px;
  padding: 4px 8px;
}

/* Replié : trois cases à cocher en tête d'écran, ce sont trois questions posées
   à chaque essai pour trois personnes sur dix. */
.chat-advanced {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-sec);
}
.chat-advanced summary {
  cursor: pointer;
  padding: 2px 0;
}

.chat-live-hint {
  font-size: 11.5px;
  color: var(--text-sec);
}
.chat-live-hint-text {
  color: var(--danger);
}

/* Non refermable tant que la conversation est réelle : c'est le dernier endroit
   où l'on peut se rendre compte de ce qui part. */
.dg-fields { display: grid; gap: var(--space-2); margin: var(--space-2) 0; }
.dg-summary { margin-top: var(--space-2); }
.dg-reveal { margin-left: auto; }
.dg-sensitive {
  font-size: 11px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-line);
  margin-left: var(--space-1);
}
.dg-values { display: grid; gap: 4px; margin-top: var(--space-2); }
.dg-values .mono { overflow-wrap: anywhere; }
.dg-compare { font-size: 12px; color: var(--text-sec); margin-top: 4px; display: grid; gap: 2px; }
.dg-compare .mono { color: var(--text); overflow-wrap: anywhere; }
.dg-restored { font-size: 12px; color: var(--warn); margin: var(--space-1) 0; }

.chat-live-banner {
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: 12px;
}

/* Ce que le texte ne teste pas, dit sur place : c'est là qu'on est en train de
   conclure qu'un agent est prêt. */
.chat-notes {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-sec);
}
.chat-notes p {
  margin: 2px 0;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
}

.chat-line {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

/* Mêmes règles que les bulles du fil d'un appel, à la largeur près : le panneau
   est étroit. `break-word` et jamais `anywhere` — `anywhere` fait tomber la
   largeur min-content à un caractère. */
.chat-msg {
  max-width: 88%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}
.chat-msg.agent {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  border-bottom-right-radius: 3px;
}
.chat-msg.system {
  align-self: center;
  max-width: none;
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  font-size: 12px;
}

/* La phrase d'attente, au-dessus de la réponse : reprend l'aspect du filler du
   fil d'appel, dans le violet qui dit le RAG partout. */
.chat-wait {
  align-self: flex-start;
  max-width: 88%;
  padding: var(--space-1) var(--space-3);
  background: var(--violet-bg);
  border: 1px solid var(--violet-line);
  border-radius: var(--radius-sm);
  color: var(--violet);
  font-size: 12px;
  font-style: italic;
}

.chat-note {
  align-self: flex-start;
  font-size: 11px;
  color: var(--text-faint);
}

.chat-meta {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: 11px;
  color: var(--text-sec);
}
.chat-meta-item {
  font-family: var(--mono);
}

/* L'agent écrit : trois points, le temps du tour. */
.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: var(--space-3);
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: chat-blink 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.chat-typing span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes chat-blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

.chat-foot {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
}

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.chat-input {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 56px;
  resize: none;
  font: inherit;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.chat-count {
  margin-top: var(--space-1);
  font-size: 11px;
  color: var(--text-faint);
}

/* Le point de repli de `.inspector` : au-dessous, le panneau recouvre au lieu
   de pousser — une table de conversations à 300 px n'est plus une table. */
@media (max-width: 1180px) {
  .chat-drawer {
    position: fixed;
    right: 0;
    top: var(--topbar-h);
    bottom: 0;
    z-index: 30;
    box-shadow: var(--pop-shadow);
  }
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  overflow-y: auto;
}

.nav-section {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  transition: background 0.12s;
}
.nav-item:hover {
  background: var(--hover);
  text-decoration: none;
}
.nav-item.active {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}
.nav-label {
  flex: 1;
  line-height: 1.25;
}

/* ---------- la sidebar d'un agent ---------- */

/* Le retour vers l'organisation, en tête : on est descendu d'un niveau, et
   c'est la seule chose à savoir avant de lire les deux groupes. */
.sidebar-back {
  display: block;
  padding: 4px 12px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-back:hover {
  color: var(--blue);
  text-decoration: none;
}

/* L'agent lui-même : son nom, ses pilules dessous. Les deux nœuds sont remplis
   par `setAgentHead` — jamais par un fetch du shell. À la **première** entrée
   dans un agent ils sont encore vides le temps du `GET`, d'où les hauteurs
   réservées : sans elles le bloc s'effondre et tout le menu monte puis
   redescend. Les bascules suivantes, elles, repeignent déjà de mémoire. */
.sidebar-agent {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-agent-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  min-height: 19px;
  overflow-wrap: break-word;
}
.sidebar-agent-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  /* La hauteur d'une pilule (11,5px de texte + 3px de marge, soit 23,25px),
     arrondie au-dessus pour que les deux états mesurent la même chose. */
  min-height: 24px;
}

/* Les sous-entrées de Tests. Elles ne se déplient que dans leur section, donc
   le retrait suffit à dire de quoi elles dépendent. */
.nav-sub {
  display: block;
  padding: 7px 12px 7px 43px;
  margin-bottom: 1px;
  border-radius: 8px;
  color: var(--text-sec);
  font-size: 12.5px;
}
.nav-sub:hover {
  background: var(--hover);
  color: var(--text);
  text-decoration: none;
}
.nav-sub.active {
  color: var(--blue);
  font-weight: 700;
}

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

main {
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
  padding: 26px 0 var(--space-7);
}

/* Le seul porteur de largeur : tout le contenu d'une vue passe par ce cadre. */
main > * {
  width: min(100% - 2 * var(--gutter), var(--content-max));
  margin-left: auto;
  margin-right: auto;
}

/* Les vues de mesure (Conversations, Tests) prennent toute la fenêtre : leur
   contenu est une table dense et un inspecteur, pas de la prose. Les autres
   restent cadrées — un champ de prompt à 2000 px est inutilisable.
   La classe est posée par shell() à partir de la route, jamais par une vue. */
main.wide > * {
  width: calc(100% - 2 * var(--gutter));
  max-width: none;
}

/* ---------- en-tête de page ---------- */

.page-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.page-head .spacer {
  flex: 1;
}
.page-head .back {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
}
.page-head .back:hover {
  color: var(--blue);
  text-decoration: none;
}
/* Dans l'en-tête d'un agent, la bannière de version n'est plus un bloc sous le
   titre : ce sont deux pilules sur la même ligne. Même composant, sans son
   cadre — un encadré de plus par écran finissait par les faire tous se
   ressembler. */
.page-head .version-banner {
  padding: 0;
  margin: 0;
  gap: var(--space-4);
  background: none;
  border: none;
}

/* ---------- surfaces ---------- */

/* La grande surface blanche qui « flotte » sur le canvas. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow);
  padding: 20px 24px;
}
.card + .card {
  margin-top: var(--space-4);
}
.card > h2 {
  margin-bottom: var(--space-4);
}
.card.flush {
  padding: 0;
  overflow: hidden;
}
/* Sous-blocs d'une surface, séparés par un filet fin — jamais des cartes
   empilées. */
.card-section {
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.card-section:first-child {
  border-top: none;
  padding-top: 2px;
}
.card-section:last-child {
  padding-bottom: 2px;
}
.card-section > h2 {
  margin-bottom: var(--space-4);
}
.card-section-sub {
  font-size: 12.5px;
  color: var(--text-sec);
  margin: -12px 0 16px;
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Lot FA1 : une carte de téléchargement repliable en bas de Deploy. */
.audio-file > summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 18px; cursor: pointer; list-style: none; }
.audio-file > summary::-webkit-details-marker { display: none; }
.audio-file > summary::before { content: '▸'; color: var(--text-faint); }
.audio-file[open] > summary::before { content: '▾'; }
.audio-file[open] > summary { border-bottom: 1px solid var(--border); }
.audio-file > summary > strong { color: var(--title); }
.audio-file-form { display: grid; gap: 14px; }
.audio-file-form .field, .audio-file-info { margin: 0; }
.audio-file-form textarea { min-height: 180px; resize: vertical; }
/* Lot FA3 : palette des balises de ton. */
.af-palette { display: grid; gap: 8px; }
.af-palette > .hint { margin: 0; }
.af-tags-row, .af-tag-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.af-tag { font-family: var(--mono); color: var(--violet); background: var(--violet-bg); }
.af-tag-groups { display: grid; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.af-tag-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.af-tag-title strong { color: var(--text); }
.af-experimental { color: var(--warn); font-size: 11.5px; }
.af-no-tags { margin: 0; }
.audio-file-options { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.audio-file-options > .field { flex: 1 1 200px; min-width: 0; }
.audio-file-name { display: flex; align-items: center; gap: 6px; }
.audio-file-name input { min-width: 0; font-family: var(--mono); }
.audio-file-name > span { color: var(--text-faint); font-family: var(--mono); }
.audio-file-trim { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.audio-file-player { min-width: 0; }
/* Lot FA4 : fond sonore mixé sous la voix. */
.af-mix { display: grid; gap: 10px; }
.af-mix > .label { font-weight: 600; color: var(--text); }
.af-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.af-mode[aria-pressed='true'] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.af-source { display: grid; gap: 4px; }
.af-import { display: grid; gap: 4px; }
.af-import > .hint, .af-credit { margin: 0; }
.af-mix-settings { display: grid; gap: 12px; }
.af-levels, .af-times { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.af-levels > .field, .af-times > .field { margin: 0; min-width: 0; }
.af-levels > .af-range { flex: 1 1 240px; max-width: 360px; }
.af-times > .field { flex: 0 1 120px; }
.af-range-row { display: flex; align-items: center; gap: 8px; }
.af-range-row input { flex: 1 1 auto; min-width: 0; }
.af-level { flex: none; min-width: 52px; text-align: right; color: var(--text-sec); font-variant-numeric: tabular-nums; }
/* Lot FA3 : lecteur à forme d'onde (wave-player.js). */
.wp { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wp-toggle { flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.wp-toggle:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.wp-wave { flex: 1 1 auto; min-width: 0; height: 72px; cursor: pointer; border-radius: 6px; }
.wp-wave:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wp-canvas { display: block; width: 100%; height: 100%; }
.wp-time { flex: none; color: var(--text-sec); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.audio-file-info { overflow-wrap: anywhere; }

.ambient-sound-choice { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 18px; }
.ambient-sound-choice > .field { flex: 1; min-width: 0; margin-bottom: 0; }
.ambient-sound-choice > button { flex-shrink: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0 var(--space-5);
}

/* La même chose pour des champs courts — un nombre, une durée, une limite —
   qui n'ont pas besoin de la moitié de la largeur chacun. */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 var(--space-5);
}

/* Deux surfaces côte à côte (repli en colonne sous 720 px de contenu). */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--space-4);
  align-items: start;
  margin-top: var(--space-4);
}
.two-col > .card + .card {
  margin-top: 0;
}
.two-col + .card {
  margin-top: var(--space-4);
}

.hint {
  font-size: 12.5px;
  color: var(--text-sec);
}

/* ---------- formulaires ---------- */

.field {
  display: block;
  margin-bottom: 18px;
}

.field > .label,
.label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
}

.field .hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-faint);
}

input[type='text'],
input[type='password'],
/* `email` depuis le lot S2 : sans lui l'inscription rendait un champ nu au
   milieu de trois champs cadrés — un type non listé retombe sur le style du
   navigateur, en silence. */
input[type='email'],
/* `url` depuis le lot DP2 : la page de connexion et la politique de
   confidentialité du widget sortaient sans cadre, à la largeur du navigateur. */
input[type='url'],
input[type='number'],
input[type='search'],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--track);
  color: var(--text-sec);
}

textarea {
  min-height: 220px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.counter {
  float: right;
  font-weight: 400;
  color: var(--text-faint);
}

/* ---------- boutons ---------- */

button {
  padding: 9px 15px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
button:hover:not(:disabled) {
  background: var(--hover);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--on-accent);
}
button.primary:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

button.danger {
  background: var(--surface);
  border-color: var(--danger-line);
  color: var(--danger);
}
button.danger:hover:not(:disabled) {
  background: var(--danger-bg);
}

button.small {
  padding: 5px 10px;
  font-size: 12px;
}

/* Un bouton qui se lit comme un lien : « Choose pages myself » n'est pas une
   action de même poids que « Import 8 recommended pages », et deux boutons
   pleins côte à côte laisseraient l'opérateur choisir entre deux inconnus. */
button.quiet {
  padding: 5px 0;
  background: none;
  border: none;
  color: var(--blue);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.quiet:hover:not(:disabled) {
  background: none;
  color: var(--blue-dark);
}

/* ---------- onglets (pilules) ---------- */

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tab,
a.tab,
button.tab {
  padding: 9px 15px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.tab:hover,
a.tab:hover,
button.tab:hover:not(:disabled) {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
  text-decoration: none;
}
.tab[aria-selected='true'],
a.tab[aria-selected='true'],
button.tab[aria-selected='true'] {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
/* Les segments d'un écran — les trois façons de regarder une version. La
   rangée d'onglets de l'agent, elle, a disparu : la sidebar la porte. */
.tabs.page-tabs {
  margin-bottom: var(--space-4);
}
.tabs.compact .tab {
  padding: 6px 12px;
  font-size: 12.5px;
}
/* Le compte d'un onglet : « Written for this agent · 12 », pas « agent12 ». */
.tab .count {
  margin-left: 6px;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

/* ---------- en-tête d'un appel (lot FC1) ----------
   Une bande : naviguer, l'issue en titre, quatre repères iconographiés sans
   étiquette, les faits, puis les onglets posés sur son filet bas. */
.call-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px var(--gutter) 0;
  margin-bottom: var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
/* Prototype FC1 : la bande court d'un bord à l'autre de la zone de contenu,
   collée sous la barre du haut. Son contenu reste dans le cadre de la page —
   la gouttière devient son padding —, seul le fond déborde. */
main > .call-head {
  width: 100%;
  max-width: none;
  margin-top: -26px;
}
/* `main` réserve la place de la barre de défilement des deux côtés : à gauche,
   la bande s'arrêtait à 15 px de la sidebar. Sur la fiche, la réserve reste du
   seul côté de la barre. */
main:has(> .call-head) {
  scrollbar-gutter: stable;
}
/* Sans onglet (chat écrit, viewer), la bande se ferme sur sa dernière ligne. */
.call-head.no-tabs {
  padding-bottom: var(--space-3);
}
.ch-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-sec);
}
.ch-nav .spacer,
.ch-title .spacer {
  flex: 1;
}
.ch-nav .back {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sec);
}
.ch-nav .back:hover {
  color: var(--blue);
  text-decoration: none;
}
/* Prototype FC1 : dans la bande, le navigateur ‹ n / N › est un petit pager. */
.ch-nav .cnav {
  height: 24px;
  border-color: var(--border);
  border-radius: 7px;
}
.ch-nav .cnav-step {
  width: 26px;
  font-size: 15px;
}
.ch-nav .cnav-step:first-child {
  border-radius: 7px 0 0 7px;
}
.ch-nav .cnav-step:nth-child(3) {
  border-radius: 0 7px 7px 0;
}
.ch-nav .cnav-count {
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 11px;
}
.ch-sid {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
}
.ch-sid:hover {
  color: var(--blue);
}
.ch-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
/* Le bouton de la ligne de titre ne doit pas la rendre plus haute que le titre. */
.ch-title button.small {
  padding: 3px 10px;
}
.ch-title h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  min-width: 0;
}
.ch-marks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2) var(--space-5);
  padding-top: 2px;
}
.ch-mark {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}
.ch-ico {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--track);
  color: var(--text-sec);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ch-ico.agent {
  background: var(--blue-soft);
  color: var(--blue);
}
.ch-mark-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}
.ch-v {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: break-word;
}
.ch-v.mono {
  font-family: var(--mono);
}
.ch-s {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-sec);
}
.ch-differs {
  color: var(--warn);
}
.ch-s .badge {
  padding: 0 7px;
  font-size: 10.5px;
  line-height: 16px;
}
.ch-split {
  display: flex;
  max-width: 200px;
  height: 6px;
  margin: 3px 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--track);
}
.ch-split-agent {
  background: var(--blue);
}
.ch-split-human,
.ch-sw.human {
  background: var(--border-strong);
}
.ch-sw {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-radius: 2px;
}
.ch-sw.agent {
  background: var(--blue);
}
/* La rangée de faits : une ligne, des filets verticaux, pas de carte haute. */
.fact-row.ch-facts {
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.ch-facts .fact {
  flex: 1 1 160px;
  gap: 1px;
  padding: 8px 14px;
  text-align: left;
  background: none;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  font: inherit;
  color: inherit;
}
.ch-facts .fact:last-child {
  border-right: 0;
}
.ch-facts button.fact {
  cursor: pointer;
}
.ch-facts button.fact:hover {
  background: var(--blue-soft);
}
.ch-facts .fact-label {
  line-height: 1.3;
}
/* Prototype FC1 : la valeur à l'encre du texte, seul le verdict porte la teinte. */
.fact-row.ch-facts .fact .fact-value {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.35;
}
.ch-facts .fact-verdict {
  font-weight: 700;
}
.ch-facts .fact.ok .fact-verdict {
  color: var(--ok);
}
.ch-facts .fact.warn .fact-verdict {
  color: var(--warn);
}
.ch-facts .fact.danger .fact-verdict {
  color: var(--danger);
}
.ch-facts .fact[data-key='tools'] {
  flex-grow: 1.4;
}
.ch-facts .fact-latency .latency {
  font-family: var(--mono);
  font-weight: 700;
}
.ch-facts .fact-latency {
  flex: 0 1 auto;
  margin-left: 0;
  border-left: 1px solid var(--border);
}
.fact-hint {
  margin-left: 6px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 400;
}
/* Les onglets de la fiche, soulignés et posés sur le filet de la bande. */
.call-head .call-tabs {
  gap: 22px;
  margin: 0;
}
.call-head .call-tabs .tab {
  padding: 8px 0 10px;
  border-radius: 0;
  background: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-sec);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.call-head .call-tabs .tab:hover:not(:disabled) {
  background: none;
  color: var(--text);
}
.call-head .call-tabs .tab[aria-selected='true'] {
  background: none;
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--blue);
}
.ch-tab-count {
  color: var(--text-faint);
  font-weight: 500;
}
.ch-tab-findings:empty {
  display: none;
}
@media (max-width: 720px) {
  .call-head {
    padding: var(--space-3) var(--gutter) 0;
  }
}

/* ---------- tableaux ---------- */

/* Table « cadrée » du prototype : bordure fine, coins arrondis, en-tête
   discret. border-collapse: separate pour garder le cadre arrondi. */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
}

th {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
  white-space: nowrap;
}
thead th:first-child {
  border-top-left-radius: var(--radius-md);
}
thead th:last-child {
  border-top-right-radius: var(--radius-md);
}
tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius-md);
}
tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius-md);
}

tbody tr:last-child td {
  border-bottom: none;
}
tbody tr:hover td {
  background: var(--surface-2);
}

td.num {
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card > table + .hint,
.card > table + p {
  margin: var(--space-4) 0 0;
}
.card > p:first-child {
  margin-top: 0;
}
.card > .empty:only-child,
.card > .loading:only-child {
  margin: 0;
}

/* Le tableau des tours a huit colonnes : il défile plutôt que d'écraser la page. */
.scroll-x {
  overflow-x: auto;
}
.card.scroll-x > table {
  min-width: 720px;
}

/* ---------- états ---------- */

.sk-bar {
  display: inline-block;
  height: .8em;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--track) 25%, var(--surface-2) 50%, var(--track) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}
@keyframes sk-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-bar { animation: none; }
}
/* Lot PD1 : une ligne d'attente garde la hauteur d'une ligne de texte. */
.loading-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 22px;
  margin: 4px 0;
  color: var(--text-sec);
  font-size: 13px;
}
.loading-line .sk-bar { width: 48px; flex: none; }
.is-refreshing {
  opacity: .55;
  transition: opacity .15s;
  pointer-events: none;
}
/* ---------- liste des conversations (lots LC2-LC3) ----------
   Maquette : docs/yelda-air-liste-conversations-prototype.html. Pleine largeur,
   sans carte : une barre de filtres compacte, puis une table qui défile dans son
   propre cadre — l'en-tête y colle, et le défilement horizontal sous 1500 px y
   reste au lieu de passer à la page. */
/* Le cadre décide des colonnes qu'on peut montrer : sa largeur, pas celle de la
   fenêtre — la barre latérale et le panneau de chat en retirent des centaines
   de pixels (la règle du panneau Actions). */
.cl-page {
  container-type: inline-size;
  container-name: cl-page;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  /* Lot FL1 : pas d'overflow ici — les menus de la barre débordent du cadre. Le
     défilement de la table arrondit lui-même ses coins du bas. */
}
.cl-fbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.cl-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-right: 8px;
  white-space: nowrap;
}
.cl-count-f { color: var(--text-sec); font-weight: 500; }
/*
 * Lot FL1 : la barre condensée. Les <select> vivent masqués dans .cl-fsource ;
 * ce qui se voit, ce sont les boutons des filtres principaux (.cl-pf), le
 * bouton « ＋ Filter » (.cl-addf) et la ligne de pastilles (.cl-chips).
 */
.cl-fbar .cl-pf,
.cl-fbar .cl-addf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
}
.cl-fbar .cl-pf:hover,
.cl-fbar .cl-addf:hover { border-color: var(--border-strong); }
.cl-fbar .cl-pf .cl-car { color: var(--text-faint); font-size: 10px; }
.cl-fbar .cl-addf { border-style: dashed; color: var(--text-sec); }
.cl-fbar .cl-addf.cl-f-on { border-style: solid; }
.cl-addf-n {
  min-width: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.cl-fbar:has(+ .cl-chips) { border-bottom: 0; padding-bottom: 6px; }
.cl-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 20px 10px;
  border-bottom: 1px solid var(--border);
}
.cl-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 2px 0 4px;
  border-radius: 999px;
  border: 1px solid var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 12px;
}
.cl-chip-v,
.cl-chip-x {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.cl-chip-v { padding: 0 4px 0 6px; font-weight: 600; white-space: nowrap; }
.cl-chip-x { width: 20px; height: 20px; border-radius: 50%; padding: 0; line-height: 1; }
.cl-chip-x:hover { background: var(--blue-line); }
.cl-fmenu { display: flex; flex-direction: column; min-width: 260px; }
.cl-fmenu-head { display: flex; align-items: center; gap: 6px; padding: 0 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.cl-fmenu-head:empty { display: none; }
.cl-fmenu input.cl-fmenu-search { flex: 1; height: 28px; padding: 0 8px; font-size: 12.5px; border-radius: 6px; }
.cl-fmenu-back {
  border: 0;
  border-radius: 6px;
  background: var(--track);
  padding: 3px 8px;
  font: inherit;
  cursor: pointer;
}
.cl-fmenu-title { font-weight: 600; }
.cl-fmenu-list { max-height: 360px; overflow: auto; display: flex; flex-direction: column; }
.cl-fmenu-set small { color: var(--blue-deep); }
.cl-fmenu-clear { color: var(--text-sec); border-top: 1px solid var(--border); border-radius: 0; margin-top: 4px; }
.cl-fmenu-empty { padding: 10px; color: var(--text-sec); font-size: 12.5px; }
/* Lot FL2 : les vues rapides, des onglets soulignés au-dessus de la barre — jamais des pilules. */
.cl-views {
  display: flex;
  gap: 2px;
  padding: 6px 20px 0;
  border-bottom: 1px solid var(--border);
  /* Ce qui ne tient pas défile, sans barre : un onglet n'est jamais coupé en deux lignes. */
  overflow-x: auto;
  scrollbar-width: none;
}
.cl-views::-webkit-scrollbar { display: none; }
@container cl-page (max-width: 900px) {
  .cl-views { padding-left: 12px; padding-right: 12px; }
  .cl-view { padding-left: 7px; padding-right: 7px; font-size: 12.5px; }
  /* Une carte étroite (écran de 1 100 px, sidebar ouverte) : la barre resserre ses
     espacements pour tenir sur une ligne. Spécificité relevée : ces règles
     précèdent celles de la barre dans la feuille. */
  .cl-page .cl-fbar { gap: 4px; padding-left: 12px; padding-right: 12px; }
  .cl-page .cl-fbar input.cl-search { width: 110px; }
  .cl-page .cl-count,
  .cl-page .cl-fbar .rv-progress,
  .cl-page .cl-fbar .vc-progress { margin-right: 2px; }
  .cl-page .cl-fbar .cl-live,
  .cl-page .cl-fbar .cl-export { padding-left: 8px; padding-right: 8px; }
}
.cl-view {
  border: 0;
  border-bottom: 2px solid transparent;
  /* La règle globale `button` arrondit ses coins : un onglet plat garde un trait droit. */
  border-radius: 0;
  background: none;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text-sec);
  white-space: nowrap;
  cursor: pointer;
}
.cl-view:hover { color: var(--text); }
.cl-view.on { color: var(--text); border-bottom-color: var(--blue); font-weight: 600; }
.cl-view-n {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--track);
  color: var(--text-sec);
  font-size: 11px;
  font-weight: 500;
}
.cl-view-n:empty { display: none; }
.cl-fbar input.cl-search {
  width: 170px;
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 6px;
}
.cl-fbar input.cl-search:focus {
  box-shadow: none;
  outline: 2px solid var(--blue-line);
  outline-offset: 0;
}
.cl-fbar .cl-f-on {
  border-color: var(--blue-line);
  background-color: var(--blue-soft);
  color: var(--blue-deep);
  font-weight: 600;
}
.cl-reset {
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 12px;
  padding: 0 6px;
  cursor: pointer;
}
.cl-scroll {
  position: relative;
  overflow: auto;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
/* Aucune largeur minimale : la table tient dans son cadre. Ce qui ne tient
   plus se retire, colonne secondaire par colonne secondaire (container
   queries plus bas) ; le défilement horizontal ne reste qu'en dernier recours,
   sur un écran de téléphone. */
.cl-table {
  width: 100%;
  border: 0;
  border-radius: 0;
}
.cl-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding: 8px 8px;
  border-radius: 0;
}
.cl-table tbody td {
  height: 38px;
  padding: 0 8px;
  white-space: nowrap;
  font-size: 13px;
}
.cl-table th.num,
.cl-table td.num { text-align: right; }
.cl-table td.num { font-family: var(--mono); font-size: 12px; }
.cl-table td:first-child,
.cl-table th:first-child { padding-left: 16px; }
.cl-table td:last-child,
.cl-table th:last-child { padding-right: 16px; }
.cl-table tbody tr { cursor: pointer; }
.cl-table tbody tr:hover td { background: var(--hover); }
.cl-table tbody tr:focus-visible { outline: 2px solid var(--blue-line); outline-offset: -2px; }
/* La ligne en cours : un vert pâle dérivé de --ok-bg, plus clair que lui pour
   que les pastilles « ok » de la ligne restent lisibles dessus. */
.cl-table tbody tr.cl-running td { background: color-mix(in srgb, var(--ok-bg) 55%, var(--surface)); }
.cl-table .mono { font-family: var(--mono); font-size: 12px; }
/* La colonne Agent reste sur l'écran d'un agent (une table ne change pas de
   colonnes selon le chemin d'entrée) ; elle y est seulement plus étroite. */
.cl-table td.cl-c-agent { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.cl-table.cl-pinned td.cl-c-agent { max-width: 120px; color: var(--text-sec); }
/* Les cellules au texte libre se tronquent : un nom de modèle ou de destination
   long ne doit pas élargir toute la table. Le texte entier reste au survol. */
.cl-table td.cl-c-llm,
.cl-table td.cl-c-caller,
.cl-table td.cl-c-ended { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
/* Lot RV2 : la colonne Review (pire cas mesuré 187 px : « Needs follow-up », initiales,
   bulle et deux chiffres) ne se masque jamais ; les trois seuils montent d'autant. */
@container cl-page (max-width: 1770px) {
  .cl-table .cl-c-region,
  .cl-table .cl-c-interruptions { display: none; }
}
@container cl-page (max-width: 1670px) {
  .cl-table .cl-c-llm,
  .cl-table .cl-c-channel { display: none; }
}
@container cl-page (max-width: 1450px) {
  .cl-table .cl-c-version,
  .cl-table .cl-c-agent { display: none; }
  .cl-table .cl-c-started .cl-sub { display: none; }
}
.cl-when { color: var(--blue); font-weight: 500; text-decoration: none; }
.cl-when:hover { text-decoration: underline; }
.cl-sub { color: var(--text-faint); font-size: 11px; margin-left: 6px; }
.cl-lat { display: inline-flex; align-items: center; gap: 6px; }
.cl-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neutral);
  vertical-align: middle;
}
.cl-dot.fail { background: var(--danger); }
.cl-dot.live { background: var(--ok); animation: cl-pulse 1.4s infinite; }
@keyframes cl-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); }
  70% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 0%, transparent); }
}
.cl-play {
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-sec);
  font-size: 9px;
  cursor: pointer;
}
.cl-play:hover { border-color: var(--blue); color: var(--blue); }
.cl-more {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  color: var(--text-sec);
  font-size: 12px;
}
.cl-more:empty { display: none; }
.cl-table-slot > .empty { border-bottom: 1px solid var(--border); }
/* Lot LC3 — le direct : le bouton Live / Paused, la pastille des arrivées
   tenues pendant un défilement, et le surlignage d'une ligne arrivée. */
.cl-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cl-live.off { background: var(--track); color: var(--text-sec); }
.cl-fbar .cl-live { margin-left: auto; }
.cl-live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.cl-live:not(.off) .cl-live-dot { animation: cl-pulse 1.4s infinite; }
.cl-newpill {
  position: sticky;
  top: 34px;
  z-index: 3;
  display: flex;
  justify-content: center;
  height: 0;
  overflow: visible;
}
.cl-newpill-btn {
  margin-top: 6px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--blue) 35%, transparent);
  cursor: pointer;
}
.cl-table tbody tr.cl-fresh td { animation: cl-fresh 2.4s ease-out; }
@keyframes cl-fresh {
  0% { background: color-mix(in srgb, var(--ok-bg) 70%, var(--ok) 12%); }
  100% { background: inherit; }
}
@media (prefers-reduced-motion: reduce) {
  .cl-dot.live,
  .cl-live:not(.off) .cl-live-dot,
  .cl-table tbody tr.cl-fresh td { animation: none; }
}

.empty,
.loading {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-sec);
  font-size: 13.5px;
}
.empty p {
  margin: 0 0 var(--space-3);
}
main > .loading {
  padding-top: var(--space-7);
}

/* Pilules : fond doux + encre, comme les statuts du prototype. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--track);
  color: var(--text-sec);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge.danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge.blue {
  background: var(--blue-soft);
  color: var(--blue);
}
/* Sur la top bar bleue, la pilule s'éclaircit. */
.topbar .badge {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ---------- notifications ---------- */

#toasts {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: 520px;
  pointer-events: none;
}

.toast {
  padding: 11px 18px;
  background: var(--ink-dark);
  color: #fff;
  border-radius: 8px;
  border-left: 3px solid transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  font-weight: 500;
}
.toast.ok {
  border-left-color: #3fb984;
}
.toast.error {
  border-left-color: #ef6b5e;
}
.toast.info {
  border-left-color: var(--blue);
}

/* ---------- écran de connexion ---------- */

/* `margin: auto` sur la carte plutôt qu'`align-items: center` sur le conteneur :
   les deux centrent quand il y a la place, mais `align-items: center` rogne le
   haut dès que le contenu dépasse — et avec trois portes sur une fenêtre courte,
   il dépasse. */
.login-wrap {
  height: 100%;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  padding: var(--space-5);
  background: var(--bg);
}
.login-card {
  width: 380px;
  margin: auto;
  padding: 28px 28px 24px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.login-brand .lang-switch {
  margin-left: auto;
}
/* Sur la carte blanche, la tuile : elle porte son propre fond. */
.login-brand .logo {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}
.login-card h1 {
  font-size: 18px;
}
.login-card .intro {
  margin: 0 0 18px;
}
.login-card button.primary {
  width: 100%;
  padding: 10px 15px;
}
.login-card .error {
  margin-top: var(--space-3);
  color: var(--danger);
  font-size: 12.5px;
  min-height: 1em;
}
/* Un message par champ : réserver une ligne pour chacun des quatre creuserait
   le formulaire. Le creux n'existe que quand il y a quelque chose à lire. */
.login-card .error:empty {
  display: none;
}

/* Le message d'un champ, remonté sous son champ : il appartient à ce qui vient
   d'être tapé, pas au bloc suivant. */
.login-card .field-error {
  margin-top: -12px;
  margin-bottom: var(--space-3);
}

/* Les deux portes de compte, en pilules. Des boutons et non des liens : un hash
   réveillerait le routeur, qui re-rendrait l'écran et perdrait la saisie. */
.login-tabs {
  margin-bottom: var(--space-4);
  padding: 3px;
  border-radius: 11px;
  background: var(--bg);
}
.login-tabs .tab {
  flex: 1;
  text-align: center;
}

/* Le bouton Google : fond blanc, bordure, logo — la charte Google, rendue avec
   les jetons existants. Le logo lui-même est le seul endroit de la console où
   une couleur n'est pas un jeton : un logo repeint n'est plus le logo. */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.btn-google:hover {
  background: var(--hover);
  text-decoration: none;
}

/* « ─── or ─── » : un filet coupé par le mot, et seulement quand il y a deux
   portes à séparer. */
.login-or {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0;
  color: var(--text-faint);
  font-size: 12px;
}
.login-or::before,
.login-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Le refus rapporté par ?auth_error= : au-dessus des portes, parce qu'il parle
   de la tentative précédente, pas du champ qui suit. */
.login-refusal {
  margin-bottom: var(--space-4);
  padding: 10px 12px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 12.5px;
}

/* ---------- Team d'une organisation (lot RO4) ---------- */

/* Un lien ou un secret montré une fois : le champ prend la place, Copy à côté. */
.ot-linkbox .row input,
.ak-secret {
  flex: 1;
  min-width: 0;
}
.ot-invite-form {
  align-items: flex-end;
  flex-wrap: wrap;
}
.ot-invite-form .field {
  margin-bottom: 0;
}
.ot-created {
  margin: var(--space-3) 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ak-scopes {
  display: grid;
  gap: 6px;
  margin-bottom: var(--space-3);
}
.al-intro {
  margin-bottom: var(--space-3);
}

/* ---------- Page Comptes (lots CP3-CP4) ----------
   Préfixe `acc-` : `ac-` appartient déjà aux actions de fin d'appel. Les
   onglets reprennent le soulignement de `.tl-subtab` ; les puces, la forme des
   filtres de la liste des conversations. Visibilité par `[hidden]` seulement. */

main > .acc-search { margin-bottom: var(--space-3); }
.acc-search-input { max-width: 420px; }

main > .acc-tabs {
  display: flex;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}
.acc-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 0 11px;
  font-size: 14px;
  font-weight: 550;
  color: var(--text-sec);
  text-decoration: none;
  white-space: nowrap;
}
.acc-tab:hover { color: var(--text); }
.acc-tab[aria-current='page'] { color: var(--text); }
.acc-tab[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
}
.acc-tab-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  background: var(--track);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}
.acc-tab-count.acc-tab-count-search { background: var(--warn-bg); color: var(--warn); }
.acc-tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
main > .acc-elsewhere { margin: 0 0 var(--space-3); }

.acc-views { display: inline-flex; gap: 4px; margin-bottom: var(--space-3); }
.acc-view {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-sec);
  text-decoration: none;
}
.acc-view[aria-current='page'] { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue-dark); }

.acc-toolbar { align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.acc-toolbar select { width: auto; }
.acc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sec);
  font-size: 13px;
}
.acc-chip:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.acc-chip[aria-pressed='true'] { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue-dark); }
.acc-chip-count { font-weight: 600; font-variant-numeric: tabular-nums; }

.acc-table-host { overflow-x: auto; }
/* Désactiver n'apparaît qu'au survol de la ligne et au focus : le geste le plus rare. */
.acc-row-action { opacity: 0; }
tr:hover .acc-row-action,
tr:focus-within .acc-row-action,
.acc-row-action:focus-visible { opacity: 1; }
.acc-org { display: inline-flex; flex-direction: column; }
.acc-via { font-size: 12px; }

.acc-homes { width: 100%; }
.acc-homes td.num,
.acc-homes th[data-sort='accounts'],
.acc-homes th[data-sort='admins'] { text-align: right; font-variant-numeric: tabular-nums; }
.acc-chevron-cell { width: 28px; }
.acc-chevron {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-sec);
  line-height: 1;
}
.acc-home-name { font-weight: 600; }
.acc-hits {
  margin-left: 8px;
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: 999px;
  padding: 0 7px;
}
.acc-signals { gap: 4px; flex-wrap: wrap; }
td.acc-detail { background: var(--surface-2); padding: var(--space-3) var(--space-4); }
.acc-detail-foot { align-items: center; margin-top: var(--space-2); }

.acc-pager { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.acc-pager-range { color: var(--text-sec); font-variant-numeric: tabular-nums; }
.acc-pager .acc-pager-size { width: auto; }

/* ---------- sélecteur de voix ---------- */

.voice-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.voice-toolbar .spacer {
  flex: 1;
}
.voice-toolbar select,
.voice-toolbar input[type='search'] {
  width: auto;
  min-width: 160px;
}

.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
  max-height: 460px;
  overflow-y: auto;
  padding: 2px;
}

.voice {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.voice:hover {
  border-color: var(--border-strong);
}
.voice.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.voice .name {
  font-weight: 600;
}
.voice .desc {
  margin: var(--space-1) 0 var(--space-3);
  font-size: 12px;
  color: var(--text-sec);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.voice .actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.voice .ttfb {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-sec);
}

/* ---------- bloc repliable ---------- */

/* Toujours utilisé par la fiche d'un appel. Ce n'est plus l'éditeur qui s'en
   sert : là, un champ va dans le panneau de son sujet, jamais dans un tiroir
   « Advanced » qui entassait quatorze réglages sans rapport. */
details.advanced {
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}
details.advanced > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  list-style: none;
  user-select: none;
}
details.advanced > summary::-webkit-details-marker {
  display: none;
}
details.advanced > summary::before {
  content: '▸ ';
}
details.advanced[open] > summary::before {
  content: '▾ ';
}
details.advanced > .body {
  margin-top: var(--space-4);
}
.card-section > details.advanced {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* ---------- les panneaux de l'éditeur ---------- */

/* Des **boutons**, jamais des liens ni des ancres `#…` : un hash réveille le
   routeur, et une route par panneau re-rendrait le formulaire — donc perdrait
   l'état non sauvegardé. */
.tabs.form-panels {
  margin-bottom: var(--space-4);
}

/* Le panneau diffère de la version publiée. Sept panneaux, et sans ce point il
   faudrait les ouvrir tous pour retrouver ce qu'on a changé. Blanc sur l'onglet
   sélectionné, qui est déjà bleu. */
.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 7px;
  vertical-align: 1px;
  background: var(--warn);
}
.tab[aria-selected='true'] .tab-dot {
  background: #fff;
}

/* ---------- panneau Tour de parole (lot TP3) ----------
   Une page de réglages à sous-navigation verticale : une section visible à la
   fois, les autres masquées par `hidden`, jamais démontées. La largeur se lit par
   container query sur le panneau, jamais par media query : la sidebar et le chat
   retirent des centaines de pixels au viewport. Préfixe `tp-`. */
.card.form-panel-turn, .card.form-panel-knowledge { padding: 0; }
.tp-wrap { container: tp-panel / inline-size; }
.tp { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 420px; }
.tp-nav, .kn-nav {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 10px;
  border-right: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius) 0 0 var(--radius);
}
.tp-group {
  margin: 14px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-faint);
}
.tp-nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 7px 10px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-sec); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer;
}
.tp-nav-item:hover { background: var(--hover); color: var(--text); }
.tp-nav-item[aria-current='true'] { background: var(--blue-soft); color: var(--blue-dark); font-weight: 600; }
.tp-nav-item .tab-dot { margin-left: 0; flex: none; }
/* L'état d'une entrée (« off »), à droite, avant le point (lot KN1). */
.tp-nav-state { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--text-faint); }
.tp-title-row { display: flex; align-items: center; gap: 10px; }
.tp-title-row > .tl-switch { margin-left: auto; font-size: 13px; font-weight: 500; }
.tp-body { min-width: 0; padding: 20px 24px 24px; }
.tp-title { font-size: 16px; margin: 0 0 4px; }
.tp-lead { margin: 0 0 var(--space-4); max-width: 640px; }
/* La règle globale `textarea { min-height: 220px }` est faite pour le prompt. */
.tp-section textarea, .kn-section textarea { min-height: 58px; }
.tp-section .background-speech-panel { margin: 0; }

/* Une ligne : libellé et aide à gauche, contrôle à droite. Le `label.field` de
   `field()` est restylé, jamais réécrit : même DOM, mêmes tests de contrat. */
.tp-rows { display: flex; flex-direction: column; }
.tp-rows label.field {
  display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); column-gap: var(--space-4);
  align-items: start; margin: 0; padding: 10px 0; border-top: 1px solid var(--border);
}
.tp-rows label.field > .label { grid-column: 1; grid-row: 1; margin: 0; font-size: 13px; font-weight: 500; color: var(--text); }
.tp-rows label.field > .hint { grid-column: 1; grid-row: 2; margin-top: 2px; }
.tp-rows label.field > :not(.label):not(.hint) { grid-column: 2; grid-row: 1 / span 2; justify-self: start; width: 100%; max-width: 360px; }
.tp-rows label.field > input[type='checkbox'] { width: auto; margin-top: 3px; }
.tp-rows output { display: block; margin: -4px 0 6px calc(280px + var(--space-4)); font-size: 12px; color: var(--text-sec); }

.tp-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); }
.tp-line > .label { width: 280px; flex: none; margin: 0; font-size: 13px; font-weight: 500; color: var(--text); }
.tp-value { font-family: var(--mono); font-size: 12.5px; }
.tp-caps { display: flex; gap: 6px; flex-wrap: wrap; }
.tp-cap { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--track); color: var(--text-faint); }
.tp-cap.yes { background: var(--ok-bg); color: var(--ok); }
.tp-note { margin: 0; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-sec); }

/* Les réglages que le moteur choisi ne lit pas : valeurs visibles, en fin de
   section, jamais mêlées aux réglages actifs. */
.tp-inert { margin-top: var(--space-3); font-size: 12.5px; color: var(--text-sec); }
.tp-inert > summary { cursor: pointer; padding: 6px 0; }
.tp-inert input, .tp-inert select { background: var(--track); border-style: dashed; }

.tp-sum { margin-top: var(--space-2); }

/* L'Overview (lot TP4) : trois mesures lues sur /stats et /speech-levels, puis
   une ligne par section. Aucune teinte nouvelle : pilules existantes. */
.tp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }
.tp-stat { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); min-width: 0; }
.tp-stat-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.tp-stat-value { margin-top: 4px; font-size: 20px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.tp-stat-sub { font-size: 12px; color: var(--text-sec); min-height: 16px; }
.tp-stats-foot { margin: 8px 0 var(--space-4); }
.tp-sum-row { cursor: pointer; }
.tp-sum-open { padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.tp-sum-open:hover, .tp-sum-open:focus-visible { color: var(--blue); }
.tp-sum-value { color: var(--text-sec); }
/* `.alert` n'a pas de style global : le bandeau porte le sien, en ambre. */
.tp-alert { margin: 0 0 var(--space-3); padding: 9px 12px; border: 1px solid var(--warn-line); border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); font-size: 12.5px; }

@container tp-panel (max-width: 720px) {
  .tp { grid-template-columns: minmax(0, 1fr); }
  .tp-nav, .kn-nav {
    flex-direction: row; overflow-x: auto; padding: 8px;
    border-right: 0; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
  }
  .tp-group { display: none; }
  .tp-nav-item { width: auto; flex: none; white-space: nowrap; border-radius: 999px; }
  .tp-body { padding: 16px; }
  .tp-rows label.field { grid-template-columns: minmax(0, 1fr); }
  .tp-rows label.field > .label { grid-row: 1; }
  .tp-rows label.field > :not(.label):not(.hint) { grid-column: 1; grid-row: 2; margin-top: 6px; }
  .tp-rows label.field > .hint { grid-row: 3; }
  .tp-rows output { margin-left: 0; }
  .tp-line > .label { width: auto; }
}

/* Le prompt a besoin de toute la hauteur : c'est le seul champ où l'on écrit
   des paragraphes, et un textarea de six lignes obligeait à défiler dedans. */
.form-panel-prompt textarea {
  min-height: 420px;
  resize: vertical;
}

/* La zone de danger au pied du panneau Identity. Archiver à côté de Save
   était le clic malheureux classique.

   Bordée, pas remplie — la même décision que `.card.danger-zone` des réglages
   d'organisation : c'est un avertissement, pas une erreur en cours. Un autre
   nom parce que celui-là désigne déjà une carte entière, et deux traitements
   sous une seule classe est la dérive qu'on évite. */
.danger-block {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-md);
}
.danger-block h3 {
  margin: 0 0 var(--space-1);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--danger);
}
.danger-block .hint {
  margin-bottom: var(--space-3);
}

/* La barre d'actions suit le défilement : un prompt long ne doit pas obliger à
   remonter pour enregistrer. Surface blanche posée sur le bas du canvas. */
.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-5);
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 -4px 16px rgba(16, 32, 60, 0.06), var(--panel-shadow);
}
.sticky-actions .spacer {
  flex: 1;
}
.sticky-actions input,
.sticky-actions select {
  width: auto;
}
.sticky-actions .group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------- filtres ---------- */

.filters {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: var(--space-4);
}
.filters .label {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.filters select {
  width: auto;
  min-width: 150px;
}
/* Un champ de recherche dans une barre de filtres se range à côté des listes,
   pas sur sa propre ligne — sinon la barre a deux hauteurs selon l'écran. */
.filters input[type='search'] {
  width: auto;
  min-width: 180px;
}

/* ---------- latence ---------- */

/* La latence est l'information principale d'une ligne : elle est lue avant le
   reste, donc plus grosse et colorée par rapport à la cible. */
.latency {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.latency.ok {
  color: var(--ok);
}
.latency.warn {
  color: var(--warn);
}
.latency.danger {
  color: var(--danger);
}

tbody tr.clickable-row {
  cursor: pointer;
}
tbody tr[aria-current='true'] {
  box-shadow: inset 3px 0 0 var(--blue);
  background: var(--surface-2);
}

/* La durée de parole du client n'est pas une latence : encre estompée, aucun
   seuil, et une colonne à part de la série des mesures. */
td.speech,
th.speech {
  color: var(--text-faint);
}

/* Trois groupes dans la table dense : ce que le client a dit, la décomposition,
   les latences perçues. Un filet vertical les sépare — sans lui, quinze
   colonnes de chiffres se lisent comme une seule. */
td.group,
th.group {
  border-left: 1px solid var(--border);
}

/* L'extrait est tronqué **par CSS**, jamais coupé en JavaScript : la valeur
   complète reste dans le title, donc au survol. */
td.excerpt {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- fil de conversation et inspecteur ---------- */

/* Les deux panneaux d'onglet se montrent et se cachent — ils ne se re-rendent
   jamais, sinon le flux SSE d'un appel en cours mourrait à chaque bascule.
   Lot FC1 : la marge sous la bande d'en-tête suffit, avec ou sans onglets. */
.conversation-panel > .player + .split {
  margin-top: var(--space-4);
}

/* Le fil à gauche, l'inspecteur à droite. Aucun de ces conteneurs ne prend
   d'overflow : le sticky de l'inspecteur colle par rapport à main, et un
   overflow intermédiaire le tuerait silencieusement. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: var(--space-5);
  align-items: start;
}
.split.reading {
  grid-template-columns: minmax(0, 1fr) 400px;
}
/* Le fil sur son bloc blanc, comme le rail à côté. */
.split.reading > .thread-host {
  min-width: 0;
  padding: var(--space-2) var(--space-3) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--panel-shadow);
}
@media (max-width: 1180px) {
  .split,
  .split.reading {
    grid-template-columns: minmax(0, 1fr);
  }
}

.inspector {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  /* Sur l'élément lui-même, jamais sur un ancêtre : un extrait de document
     long défile dans le panneau au lieu d'allonger la page. */
  max-height: calc(100vh - var(--topbar-h) - var(--space-6));
  overflow-y: auto;
}
.inspector > .card {
  margin: 0;
}

/* Le rail d'un appel : la revue dans son bloc, puis **une carte à sections**
   (lot FC2). Il suit la page — ni sticky ni défilement interne : une colonne
   plus haute que l'écran ne doit jamais porter sa propre barre. */
.inspector.call-rail {
  position: static;
  max-height: none;
  overflow: visible;
}
.call-rail > .rv-card {
  box-shadow: var(--panel-shadow);
}
/* Les cartes qu'elle reçoit perdent bordure, rayon, ombre et marge, et gagnent
   un filet bas. Une carte nouvelle y entre comme section. */
.call-rail-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--panel-shadow);
}
.call-rail-card:empty {
  display: none;
}
.call-rail-card > .ac-host:empty {
  display: none;
}
.call-rail-card > .card,
.call-rail-card > .ac-host > .card {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
}
/* Le filet bas vient après le reset de la carte, sinon `border: 0` l'efface. */
.call-rail-card > .card,
.call-rail-card > .ac-host,
.call-rail-card > .cx-block {
  border-bottom: 1px solid var(--border);
}
.call-rail-card > .card:last-child,
.call-rail-card > .ac-host:last-child,
.call-rail-card > .cx-block:last-child {
  border-bottom: 0;
}
.call-rail-card .card > h2 {
  margin: 0 0 var(--space-2);
}
.call-rail-card .card h2 {
  font-size: 13px;
  font-weight: 700;
}
.rail-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.rail-head h2 {
  margin: 0;
}
/* Le contexte, replié : son en-tête est la section. */
.call-rail-card > .cx-block {
  margin: 0;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}
.call-rail .cx-block-head {
  padding: var(--space-3) var(--space-4);
  background: none;
}
.call-rail .cx-block-body {
  padding: 0 var(--space-4) var(--space-3);
}
/* Dans 400 px : type, clé et durée sur une ligne, l'état en dessous. */
.call-rail .cx-wf {
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 2px var(--space-2);
}
.call-rail .cx-wf > :nth-child(3) {
  grid-column: 1 / -1;
  grid-row: 2;
}
.call-rail .cx-wf > :nth-child(4) {
  grid-column: 3;
  grid-row: 1;
}
.call-rail .cx-wf > :nth-child(5) {
  grid-column: 1 / -1;
  grid-row: 3;
}
.call-rail .cx-wf > :nth-child(5):empty {
  display: none;
}
/* Les détails de l'appel, repliés au pied du rail. */
.call-details > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.call-details > .kv {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 4px var(--space-3);
  padding-top: var(--space-2);
  font-size: 12px;
}
.call-details .call-sid {
  font-size: 11px;
  overflow-wrap: anywhere;
}
/* L'identification : le champ et son verdict, jamais une valeur. */
.id-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px var(--space-3);
  margin: var(--space-2) 0;
  font-size: 12.5px;
}
.id-field {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.id-field.ok .id-mark {
  color: var(--ok);
}
.id-field.warn .id-mark {
  color: var(--warn);
}
.id-field.none .id-mark {
  color: var(--text-faint);
}
.id-turn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-faint);
  font: 11px var(--mono);
}
button.id-turn {
  cursor: pointer;
}
button.id-turn:hover {
  color: var(--blue);
}
.call-rail .id-card .hint {
  margin: 0;
}

/* La conversation elle-même. Le fil ne porte aucune surface : ce sont les
   bulles qui se voient, et une carte par tour les mettrait en concurrence. */
.chat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

/* Le conteneur porte la surface du tour. Le bouton et le détail RAG restent
   frères : rien d'interactif ne rentre dans un autre contrôle. */
.turn {
  padding: var(--space-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: background-color 0.12s, border-color 0.12s;
}
.turn[data-selected] {
  background: var(--surface);
  border-color: var(--blue-line);
}
.pair {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  /* Lot TS1 : on copie une réplique ; le clic simple garde le saut au tour. */
  user-select: text;
  transition: background-color 0.12s, border-color 0.12s;
}
.pair:hover {
  background: var(--surface-2);
}
.pair:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Une bulle. Les 74 % seuls donneraient 110 caractères par ligne sur un grand
   écran ; les 62ch bornent la mesure sans casser l'effet de conversation. */
.msg {
  max-width: min(74%, 62ch);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.55;
  /* break-word, et surtout pas anywhere : anywhere fait tomber la largeur
     min-content d'une bulle à un caractère, donc la colonne du fil peut se
     réduire jusqu'à une lettre par ligne quand la place manque — le bug qu'on
     vient précisément de retirer de la page. break-word coupe un mot trop long
     à l'affichage sans mentir sur la largeur dont le texte a besoin. */
  overflow-wrap: break-word;
  cursor: text;
}

/* Le client à gauche, l'agent à droite : l'alignement dit qui parle sans
   qu'on ait à lire une étiquette. Le coin carré est du côté du locuteur. */
.msg.client {
  align-self: flex-start;
  background: var(--track);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
  color: var(--text);
}
.msg.agent {
  align-self: flex-end;
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  border-bottom-right-radius: 3px;
  color: var(--text);
}
/* Lot WD1 : une réponse écrite (canal web) garde ses retours à la ligne. */
.chat-web .msg.agent { white-space: pre-wrap; }
/* La lecture a été coupée par l'appelant : le bord bas s'interrompt. C'est un
   fait de la conversation, pas un badge de métadonnée. */
.msg.agent.aborted {
  border-bottom-style: dashed;
  /* Assez contrasté pour se voir : le contour clair de la bulle, en pointillé,
     ne se distinguait pas d'un bord plein. */
  border-bottom-color: var(--blue);
}
/* L'accueil n'a pas de bulle client : la mention prend sa place plutôt que de
   laisser le tour commencer dans le vide. */
.msg.system {
  align-self: center;
  max-width: none;
  padding: var(--space-1) var(--space-3);
  color: var(--text-faint);
  font-size: 12px;
}
/* La phrase d'attente est une interjection, pas une réponse : plus étroite,
   en italique, dans le violet qui dit le RAG partout sur cette page. */
.msg.filler {
  align-self: flex-end;
  max-width: min(42%, 30ch);
  padding: var(--space-2) var(--space-3);
  background: var(--violet-bg);
  border: 1px solid var(--violet-line);
  color: var(--violet);
  font-size: 12.5px;
  font-style: italic;
}

/* Ce que l'agent a généré et que le vidage du buffer a jeté : personne ne l'a
   entendu, et ce n'est pas dans l'historique du modèle. Estompé, jamais masqué —
   c'est ce qu'il allait dire, et c'est ce qui explique la suite. */
.msg .unheard {
  color: var(--text-faint);
}

/* Durée d'élocution du client, sous sa bulle : neutre, hors de toute série de
   latences, et sans le moindre seuil de couleur. */
.msg-speech {
  align-self: flex-start;
  padding-left: var(--space-2);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

/* Le ton que le modèle a demandé, juste avant ce qu'il a dit. */
.msg-tags {
  display: flex;
  align-self: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Les mesures du tour, du côté de l'agent : c'est sa réponse qu'elles datent. */
.pair-meta {
  display: flex;
  align-self: flex-end;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}
.turn-idx {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
}
.why {
  width: min(78%, 60ch);
  margin: var(--space-2) 0 0 auto;
}
.why > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  list-style: none;
  border: 1px solid var(--violet-line);
  border-radius: 20px;
  background: var(--violet-bg);
  color: var(--violet);
  font-size: 11.5px;
  cursor: pointer;
}
.why > summary::-webkit-details-marker {
  display: none;
}
.why > summary::after {
  content: '›';
  flex: 0 0 auto;
  transform: rotate(90deg);
  transition: transform 0.12s;
}
.why[open] > summary::after {
  transform: rotate(-90deg);
}
.why[open] > .row {
  margin-top: var(--space-3);
}

/* ---------- recherche, dans le fil et l'inspecteur ---------- */

/* La reformulation du modèle, dans un bloc à elle : c'est elle qu'on relit
   quand une réponse est mauvaise. */
.rag-query {
  margin: var(--space-3) 0 var(--space-2);
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.rag-hits {
  margin: var(--space-3) 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.rag-hit-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}
.rag-hit-title {
  font-size: 12.5px;
  font-weight: 600;
}
.rag-hit-snippet {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-sec);
  /* Le symptôme d'origine : ce texte se cassait une lettre par ligne dans une
     cellule de tableau. Il a maintenant la largeur du panneau. */
  overflow-wrap: anywhere;
}

/* ---------- waterfall des étages d'un tour ---------- */

.wf-svg {
  display: block;
  width: 100%;
  height: auto;
}
.wf-row-label {
  fill: var(--text-faint);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wf-axis {
  fill: var(--text-faint);
  font-family: var(--mono);
  font-size: 9px;
}
.wf-tick {
  stroke: var(--border-strong);
  stroke-width: 1;
}
/* Le repère du premier audio sortant : sur un tour avec attente, c'est le
   filler qui part là. */
.wf-mark {
  stroke: var(--text-sec);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
/* Parole du client : hachurée, neutre, hors de toute somme et sans seuil. */
.wf-hatch-line {
  fill: var(--stage-speech);
}
.wf-speech {
  stroke: var(--stage-speech);
  stroke-width: 1;
}
/* L'attente est de l'audio joué, pas un étage : elle emprunte le bleu doux. */
.wf-waiting {
  fill: var(--blue-soft);
  stroke: var(--blue);
  stroke-width: 1;
}

.wf-seg {
  shape-rendering: crispEdges;
}
.wf-llm,
.wf-swatch.wf-llm {
  fill: var(--stage-detect);
  background: var(--stage-detect);
}
/* L'outil — recherche comprise — garde le violet de la recherche. */
.wf-tool,
.wf-swatch.wf-tool {
  fill: var(--stage-retrieval);
  background: var(--stage-retrieval);
}
.wf-llm2,
.wf-swatch.wf-llm2 {
  fill: var(--stage-llm2);
  background: var(--stage-llm2);
}
.wf-sentence,
.wf-swatch.wf-sentence {
  fill: var(--stage-sentence);
  background: var(--stage-sentence);
}
.wf-tts,
.wf-swatch.wf-tts {
  fill: var(--stage-tts);
  background: var(--stage-tts);
}
.wf-remainder,
.wf-swatch.wf-remainder {
  fill: var(--stage-remainder);
  background: var(--stage-remainder);
}

.wf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
}
.wf-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-sec);
}
.wf-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
/* La ligne de contrôle affiche littéralement l'addition : elle n'est pas
   décorative, c'est elle qui fera repérer le jour où le tracer et l'affichage
   divergeront. */
.wf-control {
  margin: var(--space-2) 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}

/* ---------- tuiles KPI ---------- */

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.stat {
  flex: 1 1 150px;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.stat:last-child {
  border-right: none;
}
.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sec);
}
.stat-value {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-sec);
}
.stat-row > .stat-note {
  flex-basis: 100%;
  margin: 0;
  padding: 8px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ---------- bandeau de faits ---------- */

.fact-row {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.fact {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 14px 18px;
  border-right: 1px solid var(--border);
}
.fact-label {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fact-value {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.fact.warn .fact-value {
  color: var(--warn);
}
.fact.danger .fact-value {
  color: var(--danger);
}
.fact.blue .fact-value {
  color: var(--blue);
}
.fact-latency {
  flex: 0 0 auto;
  margin-left: auto;
  border-right: 0;
  border-left: 1px solid var(--border);
  background: var(--surface-2);
}
.fact-link {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.tab .sub {
  margin-left: var(--space-2);
  font-size: 10.5px;
  font-weight: 400;
  opacity: 0.65;
}
@media (max-width: 720px) {
  .fact-row {
    flex-wrap: wrap;
  }
  .fact {
    flex: 1 1 50%;
  }
  .fact-latency {
    margin-left: 0;
  }
}

/* ---------- paires clé / valeur ---------- */

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px var(--space-5);
  align-items: baseline;
}
.kv-key {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
}
.kv-value {
  font-family: var(--mono);
  font-size: 12.5px;
  /* anywhere, pas break-all : on ne coupe un mot que si la place manque
     vraiment. break-all cassait des URLs au milieu d'une ligne à moitié vide. */
  overflow-wrap: anywhere;
}

/* Extrait de configuration, ou chunk d’un document : même bloc monospace. */
pre.snapshot,
pre.chunk {
  max-height: 320px;
  overflow: auto;
  margin: var(--space-2) 0 var(--space-4);
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- graphique ---------- */

.chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  margin-top: var(--space-2);
}
.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}
.chart-axis {
  fill: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
}
.chart-target {
  stroke: var(--amber);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.chart-target-label {
  fill: var(--warn);
  font-size: 10px;
  font-weight: 600;
}
.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
/* Zone de surveillance, pas frontière : un aplat très clair entre 800 et
   1000 ms, sous la grille du reste du graphe. */
.chart-band {
  fill: var(--warn-bg);
}
.chart-dot {
  stroke: var(--surface);
  stroke-width: 1.5;
}
/* Les points prennent la bande de `latencyTone()`, comme partout ailleurs. */
.chart-dot.ok {
  fill: var(--ok);
}
.chart-dot.warn {
  fill: var(--amber);
}
.chart-dot.danger {
  fill: var(--danger);
}
.chart-empty {
  fill: var(--text-faint);
  font-size: 13px;
}

/* ---------- vue live ---------- */

.live-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  font-size: 13px;
}
.live-line {
  display: flex;
  flex-shrink: 0;
  gap: var(--space-3);
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.live-kind {
  flex: 0 0 64px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
}
.live-line.partial {
  opacity: 0.6;
}
.live-line.agent {
  background: var(--blue-soft);
  border-color: transparent;
}
.live-line.agent .live-kind {
  color: var(--blue);
}
.live-text { min-width: 0; flex: 1; white-space: pre-wrap; overflow-wrap: break-word; }
.live-turn {
  border-top: 1px solid var(--border);
  padding: var(--space-3) 0;
  color: var(--text-sec);
  font-size: 12px;
}
.live-latest {
  display: block;
  margin: var(--space-3) 0 0 auto;
}
/* Lot L2 — écouter un appel en cours : le bouton, puis une barre compacte. */
.ll-control { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-left: auto; }
.ll-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ll-volume { width: 96px; }
.ll-mode { width: auto; }
.ll-lost { color: var(--warn); }
.live-tool-group, .live-context { display: grid; gap: 6px; }
.live-tool-group .live-http { margin-left: var(--space-4); }
.live-http-head { width: 100%; text-align: left; flex-wrap: wrap; }
.live-log > * { flex-shrink: 0; }
.live-close-toggle { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.live-waterfall { padding: var(--space-3); }

/* ---------- versionnage ---------- */

/* Bandeau d'état sous le nom de l'agent : où en sont published et draft. */
.version-banner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  align-items: center;
  padding: 10px 16px;
  margin-bottom: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.version-state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------- l'Overview d'un agent ---------- */

/* Une colonne principale élastique et un aside fixe : les mesures à gauche,
   l'état et le brouillon à droite. Une seule colonne sous 1100 px, où l'aside
   passerait sous les 300 px et cesserait d'être lisible. */
.grid.main-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 1100px) {
  .grid.main-aside {
    grid-template-columns: minmax(0, 1fr);
  }
}
.main-aside .main-col,
.main-aside .aside-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
/* Les cartes espacent déjà par la grille : la règle générale ajouterait une
   deuxième marge. */
.main-aside .card + .card {
  margin-top: 0;
}

/* La checklist « Ready to take calls? ». Un point, un texte, un lien : trois
   colonnes, pour que les points s'alignent quel que soit la longueur du texte. */
.checks {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-2);
  font-size: 13px;
}
.check-text {
  min-width: 0;
  overflow-wrap: break-word;
}

/* Trois tons, tous pris dans les jetons existants. `off` est le fait neutre —
   « pas encore » — et non un problème : une alerte qui se déclenche sur du
   normal ne sera plus lue. */
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 5px;
  flex-shrink: 0;
  background: var(--text-faint);
  box-shadow: 0 0 0 3px var(--hover);
}
.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-bg);
}
.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-bg);
}
.dot.danger {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}
.dot.off {
  background: var(--text-faint);
  box-shadow: 0 0 0 3px var(--hover);
}

/* Les trois dernières lignes du journal, dans l'aside : la date, le libellé,
   l'acteur — pas une seconde chronologie, juste de quoi savoir s'il s'est passé
   quelque chose depuis hier. */
.audit-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  font-size: 13px;
}

/* La ligne du brouillon dans la table des versions : ce n'est pas une version
   de l'histoire, c'est celle qu'on est en train d'écrire. Même encre que la
   pilule `draft`, pour qu'on lise la ligne avant de lire la colonne. */
tr.draft-row td {
  background: var(--warn-bg);
}


/* Un numéro pointe sur un brouillon : la couleur dit que ce n'est pas normal. */
select.target-draft {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn);
}

/* Une ligne de démonstration : bleu et non ambre, parce que ce n'est pas une
   anomalie — c'est un état voulu, qui doit seulement se repérer d'un coup d'œil
   dans un tableau où tout le reste est de la production. */
select.purpose-demo {
  border-color: var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

/* Lot NU1 — écran Numéros. Un menu de cellule prend la largeur de sa valeur, pas
   celle de la colonne : la règle globale `select { width: 100% }` tronquait
   « Published » en « Publ ». Elle reste intacte partout ailleurs. */
.nb-table td select { width: auto; min-width: 9rem; }
.nb-table td.nb-agent select { min-width: 16rem; }
/* Neuf colonnes dont trois menus entiers : un pas de 10 px au lieu de 16, un
   numéro et une date qui ne se coupent pas, et un en-tête long (« Dernière
   synchronisation ») qui passe sur deux lignes plutôt que d'élargir sa colonne. */
.nb-table th, .nb-table td { padding-left: 10px; padding-right: 10px; }
.nb-table td.nb-nowrap { white-space: nowrap; }
.nb-table th .th-sort { white-space: normal; text-align: left; }
/* Le filet : sous la largeur que les menus exigent, la table défile dans sa
   carte au lieu d'en déborder. */
.nb-scroll { overflow-x: auto; }
td.nb-menu-cell, th.nb-menu-cell { width: 1%; text-align: right; }
/* Les gestes rares restent discrets, révélés au survol et au focus de la ligne. */
.nb-table .nb-menu { opacity: .35; }
.nb-table tr:hover .nb-menu, .nb-table tr:focus-within .nb-menu { opacity: 1; }

/* Lot AN1 — le panier de la modale d'achat : le compte et le total, puis une
   pastille par numéro sélectionné, gardée d'une recherche à l'autre. */
.np-cart { margin: 0 0 var(--space-3); }
.np-cart-head { margin: 0 0 6px; font-weight: 600; }
.np-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.np-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 2px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.np-chip-x {
  width: 20px;
  height: 20px;
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.np-chip-x:hover { background: var(--blue-line); }
.np-select-all { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 var(--space-2); font-size: 13px; }
.np-progress { font-weight: 600; }

/* Un en-tête de table triable : le bouton garde la typographie du `th`. */
.th-sort {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  white-space: nowrap;
  cursor: pointer;
}
/* `button:hover:not(:disabled)` pèse (0,2,1) : sans ce poids, le survol peindrait un fond. */
.th-sort:hover:not(:disabled) { background: none; color: var(--text); }
.th-sort:focus-visible { outline: 2px solid var(--blue-line); outline-offset: 2px; border-radius: 4px; }
th[aria-sort='ascending'] .th-sort,
th[aria-sort='descending'] .th-sort { color: var(--text); }

.warn-note {
  color: var(--warn);
  font-size: 12.5px;
}
.ok-note {
  color: var(--ok);
}

.read-only-banner {
  border-left: 4px solid var(--border-strong);
}

.link-button {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- diff ---------- */

.diff-before {
  color: var(--danger);
}
.diff-after {
  color: var(--ok);
}

/* Le diff de texte défile plutôt que d'écraser la page : un prompt a des
   lignes longues, et les couper changerait ce qu'on lit. */
/* Au-delà du plafond du LCS, l'écran dit qu'il n'a pas aligné : le bloc qui
   suit n'est pas une réécriture. */
/* Le résumé par élément d'un tableau nommé (sources, outils, actions) précède
   son diff ligne à ligne. */
.diff-elements,
.diff-unaligned {
  margin: var(--space-3) 0 0;
}
.diff-block {
  margin-top: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--surface-2);
}
.diff-line {
  display: flex;
  gap: var(--space-3);
  padding: 0 var(--space-3);
  white-space: pre;
}
.diff-sign {
  width: 1ch;
  flex: none;
  color: var(--text-faint);
  user-select: none;
}
.diff-line.same {
  color: var(--text-sec);
}
.diff-line.add {
  background: var(--ok-bg);
  color: var(--ok);
}
.diff-line.del {
  background: var(--danger-bg);
  color: var(--danger);
}
.diff-line.add .diff-sign {
  color: var(--ok);
}
.diff-line.del .diff-sign {
  color: var(--danger);
}

/* ---------- dialogue modal ---------- */

.modal {
  width: min(680px, calc(100vw - 2 * var(--space-5)));
  padding: 24px;
  background: var(--surface);
  color: var(--text);
  border: none;
  border-radius: 14px;
  box-shadow: var(--modal-shadow);
}
.modal::backdrop {
  background: rgba(16, 32, 60, 0.45);
}
.modal-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
}
.modal-body {
  max-height: min(60vh, 520px);
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.6;
}
.modal-body p {
  margin: 0 0 10px;
}
.modal-body textarea {
  min-height: 90px;
  font-family: var(--font);
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
/* Une sortie discrete se range a gauche, loin de l'action primaire : « Just
   record it as not covered » n'est pas une variante de « Open the question »,
   et les coller ferait cliquer l'une pour l'autre. */
.modal-actions .spacer { flex: 1; }

/* ---------- test runs table + launch wizard ---------- */

.runs-filters { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.runs-filters .spacer { flex: 1; }
.runs-filters button { border: 1px solid var(--border); background: var(--surface); color: var(--text-sec); border-radius: 20px; padding: 6px 12px; cursor: pointer; }
.runs-filters button.active { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); }
.card.flush { padding: 0; overflow: hidden; }
.runs-table table { min-width: 980px; width: 100%; border-collapse: collapse; font-size: 13px; }
.runs-table th { padding: 11px 14px; background: var(--surface-2); color: var(--text-faint); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.runs-table td { padding: 11px 14px; vertical-align: middle; }
.runs-table .active-run { background: var(--blue-soft); }
.run-started, .run-version { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.run-version code { font-family: var(--mono); color: var(--text-faint); font-size: 11px; }
.run-pass { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.run-pass-track { width: 60px; height: 6px; overflow: hidden; border-radius: 4px; background: var(--track); }
.run-pass-track i { display: block; height: 100%; background: var(--blue); }
.run-pass-track i.ok { background: var(--ok); }
.run-pass-track i.warn { background: var(--warn); }
.run-pass-track i.danger { background: var(--danger); }
.run-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.run-actions-cell { width: 1%; white-space: nowrap; }
.run-menu { position: relative; }
.run-menu > summary { list-style: none; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 18px; }
.run-menu > summary::-webkit-details-marker { display: none; }
.run-menu-popover { position: absolute; z-index: 20; right: 0; top: 34px; min-width: 190px; padding: 5px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--pop-shadow); }
.run-menu-popover button { display: block; width: 100%; padding: 8px 10px; border: 0; background: transparent; text-align: left; color: var(--text); cursor: pointer; border-radius: var(--radius-sm); }
.run-menu-popover button:hover:not(:disabled) { background: var(--surface-2); }
.run-menu-popover button:disabled { color: var(--text-faint); cursor: not-allowed; }
.tests-limitation { margin: var(--space-4) 0 0; }
.tests-limitation-icon { font-size: 15px; line-height: 1.1; }
.run-lineage { color: var(--text-sec); margin: 4px 0 0; }

.modal:has(.test-run-wizard) { width: min(820px, calc(100vw - 2 * var(--space-5))); padding: 0; }
.modal:has(.test-run-wizard) .modal-title { padding: 20px 24px 0; }
.modal:has(.test-run-wizard) .modal-body { max-height: min(70vh, 680px); padding: 0 24px; }
.test-run-wizard { min-height: 430px; }
.wiz-subtitle { margin-top: -8px; color: var(--text-faint); font-size: 12.5px; }
.wiz-rail { display: flex; align-items: center; gap: 4px; margin: 14px -24px 0; padding: 0 24px 14px; border-bottom: 1px solid var(--border); }
.wiz-rail button { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text-faint); padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.wiz-rail button i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--track); color: var(--text-faint); font-style: normal; font-weight: 800; }
.wiz-rail button.done { color: var(--blue-dark); }
.wiz-rail button.done i { background: var(--blue-line); color: var(--blue-dark); }
.wiz-rail button.active { background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; border-radius: 8px; }
.wiz-rail button.active i { background: var(--blue); color: var(--surface); }
.wiz-line { flex: 1; height: 1px; background: var(--border); }
.wiz-body { display: flex; flex-direction: column; gap: var(--space-5); padding: 20px 0; }
.wiz-body > .field { margin: 0; }
.wiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }
.wiz-foot-state { color: var(--text-sec); font-size: 13px; }
.wiz-heading { margin: 0 0 9px; font-size: 13px; font-weight: 700; }
.wiz-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.wiz-pick { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; }
.wiz-pick.on { border-color: var(--blue); background: var(--blue-soft); }
.wiz-pick.off { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
.wiz-pick b, .wiz-pick .sub { display: block; }
.wiz-pick .sub { margin-top: 2px; color: var(--text-sec); font-size: 12px; }
.wiz-tools { display: flex; align-items: center; gap: var(--space-3); }
.wiz-tools input[type='search'] { flex: 1; }
.wiz-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.wiz-groups { display: flex; flex-direction: column; gap: var(--space-2); }
.wiz-theme { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.wiz-theme > summary { padding: 10px 12px; background: var(--surface-2); cursor: pointer; font-weight: 650; }
.wiz-choice { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.wiz-choice-main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.wiz-choice-main code { font-family: var(--mono); color: var(--text-sec); }
.wiz-readiness { padding: 12px; border-radius: var(--radius-md); background: var(--surface-2); }
.wiz-production { padding: 10px 12px; border: 1px solid var(--warn-line); border-radius: var(--radius-md); background: var(--warn-bg); color: var(--warn); }
.wiz-review { display: grid; grid-template-columns: 130px 1fr; margin: 0; }
.wiz-review dt, .wiz-review dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border); }
.wiz-review dt { color: var(--text-sec); }
.wiz-review dd { display: flex; justify-content: space-between; gap: 12px; }
.link-button { border: 0; padding: 0; background: transparent; color: var(--blue); cursor: pointer; }
.wiz-numbers { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; padding: 14px; border-radius: var(--radius-md); background: var(--blue-soft); }
.wiz-numbers strong { font-size: 18px; }
.wiz-numbers .field { margin-left: auto; flex-direction: row; align-items: center; }
.wiz-numbers input { width: 70px; }
.wiz-matrix { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.wiz-matrix > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 11px; border-bottom: 1px solid var(--border); }
.wiz-message { padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-2); color: var(--text-sec); }
.wiz-message.warn { background: var(--warn-bg); color: var(--warn); }
.wiz-message.danger { background: var(--danger-bg); color: var(--danger); }
@media (max-width: 720px) { .wiz-rail { align-items: flex-start; overflow-x: auto; } .wiz-line { min-width: 18px; } .wiz-review, .wiz-grid2 { grid-template-columns: 1fr; } .wiz-review dt { border-bottom: 0; padding-bottom: 0; } }

/* ---------- petits écrans ---------- */

@media (max-width: 900px) {
  :root {
    --sidebar-w: 200px;
  }
  .page-title {
    padding-left: 16px;
  }
}

/* ---------- sélecteur d'organisation ---------- */

/* Il remplace le bloc de marque dans la barre du haut : c'est du chrome, rendu
   par app.js. Aucune couleur nouvelle — les jetons du prototype suffisent. */
.org-block {
  position: relative;
  flex-shrink: 0;
}

/* Un <button> qui doit ressembler au bloc de marque : la règle globale des
   boutons lui poserait sinon un fond blanc et une bordure. */
button.org-trigger {
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: #fff;
}
button.org-trigger:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.org-chevron {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.8;
}

.org-popover {
  position: absolute;
  top: calc(100% - 4px);
  left: 12px;
  z-index: 40;
  width: 300px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--pop-shadow);
  padding: var(--space-2);
  color: var(--text);
}

.org-search {
  margin-bottom: var(--space-2);
}

.org-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.org-option {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
}
.org-option:hover {
  background: var(--hover);
  text-decoration: none;
}
.org-option.current {
  background: var(--blue-soft);
  font-weight: 600;
}
.org-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-option-slug {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.org-none {
  padding: 10px;
  color: var(--text-sec);
  font-size: 13px;
}

/* Les deux écrans de niveau instance, côte à côte au pied du sélecteur : le
   filet est porté par le pied, pas par chaque lien, sinon il en resterait deux. */
/* En colonne, et pas en rangee : a quatre entrees, « Manage organizations… »
   passe sur deux lignes dans un popover de 280 px et le pied devient un
   enchevetrement ou plus personne ne distingue les liens. Une liste se lit, et
   elle tiendra la cinquieme entree sans qu'on y revienne. */
.org-footer {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.org-manage {
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sec);
}
.org-manage:hover {
  color: var(--blue);
  text-decoration: none;
}

/* ---------- rangée de compteurs ---------- */

/* Les trois chiffres au-dessus de la liste d'agents. Ils viennent de /v1/stats,
   jamais d'une agrégation inventée dans le navigateur. */
.counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.counter-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow);
  padding: 16px 20px;
}
.counter-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
.counter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.counter-hint {
  font-size: 11.5px;
  color: var(--text-sec);
}

/* ---------- réglages d'organisation ---------- */

/* Une valeur qu'on lit et qu'on ne modifie pas : le slug. Mise en monospace
   pour dire qu'elle est un identifiant, pas une phrase. */
.mono {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

/* La carte de suppression : bordée de la couleur d'alerte, pas remplie —
   c'est un avertissement, pas une erreur en cours. */
.card.danger-zone {
  border-color: var(--danger-line);
}
.card.danger-zone > h2 {
  color: var(--danger);
}

/* ---------- journal d'audit ---------- */

/* Une chronologie se lit en diagonale : l'heure, le canal, l'acteur, puis la
   phrase. Les quatre premières colonnes sont donc de largeur fixe, et seule la
   phrase respire — sinon deux lignes voisines ne s'alignent plus et l'œil doit
   relire chacune. */
.activity-day {
  font-size: 13px;
  color: var(--text-sec);
  margin: 0 0 var(--space-3);
}
/* La chronologie se lit **en colonnes**, et ses largeurs sont fixes pour ça.
   Mais elle est montée à quatre endroits, dont un qui ne fait pas la largeur
   d'une page : la colonne de 360 px d'une fiche de décision, où la carte offre
   260 px de contenu quand les seules colonnes fixes en réclament plus de 340.
   Elle s'adapte donc à la largeur **qu'on lui donne**, pas à celle de la
   fenêtre — une media query mesurerait l'écran, ce qui ne dit rien de la place
   dont dispose ce panneau-là. */
.activity-list {
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  container-name: activity;
}
.activity-entry {
  border-top: 1px solid var(--border);
  padding: var(--space-2) 0;
}
.activity-entry:first-child {
  border-top: none;
}

/* Les événements d'une même requête, dépliés : un filet à gauche, pas une
   boîte. Créer un agent, c'est trois lignes qui se lisent comme un seul geste —
   repliées, on n'en montre qu'une. */
.activity-group {
  margin: var(--space-2) 0 var(--space-2) calc(5ch + var(--space-3));
  padding-left: var(--space-3);
  border-left: 2px solid var(--border-strong);
}
.activity-group .activity-entry {
  border-top: none;
  padding: var(--space-1) 0;
}

.activity-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.activity-time {
  flex: none;
  width: 5ch;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-faint);
}
/* Assez large pour « claude-thomas · publish » et pour « console · 92.184.x.x » :
   c'est l'acteur qu'on cherche des yeux en premier, et une colonne qui le coupe
   oblige à survoler chaque ligne pour le lire. */
.activity-actor {
  flex: none;
  width: 26ch;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}
.activity-actor > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-actor .hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Les deux colonnes que seule la vue d'organisation ajoute : l'agent concerné et
   la cible. Largeurs fixes pour la même raison que le reste — une chronologie se
   lit en colonnes, pas ligne à ligne. */
.activity-agent {
  flex: none;
  width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-target {
  flex: none;
  width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Comme `.activity-summary` : une colonne élastique **coupe**, elle ne s'enroule
   pas. `min-width: 0` autorise le rétrécissement en flex, mais sans `overflow`
   le texte sort de sa boîte au lieu d'être tronqué — c'est ce qui a fait écrire
   « Décision D-44 proposée » sur trois lignes **à côté** de la carte, dans la
   colonne étroite d'une fiche de décision. */
.activity-action {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-summary {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-sec);
  font-size: 13px;
}
/* Toutes les actions n'ont pas de résumé, et la colonne est rendue quand même.
   Vide, elle ne coûtait rien en ligne ; empilée, elle ajoute un niveau blanc. */
.activity-summary:empty {
  display: none;
}
.activity-chevron {
  flex: none;
  width: 2.5ch;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0;
}
.activity-chevron:hover {
  color: var(--text);
}

/* Sous cette largeur, les colonnes ne tiennent plus : le seul bloc fixe —
   chevron, heure, canal, acteur, et leurs gouttières — dépasse déjà la place
   disponible, donc l'action et le résumé tombent à zéro. La ligne passe alors
   sur deux niveaux : **qui**, puis **quoi**. L'ordre est posé explicitement
   parce que le chevron est le dernier enfant du DOM et doit rester en bout du
   premier niveau, là où on le cherche.
   `min-width` sur l'acteur : sans plancher il se réduit à une lettre, et une
   chronologie dont on ne peut pas lire l'acteur ne sert plus à rien. */
@container activity (max-width: 560px) {
  .activity-row {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .activity-time { order: 1; }
  .activity-row > .badge { order: 2; }
  /* Base **zéro**, et non `auto` : avec `auto` la colonne réclame la largeur de
     son contenu — « claude-thomas-recouvrement » fait 26 caractères — donc elle
     passe à la ligne au lieu de se tasser à côté de l'heure, et la ligne s'étale
     sur quatre niveaux au lieu de deux. */
  .activity-actor {
    order: 3;
    flex: 1 1 0;
    width: auto;
    min-width: 12ch;
  }
  .activity-agent,
  .activity-target {
    order: 4;
    flex: 1 1 0;
    width: auto;
    min-width: 10ch;
  }
  .activity-chevron { order: 5; }
  .activity-action {
    order: 6;
    flex: 1 1 100%;
  }
  .activity-summary {
    order: 7;
    flex: 1 1 100%;
  }
  /* Le filet des événements groupés se cale sur la colonne de l'heure ; quand
     celle-ci n'existe plus, son retrait mange la moitié de la largeur. */
  .activity-group {
    margin-left: var(--space-2);
    padding-left: var(--space-2);
  }
}

/* Le déroulé : décalé sous la ligne, sur le fond doux des surfaces secondaires,
   pour qu'on voie tout de suite à quelle ligne il appartient. */
.activity-detail {
  margin: var(--space-2) 0 var(--space-3) calc(5ch + var(--space-3));
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

/* ===================== Agent tests ===================== */
/* Same tokens as everywhere else: no new colour is invented here. A grid of
   cells is read as colour before it is read as numbers, so the three state
   backgrounds already in the palette are exactly what it needs. */

.test-launch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.test-launch-actions {
  justify-content: space-between;
  margin-top: var(--space-4);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.check {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.check .count {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.estimate {
  font-size: 13px;
  color: var(--text-sec);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: var(--space-2) var(--space-3);
}

.test-grid td,
.test-grid th {
  vertical-align: middle;
}

.test-grid th.persona {
  text-align: center;
  white-space: nowrap;
}

.test-grid td.scen {
  min-width: 260px;
}

.test-grid .theme {
  display: inline-block;
  margin-right: var(--space-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.cell-attempts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.cell {
  display: inline-block;
  min-width: 46px;
  text-align: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm, 6px);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13px;
}

.cell-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.cell-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.cell-danger {
  background: var(--danger-bg);
  color: var(--danger);
}
/* An error is not a failure: it gets the warning ground, never the danger one. */
.cell-error {
  background: var(--warn-bg);
  color: var(--warn);
}
.cell-pending {
  background: var(--track);
  color: var(--text-faint);
}

.attempt {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-size: 11px;
  border-radius: 4px;
  padding: 1px 3px;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text-sec);
}
.attempt.ok {
  border-color: var(--ok);
  color: var(--ok);
}
.attempt.danger {
  border-color: var(--danger-line);
  color: var(--danger);
}
.attempt.muted {
  color: var(--text-faint);
}

/* ---------- one simulation ---------- */

.sim-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: var(--space-4);
  align-items: start;
}

@media (max-width: 1100px) {
  .sim-layout {
    grid-template-columns: 1fr;
  }
}

/* La colonne principale : le transcript, puis ce qui serait parti après lui. */
.sim-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}
.sim-action + .sim-action {
  margin-top: var(--space-3);
}

.transcript td.role {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  white-space: nowrap;
}

/* The waiting phrase was heard but is not part of the answer, and it never
   entered the history: italics is the whole difference. */
.transcript .filler {
  margin: var(--space-1) 0 0;
  font-style: italic;
  font-size: 12px;
  color: var(--text-faint);
}

/* A cited turn wears a left rule, not a fill: a border-left would shift only
   the cited rows by 3px, an inset box-shadow does not. */
.transcript tr.cited > td:first-child {
  box-shadow: inset 3px 0 0 var(--blue-line);
}

/* The global `.anchor-spot` is a box-shadow a <tr> does not paint reliably, so
   a turn flashes with a background instead; a criterion keeps the halo. */
.transcript tr.anchor-spot {
  box-shadow: none;
}
.transcript tr.anchor-spot > td {
  background: var(--blue-soft);
}

/* A criterion cites a turn: the chip carries the relation a colour never could.
   Clicking it is a button + focusAnchor(), never a `#…` href. An inline-block,
   NOT a flex `<td>`: turning the cell into a flex container drops it out of the
   table's column model — the column then blew up and the chip floated. */
.crit-ref {
  display: inline-block;
  font-size: 11px;
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue);
  cursor: pointer;
  white-space: nowrap;
  margin: 2px 4px 2px 0;
}
.transcript td.cited-by {
  white-space: normal;
}

.crit-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}

.crit-id {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--mono, ui-monospace, monospace);
}

.verdict {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.verdict:last-child {
  border-bottom: none;
}

.verdict-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.verdict-text {
  font-weight: 600;
  color: var(--text);
}

.verdict-reason {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  color: var(--text-sec);
}

.verdict-evidence {
  margin: var(--space-2) 0 0;
  font-size: 12px;
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.thumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.thumb {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 2px var(--space-2);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
}
.thumb.on {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.thumbs .who {
  font-size: 12px;
  color: var(--text-faint);
}

.mono-small {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
}

/* The run header borrows the stat row of the call view, inside a card section
   rather than as a card of its own: it needs its own top border and no
   horizontal padding of its own. */
.test-stats {
  margin: var(--space-4) calc(-1 * var(--space-5)) calc(-1 * var(--space-4));
  border-top: 1px solid var(--border);
}
.test-stats .stat:last-child {
  border-right: none;
}

.mono-small > div {
  overflow-wrap: anywhere;
}

/* A cell that is itself the link keeps the colour and loses the underline. */
a.cell {
  text-decoration: none;
}
a.cell:hover {
  outline: 1px solid var(--border-strong);
}

/* The one-line facts under a simulation header. Without a gap they read as one
   long word, which is exactly how the first screenshot came out. */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
  font-size: 13px;
  color: var(--text-sec);
}

/* ---------- issues ---------- */

.issue {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.issue:last-child {
  border-bottom: none;
}

/* Severity is the sort order made visible: what should never have been said
   comes first, and reads as such. */
.sev {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm, 6px);
  background: var(--track);
  color: var(--text-sec);
  white-space: nowrap;
}
.sev.compliance {
  background: var(--danger-bg);
  color: var(--danger);
}
.sev.task {
  background: var(--warn-bg);
  color: var(--warn);
}

.issue .crit {
  font-weight: 600;
  color: var(--text);
}
.issue .diag {
  margin-top: var(--space-1);
  font-size: 13px;
  color: var(--text-sec);
}
.issue .links {
  margin-top: var(--space-1);
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.issue .ratio {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.issue .ratio.danger {
  color: var(--danger);
}
.issue .ratio.warn {
  color: var(--warn);
}

/* ---------- comparing two runs ---------- */

.compare-select {
  font-size: 13px;
  max-width: 260px;
}

.compare-grid td.status {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
}
/* Only the two that matter get a ground: unchanged cells are the majority. */
.compare-grid tr.row-regressed {
  background: var(--danger-bg);
}
.compare-grid tr.row-improved {
  background: var(--ok-bg);
}

/* ---------- propositions ----------
   Les propositions restent des modales : une proposition se lit puis se jette,
   elle n'est pas une ressource. Ces classes etaient declarees avec les
   `.scenario*` de l'ancien ecran ; elles vivent seules depuis le lot SC1,
   parce que `views/call-detail.js` (« Scenario from this call ») les partage. */

.proposal {
  display: flex;
  gap: var(--space-3);
  align-items: start;
  cursor: pointer;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.proposal:last-child {
  border-bottom: none;
}

.proposal-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.proposal-goal {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  color: var(--text-sec);
}

.proposal-criteria {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-4);
  font-size: 13px;
  color: var(--text-sec);
}
.proposal-criteria li {
  margin-bottom: var(--space-1);
}

/* La carte d'une persona. Elle portait les classes `.scenario*` de l'ancien
   ecran des scenarios ; celui-ci est devenu un inventaire au lot SC1, et deux
   ecrans qui partagent un nom de classe sans partager de motif finissent par
   se casser l'un l'autre. */
.persona-card {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.persona-card:last-child {
  border-bottom: none;
}
.persona-card-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.persona-card-actions {
  margin-left: auto;
}
.persona-card-desc {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  color: var(--text-sec);
}
.persona-builtin-list {
  margin-top: var(--space-3);
}

/* Le prompt d'une persona est lu, pas parcouru : il garde ses retours à la
   ligne, et il est plafonné pour qu'une liste de personas reste une liste. */
.persona-prompt {
  margin: var(--space-2) 0 0;
  padding: var(--space-2) var(--space-3);
  max-height: 9.5em;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-sec);
  white-space: pre-wrap;
}

.trait-pills {
  margin-top: var(--space-2);
}

/* Une persona tient en trois champs et un prompt : sa modale suffit. Un
   scénario, non — ses critères ont leur page depuis le lot SC1. */
.persona-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ---------- scenarios : inventaire, puis fiche (lot SC1) ----------
   Repris de `docs/yelda-air-scenarios-ui-prototype.html`, qui fait foi sur la
   mise en page. Aucune couleur nouvelle : tout vient des jetons de `:root`. */

.filters .spacer {
  flex: 1;
}
.sc-count {
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.sc-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
/* Un `<div>`, jamais un `<button>` : un bouton conteneur fait sortir le
   parseur du navigateur des qu'un second bouton y entre. */
.sc-row {
  display: grid;
  align-items: center;
  gap: var(--space-3);
  grid-template-columns: 112px minmax(190px, 1.15fr) minmax(0, 1.5fr) 128px 62px 32px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}
.sc-row:first-child {
  border-top: none;
}
.sc-row:hover {
  background: var(--surface-2);
}
.sc-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.sc-row.off .sc-title,
.sc-row.off .sc-goal {
  opacity: 0.5;
}
.sc-title {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sc-meta {
  display: block;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-goal {
  font-size: 12.5px;
  color: var(--text-sec);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Le theme est une chaine libre : les modificateurs ne peignent que ceux que
   cette feuille connait, et un theme inconnu reste neutre — ce qui est
   exactement ce qu'on veut dire de lui. */
.sc-theme {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--track);
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sc-theme.identity,
.sc-theme.identity-check,
.sc-theme.confidentialite {
  background: var(--violet-bg);
  color: var(--violet);
}
.sc-theme.tools {
  background: var(--cyan-bg);
  color: var(--cyan);
}
.sc-theme.hours {
  background: var(--warn-bg);
  color: var(--warn);
}
.sc-theme.task {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

/* La relecture : un mot, pas seulement une pastille — « depuis quand » se lit,
   un rond de 7 px ne se lit pas. Un doute est ambre, jamais rouge. */
.sc-review {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ok);
}
.sc-review::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: 0 0 auto;
}
.sc-review.warn {
  color: var(--warn);
}
.sc-review.warn::before {
  background: var(--warn);
}
.sc-review.none {
  color: var(--text-faint);
}
.sc-review.none::before {
  background: var(--border-strong);
}
.sc-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ok);
}
.sc-state::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}
.sc-state.off {
  color: var(--text-faint);
}
.sc-state.off::before {
  background: var(--border-strong);
}

/* Le menu de ligne : discret au repos, entier au survol **et au focus** — la
   discipline de `.kb-rowmenu`. Masquer, jamais griser ; jamais absent non
   plus, un bouton qui n'existe qu'au survol n'existe pas au clavier. */
.sc-menu-wrap {
  position: relative;
  justify-self: end;
}
.sc-dots {
  opacity: 0.35;
  background: none;
  border: none;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1;
  color: var(--text-sec);
  cursor: pointer;
}
.sc-row:hover .sc-dots,
.sc-dots:focus-visible,
.sc-dots[aria-expanded='true'] {
  opacity: 1;
}
.sc-dots:hover {
  background: var(--hover);
}
/* Cache par `data-open`. Le convertir en `[hidden]` ne demanderait aucune
   regle : celle du haut de la feuille gagne toujours. */
.sc-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 172px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--pop-shadow);
  padding: 5px;
  display: none;
}
.sc-pop[data-open='true'] {
  display: block;
}
.sc-pop button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.sc-pop button:hover {
  background: var(--hover);
}
.sc-pop button.danger-item {
  color: var(--danger);
}
.sc-pop .sep {
  height: 1px;
  background: var(--border);
  margin: 4px 2px;
}
.sc-empty {
  padding: 18px 16px;
  margin: 0;
}

/* ---- la fiche ---- */

.sc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-5);
}
.sc-sub {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}
.sc-side {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}
.sc-side .card {
  padding: 16px 18px;
  display: grid;
  gap: var(--space-3);
}
/* `textarea { min-height: 220px }` est faite pour le prompt systeme : ailleurs
   elle donne huit lignes de haut a un champ de deux. Le precedent exact de
   `.tl-view textarea`. */
.sc-detail textarea {
  min-height: 52px;
  height: auto;
  /* Du francais lu a voix haute, pas du JSON : la mono globale est faite pour
     le prompt systeme et pour les corps d'outils, pas pour une phrase jugee.
     Les faits connus, eux, sont des paires `cle = valeur` et la gardent. */
  font-family: var(--font);
  line-height: 1.55;
}
.sc-detail .facts {
  font-family: var(--mono);
  font-size: 12px;
}
.sc-detail .switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
/* Un interrupteur, pas une case : « Enabled » est un etat de l'agent qu'on
   bascule, et il vit dans un en-tete ou une case a cocher se lit comme un
   filtre. Scope a la fiche : la console n'en a pas ailleurs. */
.sc-detail .switch input {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 19px;
  margin: 0;
  border-radius: 20px;
  background: var(--ok);
  position: relative;
  cursor: pointer;
  transition: background 0.12s;
}
.sc-detail .switch input:not(:checked) {
  background: var(--border-strong);
}
.sc-detail .switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--surface);
  transition: left 0.12s;
}
.sc-detail .switch input:checked::after {
  left: 17px;
}
.sc-detail .switch input:disabled {
  cursor: default;
  opacity: 0.6;
}
.sc-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  font-size: 12.5px;
  margin: 0;
}
.sc-kv dt {
  color: var(--text-faint);
}
.sc-kv dd {
  margin: 0;
}

/* Un bloc par critere, pleine largeur : la phrase jugee est ce qu'on relit.
   Le lisere est colore par severity, et aucune teinte n'est nouvelle. */
.crit {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  gap: 9px;
  background: var(--surface-2);
}
.crit + .crit {
  margin-top: var(--space-2);
}
.crit.compliance {
  border-left-color: var(--danger);
}
.crit.task {
  border-left-color: var(--warn);
}
.crit.form {
  border-left-color: var(--border-strong);
}
.crit-head {
  display: grid;
  grid-template-columns: 130px 150px minmax(0, 1fr) 30px;
  gap: var(--space-2);
  align-items: center;
}
.crit-id {
  font-family: var(--mono);
  font-size: 12px;
}
.crit-x {
  border: none;
  background: none;
  color: var(--text-faint);
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  justify-self: end;
}
.crit-x:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.crit-text textarea {
  font-size: 13px;
}
.crit-params {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
.crit-params > * {
  flex: 1 1 180px;
}
.crit-params .lead {
  flex: 0 0 auto;
  align-self: center;
  font-size: 11.5px;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* La remarque du relecteur, dans le bloc du critere qu'elle vise. */
.crit-remark {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.5;
}
.crit-remark b {
  font-weight: 700;
}

@media (max-width: 1000px) {
  .sc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sc-row {
    grid-template-columns: 100px minmax(0, 1fr) 32px;
  }
  .sc-row .sc-goal,
  .sc-row .sc-review,
  .sc-row .sc-state {
    display: none;
  }
  .crit-head {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The sub-line pulls itself up under a heading that is a direct child of the
   section. After a `.row` — a heading with buttons beside it — that pull lands
   on top of the heading instead. */
.row + .card-section-sub {
  margin-top: 0;
}

/* ---------- Demo page tab ----------
   Une colonne de réglages, un aperçu à droite. Le `.split` du projet fait déjà
   les deux colonnes ; ce qui suit ne pose que ce qui lui est propre. Aucune
   couleur nouvelle : tout vient des jetons de `:root`. */


/* Le lien doit se lire en entier d'un coup d'œil : c'est ce qu'on relit avant
   de l'envoyer à un prospect, et un champ qui le tronque au milieu du token
   fait douter qu'on ait copié le bon. */
.demo-link-row {
  flex-wrap: wrap;
}

.demo-url {
  flex: 1 1 22rem;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-sec);
  background: var(--surface-2);
}

.demo-line option:disabled {
  color: var(--text-faint);
}

/* Lot WC3 — la carte « Web call ». Le QR code est le second endroit de la
   console où une couleur n'est pas un jeton, après le logo Google : sombre sur
   clair, toujours, parce qu'un QR inversé par un thème sombre ne se lit plus
   sur la moitié des téléphones. */
.wc-qr {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}
.wc-qr .qr-back {
  fill: #ffffff;
}
.wc-qr .qr-dark {
  fill: #14151f;
}
.wc-caller {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.wc-choice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.wc-number {
  font-family: var(--mono);
  max-width: 14rem;
}
.wc-warn {
  color: var(--warn);
}

/* Lot DS4 — la démo sortante : le choix du mode, puis la carte « Outbound
   call ». Préfixe `.dd-` ; les classes déjà prises par l'écran d'une décision
   (`.dd-layout`, `.dd-rule`…) ne sont pas réutilisées. */
.dd-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.dd-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: var(--space-3);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.dd-mode span {
  font-size: 0.8125rem;
  color: var(--text-sec);
}
.dd-mode[aria-pressed='true'] {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.dd-mode:disabled {
  cursor: wait;
}
.dd-checks {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.dd-check {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  font-size: 0.875rem;
}
.dd-check-mark {
  font-weight: 700;
  color: var(--ok);
  width: 1em;
  flex-shrink: 0;
}
.dd-check-warn .dd-check-mark,
.dd-warn {
  color: var(--warn);
}
.dd-map,
.dd-recent {
  margin-top: var(--space-2);
}
.dd-first {
  margin: var(--space-3) 0;
}
.dd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
}
.dd-chip {
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.dd-chip[aria-pressed='true'] {
  border-color: var(--blue);
  background: var(--blue-soft);
}
@media (max-width: 720px) {
  .dd-modes {
    grid-template-columns: 1fr;
  }
}

/* L'expiration se lit et se change au même endroit, sous le lien : c'est la
   seule des deux moitiés qu'on oublie, et une date posée depuis une
   conversation doit se voir ici sans avoir à la chercher. */
.demo-expiry {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.demo-expiry .row {
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* L'aperçu est la vraie page, dans la vraie iframe que la CSP autorise
   (`frame-ancestors 'self'`). Format paysage : c'est ainsi qu'un prospect
   l'ouvrira le plus souvent, et c'est le seul cadrage où la composition
   centrée se juge. */
.demo-preview {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}


/* ---------- lecteur d'enregistrement (lots E3, LE1) ---------- */

/* Lot FC2 : un lecteur compact — une rangée de commandes, puis les pistes. */
.card.player {
  padding: 10px var(--space-4);
}

/* Dans Conversation, le même lecteur reste disponible pendant la lecture du
   fil. Sa position sticky ne crée ni clone audio ni second canvas ; seule sa
   composition devient compacte une fois sa position naturelle dépassée. */
.player.player-sticky {
  position: sticky;
  top: var(--space-3);
  z-index: 20;
  /* Pas de transition sur la hauteur : la bascule mesure la hauteur perdue
     d’un coup (keepPlayerVisible), une animation fausserait la mesure. */
  transition: border-color 0.14s, box-shadow 0.14s;
}
.player.player-sticky.is-compact {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-color: var(--blue-line);
  box-shadow: var(--pop-shadow);
}
/* Compact : lecture/pause, horloge, canvas et vitesse ; le reste se masque. */
.player.player-sticky.is-compact .player-metas,
.player.player-sticky.is-compact .player-more-wrap,
.player.player-sticky.is-compact .player-gutter,
.player.player-sticky.is-compact .player-chips,
.player.player-sticky.is-compact .player-ruler,
.player.player-sticky.is-compact .player-head-time,
.player.player-sticky.is-compact .player-skip,
.player.player-sticky.is-compact .player-turn,
.player.player-sticky.is-compact .player-spacer,
.player.player-sticky.is-compact .player-tracks-group {
  display: none;
}
.player.player-sticky.is-compact .player-transport {
  grid-column: 1;
  grid-row: 1;
  flex-wrap: nowrap;
  margin: 0;
  padding: 0;
  border-top: 0;
}
.player.player-sticky.is-compact .player-body {
  grid-column: 2;
  grid-row: 1;
  display: block;
  min-width: 0;
}
.player.player-sticky.is-compact .player-play {
  width: 34px;
  height: 34px;
}
.player.player-sticky.is-compact .player-canvas {
  height: 64px;
}

/* Lot FC2 : la méta (stéréo, calage, arrêt au transfert) à droite de la
   rangée de commandes, puis les pistes, la vitesse et le menu ⋯. */
.player-transport > .player-metas {
  flex: 0 1 240px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-faint);
  font-size: 11px;
}
.player-meta.is-error {
  color: var(--danger);
}
.player-meta-stop::before {
  content: ' · ';
}
.player-more {
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}
/* Lot RE4 → FC2 : le téléchargement et la suppression, dans le menu ⋯. */
a.player-download {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
}
.rd-understood {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: 13px;
  cursor: pointer;
}

/* Les pistes (prototype FC2) : une gouttière de noms, puis pastilles, canvas
   et échelle — deux pistes de 26 px. */
.player-body {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 10px;
}
.player-gutter {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 20px; /* rangée des pastilles et son écart */
}
.player-lane {
  height: 26px;
  display: flex;
  align-items: center;
  transition: opacity 0.14s;
}
.player-lane.is-muted {
  opacity: 0.3;
}
.player-lane-name {
  font-size: 11px;
  color: var(--text-sec);
}
.player-lane-agent .player-lane-name {
  color: var(--blue);
}
.player-tracks {
  min-width: 0;
}
.player-chips {
  position: relative;
  height: 18px;
  margin-bottom: 2px;
}
.player-chips button {
  position: absolute;
  top: 0;
  height: 18px;
  padding: 0 4px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: var(--track);
  color: var(--text-sec);
  font-size: 10.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.player-chips button[aria-current='true'],
.player-chips button[aria-current='true']:hover:not(:disabled) {
  background: var(--blue);
  color: var(--on-accent);
  font-weight: 700;
}
/* Deux pistes sur un canvas ; l'origine et l'échelle sont le temps de
   l'enregistrement, jamais mises à l'échelle pour « tomber juste ». */
.player-lanes {
  position: relative;
  overflow: hidden;
}
.player-canvas {
  display: block;
  width: 100%;
  height: 53px;
  cursor: pointer;
}
.player-head-time {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ink-dark);
  color: var(--on-accent);
  font: 600 11px/16px var(--mono);
  pointer-events: none;
}
.player-head-time[data-edge='start'] {
  transform: none;
}
.player-head-time[data-edge='end'] {
  transform: translateX(-100%);
}
.player-ruler {
  position: relative;
  height: 14px;
  margin-top: 2px;
}
.player-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--text-faint);
  font: 10px var(--mono);
  white-space: nowrap;
}
.player-tick[data-align='start'] {
  transform: none;
}
.player-tick[data-align='end'] {
  transform: translateX(-100%);
}

/* Transport : une ligne, en tête (lot FC2) ; la phrase en cours se réduit la première. */
.player-transport {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}
.player-transport > * {
  flex-shrink: 0;
}
.player-skip {
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11.5px;
}
.player-play {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: var(--on-accent);
}
.player-play:hover:not(:disabled) {
  background: var(--blue-dark);
}
.player-clock {
  color: var(--text);
  font: 12px var(--mono);
  font-variant-numeric: tabular-nums;
}
.player-turn {
  color: var(--text-sec);
  font-size: 11.5px;
}
.player-transport > .player-spacer {
  flex: 1 1 0;
}
.player-rate {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
/* Le choix de pistes, segmenté comme au prototype FC2. */
.player-tracks-group {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.player-tracks-group button {
  height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
}
.player-tracks-group button[aria-pressed='true'],
.player-tracks-group button[aria-pressed='true']:hover:not(:disabled) {
  background: var(--track);
  font-weight: 600;
}

/* ---------- import depuis un site (lot I2) ---------- */

/* La liste défile plutôt que d'allonger la page : cinquante lignes pousseraient
   la table des documents — celle où la revue a réellement lieu — hors de l'écran. */
.kb-import-list {
  margin: var(--space-3) 0;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.kb-import-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.kb-import-row:last-child {
  border-bottom: none;
}
.kb-import-row:hover {
  background: var(--hover);
}
.kb-import-row > input[type='checkbox'] {
  margin-top: 3px;
  flex-shrink: 0;
}

.kb-import-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* `min-width: 0` sur un enfant de flex : sans lui une URL longue élargit la
     ligne au lieu de se couper, et la colonne de statut sort de la carte. */
  min-width: 0;
  flex: 1;
}
.kb-import-path {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  overflow-wrap: break-word;
}
.kb-import-title {
  font-size: 12.5px;
  color: var(--text-sec);
}

.kb-import-status {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-faint);
  text-align: right;
  max-width: 42%;
  overflow-wrap: break-word;
}
.kb-import-status.running {
  color: var(--text-sec);
}
.kb-import-status.ok {
  color: var(--ok);
}
.kb-import-status.failed {
  color: var(--danger);
}

.kb-import-actions {
  margin-top: var(--space-3);
}

/* Un document dont l'extraction n'a presque rien rendu : c'est le seul signal
   qui distingue une page utile d'un menu de navigation, et il doit sauter aux
   yeux dans la table sans avoir à ouvrir le document. */
td .kb-thin {
  color: var(--warn);
  font-weight: 600;
}

.kb-workbench { min-width: 0; }
.kb-table-scroll { min-width: 0; overflow-x: auto; padding-bottom: var(--space-2); }
.kb-filters select { width: auto; }
.kb-import-panel { margin-bottom: var(--space-4); }
.kb-insp-head .spacer { flex: 1; }
.kb-insp-head h2 { overflow-wrap: anywhere; }
.kb-desc-editor { margin-bottom: var(--space-3); }
.kb-desc-editor input { flex: 1; }
.kb-q-toggle { flex: 1; text-align: left; border: none; background: none; padding: 0; overflow-wrap: anywhere; }
.kb-q-chevron { display: inline-block; margin-right: var(--space-2); }
.kb-history-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: var(--warn); }
.kb-history-ok { background: var(--ok); }
.kb-history-error { background: var(--danger); }
.kb-rowmenu:focus-visible { opacity: 1; }
.kb-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.kb-desc:focus-visible, .kb-q-toggle:focus-visible { outline: 2px solid var(--blue); }
.kb-menu button.danger-item { color: var(--danger); }
@media (max-width: 1180px) {
  .kb-workbench > .inspector { position: static; max-height: none; }
}

/* Knowledge base workspace */
.kb-desc{font-size:13px;font-weight:400;background:none;color:var(--text-sec);margin:0 0 var(--space-3);
  padding:3px 8px;margin-left:-8px;border-radius:var(--radius-sm);cursor:text;
  border:1px solid transparent;display:inline-block}
.kb-desc:hover{border-color:var(--border);background:var(--surface)}
.kb-desc.kb-desc-placeholder{color:var(--text-faint);font-style:italic}

/* La ligne de faits remplace les quatre tuiles KPI : le modèle d'embedding
   et la date d'indexation ne sont pas des chiffres qu'on lit de loin. */
.kb-meta{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap;
  font-size:12.5px;color:var(--text-sec);margin-bottom:var(--space-4)}
.kb-meta b{color:var(--text);font-weight:700;font-variant-numeric:tabular-nums}
.kb-meta .sep{color:var(--border-strong)}
.kb-meta button.badge{border:none;cursor:pointer;font-family:inherit}
.kb-meta button.badge:hover{filter:brightness(.96)}

/* Menu d'action de l'en-tête. */
.kb-menu-wrap{position:relative}
.kb-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:20;min-width:230px;
  max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow-y:auto;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
  box-shadow:var(--pop-shadow);padding:6px;display:none}
.kb-menu[data-open=true]{display:block}
.kb-menu button{display:flex;width:100%;gap:10px;align-items:center;text-align:left;
  background:none;border:none;padding:9px 10px;border-radius:var(--radius-sm);font-weight:500;font-size:13px}
.kb-menu button:hover:not(:disabled){background:var(--hover)}
.kb-menu button .k{width:18px;text-align:center}
.kb-menu button small{display:block;color:var(--text-faint);font-size:11.5px;font-weight:400}
.kb-menu hr{border:none;border-top:1px solid var(--border);margin:6px 0}
.kb-menu button.danger-item{color:var(--danger)}

/* Puces de filtre. Un filtre actif se lit, il ne se devine pas. */
.kb-chip{padding:5px 11px;border-radius:20px;border:1px solid var(--border);
  background:var(--surface);color:var(--text-sec);font-size:12px;font-weight:600;cursor:pointer}
.kb-chip:hover{background:var(--hover)}
.kb-chip[aria-pressed=true]{background:var(--blue-soft);border-color:var(--blue-line);color:var(--blue)}
.kb-chip.danger[aria-pressed=true]{background:var(--danger-bg);border-color:var(--danger-line);color:var(--danger)}
.kb-chip.warn[aria-pressed=true]{background:var(--warn-bg);border-color:var(--warn-line);color:var(--warn)}
.kb-count{margin-left:auto;font-size:12.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}

/* La barre de sélection prend la place de la barre de filtres : deux barres
   empilées feraient sauter la table d'une ligne à chaque case cochée. */
.kb-bulk{display:none;align-items:center;gap:var(--space-3);flex-wrap:wrap;
  padding:12px 16px;margin-bottom:var(--space-4);border-radius:var(--radius);
  background:var(--blue-soft);border:1px solid var(--blue-line);color:var(--blue)}
.kb-bulk[data-open=true]{display:flex}
.kb-bulk b{font-variant-numeric:tabular-nums}

/* Table des documents. */
td.kb-pick,th.kb-pick{width:38px;padding-right:0}
tr.kb-row{cursor:pointer}
tr.kb-row[aria-selected=true] td{background:var(--blue-soft)}
tr.kb-row[aria-selected=true] td:first-child{box-shadow:inset 3px 0 0 var(--blue)}
.kb-title{font-weight:600;color:var(--text)}
tr.kb-row:hover .kb-title{color:var(--blue)}
.kb-sub{display:block;font-size:11.5px;color:var(--text-faint);font-family:var(--mono);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:340px}
.kb-thin{color:var(--warn);font-weight:700}
.kb-rowmenu{opacity:.35}
tr.kb-row:hover .kb-rowmenu{opacity:1}

/* Inspecteur d'un document. */
.kb-insp-head{display:flex;align-items:flex-start;gap:var(--space-3);margin-bottom:var(--space-3)}
.kb-insp-head h2{font-size:15px;line-height:1.35}
.kb-x{border:none;background:none;color:var(--text-faint);font-size:18px;line-height:1;padding:2px 6px}
.kb-x:hover{background:var(--hover);color:var(--text)}
.kb-insp-tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin-bottom:var(--space-4)}
.kb-insp-tab{border:none;background:none;padding:8px 12px;font-size:12.5px;font-weight:600;
  color:var(--text-sec);border-bottom:2px solid transparent;border-radius:0}
.kb-insp-tab:hover{background:none;color:var(--text)}
.kb-insp-tab[aria-selected=true]{color:var(--blue);border-bottom-color:var(--blue)}
.kb-chunk-head{display:flex;align-items:center;gap:var(--space-2);margin-top:var(--space-4)}
.kb-note{display:flex;gap:10px;padding:11px 13px;border-radius:var(--radius-sm);
  font-size:12.5px;line-height:1.5;margin-bottom:var(--space-3)}
.kb-note.warn{background:var(--warn-bg);border:1px solid var(--warn-line);color:var(--warn)}
.kb-note.danger{background:var(--danger-bg);border:1px solid var(--danger-line);color:var(--danger)}
.kb-note.blue{background:var(--blue-soft);border:1px solid var(--blue-line);color:var(--blue)}
.kb-note b{font-weight:700}
.kb-actions{display:flex;gap:var(--space-2);align-items:center;flex-wrap:wrap;margin-top:var(--space-3)}
.kb-actions .spacer{flex:1}

/* Search tester : la ligne qui dit avec quoi l'agent cherche vraiment. */
.kb-agent-line{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap;
  padding:10px 13px;border-radius:var(--radius-sm);background:var(--surface-2);
  border:1px solid var(--border);font-size:12.5px;color:var(--text-sec);margin-bottom:var(--space-4)}
.kb-agent-line .spacer{flex:1}
.kb-ask{display:flex;gap:var(--space-2);align-items:stretch}
.kb-ask input{flex:1}
.kb-history{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:var(--space-3)}
.kb-history .label{margin:0}
.kb-hist{padding:4px 10px;border-radius:20px;border:1px solid var(--border);background:var(--surface);
  font-size:12px;font-weight:500;color:var(--text-sec);cursor:pointer;font-family:inherit}
.kb-hist:hover{background:var(--hover);color:var(--text)}
.kb-hist[aria-pressed=true]{border-color:var(--blue-line);background:var(--blue-soft);color:var(--blue);font-weight:600}
.kb-hist .dot{display:inline-block;width:6px;height:6px;border-radius:50%;margin-right:6px;vertical-align:middle}
.kb-hist .dot.ok{background:var(--ok)}
.kb-hist .dot.miss{background:var(--warn)}

.kb-hit{border:1px solid var(--border);border-radius:var(--radius-md);padding:14px 16px;margin-bottom:var(--space-3)}
.kb-hit:last-child{margin-bottom:0}
.kb-hit-head{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap;margin-bottom:var(--space-2)}
.kb-hit-head .spacer{flex:1}
.kb-rank{width:22px;height:22px;border-radius:6px;background:var(--blue-soft);color:var(--blue);
  display:grid;place-items:center;font-size:11.5px;font-weight:700;flex-shrink:0}
.kb-score{font-family:var(--mono);font-size:12px;color:var(--text-sec);font-variant-numeric:tabular-nums}
.kb-hit pre.chunk{margin:0}

/* Questions : une question posée douze fois est une ligne, pas douze. */
.kb-q{border:1px solid var(--border);border-radius:var(--radius-md);margin-bottom:var(--space-2);
  background:var(--surface);overflow:hidden}
.kb-q:last-child{margin-bottom:0}
.kb-q-head{display:flex;align-items:center;gap:var(--space-3);padding:13px 16px;cursor:pointer;flex-wrap:wrap}
.kb-q-head:hover{background:var(--surface-2)}
.kb-q-query{font-weight:600;min-width:0;flex:1}
.kb-q-query .kb-q-chevron{display:inline-block;width:14px;color:var(--text-faint);transition:transform .12s}
.kb-q[data-open=true] .kb-q-chevron{transform:rotate(90deg)}
.kb-q-stats{display:flex;gap:var(--space-2);align-items:center;flex-wrap:wrap}
.kb-q-when{font-size:12px;color:var(--text-faint);white-space:nowrap}
.kb-q-body{display:none;padding:0 16px 14px;border-top:1px solid var(--border);background:var(--surface-2)}
.kb-q[data-open=true] .kb-q-body{display:block}
.kb-q-call{display:flex;gap:var(--space-3);align-items:center;padding:8px 0;border-bottom:1px solid var(--border);
  font-size:12.5px;flex-wrap:wrap}
.kb-q-call:last-child{border-bottom:none}
.kb-q-call .mono{font-family:var(--mono);font-size:12px;color:var(--text-sec)}
.kb-q-call .spacer{flex:1}
.usage-card { padding: var(--space-5); margin-bottom: var(--space-5); }
.usage-card h2 { margin-bottom: var(--space-4); }
.usage-chart { display: flex; align-items: flex-end; gap: 3px; height: 190px; border-bottom: 1px solid var(--border); }
.usage-day { flex: 1; min-width: 2px; display: flex; flex-direction: column-reverse; justify-content: flex-start; height: 180px; }
.usage-day:hover { outline: 1px solid var(--text-sec); }
.usage-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-5); color: var(--text-sec); font-size: 12px; }
.usage-legend span { display: flex; align-items: center; gap: var(--space-2); }
.usage-legend i { width: 9px; height: 9px; border-radius: 2px; }
.usage-axis { display: flex; justify-content: space-between; color: var(--text-sec); font-size: 12px; margin-top: var(--space-2); }
.usage-microbar { display: flex; height: 7px; min-width: 100px; max-width: 170px; border-radius: var(--radius-sm); overflow: hidden; background: var(--track); }
.usage-card small { display: block; font-size: 11px; }
.usage-card .table-wrap { overflow-x: auto; }

/* ---------- panneau Tools (lot T8) ---------- */

/* Un filet entre deux blocs, comme partout ailleurs dans la console. */
.rule { border: 0; border-top: 1px solid var(--border); margin: var(--space-4) 0 0; }

/* Le panneau est un routeur de vues : inventaire, une fiche par outil,
   comportement partagé. On masque, on ne démonte jamais — un contrôle démonté
   est un champ perdu à la sauvegarde suivante. */
.tl-narrow { max-width: 460px; }
.tl-view textarea { min-height: 88px; height: auto; }
.tl-view .faint { font-weight: 400; color: var(--text-faint); }

/* La barre de l'inventaire : filtres à gauche, action à droite. Les filtres
   sont des pilules `.tab` compactes — le même composant que partout. */
.tl-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.tl-bar .spacer { flex: 1; }
.tl-filter .count { margin-left: 5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
/* Lot OU1 : un segmenté, plus des pilules `.tab` — les pilules bleues sont les
   onglets de l'éditeur. Une famille sans outil n'a pas de bouton. */
.tl-filters { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--track); }
.tl-filter { border: none; border-radius: 999px; background: transparent; padding: 5px 12px; font-size: 13px; font-weight: 500; color: var(--text-sec); cursor: pointer; }
.tl-filter:hover:not(:disabled) { color: var(--text); background: transparent; }
.tl-filter[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 32, 60, .12); }

/* La liste. Une ligne = un outil tel que le modèle le voit, jamais une ligne
   de formulaire : on lit d'abord, on édite ensuite. */
.tl-list { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.tl-row {
  display: grid;
  /* Lot OU1 : icône · nom et méta · consigne · pastilles · point d'état · chevron. */
  grid-template-columns: 30px minmax(190px, 250px) minmax(0, 1fr) auto 12px 12px;
  gap: 14px;
  align-items: center;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  text-align: left;
  width: 100%;
  border-radius: 0;
  font: inherit;
  color: inherit;
}
.tl-row:first-child { border-top: none; }
.tl-row:hover { background: var(--surface-2); }
.tl-id { min-width: 0; }
.tl-key { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 7px; }
.tl-key .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: 0 0 auto; }
.tl-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* Deux lignes de consigne, pas plus : c'est ce qui permet de comparer deux
   outils d'un coup d'oeil, ce que deux formulaires ne permettent pas. */
/* Lot OU1 : une ligne, et le texte entier dans le `title`. Une seule hauteur
   pour toutes les lignes, c'est ce qui laisse lire la colonne d'un coup d'oeil. */
.tl-when { font-size: 12.5px; color: var(--text-sec); line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tl-chev { color: var(--text-faint); font-size: 15px; text-align: right; }
.tl-empty { padding: 18px 16px; margin: 0; }

/* Le type, en badge : une couleur par famille. Violet = recherche, la même
   teinte que le RAG sur la page d'un appel — une seule convention. */
.tl-kind {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 0; width: 86px; border-radius: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
}
.tl-kind.transfer { background: var(--blue-soft); color: var(--blue-dark); }
.tl-kind.hangup { background: var(--warn-bg); color: var(--warn); }
.tl-kind.sms { background: var(--ok-bg); color: var(--ok); }
.tl-kind.api { background: var(--cyan-bg); color: #0f7c8b; }
.tl-kind.search { background: var(--violet-bg); color: var(--violet); }
/* Lot HS2 : un calendrier. Neutre — il dit quand, pas ce que l'outil fait. */
.tl-kind.hours { background: var(--track); color: var(--text-sec); }
.tl-family { margin: var(--space-5) 0 var(--space-2); font-size: 13px; font-weight: 700; }
.tl-hours-bar { margin-top: var(--space-5); margin-bottom: var(--space-2); }
.tl-hours-bar .tl-family { margin: 0; }
.tl-refusal { color: var(--danger); }

/* L'état. Un point plein, pas une case à cocher : on ne coche rien depuis une
   liste, on lit. Le basculement se fait dans la fiche. */
.tl-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--ok); }
.tl-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.tl-state.off { color: var(--text-faint); }
.tl-state.off::before { background: var(--border-strong); }
.tl-state.locked { color: var(--text-faint); }
.tl-state.locked::before { background: var(--violet); }

/* Un outil coupé reste lisible, et reste au même endroit : on l'estompe, on ne
   le déplace pas en bas de liste — on le cherche là où on l'a laissé. */
.tl-row.off .tl-key, .tl-row.off .tl-when { opacity: .55; }

/* Lot OU1 — l'icône d'une ligne. Sa couleur dit ce que l'outil fait : ambre pour
   un effet, violet pour une lecture, gris pour ni l'un ni l'autre ; un
   calendrier est bleu, la couleur de sa pastille. Aucune teinte nouvelle. */
.tl-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 750; letter-spacing: .02em; }
.tl-ico svg { width: 16px; height: 16px; }
.tl-ico.effect { background: var(--warn-bg); color: var(--warn); }
.tl-ico.read { background: var(--violet-bg); color: var(--violet); }
.tl-ico.neutral { background: var(--track); color: var(--text-sec); }
.tl-ico.hours { background: var(--blue-soft); color: var(--blue-dark); }
.tl-row.off .tl-ico { opacity: .55; }
.tl-key.plain { font-family: var(--font); }
/* Un `span` inline ne se coupe pas en ellipse : la méta passe en bloc dans sa colonne. */
.tl-row .tl-meta { display: block; }
.tl-pills { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.tl-pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--text-sec); background: var(--surface); white-space: nowrap; }
.tl-pill.cal { border-color: var(--blue-line); color: var(--blue-dark); background: var(--blue-soft); }
.tl-pill[data-open-hours]:hover { border-color: var(--blue); }
.tl-link { font-size: 12px; color: var(--blue); white-space: nowrap; }
/* Le point d'état, à la place de « Live » répété sur chaque ligne. */
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); justify-self: center; }
.tl-dot.off { background: var(--neutral); box-shadow: 0 0 0 3px var(--track); }

/* Lot OU1 — une ligne de calendrier : icône · nom · état du serveur et
   destinations qui le citent · mini-semaine · chevron. */
.tl-row.tl-hrow { grid-template-columns: 30px minmax(190px, 260px) minmax(0, 1fr) 230px 12px; }
.tl-hcell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tl-hstate { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ok); }
.tl-hstate i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.tl-hstate.closed { color: var(--text-sec); }
.tl-hstate.closed i { background: var(--neutral); }
.tl-cited { display: flex; gap: 6px; flex-wrap: wrap; }
.tl-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.tl-strip > span { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; color: var(--text-faint); text-align: center; }
.tl-strip > span.today { color: var(--text); font-weight: 650; }
.tl-strip i { display: block; position: relative; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.tl-strip i b { position: absolute; top: 0; bottom: 0; background: var(--blue-line); border-radius: 3px; }
.tl-lede { font-size: 13px; color: var(--text-sec); }

/* Lot OU1 — les sous-onglets du panneau : soulignés, jamais en pilules (les
   pilules sont les onglets de l'éditeur). Ils restent visibles sur une fiche. */
.tl-subtabs { display: flex; align-items: center; gap: 26px; border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.tl-subtabs .spacer { flex: 1; }
.tl-subtab { position: relative; display: inline-flex; align-items: center; gap: 7px; border: none; border-radius: 0; background: none; padding: 12px 0 11px; font-size: 14px; font-weight: 550; color: var(--text-sec); cursor: pointer; white-space: nowrap; }
.tl-subtab:hover:not(:disabled) { color: var(--text); background: none; }
.tl-subtab[aria-selected="true"] { color: var(--text); }
.tl-subtab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue); }
.tl-cnt { font-size: 12px; font-weight: 600; color: var(--text-sec); background: var(--track); border-radius: 999px; padding: 0 7px; line-height: 18px; font-variant-numeric: tabular-nums; }
.tl-subtab[aria-selected="true"] .tl-cnt { background: var(--blue-soft); color: var(--blue-dark); }
.tl-chg { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.tl-subtabs-end { display: flex; align-items: center; gap: 8px; }
.tl-info { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-sec); font-size: 12px; font-weight: 700; line-height: 1; padding: 0; display: grid; place-items: center; cursor: pointer; }
.tl-info:hover:not(:disabled) { color: var(--blue); border-color: var(--blue); background: var(--surface); }
.tl-about { width: 360px; max-width: 80vw; padding: 4px 6px; font-size: 12.5px; line-height: 1.5; white-space: normal; }
.tl-about p { margin: 0 0 8px; color: var(--text); }
.tl-about .tl-cap { font-size: 12px; }
.tl-receives { border: none; background: none; padding: 4px 8px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 550; color: var(--blue); cursor: pointer; white-space: nowrap; }
.tl-receives:hover:not(:disabled) { background: var(--blue-soft); }

/* Lot OU2 — le comportement partagé en page de réglages : un sommaire collant,
   des sections, une ligne par réglage (libellé et une ligne d'aide à gauche,
   contrôle à droite). Le pourquoi long vit dans un « ? » (`.tl-info`). */
.tl-set-lede { margin: 0 0 var(--space-4); color: var(--text-sec); font-size: 13px; }
.tl-set-split { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.tl-toc { position: sticky; top: var(--space-4); display: flex; flex-direction: column; gap: 2px; }
.tl-toc button { display: block; width: 100%; text-align: left; border: none; background: transparent; border-radius: var(--radius-sm); padding: 7px 10px; cursor: pointer; }
.tl-toc button:hover:not(:disabled) { background: var(--hover); }
.tl-toc button[aria-current="true"] { background: var(--blue-soft); }
.tl-toc b { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--text); }
.tl-toc small { display: block; font-size: 12px; color: var(--text-sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-toc button.dim b { color: var(--text-faint); }
.tl-set-sec { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 16px; scroll-margin-top: 60px; background: var(--surface); }
.tl-set-sec > header { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.tl-set-sec > header h3 { margin: 0; font-size: 15px; color: var(--text); }
.tl-set-sec > header .spacer { flex: 1; }
.tl-set-sub { color: var(--text-sec); font-size: 12.5px; }
.tl-set-sec.dim > header h3 { color: var(--text-sec); }
.tl-set { display: grid; grid-template-columns: minmax(220px, 38%) minmax(0, 1fr); gap: 20px; align-items: start; padding: 13px 18px; }
.tl-set + .tl-set, .tl-set + .tl-adv, .tl-adv > .tl-set { border-top: 1px solid var(--border); }
.tl-set-wide { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.tl-set-l b { display: block; font-weight: 600; font-size: 13.5px; color: var(--text); }
.tl-set-l small { display: block; color: var(--text-sec); font-size: 12.5px; margin-top: 2px; }
.tl-set-c { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-set-c > input, .tl-set-c > textarea, .tl-set-c > .tl-set-stack, .tl-set-c > .tw-block, .tl-set-c > .tl-requires { flex: 1; min-width: 0; }
.tl-set-stack { display: flex; flex-direction: column; gap: 8px; }
.tl-set-stack > .tl-switch { align-self: flex-start; }
/* Le libellé « While it runs » du formulaire d'attente : la ligne porte déjà le sien. */
.tl-set-c .tw-block > label.field > .label { display: none; }
.tl-unit { display: inline-flex; align-items: center; gap: 8px; color: var(--text-sec); }
input.tl-num { width: 76px; text-align: right; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tl-tag { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 1px 4px; background: var(--surface); }
.tl-tag input { border: none; padding: 3px 6px; background: transparent; field-sizing: content; min-width: 12ch; max-width: 42ch; width: auto; }
.tl-tag input:focus { outline: none; }
.tl-tag:focus-within { border-color: var(--blue); }
.tl-tag button { border: none; background: transparent; color: var(--text-faint); padding: 0 4px; font-size: 15px; line-height: 1; cursor: pointer; }
.tl-tag button:hover:not(:disabled) { color: var(--danger); background: transparent; }
.tl-addtag { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: transparent; padding: 4px 10px; color: var(--text-sec); font-size: 13px; cursor: pointer; }
.tl-addtag:hover:not(:disabled) { color: var(--blue); border-color: var(--blue); background: transparent; }
.tl-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.tl-sentence select { width: auto; max-width: 100%; }
.tl-adv > summary { list-style: none; cursor: pointer; padding: 11px 18px; color: var(--text-sec); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.tl-adv > summary::-webkit-details-marker { display: none; }
.tl-adv > summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 15px; }
.tl-adv[open] > summary::before { transform: rotate(90deg); }
.tl-set-idle { display: flex; gap: 12px; align-items: center; padding: 14px 18px; color: var(--text-sec); font-size: 13px; }
.tl-set-idle .spacer { flex: 1; }
.tl-warnline { font-size: 12.5px; color: var(--warn); }
.tl-segc { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.tl-segc button { border: none; border-radius: 0; background: var(--surface); padding: 6px 12px; font-size: 13px; color: var(--text-sec); cursor: pointer; }
.tl-segc button + button { border-left: 1px solid var(--border-strong); }
.tl-segc button:hover:not(:disabled) { background: var(--hover); }
.tl-segc button[aria-pressed="true"] { background: var(--blue-soft); color: var(--blue-dark); font-weight: 600; }
@media (max-width: 900px) {
  .tl-set-split { grid-template-columns: minmax(0, 1fr); }
  .tl-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .tl-toc button { width: auto; }
  .tl-set { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

/* L'interrupteur de la fiche. */
/* L'etat d'un outil dans sa fiche : une **pastille**, comme dans l'inventaire
   (`.tl-state`), et non une case a cocher nue — c'est le meme fait, il doit se
   lire pareil aux deux endroits. La case reste dans le DOM et reste
   focalisable : `read()` lit son `.checked`, et la retirer serait exactement la
   faute du lot T7. On ne fait que remplacer son dessin par le point. */
.tl-switch {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 4px 11px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: var(--ok-bg); color: var(--ok);
}
.tl-switch input {
  appearance: none; -webkit-appearance: none;
  margin: 0; width: 7px; height: 7px; border-radius: 50%; border: none;
  background: var(--ok); cursor: pointer;
}
.tl-switch:has(input:not(:checked)) { background: var(--track); color: var(--text-faint); }
.tl-switch input:not(:checked) { background: var(--border-strong); }
.tl-switch input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tl-switch input:disabled { cursor: default; }

/* Le pied de l'inventaire : les réglages partagés et ce que l'instance sait
   faire (get_catalog). Un bandeau plat, jamais une section pliable de plus. */
.tl-foot { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.tl-foot.flat { border-top: none; padding-top: 0; margin-top: var(--space-2); }
.tl-foot .spacer { flex: 1; }
.tl-cap { font-size: 11.5px; color: var(--text-faint); }
.tl-cap b { color: var(--text-sec); font-weight: 600; }

/* Menu « Add tool ». */
.tl-add { position: relative; }
.tl-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 290px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--pop-shadow); padding: 6px;
}
.tl-menu button { display: flex; gap: 10px; width: 100%; text-align: left; border: none; background: none; padding: 10px 11px; border-radius: 8px; align-items: flex-start; }
.tl-menu button:hover { background: var(--hover); }
.tl-menu .mi-text { display: flex; flex-direction: column; gap: 2px; }
.tl-menu .mi-text b { font-size: 13px; font-weight: 600; }
.tl-menu .mi-text span { font-size: 11.5px; color: var(--text-sec); font-weight: 400; line-height: 1.4; }

/* ---------- la fiche d'un outil ---------- */
.tl-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-2); }
.tl-head .spacer { flex: 1; }
.tl-back { font-size: 12.5px; font-weight: 600; color: var(--text-sec); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tl-back:hover { color: var(--blue); text-decoration: none; }
/* Lot OU1 : le retour est un bouton (pas d'ancre, donc pas de route). */
button.tl-back { border: none; background: none; padding: 0; }
button.tl-back:hover:not(:disabled) { background: none; }
.tl-title { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--text); }
.tl-title.plain { font-family: var(--font); }

/* ---------- sous-onglets d'une fiche ----------
   Pas `.tab` : la classe globale existe deja et rend une pilule bleue. Tout ce
   chantier est prefixe `tl-`. */
.tl-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; margin-bottom: var(--space-4); }
/* `border-radius: 0` n'est pas cosmetique : le `button` global porte
   `border-radius: var(--radius-sm)`, et un `border-bottom` sur un coin arrondi
   se courbe aux deux bouts — le soulignage de l'onglet actif dessinait une
   parenthese au lieu d'un trait. Reinitialiser `border` ne suffit pas, le rayon
   survit. */
.tl-tab { display: inline-flex; align-items: center; gap: 7px; border: none; border-radius: 0; background: none; padding: 11px 13px 9px; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 500; color: var(--text-sec); white-space: nowrap; cursor: pointer; }
/* `button:hover:not(:disabled)` vaut (0,2,1) contre (0,1,0) pour `.tl-tab` : il
   gagne, et repeignait au survol le fond arrondi d'un bouton-pilule sur un
   onglet plat. Le survol d'un onglet ne change que sa couleur de texte. */
.tl-tab:hover:not(:disabled) { color: var(--text); background: none; }
.tl-tab[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.tl-tab .sum { font-family: var(--mono); font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* La pastille est un noeud **toujours present** et vide : c'est la classe qui
   la montre. Un noeud ajoute et retire a chaque peinture ferait clignoter la
   barre a chaque frappe. */
.tl-flag { display: none; width: 6px; height: 6px; border-radius: 50%; }
.tl-flag.warn { display: block; background: var(--warn); }
.tl-flag.danger { display: block; background: var(--danger); }

/* Un panneau est un **flux**, pas une grille. La grille du lot T17 ajoutait son
   `gap` aux marges que les enfants portent deja : `.field` a 18 px de
   margin-bottom, `.card-section-sub` un pull-up de -12 px fait pour se coller
   sous un `h2`, et un `.label` collait a 6 px de sa table. Resultat : 34 px
   entre deux champs, un sous-titre remonte dans la barre d'onglets, et un
   libelle detache de ce qu'il nomme. */
.tl-pane { display: block; }

/* L'en-tete d'un panneau : le couple `h2` + `.card-section-sub` du reste de la
   console, dont les marges sont accordees (16 px moins 12 px de pull-up). */
.tl-pane > h2 { margin-bottom: var(--space-4); }

/* `whenToUseField()` et `mocksSection()` sont partages avec les fiches Transfer
   et Message, ou leur cadre de `.card-section` est juste. Dans un panneau il
   trace un filet en travers et ajoute 22 px : on le neutralise ici, sans
   toucher au helper. */
.tl-pane .card-section { border-top: none; padding: 0; }
.tl-pane .card-section + .card-section { margin-top: var(--space-5); }

/* Un libelle et ce qu'il nomme forment un bloc : c'est le bloc qui s'espace de
   ses voisins, jamais le libelle de sa table. */
.tl-group { margin-bottom: 18px; }
.tl-group > .label { margin-bottom: 6px; }

/* ---------- rail d'essai ----------
   Le testeur n'est pas une etape de la configuration : c'est un instrument, et
   rien de ce qu'on y saisit n'entre dans read(). Il sort donc du defilement.
   Sans agent -- un agent qui n'existe pas encore, la vue d'une version
   publiee -- la fiche retombe sur une seule colonne. */
.tl-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; }
.tl-split.norail { grid-template-columns: minmax(0, 1fr); }
.tl-split-main { min-width: 0; }
.tl-rail { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); position: sticky; top: var(--space-4); }
.tl-rail-head { display: flex; align-items: center; gap: var(--space-2); padding: 11px 14px; border-bottom: 1px solid var(--border); }
.tl-rail-head h3 { margin: 0; font-size: 13px; }
.tl-rail-head .spacer { flex: 1; }
.tl-rail-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 600; }
.tl-rail-body { display: grid; gap: var(--space-3); padding: 13px 14px 16px; min-width: 0; }
/* Seuls les boutons **du rail lui-meme** : le journal d'essais porte son propre
   bouton « Clear », qui n'a rien a faire en pleine largeur. */
.tl-rail-body > button { width: 100%; }

/* Le journal d'essais a ete dessine pour la pleine largeur (lot T15) : sa
   grille a sept colonnes fait plus de 400 px et deborderait le rail. Ici
   l'en-tete revient a un enroulement simple — les memes informations, sur
   deux lignes plutot que derriere un defilement horizontal. */
.tl-rail .tl-log-head { display: flex; flex-wrap: wrap; gap: 4px var(--space-3); }
.tl-rail .tl-log-head .host { overflow-wrap: anywhere; }

/* La septieme colonne de l'en-tete : ce qu'il faut savoir de l'essai avant de
   le deplier — la cible hors defaut, et le corps substitue. Toujours rendue,
   souvent vide : une colonne qui apparait et disparait decale les six autres. */
.tl-log-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- la sonde de contrat (lot T17) ----------
   Replie par defaut, et jamais memorise : on ne doit pas pouvoir rester dedans
   sans s'en apercevoir. Ouvert, le bandeau ambre est permanent — ce n'est pas
   un avertissement qu'on acquitte, c'est l'etat dans lequel on est. */
.tl-probe { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tl-probe > summary {
  cursor: pointer; padding: 8px 11px;
  font-size: 12px; font-weight: 600; color: var(--text-sec);
}
.tl-probe[open] > summary { border-bottom: 1px solid var(--border); color: var(--text); }
.tl-probe-body { display: grid; gap: 8px; padding: 10px 11px 12px; }
.tl-probe-warn {
  margin: 0; padding: 7px 9px; border-radius: var(--radius);
  border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn);
  font-size: 12px; line-height: 1.45; font-weight: 600;
}
/* La regle globale `textarea { min-height: 220px }` est faite pour le prompt
   systeme : ici elle donnerait la moitie de l'ecran a six lignes de JSON.
   `.tl-view textarea` la neutralise deja ; on fixe la hauteur utile. */
.tl-probe-body textarea { min-height: 120px; }

/* Sous 1100 px le rail passe dessous : la table des parametres et celle des
   en-tetes recuperent la largeur, et le sticky n'a plus de sens. */
@media (max-width: 1100px) {
  .tl-split { grid-template-columns: minmax(0, 1fr); }
  .tl-rail { position: static; }
}

/* Le compteur d'un champ borné par le schéma : 400 caractères sur whenToUse. */
.tl-count { float: right; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.tl-count.over { color: var(--danger); }

/* Un encart de lecture : ce que l'appelant entend, ce que l'API renverrait.
   Fond doux, jamais un champ de saisie. */
.tl-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px 15px; font-size: 13px; line-height: 1.6; }
.tl-preview .lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); display: block; margin-bottom: 6px; }
.tl-preview.speech { border-left: 3px solid var(--blue); }
.tl-preview em { color: var(--text-sec); font-style: normal; }
.tl-flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-sec); margin-top: var(--space-3); }
.tl-flow .step { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 4px 11px; font-weight: 600; color: var(--text); }
.tl-flow .arrow { color: var(--text-faint); }

/* Les variables détectées : des pastilles, jamais un champ. Elles se lisent
   dans le corps du message ou dans l'URL, elles ne se saisissent pas. */
.tl-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tl-chip { font-family: var(--mono); font-size: 11.5px; background: var(--blue-soft); color: var(--blue-dark); border-radius: 6px; padding: 3px 8px; font-weight: 600; border: none; }
.tl-chip.miss { background: var(--danger-bg); color: var(--danger); }
button.tl-chip { cursor: pointer; }

/* L'aperçu d'un SMS : la largeur d'un téléphone, parce que c'est la seule
   façon de voir qu'un message est trop long avant de l'envoyer. */
.tl-phone { max-width: 300px; background: var(--blue-soft); border: 1px solid var(--blue-line); border-radius: 14px 14px 14px 3px; padding: 11px 13px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.tl-phone .opt { color: var(--text-sec); }
.tl-sms-foot { margin-top: 10px; gap: var(--space-3); }

/* Tableau des paramètres d'un outil API : le seul tableau qui reste éditable,
   parce que quatre colonnes courtes tiennent sans défilement. */
.tl-params { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); margin-bottom: var(--space-2); }
.tl-params th { font-size: 10.5px; font-weight: 700; color: var(--text-sec); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.tl-params th.k { width: 210px; }
.tl-params th.ty { width: 110px; }
.tl-params th.req, .tl-params th.act { width: 80px; }
.tl-params td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tl-params tr:last-child td { border-bottom: none; }
.tl-params input[type=text], .tl-params select { padding: 6px 9px; font-size: 12.5px; width: 100%; }
.tl-params td.k input { font-family: var(--mono); }
.tl-params td.req { text-align: center; }
/* Lot PR2 — les contraintes d'un paramètre : valeurs admises en étiquettes, bornes en ligne. */
.tl-param-constraints { margin-top: 6px; display: grid; gap: 6px; }
.tl-param-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tl-param-chip { font-size: 11.5px; font-family: var(--mono); padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.tl-param-bounds { gap: 6px; align-items: center; }
.tl-params .tl-param-bounds input[type=number] { width: 90px; padding: 6px 9px; font-size: 12.5px; }
.tl-params td.act { text-align: right; }
.tl-params td.empty { color: var(--text-faint); font-size: 12.5px; }
.tl-params .src { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.tl-params .src.warn { color: var(--warn); }

/* Méthode et URL sur une ligne : la méthode est un choix court, l'URL est
   longue, et les séparer verticalement ferait perdre le lien entre les deux. */
.tl-request { flex-wrap: nowrap; gap: 10px; margin-bottom: var(--space-3); }
.tl-request select { width: 110px; flex: 0 0 auto; }
.tl-request input { font-family: var(--mono); font-size: 12.5px; }

.tl-headers-block { margin-top: var(--space-4); }
.tl-headers { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-2); }
.tl-header-row { display: grid; grid-template-columns: 220px 1fr 34px; gap: 8px; align-items: center; }

/* Le testeur d'outil. Rien qu'avec les jetons du systeme : ce lot ajoute des
   champs et un historique, pas une couleur. */
.tl-testargs { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-3); }
.tl-testargs input { font-family: var(--mono); font-size: 12.5px; }

/* Les cas nommes d'un endpoint et son canari. Aucune couleur nouvelle : un
   `drift` est ambre parce que c'est un AVERTISSEMENT — l'API du client a
   change, pas le produit — et `unreachable` rouge parce que la, quelque chose
   ne repond pas. Les deux teintes existent deja dans `badge`. */
.tl-mocks { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-2); }
.tl-mock-row { display: grid; grid-template-columns: 160px 80px 100px 1fr 34px; gap: 8px; align-items: start; }
.tl-mock-row textarea { min-height: 44px; }

.tl-canary { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.tl-canary .row { align-items: center; gap: 8px; }

/* Le bandeau de derive, en tete du panneau. Il ne s'affiche que quand il a
   quelque chose a dire : un bandeau toujours present est un bandeau que
   personne ne lit. */
.tl-drift {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  background: var(--warn-bg);
}

.tl-fillers { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }

/* « While it runs » (lot W3) : l'attente d'un outil. Préfixe `tw-` — `wf-` est
   pris par le waterfall. Les phrases sont masquées, jamais démontées, et le bloc
   masqué porte sa propre règle : `display: flex` battrait le `display: none` du
   navigateur à spécificité égale. */
.tw-block { display: flex; flex-direction: column; gap: 8px; }
.tw-phrases { display: flex; flex-direction: column; gap: 8px; }
.tw-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tw-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: var(--radius);
  /* Neutre : le violet et l'ambre disent ce que l'outil fait, pas comment il attend. */
  border: 1px solid var(--border);
  background: var(--track);
  color: var(--text-sec);
  font-size: 11px;
}

/* Les heures d'ouverture. Rien qu'avec les jetons du systeme : pas une couleur
   nouvelle. */
.tl-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
  font-size: 12.5px;
}
.tl-banner .txt { font-weight: 700; }
.tl-banner .hint { margin: 0; font-family: var(--mono); }
.tl-at { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--text-sec); }

.tl-week { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-3); }
.tl-day { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tl-day-body { margin: 8px 0 0 24px; }
.tl-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.tl-check input { margin: 0; }

.tl-ranges, .tl-closures { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.tl-range, .tl-closure { display: flex; align-items: center; gap: 8px; }
.tl-range .sep, .tl-closure .sep { color: var(--text-faint); }
.tl-closure input[type='text'] { flex: 1; }

.tl-holidays { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin: 8px 0; }

/* Lot OU3 — la fiche horaire : bandeau d'état, réglages sur une ligne, la
   semaine en frise 0-24 h, les exceptions. Les sections reprennent la grammaire
   de la page de réglages (`.tl-set-sec`, `.tl-set`). */
.sch-card .tl-set-sec { margin-bottom: var(--space-4); }
.sch-card .tl-banner { padding: 12px 16px; margin-bottom: var(--space-4); border-radius: var(--radius-md); font-size: 13px; }
.tl-banner .txt { font-weight: 400; }
.tl-banner .txt b { font-weight: 700; }
.tl-banner.is-open { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.tl-banner.is-closed { background: var(--track); border-color: transparent; color: var(--text-sec); }
.sch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); flex: none; }
.tl-banner.is-open .sch-dot { background: var(--ok); }
.sch-inline { display: flex; gap: 28px; flex-wrap: wrap; padding: 13px 18px; }
.sch-field small { display: block; color: var(--text-sec); font-size: 12.5px; margin-bottom: 5px; }
.sch-field-c { display: flex; align-items: center; gap: 8px; }
.sch-field-c select { width: 240px; }
.sch-used { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.sch-week { gap: 0; padding: 6px 18px 10px; margin-bottom: 0; }
.sch-scale, .tl-day.sch-day { display: grid; grid-template-columns: 150px minmax(0, 1fr) 260px; gap: 14px; align-items: center; }
.sch-scale { font-size: 11px; color: var(--text-faint); padding: 6px 0 2px; }
.sch-ticks { display: flex; justify-content: space-between; }
.tl-day.sch-day { padding: 7px 0; border: none; border-top: 1px solid var(--track); border-radius: 0; }
.sch-day .tl-switch { justify-self: start; }
.sch-line { position: relative; height: 22px; border-radius: 6px; background: var(--track); }
.sch-line > span, .sch-legend i { position: absolute; top: 0; bottom: 0; }
.sch-open { background: var(--blue-soft); border: 1px solid var(--blue-line); border-radius: 6px; }
.sch-cut { background: repeating-linear-gradient(135deg, var(--warn-line) 0 3px, var(--warn-bg) 3px 6px); border-radius: 0 6px 6px 0; }
.sch-line > .sch-now { top: -3px; bottom: -3px; width: 2px; background: var(--danger); }
.sch-slots { display: flex; justify-content: flex-end; }
.sch-day .tl-day-body { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sch-day .tl-ranges { flex-direction: row; flex-wrap: wrap; margin: 0; gap: 6px; }
.sch-day .tl-range { gap: 4px; }
.sch-day .tl-range input[type='time'] { width: auto; padding: 3px 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.sch-add { border: none; background: transparent; color: var(--blue); font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: var(--radius-sm); cursor: pointer; }
.sch-add:hover:not(:disabled) { background: var(--blue-soft); }
.sch-closed { color: var(--text-faint); font-size: 13px; }
.sch-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-sec); padding: 0 18px 12px; }
.sch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sch-legend i { position: static; display: inline-block; width: 12px; height: 10px; border-radius: 3px; }
.sch-legend i.sch-now { width: 2px; background: var(--danger); }
.sch-after { padding: 0 18px 12px; }
.sch-after .hint { margin: 0; }
.sch-next { color: var(--text-sec); }
.sch-card .tl-closure input[type='date'] { width: auto; }
@media (max-width: 900px) {
  .sch-scale { display: none; }
  .tl-day.sch-day { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sch-slots { justify-content: flex-start; }
}

/* Le journal des essais : une colonne, pas une ligne. Il portait un seul
   resultat a plat ; il porte maintenant les trois derniers, chacun avec sa
   requete et sa reponse. */
.tl-test { display: flex; flex-direction: column; gap: var(--space-2); font-size: 12.5px; margin-bottom: var(--space-4); }
.tl-test .code { font-weight: 700; font-family: var(--mono); }
.tl-test .code.ok { color: var(--ok); }
.tl-test .code.bad { color: var(--danger); }
.tl-test .ms { color: var(--text-sec); font-variant-numeric: tabular-nums; }

/* Le titre du journal, avec son bouton d'effacement. */
.tl-log-title { display: flex; align-items: center; gap: var(--space-2); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-sec); }
.tl-log-title .spacer { flex: 1; }

.tl-log { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.tl-log-entry + .tl-log-entry { border-top: 1px solid var(--border); }
.tl-log-entry > summary { cursor: pointer; padding: var(--space-2) var(--space-3); list-style-position: inside; }
.tl-log-entry > summary::-webkit-details-marker { color: var(--text-faint); }
.tl-log-entry > summary:hover { background: var(--hover); }
.tl-log-entry[open] > summary { background: var(--surface-2); border-bottom: 1px solid var(--border); }

/* **L'en-tete est une grille**, donc les colonnes tombent d'aplomb d'une
   tentative a l'autre : c'est ce qui rend l'empilement lisible comme un
   tableau sans avoir a choisir entre une ligne par essai et le corps des
   requetes. `inline-grid` pour que le marqueur natif du `summary` reste. */
.tl-log-head {
  display: inline-grid;
  grid-template-columns: 72px 46px 48px minmax(120px, 1fr) 64px 56px auto;
  gap: var(--space-3);
  align-items: baseline;
  width: calc(100% - 20px);
  vertical-align: middle;
}
.tl-log-head .at { color: var(--text-sec); font-variant-numeric: tabular-nums; }
.tl-log-head .verb { font-family: var(--mono); font-weight: 600; color: var(--text-sec); }
.tl-log-head .host { font-family: var(--mono); overflow-wrap: anywhere; }
.tl-log-head .sz { color: var(--text-sec); font-variant-numeric: tabular-nums; }

.tl-log-body { padding: var(--space-3); }
.tl-log-failure { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--space-3); }

/* Une section du corps. Le titre porte la separation entre **ce qui est parti**
   et **ce qui est revenu** : sans elle, deux blocs monospace l'un sous l'autre
   se lisent comme un seul. */
.tl-log-part + .tl-log-part { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px dashed var(--border); }
.tl-log-part h4 { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: var(--space-2); }
.tl-log-part pre.snapshot { margin: 0 0 var(--space-2); }
.tl-log-part pre.snapshot:last-child { margin-bottom: 0; }
.tl-log-line { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-2); }
.tl-log-headers { margin-bottom: var(--space-2); gap: 4px var(--space-4); }
/* Un secret masque garde sa teinte : on doit voir que la ligne est **masquee**
   et non vide. Jamais reconstituee, pas meme tronquee. */
.tl-log-headers .kv-value.masked { color: var(--text-faint); font-style: italic; }
.tl-log-said { font-size: 12.5px; }

/* La zone de retrait, bordée, en bas de fiche : une action destructive à côté
   de Save est le clic malheureux classique. */
.tl-danger { margin-top: var(--space-5); padding: var(--space-4); border: 1px solid var(--danger-line); border-radius: var(--radius-md); display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.tl-danger .spacer { flex: 1; }
.tl-danger h3 { font-size: 13px; margin-bottom: 2px; }

/* Le tiroir « ce que le modèle reçoit » (lot T9) : le bloc d'outils du prompt
   système, rendu par le serveur, en lecture seule. C'est là qu'on voit qu'un
   « when to use » est mauvais — sans lui, on écrit une consigne sans jamais
   voir le texte qu'elle produit. */
.tl-drawer-back { position: fixed; inset: 0; background: rgba(16, 32, 60, .35); z-index: 40; }
.tl-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 92vw);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--pop-shadow); z-index: 41; display: flex; flex-direction: column;
}
.tl-drawer header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.tl-drawer header h2 { font-size: 15px; }
.tl-drawer header .spacer { flex: 1; }
.tl-drawer .body { flex: 1; overflow: auto; padding: 18px 20px; }
.tl-drawer pre { margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.65; white-space: pre-wrap; color: var(--text); }
.tl-drawer pre .h { color: var(--blue-dark); font-weight: 700; }

/* Un accent divise la capacité d'un SMS par plus de deux : le compteur est le
   seul endroit de l'interface où l'on peut s'en apercevoir avant l'envoi. */
.seg { display: inline-flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; }
.seg b { font-weight: 700; color: var(--text); }
.seg span { color: var(--text-faint); font-size: 11px; }
.seg.over b { color: var(--warn); }

@media (max-width: 900px) {
  .tl-row, .tl-row.tl-hrow { grid-template-columns: 30px 1fr 12px; grid-template-areas: "ico id dot" ". when when" ". pills pills"; }
  .tl-row .tl-ico { grid-area: ico; }
  .tl-row .tl-id { grid-area: id; }
  .tl-row .tl-when, .tl-row .tl-hcell { grid-area: when; }
  .tl-row .tl-pills, .tl-row .tl-strip { grid-area: pills; justify-content: flex-start; }
  .tl-row .tl-dot { grid-area: dot; }
  .tl-row .tl-chev { display: none; }
  .tl-subtabs { gap: 18px; overflow-x: auto; }
}

/* ---------- ligne d'outil dans le fil d'un appel (lot T5) ---------- */

/* La couleur dit ce que l'outil **fait**, pas qui l'héberge. Violet = une
   lecture, la couleur du RAG dans la console ; ambre = un effet dans le monde
   réel. Aucune teinte nouvelle. */
.toolrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-family: var(--mono);
  font-size: 11.5px;
  max-width: 62ch;
  align-self: flex-end;
  text-align: left;
}
.toolrow.search { background: var(--violet-bg); border-color: var(--violet-line); color: var(--violet); }
.toolrow.effect { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
/* Un échec, pas un refus : une destination inventée par le modèle n'est pas un
   incident, et les confondre ferait lire du rouge là où il n'y en a pas. */
.toolrow.bad { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.toolrow b { font-weight: 700; }
.toolrow .arg { color: inherit; opacity: 0.85; overflow-wrap: break-word; }
.toolrow .ms { margin-left: auto; font-variant-numeric: tabular-nums; opacity: 0.75; }
/* Un record qui porte un `bodyPreview` (lot T13) a une fiche à montrer dans
   l'onglet Technique : la ligne vit déjà dans la paire `.pair`, donc
   elle est déjà cliquable — ce curseur est la seule chose qui manquait pour le
   dire. */
.toolrow-detail { cursor: pointer; }

/* Instance voice library and comparison bench. */
.voice-library-form { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; min-width: 220px; }
.voice-compare-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; }
.voice-grid-compare { display: grid; overflow: auto; gap: 1px; background: var(--border); }
.voice-cell, .voice-compare-head { padding: 14px; background: var(--surface); overflow-wrap: anywhere; }
.voice-compare-head { position: sticky; top: 0; font-weight: 600; z-index: 1; }
.voice-cell .hint { margin-top: 8px; }
.voice-compare-choices .field { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 10px; }
@media (max-width: 800px) { .voice-compare-layout { grid-template-columns: minmax(0, 1fr); } }

/* ===================== Contexte d'appel (lot A3) =====================
   Le mockup valide (docs/yelda-air-contexte-ui-prototype.html) **est** le
   design : ces regles en sont reprises telles quelles. Les trois couleurs de
   visibilite ne changent jamais de sens d'un ecran a l'autre — bleu = le modele
   le lit, cyan = les outils seulement, violet = la plateforme seule.
   ==================================================================== */

/* ============================================================
   NOUVEAU — panneau Context et bloc Context de la fiche (.cx-*)
   ============================================================ */

/* ---------- la visibilité, jetons partagés par les deux écrans ----------
   Trois valeurs, trois couleurs, et elles ne changent JAMAIS de sens d'un
   écran à l'autre : bleu = le modèle le lit, cyan = les outils seulement,
   violet = la plateforme seule. Le violet est déjà la couleur d'une lecture
   dans la fiche d'appel (RAG) : une seule convention dans tout le produit. */
.cx-vis{display:inline-flex;align-items:center;gap:5px;padding:2px 9px;border-radius:6px;
  font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
.cx-vis.prompt{background:var(--blue-soft);color:var(--blue-dark)}
.cx-vis.tool{background:var(--cyan-bg);color:#0f7c8b}
.cx-vis.platform{background:var(--violet-bg);color:var(--violet)}

/* Le type de source. Même grammaire que .tl-kind du panneau Tools. */
.cx-kind{display:inline-flex;align-items:center;justify-content:center;padding:3px 0;width:96px;
  border-radius:6px;font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}
.cx-kind.reservation{background:var(--warn-bg);color:var(--warn)}
.cx-kind.api{background:var(--cyan-bg);color:#0f7c8b}
.cx-kind.history{background:var(--violet-bg);color:var(--violet)}

/* ---------- l'ordre de résolution, CALCULÉ et affiché ----------
   L'opérateur ne déclare pas l'ordre : il est déduit des {{ }} de chaque
   source. S'il n'est pas montré, personne ne peut vérifier qu'il est juste,
   et le premier appel réel sera la première occasion de s'en apercevoir. */
.cx-plan{display:flex;align-items:stretch;gap:var(--space-3);flex-wrap:wrap;
  background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);
  padding:13px 15px;margin-bottom:var(--space-4)}
.cx-stage{display:flex;flex-direction:column;gap:6px;min-width:150px}
.cx-stage .lbl{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint)}
.cx-stage .items{display:flex;gap:6px;flex-wrap:wrap}
.cx-chip{background:var(--surface);border:1px solid var(--border);border-radius:20px;
  padding:3px 10px;font-family:var(--mono);font-size:11.5px;color:var(--text)}
.cx-arrow{align-self:center;color:var(--text-faint);font-size:16px}
.cx-plan .why{flex:1;min-width:190px;align-self:center;font-size:11.5px;color:var(--text-faint);line-height:1.45}

/* ---------- liste des sources ---------- */
.cx-list{border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden;background:var(--surface)}
.cx-row{display:grid;grid-template-columns:106px minmax(150px,1fr) minmax(210px,1.6fr) 96px 84px 18px;
  gap:var(--space-3);align-items:center;padding:13px 16px;border-top:1px solid var(--border);
  cursor:pointer;background:var(--surface);text-align:left;width:100%;border-radius:0;font:inherit;color:inherit}
.cx-row:first-child{border-top:none}
.cx-row:hover{background:var(--surface-2)}
.cx-key{font-family:var(--mono);font-size:13px;font-weight:600;color:var(--text)}
.cx-sub{font-size:11.5px;color:var(--text-faint);margin-top:3px;font-variant-numeric:tabular-nums}
.cx-target{font-size:12.5px;color:var(--text-sec);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cx-ms{font-size:12px;color:var(--text-sec);font-variant-numeric:tabular-nums;text-align:right}
.cx-chev{color:var(--text-faint);font-size:15px;text-align:right}

/* ---------- tableau des variables ----------
   Un tableau, pas des cartes : c'est une liste dense qu'on relit souvent,
   et la colonne « lue par » doit s'aligner pour être balayable d'un œil. */
.cx-table{width:100%;border-collapse:collapse;font-size:13px}
.cx-table th{text-align:left;font-size:10.5px;font-weight:800;text-transform:uppercase;
  letter-spacing:.06em;color:var(--text-faint);padding:0 10px 8px;border-bottom:1px solid var(--border)}
.cx-table td{padding:10px;border-bottom:1px solid var(--border);vertical-align:middle}
.cx-table tr:last-child td{border-bottom:none}
.cx-table tr:hover td{background:var(--surface-2)}
.cx-name{font-family:var(--mono);font-size:12.5px;font-weight:600;white-space:nowrap}
.cx-from{font-family:var(--mono);font-size:12px;color:var(--text-sec);white-space:nowrap}
.cx-lock{color:var(--violet);font-size:12px}
.cx-used{font-size:11.5px;color:var(--text-faint)}
.cx-used.none{color:var(--warn)}

/* ---------- l'aperçu : ce que l'appelant entendra ----------
   Le seul endroit de l'écran où l'opérateur voit le résultat et pas la
   mécanique. Bord bleu, comme .tl-preview.speech du panneau Tools. */
.cx-preview{background:var(--surface-2);border:1px solid var(--border);border-left:3px solid var(--blue);
  border-radius:var(--radius-md);padding:13px 15px;font-size:13px;line-height:1.6}
.cx-preview .lbl{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;
  color:var(--text-faint);display:block;margin-bottom:6px}
.cx-preview mark{background:var(--blue-soft);color:var(--blue-dark);border-radius:4px;padding:0 3px}
.cx-preview .empty-val{background:var(--warn-bg);color:var(--warn);border-radius:4px;padding:0 3px;font-style:italic}

/* ---------- l'encart d'essai ---------- */
.cx-try{border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}
.cx-try-head{background:var(--surface-2);padding:12px 15px;border-bottom:1px solid var(--border);
  display:flex;gap:var(--space-3);align-items:flex-end;flex-wrap:wrap}
.cx-try-head .field{margin:0;min-width:160px}
.cx-try-body{padding:14px 15px}
.cx-result{display:grid;grid-template-columns:106px 130px 1fr 76px;gap:var(--space-3);
  align-items:center;padding:9px 0;border-top:1px solid var(--border);font-size:12.5px}
.cx-result:first-child{border-top:none;padding-top:0}
.cx-result .msbar{position:relative;height:6px;background:var(--track);border-radius:3px;overflow:hidden}
.cx-result .msbar i{position:absolute;top:0;bottom:0;border-radius:3px;background:var(--cyan)}
.cx-result .msbar i.ko{background:var(--danger)}
.cx-result .msbar i.fast{background:var(--violet)}

/* ---------- l'état d'une source, partagé éditeur / fiche ---------- */
.cx-state{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:700;white-space:nowrap}
.cx-state::before{content:'';width:7px;height:7px;border-radius:50%;flex:0 0 auto}
.cx-state.ok{color:var(--ok)} .cx-state.ok::before{background:var(--ok)}
.cx-state.empty{color:var(--text-faint)} .cx-state.empty::before{background:var(--border-strong)}
.cx-state.timeout{color:var(--danger)} .cx-state.timeout::before{background:var(--danger)}
.cx-state.error{color:var(--danger)} .cx-state.error::before{background:var(--danger)}
.cx-state.blocked{color:var(--warn)} .cx-state.blocked::before{background:var(--warn)}

/* La cause d'un echec, a cote du statut. Elle ne dit pas ce que la source a
   fait — c'est le role du statut — mais **lequel des trois remedes** s'applique :
   des identifiants, le reseau, ou l'API du client. Pas de teinte nouvelle : les
   jetons existants, et rien d'autre. */
.cx-cause{display:inline-block;margin-left:8px;padding:1px 6px;border-radius:999px;font-size:10.5px;font-weight:700;
  letter-spacing:.02em;border:1px solid var(--border-strong);color:var(--text-faint);white-space:nowrap}
.cx-cause.auth{color:var(--warn);border-color:var(--warn)}
.cx-cause.api{color:var(--danger);border-color:var(--danger)}

/* ============================================================
   FICHE D'APPEL — bloc Context
   ============================================================ */

/* Replié par défaut, déplié tout seul quand une source a échoué : c'est le
   seul cas où quelqu'un a besoin de le lire, et le seul où il ne faut pas
   qu'il ait à cliquer pour le découvrir. */
.cx-block{border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);
  margin-bottom:var(--space-4);overflow:hidden}
.cx-block.ko{border-color:var(--danger-line)}
.cx-block-head{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap;
  padding:12px 16px;background:var(--surface-2);border-bottom:1px solid var(--border);
  width:100%;text-align:left;font:inherit;color:inherit;border-radius:0;cursor:pointer}
.cx-block.ko .cx-block-head{background:var(--danger-bg);border-bottom-color:var(--danger-line)}
.cx-block-head:hover{background:var(--hover)}
.cx-block.ko .cx-block-head:hover{background:var(--danger-bg)}
.cx-block-head .ttl{font-size:13px;font-weight:700}
.cx-block-head .spacer{flex:1}
.cx-block-head .caret{color:var(--text-faint)}
.cx-block-body{padding:14px 16px}

/* Le déroulé de la résolution, à l'échelle. Les barres sont proportionnelles
   au temps réel : c'est la seule façon de voir d'un œil que l'API du client
   a mangé 1 194 ms sur les 1 240 de la résolution. Le waterfall d'un tour
   suit la même règle (views/turn-waterfall.js) : on ne met jamais les
   segments à l'échelle pour tomber juste. */
.cx-wf{display:grid;grid-template-columns:106px 120px 1fr 70px 84px;gap:var(--space-3);
  align-items:center;padding:10px 0;border-top:1px solid var(--border);font-size:12.5px}
.cx-wf:first-of-type{border-top:none}
.cx-wf .lane{position:relative;height:8px;background:var(--track);border-radius:4px}
.cx-wf .lane i{position:absolute;top:0;bottom:0;border-radius:4px;background:var(--cyan)}
.cx-wf .lane i.violet{background:var(--violet)}
.cx-wf .lane i.warn{background:var(--warn)}
.cx-wf .lane i.ko{background:var(--danger)}
.cx-wf .ms{text-align:right;font-variant-numeric:tabular-nums;color:var(--text-sec)}
.cx-wf .k{font-family:var(--mono);font-size:12px;font-weight:600}
.cx-scale{display:flex;justify-content:space-between;font-size:10.5px;color:var(--text-faint);
  padding:6px 0 0;margin-left:calc(106px + 120px + var(--space-3) * 2);
  margin-right:calc(70px + 84px + var(--space-3) * 2);border-top:1px dashed var(--border)}

/* Les valeurs figées. Grille dense, valeurs masquées selon la visibilité —
   et une valeur `platform` n'est jamais affichée, même à un admin : elle
   n'est même pas en base. On montre son nom et sa présence. */
.cx-vals{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px var(--space-4);
  margin-top:var(--space-4);padding-top:var(--space-4);border-top:1px solid var(--border)}
.cx-val{min-width:0}
.cx-val .n{font-family:var(--mono);font-size:11.5px;color:var(--text-faint);display:block}
.cx-val .v{font-size:13px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cx-val .v.masked{font-family:var(--mono);color:var(--text-sec);font-weight:500}
.cx-val .v.locked{color:var(--violet);font-family:var(--mono);font-weight:500}
.cx-val .v.empty{color:var(--warn);font-style:italic;font-weight:500}

/* Le bandeau d'incident, en tête de page. Même traitement que le bandeau de
   transport : il ne remonte que lorsqu'il porte un PROBLÈME, jamais pour
   dire que tout va bien. */
.cx-alert{display:flex;gap:11px;align-items:flex-start;background:var(--danger-bg);
  border:1px solid var(--danger-line);border-radius:var(--radius-md);padding:12px 15px;
  margin-bottom:var(--space-4);font-size:13px;color:var(--danger)}
.cx-alert b{display:block;margin-bottom:2px}
.cx-alert .sub{color:var(--text-sec);font-size:12.5px}

/* Le résumé de conversation (besoin D). Jetons existants seulement : aucune
   couleur n'est inventée ici. */
.sum-text { margin: 0 0 8px; white-space: pre-wrap; }
.sum-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Les actions de fin d'appel. La couleur dit ce que la ligne *fait* : rouge =
   panne, vert = partie, gris = rien à faire. Aucune teinte nouvelle.
   La carte vit dans le rail `.inspector` de la fiche d'appel, ~340 px utiles :
   une ligne à sept colonnes fixes en demandait 490 et débordait du cadre. Le
   libellé prend donc sa propre ligne, les faits la suivante, la note la
   dernière — un empilement par zones, pas une media query, parce que c'est la
   largeur du rail qui compte, pas celle de la fenêtre. */
.ac-table { display: grid; gap: 4px; }
.ac-row {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "name name name name name replay"
    "trigger state http ms . ."
    "note note note note note note";
  gap: 2px 12px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.ac-row .k { grid-area: name; min-width: 0; font-weight: 600; overflow-wrap: break-word; }
.ac-row .ac-trigger { grid-area: trigger; }
.ac-row .ac-state { grid-area: state; }
.ac-row .ac-http { grid-area: http; }
.ac-row .ac-ms { grid-area: ms; }
.ac-row .ac-note { grid-area: note; min-width: 0; }
.ac-row .ac-note:empty { display: none; }
.ac-row > :last-child { grid-area: replay; justify-self: end; }
.ac-row .ac-trigger, .ac-row .ac-http, .ac-row .ac-ms { color: var(--muted); font-variant-numeric: tabular-nums; }
.ac-row .ac-note { color: var(--muted); overflow-wrap: break-word; }
.ac-row.ac-ok { background: var(--ok-bg); }
.ac-row.ac-ko { background: var(--danger-bg); }
.ac-row.ac-ko .ac-state { color: var(--danger); font-weight: 600; }
.ac-row.ac-idle { background: var(--bg); }
/* Lot JH4 : le nom d'une action qui a un échange au journal ouvre l'onglet
   Technique. Un bouton qui se lit comme le libellé qu'il remplace. */
.ac-row .ac-open {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--blue);
  text-align: left;
  cursor: pointer;
}
.ac-row .ac-open:hover { text-decoration: underline; }
/* La première ligne de ce que l'endpoint a répondu, sous une action en échec. */
.ac-row .ac-preview {
  grid-column: 1 / -1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ---------- Journal HTTP d'un appel (lot JH4, views/http-log.js) ----------
   Une ligne par requête, huit colonnes. La table défile dans sa carte, jamais
   la page : une URL longue ne doit pas élargir l'onglet au-delà d'un
   téléphone. Aucune teinte nouvelle — le vocabulaire de .ac-row et des badges. */
.hl-card { min-width: 0; }
.hl-table {
  display: grid;
  gap: 2px;
  overflow-x: auto;
}
.hl-row {
  display: grid;
  grid-template-columns: 96px 60px minmax(120px, 1.2fr) 28px 48px minmax(160px, 2fr) auto 64px;
  gap: 10px;
  align-items: center;
  min-width: 700px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: var(--bg);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.hl-row:hover { background: var(--surface-2); }
.hl-row[aria-expanded='true'] { background: var(--blue-soft); }
.hl-row.hl-error { background: var(--danger-bg); }
.hl-row .hl-at, .hl-row .hl-phase, .hl-row .hl-attempt, .hl-row .hl-method, .hl-row .hl-ms {
  color: var(--text-sec);
  font-variant-numeric: tabular-nums;
}
.hl-row .hl-key { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.hl-row .hl-url {
  min-width: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hl-row .hl-ms { text-align: right; }
.hl-detail {
  min-width: 0;
  padding: var(--space-2) var(--space-2) var(--space-3);
}

/* Une action en échec est une panne : elle se voit sur l'Overview comme dans la
   fiche, avec le même jeton. */
.stat.danger .stat-value { color: var(--danger); }

/* ---------- Speech bench (lot N4) ---------- */
/* Le bandeau bleu : ce que le banc ne mesure pas. Ne se ferme pas. */
.sb-notmeasured { background: var(--blue-soft); border: 1px solid var(--blue-line); }
.sb-notmeasured h2 { color: var(--blue-deep); }
/* Le bandeau ambre : changer de moteur déplace le configHash. */
.sb-configwarn { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.sb-configwarn p { color: var(--warn); margin: 0; }
/* Une ligne de moteur ou de filtre dans la modale : la case et son libellé. */
.sb-engine { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; }
.sb-engine input { flex: none; }
/* La durée minimale de parole est une valeur, pas une case : elle a sa largeur. */
.sb-engine input[type="number"] { width: 90px; }
/* L'état running : la pastille et son bouton Stop sur une ligne. */
.sb-running { align-items: center; gap: 8px; }
/* La cellule Expected : le champ de vérité et son bouton Save côte à côte. */
.sb-expected { display: inline-flex; align-items: center; gap: 6px; }
.sb-expected input { width: 8em; }

/* La ventilation des exclusions, sous le devis : des faits, jamais une alerte. */
.sb-excluded { margin-top: 2px; }

/* ---------- Le mode plage (lot N9) ---------- */
/* Un mode se choisit, il ne se coche pas : le radio en haut, sa phrase dessous. */
.sb-mode { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
.sb-mode input { flex: none; margin-top: 4px; }
.sb-mode > span { display: flex; flex-direction: column; gap: 2px; }
.sb-mode-label { font-weight: 600; }
/* Le bandeau de mode de la fiche : un fait, pas une alerte — et il ne se ferme pas. */
.sb-mode-banner { background: var(--blue-soft); border: 1px solid var(--blue-line); }
.sb-mode-banner p { color: var(--blue-deep); margin: 0; }

/* La source décide des colonnes du tableau des moteurs (lot NP2) : le DER n'existe
   qu'en appels, les taux d'entités qu'en clips. Masquées par la classe de la carte,
   jamais retirées du DOM — et jamais côte à côte. */
.sb-source-clips .sb-der,
.sb-source-calls .sb-entity { display: none; }
/* Ce que chaque moteur a fait d'une plage : une ligne par moteur, texte entier. */
.sb-span { padding: 10px 0; border-top: 1px solid var(--line); }
.sb-span:first-of-type { border-top: 0; }
.sb-span > p { margin: 0 0 6px; }
.sb-span-row { display: grid; grid-template-columns: 140px 70px 1fr; gap: 10px; padding: 3px 0; font-size: 13px; }
.sb-span-engine { font-weight: 600; }
.sb-span-segments { color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-span-text { overflow-wrap: break-word; }


/* ---------- judge: the review queue ----------
   Un parcours en quatre temps : (1) la regle et la decision qu'elle fait
   respecter, (2) ce que le juge en a dit, (3) la preuve, (4) l'arbitrage. Le
   numero remplace une phrase d'explication, et l'ordre de lecture devient
   l'ordre de la page.

   Deux langages visuels, et ils ne se melangent jamais : les coches et le
   couple vert/rouge disent le sort de la REGLE ; les glyphes de reponse disent
   celle de l'arbitre et a qui la balle revient. Les deux axes se croisent — on
   approuve un rouge — et les peindre de la meme couleur est ce qui rendait cet
   ecran illisible. */

.jq-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

@media (max-width: 1100px) {
  .jq-layout { grid-template-columns: 1fr; }
}

/* La bande de progression. Le denominateur se fige au chargement : le serveur
   ne rend que les lignes non repondues, donc une barre calculee sur son total
   seul reculerait sous les doigts. */
.jq-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
  color: var(--text-sec);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.jq-progress b { color: var(--text); font-weight: 600; }
.jq-bar {
  flex: 1 1 200px;
  min-width: 150px;
  height: 6px;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}
.jq-bar > i { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width 0.25s; }
.jq-tally { display: flex; gap: 10px; align-items: baseline; }
/* Les lignes que la file retient : leur decision est une question ouverte. */
.jq-held { color: var(--warn); font-weight: 600; }
.jq-held:hover { color: var(--warn); }

.jq-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-3); align-items: center; }
.jq-chip {
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  cursor: pointer;
}
.jq-chip[aria-pressed='true'] { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); }
.jq-chip .n { opacity: 0.7; margin-left: 5px; font-variant-numeric: tabular-nums; }

/* ---- la colonne de gauche ---- */

.jq-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 76vh;
  overflow-y: auto;
  padding-right: 2px;
}

.jq-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.jq-row:hover { border-color: var(--blue); }
.jq-row.active { border-color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }
/* Repondue : estompee, jamais retiree — une file qui se vide sous les doigts
   fait perdre le compte de ce qu'on vient de repondre. */
.jq-row.answered { opacity: 0.5; }

/* La coche dit le sort de la regle tant que personne n'a repondu ; ensuite
   c'est un glyphe de reponse, et il ne prend aucune teinte. */
.jq-mark { font-size: 13px; line-height: 1.35; }
.jq-mark.ok { color: var(--ok); }
.jq-mark.danger { color: var(--danger); }

.jq-rule {
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jq-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.jq-scenario {
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* ---- le panneau droit : les quatre temps ---- */

.jq-step { padding: 18px 0; border-top: 1px solid var(--border); }
.jq-step:first-child { border-top: none; padding-top: 2px; }
.jq-step:last-child { padding-bottom: 2px; }
.jq-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.jq-eyebrow .spacer { flex: 1; }
.jq-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 99px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.jq-label {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-sec);
  font-weight: 700;
}

/* (1) la regle, et la decision qu'elle fait respecter. Une citation se lit
   comme une regle qu'on applique ; un titre se lit comme le nom de l'ecran.
   La severite qualifie LA REGLE, donc elle se lit juste avant elle : calee a
   droite du bandeau, elle se lisait comme un attribut de l'ecran. */
.jq-quote-head { margin-bottom: 6px; }
.jq-quote {
  margin: 0;
  padding: 12px 16px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 500;
  color: var(--text);
}
.jq-enforces {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--violet);
  font-weight: 700;
}
.jq-where { margin: 10px 0 0; font-size: 12.5px; color: var(--text-sec); }
.jq-where b { color: var(--text); font-weight: 600; }
.jq-goal { margin: 6px 0 0; font-size: 12.5px; color: var(--text-sec); font-style: italic; }

/* (2) le verdict AVANT sa justification : le sens avant la preuve. */
.jq-verdict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jq-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
}
.jq-pill.failed { background: var(--danger-bg); color: var(--danger); }
.jq-pill.passed { background: var(--ok-bg); color: var(--ok); }
.jq-because {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
}
.jq-reason { margin: 5px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.jq-cites { margin: 8px 0 0; font-size: 12px; color: var(--text-sec); }

/* (3) la preuve. Le tour cite gagne un halo en plus de son filet. */
.jq-excerpt { display: flex; flex-direction: column; gap: 6px; }
.jq-turn {
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--text) 3%, transparent);
  font-size: 13px;
}
.jq-turn.cited { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px var(--blue-soft); }
/* Les actes font foi sur ce que l'agent a *fait* : violet, comme partout. */
.jq-acts { color: var(--violet, var(--text-sec)); font-size: 11.5px; margin-bottom: 3px; }
.jq-idx { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.jq-role { color: var(--muted); font-size: 11px; text-transform: uppercase; margin-right: 8px; letter-spacing: 0.04em; }
.jq-text { overflow-wrap: break-word; }

/* (4) l'arbitrage — DEUX familles, parce que deux des quatre reponses ne font
   aucune reference. Les aligner comme quatre variantes d'un meme choix efface
   la seule frontiere qui compte dans cet ecran — mais un filet suffit a la
   tenir : deux intertitres pour la dire sont du verbiage sur un ecran qu'on
   relit cent quatre-vingts fois. */
.jq-ask { margin: 0 0 12px; font-size: 13.5px; color: var(--text); }
.jq-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 10px; }
.jq-choices.blocked { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.jq-choice {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.06s;
}
.jq-choice:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.jq-choice:active { transform: translateY(1px); }
.jq-choice.agree:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); }
.jq-choice.disagree:hover:not(:disabled) { border-color: var(--danger-line); background: var(--danger-bg); }
.jq-choice.wording:hover:not(:disabled) { border-color: var(--warn-line); background: var(--warn-bg); }
.jq-choice.gap:hover:not(:disabled) { border-color: var(--violet-line); background: var(--violet-bg); }
.jq-choice.wording, .jq-choice.gap { background: var(--surface-2); }
.jq-choice .g { font-size: 17px; line-height: 1.2; }
.jq-choice .t { display: block; font-size: 13px; font-weight: 700; color: var(--text); }
.jq-choice .s { display: block; font-size: 12px; font-weight: 500; color: var(--text-sec); margin-top: 2px; }
.jq-choice kbd { float: right; margin-left: 8px; }

/* La regle globale sur textarea (min-height: 220px) est faite pour le prompt
   systeme : ici elle donnerait huit lignes de haut a un champ de deux. */
.jq-note {
  width: 100%;
  margin-top: 12px;
  min-height: 58px;
  resize: vertical;
  background: var(--surface-2);
  /* De la prose, pas du prompt : la police monospace globale des textarea est
     faite pour un prompt systeme, pas pour une phrase qu'on ecrit a la main. */
  font-family: var(--font);
  line-height: 1.5;
}
.jq-note:focus { background: var(--surface); }
.jq-hint { margin: 10px 0 0; color: var(--muted); font-size: 11.5px; }
.jq-hint kbd, .jq-choice kbd {
  font: 600 10.5px/1 var(--mono);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 4px;
  color: var(--text-faint);
}
.jq-hint kbd { margin-right: 3px; }

/* Repondue : ce que la reponse a produit, et rien de plus. Le violet est celui
   du registre — c'est la seule des quatre issues dont la suite est chez le
   client. */
.jq-answered {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  font-size: 13px;
}
.jq-answered.held { background: var(--violet-bg); border-color: var(--violet-line); }
.jq-answered .grow { flex: 1; }

.jq-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.jq-foot .spacer { flex: 1; }

/* La fin de file. Deux etats, deux textes : une file videe par un filtre n'est
   pas une file finie, et le dire est tout ce qui separe les deux cartes. */
.jq-done { text-align: center; padding: 26px 10px; }
.jq-done .big { font-size: 34px; }
.jq-done h3 { margin: 10px 0 6px; font-size: 17px; }
.jq-done p { margin: 0 auto 14px; color: var(--text-sec); font-size: 13.5px; max-width: 480px; }
.jq-score {
  display: inline-flex;
  gap: 18px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin: 0 0 16px;
}
.jq-score > div { text-align: center; }
.jq-score .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.jq-score .k { font-size: 11px; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.05em; }
.jq-done .jq-foot { justify-content: center; }

/* ---------- judge: definition and bench (instance) ----------
   Le contrat en lecture seule, sous la consigne : ce que `parseVerdict()` lit,
   et qu'une version ne peut pas reecrire. Grise parce qu'il ne s'edite pas. */

.judge-contract {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  color: var(--text-sec);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* ---------- judge: calibration ----------
   Cinq tuiles et une table. Aucune agregation cote navigateur : tout vient de
   la route, comme l'Overview. */

.jc-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
}

.jc-tile { display: flex; flex-direction: column; gap: 3px; }
.jc-tile-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.jc-tile-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.jc-tile-hint { color: var(--muted); font-size: 11.5px; }

/* Les barres des reecritures de regle, en div : pas de bibliotheque. */
.jc-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 26px;
}
.jc-bars i {
  display: block;
  width: 10px;
  border-radius: 2px 2px 0 0;
  background: var(--warn, var(--blue));
}

/* ---------- judge: worked examples ----------
   Un exemple se promeut depuis une reference, jamais ne se tape : il n'y a
   donc pas de champ ici, seulement ce qui a ete promu et le plafond en clair. */

.je-rule { margin-bottom: var(--space-3); }
.je-rule-head { margin-bottom: 6px; font-size: 11.5px; }
.je-example {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  align-items: flex-start;
}
.je-excerpt {
  margin: 0;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.je-note { margin: 0; color: var(--text-sec); font-size: 12.5px; font-style: italic; }

/* ---------- decisions: the business decision register ----------
   Maquette : docs/yelda-air-decisions-prototype.html. Préfixes `.dr-`
   (register), `.dd-` (decision), `.dq-` (questions), `.dt-` (tests) — rien
   d'autre, parce que `.cell`, `.verdict`, `.tl-row` et `.quote` portent déjà un
   sens ailleurs dans cette feuille, et qu'une pastille qui hériterait du
   padding d'un état vide deviendrait un disque. */

/* La pilule d'une proposition : violette comme toute sortie de machine que
   personne n'a encore relue — un diagnostic de run, une ligne d'éclaireur. */
.badge.violet {
  background: var(--violet-bg);
  color: var(--violet);
}

/* La clé, `D-7`. Partagée par les quatre écrans : c'est elle qu'on cite, dans
   un tableau comme dans une phrase de refus. */
.d-key {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}
a.d-key:hover { text-decoration: underline; }

.dr-counters { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; color: var(--text-sec); }
.dr-counters .unverified { color: var(--warn); font-weight: 600; }
.dr-counters .proposed { color: var(--violet); font-weight: 600; }
.dr-counters .sep { color: var(--text-faint); }
/* Les compteurs se posent sur la **ligne de base du titre**, pas au milieu du
   bloc titre : `.page-head` centre ses enfants, ce qui est juste pour des
   boutons et faux pour une ligne de chiffres, qui se met alors à flotter entre
   le fil d'Ariane et le `h1`. C'est ce que fait la maquette, et ça ne touche que
   cet écran — la règle générique du chrome ne bouge pas. */
.page-head .dr-counters { align-self: flex-end; padding-bottom: 5px; }

/* Le champ « rechercher ou demander » et son affordance ↵.
   L'enveloppe existe pour une raison mécanique : `main > *` (spécificité 0,0,1)
   est le seul porteur de largeur de la console, et il perd contre la règle
   générique `input[type='search'] { width: 100% }` (0,1,0). Le champ posé nu
   dans la page débordait donc du cadre, de 32 px de chaque côté, pendant que le
   header, le bandeau de couverture et le tableau le respectaient. */
.dr-search { position: relative; }
.dr-search input[type='search'] { width: 100%; height: 44px; padding: 0 92px 0 14px; }
.dr-search .ask { position: absolute; right: 12px; top: 11px; }

/* Les blocs de tête de cet écran sont des frères de `main`, donc leur rythme
   vertical est à eux : sans ça le champ, le bandeau de couverture et le tableau
   se touchent. La marge est portée par `main > …` et pas par la classe, parce
   que `.dr-answer` sert aussi **dans** une carte, où elle ajouterait une bande
   vide en pied. */
main > .dr-search,
main > .dr-answer,
main > .dr-coverage { margin-bottom: var(--space-4); }

.dr-layout { display: flex; gap: var(--space-4); align-items: flex-start; }
.dr-facets { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.dr-facets .dr-facet-head {
  padding: 0 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.dr-facet {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.dr-facet:hover { background: var(--hover); }
.dr-facet.on { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.dr-facet .n { font-size: 11px; color: var(--text-faint); }
.dr-list { flex: 1; min-width: 0; overflow: hidden; }
.dr-statement { font-weight: 600; }
.dr-why { color: var(--text-sec); font-size: 12px; }
/* Une retirée reste lisible : elle est de l'histoire, pas une erreur. */
.dr-list tr.retired { opacity: 0.55; }

/* Le bandeau de réponse du registre (D5). Bleu, parce qu'il cite des décisions
   prises et rien d'autre : ce qui est ouvert y est nommé, jamais répondu. */
.dr-answer {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--blue-line, var(--border));
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13.5px;
  line-height: 1.45;
}
.dr-answer .dr-answer-body { min-width: 0; }

/* La fiche. Une colonne de contenu, une colonne d'histoire. */
.dd-layout { display: flex; gap: var(--space-4); align-items: flex-start; }
.dd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.dd-side { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; gap: var(--space-4); }
@media (max-width: 1100px) {
  .dr-layout, .dd-layout { flex-direction: column; }
  .dr-facets, .dd-side { width: 100%; }
}

.dd-statement { line-height: 1.35; }
.dd-pills { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.dd-quote {
  padding: 6px 12px;
  border-left: 3px solid var(--blue-line, var(--border-strong));
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: break-word;
}
.dd-rule {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
}
.dd-rule-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dd-anchor { display: flex; gap: 8px; align-items: center; font-size: 13px; flex-wrap: wrap; }
/* Une ancre absente de la version publiée est un **signal**, pas une garde :
   personne ne vérifie qu'une citation est encore dans le prompt. */
.dd-anchor-missing { color: var(--warn); font-weight: 600; }
.dd-stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- decisions in the tests (.dt-) ----------
   Le verdict en attente : **calculé, non compté**. Gris et pointillé, jamais
   une couleur nouvelle — et surtout pas rouge : un client qui n'a pas encore
   tranché n'est pas une panne. */

.badge.awaiting {
  background: var(--track);
  color: var(--text-sec);
  border: 1px dashed var(--border-strong);
}

/* La cellule d'une grille de run dont tous les verdicts attendent. Même famille
   que `.cell-ok` / `.cell-warn` : c'est une quatrième valeur, pas un système. */
.cell-awaiting {
  background: var(--track);
  color: var(--text-sec);
  border: 1px dashed var(--border-strong);
}
/* Un coin gris quand une **partie** seulement des verdicts attend : la cellule
   garde sa couleur, parce que le reste compte bel et bien. */
.cell-mixed {
  position: relative;
  overflow: hidden;
}
.cell-mixed::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 11px 11px 0;
  border-color: transparent var(--border-strong) transparent transparent;
}

.verdict.awaiting {
  border-style: dashed;
  background: var(--bg);
}
.verdict-awaiting {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-sec);
  line-height: 1.45;
}

/* Le sélecteur de décision d'un critère. Rendu pour une règle `compliance`
   seulement — absent du DOM ailleurs, jamais grisé. */
.crit-policy {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 6px var(--space-2);
  align-items: center;
  padding: 0 var(--space-3) var(--space-2);
}
.crit-policy select { width: 100%; }
.crit-policy .hint { display: inline-block; margin-top: 4px; }

/* ---------- decisions: open questions (.dq-) ----------
   Le mode réunion : une question, d'où elle vient, et trois boutons. Le client
   ne voit jamais une proposition — l'onglet est **absent du DOM**, jamais grisé. */

.dq-tabs { display: flex; gap: 6px; padding-bottom: 4px; }
.dq-tab {
  padding: 3px 11px;
  border: none;
  border-radius: 999px;
  background: var(--track);
  color: var(--text-sec);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dq-tab.on { background: var(--blue-soft); color: var(--blue); }
.dq-who { display: flex; flex-direction: column; gap: 4px; }
.dq-who input { min-width: 260px; }

.dq-list { display: flex; flex-direction: column; }
.dq-q, .dq-prop {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.dq-q:last-child, .dq-prop:last-child { border-bottom: none; }
.dq-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dq-stmt { font-size: 16px; font-weight: 700; line-height: 1.4; }
.dq-prop .dq-stmt { font-size: 14.5px; font-weight: 600; }
/* Combien de règles attendent : c'est le coût de la question qui reste ouverte. */
.dq-waiting { color: var(--warn); font-weight: 600; font-size: 12px; }
/* L'origine, **relue** : un lien vers la conversation, jamais son texte. */
.dq-ctx {
  padding: 6px 12px;
  border-left: 3px solid var(--violet-line);
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.45;
}
.dq-answer { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.dq-cond { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 4px; }
.dq-cond input { width: 100%; }
/* Les décisions suggérées de la modale « Withdraw » : un clic choisit dans le menu. */
.dq-suggest { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.dq-suggestion {
  display: flex;
  gap: 8px;
  align-items: baseline;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}
.dq-suggestion b { color: var(--blue); white-space: nowrap; }
.dq-suggestion:hover, .dq-suggestion[aria-pressed='true'] { border-color: var(--blue); background: var(--blue-soft); }
/* Le bandeau ambre de la modale « Withdraw » : des règles citent la question. */
.dq-warn {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
}
.dq-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  line-height: 1.4;
}

/* *Export for the meeting* : le navigateur imprime, le service ne génère rien. */
@media print {
  .topbar, .sidebar, .dq-tabs, .dq-answer, .dq-foot, .try-slot, #toasts { display: none !important; }
  .dq-q { break-inside: avoid; }
  main > * { max-width: none; }
}

/* La décision, sous la règle, dans la file de relecture : l'arbitre doit voir
   contre quoi il juge. Absente pour une règle `task` ou `form`. */
.jq-policy {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--violet-line);
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.45;
}

/* Les trous de couverture, en tête du registre. Absent quand il n'y en a
   aucun : un bandeau toujours présent est un bandeau que personne ne lit. */
.dr-coverage {
  padding: 10px 14px;
  border: 1px solid var(--warn-line, var(--border));
  border-radius: var(--radius);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
  line-height: 1.45;
}
.dr-coverage .hint { color: inherit; opacity: 0.8; }

/* L'énoncé **est** la décision : il prend la place. Sans cette largeur, la
   phrase tombe à un mot par ligne dès que la fenêtre se réduit — le tableau
   reste lisible, l'énoncé ne l'est plus. Et **rien** n'est en `nowrap` : une
   colonne qui refuse de se replier — « Floa — Direction recouvrement
   (P. Lemaire) · 2026-09-20 » — pousse le tableau hors de sa carte, qui coupe
   (`overflow: hidden`) plutôt que de défiler, et la dernière colonne disparaît. */
/* `fixed` pour que les largeurs demandées soient tenues : en `auto`, la somme
   des largeurs naturelles dépassait la carte, qui coupe plutôt que de défiler —
   la colonne DECIDED disparaissait purement et simplement. Mesuré : 825 px de
   tableau dans une carte de 741. */
.dr-list table { table-layout: fixed; }
.dr-list td { overflow-wrap: break-word; }
.dr-list td.dr-decision, .dr-list th.dr-decision { width: 40%; }

/* ---------- Qualification (lot MC4) ---------- */
/* Préfixe .qf- : vérifié qu'aucune classe globale ne le portait déjà avant
   d'écrire ce bloc. */
.qf-qual-banner { margin-bottom: 12px; }
.qf-qual-pill { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.qf-launch-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border); border-radius: 6px; padding: 8px; }
.qf-launch-estimate { margin-top: 8px; }
.qf-bar { margin: 8px 0; }
.qf-bar-track { position: relative; height: 10px; border-radius: 5px; background: var(--track); overflow: visible; }
.qf-bar-gate-zone { position: absolute; top: 0; bottom: 0; left: 0; background: var(--warn-bg); border-radius: 5px 0 0 5px; }
.qf-bar-ci { position: absolute; top: 2px; bottom: 2px; background: var(--blue); opacity: 0.25; border-radius: 3px; }
.qf-bar-gate { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--danger); }
.qf-bar-marker { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--text); }
.qf-passk { display: inline-flex; gap: 2px; vertical-align: middle; }
.qf-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--track); border: 1px solid var(--border); }
.qf-dot.on { background: var(--ok); border-color: var(--ok); }
.qf-reasons { margin: 0; padding-left: 18px; }
.qf-verdict-heading { margin: 12px 0 4px; font-size: 13px; }
.qf-comparable { color: var(--ok); }
.qf-publish-evidence { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.qf-publish-evidence h3 { margin: 0 0 8px; font-size: 14px; }

/* ---------- decisions: analysis & the signed sentence (.da-) ----------
   « Oui » cite ce qu'il signe avant tout appel (lot DA0). */
.da-sign {
  margin: 0 0 10px;
  padding: 10px 14px;
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  background: var(--blue-soft);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: break-word;
}
/* Le panneau d'analyse (lot DA2) : trois bandes sous l'énoncé. Aucune couleur
   nouvelle — contradicts reprend le danger, refines l'ambre existants. */
.da-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.45;
}
.da-advice { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.da-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .da-cols { grid-template-columns: 1fr; } }
.da-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.da-quote {
  margin: 0;
  padding: 6px 10px;
  border-left: 3px solid var(--border);
  background: var(--surface);
  overflow-wrap: break-word;
}
.da-conflict-list { margin: 0; padding-left: 18px; color: var(--danger); }
.da-conflict-list li span { color: var(--text-sec); }
.da-related { display: flex; flex-direction: column; gap: 6px; }
.da-rel { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.da-rel-stmt { flex: 1; min-width: 200px; overflow-wrap: break-word; }
.da-rel-why { flex-basis: 100%; padding-left: 4px; }
.da-foot { font-size: 12px; }
/* Dans les boîtes Oui et Non : ce que cette réponse contredirait. */
.da-conflicts {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--danger-line);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}
.da-consistent { margin-top: 10px; }
/* Lot RC2 : un choix par conflit dans les boîtes Oui et Non, et les liens de la fiche. */
.rc-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.rc-conflict {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--danger-line);
  border-radius: 8px;
  background: var(--danger-bg);
  font-size: 13px;
  line-height: 1.45;
}
.rc-conflict.rc-info { border-color: var(--border); background: var(--bg); }
.rc-head, .rc-ref { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rc-stmt { flex: 1; min-width: 180px; overflow-wrap: break-word; }
.rc-why { margin: 0; }
.rc-options { display: flex; gap: 16px; flex-wrap: wrap; }
.rc-options label, .rc-repoint { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.rc-stop { margin: 0; color: var(--danger); }
.rc-effect p, .rc-keep .field { margin: 0; }
/* La règle globale `textarea { min-height: 220px }` est faite pour le prompt système. */
.rc-keep textarea { min-height: 0; }
.rc-unavailable {
  padding: 10px 12px;
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  background: var(--warn-bg);
  font-size: 13px;
}
.rc-left { margin: 0; font-weight: 600; }
.rc-foot { margin: 0; font-size: 12px; }
.rc-compat { display: flex; flex-direction: column; gap: 2px; }
.rc-compat-line { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.rc-compat .hint { margin: 0; }
/* Lot RC4 : le contrôle du registre, sous l'en-tête de l'écran Decisions. */
main > .rc-check { margin-bottom: var(--space-4); }
.rc-check { display: flex; flex-direction: column; gap: 10px; }
.rc-band {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
}
.rc-band.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.rc-band-text { font-weight: 600; }
.rc-report { display: flex; flex-direction: column; gap: 10px; }
.rc-finding {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.rc-finding.rc-resolved { opacity: 0.75; }
.rc-finding-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rc-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rc-gestures { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-resolved-list summary { cursor: pointer; font-size: 13px; color: var(--text-sec); }
.rc-resolved-list[open] { display: flex; flex-direction: column; gap: 10px; }
.rc-report-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 720px) { .rc-pair { grid-template-columns: 1fr; } }
/* « Decide together with D-y » : la question sœur, montrée deux secondes. */
.da-flash { outline: 2px solid var(--warn); outline-offset: 2px; border-radius: 8px; }
@media print {
  .da-analyse, .da-panel button { display: none !important; }
  .da-panel { break-inside: avoid; }
}

/* ---------- conditions d'appel des scénarios (lot CO4) ----------
   Aucune couleur nouvelle : la hachure d'une variante non jouable reprend
   `--track` sur `--surface`, le gris d'une cellule en attente. */
.cc-card .cc-toggles {
  display: grid;
  gap: var(--space-2);
}
.cc-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2);
  align-items: start;
  cursor: pointer;
}
.cc-toggle input {
  margin-top: 3px;
}
.cc-text {
  display: grid;
  gap: 1px;
  font-size: 12.5px;
}
.cc-text .hint {
  font-size: 11.5px;
}
.cc-plays-block {
  display: grid;
  gap: var(--space-2);
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}
.cc-plays {
  display: grid;
  gap: 4px;
}
.cc-play {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-2);
  font-size: 12.5px;
}
.cc-play .cc-cond {
  font-weight: 600;
}
.cc-play.na .cc-when {
  color: var(--text-sec);
}
.cc-error {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12.5px;
}
.wiz-variants {
  display: grid;
  gap: var(--space-2);
}
.wiz-variant-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.wiz-variant-title {
  display: block;
  padding: 6px 11px;
  font-weight: 600;
  font-size: 12.5px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.wiz-variant {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 11px;
  font-size: 12.5px;
}
.wiz-variant + .wiz-variant {
  border-top: 1px solid var(--border);
}
.test-grid th.played,
.test-grid td.played {
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-sec);
}
.test-grid tr.grid-group td {
  padding-bottom: 0;
  border-bottom: 0;
}
.test-grid td.scen.variant {
  padding-left: var(--space-5);
}
.test-grid .cond {
  display: inline-block;
  margin-left: var(--space-2);
  font-size: 11.5px;
  color: var(--text-sec);
}
.test-grid td.scen.variant .cond {
  margin-left: 0;
  font-size: 12.5px;
  color: var(--text);
}
.test-grid .na-reason {
  display: block;
  font-size: 11.5px;
  color: var(--text-sec);
}
.test-grid tr.grid-na td {
  background: repeating-linear-gradient(135deg, var(--track) 0 6px, var(--surface) 6px 12px);
}
.cell-na {
  background: var(--surface);
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
}
.sim-played {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: baseline;
  font-size: 12.5px;
  border-top: 1px solid var(--border);
}
.sim-played.na {
  background: repeating-linear-gradient(135deg, var(--track) 0 6px, var(--surface) 6px 12px);
}

/* ---------- panneau Actions : inventaire et fiche (lots AP3-AP4, redessinés en AP6) ----------
   Référence de mise en page : docs/yelda-air-panneau-actions-prototype.html.
   Composants réutilisés, jamais redéfinis ici : `.tl-state`, `.tl-chev`,
   `.tl-switch`, `.tl-tabs` / `.tl-tab`, `.tl-back`, `.tl-menu` (panneau Tools),
   `.badge`, `.kb-chip`, `.link-button`. Tout sélecteur propre est préfixé `ap-`
   (inventaire, fiche) ou `ar-` (routage) : `.seg`, `.card`, `.chip` existent déjà
   globalement. Couleurs : jetons seulement — aucun hexadécimal dans ce bloc. */
/* Le panneau mesure sa propre largeur : la sidebar et le panneau de chat la
   retirent au viewport, donc une media query se tromperait de plusieurs
   centaines de pixels. */
.ap-panel { display: flex; flex-direction: column; gap: 18px; container: ap-panel / inline-size; }
/* La règle globale `textarea { min-height: 220px }` est faite pour le prompt. */
.ap-panel textarea { min-height: 0; }
.ap-list { display: flex; flex-direction: column; gap: 16px; }
.ap-mono, .ap-panel code { font-family: var(--mono); }
.ap-th { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-sec); }
.ap-danger { color: var(--danger); }

/* En-tête de page : titre et phrase, période, compteur. */
.ap-pagehead { display: flex; align-items: flex-start; gap: var(--space-5); flex-wrap: wrap; }
.ap-pagetitle { flex: 1 1 360px; display: flex; flex-direction: column; gap: 6px; }
.ap-pagetitle h2 { margin: 0; font-size: 18px; }
.ap-pagetitle p { margin: 0; max-width: 720px; line-height: 1.5; }
.ap-pagehead > .badge { height: 34px; padding: 0 12px; }

/* Contrôle segmenté : boutons jointifs, sélection pleine. */
.ap-seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.ap-seg button { border: 0; border-right: 1px solid var(--border-strong); border-radius: 0; background: var(--surface); padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--text); }
.ap-seg button:last-child { border-right: 0; }
.ap-seg button[aria-pressed='true'],
.ap-seg button[aria-pressed='true']:hover:not(:disabled) { background: var(--blue); color: var(--on-accent); font-weight: 600; }

/* Tuiles. */
.ap-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ap-tile { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.ap-tile strong { font-size: 28px; line-height: 1.1; color: var(--text); }
.ap-tile-sub { font-size: 12px; color: var(--text-sec); }
.ap-tile.danger { background: var(--danger-bg); border-color: var(--danger-line); }
.ap-tile.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.ap-tile.danger strong, .ap-tile.danger .ap-th, .ap-tile.danger .ap-tile-sub { color: var(--danger); }
.ap-tile.warn strong, .ap-tile.warn .ap-th, .ap-tile.warn .ap-tile-sub { color: var(--warn); }

/* Bandeau d'échec. */
.ap-failures { display: flex; flex-direction: column; gap: 10px; }
.ap-failure { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--danger-line); border-radius: var(--radius-md); background: var(--danger-bg); color: var(--danger); font-size: 13px; }
.ap-failure-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ap-failure code { overflow-wrap: anywhere; font-size: 12px; }
.ap-failure select { width: auto; max-width: 240px; }

/* Bande du résumé, puis sa feuille. */
.ap-sumband { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.ap-sumtitle { width: 250px; flex-shrink: 0; display: flex; flex-direction: column; gap: 3px; }
.ap-chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.ap-sheet { border: 1px solid var(--blue-line); border-radius: var(--radius-md); padding: 18px 20px; background: var(--surface); }
.ap-sheet .card { box-shadow: none; border: 0; padding: 0; margin: 0; }

/* Boîtes : routage, inventaire, historique. */
.ap-box { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.ap-boxhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; background: var(--surface-2); }
.ap-boxtitle { flex: 1 1 280px; display: flex; flex-direction: column; gap: 3px; }
.ap-boxtitle b { font-size: 15px; }
.ap-boxhead input.ap-filter { width: 260px; max-width: 100%; }
.ap-boxfoot { margin: 0; padding: 12px 20px; border-top: 1px solid var(--track); }
.ap-routing { display: flex; flex-direction: column; gap: 10px; }
.ap-routing > .hint { margin: 0; }

/* Groupes d'endpoint. */
.ap-groups { display: flex; flex-direction: column; }
.ap-group-band { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 20px; background: var(--blue-soft); border-top: 1px solid var(--blue-line); border-bottom: 1px solid var(--blue-line); }
.ap-endpoint { flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.ap-token { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--violet-bg); color: var(--violet); font-weight: 600; }
.ap-group-editor { border-bottom: 1px solid var(--blue-line); padding: 18px 20px; background: var(--surface); }
.ap-group-editor h3 { margin: 0 0 6px; font-size: 14px; }

/* Lignes d'inventaire, calquées sur `.tl-row`. */
.ap-row-head, .ap-row { display: grid; grid-template-columns: 64px minmax(180px, 1fr) minmax(220px, 1.4fr) 150px 120px 16px; column-gap: 16px; align-items: center; padding: 0 20px; }
.ap-row-head { min-height: 34px; background: var(--surface-2); border-top: 1px solid var(--track); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-sec); }
.ap-row { width: 100%; min-height: 58px; padding-top: 10px; padding-bottom: 10px; border: 0; border-top: 1px solid var(--track); border-radius: 0; background: var(--surface); text-align: left; font: inherit; font-size: 13px; font-weight: 400; color: inherit; cursor: pointer; }
.ap-row:hover:not(:disabled) { background: var(--surface-2); }
.ap-row > span { min-width: 0; }
.ap-id { display: flex; flex-direction: column; gap: 2px; }
.ap-name { font-weight: 600; }
.ap-row .ap-name { font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }
.ap-key { font-family: var(--mono); font-size: 11px; color: var(--text-faint); overflow-wrap: anywhere; }
.ap-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: 0 0 auto; }
.ap-when-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.ap-when-cell .badge { font-size: 11px; padding: 2px 7px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.ap-when-cell .hint { font-size: 12px; }
.ap-period { font-size: 12px; color: var(--text-sec); }
.ap-period.failed { color: var(--danger); font-weight: 600; }
/* Une action coupée s'estompe, elle ne bouge pas. */
.ap-row.off .ap-id, .ap-row.off .ap-when-cell { opacity: .55; }

/* ---------- la fiche ---------- */
.ap-detail > section { display: flex; flex-direction: column; gap: 14px; }
.ap-detail .tl-back { align-self: flex-start; }
.ap-detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ap-detail-title { flex: 1 1 300px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-detail-title h2 { margin: 0; font-size: 19px; }
.ap-detail-title code { font-size: 12px; }
.ap-detail-head > .ap-chiprow { flex: 0 1 auto; }
.ap-more { position: relative; }
.ap-danger-item b { color: var(--danger); }
.ap-columns { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.ap-stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* Une condition par rangée : libellé à gauche, contrôle à droite. */
.ap-cond { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 20px; align-items: start; padding: 14px 0; border-top: 1px solid var(--track); }
.ap-when > .ap-cond:first-child, .ap-cond-title + .ap-cond { border-top: 0; }
.ap-cond-label { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.ap-cond-label b { font-size: 14px; font-weight: 600; }
.ap-cond-label .hint, .ap-cond-control > .hint { font-size: 12px; }
.ap-cond-control { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ap-cond-control .field { margin-bottom: 0; }
.ap-cond-title { padding: 12px 0 2px; border-top: 1px solid var(--track); }
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-chip { font-weight: 500; }
.ap-chip[aria-pressed='true'] { font-weight: 600; }
.ap-who { font-size: 11px; color: var(--text-sec); font-weight: 400; }
.ap-stepper { display: flex; align-items: center; gap: 8px; }
.ap-step { padding: 5px 11px; font-size: 14px; line-height: 1; }
.ap-stepper input.ap-turns { width: 64px; text-align: center; }
.ap-clear { margin: 10px 0 4px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--blue-soft); border: 1px solid var(--blue-line); font-size: 14px; line-height: 1.55; color: var(--blue-deep); }
.ap-clear code { font-size: 12.5px; }
.ap-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 14px; border-top: 1px solid var(--track); }

/* Requête. */
.ap-shared { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 6px; border-radius: var(--radius-md); background: var(--blue-soft); border: 1px solid var(--blue-line); }
.ap-shared-text { flex: 1; font-size: 13px; line-height: 1.5; color: var(--blue-deep); }
.ap-method-url { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; }
.ap-timeout-mock { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; }
.ap-body-lines { border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; font-family: var(--mono); font-size: 12px; line-height: 1.65; background: var(--surface); overflow: auto; }
.ap-line { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ap-line.own { background: var(--warn-bg); }
.ap-line-number { color: var(--text-faint); text-align: right; user-select: none; }

/* Historique. */
.ap-history-filter { max-width: 260px; }
.ap-history { width: 100%; border-collapse: collapse; font-size: 13px; }
.ap-history th { padding: 9px 14px; text-align: left; background: var(--surface-2); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-sec); }
.ap-history td { padding: 10px 14px; border-top: 1px solid var(--track); vertical-align: top; }
/* Une cellule de tableau reste une cellule : un `display: flex` sur un `td`
   le sort du tableau, et les filets des lignes cessent de s'aligner. */
.ap-history-call a, .ap-history-call time, .ap-history-reason > * { display: block; }
.ap-history-call a { font-size: 12px; overflow-wrap: anywhere; }
.ap-history-call time { font-size: 11.5px; margin-top: 2px; }
.ap-response { margin-top: 4px; padding: 0; background: none; color: var(--danger); font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ap-num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Rail. */
.ap-rail { display: flex; flex-direction: column; gap: 14px; }
.ap-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.ap-card h3 { margin: 0; font-size: 14px; }
.ap-card p { margin: 0; overflow-wrap: anywhere; }
.ap-card > .link-button { align-self: flex-start; }
.ap-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--track); }
.ap-bar span { min-width: 2px; }
.ap-bar-ok { background: var(--ok); }
.ap-bar-danger { background: var(--danger); }
/* Les causes d'un `skipped`, en dégradés neutres : ce n'est pas une alerte. */
.ap-sk0 { background: var(--neutral); }
.ap-sk1 { background: var(--border-strong); }
.ap-sk2 { background: var(--border); }
.ap-sk3 { background: var(--track); }
.ap-sq { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.ap-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.ap-kv-rule { border-top: 1px solid var(--track); padding-top: 10px; }
.ap-finding { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.ap-finding .badge { flex-shrink: 0; }

/* ---------- routage ---------- */
.ar-scroll { overflow-x: auto; }
.ar-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ar-table th { padding: 9px 14px; text-align: left; background: var(--surface-2); border-top: 1px solid var(--track); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-sec); }
.ar-table td { padding: 10px 14px; border-top: 1px solid var(--track); font-size: 12.5px; }
.ar-table .ar-any { color: var(--text-faint); }
.ar-table .ar-gap { background: var(--warn-bg); }
.ar-table .ar-overlap { background: var(--danger-bg); }
.ar-table .ar-by_design { background: var(--surface-2); color: var(--text-sec); }
.ar-keys { overflow-wrap: anywhere; }
.ar-key { font-family: var(--mono); font-size: 12px; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.ar-plus { color: var(--danger); margin: 0 6px; }
.ar-none { color: var(--warn); }
.ar-num { font-variant-numeric: tabular-nums; }

/* Étroit : la ligne passe sur trois rangées au lieu de cacher une colonne — le
   compte de la période et le dernier envoi sont ce qu'on vient lire. */
@container ap-panel (max-width: 980px) {
  .ap-columns { grid-template-columns: minmax(0, 1fr); }
}
@container ap-panel (max-width: 860px) {
  .ap-row-head { display: none; }
  .ap-row {
    grid-template-columns: 64px minmax(0, 1fr) auto 16px;
    grid-template-areas: 'state id last chev' '. when when when' '. period period period';
    row-gap: 6px;
  }
  .ap-row > :nth-child(1) { grid-area: state; }
  .ap-row > :nth-child(2) { grid-area: id; }
  .ap-row > :nth-child(3) { grid-area: when; }
  .ap-row > :nth-child(4) { grid-area: period; }
  .ap-row > :nth-child(5) { grid-area: last; }
  .ap-row > :nth-child(6) { grid-area: chev; }
  .ap-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-sumtitle { width: auto; }
}
@container ap-panel (max-width: 640px) {
  .ap-cond { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .ap-pair { grid-template-columns: minmax(0, 1fr); }
}
.cnav { position: relative; display: flex; align-items: stretch; height: 34px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.cnav-step { width: 36px; flex-shrink: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); font-size: 22px; }
.cnav-step:first-child { border-right: 1px solid var(--border); border-radius: 8px 0 0 8px; }
.cnav-step:nth-child(3) { border-left: 1px solid var(--border); border-radius: 0 8px 8px 0; }
.cnav-step:hover:not([aria-disabled="true"]) { background: var(--hover); }
.cnav-step[aria-disabled="true"] { color: var(--border-strong); cursor: default; }
.cnav-count { border: 0; background: transparent; color: var(--text); padding: 0 12px; display: flex; align-items: center; gap: 5px; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cnav-list-chip { margin-left: 6px; background: var(--blue-soft); color: var(--blue-deep); border: 1px solid var(--blue-line); border-radius: 10px; padding: 2px 8px; font-size: 11px; overflow-wrap: anywhere; }
.cnav-status { font-size: 12px; color: var(--text-sec); }
.cnav-count { cursor: pointer; }
.cnav-count:hover { background: var(--hover); }
.cnav-count[aria-expanded="true"] { background: var(--blue-soft); }
.cnav-peek, .cnav-pop { position: absolute; top: 42px; right: 0; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--pop-shadow); z-index: 20; }
.cnav-peek { width: 290px; padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); pointer-events: none; }
.cnav-peek-direction { display: flex; justify-content: space-between; color: var(--text-sec); font-size: 11px; text-transform: uppercase; }
.cnav-pop { width: 650px; max-height: 70vh; overflow: auto; }
.cnav-pop-head, .cnav-pop-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) var(--space-4); }
.cnav-pop-head { border-bottom: 1px solid var(--border); }
.cnav-pop-head small { margin-left: auto; color: var(--text-sec); }
.cnav-pop-foot { justify-content: space-between; background: var(--surface-2); font-size: 11px; color: var(--text-sec); }
.cnav-row { display: grid; grid-template-columns: 24px minmax(140px, 1fr) 50px 65px minmax(70px, 1fr) 65px; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.cnav-row:hover { color: var(--text); background: var(--hover); }
.cnav-row[aria-current="true"] { background: var(--blue-soft); font-weight: 600; }
.cnav-rank { color: var(--text-sec); }
.cnav-tags { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.cnav-row .cnav-latency { text-align: right; }
@media (max-width: 700px) {
  .cnav-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .cnav-date { overflow-wrap: anywhere; }
  .cnav-pop { width: calc(100vw - 32px); }
}
/* Background speech: scoped classes, no global control overrides. */
.background-speech-panel { margin: 1.5rem 0; }
.background-speech-histogram { display: flex; position: relative; height: 96px; gap: 1px; margin-top: 16px; }
.background-speech-bin { flex: 1; display: flex; align-items: flex-end; gap: 1px; min-width: 0; }
.background-speech-bin span { display: block; width: 50%; }
.background-speech-barge { background: #4b85cb; }
.background-speech-caller { background: #929ba6; }
.background-speech-marker { position: absolute; top: 0; bottom: 0; border-left: 2px solid #b55442; pointer-events: none; }
.background-speech-axis { display: flex; justify-content: space-between; font-size: 11px; color: #68727e; }
.turn-thread-background { align-self: flex-start; max-width: 80%; padding: 10px 14px; border: 1px dashed #929ba6; border-radius: 12px; color: #68727e; background: #f5f6f8; }
.turn-thread-background summary { cursor: pointer; }
.turn-thread-rescue { align-self: flex-start; }

/* ---------- onglet Technique : bilan d'abord (lot OT3) ----------
   Préfixe `tq-` : `.finding`, `.stats` et `.lane` sont des candidats à collision. */

.tq-panel > * + * {
  margin-top: var(--space-4);
}
.tq-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.tq-card-head h2,
.tq-card-head h3 {
  margin: 0;
}
.tq-card-head .spacer {
  flex: 1;
}

/* Barre de saut, collante en tête de l'onglet. */
.tq-jumphost {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding-block: 6px;
}
.tq-jumpbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.tq-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
}
.tq-jump:hover {
  border-color: var(--border-strong);
}
.tq-jump-value {
  color: var(--text-sec);
  font-variant-numeric: tabular-nums;
}
.tq-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neutral);
  flex: none;
}
.tq-dot.ok { background: var(--ok); }
.tq-dot.warn { background: var(--amber); }
.tq-dot.danger { background: var(--danger); }

/* Bilan 2/3, version 1/3. */
.tq-bilan {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}
.tq-bilan .card,
.tq-three > .card {
  margin: 0;
}
.tq-findings {
  display: grid;
}
.tq-finding {
  display: grid;
  grid-template-columns: 4px 96px minmax(0, 1fr) auto;
  gap: 0 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  align-items: start;
}
.tq-finding:first-child {
  border-top: 0;
}
.tq-stripe {
  align-self: stretch;
  border-radius: 2px;
  background: var(--neutral);
}
.tq-sev {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 2px;
  color: var(--text-sec);
}
.tq-finding.tq-incident .tq-stripe { background: var(--danger); }
.tq-finding.tq-incident .tq-sev { color: var(--danger); }
.tq-finding.tq-warning .tq-stripe { background: var(--amber); }
.tq-finding.tq-warning .tq-sev { color: var(--warn); }
.tq-finding.tq-info .tq-stripe { background: var(--blue-line); }
.tq-finding-title {
  font-weight: 600;
}
.tq-hyp {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--violet-bg);
  color: var(--violet);
  font-size: 11px;
  font-weight: 600;
}
.tq-finding-detail {
  margin-top: 2px;
  font-size: 13px;
}
.tq-finding-remedy {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-sec);
}
.tq-finding-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.tq-chip {
  border: 1px solid var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 999px;
  padding: 2px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.tq-chip:hover {
  border-color: var(--blue);
}
.tq-goods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
}
.tq-goods-label {
  margin-right: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-sec);
}
.tq-good {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12px;
}
.tq-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: 12px;
}
.tq-copy-area {
  position: fixed;
  left: -9999px;
}

/* « Compared with the version » : point = P50, losange = P90, trait = version. */
.tq-bench {
  display: grid;
  gap: 12px;
  margin-top: var(--space-3);
}
.tq-bench-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: center;
}
.tq-bench-label {
  font-size: 12.5px;
}
.tq-bench-label small {
  display: block;
  color: var(--text-faint);
  font-size: 11px;
}
.tq-scale {
  position: relative;
  height: 26px;
}
.tq-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  height: 2px;
  background: var(--track);
}
.tq-band {
  position: absolute;
  top: 6px;
  height: 14px;
  background: var(--warn-bg);
  border-left: 1px dashed var(--warn-line);
  border-right: 1px dashed var(--warn-line);
}
.tq-base {
  position: absolute;
  top: 4px;
  width: 2px;
  height: 18px;
  background: var(--text-faint);
}
.tq-p90 {
  position: absolute;
  top: 9px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  transform: rotate(45deg);
  border: 1.5px solid var(--text-sec);
  background: var(--surface);
}
.tq-me {
  position: absolute;
  top: 7px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong);
  background: var(--neutral);
}
.tq-me.ok { background: var(--ok); }
.tq-me.warn { background: var(--amber); }
.tq-me.danger { background: var(--danger); }
.tq-diff {
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tq-diff.ok { color: var(--ok); }
.tq-diff.warn { color: var(--warn); }
.tq-dominant {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.tq-dominant-bar {
  display: flex;
  height: 18px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--track);
}
.tq-dominant-bar .wf-swatch {
  height: 100%;
  border-radius: 0;
}
.tq-dominant-rest {
  height: 100%;
  background: var(--track);
}
.tq-baseline-note {
  margin-top: var(--space-3);
}

/* Rangées compactes : Dynamique et Exécution. */
.tq-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: start;
}
.tq-three.tq-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tq-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tq-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.tq-stat.would {
  border-style: dashed;
  border-color: var(--border-strong);
}
.tq-stat.muted .tq-stat-value {
  color: var(--text-faint);
}
.tq-stat-value {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tq-stat-label {
  font-size: 11.5px;
  color: var(--text-sec);
}
.tq-stats + .hint,
.tq-dbscale + .hint {
  margin-top: 10px;
}
.tq-dbscale {
  position: relative;
  height: 40px;
  margin: 14px 4px 4px;
}
.tq-db-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  height: 4px;
  border-radius: 2px;
  background: var(--track);
}
.tq-db-mark {
  position: absolute;
  top: 12px;
  width: 2px;
  height: 16px;
  background: var(--text-faint);
}
.tq-db-mark.margin {
  background: var(--amber);
}
.tq-db-label {
  position: absolute;
  top: 30px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-sec);
  white-space: nowrap;
}
.tq-db-point {
  position: absolute;
  top: 15px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--violet);
}
.tq-db-point.listening {
  background: var(--neutral);
}

@media (max-width: 1180px) {
  .tq-bilan,
  .tq-three,
  .tq-three.tq-two {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .tq-finding {
    grid-template-columns: 4px minmax(0, 1fr);
  }
  .tq-finding .tq-sev,
  .tq-finding .tq-finding-refs {
    grid-column: 2;
    justify-content: flex-start;
  }
  .tq-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.tq-chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
/* Une empreinte de 64 caractères ne doit pas élargir la carte. */
.tq-config .row {
  flex-wrap: wrap;
}
.tq-config .hint {
  overflow-wrap: anywhere;
}

/* ---------- onglet Technique : tours compacts, inspecteur collant (lot OT4) ---------- */

/* Tours ≈ 1,75 / inspecteur 1. */
.split.tq-turns {
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
}
/* Collant sous la barre de saut, et défilant chez lui quand il dépasse l'écran. */
.tq-turns > .inspector {
  top: 64px;
  max-height: calc(100vh - var(--topbar-h, 56px) - 80px);
  overflow-y: auto;
}
.tq-turns-card {
  min-width: 0;
}
.turns-table-host {
  overflow-x: auto;
}
.tq-turns-card:not(.show-detail) .tq-detail {
  display: none;
}
.tq-detail-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.tq-bar {
  position: relative;
  height: 12px;
  min-width: 140px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}
.tq-bar-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--warn-bg);
  border-left: 1px dashed var(--warn-line);
  border-right: 1px dashed var(--warn-line);
}
.tq-bar .tq-bar-seg {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 0;
}
.tq-bar-over {
  position: absolute;
  right: 2px;
  top: -3px;
  font-size: 12px;
  color: var(--danger);
}
.tq-acts {
  flex-wrap: wrap;
  gap: 4px;
}

/* La ligne qui remplace la carte d'un outil quand son échange est au journal. */
.tq-toolline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
}
.tq-toolline.failed {
  border-color: var(--danger-line);
  background: var(--danger-bg);
}
.tq-toolline .spacer {
  flex: 1;
}

/* Journal HTTP groupé par moment de l'appel. */
.hl-group + .hl-group {
  margin-top: var(--space-3);
}
.hl-group-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: 6px;
  font-size: 12.5px;
}

@media (max-width: 1180px) {
  .split.tq-turns {
    grid-template-columns: minmax(0, 1fr);
  }
  .tq-turns > .inspector {
    position: static;
    max-height: none;
    overflow: visible;
  }
}
/* Une table qui tient à côté de l'inspecteur : cellules serrées, extrait borné. */
.tq-turns-card th,
.tq-turns-card td {
  padding: 8px 10px;
}
.tq-turns-card td.excerpt {
  max-width: 220px;
}
.tq-turns-card th.tq-breakdown {
  width: 28%;
}
.tq-turns-card td.tq-acts-col {
  min-width: 120px;
}

/* ---------- onglet Technique : chronologie de l'appel (lot OT5) ----------
   Préfixe `tq-tl-` : `tl-` appartient déjà au panneau Tools. */

.tq-tl-scroll {
  overflow-x: auto;
}
.tq-tl-inner {
  min-width: 900px;
}
.tq-tl-lanes {
  position: relative;
}
.tq-tl-lane {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  min-height: 30px;
  border-top: 1px solid var(--border);
}
.tq-tl-lane:first-child {
  border-top: 0;
}
.tq-tl-name {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-sec);
}
.tq-tl-track {
  position: relative;
  height: 30px;
}
.tq-tl-seg {
  position: absolute;
  top: 8px;
  height: 14px;
  min-width: 2px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}
.tq-tl-seg.tq-tl-caller {
  background: var(--border-strong);
}
.tq-tl-seg.tq-tl-agent {
  background: var(--blue);
}
.tq-tl-seg.tq-tl-agent.cut {
  background: repeating-linear-gradient(45deg, var(--blue) 0 4px, var(--blue-soft) 4px 8px);
}
.tq-tl-seg.tq-tl-wait {
  top: 12px;
  height: 6px;
  background: var(--neutral);
}
.tq-tl-seg.tq-tl-wait.ok { background: var(--ok); }
.tq-tl-seg.tq-tl-wait.warn { background: var(--amber); }
.tq-tl-seg.tq-tl-wait.danger { background: var(--danger); }
.tq-tl-seg.selected {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}
.tq-tl-mark {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 10.5px;
  line-height: 16px;
  color: var(--text-sec);
  white-space: nowrap;
}
button.tq-tl-mark {
  cursor: pointer;
}
.tq-tl-mark.tq-tl-api {
  border-color: var(--ok);
  color: var(--ok);
}
.tq-tl-mark.tq-tl-api.failed {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}
.tq-tl-mark.tq-tl-ev-barge {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn);
}
.tq-tl-mark.tq-tl-ev-id {
  border-color: var(--violet-line);
  background: var(--violet-bg);
  color: var(--violet);
}
.tq-tl-mark.tq-tl-ev-bg {
  border-style: dashed;
}
.tq-tl-pending {
  position: absolute;
  top: 7px;
}
/* La zone après la fin d'appel : hachurée, sous les marqueurs d'action. */
.tq-tl-overlay {
  position: absolute;
  left: 96px;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
}
.tq-tl-after {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(135deg, transparent 0 5px, var(--track) 5px 7px);
  border-left: 1px dashed var(--border-strong);
}
.tq-tl-axis {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  border-top: 1px solid var(--border);
}
.tq-tl-ticks {
  position: relative;
  height: 20px;
}
.tq-tl-tick {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
}
/* Événements étagés sur deux rangées quand ils se touchent. */
.tq-tl-events .tq-tl-track {
  height: 46px;
}
.tq-tl-mark.lower {
  top: 26px;
}

/* ---------- panneau Evaluation (lot AP0) ---------- */

/* La regle globale `textarea { min-height: 220px }` est faite pour le prompt
   systeme : une phrase de critere tient en deux lignes. Le precedent exact de
   `.tl-view textarea`. */
.ev-view textarea { min-height: 52px; height: auto; }
.ev-list { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-3); }
.ev-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
}
.ev-row-head { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 10px; align-items: end; }
.ev-row .field { margin-bottom: 0; }
.ev-id { font-family: var(--mono); }
.ev-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); }
.ev-check { display: flex; align-items: flex-start; gap: 8px; }
.ev-check input { margin-top: 3px; }
/* La relecture rendue par le dernier Save, sous la barre d'enregistrement. */
.ev-review {
  margin-top: var(--space-3); padding: 10px 12px; font-size: 12.5px; line-height: 1.5;
  border: 1px solid var(--blue-line); border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--blue-dark);
}
.ev-review.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.ev-review p { margin: 0 0 4px; }
.ev-review ul { margin: 0; padding-left: 18px; }

/* ---------- carte Evaluation de la fiche d'appel (lot AP1) ---------- */

.ev-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ev-card-head h2 { margin: 0; }
.ev-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ev-lines { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ev-line { display: flex; gap: 8px; align-items: flex-start; }
.ev-body { min-width: 0; flex: 1; }
.ev-line-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 12.5px; }
.ev-line-head .link-button { margin-left: auto; }
.ev-sev { color: var(--text-faint); font-size: 11.5px; }
.ev-text { margin: 2px 0 0; font-size: 12.5px; color: var(--text-sec); overflow-wrap: break-word; }
.ev-why summary { cursor: pointer; font-size: 12px; color: var(--text-sec); }
.ev-why p { margin: 4px 0 0; font-size: 12.5px; overflow-wrap: break-word; }
.ev-mark { display: inline-block; width: 16px; text-align: center; font-weight: 700; }
.ev-mark.ok { color: var(--ok); }
.ev-mark.fail { color: var(--danger); }
.ev-mark.none, .ev-mark.muted { color: var(--text-faint); }

/* ==========================================================================
   Dashboards (lot DB1) — le moteur de rendu de Pilotage et de Santé technique.
   Porté de docs/yelda-air-dashboards-prototype.html (sections « tuiles »,
   « graphiques », « tables », « file à relire », « checklist cibles »,
   « dashboard liquide »), préfixé .db- : une classe globale .seg, .stat ou
   .queue existe déjà ailleurs. Aucune couleur inventée : les jetons du :root.
   ========================================================================== */

/* Lot DB5 : la barre unique. Une rangée de 40 px porte tout ce qu'on touche
   tous les jours — quel tableau, quelle période, la comparaison, les deux
   filtres rares repliés dans un bouton — et à droite les trois accès « second
   temps » (Architect, historique, menu). Rien d'autre au-dessus de la grille.
   Référence : docs/yelda-air-pilotage-condense-prototype.html. */
.db-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  flex-wrap: nowrap;
  min-width: 0;
}
.db-bar-wait {
  height: 40px;
}
.db-hint {
  font-size: 12px;
  color: var(--text-faint);
}
.db-bar .db-range {
  flex: 1 1 0;
  min-width: 0;
  text-align: right;
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
/* Le bouton-select du tableau : le <select> de DB2 sans bordure, dans un cadre
   qui porte aussi la révision en mono. */
.db-dsel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px 0 4px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  max-width: 340px;
  min-width: 0;
  flex-shrink: 1;
  cursor: pointer;
}
.db-dsel .db-dsel-select {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  border: 0;
  background: transparent;
  padding: 0 4px;
  height: 30px;
  min-width: 0;
  width: auto;
  max-width: 100%;
  text-overflow: ellipsis;
  cursor: pointer;
}
.db-dsel .db-dsel-select:focus-visible {
  outline: none;
}
.db-dsel:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
.db-dsel-rv {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}
.db-bar .db-bar-cta {
  height: 32px;
  flex-shrink: 0;
}
/* « vs période précédente » : un bouton-bascule. */
.db-tgl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.db-tgl.on {
  color: var(--blue-dark);
  border-color: var(--blue-line);
  background: var(--blue-soft);
}
.db-tgl i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  display: inline-grid;
  place-items: center;
  font-style: normal;
  font-size: 10px;
  line-height: 1;
}
.db-tgl.on i {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
/* Les boutons de la barre : filtres repliés, Architect, historique, menu. */
.db-ibtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
}
.db-ibtn:hover {
  background: var(--hover);
}
.db-ibtn.on {
  background: var(--blue-soft);
  border-color: var(--blue-line);
}
.db-ibtn.db-sq {
  width: 32px;
  padding: 0;
  justify-content: center;
}
.db-ibtn.db-arch {
  color: var(--violet);
  border-color: var(--violet-line);
  font-weight: 600;
}
.db-ibtn.db-arch:hover,
.db-ibtn.db-arch.on {
  background: var(--violet-bg);
}
.db-ibtn-sel {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--text-sec);
}
.db-mono {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-sec);
}
.db-car {
  color: var(--text-faint);
  font-size: 11px;
}
.db-dotn {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--violet);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
/* Les popovers de la barre : filtres rares, menu ⋯. */
.db-popwrap {
  position: relative;
  flex-shrink: 0;
}
.db-pop {
  position: absolute;
  z-index: 30;
  top: 100%;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(16, 32, 60, 0.18);
  padding: 8px;
  min-width: 240px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.db-pop.db-pop-left {
  left: 0;
}
.db-pop.db-pop-right {
  right: 0;
}
.db-pop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
}
.db-pop-lbl {
  width: 92px;
  color: var(--text-sec);
  font-size: 12.5px;
}
.db-pop-note {
  margin: 6px 2px 0;
  color: var(--text-faint);
  font-size: 12px;
}
.db-pop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.db-pop-item:hover,
.db-pop-item:focus-visible {
  background: var(--hover);
}
.db-pop-item small {
  margin-left: auto;
  padding-left: 14px;
  color: var(--text-faint);
  font-size: 11.5px;
}
.db-pop-item.danger {
  color: var(--danger);
}
.db-pop-hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}
.db-pop-h {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  padding: 6px 10px 2px;
}

/* Lot DB5 : le tiroir Architect, sous la barre, absent du DOM tant qu'il est fermé. */
.db-drawer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--violet-line);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow, var(--shadow));
  animation: db-drop 0.14s ease-out;
}
@keyframes db-drop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.db-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 2px 8px;
  border: 1px solid var(--violet-line);
  border-radius: 999px;
  background: var(--violet-bg);
  color: var(--violet);
  font-size: 12px;
  white-space: nowrap;
}
.db-scope > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-scope button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
}
.db-drawer-x {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}
.db-drawer > .db-hint {
  margin: 0;
}

/* Lot DB5 : la barre de 2 px — un rechargement qui garde les chiffres. */
.db-progress {
  height: 2px;
  border-radius: 1px;
  overflow: hidden;
  background: transparent;
}
.db-progress.on {
  background: var(--blue-soft);
}
.db-progress.on::after {
  content: '';
  display: block;
  height: 100%;
  width: 30%;
  background: var(--blue);
  animation: db-slide 1s infinite ease-in-out;
}
@keyframes db-slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(400%);
  }
}

/* Lot DB5 : le squelette, dans la forme de la spec. */
.db-sk {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--track) 25%, var(--surface-2) 37%, var(--track) 63%);
  background-size: 400% 100%;
  animation: db-shimmer 1.3s ease-in-out infinite;
}
@keyframes db-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}
.db-kv.skel {
  padding: 11px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 92px;
}
.db-kv.skel .db-sk-l {
  width: 55%;
  height: 14px;
}
.db-kv.skel .db-sk-v {
  width: 40%;
  height: 30px;
}
.db-kv.skel .db-sk-n {
  width: 70%;
  height: 10px;
}
.db-ch.skel .db-sk-h {
  width: 30%;
  height: 14px;
  margin-top: 2px;
}
.db-ch.skel .db-sk-body {
  flex: 1;
  min-height: 200px;
}
.db-ch.skel.db-skel-l .db-sk-body {
  min-height: 150px;
}
.db-ch.skel.db-skel-s .db-sk-body {
  min-height: 120px;
}
.db-fade-in {
  animation: db-fade 0.22s ease-out;
}
@keyframes db-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .db-sk,
  .db-fade-in,
  .db-drawer,
  .db-progress.on::after,
  .sheet {
    animation: none;
    transition: none;
  }
}

/* Lot DB5 : sous la grille, le brouillon et l'activité (l'aside de DB1). */
.db-foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.db-foot .card + .card {
  margin-top: 0;
}

/* Lot DB5 : le volet latéral générique (`sheet()` de ui.js). Il recouvre, il
   ne prend pas de colonne : la grille garde ses 12 colonnes. */
.sheet-scrim {
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(16, 32, 60, 0.18);
  z-index: 70;
}
.sheet {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(16, 32, 60, 0.14);
  z-index: 71;
  transform: translateX(100%);
  transition: transform 0.18s ease-out;
  display: flex;
  flex-direction: column;
}
.sheet.on {
  transform: none;
}
.sheet-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.sheet-head {
  min-width: 0;
}
.sheet-x {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font-size: 18px;
  cursor: pointer;
}
.sheet-body {
  overflow: auto;
  padding: 8px 14px 14px;
  font-size: 13px;
}
.db-sheet-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--track);
  border-radius: 999px;
}
.db-sheet-tabs button {
  border: 0;
  background: transparent;
  padding: 4px 11px;
  border-radius: 999px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-sec);
  cursor: pointer;
  white-space: nowrap;
}
.db-sheet-tabs button.on {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--panel-shadow, var(--shadow));
}
.sheet .db-hist-row.db-cur {
  margin: 0 -14px;
  padding-inline: 14px;
}
.db-sheet-foot {
  font-size: 12px;
  margin: 10px 0 0;
}

/* Lot DB2 : les contrôles de souris d'un widget, au survol et au focus. */
.db-ctl {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 2;
}
.db-w:hover .db-ctl,
.db-w:focus-within .db-ctl {
  opacity: 1;
}
.db-ctl-b {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sec);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.db-ctl-b:hover {
  background: var(--hover);
  color: var(--text);
}
.db-w[draggable='true'] {
  cursor: grab;
}
.db-w.db-dragging {
  opacity: 0.45;
}
.db-w.db-drop > .db-card {
  outline: 2px dashed var(--blue);
  outline-offset: 2px;
}

/* Lot DB3 : la barre de prompt de l'Architect et ses puces — depuis DB5, dans le tiroir. */
.db-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
}
.db-prompt-ic {
  flex: none;
}
.db-prompt .db-prompt-in {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 6px 0;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: transparent;
}
.db-prompt-go {
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.db-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.db-chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.db-chip:hover {
  background: var(--hover);
}
/* Le widget sélectionné : l'Architect ne touchera que lui. */
.db-w.db-sel > .db-card {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
}
.db-backlog {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}
.db-backlog-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.db-backlog-row:first-child {
  border-top: 0;
  padding-top: 0;
}

/* Lot DB2 : le rail « Historique ». */
.db-hist {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
}
.db-hist-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  align-items: center;
}
.db-hist-row:first-child {
  border-top: 0;
}
.db-hist-row.db-cur {
  background: var(--blue-soft);
  margin: 0 -16px;
  padding-inline: 16px;
}
.db-hist-r {
  font-family: var(--mono);
  color: var(--text-faint);
  font-size: 11px;
}
.db-hist-w {
  min-width: 0;
}
.db-hist-w b {
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-hist-w span {
  color: var(--text-faint);
  font-size: 11.5px;
}

.db-seg {
  display: inline-flex;
  flex-shrink: 0;
  height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.db-seg button {
  border: 0;
  background: transparent;
  padding: 0 11px;
  white-space: nowrap;
  font: inherit;
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
}
.db-seg button.on {
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 600;
}
.db-seg button + button {
  border-left: 1px solid var(--border);
}

main > .db-bar,
main > .db-drawer,
main > .db-host,
main > .db-foot {
  margin-top: var(--space-3);
}
main > .db-drawer + .db-progress,
main > .db-bar + .db-progress {
  margin-top: 4px;
}
main > .db-progress + .db-host {
  margin-top: 6px;
}

/* La grille : 12 colonnes, dense pour boucher les trous ; l'ordre de lecture
   reste celui de layout. */
.db-dash {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
}
.db-w {
  position: relative;
  min-width: 0;
}
.db-w.db-s {
  grid-column: span 3;
}
.db-w.db-m {
  grid-column: span 6;
}
.db-w.db-l {
  grid-column: span 12;
}
.db-card {
  height: 100%;
  margin: 0;
  /* Lot DB5 : chaque corps de widget porte son padding ; le 20 × 24 px de la
     carte globale doublait celui de la tuile, et c'était l'essentiel du blanc. */
  padding: 0;
}
/* Lot DB5 : une tuile KPI ne s'étire plus sur la hauteur de sa rangée. */
.db-card.db-kpi-card {
  height: auto;
}
.db-card-head {
  padding: 10px 14px 0;
  padding-right: 64px;
}
.db-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* « Estimé » : la pastille pointillée de la maquette, sur un jeton existant. */
.db-est {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border: 1px dashed var(--stage-tts);
  border-radius: 999px;
  color: var(--stage-tts);
  font-size: 10.5px;
  font-weight: 600;
  vertical-align: 1px;
}
.db-card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.db-pad {
  padding: 12px 16px;
  margin: 0;
}

/* Tuiles — lot DB5 : la tuile dense. Titre lisible et foncé, valeur et delta
   sur la même ligne, un seul détail en une ligne, ~96 px de haut. */
.db-kpi {
  padding: 11px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  min-height: 92px;
}
.db-kpi-l {
  font-size: 13.5px;
  line-height: 1.25;
  color: var(--text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 52px;
}
.db-kpi-l .db-est {
  margin-left: 0;
}
.db-kpi-vr {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.db-kpi .db-kpi-v {
  border: 0;
  background: transparent;
  padding: 0 2px;
  margin: 0 -2px;
  font: inherit;
  font-family: inherit;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}
.db-kpi .db-kpi-v.latency.ok { color: var(--ok); }
.db-kpi .db-kpi-v.latency.warn { color: var(--warn); }
.db-kpi .db-kpi-v.latency.danger { color: var(--danger); }
.db-kpi .db-kpi-v:hover,
.db-kpi .db-kpi-v:focus-visible {
  background: var(--blue-soft);
}
.db-m .db-kpi .db-kpi-v,
.db-l .db-kpi .db-kpi-v,
.db-kpi.hero .db-kpi-v {
  font-size: 38px;
}
.db-kpi-d {
  font-size: 12.5px;
  color: var(--text-sec);
  white-space: nowrap;
}
.db-delta {
  font-weight: 700;
}
.db-delta.good {
  color: var(--ok);
}
.db-delta.bad {
  color: var(--danger);
}
.db-delta.flat {
  color: var(--text-faint);
  font-weight: 600;
}
.db-kpi-n {
  font-size: 11.5px;
  color: var(--text-faint);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
/* La jauge de cible de la tuile : 4 px, 120 px au plus. */
.db-kpi-tgt {
  flex: 1 1 60px;
  max-width: 120px;
  height: 4px;
  border-radius: 2px;
  background: var(--blue-soft);
  position: relative;
}
.db-kpi-tgt i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--blue);
  border-radius: 2px;
}
.db-kpi-tgt i.bad {
  background: var(--danger);
}
.db-kpi-tgt b {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 10px;
  background: var(--text);
}

/* Bullet graph : la mesure, et un trait pour la cible. */
.db-bullet {
  height: 10px;
  background: var(--track);
  border-radius: 5px;
  position: relative;
}
.db-bullet-meas {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  background: var(--blue);
  border-radius: 2px;
}
.db-bullet-meas.bad {
  background: var(--danger);
}
.db-bullet-tgt {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 16px;
  background: var(--text);
}

/* Graphiques */
.db-ch {
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.db-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.db-chart text {
  font-family: var(--ui, inherit);
  font-size: 11px;
  fill: var(--text-sec);
}
.db-chart .db-grid line {
  stroke: var(--border);
  stroke-width: 1;
}
.db-chart .db-axis,
.db-chart .db-axis text {
  fill: var(--text-faint);
}
.db-chart .db-lbl {
  fill: var(--text);
  font-weight: 600;
}
.db-chart .db-ln {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.db-chart .db-dot,
.db-spark .db-dot {
  stroke: var(--surface);
  stroke-width: 2;
}
.db-chart .db-cross {
  stroke: var(--border-strong);
  stroke-width: 1;
}
.db-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-sec);
}
.db-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
.db-legend i.line {
  height: 2px;
  width: 14px;
  border-radius: 1px;
  vertical-align: 3px;
}

/* Barres horizontales */
.db-hbars {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.db-hbar {
  display: grid;
  grid-template-columns: minmax(90px, 190px) minmax(0, 1fr) 88px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.db-hbars-long .db-hbar {
  grid-template-columns: minmax(90px, 320px) minmax(0, 1fr) 88px;
}
.db-hbar .k {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-hbar .t {
  height: 14px;
  background: var(--track);
  border-radius: 0 4px 4px 0;
  position: relative;
}
.db-hbar .t i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 0 4px 4px 0;
}
.db-hbar .v {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.db-hbar .v small {
  color: var(--text-faint);
}

/* Entonnoir */
.db-funnel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px 14px;
}
.db-fstep {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.db-fstep .t {
  height: 22px;
  background: var(--track);
  border-radius: 0 4px 4px 0;
  position: relative;
}
.db-fstep .t i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 0 4px 4px 0;
}
.db-fstep .v {
  font-variant-numeric: tabular-nums;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: baseline;
}
.db-fstep .v b {
  font-size: 15px;
}
.db-fstep .v small,
.db-fconv {
  color: var(--text-faint);
}
.db-fconv {
  text-align: right;
  font-size: 11.5px;
  margin-top: -4px;
}

/* Barres empilées */
.db-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.db-srow {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: center;
  font-size: 12.5px;
}
.db-srow .k {
  color: var(--text-sec);
}
.db-srow .b {
  display: flex;
  height: 18px;
  gap: 2px;
}
.db-srow .b i {
  height: 100%;
  display: block;
  min-width: 0;
  border-radius: 2px;
}
.db-srow .b i:first-child {
  border-radius: 4px 2px 2px 4px;
}
.db-srow .b i:last-child {
  border-radius: 2px 4px 4px 2px;
}
.db-srow .v {
  text-align: right;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* Tables */
.db-tw {
  overflow-x: auto;
  padding: 8px 0 4px;
}
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.db-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.db-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.db-table tr:last-child td {
  border-bottom: 0;
}
.db-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.db-table .mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-sec);
}
.db-table .muted {
  color: var(--text-faint);
}
/* Lot SQ3 : un tableau par dimension défile dans sa carte, la première colonne
   reste collée ; la ligne de période en pied ; le jour en cours le dit. */
.db-table-dim th:first-child,
.db-table-dim td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  white-space: nowrap;
}
.db-table-dim thead th:first-child {
  background: var(--surface-2);
}
.db-table tfoot th,
.db-table tfoot td {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  background: var(--surface-2);
}
.db-table tfoot th {
  text-align: left;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}
.db-partial-tag {
  margin-left: 6px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 400;
}
.db-card-head .db-copy {
  margin-left: auto;
}

/* File à relire */
.db-queue {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}
.db-qrow {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  align-items: center;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}
.db-qrow:hover {
  background: var(--hover);
}
.db-qtime {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.db-qwho {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-sec);
}
.db-qfacts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

/* Cibles */
.db-targets {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px 14px;
}
.db-tg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
}
.db-tg .h {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.db-tg .h b {
  font-weight: 600;
}
.db-tg .h span {
  color: var(--text-sec);
  font-variant-numeric: tabular-nums;
}

/* Carte dégradée : planned, capability, removed, error. */
.db-degraded {
  padding: 14px 16px;
  color: var(--text-sec);
  font-size: 13px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.db-card:has(.db-degraded) {
  border: 0;
  box-shadow: none;
  background: transparent;
}

/* « Expliquer ce chiffre » */
.db-explain {
  position: absolute;
  z-index: 30;
  top: 54px;
  left: 8px;
  width: min(320px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(16, 32, 60, 0.18);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text);
}
.db-explain h4 {
  margin: 0 0 6px;
  font-size: 13px;
}
.db-explain p {
  margin: 0 0 8px;
}
.db-explain dl {
  margin: 0;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 4px 10px;
}
.db-explain dt {
  color: var(--text-faint);
}
.db-explain dd {
  margin: 0;
}
.db-explain code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
  word-break: break-all;
}
.db-explain-x {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
}

/* L'infobulle des graphes : une seule, posée au pointeur. */
.db-tip {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 6px;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
  opacity: 0;
  transition: opacity 0.08s;
}
.db-tip.on {
  opacity: 1;
}
.db-tip-head {
  opacity: 0.75;
  margin-bottom: 3px;
}
.db-tip-extra {
  opacity: 0.8;
}
.db-tip-swatch {
  display: inline-block;
  width: 12px;
  height: 2px;
  vertical-align: middle;
  margin-right: 6px;
}

@media (max-width: 1100px) {
  .db-bar {
    flex-wrap: wrap;
  }
  .db-bar .db-range {
    flex-basis: 100%;
    order: 10;
    text-align: left;
  }
}
@media (max-width: 900px) {
  .db-w.db-s {
    grid-column: span 6;
  }
}
@media (max-width: 900px) {
  .db-w.db-m {
    grid-column: span 12;
  }
  .db-foot {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .sheet {
    width: 100%;
  }
  .db-w.db-s,
  .db-w.db-m {
    grid-column: span 12;
  }
  .db-fstep {
    grid-template-columns: 110px minmax(0, 1fr) 90px;
  }
  .db-hbar {
    grid-template-columns: minmax(80px, 120px) minmax(0, 1fr) 64px;
  }
  .db-qrow {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- panneau Identity check (lot IU1) ----------
   La maquette `docs/yelda-air-verification-identite-prototype.html`, reproduite
   avec les seuls jetons existants. Le panneau pose ses propres surfaces : la
   carte de l'éditeur qui le porte devient transparente, sinon on aurait des
   cartes dans une carte. Préfixe `idp-` — `.empty`, `.row`, `.pill` et `.chip`
   sont déjà pris. La largeur se lit sur le panneau (container query), jamais
   sur la fenêtre : la sidebar et le chat en retirent des centaines de pixels. */
.card.form-panel-identification { padding: 0; background: none; border: 0; box-shadow: none; }
.idp-panel { container: idp / inline-size; }
.idp-panel .field { margin-bottom: 0; }
/* La règle globale `textarea { min-height: 220px }` est faite pour le prompt. */
.idp-panel textarea { min-height: 58px; font-family: var(--font); line-height: 1.45; }
.idp-grow { flex: 1; }
.idp-faint { color: var(--text-faint); }

.idp-lock { display: flex; gap: 10px; align-items: flex-start; background: var(--violet-bg); border: 1px solid var(--violet-line); color: var(--violet); border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: var(--space-4); font-size: 13px; }
.idp-lock b { font-weight: 600; }
.idp-lock-i { font-size: 16px; }

.idp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--panel-shadow); margin-bottom: var(--space-4); }
.idp-card-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.idp-card-h h2 { font-size: 14px; margin: 0; }
.idp-card-i { font-size: 15px; }
.idp-card-i.ok { color: var(--ok); }
.idp-card-note { font-size: 12px; color: var(--text-sec); }
.idp-none { padding: 18px 20px; display: grid; gap: 10px; justify-items: start; }

/* ---- parcours ---- */
.idp-flow { display: flex; align-items: center; padding: 18px 20px 20px; }
.idp-node { flex: 1 1 0; min-width: 132px; display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-md); padding: 8px 12px; text-align: left; font-weight: 400; transition: .12s; }
button.idp-node:hover:not(:disabled) { border-color: var(--blue-line); background: var(--hover); }
.idp-node.sel { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.idp-node-start { flex: 0 0 auto; min-width: 0; border-style: dashed; background: var(--bg); }
.idp-n { font-size: 11px; color: var(--text-faint); }
.idp-k { font-weight: 600; }
.idp-m { font-size: 11.5px; color: var(--text-sec); }
.idp-k, .idp-m { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idp-arrow { flex: 0 0 22px; height: 1px; background: var(--border-strong); position: relative; margin: 0 2px; }
.idp-arrow::after { content: ""; position: absolute; right: -1px; top: -3px; border: 3.5px solid transparent; border-left: 5px solid var(--border-strong); }
.idp-arrow-end { flex-basis: 30px; }
.idp-verdict { flex: 0 0 250px; display: flex; flex-direction: column; gap: 8px; margin-left: 4px; }
.idp-out { border-radius: var(--radius-md); padding: 7px 12px; font-size: 12.5px; border: 1px solid; }
.idp-out.ok { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok); }
.idp-out.ko { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.idp-out b { font-weight: 600; }
.idp-flow-foot { padding: 0 20px 14px; margin: 0; font-size: 12px; color: var(--text-sec); }

/* ---- inventaire + fiche ---- */
.idp-split { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: 540px; }
.idp-inv { border-right: 1px solid var(--border); padding: 10px; }
/* Une ligne d'inventaire : un bouton, rien d'interactif dedans (lot AP6). */
.idp-row { width: 100%; display: grid; grid-template-columns: 14px 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; background: none; border: 1px solid transparent; border-radius: var(--radius-md); padding: 9px 10px; margin-bottom: 4px; text-align: left; font-weight: 400; }
.idp-row:hover:not(:disabled) { background: var(--hover); }
.idp-row.sel { background: var(--blue-soft); border-color: var(--blue-line); }
.idp-row.idp-dragging { opacity: .5; }
.idp-row.idp-drop { border-color: var(--blue); border-style: dashed; }
.idp-grip { color: var(--text-faint); cursor: grab; letter-spacing: -2px; font-size: 12px; }
.idp-kind { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; background: var(--track); }
.idp-kind-lg { width: 34px; height: 34px; flex: 0 0 34px; }
.idp-k-text { background: var(--track); }
.idp-k-date { background: var(--cyan-bg); }
.idp-k-address { background: var(--violet-bg); }
.idp-k-digits { background: var(--warn-bg); }
.idp-k-postal_code { background: var(--ok-bg); }
.idp-row-main { display: flex; flex-direction: column; min-width: 0; }
.idp-row-key { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idp-row-sub { font-size: 11.5px; color: var(--text-sec); display: flex; gap: 4px 6px; align-items: center; flex-wrap: wrap; }
.idp-row-sub code { font-size: 11px; }
.idp-row-att { font-size: 11.5px; color: var(--text-sec); text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.idp-mini { padding: 0 6px; }
.idp-add { width: 100%; border: 1px dashed var(--border-strong); background: none; border-radius: var(--radius-md); padding: 9px; color: var(--blue-dark); margin-top: 6px; }
.idp-none .idp-add { width: auto; padding: 9px 16px; }
.idp-inv-note { font-size: 11.5px; color: var(--text-faint); padding: 8px 6px 0; margin: 0; }

.idp-fiches { min-width: 0; }
.idp-fiche { padding: 18px 24px 22px; }
.idp-f-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.idp-title { margin: 0; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idp-move { padding: 6px 10px; border-color: transparent; background: none; color: var(--text-sec); }
/* Un geste impossible se masque, mais sa place reste tenue : une classe et non
   `[hidden]`, qui retire l'élément de la mise en page partout (lot TP1). */
.idp-move.idp-move-off { visibility: hidden; }
.idp-sec { border-top: 1px solid var(--border); padding: 14px 0; }
.idp-sec:nth-child(2) { border-top: 0; padding-top: 0; }
.idp-sec-t { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.idp-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.idp-g3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
.idp-setting { margin: 14px 0 10px; }
.idp-length { max-width: 220px; }
.idp-exact { margin: 0; font-size: 12px; }
.idp-ratio { display: flex; align-items: center; gap: 10px; }
.idp-ratio-l { font-weight: 600; font-size: 12px; width: 160px; }
.idp-ratio input[type='range'] { flex: 1; accent-color: var(--blue); }
.idp-ratio-v { width: 42px; font-weight: 600; }

/* Interrupteur : une vraie case à cocher, redessinée — `read()` lit `.checked`. */
.idp-sw { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.idp-tg { appearance: none; -webkit-appearance: none; flex: 0 0 34px; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: .15s; }
.idp-tg::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: .15s; }
.idp-tg:checked { background: var(--blue); }
.idp-tg:checked::after { left: 16px; }
.idp-tg:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.idp-tg:disabled { opacity: .45; cursor: not-allowed; }
/* Indisponible pour ce type : la case garde sa valeur, mais se lit éteinte. */
.idp-sw.idp-na .idp-tg { background: var(--border-strong); }
.idp-sw.idp-na .idp-tg::after { left: 2px; }
.idp-sw-text { display: flex; flex-direction: column; min-width: 0; }
.idp-sw-l { font-weight: 600; font-size: 13px; }
.idp-sw-d { font-size: 11.5px; color: var(--text-sec); }
.idp-sw-d:empty { display: none; }
.idp-decision { font-size: 10.5px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 4px; padding: 1px 5px; margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; }

.idp-tries { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.idp-step { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.idp-step-b { border: 0; border-radius: 0; background: var(--track); width: 28px; height: 32px; padding: 0; font-weight: 700; }
.idp-panel .idp-step input[type='number'] { width: 44px; border: 0; border-radius: 0; padding: 6px 2px; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.idp-step input::-webkit-inner-spin-button, .idp-step input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Les trois colonnes : un refus est ambre, jamais rouge. */
.idp-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.idp-rule { border-radius: var(--radius-md); padding: 10px 12px; font-size: 12.5px; border: 1px solid; }
.idp-rule h4 { margin: 0 0 6px; font-size: 12px; }
.idp-rule ul { margin: 0; padding-left: 16px; }
.idp-rule li { margin: 2px 0; }
.idp-rule.ok { background: var(--ok-bg); border-color: var(--ok-bg); }
.idp-rule.ok h4 { color: var(--ok); }
.idp-rule.again { background: var(--bg); border-color: var(--border); }
.idp-rule.again h4 { color: var(--text-sec); }
.idp-rule.ko { background: var(--warn-bg); border-color: var(--warn-line); }
.idp-rule.ko h4 { color: var(--warn); }

.idp-trial { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; }
.idp-lines { display: flex; flex-direction: column; gap: 6px; }
.idp-ln { display: flex; gap: 8px; align-items: center; }
.idp-ln input { flex: 1; }
.idp-tag { font-size: 11px; color: var(--text-faint); width: 78px; flex: 0 0 78px; }
.idp-trial-bar { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.idp-panel .idp-trial-bar input[type='text'] { max-width: 260px; flex: 1 1 180px; }
.idp-ghost { border-color: transparent; background: none; color: var(--text-sec); }
.idp-res { margin-top: 10px; display: flex; gap: 8px; align-items: center; font-size: 12.5px; flex-wrap: wrap; }
.idp-res:empty { display: none; }
.idp-res-d { color: var(--text-sec); }

/* ---- les deux issues ---- */
.idp-duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.idp-duo .idp-card { margin: 0; }
.idp-body { padding: 16px 20px; }
.idp-choice { display: flex; flex-direction: column; gap: 6px; }
.idp-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 12px; cursor: pointer; }
.idp-opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.idp-opt input[type='radio'] { margin-top: 3px; }
.idp-opt-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.idp-opt-t { font-weight: 600; }
.idp-opt-d { font-size: 11.5px; color: var(--text-sec); }
.idp-opt-sub { margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.idp-opt-sub select { max-width: 220px; }
.idp-opt-sub .field { flex: 1; }
.idp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.idp-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 11px 5px 8px; background: var(--surface); font-size: 12.5px; cursor: pointer; }
/* La case reste dans le DOM et reste focalisable : seul son dessin change. */
.idp-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.idp-ck { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 10px; background: var(--surface); }
.idp-chip:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.idp-chip:has(input:checked) .idp-ck { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.idp-chip:has(input:checked) .idp-ck::after { content: "✓"; }
.idp-chip:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.idp-chip:has(input:disabled) { cursor: default; }
.idp-reveal-hint { margin: 12px 0 0; font-size: 11.5px; color: var(--text-faint); }
.idp-reveal-hint button.quiet { font-size: 11.5px; padding: 0; }

@container idp (max-width: 820px) {
  .idp-split { grid-template-columns: minmax(0, 1fr); }
  .idp-inv { border-right: 0; border-bottom: 1px solid var(--border); }
  .idp-duo, .idp-g2, .idp-g3, .idp-rules { grid-template-columns: minmax(0, 1fr); }
  .idp-flow { overflow-x: auto; }
  .idp-node { flex: 0 0 160px; }
}

/* ── Number pool : carte Pacing (lot CP3, maquette docs/yelda-air-cadence-pool-prototype.html).
   Préfixe pc-, jetons existants seulement. Les états se lisent sur ce que le serveur rend. */
.pc-card { padding: 0; overflow: hidden; }
.pc-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.pc-head h2 { margin: 0; font-size: 14px; }
.pc-intro { padding: 10px 20px 2px; margin: 0; font-size: 12.5px; color: var(--text-sec); }
.pc-agent { padding: 16px 20px; border-top: 1px solid var(--border); container-type: inline-size; container-name: pc-agent; }
.pc-agents > .pc-agent:first-child { border-top: 0; }
.pc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pc-top h3 { margin: 0; font-size: 14.5px; }
.pc-sp { flex: 1; }
.pc-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pc-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pc-pill.pc-ok { background: var(--ok-bg); color: var(--ok); }
.pc-pill.pc-warn { background: var(--warn-bg); color: var(--warn); }
.pc-pill.pc-grey { background: var(--track); color: var(--text-sec); }
.pc-none-t { font-size: 12.5px; color: var(--text-sec); margin-top: -6px; }
.pc-banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 9px 14px; margin-bottom: 12px; font-size: 12.5px; }
.pc-banner.pc-paused { background: var(--track); }
.pc-grid { display: grid; grid-template-columns: 1.15fr 1.1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.pc-cell { padding: 12px 16px; border-right: 1px solid var(--border); min-width: 0; }
.pc-cell:last-child { border-right: 0; }
.pc-l { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.pc-rate { font-size: 22px; font-weight: 650; line-height: 1.15; }
.pc-rate small { font-size: 13px; font-weight: 500; color: var(--text-sec); }
.pc-sub { font-size: 12.5px; color: var(--text-sec); margin-top: 2px; }
.pc-slots { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; flex-wrap: wrap; }
.pc-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--blue); background: var(--blue); }
.pc-dot.pc-empty { background: var(--surface); border-color: var(--border-strong); }
.pc-dot.pc-off { background: var(--track); border-color: var(--border-strong); }
.pc-slot-t { margin-left: 6px; font-weight: 600; font-size: 13px; }
.pc-prog { height: 4px; background: var(--track); border-radius: 999px; overflow: hidden; }
.pc-prog i { display: block; height: 100%; background: var(--blue-line); border-right: 2px solid var(--blue); }
.pc-conv { font-size: 18px; font-weight: 650; }
.pc-conv.pc-small { font-size: 14px; }
.pc-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12.5px; color: var(--text-sec); flex-wrap: wrap; }
.pc-foot b { color: var(--text); }
button.pc-ghost { border-color: transparent; background: none; color: var(--text-sec); padding: 4px 8px; }
.pc-history { margin-top: 10px; }
.pc-strip { margin-top: 12px; }
.pc-strip-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-sec); margin-bottom: 4px; }
.pc-strip-h b { color: var(--text); }
.pc-legend { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.pc-lg { display: inline-flex; align-items: center; gap: 5px; }
.pc-lg i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.pc-track { position: relative; height: 30px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.pc-tick { position: absolute; bottom: 3px; width: 3px; margin-left: -1px; border-radius: 2px; }
.pc-tick.pc-served { height: 22px; }
.pc-tick.pc-paced { height: 12px; }
.pc-tick.pc-exhausted { height: 22px; }
.pc-served { background: var(--blue); }
.pc-paced { background: var(--amber); }
.pc-exhausted { background: var(--danger); }
.pc-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }
.pc-modal { width: min(560px, calc(100vw - 32px)); }
.pc-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pc-f { display: block; }
.pc-f > span { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.pc-f input[type='number'] { width: 100%; }
.pc-step { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.pc-step button { border: 0; border-radius: 0; background: var(--track); width: 34px; font-weight: 700; padding: 0; }
.pc-step input[type='number'] { border: 0; text-align: center; font-weight: 600; min-width: 0; }
.pc-preview { margin-top: 14px; background: var(--blue-soft); border: 1px solid var(--blue-line); border-radius: var(--radius-md); padding: 10px 14px; font-size: 12.5px; color: var(--blue-deep); }
.pc-preview-note { margin-top: 4px; opacity: .8; }
.pc-sizer { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.pc-sizer summary { padding: 9px 14px; cursor: pointer; font-weight: 600; font-size: 12.5px; }
.pc-sizer-b { padding: 0 14px 12px; }
.pc-calc { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12.5px; flex-wrap: wrap; }
.pc-conflict { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); border-radius: var(--radius-md); padding: 10px 14px; margin-bottom: 14px; font-size: 12.5px; }
.pc-conflict .row { margin-top: 8px; }
/* Résumé du pool : quatre tuiles, deux colonnes sous 900 px. */
.pc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.pc-kpi { padding: 14px 20px; border-right: 1px solid var(--border); min-width: 0; }
.pc-kpi:last-child { border-right: 0; }
.pc-kpi .pc-l { margin-bottom: 0; }
.pc-kpi-v { font-size: 20px; font-weight: 650; margin-top: 2px; }
.pc-kpi-s { font-size: 12px; color: var(--text-sec); }
.pc-split { display: flex; gap: 16px; margin-top: 4px; }
.pc-split .pc-kpi-v { font-size: 18px; }
.pc-kpi-v.pc-red { color: var(--danger); }
@media (max-width: 900px) {
  .pc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-kpi:nth-child(2) { border-right: 0; }
  .pc-kpi:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .pc-g2 { grid-template-columns: 1fr; }
}
/* La largeur se lit sur la section, pas sur le viewport : la sidebar et le chat en retirent. */
@container pc-agent (max-width: 640px) {
  .pc-grid { grid-template-columns: 1fr; }
  .pc-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .pc-cell:last-child { border-bottom: 0; }
  .pc-note { display: none; }
}

/* ---------- export de l'historique (lots EX2-EX5) ----------
   Préfixe `ex-` : aucune classe globale ne le porte. Les couleurs viennent des
   jetons, aucune n'est inventée. */
.cl-export {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.cl-fbar .cl-export { margin-left: auto; }
.cl-fbar .cl-export + .cl-live { margin-left: 0; }
.page-head .cl-export { margin-right: 6px; }

a.ex-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
a.ex-button:hover { background: var(--hover); text-decoration: none; }
a.ex-button.primary { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
a.ex-button.primary:hover { background: var(--blue-dark); }
a.ex-button.small { padding: 5px 10px; font-size: 12px; }

.ex-body > .card + .card { margin-top: var(--space-4); }
.ex-callout {
  margin: 0 0 var(--space-3);
  padding: 10px 14px;
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--text);
  font-size: 12.5px;
}
.ex-callout.ex-warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.ex-callout.ex-danger {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}
.ex-callout.ex-danger > span { flex: 1; }
.ex-callout.ex-ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.ex-name { font-weight: 600; }
.ex-file { font-family: var(--mono); font-size: 12px; overflow-wrap: break-word; }
.ex-error { color: var(--danger); }
.ex-deliveries, .ex-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.ex-chip {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.ex-chip.on { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.ex-check { display: flex; align-items: baseline; gap: 8px; margin: 6px 0; font-size: 13px; cursor: pointer; }
.ex-check > input { flex: none; }

.ex-dr-title { margin: 0; font-size: 16px; }
.ex-dr-scope, .ex-dr-section { margin-bottom: var(--space-4); }
.ex-dr-scope-text { font-weight: 600; }
.ex-dr-fields { margin-top: 4px; }
.ex-dr-status { min-height: 18px; margin: var(--space-3) 0; }
.ex-dr-actions { display: flex; align-items: center; gap: 8px; margin-top: var(--space-4); flex-wrap: wrap; }
.ex-dr-actions .spacer { flex: 1; }

.ex-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 1100px) {
  .ex-editor { grid-template-columns: minmax(0, 1fr); }
}
.ex-rail { position: sticky; top: var(--space-4); }
.ex-rail > .card + .card { margin-top: var(--space-4); }
.ex-section > h2 { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ex-step {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}
.ex-form > .card + .card { margin-top: var(--space-4); }
.ex-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.ex-group-name { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-sec); margin-bottom: 4px; }
.ex-sens { font-size: 12px; color: var(--warn); }
.ex-sens.ex-sens-identifying { color: var(--danger); }
.ex-kv { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 13px; }
.ex-sample {
  max-height: 260px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: pre;
}
.ex-dests { display: grid; gap: 8px; margin-bottom: var(--space-3); }
.ex-dest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.ex-dest.ex-dest-on { display: block; background: var(--surface-2); }
.ex-dest-head { margin: var(--space-3) 0; }
.ex-dest-card .row { gap: 8px; }
.ex-dest-icon { font-size: 16px; }
.ex-fingerprint { margin: var(--space-3) 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }

/* ---------- Integrations (lot I4) ----------
   L'étagère des logiciels tiers et la page d'une intégration. Préfixe `ig-` :
   aucune classe globale ne le porte. Couleurs prises dans les jetons — une
   tuile ne recopie pas la couleur d'une marque. */
main > .ig-page { display: flex; flex-direction: column; gap: var(--space-3); }
.ig-heading { font-size: 15px; margin: var(--space-3) 0 0; }
.ig-connected { display: flex; flex-direction: column; gap: var(--space-2); }
.ig-conn-row { display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); font: inherit; cursor: pointer; }
.ig-conn-row:hover { border-color: var(--blue-line); background: var(--surface-2); }
.ig-conn-name .meta { font-size: 12px; color: var(--text-sec); }
.ig-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ig-chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-sec); font: inherit; font-size: 13px; cursor: pointer; }
.ig-chip[aria-pressed='true'] { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue-dark); font-weight: 600; }
.ig-filters .ig-search { margin-left: auto; width: 220px; max-width: 100%; }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.ig-card { display: flex; flex-direction: column; gap: var(--space-2); text-align: left; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font: inherit; }
button.ig-card { cursor: pointer; }
button.ig-card:hover { border-color: var(--blue-line); background: var(--surface-2); }
.ig-card.dim { opacity: .6; }
.ig-card-top { display: flex; align-items: center; gap: var(--space-3); }
.ig-card-top h3 { margin: 0; font-size: 15px; }
.ig-cat { font-size: 12px; color: var(--text-sec); }
.ig-pitch { margin: 0; font-size: 13px; color: var(--text-sec); }
.ig-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: auto; font-size: 12px; color: var(--text-faint); }
.ig-tile { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--blue-dark); border: 1px solid var(--blue-line); font-weight: 700; font-size: 14px; }
.ig-tile.lg { width: 52px; height: 52px; font-size: 19px; border-radius: var(--radius-md); }
.ig-tile.mcp { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-line); font-size: 11px; }
.ig-gives { display: flex; flex-wrap: wrap; gap: 6px; }
.ig-m { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-sec); }
.ig-m.before { background: var(--cyan-bg); color: var(--cyan); border-color: var(--cyan-bg); }
.ig-m.during { background: var(--blue-soft); color: var(--blue-dark); border-color: var(--blue-line); }
.ig-m.after { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-line); }
.ig-footnote, .ig-legend { margin: 0; }
.page-head.ig-head { align-items: center; gap: var(--space-3); }
.ig-head h1 { margin: 0; }
.ig-head .ig-gives { margin-top: 6px; }
.ig-envs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.ig-env { display: flex; flex-direction: column; gap: var(--space-2); padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.ig-env h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: var(--space-2); }
.ig-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
.ig-kv dt { color: var(--text-sec); }
.ig-kv dd { margin: 0; overflow-wrap: anywhere; }
.ig-test { font-size: 12px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--ok-bg); color: var(--ok); }
.ig-test.failed { background: var(--danger-bg); color: var(--danger); }
.ig-test button { padding: 0; }
.ig-key { width: 160px; }
.ig-script { width: 90px; }
.ig-ids { font-size: 12px; color: var(--text-faint); }
.ig-script-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.ig-missing { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--warn); }
.ig-env textarea.ig-places { min-height: 0; font-family: var(--mono, monospace); font-size: 12px; }

/* Panneau Integrations de l'éditeur (lot I5). La largeur se lit par container
   query sur `.ig-panel`, jamais par media query : la sidebar et le chat retirent
   des centaines de pixels au viewport. */
.ig-panel { container-type: inline-size; container-name: ig-panel; display: flex; flex-direction: column; gap: var(--space-3); }
.ig-panel .card { margin: 0; }
.ig-candidate { display: flex; align-items: center; gap: var(--space-3); }
.ig-use-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.ig-use-head h2 { margin: 0; font-size: 17px; }
.ig-use-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
@container ig-panel (min-width: 900px) {
  .ig-use-body.with-try { grid-template-columns: minmax(0, 1fr) 320px; }
}
.ig-use-main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.ig-banner { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--blue-soft); border: 1px solid var(--blue-line); font-size: 13px; }
.ig-banner p { margin: 0; }
.ig-banner p + p { margin-top: 6px; }
/* Lot AR2 : la règle d'arrivée sur la fiche d'un appel. */
.arrival-notice { padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius-sm); background: var(--blue-soft); border: 1px solid var(--blue-line); font-size: 13px; }
.arrival-notice p { margin: 0; }
.arrival-notice.arrival-refused { background: var(--track); border-color: var(--border-strong); }
.ig-warn { color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; margin: 0; }
.ig-section h3 { margin: 0 0 6px; font-size: 14px; }
.ig-section > .hint { margin: 0 0 var(--space-2); }
.ig-service { display: grid; grid-template-columns: minmax(160px, 1fr) max-content max-content minmax(180px, 1.4fr); align-items: center; gap: var(--space-3); padding: 6px 0; border-top: 1px solid var(--border); }
.ig-service .ig-spoken { width: 100%; }
.ig-lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); }
.ig-lane { display: flex; flex-direction: column; gap: var(--space-2); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.ig-lane h4 { margin: 0; }
.ig-ability { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 13px; }
.ig-ability + .ig-ability { padding-top: var(--space-2); border-top: 1px solid var(--border); }
.ig-try { display: flex; flex-direction: column; gap: var(--space-2); padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); align-self: start; }
.ig-try h3 { margin: 0; font-size: 14px; }
.ig-try .hint { margin: 0; }
.ig-try-result:empty, .ig-try-history:empty { display: none; }
.ig-try-result { display: flex; flex-direction: column; gap: var(--space-2); }
.ig-reads { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.ig-reads p { margin: 4px 0 0; }
.ig-request pre { margin: 6px 0 0; font-family: var(--mono); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ig-try-history { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.ig-try-line { display: flex; align-items: center; gap: var(--space-2); }
/* ---------- page Agents (lots IS1, LC1) ----------
   Un registre d'organisation, pas un pilotage : en service (par groupes, la
   préparation sous sa production), en préparation, essais et démos, les
   archivés à la demande. Une info par cellule, le détail en title. Préfixe ag-. */
.page-head .ag-search { width: 240px; }
.ag-sub { font-size: 12px; color: var(--text-sec); }
.ag-h { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); }
.ag-count { font-weight: 400; color: var(--text-sec); }
/* La description d'une section : un bouton i, révélé au survol et au focus. */
.ag-info {
  width: 18px; height: 18px; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%;
  background: transparent; color: var(--text-sec); font: italic 700 11px/1 var(--font); cursor: help;
  opacity: .35;
}
.ag-h:hover .ag-info, .ag-info:focus-visible { opacity: 1; }
.ag-help { margin: 0; }
.ag-toggle {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.ag-trials > .ag-h:has(.ag-toggle[aria-expanded='false']) { margin-bottom: 0; }
/* Variante 1 de la maquette : l'en-tête de colonnes sur fond gris clair, sur cette page seulement. */
.ag-section thead th { background: var(--track); }
/* Un groupe : le nom de l'agent de production, sans fond, puis ses lignes. */
.ag-section tr.ag-group td { padding-top: 14px; padding-bottom: 4px; border-bottom: 0; font-weight: 700; font-size: 13px; background: transparent; }
.ag-section tr.ag-group + tr.ag-row td { border-top: 0; }
.ag-inactive { color: var(--warn); }
/* Les essais se lisent en masse : un tableau plus serré. */
.ag-dense th,
.ag-dense td { padding-top: 7px; padding-bottom: 7px; }
td.ag-menu-cell, th.ag-menu-cell { width: 1%; text-align: right; }
/* Les actions de ligne restent discrètes, révélées au survol et au focus de la ligne. */
.ag-section .ag-menu { opacity: .35; }
.ag-section tr:hover .ag-menu, .ag-section tr:focus-within .ag-menu { opacity: 1; }
.ag-checks { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ag-check { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
main > .ag-archived { margin-top: var(--space-4); }
/* Lot LC2 : « Passer en production » sur une ligne de préparation, avec la discrétion des actions de ligne. */
.ag-actions { display: inline-flex; align-items: center; gap: var(--space-2); }
.ag-section .ag-promote { opacity: .35; white-space: nowrap; }
.ag-section tr:hover .ag-promote, .ag-section tr:focus-within .ag-promote { opacity: 1; }
/* L'en-tête d'un agent lié : la pastille d'écart sur la ligne du titre (lot VH1), puis la bascule Production / Préparation. */
.page-head .ag-pair { margin-left: var(--space-2); }
.page-head > .ag-gap-pill {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 100%;
  padding: 3px 6px 3px 10px; border: 1px solid var(--warn-line); border-radius: 999px;
  background: var(--warn-bg); color: var(--warn); font-size: 12px;
}
.ag-gap-pill .link-button, .ag-gap-pill a { color: var(--warn); font-size: 12px; padding: 2px 4px; }
/* La boîte « Passer en production ». Préfixe pm-. */
.pm-body h3 { margin: var(--space-4) 0 var(--space-2); font-size: 13px; }
.pm-groups, .pm-paths, .pm-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pm-paths { margin-top: var(--space-2); font-size: 12px; }
.pm-check { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pm-ack { display: flex; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-3); }
.modal-actions .pm-status { margin-right: auto; }
/* Lot IS2 : « En service » sur une organisation qui n'en a aucun. */
.db-notice { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: 0 0 var(--space-3); padding: 10px 14px; border-radius: var(--radius-md); background: var(--warn-bg); color: var(--warn); font-size: 13px; }
/* Lot SV1 : l'écran Secrets pivoté par environnement. */
.sv-cell { display: grid; gap: 4px; justify-items: start; }
.sv-cell .hint { margin: 0; }
.sv-missing { margin: 0; padding: 10px 14px; border-radius: var(--radius-md); background: var(--warn-bg); color: var(--warn); font-size: 13px; }

/* Lot DA2 : déplacer des conversations — le volet, l'historique, le badge de version d'un autre agent. */
.sheet.cm-sheet {
  width: 600px;
}
.cm-title {
  margin: 0;
  font-size: 15px;
}
.cm-sec {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cm-sec h4 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.cm-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: start;
}
.cm-agent {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.cm-agent select {
  width: 100%;
}
.cm-pills {
  display: inline-flex;
  gap: 4px;
}
.cm-arrow {
  padding-top: 6px;
  color: var(--text-faint);
}
.cm-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cm-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-sec);
}
.cm-presets,
.cm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.cm-preset {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 3px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.cm-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text);
}
.cm-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.cm-kpi-v {
  font-size: 18px;
  font-weight: 600;
}
.cm-kpi-l {
  font-size: 11px;
  color: var(--text-sec);
}
.cm-hist {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 56px;
  margin-top: 10px;
}
.cm-bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.cm-bar-fill {
  width: 100%;
  min-height: 2px;
  background: var(--blue);
  border-radius: 2px 2px 0 0;
}
.cm-stay {
  margin: 8px 0 0;
  color: var(--text-sec);
}
.cm-opt {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.cm-opt small {
  display: block;
  color: var(--text-faint);
}
.cm-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cm-two ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.cm-h {
  font-weight: 600;
}
.cm-reason {
  width: 100%;
  min-height: 0;
}
.cm-foot {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.cm-notice {
  margin: 0;
  color: var(--danger);
}
.cm-history .cm-table {
  width: 100%;
}
.cm-history tr.cm-undone td {
  color: var(--text-faint);
  text-decoration: line-through;
}
.cm-history tr.cm-undone td:last-child {
  text-decoration: none;
}
.cm-version-link {
  text-decoration: none;
}

/* Lot VH1 : l'écran Versions — une liste dense à gauche, un panneau collant à droite. Préfixe vh-. */
main > .vh-tool { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--space-3); }
.vh-count { font-size: 12.5px; color: var(--text-sec); }
.vh-tool .spacer { flex: 1; }
.vh-search { display: flex; align-items: center; flex: 0 1 320px; }
.vh-search input { width: 100%; height: 32px; }
.vh-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; white-space: nowrap;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 12px; font-weight: 600;
}
.vh-btn:hover { background: var(--hover); text-decoration: none; }
.vh-btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.vh-btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
main > .vh-work { display: flex; gap: var(--space-4); align-items: flex-start; flex-wrap: wrap; }
.vh-list { flex: 999 1 640px; min-width: 0; overflow: hidden; padding: 0; }
.vh-scroll { overflow-x: auto; }
.vh-grid {
  display: grid; align-items: center; column-gap: 14px; min-width: 960px;
  grid-template-columns: 62px 58px 168px minmax(220px, 1fr) 58px 58px 74px 74px 68px;
}
.vh-hdr {
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  font-size: 10.5px; font-weight: 700; color: var(--text-sec); text-transform: uppercase; letter-spacing: .05em;
}
.vh-num { text-align: right; font-variant-numeric: tabular-nums; }
.vh-day {
  padding: 12px 16px 5px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em;
}
/* Une ligne est un bouton (la règle des paires du fil d'appel) : on défait le style global de `button`. */
button.vh-row {
  width: 100%; height: 44px; padding: 0 16px; position: relative; text-align: left;
  background: var(--surface); border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
  font-size: 13px; font-weight: 400; color: var(--text);
}
button.vh-row:hover:not(:disabled) { background: var(--hover); }
button.vh-row.on { background: var(--blue-soft); }
.vh-row.on::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.vh-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.vh-vn { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--blue-dark); }
.vh-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.vh-dot.published { background: var(--ok); }
.vh-dot.superseded { background: var(--border-strong); }
.vh-dot.draft { border: 1.5px dashed var(--violet); }
.vh-time { color: var(--text-sec); font-variant-numeric: tabular-nums; }
.vh-who { display: flex; align-items: center; gap: 7px; min-width: 0; }
.vh-av {
  display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue-dark); font-size: 10px; font-weight: 700;
}
.vh-av.key { background: var(--violet-bg); color: var(--violet); }
.vh-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vh-ch { font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.vh-sum { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vh-tx { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vh-tx.none { color: var(--text-faint); font-style: italic; }
.vh-chip { padding: 2px 7px; border-radius: 5px; background: var(--track); color: var(--text-sec); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.vh-muted { color: var(--text-faint); }
.vh-low { color: var(--text-faint); }
.vh-low::after { content: '◌'; margin-left: 3px; font-size: 9px; vertical-align: 1px; }
.vh-draft {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(135deg, var(--surface) 0 10px, var(--violet-bg) 10px 20px);
}
.vh-draft-title { font-weight: 700; color: var(--violet); }
.vh-draft-detail { flex: 1; min-width: 200px; color: var(--text-sec); }
.vh-draft code { font-family: var(--mono); font-size: 11.5px; }
.vh-foot { padding: 10px 16px; background: var(--surface-2); color: var(--text-sec); font-size: 11.5px; }
.vh-empty { padding: 28px 16px; text-align: center; color: var(--text-sec); }
/* Sous ~1100 px, le panneau passe sous la liste : `flex-wrap` sur `.vh-work`. */
.vh-panel { flex: 1 1 380px; max-width: 480px; position: sticky; top: 16px; padding: 0; }
.vh-ph { padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.vh-ph-l1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vh-ph h2 { margin: 0; font-size: 20px; }
.vh-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 8px; color: var(--text-sec); font-size: 12.5px; }
.vh-sec { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.vh-sec h3 {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
  font-size: 10.5px; font-weight: 700; color: var(--text-sec); text-transform: uppercase; letter-spacing: .06em;
}
.vh-sec h3 .spacer { flex: 1; }
.vh-sec h3 a { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.vh-notes { max-height: 220px; overflow: auto; white-space: pre-line; line-height: 1.55; }
.vh-notes.none { color: var(--text-faint); }
.vh-paths { display: flex; flex-wrap: wrap; gap: 6px; }
.vh-path { padding: 3px 7px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font-family: var(--mono); font-size: 11.5px; }
.vh-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.vh-tile { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.vh-k { font-size: 10px; font-weight: 700; color: var(--text-sec); text-transform: uppercase; letter-spacing: .05em; }
.vh-v { margin-top: 3px; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vh-d { margin-top: 2px; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vh-d.good { color: var(--ok); }
.vh-d.bad { color: var(--danger); }
.vh-note { margin-top: 10px; color: var(--text-sec); font-size: 12px; line-height: 1.45; }
.vh-note.warn { padding: 7px 10px; border: 1px solid var(--warn-line); border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.vh-hash { display: flex; align-items: center; gap: 8px; color: var(--text-sec); font-size: 12px; }
.vh-hash code { padding: 2px 6px; border-radius: 5px; background: var(--track); color: var(--text); font-family: var(--mono); }
.vh-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; }
.vh-why { flex-basis: 100%; color: var(--text-faint); font-size: 11.5px; }

/* Lot RP4 — Répondeurs et filtrage (Tour de parole). Préfixe ans-, jetons existants. */
.ans-panel { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-4); align-items: start; }
@container (max-width: 900px) { .ans-panel { grid-template-columns: minmax(0, 1fr); } }
.ans-blocks { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-4); }
.ans-block { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; background: var(--surface); }
.ans-block h3 { margin: 0 0 4px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.ans-sub { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ans-choice { display: flex; gap: 8px; align-items: flex-start; }
.ans-choice > span { display: flex; flex-direction: column; }
.ans-sub textarea, .ans-tester textarea { min-height: 0; }
.ans-note { margin: 0; }
.ans-kinds { width: 100%; border-collapse: collapse; font-size: 13px; }
.ans-kinds th { text-align: left; font-weight: 500; color: var(--text-sec); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.ans-kinds td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ans-kinds td textarea { margin-top: 6px; width: 100%; }
.ans-family { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; }
.ans-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ans-chip { font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--track); color: var(--text); }
.ans-tester { position: sticky; top: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.ans-tester h3 { margin: 0; font-size: 14px; }
.ans-result-text { line-height: 1.6; }
.ans-mark { background: var(--violet-bg); color: var(--violet); border-radius: 3px; padding: 0 2px; }

/* Lot RP5 — le décroché en lecture : fiche, fil, liste, Pilotage. Jetons existants. */
.fact.violet .fact-value { color: var(--violet); }
.msg.client.machine { border: 1px dashed var(--border-strong); background: var(--surface); }
.msg.client.machine.screener { border-color: var(--violet-line); }
.machine-kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--text-sec); }
.msg.client.machine.screener .machine-kind { color: var(--violet); }
.answering-banner { font-size: 12px; color: var(--text-sec); padding: 4px 10px; border-left: 3px solid var(--border-strong); background: var(--track); border-radius: var(--radius-sm); margin: 4px 0; }
.answering-banner.screener, .answering-banner.waiting { border-left-color: var(--violet); background: var(--violet-bg); color: var(--violet); }
.answering-banner.holder { border-left-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.cl-answered { display: inline-flex; flex-direction: column; gap: 2px; }
.cl-answered .cl-sub { font-size: 11px; }
/* Le padding de l'entonnoir : `.db-card` n'en porte aucun (lot DB5), chaque corps le sien. */
.db-answered { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 14px; }
.db-answered-bar { display: flex; height: 12px; border-radius: var(--radius-sm); overflow: hidden; background: var(--track); }
.db-answered-bar i { display: block; height: 100%; }
.db-answered-legend { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.db-answered-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 48px 40px; gap: 8px; align-items: center; }
.db-answered-row > i { width: 10px; height: 10px; border-radius: 2px; }
.db-answered-row .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-answered-row small { color: var(--text-sec); text-align: right; }
.db-fstep.db-fsub > span { padding-left: 12px; color: var(--text-sec); }

/* ---------- Lot RV2 : revue des conversations (préfixe rv-) ---------- */
.rv-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; padding: 3px 10px; font-size: 12px; white-space: nowrap; border: 1px solid transparent; }
.rv-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rv-pill.rv-ok { color: var(--ok); background: var(--ok-bg); }
.rv-pill.rv-follow_up { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.rv-pill.rv-issue { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.rv-pill.rv-resolved { color: var(--blue-deep); background: var(--blue-soft); }
.rv-pill.rv-none { color: var(--text-sec); background: var(--track); }
.rv-pill.rv-none::before { background: transparent; border: 1.5px solid currentColor; width: 5px; height: 5px; }
.rv-pill.rv-small { font-size: 11px; padding: 1px 8px; }
.rv-bubble-icon { flex-shrink: 0; }
.rv-av { width: 26px; height: 26px; border-radius: 50%; background: var(--blue-deep); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; flex-shrink: 0; }
.rv-av.rv-av-small { width: 20px; height: 20px; font-size: 9px; }
.rv-sp { flex: 1; }

/* En-tête de la fiche : bouton scindé, ou l'état qui mène à la carte. */
.rv-head { display: inline-flex; }
.rv-split { display: inline-flex; position: relative; border: 1px solid var(--blue); border-radius: var(--radius-sm); }
.rv-split > button { border: 0; border-radius: 0; background: var(--blue); color: var(--on-accent); padding: 6px 10px; font-size: 12px; }
.rv-split > button:hover:not(:disabled) { background: var(--blue-dark); }
.rv-split > .rv-caret { border-left: 1px solid var(--blue-line); padding: 6px 8px; }
.rv-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 20; min-width: 200px; padding: 6px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--pop-shadow); }
.rv-menu > button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; color: var(--text); text-align: left; padding: 7px 8px; font-size: 12px; }
.rv-menu > button:hover:not(:disabled) { background: var(--hover); }
.rv-head-state { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 16px; padding: 2px 10px 2px 2px; background: var(--surface); font-size: 12px; }
.rv-who { color: var(--text-sec); white-space: nowrap; }
.rv-count { display: inline-flex; align-items: center; gap: 3px; }

/* La carte : en-tête, fil chronologique, saisie. */
.rv-card { padding: 0; overflow: visible; display: flex; flex-direction: column; }
.rv-card-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.rv-card-head h3 { margin: 0; font-size: 14px; }
.rv-card-head small { color: var(--text-sec); font-size: 11px; }
.rv-empty { margin: 0; padding: 18px 16px; color: var(--text-sec); font-size: 12px; text-align: center; line-height: 1.5; }
.rv-empty b { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }
.rv-tl { position: relative; padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 12px; }
.rv-tl::before { content: ""; position: absolute; left: 28px; top: 18px; bottom: 14px; width: 2px; background: var(--track); }
.rv-day { position: relative; align-self: flex-start; margin-left: 36px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.rv-ev { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12px; color: var(--text-sec); }
.rv-ev b, .rv-bh b { color: var(--text); font-weight: 600; }
.rv-dot { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.rv-dot i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); background: var(--track); }
.rv-dot i.rv-dot-ok { background: var(--ok); }
.rv-dot i.rv-dot-follow_up { background: var(--warn); }
.rv-dot i.rv-dot-issue { background: var(--danger); }
.rv-dot i.rv-dot-resolved { background: var(--blue); }
.rv-ev time, .rv-bh time { color: var(--text-faint); font-size: 11px; white-space: nowrap; }
.rv-cm { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
.rv-cm > .rv-av { position: relative; z-index: 1; box-shadow: 0 0 0 3px var(--surface); }
.rv-bubble { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.rv-bubble.rv-mine { border-color: var(--blue-line); }
.rv-bh { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: 12px; white-space: nowrap; flex-wrap: wrap; }
.rv-bubble.rv-mine .rv-bh { background: var(--blue-soft); border-bottom-color: var(--blue-line); }
.rv-set { color: var(--text-sec); }
.rv-bt { padding: 8px 10px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: break-word; }
.rv-refs { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 10px 8px; }
.rv-more-wrap { position: relative; }
.rv-more { border: 0; background: transparent; color: var(--text-faint); padding: 0 4px; }
.rv-turnref { font-size: 11px; border: 1px solid var(--warn-line); color: var(--warn); background: var(--surface); border-radius: 10px; padding: 1px 8px; }
.rv-tag { border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; font-size: 11px; background: var(--surface); color: var(--text-sec); }
.rv-tag[aria-pressed="true"] { background: var(--violet-bg); border-color: var(--violet-line); color: var(--violet); }
.rv-undo { display: flex; align-items: center; gap: 10px; margin: 4px 16px 10px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--blue-soft); border: 1px solid var(--blue-line); font-size: 12px; }
.rv-undo-btn { margin-left: auto; padding: 2px 10px; font-size: 12px; }
.rv-composer { border-top: 1px solid var(--border); padding: 12px 16px; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.rv-box { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.rv-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
/* La règle globale `textarea { min-height: 220px }` est faite pour le prompt. */
.rv-box textarea { width: 100%; min-height: 58px; resize: vertical; border: 0; outline: 0; box-shadow: none; padding: 8px 10px; font-family: inherit; font-size: 12px; line-height: 1.45; display: block; }
.rv-tb { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--track); flex-wrap: wrap; }
.rv-select { width: auto; max-width: 140px; padding: 3px 4px; font-size: 11px; }
.rv-tagpick { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 8px 8px; }
.rv-icon { border: 1px solid var(--border); background: var(--surface); padding: 3px 7px; font-size: 11px; color: var(--text-sec); }
.rv-icon[aria-pressed="true"] { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-line); }
.rv-send { padding: 4px 12px; font-size: 12px; }
.rv-hint { grid-column: 2; font-size: 11px; color: var(--text-faint); display: flex; gap: 10px; }
.rv-hint kbd { font-family: var(--mono); font-size: 10px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--text-sec); background: var(--surface); }

/* Sous un tour cité, frère de la paire. */
.rv-flag { display: flex; width: max-content; gap: 6px; align-items: center; font-size: 11px; color: var(--warn); background: var(--surface); border: 1px solid var(--warn-line); border-radius: 10px; padding: 2px 8px; margin: 2px 0 0 auto; }

/* La liste : pastilles de filtre, compte « reviewed », cellule. */
/* Liste : « 17 / 48 reviewed » à côté du compte, le filtre de revue est un menu de la barre. */
.cl-fbar .rv-progress { font-size: 12px; color: var(--text-sec); white-space: nowrap; margin-right: 8px; }
.cl-fbar .rv-progress:empty { display: none; }
.rv-mini { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rv-cmt { display: inline-flex; align-items: center; gap: 3px; color: var(--text-sec); font-size: 11px; }

/* ---------- jeux de référence (lot JR5) ----------
   La page Identification d'une organisation : trois cartes, les règles en lignes
   dépliables, un cas à la fois. Préfixe `rs-`. */
.rs-card-value { font-size: 17px; }
.rs-kinds { flex: 0 0 auto; }
.rs-search { max-width: 280px; margin-left: auto; }
.rs-group { margin-top: 18px; }
.rs-group h3 { font-size: 13px; color: var(--text-sec); text-transform: none; margin: 0 0 6px; }
.rs-rule { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--surface); }
.rs-rule-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%;
  padding: 10px 12px; border: none; background: transparent; text-align: left; cursor: pointer; color: var(--text);
}
.rs-rule-head:hover { background: var(--hover); }
.rs-rule-text { font-weight: 600; flex: 1 1 260px; }
.rs-rule-example { color: var(--text-sec); font-family: var(--mono); font-size: 12px; }
.rs-rule-body { padding: 0 12px 12px; }
.rs-example { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--text-sec); margin: 4px 0; }
.rs-review-card:focus { outline: none; }
.rs-qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.rs-review { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .rs-review { grid-template-columns: 1fr; } }
.rs-lbl { font-size: 12px; color: var(--text-sec); margin-bottom: 4px; }
.rs-record { font-family: var(--mono); font-size: 14px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.rs-said { margin: 0 0 8px; padding-left: 20px; }
.rs-platform { font-weight: 600; }
.rs-ask { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.rs-q { font-weight: 600; margin: 0 0 8px; }
.rs-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.rs-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; text-align: left; }
.rs-choice small { color: var(--text-sec); font-weight: 400; }
.rs-choice.ok span { color: var(--ok); }
.rs-choice.warn span { color: var(--amber); }
.rs-choice.danger span { color: var(--danger); }
.rs-comment { flex: 1 1 auto; }
.rs-done { padding: 12px 0; }
.rs-retention { margin-top: 16px; }
.rs-case-row { gap: 8px; align-items: center; }
/* Lot JR6 : les lignes du jeu de référence dans la boîte de publication. */
.rs-pub { margin: 4px 0; }
.rs-pub.ok { color: var(--ok); }
.rs-pub.warn { color: var(--amber); }
.rs-pub.danger { color: var(--danger); }
/* Lot VC3 — l'avis du vérificateur. L'IA : violet, coins carrés, ✦ ; l'humain
   reste la pastille ronde (`.rv-pill`) et les initiales. Aucune couleur nouvelle. */
.vc-badge { display: inline-flex; align-items: center; border-radius: 3px; padding: 3px 8px; font-size: 12px; white-space: nowrap; color: var(--violet); background: var(--violet-bg); border: 1px solid var(--violet-line); }
.vc-badge.vc-small { font-size: 11px; padding: 1px 6px; }
.vc-badge.vc-issue { font-weight: 600; }
.vc-badge.vc-clear { background: transparent; border-color: transparent; padding-left: 0; padding-right: 0; }
.vc-clear { color: var(--violet); font-size: 11px; white-space: nowrap; }
.vc-mini { font-size: 11px; color: var(--violet); white-space: nowrap; }
.vc-mini-diff { font-weight: 600; }
.cl-fbar .vc-progress { font-size: 12px; color: var(--violet); white-space: nowrap; margin-right: 8px; }
.cl-fbar .vc-progress:empty { display: none; }

.vc-card { padding: 0; display: flex; flex-direction: column; border-left: 3px solid var(--violet); border-radius: 3px; }
.vc-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.vc-head h3 { margin: 0; font-size: 14px; color: var(--violet); }
.vc-sp { flex: 1; }
.vc-comment { margin: 0; padding: 12px 16px 4px; font-size: 13px; line-height: 1.5; }
.vc-refs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 8px; }
.vc-tag { font-size: 11px; color: var(--violet); background: var(--violet-bg); border-radius: 3px; padding: 1px 6px; }
.vc-fields { padding: 4px 16px 8px; }
.vc-fields h4 { margin: 4px 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-sec); font-weight: 600; }
.vc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.vc-table td { padding: 4px 6px 4px 0; vertical-align: top; border-top: 1px solid var(--border); }
.vc-table small { color: var(--text-sec); }
.vc-sym { width: 18px; font-weight: 700; text-align: center; color: var(--text-sec); }
.vc-r-same .vc-sym { color: var(--ok); }
.vc-r-read_differently .vc-sym { color: var(--warn); }
.vc-r-different .vc-sym { color: var(--danger); }
.vc-label { color: var(--text-sec); max-width: 0; width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-note, .vc-vault { margin: 0; padding: 2px 16px 8px; font-size: 11px; color: var(--text-sec); }
.vc-actions { display: flex; gap: 8px; padding: 8px 16px 14px; }
.vc-collapsed { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px; background: none; border: 0; text-align: left; cursor: pointer; font: inherit; }
.vc-agreement { font-size: 12px; color: var(--violet); }
.vc-agree-diff { font-weight: 600; }
.vc-more { margin-left: auto; font-size: 11px; color: var(--text-sec); }
.vc-stack { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.vc-spot { font-style: italic; }

/* Réglages d'organisation : la carte du vérificateur de conversations. */
.vf-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.vf-main { margin: 12px 0 4px; }
.vf-scope { margin: 4px 0 8px 24px; }
.vf-agents { margin: 4px 0 4px 24px; max-height: 260px; overflow: auto; }
.vf-badge { font-size: 11px; color: var(--text-sec); background: var(--track); border-radius: 10px; padding: 1px 8px; }

/* ---------- Lot W5 : Deploy → Website (préfixe .wb-) ---------- */
.wb-head { align-items: center; gap: 12px; flex-wrap: wrap; }
.wb-head h2 { margin: 0; }
.wb-head .hint { flex: 1; }
.wb-snippet { display: block; flex: 1; min-width: 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; overflow-wrap: anywhere; }
.wb-code { margin: 0; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; line-height: 1.5; overflow-x: auto; }
.wb-controls { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wb-preview { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wb-preview-bar { gap: 8px; flex-wrap: wrap; }
.wb-preview-bar select { width: auto; }
.wb-stage { height: 560px; border-radius: 12px; background-color: var(--bg); background-image: radial-gradient(var(--border) 1px, transparent 1.2px); background-size: 18px 18px; overflow: hidden; }
.wb-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.wb-swatch { width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }

/* ---------- Lots DP1-DP3 : la page Déployer par canal ----------
   Préfixe .dp- pour l'accueil des canaux, .ch- pour les sous-onglets d'un canal
   (Website, Demo page). `.ch-` porte déjà l'en-tête d'une fiche d'appel : les
   noms ci-dessous ont été vérifiés libres. Aucune couleur nouvelle. */

.dp-section + .dp-section { margin-top: var(--space-5); }
.dp-group {
  margin: 0 0 var(--space-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-sec);
}
.dp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: stretch; }
.dp-stack { display: grid; gap: var(--space-4); }
.dp-grid > .card + .card, .dp-stack > .card + .card { margin-top: 0; }
@media (max-width: 900px) { .dp-grid { grid-template-columns: 1fr; } }

.dp-card { display: flex; flex-direction: column; gap: var(--space-3); cursor: pointer; min-width: 0; }
.dp-card:hover { border-color: var(--border-strong, var(--border)); }
.dp-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.dp-card-head { display: flex; align-items: center; gap: var(--space-3); }
.dp-card-head h2 { margin: 0; font-size: 16px; }
.dp-card-actions { display: flex; gap: var(--space-3); align-items: center; margin-top: auto; }
.dp-lines, .dp-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dp-lines li { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.dp-checks a { color: var(--warn); }
.dp-link { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.dp-url {
  flex: 1 1 18rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 12px;
}
.dp-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px var(--space-4); margin: 0; font-size: 13px; }
.dp-facts dt { color: var(--text-sec); }
.dp-facts dd { margin: 0; min-width: 0; }

.dp-crumb { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--space-4); font-size: 13px; color: var(--text-sec); }
.dp-crumb-sep { color: var(--text-faint); }

/* Sous-onglets d'un canal : la barre sous l'en-tête, l'aperçu fixe à droite. */
.ch-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: var(--space-4); align-items: start; }
.ch-layout > .card + .card { margin-top: 0; }
.ch-main { padding: 0; min-width: 0; }
.ch-head { align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 22px; }
.ch-head h2 { margin: 0; }
.ch-head .hint { flex: 1; }
.ch-aside, .ch-aside-host > .card { position: sticky; top: var(--space-4); min-width: 0; }
@media (max-width: 1180px) {
  .ch-layout { grid-template-columns: 1fr; }
  .ch-aside, .ch-aside-host > .card { position: static; }
}
.ch-tabs { display: flex; gap: 2px; padding: 0 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow-x: auto; }
.ch-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 120px;
  min-height: 0;
  margin-bottom: -1px;
  padding: 10px 14px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.ch-tab:hover { background: var(--hover); }
.ch-tab[aria-selected='true'] { border-bottom-color: var(--blue); }
.ch-tab[aria-selected='true'] .ch-tab-label { color: var(--blue); }
.ch-tab-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.ch-tab-sum { font-size: 11.5px; color: var(--text-sec); white-space: nowrap; }
.ch-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.ch-dot-ok { background: var(--ok); }
.ch-dot-warn { background: var(--warn); }
.ch-dot-off { background: var(--text-faint); }
/* Un panneau aligne son contenu sur l'en-tête du canal (22 px) : `.ch-main` n'a
   pas de padding, et `.card-section` n'en porte qu'un vertical. */
.ch-panel { padding: 0 22px 8px; }
.ch-panel > .card-section:first-child { padding-top: 18px; }
/* `.card-section-sub` remonte de 12 px sous un h2 (marge 16 px) : sous un h3 sans
   marge, il chevauchait le titre. */
.ch-panel .card-section > h3 { margin-bottom: 16px; }
/* La règle globale `textarea { min-height: 220px }` est faite pour le prompt :
   ici, la hauteur vient de `rows`. */
.ch-panel textarea { min-height: 0; height: auto; resize: vertical; }

/* Lot DP2 : le diagnostic du widget, lu à la demande dans Install. */
.wb-checks { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: 8px; }
.wb-checks li { display: flex; gap: 10px; align-items: flex-start; }
.wb-checks li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wb-check-mark { width: 16px; flex: none; font-weight: 700; }
.wb-check-ok .wb-check-mark { color: var(--ok); }
.wb-check-ko .wb-check-mark { color: var(--danger); }
.wb-preview.ch-aside { padding: 14px; }

/* Lot DP3 : le lien condensé sous le titre, et des cartes sans bordure dans un onglet. */
.demo-linkhead { display: flex; flex-direction: column; gap: var(--space-2); padding: 0 22px 16px; }
.ch-panel.demo-tab-panel { padding: 0; }
.demo-tab-panel > .card { border: 0; box-shadow: none; background: transparent; padding: 18px 22px; }
.demo-tab-panel > .card + .card { margin-top: 0; border-top: 1px solid var(--border); border-radius: 0; }

/* Lot TR2 — répartition d'une destination de transfert entre plusieurs numéros. */
.tl-share { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
.tl-share-rows { display: grid; gap: 8px; }
.tl-share-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 72px auto auto; gap: 8px; align-items: center; }
.tl-share-row input { min-width: 0; }
.tl-share-add { justify-self: start; }
.cx-fallback-routes{margin-top:8px}
.cx-fallback-routes ul{margin:4px 0 0;padding-left:18px;font-size:13px}

/* ===== Lot TX3 — la mise en relation lue dans le fil =====
   La carte formate `transferTimeline` : aucune teinte nouvelle. Bleu pour
   l'agent, `--border-strong` pour le conseiller (comme l'en-tête), `--warn` pour
   l'échec ; la sonnerie prend l'ambre existant, déclaré ici une fois. */
.xf-card,
.ch-xf-split,
.xf-rail {
  --xf-ring: var(--amber);
}
.xf-card {
  margin: 8px 6px 4px 52px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
  min-width: 0;
}
.xf-card.warn {
  border-color: var(--warn);
}
.xf-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px 2px;
}
.xf-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
}
.xf-ico {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-soft);
  color: var(--blue);
}
.xf-card.warn .xf-ico {
  background: var(--warn-bg);
  color: var(--warn);
}
.xf-sp {
  flex: 1;
}
.xf-why {
  margin: 0;
  padding: 0 12px 6px 46px;
  font-size: 12px;
  color: var(--text-sec);
}
.xf-dot {
  margin: 0 6px;
  color: var(--text-faint);
}
.xf-steps {
  list-style: none;
  margin: 0;
  padding: 2px 12px 0;
  display: flex;
  flex-wrap: wrap;
  row-gap: 6px;
}
.xf-step {
  position: relative;
  flex: 1 1 90px;
  min-width: 90px;
  padding-top: 15px;
}
.xf-step::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-strong);
}
.xf-step i {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--blue);
  box-sizing: border-box;
}
.xf-step.bad i {
  background: var(--warn);
  border-color: var(--warn);
}
.xf-step.unknown i {
  background: var(--surface);
  border-style: dashed;
  border-color: var(--text-faint);
}
.xf-step-k {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  padding-right: 8px;
}
.xf-step-t {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--text-sec);
}
.xf-dur {
  padding: 8px 12px 8px;
}
.xf-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--track);
}
.ch-xf-split .xf-bar {
  max-width: 200px;
  height: 6px;
  margin: 3px 0;
  border-radius: 3px;
}
.xf-seg {
  display: block;
  min-width: 3px;
}
.xf-seg.agent,
.xf-sw.agent {
  background: var(--blue);
}
.xf-seg.ring,
.xf-sw.ring {
  background: var(--xf-ring);
}
.xf-seg.human,
.xf-sw.human {
  background: var(--border-strong);
}
.xf-legend {
  display: flex;
  gap: 4px 16px;
  flex-wrap: wrap;
  padding-top: 5px;
  font-size: 11.5px;
  color: var(--text-sec);
}
.ch-xf-split .xf-legend {
  gap: 2px 10px;
  padding-top: 0;
}
.xf-sw {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-radius: 2px;
}
.xf-total {
  margin-left: auto;
}
.xf-facts {
  display: grid;
  grid-template-columns: minmax(90px, max-content) minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
  font-size: 12px;
}
.xf-facts dt {
  color: var(--text-sec);
}
.xf-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.xf-rail .xf-facts {
  padding: 4px 0 8px;
}
.xf-request {
  font-size: 12px;
}
.xf-say {
  align-self: flex-end;
  max-width: 74%;
  margin: 8px 6px 0 auto;
  padding: 7px 12px;
  border-radius: 14px 14px 4px 14px;
  background: var(--track);
  color: var(--text-sec);
}
.xf-say small {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.xf-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 6px 2px 52px;
  font-size: 11.5px;
  color: var(--text-faint);
}
.xf-end::before,
.xf-end::after {
  content: '';
  flex: 1;
  border-top: 1px dashed var(--border-strong);
}
.xf-route {
  cursor: pointer;
}

/* Lot SD4 — le panneau Follow-up : une ligne par règle, sa fiche masquée, jamais démontée. */
.fu-panel { display: grid; gap: 12px; }
.fu-rules { display: grid; }
.fu-rule { border-top: 1px solid var(--track); padding: 8px 0; }
.fu-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fu-row { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 4px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.fu-row:hover { background: var(--surface-2); }
.fu-sentence { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-key { flex: none; }
.fu-summary-action { flex: none; }
.fu-count { flex: none; }
.fu-detail { padding: 8px 0 4px 12px; }
.fu-then { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; }
.fu-code { max-width: 220px; }
.fu-otherwise .fu-head > b { margin-right: 4px; }
.fu-examples { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 0 12px; }
.fu-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Playbooks d'une base (lot PB3, prototype #s1 et #s2) ---------- */
.kb-tab-count:not(:empty) { margin-left: 6px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.pb-panel { padding: 18px 22px 22px; }
.pb-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pb-bar .pb-search { width: 220px; }
.pb-list { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.pb-group + .pb-group { border-top: 1px solid var(--border); }
.pb-cat { margin: 0; padding: 7px 16px; background: var(--surface-2); font-size: 11.5px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-faint); font-weight: 600; }
.pb-row { display: grid; grid-template-columns: 24px minmax(180px, 260px) minmax(0, 1fr) auto auto; align-items: center;
  gap: 14px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--border); background: var(--surface);
  padding: 10px 16px; font: inherit; color: var(--text); cursor: pointer; }
.pb-row:hover, .pb-row:focus-visible { background: var(--hover); }
.pb-icon { color: var(--violet); text-align: center; }
.pb-name { display: flex; flex-direction: column; min-width: 0; }
.pb-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-key { font-family: var(--mono); font-size: 11.5px; color: var(--text-sec); }
.page-head .pb-key { border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.pb-when { color: var(--text-sec); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pb-size { color: var(--text-sec); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-size.pb-long { color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 999px; padding: 0 8px; }
.pb-state { display: inline-flex; gap: 4px; }
.pb-empty { padding: 24px; text-align: center; color: var(--text-sec); }
.pb-duo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-top: 18px; }
.pb-mini { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.pb-mini h3 { margin: 0; padding: 11px 16px; font-size: 14px; }
.pb-mini-head { display: flex; align-items: center; gap: 8px; padding-right: 12px; }
.pb-mini .kv { padding: 4px 16px 14px; }
.pb-mini .kv-value { font-family: inherit; font-size: 13px; }
.pb-mini .hint { padding: 0 16px 12px; margin: 0; }
.pb-model { margin: 0 16px 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font: 12px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: break-word;
  max-height: 360px; overflow: auto; color: var(--text); }
.sheet-body .pb-model { margin: 0; max-height: none; }
.pb-meter { display: block; height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; margin-top: 5px; }
.pb-meter i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.pb-meter.pb-over i { background: var(--amber); }
.pb-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px;
  border-radius: var(--radius-md); margin-bottom: 14px; font-size: 13.5px; }
.pb-banner-ok { background: var(--ok-bg); color: var(--ok); }
.pb-banner-draft { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
/* Lot KS5 — contenu synchronisé : relecture, élément retiré, sélection groupée, suggestions. */
.pb-banner.ks-review, .pb-banner.ks-removed { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.pb-rowwrap { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; border-top: 1px solid var(--border); background: var(--surface); }
.pb-rowwrap .pb-row { border-top: 0; padding-left: 0; }
.pb-rowwrap .pb-select, .pb-rowwrap .pb-select-gap { justify-self: center; }
.pb-selbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--blue-soft, var(--hover)); border-top: 1px solid var(--border); }
.pb-publist { margin: 0 0 12px; padding-left: 18px; }
.pb-publist li { margin: 2px 0; }
.pb-suggest-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.pb-suggestion { text-align: left; white-space: normal; }
.pb-two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .pb-two, .pb-duo { grid-template-columns: minmax(0, 1fr); } }
.pb-main { padding: 0; }
.pb-form { padding: 18px 22px 8px; }
.pb-g3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
.pb-form .field .label { display: flex; align-items: baseline; gap: 8px; }
.pb-form .field .counter { margin-left: auto; font-variant-numeric: tabular-nums; }
.pb-note { font-style: normal; font-weight: 400; color: var(--text-sec); }
.pb-form textarea { min-height: 0; }
.pb-form .pb-body { min-height: 360px; }
.pb-mono { font-family: var(--mono); font-size: 13px; }
.pb-refs { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 14px; }
.pb-refs-head { font-size: 12.5px; font-weight: 600; }
.pb-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pb-chip { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px;
  font: 11.5px var(--mono); white-space: nowrap; color: var(--text-sec); background: var(--surface); }
.pb-chip-tool { border-color: var(--warn-line); color: var(--warn); background: var(--warn-bg); }
.pb-chip-playbook { border-color: var(--violet-line); color: var(--violet); background: var(--violet-bg); text-decoration: none; }
.pb-chip-other { border-color: var(--danger-line); color: var(--danger); background: var(--danger-bg); }
.pb-sticky { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 10px 22px;
  border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.pb-rail { padding: 0; }
.pb-sec { padding: 14px 16px; border-top: 1px solid var(--border); }
.pb-sec:first-child { border-top: 0; }
.pb-sec h3 { margin: 0 0 8px; font-size: 13.5px; }
.pb-reads { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 13px; }
.pb-reads span { color: var(--text-sec); }
.pb-rev { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; border-top: 1px solid var(--border); }
.pb-rev:first-of-type { border-top: 0; }
.pb-rev b { font-family: var(--mono); font-size: 12.5px; width: 26px; }
.pb-rev span { color: var(--text-sec); flex: 1; }
.pb-when-read { color: var(--text-sec); }
.pb-form .pb-when-input { font-family: inherit; }
.pb-form input[readonly], .pb-form textarea[readonly] { background: var(--surface-2); color: var(--text-sec); }
/* Lot PB4 : fiche d'appel et bloc de l'éditeur. */
.pb-active { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--violet); margin: 2px 0 4px; }
.pb-active i { width: 6px; height: 6px; border-radius: 99px; background: var(--violet); }
.pb-read { margin: 2px 0 6px; }
.pb-readbox .pb-model { margin: 6px 0 0; }
.pb-rail-sec .xf-facts dd { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
/* Lot KN1 : le bloc est une section du panneau Connaissances, sans cadre ; ce
   que l'agent reçoit vit dans sa propre section. */
.pb-receives .pb-model { margin: 6px 0 8px; }
.pb-receives .pb-mini-head { padding-right: 0; }
.pb-info { color: var(--text-sec); font-size: 13px; }
.pb-try-row { display: flex; gap: 6px; margin: 6px 0; }
.pb-try-row .pb-try-input { flex: 1; min-width: 0; }
.pb-sec select { width: 100%; }
.pb-try-text { margin: 4px 0 0; }

/* ---------- Lots KS4-KS5 : les sources externes d'une base ---------- */
.ks-panel { padding: 16px 18px; }
.ks-empty { padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.ks-lede { color: var(--text-sec); font-size: 13.5px; margin: 0 0 12px; }
.ks-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ks-bar .ks-lede { margin: 0; }
.ks-bar .ks-search { width: 220px; }
.ks-list { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.ks-row { display: grid; grid-template-columns: 28px minmax(180px, 260px) minmax(0, 1fr) auto minmax(150px, 220px) 14px; align-items: center;
  gap: 14px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--border); background: var(--surface);
  padding: 11px 16px; font: inherit; color: var(--text); cursor: pointer; }
.ks-row:first-child { border-top: 0; }
.ks-row:hover, .ks-row:focus-visible { background: var(--hover); }
.ks-ico { width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--blue-dark);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.ks-name, .ks-last { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.ks-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ks-name small, .ks-last small, .ks-table small { color: var(--text-sec); font-size: 12px; display: block; }
.ks-when { color: var(--text-sec); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ks-chev { color: var(--text-faint); }
.ks-duo, .ks-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.ks-two { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.ks-mini { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; background: var(--surface-2); }
.ks-mini h3, .ks-sec h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-sec); }
.ks-todo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.ks-todo:first-of-type { border-top: 0; }
.ks-todo b { display: block; }
.ks-todo small { color: var(--text-sec); font-size: 12px; }
.ks-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 13px; }
.ks-kv dt { color: var(--text-sec); }
.ks-kv dd { margin: 0; overflow-wrap: break-word; }
.ks-faint { color: var(--text-faint); font-size: 12.5px; }
.ks-steps { display: flex; gap: 6px; margin: 10px 0 12px; flex-wrap: wrap; }
.ks-step { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 14px; font: inherit; color: var(--text-sec); cursor: pointer; }
.ks-step.on { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue-dark); font-weight: 600; }
.ks-wizard { padding: 18px; }
.ks-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ks-fields { display: grid; gap: 4px; }
.ks-admin ol { margin: 0 0 8px; padding-left: 18px; font-size: 13px; }
.ks-testline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ks-test { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ks-info { color: var(--text-sec); font-size: 13px; background: var(--blue-soft); border: 1px solid var(--blue-line); border-radius: var(--radius-sm); padding: 8px 12px; }
.ks-info:empty { display: none; }
.ks-h { font-size: 14px; margin: 18px 0 8px; }
.ks-rule { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ks-vals { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ks-chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12.5px; color: var(--text); }
button.ks-chip { cursor: pointer; }
.ks-chip.on { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue-dark); }
.ks-table .ks-chip + .ks-chip { margin-left: 4px; }
.ks-map, .ks-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ks-map th, .ks-map td, .ks-table th, .ks-table td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--border); vertical-align: top; }
.ks-map th, .ks-table th { color: var(--text-sec); font-weight: 600; font-size: 12px; background: var(--track); }
.ks-line { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 0; }
.ks-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ks-tile { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.ks-tile b { font-size: 22px; }
.ks-tile small { color: var(--text-sec); font-size: 12px; }
.ks-tile.violet { background: var(--violet-bg); border-color: var(--violet-line); }
.ks-tile.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.ks-tile.ok { background: var(--ok-bg); }
.ks-tile.mute { background: var(--track); }
.ks-warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; }
.ks-error { color: var(--danger); font-size: 13px; margin: 10px 0 0; }
.ks-sticky { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.ks-banner { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 14px; margin: 6px 0 4px; background: var(--surface-2); font-size: 13.5px; }
.ks-banner.ok { background: var(--ok-bg); }
.ks-banner.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.ks-banner.danger { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.ks-rail { padding: 14px 16px; }
.ks-sec + .ks-sec { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.ks-run { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 12.5px; }
.ks-run em { color: var(--text-faint); font-style: normal; }
.ks-reads { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 3px 0; }
.ks-link { color: var(--blue-dark); white-space: nowrap; }
.ks-menu { position: relative; }
.ks-menu > summary { list-style: none; cursor: pointer; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 10px; background: var(--surface); }
.ks-menu > summary::-webkit-details-marker { display: none; }
.ks-menu-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; min-width: 180px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 4px; }
.ks-menu-panel button { text-align: left; border: 0; background: none; padding: 7px 10px; }
.ks-pill-source { background: var(--blue-soft); color: var(--blue-dark); border: 1px solid var(--blue-line); }
@media (max-width: 1100px) { .ks-duo, .ks-two, .ks-tiles { grid-template-columns: minmax(0, 1fr); } .ks-row { grid-template-columns: 28px minmax(0, 1fr) auto 14px; } .ks-when, .ks-last { display: none; } }

/* ── Panneau Connaissances (lots KN1-KN2) ──────────────────────────────────────
   La sous-navigation du Tour de parole (`tp-*`, `subnavPanel()`), et ce qui lui
   est propre sous le préfixe `kn-`. Aucune teinte nouvelle. */
.kn-sub { margin: var(--space-4) 0 0; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.kn-ext { white-space: nowrap; }
.kn-nobase { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 0; margin-bottom: var(--space-3); }
.kn-shared { margin: 4px 0 0; }
.kn-default-details { margin-top: var(--space-4); font-size: 12.5px; color: var(--text-sec); }
.kn-default-details > summary { cursor: pointer; padding: 6px 0; }
.kn-caps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); }
.kn-cap { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); min-width: 0; }
.kn-cap-off { background: var(--surface-2); }
.kn-cap-head { display: flex; align-items: center; gap: 8px; }
.kn-cap-head .spacer { flex: 1; }
.kn-cap-icon { width: 24px; text-align: center; color: var(--text-sec); }
.kn-cap .hint { margin: 0; }
.kn-cap-foot { margin-top: auto; }
.kn-overview { display: flex; flex-direction: column; gap: var(--space-4); }
.kn-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13px; }
.kn-kv dt { color: var(--text-faint); }
.kn-kv dd { margin: 0; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kn-oneline { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.kn-same { font-size: 11px; }
.kn-strip { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.kn-strip + .kn-strip { margin-top: var(--space-3); }
.kn-strip-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13px; }
.kn-strip-head .spacer { flex: 1; }
.kn-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kn-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; color: var(--text); text-decoration: none; border-right: 1px solid var(--border); min-width: 0; }
.kn-tile:last-child { border-right: 0; }
.kn-tile:hover, .kn-tile:focus-visible { background: var(--hover); }
.kn-tile-title { font-size: 12px; color: var(--text-sec); }
.kn-tile-value { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.kn-tile-sub { font-size: 12px; color: var(--text-sec); }
.kn-tile-sub.ok { color: var(--ok); }
.kn-tile-sub.warn { color: var(--warn); }
.kn-tile-sub.danger { color: var(--danger); }
.kn-usage { display: flex; flex-direction: column; gap: var(--space-2); }
.kn-usage-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kn-top { margin: 0; font-size: 13px; color: var(--text-sec); }
.kn-top code { margin-right: 2px; }
.kn-recv + .kn-recv, .kn-recv + .pb-receives { margin-top: var(--space-4); }
.kn-tool-pre { white-space: pre-wrap; }


/* Lot KU3 — les tables de connaissances d'un dashboard (prototype
   docs/yelda-air-usage-connaissances-prototype.html). Les nombres viennent du
   serveur ; ces règles ne dessinent que la barre, le gris et le panneau. */
.db-ku-table td { vertical-align: middle; }
.db-ku-table th, .db-ku-table th.num { white-space: normal; vertical-align: bottom; }
.db-ku-title { min-width: 160px; }
.db-ku-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.db-ku-chip { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--track); color: var(--text-sec); white-space: nowrap; }
.db-ku-click { cursor: pointer; }
.db-ku-click:hover td { background: var(--hover); }
.db-ku-row.db-ku-sel td { background: var(--blue-soft); }
.db-ku-ttl { font-weight: 600; color: var(--text); }
.db-ku-key { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-left: 6px; }
.db-ku-sub { display: block; font-size: 11.5px; color: var(--text-faint); }
.db-ku-src { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--track); color: var(--text-sec); margin-left: 6px; }
.db-ku-n { white-space: nowrap; font-size: 10.5px; font-weight: 600; color: var(--text-faint); border: 1px dashed var(--border-strong); border-radius: 4px; padding: 0 4px; margin-left: 6px; }
.db-ku-low td { color: var(--text-faint); }
.db-ku-low .db-ku-ttl { color: var(--text-sec); font-weight: 500; }
.db-ku-del .db-ku-ttl { text-decoration: line-through; color: var(--text-sec); }
.db-ku-cmp { color: var(--text-sec); }
.db-ku-bar { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.db-ku-track { flex: 1; height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.db-ku-track i { display: block; height: 100%; border-radius: 4px; }
.db-ku-fill { background: var(--violet); }
.db-ku-fill-blue { background: var(--blue); }
.db-ku-fill-low { background: var(--neutral); }
.db-ku-bar b { font-weight: 600; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.db-ku-foot { padding: 8px 16px 12px; font-size: 12px; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--border); }
.db-ku-foot a { color: var(--blue-dark); text-decoration: none; }
.db-ku-sp { flex: 1; }
.db-ku-idle { list-style: none; margin: 0; padding: 4px 16px; }
.db-ku-idle li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.db-ku-idle li:last-child { border-bottom: 0; }
.db-ku-idle a.db-ku-ttl { text-decoration: none; }
.db-ku-date { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.db-ku-detail { grid-column: 1 / -1; }
.db-ku-drill { background: var(--surface-2); border: 1px solid var(--blue-line); padding: 14px 16px; display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 18px; }
.db-ku-drill h4 { margin: 0 0 6px; font-size: 14px; }
.db-ku-kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; margin: 0; }
.db-ku-kv dt { color: var(--text-sec); }
.db-ku-kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.db-ku-revs { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.db-ku-rev { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 8px; }
.db-ku-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.db-ku-acts a { color: var(--blue-dark); text-decoration: none; font-size: 13px; }
.db-ku-close { align-self: flex-end; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--text-sec); cursor: pointer; }
.db-ku-i { margin-left: auto; }
.db-card-head .db-copy + .db-ku-i { margin-left: 0; }
@media (max-width: 760px) {
  .db-ku-drill { grid-template-columns: 1fr; }
}
.pb-opened-n { font-size: 11.5px; color: var(--text-faint); }

/* Lot CL1 — partenaires : pastille d'accent, aperçu de la marque. */
.pt-swatch { display: inline-block; padding: 2px 8px; border-radius: 999px; font-family: var(--mono, monospace); font-size: 12px; }
.pt-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pt-preview-bar { display: inline-block; min-width: 220px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border); font-weight: 600; }
.pt-colour { width: 44px; height: 32px; padding: 0; border: 1px solid var(--border); background: none; }
.pt-accent { max-width: 120px; }

/* Lot CL2 — the plan card of an organization's settings. */
.op-gauge { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; margin: 8px 0; }
.op-gauge-fill { display: block; height: 100%; background: var(--blue); }
.op-banner { padding: 8px 12px; border-radius: 8px; background: var(--bg); }
.op-paused { font-weight: 600; }
.op-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }

/* Lot CL5c — the client deployments. */
.cl5-dots { display: inline-flex; gap: 4px; }
.cl5-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--track); }
.cl5-dot.ok { background: var(--green, #1f9d55); }
.cl5-dot.pending { background: #f0b429; }
.cl5-timeline { display: flex; gap: 12px; list-style: none; padding: 0; flex-wrap: wrap; }
.cl5-timeline li { display: flex; flex-direction: column; opacity: .5; }
.cl5-timeline li.reached { opacity: 1; }
.cl5-steps { padding-left: 18px; }

/* Lot PT4 — la console partenaire. */
.pcn-tech { margin-top: auto; padding: 16px 20px; font-size: 11px; color: var(--muted); }
.pcn-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pcn-tile { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.pcn-tile-value { font-size: 26px; font-weight: 600; }
.pcn-tile-label { color: var(--muted); font-size: 13px; }
.pcn-chip { display: inline-flex; align-items: center; gap: 2px; margin: 0 6px 4px 0; padding: 2px 8px; border-radius: 999px; background: var(--track, #eef1f6); font-size: 12px; }
.pcn-link { width: 100%; font-family: var(--mono, monospace); }
.pcn-totals { color: var(--muted); }
.pcn-brand-preview { display: inline-block; min-width: 220px; margin: 8px 0 12px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border); font-weight: 600; }
/* Marges verticales seulement : `main > .pcn-tabs` centre la barre comme le reste de la page. */
.pcn-tabs { display: flex; gap: 4px; margin-top: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.pcn-tab { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; color: var(--muted); }
.pcn-tab[aria-current='true'] { border-bottom-color: var(--blue); color: var(--text, inherit); }
.pcn-readbar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; margin-bottom: 12px; border-radius: 8px; background: var(--amber-bg, #fff4e0); }
.oa-floor h3 { margin: 12px 0 4px; font-size: 14px; }
.oa-people { margin: 0; padding-left: 18px; }

/* Lot PT8 — la Vue d'ensemble de l'instance. */
a.io-tile { color: inherit; text-decoration: none; }
a.io-tile:hover { border-color: var(--blue); }
.io-tile-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.io-tile-sub.io-alert { color: var(--red, #b42318); }
.io-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .io-grid { grid-template-columns: minmax(0, 1fr); } }
.io-list { list-style: none; margin: 8px 0 0; padding: 0; }
.io-row { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.io-row:last-child { border-bottom: 0; }
.io-row .badge { flex: 0 0 auto; }
.io-partner { color: var(--muted); }
.io-partner-row { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 10px; padding: 10px 0; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.io-list li:last-child .io-partner-row { border-bottom: 0; }
.io-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--muted); margin-top: 4px; }
.io-partner-name { font-weight: 600; }
.io-partner-sub { grid-column: 2; color: var(--muted); font-size: 12px; overflow-wrap: break-word; }
/* Lot PT8 — l'aperçu du logo d'un partenaire. */
.pt-logo-preview { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: var(--surface, #fff); }

/* ---------- Nouveautés (lots NV2-NV5) ----------
   Le journal technique, la préparation d'une version et les notes de version.
   Préfixe `wn-` : aucune classe globale ne le porte. */
.wn-yelda-only { margin-bottom: var(--space-3); }
.wn-filters { margin: var(--space-4) 0 var(--space-3); }
.wn-filters .tabs { align-items: center; }
.wn-filters .spacer { flex: 1; }
.wn-deploy { margin-bottom: var(--space-5, 24px); }
.wn-deploy-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.wn-deploy-head h2 { margin: 0; font-size: 16px; }
.wn-mono, .wn-sha { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-sec); }
.wn-entries { padding: 0; overflow: hidden; }
.wn-entry { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--border); }
.wn-entry:first-child { border-top: none; }
.wn-entry-domain { flex: 0 0 96px; }
.wn-entry-main { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wn-entry-status { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wn-client-note { margin: 0; color: var(--text-sec); font-size: 13.5px; }
.wn-body { margin: 0; white-space: pre-wrap; font-size: 12.5px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.wn-body-toggle { align-self: flex-start; font-size: 12.5px; }
.wn-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.wn-muted { margin: 0; color: var(--text-sec); font-size: 13px; }
.wn-draft { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.wn-draft-left { flex: 1 1 380px; min-width: 0; padding: 0; overflow: hidden; }
.wn-draft-left-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.wn-draft-left-head h2 { margin: 0 0 4px; font-size: 15px; }
.wn-draft-right { flex: 1.4 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.wn-draft-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: var(--space-4); }
.wn-draft-actions .spacer { flex: 1; }
.wn-save-state { font-size: 12.5px; color: var(--text-sec); }
.wn-pick { display: flex; align-items: flex-start; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); }
.wn-pick:first-child { border-top: none; }
.wn-pick-label { flex: 1; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; min-height: 32px; }
.wn-pick-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wn-pick-meta { font-size: 12px; color: var(--text-sec); }
.wn-draft-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.wn-draft-meta .wn-wide { grid-column: 1 / -1; }
.wn-draft-item { display: flex; flex-direction: column; gap: 8px; }
.wn-edit-wrap { display: flex; flex-direction: column; gap: 4px; }
.wn-edit { width: 100%; box-sizing: border-box; }
textarea.wn-edit-area { min-height: 64px; }
.wn-field-blocking { outline: 2px solid var(--danger); outline-offset: 0; }
.wn-field-warning { outline: 2px solid var(--warn, #d48a00); outline-offset: 0; }
.wn-terms { font-size: 12px; color: var(--warn, #8a5a0b); }
.wn-terms-blocking { color: var(--danger); font-weight: 600; }
.wn-sources { font-size: 11.5px; color: var(--text-sec); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.wn-kicker { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-sec); }
.wn-preview { max-width: 860px; }
.wn-release { display: flex; flex-direction: column; gap: 18px; }
.wn-release-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wn-date { font-size: 14px; color: var(--text-sec); }
.wn-release-title { margin: 0; font-size: 26px; line-height: 1.2; }
.wn-release-latest .wn-release-title { font-size: 32px; }
.wn-release-intro { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--text-sec); max-width: 720px; }
.wn-headline { border: 1px solid var(--border); border-radius: 12px; padding: 22px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.wn-headline h3 { margin: 0; font-size: 20px; }
.wn-headline p, .wn-card p { margin: 0; line-height: 1.55; color: var(--text-sec); }
.wn-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.wn-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.wn-card h3 { margin: 0; font-size: 16px; }
.wn-also { border-top: 1px solid var(--border); padding-top: 16px; }
.wn-also h3 { margin: 0 0 8px; font-size: 14px; }
.wn-also ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-sec); }
.wn-page-head h1 { margin: 0; }
.wn-page-head .wn-muted { margin-top: 4px; font-size: 14.5px; }
.wn-older { display: flex; flex-direction: column; gap: 12px; margin-top: var(--space-5, 24px); }
.wn-older-title { margin: 0; font-size: 17px; }
.wn-older-row { padding: 0; overflow: hidden; }
.wn-acc { all: unset; box-sizing: border-box; width: 100%; min-height: 44px; padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; cursor: pointer; }
.wn-acc:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 12px; }
.wn-acc-title { flex: 1 1 200px; font-size: 15px; }
.wn-chevron { font-size: 18px; color: var(--text-sec); }
.wn-older-body { padding: 0 20px 20px; }
.wn-older-body .wn-release { border: none; box-shadow: none; padding: 0; }
.wn-nav-badge { margin-left: auto; font-size: 11px; }
/* La règle globale `textarea` vise le prompt système : ici, deux lignes de prose. */
.wn-draft textarea.wn-edit-area { font-family: inherit; font-size: 14px; min-height: 64px; }
.wn-draft-meta .field { margin-bottom: 0; }

/* Lot GO1 : la case « transferts comptés » du forfait. */
.plan-transfers {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
}

/* Lot LP3 — l'éditeur de la page d'accueil d'un partenaire. */
.lpe-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lpe-status { margin-right: 4px; }
.lpe-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr); gap: 16px; align-items: start; }
.lpe-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 16px; }
.lpe-sections { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.lpe-pair { border: 1px solid var(--border); border-radius: 10px; background: var(--surface, #fff); }
.lpe-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.lpe-row code { font-size: 12px; color: var(--muted); }
.lpe-sheet textarea, .lpe-group textarea { min-height: 0; }
.lpe-sheet { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.lpe-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.lpe-lines, .lpe-objects, .lpe-group { display: flex; flex-direction: column; gap: 6px; }
.lpe-lines .row input { flex: 1; }
.lpe-err { color: var(--danger, #b42318); margin: 2px 0 0; }
.lpe-err:empty { display: none; }
.lpe-frame-box { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; height: 640px; margin-top: 8px; }
.lpe-frame-box.phone { width: 390px; max-width: 100%; margin-left: auto; margin-right: auto; }
.lpe-frame { width: 100%; height: 100%; border: 0; }
.lpe-history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.lpe-history li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lpe-links textarea { font-family: var(--mono, monospace); font-size: 12px; min-height: 0; width: 100%; }
@media (max-width: 1100px) { .lpe-grid { grid-template-columns: 1fr; } .lpe-side { position: static; } }
