/* Faisceau — styles
 * Identité : un câble de fibres. Chaque parcours = une fibre (code couleur TIA-598).
 * Le jaune (gaine monomode OS2) ne sert qu'à signaler « maintenant » et l'action principale.
 */

/* ---------- polices (hébergées localement, OFL) ---------- */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-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: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,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: "Barlow"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-500-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: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,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: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-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: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,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: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/barlow-latin-700-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: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/barlow-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,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: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/barlow-semi-condensed-latin-600-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: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/barlow-semi-condensed-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,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: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/barlow-semi-condensed-latin-700-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: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/barlow-semi-condensed-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,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: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/jetbrains-mono-latin-600-normal.woff2) format("woff2"); }

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --paper: #f2f4f5;
  --panel: #ffffff;
  --ink: #14212b;
  --ink-2: #4f5f6b;
  --ink-3: #75848f;
  --rule: #d2dae0;
  --rule-2: #e5eaed;
  --signal: #f5c400;          /* gaine OS2 */
  --signal-ink: #14212b;
  --ok: #17803d;
  --ko: #c4213a;
  --code-bg: #12202a;
  --code-ink: #dfe7ec;
  --code-dim: #8ea3b3;
  --shadow: 0 1px 0 rgba(20, 33, 43, .06);

  /* fibres TIA-598 */
  --f-blue: #1f6fd1;
  --f-orange: #e07000;
  --f-green: #1b8f44;
  --f-brown: #8b5a2b;
  --f-slate: #66798a;
  --f-red: #d22a40;
  --f-violet: #7a4fc9;
  --f-aqua: #00999b;

  --font-ui: "Barlow", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Barlow Semi Condensed", "Barlow", "Arial Narrow", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 70ch;
  --rail: 268px;
  --radius: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0d151c;
    --panel: #131e27;
    --ink: #e3e9ed;
    --ink-2: #a4b3be;
    --ink-3: #7d8e9a;
    --rule: #263540;
    --rule-2: #1b2832;
    --ok: #3cc26b;
    --ko: #ff5c6f;
    --code-bg: #0a1117;
    --shadow: none;
    --f-blue: #4a90ec; --f-orange: #f38a1d; --f-green: #3cb36a; --f-brown: #b5814f;
    --f-slate: #8ea1b1; --f-red: #f0546a; --f-violet: #a07ef0; --f-aqua: #22c1c3;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d151c;
  --panel: #131e27;
  --ink: #e3e9ed;
  --ink-2: #a4b3be;
  --ink-3: #7d8e9a;
  --rule: #263540;
  --rule-2: #1b2832;
  --ok: #3cc26b;
  --ko: #ff5c6f;
  --code-bg: #0a1117;
  --shadow: none;
  --f-blue: #4a90ec; --f-orange: #f38a1d; --f-green: #3cb36a; --f-brown: #b5814f;
  --f-slate: #8ea1b1; --f-red: #f0546a; --f-violet: #a07ef0; --f-aqua: #22c1c3;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 64px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--signal); color: var(--signal-ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

h1, h2, h3, h4, h5 { font-family: var(--font-head); line-height: 1.15; margin: 1.6em 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem); font-weight: 700; margin-top: .2em; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.28rem; font-weight: 600; }
h4, h5 { font-size: 1.06rem; font-weight: 600; }
p { margin: 0 0 1em; }
code { font-family: var(--font-mono); font-size: .86em; background: var(--rule-2); padding: .08em .32em; border-radius: 3px; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }

/* ---------- coquille ---------- */
.topbar { display: none; }
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--rule);
  background: var(--panel);
  padding: 18px 16px 24px;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 1.45rem; letter-spacing: .01em; margin-bottom: 6px; }
.brand-mark { width: 40px; height: 24px; flex: none; }
.brand-mark path { fill: none; stroke-width: 2.4; stroke-linecap: round; }
.brand-mark .bm1 { stroke: var(--f-blue); } .brand-mark .bm2 { stroke: var(--f-orange); }
.brand-mark .bm3 { stroke: var(--f-green); } .brand-mark .bm4 { stroke: var(--f-red); }

