/* ============================================================================
   codex.css — design system PARTAGÉ des cours « codex/ ».
   Source unique de vérité. À charger APRÈS le <style> de la page : ses :root
   canoniques l'emportent et repeignent la page via ses variables.
   THÈME / PALETTE = wyckoff-1.html (référence).
   MENU gauche = chapter-nav (modèle chapter-nav).
   ========================================================================== */

/* ---- Tokens canoniques = wyckoff-1 (+ alias des autres lignées) ---- */
:root {
  color-scheme: dark;
  --bg: #06070a; --bg-1: #080a10; --bg-2: #0b0e15;
  --text: #e9edf3; --bright: #f4f6f9; --body: #c3c9d4;
  --muted: #9aa0ac; --muted2: #828a96; --faint: #6b7280;
  --line: rgba(140,142,152,0.14); --line-2: rgba(140,142,152,0.22); --line2: rgba(140,142,152,0.22);
  --mint: #22d3a3; --mint-2: #78b996; --mint-3: #4a8064; --mint-soft: rgba(34,211,163,0.12);
  --green: #78b996; --green-2: #22d3a3; --accent: #22d3a3;
  --red: #ff5577; --red-2: #ff6b85; --ruby: #ff5577; --red-soft: rgba(255,85,119,0.12); --amber: #f0af76;
  --blue: #94a8e8; --sky: #94a8e8; --gold: #e0b56e; --gold-2: #e0b56e; --violet: #cd91dc;
  --panel: rgba(15,18,26,0.78);
  --shadow: 0 24px 90px rgba(0,0,0,0.55);
  --sb-w: 288px; --max: 1180px; --pad: clamp(20px, 4vw, 56px);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---- Base (wyckoff) ---- */
html { scroll-behavior: smooth; scroll-padding-top: 40px; background: var(--bg); }
body { font-family: var(--sans); color: var(--text); }
::selection { background: rgba(34,211,163,0.26); color: #fff; }
h1, h2, h3, h4 { font-family: var(--serif); letter-spacing: -0.02em; color: var(--bright); }
.cn-anchor-offset { scroll-margin-top: 92px; }

/* ---- Liens glossaire (uniformisés) ---- */
/* spécificité .prose a.gloss-link (0,2,1) pour battre le `.prose a{border-bottom:solid}` inline (0,1,1) de chaque codex → pointillé partout */
.prose a.gloss-link, .gloss-link { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(120,185,150,.55); cursor: pointer; transition: border-color .15s var(--ease), color .15s var(--ease); }
.prose a.gloss-link:hover, .gloss-link:hover { color: var(--mint); border-bottom-color: var(--mint); border-bottom-style: solid; }
.gloss-link:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 2px; }

/* ---- Réconciliation layout : la sidebar devient un OVERLAY (ne pousse plus) ---- */
.main { margin-left: 0 !important; }
/* anciennes sidebars / chromes mobiles des lignées : masqués (codex.js reprend le relais) */
.cn-hidden { display: none !important; }
.menu-btn, .scrim, .sb-foot { display: none !important; }
/* psychologie : .shell réservait une 1re piste 268px pour l'ancienne nav ; comme
   display:none ne libère pas la track CSS-grid, le contenu tombait dedans (268px). */
.shell { grid-template-columns: 1fr !important; }

/* ---- Largeur de colonne de lecture unifiée → 1000px ----
   Chaque lignée pilote sa colonne autrement : .wrap (wyckoff), ou une variable
   propre (--read le-risque, --col psychologie, --content wyckoff-2, --maxw
   analyse-technique). On les aligne toutes ici. Chaque var n'est définie que sur
   sa page et ne sert QU'À la largeur de lecture (vérifié) → aucun effet de bord. */
:root { --read: 1000px; --col: 1000px; --content: 1000px; --maxw: 1000px; }
.wrap { max-width: 1000px !important; }
.prose { max-width: 1000px !important; } /* le-risque & psychologie plafonnent .prose en `ch` */
.fig { max-width: 1100px !important; }
.fig--full { max-width: 1180px !important; }
/* analyse-technique : .layout est un flex (contenu + ancienne nav) ; nav masquée,
   le contenu restait collé à gauche → on recentre la colonne dans le flex. */
.layout { justify-content: center !important; }

/* ---- Épingle (desktop) : POUSSE le contenu à droite pour tout voir (pas de recouvrement) ---- */
body { transition: padding-left .32s var(--ease); }
@media (min-width: 981px) { body.cn-pinned { padding-left: 300px; } }

/* ---- Barre de progression ---- */
.cn-progress { position: fixed; left: 0; top: 0; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); z-index: 60; background: linear-gradient(90deg, var(--mint), var(--blue), var(--red)); will-change: transform; }

