/* self-hosted fonts (SIL Open Font License 1.1, see fonts/OFL-*.txt) */
@font-face{font-family:'Bricolage Grotesque';font-style:normal;font-display:swap;font-weight:200 800;src:url(fonts/bricolage-grotesque-latin-ext-wght-normal.woff2) format('woff2-variations'),url(fonts/bricolage-grotesque-latin-ext-wght-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Bricolage Grotesque';font-style:normal;font-display:swap;font-weight:200 800;src:url(fonts/bricolage-grotesque-latin-wght-normal.woff2) format('woff2-variations'),url(fonts/bricolage-grotesque-latin-wght-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Atkinson Hyperlegible Next';font-style:normal;font-display:swap;font-weight:200 800;src:url(fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2) format('woff2-variations'),url(fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Atkinson Hyperlegible Next';font-style:normal;font-display:swap;font-weight:200 800;src:url(fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2) format('woff2-variations'),url(fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Atkinson Hyperlegible Next';font-style:italic;font-display:swap;font-weight:200 800;src:url(fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2) format('woff2-variations'),url(fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Atkinson Hyperlegible Mono';font-style:normal;font-display:swap;font-weight:200 800;src:url(fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2) format('woff2-variations'),url(fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Atkinson Hyperlegible Mono';font-style:normal;font-display:swap;font-weight:200 800;src:url(fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2) format('woff2-variations'),url(fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/* src/styles.css */
/* Ocelle v2 « Fluorescéine » — design tokens (names are a contract with src/*.js; values follow brand/BRAND.md).
   Chrome, hero, transitions, rewards and the reveal are cobalt + fluorescein; study surfaces stay calm (paper / deep navy).
   Layout: left rail (navigation + progress) and a reading column; figures and simulations break out to the full main width. */
:root {
  /* study surfaces: paper white, deep ink */
  --paper: #fbfbf8;
  --surface: #ffffff;
  --sunk: #f1f2f7;
  --ink: #0a0f40;
  --ink-2: #3a406b;
  --ink-3: #5b6188;
  --line: #dcdeea;
  --line-2: #ecedf4;
  /* brand: cobalt filter + fluorescein */
  --cobalt: #1f2cff;
  --cobalt-ink: #1a24d6;
  --cobalt-wash: #eceeff;
  --on-cobalt: #ffffff;
  --fluo: #d8ff3a;
  --fluo-ink: #3c5a00;
  --fluo-wash: #f4ffd1;
  --sign: #d8ff3a;                 /* decisive sign, marker loops on media: always over an ink halo */
  --sign-halo: rgba(10, 15, 64, .72);
  --on-fluo: #0a0f40;
  /* chrome (top bar, rail, tab bar, drawer) */
  --chrome: #1f2cff;
  --chrome-2: #1a24d6;
  --chrome-ink: #ffffff;
  --chrome-ink-2: #c9ceff;
  --chrome-line: rgba(255, 255, 255, .16);
  --chrome-hover: rgba(255, 255, 255, .1);
  /* semantics (text colour on its wash >= 4.5:1) */
  --urgent: #b42323; --urgent-wash: #fbe9e8;
  --frequent: #1a6e80; --frequent-wash: #e1f1f4;
  --hy: #8a5a06; --hy-wash: #fbf0dc;
  --trap: #6a32a3; --trap-wash: #f1e8fa;
  --ok: #25702c; --ok-wash: #e6f3e7;
  --bad: #b42323; --bad-wash: #fdebeb;
  --focus: #1f2cff;
  --shadow: 0 1px 2px rgba(10, 15, 64, .06), 0 8px 24px rgba(10, 15, 64, .07);
  --shadow-lift: 0 2px 4px rgba(10, 15, 64, .06), 0 14px 32px rgba(10, 15, 64, .12);
  --shadow-hard: 0 4px 0 var(--ink);
  --edge: #0a0f40;                 /* hard sticker edge / shadow */
  --teal-ink: #0a6f64; --teal-wash: #e3f6f2; --teal-line: #9adbd0;

  /* tissue palette for schematic drawings */
  --t-sclera: #f3efe6; --t-sclera-edge: #c9bfa9;
  --t-cornea: #cfe8f5; --t-cornea-edge: #7fb3cf;
  --t-aqueous: #e3f3fb;
  --t-iris: #7a5236; --t-iris-2: #a0714b;
  --t-ciliary: #8c4f45; --t-ciliary-2: #b06a5d;
  --t-lens: #f6e7b8; --t-lens-edge: #c9a94f;
  --t-vitreous: #f4f8fb;
  --t-retina: #e98f7a; --t-choroid: #8e3b33;
  --t-disc: #f3c58f; --t-disc-rim: #e8a274; --t-cup: #fbedd2;
  --t-fundus: #c8553d; --t-fundus-2: #a8402c;
  --t-nerve: #f1e2c0; --t-nerve-edge: #c9b27e;
  --t-artery: #d02d2d; --t-vein: #3a55b4; --t-nervefib: #e0b318;
  --t-muscle: #c76e66; --t-conj: #f2c9c3;
  --t-tm: #b98d63; --t-pigment: #5a3a22; --t-schlemm: #c4dff0;
  --t-skin: #efc9a8; --t-lid: #e7b292;
  --t-cobalt-bg: #11205e; --t-fluo-glow: #b5f04b;
  --t-label: #0b1a30;

  --font-display: "Bricolage Grotesque", "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-xs: .78rem; --fs-sm: .875rem; --fs-base: 1rem; --fs-md: 1.125rem; --fs-lg: 1.375rem;
  --fs-xl: 1.75rem; --fs-2xl: 2.375rem; --fs-3xl: 3.25rem;
  --radius: 16px; --radius-sm: 10px;
  --rail: 284px;

  /* motion */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-marker: cubic-bezier(.65, .05, .36, 1);
  --dur-1: .14s; --dur-2: .24s; --dur-3: .42s;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #060a2a; --surface: #0e1440; --sunk: #151c52; --ink: #eef0ff; --ink-2: #b9bee6; --ink-3: #8e94c4;
    --line: #262e66; --line-2: #1c2357; --cobalt: #4a57ff; --cobalt-ink: #9da5ff; --cobalt-wash: #1a2266; --on-cobalt: #ffffff;
    --fluo: #d8ff3a; --fluo-ink: #d8ff3a; --fluo-wash: #232b0c; --sign: #d8ff3a; --sign-halo: rgba(0, 0, 0, .7); --on-fluo: #0a0f40;
    --chrome: #1a23d9; --chrome-2: #151cb3; --chrome-ink: #ffffff; --chrome-ink-2: #c9ceff; --chrome-line: rgba(255, 255, 255, .14); --chrome-hover: rgba(255, 255, 255, .08);
    --urgent: #ff7a73; --urgent-wash: #3a1b1d; --frequent: #63c3d6; --frequent-wash: #122d35;
    --hy: #f0b64d; --hy-wash: #352712; --trap: #c49bf0; --trap-wash: #2a1c3d;
    --ok: #78cf7e; --ok-wash: #15301a; --bad: #ff7b7b; --bad-wash: #3a1a1a; --focus: #d8ff3a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --shadow-lift: 0 2px 4px rgba(0,0,0,.35), 0 16px 36px rgba(0,0,0,.4);
    --shadow-hard: 0 4px 0 #000; --edge: #000000;
    --teal-ink: #5fe3d0; --teal-wash: #0f2e2c; --teal-line: #1f5c55;
    --t-sclera: #d9d3c6; --t-sclera-edge: #9c917a; --t-cornea: #9fc7dc; --t-cornea-edge: #6aa0bf; --t-aqueous: #26405a;
    --t-iris: #8a6142; --t-iris-2: #b0825b; --t-ciliary: #9a5a50; --t-ciliary-2: #b9766a; --t-lens: #d9c992; --t-lens-edge: #b39443;
    --t-vitreous: #1c2a3d; --t-retina: #d9806c; --t-choroid: #7e3a33; --t-disc: #e7b57f; --t-disc-rim: #d9926a; --t-cup: #f2e2c4;
    --t-fundus: #b04c37; --t-fundus-2: #8f3a28; --t-nerve: #d7c9a5; --t-nerve-edge: #a8925f; --t-artery: #f05252; --t-vein: #6f86e0;
    --t-nervefib: #f2c535; --t-muscle: #b9645c; --t-conj: #d9aaa3; --t-tm: #b08660; --t-pigment: #4a2f1b; --t-schlemm: #4b7493;
    --t-skin: #d9b08f; --t-lid: #cf9c7f; --t-cobalt-bg: #0d1a4d; --t-fluo-glow: #b9f35a; --t-label: #e6ecf5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #060a2a; --surface: #0e1440; --sunk: #151c52; --ink: #eef0ff; --ink-2: #b9bee6; --ink-3: #8e94c4;
  --line: #262e66; --line-2: #1c2357; --cobalt: #4a57ff; --cobalt-ink: #9da5ff; --cobalt-wash: #1a2266; --on-cobalt: #ffffff;
  --fluo: #d8ff3a; --fluo-ink: #d8ff3a; --fluo-wash: #232b0c; --sign: #d8ff3a; --sign-halo: rgba(0, 0, 0, .7); --on-fluo: #0a0f40;
  --chrome: #1a23d9; --chrome-2: #151cb3; --chrome-ink: #ffffff; --chrome-ink-2: #c9ceff; --chrome-line: rgba(255, 255, 255, .14); --chrome-hover: rgba(255, 255, 255, .08);
  --urgent: #ff7a73; --urgent-wash: #3a1b1d; --frequent: #63c3d6; --frequent-wash: #122d35;
  --hy: #f0b64d; --hy-wash: #352712; --trap: #c49bf0; --trap-wash: #2a1c3d;
  --ok: #78cf7e; --ok-wash: #15301a; --bad: #ff7b7b; --bad-wash: #3a1a1a; --focus: #d8ff3a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.35), 0 16px 36px rgba(0,0,0,.4);
  --shadow-hard: 0 4px 0 #000; --edge: #000000;
  --teal-ink: #5fe3d0; --teal-wash: #0f2e2c; --teal-line: #1f5c55;
  --t-sclera: #d9d3c6; --t-sclera-edge: #9c917a; --t-cornea: #9fc7dc; --t-cornea-edge: #6aa0bf; --t-aqueous: #26405a;
  --t-iris: #8a6142; --t-iris-2: #b0825b; --t-ciliary: #9a5a50; --t-ciliary-2: #b9766a; --t-lens: #d9c992; --t-lens-edge: #b39443;
  --t-vitreous: #1c2a3d; --t-retina: #d9806c; --t-choroid: #7e3a33; --t-disc: #e7b57f; --t-disc-rim: #d9926a; --t-cup: #f2e2c4;
  --t-fundus: #b04c37; --t-fundus-2: #8f3a28; --t-nerve: #d7c9a5; --t-nerve-edge: #a8925f; --t-artery: #f05252; --t-vein: #6f86e0;
  --t-nervefib: #f2c535; --t-muscle: #b9645c; --t-conj: #d9aaa3; --t-tm: #b08660; --t-pigment: #4a2f1b; --t-schlemm: #4b7493;
  --t-skin: #d9b08f; --t-lid: #cf9c7f; --t-cobalt-bg: #0d1a4d; --t-fluo-glow: #b9f35a; --t-label: #e6ecf5;
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
* { box-sizing: border-box; }
a { color: var(--cobalt-ink); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: .005em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); margin: 0; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2em; }
li + li { margin-top: .3em; }
strong { font-weight: 700; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.eyebrow { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.rail { display: none; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.topbar .brand { flex: 1; min-width: 0; }
.main { min-width: 0; padding-block: 20px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.page { max-width: 980px; margin: 0 auto; display: grid; gap: 28px; }
.read { max-width: 760px; }
@media (min-width: 1040px) {
  .shell { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface);
    border-right: 1px solid var(--line); padding: 18px 14px 28px; padding-left: max(14px, env(safe-area-inset-left, 0px)); }
  .topbar { display: none; }
  .main { padding-block: 32px 80px; padding-left: 40px; padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}
.drawer { position: fixed; inset: 0; z-index: 40; display: flex; }
.drawer[hidden] { display: none !important; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(8, 14, 26, .45); }
.drawer .panel { position: relative; width: min(86vw, 320px); height: 100%; background: var(--surface); overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(24px + env(safe-area-inset-bottom, 0px)); padding-left: max(14px, env(safe-area-inset-left, 0px)); box-shadow: var(--shadow); }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .logo { width: 34px; height: 34px; flex: none; }
.brand b { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.05; display: block; }
.brand span { font-size: var(--fs-xs); color: var(--ink-3); }

.nav { display: grid; gap: 2px; }
.nav .grp { margin-top: 10px; }
.nav .grp-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--ink); font-size: var(--fs-sm); line-height: 1.3; }
.nav a:hover { background: var(--sunk); }
.nav a.on { background: var(--cobalt-wash); color: var(--cobalt-ink); font-weight: 700; }
.nav a .n { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); width: 1.6em; flex: none; text-align: right; }
.nav a .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; margin-left: auto; }
.nav a .dot.seen { background: var(--cobalt); border-color: var(--cobalt); }
.nav a .dot.done { background: var(--ok); border-color: var(--ok); }
.nav .lock { font-size: var(--fs-xs); color: var(--ink-3); margin-left: auto; }
.nav details summary { list-style: none; cursor: pointer; }
.nav details summary::-webkit-details-marker { display: none; }

.syncnote { font-size: var(--fs-xs); color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.syncnote i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.syncnote.ok i { background: var(--ok); }
.syncnote.warn i { background: var(--hy); }

/* ---------- generic components ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; font-weight: 600; font-size: var(--fs-sm); line-height: 1.2; }
.btn:hover { border-color: var(--cobalt); }
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
:root[data-theme="dark"] .btn.primary { color: var(--on-fluo); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: var(--on-fluo); } }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--cobalt-ink); padding-inline: 8px; }
.btn.ghost:hover { background: var(--cobalt-wash); }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: var(--fs-xs); }
.btn.xs { min-height: 28px; padding: 3px 9px; font-size: var(--fs-xs); border-radius: 7px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--cobalt-wash); border-color: var(--cobalt); color: var(--cobalt-ink); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.tight { gap: 6px; }
.stack { display: grid; gap: 12px; align-content: start; }
.stack.lg { gap: 20px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid2 > *, .grid3 > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.flat { box-shadow: none; }
.card.link { text-decoration: none; color: inherit; display: grid; gap: 8px; transition: border-color .15s, transform .15s; }
.card.link:hover { border-color: var(--cobalt); }
.panel-sunk { background: var(--sunk); border-radius: var(--radius); padding: 14px 16px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.urgent { color: var(--urgent); background: var(--urgent-wash); }
.tag.frequent { color: var(--frequent); background: var(--frequent-wash); }
.tag.highyield { color: var(--hy); background: var(--hy-wash); }
.tag.piege { color: var(--trap); background: var(--trap-wash); }
.tag.plain { color: var(--ink-2); background: var(--sunk); }
.tag.plain::before { display: none; }

.callout { border-radius: var(--radius); padding: 14px 16px; background: var(--cobalt-wash); color: var(--ink); display: block; }
.callout > .eyebrow { display: block; margin-bottom: 6px; }
.callout > div + div, .callout > ul { margin-top: 6px; }
.callout.red { background: var(--urgent-wash); }
.callout.amber { background: var(--hy-wash); }
.callout.green { background: var(--ok-wash); }
.callout.violet { background: var(--trap-wash); }
.callout .eyebrow { color: inherit; opacity: .8; }
.callout.red .eyebrow { color: var(--urgent); opacity: 1; }
.callout.amber .eyebrow { color: var(--hy); opacity: 1; }
.callout.violet .eyebrow { color: var(--trap); opacity: 1; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.tbl th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: var(--sunk); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { font-weight: 700; }
@media (max-width: 600px) {
  .tbl.stackable thead { display: none; }
  .tbl.stackable, .tbl.stackable tbody { display: block; }
  .tbl.stackable tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
  .tbl.stackable tr:last-child { border-bottom: 0; }
  .tbl.stackable td { display: block; padding: 2px 0; border: 0; }
  .tbl.stackable td[data-l]:not(:first-child)::before { content: attr(data-l); display: block; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; margin-top: 6px; }
  .tbl.stackable td:empty { display: none; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: var(--fs-sm); cursor: pointer; line-height: 1.25; }
.chip:hover { border-color: var(--cobalt); }
.chip[aria-pressed="true"], .chip.on { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }
:root[data-theme="dark"] .chip[aria-pressed="true"], :root[data-theme="dark"] .chip.on { color: var(--on-cobalt); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip[aria-pressed="true"], :root:not([data-theme="light"]) .chip.on { color: var(--on-cobalt); } }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; font-size: var(--fs-sm); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--cobalt-wash); color: var(--cobalt-ink); font-weight: 700; }

.slider { display: grid; gap: 4px; }
.slider label { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); }
.slider label output { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--cobalt-ink); font-weight: 700; }
input[type="range"] { width: 100%; accent-color: var(--cobalt); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); cursor: pointer; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--cobalt); }
select, input[type="date"], input[type="number"], input[type="text"] { font: inherit; font-size: var(--fs-sm); padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

.pbar { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--cobalt); border-radius: 99px; }
.pbar.ok i { background: var(--ok); }

/* ---------- page header ---------- */
.crumbs { font-size: var(--fs-xs); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--cobalt-ink); }
.phead { display: grid; gap: 10px; }
.phead .en { font-style: italic; color: var(--ink-2); font-size: var(--fs-md); }
.section-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.section-h .k { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--cobalt-ink); }
.section-h h2 { font-size: var(--fs-lg); }

/* ---------- home: acuity chart hero ---------- */
.hero { display: grid; gap: 18px; }
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 10px; display: grid; gap: 4px; }
.chart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; }
.chart-line:hover { border-color: var(--line); background: var(--paper); }
.chart-line .opto { font-family: var(--font-display); font-weight: 800; letter-spacing: .12em; line-height: .95; display: flex; gap: .25em; align-items: baseline; flex-wrap: wrap; }
.chart-line .opto small { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-sm); letter-spacing: 0; color: var(--ink-2); margin-left: .6em; }
.chart-line .acu { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--ink-3); text-align: right; white-space: nowrap; }
.chart-line.locked .opto { color: var(--ink-3); }
.chart-line.l1 .opto { font-size: clamp(2.6rem, 8vw, 4.6rem); }
.chart-line.l2 .opto { font-size: clamp(1.9rem, 5.6vw, 3.1rem); }
.chart-line.l3 .opto { font-size: clamp(1.4rem, 4vw, 2.2rem); }
.chart-line.l4 .opto { font-size: clamp(1.1rem, 3.2vw, 1.7rem); }
.chart-foot { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: var(--fs-sm); }
.acuity-big { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); line-height: 1; color: var(--cobalt-ink); }
.countdown { display: flex; gap: 10px; flex-wrap: wrap; }
.cd { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); display: grid; gap: 2px; min-width: 150px; }
.cd b { font-family: var(--font-display); font-size: var(--fs-lg); }
.cd.soon { border-color: var(--hy); background: var(--hy-wash); }
.plan { display: grid; gap: 8px; }
.plan li { list-style: none; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.plan { padding: 0; margin: 0; }
.plan .ck { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; margin-top: 2px; }
.plan .ck.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.plan .when { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); }

