/* Savoir communiquer
   Concept : une ligne de transmission. Le parcours est un fil qui relie des « stations » (modules) ;
   les exercices se présentent comme une conversation entre deux voix : le bleu signal (l'émetteur)
   et l'ambre (la voix de l'autre). */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../fonts/bricolage-grotesque-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('../fonts/atkinson-next-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('../fonts/atkinson-next-latin-italic.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Couleurs */
  --paper: oklch(0.975 0.008 255);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.955 0.012 255);
  --ink: oklch(0.25 0.045 265);
  --muted: oklch(0.5 0.03 262);
  --line: oklch(0.9 0.012 258);
  --signal: oklch(0.53 0.2 264);
  --signal-ink: oklch(1 0 0);
  --signal-soft: oklch(0.93 0.04 264);
  --voice: oklch(0.8 0.15 75);
  --voice-ink: oklch(0.3 0.06 60);
  --voice-soft: oklch(0.95 0.05 85);
  --voice-strong: oklch(0.47 0.11 62);
  --good: oklch(0.6 0.15 155);
  --good-soft: oklch(0.94 0.05 155);
  --mid: oklch(0.7 0.15 70);
  --mid-soft: oklch(0.95 0.05 80);
  --bad: oklch(0.58 0.19 25);
  --bad-soft: oklch(0.95 0.035 25);
  --pink: oklch(0.68 0.17 350);
  --sky: oklch(0.72 0.12 220);
  --mod-l: 0.56;
  --mod-c: 0.15;
  --mod-soft-l: 0.95;
  --shadow: 0 1px 2px oklch(0.25 0.05 265 / 0.06), 0 6px 20px -8px oklch(0.25 0.05 265 / 0.18);
  --shadow-lift: 0 2px 4px oklch(0.25 0.05 265 / 0.08), 0 14px 32px -12px oklch(0.25 0.05 265 / 0.3);

  /* Typographie */
  --font-display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --step--1: 0.84rem;
  --step-0: 1rem;
  --step-1: 1.18rem;
  --step-2: 1.42rem;
  --step-3: clamp(1.7rem, 1.3rem + 1.6vw, 2.15rem);
  --step-4: clamp(2rem, 1.5rem + 2.4vw, 2.8rem);

  /* Formes */
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --gutter: 16px;
  --nav-h: 68px;
  --col: 720px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: oklch(0.19 0.025 265);
    --surface: oklch(0.235 0.03 265);
    --surface-2: oklch(0.27 0.032 265);
    --ink: oklch(0.95 0.012 255);
    --muted: oklch(0.74 0.025 258);
    --line: oklch(0.34 0.032 265);
    --signal: oklch(0.72 0.15 264);
    --signal-ink: oklch(0.18 0.04 265);
    --signal-soft: oklch(0.3 0.06 264);
    --voice: oklch(0.82 0.14 78);
    --voice-ink: oklch(0.22 0.05 60);
    --voice-soft: oklch(0.32 0.05 75);
  --voice-strong: oklch(0.87 0.12 82);
    --voice-strong: oklch(0.87 0.12 82);
    --good: oklch(0.74 0.15 155);
    --good-soft: oklch(0.3 0.05 155);
    --mid: oklch(0.8 0.14 75);
    --mid-soft: oklch(0.32 0.05 75);
    --bad: oklch(0.7 0.17 25);
    --bad-soft: oklch(0.3 0.06 25);
    --pink: oklch(0.74 0.15 350);
    --sky: oklch(0.78 0.11 220);
    --mod-l: 0.74;
    --mod-c: 0.13;
    --mod-soft-l: 0.29;
    --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 8px 24px -10px oklch(0 0 0 / 0.6);
    --shadow-lift: 0 2px 6px oklch(0 0 0 / 0.35), 0 16px 36px -12px oklch(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: oklch(0.19 0.025 265);
  --surface: oklch(0.235 0.03 265);
  --surface-2: oklch(0.27 0.032 265);
  --ink: oklch(0.95 0.012 255);
  --muted: oklch(0.74 0.025 258);
  --line: oklch(0.34 0.032 265);
  --signal: oklch(0.72 0.15 264);
  --signal-ink: oklch(0.18 0.04 265);
  --signal-soft: oklch(0.3 0.06 264);
  --voice: oklch(0.82 0.14 78);
  --voice-ink: oklch(0.22 0.05 60);
  --voice-soft: oklch(0.32 0.05 75);
  --good: oklch(0.74 0.15 155);
  --good-soft: oklch(0.3 0.05 155);
  --mid: oklch(0.8 0.14 75);
  --mid-soft: oklch(0.32 0.05 75);
  --bad: oklch(0.7 0.17 25);
  --bad-soft: oklch(0.3 0.06 25);
  --pink: oklch(0.74 0.15 350);
  --sky: oklch(0.78 0.11 220);
  --mod-l: 0.74;
  --mod-c: 0.13;
  --mod-soft-l: 0.29;
  --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 8px 24px -10px oklch(0 0 0 / 0.6);
  --shadow-lift: 0 2px 6px oklch(0 0 0 / 0.35), 0 16px 36px -12px oklch(0 0 0 / 0.7);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
body.no-scroll { overflow: hidden; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid color-mix(in oklch, var(--signal) 70%, transparent); outline-offset: 2px; border-radius: 6px; }
strong { font-weight: 700; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.display { font-family: var(--font-display); font-size: var(--step-3); line-height: 1.08; font-weight: 750; letter-spacing: -0.02em; font-variation-settings: 'opsz' 72; }
.h2 { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; letter-spacing: -0.01em; }
.h3 { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; }
.lead { font-size: var(--step-1); color: var(--muted); max-width: 60ch; line-height: 1.45; }
.eyebrow { font-size: 0.74rem; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.end { justify-content: flex-end; }

/* ------------------------------------------------------------------ */
/* Structure                                                           */
/* ------------------------------------------------------------------ */
.app { min-height: 100dvh; }
#view {
  max-width: var(--col);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) var(--gutter) calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 40px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
body.is-immersive #view { padding-bottom: 0; padding-top: 0; max-width: none; }
body.is-immersive .nav { display: none; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: color-mix(in oklch, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-brand { display: none; }
.nav-list { list-style: none; margin: 0 auto; padding: 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 520px; height: var(--nav-h); }
.nav-item {
  position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.01em;
}
.nav-icon { display: grid; place-items: center; width: 48px; height: 30px; border-radius: 99px; transition: background .2s, color .2s; }
.nav-icon .icon { width: 22px; height: 22px; }
.nav-item.is-active { color: var(--ink); }
.nav-item.is-active .nav-icon { background: var(--signal-soft); color: var(--signal); }
.nav-badge { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--voice); color: var(--voice-ink); font-size: 0.7rem; display: grid; place-items: center; }

@media (min-width: 960px) {
  .nav {
    top: 0; right: auto; width: 232px; border-top: 0; border-right: 1px solid var(--line);
    padding: 28px 16px; display: flex; flex-direction: column; gap: 28px; background: var(--surface);
  }
  .nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 0 8px; }
  .brand-mark svg { width: 38px; height: 38px; display: block; }
  .brand-name { font-family: var(--font-display); font-weight: 750; line-height: 1.05; font-size: 1.05rem; letter-spacing: -0.01em; }
  .nav-list { display: flex; flex-direction: column; gap: 4px; height: auto; padding: 0; max-width: none; margin: 0; }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: 10px; height: 46px; padding: 0 10px; border-radius: 12px; font-size: 0.95rem; }
  .nav-item:hover { background: var(--surface-2); color: var(--ink); }
  .nav-item.is-active { background: var(--signal-soft); }
  .nav-item.is-active .nav-icon { background: none; }
  .nav-icon { width: 26px; height: 26px; }
  .nav-badge { position: static; margin-left: auto; }
  body:not(.is-immersive) #view { padding-left: calc(232px + var(--gutter)); max-width: calc(var(--col) + 232px + 2 * var(--gutter)); padding-bottom: 60px; padding-top: 36px; }
  body:not(.is-immersive) #view { margin-left: max(0px, calc((100vw - var(--col) - 232px) / 2 - 116px)); }
}
.bm-a { fill: var(--signal); }
.bm-b { fill: var(--voice); }

/* ------------------------------------------------------------------ */
/* Composants communs                                                  */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0;
  font-weight: 700; font-size: 1rem; text-decoration: none; line-height: 1.2; text-align: center;
  transition: transform .12s ease, box-shadow .2s, background .2s, opacity .2s;
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn-primary { background: var(--signal); color: var(--signal-ink); box-shadow: 0 3px 0 color-mix(in oklch, var(--signal) 65%, black), var(--shadow); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-primary:disabled { background: var(--line); color: var(--muted); box-shadow: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: color-mix(in oklch, var(--signal) 40%, var(--line)); }
.btn-danger { background: var(--bad); color: oklch(1 0 0); }
.btn-danger-ghost { background: var(--surface); color: var(--bad); border: 1.5px solid color-mix(in oklch, var(--bad) 35%, var(--line)); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 0.92rem; border-radius: 11px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 0; background: transparent; color: var(--muted); text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px;
  font-size: 0.8rem; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 0; line-height: 1.3; text-decoration: none; white-space: nowrap;
}
.chip .icon { width: 1em; height: 1em; vertical-align: 0; }
.chip-small { font-size: 0.72rem; padding: 2px 8px; }
.chip-new { background: var(--signal-soft); color: var(--signal); }
.chip-learning { background: var(--voice-soft); color: var(--voice-strong); }
.chip-mastered { background: var(--good-soft); color: color-mix(in oklch, var(--good) 75%, var(--ink)); }
.chip-review { background: var(--bad-soft); color: var(--bad); }
.chip-retry { background: var(--voice-soft); color: var(--voice-strong); }
.chip-link { background: var(--signal-soft); color: var(--signal); white-space: normal; }
.chip-count { background: var(--voice); color: var(--voice-ink); }
.chip-evidence { cursor: pointer; }
.ev-solide { background: var(--good-soft); color: color-mix(in oklch, var(--good) 75%, var(--ink)); }
.ev-etabli { background: color-mix(in oklch, var(--good-soft) 60%, var(--surface-2)); color: color-mix(in oklch, var(--good) 65%, var(--ink)); }
.ev-cadre { background: var(--signal-soft); color: var(--signal); }
.ev-pratique { background: var(--surface-2); color: var(--ink); }
.ev-grille { background: var(--voice-soft); color: var(--voice-strong); }
.ev-mythe { background: var(--bad-soft); color: var(--bad); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.card { background: var(--surface); border-radius: var(--r-l); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.92rem; align-self: flex-start; margin-bottom: -8px; }
.back:hover { color: var(--ink); }
.page-head { display: flex; flex-direction: column; gap: 10px; }
.empty, .empty-note { text-align: center; padding: 28px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.empty-note { background: var(--surface); border-radius: var(--r-m); border: 1.5px dashed var(--line); }

.mini-bar { display: inline-block; height: 6px; width: 70px; border-radius: 99px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.mini-bar > span { display: block; height: 100%; border-radius: inherit; background: oklch(var(--mod-l) var(--mod-c) var(--mod-h, 264)); }

.ring-track { stroke: var(--surface-2); }
.ring-value { stroke: oklch(var(--mod-l) var(--mod-c) var(--mod-h, 264)); transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }

/* Champs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 700; font-size: 0.95rem; }
.field-hint { font-size: var(--step--1); color: var(--muted); }
.input {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px;
  font-size: 1rem; line-height: 1.45; resize: vertical; transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.input::placeholder, .write-input::placeholder { color: color-mix(in oklch, var(--muted) 75%, transparent); }

/* Toasts */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
body.is-immersive .toasts { bottom: calc(env(safe-area-inset-bottom, 0px) + 110px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lift); font-weight: 600; font-size: 0.95rem;
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s;
}
.toast.in { opacity: 1; transform: none; }
.toast-text { flex: 1; min-width: 0; }
.toast-action { border: 0; background: var(--voice); color: var(--voice-ink); font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.toast-icon { display: grid; color: var(--voice); }

/* Feuille modale */
.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: oklch(0.15 0.03 265 / 0.45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .25s; }
.sheet-backdrop.in { opacity: 1; }
.sheet {
  position: relative; width: min(100%, 640px); max-height: 88dvh; overflow: auto; background: var(--surface);
  border-radius: 24px 24px 0 0; padding: 14px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(30px); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column; gap: 10px;
}
.sheet-backdrop.in .sheet { transform: none; }
.sheet-handle { width: 42px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 6px; }
.sheet-close { position: absolute; top: 8px; right: 8px; }
.sheet-body { display: flex; flex-direction: column; gap: 12px; }
.sheet-title { font-family: var(--font-display); font-size: var(--step-2); padding-right: 40px; }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 24px; } }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }

/* ------------------------------------------------------------------ */
/* Accueil                                                             */
/* ------------------------------------------------------------------ */
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.home-hello { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 240px; }
.home-hello .display { font-size: var(--step-4); }
.level-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-decoration: none; color: var(--muted); font-size: 0.88rem; }
.level-badge { background: var(--ink); color: var(--paper); font-weight: 700; padding: 2px 8px; border-radius: 8px; font-size: 0.78rem; }
.level-title { font-weight: 700; color: var(--ink); }
.level-bar { display: inline-block; width: 90px; height: 7px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.level-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--signal), var(--voice)); border-radius: inherit; }
.level-line.is-static .level-bar { width: 160px; }
.home-meters { display: flex; gap: 10px; }
.meter {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 84px; padding: 10px 10px 8px;
  background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.meter strong { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.2; }
.meter span:last-child { color: var(--muted); font-weight: 700; }
.meter-icon .icon { width: 26px; height: 26px; color: var(--muted); }
.meter-streak.is-on .meter-icon .icon { color: oklch(0.68 0.19 45); fill: oklch(0.8 0.15 75 / 0.5); }
.meter-ring { position: relative; width: 40px; height: 40px; display: grid; place-items: center; --mod-h: 75; --mod-l: 0.75; --mod-c: 0.15; }
.meter-ring .ring { position: absolute; inset: 0; }
.meter-ring .icon { width: 16px; height: 16px; color: var(--muted); }
.meter-goal.is-done .meter-ring { --mod-h: 155; --mod-l: 0.62; }
.meter-goal.is-done .meter-ring .icon { color: var(--good); }

.hero-card {
  --mod-h: 264;
  position: relative; display: flex; gap: 16px; padding: 22px; border-radius: var(--r-l); text-decoration: none; color: var(--ink);
  background:
    radial-gradient(120% 140% at 100% 0%, oklch(var(--mod-l) var(--mod-c) var(--mod-h) / 0.22), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow); overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.hero-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.hero-icon { width: 54px; height: 54px; flex: none; border-radius: 18px; display: grid; place-items: center; background: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); color: oklch(1 0 0); }
.hero-icon .icon { width: 28px; height: 28px; }
.hero-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-items: flex-start; }
.hero-title { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.15; }
.hero-summary { color: var(--muted); }
.hero-btn { margin-top: 8px; }
.hero-card.is-complete { --mod-h: 155; }

