/* Palette « signalisation » : bleu des panneaux belges, jaune du marquage, asphalte */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #eeece6;
  --ink: #0e1726;
  --ink-2: #4a5568;
  --ink-3: #8a93a3;
  --line: #e3e0d8;
  --accent: #1c4fd8;
  --accent-strong: #163fae;
  --accent-soft: #e7eeff;
  --accent-ink: #12307a;
  --on-accent: #ffffff;
  --signal: #ffc629;
  --signal-ink: #2a1f00;
  --road: #121a28;
  --road-2: #1b2536;
  --blue: #1c4fd8;
  --blue-soft: #e7eeff;
  --ok: #12804a;
  --ok-soft: #e4f5ec;
  --bad: #c42b2b;
  --bad-soft: #fdeaea;
  --trap-soft: #fff5d6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(14, 23, 38, .05), 0 8px 28px rgba(14, 23, 38, .07);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1019; --surface: #141b27; --surface-2: #1d2635; --ink: #f2f4f7; --ink-2: #b9c1ce; --ink-3: #758195;
    --line: #273142; --accent: #5b8cff; --accent-strong: #7aa2ff; --accent-soft: #172447; --accent-ink: #c4d5ff; --on-accent: #07122e;
    --road: #070b12; --road-2: #101826; --blue: #7aa2ff; --blue-soft: #16223d; --trap-soft: #33290b;
    --ok: #44c98a; --ok-soft: #0f2d1f; --bad: #f2766c; --bad-soft: #391617; --shadow: 0 1px 2px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1019; --surface: #141b27; --surface-2: #1d2635; --ink: #f2f4f7; --ink-2: #b9c1ce; --ink-3: #758195;
  --line: #273142; --accent: #5b8cff; --accent-strong: #7aa2ff; --accent-soft: #172447; --accent-ink: #c4d5ff; --on-accent: #07122e;
  --road: #070b12; --road-2: #101826; --blue: #7aa2ff; --blue-soft: #16223d; --trap-soft: #33290b;
  --ok: #44c98a; --ok-soft: #0f2d1f; --bad: #f2766c; --bad-soft: #391617; --shadow: 0 1px 2px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px; }