/* ---------- figures ---------- */
.fig { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; min-width: 0; }
.fig .fig-body { position: relative; min-width: 0; }
.fig svg { display: block; width: 100%; height: auto; }
.fig .fig-cap { font-size: var(--fs-xs); color: var(--ink-3); padding: 8px 12px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.fig .fig-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); background: var(--paper); }
.fig.dark-bg { background: #0a1022; }
.schema-badge { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.lbl { font-family: var(--font-body); fill: var(--t-label); font-size: 13px; }
.lbl-sm { font-family: var(--font-body); fill: var(--t-label); font-size: 11px; }
.lbl-b { font-weight: 700; }
.lbl-muted { fill: var(--ink-3); }
.lbl-white { fill: #f5f8ff; }
.lead { stroke: var(--ink-3); stroke-width: 1; fill: none; }
.lbl-g .lead, .lbl-g circle { pointer-events: none; }
.explorer .lbl-g[data-for] text, .anat-wrap .lbl-g[data-for] text { cursor: pointer; }
.hl-ring { fill: none; stroke: var(--cobalt); stroke-width: 3; stroke-dasharray: 6 4; }
.reveal-ring { fill: none; stroke: var(--sign); stroke-width: 3; filter: drop-shadow(0 0 1.5px var(--sign-halo)); }
.reveal-txt { font-family: var(--font-body); font-size: 12px; font-weight: 700; fill: var(--sign); paint-order: stroke; stroke: #050e1d; stroke-width: 3.5px; }
.hit { cursor: pointer; }
.hit:hover { filter: brightness(1.08) saturate(1.1); }
.sel > * { stroke: var(--cobalt) !important; stroke-width: 3 !important; }
.hl > * { stroke: var(--cobalt); stroke-width: 3; }

/* tissue classes */
.t-sclera { fill: var(--t-sclera); stroke: var(--t-sclera-edge); stroke-width: 1.2; }
.t-cornea { fill: var(--t-cornea); stroke: var(--t-cornea-edge); stroke-width: 1.2; }
.t-aqueous { fill: var(--t-aqueous); }
.t-iris { fill: var(--t-iris); }
.t-iris2 { fill: var(--t-iris-2); }
.t-ciliary { fill: var(--t-ciliary); }
.t-ciliary2 { fill: var(--t-ciliary-2); }
.t-lens { fill: var(--t-lens); stroke: var(--t-lens-edge); stroke-width: 1.2; }
.t-vitreous { fill: var(--t-vitreous); }
.t-retina { fill: var(--t-retina); }
.t-choroid { fill: var(--t-choroid); }
.t-nerve { fill: var(--t-nerve); stroke: var(--t-nerve-edge); stroke-width: 1.2; }
.t-artery { stroke: var(--t-artery); fill: none; stroke-linecap: round; }
.t-vein { stroke: var(--t-vein); fill: none; stroke-linecap: round; }
.t-nfib { stroke: var(--t-nervefib); fill: none; stroke-linecap: round; }
.t-muscle { fill: var(--t-muscle); }
.t-conj { fill: none; stroke: var(--t-conj); stroke-width: 4; }
.t-tm { fill: var(--t-tm); }
.t-schlemm { fill: var(--t-schlemm); stroke: var(--t-cornea-edge); stroke-width: 1; }
.t-zonule { stroke: var(--t-lens-edge); stroke-width: .8; fill: none; opacity: .9; }
.t-disc { fill: var(--t-disc); }
.t-cup { fill: var(--t-cup); }
.t-fundus { fill: var(--t-fundus); }
.t-skin { fill: var(--t-skin); }
.t-lid { fill: var(--t-lid); }
.flow { stroke: var(--cobalt); stroke-width: 2.2; fill: none; stroke-dasharray: 7 6; animation: dash 1.4s linear infinite; }
.flow-u { stroke: var(--fluo-ink); stroke-width: 2.2; fill: none; stroke-dasharray: 4 6; animation: dash 1.8s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -26; } }
.eye-svg .g-vasc, .eye-svg .g-nerv, .eye-svg .g-flow { display: none; }
.eye-svg.show-vasc .g-vasc, .eye-svg.show-nerv .g-nerv, .eye-svg.show-flow .g-flow { display: inline; }
.eye-svg.no-labels .g-labels { display: none; }
.eye-svg.tunics .tun-f { fill: #8fb0e8 !important; }
.eye-svg.tunics .tun-v { fill: #d88a5a !important; }
.eye-svg.tunics .tun-n { fill: #e3c65a !important; }
.zoomwrap { overflow: hidden; touch-action: none; cursor: grab; background: var(--surface); }
.zoomwrap:active { cursor: grabbing; }

/* info panel */
.info { border-left: 3px solid var(--cobalt); padding: 10px 14px; background: var(--cobalt-wash); border-radius: 0 var(--radius) var(--radius) 0; display: grid; gap: 6px; }
.info h4 { font-family: var(--font-display); font-size: var(--fs-lg); }
.info .en { font-style: italic; color: var(--ink-2); font-size: var(--fs-sm); }
.info .pearl { border-top: 1px dashed var(--line); padding-top: 6px; font-size: var(--fs-sm); }
.explorer { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .explorer { grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); align-items: start; } .explorer .side { position: sticky; top: 20px; } }

/* sim readouts */
.readout { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--sunk); min-width: 0; }
.readout .v { font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.readout .u { font-size: var(--fs-xs); color: var(--ink-3); }
.readout.good .v { color: var(--ok); }
.readout.warn .v { color: var(--hy); }
.readout.bad .v { color: var(--urgent); }
.eqn { font-family: var(--font-mono); font-size: var(--fs-sm); background: var(--sunk); border-radius: 8px; padding: 8px 10px; overflow-x: auto; white-space: nowrap; }
.simgrid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .simgrid { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); align-items: start; } }

/* ---------- fiche ---------- */
.fiche-nav { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 57px); z-index: 10; background: var(--paper); padding: 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; display: flex; gap: 6px; scrollbar-width: thin; }
@media (min-width: 1040px) { .fiche-nav { top: env(safe-area-inset-top, 0px); } }
.fiche-nav a { font-size: var(--fs-xs); text-decoration: none; color: var(--ink-2); padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); flex: none; }
.fiche-nav a:hover { color: var(--cobalt-ink); border-color: var(--cobalt); }
.sec { display: grid; gap: 14px; scroll-margin-top: 120px; }
.oneliner { font-family: var(--font-display); font-size: var(--fs-lg); line-height: 1.3; }
.prereq { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--fs-sm); }
.prereq a { text-decoration: none; border: 1px dashed var(--line); padding: 2px 10px; border-radius: 99px; color: var(--ink-2); }
.prereq a:hover { border-color: var(--cobalt); color: var(--cobalt-ink); }
.twocol { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.twocol > * { min-width: 0; }
.blist { list-style: none; padding: 0; display: grid; gap: 6px; }
.blist li { position: relative; padding-left: 18px; }
.blist li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 7px; height: 7px; border-radius: 2px; background: var(--cobalt); }
.blist.red li::before { background: var(--urgent); }
.blist.ok li::before { background: var(--ok); }