.review-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-m); text-decoration: none; color: var(--ink);
  background: var(--voice-soft); border: 1.5px solid color-mix(in oklch, var(--voice) 50%, transparent);
}
.review-card p { color: var(--muted); font-size: 0.9rem; }
.review-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--voice); color: var(--voice-ink); flex: none; }
.review-go, .path-go { margin-left: auto; color: var(--muted); display: grid; }

/* Le parcours : une ligne de transmission */
.path { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 6px; }
.path::before {
  content: ''; position: absolute; left: 33px; top: 30px; bottom: 30px; width: 3px; border-radius: 3px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 8px, transparent 8px 14px);
}
.path-stop { position: relative; }
.path-link { display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 5px; border-radius: var(--r-m); text-decoration: none; color: var(--ink); transition: background .15s; }
.path-link:hover { background: var(--surface); }
.path-node { position: relative; width: 56px; height: 56px; flex: none; display: grid; place-items: center; background: var(--paper); border-radius: 50%; }
.path-node .ring { position: absolute; inset: 0; }
.path-node-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: oklch(var(--mod-soft-l) 0.04 var(--mod-h)); color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); }
.path-stop.is-done .path-node-icon { background: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); color: oklch(1 0 0); }
.path-node-icon .icon { width: 21px; height: 21px; }
.path-text { display: flex; flex-direction: column; min-width: 0; }
.path-num { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); }
.path-title { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.2; }
.path-meta { font-size: 0.85rem; color: var(--muted); }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quick { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-size: 0.85rem; min-width: 0; }
.quick span:last-child { color: var(--muted); }
.quick-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--signal-soft); color: var(--signal); margin-bottom: 6px; }
.quick strong { font-size: 0.98rem; }

