/* ==========================================================================
   SkyNet Suivi — système de design « Salle de contrôle du chantier »
   Prototype statique. Jetons dérivés de la charte LABOR CONTROL (nuit, signal,
   ambre, craie). Thème sombre par défaut (instrument), thème « plein jour »
   pour le chantier au soleil. Aucune dépendance.
   ========================================================================== */

/* ---------- 1. Polices (OFL, servies localement) ---------- */
@font-face {
  font-family: "Archivo SN";
  src: url("../fonts/archivo-variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono SN";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono SN";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}

/* ---------- 2. Jetons : voir ../tokens/skynet-tokens.css (chargé avant ce fichier) ---------- */

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--police);
  font-size: var(--t-corps);
  line-height: 1.55;
  color: var(--texte);
  background: var(--lueur-fond), var(--fond);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
body::after { /* grain d'écran d'instrument (sombre uniquement) */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-stretch: var(--large); letter-spacing: -0.02em; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { flex-shrink: 0; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--sur-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.mono { font-family: var(--police-mono); font-feature-settings: "zero" 1; }
.chiffres { font-variant-numeric: tabular-nums; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 14px; border-radius: var(--r-2); background: var(--accent); color: var(--sur-accent); font-weight: 600; }
.evitement:focus { top: 12px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-16 { width: 16px; height: 16px; }
.ic-14 { width: 14px; height: 14px; }

/* ---------- 4. Coquille : latéral, barre, navigation du bas ---------- */
.app { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
.lateral { display: none; }
.colonne { min-width: 0; display: flex; flex-direction: column; }
.contenu { width: 100%; max-width: 1200px; margin: 0 auto; padding: var(--e-4) var(--e-4) calc(96px + env(safe-area-inset-bottom)); }

.barre {
  position: sticky; top: 0; z-index: var(--z-barre);
  height: 60px; display: flex; align-items: center; gap: var(--e-3);
  padding: 0 var(--e-4);
  background: var(--surface-verre);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--trait);
  view-transition-name: barre;
}
.barre-projet { display: flex; align-items: center; gap: 10px; min-width: 0; }
.barre-projet img { width: 30px; height: 30px; }
.barre-projet .nom { font-weight: 700; font-stretch: 108%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-projet .code { font-family: var(--police-mono); font-size: 11px; color: var(--texte-3); letter-spacing: 0.08em; }
.fil-ariane { display: none; align-items: center; gap: 8px; font-size: var(--t-petit); color: var(--texte-3); min-width: 0; }
.fil-ariane strong { color: var(--texte); font-weight: 600; }
.barre-espace { flex: 1; }
.recherche { display: none; position: relative; }
.recherche input {
  width: 300px; height: 40px; padding: 0 44px 0 38px; border-radius: var(--r-2);
  border: 1px solid var(--trait-fort); background: var(--surface-2); color: var(--texte); font: inherit; font-size: var(--t-petit);
  transition: border-color var(--d-2), box-shadow var(--d-2), width var(--d-3) var(--c-sortie);
}
.recherche input::placeholder { color: var(--texte-3); }
.recherche input:focus { outline: none; border-color: var(--accent); box-shadow: var(--lueur); width: 360px; }
.recherche .ic { position: absolute; left: 12px; top: 10px; color: var(--texte-3); }
.recherche kbd { position: absolute; right: 10px; top: 9px; font-family: var(--police-mono); font-size: 11px; color: var(--texte-3); border: 1px solid var(--trait-fort); border-radius: 5px; padding: 1px 6px; }

.btn-icone {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-2);
  border: 1px solid transparent; background: transparent; color: var(--texte-2); cursor: pointer;
  transition: background var(--d-2), color var(--d-2), transform var(--d-1);
}
.btn-icone:hover { background: var(--surface-2); color: var(--texte); }
.btn-icone:active { transform: scale(0.94); }
.pastille-compte {
  position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--feu-rouge); color: #fff; font-family: var(--police-mono); font-size: 10.5px; font-weight: 600; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.pastille-compte.rebond { animation: rebond 620ms var(--c-ressort); }

.nav-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface-verre); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border-top: 1px solid var(--trait);
  view-transition-name: nav-bas;
}
.nav-bas a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 64px; font-size: 11.5px; font-weight: 500; color: var(--texte-3);
  transition: color var(--d-2);
}
.nav-bas a[aria-current="page"] { color: var(--accent); }
.nav-bas a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  view-transition-name: nav-bas-indicateur;
}
.nav-bas .nav-creer { align-self: center; justify-self: center; }
.nav-creer span {
  display: grid; place-items: center; width: 52px; height: 52px; margin-top: -18px; border-radius: 16px;
  background: var(--accent); color: var(--sur-accent); box-shadow: 0 8px 24px -8px var(--accent), 0 0 0 4px var(--fond);
}

/* Latéral (bureau) */
@media (min-width: 1024px) {
  .app { grid-template-columns: 264px 1fr; }
  .lateral {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: var(--e-5);
    padding: var(--e-5) var(--e-4); background: var(--surface); border-right: 1px solid var(--trait);
    view-transition-name: lateral;
  }
  .nav-bas { display: none; }
  .barre { height: 68px; padding: 0 var(--e-6); }
  .barre-projet { display: none; }
  .fil-ariane { display: flex; }
  .recherche { display: block; }
  .contenu { padding: var(--e-6) var(--e-6) var(--e-8); }
}
.marque { display: flex; align-items: center; gap: 12px; padding: 0 var(--e-2); }
.marque img { width: 36px; height: 36px; }
.marque-nom { font-weight: 750; font-stretch: 112%; font-size: 1.05rem; letter-spacing: -0.02em; line-height: 1.1; }
.marque-sous { font-family: var(--police-mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--texte-3); text-transform: uppercase; }
.projet-courant {
  display: block; padding: var(--e-3) var(--e-4); border-radius: var(--r-3); background: var(--surface-2); box-shadow: var(--ombre-1);
  position: relative; overflow: hidden;
}
.projet-courant::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, var(--accent-doux), transparent 55%); pointer-events: none; }
.projet-courant .code { font-family: var(--police-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.12em; }
.projet-courant .nom { display: block; font-weight: 700; font-stretch: 110%; font-size: 1.05rem; margin-top: 2px; }
.projet-courant .lieu { font-size: 12.5px; color: var(--texte-3); }
.nav-lat { display: flex; flex-direction: column; gap: 2px; }
.nav-lat-titre { font-family: var(--police-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--texte-3); padding: 0 var(--e-3); margin: var(--e-2) 0 var(--e-1); }
.nav-lat a {
  position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 var(--e-3); border-radius: var(--r-2);
  color: var(--texte-2); font-weight: 500; font-size: 0.95rem; transition: background var(--d-2), color var(--d-2);
}
.nav-lat a:hover { background: var(--surface-2); color: var(--texte); }
.nav-lat a[aria-current="page"] { background: var(--accent-doux); color: var(--texte); }
.nav-lat a[aria-current="page"]::before {
  content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); box-shadow: 0 0 14px var(--accent);
  view-transition-name: nav-indicateur;
}
.nav-lat a[aria-current="page"] .ic { color: var(--accent); }
.nav-lat .compte { margin-left: auto; font-family: var(--police-mono); font-size: 11.5px; color: var(--texte-3); }
.nav-lat .compte.alerte { color: var(--txt-rouge); }
.portefeuille a { height: auto; padding: 8px var(--e-3); align-items: flex-start; flex-direction: column; gap: 4px; }
.portefeuille .p-nom { font-size: 0.9rem; color: var(--texte); }
.portefeuille a[aria-current="true"] { background: var(--surface-2); }
.portefeuille .p-feux { display: flex; gap: 10px; font-family: var(--police-mono); font-size: 11px; color: var(--texte-3); }
.portefeuille .p-feux i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.lateral-pied { margin-top: auto; display: flex; flex-direction: column; gap: var(--e-3); }
.veille { display: flex; align-items: center; gap: 10px; padding: 10px var(--e-3); border-radius: var(--r-2); background: var(--surface-2); font-size: 12.5px; color: var(--texte-2); box-shadow: var(--ombre-1); }
.veille small { display: block; font-family: var(--police-mono); font-size: 10.5px; color: var(--texte-3); }
.utilisateur { display: flex; align-items: center; gap: 10px; padding: 0 var(--e-2); font-size: 13px; color: var(--texte-2); }
.utilisateur strong { display: block; color: var(--texte); font-weight: 600; }