.search input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper); font-size: 15px;
}
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail-main a, .rail-tracks a {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius);
  text-decoration: none; color: var(--ink-2); font-weight: 500; line-height: 1.3;
}
.rail-main a:hover, .rail-tracks a:hover { background: var(--rule-2); color: var(--ink); }
.rail a[aria-current="page"] { color: var(--ink); background: var(--rule-2); box-shadow: inset 3px 0 0 var(--signal); }
.rail-heading { margin: 14px 8px 4px; font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.rail-tracks .strand-mini { width: 22px; height: 4px; border-radius: 2px; flex: none; background: var(--c); }
.rail-tracks .pct { margin-left: auto; font-size: 13px; color: var(--ink-3); }

.timer { margin-top: 8px; }
.timer-row { display: flex; gap: 6px; padding: 0 8px; }
.timer-row select { flex: 1; min-width: 0; padding: 5px 6px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); font-size: 14px; }
.timer-time { margin: 6px 8px 0; font-size: 14px; color: var(--ink-2); min-height: 1.4em; }
.timer.running .timer-time { color: var(--ink); font-weight: 600; }

.rail-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.rail-foot-row { display: flex; gap: 14px; flex-wrap: wrap; }
.who { margin: 0 0 4px; font-weight: 600; }
.sync { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); }
.sync.offline { color: var(--ko); }

main { padding: 32px clamp(18px, 4vw, 56px) 80px; min-width: 0; outline: none; }
.page { max-width: 1120px; }
.reading { max-width: var(--measure); }
.loading { color: var(--ink-2); }

/* ---------- boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--ink);
  background: transparent; cursor: pointer; font-weight: 600; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--rule-2); }
.btn-primary { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.btn-primary:hover { background: color-mix(in srgb, var(--signal) 86%, #000); }
.btn-small { padding: 4px 10px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: 15px; }
.input, .field input, .field select, .field textarea, .inline-input {
  padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel);
}
textarea.notes { width: 100%; min-height: 360px; padding: 14px; font-family: var(--font-mono); font-size: 14px; line-height: 1.55; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); resize: vertical; }

/* ---------- accueil (pseudo) ---------- */
.gate { max-width: 560px; margin: 8vh auto 0; }
.gate h1 { margin-bottom: .3em; }
.gate form { display: flex; gap: 10px; margin: 22px 0 10px; }
.gate input { flex: 1; font-size: 1.15rem; padding: 10px 12px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--panel); }
.gate .hint { color: var(--ink-2); font-size: 15px; }
.gate-cable { width: 100%; height: 120px; margin-bottom: 18px; }
.gate-cable path { fill: none; stroke-width: 3; stroke-linecap: round; }