/* ------------------------------------------------------------------ */
/* Module & notion                                                     */
/* ------------------------------------------------------------------ */
.module-head {
  display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 22px; border-radius: var(--r-l);
  background: linear-gradient(135deg, oklch(var(--mod-soft-l) 0.05 var(--mod-h)), var(--surface) 75%);
  box-shadow: var(--shadow);
}
.module-head .eyebrow { color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); }
.module-head-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.module-tagline { color: var(--muted); }
.module-ring { position: relative; width: 84px; height: 84px; flex: none; display: grid; place-items: center; font-family: var(--font-display); font-weight: 750; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.module-ring .ring { position: absolute; inset: 0; }
.module-ring small { font-size: 0.7em; }

.notion-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.notion-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .15s; }
.notion-row:hover { transform: translateX(3px); }
.notion-num { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 750; background: oklch(var(--mod-soft-l) 0.04 var(--mod-h)); color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); }
.notion-row.st-mastered .notion-num, .notion-row.st-review .notion-num { background: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); color: oklch(1 0 0); }
.notion-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.notion-text strong { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.25; }
.notion-summary { color: var(--muted); font-size: 0.92rem; }
.notion-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.notion-row .path-go { align-self: center; }

.quiz-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-l); background: var(--surface); border: 2px dashed oklch(var(--mod-l) var(--mod-c) var(--mod-h) / 0.45); flex-wrap: wrap; }
.quiz-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: oklch(var(--mod-soft-l) 0.05 var(--mod-h)); color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); flex: none; }
.quiz-text { flex: 1 1 180px; min-width: 0; }
.quiz-text p { color: var(--muted); font-size: 0.9rem; }

.notion { display: flex; flex-direction: column; gap: 20px; }
.notion-head { display: flex; flex-direction: column; gap: 10px; }
.notion-head .eyebrow { color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); }
.source { font-size: var(--step--1); color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.sticky-cta {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px); z-index: 5;
  padding: 10px; margin: 0 -10px; border-radius: 20px;
  background: color-mix(in oklch, var(--paper) 80%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
@media (min-width: 960px) { .sticky-cta { bottom: 16px; } }
.cta-count { background: color-mix(in oklch, var(--signal-ink) 22%, transparent); padding: 1px 9px; border-radius: 99px; font-size: 0.85rem; }

/* Mini-cours */
.lesson { display: flex; flex-direction: column; gap: 16px; font-size: 1.04rem; line-height: 1.62; }
.lesson > p { max-width: 65ch; }
.lesson-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.lesson-list li::marker { color: oklch(var(--mod-l) var(--mod-c) var(--mod-h, 264)); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; position: relative; }
.step { display: flex; gap: 14px; position: relative; padding-bottom: 14px; }
.step:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: oklch(var(--mod-l) var(--mod-c) var(--mod-h, 264) / 0.3); }
.step-label { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; background: oklch(var(--mod-l) var(--mod-c) var(--mod-h, 264)); color: oklch(1 0 0); }
.step-body { display: flex; flex-direction: column; gap: 2px; padding-top: 5px; min-width: 0; }
.step-body p { color: var(--muted); }
.table-wrap { overflow-x: auto; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); min-width: 120px; }
thead th { background: var(--surface-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
tbody th { font-weight: 700; color: oklch(var(--mod-l) var(--mod-c) var(--mod-h, 264)); }
tbody tr:last-child > * { border-bottom: 0; }
.example { background: var(--surface); border-radius: var(--r-m); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.example-context { color: var(--muted); }
.example-line { border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.example-line.is-bad { background: var(--bad-soft); }
.example-line.is-good { background: var(--good-soft); }
.example-tag { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; display: inline-flex; align-items: center; gap: 4px; }
.is-bad .example-tag { color: var(--bad); }
.is-good .example-tag { color: color-mix(in oklch, var(--good) 75%, var(--ink)); }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-m); align-items: flex-start; }
.callout-icon { flex: none; display: grid; padding-top: 2px; }
.callout-tip { background: var(--signal-soft); }
.callout-tip .callout-icon { color: var(--signal); }
.callout-warn { background: var(--voice-soft); }
.callout-warn .callout-icon { color: var(--voice-strong); }
blockquote { margin: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--voice); font-family: var(--font-display); font-size: 1.15rem; line-height: 1.4; }
blockquote cite { display: block; margin-top: 6px; font-family: var(--font-body); font-style: normal; font-size: 0.85rem; color: var(--muted); }
.keypoints { border-radius: var(--r-l); padding: 18px 20px; background: oklch(var(--mod-soft-l) 0.035 var(--mod-h, 264)); display: flex; flex-direction: column; gap: 10px; }
.keypoints-title { font-family: var(--font-display); font-size: 1.05rem; display: flex; align-items: center; gap: 6px; color: oklch(var(--mod-l) var(--mod-c) var(--mod-h, 264)); }
.keypoints ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }

/* ------------------------------------------------------------------ */
/* Session                                                             */
/* ------------------------------------------------------------------ */
.session { min-height: 100dvh; display: flex; flex-direction: column; max-width: var(--col); margin: 0 auto; }
.session-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--gutter) 10px; background: color-mix(in oklch, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.progress-track { flex: 1; height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 4%; border-radius: inherit; background: linear-gradient(90deg, var(--signal), color-mix(in oklch, var(--signal) 60%, var(--voice))); transition: width .5s cubic-bezier(.2,.8,.2,1); position: relative; }
.progress-fill::after { content: ''; position: absolute; left: 8px; right: 8px; top: 3px; height: 3px; border-radius: 3px; background: oklch(1 0 0 / 0.35); }
.combo { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; color: oklch(0.68 0.19 45); font-family: var(--font-display); min-width: 0; transform: scale(.6); opacity: 0; transition: all .25s; }
.combo.is-on { transform: none; opacity: 1; }
.combo .icon { fill: currentColor; }
.session-body { flex: 1; padding: 8px var(--gutter) 24px; outline: none; }
.ex { display: flex; flex-direction: column; gap: 16px; animation: exIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes exIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.ex-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ex-type { font-size: 0.74rem; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 800; color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); }
.ex-notion { font-size: 0.82rem; color: var(--muted); }
.ex-notion::before { content: '·'; margin-right: 8px; }
.ex-prompt { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.22; font-weight: 700; letter-spacing: -0.01em; }
.ex-hint { color: var(--muted); font-size: 0.9rem; margin-top: -8px; }
.ex-context { background: var(--surface); border-radius: var(--r-m); padding: 14px 16px; border-left: 4px solid oklch(var(--mod-l) var(--mod-c) var(--mod-h)); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.ex-choice, .ex-tf, .ex-sort, .ex-match, .ex-order, .ex-cloze, .ex-scenario, .ex-spot, .ex-build, .ex-write { display: flex; flex-direction: column; gap: 16px; }

.action-bar {
  position: sticky; bottom: 0; z-index: 20; padding: 12px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: color-mix(in oklch, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; transition: background .25s;
}
.action-btn { min-height: 54px; font-size: 1.05rem; }
.fb { display: none; flex-direction: column; gap: 6px; max-height: 42dvh; overflow: auto; }
.fb.in { display: flex; animation: fbIn .3s cubic-bezier(.2,.8,.2,1); }
@keyframes fbIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fb-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 750; font-size: 1.3rem; }
.fb-title .icon { width: 28px; height: 28px; padding: 4px; border-radius: 50%; color: oklch(1 0 0); }
.fb-xp { flex: none; white-space: nowrap; font-weight: 800; font-family: var(--font-display); color: var(--voice-ink); background: var(--voice); padding: 2px 10px; border-radius: 99px; font-size: 0.9rem; }
.fb-xp:empty { display: none; }
.fb-detail { font-size: 0.88rem; font-weight: 700; }
.fb-text { font-size: 0.98rem; line-height: 1.5; }
.action-bar.fb-good { background: var(--good-soft); border-top-color: transparent; }
.fb-good .fb-title { color: color-mix(in oklch, var(--good) 80%, var(--ink)); }
.fb-good .fb-title .icon { background: var(--good); }
.fb-good .action-btn { background: var(--good); box-shadow: 0 3px 0 color-mix(in oklch, var(--good) 65%, black); color: oklch(1 0 0); }
.action-bar.fb-mid { background: var(--mid-soft); border-top-color: transparent; }
.fb-mid .fb-title { color: var(--voice-strong); }
.fb-mid .fb-title .icon { background: var(--mid); }
.fb-mid .action-btn { background: var(--mid); color: var(--voice-ink); box-shadow: 0 3px 0 color-mix(in oklch, var(--mid) 65%, black); }
.action-bar.fb-bad { background: var(--bad-soft); border-top-color: transparent; }
.fb-bad .fb-title { color: var(--bad); }
.fb-bad .fb-title .icon { background: var(--bad); }
.fb-bad .action-btn { background: var(--bad); color: oklch(1 0 0); box-shadow: 0 3px 0 color-mix(in oklch, var(--bad) 65%, black); }
.action-bar.fb-neutral { background: var(--signal-soft); border-top-color: transparent; }
.fb-neutral .fb-title .icon { background: var(--signal); }
:root[data-theme="dark"] .fb-good .action-btn, :root[data-theme="dark"] .fb-bad .action-btn { color: var(--signal-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fb-good .action-btn, :root:not([data-theme="light"]) .fb-bad .action-btn { color: var(--signal-ink); } }

/* Options (QCM, scénario) */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 14px 14px; border-radius: 16px;
  background: var(--surface); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line); line-height: 1.45;
  transition: border-color .15s, background .15s, transform .1s;
}
.option:hover:not(:disabled) { border-color: color-mix(in oklch, var(--signal) 45%, var(--line)); }
.option:active:not(:disabled) { transform: translateY(1px); }
.option-key { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; border: 2px solid var(--line); color: var(--muted); }
.option-text { flex: 1; min-width: 0; padding-top: 2px; }
.option-mark { flex: none; display: grid; width: 24px; padding-top: 2px; }
.option-multi .option-key { border-radius: 7px; }
.option.is-selected { border-color: var(--signal); background: var(--signal-soft); box-shadow: 0 2px 0 var(--signal); }
.option.is-selected .option-key { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.option.is-correct { border-color: var(--good); background: var(--good-soft); box-shadow: 0 2px 0 var(--good); }
.option.is-correct .option-key { background: var(--good); border-color: var(--good); color: oklch(1 0 0); }
.option.is-correct .option-mark { color: var(--good); }
.option.is-wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 2px 0 var(--bad); }
.option.is-wrong .option-key { background: var(--bad); border-color: var(--bad); color: oklch(1 0 0); }
.option.is-wrong .option-mark { color: var(--bad); }
.option.is-partial { border-color: var(--mid); background: var(--mid-soft); box-shadow: 0 2px 0 var(--mid); }
.option.is-partial .option-key { background: var(--mid); border-color: var(--mid); color: var(--voice-ink); }
.option.is-missed { border-style: dashed; border-color: var(--good); }
.option.is-missed .option-mark { color: var(--good); }
.option.is-dim { opacity: .62; }
.mark-mid { font-weight: 800; color: var(--mid); font-size: 1.2rem; line-height: 1; }
.why { font-size: 0.92rem; line-height: 1.5; padding: 8px 12px 8px 14px; margin-top: -4px; border-left: 3px solid var(--line); color: var(--ink); animation: fbIn .3s; }
.why-good { border-color: var(--good); }
.why-bad { border-color: var(--bad); }
.why-mid { border-color: var(--mid); }
.more-why { background: var(--surface); border-radius: var(--r-m); padding: 10px 14px; font-size: 0.92rem; }
.more-why summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.more-why p { margin-top: 8px; }

/* Vrai / faux */
.tf-card { background: var(--surface); border-radius: var(--r-m); padding: 16px; border: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; opacity: .55; transition: opacity .2s, border-color .2s; }
.tf-card.is-current { opacity: 1; border-color: var(--signal); box-shadow: var(--shadow); }
.tf-card.is-done { opacity: 1; }
.tf-card.is-good { border-color: var(--good); }
.tf-card.is-bad { border-color: var(--bad); }
.tf-text { font-size: 1.08rem; font-weight: 600; line-height: 1.45; }
.tf-buttons { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tf-btn { flex: 1 1 120px; min-height: 46px; background: var(--surface-2); color: var(--ink); border: 2px solid transparent; }
.tf-card:not(.is-done) .tf-btn:hover { border-color: var(--signal); }
.tf-btn.is-picked { border-color: var(--ink); }
.is-done .tf-btn:not(.is-picked) { opacity: .45; }
.tf-verdict { flex-basis: 100%; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; font-size: 0.92rem; }
.is-good .tf-verdict { color: color-mix(in oklch, var(--good) 80%, var(--ink)); }
.is-bad .tf-verdict { color: var(--bad); }
.tf-card .why { margin-top: 0; }

/* Tri */
.sort-counter { font-size: 0.85rem; font-weight: 700; color: var(--muted); text-align: center; margin-bottom: -8px; }
.sort-stage { min-height: 128px; display: grid; place-items: center; perspective: 800px; }
.sort-card {
  width: 100%; max-width: 480px; padding: 22px 20px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lift);
  font-size: 1.12rem; font-weight: 600; line-height: 1.45; text-align: center; border: 2px solid var(--line);
  transform: translateY(14px) rotateX(10deg); opacity: 0; transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s, border-color .2s, background .2s;
}
.sort-card.in { transform: none; opacity: 1; }
.sort-card.is-good { border-color: var(--good); background: var(--good-soft); transform: translateY(40px) scale(.9); opacity: 0; transition-delay: .15s; }
.sort-card.is-bad { border-color: var(--bad); background: var(--bad-soft); animation: shake .4s; }
.sort-feedback { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sort-feedback:empty { display: none; }
.sort-feedback .why { margin-top: 0; }
.sort-buckets { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.sort-buckets.n2 { grid-template-columns: 1fr 1fr; }
.sort-buckets.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sort-buckets.is-grid { grid-template-columns: 1fr 1fr; }
.bucket {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; padding: 10px 8px;
  border-radius: 16px; border: 2px solid oklch(var(--mod-l) var(--mod-c) var(--mod-h) / 0.45); background: oklch(var(--mod-soft-l) 0.035 var(--mod-h));
  box-shadow: 0 3px 0 oklch(var(--mod-l) var(--mod-c) var(--mod-h) / 0.35); text-align: center; transition: transform .1s, background .2s, border-color .2s;
}
.bucket:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.bucket:disabled { opacity: .55; }
.bucket-label { font-family: var(--font-display); font-weight: 750; font-size: 1.02rem; line-height: 1.2; }
.bucket-hint { font-size: 0.76rem; color: var(--muted); line-height: 1.25; }
.bucket-count { position: absolute; top: 6px; right: 8px; font-size: 0.72rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.bucket.flash-good { background: var(--good-soft); border-color: var(--good); }
.bucket.hint-good { opacity: 1 !important; background: var(--good-soft); border-color: var(--good); box-shadow: 0 0 0 4px color-mix(in oklch, var(--good) 25%, transparent); }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

/* Associer */
.match-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 10px; }
.match-col { display: flex; flex-direction: column; gap: 10px; }
.match-item {
  position: relative; text-align: left; padding: 12px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line);
  box-shadow: 0 2px 0 var(--line); line-height: 1.35; font-size: 0.95rem; min-height: 56px; display: flex; align-items: center; gap: 8px;
}
.match-left .match-item { font-weight: 700; font-family: var(--font-display); }
.match-item.is-selected { border-color: var(--signal); background: var(--signal-soft); box-shadow: 0 2px 0 var(--signal); }
.match-item.is-matched { border-color: var(--good); background: var(--good-soft); box-shadow: none; opacity: .9; }
.match-item.is-shake { border-color: var(--bad); background: var(--bad-soft); animation: shake .4s; }
.match-tag { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--good); color: oklch(1 0 0); font-size: 0.75rem; font-weight: 800; font-family: var(--font-body); }

/* Ordre */
.order-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.order-slot { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 6px 8px; border-radius: 14px; border: 2px dashed var(--line); }
.order-slot.is-filled { border-style: solid; border-color: transparent; background: var(--surface-2); }
.order-num { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; background: oklch(var(--mod-soft-l) 0.04 var(--mod-h)); color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); }
.order-empty { color: var(--muted); font-size: 0.88rem; font-style: italic; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.order-chip { text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line); line-height: 1.35; font-size: 0.95rem; display: inline-flex; align-items: center; gap: 8px; }
.order-chip.is-placed { flex: 1; box-shadow: none; border-color: transparent; background: var(--surface); }
.order-slot.is-correct { background: var(--good-soft); }
.order-slot.is-wrong { background: var(--bad-soft); }
.order-mark { margin-left: auto; display: grid; }
.is-correct .order-mark { color: var(--good); }
.is-wrong .order-mark { color: var(--bad); }
.order-solution, .build-ideal, .criteria-list { background: var(--good-soft); border-radius: var(--r-m); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.order-solution ol, .criteria-list ul { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }

/* Texte à trous */
.cloze-card, .spot-card { background: var(--surface); border-radius: var(--r-m); padding: 18px; box-shadow: var(--shadow); }
.cloze-text { font-size: 1.1rem; line-height: 2.3; }
.blank {
  display: inline-block; min-width: 92px; min-height: 36px; padding: 2px 12px; margin: 0 2px; vertical-align: middle; line-height: 1.5;
  border: 0; border-bottom: 3px solid var(--line); border-radius: 10px 10px 4px 4px; background: var(--surface-2); font-weight: 700; color: var(--signal);
}
.blank.is-active { border-bottom-color: var(--signal); background: var(--signal-soft); animation: pulse 1.4s infinite; }
.blank.is-filled { background: var(--signal-soft); border-bottom-color: var(--signal); }
.blank.is-correct { background: var(--good-soft); border-bottom-color: var(--good); color: color-mix(in oklch, var(--good) 75%, var(--ink)); }
.blank.is-wrong { background: var(--bad-soft); border-bottom-color: var(--bad); color: var(--bad); }
.blank s { opacity: .7; }
.blank-fix { color: color-mix(in oklch, var(--good) 75%, var(--ink)); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px var(--signal-soft); } }
.word-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.word { padding: 10px 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 2px 0 var(--line); font-weight: 700; transition: opacity .2s, transform .1s; }
.word:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.word.is-used { opacity: .25; }