/* ---------- 5. Primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: var(--r-2); border: 1px solid transparent; font-weight: 600; font-size: 0.94rem; cursor: pointer; white-space: nowrap;
  transition: background var(--d-2), border-color var(--d-2), box-shadow var(--d-2), color var(--d-2), transform var(--d-1) var(--c-standard);
}
.btn:active { transform: scale(0.97); }
.btn-primaire { background: var(--accent); color: var(--sur-accent); }
.btn-primaire:hover { background: var(--accent-vif); box-shadow: var(--lueur); }
.btn-secondaire { background: var(--surface-2); color: var(--texte); border-color: var(--trait-fort); }
.btn-secondaire:hover { border-color: var(--accent-trait); background: var(--surface-3); }
.btn-fantome { background: transparent; color: var(--texte-2); }
.btn-fantome:hover { background: var(--surface-2); color: var(--texte); }
.btn-petit { height: 36px; padding: 0 12px; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
@media (pointer: coarse) { .btn-petit { height: 44px; } }

.surtitre { font-family: var(--police-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.surtitre.alerte { color: var(--alerte); }
.titre-section { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e-3); margin-bottom: var(--e-4); }
.titre-section h2 { font-size: var(--t-h2); font-weight: 720; margin-top: 4px; }
.lien-voir { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-petit); font-weight: 600; color: var(--accent); white-space: nowrap; min-height: 44px; }
.lien-voir:hover { text-decoration: underline; text-underline-offset: 4px; }

.carte { background: var(--surface); border-radius: var(--r-4); box-shadow: var(--ombre-1); padding: var(--e-4); }
@media (min-width: 640px) { .carte { padding: var(--e-5); } }

.puce {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-pilule);
  border: 1px solid var(--trait-fort); background: transparent; color: var(--texte-2); font-size: 0.875rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--d-2), border-color var(--d-2), color var(--d-2), transform var(--d-1);
}
.puce:hover { border-color: var(--accent-trait); color: var(--texte); }
.puce:active { transform: scale(0.96); }
.puce[aria-pressed="true"] { background: var(--accent-doux); border-color: var(--accent); color: var(--texte); }
.puce .n { font-family: var(--police-mono); font-size: 11.5px; color: var(--texte-3); }
.puce[aria-pressed="true"] .n { color: var(--accent); }
@media (pointer: coarse) { .puce { height: 44px; } }

.segment { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 12px; background: var(--surface-2); box-shadow: var(--ombre-1); }
.segment button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; color: var(--texte-2); font-weight: 600; font-size: 0.875rem; transition: color var(--d-2); }
.segment button[aria-pressed="true"] { color: var(--texte); }
.segment-curseur { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; border-radius: 9px; background: var(--surface); box-shadow: var(--ombre-2), 0 0 0 1px var(--accent-trait); transition: transform var(--d-3) var(--c-sortie), width var(--d-3) var(--c-sortie); }
@media (pointer: coarse) { .segment button { height: 40px; } }

.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--surface-3); color: var(--texte); font-family: var(--police-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em;
}
.avatar.lc { background: var(--accent-doux); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-trait); }
.role { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--trait-fort); font-family: var(--police-mono); font-size: 10.5px; font-weight: 500; color: var(--texte-2); }

/* ---------- 6. Composants métier ---------- */

/* Gravité : forme + couleur + libellé */
.gravite { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 6px; border-radius: var(--r-1); font-size: 12.5px; font-weight: 650; font-stretch: 94%; white-space: nowrap; }
.gravite svg { width: 14px; height: 14px; }
.gravite-bloquant { background: var(--fond-rouge); color: var(--txt-rouge); }
.gravite-bloquant svg { color: var(--feu-rouge); }
.gravite-majeur { background: var(--fond-orange); color: var(--txt-orange); }
.gravite-majeur svg { color: var(--feu-orange); }
.gravite-mineur { background: var(--fond-gris); color: var(--txt-gris); }
.gravite-mineur svg { color: var(--feu-gris); }

/* Feu tricolore : une lampe ronde, un pictogramme, un libellé */
.feu { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texte-2); }
.feu-lampe {
  --c: var(--feu-gris);
  position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c); color: var(--sur-feu);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent), 0 0 14px -2px color-mix(in srgb, var(--c) 70%, transparent);
  transition: background-color var(--d-4) var(--c-standard), box-shadow var(--d-4) var(--c-standard);
}
.feu-lampe svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.feu-lampe::after { /* onde au changement d'état */
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; pointer-events: none;
}
.feu-lampe.change::after { animation: onde 900ms var(--c-sortie); }
.feu-lampe.change { animation: rebond 700ms var(--c-ressort); }
[data-feu="vert"] .feu-lampe, .feu-lampe[data-feu="vert"] { --c: var(--feu-vert); }
[data-feu="orange"] .feu-lampe, .feu-lampe[data-feu="orange"] { --c: var(--feu-orange); }
[data-feu="rouge"] .feu-lampe, .feu-lampe[data-feu="rouge"] { --c: var(--feu-rouge); }
[data-feu="gris"] .feu-lampe, .feu-lampe[data-feu="gris"] {
  --c: transparent; color: var(--feu-gris); box-shadow: none; background: transparent;
}
[data-feu="gris"] .feu-lampe svg { width: 22px; height: 22px; stroke-width: 2; }
[data-feu="orange"] .feu-lampe.attente::before { /* respiration discrète : en attente d'une action */
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--feu-orange); animation: respire 2.6s ease-in-out infinite;
}

/* Cycle de vie : un rail plutôt qu'une pastille de couleur */
.cycle-mini { display: inline-flex; gap: 2px; vertical-align: middle; }
.cycle-mini i { width: 12px; height: 4px; border-radius: 2px; background: var(--surface-3); transition: background var(--d-3); }
.cycle-mini i.fait { background: var(--accent); }
.cycle-mini i.courant { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.cycle-mini.ferme i { background: var(--feu-vert); box-shadow: none; }
.statut { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texte-2); white-space: nowrap; }

.cycle { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); margin-top: var(--e-5); }
.cycle::before, .cycle-avance {
  content: ""; position: absolute; left: 10%; right: 10%; top: 9px; height: 2px; background: var(--surface-3); border-radius: 2px;
}
.cycle-avance { background: linear-gradient(90deg, var(--accent-profond), var(--accent)); transform-origin: left; transform: scaleX(var(--p, 0)); box-shadow: 0 0 10px var(--accent); transition: transform 900ms var(--c-sortie); }
.cycle-etape { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 11.5px; color: var(--texte-3); line-height: 1.25; }
.cycle-etape .point { width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--trait-fort); display: grid; place-items: center; transition: border-color var(--d-3), background var(--d-3); }
.cycle-etape.fait .point { border-color: var(--accent); background: var(--accent); color: var(--sur-accent); }
.cycle-etape.fait .point svg { width: 12px; height: 12px; stroke-width: 3; }
.cycle-etape.courant { color: var(--texte); font-weight: 600; }
.cycle-etape.courant .point { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 5px var(--accent-doux), 0 0 18px var(--accent); }
.cycle-etape.courant .point::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cycle-etape.arrive .point { animation: rebond 700ms var(--c-ressort); }
@media (max-width: 639px) {
  .cycle-etape span.l { display: none; }
  .cycle-etape.courant span.l { display: block; position: absolute; top: 28px; white-space: nowrap; }
  .cycle { margin-bottom: 20px; }
}

/* Échéance */
.echeance { display: inline-flex; align-items: center; gap: 6px; font-family: var(--police-mono); font-size: 12.5px; color: var(--texte-2); white-space: nowrap; }
.echeance.retard { color: var(--txt-rouge); }
.echeance.proche { color: var(--txt-orange); }