/* ---------- tableau de bord : le faisceau ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { margin-bottom: 0; }
.dash-head p { margin: 0; color: var(--ink-2); }
.bundle-wrap { margin: 22px 0 8px; overflow-x: auto; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--panel); }
.bundle { display: block; min-width: 760px; width: 100%; height: auto; }
.bundle .month { font-size: 12px; fill: var(--ink-3); font-family: var(--font-ui); }
.bundle .tick { stroke: var(--rule-2); stroke-width: 1; }
.bundle .lbl { font-size: 14px; fill: var(--ink); font-family: var(--font-ui); font-weight: 600; }
.bundle .lbl-sub { font-size: 12px; fill: var(--ink-3); font-family: var(--font-ui); }
.bundle .jacket { stroke: var(--rule); stroke-width: 2; }
.bundle .window { stroke-width: 7; stroke-linecap: round; opacity: .2; }
.bundle .lit { stroke-width: 7; stroke-linecap: round; }
.bundle .glow { stroke-width: 14; stroke-linecap: round; opacity: .18; filter: blur(3px); }
.bundle .exam { fill: var(--panel); stroke-width: 2.5; }
.bundle .exam.passed { stroke-width: 0; }
.bundle .today { stroke: var(--signal); stroke-width: 2.5; }
.bundle .today-lbl { font-size: 12px; font-weight: 700; fill: var(--ink); font-family: var(--font-ui); }
.bundle .today-tab { fill: var(--signal); }
@media (prefers-reduced-motion: no-preference) {
  .bundle .lit, .bundle .glow { animation: light 1.4s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 70ms); }
  @keyframes light { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
}
.bundle-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); margin: 6px 0 26px; }
.bundle-legend span::before { content: ""; display: inline-block; vertical-align: middle; margin-right: 6px; }
.lg-window::before { width: 18px; height: 6px; border-radius: 3px; background: var(--ink-3); opacity: .35; }
.lg-lit::before { width: 18px; height: 6px; border-radius: 3px; background: var(--ink-2); }
.lg-exam::before { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink-2); }
.lg-today::before { width: 2px; height: 12px; background: var(--signal); }

.now { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--rule); background: var(--panel); }
.now > section { padding: 20px 22px; }
.now > section + section { border-left: 1px solid var(--rule); }
.now h2 { margin: 0 0 6px; font-size: 1.35rem; }
.now .phase-dates { color: var(--ink-2); margin: 0 0 14px; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--rule-2); }
.todo li:first-child { border-top: 0; }
.todo .kind { font-size: 13px; color: var(--ink-3); min-width: 3.4em; }
.todo .mins { margin-left: auto; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.meter { height: 8px; background: var(--rule-2); border-radius: 4px; overflow: hidden; margin: 6px 0 4px; }
.meter > i { display: block; height: 100%; background: var(--c, var(--ink-2)); border-radius: 4px; }
.meter.signal > i { background: var(--signal); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 600; }
.countdown { font-family: var(--font-head); font-size: 2.1rem; font-weight: 700; line-height: 1; margin: 4px 0 2px; }

.tracks-table { margin-top: 30px; }
.trow {
  display: grid; grid-template-columns: 6px minmax(0, 2.1fr) minmax(0, 1.6fr) 70px 90px minmax(0, 1.3fr);
  gap: 16px; align-items: center; padding: 14px 16px 14px 0; border-top: 1px solid var(--rule);
  text-decoration: none; color: inherit;
}
.trow:last-child { border-bottom: 1px solid var(--rule); }
.trow:hover { background: var(--panel); }
.trow .strand { align-self: stretch; background: var(--c); border-radius: 0 3px 3px 0; }
.trow .t-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.trow .t-code { color: var(--ink-3); font-size: 14px; }
.trow .t-num { font-size: 15px; }
.trow .t-num small { display: block; color: var(--ink-3); font-size: 12px; }
.trow-head { display: grid; grid-template-columns: 6px minmax(0, 2.1fr) minmax(0, 1.6fr) 70px 90px minmax(0, 1.3fr); gap: 16px; padding: 0 16px 6px 0; color: var(--ink-3); font-size: 13px; }

/* statut d'examen */
.status { display: inline-block; font-size: 13px; font-weight: 600; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.status-booked { border-color: var(--ink-2); color: var(--ink); }
.status-passed { background: var(--ok); border-color: var(--ok); color: #fff; }
.status-failed { border-color: var(--ko); color: var(--ko); }

/* ---------- page parcours ---------- */
.track-head { border-left: 6px solid var(--c); padding-left: 18px; margin-bottom: 18px; }
.track-head h1 { margin: 0; }
.track-head p { margin: 4px 0 0; color: var(--ink-2); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 18px 0 26px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--c); }
.tabs .count { color: var(--ink-3); font-weight: 500; margin-left: 4px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; border: 1px solid var(--rule); background: var(--panel); margin: 0 0 22px; }
.facts > div { padding: 12px 16px; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); }
.facts dt { font-size: 13px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 600; }

.exam-box { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; padding: 14px 16px; border: 1px solid var(--rule); border-left: 4px solid var(--c); background: var(--panel); margin-bottom: 26px; }
.exam-box .field { margin: 0; }

.items { list-style: none; margin: 0; padding: 0; counter-reset: item; }
.items li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--rule-2); }
.items li:first-child { border-top: 0; }
.items .num { font-family: var(--font-head); font-weight: 700; color: var(--ink-3); text-align: right; }
.items a { font-weight: 600; text-decoration: none; }
.items a:hover { text-decoration: underline; }
.items .mins { font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.items li.done a { color: var(--ink-2); }
.items li.done .num { color: var(--c); }
.check { width: 22px; height: 22px; accent-color: var(--c); cursor: pointer; }
.item-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* ---------- contenu rédigé ---------- */
.prose { max-width: var(--measure); }
.prose h2 { padding-top: .2em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .25em 0; }
.prose li > p { margin: .3em 0; }
.prose a { color: var(--ink); }
.prose strong { font-weight: 700; }
.prose blockquote { margin: 1em 0; padding: .2em 0 .2em 1em; border-left: 3px solid var(--rule); color: var(--ink-2); }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--rule); background: var(--panel); }
.prose table, .budget-table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td, .budget-table th, .budget-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.prose th, .budget-table th { font-weight: 600; background: var(--rule-2); }
.prose tr:last-child td { border-bottom: 0; }
.prose td code, .prose th code { white-space: nowrap; }