/* Mise en situation */
.scene { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--r-m); background: var(--voice-soft); }
.scene .eyebrow { color: var(--voice-strong); }
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble-row { display: flex; align-items: flex-end; gap: 8px; animation: fbIn .35s; }
.bubble-row.is-me { justify-content: flex-end; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--voice); color: var(--voice-ink); font-weight: 800; font-family: var(--font-display); }
.avatar-big { width: 64px; height: 64px; font-size: 1.6rem; background: linear-gradient(135deg, var(--signal), var(--voice)); color: oklch(1 0 0); }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bubble-me { border-radius: 18px 18px 6px 18px; background: var(--signal); color: var(--signal-ink); }
.bubble-who { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; opacity: .7; }
.bubble-text { line-height: 1.45; }
.bubble.typing { flex-direction: row; gap: 4px; padding: 14px 16px; }
.bubble.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite; }
.bubble.typing span:nth-child(2) { animation-delay: .15s; }
.bubble.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.reply-options .option { border-radius: 18px 18px 6px 18px; }

/* Repérer */
.spot-text { font-size: 1.08rem; line-height: 2; }
.seg {
  display: inline; padding: 3px 4px; margin: 0 -1px; border: 0; border-radius: 6px; background: transparent; line-height: 1.9;
  text-decoration: underline dotted color-mix(in oklch, var(--muted) 60%, transparent); text-underline-offset: 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
  text-align: left;
}
.seg:hover:not(:disabled) { background: var(--surface-2); }
.seg.is-on { background: var(--voice); color: var(--voice-ink); text-decoration: none; }
.seg.is-correct { background: var(--good-soft); color: color-mix(in oklch, var(--good) 80%, var(--ink)); text-decoration: none; box-shadow: inset 0 -2px 0 var(--good); }
.seg.is-missed { background: transparent; box-shadow: inset 0 -3px 0 var(--good); text-decoration: none; }
.seg.is-wrong { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.spot-notes { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.note-good::marker { color: var(--good); }
.note-bad::marker { color: var(--bad); }

/* Construire */
.build-slot { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.build-label { font-family: var(--font-display); font-weight: 750; font-size: 1rem; padding: 0; color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); margin-bottom: 2px; }
.build-option { text-align: left; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 2px 0 var(--line); line-height: 1.4; }
.build-option.is-selected { border-color: var(--signal); background: var(--signal-soft); box-shadow: 0 2px 0 var(--signal); }
.build-option.is-correct { border-color: var(--good); background: var(--good-soft); box-shadow: none; }
.build-option.is-wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: none; }
.build-option.is-dim { opacity: .5; }
.build-preview { background: var(--surface); border-radius: var(--r-m); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; border-left: 4px solid var(--signal); }
.build-preview-text { line-height: 1.6; }
.build-gap { color: var(--muted); font-style: italic; background: var(--surface-2); padding: 0 6px; border-radius: 6px; }

/* Écrire */
.write-input { width: 100%; min-height: 150px; border: 2px solid var(--line); border-radius: var(--r-m); padding: 14px; background: var(--surface); font-size: 1.02rem; line-height: 1.5; resize: vertical; }
.write-input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.write-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: -6px; flex-wrap: wrap; }
.write-count { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.write-compare { display: grid; gap: 10px; }
@media (min-width: 640px) { .write-compare { grid-template-columns: 1fr 1fr; } }
.write-mine, .write-model { border-radius: var(--r-m); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.write-mine { background: var(--surface); border: 2px dashed var(--line); white-space: pre-wrap; }
.write-model { background: var(--good-soft); }
.write-model .eyebrow { color: color-mix(in oklch, var(--good) 75%, var(--ink)); }
.criteria { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.criteria legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.criterion { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); cursor: pointer; }
.criterion input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--good); flex: none; }
.criterion:has(input:checked) { border-color: var(--good); background: var(--good-soft); }