/* Bandeau SkyNet : l'assistant au travail */
.skynet {
  position: relative; overflow: hidden; border-radius: var(--r-4); padding: var(--e-4);
  background: linear-gradient(135deg, var(--accent-doux), transparent 60%), var(--surface);
  box-shadow: var(--ombre-1), inset 0 0 0 1px var(--accent-trait);
}
@media (min-width: 640px) { .skynet { padding: var(--e-5); } }
.skynet::before { /* trame fine de relevé */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.9;
  background-image: linear-gradient(to right, var(--trame) 1px, transparent 1px), linear-gradient(to bottom, var(--trame) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(90deg, #000 0, transparent 70%); mask-image: linear-gradient(90deg, #000 0, transparent 70%);
}
.skynet::after { /* ligne de balayage pendant l'analyse */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40%; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent, var(--accent-doux) 70%, rgba(34, 211, 238, 0.28) 100%);
}
.skynet[data-etat="analyse"]::after { opacity: 1; animation: balayage 2.8s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.skynet-tete { position: relative; display: flex; gap: var(--e-4); align-items: center; }
.skynet-corps { min-width: 0; flex: 1; }
.skynet-titre { font-size: 1.2rem; font-weight: 740; margin-top: 2px; }
.skynet-titre .n { color: var(--accent); }
.skynet-journal { position: relative; height: 22px; margin-top: 6px; overflow: hidden; font-family: var(--police-mono); font-size: 12.5px; color: var(--texte-2); }
.skynet-journal span { position: absolute; inset: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skynet-journal span.entre { animation: ligne-entre 380ms var(--c-sortie) 140ms both; }
.skynet-journal span.sort { animation: ligne-sort 180ms var(--c-entree) both; }
.skynet-progression { height: 3px; margin-top: 10px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.skynet-progression span { display: block; height: 100%; width: 100%; background: var(--accent); box-shadow: 0 0 10px var(--accent); transform-origin: left; transform: scaleX(0); }
.skynet[data-etat="pret"] .skynet-progression { display: none; }
.skynet-actions-tete { display: none; }
@media (min-width: 900px) { .skynet-actions-tete { display: flex; gap: 8px; } }

/* Radar : signature visuelle de la veille */
.radar {
  position: relative; flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 30%, var(--accent-trait) 30.5% 31.5%, transparent 32% 62%, var(--accent-trait) 62.5% 63.5%, transparent 64%),
    radial-gradient(circle, var(--accent-doux), transparent 70%);
  box-shadow: inset 0 0 0 1px var(--accent-trait), 0 0 24px -6px var(--accent);
}
.radar::before { /* aiguille de balayage */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 290deg, rgba(34, 211, 238, 0.05) 300deg, rgba(34, 211, 238, 0.55) 358deg, var(--accent) 360deg);
  animation: tourne 2.4s linear infinite;
}
.radar::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.skynet[data-etat="pret"] .radar::before { animation-duration: 7s; opacity: 0.55; }
.radar .blip { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--alerte); box-shadow: 0 0 10px var(--alerte); opacity: 0; transform: scale(0); }
.skynet[data-etat="pret"] .radar .blip { opacity: 1; transform: scale(1); transition: transform 600ms var(--c-ressort), opacity 200ms; }
.skynet[data-etat="pret"] .radar .blip:nth-child(2) { transition-delay: 140ms; }
.skynet[data-etat="pret"] .radar .blip:nth-child(3) { transition-delay: 280ms; }
.radar-mini { width: 22px; height: 22px; box-shadow: inset 0 0 0 1px var(--accent-trait); }
.radar-mini::before { animation-duration: 3.6s; }
.radar-mini::after { width: 3px; height: 3px; margin: -1.5px; }

.propositions { position: relative; display: grid; gap: var(--e-3); margin-top: var(--e-4); }
@media (min-width: 900px) { .propositions { grid-template-columns: repeat(3, 1fr); } }
.proposition {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: var(--e-4); border-radius: var(--r-3);
  background: var(--surface-2); box-shadow: var(--ombre-1);
}
.proposition::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--alerte); }
.proposition.haute::before { background: var(--feu-rouge); }
.proposition h3 { font-size: 0.98rem; font-weight: 680; font-stretch: 104%; letter-spacing: -0.01em; line-height: 1.3; }
.proposition p { font-size: 13.5px; color: var(--texte-2); line-height: 1.45; }
.proposition .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-family: var(--police-mono); font-size: 11px; color: var(--texte-3); }
.confiance { display: inline-flex; align-items: center; gap: 3px; }
.confiance i { width: 4px; height: 10px; border-radius: 1px; background: var(--surface-3); }
.confiance i.on { background: var(--accent); }
.proposition .actions { display: flex; gap: 8px; margin-top: auto; }
.proposition.validee { animation: valide 520ms var(--c-sortie) forwards; }
.skynet-moa { display: grid; gap: 8px; margin-top: var(--e-4); }
@media (min-width: 900px) { .skynet-moa { grid-template-columns: repeat(3, 1fr); } }
.fait-skynet { display: flex; gap: 12px; align-items: flex-start; padding: var(--e-3) var(--e-4); border-radius: var(--r-3); background: var(--surface-2); box-shadow: var(--ombre-1); font-size: 14px; color: var(--texte-2); }
.fait-skynet strong { color: var(--texte); font-size: 1.6rem; font-stretch: 112%; font-weight: 760; line-height: 1; display: block; margin-bottom: 4px; }

/* Héros du projet */
.hero { position: relative; overflow: hidden; border-radius: var(--r-4); padding: var(--e-5) var(--e-4); background: var(--surface); box-shadow: var(--ombre-1); }
.hero::before { /* trame technique, fondue */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, var(--trame) 1px, transparent 1px), linear-gradient(to bottom, var(--trame) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(120% 90% at 0% 0%, #000 20%, transparent 75%); mask-image: radial-gradient(120% 90% at 0% 0%, #000 20%, transparent 75%);
}
.hero::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; top: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 65%); pointer-events: none; }
.hero-grille { position: relative; z-index: 1; display: grid; gap: var(--e-5); grid-template-areas: "id" "arret" "depuis"; }
.hero-id { grid-area: id; } .hero-depuis { grid-area: depuis; } .hero-grille > .arret { grid-area: arret; }
@media (min-width: 1100px) { .hero { padding: var(--e-6); } .hero-grille { grid-template-columns: 1.25fr 1fr; grid-template-areas: "id arret" "depuis arret"; align-items: start; row-gap: 0; } .hero-grille > .arret { align-self: stretch; } }
.hero h1 { font-size: var(--t-hero); font-weight: 820; font-stretch: 122%; letter-spacing: -0.035em; line-height: 0.98; margin-top: 10px; }
.hero-phase { margin-top: 12px; font-size: 1.02rem; color: var(--texte-2); max-width: 46ch; }
.hero-phase strong { color: var(--texte); font-weight: 600; }
.voir-comme { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: var(--e-5); font-size: 12.5px; color: var(--texte-3); }
.depuis { margin-top: 0; }
@media (min-width: 1100px) { .depuis { margin-top: var(--e-5); } }
.depuis-titre { font-size: 13px; color: var(--texte-3); margin-bottom: 10px; }
.depuis-titre strong { color: var(--texte-2); font-weight: 600; }
.depuis-liste { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .depuis-liste { grid-template-columns: repeat(4, 1fr); } }
.depuis-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r-3); background: var(--surface-2); box-shadow: var(--ombre-1); }
.depuis-item b { font-size: 1.5rem; font-weight: 760; font-stretch: 112%; line-height: 1.05; }
.depuis-item span { font-size: 12.5px; color: var(--texte-2); line-height: 1.3; }

.arret { position: relative; display: flex; flex-direction: column; gap: var(--e-3); padding: var(--e-4) var(--e-4) var(--e-4); border-radius: var(--r-3); background: var(--surface-2); box-shadow: var(--ombre-2); }
@media (min-width: 640px) { .arret { padding: var(--e-5); } }
.arret-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.arret-tete .surtitre { display: inline-flex; align-items: center; gap: 6px; }
.arret h2 { font-size: 1.15rem; font-weight: 720; }
.compte-rebours { display: flex; align-items: baseline; gap: 14px; }
.compte-rebours .j { font-size: clamp(3rem, 2.4rem + 2.6vw, 4.4rem); font-weight: 840; font-stretch: 125%; letter-spacing: -0.04em; line-height: 0.9; }
.compte-rebours .j em { font-style: normal; color: var(--texte-3); font-weight: 600; }
.compte-rebours p { font-size: 13.5px; color: var(--texte-2); line-height: 1.35; }
.jauge { display: grid; grid-template-columns: repeat(var(--n, 8), 1fr); gap: 3px; }
.jauge a { position: relative; height: 26px; border-radius: 4px; background: var(--surface-3); transform-origin: bottom; }
.jauge a:first-child { border-radius: 7px 4px 4px 7px; }
.jauge a:last-child { border-radius: 4px 7px 7px 4px; }
.jauge a.leve { background: var(--feu-vert); }
.jauge a.reste { background: var(--fond-rouge); box-shadow: inset 0 -3px 0 var(--feu-rouge); }
.jauge a:hover, .jauge a:focus-visible { filter: brightness(1.2); outline-offset: 2px; }
.js .jauge a { transform: scaleY(0.2); opacity: 0; }
.js .jauge.vu a { transform: none; opacity: 1; transition: transform 520ms var(--c-ressort), opacity 200ms; transition-delay: calc(var(--i) * 70ms + 200ms); }
.jauge-legende { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--texte-2); }
.jauge-legende b { color: var(--texte); }

