/* ============================================================================
   PRAXIS — design system « cockpit contrasté »
   Référence : docs/superpowers/specs/2026-07-02-refonte-design-cockpit-design.md
   Règle : les templates ne portent QUE des classes — tout le style vit ici.
   ========================================================================== */

/* ----- Polices (auto-hébergées, aucune requête externe) -------------------- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
}

/* ----- Tokens (spec §2) ----------------------------------------------------- */
:root {
  --paper: #FFFFFF;
  --surface: #FAFAFA;
  --ink: #09090B;
  --muted: #71717A;
  --line: #E4E4E7;
  --rail: #131316;
  --rail-2: #26262B;
  --rail-ink: #A1A1AA;
  --acc: #4F46E5;
  --acc-press: #4338CA;
  --acc-soft: #EEF2FF;
  --acc-hover: rgba(79, 70, 229, .09);  /* pastel translucide — hover propre, sans souligné */
  --good: #15803D;  --good-bg: #F0FDF4;  --good-line: #BBF7D0;
  --warn: #854D0E;  --warn-bg: #FEFCE8;  --warn-line: #FDE68A;
  --bad: #B91C1C; /* red-700 : 4,5:1 tenu sur --bad-bg ET sur blanc (AA) */   --bad-bg: #FEF2F2;   --bad-line: #FECACA;
  --r-sm: 7px;
  --r: 9px;
  --r-lg: 12px;
  --shadow: 0 12px 32px rgba(20, 20, 40, .10);
  --bnav-h: 58px;
  --titres: "Space Grotesk", system-ui, sans-serif;
  --texte: "Inter", system-ui, sans-serif;
}

/* ----- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--texte);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
h1, h2, h3, h4, .sg { font-family: var(--titres); letter-spacing: -.015em; margin: 0; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 13.5px; font-weight: 600; }
h4 { font-size: 12.5px; font-weight: 600; }
p { margin: 0 0 8px; }
/* Aucun souligné, sur AUCUN état (repos, survol, focus, actif) — le hover est un surlignage pastel. */
a, a:hover, a:focus, a:active, a:visited { text-decoration: none; }
a { color: var(--acc); }
/* Hover propre des liens de CONTENU : surlignage pastel translucide qui épouse le texte (jamais de
   souligné, aucun décalage). Exclut boutons, onglets et items de nav — ils ont leur propre hover. */
a:not(.btn):not(.bnav-item):not(.rail-item):not(.rail-lien):not(.feuille-item):not(.seg) {
  border-radius: 3px; transition: background-color .12s, color .12s;
}
a:not(.btn):not(.bnav-item):not(.rail-item):not(.rail-lien):not(.feuille-item):not(.seg):hover {
  color: var(--acc-press); background-color: var(--acc-hover); box-shadow: 0 0 0 2px var(--acc-hover);
}
.num, td.num, .kpi .v { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
[x-cloak] { display: none !important; }
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
/* (Fondu de section : voir « Feedback de navigation » plus bas — une seule définition.) */

/* ----- Chrome : grille app, rail (bureau), nav basse (mobile) ---------------- */
.app-grid { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
/* Un item de grille a min-width:auto par défaut : il refuse de rétrécir sous la largeur de son
   contenu, ce qui laisse une barre en nowrap (pôles) élargir la colonne et déborder l'écran sur
   mobile. min-width:0 autorise la colonne à rétrécir → les zones défilantes défilent en INTERNE. */
.app-grid > main { min-width: 0; }
.rail { display: none; }
.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: var(--paper); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bnav-item {
  flex: 1; min-height: 44px; border: 0; border-top: 2px solid transparent; background: none;
  cursor: pointer; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px;
  font-family: var(--texte); font-size: 10px; font-weight: 600; color: var(--muted);
}
.bnav-item .g { font-size: 16px; line-height: 1; }
/* Actif = couleur ET forme (barre haute + graisse) — jamais la couleur seule (WCAG 1.4.1) */
.bnav-item.on { color: var(--acc); border-top-color: var(--acc); font-weight: 700; }
.zone { padding: 14px 14px calc(var(--bnav-h) + 18px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; width: 100%; min-width: 0; }

@media (min-width: 900px) {
  .app-grid { grid-template-columns: 176px 1fr; }
  .bnav { display: none; }
  .zone { padding: 18px 26px 40px; }
  .rail {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--rail); color: var(--rail-ink);
    padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  }
}
.rail-logo { display: flex; align-items: center; gap: 8px; padding: 0 8px 14px; }
.rail-logo .m {
  width: 26px; height: 26px; border-radius: 8px; background: var(--acc); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--titres); font-weight: 700; font-size: 13px;
}
.rail-logo b { color: #fff; font-family: var(--titres); font-size: 13px; letter-spacing: .05em; }
.rail-sec {
  font-size: 9px; text-transform: uppercase; letter-spacing: .13em;
  color: #8E8E99; padding: 12px 8px 4px; font-weight: 700; /* 5,0:1 sur --rail (AA) */
}
.rail-item {
  display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 8px;
  font-size: 11.5px; font-weight: 500; color: var(--rail-ink);
  background: none; border: 0; cursor: pointer; text-align: left; width: 100%;
  font-family: var(--texte); text-decoration: none;
}
.rail-item:hover { color: #fff; text-decoration: none; }
.rail-item.on { background: var(--rail-2); color: #fff; }
.rail-item .rbadge {
  margin-left: auto; font-size: 9px; background: #3F3F46; color: #fff;
  border-radius: 999px; padding: 1px 7px; font-weight: 600;
}
.rail-foot {
  margin-top: auto; padding: 10px 8px 0; font-size: 10.5px; color: var(--rail-ink); /* 7,2:1 (AA) */
  border-top: 1px solid var(--rail-2); display: grid; gap: 6px;
}
.rail-foot b { color: #fff; letter-spacing: .06em; }
.rail-lien {
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  color: var(--rail-ink); font-family: var(--texte); font-size: 10.5px; text-decoration: none;
  border-radius: 4px; padding: 3px 6px; margin: -3px -6px; transition: background-color .12s, color .12s;
}
.rail-lien:hover { color: #fff; background-color: rgba(255, 255, 255, .08); }

/* ----- En-tête d'écran, KPI ---------------------------------------------------- */
.vhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.vhead h1 { font-size: clamp(17px, 2.5vw, 20px); }
.vhead h2 { font-size: clamp(16px, 2.5vw, 19px); }
.vhead .sess { font-size: 10.5px; color: var(--muted); }
.chip-trim {
  margin-left: auto; font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--acc); padding: 4px 11px; border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.etat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-sm);
  border: 1px solid var(--line); color: var(--muted); background: var(--surface);
}
.etat.ok { color: var(--good); background: var(--good-bg); border-color: var(--good-line); }
.etat.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.etat.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); gap: 10px; } }
.kpi { background: var(--surface); border-radius: var(--r); padding: 10px 12px; }
.kpi .l {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; gap: 6px;
}
.kpi .l .up { color: var(--good); letter-spacing: 0; }
.kpi .l .down { color: var(--bad); letter-spacing: 0; }
.kpi .v { font-family: var(--titres); font-size: 20px; font-weight: 700; margin-top: 3px; letter-spacing: -.02em; }
.kpi .v small { font-size: 12px; color: var(--rail-ink); font-weight: 600; }
.kpi .v.kpi-spark { font-size: 15px; }
.kpi svg { margin-top: 6px; display: block; }
.kpi-bar { height: 3px; border-radius: 2px; background: var(--line); margin-top: 8px; position: relative; overflow: hidden; }
.kpi-bar i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--acc); border-radius: 2px; display: block; }