/* causal chain */
.causal { display: grid; gap: 10px; }
.chain { display: grid; gap: 0; }
.cstep { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 14px; }
.cstep::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.cstep:last-child::before { display: none; }
.cstep .node { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-sm); background: var(--sunk); color: var(--ink-2); border: 2px solid var(--line); transition: all .25s; z-index: 1; }
.cstep .body { padding: 6px 12px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); transition: all .25s; min-width: 0; }
.cstep .body b { display: block; }
.cstep .body .k { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.cstep.k-cause .k { color: var(--frequent); }
.cstep.k-mecanisme .k { color: var(--cobalt-ink); }
.cstep.k-lesion .k { color: var(--hy); }
.cstep.k-signe .k { color: var(--trap); }
.cstep.k-complication .k { color: var(--urgent); }
.cstep.on .node { background: var(--cobalt); color: #fff; border-color: var(--cobalt); transform: scale(1.06); }
.cstep.on .body { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-wash); }
.cstep.cut .node { background: var(--fluo); border-color: var(--fluo-ink); color: #10200a; }
.cstep .cutnote { margin-top: 6px; font-size: var(--fs-sm); background: var(--fluo-wash); border-left: 3px solid var(--fluo-ink); padding: 6px 10px; border-radius: 0 8px 8px 0; }
.cstep.after .body { opacity: .45; }

/* algorithm */
.algo { display: grid; gap: 10px; counter-reset: q; }
.anode { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.anode .q { padding: 10px 14px; font-weight: 700; display: flex; gap: 10px; align-items: baseline; }
.anode .q::before { counter-increment: q; content: counter(q); font-family: var(--font-mono); color: var(--cobalt-ink); font-size: var(--fs-sm); }
.anode .yn { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); border-top: 1px solid var(--line-2); }
.anode .yn > div { padding: 9px 14px; font-size: var(--fs-sm); display: grid; gap: 2px; }
.anode .yn > div + div { border-left: 1px solid var(--line-2); }
.anode .yn .lab { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.anode .yes .lab { color: var(--ok); }
.anode .no .lab { color: var(--urgent); }
.anode.walk .yn > div { cursor: pointer; }
.anode.walk .yn > div:hover { background: var(--sunk); }
.anode.chosen-yes .yes, .anode.chosen-no .no { background: var(--cobalt-wash); }
.anode.dim { opacity: .5; }
.phases { display: grid; gap: 10px; }
.phase { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 560px) { .phase { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.phase .ph { font-weight: 700; font-size: var(--fs-sm); display: flex; align-items: center; gap: 8px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.phase .ph i { width: 10px; height: 10px; border-radius: 3px; background: var(--cobalt); flex: none; }
.phase.p-observation .ph i { background: var(--ink-3); }
.phase.p-medical .ph i { background: var(--frequent); }
.phase.p-laser .ph i { background: var(--fluo-ink); }
.phase.p-chirurgie .ph i { background: var(--trap); }
.phase.p-suivi .ph i { background: var(--cobalt); }
.phase.p-escalade .ph i { background: var(--urgent); }

/* treatments accordion */
.acc { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.acc + .acc { margin-top: 8px; }
.acc summary { padding: 11px 14px; cursor: pointer; font-weight: 700; display: flex; gap: 10px; align-items: center; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; margin-left: auto; font-family: var(--font-mono); color: var(--cobalt-ink); font-size: 1.2rem; }
.acc[open] summary::after { content: "–"; }
.acc .acc-b { padding: 0 14px 14px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.kv { display: grid; gap: 2px; font-size: var(--fs-sm); min-width: 0; align-content: start; }
.acc .acc-b > .kv:first-child { grid-column: 1 / -1; font-size: var(--fs-base); }
.kv .k { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }

/* pearls (flip) */
.pearls { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.pearl-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px; text-align: left; cursor: pointer; display: grid; gap: 10px; align-content: start; min-height: 120px; }
.pearl-card:hover { border-color: var(--cobalt); }
.pearl-card .who { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--hy); font-weight: 700; }
.pearl-card .q { font-weight: 700; }
.pearl-card .a { border-top: 1px dashed var(--line); padding-top: 8px; font-size: var(--fs-sm); }
.pearl-card .hint { font-size: var(--fs-xs); color: var(--ink-3); }

/* glossary term */
.gt { text-decoration: underline dotted var(--cobalt); text-underline-offset: 3px; cursor: help; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: inherit; }
.gt:hover { color: var(--cobalt-ink); }
.pop { position: fixed; z-index: 60; max-width: min(340px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; font-size: var(--fs-sm); display: grid; gap: 4px; }
.pop b { font-family: var(--font-display); font-size: var(--fs-md); }

/* photos */
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.ph-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); display: grid; align-content: start; min-width: 0; }
.ph-card .ph-img { background: #0a0f1a; display: grid; place-items: center; cursor: zoom-in; border: 0; padding: 0; width: 100%; }
.ph-card img { width: 100%; height: auto; display: block; }
.ph-card .ph-b { padding: 10px 12px 12px; display: grid; gap: 6px; font-size: var(--fs-sm); }
.ph-card .ph-b .cap { font-weight: 700; }
.credit { font-size: 11px; color: var(--ink-3); line-height: 1.35; }
.credit a { color: var(--ink-3); }
.reveal-list { list-style: none; padding: 0; display: grid; gap: 4px; }
.reveal-list li { padding: 6px 8px; border-radius: 6px; background: var(--fluo-wash); border-left: 3px solid var(--fluo-ink); font-size: var(--fs-sm); }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(5, 9, 18, .97); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: calc(10px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); gap: 8px; color: #eef2fa; }
.lightbox[hidden] { display: none !important; }
.lightbox .lb-img { min-height: 0; display: grid; place-items: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .lb-top, .lightbox .lb-bot { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: var(--fs-sm); }
.lightbox .btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.lightbox a { color: #c9d6ff; }
.lightbox .lb-fig { min-height: 0; overflow: auto; background: var(--surface); border-radius: 10px; color: var(--ink); overscroll-behavior: contain; }
.lightbox .lb-fig-in { margin: 0 auto; padding: 10px; box-sizing: border-box; min-width: 100%; }
.lightbox .lb-fig-in svg { width: 100%; height: auto; display: block; max-height: none !important; }
.fig-cap-r { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pair { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.pair .fig .fig-body svg { max-height: 340px; }
.pair .lab { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; padding: 6px 12px; }
.pair .lab.n { color: var(--ok); }
.pair .lab.p { color: var(--urgent); }

/* ---------- quiz ---------- */
.quiz { display: grid; gap: 16px; }
.qhead { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.qstem { font-size: var(--fs-md); line-height: 1.5; }
.opts { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; width: 100%; line-height: 1.4; }
.opt:hover:not([disabled]) { border-color: var(--cobalt); }
.opt .key { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--sunk); font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; }
.opt[disabled] { cursor: default; }
.opt.correct { border-color: var(--ok); background: var(--ok-wash); }
.opt.correct .key { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-wash); }
.opt.wrong .key { background: var(--bad); color: #fff; }
.opt .why { grid-column: 2; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 4px; }
.feedback { border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; }
.feedback.ok { background: var(--ok-wash); }
.feedback.bad { background: var(--bad-wash); }
.feedback .verdict { font-weight: 700; font-size: var(--fs-md); }
.feedback.ok .verdict { color: var(--ok); }
.feedback.bad .verdict { color: var(--bad); }
.qfig { max-width: 560px; }
.cap-media { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); max-width: 940px; align-items: start; }
.cap-media > * { min-width: 0; }
.cap-media .cm-ph { max-width: 440px; }
.cap-media .cm-fig { max-width: 640px; }
.qfig .ph-img { cursor: zoom-in; }
.scorecard { display: grid; gap: 12px; }
.qmeta { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- cases ---------- */
.case-step { display: grid; gap: 12px; }
.exam-opt { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; width: 100%; }
.exam-opt[aria-pressed="true"] { border-color: var(--cobalt); background: var(--cobalt-wash); }
.exam-opt .bx { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; }
.exam-opt[aria-pressed="true"] .bx { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.exam-res { font-size: var(--fs-sm); display: grid; gap: 4px; grid-column: 2; }
.val { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.val.v2 { color: var(--ok); } .val.v1 { color: var(--frequent); } .val.v0 { color: var(--ink-3); } .val.v-1 { color: var(--urgent); }
.timeline { display: grid; gap: 10px; border-left: 2px solid var(--line); padding-left: 14px; }
.timeline .done-step { font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------- misc ---------- */
.kbd { font-family: var(--font-mono); font-size: var(--fs-xs); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }
.lockbox { border: 1px dashed var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 10px; background: var(--surface); }
.footnote { font-size: var(--fs-xs); color: var(--ink-3); }
.src-list { display: grid; gap: 8px; font-size: var(--fs-sm); }
.src-list li { list-style: none; }
.src-list { padding: 0; }
.mini-vision { border-radius: 10px; background: #f7f7f2; color: #111; display: grid; place-items: center; height: 96px; overflow: hidden; font-family: var(--font-display); font-weight: 800; letter-spacing: .25em; font-size: 2rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 80; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: var(--fs-sm); box-shadow: var(--shadow); }
.empty { color: var(--ink-3); font-size: var(--fs-sm); padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .flow, .flow-u { animation: none; }
}

/* =====================================================================
   Learning layer v2 — depth levels, hero, games, flashcards, tab bar
   ===================================================================== */
body { font-size: 1rem; }
:root[data-size="s"] { font-size: 93.75%; }
:root[data-size="l"] { font-size: 112.5%; }
:root[data-size="xl"] { font-size: 125%; }
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* depth gating: details hidden below the chosen level, unless the part is opened */
:root[data-depth="1"] .mv:not(.open) [data-dz="2"],
:root[data-depth="1"] .mv:not(.open) [data-dz="3"],
:root[data-depth="2"] .mv:not(.open) [data-dz="3"] { display: none !important; }
:root[data-depth="3"] .mv-more, :root[data-depth="2"] .mv-more[data-need="2"] { display: none; }
.mv-more { justify-self: start; border: 1px dashed var(--line); }
.mv { display: grid; gap: 16px; scroll-margin-top: 110px; }
.page.mv { gap: 28px; }
.depth-row { gap: 10px; align-items: center; }
.depth-seg.sm button { padding: 4px 10px; font-size: var(--fs-xs); }
.seg.sm button { padding: 4px 10px; font-size: var(--fs-xs); }

/* fiche step navigation */
.mv-nav { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 57px); z-index: 10; background: var(--paper); padding: 8px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 1040px) { .mv-nav { top: env(safe-area-inset-top, 0px); } }
.mv-nav a { display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; padding: 8px 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-align: center; min-width: 0; }
.mv-nav a .k { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--teal-ink); }
.mv-nav a:hover { border-color: var(--cobalt); }
.voir-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .voir-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.voir-side { position: sticky; top: 120px; }

/* high-yield box */
.hy-box { border: 1.5px solid var(--teal-line); background: var(--teal-wash); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.hy-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hy-badge { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--teal-ink); background: var(--surface); border: 1px solid var(--teal-line); border-radius: 99px; padding: 2px 9px; }
.hy-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.hy-list li { position: relative; padding-left: 22px; line-height: 1.45; }
.hy-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--teal-ink); font-weight: 800; }

/* carousel: big image first */
.carousel { display: grid; gap: 8px; min-width: 0; }
.carousel .ph-card img { max-height: 460px; object-fit: contain; background: #000; }
.car-nav { display: flex; align-items: center; justify-content: center; gap: 12px; }
.car-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.car-th { flex: none; width: 64px; height: 48px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--sunk); cursor: pointer; }
.car-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-th.on { border-color: var(--cobalt); }

/* immersive home */
:root { --night-1: #0a0f40; --night-2: #1a24d6; --night-3: #1f2cff; --teal: #d8ff3a; }
.hero2 { background: radial-gradient(120% 140% at 85% 30%, var(--night-3) 0%, var(--night-2) 45%, var(--night-1) 100%); color: #eaf6ff; border-radius: 22px; margin: -8px auto 24px; max-width: 1100px; overflow: hidden; }
.hero2-in { padding: 36px clamp(18px, 4vw, 44px) 34px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 760px) { .hero2-in { grid-template-columns: 1fr; padding-top: 24px; } .hero-eye { max-width: 150px; margin: 0 auto; order: -1; } }
.hero2 h1 { color: #fff; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; margin: 0; }
.hero2 .eyebrow { color: var(--sign); }
.hero-text { gap: 14px; }
.hero-lead { font-size: var(--fs-md); color: #cfe3f5; max-width: 52ch; margin: 0; }
.hero-cd { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-cd span { background: rgba(182, 240, 78, .08); border: 1px solid rgba(182, 240, 78, .35); color: #e9f4ff; border-radius: 999px; padding: 4px 12px; font-size: var(--fs-sm); }
.hero-cd b { color: #fff; }
.btn.hero-btn { background: var(--sign); color: #0b1a30; border-color: var(--sign); font-weight: 700; }
.btn.hero-btn.ghost { background: transparent; color: #e9f4ff; border-color: rgba(233, 244, 255, .45); }
.eye-anim { width: 100%; max-width: 250px; display: block; margin: 0 auto; filter: drop-shadow(0 10px 40px rgba(92, 123, 255, .3)); }
.eye-fib { transform-origin: 100px 100px; animation: eyespin 80s linear infinite; }
.eye-pupil { transform-origin: 100px 100px; animation: pupil 7s ease-in-out infinite; }
@keyframes eyespin { to { transform: rotate(360deg); } }
@keyframes pupil { 0%, 100% { transform: scale(1); } 45%, 62% { transform: scale(.6); } }
@media (prefers-reduced-motion: reduce) { .eye-fib, .eye-pupil { animation: none; } }
.level-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.level-card { display: grid; gap: 4px; text-align: left; padding: 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.level-card:hover { border-color: var(--cobalt); }
.level-card.on { border-color: var(--teal-ink); background: var(--teal-wash); box-shadow: 0 0 0 3px var(--teal-wash); }
.level-card .lvl-n { font-family: var(--font-mono); font-size: var(--fs-xs); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); font-weight: 700; }
.level-card.on .lvl-n { background: var(--teal-ink); color: #fff; }
.today-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.next-step { display: grid; gap: 4px; padding: 16px; border-radius: 14px; text-decoration: none; color: var(--ink); background: var(--cobalt-wash); border: 1px solid var(--line); }
.next-step.alt { background: var(--teal-wash); }
.next-step.alt2 { background: var(--hy-wash); }
.next-step b { font-size: var(--fs-md); }
.next-step:hover { border-color: var(--cobalt); }
.mod-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.mod-card { display: grid; grid-template-rows: 150px auto; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); text-decoration: none; color: var(--ink); }
.mod-card:hover { border-color: var(--cobalt); }
.mod-img { background-size: cover; background-position: center; background-color: #000; }
.mod-t { font-family: var(--font-display); font-size: var(--fs-lg); }

/* apprendre hub */
.lgrid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
.lcol { display: grid; gap: 10px; min-width: 0; }
.lcover { height: 120px; border-radius: 14px; background-size: cover; background-position: center; background-color: #000; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 12px 14px; color: #fff; position: relative; overflow: hidden; }
.lcover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 16, 31, 0) 20%, rgba(4, 16, 31, .85)); }
.lcover > * { position: relative; }
.lcover .eyebrow { color: var(--sign); }
.lcover b { font-size: var(--fs-lg); font-family: var(--font-display); }
.lrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) 10px; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.lrow:hover { border-color: var(--cobalt); }
.lrow b { font-size: var(--fs-sm); line-height: 1.3; }
.lthumb { width: 52px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--sunk); display: block; }
.lthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nothumb { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--cobalt-wash), var(--teal-wash)); }
.lrow .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line); }
.lrow .dot.seen { background: var(--cobalt); border-color: var(--cobalt); }
.lrow .dot.done { background: var(--ok); border-color: var(--ok); }
.fcard { display: grid; gap: 6px; }
.fcard-img { display: block; height: 120px; margin: -18px -18px 6px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; background: var(--sunk); }
.fcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* review hub, games, flashcards */
.today { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--teal-wash); border-color: var(--teal-line); }
.today-n { font-family: var(--font-display); font-size: var(--fs-xl); }
.mode-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.mode-tile { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.mode-tile:hover { border-color: var(--cobalt); }
.mode-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--cobalt-wash); color: var(--cobalt-ink); font-size: 1.25rem; font-weight: 800; }
.run { display: grid; gap: 14px; max-width: 760px; }
.run-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.run-end { max-width: 760px; }
.fc { border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); min-height: 220px; padding: 22px; display: grid; align-content: center; cursor: pointer; box-shadow: var(--shadow); animation: fcin .25s ease; }
.fc.flipped { cursor: default; border-color: var(--teal-line); background: linear-gradient(180deg, var(--teal-wash), var(--surface) 60%); animation: fcflip .3s ease; }
@keyframes fcin { from { opacity: 0; transform: translateY(6px); } }
@keyframes fcflip { from { transform: rotateY(80deg); opacity: .4; } }
.fc-face { display: grid; gap: 12px; }
.fc-q { font-size: var(--fs-lg); font-weight: 700; line-height: 1.35; }
.fc.flipped .fc-q { font-size: var(--fs-sm); font-weight: 400; }
.fc-a { font-size: var(--fs-md); line-height: 1.5; }
.fc-img { padding: 0; border: 0; background: #000; border-radius: 10px; overflow: hidden; cursor: zoom-in; display: block; }
.fc-img img { display: block; width: 100%; max-height: 340px; object-fit: contain; }
.fc-hint summary { cursor: pointer; font-size: var(--fs-sm); color: var(--cobalt-ink); }
.fc-rate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fc-rate .btn { flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.btn.rate0 { border-color: var(--urgent); color: var(--urgent); }
.btn.rate1 { border-color: var(--hy); color: var(--hy); }
.btn.rate2 { border-color: var(--ok); color: var(--ok); background: var(--ok-wash); }
kbd { font-family: var(--font-mono); font-size: .72em; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: var(--sunk); color: var(--ink-2); }
.cloze-s { font-size: var(--fs-md); line-height: 1.7; margin: 0; }
.blank { display: inline-block; min-width: 5.5em; border-bottom: 2px solid var(--cobalt); text-align: center; font-weight: 800; color: var(--cobalt-ink); padding: 0 4px; }
.blank.ok { border-color: var(--ok); color: var(--ok); }
.blank.bad { border-color: var(--urgent); color: var(--urgent); }
.chip.big { padding: 8px 14px; font-size: var(--fs-base); }
.chip.ghost { border-style: dashed; color: var(--ink-3); }
.chip.correct, .opt.correct { background: var(--ok-wash); border-color: var(--ok); color: var(--ink); }
.chip.wrong { background: var(--urgent-wash); border-color: var(--urgent); color: var(--ink); }
.triage-s { font-size: var(--fs-md); line-height: 1.55; margin: 0; padding: 14px 16px; background: var(--sunk); border-radius: 12px; }
.triage-btns { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.triage-btns .btn { min-height: 52px; font-weight: 700; }
.btn.tri-urgent { border-color: var(--urgent); color: var(--urgent); }
.btn.tri-rapide { border-color: var(--hy); color: var(--hy); }
.btn.tri-routine { border-color: var(--ok); color: var(--ok); }
.triage-btns .btn.correct { background: var(--ok-wash); color: var(--ink); border-color: var(--ok); }
.triage-btns .btn.wrong { background: var(--urgent-wash); color: var(--ink); }
.game-img { background: #000; border-radius: 12px; overflow: hidden; }
.game-img .ph-img { display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: zoom-in; }
.game-img img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.mcol { display: grid; gap: 8px; align-content: start; }
.mcard { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: var(--fs-sm); line-height: 1.35; min-height: 48px; color: var(--ink); }
.mcard.cue { background: var(--sunk); }
.mcard.sel { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-wash); }
.mcard.matched { border-color: var(--ok); background: var(--ok-wash); opacity: .8; cursor: default; }
.mcard.nope { border-color: var(--urgent); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.deck-chips { margin-bottom: 4px; }
.conf { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.conf button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 12px; font-size: var(--fs-sm); cursor: pointer; color: var(--ink); }
.conf button[aria-pressed="true"] { background: var(--cobalt-wash); border-color: var(--cobalt); color: var(--cobalt-ink); font-weight: 700; }
.opt.idk { border-style: dashed; color: var(--ink-2); }
.meta-box { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.report textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; background: var(--surface); color: var(--ink); }
.src-acc summary { font-size: var(--fs-sm); }

/* navigation: four primary entries, collapsible tree */
.prims { display: grid; gap: 2px; margin-bottom: 6px; }
.nav a.prim { font-size: var(--fs-base); font-weight: 600; padding: 8px; }
.nav a.prim .ic { width: 1.6em; display: inline-flex; justify-content: center; color: var(--teal-ink); }
.nav details.grp summary.grp-h { cursor: pointer; }
.nav details.grp summary.grp-h::after { content: "+"; margin-left: auto; font-family: var(--font-mono); }
.nav details.grp[open] summary.grp-h::after { content: "–"; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.tabbar a { display: grid; justify-items: center; gap: 1px; padding: 7px 4px 8px; text-decoration: none; color: var(--ink-3); font-size: .72rem; font-weight: 600; }
.tabbar a .ic { display: inline-flex; line-height: 1; }
.tabbar a.on { color: var(--cobalt-ink); }
.tabbar a.on .ic { color: var(--teal-ink); }
@media (max-width: 1039px) { .main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } .toast { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); } }
@media (min-width: 1040px) { .tabbar { display: none; } }

/* line icons */
.ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
.tabbar a .ic svg { width: 22px; height: 22px; }
/* step pills: compact on phones */
@media (max-width: 520px) {
  .mv-nav { gap: 4px; }
  .mv-nav a { padding: 7px 2px; gap: 3px; font-size: .78rem; }
  .mv-nav a .k { display: none; }
}

.mode-tile.err-tile { font: inherit; text-align: left; cursor: pointer; border-color: var(--teal-line); background: var(--teal-wash); color: var(--ink); width: 100%; }

/* progress markers: distinct shapes, not colour only */
.nav a .dot.seen, .lrow .dot.seen { background: linear-gradient(90deg, var(--cobalt) 50%, transparent 50%); }
.nav a .dot.done, .lrow .dot.done { width: 12px; height: 12px; display: inline-grid; place-items: center; }
.nav a .dot.done::after, .lrow .dot.done::after { content: ""; width: 5px; height: 2.5px; border-left: 1.6px solid var(--surface); border-bottom: 1.6px solid var(--surface); transform: translateY(-0.5px) rotate(-45deg); }
/* acuity chart: readable on phones */
.chart-line .opto small { line-height: 1.3; }
@media (max-width: 640px) {
  .chart-line { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .chart-line .acu { text-align: left; white-space: normal; }
}

/* =====================================================================
   Ocelle v2 « Fluorescéine » — brand layer (overrides above by cascade)
   Rule of thumb: chrome / hero / rewards / reveal = cobalt + fluo;
   reading and study surfaces = calm paper (deep navy in dark).
   ===================================================================== */
body { -webkit-font-smoothing: antialiased; font-feature-settings: "kern" 1; }
body::before { background: var(--chrome); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 760; letter-spacing: -.022em; line-height: 1.06; }
h1 { font-weight: 800; letter-spacing: -.034em; line-height: 1; }
h3 { letter-spacing: -.012em; line-height: 1.15; }
.oneliner { font-weight: 500; letter-spacing: -.012em; line-height: 1.28; }
.eyebrow { letter-spacing: .1em; }
::selection { background: var(--fluo); color: var(--on-fluo); }
a { text-underline-offset: .18em; }

/* ---------- chrome: top bar, rail, drawer, tab bar ---------- */
.topbar { background: var(--chrome); color: var(--chrome-ink); border-bottom: 0; }
.topbar .btn { background: transparent; color: var(--chrome-ink); border-color: var(--chrome-line); }
.topbar .btn:hover { background: var(--chrome-hover); border-color: rgba(255, 255, 255, .45); }
.topbar .seg, .rail .seg, .drawer .seg { border-color: var(--chrome-line); background: transparent; }
.topbar .seg button, .rail .seg button, .drawer .seg button { background: transparent; color: var(--chrome-ink-2); border-color: var(--chrome-line); }
.topbar .seg button[aria-pressed="true"], .rail .seg button[aria-pressed="true"], .drawer .seg button[aria-pressed="true"] { background: var(--fluo); color: var(--on-fluo); font-weight: 800; }
.brand { gap: 10px; color: inherit; }
.brand .logo { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.brand b { font-family: var(--font-display); font-weight: 800; font-size: 1.36rem; letter-spacing: -.03em; line-height: 1; color: inherit; }
.brand > span > span { color: var(--chrome-ink-2); letter-spacing: .01em; }
.topbar .brand, .rail .brand, .drawer .brand, .topbar .brand b, .rail .brand b, .drawer .brand b { color: var(--chrome-ink); }
.rail, .drawer .panel { background: var(--chrome); color: var(--chrome-ink); border-right: 0; }
.rail { gap: 16px; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
.drawer .scrim { background: rgba(10, 15, 64, .55); }
.rail .nav a, .drawer .nav a { color: var(--chrome-ink); border-radius: 10px; transition: background-color var(--dur-1), color var(--dur-1); }
.rail .nav a:hover, .drawer .nav a:hover { background: var(--chrome-hover); }
.rail .nav a.on:not(.prim), .drawer .nav a.on:not(.prim) { background: var(--fluo); color: var(--on-fluo); box-shadow: none; font-weight: 800; }
.rail .nav .grp-h, .drawer .nav .grp-h, .rail .nav a .n, .drawer .nav a .n, .rail .nav .lock, .drawer .nav .lock { color: var(--chrome-ink-2); }
.rail .nav a.on .n, .drawer .nav a.on .n { color: var(--on-fluo); }
.rail .nav a .dot, .drawer .nav a .dot { border-color: rgba(255, 255, 255, .55); }
.rail .nav a .dot.seen, .drawer .nav a .dot.seen { background: linear-gradient(90deg, var(--fluo) 50%, transparent 50%); border-color: var(--fluo); }
.rail .nav a .dot.done, .drawer .nav a .dot.done { background: var(--fluo); border-color: var(--fluo); }
.rail .nav a .dot.done::after, .drawer .nav a .dot.done::after { border-color: var(--on-fluo); }
.rail .nav a.on .dot, .drawer .nav a.on .dot { border-color: var(--on-fluo); }
.nav a.prim { padding: 5px 8px; gap: 11px; font-weight: 700; }
.nav a.prim .ic { width: 34px; height: 34px; flex: none; border-radius: 11px; display: inline-grid; place-items: center; color: inherit; transition: transform var(--dur-2) var(--ease-pop), background-color var(--dur-2); }
.rail .nav a.prim.on, .drawer .nav a.prim.on { background: transparent; color: var(--chrome-ink); font-weight: 800; }
.nav a.prim.on .ic { background: var(--fluo); color: var(--on-fluo); transform: rotate(-6deg); box-shadow: 0 2px 0 var(--edge); }
.rail .muted, .drawer .muted, .rail .disclaimer, .drawer .disclaimer, .rail .syncnote, .drawer .syncnote { color: var(--chrome-ink-2); }
.rail a:not(.brand):not([class]), .drawer a:not(.brand):not([class]) { color: inherit; }
.syncnote.ok i { background: var(--fluo); }
.tabbar { background: var(--chrome); border-top: 0; box-shadow: 0 -1px 0 var(--chrome-line); }
.tabbar a { color: var(--chrome-ink-2); font-weight: 700; padding: 6px 2px 8px; gap: 3px; }
.tabbar a .ic { width: 50px; height: 30px; border-radius: 99px; display: inline-grid; place-items: center; transition: background-color var(--dur-2), transform var(--dur-2) var(--ease-pop); }
.tabbar a.on { color: var(--chrome-ink); }
.tabbar a.on .ic { background: var(--fluo); color: var(--on-fluo); transform: rotate(-4deg); }
.topbar :focus-visible, .rail :focus-visible, .drawer .panel :focus-visible, .tabbar :focus-visible, .hero2 :focus-visible { outline-color: var(--fluo); }

/* ---------- calm study surfaces ---------- */
.section-h { border-bottom: 0; padding-bottom: 0; gap: 12px; align-items: center; flex-wrap: nowrap; }
.section-h h2 { min-width: 0; }
.section-h .k { flex: none; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--cobalt); color: var(--on-cobalt);
  font: 700 var(--fs-xs)/1 var(--font-mono); transform: rotate(-5deg); }
.card { border-radius: var(--radius); }
.btn { border-radius: 999px; font-weight: 700; border-width: 1.5px; transition: border-color var(--dur-1), background-color var(--dur-1), transform var(--dur-1), box-shadow var(--dur-1); }
.btn:hover { border-color: var(--cobalt); }
.btn.primary { background: var(--fluo); color: var(--on-fluo); border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--edge); }
.btn.primary:hover { background: #e6ff7a; border-color: var(--edge); filter: none; }
.btn.primary:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.btn:active:not([disabled]):not(.primary) { transform: scale(.98); }
.btn.ghost { color: var(--cobalt-ink); }
.chip { border-radius: 999px; transition: border-color var(--dur-1), background-color var(--dur-1); }
.chip[aria-pressed="true"], .chip.on { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
.seg { border-radius: 12px; }
.tag { border-radius: 7px; font-weight: 800; }
.pbar { background: var(--sunk); }
.pbar i { background: var(--cobalt); }
.pbar.ok i { background: var(--ok); }
.opt { position: relative; border-radius: 14px; transition: border-color var(--dur-1), background-color var(--dur-2); }
.opt .key { border-radius: 9px; }
.opt.correct .key { background: var(--ok); color: #fff; }
.feedback { position: relative; border-radius: 14px; }
.feedback.ok { background: var(--ok-wash); }
.fiche-nav, .mv-nav { background: color-mix(in srgb, var(--paper) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.mv-nav a { border-radius: 999px; font-weight: 700; }
.mv-nav a .k { color: var(--cobalt-ink); }
.mv-nav a:hover { border-color: var(--cobalt); }
.hy-box { border-radius: var(--radius); }
.blist li::before { border-radius: 50%; width: 6px; height: 6px; top: .62em; background: var(--cobalt); }
.info { border-left-color: var(--cobalt); }
.fc { border-radius: 20px; }
.fc.flipped { border-color: var(--cobalt); background: linear-gradient(180deg, var(--cobalt-wash), var(--surface) 55%); }

/* tiles and cards on hub pages: sticker energy on hover */
.mod-card, .level-card, .next-step, .mode-tile, .chart, .lrow, .card.link { border-radius: 18px; }
.card, .mod-card, .next-step, .mode-tile, .level-card, .lrow, .pearl-card { transition: border-color var(--dur-2), box-shadow var(--dur-2), transform var(--dur-2) var(--ease-out); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card.link:hover, .mod-card:hover, .next-step:hover, .mode-tile:hover, .lrow:hover { transform: translateY(-3px); box-shadow: 0 4px 0 var(--edge); border-color: var(--edge); }
}
.next-step { border-color: var(--line); background: var(--surface); }
.next-step.alt { background: var(--cobalt-wash); border-color: transparent; }
.next-step.alt2 { background: var(--fluo-wash); border-color: transparent; }
.daily-card { background: var(--chrome); color: var(--chrome-ink); border-color: var(--chrome); }
.daily-card .eyebrow { color: var(--fluo); }
.daily-card .small, .daily-card .muted, .daily-card .xs { color: var(--chrome-ink-2); }
.daily-card .daily-th { border-radius: 12px; box-shadow: 0 0 0 3px #fff; margin: 4px 4px 8px; }
.level-card.on { border-color: var(--cobalt); background: var(--cobalt-wash); box-shadow: none; }
.level-card.on .lvl-n { background: var(--fluo); color: var(--on-fluo); transform: rotate(-6deg); }
.mode-ic { border-radius: 14px; background: var(--cobalt); color: var(--on-cobalt); }
.today { background: var(--cobalt-wash); border-color: transparent; }
.mod-card .pbar { height: 6px; }

/* ---------- home hero: cobalt, tilted photo card, marker loop, sticker ---------- */
.hero2 { position: relative; background: var(--chrome); color: var(--chrome-ink); border-radius: 28px; overflow: hidden; box-shadow: none; isolation: isolate; }
.hero2-in { position: relative; z-index: 1; padding: 40px clamp(20px, 4vw, 48px) 40px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 760px) { .hero2-in { grid-template-columns: 1fr; padding-top: 24px; gap: 18px; } .hero2 .hero-eye { max-width: 250px; width: 72%; margin: 0 auto; order: -1; } }
.hero2 h1 { color: #fff; font-size: clamp(2.5rem, 7.2vw, 4.4rem); font-weight: 800; letter-spacing: -.045em; line-height: .94; }
.hero2 .eyebrow { color: var(--fluo); }
.hero-lead { color: #e2e5ff; font-size: var(--fs-md); }
.hero-cd span { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .3); color: #fff; }
.btn.hero-btn { background: var(--fluo); color: var(--on-fluo); border: 2px solid #0a0f40; box-shadow: 0 4px 0 #0a0f40; font-weight: 800; }
.btn.hero-btn:hover { background: #e6ff7a; border-color: #0a0f40; }
.btn.hero-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #0a0f40; }
.btn.hero-btn.ghost { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .7); box-shadow: none; }
.btn.hero-btn.ghost:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.hero-ocellus { position: absolute; right: -90px; top: -110px; width: 460px; height: 460px; z-index: 0; pointer-events: none; opacity: .95; }
@media (max-width: 760px) { .hero-ocellus { right: -170px; top: -150px; width: 340px; height: 340px; } }
.hero-ocellus .mo-path { stroke: var(--fluo); stroke-width: 26; }
.hero-ocellus circle { fill: var(--fluo); }
.hero-art { position: static; }
.hero-text { position: relative; z-index: 1; }
.hero-photo { z-index: 1; }
.hero-photo { position: relative; background: #fff; color: #0a0f40; padding: 10px 10px 8px; border-radius: 18px; transform: rotate(-3deg); box-shadow: 0 14px 0 -4px #0a0f40; }
.hero-photo .hero-img { position: relative; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 853 / 788; }
.hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-photo figcaption { display: block; margin-top: 6px; font-size: 10.5px; line-height: 1.3; color: #3a406b; }
.hero-photo figcaption a { color: inherit; }
.hero-photo .mo-marks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hero-photo .mo-sticker { position: absolute; top: 2%; right: -5%; z-index: 2; --rot: 8deg; font-size: clamp(1rem, 2.4vw, 1.35rem); }

/* ---------- motion system (src/motion.js) ---------- */
/* hand-drawn marker loops over media (decisive sign) */
.mo-marks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 3; }
.mo-path { fill: none; stroke: var(--sign); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.mo-path.halo { stroke: var(--sign-halo); stroke-width: 7.5; opacity: .75; }
.mo-path.minor { stroke: #fff; stroke-width: 2.5; stroke-dasharray: 2 7; }
.mo-path.minor.halo { stroke: rgba(10, 15, 64, .55); stroke-width: 5; stroke-dasharray: none; }
.inv-hots.mo-marked .inv-hot.mo-loop > i { visibility: hidden; }
.inv-hots.mo-marked .inv-hot:not(.mo-loop) > i { border-width: 2px; border-color: rgba(255, 255, 255, .9); }
/* stickers: tags that pop in rotated */
.mo-sticker { --rot: -6deg; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 7px; border-radius: 999px; background: var(--fluo); color: var(--on-fluo);
  font: 800 1rem/1 var(--font-display); letter-spacing: -.01em; white-space: nowrap; transform: rotate(var(--rot)); box-shadow: 0 3px 0 var(--edge); border: 2px solid var(--edge); pointer-events: none; }
.feedback > .mo-sticker { position: absolute; top: -16px; right: 12px; z-index: 2; }
/* wrong answer: scribbled underline */
.mo-scribble { position: absolute; left: 46px; right: 16px; bottom: 5px; height: 12px; width: calc(100% - 62px); overflow: visible; pointer-events: none; }
.mo-scribble path { fill: none; stroke: var(--bad); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
/* page change: cobalt wipe with a fluorescein trailing edge */
.mo-wipe { position: fixed; inset: 0; z-index: 95; pointer-events: none; background: var(--chrome); transform: translateX(calc(101% + 16px)); } /* + 16 px: the 14 px fluo edge (::before, left: -14px) also leaves the screen */
.mo-wipe::before { content: ""; position: absolute; top: 0; bottom: 0; left: -14px; width: 14px; background: var(--fluo); }
/* reward burst */
.mo-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.mo-burst i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 3px; background: var(--fluo); opacity: 0; }
.mo-burst i:nth-child(3n) { background: var(--cobalt); border-radius: 50%; }
.mo-burst i:nth-child(4n) { background: var(--edge); width: 6px; height: 14px; }
.daily-end, .run-end { position: relative; }
.today-n, .acuity-big { font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em; }

@media (prefers-reduced-motion: no-preference) {
  .main > .page, .main > .hero2 { animation: mo-rise .36s var(--ease-out) both; }
  .main > .hero2 + .page { animation-delay: .05s; }
  .page-enter { animation: mo-rise .36s var(--ease-out) both; }
  .mo-path.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: mo-draw var(--mo-dur, .75s) var(--ease-marker) var(--mo-delay, 0s) forwards; }
  .mo-path.minor.draw:not(.halo) { stroke-dasharray: 2 7; stroke-dashoffset: 0; animation: mo-fade .4s ease-out var(--mo-delay, 0s) both; }
  .mo-pop { animation: mo-pop .5s var(--ease-pop) var(--mo-delay, 0s) both; }
  .mo-sticker { animation: mo-sticker .55s var(--ease-pop) var(--mo-delay, 0s) both; }
  .mo-scribble path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: mo-draw .45s var(--ease-marker) .1s forwards; }
  .opt.wrong, .chip.wrong, .triage-btns .btn.wrong, .blank.bad, .mcard.nope, .no-shake { animation: mo-shake .38s ease-in-out; }
  .opt.correct .key, .chip.correct, .triage-btns .btn.correct, .blank.ok, .mcard.matched, .ok-pop, .progress-pop { animation: mo-pop .45s var(--ease-pop); }
  .feedback { animation: mo-rise .26s var(--ease-out) both; }
  .mo-wipe { animation: mo-wipe .48s cubic-bezier(.7, 0, .3, 1) both; }
  .mo-burst i { animation: mo-burst .9s cubic-bezier(.15, .7, .3, 1) var(--d, 0s) both; }
  .main .pbar i { transform-origin: left center; animation: mo-grow .8s var(--ease-out) .12s both; }
  .nav a.prim.on .ic, .tabbar a.on .ic { animation: mo-tab .42s var(--ease-pop) both; }
  .hero-ocellus circle { animation: mo-pop .5s var(--ease-pop) 1s both; transform-box: fill-box; transform-origin: center; }
}
@keyframes mo-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes mo-fade { from { opacity: 0; } }
@keyframes mo-draw { to { stroke-dashoffset: 0; } }
@keyframes mo-pop { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
@keyframes mo-sticker { 0% { opacity: 0; transform: scale(.3) rotate(calc(var(--rot, -6deg) - 28deg)); } 60% { opacity: 1; transform: scale(1.12) rotate(calc(var(--rot, -6deg) + 4deg)); } 100% { opacity: 1; transform: scale(1) rotate(var(--rot, -6deg)); } }
@keyframes mo-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes mo-wipe { 0% { transform: translateX(0); } 100% { transform: translateX(calc(101% + 16px)); } }
@keyframes mo-burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.6); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); } }
@keyframes mo-grow { from { transform: scaleX(0); } }
@keyframes mo-tab { from { transform: rotate(-24deg) scale(.7); } }
.inv-hots.mo-marked .inv-hot:not(.mo-loop) em { background: #fff; }

/* ---------- mechanism figures (src/figures-mech.js): tap to advance, nothing plays by itself ---------- */
.fig.mech { background: var(--surface); }
.mech-stage { cursor: pointer; padding: 6px 6px 0; -webkit-tap-highlight-color: transparent; border-radius: var(--radius) var(--radius) 0 0; }
.mech-stage:focus-visible { outline: 3px solid var(--cobalt); outline-offset: -3px; }
.mech-stage svg { display: block; width: 100%; max-width: 520px; max-height: 230px; margin: 0 auto; height: auto; }
.mech-cap { padding: 6px 12px 10px; border-top: 1px solid var(--line-2); display: grid; gap: 6px; }
.mech-lab { margin: 0; font-size: var(--fs-sm); line-height: 1.35; color: var(--ink); font-weight: 600; min-height: 2.7em; }
.mech-n { font-family: var(--font-mono, monospace); font-size: var(--fs-xs); color: var(--cobalt-ink); font-weight: 700; margin-right: 2px; }
.mech-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mech-row .btn { margin-left: auto; }
.mech-dots { display: flex; gap: 5px; list-style: none; margin: 0; padding: 0; }
.mech-dots li { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-3); }
.mech-dots li.done { background: var(--ink-3); }
.mech-dots li.on { background: var(--cobalt); border-color: var(--cobalt); border-radius: 2px; transform: rotate(45deg); }
@media (prefers-reduced-motion: no-preference) { html:not(.no-motion) .mech-s.mech-in { animation: mech-in .32s ease-out; } }
@keyframes mech-in { from { opacity: .25; } to { opacity: 1; } }
.mech-fo { font: 600 10.5px/1.2 var(--font-body); color: var(--ink); } .mech-pre { margin-bottom: 10px; }

/* src/investigations.css */
/* ===== Investigations section (hub, pages, practice engine, tools) — owner: exercices interactifs ===== */
.inv-page { gap: 24px; }
.inv-hub { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.inv-card { align-content: start; }
.inv-card-top { display: flex; justify-content: space-between; align-items: center; }
.inv-card-t { font-family: var(--font-display); font-size: var(--fs-lg); line-height: 1.15; }
.inv-ic { width: 34px; height: 34px; stroke: var(--cobalt); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: var(--cobalt); }
.inv-ic [fill="none"] { fill: none; }
.inv-blk ul, .inv-blk ol { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }
.inv-blk.key { border-left: 4px solid var(--cobalt); }
.inv-blk.trap { border-left: 4px solid var(--trap); background: var(--trap-wash); }
.inv-nav { justify-content: space-between; }

/* schematic badge */
.inv-schema { display: inline-block; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 1px 7px; border-radius: 99px; background: var(--hy-wash); color: var(--hy); border: 1px solid currentColor; line-height: 1.5; white-space: nowrap; }

/* tools */
.inv-tool { display: grid; gap: 12px; min-width: 0; }
.inv-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inv-seg button { min-height: 36px; }
.inv-fig { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.inv-fig-in { position: relative; background: #000; touch-action: pan-y; }
.inv-fig figcaption { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-3); padding: 7px 10px; border-top: 1px solid var(--line-2); }
.inv-svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.inv-svg text { font-family: var(--font-mono); }
.inv-ax { font-size: 11px; fill: #8fbf9a; }
.inv-alab { font-size: 10px; fill: #e8ffe9; }
.inv-calt { font-size: 11px; font-weight: 700; fill: #10140f; pointer-events: none; }
.inv-calv { font-size: 12px; font-weight: 700; fill: #d8ff3a; }
.inv-olab { font-size: 13px; font-weight: 700; fill: #d8ff3a; paint-order: stroke; stroke: #000; stroke-width: 3px; }
.inv-vfh { font-size: 13px; font-weight: 700; fill: #111; }
.inv-vfs { font-size: 9px; fill: #666; }
.inv-ctl { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.inv-ctl label, .inv-gain { display: grid; gap: 4px; font-size: var(--fs-sm); }
.inv-gain { grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.inv-ctl input[type=range], .inv-gain input[type=range] { width: 100%; accent-color: var(--cobalt); min-height: 28px; }
.inv-two { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .inv-two { grid-template-columns: minmax(0, 1fr); } }
.inv-probe { display: flex; gap: 10px; align-items: center; }
.inv-mini { width: 76px; height: 76px; flex: none; }
.inv-info { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.inv-info:empty { display: none; }
.inv-info h3, .inv-info h4 { margin: 0 0 4px; font-size: var(--fs-base); font-family: var(--font-body); font-weight: 700; line-height: 1.3; }
.inv-info ul { margin: 0; padding-left: 1.1em; display: grid; gap: 3px; }
.inv-info p { margin: 0; }
.inv-info .callout { margin-top: 8px; padding: 8px 10px; }
.inv-out:empty { display: none; }
.inv-prompt { margin: 0; font-size: var(--fs-md); display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.inv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-chips .chip { min-height: 36px; }
.inv-chips .chip[disabled] { cursor: default; opacity: .75; }
.inv-chips .chip.correct, .inv-chips .chip.wrong { opacity: 1; }

/* highlight in svg */
.inv-svg [data-layer], .inv-svg [data-band], .inv-svg [data-reg] { cursor: pointer; }
.inv-svg [data-layer]:focus, .inv-svg [data-band]:focus, .inv-svg [data-reg]:focus { outline: none; }
.inv-svg [data-layer]:focus-visible, .inv-svg [data-reg]:focus-visible, .inv-svg [data-band]:focus-visible { stroke: var(--focus); stroke-width: 2.5; }
.inv-svg .inv-hl { stroke: #d8ff3a; stroke-width: 2.5; paint-order: stroke; }
.inv-svg .inv-hit { cursor: pointer; }
.inv-svg .inv-hit:focus-visible { fill: #d8ff3a; fill-opacity: .18; stroke: var(--focus); stroke-width: 2; }
.inv-svg [data-reg].inv-hl { stroke-width: 3; }
.inv-svg [data-reg="periph"].inv-hl { stroke-width: 6; }

/* visual field printout */
.inv-vfp { background: #fff; color: #111; padding: 10px; display: grid; gap: 8px; }
.inv-vfp .muted, .inv-vfp .xs { color: #444; }
.inv-vfhead { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid #ccc; padding-bottom: 6px; }
.inv-vfidx { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.inv-vfcol dl { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 4px 0 0; font-size: var(--fs-sm); justify-content: start; }
.inv-vfcol dt, .inv-vfcol dd { margin: 0; }
.inv-vfcol dd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.inv-vfcol dd.inv-bad { color: #b3261e; font-weight: 700; }
.inv-vfcol dd.inv-bad::after { content: " !"; }
.inv-term { background: none; border: 0; padding: 0; font: inherit; color: #1a35a6; text-decoration: underline dotted; cursor: pointer; text-align: left; }
.inv-vfmap { position: relative; width: 100%; margin: 0 auto; }

/* practice engine */
.inv-run { display: grid; gap: 14px; }
.inv-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.inv-steps li { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); padding: 3px 10px 3px 4px; border-radius: 99px; background: var(--sunk); }
.inv-steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-family: var(--font-mono); }
.inv-steps li.on { background: var(--cobalt-wash); color: var(--cobalt-ink); }
.inv-steps li.on span { background: var(--cobalt); color: #fff; }
.inv-steps li.done { color: var(--ok); }
.inv-pgrid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 820px) { .inv-pgrid { grid-template-columns: minmax(0, 1fr); } }
.inv-q { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.inv-media { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.inv-media.empty { padding: 40px 12px; text-align: center; color: var(--ink-3); }
.inv-media-in { position: relative; background: #000; }
.inv-media-in > img, .inv-media-in > svg { display: block; width: 100%; height: auto; }
.inv-media figcaption { padding: 7px 10px; display: grid; gap: 4px; border-top: 1px solid var(--line-2); }
.inv-media .credit { font-size: var(--fs-xs); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* hotspots (positions in % of the media box; --r = radius in % of width) */
.inv-hots { position: absolute; inset: 0; pointer-events: none; }
.inv-fig-in .inv-hots, .inv-vfmap .inv-hots { z-index: 2; }
.inv-hot { position: absolute; width: calc(var(--r) * 2%); aspect-ratio: 1; transform: translate(-50%, -50%); }
.inv-hot i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid #d8ff3a; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .4); animation: inv-ring .7s cubic-bezier(.2, .8, .3, 1) both, inv-pulse 1.8s .7s ease-in-out 3; }
.inv-hot.minor i { border-width: 2px; border-style: dashed; opacity: .85; }
.inv-hot b { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: #111; color: #d8ff3a; font-size: var(--fs-xs); padding: 3px 8px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); animation: inv-fade .4s .45s both; }
.inv-hot em { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #d8ff3a; color: #111; font: 700 12px/1 var(--font-mono); font-style: normal; box-shadow: 0 0 0 2px rgba(0, 0, 0, .6); animation: inv-fade .3s calc(.35s + var(--d, 0s)) both; }
.inv-hot i { animation-delay: var(--d, 0s), calc(.7s + var(--d, 0s)); }
.inv-hot.minor em { background: #fff; }
.inv-hot.alt em { right: auto; left: -4px; }
.inv-hlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.inv-hlist li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; }
.inv-hlist li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--sunk); font: 700 11px/1 var(--font-mono); margin-top: 1px; }
.inv-hlist li.dec { font-weight: 600; }
.inv-hlist li.dec span { background: #d8ff3a; color: #111; }
.inv-zoom { position: absolute; right: 8px; bottom: 8px; z-index: 3; background: rgba(255, 255, 255, .92); color: #111; }
.inv-hot.r b { left: auto; right: 0; transform: none; }
.inv-hot.l b { left: 0; transform: none; }
.inv-hot.up b { top: auto; bottom: calc(100% + 6px); }
@keyframes inv-ring { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes inv-pulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 0 0 0 rgba(216, 255, 58, .6); } 50% { box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 0 0 8px rgba(216, 255, 58, 0); } }
@keyframes inv-fade { from { opacity: 0; } to { opacity: 1; } }
.inv-end .acuity-big { font-family: var(--font-display); }

@media (prefers-reduced-motion: reduce) { .inv-hot i, .inv-hot b, .inv-hot em { animation: none !important; } }
.no-motion .inv-hot i, .no-motion .inv-hot b, .no-motion .inv-hot em { animation: none !important; }

@media (max-width: 480px) {
  .inv-bar .seg { width: 100%; }
  .inv-bar .seg button { flex: 1 1 auto; }
  .inv-gain { grid-template-columns: 1fr; }
  .inv-vfcol dl { font-size: var(--fs-xs); }
  .inv-ascan .inv-alab { font-size: 15px; }
  .inv-ascan .inv-ax, .inv-bscan .inv-ax { font-size: 16px; }
  .inv-calv { font-size: 17px; }
  .inv-olab { font-size: 16px; }
}

/* cas en images */
.ic-prog { display: grid; gap: 10px; }
.ic-big { font-family: var(--font-display); font-size: var(--fs-xl); line-height: 1; }
.ic-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.ic-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
[data-iclist][hidden] { display: none; }
.ic-count { margin: 0 0 8px; }
.ic-more { justify-content: center; margin-top: 12px; }
.opts:focus { outline: none; }
.ic-card { align-content: start; }
.ic-q { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ic-st { font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--sunk); color: var(--ink-3); }
.ic-st.ok { background: var(--ok-wash); color: var(--ok); }
.ic-st.shaky { background: var(--hy-wash); color: var(--hy); }
.ic-st.bad { background: var(--bad-wash); color: var(--bad); }
.ic-hubcard { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: end; border-left: 4px solid var(--cobalt); }
.ic-hubcard > .stack { flex: 1 1 320px; }
.ic-runbar { margin-bottom: 6px; }
@media (max-width: 480px) { .ic-filters .seg { width: 100%; } .ic-filters .seg button { flex: 1 1 auto; } }

/* ===== Ocelle v2 « Fluorescéine »: stickers and marker reveal (loops drawn by src/motion.js) ===== */
.inv-hot i { border-color: var(--sign, #d8ff3a); box-shadow: 0 0 0 2px var(--sign-halo, rgba(10, 15, 64, .7)), inset 0 0 0 1px rgba(10, 15, 64, .4); }
.inv-hot b { background: var(--fluo, #d8ff3a); color: #0a0f40; border: 2px solid #0a0f40; border-radius: 999px; padding: 3px 10px 4px; font: 800 var(--fs-xs)/1.2 var(--font-display); letter-spacing: -.005em; rotate: -3deg; box-shadow: 0 2px 0 #0a0f40; }
.inv-hot em { background: var(--fluo, #d8ff3a); color: #0a0f40; width: 24px; height: 24px; box-shadow: 0 0 0 2px #0a0f40; rotate: -8deg; }
.inv-hot.minor em { background: #fff; }
.inv-hlist li.dec span { background: var(--fluo, #d8ff3a); color: #0a0f40; box-shadow: 0 0 0 1.5px #0a0f40; }
.inv-steps li { border-radius: 999px; }
.inv-steps li.on { background: var(--cobalt); color: var(--on-cobalt, #fff); }
.inv-steps li.on span { background: var(--fluo, #d8ff3a); color: #0a0f40; }
.inv-steps li.done span { background: var(--ok-wash); }
@media (prefers-reduced-motion: no-preference) {
  .inv-hot b, .inv-hot em { animation: inv-fade .3s calc(.45s + var(--d, 0s)) both, inv-stk .5s cubic-bezier(.34, 1.56, .64, 1) calc(.45s + var(--d, 0s)) both; }
}
@keyframes inv-stk { 0% { scale: .3; rotate: -30deg; } 60% { scale: 1.12; } 100% { scale: 1; } }

/* cycle 8: exam page = tool + practice first, reference text folded below; hub thumbnails */
.inv-page2 { gap: 18px; }
.inv-phead { gap: 2px; }
.inv-phead h1 { font-size: var(--fs-xl); }
.inv-sec { gap: 10px; }
.inv-ref { display: grid; gap: 8px; }
.inv-ref-h { font-size: var(--fs-md); margin: 0; }
.inv-folds { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.inv-fold { flex: 0 1 auto; }
.inv-fold[open] { flex: 1 1 100%; order: 9; }
.inv-fold summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-sm); font-weight: 600; }
.inv-fold summary::-webkit-details-marker { display: none; }
.inv-fold summary::after { content: "+"; font-family: var(--font-mono); color: var(--ink-3); }
.inv-fold[open] summary { background: var(--cobalt-wash); border-color: var(--cobalt); color: var(--cobalt-ink); }
.inv-fold[open] summary::after { content: "−"; }
.inv-fold.key summary { border-left: 3px solid var(--cobalt); }
.inv-fold.trap summary { border-left: 3px solid var(--trap); }
.inv-fold-b { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.inv-fold-b ul, .inv-fold-b ol { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.inv-fold-b p { margin: 0; }
.inv-thumb { position: relative; margin: -18px -18px 4px; height: 118px; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: #000; border-bottom: 1px solid var(--line); }
.inv-thumb svg { display: block; width: 100%; height: 100%; }
.inv-thumb .inv-schema { position: absolute; right: 8px; bottom: 8px; background: var(--surface); }
.inv-thumb-cv { background: #fff; }
.inv-card .small.muted { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* src/bscan-sim.css */
/* ===== B-scan simulator (#inv-bscan-sim) — identity v2 « Fluorescéine » : calm study surfaces, fluo only for the marker and the decisive sign.
   Phone first (390 × 844): the eye and the B image are stacked and sized from the viewport height so both stay on screen together. ===== */
.bs3-lead { max-width: 60ch; margin: 4px 0 0; }
.bs3 { display: flex; flex-direction: column; gap: 10px; min-width: 0; scroll-margin-top: 76px; }
.bs3-grid { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); align-items: start; order: 1; }
.bs3-read { order: 2; }
.bs3-ctl { order: 3; }
.bs3-case { order: 4; }
.bs3.answered .bs3-case { order: 3; }
.bs3.answered .bs3-ctl { order: 4; }
.bs3-fig { margin: 0; }
.bs3-eye { position: relative; height: clamp(150px, 24svh, 212px); background: var(--sunk); overflow: hidden;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.bs3-eye canvas { display: block; width: 100%; height: 100%; cursor: grab; outline-offset: -3px; touch-action: none; }
.bs3-eye canvas:active { cursor: grabbing; }
.bs3-labs { position: absolute; inset: 0; pointer-events: none; }
.bs3-labs span { position: absolute; left: 0; top: 0; font-size: 11px; font-weight: 700; line-height: 1; color: var(--ink-2); white-space: nowrap; padding: 2px 4px; border-radius: 5px; background: color-mix(in srgb, var(--surface) 78%, transparent); }
.bs3-snap { position: absolute; left: 8px; bottom: 8px; pointer-events: none; font-size: 11px; font-weight: 700; line-height: 1; padding: 5px 8px; border-radius: 7px; color: var(--ink-2); background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); transition: background-color .12s, color .12s; }
.bs3-snap.on { color: #0a0f40; background: #d8ff3a; border-color: #0a0f40; }
.bs3-view { position: absolute; right: 8px; bottom: 8px; min-height: 44px; padding: 4px 12px; }
.bs3-img { position: relative; background: #000; aspect-ratio: 1 / 1; width: 100%; max-width: min(100%, clamp(230px, 38svh, 330px)); margin: 0 auto; }
.bs3-fig:has(.bs3-img) { background: #000; }
.bs3-fig:has(.bs3-img) figcaption { background: var(--surface); }
.bs3-img canvas { display: block; width: 100%; height: 100%; }
.bs3-top { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #0a0f40; background: #d8ff3a; padding: 2px 6px; border-radius: 5px; }
.bs3-hud, .bs3-mhz { position: absolute; font-size: 10px; line-height: 1; color: #c9ceee; letter-spacing: .02em; }
.bs3-hud { right: 8px; top: 8px; }
.bs3-mhz { left: 8px; bottom: 8px; }
.bs3-sim { position: absolute; right: 6px; bottom: 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #cfd3ee; background: rgba(10, 15, 64, .72); padding: 2px 6px; border-radius: 5px; }
.bs3-ring { position: absolute; width: 16%; aspect-ratio: 1 / 1; margin: -8% 0 0 -8%; border-radius: 50%; border: 3px solid var(--sign); box-shadow: 0 0 0 3px var(--sign-halo), inset 0 0 0 2px var(--sign-halo); pointer-events: none; }
.bs3-read { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--cobalt-wash); color: var(--ink); min-height: 2.9em; }
.bs3-ctl { display: grid; gap: 8px; }
.bs3-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.bs3-k { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); min-width: 5.2em; }
.bs3-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bs3-row .btn.sm, .bs3-seg button { min-height: 44px; }
.bs3-row .btn.sm { padding-inline: 14px; }
.bs3-chips .btn.sm { min-width: 52px; }
.bs3-row input[type=range] { flex: 1 1 120px; min-width: 0; accent-color: var(--cobalt); min-height: 44px; margin: 0; touch-action: pan-y; }
.bs3-gv { min-width: 8.5em; text-align: right; }
.bs3 .btn[aria-pressed="true"] { background: var(--cobalt-wash); color: var(--cobalt-ink); border-color: var(--cobalt); }
.bs3-val { position: relative; display: inline-block; font-size: var(--fs-xs); }
.bs3-val summary { list-style: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink-3); display: grid; place-items: center; font-weight: 700; font-style: italic; font-family: Georgia, serif; cursor: pointer; background: var(--surface); }
.bs3-val summary::-webkit-details-marker { display: none; }
.bs3-val[open] summary { border-color: var(--hy); color: var(--hy); }
.bs3-val > span { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--hy-wash); color: var(--ink); max-width: 34ch; line-height: 1.4; }
.bs3-row .bs3-val[open] { flex-basis: 100%; }
.bs3-case { display: grid; gap: 10px; }
.bs3-stem { margin: 0; font-size: var(--fs-base); font-weight: 600; }
.bs3-q { font-weight: 700; font-size: var(--fs-sm); }
.bs3-score { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--fluo-wash); border: 1.5px solid var(--ink); }
.bs3-score b { font-family: var(--font-display); font-size: var(--fs-lg); margin-right: 6px; }
.bs3-ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bs3-ticks li.ok { color: var(--ok); font-weight: 600; }
.bs3-rev p { margin: 4px 0 0; }
.bs3-rev .bs3-val { margin-top: 8px; }
.bs3-gest { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bs3-gest .tag.ok { color: var(--ok); background: var(--ok-wash); }
.bs3-case .btn.primary { min-height: 48px; }
.bs3-promo { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--ink); background: var(--fluo-wash); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-hard); }
.bs3-promo:hover { background: var(--fluo); color: var(--on-fluo); }
.bs3-hubcard { border-color: var(--ink); background: var(--fluo-wash); }
@media (max-width: 859px) {
  /* compact header: the breadcrumb already carries the title */
  .bs3-page .phead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0; }
  .bs3-page { gap: 8px; }
  .bs3-fig figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; border: 0; }
  .bs3-ctl .bs3-k:not(label) { display: none; }
  .bs3-ctl label.bs3-k { min-width: 0; }
  .bs3-gv { min-width: 7.2em; }
  .bs3-read { font-size: var(--fs-xs); min-height: 3.4em; }
}
@media (min-width: 860px) {
  .bs3 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); column-gap: 16px; row-gap: 12px; }
  .bs3-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; }
  .bs3-eye { height: auto; aspect-ratio: 4 / 3; }
  .bs3-img { max-width: none; }
  .bs3-grid, .bs3-read, .bs3-ctl { grid-column: 1; }
  .bs3-case, .bs3.answered .bs3-case { grid-column: 2; grid-row: 1 / span 3; align-self: start; position: sticky; top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .bs3-snap { transition: none; } }

/* src/tree.css */
/* ===== Tree v2 — visual decision tree (src/tree.js) — owner: exercices interactifs ===== */
.tree { display: grid; gap: 10px; min-width: 0; }
.tree-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.tree-seg button { min-height: 36px; }
.tree-restart { display: none; }
.tree[data-mode="walk"] .tree-restart { display: inline-flex; }
.tree[data-mode="walk"] .tree-box, .tree[data-mode="overview"] .tree-walk { display: none; }
.tree-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* shared bits */
.tree-edge { font: 700 11px/1 var(--font-body); letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 99px; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); white-space: nowrap; }
.no > .tree-edge, .tree-leaf.no .tree-edge { border-style: dashed; }
.tree-tag { font: 700 11px/1 var(--font-body); padding: 4px 7px; border-radius: 6px; background: var(--urgent); color: var(--paper); }
.tree-qn { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--ink); font: 700 11px/1 var(--font-mono); flex: none; }

/* ---------- walk mode: one question per card, path as a trail ---------- */
.tree-walk { display: grid; gap: 10px; }
.tw-dots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tw-dots li { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 11px/1 var(--font-mono); background: var(--sunk); color: var(--ink-3); border: 1.5px solid var(--line); }
.tw-dots li.on { background: var(--fluo); color: var(--on-fluo, #0a0f40); border-color: var(--ink); }
.tw-dots li.cur { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tw-trail { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 6px; border-left: 4px solid var(--fluo); }
.tw-trail:empty { display: none; }
.tw-step { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: start; padding: 4px 6px; font-size: var(--fs-sm); line-height: 1.4; }
.tw-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font: 700 11px/1 var(--font-mono); }
.tw-q { margin: 0; color: var(--ink-2); }
.tw-a { margin: 2px 0 0; }
.tw-card { background: var(--ink); color: var(--paper); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; box-shadow: var(--shadow); }
.tw-card a, .tw-card .gt { color: inherit; }
.tw-qn { font: 700 var(--fs-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.tw-qt { margin: 0; font-weight: 700; font-size: var(--fs-md); line-height: 1.35; }
.tree-yn { display: flex; gap: 10px; }
.tree-yn .btn { flex: 1 1 0; max-width: 160px; min-height: 44px; background: var(--paper); color: var(--ink); border-color: var(--paper); font-weight: 700; }
.tw-act { position: relative; display: grid; gap: 6px; justify-items: start; background: var(--surface); border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; font-size: var(--fs-sm); }
.tw-act p { margin: 0; }
.tw-act.urgent { border-color: var(--urgent); border-left-width: 6px; background: var(--urgent-wash); }
.tw-end { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 2px solid var(--ink); background: var(--fluo-wash); }
.tw-card.just, .tw-step.just { animation: tw-in .28s ease-out both; }
@keyframes tw-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- overview: compact flowchart ---------- */
.tree-box { container-type: inline-size; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 12px 10px; }
.tree-canvas { position: relative; min-width: 260px; }
.tree-wires { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.tree-wire { fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round; }
.tree-wire.no { stroke-dasharray: 5 4; }
.tree-wire.then { stroke-dasharray: 2 5; stroke-width: 2; }
.tree-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; position: relative; z-index: 1; }
.tree-step { position: relative; display: grid; gap: 16px; }
.tree-q { justify-self: center; width: min(100%, 460px); background: var(--ink); color: var(--paper); border-radius: 12px; padding: 8px 10px; display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); }
.tree-q.flash { outline: 3px solid var(--fluo); outline-offset: 2px; }
.tree-q a, .tree-q .gt { color: inherit; }
.tree-qt { margin: 0; font-weight: 700; line-height: 1.3; }
.tree-br { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.tree-leaf { position: relative; display: grid; gap: 4px; justify-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; font-size: 13px; line-height: 1.38; }
.tree-leaf p { margin: 0; }
.tree-leaf .tree-tag { position: absolute; top: -9px; right: 8px; }
.tree-leaf.urgent { border-color: var(--urgent); border-left-width: 4px; background: var(--urgent-wash); }
.tree-leaf.end { box-shadow: inset 0 -3px 0 var(--line); }
.tree-leaf.pass { justify-self: center; display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-style: dashed; background: transparent; }
.tree-go { font-size: var(--fs-xs); font-weight: 700; color: var(--cobalt-ink); text-decoration: none; }
.tree-go:hover { text-decoration: underline; }
.tree-then { justify-self: center; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); background: var(--paper); padding: 0 6px; margin-top: -8px; }
/* wide box: Oui | question | Non on one row */
@container (min-width: 700px) {
  .tree-flow { gap: 26px; }
  .tree-step { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "y q n"; gap: 0 26px; align-items: center; }
  .tree-q { grid-area: q; width: 100%; }
  .tree-br { display: contents; }
  .tree-leaf.yes { grid-area: y; }
  .tree-leaf.no { grid-area: n; }
  .tree-leaf.pass { justify-self: stretch; justify-content: center; }
  .tree-then { grid-column: 2; grid-row: 2; margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) { .tw-card.just, .tw-step.just { animation: none; } }
.no-motion .tw-card.just, .no-motion .tw-step.just { animation: none; }

/* cycle 9: clinical vignette and checked answers */
.tw-vig { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cobalt); font-size: var(--fs-sm); line-height: 1.45; }
.tw-ok { font-weight: 700; color: var(--ok); }
.tw-bad { font-weight: 700; color: var(--bad); display: block; }
.tw-step.miss .tw-n { background: var(--bad); }

/* src/web.css */
/* ===== Web shell additions (static site / Capacitor). Visual design lives in styles.css. ===== */
.langsw { flex: none; }
.langsw button { min-width: 40px; min-height: 32px; font-weight: 600; letter-spacing: .03em; }
.topbar .langsw button { min-height: 36px; }
.lang-row { display: flex; align-items: center; gap: 8px; }
.fr-badge { margin-left: 8px; font-size: .68rem; letter-spacing: .05em; vertical-align: middle; }
h1 .fr-badge { position: relative; top: -.2em; }
@media (max-width: 380px) { .topbar .brand > span > span { display: none; } }
noscript p { max-width: 40rem; margin: 40px auto; padding: 0 16px; font-family: system-ui, sans-serif; }

/* five-item tab bar when Investigations is present */
.tabbar[data-n="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tabbar[data-n="5"] a { font-size: .68rem; }
/* educational disclaimer (rail, home) */
.disclaimer { margin: 4px 0 0; line-height: 1.35; }
.disclaimer a { color: inherit; }
.page > .disclaimer { margin-top: 28px; }
/* image du jour + streak */
.daily-card { position: relative; }
.daily-card .daily-th { display: block; height: 96px; margin: -2px 0 6px; border-radius: 10px; overflow: hidden; background: var(--sunk); }
.daily-card .daily-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.daily-card.done b::after { content: " ✓"; }
.daily-streak { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.streak b { font-size: 1.15em; }
.inv-banner { margin: 0 0 16px; border-color: var(--cobalt); }
.tbl.credits td { font-size: var(--fs-xs, .8rem); vertical-align: top; }
/* featured case (campaign link): focus layout without the navigation chrome */
.focus-view .rail, .focus-view .tabbar { display: none !important; }
.focus-view .shell { grid-template-columns: minmax(0, 1fr) !important; }
.focus-view .main { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)) !important; }
@media (min-width: 1040px) { .focus-view .topbar { display: flex; } .focus-view .topbar [data-act="menu"] { display: none; } }
.featured { max-width: 980px; margin: 0 auto; }
.feat-cta { margin-top: 18px; border-color: var(--cobalt); }
/* native app (Capacitor): hide web-only UI */
html.native .web-only, html.is-native .web-only, html.native [data-web-only], html.native .install-prompt, html.native .open-in-app { display: none !important; }

/* accessibility: skip link (first focusable element), depth radios */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--cobalt); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: calc(8px + env(safe-area-inset-top, 0px)); outline: 3px solid var(--fluo, #b6f04e); outline-offset: 2px; }
.seg button[role="radio"][aria-checked="true"] { background: var(--cobalt-wash); color: var(--cobalt-ink); font-weight: 700; }
/* atlas filter row wraps on narrow screens and large text */
.atlas-filters { flex-wrap: wrap; }
.atlas-filters .seg { max-width: 100%; }
.atlas-filters input { flex: 1 1 200px; min-width: 0; max-width: 100%; }
/* sub-headings kept at the former h4 size (heading levels no longer skip from h2 to h4) */
h3.h4 { font-family: inherit; font-size: var(--fs-md); font-weight: 700; line-height: 1.3; margin: 0; letter-spacing: normal; }
/* pages never grow wider than the viewport because of one wide child (atlas at 320 px / A++) */
.page { grid-template-columns: minmax(0, 1fr); }
.atlas-filters .seg button { white-space: normal; }
.sec, .stack { min-width: 0; }
.sec { grid-template-columns: minmax(0, 1fr); }
.ph-card .cap, .ph-card .muted, .credit { overflow-wrap: anywhere; }
/* anatomy: invisible enlarged hit area around tiny structures (≥ 24 px on screen) */
.hit-pad, .hit-pad * { fill: none !important; stroke: transparent !important; stroke-width: 24px !important; vector-effect: non-scaling-stroke; pointer-events: stroke; }
.info h3.h4 { font-family: var(--font-display); font-size: var(--fs-lg); }
.atlas-h { font-size: var(--fs-lg, 1.15rem); }
/* long single words (e.g. « Blépharokératoconjonctivite ») hyphenate or wrap instead of widening the page */
h1, h2, h3, .atlas-h, .cap, .eyebrow { overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }

/* ---------- fiche: 4 screens ---------- */
.fsteps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fsteps a { display: grid; justify-items: center; gap: 4px; padding: 6px 2px; border-radius: 10px; text-decoration: none; color: var(--ink-3); font-size: var(--fs-xs, .78rem); font-weight: 600; text-align: center; min-height: 44px; }
.fsteps .pip { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--surface); font-family: var(--font-mono); }
.fsteps li.done .pip { background: var(--cobalt-wash); border-color: var(--cobalt); color: var(--cobalt-ink); }
.fsteps li.on a { color: var(--cobalt-ink); }
.fsteps li.on .pip { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt, #fff); }
.fsteps .lab { overflow-wrap: anywhere; line-height: 1.2; }
.fstep-nav { justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.fstep-nav .btn { max-width: 100%; }
.fiche-page .phead { gap: 6px; }
h2.h3 { font-size: var(--fs-lg, 1.15rem); }
details.more > summary { font-weight: 700; }
/* causal chain stepped by the learner */
.chain.paced .cstep.pending { display: none; }
/* treatment card group */
.tx-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.tx-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); display: grid; gap: 4px; }
.tx-card.first { border-color: var(--cobalt); }
.tx-card.refer { border-color: var(--urgent, #c0392b); }
.tx-card.trap { border-color: var(--hy, #d4a017); }

/* ---------- cycle 8: compact fiche header (≤ 25 % of a phone screen) ---------- */
.fiche-page { gap: 14px; }
.fiche-bar { display: grid; gap: 6px; }
.fb-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-top .lvl-chip { margin-left: auto; font-size: var(--fs-xs, .78rem); padding: 4px 10px; min-height: 32px; }
.fb-title { font-size: clamp(1.15rem, 4.6vw, 1.4rem) !important; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.lvl-pop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lvl-pop[hidden] { display: none; }
.fiche-bar .fsteps a { padding: 2px; min-height: 0; gap: 2px; }
.fiche-bar .fsteps .pip { width: 24px; height: 24px; font-size: .78rem; }
@media (max-width: 600px) { .fiche-page > .crumbs { display: none; } }
/* « Voir »: Observe → Réponds → Révèle on the photo */
.voir-card .voir-media { position: relative; }
.voir-ask { display: grid; gap: 6px; justify-items: start; }
.voir-sign { position: relative; }
.mech-fig .pair { gap: 10px; }
details.more .tag.plain { font-size: .68rem; margin-left: 6px; }
.thumb-svg { display: block; width: 100%; height: 100%; background: var(--surface); }
.thumb-svg svg { width: 100%; height: 100%; display: block; }
/* module A micro-fiches, capsule cards, module micro-cards */
.a-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.a-ico { display: grid; place-items: center; width: 100%; height: 100%; background: var(--cobalt-wash); color: var(--cobalt-ink); font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; }
.a-dots { display: flex; flex-wrap: wrap; gap: 4px; }
.a-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.a-dots i.done { background: var(--cobalt-wash); outline: 1px solid var(--cobalt); }
.a-dots i.on { background: var(--cobalt); }
.micro-grid .fcard h3 { font-size: var(--fs-md, 1rem); }
/* content line breaks (\n) authored by the editors (definitions ≤ 125 characters per line) */
.def-text, .hy-list li, .voir-sign, .fstep-body p.read, .fstep-body .callout > span:not(.eyebrow) { white-space: pre-line; }
/* cycle 9: Voir loop on the photo */
.voir-media[data-act="voir-tap"] { cursor: crosshair; }
.voir-media img { display: block; width: 100%; height: auto; }
.voir-miss { position: absolute; transform: translate(-50%, -120%); background: #111; color: #fff; font-size: .72rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; pointer-events: none; animation: voir-fade 1.6s ease forwards; }
@keyframes voir-fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.voir-hint { position: absolute; width: calc(var(--r) * 2%); aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px dashed #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); pointer-events: none; }
.voir-sign.feedback { padding-right: 96px; } /* room for the sticker, which never covers the caption above */
.voir-sign.neutral { border-left: 4px solid var(--line); background: var(--sunk); padding: 8px 12px; border-radius: 10px; }
.voir-ask .opts { width: 100%; }
@media (prefers-reduced-motion: reduce) { .voir-miss { animation: none; } }
html.no-motion .voir-miss { animation: none; }
/* cycle 9: Comprendre — normal vs pathological side by side (≤ 220 px on phones), then a compact causal chain */
.mech-fig .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mech-fig .pair .fig .fig-body svg { max-height: 150px; width: 100%; }
.mech-fig .pair .lab { padding: 2px 6px; }
.mech-fig .fig-cap { font-size: .68rem; padding: 4px 6px; gap: 4px; flex-wrap: wrap; }
.mech-fig .fig-cap > span:first-child { display: none; } /* captions live in « Révéler les anomalies »; the « schéma » badge stays */
.mech-fig .fig-cap [data-act="figzoom"] { padding: 2px 8px; }
.chain.paced { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: stretch; }
.chain.paced .cstep { display: flex; align-items: center; gap: 4px; padding: 0; flex: 0 1 auto; max-width: 100%; }
.chain.paced .cstep::before { display: none; }
.chain.paced .cstep + .cstep:not(.pending)::after { content: none; }
.chain.paced .cstep:not(:first-child) .node::before { content: "→"; position: absolute; left: -16px; color: var(--ink-3); font-weight: 700; }
.chain.paced .cstep .node { width: 24px; height: 24px; font-size: .75rem; position: relative; margin-left: 14px; flex: none; }
.chain.paced .cstep:first-child .node { margin-left: 0; }
.chain.paced .cstep .body { padding: 4px 8px; }
.chain.paced .cstep .body .k { font-size: .62rem; }
.chain.paced .cstep .body b { font-size: var(--fs-sm, .9rem); line-height: 1.25; }
.chain.paced .cstep .cutslot:empty { display: none; }
/* cycle 9: one header model; titles wrap on 2 lines (no ellipsis) */
.fb-title { white-space: normal !important; overflow: visible; text-overflow: clip; display: block; }
.fb-title.long { font-size: clamp(1.02rem, 4.1vw, 1.25rem) !important; }
.fiche-page { gap: 10px; }
.fiche-page .fstep-body { gap: 12px; }
.a-dots { gap: 5px; }
.a-dots i { width: 9px; height: 9px; }
/* micro-fiches: smaller simulations on phones */
@media (max-width: 600px) {
  .a-item [data-sim] svg, .a-item [data-sim] canvas { max-height: 230px; }
  .a-item [data-sim] .simgrid, .a-item [data-sim] .explorer { gap: 8px; }
  .a-item [data-sim] p.small.muted { display: none; }
}
/* capsule toolbox chips */
.tool-chips .chip { font-size: var(--fs-sm, .9rem); }
.tool-panel { display: grid; gap: 6px; }
/* réviser: one visual per mode */
.mode-ic.pic { overflow: hidden; padding: 0; }
.mode-ic.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* cas: image-case strip */
.ic-strip { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; border-color: var(--cobalt); }
.ic-pics { display: flex; }
.ic-pics img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid var(--surface); margin-left: -18px; }
.ic-pics img:first-child { margin-left: 0; }
/* apprendre covers: legible title over the photo */
.lcover { position: relative; isolation: isolate; }
.lcover::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5, 14, 29, .15) 0%, rgba(5, 14, 29, .82) 100%); border-radius: inherit; }
/* cycle 9b: phone budgets — Comprendre pair ≤ 220 px, home ≤ 2.5 screens, micro-fiches ≤ 1.5 screens */
@media (max-width: 600px) {
  .mech-fig .pair .fig .fig-body svg { max-height: 128px; }
  .mech-fig .pair .lab { font-size: .7rem; }
  .mech-fig .pair > div:last-child .schema-badge { display: none; } /* one « schéma » badge for the pair */
  .mech-fig .pair .schema-badge { font-size: .6rem; line-height: 1.2; }
  .mech-fig .pair .fig-cap { padding: 3px 4px; }
  .hero2-in { grid-template-columns: minmax(0, 1fr) 96px; gap: 10px 12px; padding: 18px 16px 18px; align-items: start; }
  .hero2 .hero-eye { order: 0; width: 96px; max-width: 96px; margin: 0; grid-column: 2; grid-row: 1; }
  .hero2 .hero-text { grid-column: 1 / -1; grid-row: 1; padding-right: 104px; }
  .hero2 .hero-art .ph-credit, .hero2 .hero-eye .credit, .hero2 .hero-eye figcaption { font-size: .55rem; }
  .hero2 h1 { font-size: 2.1rem; }
  .hero2 .hero-lead { font-size: .92rem; margin: 0; }
  .mod-card { grid-template-rows: 84px auto; }
  .mod-grid, .today-grid { gap: 10px; }
  .a-item .simgrid, .fstep-body .simgrid { gap: 8px; }
  .a-item [data-sim] .fig-cap { font-size: .72rem; padding: 4px 8px; }
  .a-item [data-sim] svg, .a-item [data-sim] canvas { max-height: 200px; }
  .a-item [data-sim] .chips { gap: 4px; }
  .a-item [data-sim] .chip { padding: 4px 9px; font-size: .76rem; min-height: 28px; }
  .a-item [data-sim] .readout { padding: 6px 10px; gap: 0; }
  .a-item [data-sim] .readout .v { font-size: 1.15rem; }
  .a-item [data-sim] .eyebrow { margin: 0; }
  .a-item [data-sim] .eqn { font-size: .72rem; padding: 4px 8px; }
}
.voir-sign.feedback { position: relative; padding-right: 120px; min-height: 46px; }
.voir-sign.feedback > .mo-sticker { top: 8px; right: 8px; } /* inside the verdict box: never over the caption */
@media (max-width: 600px) {
  .mech-fig .pair .fig-body svg, .mech-fig .pair .fig-body canvas { max-height: 110px; width: 100%; object-fit: contain; }
  .mech-fig .pair .fig-body .row.small { font-size: .7rem; gap: 4px; margin-top: 2px; }
  .mech-fig .pair .fig-body .row.small input[type="range"] { min-width: 0; width: 100%; }
}
@media (max-width: 600px) {
  .mech-fig .pair .fig-body .row.small { padding: 2px 4px !important; gap: 0 6px !important; font-size: .62rem; line-height: 1.25; }
  .mech-fig .pair .ph-img img { max-height: 118px; width: 100%; object-fit: contain; background: #000; }
  .mech-fig .pair .ph-b { padding: 4px 6px; gap: 2px; }
  .mech-fig .pair .ph-b .cap { display: none; } /* the caption is in the image's alt / « Agrandir » */
  .mech-fig .pair .ph-b .credit { font-size: .58rem; line-height: 1.25; overflow-wrap: anywhere; }
}
@media (max-width: 600px) {
  .mech-fig .pair > div:first-child .fig-cap [data-act="figzoom"] { display: none; } /* one « Agrandir » per pair (pathological side) */
  .mech-fig .pair .fig-cap-r { gap: 4px; }
  .mech-fig .pair [data-figtype="topo"] .fig-body > div:first-child { max-width: 112px !important; }
}
/* micro-fiches on phones: sim chip groups and multi-printout grids scroll sideways instead of stacking (≤ 1.5 screens) */
@media (max-width: 600px) {
  .a-item [data-sim] .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .a-item [data-sim] .chips::-webkit-scrollbar { display: none; }
  .a-item [data-sim] .chips .chip { flex: none; }
  .a-item [data-sim] .grid3 { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; }
  .a-item [data-sim] .grid3 > * { scroll-snap-align: start; min-width: 0; }
  .a-item [data-sim] .grid2 { gap: 6px; }
  .a-item [data-sim] .slider { gap: 2px; }
  .a-item .a-keys { gap: 4px; }
  .a-item .a-lead { margin: 0; }
}
@media (max-width: 600px) {
  .a-item [data-sim] svg, .a-item [data-sim] canvas { max-height: 170px; }
  .a-item [data-sim] .readout .v { font-size: 1rem; }
  .a-item [data-sim] .readout .u { font-size: .68rem; }
  .a-item [data-sim] .slider { padding: 0; }
  .a-item [data-sim] .stack { gap: 6px; }
  .a-item .fstep-nav { flex-wrap: nowrap; gap: 8px; }
  .a-item .fstep-nav > * { flex: 1 1 0; min-width: 0; font-size: .78rem; padding: 6px 10px; line-height: 1.2; }
  .a-item .pearl-card { padding: 10px 12px; }
}
@media (max-width: 600px) {
  .a-item [data-sim="structure"] .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .a-item [data-sim="structure"] .grid2 .slider { font-size: .72rem; }
  .a-item [data-sim="structure"] .grid2 .fig-cap { font-size: .62rem; }
}
@media (max-width: 600px) {
  .a-item .fstep-body { gap: 12px; }
  .a-item .fiche-bar { gap: 6px; padding-bottom: 8px; }
}
/* cycle 10: Voir — loops clipped inside the photo frame; found-zone ring for 2-step tasks */
.voir-media { position: relative; overflow: hidden; }
.voir-media .inv-hots > .mo-marks { overflow: hidden; }
.voir-found { position: absolute; width: calc(var(--r) * 2%); aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid var(--fluo, #d8ff3a); border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55); pointer-events: none; }
.voir-sign .verdict[hidden] { display: none; }
/* cycle 10: home hero — photo ≥ 140 px on phones, credit behind an « i » button, sticker beside the sign (never on it) */
.hero-photo .mo-sticker { top: auto; bottom: -16px; right: auto; left: -14px; --rot: -7deg; }
.hero-photo figcaption.hero-cred { position: absolute; right: 16px; bottom: 14px; margin: 0; z-index: 3; font-size: 11px; line-height: 1.35; }
.hero-cred summary { list-style: none; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: #0a0f40; font: 700 13px/1 var(--font-display); font-style: italic; box-shadow: 0 0 0 2px rgba(10, 15, 64, .55); margin-left: auto; }
.hero-cred summary::-webkit-details-marker { display: none; }
.hero-cred summary:focus-visible { outline: 3px solid var(--fluo); outline-offset: 2px; }
.hero-cred-t { position: absolute; right: 0; bottom: calc(100% + 6px); width: max-content; max-width: min(260px, 70vw); background: #fff; color: #0a0f40; padding: 8px 10px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.hero-cred-t a { color: inherit; }
.hero-photo { padding-bottom: 10px; }
@media (max-width: 760px) {
  .hero2-in { grid-template-columns: minmax(0, 1fr) 160px; gap: 8px 12px; padding: 20px 16px 22px; align-items: start; }
  .hero2 .hero-text { display: contents; padding: 0; }
  .hero2 .hero-text > * { grid-column: 1; }
  .hero2 .hero-text > .row { grid-column: 1 / -1; margin-top: 10px; }
  .hero2 .hero-eye { grid-column: 2; grid-row: 1 / span 3; width: 160px; max-width: 160px; margin: 4px 0 0; order: 0; align-self: start; }
  .hero2 .hero-ocellus { display: none; }
  .hero2 .hero-art { position: static; }
  .hero2 .hero-photo { padding: 6px 6px 6px; border-radius: 14px; transform: rotate(-2.5deg); box-shadow: 0 8px 0 -3px #0a0f40; }
  .hero2 .hero-photo .mo-sticker { font-size: .78rem; padding: 4px 10px 5px; bottom: -14px; left: -10px; }
  .hero2 .hero-cred { right: 10px; bottom: 10px; }
  .hero2 h1 { font-size: 2rem; line-height: 1; }
  .hero2 .eyebrow { font-size: .66rem; letter-spacing: .08em; }
  .hero2 .hero-lead { font-size: .9rem; line-height: 1.4; }
}
/* cycle 10: #reviser = a real grid of tiles, identity v2 palette only (cobalt, ink, fluo, white; urgent for the error tile) */
.mode-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.mode-tile { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 10px; padding: 10px 10px 14px; background: var(--surface); border: 2px solid var(--edge); box-shadow: 0 4px 0 var(--edge); }
.mode-tile .mode-ic { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; font-size: 2.2rem; background: var(--cobalt); color: #fff; }
.mode-tile:nth-child(3n+2) .mode-ic:not(.pic) { background: var(--edge); color: var(--fluo); }
.mode-tile:nth-child(3n) .mode-ic:not(.pic) { background: var(--fluo); color: var(--on-fluo); }
.mode-tile .mode-ic.pic { background: #000; }
.mode-tile b { font-size: 1.02rem; line-height: 1.2; }
.mode-tile .xs.mono { color: var(--cobalt-ink); font-weight: 700; }
.mode-tile.err-tile { border-color: var(--urgent); box-shadow: 0 4px 0 var(--urgent); background: var(--surface); }
.mode-tile.err-tile .mode-ic { background: var(--urgent); color: #fff; }
@media (max-width: 600px) {
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mode-tile { padding: 8px 8px 12px; gap: 8px; }
  .mode-tile .mode-ic { aspect-ratio: 16 / 10; font-size: 1.7rem; }
  .mode-tile .small.muted { display: none; } /* phone: picture + name + count */
  .mode-tile b { font-size: .92rem; }
}
.hero2 .eyebrow { hyphens: manual; -webkit-hyphens: manual; }
.voir-media .inv-hot.dec > i { inset: -40%; } /* fallback ring (no Motion): around the sign, not on it */
/* cycle 11: one stepper in Comprendre — the chain item mapped onto each drawn step */
.mech-sub { margin: 4px 0 0; color: var(--ink-2); line-height: 1.4; }
.mech-sub .k { display: inline-block; font: 700 .66rem/1.4 var(--font-mono, monospace); text-transform: uppercase; letter-spacing: .06em; color: var(--cobalt-ink); margin-right: 4px; }
.mech-chain [data-levnote] { margin-top: 6px; }
.chain-list { padding-left: 1.2em; }
/* sticker placed by motion.js placeSticker(): inline row when every corner would cover text (never over the sign's name) */
.feedback > .mo-sticker.mo-inline { position: static; display: inline-flex; grid-column: 1 / -1; justify-self: end; width: max-content; max-width: 100%; margin-top: 4px; }

/* ===== QA démo (2026-11-22): mobile stabilisation, see docs/QA-DEMO.md ===== */
/* horizontal step lists (fiche pips, tree dots, mechanism dots, investigation steps): the global « li + li » spacing pushed items 2..n below the first */
.fsteps li + li, .tw-dots li + li, .mech-dots li + li, .inv-steps li + li { margin-top: 0; }
/* a grid .stack never grows wider than its column because of one wide child (a <select> sizes to its longest option: gonioscopy overflowed by 34 px at 360 px) */
.stack { grid-template-columns: minmax(0, 1fr); }
select { max-width: 100%; }
/* notch: if iOS reports a top inset (status bar drawn over the page), the page starts below it instead of under the sticky top bar */
body { padding-top: env(safe-area-inset-top, 0px); }
/* touch screens: every control gets a hit area of at least 44 px while its drawn size stays the same.
   :where() keeps the specificity at 0, so buttons that are absolutely placed (.inv-zoom, .bs3-view…) keep their own position. */
@media (pointer: coarse) {
  :where(.btn, .chip, .conf button, .crumbs a, a.eyebrow, .hero-cred summary, .bs3-val summary, .inv-term, .fc-hint summary) { position: relative; }
  :where(.btn, .chip, .conf button, .crumbs a, a.eyebrow, .hero-cred summary, .bs3-val summary, .inv-term, .fc-hint summary)::after { content: ""; position: absolute; inset: -2px; }
  :where(.btn.sm, .conf button)::after { inset: -6px -3px; }
  :where(.chip)::after { inset: -8px -3px; }
  .seg button, .topbar .langsw button { min-height: 44px; min-width: 44px; } /* .seg clips its children (overflow: hidden), so a pseudo hit area would be cut: the buttons grow instead */
  .inv-fold summary { min-height: 44px; } /* its ::after draws the « + », so no hit-area pseudo here */
  :where(.btn.xs, .bs3-val summary)::after { inset: -8px; }
  :where(.crumbs a, a.eyebrow, .inv-term, .fc-hint summary)::after { inset: -13px -4px; }
  .a-item [data-sim] .chips { padding-block: 8px; margin-block: -8px; } /* room for the chips’ hit area inside the horizontal scroller */
  :where(.hero-cred summary)::after { inset: -10px; }
  .car-nav .btn { min-width: 44px; }
}