/* Tuiles d'indicateurs */
.tuiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--e-3); }
@media (min-width: 1100px) { .tuiles { grid-template-columns: repeat(4, 1fr); gap: var(--e-4); } }
.tuile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: var(--e-4); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ombre-1); min-width: 0; }
.tuile-libelle { font-size: 13px; color: var(--texte-2); }
.tuile-valeur { font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.6rem); font-weight: 780; font-stretch: 112%; letter-spacing: -0.03em; line-height: 1.05; }
.tuile-valeur small { font-size: 0.5em; color: var(--texte-3); font-weight: 600; letter-spacing: 0; margin-left: 2px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-family: var(--police-mono); font-size: 11.5px; color: var(--texte-3); }
.delta.bon { color: var(--txt-vert); }
.delta.mauvais { color: var(--txt-rouge); }
.delta svg { width: 12px; height: 12px; }
.sparkline { width: 100%; height: 38px; margin-top: 6px; overflow: visible; }
.sparkline .trace { fill: none; stroke: var(--texte-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sparkline .aire { fill: var(--accent); opacity: 0.08; }
.sparkline .fin { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.sparkline .reticule { stroke: var(--trait-fort); stroke-width: 1; }
.js .sparkline .trace { stroke-dasharray: var(--l); stroke-dashoffset: var(--l); }
.js .vu .sparkline .trace { stroke-dashoffset: 0; transition: stroke-dashoffset 1100ms var(--c-sortie) 250ms; }
.bulle {
  position: fixed; z-index: var(--z-bulle); pointer-events: none; max-width: 280px; padding: 10px 12px; border-radius: var(--r-2);
  background: var(--surface-3); color: var(--texte); box-shadow: var(--ombre-2); font-size: 13px; line-height: 1.4;
  opacity: 0; transform: translateY(4px); transition: opacity var(--d-2), transform var(--d-2) var(--c-sortie);
}
.bulle.visible { opacity: 1; transform: none; }
.bulle b { display: block; font-size: 15px; }
.bulle .sec { color: var(--texte-2); font-size: 12.5px; }
.bulle .ligne-cle { display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: 3px; border-radius: 1px; }

/* Grilles de page */
.grille { display: grid; gap: var(--e-4); }
@media (min-width: 1100px) { .grille { grid-template-columns: repeat(12, 1fr); gap: var(--e-5); } .s7 { grid-column: span 7; } .s5 { grid-column: span 5; } .s12 { grid-column: span 12; } }
.pile { display: flex; flex-direction: column; gap: var(--e-4); }
@media (min-width: 1024px) { .pile { gap: var(--e-5); } }

/* Synthèse des feux */
.barre-feux { display: flex; gap: 2px; height: 14px; margin: 6px 0 14px; }
.barre-feux span { flex-grow: var(--n); flex-basis: 0; min-width: 0; height: 100%; transition: flex-grow 700ms var(--c-sortie); }
.barre-feux span:first-child { border-radius: 7px 2px 2px 7px; }
.barre-feux span:last-child { border-radius: 2px 7px 7px 2px; }
.barre-feux [data-feu="vert"] { background: var(--feu-vert); }
.barre-feux [data-feu="orange"] { background: var(--feu-orange); }
.barre-feux [data-feu="rouge"] { background: var(--feu-rouge); }
.barre-feux [data-feu="gris"] { background: repeating-linear-gradient(135deg, var(--surface-3) 0 4px, transparent 4px 7px); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.legende-feux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.legende-feux .feu { justify-content: flex-start; }
.legende-feux .feu b { margin-left: auto; }
.legende-feux .feu b { color: var(--texte); font-size: 1.05rem; font-weight: 720; margin-left: 2px; }
.feux-intervenants { margin-top: var(--e-4); display: grid; gap: 2px; }
.fi-ligne { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--trait); font-size: 14px; }
.fi-points { display: flex; gap: 5px; }
.fi-points i { width: 12px; height: 12px; border-radius: 50%; }
.fi-points i[data-feu="vert"] { background: var(--feu-vert); }
.fi-points i[data-feu="orange"] { background: var(--feu-orange); }
.fi-points i[data-feu="rouge"] { background: var(--feu-rouge); }
.fi-points i[data-feu="gris"] { box-shadow: inset 0 0 0 1.5px var(--feu-gris); }

/* Liste de sujets compacte (priorités) */
.liste-sujets { display: flex; flex-direction: column; }
.sujet-court { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--trait); border-radius: 0; transition: background var(--d-2); }
.sujet-court:first-child { border-top: 0; }
.sujet-court:hover { background: linear-gradient(90deg, var(--accent-doux), transparent 80%); }
.sujet-court .ref { font-family: var(--police-mono); font-size: 12px; color: var(--accent); padding-top: 2px; }
.sujet-court .t { font-weight: 560; line-height: 1.35; }
.sujet-court .m { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
@media (max-width: 639px) { .sujet-court { grid-template-columns: 1fr; } .sujet-court .m { grid-column: 1; } .sujet-court .ref { padding-top: 0; } }

/* Jalons */
.jalons { position: relative; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.jalons-piste { position: relative; display: grid; grid-template-columns: repeat(8, minmax(118px, 1fr)); min-width: 940px; padding-top: 34px; }
.jalons-ligne, .jalons-fait { position: absolute; left: 0; right: 0; top: 45px; height: 2px; background: var(--surface-3); }
.jalons-fait { right: auto; width: var(--x, 0); background: linear-gradient(90deg, var(--feu-vert), var(--accent)); box-shadow: 0 0 10px var(--accent); transform-origin: left; }
.js .jalons-fait { transform: scaleX(0); }
.js .vu .jalons-fait { transform: scaleX(1); transition: transform 1400ms var(--c-sortie) 200ms; }
.aujourdhui { position: absolute; top: 0; left: var(--x); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--police-mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--accent); text-transform: uppercase; }
.aujourdhui::after { content: ""; width: 2px; height: 22px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.jalon { scroll-snap-align: start; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-right: 10px; }
.jalon .noeud { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 2px solid var(--trait-fort); z-index: 1; }
.jalon.fait .noeud { background: var(--feu-vert); border-color: var(--feu-vert); color: var(--sur-feu); }
.jalon.fait .noeud svg { width: 12px; height: 12px; stroke-width: 3; }
.jalon.pa .noeud { border-radius: 4px; transform: rotate(45deg) scale(0.86); border-color: var(--alerte); background: var(--alerte-doux); }
.jalon.pa.bloque .noeud { background: var(--alerte); box-shadow: 0 0 16px var(--alerte); }
.jalon .nom { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.jalon .date { font-family: var(--police-mono); font-size: 11.5px; color: var(--texte-3); }
.jalon .etiq { font-size: 11.5px; font-weight: 600; color: var(--txt-orange); display: inline-flex; gap: 4px; align-items: center; }

/* Activité en direct */
.activite { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activite li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--trait); }
.activite li:first-child { border-top: 0; }
.activite .quoi { font-size: 14px; line-height: 1.45; color: var(--texte-2); }
.activite .quoi strong { color: var(--texte); font-weight: 600; }
.activite .quoi .mono { color: var(--accent); font-size: 12.5px; }
.activite time { font-family: var(--police-mono); font-size: 11px; color: var(--texte-3); white-space: nowrap; padding-top: 3px; }
.activite li.nouveau { animation: arrivee 620ms var(--c-sortie) both, surligne 2.6s ease-out 300ms both; border-radius: var(--r-2); }
.en-direct { display: inline-flex; align-items: center; gap: 6px; font-family: var(--police-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--txt-vert); }
.en-direct::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--feu-vert); box-shadow: 0 0 0 0 var(--feu-vert); animation: direct 2s ease-out infinite; }

/* Valeur LABOR CONTROL */
.valeur { position: relative; overflow: hidden; }
.valeur-liste { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--e-4) var(--e-3); margin-top: var(--e-2); }
.valeur-liste b { display: block; font-size: 2rem; font-weight: 800; font-stretch: 118%; letter-spacing: -0.03em; line-height: 1; }
.valeur-liste span { font-size: 13px; color: var(--texte-2); line-height: 1.35; }
.valeur-note { margin-top: var(--e-4); padding-top: var(--e-3); border-top: 1px solid var(--trait); font-size: 13px; color: var(--texte-3); }

/* En-tête de page */
.entete-page { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--e-4); margin-bottom: var(--e-5); }
.entete-page h1 { font-size: var(--t-h1); font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; }
.entete-page .sous { margin-top: 6px; color: var(--texte-2); font-size: 0.95rem; }
.entete-page .sous b { color: var(--texte); font-weight: 650; }
.entete-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Registre */
.filtres { display: flex; flex-direction: column; gap: var(--e-3); margin-bottom: var(--e-4); }
.filtres-ligne { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.filtres-ligne::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .filtres-ligne { flex-wrap: wrap; overflow: visible; } }
.champ-recherche { position: relative; flex: 1; min-width: 220px; }
.champ-recherche input { width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: var(--r-2); border: 1px solid var(--trait-fort); background: var(--surface); color: var(--texte); font: inherit; font-size: 16px; transition: border-color var(--d-2), box-shadow var(--d-2); }
.champ-recherche input:focus { outline: none; border-color: var(--accent); box-shadow: var(--lueur); }
.champ-recherche .ic { position: absolute; left: 12px; top: 12px; color: var(--texte-3); }
.separateur { width: 1px; background: var(--trait-fort); margin: 6px 4px; flex-shrink: 0; }
.compteur-ligne { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--texte-2); margin-bottom: var(--e-3); }
.compteur-ligne b { color: var(--texte); font-size: 1rem; }

