/* Révision Module 1 · charte du cours approfondi (encre, terre, olive, moutarde) */
@font-face{font-family:"Plex";src:url(../assets/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"Plex";src:url(../assets/fonts/ibm-plex-sans-latin-400-italic.woff2) format("woff2");font-weight:400;font-style:italic;font-display:swap}
@font-face{font-family:"Plex";src:url(../assets/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"Plex";src:url(../assets/fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2");font-weight:700;font-display:swap}
@font-face{font-family:"PlexC";src:url(../assets/fonts/ibm-plex-sans-condensed-latin-600-normal.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"PlexC";src:url(../assets/fonts/ibm-plex-sans-condensed-latin-700-normal.woff2) format("woff2");font-weight:700;font-display:swap}

:root{
  --ink:#13253D;--ink2:#1E3554;--terra:#B23A2B;--olive:#0E6E66;--must:#E0A526;--mustd:#8A6510;--soft:#9FB0C3;
  --bg:#F4F6F9;--surface:#FFFFFF;--sand:#EEF2F6;--line:#D5DDE6;--txt:#2E3B4C;--muted:#5D6B7D;--head:#13253D;
  --ok:#0E6E66;--okbg:#E4F2F0;--ko:#B23A2B;--kobg:#FBEDEB;
  --shadow:0 1px 2px rgba(19,37,61,.06),0 4px 14px rgba(19,37,61,.07);
  --r:12px;--sans:"Plex",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;--cond:"PlexC","Plex","Arial Narrow",sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0E1726;--surface:#16223A;--sand:#1C2A44;--line:#2A3B58;--txt:#D9E1EC;--muted:#9AAAC0;--head:#F1F4F8;
  --ok:#3FB7AC;--okbg:#123A3A;--ko:#E8806F;--kobg:#3A1E1E;--shadow:0 1px 2px rgba(0,0,0,.3),0 4px 14px rgba(0,0,0,.25);color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#0E1726;--surface:#16223A;--sand:#1C2A44;--line:#2A3B58;--txt:#D9E1EC;--muted:#9AAAC0;--head:#F1F4F8;
  --ok:#3FB7AC;--okbg:#123A3A;--ko:#E8806F;--kobg:#3A1E1E;--shadow:0 1px 2px rgba(0,0,0,.3),0 4px 14px rgba(0,0,0,.25);color-scheme:dark}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--txt);font:16px/1.5 var(--sans);min-height:100vh;padding-bottom:calc(70px + env(safe-area-inset-bottom))}
a{color:inherit}
button{font:inherit;color:inherit}
h1,h2,h3{font-family:var(--cond);color:var(--head);line-height:1.2;margin:0}
img{max-width:100%}
:focus-visible{outline:3px solid var(--must);outline-offset:2px}

/* ── barre du haut ───────────────────────────────── */
.top{position:sticky;top:0;z-index:20;background:var(--ink);color:#fff;display:flex;align-items:center;gap:16px;
  padding:calc(8px + env(safe-area-inset-top)) 16px 8px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:#fff;margin-right:auto}
.brand img{width:34px;height:34px}
.brand span{display:flex;flex-direction:column;line-height:1.1}
.brand b{font-family:var(--cond);font-size:19px;letter-spacing:.2px}
.brand small{color:#B9C6D4;font-size:12px}
.tabs{display:none;gap:4px}
.tabs a{color:#C9D4E1;text-decoration:none;padding:8px 12px;border-radius:8px;font-weight:600;font-size:15px}
.tabs a.on{background:rgba(255,255,255,.12);color:#fff}
.tabs a:hover{color:#fff}
.bottom{position:fixed;bottom:0;left:0;right:0;z-index:20;display:flex;background:var(--surface);border-top:1px solid var(--line);
  padding:4px 4px calc(4px + env(safe-area-inset-bottom))}
.bottom a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;text-decoration:none;font-size:11.5px;color:var(--muted);padding:5px 0;border-radius:8px}
.bottom svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.bottom a.on{color:var(--head);font-weight:600}
.bottom a.on svg{stroke:var(--must);stroke-width:2.2}
@media (min-width:820px){.tabs{display:flex}.bottom{display:none}body{padding-bottom:24px}}

main{max-width:980px;margin:0 auto;padding:18px 16px 28px;outline:none}
.view{animation:enter .28s ease-out both}
@keyframes enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* ── éléments communs ────────────────────────────── */
.kicker{font-family:var(--cond);font-weight:700;letter-spacing:1.6px;text-transform:uppercase;font-size:12.5px;color:var(--mustd)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .kicker{color:var(--must)}}
:root[data-theme="dark"] .kicker{color:var(--must)}
.h1{font-size:28px;margin:2px 0 6px}
.lead{color:var(--muted);margin:0 0 18px}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:16px}
.grid{display:grid;gap:12px}
.g2{grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
.g3{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:10px;padding:12px 18px;min-height:46px;
  background:var(--ink);color:#fff;font-weight:600;cursor:pointer;text-decoration:none;font-size:15.5px}
.btn:hover{filter:brightness(1.15)}
.btn.alt{background:var(--surface);color:var(--head);border:1.5px solid var(--line)}
.btn.must{background:var(--must);color:#1B1405}
.btn.ok{background:var(--olive)}
.btn.ko{background:var(--terra)}
.btn.wide{width:100%}
.btn[disabled]{opacity:.45;cursor:default;filter:none}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{min-height:44px;border:1.5px solid var(--line);background:var(--surface);border-radius:999px;padding:7px 13px;font-size:14px;font-weight:600;cursor:pointer;color:var(--txt)}
.chip.on{background:var(--ink);border-color:var(--ink);color:#fff}
.tag{display:inline-block;font-family:var(--cond);font-weight:700;font-size:12px;letter-spacing:.6px;text-transform:uppercase;padding:2px 8px;border-radius:6px;background:var(--sand);color:var(--head)}
.muted{color:var(--muted)}
.small{font-size:13.5px}
.sep{height:1px;background:var(--line);margin:16px 0;border:0}
.bar{height:8px;border-radius:99px;background:var(--sand);overflow:hidden}
.bar i{display:block;height:100%;border-radius:99px;background:var(--olive);width:0;transition:width .9s cubic-bezier(.2,.7,.2,1)}
.back{display:inline-flex;align-items:center;gap:6px;min-height:44px;text-decoration:none;color:var(--muted);font-weight:600;font-size:14.5px;margin-bottom:10px}
.back::before{content:"‹";font-size:22px;line-height:1}

/* ── accueil ─────────────────────────────────────── */
.hero{background:var(--ink);color:#fff;border-radius:16px;padding:20px;display:grid;grid-template-columns:1fr auto;gap:14px;align-items:center;position:relative;overflow:hidden}
.hero h1{color:#fff;font-size:26px}
.hero p{color:#C9D4E1;margin:6px 0 14px}
.hero .ring{width:104px;height:104px}
.hero .ring text{fill:#fff}
.ring circle.trk{stroke:rgba(255,255,255,.14)}
.ring circle.val{transition:stroke-dasharray 1.1s cubic-bezier(.2,.7,.2,1)}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0 4px}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px}
.stat b{display:block;font-family:var(--cond);font-size:24px;color:var(--head);line-height:1.1}
.stat span{font-size:12.5px;color:var(--muted)}
.sec-t{font-family:var(--cond);font-size:19px;margin:22px 0 10px;color:var(--head)}
.mode{display:flex;gap:12px;align-items:center;text-decoration:none;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px;box-shadow:var(--shadow);transition:transform .15s}
.mode:hover{transform:translateY(-2px)}
.mode img{width:46px;height:46px;flex:none}
.mode b{display:block;font-family:var(--cond);font-size:18px;color:var(--head)}
.mode span{font-size:13.5px;color:var(--muted);line-height:1.35;display:block}
.part{display:grid;grid-template-columns:48px 1fr;gap:4px 12px;align-items:center;text-decoration:none;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:12px 14px;box-shadow:var(--shadow)}
.part img{width:48px;height:48px;grid-row:span 2}
.part b{font-family:var(--cond);font-size:17px;color:var(--head);line-height:1.2}
.part b em{font-style:normal;color:var(--muted);font-weight:600;margin-right:6px}
.part .bar{align-self:start;margin-top:4px}
.part small{grid-column:2;font-size:12.5px;color:var(--muted)}

/* ── cours ───────────────────────────────────────── */
.cover{background:var(--ink);color:#fff;border-radius:16px;padding:20px 20px 18px;position:relative;overflow:hidden;margin-bottom:14px}
.cover .n{position:absolute;right:16px;top:-8px;font-family:var(--cond);font-weight:700;font-size:96px;color:var(--ink2);line-height:1}
.cover img{position:absolute;right:20px;bottom:14px;width:70px;height:70px}
.cover h1{color:#fff;font-size:28px;max-width:80%;position:relative}
.cover p{color:#C9D4E1;margin:6px 0 0;max-width:78%;position:relative;font-size:15px}
.cover .k{color:var(--must)}
.toc{display:flex;gap:8px;overflow-x:auto;padding:2px 0 10px;scrollbar-width:thin;position:sticky;top:58px;z-index:5;background:var(--bg)}
.toc a{flex:none;display:inline-flex;align-items:center;min-height:44px;text-decoration:none;font-size:13.5px;font-weight:600;border:1.5px solid var(--line);background:var(--surface);border-radius:999px;padding:6px 12px;color:var(--txt);white-space:nowrap}
.done-bar{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:18px 0 0}

.cours{--txt:#2E3B4C;--muted:#566476;--sand:#EEF2F6;--ink:#13253D;--line:#D5DDE6;--head:#13253D;
  background:#fff;color:#2E3B4C;border:1px solid var(--line);border-radius:var(--r);padding:6px 18px 18px;font-size:16px;line-height:1.6;color-scheme:light;box-shadow:var(--shadow)}
.cours h2{font-size:22px;margin:26px 0 10px;padding-bottom:5px;border-bottom:2.5px solid var(--ink);scroll-margin-top:118px}
.cours h3{font-size:18px;margin:20px 0 8px;color:var(--ink2)}
.cours p{margin:8px 0}
.cours ul,.cours ol{padding-left:22px;margin:6px 0 10px}
.cours li{margin:3px 0}
.cours strong{color:var(--ink)}
.cours .tw{overflow-x:auto;margin:10px 0 14px;-webkit-overflow-scrolling:touch}
.cours table{border-collapse:collapse;width:100%;font-size:14.5px;min-width:520px}
.cours th{background:var(--ink);color:#fff;font-family:var(--cond);font-weight:600;text-align:left;padding:7px 9px}
.cours td{padding:7px 9px;border-bottom:1px solid var(--line);vertical-align:top}
.cours tr:nth-child(even) td{background:#F6F8FA}
.cours div.objectifs{background:var(--sand);border-radius:10px;padding:10px 16px;margin:14px 0}
.cours div.def{border-left:5px solid var(--must);background:#FBF5E6;padding:10px 15px;margin:12px 0;border-radius:0 8px 8px 0}
.cours div.code{border:1.5px solid var(--ink);border-left:6px solid var(--ink);background:#F4F7FA;padding:10px 15px 8px;margin:14px 0;font-size:15px;border-radius:0 8px 8px 0}
.cours div.code::before{content:"Code de la route · texte en vigueur";display:block;font-family:var(--cond);font-weight:700;letter-spacing:1.4px;font-size:12px;text-transform:uppercase;color:var(--ink);margin-bottom:4px}
.cours div.warn{border-left:6px solid var(--terra);background:#FBEFED;padding:10px 15px;margin:14px 0;border-radius:0 8px 8px 0}
.cours div.warn strong{color:var(--terra)}
.cours div.prof{border-left:6px solid var(--olive);background:#EAF4F3;padding:10px 15px;margin:14px 0;border-radius:0 8px 8px 0}
.cours div.prof strong{color:var(--olive)}
.cours div.complement{border:1.5px dashed var(--soft);padding:10px 15px;margin:14px 0;border-radius:8px}
.cours div.retenir{background:var(--ink);color:#fff;border-radius:10px;padding:12px 16px;margin:14px 0}
.cours div.retenir strong{color:var(--must)}
.cours div.retenir td{color:var(--txt)}
.cours div.retenir table{min-width:480px}
.cours div.exo{background:var(--sand);border-radius:10px;padding:10px 16px;margin:12px 0}
.cours div.corrige{border:1.5px solid var(--olive);border-radius:10px;padding:10px 16px;margin:12px 0;font-size:15px}
.cours details.corrige-wrap>summary{cursor:pointer;font-weight:700;color:var(--olive);padding:8px 0;list-style:none}
.cours details.corrige-wrap>summary::before{content:"▸ ";}
.cours details.corrige-wrap[open]>summary::before{content:"▾ ";}
.cours div.sources{color:var(--muted);font-size:13.5px;border-top:1px solid var(--line);margin-top:18px;padding-top:8px}

/* figures du cours approfondi (classes de visuals.py), adaptées à l'écran */
.cours .fig{margin:14px 0 18px}
.cours .fig .ft{font-family:var(--cond);font-weight:700;color:var(--ink);font-size:14px;letter-spacing:.4px;margin-bottom:8px;text-transform:uppercase}
.cours .fig .fn{font-size:12.5px;color:var(--muted);margin-top:6px}
.cours .ico{vertical-align:middle;object-fit:contain}
.cours .ico.flag{width:auto;border:1px solid #D5DDE6}
.cours .tiles,.cours .cards,.cours .rings,.cours .tline{display:grid;gap:10px}
.cours .tile{background:var(--sand);border-top:4px solid var(--ink);border-radius:8px;padding:10px;text-align:center}
.cours .tile .big{font-family:var(--cond);font-weight:700;font-size:26px;line-height:1.1;margin-top:4px}
.cours .tile .lab{font-size:13px;line-height:1.35}
.cours .card{background:#fff;border:1px solid var(--line);border-left:5px solid var(--ink);border-radius:8px;padding:9px 12px}
.cours .card .ch{display:flex;align-items:center;gap:8px;font-family:var(--cond);font-size:16px;color:var(--ink);margin-bottom:4px}
.cours .card .cb{font-size:14px;line-height:1.45}
.cours .hbars{background:var(--sand);border-radius:8px;padding:10px 14px}
.cours .hb{display:grid;grid-template-columns:38% 1fr 64px;align-items:center;gap:8px;margin:6px 0}
.cours .hl{display:flex;align-items:center;gap:6px;font-size:13.5px;line-height:1.25}
.cours .ht{background:#DCE3EB;height:14px;border-radius:3px;overflow:hidden}
.cours .hf{height:14px;border-radius:3px;transform-origin:left;animation:grow .9s cubic-bezier(.2,.7,.2,1) both}
.cours .hv{font-family:var(--cond);font-weight:700;font-size:15px;text-align:right}
.cours .vcols{display:flex;align-items:flex-end;justify-content:space-around;background:var(--sand);border-radius:8px;padding:12px 12px 8px;gap:8px}
.cours .vc{flex:1;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:flex-end}
.cours .vbar{width:62%;border-radius:3px 3px 0 0;transform-origin:bottom;animation:growy .9s cubic-bezier(.2,.7,.2,1) both}
.cours .vv{font-family:var(--cond);font-weight:700;font-size:15px;margin-bottom:2px}
.cours .vl{font-size:12.5px;margin-top:4px;border-top:1.5px solid var(--ink);padding-top:3px;width:100%}
.cours .stk{display:flex;height:30px;border-radius:5px;overflow:hidden}
.cours .stk div{color:#fff;font-family:var(--cond);font-weight:700;font-size:13px;display:flex;align-items:center;justify-content:center;white-space:nowrap;overflow:hidden}
.cours .leg{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:13px;margin-top:6px}
.cours .leg i{display:inline-block;width:11px;height:11px;border-radius:2px;margin-right:5px;vertical-align:-1px}
.cours .rings{background:var(--sand);border-radius:8px;padding:10px}
.cours .rg{display:flex;align-items:center;gap:8px}
.cours .rl{display:flex;align-items:center;gap:6px;font-size:13.5px;line-height:1.3}
.cours .rg text{font-family:var(--cond)!important}
.cours .tline{position:relative;padding-top:2px}
.cours .tline::before{content:"";position:absolute;left:4%;right:4%;top:13px;height:3px;background:var(--soft)}
.cours .tl{position:relative;text-align:center;font-size:12.5px;line-height:1.35}
.cours .td{display:inline-block;color:#fff;font-family:var(--cond);font-weight:700;font-size:13px;border-radius:10px;padding:1px 9px;position:relative}
.cours .ti{margin:5px 0 2px}
.cours .tt{font-family:var(--cond);font-weight:700;color:var(--ink);font-size:14px}
.cours .fig.img{text-align:center}
.cours .fig.img img.schema{display:block;margin:0 auto;border:1px solid var(--line);border-radius:8px;width:100%!important;max-width:820px;height:auto}
.cours .signs{display:flex;gap:18px;align-items:flex-end;justify-content:center;flex-wrap:wrap;background:var(--sand);border-radius:8px;padding:12px}
.cours .sg{text-align:center;font-size:13px}
.cours .sg img{height:96px;display:block;margin:0 auto 6px}
.cours .flow{display:flex;align-items:stretch;gap:4px}
.cours .fs{flex:1;background:var(--sand);border-radius:8px;padding:9px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:13px;line-height:1.35}
.cours .fs b{font-family:var(--cond);color:var(--ink);font-size:15px}
.cours .arrow{align-self:center;color:var(--must);font-size:20px}
.cours .org{display:grid;gap:8px}
.cours .org .row{display:flex;gap:8px;justify-content:center;flex-wrap:nowrap}
.cours .ob{flex:1;border-radius:8px;padding:8px;text-align:center;font-size:13px;line-height:1.35;background:var(--sand);border-top:4px solid var(--ink)}
.cours .ob b{display:block;font-family:var(--cond);font-size:15px;color:var(--ink)}
.cours .ob.top{flex:0 0 60%;background:var(--ink);color:#fff;border-top-color:var(--must)}
.cours .ob.top b{color:#fff}
.cours .org .down{text-align:center;color:var(--must);font-size:16px;line-height:1}
.cours .duo{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start}
.cours .scale{position:relative;height:118px;margin:4px 6px 0}
.cours .scale .bar{position:absolute;left:0;right:0;top:40px;height:18px;border-radius:4px;background:linear-gradient(90deg,#CFE6E3 0 20%,#F6E3B4 20% 50%,#F1C9A4 50% 80%,#E6A79E 80%)}
.cours .scale .mk{position:absolute;top:0;transform:translateX(-50%);text-align:center;font-size:12px;line-height:1.25;width:30%}
.cours .scale .mk b{display:block;font-family:var(--cond);font-size:16px}
.cours .scale .mk i{display:block;width:3px;height:22px;margin:2px auto 0;background:var(--ink)}
.cours .scale .who{position:absolute;top:66px;transform:translateX(-50%);font-size:11.5px;line-height:1.25;text-align:center;width:30%}
@keyframes grow{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes growy{from{transform:scaleY(0)}to{transform:scaleY(1)}}

@media (max-width:700px){
  .cours{padding:4px 14px 14px;border-radius:10px}
  .cours .tiles,.cours .cards{grid-template-columns:repeat(2,1fr)!important}
  .cours .rings{grid-template-columns:1fr 1fr!important}
  .cours .rg svg{width:60px;height:60px;flex:none}
  .cours .tline{grid-template-columns:1fr!important;gap:6px;text-align:left}
  .cours .tline::before{left:15px;right:auto;top:6px;bottom:6px;width:3px;height:auto}
  .cours .tl{display:grid;grid-template-columns:auto 34px 1fr;gap:2px 8px;align-items:center;text-align:left}
  .cours .tl .td{grid-row:span 2;min-width:62px;text-align:center}
  .cours .tl .ti{grid-row:span 2;margin:0}
  .cours .tl .tt,.cours .tl .tx{grid-column:3}
  .cours .flow{flex-direction:column}
  .cours .arrow{transform:rotate(90deg)}
  .cours .org .row{flex-wrap:wrap}
  .cours .org .row .ob{flex:1 1 45%}
  .cours .duo{grid-template-columns:1fr}
  .cours .hb{grid-template-columns:42% 1fr 56px}
  .cover h1{font-size:24px}
  .cover .n{font-size:76px}
  .cover img{width:54px;height:54px}
}
@media (max-width:420px){
  .cours .tiles,.cours .cards{grid-template-columns:1fr!important}
  .cours .tiles{grid-template-columns:1fr 1fr!important}
  .cours .tile .big{font-size:22px}
  .cours .scale .who{font-size:10.5px}
}

/* ── cartes mémoire ──────────────────────────────── */
.deck-top{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}
.flash{perspective:1400px;height:min(56vh,380px);margin:8px 0 14px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.flash .in{position:relative;width:100%;height:100%;transition:transform .5s cubic-bezier(.3,.7,.2,1);transform-style:preserve-3d}
.flash.flip .in{transform:rotateY(180deg)}
.flash .face{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:18px;padding:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;box-shadow:var(--shadow);overflow:auto}
.flash .fr{background:var(--surface);border:1px solid var(--line)}
.flash .fr b{font-family:var(--cond);font-size:clamp(22px,5.4vw,30px);color:var(--head);line-height:1.2}
.flash .bk{background:var(--ink);color:#fff;transform:rotateY(180deg);font-size:clamp(16px,4.2vw,19px);line-height:1.5}
.flash .bk b{color:var(--must)}
.flash .face .tag{position:absolute;top:14px;left:14px}
.flash .hint{position:absolute;bottom:14px;font-size:13px;color:var(--muted)}
.flash .bk .hint{color:#B9C6D4}
.box-dots{display:flex;gap:4px;position:absolute;top:16px;right:16px}
.box-dots i{width:8px;height:8px;border-radius:50%;background:var(--line)}
.box-dots i.on{background:var(--olive)}
.flash .bk .box-dots i{background:rgba(255,255,255,.2)}.flash .bk .box-dots i.on{background:var(--must)}
.answer-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* ── quiz ────────────────────────────────────────── */
.qhead{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px;font-size:14px;color:var(--muted)}
.qtimer{font-family:var(--cond);font-weight:700;font-size:17px;color:var(--head)}
.qtimer.low{color:var(--ko)}
.question{font-family:var(--cond);font-size:clamp(20px,4.6vw,25px);color:var(--head);margin:12px 0 14px;line-height:1.25}
.qimg{display:block;height:110px;margin:6px auto 4px}
.choices{display:grid;gap:10px}
.choice{display:flex;gap:12px;align-items:flex-start;text-align:left;width:100%;background:var(--surface);border:1.5px solid var(--line);border-radius:12px;padding:13px 14px;cursor:pointer;font-size:16px;line-height:1.4;transition:border-color .15s,background .15s}
.choice:hover:not([disabled]){border-color:var(--soft)}
.choice .l{flex:none;width:28px;height:28px;border-radius:8px;background:var(--sand);display:flex;align-items:center;justify-content:center;font-family:var(--cond);font-weight:700;color:var(--head)}
.choice.sel{border-color:var(--ink);background:var(--sand)}
.choice.good{border-color:var(--ok);background:var(--okbg)}
.choice.good .l{background:var(--ok);color:#fff}
.choice.bad{border-color:var(--ko);background:var(--kobg)}
.choice.bad .l{background:var(--ko);color:#fff}
.choice[disabled]{cursor:default}
.expl{margin-top:14px;border-radius:12px;padding:12px 14px;background:var(--sand);border-left:5px solid var(--ok);font-size:15px;animation:enter .25s ease-out both}
.expl.ko{border-left-color:var(--ko)}
.expl b{font-family:var(--cond);font-size:16px}
.qfoot{position:sticky;bottom:calc(68px + env(safe-area-inset-bottom));padding:12px 0 4px;background:linear-gradient(transparent,var(--bg) 30%)}
@media (min-width:820px){.qfoot{bottom:0}}
.score{text-align:center;padding:18px 10px}
.score .big{font-family:var(--cond);font-weight:700;font-size:56px;color:var(--head);line-height:1}
.review{display:grid;gap:10px;margin-top:14px}
.review .it{background:var(--surface);border:1px solid var(--line);border-left:5px solid var(--ok);border-radius:10px;padding:10px 14px;font-size:14.5px}
.review .it.ko{border-left-color:var(--ko)}
.review .it b{display:block;color:var(--head);margin-bottom:3px}
.setup label.opt{display:flex;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);cursor:pointer}
.setup label.opt:last-child{border-bottom:0}
.setup input[type=checkbox]{width:20px;height:20px;accent-color:var(--ink)}

/* ── calculs ─────────────────────────────────────── */
.calc-q{font-size:17px;line-height:1.55}
.calc-q b{color:var(--head)}
.numin{display:flex;gap:10px;margin:14px 0 4px}
.numin input{flex:1;min-width:0;font:inherit;font-size:20px;padding:10px 14px;border-radius:10px;border:1.5px solid var(--line);background:var(--surface);color:var(--txt)}
.steps{margin:10px 0 0;padding-left:20px}
.steps li{margin:4px 0}
.formula{font-family:var(--cond);font-weight:600;background:var(--sand);border-radius:8px;padding:8px 12px;margin:8px 0;color:var(--head)}

/* ── articles du Code ────────────────────────────── */
.search{width:100%;font:inherit;padding:12px 14px 12px 42px;border-radius:12px;border:1.5px solid var(--line);background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239FB0C3' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") 13px 50%/20px no-repeat;color:var(--txt)}
.arts{display:grid;gap:10px;margin-top:12px}
.art{background:var(--surface);border:1px solid var(--line);border-left:6px solid var(--ink);border-radius:10px;overflow:hidden}
.art summary{cursor:pointer;padding:12px 14px;display:flex;justify-content:space-between;align-items:center;gap:10px;list-style:none}
.art summary::-webkit-details-marker{display:none}
.art summary b{font-family:var(--cond);font-size:18px;color:var(--head)}
.art .body{padding:0 14px 12px;font-size:15px;line-height:1.55}
.art .body p{margin:6px 0}
.art .body ul{padding-left:20px}
.art mark{background:#F6E3B4;color:inherit;border-radius:3px}
.art.new{border-left-color:var(--terra)}

/* ── progrès, fenêtre ────────────────────────────── */
.ptable{width:100%;border-collapse:collapse;font-size:14.5px}
.ptable td,.ptable th{padding:9px 6px;border-bottom:1px solid var(--line);text-align:left}
.ptable th{font-family:var(--cond);color:var(--head)}
.modal{position:fixed;inset:0;z-index:50;background:rgba(10,18,30,.55);display:flex;align-items:center;justify-content:center;padding:16px}
.modal[hidden]{display:none}
.modal .box{background:var(--surface);border-radius:16px;padding:20px;max-width:420px;width:100%;box-shadow:0 20px 50px rgba(0,0,0,.3);animation:enter .2s ease-out both}
.modal h3{font-size:20px;margin-bottom:6px}
.toast{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom));transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 16px;border-radius:10px;font-size:14.5px;z-index:60;box-shadow:var(--shadow);animation:toastin .2s ease-out both;max-width:calc(100% - 32px)}
@keyframes toastin{from{opacity:0;transform:translate(-50%,6px)}to{opacity:1;transform:translate(-50%,0)}}
.empty{text-align:center;padding:26px 10px}
.empty img{width:72px;height:72px}
.foot{margin-top:28px;font-size:12.5px;color:var(--muted);text-align:center;line-height:1.5}

/* contrastes en mode sombre (l’encre du thème clair se confond avec le fond) */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--btn:#2C4A73;--chipon:var(--must);--chipontxt:#1B1405}}
:root[data-theme="dark"]{--btn:#2C4A73;--chipon:var(--must);--chipontxt:#1B1405}
.btn{background:var(--btn,var(--ink))}
.btn.alt{background:var(--surface)}
.btn.must{background:var(--must)}
.btn.ok{background:var(--olive)}
.btn.ko{background:var(--terra)}
.chip.on{background:var(--chipon,var(--ink));border-color:var(--chipon,var(--ink));color:var(--chipontxt,#fff)}
.choice.good .l,.choice.bad .l{color:var(--chipontxt,#fff)}
.hero .btn.alt.on-dark{background:transparent;color:#fff;border-color:rgba(255,255,255,.45)}
.hero .btn.alt.on-dark:hover{background:rgba(255,255,255,.1)}
.cours .sg img{width:auto}
.panel.note{background:var(--sand);box-shadow:none}
.tw{overflow-x:auto;-webkit-overflow-scrolling:touch}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.upd{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(84px + env(safe-area-inset-bottom));z-index:70;display:flex;gap:12px;align-items:center;
  background:var(--ink);color:#fff;border:1px solid rgba(255,255,255,.18);padding:10px 12px 10px 16px;border-radius:12px;box-shadow:var(--shadow);font-size:14.5px;max-width:calc(100% - 24px)}
.upd .btn{min-height:38px;padding:6px 12px;font-size:14px}
@media (max-width:560px){.upd{left:12px;right:12px;transform:none;max-width:none;flex-wrap:wrap}.upd span{flex:1 1 100%}}
@media (min-width:820px){.upd{bottom:24px}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* retouches après essais */
.cover .n{right:100px;opacity:.9}
.cover .kicker,.cover h1,.cover p{position:relative;z-index:1;max-width:calc(100% - 90px)}
@media (max-width:700px){
  .cover .n{right:12px;top:auto;bottom:-14px;opacity:.6}
  .cover img{top:16px;bottom:auto;right:16px;width:46px;height:46px}
  .cover .kicker{max-width:calc(100% - 60px)}
  .hero{grid-template-columns:1fr;padding:18px}
  .hero .ring{position:absolute;top:14px;right:14px;width:70px;height:70px}
  .hero .kicker,.hero h1{max-width:calc(100% - 80px)}
  .cours .rg{flex-direction:column;align-items:flex-start;gap:4px}
  .cours .rg svg{width:58px;height:58px}
  .cours .rl{font-size:12.5px}
  .cours .rl img{width:20px!important;height:20px!important}
}
.panel .ring circle.trk{stroke:var(--sand)}.panel .ring text{fill:var(--head)}