/* ------------------------------------------------------------------ */
/* Bilan                                                               */
/* ------------------------------------------------------------------ */
.results { display: flex; flex-direction: column; gap: 18px; padding: 16px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 32px); max-width: 560px; margin: 0 auto; width: 100%; }
.results-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 12px; }
.results-burst { position: relative; width: 132px; height: 132px; display: grid; place-items: center; --mod-h: 155; --mod-l: 0.62; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.results-burst .ring { position: absolute; inset: 0; }
.results-pct { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; font-variant-numeric: tabular-nums; }
.results-pct small { font-size: 0.5em; }
.results-title { font-family: var(--font-display); font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.big-icon { width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center; background: var(--signal-soft); color: var(--signal); }
.big-icon .icon { width: 42px; height: 42px; }
.big-icon.is-blitz { background: var(--voice); color: var(--voice-ink); }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .stat-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border-radius: var(--r-m); padding: 14px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; box-shadow: var(--shadow); min-width: 0; }
.stat-icon { color: var(--signal); display: grid; }
.stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-label { font-size: 0.78rem; color: var(--muted); font-weight: 700; line-height: 1.25; }
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-m); }
.banner p { font-size: 0.9rem; color: var(--muted); }
.banner-icon { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; }
.banner-level { background: linear-gradient(120deg, var(--signal-soft), var(--voice-soft)); }
.banner-level .banner-icon { background: var(--signal); color: var(--signal-ink); }
.banner-goal { background: var(--good-soft); }
.banner-goal .banner-icon { background: var(--good); color: oklch(1 0 0); }
.mastery-list { display: flex; flex-direction: column; gap: 14px; }
.mastery-item { display: flex; flex-direction: column; gap: 6px; }
.mastery-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.mastery-val { font-variant-numeric: tabular-nums; }
.mbar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.mbar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.mbar-before { background: oklch(var(--mod-l) var(--mod-c) var(--mod-h) / 0.35); z-index: 1; }
.mbar-after { background: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); animation: grow 1s .3s both cubic-bezier(.2,.8,.2,1); transform-origin: left; }
@keyframes grow { from { transform: scaleX(0.4); opacity: .4; } }
.badge-won-list { display: flex; flex-direction: column; gap: 10px; }
.badge-won { display: flex; gap: 12px; align-items: center; }
.badge-won p { color: var(--muted); font-size: 0.9rem; }
.results-actions { display: flex; flex-direction: column; gap: 10px; }