.registre-liste { display: flex; flex-direction: column; gap: 8px; }
.sujet-ligne {
  position: relative; display: grid; gap: 8px 12px; grid-template-columns: auto 1fr auto; grid-template-areas: "ref grav ech" "titre titre titre" "statut statut roles";
  padding: 14px var(--e-4); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ombre-1);
  transition: box-shadow var(--d-2), background var(--d-2);
}
.sujet-ligne:hover { box-shadow: var(--ombre-1), 0 0 0 1px var(--accent-trait); }
.sujet-ligne .ref { grid-area: ref; font-family: var(--police-mono); font-size: 12.5px; color: var(--accent); align-self: center; }
.sujet-ligne .titre { grid-area: titre; font-weight: 580; line-height: 1.35; }
.sujet-ligne .gravite { grid-area: grav; justify-self: start; }
.sujet-ligne .statut { grid-area: statut; }
.sujet-ligne .roles { grid-area: roles; display: flex; gap: 4px; justify-self: end; align-items: center; }
.sujet-ligne .echeance { grid-area: ech; justify-self: end; align-self: center; }
.sujet-ligne .avis-n { display: none; }
.sujet-ligne.maj { animation: surligne 2.6s ease-out both; }
@media (min-width: 1024px) {
  .registre-liste { gap: 0; border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ombre-1); overflow: hidden; }
  .registre-tete, .sujet-ligne { grid-template-columns: 84px minmax(0, 1fr) 118px 196px 104px 54px 132px; grid-template-areas: "ref titre grav statut roles avis ech"; align-items: center; }
  .sujet-ligne { border-radius: 0; box-shadow: none; border-top: 1px solid var(--trait); padding: 12px var(--e-5); background: transparent; }
  .sujet-ligne:hover { box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-doux); }
  .sujet-ligne .roles { justify-self: start; }
  .sujet-ligne .avis-n { display: block; grid-area: avis; font-family: var(--police-mono); font-size: 12px; color: var(--texte-2); }
  .registre-tete { display: grid; gap: 12px; padding: 12px var(--e-5); font-size: 11.5px; font-weight: 600; font-stretch: var(--etroit); text-transform: uppercase; letter-spacing: 0.08em; color: var(--texte-3); background: var(--surface-2); }
}
.registre-tete { display: none; }
@media (min-width: 1024px) { .registre-tete { display: grid; } }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 84%; gap: var(--e-3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--e-3); margin: 0 calc(-1 * var(--e-4)); padding-left: var(--e-4); padding-right: var(--e-4); scroll-padding: var(--e-4); }
@media (min-width: 1024px) { .kanban { grid-auto-columns: minmax(0, 1fr); overflow: visible; margin: 0; padding: 0; } }
.colonne-k { scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: var(--e-3); border-radius: var(--r-4); background: var(--surface-2); box-shadow: var(--ombre-1); align-self: start; }
.colonne-k h2 { display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; font-weight: 700; font-stretch: 104%; padding: 4px 4px 8px; letter-spacing: 0; }
.colonne-k h2 .n { font-family: var(--police-mono); font-size: 12px; color: var(--texte-3); font-weight: 500; }
.colonne-k h2 .cycle-mini { margin-right: auto; margin-left: 10px; }
.carte-k { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ombre-1); transition: box-shadow var(--d-2), transform var(--d-2) var(--c-sortie); }
.carte-k:hover { box-shadow: var(--ombre-2), 0 0 0 1px var(--accent-trait); transform: translateY(-2px); }
.carte-k .haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.carte-k .ref { font-family: var(--police-mono); font-size: 12px; color: var(--accent); }
.carte-k .titre { font-weight: 580; font-size: 0.92rem; line-height: 1.35; }
.carte-k .bas { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.carte-k .roles { display: flex; gap: 4px; }
.carte-k.maj { animation: surligne 2.6s ease-out both; }
.vide { padding: var(--e-6) var(--e-4); text-align: center; color: var(--texte-3); border-radius: var(--r-3); border: 1px dashed var(--trait-fort); }

/* Fiche sujet */
.fiche { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--e-4); }
@media (min-width: 1100px) {
  .fiche { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "tete avis" "fil avis" "fil pieces" "fil liens" "fil ."; gap: var(--e-5); align-items: start; }
  .zone-tete { grid-area: tete; } .zone-avis { grid-area: avis; } .zone-fil { grid-area: fil; } .zone-pieces { grid-area: pieces; } .zone-liens { grid-area: liens; }
}
.retour.retour-bureau { display: none; }
@media (min-width: 1024px) { .retour.retour-bureau { display: inline-flex; margin-bottom: var(--e-2); } }
.retour { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--texte-2); min-height: 44px; }
.retour:hover { color: var(--accent); }
.fiche-tete .ligne-1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.fiche-tete .ref { font-family: var(--police-mono); font-size: 13px; color: var(--accent); letter-spacing: 0.04em; }
.fiche-tete h1 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.1rem); font-weight: 780; letter-spacing: -0.025em; margin-top: 10px; line-height: 1.12; }
.type-puce { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--r-1); border: 1px solid var(--trait-fort); font-size: 12.5px; color: var(--texte-2); }
.bloque-jalon { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--e-4); padding: 8px 12px; border-radius: var(--r-2); background: var(--alerte-doux); color: var(--txt-orange); font-size: 13.5px; font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--alerte) 35%, transparent); }
.description { margin-top: var(--e-4); color: var(--texte-2); line-height: 1.6; max-width: 70ch; }
.infos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: var(--e-4); padding-top: var(--e-4); border-top: 1px solid var(--trait); }
@media (min-width: 640px) { .infos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.infos dt { font-size: 12px; color: var(--texte-3); }
.infos dd { margin: 2px 0 0; font-size: 14px; font-weight: 560; }

.anneau { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.anneau svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.anneau circle { fill: none; stroke-width: 5; }
.anneau .piste { stroke: var(--surface-3); }
.anneau .valeur { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 800ms var(--c-sortie); filter: drop-shadow(0 0 4px var(--accent)); }
.anneau .texte { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--police-mono); font-size: 13px; font-weight: 600; }
.avis-tete { display: flex; align-items: center; gap: var(--e-4); margin-bottom: var(--e-4); }
.avis-tete h2 { font-size: 1.1rem; font-weight: 720; }
.avis-tete p { font-size: 13px; color: var(--texte-2); margin-top: 2px; }
.avis-liste { display: flex; flex-direction: column; gap: 8px; }
.avis {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px;
  border-radius: var(--r-3); background: var(--surface-2); box-shadow: var(--ombre-1);
}
.avis::before { /* balayage de couleur à l'avis donné */
  content: ""; position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; background: var(--fond-avis, transparent); transition: transform 560ms var(--c-sortie); z-index: 0;
}
.avis > * { position: relative; z-index: 1; }
.avis[data-etat="accord"] { --fond-avis: var(--fond-vert); }
.avis[data-etat="reserve"] { --fond-avis: var(--fond-orange); }
.avis[data-etat="desaccord"] { --fond-avis: var(--fond-rouge); }
.avis:not([data-etat="attente"])::before { transform: scaleX(1); }
.avis .qui { font-weight: 600; font-size: 14px; line-height: 1.25; }
.avis .raci { font-size: 12px; color: var(--texte-3); }
.etat-avis { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.etat-avis svg { width: 16px; height: 16px; }
.avis[data-etat="attente"] .etat-avis { color: var(--texte-3); font-weight: 500; }
.avis[data-etat="attente"] .etat-avis::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--feu-orange); animation: respire-point 2s ease-in-out infinite; }
.avis[data-etat="accord"] .etat-avis { color: var(--txt-vert); }
.avis[data-etat="reserve"] .etat-avis { color: var(--txt-orange); }
.avis[data-etat="desaccord"] .etat-avis { color: var(--txt-rouge); }
.trace-coche { stroke-dasharray: 24; stroke-dashoffset: 24; animation: coche 520ms var(--c-sortie) 200ms forwards; }
.mon-avis { margin-top: var(--e-3); padding: var(--e-4); border-radius: var(--r-3); background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent-trait), 0 0 30px -18px var(--accent); }
.mon-avis h3 { font-size: 0.95rem; font-weight: 680; }
.mon-avis p { font-size: 13px; color: var(--texte-2); margin-top: 2px; }
.mon-avis .boutons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: var(--e-3); }
.mon-avis .boutons .btn { padding: 0 8px; font-size: 0.85rem; }
.b-accord:hover { background: var(--fond-vert); border-color: var(--feu-vert); }
.b-reserve:hover { background: var(--fond-orange); border-color: var(--feu-orange); }
.b-desaccord:hover { background: var(--fond-rouge); border-color: var(--feu-rouge); }
.depliant { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--d-3) var(--c-sortie); }
.depliant > div { overflow: hidden; }
.depliant.ouvert { grid-template-rows: 1fr; }
.zone-texte { width: 100%; min-height: 84px; margin-top: var(--e-3); padding: 10px 12px; border-radius: var(--r-2); border: 1px solid var(--trait-fort); background: var(--surface-2); color: var(--texte); font: inherit; font-size: 16px; resize: vertical; }
.zone-texte:focus { outline: none; border-color: var(--accent); box-shadow: var(--lueur); }
.erreur-champ { font-size: 13px; color: var(--txt-rouge); margin-top: 6px; min-height: 18px; }
.secoue { animation: secoue 380ms var(--c-standard); }

