/* Palette : noir (texte, boutons), violet (couleur principale), jaune (repères, surlignage), blanc (fond). */
:root {
  --paper: #f6f5f9;
  --paper-2: #eeecf3;
  --card: #ffffff;
  --ink: #15131a;
  --ink-2: #47434f;
  --ink-3: #76717f;
  --line: #e4e1eb;
  --line-2: #cfcad9;
  --accent: #6a35d0;
  --accent-soft: #eee6fc;
  --violet: #4a3a86;
  --violet-soft: #ebe8f4;
  --yellow: #866200;
  --yellow-soft: #fff3c2;
  --mark: #f6c915;
  --green: #1e7a4c;
  --green-soft: #dff3e7;
  --bad: #c2382d;
  --bad-soft: #fbe4e1;
  --grid: rgba(21, 19, 26, .04);
  --r-lg: 14px;
  --r: 10px;
  --r-sm: 7px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --shadow: 0 1px 1px rgba(40, 20, 80, .05), 0 4px 14px -6px rgba(40, 20, 80, .13);
  --shadow-up: 0 2px 2px rgba(40, 20, 80, .05), 0 12px 28px -12px rgba(40, 20, 80, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --z-sticky: 10; --z-bar: 20; --z-scrim: 30; --z-drawer: 40; --z-skip: 50;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e0d12; --paper-2: #15131b; --card: #1b1922; --ink: #f3f1f7; --ink-2: #c4c0cd; --ink-3: #8f8a9a;
    --line: #2a2733; --line-2: #3e3a4a; --accent: #a986ff; --accent-soft: #2a1f47; --violet: #bcb1e6; --violet-soft: #221f31;
    --yellow: #f7cf3d; --yellow-soft: #352c0c; --mark: #f7cf3d; --green: #5fcf94; --green-soft: #13301f; --bad: #ff7d71; --bad-soft: #3b1916;
    --grid: rgba(243, 241, 247, .03);
    --shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 6px 18px -8px rgba(0, 0, 0, .6);
    --shadow-up: 0 2px 2px rgba(0, 0, 0, .3), 0 14px 30px -12px rgba(0, 0, 0, .8); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e0d12; --paper-2: #15131b; --card: #1b1922; --ink: #f3f1f7; --ink-2: #c4c0cd; --ink-3: #8f8a9a;
  --line: #2a2733; --line-2: #3e3a4a; --accent: #a986ff; --accent-soft: #2a1f47; --violet: #bcb1e6; --violet-soft: #221f31;
  --yellow: #f7cf3d; --yellow-soft: #352c0c; --mark: #f7cf3d; --green: #5fcf94; --green-soft: #13301f; --bad: #ff7d71; --bad-soft: #3b1916;
  --grid: rgba(243, 241, 247, .03);
  --shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 6px 18px -8px rgba(0, 0, 0, .6);
  --shadow-up: 0 2px 2px rgba(0, 0, 0, .3), 0 14px 30px -12px rgba(0, 0, 0, .8); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background-color: var(--paper); color: var(--ink);
  font: 16px/1.6 var(--sans);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--mark); color: #15131a; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: var(--z-skip); border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------- Structure ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  border-right: 1px solid var(--line); background: var(--paper-2);
  padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 20px;
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); padding: 4px 8px; }
.brand:hover { color: var(--ink); }
.brand strong { display: block; font-family: var(--serif); font-size: 1.25rem; line-height: 1.1; letter-spacing: -.01em; }
.brand small { font-family: var(--mono); font-size: .68rem; color: var(--ink-3); letter-spacing: .04em; }
.brand-mark {
  width: 12px; height: 38px; border-radius: 3px; flex: none;
  background: repeating-linear-gradient(180deg, var(--mark) 0 9.5px, #15131a 9.5px 19px);
  border: 1.5px solid var(--ink);
}
#nav-side { display: grid; gap: 1px; }
#nav-side a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .94rem;
  transition: background-color .15s ease, color .15s ease;
}
#nav-side a:hover { background: var(--card); color: var(--ink); }
#nav-side a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
#nav-side a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mark); }
#nav-side a[aria-current="page"] .ico { color: var(--accent); }
#nav-side .count { margin-left: auto; font-family: var(--mono); font-size: .7rem; color: var(--ink-3); font-weight: 400; }
#nav-side .sep { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); padding: 16px 10px 5px; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 0 4px; }
.side-foot p { margin: 0; font-family: var(--mono); font-size: .7rem; line-height: 1.5; color: var(--ink-3); padding: 0 6px; }
.ico { width: 18px; height: 18px; flex: none; }