figure.code { margin: 0 0 1.2em; border-radius: var(--radius); overflow: hidden; background: var(--code-bg); color: var(--code-ink); }
figure.code figcaption { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px 5px 14px; font-size: 13px; color: var(--code-dim); border-bottom: 1px solid rgba(255, 255, 255, .08); }
figure.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.55; tab-size: 2; }
figure.code code { background: none; padding: 0; font-size: inherit; color: inherit; overflow-wrap: normal; }
figure.code .c { color: var(--code-dim); }
.copy { background: transparent; border: 1px solid rgba(255, 255, 255, .22); color: var(--code-ink); border-radius: 3px; padding: 1px 8px; font-size: 12px; cursor: pointer; }
.copy:hover { border-color: var(--signal); }

.callout { margin: 1.2em 0; padding: 12px 16px; border-left: 4px solid var(--ink-3); background: var(--panel); }
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; margin: 0 0 4px; }
.callout-tip { border-left-color: var(--ok); }
.callout-warn, .callout-trap { border-left-color: var(--ko); }
.callout-exam { border-left-color: var(--signal); }
.callout-cost { border-left-color: var(--f-orange); }
.callout-note { border-left-color: var(--f-slate); }

.tag { display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.4; padding: 0 7px; border-radius: 9px; border: 1px solid currentColor; vertical-align: 1px; white-space: nowrap; }
.tag-gratuit { color: var(--ok); }
.tag-officiel { color: var(--f-blue); }
.tag-payant { color: var(--f-orange); }
.tag-essai, .tag-cloud { color: var(--f-violet); }
.tag-employeur, .tag-note, .tag-lourd { color: var(--ink-2); }

.item-head { border-left: 6px solid var(--c); padding-left: 18px; margin-bottom: 24px; }
.item-head .crumbs { font-size: 14px; color: var(--ink-2); margin: 0 0 4px; }
.item-head h1 { margin: 0 0 6px; }
.item-head .meta { color: var(--ink-2); margin: 0; }
.item-actions { display: flex; gap: 10px; align-items: center; margin: 0 0 26px; flex-wrap: wrap; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 42px; padding-top: 18px; border-top: 1px solid var(--rule); max-width: var(--measure); }
.pager a { text-decoration: none; max-width: 48%; }
.pager small { display: block; color: var(--ink-3); }
.pager .next { text-align: right; margin-left: auto; }

/* ---------- quiz ---------- */
.quiz { max-width: var(--measure); }
.q-meta { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 14px; margin-bottom: 8px; }
.q-track { display: inline-block; font-size: 13px; font-weight: 600; color: var(--c); margin-bottom: 4px; }
.q-text { font-size: 1.12rem; font-weight: 600; margin-bottom: 14px; }
.q-text p:last-child { margin-bottom: 0; }
.opts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.opt label { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: start; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); cursor: pointer; }
.opt label:hover { border-color: var(--ink-2); }
.opt input { margin-top: 4px; accent-color: var(--ink); }
.opt .k { display: none; }
.opt.correct label { border-color: var(--ok); box-shadow: inset 4px 0 0 var(--ok); }
.opt.wrong label { border-color: var(--ko); box-shadow: inset 4px 0 0 var(--ko); }
.feedback { padding: 12px 16px; border-left: 4px solid var(--ok); background: var(--panel); margin-bottom: 14px; }
.feedback.ko { border-left-color: var(--ko); }
.feedback .verdict { font-weight: 700; margin: 0 0 4px; }
.score { font-family: var(--font-head); font-size: 3.2rem; font-weight: 700; line-height: 1; margin: 8px 0; }
.hist { font-size: 14px; color: var(--ink-2); }
.review { list-style: none; padding: 0; }
.review li { border-top: 1px solid var(--rule); padding: 14px 0; }