.fil { display: flex; flex-direction: column; gap: var(--e-4); padding-bottom: var(--e-2); }
.message { display: flex; gap: 10px; align-items: flex-end; max-width: 92%; }
.message .bulle-m { padding: 12px 14px; border-radius: 16px 16px 16px 6px; background: var(--surface-2); box-shadow: var(--ombre-1); min-width: 0; }
.message .qui { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 4px; font-size: 13px; }
.message .qui strong { font-weight: 650; }
.message .qui span { color: var(--texte-3); font-size: 12px; }
.message .qui time { font-family: var(--police-mono); font-size: 11px; color: var(--texte-3); }
.message .texte { font-size: 15px; line-height: 1.5; color: var(--texte); overflow-wrap: anywhere; }
.message .texte .mention { color: var(--accent); font-weight: 600; }
.message .vu-par { margin-top: 6px; font-size: 11.5px; color: var(--texte-3); display: flex; gap: 6px; align-items: center; }
.message.moi { align-self: flex-end; flex-direction: row-reverse; }
.message.moi .bulle-m { border-radius: 16px 16px 6px 16px; background: var(--accent-doux); box-shadow: inset 0 0 0 1px var(--accent-trait); }
.message.nouveau { animation: arrivee 620ms var(--c-sortie) both; }
.message.nouveau .bulle-m { animation: surligne 2.8s ease-out 400ms both; }
.badge-reponse { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--accent-doux); color: var(--accent); font-size: 11.5px; font-weight: 650; }
.piece { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 12px 8px 8px; border-radius: var(--r-2); background: var(--surface); box-shadow: var(--ombre-1); font-size: 13px; max-width: 100%; }
.piece .vig { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--surface-3); }
.piece .vig svg { width: 100%; height: 100%; }
.piece .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.piece .t { font-family: var(--police-mono); font-size: 11px; color: var(--texte-3); }
.ecrit { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--texte-3); }
.points { display: inline-flex; gap: 4px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.points i { width: 6px; height: 6px; border-radius: 50%; background: var(--texte-3); animation: point 1.2s ease-in-out infinite; }
.points i:nth-child(2) { animation-delay: 0.15s; }
.points i:nth-child(3) { animation-delay: 0.3s; }
.skynet-fil { position: relative; padding: var(--e-4); border-radius: var(--r-3); background: linear-gradient(135deg, var(--accent-doux), transparent 70%), var(--surface); box-shadow: inset 0 0 0 1px var(--accent-trait); }
.skynet-fil .tete { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.skynet-fil .tete strong { font-size: 14px; }
.skynet-fil .prive { margin-left: auto; font-family: var(--police-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--texte-3); display: inline-flex; gap: 4px; align-items: center; }
.skynet-fil p { font-size: 14px; color: var(--texte-2); line-height: 1.5; }
.skynet-fil .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--e-3); }
.skynet-fil.nouveau { animation: arrivee 620ms var(--c-sortie) both; }
.nouveaux-messages { position: sticky; bottom: 84px; align-self: center; display: none; }
.saisie { position: sticky; bottom: 0; margin-top: var(--e-4); padding: var(--e-3); border-radius: var(--r-4); background: var(--surface-verre); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--ombre-2); }
.saisie textarea { width: 100%; min-height: 48px; max-height: 160px; padding: 10px 12px; border: 0; background: transparent; color: var(--texte); font: inherit; font-size: 16px; resize: none; }
.saisie textarea:focus { outline: none; }
.saisie textarea::placeholder { color: var(--texte-3); }
.saisie-actions { display: flex; align-items: center; gap: 4px; }
.saisie-actions .btn-primaire { margin-left: auto; }
.saisie-dest { font-size: 12px; color: var(--texte-3); padding: 0 12px; }
.saisie-dest .role { height: 20px; font-size: 10px; margin-left: 2px; }
@media (max-width: 1023px) {
  body[data-page="sujet"] .nav-bas { display: none; }
  body[data-page="sujet"] .contenu { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .saisie { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom)); }
}
.pieces-grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.piece-tuile { position: relative; display: flex; flex-direction: column; border-radius: var(--r-3); overflow: hidden; background: var(--surface-2); box-shadow: var(--ombre-1); transition: box-shadow var(--d-2); }
.piece-tuile:hover { box-shadow: var(--ombre-1), 0 0 0 1px var(--accent-trait); }
.piece-tuile .apercu { aspect-ratio: 4 / 3; background: var(--surface-3); }
.piece-tuile .apercu svg { width: 100%; height: 100%; display: block; }
.piece-tuile .legende { padding: 8px 10px; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.piece-tuile .legende small { display: block; font-family: var(--police-mono); font-size: 10.5px; color: var(--texte-3); font-weight: 400; margin-top: 2px; }
.piece-tuile.charge .apercu { display: grid; place-items: center; }
.piece-tuile.nouveau { animation: arrivee 520ms var(--c-ressort) both; }
.progres-rond { width: 44px; height: 44px; transform: rotate(-90deg); }
.progres-rond circle { fill: none; stroke-width: 4; }
.progres-rond .piste { stroke: var(--trait-fort); }
.progres-rond .val { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: 113; }
.liens-sujet { display: flex; flex-direction: column; gap: 8px; }
.lien-sujet { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-2); background: var(--surface-2); font-size: 13.5px; box-shadow: var(--ombre-1); }
.lien-sujet .nature { font-size: 11.5px; color: var(--texte-3); display: block; }

/* Matrice des documents obligatoires */
.synthese { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--e-3); margin-bottom: var(--e-4); }
@media (min-width: 900px) { .synthese { grid-template-columns: repeat(4, 1fr) 1.4fr; } }
.synth { display: flex; align-items: center; gap: 12px; padding: var(--e-3) var(--e-4); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ombre-1); }
.synth .feu-lampe { width: 28px; height: 28px; }
.synth .feu-lampe svg { width: 16px; height: 16px; }
.synth b { display: block; font-size: 1.7rem; font-weight: 790; font-stretch: 112%; line-height: 1; }
.synth span { font-size: 12.5px; color: var(--texte-2); }
.synth.change { animation: rebond 600ms var(--c-ressort); }
.synth-barre { grid-column: 1 / -1; display: flex; flex-direction: column; justify-content: center; padding: var(--e-3) var(--e-4); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--ombre-1); font-size: 12.5px; color: var(--texte-2); }
@media (min-width: 900px) { .synth-barre { grid-column: auto; } }
.synth-barre .barre-feux { margin: 8px 0 0; }