img { max-width: 100%; }
a { color: var(--blue); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; margin-top: 1.4em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 11px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--ink); }
@media (max-width: 1180px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; gap: 2px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; border-radius: 10px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: 1rem; border: 0; border-radius: 12px; padding: 12px 20px; cursor: pointer; text-decoration: none; transition: transform .06s, background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 -2px 0 rgba(0,0,0,.12); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-signal { background: var(--signal); color: var(--signal-ink); box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.btn-signal:hover { background: #ffd65c; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-sm { padding: 8px 14px; font-size: .9rem; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); letter-spacing: .01em; }
.pill-accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }

/* Segmented */
.seg { display: inline-flex; background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 4px; flex-wrap: wrap; }
.seg button { font: inherit; font-weight: 700; font-size: .92rem; border: 0; background: transparent; color: var(--ink-2); padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* Landing */
.hero { padding: 64px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 28px; margin-top: 28px; }
@media (max-width: 560px) { .hero-stats { grid-template-columns: repeat(2, auto); } }
.hero-stats b { display: block; font-size: 1.6rem; font-weight: 800; }
.hero-stats span { color: var(--ink-2); font-size: .9rem; }
.hero-demo { position: relative; }
.demo-q { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.demo-q .sign-wrap { width: 96px; height: 96px; margin-bottom: 14px; }
.section { padding: 56px 0; }
.section-head { max-width: 640px; margin-bottom: 28px; }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 14px; }
.feature .ico svg { width: 22px; height: 22px; }
.steps { counter-reset: s; }
.step { position: relative; padding-left: 58px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 12px; background: var(--signal); color: var(--signal-ink); display: grid; place-items: center; font-weight: 800; }
.facts { width: 100%; border-collapse: collapse; }
.facts th, .facts td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { width: 40%; color: var(--ink-2); font-weight: 600; }
details.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
details.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::after { content: "+"; font-weight: 800; color: var(--ink-3); }
details.faq[open] summary::after { content: "−"; }
details.faq p { margin: 10px 0 0; color: var(--ink-2); }
.cta-band { background: var(--road); color: #fff; position: relative; overflow: hidden; border-radius: 24px; padding: 40px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-band p { color: rgba(255,255,255,.72); margin: 0; }
.cta-band::before { content: ""; position: absolute; left: 0; right: 0; bottom: 18px; height: 4px; background: repeating-linear-gradient(90deg, var(--signal) 0 36px, transparent 36px 64px); opacity: .9; }
footer.foot { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--ink-2); font-size: .9rem; margin-top: 40px; }
footer.foot .wrap { display: grid; gap: 16px; }

/* App */
main.app { padding: 28px 0 64px; min-height: 70vh; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 0; color: var(--ink-2); }
.settings { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.settings label { font-size: .8rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 4px; }

.ready { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.ring { width: 132px; height: 132px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 800; font-size: 2rem; line-height: 1; }
.ring .val small { display: block; font-size: .75rem; color: var(--ink-3); font-weight: 600; margin-top: 4px; }
@media (max-width: 520px) { .ready { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.bar.ok > i { background: var(--ok); }

.chap { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.chap:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(28,79,216,.12); }
.chap .num { font-size: .78rem; font-weight: 800; color: var(--accent); letter-spacing: .04em; }
.chap p { margin: 0; color: var(--ink-2); font-size: .93rem; flex: 1; }

.lesson-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .lesson-layout { grid-template-columns: 1fr; } .lesson-side { order: 2; } }
.lesson-side { position: sticky; top: 84px; }
.lesson-side a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .93rem; }
.lesson-side a:hover { background: var(--surface-2); }
.lesson-side a.on { background: var(--accent-soft); color: var(--accent-ink); }
.lesson-side a.btn, .lesson-side a.btn:hover { color: var(--on-accent); background: var(--accent); padding: 8px 14px; }
.lesson-side a.done::after { content: " ✓"; color: var(--ok); }
.prose { font-size: 1.02rem; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .35em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
.prose thead th { background: var(--surface-2); }
.prose tbody th { background: var(--surface-2); font-weight: 700; width: 34%; }
.tip, .trap { border-radius: 12px; padding: 14px 16px; margin: 0 0 1.1em; font-size: .97rem; }
.tip { background: var(--blue-soft); }
.trap { background: var(--trap-soft); color: var(--ink); border-left: 4px solid var(--signal); }
.tip { border-left: 4px solid var(--accent); }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* Quiz */
.quiz { max-width: 760px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.qcard { padding: 28px; }
@media (max-width: 520px) { .qcard { padding: 18px; } }
.qmedia { display: flex; justify-content: center; margin-bottom: 18px; }
.sign-wrap { width: 132px; height: 132px; display: flex; align-items: center; justify-content: center; flex: none; }
.sign-wrap img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.sign-fallback { font-weight: 800; font-size: 1.4rem; color: var(--ink-3); border: 2px dashed var(--line); border-radius: 12px; width: 100%; height: 100%; display: grid; place-items: center; }
.qtext { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; font: inherit; font-size: 1.02rem; background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: border-color .12s, background .12s; }
.opt:hover:not([disabled]) { border-color: var(--ink-3); }
.opt .k { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.sel .k { background: var(--accent); color: var(--on-accent); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .k { background: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; }
.feedback { margin-top: 18px; border-radius: 14px; padding: 16px 18px; }
.feedback.ok { background: var(--ok-soft); }
.feedback.ko { background: var(--bad-soft); }
.feedback b { display: block; margin-bottom: 4px; }
.quiz-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.timer { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.timer > i { display: block; height: 100%; background: var(--accent); width: 100%; }
.timer.low > i { background: var(--bad); }
.kbd { font-size: .8rem; color: var(--ink-3); }

.result-score { font-size: 3.4rem; font-weight: 800; line-height: 1; }
.result-score small { font-size: 1.2rem; color: var(--ink-3); }
.review-item { border-top: 1px solid var(--line); padding: 16px 0; }
.review-item .ans { font-size: .93rem; }

/* Signs page */
.sign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sign-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: border-color .15s; }
.sign-card:hover { border-color: var(--accent); }
.sign-card .sign-wrap { width: 84px; height: 84px; }
.sign-card .code { font-size: .75rem; font-weight: 800; color: var(--ink-3); }
.sign-card .name { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.search { font: inherit; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); width: min(320px, 100%); }
.cat-desc { margin: 16px 0; }

.modal-back { position: fixed; inset: 0; background: rgba(10, 14, 22, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 20px; padding: 26px; max-width: 460px; width: 100%; text-align: center; max-height: 90vh; overflow: auto; }
.modal .sign-wrap { width: 160px; height: 160px; margin: 0 auto 14px; }

.check { display: flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.theme-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.theme-list label { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: var(--surface); font-weight: 600; font-size: .93rem; }
.theme-list label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.theme-list input { accent-color: var(--accent); }
.stat { font-size: 1.8rem; font-weight: 800; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Photos réelles */
figure.photo { margin: 0 0 1.2em; }
figure.photo img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; display: block; background: var(--surface-2); }
figure.photo figcaption { font-size: .88rem; color: var(--ink-2); margin-top: 8px; line-height: 1.45; }
figure.photo .credit { color: var(--ink-3); font-size: .78rem; white-space: nowrap; }
figure.photo .credit a { color: inherit; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 1.2em; }
.photo-grid figure.photo { margin: 0; }
.photo-grid figure.photo img { aspect-ratio: 4 / 3; max-height: none; }
.qphoto { margin: -8px -8px 18px; }
.qphoto figure.photo { margin: 0; }
.qphoto figure.photo img { max-height: 380px; aspect-ratio: 16 / 10; }
.qphoto figcaption { text-align: right; }
.review-thumb { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }

/* Accessibilité clavier */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.opt:focus-visible { outline-offset: 0; border-radius: 14px; }

/* Bouton thème */
.theme-btn { flex: none; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.theme-btn:hover { color: var(--ink); background: var(--surface-2); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }

/* Hero « route » */
.hero.road { background: radial-gradient(1200px 500px at 85% -10%, rgba(91,140,255,.28), transparent 60%), linear-gradient(180deg, var(--road-2), var(--road)); color: #fff; padding: 72px 0 88px; position: relative; overflow: hidden; }
.hero.road::after { content: ""; position: absolute; left: 0; right: 0; bottom: 34px; height: 6px; background: repeating-linear-gradient(90deg, var(--signal) 0 56px, transparent 56px 96px); opacity: .95; }
.hero.road::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.18); }
.hero.road h1 { color: #fff; }
.hero.road h1 em { font-style: normal; color: var(--signal); }
.hero.road .lead { color: rgba(255,255,255,.75); }
.hero.road .hero-stats span { color: rgba(255,255,255,.6); }
.hero.road .hero-stats b { color: var(--signal); }
.hero.road .pill-accent { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18); }
.hero.road .btn-ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.25); }
.hero.road .btn-ghost:hover { background: rgba(255,255,255,.14); }
.hero.road .demo-q { color: var(--ink); box-shadow: 0 30px 60px rgba(0,0,0,.35); border-color: transparent; }
.hero.road .demo-q .muted { color: var(--ink-2); }
.nav a.btn-primary, .nav a.btn-primary:hover { color: var(--on-accent); background: var(--accent); }
.nav a.btn-primary:hover { background: var(--accent-strong); }
.opt.sel:hover:not([disabled]) { border-color: var(--accent); }
.hero.road .hero-stats { gap: 22px 32px; }
.hero.road .hero-stats > div { min-width: 0; }

/* Série, points, défi du jour */
.streak-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 12px 6px 9px; border-radius: 999px; background: var(--trap-soft); color: var(--signal-ink); text-decoration: none; font-weight: 800; font-size: .92rem; border: 1px solid color-mix(in srgb, var(--signal) 55%, transparent); }
.streak-chip svg { width: 18px; height: 18px; color: #f08a00; }
.streak-chip .xp { font-weight: 600; color: var(--ink-2); font-size: .82rem; padding-left: 8px; border-left: 1px solid color-mix(in srgb, var(--signal) 55%, transparent); }
.streak-chip.off { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.streak-chip.off svg { color: var(--ink-3); }
:root[data-theme="dark"] .streak-chip:not(.off) { color: var(--signal); }
@media (max-width: 1180px) { .streak-chip { margin-left: auto; } .top .menu-btn { margin-left: 0; } .streak-chip .xp { display: none; } }
@media (min-width: 1181px) { .streak-chip { margin-left: 8px; } }

.today-card { background: linear-gradient(135deg, var(--surface) 55%, color-mix(in srgb, var(--accent-soft) 70%, var(--surface))); }
.today-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.1fr; gap: 24px; align-items: center; }
@media (max-width: 860px) { .today-grid { grid-template-columns: 1fr; gap: 18px; } }
.today-grid p { margin: 0; }
.t-streak { display: flex; gap: 14px; align-items: center; }
.t-streak .flame { width: 58px; height: 58px; border-radius: 16px; background: linear-gradient(160deg, #ffd54a, #ff8a00); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 8px 20px rgba(255,138,0,.3); }
.t-streak .flame svg { width: 32px; height: 32px; }
.t-streak.off .flame { background: var(--surface-2); color: var(--ink-3); box-shadow: none; }
.t-streak .big { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.t-streak .big span { font-size: 1rem; font-weight: 700; }
.t-meta { margin-top: 4px !important; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.t-meta svg { width: 14px; height: 14px; vertical-align: -2px; }
.t-goal { display: flex; gap: 14px; align-items: center; }
.mini-ring { width: 64px; height: 64px; position: relative; flex: none; }
.mini-ring svg:first-child { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini-ring > svg:last-child { position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; color: var(--accent); }
.today-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.today-actions .btn svg { width: 18px; height: 18px; }
.span-2 { grid-column: 1 / -1; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head p { margin: 0; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

.sign-day { display: flex; gap: 20px; align-items: center; }
.sign-day .sign-wrap { width: 108px; height: 108px; }
@media (max-width: 520px) { .sign-day { flex-direction: column; text-align: center; } }

.chart-box { position: relative; margin-top: 8px; }
.chart { display: block; max-width: 100%; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .pass { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 5; }
.chart .pass-label { fill: var(--ink-2); font-size: 11px; font-weight: 700; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .dot.on { r: 6.5; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 12px; display: grid; gap: 1px; white-space: nowrap; z-index: 2; }
.chart-tip[hidden] { display: none; }
.chart-tip b { font-size: 1.05rem; }
.chart-table { margin-top: 10px; }
.chart-table summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }

.weak { display: grid; gap: 4px; margin-top: 10px; }
.weak-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px; margin: 0 -10px; border-radius: 10px; color: inherit; text-decoration: none; }
.weak-row:hover { background: var(--surface-2); }
.weak-row .bar { grid-column: 1 / -1; }
.weak-name { font-weight: 700; }
.weak-val { font-weight: 800; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.badge { border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px; text-align: center; display: grid; justify-items: center; align-content: start; gap: 4px; color: var(--ink-3); background: var(--surface-2); }
.badge svg { width: 34px; height: 34px; opacity: .5; }
.badge b { font-size: .88rem; color: var(--ink-2); }
.badge span { font-size: .76rem; line-height: 1.35; }
.badge.got { background: var(--trap-soft); border-color: color-mix(in srgb, var(--signal) 60%, transparent); color: var(--ink-2); }
.badge.got svg { opacity: 1; color: #e08600; }
.badge.got b { color: var(--ink); }

.marks { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.marks i { width: 26px; height: 10px; border-radius: 4px; }
.marks i.ok { background: var(--ok); }
.marks i.ko { background: var(--bad); }
.next-defi { display: grid; gap: 2px; background: var(--surface-2); border-radius: 14px; padding: 14px 16px; margin: 0 0 18px; }
.next-defi b { font-size: 1.8rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

#toasts { position: fixed; right: 16px; top: 76px; pointer-events: none; z-index: 80; display: grid; gap: 10px; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--road); color: #fff; border-radius: 14px; padding: 12px 16px 12px 18px; box-shadow: 0 12px 32px rgba(0,0,0,.25); display: grid; gap: 2px; border-left: 5px solid var(--signal); animation: toast-in .3s ease-out; transition: opacity .4s, transform .4s; }
.toast span { font-size: .88rem; color: rgba(255,255,255,.75); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--x), 105vh) rotate(var(--r)); opacity: .9; } }

/* Mode examen réel */
body.immersive .top, body.immersive .foot { display: none; }
body.immersive main.app { padding: 0; min-height: 100vh; }
body.immersive main.app > .wrap { max-width: none; padding: 0; }
.real { min-height: 100vh; display: flex; flex-direction: column; color: var(--ink); background: var(--bg); }
.real-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 24px; background: var(--road); color: #fff; font-weight: 600; }
.real-top span:last-child { justify-self: end; }
.real-time { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--signal); }
.real-time.low { color: #ff6b6b; }
.real .timer { border-radius: 0; margin: 0; height: 8px; }
.real-body { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.real-body .qtext { font-size: 1.45rem; }
.real-body .opt { font-size: 1.15rem; padding: 18px 20px; }
.real-body .qphoto { margin: 0 0 22px; }
.real-body .qphoto img { max-height: 46vh; }
.real-body .qmedia .sign-wrap { width: 170px; height: 170px; }
.real-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.real-intro .real-body { max-width: 680px; }
.real-intro li { margin: .5em 0; font-size: 1.08rem; }
@media (max-width: 620px) { .real-top { grid-template-columns: 1fr auto; } .real-top span:first-child { display: none; } .real-body { padding: 20px 16px; } .real-body .qtext { font-size: 1.2rem; } }
.real-card { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; background: linear-gradient(180deg, var(--road-2), var(--road)); color: #fff; border-color: transparent; }
.real-card h3 { color: #fff; }
.real-card p { color: rgba(255,255,255,.75); margin: 0; max-width: 60ch; }
.real-card .pill { background: var(--signal); color: var(--signal-ink); }
.dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .dash-grid { grid-template-columns: 1fr; } }
.chart .pass-label { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }

/* Perception des risques */
.tpr-wrap { max-width: min(820px, calc((100vh - 190px) * 1.125)); }
@media (max-width: 600px) { .tpr-wrap { max-width: none; } }
.tpr { background: var(--road); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tpr-hud { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; color: rgba(255,255,255,.8); font-size: .92rem; font-weight: 600; }
.tpr-hud b { color: var(--signal); font-size: 1.05rem; }
.tpr-stage { position: relative; }
.tpr-stage canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: manipulation; background: #4a4f57; }
.tpr-over { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.tpr-over:not(:empty) { background: rgba(10, 14, 22, .45); pointer-events: auto; }
.tpr .timer { border-radius: 0; margin: 0; }
.tpr-modal { max-width: 760px; }
.tpr-modal canvas { display: block; width: 100%; height: auto; border-radius: 12px; }
.scene-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.scene-item { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; background: var(--surface); }
.scene-item:hover { border-color: var(--accent); }
.risk-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.risk-list li { display: grid; gap: 2px; padding: 10px 14px; border-radius: 10px; font-size: .93rem; }
.risk-list li span { color: var(--ink-2); }
.risk-list li.ok { background: var(--ok-soft); }
.risk-list li.ok b { color: var(--ok); }
.risk-list li.ko { background: var(--bad-soft); }
.risk-list li.ko b { color: var(--bad); }

/* Planning et rappels */
.plan-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 12px; }
.plan-day { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .82rem; color: var(--ink-2); display: grid; gap: 2px; }
.plan-day b { color: var(--ink); font-size: .86rem; }
.plan-day.today { border-color: var(--accent); background: var(--accent-soft); }
.plan-day.exam { border-color: var(--signal); background: var(--trap-soft); }
.tasks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.tasks li { display: flex; gap: 10px; align-items: center; }
.tasks li::before { content: ""; width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--line); flex: none; }
.tasks li.done { color: var(--ink-3); text-decoration: line-through; }
.tasks li.done::before { background: var(--ok); border-color: var(--ok); }
.countdown { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.countdown small { font-size: 1rem; color: var(--ink-2); font-weight: 700; }
.field { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.next-lesson { display: grid; gap: 4px; justify-items: start; background: var(--accent-soft); border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; }
.next-lesson b { font-size: 1.08rem; margin-bottom: 8px; }
.plan-top { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; align-items: start; }
@media (max-width: 760px) { .plan-top { grid-template-columns: 1fr; } }
.app-card { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; }
@media (max-width: 760px) { .app-card { grid-template-columns: 1fr; } }
.app-card p { margin-bottom: 10px; }

/* Renvoi vers le cours */
.link-btn { display: inline-block; margin-top: 10px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; font-size: .93rem; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.prose .hl, .prose li.hl, .prose tr.hl > * { background: var(--trap-soft); box-shadow: inset 4px 0 0 var(--signal); border-radius: 6px; }
.prose p.hl, .prose li.hl { padding: 6px 10px; margin-left: -10px; }
.lesson-modal { max-width: 780px; text-align: left; max-height: 88vh; }
.lesson-modal .prose { font-size: .98rem; }

/* Compte */
.account-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 12px 6px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .9rem; max-width: 160px; }
.account-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.account-chip:hover { background: var(--surface-2); }
@media (max-width: 1100px) { .account-chip span { display: none; } .account-chip { padding: 8px; } }
.auth-wrap { max-width: 460px; margin: 0 auto; }
.form { display: grid; gap: 14px; margin-top: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .93rem; }
.form label.check { display: flex; font-weight: 500; }
.form .field { width: 100%; }
.form .btn { justify-self: start; }
.form-msg { margin: 0; font-size: .9rem; min-height: 1em; }
.form-msg.ok { color: var(--ok); }
.form-msg.ko { color: var(--bad); }
details.danger { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.danger summary { cursor: pointer; color: var(--bad); font-weight: 700; font-size: .93rem; }
.btn-danger { background: var(--bad); color: #fff; }
.todo { background: var(--trap-soft); padding: 0 4px; border-radius: 4px; }

/* Statistiques des questions */
.qstat { display: grid; gap: 6px; margin-top: 12px; font-size: .88rem; color: var(--ink-2); }
.qstat .bar { height: 6px; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.qstat .bar > i { background: var(--ok); }
.qstat.hard .bar > i { background: var(--bad); }
.qstat b { color: var(--ink); }

/* Mini-jeux */
.game-hud { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; }
.game-hud b { font-size: 1.5rem; color: var(--accent); }
.game-time { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.game .timer > i { transition: none; }
.game-start { text-align: center; }
.game-prop { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: -6px 0 16px; }
.opts-vf { grid-template-columns: 1fr 1fr; }
.opts-vf .opt { justify-content: center; font-weight: 800; font-size: 1.1rem; }
.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .boards { grid-template-columns: 1fr; } }
ol.board { margin: 6px 0 0; padding-left: 1.4em; font-size: .92rem; }
ol.board li { padding: 3px 0; }
ol.board li span { display: inline-block; min-width: 60%; }
@media (max-width: 1180px) { .account-chip { margin-left: auto; } .account-chip + .streak-chip { margin-left: 0; } }
@media (min-width: 1181px) { .account-chip { margin-left: 8px; } }

/* Révision avant l'examen */
.revision-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--signal); }
.revision-card > div { flex: 1 1 320px; }

/* Pages statiques (cours et panneaux) pour les moteurs de recherche */
.seo-main { padding-top: 22px; padding-bottom: 56px; max-width: 900px; }
.crumbs { color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { color: inherit; }
.seo-main h1 { margin: 10px 0 12px; }
.seo-main h2 { margin: 36px 0 14px; }
.seo-sign-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.seo-sign-head > div:last-child { flex: 1 1 300px; }
.seo-sign-img { width: 160px; height: 160px; }
.seo-sign-img img, .seo .sign-wrap img { max-width: 100%; max-height: 100%; }
.seo .sign-card { text-decoration: none; }
.seo-links { padding-left: 20px; display: grid; gap: 6px; }
.seo-qs { display: grid; gap: 12px; }
.seo-q .qtext { font-weight: 700; margin: 10px 0 8px; }
.seo-opts { list-style: upper-alpha; padding-left: 24px; margin: 0 0 10px; display: grid; gap: 4px; }
.seo-q details summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.seo-q details p { margin: 8px 0 0; }
.seo-cta { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 32px 0; border-left: 4px solid var(--signal); }
.seo-cta > div { flex: 1 1 280px; }
.seo-cta h3 { margin: 0 0 4px; }
.seo-cta p { margin: 0; }
.seo-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.seo-toc ol { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.seo-lesson { scroll-margin-top: 80px; }
.seo-chap-card { text-decoration: none; color: inherit; display: block; transition: border-color .15s; }
.seo-chap-card:hover { border-color: var(--accent); }
.seo-chap-card h3 { margin: 6px 0; }
.seo-cat { margin-top: 12px; }