/* ------------------------------------------------------------------ */
/* S'entraîner                                                         */
/* ------------------------------------------------------------------ */
.practice-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .practice-grid { grid-template-columns: 1fr 1fr; } }
.pcard { background: var(--surface); border-radius: var(--r-l); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); align-items: flex-start; min-width: 0; }
.pcard p { color: var(--muted); flex: 1; }
.pcard-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.pcard-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; }
.pc-review .pcard-icon { background: var(--signal); color: var(--signal-ink); }
.pc-blitz .pcard-icon { background: var(--voice); color: var(--voice-ink); }
.pc-scenes .pcard-icon { background: oklch(var(--mod-soft-l) 0.06 170); color: oklch(var(--mod-l) var(--mod-c) 170); }
.pc-mix .pcard-icon { background: oklch(var(--mod-soft-l) 0.06 345); color: oklch(var(--mod-l) var(--mod-c) 345); }
.pc-lex .pcard-icon { background: oklch(var(--mod-soft-l) 0.06 305); color: oklch(var(--mod-l) var(--mod-c) 305); }
.pc-write .pcard-icon { background: oklch(var(--mod-soft-l) 0.06 95); color: oklch(var(--mod-l) var(--mod-c) 95); }
.pc-review { grid-column: 1 / -1; background: linear-gradient(135deg, var(--signal-soft), var(--surface) 70%); }
.pcard.is-disabled { opacity: .75; }

/* Défi éclair */
.blitz { min-height: 100dvh; display: flex; flex-direction: column; max-width: 620px; margin: 0 auto; transition: background .2s; }
.blitz-hurt { background: var(--bad-soft); }
.blitz-intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 10px var(--gutter) 40px; }
.blitz-record { display: inline-flex; align-items: center; gap: 6px; background: var(--voice-soft); padding: 6px 14px; border-radius: 99px; }
.deck-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; width: 100%; }
.deck { text-align: left; padding: 14px; border-radius: var(--r-m); background: var(--surface); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line); display: flex; flex-direction: column; gap: 2px; }
.deck span { font-size: 0.85rem; color: var(--muted); }
.deck:hover { border-color: var(--voice); }
.deck-all { grid-column: 1 / -1; background: var(--voice); border-color: var(--voice); box-shadow: 0 3px 0 color-mix(in oklch, var(--voice) 60%, black); color: var(--voice-ink); }
.deck-all span { color: var(--voice-ink); opacity: .8; }
.blitz-top .progress-fill { width: 100%; background: linear-gradient(90deg, var(--voice), var(--signal)); transition: none; }
.blitz-hurry .progress-fill { background: var(--bad); }
.blitz-scorebox { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); }
.blitz-score { font-size: 1.6rem; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.blitz-streak { display: inline-flex; align-items: center; color: oklch(0.68 0.19 45); font-weight: 800; }
.blitz-play { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 10px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 20px); }
.blitz-deck { text-align: center; }
.blitz-stage { flex: 1; min-height: 220px; display: grid; place-items: center; }
.blitz-card {
  width: 100%; max-width: 440px; min-height: 180px; padding: 26px; border-radius: 26px; display: grid; place-items: center; text-align: center;
  background: var(--surface); box-shadow: var(--shadow-lift); font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; line-height: 1.3;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; animation: pop .25s cubic-bezier(.2,1.2,.4,1); transition: transform .2s, opacity .2s;
}
.blitz-card.is-drag { transition: none; cursor: grabbing; }
.blitz-card.fly-left { transform: translateX(-120%) rotate(-14deg); opacity: 0; }
.blitz-card.fly-right { transform: translateX(120%) rotate(14deg); opacity: 0; }
.blitz-card.is-wrong { background: var(--bad-soft); color: var(--bad); animation: shake .4s; }
.blitz-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.blitz-btn { min-height: 70px; border-radius: 18px; border: 0; font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; line-height: 1.2; transition: transform .08s; }
.blitz-btn:active { transform: translateY(2px); }
.blitz-left { background: var(--signal); color: var(--signal-ink); box-shadow: 0 4px 0 color-mix(in oklch, var(--signal) 60%, black); }
.blitz-right { background: var(--voice); color: var(--voice-ink); box-shadow: 0 4px 0 color-mix(in oklch, var(--voice) 60%, black); }
.blitz-errors { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.blitz-errors li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.blitz-errors li:last-child { border-bottom: 0; }
.blitz-errors strong { color: color-mix(in oklch, var(--good) 80%, var(--ink)); white-space: nowrap; }

/* Lexique & cartes */
.search-row { display: flex; gap: 10px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); color: var(--muted); }
.search:focus-within { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.search-input { flex: 1; border: 0; background: transparent; min-height: 46px; outline: none; min-width: 0; color: var(--ink); }
.glossary { margin: 0; display: flex; flex-direction: column; gap: 0; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
.gl-entry { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.gl-entry:last-child { border-bottom: 0; }
.gl-entry dt { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-family: var(--font-display); font-weight: 750; font-size: 1.06rem; }
.gl-entry dd { margin: 4px 0 0; color: var(--muted); line-height: 1.5; }
.gl-mod { font-family: var(--font-body); font-size: 0.75rem; font-weight: 700; text-decoration: none; color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); white-space: nowrap; }
.empty-search { text-align: center; }
.fc-stage { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 10px var(--gutter) 30px; align-items: center; }
.fc-card { --mod-h: 264; position: relative; width: 100%; max-width: 460px; min-height: 280px; border: 0; padding: 0; background: none; perspective: 1200px; }
.fc-face {
  position: absolute; inset: 0; border-radius: 26px; padding: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .5s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lift);
}
.fc-front { background: var(--surface); border-top: 6px solid oklch(var(--mod-l) var(--mod-c) var(--mod-h)); }
.fc-back { background: oklch(var(--mod-soft-l) 0.04 var(--mod-h)); transform: rotateY(180deg); color: var(--ink); line-height: 1.5; }
.fc-back strong { font-family: var(--font-display); font-size: 1.2rem; }
.fc-term { font-family: var(--font-display); font-size: 1.8rem; line-height: 1.15; }
.fc-card.is-flipped .fc-front { transform: rotateY(-180deg); }
.fc-card.is-flipped .fc-back { transform: none; }
.fc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 460px; }