.matrice-cadre { border-radius: var(--r-4); background: var(--surface); box-shadow: var(--ombre-1); overflow-x: auto; display: none; }
@media (min-width: 1024px) { .matrice-cadre { display: block; } .cartes-intervenants { display: none !important; } }
.matrice { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.matrice th, .matrice td { padding: 0; border-bottom: 1px solid var(--trait); }
.matrice thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); padding: 14px 8px 12px; text-align: center; vertical-align: bottom; font-size: 11.5px; font-weight: 640; font-stretch: var(--etroit); line-height: 1.2; color: var(--texte-2); transition: color var(--d-2), background var(--d-2); }
.matrice thead th:first-child { text-align: left; padding-left: var(--e-5); font-family: var(--police-mono); font-stretch: 100%; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; font-size: 10.5px; color: var(--texte-3); }
.matrice thead th small { display: block; font-family: var(--police-mono); font-size: 10px; font-stretch: 100%; color: var(--texte-3); font-weight: 400; margin-top: 4px; letter-spacing: 0.02em; }
.matrice tbody th { text-align: left; padding: 10px var(--e-4) 10px var(--e-5); font-weight: 600; white-space: nowrap; transition: background var(--d-2); }
.matrice tbody th .qui { display: flex; align-items: center; gap: 10px; }
.matrice tbody th .qui small { display: block; font-weight: 400; color: var(--texte-3); font-size: 11.5px; }
.matrice tbody tr:last-child th, .matrice tbody tr:last-child td { border-bottom: 0; }
.matrice td { text-align: center; transition: background var(--d-2); }
.matrice tbody tr:hover th, .matrice tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.matrice td.col-active { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.matrice thead th.col-active { color: var(--texte); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.cellule { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; min-height: 72px; padding: 12px 4px; border: 0; background: transparent; cursor: pointer; border-radius: var(--r-2); }
.cellule:hover .feu-lampe, .cellule:focus-visible .feu-lampe { transform: scale(1.15); }
.cellule .feu-lampe { transition: transform var(--d-2) var(--c-sortie), background-color var(--d-4), box-shadow var(--d-4); }
.cellule .etiq { font-size: 11.5px; font-stretch: 86%; color: var(--texte-2); line-height: 1.2; max-width: 108px; }
.cellule[data-feu="rouge"] .etiq { color: var(--txt-rouge); font-weight: 600; }
.cellule.so { cursor: default; color: var(--texte-3); font-size: 13px; }
.pastille-obs { display: inline-flex; padding: 0 5px; height: 16px; align-items: center; border-radius: 4px; background: var(--alerte-doux); color: var(--txt-orange); font-size: 10px; font-weight: 650; }
.tampon {
  position: absolute; pointer-events: none; z-index: 5; padding: 4px 10px; border: 2.5px solid var(--feu-vert); border-radius: 6px; color: var(--feu-vert);
  font-family: var(--police-mono); font-weight: 600; font-size: 13px; letter-spacing: 0.12em; background: color-mix(in srgb, var(--surface) 70%, transparent);
  animation: tampon 1500ms var(--c-sortie) forwards;
}

.cartes-intervenants { display: flex; flex-direction: column; gap: var(--e-3); }
.carte-int { padding: var(--e-4); border-radius: var(--r-4); background: var(--surface); box-shadow: var(--ombre-1); }
.carte-int .tete { display: flex; align-items: center; gap: 12px; }
.carte-int .tete h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.carte-int .tete small { display: block; font-size: 12px; color: var(--texte-3); }
.carte-int .tete .fi-points { margin-left: auto; }
.carte-int ul { list-style: none; margin: var(--e-3) 0 0; padding: 0; }
.carte-int li button { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--trait); background: transparent; text-align: left; cursor: pointer; min-height: 52px; }
.carte-int li button .doc { font-size: 14px; font-weight: 560; }
.carte-int li button .etiq { grid-column: 2; font-size: 12.5px; color: var(--texte-2); }
.carte-int li button[data-feu="rouge"] .etiq { color: var(--txt-rouge); }

.depot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: var(--e-5) var(--e-4);
  border-radius: var(--r-4); background: var(--surface); box-shadow: var(--ombre-1);
  outline: 2px dashed var(--trait-fort); outline-offset: -10px; transition: outline-color var(--d-2), background var(--d-2), box-shadow var(--d-2);
}
.depot .ic-grande { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-doux); color: var(--accent); transition: transform var(--d-3) var(--c-ressort); }
.depot h2 { font-size: 1.05rem; font-weight: 700; }
.depot p { font-size: 13.5px; color: var(--texte-2); max-width: 40ch; }
.depot .boutons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.depot[data-etat="survol"] { outline-color: var(--accent); background: linear-gradient(var(--accent-doux), var(--accent-doux)), var(--surface); box-shadow: var(--lueur); }
.depot[data-etat="survol"] .ic-grande { transform: translateY(-6px) scale(1.08); }
.depot[data-etat="survol"]::after { content: ""; position: absolute; inset: 8px; border-radius: 14px; border: 2px dashed var(--accent); animation: fourmis 900ms linear infinite; pointer-events: none; }
.fichier-depot { display: none; width: 100%; max-width: 440px; text-align: left; padding: var(--e-3) var(--e-4); border-radius: var(--r-3); background: var(--surface-2); box-shadow: var(--ombre-1); }
.depot[data-etat="traitement"] .fichier-depot, .depot[data-etat="fini"] .fichier-depot { display: block; animation: arrivee 420ms var(--c-sortie) both; }
.depot[data-etat="traitement"] .invite, .depot[data-etat="fini"] .invite { display: none; }
.fichier-depot .nom { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.fichier-depot .nom span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fichier-depot .progression { height: 4px; margin: 10px 0; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.fichier-depot .progression span { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 8px var(--accent); transform-origin: left; transform: scaleX(0); }
.etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--texte-3); }
.etapes li { display: flex; align-items: flex-start; gap: 8px; opacity: 0.45; transition: opacity var(--d-3), color var(--d-3); }
.etapes li .ic { width: 16px; height: 16px; margin-top: 1px; }
.etapes li.encours { opacity: 1; color: var(--texte-2); }
.etapes li.ok { opacity: 1; color: var(--texte); }
.etapes li.ok .ic { color: var(--txt-vert); }
.etapes li .roue { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--trait-fort); border-top-color: var(--accent); animation: tourne 800ms linear infinite; flex-shrink: 0; margin-top: 1px; }
.reconnu { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-2); background: var(--accent-doux); font-size: 13px; color: var(--texte-2); }
.reconnu b { color: var(--texte); }
.jeton { position: fixed; z-index: var(--z-bulle); width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: var(--feu-orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--feu-orange) 25%, transparent), 0 0 24px var(--feu-orange); pointer-events: none; }

/* Tiroir (bureau) / feuille (téléphone) */
.voile { position: fixed; inset: 0; z-index: var(--z-tiroir); background: rgba(7, 10, 15, 0.55); opacity: 0; pointer-events: none; transition: opacity var(--d-3); }
.voile.ouvert { opacity: 1; pointer-events: auto; }
.tiroir {
  position: fixed; z-index: calc(var(--z-tiroir) + 1); left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow-y: auto;
  padding: var(--e-5) var(--e-4) calc(var(--e-5) + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--surface); box-shadow: var(--ombre-2);
  transform: translateY(105%); transition: transform 420ms var(--c-sortie); visibility: hidden;
}
.tiroir.ouvert { transform: none; visibility: visible; }
.tiroir::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--trait-fort); margin: -10px auto 16px; }
@media (min-width: 1024px) {
  .tiroir { left: auto; top: 0; width: 460px; max-height: none; border-radius: 0; padding: var(--e-6); transform: translateX(105%); border-left: 1px solid var(--trait); }
  .tiroir::before { display: none; }
}
.tiroir h2 { font-size: 1.3rem; font-weight: 760; margin-top: 6px; }
.tiroir .fermer { position: absolute; right: 12px; top: 12px; }
.doc-apercu { margin-top: var(--e-4); border-radius: var(--r-3); overflow: hidden; box-shadow: var(--ombre-1); background: var(--surface-2); }
.doc-apercu svg { display: block; width: 100%; height: auto; }
.visa-boutons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: var(--e-4); }
.visa-boutons .btn { flex-direction: column; height: auto; padding: 10px 6px; gap: 2px; white-space: normal; text-align: center; line-height: 1.2; }
.visa-boutons .btn small { font-weight: 400; font-size: 11px; color: var(--texte-3); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: var(--e-4) 0 0; font-size: 13.5px; }
.dl dt { color: var(--texte-3); }
.dl dd { margin: 0; }