.zone-2col { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .zone-2col { grid-template-columns: 1.6fr 1fr; } }

/* ----- Panneaux, segments, formulaires ---------------------------------------- */
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 13px 15px; background: var(--paper); margin-bottom: 12px; }
.panel > h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }

.segwrap { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 11px; }
.seg {
  font-size: 10.5px; font-weight: 600; color: #3F3F46; background: #F4F4F5;
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
  border: 0; cursor: pointer; font-family: var(--texte); min-height: 30px;
}
.seg:hover { background: var(--acc-soft); color: var(--acc-press); }
.seg.on { background: var(--rail); color: #fff; }
.seg.done::after { content: " ✓"; color: var(--good); }
.seg.on.done::after { color: #86EFAC; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #F4F4F5; color: var(--ink); border: 0; cursor: pointer;
  font-family: var(--titres); font-size: 11.5px; font-weight: 700;
  padding: 9px 16px; border-radius: var(--r); min-height: 36px;
  text-decoration: none; transition: background .12s;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn--accent { background: var(--acc); color: #fff; }
.btn--accent:hover { background: var(--acc-press); }
.btn--ghost { background: var(--paper); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--acc-soft); border-color: #C7D2FE; filter: none; }
.btn--block { display: flex; width: 100%; }
.btn--lg { min-height: 44px; font-size: 12.5px; }

.field { margin-bottom: 10px; }
.field label { font-size: 10.5px; font-weight: 700; color: #52525B; display: block; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #D4D4D8; border-radius: var(--r); padding: 8px 10px;
  font-family: var(--texte); font-size: 12.5px; color: var(--ink); background: var(--paper);
  min-height: 36px;
}
.field textarea { min-height: 68px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acc); }
.form-section { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 12px; }
.form-section > h4 { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.form-card { background: var(--surface); border-radius: var(--r); padding: 11px 13px; margin: 8px 0; }

.aide { font-size: 11px; color: var(--muted); background: var(--surface); border-radius: var(--r); padding: 8px 10px; margin: 8px 0; }
.help { font-size: 10.5px; color: var(--muted); margin: 3px 0 0; }
.sub { font-size: 11px; color: var(--muted); }
.note { font-size: 11.5px; color: var(--muted); background: var(--surface); border-radius: var(--r); padding: 8px 10px; }
.eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--acc); font-weight: 700; display: block; }
.lead { color: var(--muted); font-size: 12.5px; max-width: 64ch; }

/* ----- États & retours (icône + libellé, jamais couleur seule) ----------------- */
.coh {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 11px; border-radius: var(--r); padding: 8px 10px; margin: 6px 0;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.coh .badge { flex-shrink: 0; }
.coh.ok { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.coh.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.coh.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.badge { font-size: 12px; line-height: 1.3; }
.prepa-alertes { margin: 4px 0 0; padding-left: 18px; font-size: 11px; color: var(--warn); }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 999px;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); }

/* ----- Tableaux de données ------------------------------------------------------ */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table caption { text-align: left; font-size: 10.5px; color: var(--muted); padding-bottom: 6px; }
.table th {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; text-align: right;
  padding: 6px 9px; border-bottom: 1px solid var(--line);
}
.table th:first-child, .table td:first-child { text-align: left; }
.table td { padding: 6px 9px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table .neg { color: var(--bad); font-weight: 600; }
.table .pos { color: var(--good); font-weight: 700; }
.ligne { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 11.5px; border-bottom: 1px dashed var(--line); }
.ligne:last-of-type { border-bottom: 0; }
.ligne b { font-weight: 650; font-variant-numeric: tabular-nums; }
.ligne .neg { color: var(--bad); font-weight: 600; font-variant-numeric: tabular-nums; }
.ligne .pos { color: var(--good); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ----- Largeurs de jauge (pas de 5 — zéro style inline dans les templates) -------- */
.j0 { width: 0%; }
.j5 { width: 5%; }
.j10 { width: 10%; }
.j15 { width: 15%; }
.j20 { width: 20%; }
.j25 { width: 25%; }
.j30 { width: 30%; }
.j35 { width: 35%; }
.j40 { width: 40%; }
.j45 { width: 45%; }
.j50 { width: 50%; }
.j55 { width: 55%; }
.j60 { width: 60%; }
.j65 { width: 65%; }
.j70 { width: 70%; }
.j75 { width: 75%; }
.j80 { width: 80%; }
.j85 { width: 85%; }
.j90 { width: 90%; }
.j95 { width: 95%; }
.j100 { width: 100%; }

/* ----- Jauge horizontale (profil 7 axes, évaluation) ------------------------------ */
.jauge { background: var(--line); border-radius: 6px; height: 8px; overflow: hidden; }
.jauge i { display: block; height: 8px; border-radius: 6px; background: var(--acc); }
.jauge-ligne { display: flex; justify-content: space-between; gap: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.espace-haut { margin-top: 12px; }
.coh--inline { display: inline-flex; margin-top: 6px; }
.titre-page { font-family: var(--titres); font-weight: 700; }
.resultat-code { font-family: var(--titres); font-size: 28px; font-weight: 700; text-align: center; letter-spacing: .1em; }

/* ----- Utilitaires de mise en page (zéro style inline dans les templates) --------- */
.panel--etroit { max-width: 480px; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 12px; }
.defile-x { overflow-x: auto; }

/* ----- Listes -------------------------------------------------------------------- */
.liste-nue { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.liste-pas { padding-left: 18px; margin: 0; display: grid; gap: 8px; }
.bloc-espace { margin-bottom: 14px; }

/* ----- Classement ---------------------------------------------------------------- */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank li { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; }
.rank .pos {
  font-family: var(--titres); font-weight: 700; font-size: 14px; color: var(--acc);
  min-width: 22px; text-align: center; font-variant-numeric: tabular-nums;
}
.rank .nm { font-weight: 650; font-size: 12.5px; }

/* ----- Pages simples (connexion, résultats de formulaires) ------------------------ */
.topbar { background: var(--rail); color: #fff; }
.topbar-in { display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: 1120px; margin: 0 auto; }
.topbar .brand, .brand { font-family: var(--titres); font-weight: 700; letter-spacing: .05em; }
.topbar .pill { background: var(--rail-2); border-color: transparent; color: var(--rail-ink); }
.content { padding: 16px 16px 40px; max-width: 1120px; margin: 0 auto; }
.app { min-height: 100vh; }
.layout { max-width: 1120px; margin: 0 auto; }
.meta { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.logo { flex-shrink: 0; }
.card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; background: var(--paper); }

/* ----- Bibliothèque pédagogique ------------------------------------------------------ */
.biblio-filtre { max-width: 380px; margin-bottom: 12px; }
.fiche {
  border: 1px solid var(--line); border-radius: var(--r); padding: 0; margin-bottom: 8px;
  background: var(--paper);
}
.fiche summary {
  cursor: pointer; padding: 10px 13px; display: flex; align-items: center; gap: 8px;
  font-family: var(--titres); font-weight: 600; font-size: 12.5px; list-style: none;
}
.fiche summary::-webkit-details-marker { display: none; }
.fiche summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 14px; }
.fiche[open] summary::after { content: "−"; }
.fiche[open] summary { border-bottom: 1px solid var(--line); }
.fiche-corps { padding: 11px 13px; display: grid; gap: 9px; font-size: 12px; }
.fiche-corps h5 {
  margin: 0 0 2px; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--acc); font-family: var(--texte); font-weight: 700;
}
.fiche-corps p { margin: 0; }
.fiche-liens { display: flex; gap: 5px; flex-wrap: wrap; }

/* ----- Bouton-lien dans le contenu -------------------------------------------------- */
.lien-contenu {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--acc); font-family: var(--texte); font-size: inherit; text-decoration: none;
  border-radius: 4px; transition: background-color .12s, color .12s;
}
.lien-contenu:hover { color: var(--acc-press); background-color: var(--acc-hover); box-shadow: 0 0 0 3px var(--acc-hover); }

/* ----- Business game : manche, flash marché, barre d'action ------------------------ */
.manche {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px;
  background: linear-gradient(135deg, var(--acc-soft), var(--paper) 55%);
  margin-bottom: 14px;
}
.manche-titre { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.manche-titre h2 { font-size: clamp(18px, 3vw, 24px); letter-spacing: -.02em; }
.manche-titre .sub { font-variant-numeric: tabular-nums; }
.manche-grille { display: flex; gap: 4px; margin: 12px 0; }
.manche-grille i {
  flex: 1; height: 6px; border-radius: 3px; background: var(--line); display: block;
}
.manche-grille i.faite { background: var(--acc); }
.manche-grille i.courante { background: var(--acc); opacity: .45; }
.manche-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.flash {
  display: flex; gap: 8px; align-items: flex-start;
  border-left: 3px solid var(--acc); background: var(--surface);
  border-radius: 0 var(--r) var(--r) 0; padding: 8px 11px; font-size: 11.5px; margin-bottom: 12px;
}
.flash .badge { flex-shrink: 0; }
.flash .sub { display: block; }
.barre-action {
  position: sticky; bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom) + 8px);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 10px 12px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center;
  z-index: 30; margin-top: 12px;
}
@media (min-width: 900px) { .barre-action { bottom: 12px; } }
.barre-action .progression { flex: 1; min-width: 90px; }
.progression-texte { font-size: 10px; color: var(--muted); font-weight: 600; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.progression-barre { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progression-barre i { display: block; height: 4px; background: var(--acc); border-radius: 2px; }

/* ----- Accueil (spec §3 : deux parcours visibles d'emblée) ------------------------- */
.accueil { min-height: 100vh; display: flex; flex-direction: column; }
.accueil .topbar-in .rail-logo { padding: 0; }
.accueil-corps { flex: 1; width: 100%; max-width: 1060px; margin: 0 auto; padding: 26px 18px 40px; }
.accueil-hero { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; padding: 10px 0 26px; }
@media (min-width: 860px) { .accueil-hero { grid-template-columns: 1.2fr 1fr; gap: 40px; } }
.accueil-hero h1 { font-size: clamp(26px, 4.5vw, 38px); letter-spacing: -.025em; margin: 6px 0 10px; text-wrap: balance; }
.accueil-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Aperçu décoratif du cockpit (pur HTML/CSS, aria-hidden) */
.apercu {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px;
  background: var(--paper); box-shadow: var(--shadow); max-width: 400px; justify-self: center;
  width: 100%; user-select: none;
}
.apercu-tete { display: flex; align-items: center; gap: 8px; font-family: var(--titres); font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.apercu-point { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.apercu-chip { margin-left: auto; font-size: 9.5px; font-weight: 700; color: #fff; background: var(--acc); padding: 2px 8px; border-radius: 5px; }
.apercu-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.apercu-kpi { background: var(--surface); border-radius: var(--r-sm); padding: 7px 9px; display: grid; gap: 2px; }
.apercu-kpi span:first-child { font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.apercu-kpi b { font-family: var(--titres); font-size: 14px; font-variant-numeric: tabular-nums; }
.apercu-jauge { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; display: block; }
.apercu-jauge i { display: block; height: 3px; background: var(--acc); border-radius: 2px; }
.apercu-segs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.apercu-segs .seg { font-size: 9px; padding: 3px 8px; min-height: 0; pointer-events: none; }
.apercu-ligne { height: 8px; border-radius: 4px; background: var(--surface); margin-bottom: 6px; }
.apercu-ligne.courte { width: 62%; }
.apercu-btn { margin-top: 10px; background: var(--acc); color: #fff; font-family: var(--titres); font-weight: 700; font-size: 10.5px; border-radius: var(--r-sm); padding: 7px 12px; text-align: center; }

/* Les deux parcours, côte à côte dès 800 px */
.parcours { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 800px) { .parcours { grid-template-columns: 1fr 1fr; align-items: start; } }
.parcours-carte { margin-bottom: 0; }
.parcours-carte--animateur { background: var(--surface); }
.parcours-tete { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.parcours-tete h2 { font-size: 16px; }
.parcours-tete .sub { display: block; margin-top: 2px; }
.parcours-icone {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--r);
  background: var(--acc-soft); color: var(--acc); display: flex; align-items: center;
  justify-content: center; font-size: 16px;
}
.parcours-icone--anim { background: var(--rail); color: #fff; }
.champs-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .champs-2col { grid-template-columns: 1fr; } }
.accueil-pied { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 14px; }

/* ----- Héritage encore référencé (aligné sur le cockpit) -------------------------- */
.e { font-style: normal; }
.prepa-nav, .poles-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
@media (max-width: 899px) {
  /* Mobile (audit UX) : une seule rangée défilable au doigt au lieu d'un mur de ~5 rangées. */
  .prepa-nav, .poles-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: 4px; }
  .prepa-nav .seg, .poles-nav .seg { flex: 0 0 auto; scroll-snap-align: start; }
}
.risque-ligne { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 11px; }
.risque-ligne label { display: flex; gap: 5px; align-items: center; font-size: 10.5px; color: var(--muted); }
.risque-ligne select { min-height: 32px; border: 1px solid #D4D4D8; border-radius: var(--r-sm); padding: 4px 8px; }

/* Texte réservé aux lecteurs d'écran (WCAG — l'état des étapes n'est pas porté que par ✓/·). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ----- Feuille « Plus » (mobile) : sections hors nav basse (audit UX) -------- */
.feuille {
  border: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  margin: 0 0 0 auto; margin-right: auto; position: fixed; left: 0; right: 0;
  bottom: 0; top: auto; width: 100%; max-width: 560px; background: var(--paper); color: var(--ink);
  box-shadow: 0 -8px 30px rgba(0,0,0,.18);
}
.feuille::backdrop { background: rgba(0,0,0,.4); }
.feuille-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.feuille-fermer { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); min-height: 44px; min-width: 44px; }
/* Titre de groupe intermédiaire dans la feuille « Plus » (animateur). */
.feuille-sec { font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin: 10px 2px 4px; }
.feuille-sec:first-of-type { margin-top: 2px; }

.feuille-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: var(--surface); border-radius: var(--r); padding: 12px 14px;
  margin-bottom: 6px; font-family: var(--titres); font-size: 13px; font-weight: 600; color: var(--ink);
  cursor: pointer; min-height: 48px;
}
.feuille-item.on { background: var(--rail); color: #fff; }

/* ----- Confort tactile & lisibilité sur mobile (audit UX) -------------------- */
@media (max-width: 899px) {
  /* Cibles tactiles ≥ 44 px sur les commandes primaires (spec §11b). */
  .seg { min-height: 44px; padding: 10px 14px; font-size: 12px; }
  .btn { min-height: 44px; }
  .field input, .field select, .field textarea { min-height: 44px; }
  .risque-ligne select { min-height: 44px; }
  /* Typographie de contenu plus lisible (labels, aides, sous-titres). */
  .field label { font-size: 12.5px; }
  .help, .sub, .risque-ligne label { font-size: 12px; }
  .aide, .note { font-size: 12.5px; }
}

/* Accordéons des formulaires longs (audit UX — l'étude de marché empilait 42 champs). */
details.form-section > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 34px; }
details.form-section > summary::before { content: "▸"; color: var(--acc); font-size: 12px; transition: transform .15s; }
details.form-section[open] > summary::before { transform: rotate(90deg); }
details.form-section > summary::-webkit-details-marker { display: none; }
details.form-section > summary h4 { margin: 0; }
@media (prefers-reduced-motion: reduce) { details.form-section > summary::before { transition: none; } }

/* ----- Écran de transition plein écran (passage de trimestre — demande UX) --- */
.transition {
  border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: linear-gradient(160deg, var(--rail) 0%, #1E1B4B 60%, #312E81 100%); color: #fff;
}
.transition::backdrop { background: rgba(0, 0, 0, .5); }
.transition-corps {
  position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; gap: 18px; padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  max-width: 720px; margin: 0 auto;
  animation: transition-entree .45s ease-out;
}
@keyframes transition-entree { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .transition-corps { animation: none; } }
.transition-eyebrow {
  font-family: var(--titres); font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #A5B4FC;
}
.transition-titre { font-family: var(--titres); font-size: clamp(26px, 6vw, 42px); font-weight: 700; color: #fff; text-wrap: balance; }
.transition-texte { color: #C7D2FE; font-size: 14px; max-width: 52ch; }
.transition-kpis { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 10px; width: 100%; max-width: 480px; }
@media (min-width: 720px) { .transition-kpis { grid-template-columns: repeat(4, 1fr); max-width: none; } }
.transition-kpi {
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--r-lg); padding: 12px 10px; display: flex; flex-direction: column; gap: 4px;
}
.transition-kpi span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #A5B4FC; }
.transition-kpi b { font-family: var(--titres); font-size: 18px; font-variant-numeric: tabular-nums; color: #fff; }
.transition-kpi b.pos { color: #86EFAC; }
.transition-kpi b.neg { color: #FCA5A5; }
.transition-kpi i { font-style: normal; font-size: 10px; }
.transition-actus { display: flex; flex-direction: column; gap: 6px; max-width: 56ch; }
.transition-actus p { font-size: 12.5px; color: #C7D2FE; }
.transition-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.transition-fermer {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px;
  border: 0; background: rgba(255, 255, 255, .1); color: #E0E7FF; font-size: 16px;
  min-width: 44px; min-height: 44px; border-radius: 999px; cursor: pointer;
}

/* ----- Modale d'aide (Bibliothèque depuis un formulaire — audit UX) ---------- */
.modale {
  border: 0; border-radius: var(--r-lg); padding: 0; width: min(720px, calc(100vw - 24px));
  max-height: 86dvh; background: var(--paper); color: var(--ink);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .25);
}
.modale::backdrop { background: rgba(0, 0, 0, .45); }
.modale-tete {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--paper); z-index: 1;
}
.modale-corps { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; max-height: calc(86dvh - 54px); }


/* ----- Feedback de navigation (audit polish #3/#4) ---------------------------- */
/* Barre de progression fine en haut pendant TOUTE requête htmx (classe posée par htmx sur body). */
body.htmx-request::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 999;
  background: linear-gradient(90deg, var(--acc), #818CF8, var(--acc));
  background-size: 200% 100%;
  animation: barre-charge 1.1s linear infinite;
}
@keyframes barre-charge { from { background-position: 200% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { body.htmx-request::before { animation: none; } }
/* Transition de section propre : fondu + léger glissement (sortie vers le bas, entrée depuis le bas). */
#zone-principale { transition: opacity 130ms ease, transform 130ms ease; }
#zone-principale.htmx-swapping { opacity: 0; transform: translateY(6px); }
#zone-principale.htmx-settling { opacity: 1; transform: none; }

/* Zones rafraîchies EN DIRECT par le polling (console, décisions) : pulsation très douce le temps
   du fetch — signale le chargement sans faire clignoter (propre). */
#console-tableau.htmx-request, #decisions-zone.htmx-request, #transition-contenu.htmx-request {
  animation: pulse-chargement 1s ease-in-out infinite;
}
@keyframes pulse-chargement { 50% { opacity: .6; } }

@media (prefers-reduced-motion: reduce) {
  #zone-principale { transition: none; }
  #zone-principale.htmx-swapping { opacity: 1; transform: none; }
  #console-tableau.htmx-request, #decisions-zone.htmx-request, #transition-contenu.htmx-request { animation: none; }
}
/* Boutons désactivés pendant une requête (hx-disabled-elt) : l'état se VOIT. */
.btn:disabled { opacity: .55; cursor: wait; }
/* Bascule libellé/indicateur dans un bouton pendant la requête (hx-indicator="this"). */
.btn.htmx-request .si-defaut { display: none; }
.btn .htmx-indicator { display: none; }
.btn.htmx-request .htmx-indicator { display: inline-flex; align-items: center; gap: 6px; }

/* Petit spinner monochrome (dans les indicateurs de boutons). */
.spin {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin-rot .7s linear infinite; vertical-align: -2px;
}
@keyframes spin-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 1.6s; } }

/* ----- Podium de fin de partie (audit polish #6 — pensé pour la projection) --- */
.podium-page { max-width: 860px; margin: 0 auto; }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: end; margin: 22px 0 16px; }
.podium-marche { text-align: center; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.podium-rang {
  font-family: var(--titres); font-weight: 700; font-size: 30px; color: var(--muted);
}
.podium-nom { font-family: var(--titres); font-weight: 700; font-size: clamp(15px, 2.6vw, 22px); }
.podium-chiffres { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.podium-socle { border-radius: var(--r) var(--r) 0 0; background: linear-gradient(180deg, var(--acc), #3730A3); }
.podium-1 .podium-socle { height: 150px; }
.podium-2 .podium-socle { height: 104px; background: linear-gradient(180deg, #6366F1, #4338CA); }
.podium-3 .podium-socle { height: 72px; background: linear-gradient(180deg, #818CF8, #4F46E5); }
.podium-1 .podium-rang { color: #B45309; }
/* Masqué tant que non révélé : nom flouté, socle grisé — le suspense se pilote au clic. */
.podium-marche:not(.revele) .podium-nom,
.podium-marche:not(.revele) .podium-chiffres { filter: blur(9px); opacity: .55; }
.podium-marche:not(.revele) .podium-socle { background: var(--line); }
.podium-marche .podium-nom, .podium-marche .podium-socle, .podium-marche .podium-chiffres {
  transition: filter .5s ease, opacity .5s ease, background .5s ease;
}
.podium-marche.revele .podium-socle { animation: podium-monte .55s ease-out; transform-origin: bottom; }
@keyframes podium-monte { from { transform: scaleY(.4); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .podium-marche:not(.revele) .podium-nom, .podium-marche:not(.revele) .podium-chiffres { filter: none; opacity: 1; }
  .podium-marche:not(.revele) .podium-socle { background: linear-gradient(180deg, var(--acc), #3730A3); }
  .podium-marche.revele .podium-socle { animation: none; }
  .podium-controles { display: none; }
}
@media print {
  .podium-marche .podium-nom, .podium-marche .podium-chiffres { filter: none !important; opacity: 1 !important; }
  .podium-controles { display: none; }
}
.podium-controles { display: flex; gap: 10px; justify-content: center; margin: 8px 0 16px; }

/* Radar du profil de compétences (audit polish #9). */
.radar-boite { display: flex; justify-content: center; margin: 8px 0 4px; }

/* ----- Certificat imprimable (audit polish #9) -------------------------------- */
.certificat { max-width: 720px; margin: 0 auto; background: var(--paper); padding: 28px; }
.certificat-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--acc); padding-bottom: 12px; margin-bottom: 20px; }
.certificat-mention { font-size: 11px; color: var(--muted); text-align: right; max-width: 46ch; }
.certificat-nom { font-family: var(--titres); font-size: 30px; margin: 4px 0; }
.certificat-sous { color: var(--muted); font-size: 13px; }
.certificat-contexte { font-size: 12.5px; color: var(--muted); margin: 6px 0 12px; }
.certificat-score { font-size: 15px; margin-bottom: 8px; }
.certificat-radar { display: flex; justify-content: center; margin: 6px 0 14px; }
.certificat-table { width: 100%; }
.certificat-pied { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 12px; }
.certificat-signature { display: flex; justify-content: space-between; margin-top: 26px; font-size: 12px; color: var(--muted); }
.certificat-actions { display: flex; gap: 10px; margin-top: 18px; }
@media print {
  .rail, .bnav, .topbar, .certificat-actions { display: none !important; }
  body { background: #fff; }
  .certificat { max-width: none; padding: 0; }
  .zone { padding: 0; max-width: none; }
}

/* Aventure en chiffres + breaking news (transition — audit polish #11). */
.transition-aventure { width: 100%; max-width: 640px; background: rgba(255, 255, 255, .06); border-radius: var(--r-lg); padding: 12px 14px; }
.transition-records { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: #C7D2FE; margin-top: 6px; }
.transition-records b { color: #fff; font-variant-numeric: tabular-nums; }
.transition-breaking {
  display: flex; align-items: center; gap: 10px; max-width: 56ch; text-align: left;
  background: rgba(220, 38, 38, .18); border: 1px solid rgba(252, 165, 165, .4);
  border-radius: var(--r); padding: 9px 12px; font-size: 13px; color: #FECACA;
}
.transition-breaking-tag {
  background: #DC2626; color: #fff; font-family: var(--titres); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; padding: 3px 8px; border-radius: 4px; white-space: nowrap;
}

/* Lobby en mode projection (audit polish #10). */
.resultat-code--geant { font-size: clamp(34px, 7vw, 56px); letter-spacing: .16em; }
.projection-code {
  font-family: var(--titres); font-weight: 700; font-size: clamp(64px, 16vw, 160px);
  letter-spacing: .18em; color: #fff; font-variant-numeric: tabular-nums;
}

/* États vides engageants (audit polish #17) : jamais une ligne sèche au premier contact. */
.etat-vide { text-align: center; padding: 34px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.etat-vide .ico { font-size: 30px; opacity: .8; }
.etat-vide p { color: var(--muted); font-size: 13px; max-width: 44ch; }

/* Bandeau vitrine de l'accueil (audit polish #17). */
.vitrine { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin: 18px 0 4px; }
.vitrine-item { text-align: center; }
.vitrine-item b { font-family: var(--titres); font-size: 20px; display: block; }
.vitrine-item span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* Icônes SVG inline (audit polish #16) : alignement optique avec le texte. */
svg.ico { vertical-align: -3px; flex-shrink: 0; }
.rail-item svg.ico, .bnav-item svg.ico { vertical-align: -4px; }

/* Contenu embarqué dans un accordéon Documents (Bibliothèque, guide) : marge intérieure propre. */
.doc-embed { padding: 12px 14px; }
.doc-embed > .vhead:first-child, .doc-embed > *:first-child { margin-top: 0; }

/* ----- Journal de session (historique interventions & événements) ------------- */
.journal { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.journal-ligne {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline;
  padding: 8px 10px; border-radius: var(--r); background: var(--surface);
}
.journal-tag {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-family: var(--titres); font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted);
}
.journal-msg { font-size: 12.5px; }
.journal-meta { font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.journal-animateur { border-left: 3px solid var(--acc); }
.journal-alerte { border-left: 3px solid var(--bad, #DC2626); }
.journal-evenement { border-left: 3px solid #B45309; }
.journal-systeme { border-left: 3px solid var(--line); }
@media (max-width: 620px) {
  .journal-ligne { grid-template-columns: 1fr; gap: 3px; }
  .journal-meta { justify-self: start; }
}

/* ----- Modale de confirmation (remplace window.confirm — demande utilisateur) -- */
.modale-confirm {
  border: 0; border-radius: var(--r-lg); padding: 0; width: min(440px, calc(100vw - 24px));
  background: var(--paper); color: var(--ink); box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
}
.modale-confirm::backdrop { background: rgba(0, 0, 0, .45); }
.modale-confirm-corps { padding: 20px 22px calc(18px + env(safe-area-inset-bottom)); margin: 0; }
.modale-confirm-corps h2 { font-family: var(--titres); font-size: 18px; margin-bottom: 8px; }
.modale-confirm-corps p { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.modale-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modale-confirm-actions .btn { min-height: 44px; }

/* « Au prochain trimestre » sur la console animateur (demande utilisateur). */
.form-card.avenir { border-left: 3px solid var(--acc); }
.form-card.avenir > strong { display: inline-flex; align-items: center; gap: 6px; }

/* ----- Décisions en direct (animateur — demande utilisateur) ------------------ */
.dec-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.dec-carte { padding: 12px 14px; }
.dec-carte.dec-attente { opacity: .72; }
.dec-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pill--ok { background: #DCFCE7; color: #166534; }
.dec-groupe { margin-top: 8px; }
.dec-pole { display: block; font-family: var(--titres); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--acc); margin-bottom: 3px; }
.dec-champ { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 1px 0; }
.dec-champ span { color: var(--muted); }
.dec-champ b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ----- Écran de décision allégé (retour utilisateur) -------------------------- */
/* Barre des pôles : conteneur flèches ‹ › + zone défilante sur UNE ligne (mobile ET bureau). */
.poles-barre { display: flex; align-items: center; gap: 4px; max-width: 100%; margin-bottom: 11px; }
.poles-filante {
  flex: 1 1 auto; min-width: 0;              /* min-width:0 = confine le flex, plus de débordement */
  margin-bottom: 0;
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none; scrollbar-width: none;   /* piste masquée : on navigue aux flèches/au doigt */
}
.poles-filante::-webkit-scrollbar { display: none; }
.poles-filante .seg { flex: 0 0 auto; scroll-snap-align: start; }
.poles-fleche {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--paper); color: var(--acc); font-size: 17px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  transition: background-color .12s, border-color .12s;
}
.poles-fleche:hover { background: var(--acc-soft); border-color: #C7D2FE; }
/* Label + bouton d'aide alignés sur une ligne. */
.lbl-aide { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.lbl-aide > label { margin-bottom: 0; }
/* Bouton « ? » d'aide à la décision : petit rond discret, pastel au survol. */
.aide-btn {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--acc); font-family: var(--titres); font-weight: 700;
  font-size: 11px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; padding: 0; transition: background-color .12s, color .12s, border-color .12s;
}
.aide-btn:hover { background: var(--acc-soft); border-color: #C7D2FE; }
.aide-btn--inline { cursor: default; vertical-align: -3px; }
/* Contenu d'une fiche d'aide dans la modale. */
.aide-fiche h2 { font-family: var(--titres); font-size: 17px; margin-bottom: 8px; }
.aide-fiche h3 { font-family: var(--titres); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--acc); margin: 12px 0 3px; }
.aide-fiche p { font-size: 13px; color: var(--ink); margin: 0; }

/* ----- Calendrier de la demande (saisonnalité) — Cabinet d'études + écran de saisie -------------- */
.calsaison { overflow-x: auto; }                    /* secours : jamais de débordement de page */
.calsaison-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.calsaison-tbl th, .calsaison-tbl td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.calsaison-tbl th[scope="row"] { font-family: var(--titres); font-weight: 600; }  /* peut passer à la ligne */
.calsaison-per { white-space: nowrap; }             /* le libellé de période reste d'un bloc */
.calsaison-tbl tr.ici { background: var(--acc-soft); }
.calsaison-val { display: flex; align-items: center; gap: 6px; }
.calsaison-val .num { font-variant-numeric: tabular-nums; }
.calsaison meter { width: 52px; flex: 0 0 auto; height: 8px; -webkit-appearance: none; appearance: none; }
.calsaison meter::-webkit-meter-bar { background: var(--acc-soft); border: 0; border-radius: 4px; height: 8px; }
.calsaison meter::-webkit-meter-optimum-value { background: var(--acc); border-radius: 4px; }
.calsaison meter::-moz-meter-bar { background: var(--acc); border-radius: 4px; }
.pill--ici { background: var(--acc); color: #fff; margin-left: 5px; }
.calsaison-niv { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.calsaison-niv--pic { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.calsaison-niv--haute { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.calsaison-niv--normale { background: var(--surface); color: var(--muted); }
.calsaison-niv--creux { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }

/* ----- Sliders de niveau (retour utilisateur : bornés + indicateur qualitatif live) ------------- */
.champ-slider .slider { display: flex; align-items: center; gap: 12px; }
.champ-slider input[type="range"] { flex: 1 1 auto; min-width: 0; accent-color: var(--acc); height: 30px; cursor: pointer; }
.slider-out { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-width: 104px; justify-content: flex-end; }
.slider-out .num { font-family: var(--titres); font-weight: 700; font-size: 13px; }
.slider-niv { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; background: var(--acc-soft); color: var(--acc-press); white-space: nowrap; }

/* ----- Renseignements du marché : chaque étude achetée = une carte distincte ---------------------- */
.rens-carte { border: 1px solid var(--line); border-left: 3px solid var(--acc); border-radius: var(--r-sm);
  padding: 9px 11px; margin: 10px 0; background: var(--surface); }
.rens-carte-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rens-carte-tete strong { font-family: var(--titres); font-size: 12.5px; }
.rens-carte-tete .pill { margin-left: auto; background: var(--good-bg); color: var(--good); border: 1px solid var(--good-line); }
.rens-cal { border-left-color: var(--muted); }

/* ----- Console d'administration (super-admin) ----------------------------------- */
.admin-vhead-fin { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th, .admin-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.admin-table th { font-family: var(--titres); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.admin-table tbody tr:hover { background: var(--surface); }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-actions form { margin: 0; }
.admin-danger:hover { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.btn--sm { padding: 5px 11px; font-size: 11px; min-height: 32px; border-radius: var(--r-sm); }
.admin-nav { display: flex; gap: 4px; }
.admin-nav a { padding: 5px 12px; border-radius: var(--r-sm); font-weight: 600; font-size: 12px; }
.admin-nav a.on { background: var(--acc-soft); color: var(--acc-press); }
.admin-form-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.admin-form-inline .field { margin: 0; }
.opt-titre { display: block; font-weight: 600; margin-bottom: 6px; }
.opt { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin: 4px 0; cursor: pointer; }
.opt input { width: auto; margin: 0; }
.lien-path { font-family: monospace; font-size: 11px; word-break: break-all; }

/* --- Admin mobile : tables en cartes empilées, nav scrollable, cibles tactiles --- */
@media (max-width: 720px) {
  .admin-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; width: 100%; flex-wrap: nowrap; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav a { white-space: nowrap; flex: 0 0 auto; }
  .admin-vhead-fin { margin-left: 0; width: 100%; justify-content: space-between; }
  .table-scroll { overflow-x: hidden; }
  .admin-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; }
  .admin-table, .admin-table tbody, .admin-table tr { width: 100%; max-width: 100%; }
  .admin-table tr { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 12px; padding: 4px 12px; background: var(--card); box-sizing: border-box; }
  .admin-table tbody tr:hover { background: var(--card); }
  /* Cellule = libellé au-dessus, valeur en dessous (pleine largeur) → aucun débord, coupure des liens longs */
  .admin-table td { border: none; border-bottom: 1px solid var(--line); padding: 8px 0; white-space: normal; text-align: left; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
  .admin-table td::before { content: attr(data-label); display: block; font-family: var(--titres); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 3px; }
  .admin-table td:last-child { border-bottom: none; }
  .admin-table td.admin-actions-cell { padding-top: 10px; }
  .admin-actions { gap: 8px; }
  .admin-actions .btn--sm { min-height: 40px; padding: 8px 14px; font-size: 12px; flex: 1 1 42%; }
  .lien-path { word-break: break-all; }
}

/* --- Modale pilotée par Alpine (overlay) : réutilise .modale / .modale-tete / .modale-corps --- */
.modale-fond { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.espace-bas { margin-bottom: 14px; }

/* ================= Espace administrateur : identité couleur + nav basse mobile ================= */
/* Accent TEAL propre à l'admin (différenciation nette de l'indigo joueur/animateur) */
.admin-space {
  --acc: #0F766E; --acc-press: #0B5A54; --acc-soft: #CCFBF1; --acc-hover: rgba(15, 118, 110, .10);
}
.admin-space .eyebrow { color: var(--acc-press); }
/* Liseré teal en tête de page → repère visuel « zone admin » */
.admin-space .content { border-top: 3px solid var(--acc); }

/* Nav basse admin : masquée sur bureau, fixe en bas sur mobile (le haut est masqué) */
.admin-bnav { display: none; }
@media (max-width: 899px) {
  .admin-space .admin-nav { display: none; }               /* la nav du haut disparaît sur mobile */
  .admin-space .content { padding-bottom: calc(60px + env(safe-area-inset-bottom) + 18px); }
  .admin-bnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--paper); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 14px rgba(0, 0, 0, .06);
  }
  .admin-bnav a {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 4px; min-height: 56px; font-size: 11px; font-weight: 600;
    color: var(--muted); border-top: 2px solid transparent; text-align: center;
  }
  .admin-bnav a.on { color: var(--acc); border-top-color: var(--acc); font-weight: 700; }
  .admin-bnav a .ico { display: block; }
}

/* --- Confirmation destructive : rouge + icône d'alerte --- */
.btn--danger { background: var(--bad); color: #fff; }
.btn--danger:hover { background: var(--bad); filter: brightness(.92); color: #fff; }
.ico-alerte { color: var(--bad); display: inline-flex; vertical-align: -4px; margin-right: 4px; }

/* --- QR code (modale lien d'accès) --- */
.qr-zone { display: flex; justify-content: center; padding: 8px 0 4px; }
.qr-zone img { width: 220px; height: 220px; image-rendering: pixelated; background: #fff; border-radius: 6px; }

/* --- Bibliothèque scénarios (détail lecture seule) --- */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 18px; margin: 8px 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 5px 0; }
.kv dt { color: var(--muted); font-size: 11.5px; }
.kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.flag-grid { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 6px; }
.flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 9px; }
.flag-k { color: var(--muted); }
.ico-ok { color: var(--good); display: inline-flex; }
.ico-off { color: var(--muted); display: inline-flex; opacity: .6; }
.liste-sobre { margin: 4px 0 8px; padding-left: 18px; font-size: 12.5px; }
.liste-sobre li { margin: 2px 0; }
.json-brut { max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; font-size: 11.5px; margin-top: 8px; }

/* --- Menu d'actions (console admin) : 1 action primaire + « Actions » en surimpression --- */
.admin-menu { min-width: 0; position: relative; }
/* Le conteneur de table du menu ne rogne pas l'overlay (sinon clippé par overflow). */
.admin-scroll-menu { overflow: visible; }
.menu-liste {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 50; min-width: 210px;
  display: flex; flex-direction: column; gap: 3px; padding: 5px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow); max-width: 320px;
}
.menu-liste form { margin: 0; }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 9px 11px; border: 0; background: var(--paper); cursor: pointer;
  font-family: var(--texte); font-size: 12.5px; font-weight: 600; color: var(--ink);
  border-radius: var(--r-sm); min-height: 40px; text-decoration: none;
}
.menu-item:hover { background: var(--acc-soft); color: var(--acc-press); }
.menu-danger { color: var(--bad); }
.menu-danger:hover { background: var(--bad-bg); color: var(--bad); }