/* ============================================================================
   SIDEBAR CHAPITRES — rétractable, fond transparent + blur, scroll-spy.
   Modèle chapter-nav (épingle mémorisée, auto-scroll, tiroir).
   ========================================================================== */
.chapter-nav {
  position: fixed; left: 0; top: 22px; bottom: 22px; z-index: 54;
  width: 264px; padding: 0 14px 18px;   /* padding-top à 0 : .cn-sticky couvre le haut à ras (pas de fuite de texte sous le bloc épinglé) */
  border: 1px solid var(--line); border-left: none; border-radius: 0 18px 18px 0;
  background: rgba(8, 10, 16, 0.72);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.32);
  overflow: hidden auto; overscroll-behavior: contain;
  /* rétractée : ne laisse que le bord (= padding, propre) ; panneau translucide+blur */
  transform: translateX(calc(-100% + 13px)); opacity: 1;
  transition: transform .3s var(--ease), box-shadow .3s ease;
  scrollbar-width: thin; scrollbar-color: rgba(140,142,152,.3) transparent;
}
.chapter-nav::-webkit-scrollbar { width: 7px; }
.chapter-nav::-webkit-scrollbar-thumb { background: rgba(140,142,152,.28); border-radius: 99px; }
/* poignée fine, douce, CENTRÉE (remplace la barre tri-color pleine hauteur) */
.chapter-nav::after {
  content: ""; position: fixed; left: 5px; top: 50%; margin-top: -24px;
  width: 3px; height: 48px; border-radius: 99px; pointer-events: none;
  background: linear-gradient(180deg, rgba(34,211,163,.6), rgba(148,168,232,.5));
  box-shadow: 0 0 14px rgba(34,211,163,.22);
  opacity: .85; transition: opacity .3s ease, height .3s var(--ease);
}
/* body.cn-near : ouverture anticipée quand le curseur approche le bord gauche (~2 cm, piloté en JS) */
/* :has(:focus-visible) plutôt que :focus-within : un CLIC souris sur un lien/bouton du menu n'est PAS focus-visible →
   le menu se referme quand on retire le curseur (avant : le lien cliqué gardait le focus → :focus-within le laissait
   ouvert jusqu'à un clic ailleurs). Le clavier (Tab) ET le champ de recherche (input texte) RESTENT focus-visible → menu maintenu ouvert. */
.chapter-nav:hover, .chapter-nav:has(:focus-visible), body.cn-pinned .chapter-nav, body.cn-near .chapter-nav, body.cn-peek .chapter-nav { transform: translateX(0); box-shadow: 0 24px 90px rgba(0,0,0,0.5); }
.chapter-nav:hover::after, .chapter-nav:has(:focus-visible)::after, body.cn-pinned .chapter-nav::after, body.cn-near .chapter-nav::after, body.cn-peek .chapter-nav::after { opacity: 0; }

