/* ============================================================
   Audits clôturés, lu / non lu des échanges, supervision de l'administrateur
   (échanges de tous les audits, historique des révisions), apparence.
   Couleurs : uniquement des variables — le mode sombre et la palette de l'organisme s'appliquent seuls.
   ============================================================ */

/* ---------- audit clôturé : bandeau et lecture seule ---------- */
.closed-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 14px;
  border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  background: color-mix(in srgb, var(--warn) 9%, var(--surface)); color: var(--ink); }
.closed-banner > .ico { color: var(--warn); display: inline-flex; }
.closed-banner .txt { flex: 1; min-width: 220px; }
.closed-banner .txt b { font-weight: 650; }
.closed-banner .txt .muted { display: block; font-size: 12.5px; }
.audit-closed-ro input:disabled, .audit-closed-ro textarea:disabled, .audit-closed-ro select:disabled,
.drawer.audit-closed-ro input:disabled, .drawer.audit-closed-ro textarea:disabled, .drawer.audit-closed-ro select:disabled {
  cursor: not-allowed; background: var(--surface-2); color: var(--ink-2); }

/* ---------- échanges : non lu, accusés de lecture ---------- */
.th-item.unread .ttl { font-weight: 650; }
.th-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; flex-shrink: 0; }
.th-reads { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.th-reads .who { padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.th-reads .who.read { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.th-reads .who.read::before { content: "✓ "; color: var(--ok); }
.th-reads .who.unread { opacity: .7; }

/* ---------- filtres communs (supervision, historique) ---------- */
.sup-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.sup-filters .field { margin: 0; min-width: 150px; flex: 1 1 150px; max-width: 260px; }
.sup-filters .field.grow { max-width: none; flex: 2 1 220px; }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
  background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.sup-count { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.sup-excerpt { max-width: 560px; white-space: normal; overflow-wrap: anywhere; }
.sup-msg { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; }

/* ---------- historique des révisions : chronologie ---------- */
.rev-timeline { position: relative; padding-inline-start: 22px; }
.rev-timeline::before { content: ""; position: absolute; inset-inline-start: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.rev-day { position: relative; z-index: 1; display: inline-block; margin: 16px 0 6px; margin-inline-start: -22px;
  padding-block: 2px; padding-inline-end: 8px; background: var(--bg); font-size: 12.5px; font-weight: 650; color: var(--muted); }
.rev-item { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px; margin-bottom: 8px; box-shadow: var(--shadow); animation: rev-in .22s ease both; }
.rev-item::before { content: ""; position: absolute; inset-inline-start: -19px; top: 14px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--rev-color, var(--brand)); box-shadow: 0 0 0 3px var(--bg); }
.rev-item[data-action="create"] { --rev-color: var(--ok); }
.rev-item[data-action="update"] { --rev-color: var(--brand); }
.rev-item[data-action="delete"] { --rev-color: var(--danger); }
.rev-item[data-action="close"] { --rev-color: var(--ink-2); }
.rev-item[data-action="reopen"] { --rev-color: var(--warn); }
.rev-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rev-head .when { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rev-head .spacer { flex: 1; }
.rev-chip { font-size: 11.5px; padding: 1px 8px; border-radius: 10px; color: var(--rev-color, var(--brand));
  border: 1px solid color-mix(in srgb, var(--rev-color, var(--brand)) 40%, var(--line));
  background: color-mix(in srgb, var(--rev-color, var(--brand)) 10%, var(--surface)); }
.rev-change { font-family: var(--mono); font-size: 12px; margin-top: 5px; overflow-wrap: anywhere; color: var(--ink-2); }
.rev-change del { color: var(--danger); text-decoration: line-through; }
.rev-change ins { color: var(--ok); text-decoration: none; }
.rev-reason { margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }
.rev-reason b { color: var(--ink); }
.rev-more { display: flex; justify-content: center; margin-top: 8px; }
.rev-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rev-diff h4 { margin-bottom: 6px; }
.rev-diff pre { margin: 0; max-height: 62vh; overflow: auto; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
@keyframes rev-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { .rev-diff { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .rev-item { animation: none; } }

/* ---------- apparence : palette de l'organisme ---------- */
.chip.ok { color: var(--success-text); border-color: var(--success-border); background: var(--success-soft); }
.pal-logo-box { display: flex; align-items: center; justify-content: center; min-height: 116px; padding: 14px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }
.pal-logo { max-height: 90px; max-width: 100%; object-fit: contain; }
.pal-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.pal-swatch { width: 80px; height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; font: 600 10.5px var(--mono);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.pal-swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pal-pickers { display: grid; gap: 2px; }
.pal-picker input[type="color"] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.pal-picker input[type="text"] { width: 112px; }
.pal-note { color: var(--warning-text); }
.pal-dirty { color: var(--warning-text); font-weight: 600; }
.pal-mocks, .pal-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pal-mock { display: flex; min-height: 196px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 12px; }
.pm-side { width: 34%; background: var(--side); color: var(--side-text); padding: 10px 8px; display: flex; flex-direction: column; gap: 4px; }
.pm-brand { color: var(--side-strong); font-weight: 650; margin-bottom: 6px; display: flex; align-items: center; }
.pm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-inline-end: 6px; }
.pm-nav { padding: 5px 8px; border-radius: 6px; }
.pm-nav.active { background: var(--side-active); color: var(--side-active-text); }
.pm-body { flex: 1; min-width: 0; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.pm-title { font-weight: 650; font-size: 13px; }
.pm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px; display: flex; flex-direction: column; gap: 7px; }
.pm-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pm-btn { padding: 4px 9px; border-radius: 6px; font-weight: 600; }
.pm-btn.primary { background: var(--primary); color: var(--on-primary); }
.pm-btn.secondary { background: var(--secondary); color: var(--on-secondary); }
.pm-badge { padding: 1px 8px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.pm-link { color: var(--primary); text-decoration: underline; }
.pm-muted { color: var(--text-muted); }
.pm-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.pm-bar span { display: block; height: 100%; background: var(--accent); }
.pm-sel { padding: 4px 7px; border-radius: 6px; background: var(--primary-softer); border-inline-start: 3px solid var(--primary); }
.pal-chk { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pal-chk td { padding: 5px 6px; border-bottom: 1px solid var(--border-soft); }
.pal-chk td:nth-child(2) { text-align: end; white-space: nowrap; }
.pal-chk td:last-child { text-align: end; width: 1%; white-space: nowrap; }
.pal-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.pal-actions .spacer { flex: 1; }
@media (max-width: 1180px) { .pal-mocks, .pal-checks { grid-template-columns: 1fr; } }

.field .theme-seg { width: auto; align-self: flex-start; }

/* ---------- vue en cours de chargement : barre fine sous l'en-tête ---------- */
.main.route-loading::before { content: ""; position: fixed; top: var(--top-h); inset-inline: var(--side-w) 0; height: 3px; z-index: 30;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat; background-size: 35% 100%;
  animation: route-bar 1.1s var(--ease) infinite; }
.app.rail .main.route-loading::before { inset-inline-start: var(--rail-w); }
@media (max-width: 1024px) { .main.route-loading::before { inset-inline-start: var(--rail-w); } }
@media (max-width: 760px) { .main.route-loading::before { inset-inline-start: 0; } }
@keyframes route-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ---------- aide des raccourcis clavier ---------- */
.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; align-items: center; }
.kbd-list > div:nth-child(odd) { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .main.route-loading::before { animation: none; } .pal-swatch { transition: none; } }

/* ---------- anonymisation : comparaison original / anonymisé (lot A, refondue au lot W1) ----------

   Trois règles sont indispensables et ont manqué jusqu'à la 1.69.0 — leur absence rendait la moitié gauche de la
   comparaison physiquement inatteignable (le conteneur centré débordait des deux côtés) :
     1. `minmax(0, 1fr)` et non `1fr` : une colonne de grille ne descend jamais sous la taille de son contenu ;
     2. `min-width: 0` sur les enfants : un enfant de grille ou de flex a `min-width: auto` par défaut ;
     3. `overflow: auto` porté par le panneau, qui absorbe les lignes insécables (`white-space: pre`).
   Même schéma que `.tr-diff-side` (techaudit.css), qui n'a jamais souffert du défaut pour cette seule raison. */
.anon-diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0;
  direction: ltr; /* la comparaison reste gauche→droite même en arabe : l'original est toujours à gauche */ }
.anon-diff > * { min-width: 0; }
.anon-diff.solo { grid-template-columns: minmax(0, 1fr); }
.anon-diff.tabbed { grid-template-columns: minmax(0, 1fr); }
.anon-diff.tabbed > .anon-side[hidden] { display: none; }
.anon-side { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.anon-side > h4 { margin: 0; font-size: 13px; }
.anon-pane { flex: 1; min-width: 0; min-height: 120px; max-height: 62vh; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; padding: 6px 0; }
.anon-line { display: flex; gap: 10px; padding: 0 10px; white-space: pre; }
.anon-line.changed { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.anon-line.current { background: color-mix(in srgb, var(--brand) 14%, transparent); box-shadow: inset 2px 0 0 var(--brand); }
.anon-no { color: var(--muted, #8491a1); min-width: 3.2em; text-align: end; user-select: none; flex: none; }
.anon-line code { background: none; padding: 0; }
.anon-mark { border-radius: 3px; padding: 0 2px; color: var(--ink); background: color-mix(in srgb, var(--brand) 22%, transparent);
  cursor: pointer; }
.anon-mark.current { outline: 2px solid var(--brand); outline-offset: 1px; }
.anon-mark.dim { opacity: .35; }
/* barre de navigation entre les changements */
.anon-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.anon-nav .anon-count { font-variant-numeric: tabular-nums; }
.anon-nav select { width: auto; max-width: 320px; }
.anon-nav .check { white-space: nowrap; }
.anon-rot { transform: rotate(180deg); }
.anon-workbench { outline: none; display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.anon-workbench > .anon-diff { flex: 1; min-height: 0; }
.anon-workbench .anon-side { min-height: 0; }
/* dans l'atelier, la hauteur vient du conteneur : le panneau défile, la page non */
.anon-workbench .anon-pane { max-height: none; }

/* ---------- atelier d'anonymisation : page plein écran (lot W2) ---------- */
.anon-wb-page { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 420px; }
.anon-wb-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; }
.anon-wb-grid.collapsed { grid-template-columns: minmax(0, 1fr); }
.anon-wb-grid.collapsed > .anon-inventory { display: none; }
@media (max-width: 900px) { .anon-wb-grid { grid-template-columns: minmax(0, 1fr); } .anon-wb-grid > .anon-inventory { display: none; } }
.anon-inventory { display: flex; flex-direction: column; min-height: 0; min-width: 0; gap: 6px; }
.anon-inventory > h4 { margin: 0; font-size: 13px; }
.anon-inv-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; background: var(--surface-2); }
.anon-inv-item { text-align: start; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 6px 8px;
  background: none; color: inherit; cursor: pointer; min-width: 0; }
.anon-inv-item > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anon-inv-item:hover { background: var(--surface-3); }
.anon-inv-item.active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
/* ---------- laboratoire de transformation (lot W8) ---------- */
.lab-page { display: flex; flex-direction: column; min-height: 0; }
.lab-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr) minmax(0, 1fr); gap: 14px; min-width: 0;
  align-items: start; }
@media (max-width: 1100px) { .lab-grid { grid-template-columns: minmax(0, 1fr); } }
.lab-grid > section { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lab-grid h3 { margin: 0; font-size: 14px; }
.lab-grid textarea { width: 100%; resize: vertical; }
/* traitement en direct arrêté : le résultat affiché ne correspond plus à l'entrée (lot L1) */
.lab-grid textarea.stale { opacity: .55; border-style: dashed; }
/* écarts réels original ↔ final (lot P5) : différentiel unifié, coloré par préfixe de ligne */
.anon-diff-text { max-height: 62vh; overflow: auto; margin: 0; padding: 10px 12px; font-size: 12px;
  line-height: 1.45; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  white-space: pre; }
.anon-diff-line.add { background: var(--success-soft); color: var(--success-text); display: inline-block; width: 100%; }
.anon-diff-line.del { background: var(--error-soft); color: var(--error-text); display: inline-block; width: 100%; }
.anon-diff-line.meta { color: var(--muted, #8491a1); }
.lab-catalogue { max-height: 60vh; overflow: auto; display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; background: var(--surface-2); }
.lab-cat h4 { margin: 0 0 4px; font-size: 12.5px; color: var(--muted, #8491a1); }
.lab-ops { display: flex; flex-direction: column; gap: 3px; }
.lab-op { text-align: start; background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 4px 7px; color: inherit; cursor: pointer; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.lab-op:hover { border-color: var(--brand); background: var(--surface-3); }
.lab-steps { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.lab-step { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; background: var(--surface); }
.lab-step.failed { border-color: var(--danger); }
.lab-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 10px; margin-top: 6px; }
.lab-params .field { margin: 0; }
.lab-recipes { display: flex; flex-direction: column; gap: 8px; }
.lab-recipe { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.chip.xs { padding: 0 5px; font-size: 11px; }
.flex1 { flex: 1; }

/* zone de dépôt par lots (lot W5) */
.anon-drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  background: var(--surface-2); transition: border-color var(--dur-fast) var(--ease); }
.anon-drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.anon-drop > .help { margin: 4px 0 0; }
.anon-job { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.anon-job .tk-bar { flex: 1; }
.anon-profile-list { display: flex; flex-direction: column; gap: 8px; }
.anon-profile { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.anon-wb-left { display: flex; flex-direction: column; min-height: 0; gap: 10px; }
.anon-overrides { display: flex; flex-direction: column; min-height: 0; max-height: 40%; gap: 6px; }
.anon-overrides > h4 { margin: 0; font-size: 13px; }
.anon-ov-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; background: var(--surface-2); }
.anon-ov-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; }
.anon-ov-item .mono { overflow-wrap: anywhere; }
/* un segment imposé par une correction manuelle se distingue du jeton calculé */
.anon-mark.forced { outline: 1px dashed var(--warn); }
/* poignée de redimensionnement entre les deux panneaux */
.anon-split { cursor: col-resize; border-radius: 3px; background: var(--border); touch-action: none; }
.anon-split:hover, .anon-split:active { background: var(--brand); }
.anon-diff.tabbed > .anon-split { display: none; }
/* virtualisation : le canevas porte la hauteur du fichier entier, seules les lignes visibles sont dans le DOM */
.anon-canvas { position: relative; min-height: 100%; }
.anon-canvas > .anon-line { position: absolute; inset-inline-start: 0; min-width: 100%;
  height: 19px; line-height: 19px; }
.anon-tabs { display: none; }
@media (max-width: 900px) {
  /* en dessous de 900 px, on bascule en onglets : empiler les deux panneaux supprimerait la comparaison */
  .anon-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
}
.anon-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 14px; margin: 6px 0 12px; }
.anon-stats, .anon-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.anon-cat-private_key, .anon-cat-secret, .anon-cat-hash, .anon-cat-community, .anon-cat-token {
  background: color-mix(in srgb, var(--danger) 18%, transparent) !important; }
.anon-cat-username, .anon-cat-email, .anon-cat-organisation, .anon-cat-hostname, .anon-cat-serial {
  background: color-mix(in srgb, var(--warn) 20%, transparent) !important; }
.anon-cat-ip_public, .anon-cat-ip_private, .anon-cat-domain, .anon-cat-url, .anon-cat-cloud_id {
  background: color-mix(in srgb, var(--brand) 20%, transparent) !important; }
.anon-cat-description, .anon-cat-location, .anon-cat-banner, .anon-cat-object_name {
  background: color-mix(in srgb, var(--ok) 18%, transparent) !important; }

/* ---------- connaissance technique : bibliothèque de configurations, parseurs (lots C et D) ---------- */
.tk-bar { position: relative; min-width: 90px; height: 18px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.tk-bar > i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--brand) 55%, transparent); }
.tk-bar > span { position: relative; display: block; text-align: center; font-size: 11.5px; line-height: 18px; color: var(--ink); }
.tk-code { max-height: 55vh; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.tk-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.tk-meta dt { color: var(--muted, #8491a1); font-size: 12.5px; }
.tk-meta dd { margin: 0; }
.tk-candidate { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.cl-v-vulnerable { background: color-mix(in srgb, var(--danger) 16%, transparent) !important; }
.cl-v-hardened { background: color-mix(in srgb, var(--ok) 16%, transparent) !important; }
.cl-v-complex { background: color-mix(in srgb, var(--brand) 14%, transparent) !important; }

/* ---------- contrôle d'accès (lot I-2) ---------- */
.ac-matrix td, .ac-matrix th { white-space: nowrap; }
.ac-matrix select { min-width: 110px; }
.ac-lv-NONE { opacity: .55; }
.ac-lv-RW, .ac-lv-EXECUTE { background: color-mix(in srgb, var(--brand) 18%, transparent) !important; }
.ac-lv-APPROVE, .ac-lv-ADMIN { background: color-mix(in srgb, var(--ok) 22%, transparent) !important; }

/* ---------- réglage de l'analyse (lot F) ---------- */
tr.an-suppressed td { opacity: .5; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent); }
.tn-chain { width: 100%; font-size: 12.5px; }
.tn-chain td, .tn-chain th { padding: 4px 8px; border-bottom: 1px solid var(--border-soft, var(--border)); text-align: start; }
.tn-chain tr.tn-winner td { font-weight: 600; background: color-mix(in srgb, var(--brand) 8%, transparent); }
.tn-history { list-style: none; margin: 4px 0 0; padding: 0; }
.tn-history li { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.tn-conds { display: grid; gap: 6px; }
.tn-cond { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(110px, 1fr) minmax(120px, 1.4fr) auto; gap: 6px; align-items: center; }
@media (max-width: 640px) { .tn-cond { grid-template-columns: 1fr 1fr; } }

/* ---------- base de connaissance de sécurité (lot E) ---------- */
.kb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.kb-main > .card, .kb-side > .card { margin-bottom: 14px; }
.kb-side { position: sticky; top: 12px; }
@media (max-width: 1100px) { .kb-layout { grid-template-columns: 1fr; } .kb-side { position: static; } }
.kb-text p { margin: 0 0 8px; line-height: 1.55; white-space: pre-wrap; }
.kb-text p:last-child { margin-bottom: 0; }
.kb-alts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.kb-alt { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); margin-bottom: 8px; }
.kb-alt p { margin: 6px 0 0; }
.kb-alt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kb-alt-code { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; font-size: 12px;
  background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--ink); }
.kb-refs { margin: 0; padding-inline-start: 0; list-style: none; }
.kb-refs li { margin-bottom: 6px; line-height: 1.45; }

/* ---------------------------------------------------------------- Capacités cyber (lot 4, 1.112.0)
   La couverture est une barre et un nombre : la barre se lit d'un coup d'œil, le nombre empêche de
   la lire de travers. Le niveau, lui, n'a pas de barre — un niveau indéterminé n'a pas de longueur,
   et lui en donner une reviendrait à le faire passer pour un zéro. */
.cap-models { display: grid; gap: 10px; }
.cap-model { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.cap-cov { display: inline-flex; align-items: center; gap: 8px; }
.cap-cov-bar { display: inline-block; width: 90px; height: 8px; border-radius: 4px;
  background: var(--line); overflow: hidden; }
.cap-cov-bar > span { display: block; height: 100%; background: var(--brand); }
.cap-cov-num { font-variant-numeric: tabular-nums; font-size: .85em; color: var(--muted); }
.cap-score-head { gap: 28px; align-items: flex-start; }
.cap-questions { display: grid; gap: 12px; }
.cap-q { border-inline-start: 3px solid var(--line); padding-inline-start: 12px; }
.cap-q .cap-answer { gap: 14px; align-items: flex-end; }
.cap-q .cap-answer .field { margin: 0; }
.cap-criteria { margin: 6px 0 0; padding-inline-start: 18px; }
.cap-criteria li { margin-bottom: 4px; }
.cap-road { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.cap-road:first-of-type { border-top: 0; }

/* 2.12.0 : grille de maturité, échelle par dimension, propositions et points à vérifier. La grille est le SVG du
   rapport (couleurs de page blanche) : fond --chart-bg, et taille réelle avec défilement plutôt qu'un texte réduit. */
.cap-grille-fig { margin: 0; padding: 8px; border-radius: var(--radius-sm); background: var(--chart-bg); color: var(--chart-text); overflow-x: auto; }
.cap-grille-fig svg { display: block; max-width: none; height: auto; }
.cap-grille-table td { vertical-align: top; min-width: 150px; }
.cap-grille-table td.cap-atteint { background: color-mix(in srgb, var(--success, #1f9d55) 12%, transparent); }
.cap-echelle-niv { display: grid; gap: 6px; margin: 8px 0; }
.cap-niv { text-align: start; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: transparent; color: inherit; cursor: pointer; }
.cap-niv:hover, .cap-niv:focus-visible { border-color: var(--brand); }
.cap-niv.atteint { border-inline-start: 4px solid var(--success, #1f9d55); }
.cap-prop { display: grid; gap: 6px; padding: 6px 10px; border-radius: 6px; background: color-mix(in srgb, var(--brand) 8%, transparent); }
.cap-prop .chip { margin-inline-end: 4px; }
.cap-aide { margin: 4px 0; }
.cap-niveau { border-inline-start: 2px solid var(--line); padding-inline-start: 8px; margin: 6px 0; }
.cap-niveau ul { margin: 4px 0; padding-inline-start: 18px; }
.cap-fiche h4 { margin-bottom: 4px; }

/* Assistant de préparation d'un programme (1.121.0) : quatre étapes, et la dernière montre ce qui
   va être créé avant de le créer. */
.pg-wiz-steps {
  display: flex; gap: .35rem; list-style: none; margin: 0 0 1rem; padding: 0;
  flex-wrap: wrap; font-size: .82rem;
}
.pg-wiz-step {
  display: flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.pg-wiz-step .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--line); color: var(--ink-2); font-size: .72rem; font-weight: 700;
}
.pg-wiz-step.cur { border-color: var(--brand); color: var(--ink); }
.pg-wiz-step.cur .n { background: var(--brand); color: #fff; }
.pg-wiz-step.done .n { background: var(--ok); color: #fff; }
.pg-wiz-recap { display: grid; gap: .25rem; margin: .5rem 0; font-size: .88rem; }

/* Les nombres du paquet. Volontairement sans anneau de progression : ce sont des quantités à créer,
   pas un avancement — un anneau vide devant « 12 chantiers » se lirait « rien de fait ». */
.pg-wiz-ns { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.pg-wiz-n {
  min-width: 5.5rem; padding: .5rem .7rem; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.pg-wiz-n .v { font-size: 1.2rem; font-weight: 700; line-height: 1.1; }
.pg-wiz-n .l { font-size: .72rem; color: var(--muted); }

/* Équipe IA — Anibal Crew (2.0.0). Cartes 2D ; l'état vient des tâches réelles, jamais d'une animation à vide. */
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 16px 0; }
/* 2.0.2 : carte verticale, l'avatar en grand au centre — c'est lui qui dit l'état, avant les pastilles. */
.crew-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px 14px 14px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.crew-card.active { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
.crew-card.masque { opacity: .55; }
.crew-card-top { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.crew-card .crew-name { font-size: 17px; }
.crew-card .crew-etat, .crew-card .crew-actions { justify-content: center; }
.crew-head { display: flex; align-items: center; gap: 10px; }
.crew-head-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.crew-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 8px; }
.crew-video { margin: 0; }
.crew-video video { width: 100%; max-height: 360px; border-radius: var(--radius-sm); background: #fff; }
/* Guides : index à gauche, article à droite ; sur mobile l'index passe au-dessus. */
.crew-guide-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .crew-guide-layout { grid-template-columns: 1fr; } }
.crew-guide-index { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; }
.crew-guide-group { display: flex; flex-direction: column; gap: 2px; }
.crew-guide-link { padding: 4px 8px; border-radius: 6px; color: inherit; text-decoration: none; font-size: 13.5px; }
.crew-guide-link:hover { background: var(--surface-2, rgba(127,127,127,.12)); }
.crew-guide-link.active { background: var(--brand); color: #fff; }
.crew-guide-body { max-width: 860px; }
.crew-guide-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.crew-guide-section { margin: 14px 0; }
.crew-guide-section h3 { margin: 12px 0 6px; }
.crew-guide-section p { line-height: 1.55; margin: 6px 0; }
.crew-guide-section ul { line-height: 1.5; padding-inline-start: 22px; }
/* Bibliothèque d'avatars (administration) */
.crew-bib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.crew-bib-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: center; }
.crew-bib-img { width: 72px; height: 72px; border-radius: 50%; background: #fff; }
.crew-pol-card { padding: 10px 12px; }

/* Présence des agents (2.1.0, refondue en 2.3.0) : des bulles séparées en bas à droite des écrans d'audit, une
   languette toujours visible, un masquage automatique, et la carte d'un agent ; puis le panneau d'Écho. */
.crew-dock { position: fixed; right: 0; bottom: 28px; z-index: 60; display: flex; flex-direction: row; align-items: flex-end; gap: 10px;
  padding: 0 12px 0 0; transition: transform .35s ease; pointer-events: none; }
.crew-dock > * { pointer-events: auto; }
.crew-dock.cache { transform: translateX(calc(100% - 40px)); }
.crew-dock.mode-masque { transform: none; }
.crew-dock-tab { order: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 32px; padding: 8px 0; border-radius: 10px 0 0 10px;
  background: var(--brand); color: #fff; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 14px; user-select: none; }
.crew-dock-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.crew-dock-tab-ico { line-height: 1; }
.crew-dock-badge { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #fff; color: var(--brand); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.crew-dock-mode { background: transparent; border: 0; color: #fff; cursor: pointer; font-size: 12px; line-height: 1; padding: 2px; opacity: .85; }
.crew-dock-mode:hover { opacity: 1; }
.crew-dock-col { order: 2; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.crew-dock.cache .crew-dock-col, .crew-dock.cache .crew-carte { visibility: hidden; transition: visibility 0s .35s; }
.crew-dock:not(.cache) .crew-dock-col { order: 1; }
.crew-dock:not(.cache) .crew-dock-tab { order: 0; }
.crew-bulle { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); padding: 2px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.22); transition: transform .2s ease, border-color .2s ease; }
.crew-bulle:hover, .crew-bulle:focus-visible { transform: translateX(-4px); border-color: var(--brand); outline: none; }
.crew-bulle.ouverte { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.crew-bulle.inactive { opacity: .8; }
.crew-bulle-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--warn, #d98c00); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.crew-bulle-badge.alerte { background: var(--danger, #c0392b); }
.crew-bulle-nom { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 2px 8px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.crew-bulle:hover .crew-bulle-nom, .crew-bulle:focus-visible .crew-bulle-nom { opacity: 1; }
.crew-bulle.coucou .crew-bulle-nom { display: none; }
.crew-bulle.coucou { border-color: var(--brand); }
/* Seul le visage s'agite : la phrase qui sort reste droite et se lit (la première version faisait tourner le tout). */
.crew-bulle.coucou .crew-avatar { animation: crew-coucou 1.1s ease-in-out 2; }
@keyframes crew-coucou { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-8px) rotate(-6deg); } 75% { transform: translateX(-8px) rotate(6deg); } }
.crew-bulle-dit { position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%); width: max-content; max-width: 260px; text-align: start; white-space: normal;
  background: var(--surface); color: var(--text); border: 1px solid var(--brand); border-radius: 12px; padding: 8px 10px; font-size: 12.5px; line-height: 1.35; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.crew-bulle-dit::after { content: ''; position: absolute; right: -7px; top: calc(50% - 6px); border: 6px solid transparent; border-left-color: var(--brand); border-right: 0; }
@media (prefers-reduced-motion: reduce) { .crew-dock { transition: none; } .crew-bulle.coucou .crew-avatar { animation: none; } .crew-bulle:hover { transform: none; } }
.crew-carte { order: 1; width: 320px; max-width: calc(100vw - 80px); border: 1px solid var(--brand); border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 10px 32px rgba(0,0,0,.3); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.crew-carte-head { display: flex; align-items: center; gap: 10px; }
.crew-carte-ligne { line-height: 1.4; }
.crew-carte-etat, .crew-carte-actions { gap: 6px; }
.crew-carte-msgs { border-top: 1px solid var(--border); padding-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.crew-msg { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; }
.crew-msg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; margin-top: 6px; }
.crew-msg.niveau-alerte .crew-msg-dot { background: var(--warn, #d98c00); }
.crew-msg.niveau-erreur .crew-msg-dot { background: var(--danger, #c0392b); }
.crew-msg-txt { flex: 1; line-height: 1.35; }
.crew-msg.lu { opacity: .65; }
.crew-messages-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.crew-messages .crew-msg { border-top: 1px solid var(--border); padding: 8px 0; }
.crew-messages .crew-msg-body { flex: 1; min-width: 0; }
.chip.danger { background: color-mix(in srgb, var(--danger, #c0392b) 18%, var(--surface)); color: var(--danger, #c0392b); }
@media (max-width: 760px) { .crew-dock { bottom: 8px; } .crew-carte { width: calc(100vw - 72px); } }
.crew-echo { position: fixed; right: 16px; bottom: 16px; width: 420px; max-width: calc(100vw - 32px); max-height: 78vh; z-index: 61; display: flex; flex-direction: column;
  border: 1px solid var(--brand); border-radius: var(--radius); background: var(--surface); box-shadow: 0 10px 32px rgba(0,0,0,.3); }
.crew-echo-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.crew-echo-body { padding: 10px 12px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.crew-echo-body h4 { margin: 8px 0 2px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.crew-echo-req { font-size: 13px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2, rgba(127,127,127,.12)); }
.crew-echo-consent { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 8px; }
.crew-echo-speaker { max-width: 160px; }
.crew-echo-type { width: 100%; }
.crew-echo-partial { min-height: 18px; font-style: italic; }
/* Le corps du panneau est une colonne flex qui défile : ses blocs ne se compriment pas. Sans `flex-shrink: 0`, la
   transcription (overflow: auto, donc hauteur minimale nulle) était écrasée à quelques pixels dès qu'elle débordait
   — signalé sur capture d'écran en production (2.5.1). */
.crew-echo-body > * { flex-shrink: 0; }
/* Voix séparées (2.6.0) : une ligne par voix — nom, comptes, rôle confirmé, nom facultatif. */
.crew-echo-voix { display: grid; gap: 6px; }
.crew-echo-voix-ligne { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; }
.crew-echo-voix-ligne select, .crew-echo-voix-ligne input { width: 100%; }
.crew-echo-voix-option { margin-top: 8px; }
.crew-echo-transcript { min-height: 72px; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; }
.crew-echo-q, .crew-echo-d { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border); font-size: 13px; }
.crew-echo-q.couverte { opacity: .6; }
.crew-echo-d.ecartee { opacity: .55; text-decoration: line-through; }
.crew-echo-slot:empty { display: none; }
.crew-echo-banner { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 10px; border: 1px solid var(--brand); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; flex-wrap: wrap; }
@media (max-width: 760px) { .crew-dock, .crew-echo { right: 8px; bottom: 8px; } }

/* Propositions de l'équipe IA (2.2.0) : le composant partagé — barre de filtres, groupes, lignes lisibles. */
.props-toolbar { display: grid; grid-template-columns: 2fr repeat(4, minmax(130px, 1fr)) auto; gap: 10px; align-items: end; margin-bottom: 8px; }
@media (max-width: 980px) { .props-toolbar { grid-template-columns: 1fr 1fr; } }
.props-toolbar .field { margin: 0; }
.props-search { width: 100%; }
.props-actions { gap: 6px; align-items: center; }
.props-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.props-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.props-group-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.props-group-body { display: flex; flex-direction: column; }
.props-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border-top: 1px solid var(--border); }
.props-group-body .props-row:first-child { border-top: 0; }
.props-list > .props-row { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.props-row.sel { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.props-spacer { width: 13px; display: inline-block; }
.props-main { min-width: 0; }
.props-libelle { font-size: 14px; line-height: 1.4; }
.props-meta { margin-top: 3px; line-height: 1.8; }
.props-count { align-self: center; }
.crew-avatar { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: var(--brand); flex: none; }
.crew-avatar.en_travail { animation: crew-pulse 1.2s ease-in-out infinite; }
@keyframes crew-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 40%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .crew-avatar.en_travail { animation: none; } }
/* Avatars tirés de la vidéo (2.0.1) : disque à fond blanc ; GRISÉ quand l'agent est inactif, net et cerclé
   quand il est actif (l'image animée est alors servie par la vue). La pastille d'initiales ne sert qu'à un
   agent sans image (Atlas, absent de la vidéo). */
.crew-avatar-img, .crew-avatar-txt { border-radius: 50%; flex: none; }
.crew-avatar-img { background: #fff; overflow: hidden; padding: 0; }
.crew-avatar-img img { width: 100%; height: 100%; display: block; border-radius: 50%; transition: filter .4s ease; }
.crew-avatar.inactif img, .crew-avatar-txt.inactif { filter: grayscale(1) opacity(.55); }
.crew-avatar.actif { box-shadow: 0 0 0 2px var(--brand); }

/* Le détail d'une proposition (2.3.0) : avant / après, champs nommés, sources ; et la ligne cliquable de la liste. */
.props-link { cursor: pointer; }
.props-link:hover, .props-link:focus-visible { text-decoration: underline; text-decoration-color: var(--brand); outline: none; }
.props-row-actions { gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.props-diff del { background: color-mix(in srgb, var(--danger, #c0392b) 16%, var(--surface)); color: inherit; text-decoration: line-through; padding: 0 3px; border-radius: 3px; }
.props-diff ins { background: color-mix(in srgb, var(--ok, #2e8b57) 18%, var(--surface)); color: inherit; text-decoration: none; padding: 0 3px; border-radius: 3px; font-weight: 600; }
.props-diff.big { font-size: 15px; line-height: 1.6; }
.prop-detail { display: flex; flex-direction: column; gap: 6px; }
.prop-detail-head { display: flex; align-items: center; gap: 12px; }
.prop-detail-libelle { font-size: 15px; line-height: 1.45; }
.prop-detail-diff { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2, rgba(127,127,127,.08)); }
.prop-detail-ctx mark { background: color-mix(in srgb, var(--brand) 25%, transparent); color: inherit; border-radius: 2px; padding: 0 2px; }
.prop-detail-dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 4px 12px; margin: 0; }
.prop-detail-dl dt { font-size: 12.5px; color: var(--muted); padding-top: 2px; }
.prop-detail-dl dd { margin: 0; min-width: 0; }
.prop-detail-dl textarea { width: 100%; }
.prop-detail-val { white-space: pre-wrap; word-break: break-word; }
.prop-detail-val del { opacity: .7; }
.prop-detail-val ins { text-decoration: none; font-weight: 600; }
.mt-xs { margin-top: 4px; }
@media (max-width: 760px) { .prop-detail-dl { grid-template-columns: 1fr; } }
.crew-fiche-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.crew-presentation { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 8px 12px; margin-top: 10px; }
.crew-presentation summary { cursor: pointer; font-weight: 600; }
.crew-presentation video { width: 100%; max-height: 440px; margin-top: 8px; border-radius: var(--radius-sm); background: #fff; }
.crew-name { font-weight: 700; }
.crew-spec { font-size: 12px; color: var(--muted); }
.crew-etat { font-size: 11px; display: flex; gap: 6px; flex-wrap: wrap; }
.crew-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.crew-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* Le sélecteur de mission se dimensionne sur sa plus longue option (référence + titre) : borné, sinon
   il déborde du contenu et fait apparaître une barre de défilement horizontale. */
.crew-bar .field { flex: 1 1 320px; min-width: 0; }
.crew-bar .field select { width: 100%; max-width: 100%; }
.crew-stop { border: 1px solid #f2c4c7; background: #fbe5e6; color: #a32229; border-radius: 6px; padding: 8px 12px; font-size: 12.5px; display: flex; gap: 10px; align-items: center; }
.crew-fiche dt { font-weight: 600; margin-top: 8px; }
.crew-fiche dd { margin: 2px 0 0; }
.crew-props { margin-top: 14px; }
.crew-prop { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 6px 0; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.crew-prop .mono { font-size: 11px; }
.crew-cite { font-size: 11.5px; color: var(--muted); border-inline-start: 3px solid var(--line); padding-inline-start: 8px; margin-top: 4px; }
.crew-pol { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
@media (max-width: 760px) { .crew-pol { grid-template-columns: 1fr; } }

/* Cohérence d'un constat relue par Prisma pendant la saisie (2.5.0) : l'état, les alertes, l'aperçu avant / après.
   Un résultat en cours de relecture est estompé — jamais présenté comme actuel. */
.crew-coherence-slot:empty { display: none; }
.coh { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 8px 10px; margin: 12px 0; font-size: 13px; }
.coh-tete { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.coh-perime .coh-alerte { opacity: .5; }
.coh-note { margin-top: 6px; }
.coh-alerte { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; display: grid; gap: 4px; }
.coh-extrait { display: block; width: 100%; text-align: start; font: inherit; color: inherit; background: none; border: 0; border-inline-start: 3px solid var(--caution-border); padding: 2px 8px; cursor: pointer; white-space: pre-wrap; word-break: break-word; }
.coh-extrait:hover, .coh-extrait:focus-visible { background: var(--caution-soft); }
.coh-extrait mark { background: var(--caution-soft); color: inherit; font-weight: 600; }
.coh-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.coh-apercu { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 6px 8px; margin-top: 4px; }
.coh-diff { white-space: pre-wrap; word-break: break-word; display: grid; gap: 2px; margin-top: 4px; }
.coh-diff del { background: var(--error-soft); }
.coh-diff ins { background: var(--success-soft); text-decoration: none; font-weight: 600; }
.coh-champ { outline: 2px solid var(--caution); outline-offset: 1px; }

/* 2.14.0 : analyses de risques multi-méthodes */
.rk-groupe { margin-bottom: 16px; }
.rk-groupe h4 { margin: 8px 0; }
.rk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.rk-meth .card-b { display: grid; gap: 8px; }
.rk-onglets { gap: 6px; margin: 10px 0 16px; }
.rk-actions select { width: auto; min-width: 150px; }
.rk-etape { margin-bottom: 12px; }
.rk-etape h3 { font-size: 1.05em; margin: 0; }
.rk-saisie td { vertical-align: top; min-width: 120px; }
.rk-saisie td input, .rk-saisie td select, .rk-saisie td textarea { width: 100%; min-width: 110px; }
.rk-saisie td.rk-calc { font-weight: 600; white-space: nowrap; }
.rk-fig { margin: 0; padding: 8px; border-radius: var(--radius-sm); background: var(--chart-bg); color: var(--chart-text); overflow-x: auto; }
.rk-fig svg { display: block; max-width: none; height: auto; }

/* 2.15.x : premiers pas sur l'accueil */
.ob-etapes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.ob-etapes li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ob-etapes li.fait { opacity: .7; }
.ob-etapes .ob-ico { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ob-etapes li.fait .ob-ico { background: var(--ok); border-color: var(--ok); color: #fff; }
.ob-etapes .ob-txt { flex: 1; min-width: 0; }

/* Vue d'entreprise des risques (2.17.0) : la classe porte toujours son libellé, la couleur ne fait que doubler */
.rke-cls { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); white-space: nowrap; }
.rke-critique { background: var(--error-soft); color: var(--error-text); border-color: var(--error-border); }
.rke-eleve { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); }
.rke-modere { background: var(--info-soft); color: var(--info-text); border-color: var(--info-border); }
.rke-faible { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); }
.rke-non_calculable { color: var(--text-muted); }
.rke-heat td.rke-cell { font-weight: 600; text-align: center; }

/* Surveillance continue (2.17.0) */
.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sv-carte .card-b { padding: 12px 14px; }
.sv-histo td, .sv-histo th { text-align: center; }
.ti-q { padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.ti-q .row { margin-top: 6px; }


/* Assistant générique (2.19.0) : stepper partagé avec celui des programmes, pied à droite. */
.wiz-page .wiz-body { min-height: 240px; }
.wiz-foot { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.wiz-steps .pg-wiz-step[data-step] { user-select: none; }
.pick.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--primary-soft); }

/* Arbre de sélection d'exigences. */
.seltree-bar { gap: 10px; margin-bottom: .5rem; align-items: center; }
.seltree-body { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .25rem .5rem; background: var(--surface); }
.seltree-chapter { margin: .15rem 0 .15rem calc(var(--prof, 0) * 0); }
.seltree-head { display: flex; align-items: center; gap: .4rem; padding: .25rem 0; }
.seltree-head .check { display: inline-flex; align-items: center; gap: .3rem; }
.seltree-toggle { width: 1.6rem; padding: 0; }
.seltree-children { margin-inline-start: 1.6rem; border-inline-start: 1px dashed var(--line); padding-inline-start: .5rem; }
.seltree-req { padding: .15rem 0; }
.seltree-req .check { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.seltree-count { margin-inline-start: auto; }

/* Assistant de référentiel : profils, mapping, paragraphes. */
.refwiz-profils .pick.on { background: var(--primary-soft); }
.refwiz-mapping td { vertical-align: top; }
.refwiz-conf { min-width: 160px; }
.refwiz-conf .progress { height: 6px; margin-bottom: 3px; }
.refwiz-paras { display: grid; gap: .35rem; max-height: 60vh; overflow: auto; }
.refwiz-para { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .4rem .6rem; background: var(--surface); }
.refwiz-para.role-chapter { border-inline-start: 4px solid var(--brand); }
.refwiz-para.role-requirement { border-inline-start: 4px solid var(--ok); }
.refwiz-para.role-ignore { opacity: .6; }
.refwiz-para-ctl { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .25rem; }
.refwiz-para-txt { white-space: pre-wrap; }
.refwiz-preview ul { columns: 2; margin: .25rem 0; padding-inline-start: 1.2rem; }
.ref-derived summary { cursor: pointer; }


/* Droits d'usage par organisation (2.20.0). */
.dro-modules { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0; }
.dro-module { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); cursor: pointer; font-size: .85rem; }
.dro-module.on { border-color: var(--brand); background: var(--primary-soft); }
.dro-module.hors { opacity: .45; cursor: not-allowed; }
.dro-refs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .2rem .8rem; max-height: 40vh; overflow: auto; }
.dro-corps { margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--line); }


/* Assistants de variante (2.21.0). */
.var-gabarit { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .3rem .6rem; margin: .3rem 0; }
.var-gabarit summary { cursor: pointer; }
.var-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .15rem .8rem; margin-top: .3rem; }

/* Assistants d'audit de code et d'architecture, dossier d'architecture (2.22.0). */
.tw-zone { margin: .75rem 0 1rem; }
.tw-drop { padding: 1rem; }
.tw-files { list-style: none; margin: .4rem 0 0; padding: 0; }
.tw-files li { display: flex; align-items: center; gap: .6rem; padding: .25rem .4rem; border-bottom: 1px dashed var(--line); }
.tw-schema { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem; }
.tw-schema img { max-width: 100%; height: auto; display: block; }