.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); }
.theme-seg button { border: 0; background: none; border-radius: var(--r-sm); padding: 6px 4px; font-size: .78rem; font-weight: 500; color: var(--ink-3); transition: background-color .15s ease, color .15s ease; }
.theme-seg button:hover { color: var(--ink); }
.theme-seg button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

main:focus, main:focus-visible { outline: none; }
main { padding: 36px clamp(16px, 4.5vw, 56px) 112px; max-width: 1000px; width: 100%; }
.page-in > * { animation: rise .38s var(--ease) both; }
.page-in > *:nth-child(2) { animation-delay: .03s; }
.page-in > *:nth-child(3) { animation-delay: .06s; }
.page-in > *:nth-child(4) { animation-delay: .09s; }
.page-in > *:nth-child(n+5) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.topbar, .tabbar, .scrim { display: none; }

/* ---------- Typographie ---------- */
h1, h2, h3 { font-family: var(--serif); line-height: 1.18; margin: 0 0 .5em; text-wrap: balance; font-weight: 650; }
h1 { font-size: clamp(1.75rem, 4.2vw, 2.45rem); letter-spacing: -.018em; font-weight: 700; }
h2 { font-size: 1.4rem; margin-top: 1.8em; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; margin-top: 1.2em; }
p, li { text-wrap: pretty; }
.eyebrow { font-family: var(--mono); font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; font-weight: 600; }
.lead { color: var(--ink-2); font-size: 1.07rem; max-width: 64ch; margin-top: 0; }
.muted { color: var(--ink-3); }
.small { font-size: .88rem; }
.mono { font-family: var(--mono); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--ink-3); text-decoration: none; margin: 0 0 14px; font-weight: 500; }
.back:hover { color: var(--ink); }

/* ---------- Surfaces ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card.accent { border-color: transparent; box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-up); }
.card.flat { box-shadow: none; background: transparent; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mt { margin-top: 16px; }

a.tile { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s ease; }
a.tile::after { content: "→"; position: absolute; right: 18px; bottom: 14px; color: var(--accent); font-weight: 600; opacity: 0; transform: translateX(-4px); transition: opacity .2s ease, transform .2s var(--ease); }
.tile h3 { margin: 8px 0 6px; font-size: 1.08rem; padding-right: 18px; }
.tile p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.tile .row:first-child { min-height: 24px; }
@media (hover: hover) {
  a.tile:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-up); color: var(--ink); }
  a.tile:hover::after { opacity: 1; transform: none; }
}
a.tile:active { transform: scale(.99); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 6px;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .02em; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink-2); white-space: nowrap; line-height: 1.6; text-decoration: none;
}
.chip.red { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip.green { background: var(--green-soft); border-color: transparent; color: var(--green); }
.chip.amber { background: var(--yellow-soft); border-color: transparent; color: var(--yellow); }
.chip.blue { background: var(--violet-soft); border-color: transparent; color: var(--violet); }
a.chip, button.chip { cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.filters .chip { font-size: .76rem; padding: 6px 12px; border-radius: 99px; font-family: var(--sans); font-weight: 500; }
a.chip:hover, button.chip:hover { border-color: var(--ink-3); color: var(--ink); }
button.chip[aria-pressed="true"], a.chip[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 18px; border-radius: var(--r); border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; font-size: .94rem;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { color: var(--paper); background: var(--ink-2); border-color: var(--ink-2); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink-3); background: var(--card); color: var(--ink); }
.btn.ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ko { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok:hover, .btn.ko:hover { filter: brightness(1.06); color: #fff; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; transform: none; filter: none; }

input[type="search"], input[type="text"], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--card); font-size: 16px; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }

/* ---------- Accueil ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; margin-bottom: 26px; }
.hero h1 { font-size: clamp(2rem, 5vw, 2.9rem); max-width: 16ch; }
.countdown { text-align: right; padding: 14px 18px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); background: var(--card); }
.countdown .n { font-family: var(--serif); font-size: clamp(3rem, 9vw, 4.4rem); line-height: .95; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.countdown .l { font-family: var(--mono); font-size: .7rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.card .countdown { text-align: center; border: 0; background: none; padding: 6px 0; display: block; }
.stat .v { font-family: var(--serif); font-size: 1.85rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .k { font-size: .86rem; color: var(--ink-2); }
.bar { height: 6px; background: var(--paper-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .5s var(--ease); }
.today-steps { display: flex; gap: 4px; margin: 14px 0 4px; }
.today-steps span { flex: 1; height: 5px; border-radius: 99px; background: var(--paper-2); }
.today-steps span.on { background: var(--green); }

/* ---------- Tâches et cases ---------- */
.task { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px dashed var(--line); }
.task:first-of-type { border-top: 0; }
.task input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--green); }
.task.done .t { text-decoration: line-through; color: var(--ink-3); }
label.task { cursor: pointer; }