.chapter-nav__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px 8px; }
.chapter-nav__title { margin: 0; color: var(--muted2); font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; }
.chapter-nav__pin { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; line-height: 1; transition: color .2s, border-color .2s, background .2s, transform .2s; }
.chapter-nav__pin:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,.05); }
body.cn-pinned .chapter-nav__pin { color: var(--mint); border-color: rgba(34,211,163,.4); background: rgba(34,211,163,.08); }
.chapter-nav__act { margin: 14px 0 4px; padding: 0 10px; color: var(--gold); font-family: var(--mono); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.chapter-nav a { display: grid; grid-template-columns: 26px 1fr; gap: 9px; align-items: baseline; padding: 8px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-family: var(--sans); font-size: 0.84rem; font-weight: 450; line-height: 1.26; transition: color .2s, background .2s, transform .2s; }
.chapter-nav a:hover { color: var(--text); background: rgba(255,255,255,0.05); transform: translateX(2px); }
.chapter-nav a.is-current { color: var(--mint); background: rgba(34,211,163,0.08); }
.chapter-nav a.is-current span { color: var(--mint); }
.chapter-nav a span { color: var(--faint); font-family: var(--mono); font-size: 0.64rem; }

/* ---- Sous-sommaire déroulant : sous-titres (≥2) de la section active / survolée, un seul ouvert ---- */
.cn-item--exp > a { position: relative; padding-right: 26px; }                  /* place pour le chevron */
.cn-item--exp > a::after { content: ''; position: absolute; right: 11px; top: 50%; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-50%) rotate(45deg); opacity: .38; transition: transform .25s var(--ease), opacity .2s; } /* chevron ▸, centré vertical (libellés sur 1 ou 2 lignes) */
.cn-item--exp.is-open > a::after { transform: translateY(-50%) rotate(225deg); opacity: .8; } /* ▾ déployé */
.cn-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s var(--ease); } /* 0fr→1fr : hauteur auto animable, sans max-height magique */
.cn-item--exp.is-open > .cn-sub { grid-template-rows: 1fr; }
.cn-sub__list { overflow: hidden; min-height: 0; margin: 2px 0 5px; padding: 0; list-style: none; }
/* NB : sélecteurs portés par `.chapter-nav a.cn-sub__a` (spécificité 0,2,1) pour BATTRE `.chapter-nav a`
   (0,1,1) — sinon le `display:grid; grid-template-columns:26px 1fr` des liens de section s'applique aux
   sous-liens et fait tomber leur texte dans la colonne 26px → 1 mot par ligne. */
.chapter-nav a.cn-sub__a { position: relative; display: flex; align-items: baseline; gap: 6px; padding: 4px 10px 4px 40px; color: var(--muted); font-size: 0.78rem; font-weight: 450; line-height: 1.25; border-radius: 8px; opacity: .82; transition: color .15s, background .15s, opacity .15s; }
.chapter-nav a.cn-sub__a::before { content: ''; position: absolute; left: 25px; top: 11px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .45; }
.chapter-nav a.cn-sub__a:hover { color: var(--text); background: rgba(255,255,255,.045); opacity: 1; transform: none; }
.chapter-nav a.cn-sub__a.is-current { color: var(--mint); opacity: 1; }
.chapter-nav a.cn-sub__a.is-current::before { background: var(--mint); opacity: 1; }
.chapter-nav a.cn-sub__a .cn-sub__tag { margin-left: auto; flex: 0 1 auto; min-width: 0; padding-left: 8px; font-family: var(--mono); font-size: 0.6rem; letter-spacing: .03em; color: var(--mint); opacity: .72; } /* sigle (ex. PS · PSY) — bat `.chapter-nav a span` ; RÉTRÉCIT (flex 0 1 auto) si long (« LPS · LPSY · l'entrée ») au lieu de déborder */
@media (prefers-reduced-motion: reduce) { .cn-sub, .cn-item--exp > a::after { transition: none; } }