/* ---------- planning ---------- */
.phases { list-style: none; margin: 0; padding: 0; }
.phase { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-top: 1px solid var(--rule); }
.phase.current { background: linear-gradient(90deg, color-mix(in srgb, var(--signal) 16%, transparent), transparent 60%); }
.phase .when { font-weight: 600; }
.phase .when small { display: block; color: var(--ink-3); font-weight: 400; }
.phase h3 { margin: 0 0 4px; }
.phase .chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 1px 8px 1px 6px; border: 1px solid var(--rule); border-radius: 10px; color: var(--ink-2); text-decoration: none; }
.chip::before { content: ""; width: 10px; height: 4px; border-radius: 2px; background: var(--c); }
.pace { font-size: 14px; color: var(--ink-2); }
.weeks { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 10px 0 0; border-bottom: 1px solid var(--rule); margin: 10px 0 4px; }
.weeks .w { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.weeks .w i { display: block; width: 100%; max-width: 38px; background: var(--ink-2); border-radius: 2px 2px 0 0; }
.weeks .w.cur i { background: var(--signal); }
.weeks .target { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--ko); }
.weeks-lbl { display: flex; gap: 6px; font-size: 12px; color: var(--ink-3); }
.weeks-lbl span { flex: 1; text-align: center; }

/* ---------- budget ---------- */
.budget-table td.num, .budget-table th.num { text-align: right; white-space: nowrap; }
.budget-table tfoot td { font-weight: 700; border-top: 2px solid var(--rule); }
.budget-table input { width: 90px; text-align: right; padding: 4px 6px; border: 1px solid var(--rule); border-radius: 3px; background: var(--panel); }
.big-figures { display: flex; gap: 0; flex-wrap: wrap; border: 1px solid var(--rule); background: var(--panel); margin: 18px 0 26px; }
.big-figures > div { flex: 1 1 200px; padding: 14px 18px; border-right: 1px solid var(--rule-2); }
.big-figures b { display: block; font-family: var(--font-head); font-size: 1.9rem; line-height: 1.1; }
.big-figures span { color: var(--ink-2); font-size: 14px; }

/* ---------- journal ---------- */
.log-form { display: grid; grid-template-columns: 150px minmax(0, 1fr) 110px minmax(0, 2fr) auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--rule); background: var(--panel); margin-bottom: 20px; }
.log-form .field { margin: 0; }
.log-list { width: 100%; border-collapse: collapse; font-size: 15px; }
.log-list td, .log-list th { padding: 7px 8px; border-bottom: 1px solid var(--rule-2); text-align: left; }
.log-list th { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.dot { display: inline-block; width: 10px; height: 4px; border-radius: 2px; background: var(--c); vertical-align: middle; margin-right: 6px; }

/* ---------- recherche ---------- */
.results { list-style: none; padding: 0; margin: 0; }
.results li { padding: 12px 0; border-top: 1px solid var(--rule-2); }
.results a { font-weight: 600; }
.results p { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }
.results mark { background: color-mix(in srgb, var(--signal) 55%, transparent); color: inherit; padding: 0 1px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: var(--radius); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 40; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .trow, .trow-head { grid-template-columns: 6px minmax(0, 2fr) minmax(0, 1.4fr) 64px minmax(0, 1.2fr); }
  .trow .t-hours, .trow-head .t-hours { display: none; }
}
@media (max-width: 860px) {
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); margin-top: calc(-1 * env(safe-area-inset-top, 0px));
    background: var(--panel); border-bottom: 1px solid var(--rule);
  }
  .menu-btn { border: 1px solid var(--ink); background: none; border-radius: var(--radius); padding: 4px 10px; font-weight: 600; cursor: pointer; }
  .brand-sm { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; text-decoration: none; }
  .topbar .sync { margin: 0 0 0 auto; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; z-index: 35; top: 0; left: 0; bottom: 0; width: min(86vw, 320px); height: auto;
    padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
  }
  .rail.open { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 18, 24, .45); }
  main { padding: 22px 18px 70px; }
  .now { grid-template-columns: minmax(0, 1fr); }
  .now > section + section { border-left: 0; border-top: 1px solid var(--rule); }
  .trow, .trow-head { grid-template-columns: 6px minmax(0, 1fr) 72px; gap: 12px; }
  .trow .t-prog, .trow .t-quiz, .trow .t-hours, .trow-head .t-prog, .trow-head .t-quiz, .trow-head .t-hours { display: none; }
  .phase { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .log-form { grid-template-columns: 1fr 1fr; }
  .log-form .wide { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- écran pseudo : masque la navigation ---------- */
body.gated .shell { grid-template-columns: minmax(0, 1fr); }
body.gated .rail, body.gated .topbar { display: none; }

/* graphique hebdomadaire : ligne d'objectif sur toute la largeur */
.weeks { position: relative; padding-top: 0; }