/* ---------- Fiche ---------- */
.qgilo { display: grid; gap: 12px; }
.qg { position: relative; padding-left: 58px; }
.qg .k { position: absolute; left: 18px; top: 19px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: .76rem; font-weight: 600; background: var(--c); color: var(--card); }
.qg h3 { margin: 0 0 8px; font-size: 1.06rem; }
.qg ul { margin: 0; padding-left: 18px; }
.qg li + li { margin-top: 5px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 26px 0 18px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: var(--z-sticky); background: var(--paper); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; padding: 12px 14px; border-bottom: 2px solid transparent; color: var(--ink-3); font-weight: 500; white-space: nowrap; margin-bottom: -1px; transition: color .15s ease, border-color .15s ease; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .n { font-family: var(--mono); font-size: .7rem; color: var(--ink-3); margin-left: 4px; }
.art { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px dashed var(--line); }
.art:first-child { border-top: 0; padding-top: 0; }
.art:last-child { padding-bottom: 0; }
.art .n { font-family: var(--mono); font-size: .8rem; color: var(--accent); font-weight: 600; }
.num { display: grid; grid-template-columns: minmax(90px, 170px) minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px dashed var(--line); }
.num:first-child { border-top: 0; padding-top: 0; }
.num .v { font-family: var(--mono); font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.piege { background: var(--yellow-soft); border-radius: var(--r); padding: 11px 15px; color: var(--ink); border-left: 3px solid var(--yellow); }
.piege + .piege { margin-top: 8px; }
.callout { border-left: 3px solid var(--accent); }
.callout.blue { border-left-color: var(--violet); }
.prose p, .prose li, .prose h3 { max-width: 76ch; }
.prose p { margin: 0 0 .85em; }
.prose ul, .prose ol { margin: 0 0 .85em; padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose li::marker { color: var(--ink-3); }
.prose h3 { font-size: 1.08rem; margin: 1.2em 0 .45em; }
.prose > :last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; }

/* ---------- Questions ---------- */
.q .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.q h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; margin: 0 0 12px; line-height: 1.5; }
.reveal { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; animation: rise .3s var(--ease) both; }
.reveal h4 { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin: 16px 0 6px; }
.reveal h4:first-child { margin-top: 0; }
.answer { background: var(--green-soft); border-radius: var(--r); padding: 11px 15px; border-left: 3px solid var(--green); }
.ex { counter-reset: ex; list-style: none; padding: 0; margin: 0; }
.ex li { counter-increment: ex; position: relative; padding-left: 36px; margin-bottom: 10px; }
.ex li::before { content: counter(ex); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper-2); color: var(--ink-2); font-family: var(--mono); font-size: .74rem; font-weight: 600; display: grid; place-items: center; }
.choices { display: grid; gap: 8px; margin: 8px 0; }
.choice { text-align: left; padding: 13px 15px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--card); display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; transition: border-color .15s ease, background-color .15s ease, transform .12s ease; }
.choice:hover:not(:disabled) { border-color: var(--ink-3); }
.choice:active:not(:disabled) { transform: scale(.99); }
.choice .l { font-family: var(--mono); font-weight: 600; color: var(--ink-3); }
.choice.good { background: var(--green-soft); border-color: var(--green); }
.choice.bad { background: var(--bad-soft); border-color: var(--bad); }
.choice:disabled { cursor: default; }