/* ---- Hamburger + voile (mobile) ---- */
.cn-burger { display: none; position: fixed; left: 14px; bottom: 16px; z-index: 56; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(8,10,16,0.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--text); cursor: pointer; place-items: center; box-shadow: var(--shadow); }
.cn-burger svg { width: 20px; height: 20px; }
.cn-scrim { display: none; position: fixed; inset: 0; z-index: 53; background: rgba(2,3,6,.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; transition: opacity .25s ease; }

@media (max-width: 980px) {
  .chapter-nav { transform: translateX(-104%); opacity: 1; top: 0; bottom: 0; width: min(82vw, 300px); padding-top: 0; }
  .chapter-nav::after { display: none; }
  .chapter-nav:hover, .chapter-nav:focus-within { transform: translateX(-104%); }
  body.cn-open .chapter-nav { transform: translateX(0); box-shadow: 0 24px 90px rgba(0,0,0,0.6); }
  body.cn-open .cn-scrim { display: block; opacity: 1; }
  .cn-burger { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { transition: none; }  /* le contenu se resserre instantanément (pas de glissement padding-left) ; preserveReadingPosition lit dur=0 → recalage en une passe */
  .chapter-nav, .chapter-nav a, .cn-scrim, .chapter-nav__pin { transition: none; }
}

/* ── curseur de rejeu : un point qui retrace le mouvement le long d'un tracé .playline ──
   Markup créé par codex.js (mkPlayhead) à partir de l'opt-in .playline, ou explicite
   <g class="playhead"><circle class="ph-halo"/><circle class="ph-core"/></g>. Style PARTAGÉ
   ici → une seule définition pour toutes les pages codex/. Variantes sémantiques --red/--gold. */
.playhead{ opacity:0; pointer-events:none; filter:drop-shadow(0 0 5px rgba(51,224,168,.85)); }
.playhead .ph-halo{ fill:#33e0a8; opacity:.16; }
.playhead .ph-core{ fill:#eafff7; }
.playhead--red{ filter:drop-shadow(0 0 5px rgba(255,85,119,.85)); }
.playhead--red .ph-halo{ fill:#ff5577; }
.playhead--red .ph-core{ fill:#ffe9ef; }
.playhead--gold{ filter:drop-shadow(0 0 5px rgba(224,181,110,.85)); }
.playhead--gold .ph-halo{ fill:#e0b56e; }
.playhead--gold .ph-core{ fill:#fff4e0; }
@media (prefers-reduced-motion:reduce){ .playhead{ display:none; } }

/* ============================================================================
   RECHERCHE INTRA-COURS — champ épinglé en haut du sommaire. Markup créé par
   codex.js (search()). Le bloc .cn-sticky reste visible au scroll du menu ;
   le surlignage des occurrences se fait via la CSS Custom Highlight API
   (::highlight) → aucune mutation du DOM, donc aucune perturbation des
   animations d'apparition ni des schémas SVG. Source unique = toutes les pages.
   ========================================================================== */
.cn-sticky {
  position: sticky; top: 0; z-index: 3;
  margin: 0 -14px 6px;            /* déborde sur le padding latéral du nav pour masquer les liens qui défilent dessous */
  padding: 14px 14px 10px;        /* fournit lui-même l'espace haut (le nav n'a plus de padding-top) */
  background: rgba(8, 10, 16, 0.97);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.cn-sticky .chapter-nav__head { margin: 12px 4px 0; }

.cn-search { position: relative; display: flex; align-items: center; }
.cn-search__icon { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--muted2); pointer-events: none; }
.cn-search__in {
  width: 100%; box-sizing: border-box; padding: 8px 30px 8px 32px;
  background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--text); font-family: var(--sans); font-size: 0.82rem; line-height: 1.2;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.cn-search__in::placeholder { color: var(--faint); }
.cn-search__in:focus { outline: none; border-color: rgba(34, 211, 163, .5); background: rgba(34, 211, 163, .06); }
.cn-search__in::-webkit-search-cancel-button { -webkit-appearance: none; }  /* on fournit notre propre × */
.cn-search__x { position: absolute; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; } /* 24×24 : cible tactile WCAG 2.5.8 */
.cn-search__x:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

.cn-search__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; padding: 0 2px; }
/* l'attribut [hidden] doit l'emporter sur les display:flex/grid ci-dessus (sinon barre/flèches/× restent visibles) */
.cn-search__bar[hidden], .cn-search__nav[hidden], .cn-search__x[hidden] { display: none; }
.cn-search__count { font-family: var(--mono); font-size: 0.62rem; letter-spacing: .04em; color: var(--muted2); }
.cn-search__nav { display: flex; gap: 4px; }
.cn-search__nav button { width: 26px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; transition: color .15s, border-color .15s, background .15s; } /* ≥ 24px : cible tactile WCAG 2.5.8 */
.cn-search__nav button:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, .05); }
/* affordance de focus clavier (cohérent avec .gloss-link) sur les contrôles recherche + menu */
.cn-search__in:focus-visible, .cn-search__x:focus-visible, .cn-search__nav button:focus-visible, .chapter-nav__pin:focus-visible, .cn-burger:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.chapter-nav a:focus-visible { outline: 2px solid var(--mint); outline-offset: -2px; } /* anneau clavier net, dans le lien arrondi */

/* pastilles de comptage par section : le sommaire devient une carte du terme */
.chapter-nav a { position: relative; }
.chapter-nav a.has-badge { padding-right: 34px; }
/* sélecteur scopé `.chapter-nav a .cn-search-badge` : DOIT l'emporter sur `.chapter-nav a span` (couleur/taille) */
.chapter-nav a .cn-search-badge { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; box-sizing: border-box; border-radius: 99px; background: rgba(34, 211, 163, .2); color: #7af0cf; font-family: var(--mono); font-size: 0.58rem; font-weight: 600; line-height: 1; } /* texte clair sur fond menthe dense → contraste AA */
.chapter-nav a.is-current .cn-search-badge { background: rgba(34, 211, 163, .3); }
/* section DÉPLOYABLE + pastille : le chevron (▸, right:11px) et la pastille se chevauchaient → on décale la pastille à GAUCHE du chevron.
   Préfixe .chapter-nav → spécificité (0,3,1) > la règle générique .chapter-nav a.has-badge (0,2,1) : le 48px gagne par SPÉCIFICITÉ, pas par ordre source (robuste au réordonnancement). */
.chapter-nav .cn-item--exp > a.has-badge { padding-right: 48px; }
.cn-item--exp > a.has-badge .cn-search-badge { right: 24px; }
/* pastille de comptage sur un SOUS-titre : ÉPINGLÉE en haut-droite (place réservée à droite) → TOUJOURS visible,
   même quand le sigle est long (« LPS · LPSY · l'entrée ») : le sigle RÉTRÉCIT/passe à la ligne (cf. flex ci-dessus)
   au lieu de pousser la pastille hors écran. */
.chapter-nav a.cn-sub__a.has-badge { padding-right: 30px; }
.chapter-nav a.cn-sub__a .cn-search-badge { right: 8px; top: 6px; transform: none; }
.cn-search-dim { opacity: .55; transition: opacity .2s var(--ease); }  /* estompe les sections sans occurrence (≥ .55 : libellé reste lisible) */

/* garde le sommaire ouvert pendant la frappe (desktop) */
@media (min-width: 981px) {
  body.cn-searching .chapter-nav { transform: translateX(0); box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5); }
  body.cn-searching .chapter-nav::after { opacity: 0; }
}

/* surlignage SANS mutation du DOM (CSS Custom Highlight API) */
::highlight(codex-find) { background-color: rgba(34, 211, 163, 0.26); color: #eafff7; }            /* exact */
::highlight(codex-find-fuzzy) { background-color: rgba(34, 211, 163, 0.12); color: #cfeede; text-decoration: underline dotted rgba(34, 211, 163, .75); text-underline-offset: 2px; }  /* approché (coquille) */
::highlight(codex-find-cur) { background-color: #e0b56e; color: #06070a; }                          /* occurrence courante */
/* contraste forcé (Windows HCM) : exact & courante partagent la couleur système Highlight → on distingue la courante par un soulignement épais (::highlight n'accepte ni outline ni border) */
@media (forced-colors: active) { ::highlight(codex-find-cur) { text-decoration: underline solid 2px; text-underline-offset: 2px; } }

/* repli si la Custom Highlight API est absente : flash du bloc ciblé */
@keyframes cnFlash { 0% { background: rgba(224, 181, 110, .34); } 100% { background: transparent; } }
.cn-flash { animation: cnFlash 1.2s var(--ease); border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .cn-flash { animation: none; } }

/* ====== schema lightbox (B3-C) — the single canonical styling for the « plein écran » zoom button + the
   modal, hoisted from the per-body inline <style> copies. Mobile-only affordance: the button is display:none
   on desktop, shown ≤760px where a wide diagram would overflow; the scroll-affordance generalises the old
   `.fig.has-zoom .diagram` to `.has-zoom` (so it applies whether the zoom container is the outer .fig or the
   .diagram itself, and gracefully no-ops on bodies without a .diagram/.cap). ====== */
.schema__zoom{ display:none; align-items:center; gap:7px; position:absolute; top:10px; right:38px; z-index:3;
  font-family:'JetBrains Mono',monospace; font-size:.62rem; letter-spacing:.06em; text-transform:uppercase; color:var(--mint); white-space:nowrap;
  background:rgba(6,7,10,.78); border:1px solid rgba(34,211,163,.42); border-radius:10px; padding:9px 13px; cursor:pointer;
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.schema__zoom svg{ width:14px; height:14px; }
.schema__zoom:active{ background:rgba(34,211,163,.16); }
.smodal{ position:fixed; inset:0; z-index:90; display:none; flex-direction:column; padding:12px;
  background:rgba(4,5,8,.96); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
html.smodal-open{ overflow:hidden; }
html.smodal-open .smodal{ display:flex; animation:smodalIn .2s ease; }
@keyframes smodalIn{ from{ opacity:0 } to{ opacity:1 } }
@media (prefers-reduced-motion:reduce){ html.smodal-open .smodal{ animation:none; } }
.smodal__bar{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex:none; padding:2px 4px 10px; }
.smodal__hint{ font-family:'JetBrains Mono',monospace; font-size:.62rem; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.smodal__close{ width:42px; height:42px; flex:none; border-radius:11px; border:1px solid var(--line-2); background:var(--bg-2); color:var(--text); font-size:1.2rem; line-height:1; cursor:pointer; }
.smodal__close:focus-visible{ outline:2px solid var(--mint); outline-offset:2px; }
.smodal__body{ flex:1; overflow:auto; -webkit-overflow-scrolling:touch; display:flex; align-items:center; justify-content:center; --p:1; }
.smodal__body svg{ height:74vh !important; width:auto !important; max-width:none !important; min-width:0 !important; flex:none; }
@media (max-width:760px){
  .has-zoom .diagram, .diagram.has-zoom{ overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:thin; scrollbar-color:rgba(34,211,163,.5) transparent; }
  .has-zoom .diagram > svg[role="img"], .diagram.has-zoom > svg[role="img"]{ min-width:580px; }
  .has-zoom .diagram::-webkit-scrollbar, .diagram.has-zoom::-webkit-scrollbar{ height:5px; }
  .has-zoom .diagram::-webkit-scrollbar-thumb, .diagram.has-zoom::-webkit-scrollbar-thumb{ background:rgba(34,211,163,.5); border-radius:99px; }
  .has-zoom .diagram::-webkit-scrollbar-track, .diagram.has-zoom::-webkit-scrollbar-track{ background:transparent; }
  .has-zoom .cap::before{ content:"↔ glissez (ou « plein écran ») pour lire le schéma · "; color:var(--mint); font-family:'JetBrains Mono',monospace; font-size:.82em; }
  .schema__zoom{ display:inline-flex; }
}
@media (max-width:560px){ .schema__zoom{ right:30px; } }

/* ---- sticky "stage" pacing for scroll-scrubbed diagrams (shared, opt-in) ----
   Wrap a scrubbed figure in <div class="stage" data-scrub-stage style="--stage-h:Nvh"><div class="stage__sticky">…</div></div>:
   the tall stage scrolls while the inner sticky pins the diagram mid-viewport, and codex.js drives the inner
   [data-scrub] --p from the stage's scroll progress (the long, paced "stage" animation, vs. the short viewport band).
   Reduced-motion collapses the stage so the figure shows once, fully drawn. */
.stage{ position:relative; height:var(--stage-h, 230vh); }
/* NB: .stage__sticky pins against the VIEWPORT (the page scrolls on the viewport, not on <body>).
   Do not give <body>/<html> a constrained height + overflow:auto — that would make <body> the scroll
   container and silently break the pin on all stages at once. */
.stage__sticky{ position:sticky; top:0; min-height:100svh; display:flex; align-items:center; }
.stage__sticky .frame{ width:100%; }
@media (prefers-reduced-motion:reduce){ .stage{ height:auto; } .stage__sticky{ position:static; min-height:0; padding:30px 0; } }