/* Toasts */
.toasts { position: fixed; z-index: var(--z-toast); left: 12px; right: 12px; top: 70px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 1024px) { .toasts { left: auto; top: auto; right: 24px; bottom: 24px; width: 380px; } }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-3); background: var(--surface-3); color: var(--texte); box-shadow: var(--ombre-2); font-size: 14px; line-height: 1.4; animation: toast-entre 420ms var(--c-sortie) both; }
.toast .ic { color: var(--accent); margin-top: 1px; }
.toast.ok .ic { color: var(--txt-vert); }
.toast small { display: block; color: var(--texte-2); font-size: 12.5px; margin-top: 2px; }
.toast.sort { animation: toast-sort 260ms var(--c-entree) both; }

/* ---------- 7. Mouvement ---------- */
.js .apparait { opacity: 0; transform: translateY(14px); }
.js .apparait.vu { opacity: 1; transform: none; transition: opacity 560ms var(--c-sortie), transform 560ms var(--c-sortie); transition-delay: calc(var(--i, 0) * 70ms); }

@keyframes entree { from { opacity: 0; transform: translateY(14px); } }
@keyframes arrivee { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
@keyframes surligne { 0% { box-shadow: 0 0 0 1px var(--accent-trait), 0 0 28px -6px var(--accent); background-color: var(--accent-doux); } 100% { box-shadow: 0 0 0 1px transparent; } }
@keyframes rebond { 0% { transform: scale(0.6); } 100% { transform: scale(1); } }
@keyframes onde { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }
@keyframes respire { 0%, 100% { opacity: 0.15; transform: scale(0.9); } 50% { opacity: 0.6; transform: scale(1.08); } }
@keyframes respire-point { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes balayage { 0% { transform: translateY(-100%); } 100% { transform: translateY(260%); } }
@keyframes ligne-entre { from { opacity: 0; transform: translateY(12px); } }
@keyframes ligne-sort { to { opacity: 0; transform: translateY(-12px); } }
@keyframes direct { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--feu-vert) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes point { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes coche { to { stroke-dashoffset: 0; } }
@keyframes secoue { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes valide { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(0.96) translateY(-6px); } }
@keyframes fourmis { to { border-color: var(--accent-vif); } }
@keyframes tampon { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.8) rotate(-14deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(0.94) rotate(-8deg); } 26% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); } 80% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-8deg); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1) rotate(-8deg); } }
@keyframes toast-entre { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes toast-sort { to { opacity: 0; transform: translateY(8px); } }

/* Transitions de page (navigation entre documents, même origine) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 180ms var(--c-entree) both page-sort; }
::view-transition-new(root) { animation: 420ms var(--c-sortie) both page-entre; }
::view-transition-group(*) { animation-duration: 460ms; animation-timing-function: var(--c-sortie); }
@keyframes page-sort { to { opacity: 0; transform: translateY(-6px); } }
@keyframes page-entre { from { opacity: 0; transform: translateY(12px); } }

/* ---------- 8. Mouvement réduit : tout est lisible, rien ne bouge ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .js .apparait, .js .jauge a { opacity: 1; transform: none; }
  .js .sparkline .trace { stroke-dashoffset: 0; }
  .js .jalons-fait { transform: none; }
  .radar::before { animation: none; transform: rotate(300deg); }
}

/* Couleurs forcées (Windows contraste élevé) : les formes portent l'information */
@media (forced-colors: active) {
  .feu-lampe, .jauge a, .barre-feux span { forced-color-adjust: none; }
}

/* Impression : la matrice et le registre s'impriment lisiblement */
@media print {
  .lateral, .barre, .nav-bas, .toasts, .skynet, .depot { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Bloquants restants sous la jauge */
.restants { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: var(--e-3); border-top: 1px solid var(--trait); }
.restants span.l { width: 100%; font-size: 12.5px; color: var(--texte-3); }
.restants a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-1); background: var(--fond-rouge); color: var(--txt-rouge); font-family: var(--police-mono); font-size: 12px; font-weight: 500; transition: background var(--d-2), box-shadow var(--d-2); }
.restants a:hover { box-shadow: inset 0 0 0 1px var(--feu-rouge); }
.restants a .retard { color: var(--texte-2); font-family: var(--police); font-size: 11.5px; }
@media (pointer: coarse) { .restants a { height: 36px; } }

/* Noms de transition posés seulement pendant un changement de vue du registre */
.vt-noms .sujet-ligne, .vt-noms .carte-k { view-transition-name: var(--vtn); }
.vt-noms .registre-tete { view-transition-name: registre-tete; }
.txt-rouge { color: var(--txt-rouge); }
.fiche-tete { view-transition-name: sujet-entete; }

/* Fil : lignes système (relances automatiques) et indicateur de saisie */
.fil-systeme { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--police-mono); font-size: 11.5px; color: var(--texte-3); text-align: center; }
.fil-systeme .radar-mini { width: 16px; height: 16px; }
.ecrit.nouveau { animation: arrivee 420ms var(--c-sortie) both; }
.mon-avis .btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: var(--lueur); }
@media (min-width: 1024px) {
  .fil { max-height: 540px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px 8px 2px; margin-right: -10px; scrollbar-width: thin; scrollbar-color: var(--trait-fort) transparent; }
  .saisie { position: static; }
}

/* Téléphone : saisie sur une ligne, comme une messagerie */
@media (max-width: 1023px) {
  .saisie { display: flex; align-items: flex-end; gap: 2px; padding: 6px; border-radius: 22px; }
  .saisie-dest { display: none; }
  .saisie textarea { order: 0; flex: 1; min-height: 44px; height: 44px; padding: 11px 8px; }
  .saisie-actions { display: contents; }
  .saisie-actions .btn-icone { order: -1; }
  .saisie-actions .btn-primaire { order: 1; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
  .saisie-actions .btn-primaire .lib { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Documents : zone de dépôt, étapes, cartes téléphone, note */
.depot { margin-bottom: var(--e-4); }
.invite { display: flex; flex-direction: column; align-items: center; gap: 10px; }
@media (min-width: 1024px) {
  .depot { padding: var(--e-4) var(--e-5); align-items: stretch; }
  .invite { flex-direction: row; text-align: left; gap: var(--e-4); }
  .invite-texte { flex: 1; }
  .invite .boutons { margin-top: 0; }
  .fichier-depot { max-width: none; display: none; }
  .depot[data-etat="traitement"] .fichier-depot, .depot[data-etat="fini"] .fichier-depot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px 24px; align-items: center; }
  .fichier-depot .nom, .fichier-depot .progression { grid-column: 1; }
  .fichier-depot .etapes { grid-column: 2; grid-row: 1 / span 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
  .fichier-depot .reconnu { grid-column: 1; margin-top: 0; }
}
.etapes .marque-e { display: inline-grid; place-items: center; width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.etapes .marque-e .ic { width: 16px; height: 16px; margin: 0; }
.etapes .rond { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--trait-fort); }
.etapes li.ok .marque-e { color: var(--txt-vert); }
.cellule-m .feu-lampe { grid-row: 1 / span 2; }
.note-feux { margin-top: var(--e-4); font-size: 12.5px; color: var(--texte-3); line-height: 1.5; max-width: 110ch; }
.tiroir .feu { font-size: 14px; font-weight: 600; color: var(--texte); }
.matrice thead th:not(:first-child) { min-width: 82px; }
.matrice tbody th { white-space: normal; min-width: 190px; max-width: 210px; line-height: 1.25; }
.matrice tbody th, .matrice thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.matrice thead th:first-child { z-index: 3; background: var(--surface-2); }
.matrice tbody tr:hover th { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.cellule.so { color: var(--trait-fort); }

/* Ampoule de l'en-tête (BasculeTheme) : allumée sur fond nuit, éteinte sur fond clair */
.btn-icone.ampoule { border-radius: 50%; border-color: color-mix(in srgb, var(--alerte) 45%, transparent); background: var(--alerte-doux); color: var(--alerte); }
.btn-icone.ampoule svg { width: 22px; height: 22px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--alerte) 75%, transparent)); }
.btn-icone.ampoule:hover { background: color-mix(in srgb, var(--alerte) 22%, transparent); color: var(--alerte); }
.btn-icone.ampoule[data-etat="clair"] { border-color: var(--trait-fort); background: var(--surface-2); color: var(--texte-2); }
.btn-icone.ampoule[data-etat="clair"] svg { filter: none; }
.btn-icone.ampoule[data-etat="clair"]:hover { background: var(--surface-3); color: var(--texte); }
.btn-icone.ampoule.allume svg { animation: allumage 480ms linear; }
@keyframes allumage { 0% { opacity: 0.2; } 18% { opacity: 1; } 30% { opacity: 0.35; } 46% { opacity: 1; } 100% { opacity: 1; } }