/* Outils */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
.tool-card, .challenge-link, .doc-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); min-width: 0; }
.tool-card { align-items: flex-start; }
.tool-card:hover, .doc-row:hover, .challenge-link:hover { box-shadow: var(--shadow-lift); }
.tool-icon { width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--signal-soft); color: var(--signal); }
.tool-icon.small { width: 34px; height: 34px; border-radius: 11px; }
.tool-icon.big { width: 58px; height: 58px; border-radius: 18px; background: var(--signal); color: var(--signal-ink); }
.tool-icon.big .icon { width: 28px; height: 28px; }
.tool-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-text span { font-size: 0.88rem; color: var(--muted); line-height: 1.4; }
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-text { display: flex; flex-direction: column; min-width: 0; }
.reflex { background: linear-gradient(135deg, var(--voice-soft), var(--surface) 75%); border-radius: var(--r-l); padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); align-items: flex-start; }
.reflex .tool-icon { background: var(--voice); color: var(--voice-ink); }
.reflex-head { display: flex; gap: 12px; align-items: center; }
.reflex-cols { display: grid; gap: 14px; width: 100%; }
@media (min-width: 640px) { .reflex-cols { grid-template-columns: 1.6fr 1fr 1fr; } }
.reflex-cols ol, .reflex-cols ul { margin: 6px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 5px; font-size: 0.93rem; }
.reflex-step { font-family: var(--font-display); font-size: 1rem; }
.tool-head { flex-direction: row; gap: 16px; align-items: flex-start; }
.tool-head > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.tool-layout { display: grid; gap: 18px; }
@media (min-width: 820px) { .tool-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); align-items: start; } .tool-side { position: sticky; top: 20px; } }
.tool-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: 0.92rem; }
.choice.is-selected { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.tool-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.preview-card, .checks-card { background: var(--surface); border-radius: var(--r-m); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tool-preview { margin: 0; white-space: pre-wrap; word-wrap: break-word; font-family: var(--font-body); font-size: 0.95rem; line-height: 1.5; color: var(--ink); }
.tool-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.tool-checks li { display: flex; gap: 8px; align-items: flex-start; }
.tool-checks .is-ok { color: color-mix(in oklch, var(--good) 75%, var(--ink)); }
.tool-checks .is-todo { color: var(--muted); }
.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.challenge-progress { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--muted); }
.challenge-progress .mini-bar { width: 140px; --mod-h: 155; }
.challenge-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.challenge { background: var(--surface); border-radius: var(--r-l); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.challenge.is-done { background: linear-gradient(135deg, var(--good-soft), var(--surface) 70%); }
.challenge-head { display: flex; gap: 12px; align-items: center; }
.challenge-head > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.challenge-head strong { font-family: var(--font-display); font-size: 1.08rem; }
.challenge-check { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.is-done .challenge-check { background: var(--good); color: oklch(1 0 0); }
.challenge-links { display: flex; flex-wrap: wrap; gap: 6px; }
.challenge-note { width: 100%; }
.challenge-note summary { cursor: pointer; font-weight: 700; color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }

/* Profil */
.profile-head { display: flex; gap: 16px; align-items: center; }
.profile-head > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.heatmap { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; max-width: 520px; }
.hm-cell { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--surface-2); max-width: 100%; }
.hm-cell.is-pad { background: transparent; }
.hm-cell.l1 { background: color-mix(in oklch, var(--signal) 30%, var(--surface-2)); }
.hm-cell.l2 { background: color-mix(in oklch, var(--signal) 62%, var(--surface-2)); }
.hm-cell.l3 { background: var(--signal); }
.hm-legend { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--muted); }
.hm-legend .hm-cell { width: 12px; height: 12px; }
.module-bars { display: flex; flex-direction: column; gap: 10px; }
.module-bar { display: grid; grid-template-columns: minmax(0, 1fr) 90px 62px; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 0.93rem; }
.module-bar .mini-bar { width: 100%; }
.module-bar-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.module-bar-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-dot { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; background: oklch(var(--mod-soft-l) 0.05 var(--mod-h)); color: oklch(var(--mod-l) var(--mod-c) var(--mod-h)); }
.module-dot .icon { width: 15px; height: 15px; }
.module-bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; display: inline-flex; justify-content: flex-end; gap: 4px; align-items: center; }
.trophy-mini { color: var(--voice); width: 16px; height: 16px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px; border-radius: var(--r-m); background: var(--surface-2); color: var(--muted); }
.badge strong { color: var(--ink); font-size: 0.9rem; line-height: 1.25; }
.badge span:last-child { font-size: 0.76rem; line-height: 1.3; }
.badge:not(.is-got) { opacity: .7; }
.badge-medal { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--muted); flex: none; }
.badge.is-got { background: var(--voice-soft); }
.badge.is-got .badge-medal, .badge-won .badge-medal { background: conic-gradient(from 200deg, var(--voice), oklch(0.88 0.12 90), var(--voice)); color: var(--voice-ink); box-shadow: 0 3px 0 color-mix(in oklch, var(--voice) 60%, black); }
.settings .field { gap: 8px; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 14px; }
.segmented button { flex: 1 1 auto; border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; font-weight: 700; font-size: 0.88rem; color: var(--muted); }
.segmented button.is-selected { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle-text { display: flex; flex-direction: column; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-ui { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .2s; pointer-events: none; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: oklch(1 0 0); box-shadow: 0 1px 3px oklch(0 0 0 / .3); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--signal); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid color-mix(in oklch, var(--signal) 60%, transparent); outline-offset: 2px; }
.install-box:empty { display: none; }
.install { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-m); background: var(--signal-soft); flex-wrap: wrap; }
.install > div { flex: 1 1 200px; min-width: 0; }
.profile-links { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 15px 18px; text-decoration: none; color: var(--ink); border: 0; background: none; border-bottom: 1px solid var(--line); font-weight: 600; text-align: left; width: 100%; }
.link-row:last-child { border-bottom: 0; }
.link-row span { flex: 1; }
.link-row .icon:first-child { color: var(--signal); }
.link-row .icon:last-child { color: var(--muted); }
.ev-legend { display: flex; flex-direction: column; gap: 10px; }
.ev-item { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ev-item span:last-child { color: var(--muted); font-size: 0.92rem; }

/* Accueil (premier lancement) */
.onboarding { position: fixed; inset: 0; z-index: 70; background: var(--paper); overflow: auto; animation: fbIn .3s; }
.onboarding.out { opacity: 0; transition: opacity .25s; }
.onb-inner { min-height: 100%; max-width: 520px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 32px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 24px); display: flex; flex-direction: column; gap: 28px; }
.onb-content { flex: 1; display: flex; flex-direction: column; gap: 14px; justify-content: center; animation: exIn .35s; }
.onb-content .display { font-size: var(--step-4); }
.onb-art { max-width: 320px; }
.art rect, .art path:not(.art-wave) { stroke: none; }
.art-a rect:first-child, .art-a path { fill: var(--signal); }
.art-b rect:first-child, .art-b path { fill: var(--voice); }
.art-line { fill: oklch(1 0 0 / 0.75); }
.art-b .art-line { fill: oklch(0.3 0.06 60 / 0.5); }
.art-wave { stroke: var(--muted); }
.art-a { animation: floatA 4s ease-in-out infinite; }
.art-b { animation: floatA 4s ease-in-out 2s infinite; }
@keyframes floatA { 50% { transform: translateY(-6px); } }
.onb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.onb-list li { display: flex; gap: 14px; align-items: flex-start; }
.onb-list li > div { display: flex; flex-direction: column; }
.onb-list li span:last-child { color: var(--muted); font-size: 0.93rem; }
.onb-icon { width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--signal-soft); color: var(--signal); }
.goal-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.goal { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); text-align: center; }
.goal span { font-size: 0.78rem; color: var(--muted); }
.goal.is-selected { border-color: var(--signal); background: var(--signal-soft); }
.onb-foot { display: flex; flex-direction: column; gap: 12px; }
.onb-nav { display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.onb-dots { display: flex; gap: 6px; }
.onb-dots span { width: 8px; height: 8px; border-radius: 9px; background: var(--line); transition: width .2s, background .2s; }
.onb-dots span.is-on { width: 24px; background: var(--signal); }

/* Animations réduites */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }

/* Écran de chargement / sans JavaScript */
.boot { min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
html.is-ready .boot { display: none; }