/* ---------- Jeux ---------- */
.flash { perspective: 1200px; min-height: 280px; }
.flash-inner { position: relative; min-height: 280px; transition: transform .5s var(--ease); transform-style: preserve-3d; cursor: pointer; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; padding: 28px; text-align: center; }
.flash-face.back { transform: rotateY(180deg); background: var(--green-soft); border-color: transparent; }
.flash-face .big { font-family: var(--serif); font-size: clamp(1.15rem, 3vw, 1.5rem); line-height: 1.38; text-wrap: balance; }
.boxes { display: flex; gap: 4px; }
.boxes span { width: 22px; height: 6px; border-radius: 3px; background: var(--paper-2); }
.boxes span.on { background: var(--green); }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match .col { display: grid; gap: 8px; align-content: start; }
.mitem { text-align: left; padding: 11px 13px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--card); font-size: .92rem; min-height: 46px; transition: border-color .15s ease, background-color .2s ease, transform .12s ease; }
.mitem:hover { border-color: var(--ink-3); }
.mitem:active { transform: scale(.98); }
.mitem.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.mitem.done { background: var(--green-soft); border-color: transparent; color: var(--green); }
.mitem.err { animation: shake .3s; background: var(--bad-soft); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.chrono .mitem { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; }
.chrono .rk { font-family: var(--mono); font-weight: 600; color: var(--accent); }
.score { font-family: var(--mono); font-size: .84rem; color: var(--ink-2); }
.game-tile .ico { width: 26px; height: 26px; color: var(--accent); }

/* ---------- Sujets ---------- */
.timer { font-family: var(--mono); font-size: 1.5rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.timer.low { color: var(--accent); }
.enonce { background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 15px 17px; }
.sticky-top { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--paper); padding: 10px 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; }

/* ---------- Programme et leçons ---------- */
.module { margin-top: 34px; }
.module h2 { margin: 0; }
.module-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 6px; }
.module-num { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; font-size: .86rem; background: var(--ink); color: var(--paper); }
.module-num.done { background: var(--green); color: #fff; }
.lesson .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.lesson .dot.green { background: var(--green); } .lesson .dot.red { background: var(--accent); } .lesson .dot.amber { background: var(--yellow); } .lesson .dot.blue { background: var(--violet); }
.lesson .when { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); }
.comp { margin: 4px 0 0; padding-left: 0; list-style: none; }
.comp li { position: relative; padding-left: 24px; margin: 6px 0; font-size: .94rem; }
.comp li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 11px; height: 11px; border: 2px solid var(--accent); border-radius: 3px; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); margin: 20px 0; position: sticky; top: 0; z-index: var(--z-sticky); background: var(--paper); padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.steps::before { content: ""; position: absolute; top: 26px; left: 10%; right: 10%; height: 2px; background: var(--line); z-index: -1; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; text-decoration: none; color: var(--ink-3); font-size: .78rem; font-weight: 500; text-align: center; padding: 0 2px 2px; }
.step .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; border: 2px solid var(--line-2); background: var(--card); color: var(--ink-2); transition: transform .15s var(--ease), background-color .2s ease, border-color .2s ease; }
.step:hover { color: var(--ink); }
.step:hover .n { transform: scale(1.06); }
.step.done .n { background: var(--green); border-color: var(--green); color: #fff; }
.step.on { color: var(--ink); font-weight: 600; }
.step.on .n { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--mark); }
.memo { background: var(--violet-soft); border-color: transparent; box-shadow: none; }
.lesson-body { font-size: 1.03rem; line-height: 1.72; }
.lesson-body h3 { font-size: 1.18rem; margin-top: 1.5em; padding-top: .7em; border-top: 1px dashed var(--line); }
.lesson-body h3:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.nav-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.hl { background: var(--mark); color: #15131a; border-radius: 2px; padding: 0 2px; }
.res { padding: 14px 0; border-top: 1px dashed var(--line); }
.res:first-of-type { border-top: 0; }
.res a { font-weight: 600; text-decoration: none; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- Mobile ---------- */
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; background: none; border: 0; }
.icon-btn:hover { color: var(--ink); background: var(--paper-2); }
.icon-btn .ico { width: 22px; height: 22px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: 0; z-index: var(--z-bar); padding: calc(6px + env(safe-area-inset-top)) 10px 6px 8px;
    background: color-mix(in srgb, var(--paper) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand strong { font-size: 1.08rem; }
  .topbar .brand-mark { height: 30px; width: 10px; background: repeating-linear-gradient(180deg, var(--mark) 0 7px, #15131a 7px 14px); }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); height: 100dvh; z-index: var(--z-drawer);
    transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: var(--shadow-up);
    padding-bottom: calc(18px + env(safe-area-inset-bottom)); visibility: hidden;
  }
  body.menu-open .sidebar { transform: none; visibility: visible; }
  .scrim { display: block; position: fixed; inset: 0; z-index: var(--z-scrim); background: rgba(15, 20, 19, .42); animation: fade .2s ease both; }
  .scrim[hidden] { display: none; }
  body.menu-open { overflow: hidden; }
  #nav-side a { padding: 11px 10px; font-size: 1rem; }
  main { padding: 20px 16px calc(100px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bar);
    background: color-mix(in srgb, var(--card) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px; text-decoration: none; color: var(--ink-3); font-size: .68rem; font-weight: 500; border-radius: var(--r); background: none; border: 0; }
  .tabbar .ico { width: 22px; height: 22px; padding: 0; transition: transform .15s var(--ease); }
  .tabbar a:active .ico, .tabbar button:active .ico { transform: scale(.88); }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] .ico { color: var(--accent); }
  .tabbar a[aria-current="page"]::after { content: ""; width: 16px; height: 2px; border-radius: 2px; background: var(--accent); margin-top: -1px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .countdown { text-align: left; display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; }
  .countdown .n { font-size: 2.8rem; }
  .art { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .num { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .match { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .mitem { font-size: .84rem; padding: 9px; }
  .card { padding: 17px; border-radius: 12px; }
  .qg { padding-left: 50px; }
  .qg .k { left: 14px; top: 17px; }
  .steps { top: 55px; margin: 14px -16px; padding-left: 8px; padding-right: 8px; }
  .steps::before { top: 26px; }
  .step { font-size: .68rem; }
  .step .n { width: 30px; height: 30px; font-size: .85rem; }
  .tabs { top: 55px; margin-left: -16px; margin-right: -16px; padding: 0 8px; }
  .sticky-top { top: 55px; }
  .nav-foot .btn { flex: 1; }
  .btn { min-height: 46px; }
}
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }
@media print {
  .sidebar, .tabbar, .topbar, .btn, .filters, .tabs, .toolbar, .steps, .nav-foot { display: none !important; }
  body { background: #fff; }
  .shell { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Surligneur jaune */
.mk { background: linear-gradient(transparent 60%, var(--mark) 60%, var(--mark) 92%, transparent 92%); padding: 0 .08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
:root[data-theme="dark"] .mk { color: #15131a; background: var(--mark); border-radius: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mk { color: #15131a; background: var(--mark); border-radius: 3px; } }
.countdown { border-color: var(--mark); border-style: solid; border-width: 1px 1px 4px; }
.today-steps span.on { background: var(--accent); }
.bar > span { background: linear-gradient(90deg, var(--accent), #8f5cf0); }
.piege { border-left-color: var(--mark); }

/* Version payante */
.paywall { border-color: transparent; box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-up); }
.paywall h2 { margin-top: 0; }
.inclus { margin: 16px 0 4px; gap: 18px 22px; }
.inclus .v { color: var(--accent); }
.inclus .k { font-size: .84rem; color: var(--ink-3); }
.inclus .k strong { color: var(--ink); font-weight: 600; font-size: .9rem; }
.bandeau { margin-bottom: 16px; background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.bandeau::after { display: none; }
.bandeau .eyebrow { color: var(--accent); }
.prix { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 8px; }
.err-msg { color: var(--bad); font-weight: 500; margin: 10px 0 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.comp.ok li::before { content: "✓"; border: 0; width: auto; height: auto; top: 0; left: 2px; color: var(--accent); font-weight: 700; }
@media (max-width: 860px) { .inclus { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .inclus .v { font-size: 1.5rem; } }
