/* CAP Education — feuille de style unique, habillage CAP Ecosystem (directive CAP-UI-DESIGN-001).
   Polices de l'écosystème : Space Grotesk (titres), Plus Jakarta Sans (texte), JetBrains Mono (numéros, chrono).
   Identité Education : le surligneur. Jaune fluo #FFE14A pour le module, une teinte de surligneur par thème.
   Les teintes servent uniquement de fond (texte encre dessus), jamais de couleur de texte : lisible en clair comme en sombre.
   Conçu d'abord pour le téléphone ; barre d'onglets en bas, rail latéral à partir de 760px (tablette en portrait). */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans-latin.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: 'Plus Jakarta Sans';
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans-latin-ext.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: 'Space Grotesk';
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/space-grotesk-latin.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: 'Space Grotesk';
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/space-grotesk-latin-ext.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-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin.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;
}

/* ───────────── jetons ───────────── */
:root {
  color-scheme: dark;
  --font: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Space Grotesk', 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --ink: #0b1020;
  --stabilo: #ffe14a;
  --accent: #818cf8; /* indigo de l'écosystème CAP */

  --bg: #080b13;
  --surface: #111827;
  --surface-2: #182036;
  --line: #263049;
  --text: #f1f5f9;
  --muted: #a3afc4;
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(99, 102, 241, 0.34), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(255, 225, 74, 0.16), transparent 60%), linear-gradient(160deg, #141c3a, #0a0f1e);
  --grid-line: rgba(148, 163, 184, 0.05);
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  --ok: #6ee7a8;
  --mid: #ffb04a;
  --low: #ff8a70;
  --focus: #a5b4fc;

  --hue: var(--stabilo);
  --r: 14px;
  --r-lg: 22px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme='light'] {
  color-scheme: light;
  --accent: #4f46e5;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --line: #dde2ec;
  --text: #0f172a;
  --muted: #556074;
  --grid-line: rgba(15, 23, 42, 0.04);
  --shadow: 0 16px 36px -24px rgba(15, 23, 42, 0.35);
  --focus: #4f46e5;
}
[data-teinte='jaune'] { --hue: #ffe14a; }
[data-teinte='orange'] { --hue: #ffb04a; }
[data-teinte='corail'] { --hue: #ff8a70; }
[data-teinte='rose'] { --hue: #ff7eb6; }
[data-teinte='mauve'] { --hue: #c79bff; }
[data-teinte='indigo'] { --hue: #8e9bff; }
[data-teinte='azur'] { --hue: #6cc4ff; }
[data-teinte='turquoise'] { --hue: #4fe0d2; }
[data-teinte='menthe'] { --hue: #6ee7a8; }
[data-teinte='vert'] { --hue: #a8e05f; }
[data-teinte='argent'] { --hue: #d5dbe8; }

/* ───────────── base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 6vw, 2.4rem); font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
mark {
  background: linear-gradient(transparent 10%, var(--hue) 10%, var(--hue) 90%, transparent 90%);
  color: var(--ink);
  padding: 0 0.1em;
  margin: 0 -0.04em;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  font-weight: 600;
}
strong { font-weight: 700; }
.icon { display: inline-flex; flex: none; }
.muted { color: var(--muted); font-size: 0.95rem; }
.lead { color: var(--muted); }
.empty { color: var(--muted); padding: 20px; border: 1px dashed var(--line); border-radius: var(--r); text-align: center; }
.footnote { color: var(--muted); font-size: 0.8rem; text-align: center; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.kicker { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.numero { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; background: var(--hue); color: var(--ink); border-radius: 6px; padding: 2px 6px; flex: none; }

/* ───────────── structure ───────────── */
.shell { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px); }
.main { outline: none; }
.page { max-width: 760px; margin: 0 auto; padding: 22px 18px 8px; display: grid; gap: 22px; }
.page > section { display: grid; gap: 12px; }
.page-head { display: flex; gap: 12px; align-items: flex-start; }
.page-head > div { display: grid; gap: 6px; }
.back { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -4px 0 0 -8px; border-radius: 50%; flex: none; }
.back:hover { background: var(--surface-2); }

.nav {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav .brand { display: none; }
.nav a { display: grid; place-items: center; align-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.nav a.is-on { color: var(--text); }
.nav a.is-on .icon { background: var(--stabilo); color: var(--ink); border-radius: 999px; padding: 3px 16px; }
.nav a .icon { padding: 3px 16px; transition: background 0.2s var(--ease); }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--stabilo); color: var(--ink); font-size: 1.15rem; transform: rotate(-4deg); }

@media (min-width: 760px) {
  .shell { padding: 0 0 40px 208px; }
  .nav { inset: 0 auto 0 0; width: 208px; height: auto; padding: 22px 14px; display: flex; flex-direction: column; gap: 6px; border-top: 0; border-right: 1px solid var(--line); }
  .nav .brand { display: flex; margin: 0 8px 22px; }
  .nav a { grid-auto-flow: column; justify-content: start; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 0.95rem; }
  .nav a .icon, .nav a.is-on .icon { padding: 0; background: none; color: inherit; }
  .nav a.is-on { background: var(--stabilo); color: var(--ink); }
  .page { padding: 36px 28px 8px; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
}

/* ───────────── boutons et champs ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--stabilo); border-color: var(--stabilo); color: var(--ink); }
.btn-ghost, .btn-on-ink { background: transparent; }
.btn-on-ink { border-color: rgba(255, 255, 255, 0.28); color: #f8fafc; }
.btn-danger { color: var(--low); }
.btn-block { width: 100%; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

.form { display: grid; gap: 14px; }
.form h2 { margin-top: 10px; }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: 0.92rem; }
.field-hint { color: var(--muted); font-size: 0.82rem; }
.input { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
textarea.input { resize: vertical; line-height: 1.5; }
.form-error { color: var(--low); font-weight: 600; }
.search { position: relative; }
.search > .icon { position: absolute; left: 14px; top: 15px; color: var(--muted); }
.search .input { padding-left: 42px; border-radius: 999px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented button { min-height: 40px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: 0.9rem; cursor: pointer; padding: 0 8px; }
.segmented button.is-on { background: var(--stabilo); color: var(--ink); }
.segmented button.is-on.score-0 { background: var(--low); }
.segmented button.is-on.score-1 { background: var(--mid); }
.segmented button.is-on.score-2 { background: var(--ok); }

.chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; text-decoration: none; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip-ok { background: var(--ok); color: var(--ink); border-color: transparent; }
.chip-mid { background: var(--mid); color: var(--ink); border-color: transparent; }
.chip-low { background: var(--low); color: var(--ink); border-color: transparent; }
.chip-oral { background: var(--stabilo); color: var(--ink); border-color: transparent; }
.chip-read { color: var(--text); }
.chip-link { text-decoration: underline; text-underline-offset: 3px; }

/* ───────────── cartes ───────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.card-link { grid-template-columns: 1fr auto; align-items: center; text-decoration: none; }
.card-link .kicker { grid-column: 1 / -1; }
.hero { background: var(--hero); color: #f8fafc; border-radius: var(--r-lg); padding: 22px 18px 18px; display: grid; gap: 14px; border: 1px solid rgba(148, 163, 184, 0.18); box-shadow: var(--shadow); }
.hero-when { font-family: var(--font-heading); font-size: clamp(1.5rem, 6.4vw, 2rem); font-weight: 700; line-height: 1.1; }
.hero-date { color: #cbd5e1; }
.hero-date::first-letter { text-transform: uppercase; }
.hero-note { background: rgba(255, 255, 255, 0.08); border-radius: var(--r); padding: 10px 12px; font-size: 0.95rem; }
.hero .chip-none, .hero .chip:not([class*='chip-o']):not(.chip-read) { background: rgba(255, 255, 255, 0.08); color: #cbd5e1; border-color: rgba(255, 255, 255, 0.16); }
.hero .chip-read { background: rgba(255, 255, 255, 0.08); color: #f8fafc; border-color: rgba(255, 255, 255, 0.16); }
.oral-list { display: grid; gap: 8px; }
.oral-notion { display: grid; gap: 8px; padding: 12px; border-radius: var(--r); background: rgba(148, 163, 184, 0.1); }
.oral-notion-main { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.oral-notion-state { display: flex; gap: 6px; flex-wrap: wrap; }
.oral-notion .numero { background: var(--stabilo); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 2px; }
.stat strong { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.04em; }
.stat span { color: var(--muted); font-size: 0.8rem; line-height: 1.3; }

.notion-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.notion-row.is-brief .numero { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.notion-row-text { display: grid; gap: 2px; min-width: 0; }
.notion-row-text span { color: var(--muted); font-size: 0.86rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.theme-grid { display: grid; gap: 12px; }
.theme-card { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow); }
.theme-card .bar { grid-column: 1 / -1; }
.theme-card-text, .theme-line-text { display: grid; gap: 4px; min-width: 0; }
.theme-card-text span { color: var(--muted); font-size: 0.85rem; }
.theme-roman { display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 8px; border-radius: 12px; background: var(--hue); color: var(--ink); font-family: var(--font-heading); font-weight: 700; transform: rotate(-3deg); }
.theme-line { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.theme-line strong { font-size: 0.95rem; }
.theme-line-count { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); }
.bar { position: relative; display: block; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: 999px; }
.bar-read { background: color-mix(in oklab, var(--hue) 38%, var(--surface-2)); }
.bar-done { background: var(--hue); }

/* ───────────── fiche ───────────── */
.fiche { gap: 20px; }
.fiche-head { background: var(--hue); color: var(--ink); border-radius: var(--r-lg); padding: 14px 18px 22px; display: grid; gap: 8px; }
.fiche-head .back { color: var(--ink); margin: 0 0 4px -10px; }
.fiche-head .back:hover { background: rgba(11, 16, 32, 0.12); }
.fiche-head .kicker, .fiche-head .muted { color: rgba(11, 16, 32, 0.72); }
.fiche-head .numero { background: var(--ink); color: #fff; }
.fiche-head h1 { font-size: clamp(2rem, 9vw, 3.2rem); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.accroche { font-family: var(--font-heading); font-size: 1.22rem; line-height: 1.4; font-weight: 500; }
.rail { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; gap: 6px; padding: 10px 0; background: color-mix(in oklab, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.rail-dot { flex: 1; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; cursor: pointer; color: var(--muted); transition: background 0.2s var(--ease); }
.rail-dot.is-past { background: color-mix(in oklab, var(--hue) 34%, var(--surface)); color: var(--text); }
.rail-dot.is-on { background: var(--hue); color: var(--ink); border-color: transparent; }
.fiche-step { display: grid; gap: 12px; scroll-margin-top: 64px; padding-top: 6px; }
.fiche-step > header, .prep-step > header { display: flex; gap: 12px; align-items: center; }
.fiche-step > header p, .prep-step > header p { color: var(--muted); font-size: 0.88rem; }
.step-num { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--hue); color: var(--ink); font-family: var(--font-mono); font-weight: 700; }
.timeline { display: grid; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { display: grid; gap: 2px; padding: 0 0 14px 18px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--hue); border: 2px solid var(--bg); }
.timeline-date { font-family: var(--font-mono); font-weight: 600; font-size: 0.85rem; }
.steps { display: grid; gap: 10px; counter-reset: step; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 12px 46px; position: relative; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 13px; font-family: var(--font-mono); font-weight: 600; font-size: 0.85rem; color: var(--muted); }
.example { background: var(--hero); color: #f8fafc; border-radius: var(--r-lg); padding: 20px 18px; display: grid; gap: 10px; border: 1px solid rgba(148, 163, 184, 0.18); }
.example h3 { font-size: 1.25rem; }
.neighbor { display: grid; gap: 6px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.neighbor-type { justify-self: start; font-size: 0.75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.neighbor-opp { background: var(--low); color: var(--ink); }
.neighbor-near { background: var(--surface-2); border: 1px solid var(--line); }
.neighbor p { font-size: 0.97rem; }
.open-question { font-family: var(--font-heading); font-size: 1.2rem; line-height: 1.4; border-left: 4px solid var(--hue); padding-left: 14px; }
.callout { border-radius: var(--r); padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 6px; }
.callout-trap { border-left: 4px solid var(--low); }
.english { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-style: italic; }
.english span { font-style: normal; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.fiche-extra { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.quiz-q { display: grid; gap: 8px; }
.quiz-question { font-weight: 700; }
.quiz-choices { display: grid; gap: 8px; }
.quiz-choice { text-align: left; min-height: 48px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.quiz-choice.is-right { background: var(--ok); color: var(--ink); border-color: transparent; font-weight: 700; }
.quiz-choice.is-wrong { background: var(--low); color: var(--ink); border-color: transparent; }
.quiz-why { color: var(--muted); font-size: 0.93rem; }
.quiz-result { font-family: var(--font-heading); font-weight: 600; font-size: 1.1rem; }

/* ───────────── oral ───────────── */
.grille { display: grid; gap: 8px; counter-reset: g; }
.grille li { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); counter-increment: g; }
.grille li::before { content: counter(g); grid-row: span 2; align-self: center; font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--stabilo); color: var(--ink); }
.grille li span { color: var(--muted); font-size: 0.88rem; grid-column: 2; }
.grille .grille-time { grid-column: 3; grid-row: 1 / span 2; align-self: center; font-family: var(--font-mono); }
.prep-step { display: grid; gap: 10px; }
.prep-foot { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); display: grid; gap: 6px; }
.saved { font-size: 0.8rem; color: var(--muted); text-align: right; min-height: 1.2em; }
.result-list { display: grid; gap: 16px; }
.result-list li { display: grid; gap: 8px; }
.result-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.result-comment { background: var(--surface-2); border-radius: var(--r); padding: 10px 12px; font-size: 0.95rem; }
.grid-scores { display: flex; flex-wrap: wrap; gap: 4px; }
.score { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--ink); }
.score-0 { background: var(--low); }
.score-1 { background: var(--mid); }
.score-2 { background: var(--ok); }

.timer { position: fixed; inset: 0; z-index: 50; background: var(--hero), var(--ink); color: #f8fafc; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 28px 22px calc(28px + var(--safe-b)); text-align: center; }
.timer .kicker { color: #cbd5e1; }
.timer-close { position: absolute; top: 14px; right: 14px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.1); color: inherit; cursor: pointer; display: grid; place-items: center; }
.timer-clock { font-family: var(--font-mono); font-size: clamp(4.5rem, 26vw, 9rem); font-weight: 600; line-height: 1; letter-spacing: -0.04em; }
.timer-segments { display: flex; gap: 4px; width: min(100%, 520px); }
.timer-segments span { flex: var(--grow) 1 0; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.timer-segments i { display: block; height: 100%; width: var(--fill, 0%); background: var(--stabilo); }
.timer h2 { font-size: 1.7rem; }
.timer-hint { color: #cbd5e1; }
.timer-note { max-width: 520px; max-height: 28dvh; overflow: auto; background: rgba(255, 255, 255, 0.08); border-radius: var(--r); padding: 12px 14px; text-align: left; white-space: pre-wrap; }
.timer-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.timer .btn-ghost { color: #f8fafc; border-color: rgba(255, 255, 255, 0.28); }

/* ───────────── parent ───────────── */
.page-narrow { max-width: 640px; }
.picker { display: grid; gap: 8px; }
.picker-list { display: grid; gap: 6px; }
.picker-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 6px 6px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.picker-list li.empty { display: block; padding: 12px; }
.picker-results { display: grid; gap: 6px; }
.picker-result { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; min-height: 46px; padding: 6px 12px; border-radius: var(--r); border: 1px dashed var(--line); background: transparent; cursor: pointer; }
.eval { gap: 14px; }
.eval-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.eval-head > div { display: grid; gap: 6px; justify-items: start; }
.eval-row { display: grid; gap: 6px; }
.eval-row > div:first-child { display: grid; }
.eval-row span { color: var(--muted); font-size: 0.85rem; }
.eval-foot { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.eval-total { font-family: var(--font-mono); }
.fold { border: 1px solid var(--line); border-radius: var(--r); padding: 0 14px; background: var(--surface-2); }
.fold summary { cursor: pointer; font-weight: 700; padding: 12px 0; min-height: 44px; }
.fold[open] { padding-bottom: 14px; }
.fold > * + * { margin-top: 8px; }
.parent-only { border: 1px dashed var(--line); border-radius: var(--r); padding: 14px; }
@media (min-width: 560px) {
  .eval-row { grid-template-columns: 1fr 250px; align-items: center; }
}

/* ───────────── connexion ───────────── */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 22px; }
.auth-card { width: min(100%, 420px); display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 22px; box-shadow: var(--shadow); }

/* ───────────── notifications ───────────── */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 0.92rem; max-width: calc(100vw - 32px); box-shadow: var(--shadow); animation: toast-in 0.25s var(--ease); }
.toast-error { background: var(--low); color: var(--ink); }
.toast-out { opacity: 0; transition: opacity 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.main > * { animation: page-in 0.28s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
@media (min-width: 760px) {
  .toast { bottom: 28px; left: calc(50% + 104px); }
  .prep-foot { bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Les points de la grille ne reposent pas sur la couleur seule. */
.score-2::before { content: '✓\00a0'; }
.score-1::before { content: '≈\00a0'; }
.score-0::before { content: '✗\00a0'; }

/* ───────────── rappel de l'oral ───────────── */
.nav a { position: relative; }
.nav-badge { position: absolute; top: 6px; left: calc(50% + 10px); font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700; line-height: 1; padding: 3px 5px; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); white-space: nowrap; }
.nav-badge.is-near { background: var(--low); color: var(--ink); border-color: transparent; }
.reminder { display: flex; gap: 10px; align-items: center; max-width: 760px; margin: 12px auto 0; padding: 10px 14px; width: calc(100% - 36px); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: 0.9rem; line-height: 1.35; }
.reminder.is-near { background: var(--stabilo); color: var(--ink); border-color: transparent; }
.main > .reminder { animation: none; }
.hero-label { font-family: var(--font-heading); font-weight: 600; font-size: 1.05rem; margin-top: 4px; }
.result-summary { background: color-mix(in oklab, var(--stabilo) 22%, var(--surface)); border-left: 4px solid var(--stabilo); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 4px; white-space: pre-wrap; }
@media (min-width: 760px) {
  .nav-badge { position: static; margin-left: auto; font-size: 0.72rem; padding: 4px 7px; }
  .reminder { width: calc(100% - 56px); margin-top: 20px; }
}
@media (max-width: 420px) {
  .segmented button { font-size: 0.82rem; white-space: nowrap; padding: 0 4px; }
}
.sources { display: grid; gap: 8px; font-size: 0.92rem; }
.sources a { text-underline-offset: 3px; overflow-wrap: anywhere; }
