/* CoachMyStudy — « le carnet et la marge ». Papier, encre, pétrole (voix du coach), surligneur (ce qui compte).
   Un seul fichier, pas de build. Polices hébergées ici (OFL), aucune requête externe. */

@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-italic.woff2") format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("../fonts/atkinson-next.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  --bg: #f7f6f2;
  --surface: #f7f6f2;
  --surface-2: #f2efe7;
  --card: #ffffff;
  --text: #28251d;
  --muted: #5c574b;
  --border: #d9d3c6;
  --border-soft: #e7e2d7;
  --ink: #28251d;
  --hl: #ffd59a;
  --hl-soft: #fff1dc;
  --margin: #e7b8a3;
  --margin-ink: #d9785a;
  --late-ink: #9a3f1f;
  --draft: #ece7db;
  --serif: Fraunces, Georgia, "Times New Roman", serif;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --accent: #01696f;
  --accent-soft: #dceceb;
  --accent-ink: #014f54;
  --on-accent: #fff; /* texte posé sur l’accent */
  --ok-bg: #e6efea; --ok-ink: #1f5c3a;
  --warn-bg: #f8eae2; --warn-ink: #913e27;
  --err-bg: #fff0ee; --err-ink: #9b3131;
  --info-bg: #eef3ef; --info-border: #cadbd5;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(40, 37, 29, .06), 0 14px 32px -24px rgba(40, 37, 29, .35);
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, "Segoe UI", sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #1b1a17;
  --surface: #23221e;
  --surface-2: #26251f;
  --card: #2a2924;
  --text: #f1eee6;
  --muted: #a9a59a;
  --border: #3a3832;
  --border-soft: #33312b;
  --ink: #f1eee6;
  --hl: #8a5a1c;
  --hl-soft: #3a2c17;
  --margin: #7a4a38;
  --margin-ink: #e59a7d;
  --late-ink: #f0b39c;
  --draft: #2f2d27;
  --accent: #4fb3b8;
  --accent-soft: #1f3a3b;
  --accent-ink: #9fdfe2;
  --on-accent: #062a2c; /* l’accent sombre est clair : texte foncé dessus */
  --ok-bg: #1f3328; --ok-ink: #9fd8b3;
  --warn-bg: #3d2a22; --warn-ink: #f0b39c;
  --err-bg: #3f2424; --err-ink: #f2a8a8;
  --info-bg: #23302a; --info-border: #2f4a40;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55;
  color: var(--text); background: var(--bg);
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 40px; letter-spacing: -.025em; line-height: 1.05; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
h4 { font-family: var(--font); font-size: 15px; font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 .8em; }
p.muted, .muted { color: var(--muted); }
small { font-size: 13px; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
.eyebrow { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 17px; font-weight: 400; margin-bottom: 2px; }
.serif { font-family: var(--serif); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.sr-only:focus { position: fixed; left: 12px; top: 12px; width: auto; height: auto; clip: auto; z-index: 100; background: var(--card); padding: 10px 14px; border-radius: 8px; }

/* Structure */
.topbar {
  display: flex; align-items: center; gap: 28px; padding: 0 max(20px, calc((100vw - 1200px) / 2));
  background: var(--bg); border-bottom: 1px solid var(--border-soft); min-height: 64px;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 21px; text-decoration: none; color: var(--text); }
.brand svg, .brand img { flex-shrink: 0; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 14px; color: var(--muted); }
.mainnav { display: flex; gap: 26px; flex-wrap: wrap; }
.mainnav a { position: relative; isolation: isolate; text-decoration: none; color: var(--muted); padding: 20px 2px; font-size: 15px; font-weight: 700; }
.mainnav a:hover { color: var(--text); }
.mainnav a.active { color: var(--text); }
.mainnav a.active::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: 21px; height: 9px; background: var(--hl); z-index: -1; border-radius: 2px; transform-origin: left; animation: hl-sweep .6s .1s var(--ease-out) both; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 26px; }
.subnav a { text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--border-soft); }
.subnav a:hover { color: var(--text); border-color: var(--border); }
.subnav a.active { color: var(--text); border-color: var(--ink); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
main.page { max-width: 1200px; margin: 40px auto 72px; padding: 0 20px; }
main.page.narrow { max-width: 560px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }

/* Cartes */
.card {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card.soft { background: var(--surface-2); box-shadow: none; border-color: transparent; }
.card > .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card > .card-head h2, .card > .card-head h3 { margin: 0; }
.stat { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--card); }
.stat span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stat strong { font-size: 22px; font-weight: 650; }
.stat strong.accent { color: var(--accent); }

/* Formulaires */
form { margin: 0; }
label, .label { display: block; font-size: 14px; color: var(--text); font-weight: 500; }
label + label, .field + .field { margin-top: 14px; }
.field { margin-bottom: 14px; }
.field .hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  display: block; width: 100%; margin-top: 6px; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 8px; font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0 8px 0 0; vertical-align: middle; accent-color: var(--accent); }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.check input { margin-top: 3px; flex-shrink: 0; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-pair > .field + .field, .grid > .field + .field { margin-top: 0; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.invalid { color: var(--err-ink); font-size: 13px; margin-top: 5px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err-ink); }

/* Boutons */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid transparent; border-radius: 10px; padding: 11px 20px; min-height: 46px;
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-ink); }
.btn:active { transform: scale(.97); }
.btn.quiet { background: transparent; color: var(--text); border-color: var(--border); }
.btn.quiet:hover { border-color: var(--ink); background: transparent; }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--border-soft); }
.btn.ghost { background: transparent; color: var(--accent); padding: 8px 10px; min-height: 36px; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: transparent; color: var(--err-ink); border-color: var(--border); }
.btn.sm { padding: 6px 10px; min-height: 34px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Badges et états */
.badge { display: inline-block; padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-soft); }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.badge.err { background: var(--err-bg); color: var(--err-ink); border-color: transparent; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.alert { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--info-border); background: var(--info-bg); margin-bottom: 16px; }
.alert.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok-ink); }
.alert.err { background: var(--err-bg); border-color: transparent; color: var(--err-ink); }
.alert.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn-ink); }
.alert p:last-child { margin: 0; }
.empty { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 30px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 6px; }

/* Listes de travail */
.list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); }
.list-row { display: flex; align-items: flex-start; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border-soft); }
.list-row:last-child { border-bottom: 0; }
.list-row.done { opacity: .6; }
.date-chip { min-width: 52px; text-align: center; padding: 8px 6px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.date-chip strong { display: block; font-size: 20px; line-height: 1; }
.date-chip small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
.date-chip.late { background: var(--warn-bg); border-color: transparent; color: var(--warn-ink); }
.date-chip.today { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.list-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list-main .title { font-weight: 600; }
.list-main .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; margin-top: 4px; }
.list-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* Priorités du cockpit */
.priority { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); }
.priority .rank { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.priority .why { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Emploi du temps et planning */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week.school { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.day { border-top: 1.5px solid var(--ink); background: transparent; padding: 10px 2px; min-height: 200px; min-width: 0; }
.day.today { background: var(--card); border-radius: 0 0 12px 12px; padding: 10px 8px; }
.day.today h3 { color: var(--accent); }
.day h3 { font-size: 16px; margin: 0 0 8px; }
.day h3 small { display: block; font-weight: 400; color: var(--muted); }
.slot, .session, .deadline { border-radius: 8px; padding: 8px 9px; margin-top: 8px; font-size: 13px; line-height: 1.35; background: var(--draft); border: 0; box-shadow: inset 3px 0 0 var(--slot-color, var(--accent)); overflow-wrap: anywhere; }
.session { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--accent); border-style: dashed; }
input[type="file"] { font-size: 14px; padding: 8px !important; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 700; border: 1.5px solid var(--border); background: var(--card); color: var(--text); border-radius: 8px; padding: 8px 12px; margin-right: 10px; cursor: pointer; }
.slot small, .session small, .deadline small { display: block; color: var(--muted); }
.deadline { background: var(--ok-bg); border-left-color: var(--ok-ink); }

/* Tableaux */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.table-wrap { overflow-x: auto; }

/* Onglets secondaires */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a, .tabs button { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--muted); background: transparent; border: 1px solid transparent; font: inherit; cursor: pointer; }
.tabs .active { color: var(--accent); background: var(--accent-soft); }

/* Auth */
.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card h1 { font-size: 24px; }

/* Navigation mobile */
.bottomnav { display: none; }
@media (min-width: 761px) { .only-mobile { display: none !important; } }
@media (max-width: 760px) {
  .mainnav { display: none; }
  .topbar { padding: 12px 16px; }
  .topbar .who { display: none; }
  main.page { margin: 18px auto 84px; padding: 0 14px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .form-pair { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  h1 { font-size: 24px; }
  .week, .week.school { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .list-row { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .list-side { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: 11px; padding: 6px 2px; border-radius: 8px; }
  .bottomnav a .ico { display: block; margin: 0 auto 3px; }
  .bottomnav a { font-weight: 700; }
  .topbar { gap: 12px; }
  .bottomnav a.active { color: var(--accent); background: var(--accent-soft); }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .week.school { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media print {
  .topbar, .mainnav, .bottomnav, .btn, form { display: none !important; }
  main.page { margin: 0; max-width: none; }
}

/* Coach IA (lot 2) */
main.page.narrow-wide { max-width: 820px; }
.postures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.posture { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; font-weight: 400; background: var(--card); }
.posture input { margin: 0 6px 0 0; }
.posture strong { font-size: 14px; }
.posture small { display: block; color: var(--muted); margin-top: 3px; font-size: 12.5px; }
.posture:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.conv { display: block; text-decoration: none; color: var(--text); padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.conv strong { display: block; font-weight: 550; }
.conv small { display: block; }
.conv:hover strong { color: var(--accent); }
.chat { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.msg { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; background: var(--card); max-width: 92%; min-width: 0; overflow-wrap: break-word; }
.msg.user, .msg .body a { overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.msg.assistant { align-self: flex-start; }
.msg header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.msg .body > :last-child, .artifact .body > :last-child { margin-bottom: 0; }
.msg .body h3, .artifact .body h3 { font-size: 15px; margin-top: 12px; }
.msg .body pre, .artifact .body pre { overflow-x: auto; background: var(--surface-2); padding: 10px; border-radius: 6px; }
.msg .attachment img { max-width: 260px; max-height: 260px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.artifact { margin-top: 12px; border: 1px solid var(--accent-soft); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); }
.artifact .body { margin-top: 8px; }
.artifact details, .artifact-card details { margin-top: 8px; }
.artifact summary, .artifact-card details summary { cursor: pointer; color: var(--accent); font-weight: 550; }
.artifact-card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.artifact-card > summary::-webkit-details-marker { display: none; }
.artifact-card .body { margin-top: 12px; }
.mistake-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.mistake-note .badge { margin-left: 4px; }
.reply textarea { min-height: 72px; }
@media (max-width: 760px) {
  .postures { grid-template-columns: 1fr; }
  .msg { max-width: 100%; }
}

/* Formules (KaTeX) : une formule longue défile au lieu de déborder sur mobile */
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
/* Sur téléphone, les formules en bloc un peu plus petites : moins de défilement horizontal, toujours lisibles. */
@media (max-width: 480px) { .katex-display > .katex { font-size: 1.02em; } }

/* ===== Carnet et marge : gestes ===== */
@keyframes hl-sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ink-draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes pulse-soft { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.ink { stroke-dasharray: 1; stroke-dashoffset: var(--len, 1); animation: ink-draw 1.5s cubic-bezier(.4, 0, .2, 1) forwards; }
.ink.d2 { animation-delay: .3s; } .ink.d3 { animation-delay: .6s; } .ink.d4 { animation-delay: .9s; }
.rise { animation: rise .55s var(--ease-out) both; }
.rise.r2 { animation-delay: .1s; } .rise.r3 { animation-delay: .2s; } .rise.r4 { animation-delay: .3s; } .rise.r5 { animation-delay: .4s; }
.pop { animation: pop .5s cubic-bezier(.2, .8, .2, 1.2) both; }
/* Surligneur : un fond découpé ligne par ligne, qui balaie de gauche à droite (marche aussi sur plusieurs lignes). */
.mark { background-image: linear-gradient(transparent 54%, var(--hl) 54%, var(--hl) 92%, transparent 92%); background-repeat: no-repeat; background-size: 0% 100%; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 3px; margin: 0 -3px; }
@keyframes hl-bg { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
.mark.on, .done-flash .mark { background-size: 100% 100%; animation: hl-bg .6s var(--ease-out) both; }
.hl-text { background: linear-gradient(transparent 55%, var(--hl) 55%, var(--hl) 92%, transparent 92%); }

/* La marge du coach */
.notebook { display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.notebook > .sheet { padding-right: 56px; min-width: 0; }
.notebook > .margin { border-left: 2px solid var(--margin); padding-left: 36px; min-width: 0; }
.coach-sign { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--accent); }
.coach-voice { font-family: var(--serif); font-style: italic; font-size: 23px; line-height: 1.4; color: var(--accent-ink); margin: 10px 0 0; }
.coach-voice.write { animation: write 1.6s .4s steps(40) both; }
.coach-aside { border-left: 2px solid var(--margin); padding-left: 16px; }
.illus { display: block; max-width: 100%; height: auto; color: var(--ink); }
.illus .hlf { fill: var(--hl); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; color: var(--text); background: transparent; border: 1.5px solid var(--border); border-radius: 999px; padding: 9px 14px; cursor: pointer; min-height: 40px; transition: border-color .2s ease; }
.chip:hover, .chip.on { border-color: var(--ink); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.chip { position: relative; display: inline-flex; align-items: center; margin: 0 !important; line-height: 1.2; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.line-input { font: inherit; font-size: 17px; width: 100%; border: 0 !important; border-bottom: 1.5px solid var(--ink) !important; border-radius: 0 !important; background: transparent !important; padding: 12px 2px !important; }
.label-strong { font-size: 14px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }

/* Aujourd'hui */
.today-hello { font-size: 64px; }
.focus-title { font-size: 36px; line-height: 1.15; margin: 0; }
.focus-why { font-size: 18px; line-height: 1.55; color: var(--text); margin: 14px 0 0; max-width: 620px; }
.next-row { display: flex; align-items: baseline; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.next-row .t { font-size: 18px; font-weight: 700; flex: 1 1 240px; min-width: 0; color: var(--text); text-decoration: none; }
.next-row .late { color: var(--late-ink); font-weight: 700; font-size: 15px; }
.weekline { display: flex; border-top: 1.5px solid var(--ink); margin-top: 10px; }
.weekline .d { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px; position: relative; text-align: center; }
.weekline .d small { color: var(--muted); }
.weekline .d .n { font-family: var(--serif); font-size: 22px; line-height: 1; position: relative; }
.weekline .d.today { background: var(--card); border-radius: 0 0 10px 10px; }
.weekline .d.today small { color: var(--text); font-weight: 700; }
.weekline .d .tag { font-size: 12px; font-weight: 700; color: var(--accent); }
.weekline .d .tag.exam { color: var(--late-ink); }
.weekline .d .circle { position: absolute; left: 50%; top: 50%; width: 52px; height: 42px; transform: translate(-50%, -50%); pointer-events: none; }
.weekline .dots { display: flex; gap: 3px; min-height: 6px; }
.weekline .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: block; }
.carnet { display: flex; gap: 6px; flex-wrap: wrap; max-width: 340px; }
.carnet span { width: 22px; height: 22px; border: 1.5px solid var(--border); border-radius: 4px; display: block; }
.carnet .c { background: var(--accent); border-color: var(--accent); }
.carnet .w { border-color: var(--ink); }
.carnet .f { background: repeating-linear-gradient(-45deg, var(--hl) 0 4px, var(--hl-soft) 4px 8px); border-color: #e0a24d; animation: pulse-soft 2.6s ease-in-out infinite; }
.stat-line { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 10px; }
.stat-line a, .stat-line div { text-decoration: none; color: var(--text); }
.stat-line strong { font-family: var(--serif); font-size: 30px; font-weight: 600; display: block; line-height: 1.1; }
.stat-line span { font-size: 14px; color: var(--muted); }
.empty-illus { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 8px 0; }
.empty-illus p { margin: 0; max-width: 460px; }
.empty-illus.is-quiet .illus { display: none; }
.empty-illus.is-quiet p { font-size: 15px; color: var(--muted); }

/* Coach : conversation */
.thread { display: flex; flex-direction: column; gap: 26px; margin-bottom: 24px; }
.bubble-me { align-self: flex-end; max-width: 80%; background: var(--draft); border-radius: 18px 18px 4px 18px; padding: 12px 16px; overflow-wrap: anywhere; }
.coach-answer, .coach-answer.msg { border: 0; border-left: 2px solid var(--margin); border-radius: 0; background: transparent; padding: 0 0 0 20px; max-width: 760px; }
.bubble-me.msg { border: 0; background: var(--draft); padding: 12px 16px; border-radius: 18px 18px 4px 18px; }
.coach-answer .coach-sign { flex-wrap: wrap; row-gap: 2px; }
.thread-title { font-size: 34px; }
.coach-answer .body { font-size: 17px; line-height: 1.65; }
.coach-answer .body h3, .coach-answer .body h2 { font-family: var(--serif); font-size: 21px; margin: 18px 0 6px; }
.coach-answer .body table { font-size: 15px; }
.coach-answer .body th { text-transform: none; letter-spacing: 0; font-size: 14px; }
.coach-answer .body ol > li::marker { font-family: var(--serif); color: var(--margin-ink); font-weight: 600; }
.coach-answer .body hr { border: 0; border-top: 1px dashed var(--border); margin: 18px 0; }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0 16px; border-top: 1px solid var(--border-soft); z-index: 5; }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { min-height: 52px; margin: 0; border-radius: 14px; border: 1.5px solid var(--border); font-size: 16px; }
.icon-btn { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; border: 1.5px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; flex-shrink: 0; }
.icon-btn input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ask-hero { font-family: var(--serif); font-size: 24px !important; min-height: 120px !important; border: 0 !important; border-bottom: 1.5px solid var(--ink) !important; border-radius: 0 !important; background: transparent !important; padding: 8px 2px !important; }
.production { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }

/* Parent : lecture */
.child-read { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px; padding: 34px 0; border-top: 1.5px solid var(--ink); }
.child-read .who-big { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--hl); font-family: var(--serif); font-size: 32px; font-weight: 600; color: var(--text); }
.child-read:nth-of-type(2n) .who-big { background: var(--accent-soft); color: var(--accent-ink); }
.child-read .lede { font-size: 19px; line-height: 1.55; margin: 0; }
.daydots { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 18px; }
.daydots .d { width: 32px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.daydots .d i { width: 16px; height: 16px; border-radius: 50%; display: block; border: 1.5px dashed #a59f91; }
.daydots .d i.w { background: var(--accent); border: 0; }
.daydots .d i.f { border: 2px solid var(--ink); }
.talk { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); font-size: 16px; }
.talk b { font-family: var(--serif); color: var(--margin-ink); }

/* Agenda : relier */
.sync-panel { background: var(--card); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.seg { display: flex; background: var(--draft); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.seg a { flex: 1; text-align: center; text-decoration: none; font-weight: 700; font-size: 15px; padding: 11px 6px; border-radius: 9px; color: var(--muted); }
.seg a.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(40, 37, 29, .15); }
.dropzone { border: 2px dashed var(--border); border-radius: 14px; padding: 22px 16px; text-align: center; }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field input { margin: 0; font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--surface-2); }

@media (max-width: 980px) {
  .notebook { grid-template-columns: minmax(0, 1fr); }
  .notebook > .sheet { padding-right: 0; }
  .notebook > .margin { border-left: 0; border-top: 2px solid var(--margin); padding: 26px 0 0; margin-top: 36px; }
  .child-read { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
/* ===== Lot 1 : résultats, devoirs, matières ===== */
.big-number { font-family: var(--serif); font-size: 76px; font-weight: 600; line-height: 1; letter-spacing: -.03em; margin: 4px 0 8px; }
.big-number small { font-size: 26px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.results-hero { display: grid; grid-template-columns: minmax(200px, auto) minmax(240px, 1fr); gap: 48px; align-items: end; padding-bottom: 22px; }
.how { border-bottom: 1.5px solid var(--ink); padding-bottom: 14px; }
.how summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--muted); }
.how p { font-size: 14px; color: var(--muted); margin: 8px 0 0; max-width: 640px; }
.sl-avg.none { font-size: 14px; color: var(--muted); font-weight: 400; }
.no-grades { margin: 18px 0 0; font-size: 15px; color: var(--muted); line-height: 1.6; }
.no-grades strong { color: var(--text); }
.scale20 { width: 100%; padding-bottom: 4px; }
.scale20-track { position: relative; height: 14px; background: var(--draft); border-radius: 999px; }
.scale20-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--hl-soft), var(--hl)); border-radius: 999px; transform-origin: left; animation: hl-sweep .9s .3s var(--ease-out) both; }
.scale20-ten { position: absolute; top: -6px; bottom: -6px; border-left: 1.5px dashed var(--muted); opacity: .5; }
.scale20-me { position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--accent); border: 4px solid var(--bg); box-shadow: 0 2px 8px rgba(1, 105, 111, .35); animation: pop .5s .9s cubic-bezier(.2, .8, .2, 1.4) both; }
.scale20-class { position: absolute; top: -10px; bottom: -10px; border-left: 2px solid var(--ink); }
.scale20-class small { position: absolute; top: -20px; left: -18px; font-size: 12px; color: var(--muted); font-weight: 700; }
.scale20-ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.attention { margin-top: 22px; }
.chip .dot { margin-right: 8px; }
.subject-line { border-bottom: 1px solid var(--border-soft); }
.subject-line > summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1.2fr) 180px 92px 110px; gap: 18px; align-items: center; padding: 16px 6px 16px 18px; cursor: pointer; position: relative; border-radius: 10px; transition: background .2s ease; }
.subject-line > summary::-webkit-details-marker { display: none; }
.subject-line > summary::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--subject); }
.subject-line > summary:hover { background: var(--surface-2); }
.subject-line[open] > summary { background: var(--surface-2); }
.sl-name { min-width: 0; font-size: 17px; }
.sl-avg { font-size: 22px; font-weight: 600; text-align: right; white-space: nowrap; }
.sl-body { padding: 4px 18px 18px; animation: rise .35s var(--ease-out) both; }
.trend { font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.trend.up { color: var(--accent); }
.trend.down { color: var(--late-ink); }
.spark { display: block; color: var(--text); overflow: visible; }
.inline-edit { position: relative; }

.week-progress { margin-top: 18px; max-width: 560px; }
.wp-bar { height: 12px; border-radius: 999px; background: var(--draft); overflow: hidden; }
.wp-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s var(--ease-out); }
.late-link { color: var(--late-ink); font-weight: 700; }
.task-group { margin-top: 30px; }
.tg-title { font-size: 21px; margin: 0 0 6px; display: flex; align-items: baseline; gap: 10px; }
.tg-title small { font-family: var(--font); font-size: 14px; color: var(--muted); font-weight: 700; }
.tg-title.late { color: var(--late-ink); }
.task-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 4px 16px 0; border-bottom: 1px solid var(--border-soft); position: relative; transition: opacity .3s ease, transform .3s ease, max-height .45s var(--ease-out), padding .45s var(--ease-out); max-height: 400px; }
.task-row::before { content: ""; position: absolute; left: -14px; top: 18px; width: 4px; height: 26px; border-radius: 4px; background: var(--subject); }
.task-row form { margin: 0; }
.tick { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--border); cursor: pointer; border-radius: 50%; padding: 0; transition: transform .15s ease, color .2s ease; }
.tick:hover { color: var(--accent); }
.tick:active { transform: scale(.88); }
.tick circle { transition: fill .25s ease, stroke .25s ease; }
.tick .tick-check { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .35s .1s var(--ease-out); }
.task-row.is-done .tick, .tick.on { color: var(--accent); }
.task-row.is-done .tick circle, .tick.on circle { fill: var(--accent); stroke: var(--accent); }
.task-row.is-done .tick .tick-check, .tick.on .tick-check { stroke-dashoffset: 0; }
.task-row.is-done .task-title .mark { background-size: 100% 100%; animation: hl-bg .55s .15s var(--ease-out) both; }
.task-row.is-late .tick { color: var(--late-ink); }
.task-row.leaving { opacity: 0; transform: translateX(14px); max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; border-bottom-color: transparent; }
.task-title { margin: 6px 0 0; font-size: 18px; font-weight: 700; line-height: 1.35; }
.task-meta { margin: 4px 0 0; display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.task-meta .subj { color: var(--text); }
.exam-pill { color: var(--late-ink); font-weight: 700; }
.prio { color: var(--late-ink); }
.task-notes { margin: 8px 0 0; font-size: 14px; color: var(--muted); white-space: pre-wrap; max-width: 640px; }
.task-side { display: flex; align-items: center; gap: 4px; padding-top: 6px; }
.due { font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.due.today { color: var(--accent); }
.due.late { color: var(--late-ink); }
.margin .next-row { flex-wrap: nowrap; gap: 12px; }
.margin .next-row .t { flex: 1 1 0; }
.countdown { margin-left: 8px; padding: 3px 8px; border-radius: 999px; background: var(--hl); color: #28251d; font-size: 12px; }
.row-menu { position: relative; }
.row-menu > summary { list-style: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; color: var(--muted); }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover, .row-menu[open] > summary { background: var(--surface-2); color: var(--text); }
.row-menu-pop { position: absolute; right: 0; top: 44px; z-index: 15; min-width: 230px; background: var(--card); border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; animation: pop .22s var(--ease-out) both; }
.row-menu-pop a, .row-menu-pop button { display: block; width: 100%; text-align: left; font: inherit; font-size: 15px; font-weight: 600; color: var(--text); background: transparent; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.row-menu-pop a:hover, .row-menu-pop button:hover { background: var(--surface-2); }
.row-menu-pop .danger-link { color: var(--err-ink); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--bg); padding: 12px 14px 12px 20px; border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .5); font-weight: 700; animation: pop .35s cubic-bezier(.2, .8, .2, 1.2) both; }
.toast .btn.ghost { color: var(--hl); }
.toast[hidden] { display: none; }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; margin-top: 30px; }
.notebook-cover { position: relative; display: flex; min-height: 196px; text-decoration: none; color: var(--text); background: var(--card); border-radius: 6px 16px 16px 6px; box-shadow: var(--shadow); overflow: hidden; transition: transform .25s var(--ease-out), box-shadow .25s ease; }
.notebook-cover:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 1px 0 rgba(40, 37, 29, .06), 0 22px 40px -22px rgba(40, 37, 29, .45); }
.notebook-cover:active { transform: translateY(-1px) scale(.99); }
.nc-spine { width: 16px; flex-shrink: 0; background: var(--subject); box-shadow: inset -3px 0 0 rgba(0, 0, 0, .12); }
.nc-body { flex: 1; min-width: 0; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; background-image: repeating-linear-gradient(transparent 0 27px, var(--border-soft) 27px 28px); background-position: 0 14px; }
.nc-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.nc-head strong { font-size: 21px; line-height: 1.15; }
.nc-tag { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.nc-current { font-size: 14px; color: var(--muted); font-style: italic; font-family: var(--serif); }
.carnet.mini { gap: 4px; }
.carnet.mini span { width: 14px; height: 14px; border-radius: 3px; }
.nc-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; gap: 8px; }
.nc-foot b { color: var(--late-ink); }
.nc-avg { font-size: 24px; font-weight: 600; }
.notebook-cover.add { flex-direction: column; background: transparent; border: 2px dashed var(--border); box-shadow: none; }
.notebook-cover.add > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 196px; font-weight: 700; color: var(--muted); }
.notebook-cover.add[open] > summary { min-height: 0; padding: 18px; }
.nc-plus { font-family: var(--serif); font-size: 40px; line-height: 1; }

.subject-head { position: relative; padding-left: 22px; }
.subject-head::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 8px; border-radius: 4px; background: var(--subject); }
.notion-meter { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 3px; margin-top: 18px; max-width: 560px; }
.notion-meter span { display: block; }
.notion-meter .c { background: var(--accent); }
.nm-cap { margin: 6px 0 0; font-size: 13px; opacity: .85; }
.notion-meter .w { background: var(--ink); opacity: .55; }
.notion-meter .f { background: repeating-linear-gradient(-45deg, var(--hl) 0 4px, var(--hl-soft) 4px 8px); }
.notion-meter .n { background: var(--draft); }
.chapters { list-style: none; margin: 0; padding: 0 0 0 30px; position: relative; }
.chapters::before { content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 2px; background: var(--border); }
.chapter { position: relative; padding: 0 0 26px; }
.ch-node { position: absolute; left: -30px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px dashed var(--border); }
.chapter.is-done .ch-node { background: var(--ink); border: 2px solid var(--ink); }
.chapter.is-in_progress .ch-node { background: var(--accent); border: 4px solid var(--accent-soft); box-shadow: 0 0 0 0 rgba(1, 105, 111, .4); animation: node-pulse 2.4s ease-out infinite; }
@keyframes node-pulse { 0% { box-shadow: 0 0 0 0 rgba(1, 105, 111, .35); } 70% { box-shadow: 0 0 0 12px rgba(1, 105, 111, 0); } 100% { box-shadow: 0 0 0 0 rgba(1, 105, 111, 0); } }
.ch-head { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; position: relative; padding-right: 44px; }
.ch-head .row-menu { position: absolute; right: 0; top: -4px; }
h1, h2, .focus-title { text-wrap: balance; }
.coach-voice, .focus-why, .lede { text-wrap: pretty; }
.ch-title { margin: 0; font-size: 22px; }
.chapter.is-upcoming .ch-title { color: var(--muted); }
.ch-status { font-size: 13px; font-weight: 700; color: var(--muted); }
.chapter.is-in_progress .ch-status { color: var(--accent); }
.notions { list-style: none; margin: 10px 0 0; padding: 0; }
.notion { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.notion-title { flex: 1 1 200px; min-width: 0; font-size: 16px; }
.notion.add { border-top: 0; }
.notion-picker { display: inline-flex; background: var(--draft); border-radius: 999px; padding: 3px; gap: 2px; }
.notion-picker button { font: inherit; font-size: 13px; font-weight: 700; border: 0; background: transparent; color: var(--muted); padding: 7px 11px; border-radius: 999px; cursor: pointer; min-height: 34px; transition: background .2s ease, color .2s ease, transform .12s ease; }
.notion-picker button:hover { color: var(--text); }
.notion-picker button:active { transform: scale(.94); }
.notion-picker button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(40, 37, 29, .18); }
.notion-picker .np-fragile[aria-pressed="true"] { background: var(--hl); color: #28251d; }
.notion-picker .np-consolidated[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.notion-picker.saving { opacity: .7; }

@media (max-width: 760px) {
  .results-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .big-number { font-size: 60px; }
  .subject-line > summary { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name avg" "spark trend"; row-gap: 6px; }
  .sl-name { grid-area: name; } .sl-avg { grid-area: avg; } .sl-spark { grid-area: spark; } .sl-trend { grid-area: trend; text-align: right; }
  .task-row { grid-template-columns: 44px minmax(0, 1fr); }
  .task-side { grid-column: 2; padding-top: 0; justify-content: space-between; }
  .task-row::before { left: -8px; }
  .chapters { padding-left: 26px; }
  .notion-picker { width: 100%; justify-content: space-between; }
  .notion-picker button { flex: 1; padding: 8px 4px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); width: calc(100% - 32px); justify-content: space-between; }
}

/* ===== Lot 2 : quiz jouable ===== */
.quiz { background: var(--card); border-radius: 18px; padding: 20px 22px 22px; box-shadow: var(--shadow); margin-top: 12px; overflow: hidden; }
.coach-answer .quiz, .production .quiz { box-shadow: none; border: 1.5px solid var(--border-soft); }
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.quiz-dots { display: flex; gap: 6px; }
.quiz-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--draft); display: block; transition: background .3s ease, transform .3s var(--ease-out); }
.quiz-dots i.on { transform: scale(1.35); background: var(--ink); }
.quiz-dots i.good { background: var(--accent); }
.quiz-dots i.bad { background: var(--hl); box-shadow: inset 0 0 0 2px #e0a24d; }
.quiz-prompt { font-family: var(--serif); font-size: 21px; line-height: 1.45; margin-bottom: 16px; }
.quiz-prompt p { margin: 0 0 .5em; }
.quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quiz-opt { position: relative; display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; font-size: 16px; font-weight: 600; color: var(--text); background: var(--bg); border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px; min-height: 58px; cursor: pointer; transition: border-color .2s ease, background .25s ease, transform .15s ease, opacity .25s ease; }
.quiz-opt:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-1px); }
.quiz-opt:active:not(:disabled) { transform: scale(.98); }
.quiz-opt:disabled { cursor: default; }
.qo-letter { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--draft); transition: background .25s ease, color .25s ease; }
.qo-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qo-mark { width: 22px; height: 22px; flex-shrink: 0; }
.quiz-q.answered .quiz-opt:not(.good):not(.bad) { opacity: .5; }
.quiz-opt.good { border-color: var(--accent); background: var(--accent-soft); animation: pop .4s cubic-bezier(.2, .8, .2, 1.3) both; }
.quiz-opt.good .qo-letter { background: var(--accent); color: var(--on-accent); }
.quiz-opt.good .qo-mark { background: no-repeat center / 22px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%2301696f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.quiz-opt.bad { border-color: #c0643f; background: var(--warn-bg); animation: nudge .38s ease both; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 60% { transform: translateX(5px); } }
.quiz-feedback { display: none; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.quiz:not(.ready) .quiz-feedback, .quiz-feedback.shown { display: block; animation: rise .4s var(--ease-out) both; }
.qf-verdict { font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.quiz-q.right .qf-verdict { color: var(--accent); }
.quiz-q.wrong .qf-verdict { color: var(--late-ink); }
.qf-explain { font-size: 16px; line-height: 1.6; }
.qf-explain p:last-child { margin-bottom: 0; }
.quiz-next { margin-top: 16px; }
.quiz-self .btn.chosen { border-color: var(--accent); color: var(--accent-ink); }
.quiz.ready .quiz-q[hidden], .quiz-end[hidden], .quiz-head[hidden] { display: none; }
.quiz:not(.ready) .quiz-end, .quiz:not(.ready) .quiz-head, .quiz:not(.ready) [data-next], .quiz:not(.ready) [data-reveal], .quiz:not(.ready) .quiz-self { display: none; }
.quiz:not(.ready) .quiz-q + .quiz-q { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.quiz-q.enter { animation: slide-in .38s var(--ease-out) both; }
.quiz-q.enter-back { animation: slide-in-back .38s var(--ease-out) both; }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.quiz-end { text-align: center; padding: 8px 0 4px; }
.quiz-end.enter { animation: rise .5s var(--ease-out) both; }
.quiz-end .illus { margin: 0 auto; }
.quiz-review ol { text-align: left; max-width: 520px; margin: 0 auto; padding-left: 22px; font-size: 15px; line-height: 1.5; }
.quiz-review li { margin: 4px 0; }
.productions { display: flex; flex-direction: column; gap: 14px; }
.prod-head { list-style: none; display: flex; align-items: center; gap: 14px; cursor: pointer; }
.prod-head::-webkit-details-marker { display: none; }
.prod-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prod-title strong { font-size: 19px; }
.prod-kind { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--draft); white-space: nowrap; }
.prod-kind.kind-quiz { background: var(--hl); color: #28251d; }
.prod-kind.kind-fiche { background: var(--accent-soft); color: var(--accent-ink); }
.prod-chevron { font-size: 26px; color: var(--muted); transition: transform .25s var(--ease-out); }
details[open] > .prod-head .prod-chevron { transform: rotate(90deg); }
@media (max-width: 760px) {
  .quiz { padding: 16px; }
  .quiz-options { grid-template-columns: minmax(0, 1fr); }
  .quiz-prompt { font-size: 19px; }
}

/* ===== Lot 3 : planning ===== */
.plan-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 36px; align-items: start; margin: 22px 0 18px; }
.plan-sum { max-width: 460px; }
.plan-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.plan-legend span { display: inline-flex; align-items: center; gap: 6px; }
.plan-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lg-class { background: var(--draft); }
.lg-busy { background: repeating-linear-gradient(-45deg, var(--border) 0 3px, transparent 3px 6px); }
.lg-session { border: 1.5px solid var(--accent); background: var(--card); }
.lg-done { background: var(--accent); }
.lg-due { background: var(--hl); }
.plan-grid { display: grid; grid-template-columns: 46px repeat(7, minmax(0, 1fr)); grid-template-rows: auto calc(var(--ph) * var(--hours)); column-gap: 6px; background: var(--card); border-radius: 18px; padding: 12px 12px 14px 6px; box-shadow: var(--shadow); }
.pg-dayhead { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 8px; border-bottom: 1.5px solid var(--ink); min-width: 0; }
.pg-dayhead small { color: var(--muted); font-weight: 700; }
.pg-dayhead .serif { font-size: 22px; line-height: 1; }
.pg-dayhead.today .serif { color: var(--on-accent); background: var(--accent); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; font-size: 18px; }
.pg-dues { display: flex; flex-direction: column; gap: 3px; width: 100%; margin-top: 6px; min-height: 4px; }
.pg-due { font-size: 11.5px; font-weight: 700; background: var(--hl-soft); border-radius: 6px; padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-due.exam { background: var(--hl); color: #28251d; }
.pg-hours { position: relative; }
.pg-hours span { display: block; height: var(--ph); font-size: 11.5px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.pg-col { position: relative; min-width: 0; background-image: repeating-linear-gradient(to bottom, var(--border-soft) 0 1px, transparent 1px var(--ph)); cursor: copy; border-radius: 4px; }
.pg-col.today { background-color: color-mix(in srgb, var(--accent-soft) 22%, transparent); }
.pg-session.short small { display: none; }
.plan-top + .plan-legend, .seg a { white-space: nowrap; }
.pg-col:hover { background-color: color-mix(in srgb, var(--hl-soft) 40%, transparent); }
.pg-item { position: absolute; left: 2px; right: 2px; border-radius: 8px; padding: 4px 6px; font-size: 12px; line-height: 1.25; overflow: hidden; text-align: left; font-family: inherit; color: var(--text); }
.pg-item b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-item small { display: block; color: var(--muted); font-size: 11px; }
.pg-class { background: var(--draft); box-shadow: inset 3px 0 0 var(--c); opacity: .9; pointer-events: none; }
.pg-busy { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--border) 70%, transparent) 0 3px, transparent 3px 7px); border: 1px dashed var(--border); pointer-events: none; }
.pg-session { left: 14%; right: 2px; border: 1.5px solid var(--c); background: var(--card); cursor: grab; z-index: 2; touch-action: none; transition: box-shadow .2s ease, transform .15s ease; box-shadow: 0 6px 16px -10px rgba(40, 37, 29, .5); }
.pg-session:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(40, 37, 29, .55); }
.pg-session.is-done { background: var(--c); border-color: var(--c); color: #fff; }
.pg-session.is-done small { color: rgba(255, 255, 255, .85); }
.pg-session.is-skipped { opacity: .5; text-decoration: line-through; border-style: dashed; }
.pg-session.dragging { cursor: grabbing; z-index: 10; transform: scale(1.04) rotate(-1deg); box-shadow: 0 18px 30px -12px rgba(40, 37, 29, .6); transition: none; }
.pg-session.landed { animation: pop .45s cubic-bezier(.2, .8, .2, 1.3); }
.pg-session:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pg-now { position: absolute; left: -4px; right: 0; height: 2px; background: var(--margin-ink); z-index: 3; pointer-events: none; }
.pg-now::before { content: ""; position: absolute; left: -2px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--margin-ink); }
.plan-list { display: none; }
.sheet-dialog { border: 0; border-radius: 20px; padding: 24px; width: min(520px, calc(100% - 24px)); background: var(--card); color: var(--text); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); }
.sheet-dialog::backdrop { background: rgba(40, 37, 29, .35); backdrop-filter: blur(2px); }
.sheet-dialog[open] { animation: pop .3s var(--ease-out) both; }
@media (max-width: 860px) {
  .plan-top { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .plan-grid, .plan-legend { display: none; }
  .plan-list { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
  .pl-day { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
  .pl-day.today { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
  .pl-dayhead { display: flex; align-items: baseline; gap: 10px; font-size: 20px; margin: 0 0 8px; }
  .pl-dayhead small { font-family: var(--font); font-size: 13px; color: var(--accent); font-weight: 700; }
  .pl-due { margin: 0 0 6px; font-size: 14px; font-weight: 700; background: var(--hl-soft); padding: 6px 10px; border-radius: 8px; }
  .pl-due.exam { background: var(--hl); color: #28251d; }
  .pl-item { position: relative; display: flex; gap: 12px; align-items: baseline; width: 100%; text-align: left; font: inherit; color: var(--text); padding: 10px 12px; margin-top: 6px; border-radius: 10px; border: 0; background: var(--draft); box-shadow: inset 4px 0 0 var(--c); }
  .pl-item.pg-busy { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--border) 60%, transparent) 0 3px, transparent 3px 7px); box-shadow: none; border: 1px dashed var(--border); }
  .pl-item.pg-session { left: auto; right: auto; background: var(--card); border: 1.5px solid var(--c); box-shadow: none; cursor: pointer; min-height: 48px; }
  .pl-item.pg-session.is-done { background: var(--c); color: #fff; }
  .pl-time { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 92px; }
  .pg-session.is-done .pl-time { color: rgba(255, 255, 255, .85); }
  .pl-add { margin-top: 10px; font: inherit; font-weight: 700; color: var(--accent); background: transparent; border: 1.5px dashed var(--border); border-radius: 10px; width: 100%; min-height: 44px; cursor: pointer; }
}

/* ===== Lot 4 : parcours ===== */
.parcours-hero, .project-hero { display: flex; align-items: center; gap: 28px; justify-content: space-between; }
.hero-illus { flex-shrink: 0; }
.ring { flex-shrink: 0; }
.ring-arc { animation: ring-draw 1.1s .2s var(--ease-out) both; }
@keyframes ring-draw { from { stroke-dashoffset: var(--c); } }
.ring-text { font-family: var(--serif); font-weight: 600; font-size: 17px; fill: var(--text); }
.trail { list-style: none; margin: 0; padding: 0 0 0 34px; position: relative; display: flex; flex-direction: column; gap: 18px; }
.trail::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 24px; border-left: 2.5px dashed var(--border); }
.trail-stop { position: relative; }
.trail-node { position: absolute; left: -34px; top: 34px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); border: 2.5px dashed var(--border); }
.trail-stop.is-started .trail-node { border: 2.5px solid var(--accent); background: var(--card); }
.trail-stop.is-done .trail-node { background: var(--accent); border-color: var(--accent); }
.trail-card { display: flex; align-items: center; gap: 22px; background: var(--card); border-radius: 18px; padding: 18px 22px; box-shadow: var(--shadow); transition: transform .25s var(--ease-out), box-shadow .25s ease; }
.trail-stop:not(.is-started) .trail-card { background: transparent; box-shadow: none; border: 1.5px dashed var(--border); }
.trail-card:hover { transform: translateX(4px); }
.trail-illus { width: 110px; height: auto; flex-shrink: 0; }
.trail-body { flex: 1; min-width: 0; }
.trail-title { margin: 2px 0 6px; font-size: 24px; }
.trail-next { margin: 0 0 12px; font-size: 16px; line-height: 1.5; max-width: 560px; }
.project-hero { justify-content: flex-start; }
.project-illus { margin-left: auto; }
.why-line { margin: 16px 0 0; font-size: 16px; max-width: 760px; line-height: 1.55; }
.tag-official { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1.5px solid var(--margin-ink); color: var(--late-ink); }
.path-steps { list-style: none; margin: 0; padding: 0; position: relative; }
.path-steps::before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2.5px; background: var(--border-soft); }
.ps { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; }
.ps-node { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 2.5px solid var(--border); display: grid; place-items: center; margin-top: 2px; }
.ps.done .ps-node { background: var(--accent); border-color: var(--accent); }
.ps.current .ps-node { border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); animation: node-pulse 2.4s ease-out infinite; }
.ps-title { margin: 3px 0 0; font-size: 17px; font-weight: 700; }
.ps.done .ps-title { color: var(--muted); font-weight: 600; }
.ps:not(.done):not(.current) .ps-title { color: var(--muted); }
.ps.current { background: var(--card); border-radius: 16px; padding: 16px 14px 18px; margin: 6px -14px; box-shadow: var(--shadow); }
.ps.current .ps-title { font-family: var(--serif); font-size: 23px; color: var(--text); }
.ps.current::after { content: "Maintenant"; position: absolute; top: -10px; left: 58px; font-size: 12px; font-weight: 700; background: var(--hl); color: #28251d; padding: 2px 10px; border-radius: 999px; }
.ps-meta { margin: 4px 0 0; display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); align-items: center; }
.ps-actions { margin-top: 10px; }
.ps:not(.current) .ps-actions { margin-top: 6px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.board-col { background: var(--surface-2); border-radius: 14px; padding: 10px; min-height: 120px; }
.board-col.col-followup { background: var(--hl-soft); }
.board-head { margin: 2px 4px 8px; font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; }
.board-head small { color: var(--muted); }
.board-card { background: var(--card); border-radius: 10px; box-shadow: 0 1px 2px rgba(40, 37, 29, .08); margin-bottom: 8px; }
.board-card > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.board-card > summary::-webkit-details-marker { display: none; }
.board-card > summary small { color: var(--muted); font-size: 13px; }
.board-card[open] { grid-column: span 2; }
.board-detail { padding: 0 12px 12px; }
.board-empty { color: var(--muted); text-align: center; margin: 18px 0; }
.chrono { background: var(--card); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); text-align: center; }
.chrono .label-strong, .chrono .muted { text-align: left; }
.chrono-face { width: 170px; height: 170px; margin: 0 auto; border-radius: 50%; border: 6px solid var(--draft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.chrono-face span { font-size: 13px; font-weight: 700; color: var(--accent); }
.chrono-face strong { font-family: var(--serif); font-size: 44px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .hero-illus, .project-illus { display: none; }
  .project-hero { flex-wrap: wrap; gap: 12px 16px; }
  .project-hero .ring { width: 64px; height: 64px; }
  .trail-card { flex-wrap: wrap; padding: 16px; gap: 14px; }
  .trail-illus { width: 80px; }
  .trail-card .ring { width: 56px; height: 56px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .board-card[open] { grid-column: auto; }
  .ps { grid-template-columns: 30px minmax(0, 1fr) 40px; }
}

/* ===== Lot 5 : orientation ===== */
.orient-hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.orient-steps { position: sticky; top: 64px; z-index: 12; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 26px 0 8px; padding: 10px 0; background: var(--bg); }
.os { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border-soft); transition: border-color .2s ease, background .2s ease, color .2s ease; min-width: 0; }
.os:hover { border-color: var(--border); color: var(--text); }
.os-n { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: 17px; border: 1.5px dashed var(--border); }
.os-l { font-size: 14px; font-weight: 700; line-height: 1.25; }
.os.filled .os-n { background: var(--accent-soft); border: 1.5px solid var(--accent); color: var(--accent-ink); }
.os.active { border-color: var(--ink); color: var(--text); background: var(--card); }
.os.active .os-n { background: var(--hl); border-color: var(--hl); color: #28251d; }
.orient-sec { padding: 40px 0 10px; scroll-margin-top: 140px; border-top: 1.5px solid var(--ink); margin-top: 30px; }
.orient-sec h2 { font-size: 32px; margin: 0 0 18px; }
.os-kicker { font-family: var(--serif); font-style: italic; color: var(--muted); margin: 0 0 4px; font-size: 16px; }
.interest-chips .chip { font-size: 15px; padding: 10px 16px; }
.interest-chips .chip:has(input:checked) { background: var(--hl); border-color: var(--hl); color: #28251d; animation: pop .3s var(--ease-out); }
.bon-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 34px; align-items: start; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr) 46px; gap: 12px; align-items: center; }
.bar-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { position: relative; height: 14px; background: var(--draft); border-radius: 999px; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); border-radius: 999px; transform-origin: left; animation: hl-sweep .9s var(--ease-out) both; }
.bar-ten { position: absolute; left: 50%; top: -4px; bottom: -4px; border-left: 1.5px dashed var(--muted); opacity: .5; }
.bar-val { font-size: 20px; font-weight: 600; text-align: right; }
.path-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 18px; }
.path-card { background: var(--card); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; position: relative; }
.path-card.st-proposed { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.path-card.st-shortlisted { box-shadow: inset 4px 0 0 var(--hl), var(--shadow); }
.path-card.st-dropped { opacity: .6; }
.pc-head { display: flex; align-items: center; gap: 10px; }
.pc-head .row-menu { margin-left: auto; }
.pc-kind { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--draft); }
.pc-coach { font-size: 12px; font-weight: 700; color: var(--accent); }
.pc-title { font-size: 23px; margin: 4px 0 0; }
.pc-notes { margin: 0; color: var(--muted); font-size: 15px; white-space: pre-line; }
.pc-fit { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--border); }
.pc-lab { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pc-list { list-style: none; margin: 0; padding: 0; font-size: 14.5px; line-height: 1.45; }
.pc-list li { position: relative; padding-left: 20px; margin: 4px 0; }
.pc-list.sup li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.pc-list.gap li::before { content: "↗"; position: absolute; left: 0; color: var(--late-ink); font-weight: 700; }
.pc-actions { margin-top: auto; padding-top: 10px; }
.add-path { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.add-path .line-input { flex: 1 1 280px; }
@media (max-width: 860px) {
  .orient-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); top: 56px; gap: 4px; }
  .os { flex-direction: column; gap: 4px; padding: 8px 4px; text-align: center; }
  .os-l { font-size: 11px; }
  .bon-grid { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: minmax(0, 1fr) 44px; row-gap: 4px; }
  .bar-name { grid-column: 1 / -1; white-space: normal; }
  .pc-fit { grid-template-columns: 1fr; }
  .orient-sec h2 { font-size: 26px; }
}

/* ===== Lot 6 : accès, transitions, finitions ===== */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .28s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
.auth-spread { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-left { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; padding: 44px clamp(24px, 5vw, 72px); border-right: 2px solid var(--margin); }
.auth-pitch { max-width: 520px; }
.auth-illus { width: 300px; height: auto; }
.auth-voice { font-size: 27px; }
.auth-promises { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; font-size: 17px; }
.auth-promises li { padding-left: 26px; position: relative; }
.auth-promises li::before { content: ""; position: absolute; left: 0; top: .45em; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); }
.auth-foot { font-size: 13px; margin: 0; }
.auth-right { display: grid; place-items: center; padding: 40px 24px; background: var(--card); }
.auth-sheet { width: 100%; max-width: 440px; }
.auth-sheet h1 { font-size: 44px; }
.auth-switch { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border-soft); color: var(--muted); }
.auth-switch a { font-weight: 700; }
.pass-field { position: relative; }
.pass-field input { padding-right: 96px !important; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-40%); font: inherit; font-size: 14px; font-weight: 700; color: var(--accent); background: transparent; border: 0; padding: 8px 10px; cursor: pointer; border-radius: 8px; }
.pass-toggle:hover { background: var(--accent-soft); }
@media (max-width: 900px) {
  .auth-spread { grid-template-columns: minmax(0, 1fr); }
  .auth-left { border-right: 0; border-bottom: 2px solid var(--margin); padding: 22px 20px 20px; gap: 12px; }
  .auth-illus, .auth-promises, .auth-foot { display: none; }
  .auth-voice { font-size: 20px; }
  .auth-right { place-items: start center; padding: 26px 20px 40px; }
  .auth-sheet h1 { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

.errata { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.erratum { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.er-wrong { padding: 16px 20px; border-right: 2px solid var(--margin); }
.er-right { padding: 16px 20px; background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.er-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.er-cat { font-weight: 700; color: var(--late-ink); }
.er-desc { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.45; }
.er-fix { margin: 0; font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--accent-ink); line-height: 1.4; }
.er-arrow { font-style: normal; margin-right: 8px; color: var(--accent); }
.erratum.resolved { opacity: .85; }
.goals { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.goal { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--card); border-radius: 16px; padding: 16px 20px; box-shadow: var(--shadow); }
.goal-main { flex: 1 1 360px; min-width: 0; }
.goal-title { margin: 0; font-size: 19px; font-weight: 700; }
.goal-track { list-style: none; display: flex; gap: 6px; padding: 0; margin: 12px 0 0; flex-wrap: wrap; }
.goal-track li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--surface-2); }
.goal-track li span { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border); }
.goal-track li.on span { background: var(--accent); border-color: var(--accent); }
.goal-track li.on { color: var(--text); }
.goal-track li.now { background: var(--hl); color: #28251d; }
.goal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) { .erratum { grid-template-columns: minmax(0, 1fr); } .er-wrong { border-right: 0; border-bottom: 2px solid var(--margin); } }
.quick-form { margin-top: 18px; }
.qf-group { border: 0; padding: 0; margin: 24px 0 0; }
.qf-group .hint { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
.qf-more { margin-top: 26px; border-top: 1px solid var(--border-soft); padding-top: 16px; }
.qf-more > summary { cursor: pointer; font-weight: 700; color: var(--accent); }

.only-narrow { display: none; }
@media (max-width: 980px) {
  .only-narrow { display: block; }
  .hide-narrow { display: none; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 12px; gap: 6px; }
  .subnav { flex-wrap: nowrap; overflow-x: auto; margin-left: -14px; margin-right: -14px; padding: 2px 14px; scrollbar-width: none; }
  .subnav a { white-space: nowrap; flex-shrink: 0; }
  .brand { font-size: 19px; gap: 8px; }
  .topbar .btn.ghost.sm { padding: 6px 6px; }
  .today-hello { font-size: 44px; }
  .focus-title { font-size: 28px; }
  h1 { font-size: 32px; }
  .weekline .d .n { font-size: 18px; }
  .bubble-me { max-width: 92%; }
  .thread-title { font-size: 24px; }
  .composer { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .coach-answer { padding-left: 14px; }
  .coach-answer .body { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ink { stroke-dashoffset: 0; }
  .mark.on { background-size: 100% 100%; }
}

/* Programme : page de chapitre (carte mentale, essentiel, méthodes, pièges, exercices générés) */
.ch-prog { font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; }
.prog-ready { margin-top: 22px; display: grid; gap: 8px; }
.prog-ready a { display: grid; gap: 2px; text-decoration: none; color: var(--text); background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); border-left: 4px solid var(--hl); font-weight: 700; transition: transform .2s var(--ease-out); }
.prog-ready a:hover { transform: translateX(3px); }
.prog-ready small { font-weight: 400; color: var(--muted); font-size: 13px; }
.prog-tabs { max-width: 640px; margin: 22px 0 0; position: sticky; top: 8px; z-index: 5; transition: transform .25s var(--ease-out, ease-out), opacity .2s; }
/* En descendant, la barre s'efface (app.js, html.tabs-away) : rien ne reste au-dessus de l'activité ; elle revient en remontant. */
html.tabs-away .prog-tabs { transform: translateY(calc(-100% - 90px)); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .prog-tabs { transition: none; } }
/* L'élève travaille dans la page (un geste de Comprendre, un piège, un défi, une série : zones [data-work], app.js) : les
   parties du chapitre ne restent plus collées en haut, elles partent avec la page ; elles reviennent dès qu'il en sort. */
html.at-work .prog-tabs { position: relative; top: auto; }
/* Une page d'activité (mode « activite » ou « epreuve », layouts/app) : la barre du haut, réduite au retour, part avec la
   page ; rien de fixe ne recouvre la consigne, les réponses ou la correction. */
html[data-mode] .topbar { position: relative; }
.prog-section { margin: 0 0 46px; scroll-margin-top: 80px; }
.prog-lede { margin: 2px 0 16px; font-size: 15px; max-width: 62ch; }
.prog-credit { font-size: 13px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.md table { border-collapse: collapse; width: 100%; margin: 12px 0 18px; font-size: 15px; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--border-soft); padding: 9px 10px; text-align: left; vertical-align: top; }
.md th { font-weight: 700; background: var(--surface-2); }
.md h3 { font-family: var(--serif); font-size: 21px; margin: 26px 0 8px; }
.md h3:first-child { margin-top: 0; }
.md li { margin: 4px 0; }
.md .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.prog-sheet { background: var(--card); border-radius: 18px; padding: 24px 26px; box-shadow: var(--shadow); line-height: 1.65; }
.prog-sheet.traps h3 { display: flex; gap: 10px; align-items: baseline; font-size: 19px; }
.prog-sheet.traps h3::before { content: "!"; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--warn-bg); color: var(--warn-ink); font: 800 14px/24px var(--font); text-align: center; }
.md-inline p { display: inline; margin: 0; }

.methods { display: grid; gap: 10px; }
.capacities { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.capacities li { background: var(--card); border-radius: 12px; padding: 10px 14px 10px 40px; box-shadow: var(--shadow); position: relative; line-height: 1.5; }
.capacities li::before { content: ""; position: absolute; left: 14px; top: 14px; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--accent); }
.capacities li.is-xp::before { border-color: var(--margin-ink); border-radius: 50%; }
.capacities li.is-num::before { border-color: var(--muted); border-style: dashed; }
.cap-kind { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #a3502c; margin-right: 8px; }
[data-theme="dark"] .cap-kind { color: var(--margin-ink); } /* contraste ≥ 4,5:1 sur la carte, clair (5,6) et sombre (6,4) */
.capacities li.is-num .cap-kind { color: var(--muted); }
.written-head { display: flex; align-items: baseline; gap: 10px; padding: 16px 22px 6px; font-size: 17px; flex-wrap: wrap; }
.written-kind { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--accent-soft); color: var(--accent-ink); border-radius: 99px; padding: 3px 9px; }
.written-kind.is-defi { background: var(--hl); color: var(--text); }
.written-sol { border-top: 1px dashed var(--border); margin: 6px 0 0; }
.written-sol summary { cursor: pointer; padding: 12px 22px; font-weight: 700; color: var(--accent); }
.written-sol .md { padding: 0 22px 18px; }
.outline ul { list-style: none; padding-left: 18px; border-left: 2px solid var(--border-soft); margin: 6px 0; }
.outline > ul { border-left: 0; padding-left: 0; }
.outline li { position: relative; padding-left: 4px; }
.outline ul ul li::before { content: ""; position: absolute; left: -18px; top: .8em; width: 12px; border-top: 2px solid var(--border-soft); }
.method { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.method summary { display: flex; gap: 14px; align-items: center; padding: 16px 20px; cursor: pointer; font-weight: 700; font-size: 17px; list-style: none; }
.method summary::-webkit-details-marker { display: none; }
.method[open] summary { border-bottom: 1px solid var(--border-soft); }
.method-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font: 600 17px/32px var(--serif); text-align: center; }
.method .md { padding: 14px 22px 20px; line-height: 1.65; }

.mindmap { position: relative; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 14px 0 10px;
  background-image: radial-gradient(var(--border-soft) 1px, transparent 1px); background-size: 22px 22px; }
.mm-heads { display: grid; grid-template-columns: 30% 44% 26%; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.mm-area { position: relative; height: calc(var(--rows) * 82px); margin: 6px 0 4px; }
.mm-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mm-lines path { fill: none; vector-effect: non-scaling-stroke; }
.mm-lines .mm-link { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; animation: rise .6s .2s var(--ease-out) both; }
.mm-lines .mm-pre { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 5; opacity: .75; animation: rise .6s .35s var(--ease-out) both; }
.mm-lines .mm-pre.is-flagged { stroke: #c0643f; opacity: 1; }
.mm-node { position: absolute; translate: -50% -50%; text-decoration: none; color: var(--text); animation: pop .5s cubic-bezier(.2, .8, .2, 1.2) both; }
.mm-center { font-family: var(--serif); font-weight: 600; font-size: 19px; background: var(--hl); padding: 14px 14px; border-radius: 16px; width: 20%; line-height: 1.2; text-align: center; }
.mm-notion { background: var(--bg); border: 2px solid var(--border); border-radius: 14px; padding: 9px 12px; width: 29%; font-size: 14px; font-weight: 700; line-height: 1.3; display: grid; gap: 3px; transition: transform .2s var(--ease-out), border-color .2s ease; animation-delay: .1s; }
.mm-notion:hover { transform: scale(1.03); border-color: var(--ink); }
.mm-notion.is-ok { border-color: var(--accent); background: var(--accent-soft); }
.mm-notion.is-worked { border-color: #e0a24d; }
.mm-notion.is-fragile { border-color: #c0643f; background: var(--warn-bg); }
.mm-state { font-size: 12px; font-weight: 600; color: var(--muted); }
.mm-pre-node { font-size: 12.5px; color: var(--text); background: var(--surface-2); border: 1.5px dashed var(--border); border-radius: 10px; padding: 6px 9px; width: 26%; line-height: 1.3; animation-delay: .25s; }
.mm-pre-node:hover { border-style: solid; border-color: var(--ink); }
.mm-pre-node.is-flagged, .prereq-list li.is-flagged { border-color: #c0643f; color: var(--warn-ink); background: var(--warn-bg); }
.mm-level { display: block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mm-legend { font-size: 13px; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.mm-legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--border); margin-right: 4px; vertical-align: -1px; }
.mm-legend .dot.is-ok { border-color: var(--accent); background: var(--accent-soft); }
.mm-legend .dot.is-worked { border-color: #e0a24d; }
.mm-legend .dot.is-fragile { border-color: #c0643f; background: var(--warn-bg); }

/* L'essentiel en cartes à feuilleter : une idée par carte */
.prog-sheet.has-deck { background: none; box-shadow: none; padding: 0; }
.deck { position: relative; }
.deck-track { display: flex; align-items: flex-start; gap: 12px; padding: 2px 0 10px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 22px; }
.deck-track::-webkit-scrollbar { display: none; }
.deck-track:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.deck-card { flex: 0 0 calc(100% - 28px); box-sizing: border-box; scroll-snap-align: start; position: relative; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 26px 22px 22px; line-height: 1.65; min-width: 0; overflow-x: auto; border-top: 6px solid var(--hl); }
.deck-card h3 { font-family: var(--serif); font-size: 26px; line-height: 1.15; margin: 4px 0 14px; padding-right: 44px; }
.deck-n { position: absolute; top: 16px; right: 18px; font-size: 13px; font-weight: 800; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 9px; }
.deck-card .katex-display { background: var(--surface-2); border-radius: 14px; padding: 12px 10px; margin: 12px 0; }
.deck-card.is-recall { border-top-color: var(--accent); }
.deck-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 10px; }
@media (min-width: 900px) { .deck-track { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; overflow: visible; scroll-snap-type: none; } .deck-card:has(table, .timeline) { grid-column: 1 / -1; } .deck-nav { display: none; } }
.deck-btn { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--card); color: var(--text); font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.deck-btn:disabled { opacity: .35; cursor: default; }
.deck-btn:not(:disabled):active { transform: scale(.94); }
.deck-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 60%; }
.deck-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: width .25s var(--ease-out), background .25s ease; }
.deck-dots i.on { width: 22px; border-radius: 6px; background: var(--accent); }

/* « À savoir refaire » : retrouver de tête, puis toucher pour vérifier */
.recall-hint { font-size: 14px; color: var(--muted); margin: 0 0 8px; }

/* Chronologie en frise */
.timeline { list-style: none; padding: 0 0 0 22px; margin: 14px 0; border-left: 3px solid var(--hl); display: grid; gap: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -31px; top: 4px; width: 15px; height: 15px; border-radius: 50%; background: var(--card); border: 3px solid var(--accent); }
.tl-when { display: inline-block; font-weight: 800; font-size: 14px; background: var(--hl); border-radius: 8px; padding: 2px 8px; margin-bottom: 4px; }
.tl-what p { margin: 0; }

/* Méthodes : étiquette, parcours d'étapes, carte d'exemple, encadré réflexe */
:is(.method, .story) .m-when { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; }
:is(.method, .story) .m-steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 16px; position: relative; }
:is(.method, .story) .m-steps > li { counter-increment: step; position: relative; padding: 2px 0 16px 46px; min-height: 34px; }
:is(.method, .story) .m-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 800; display: grid; place-items: center; z-index: 1; }
:is(.method, .story) .m-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
:is(.method, .story) .m-example { background: var(--card); border: 2px solid var(--hl); border-radius: 16px; padding: 12px 14px; margin: 0 0 14px; overflow-x: auto; }
:is(.method, .story) .m-example > p:first-child strong:first-child { display: inline-block; background: var(--hl); border-radius: 8px; padding: 1px 8px; }
:is(.method, .story) .m-tip { border-left: 4px solid var(--accent); padding: 6px 0 6px 12px; margin: 0; font-size: 15px; }

/* Pièges : une carte par piège, l'explication au toucher */
.prog-sheet.has-traps { background: none; box-shadow: none; padding: 0; }
.trap-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }
.trap-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); border-left: 5px solid #c0643f; overflow: hidden; }
.trap-head { width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; text-align: left; font: inherit; color: var(--text); background: none; border: 0; padding: 14px 14px; cursor: pointer; min-height: 56px; }
.trap-icon { grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--warn-bg); color: var(--warn-ink); font-weight: 900; display: grid; place-items: center; }
.trap-title { font-weight: 700; line-height: 1.35; }
.trap-more { font-size: 13px; font-weight: 700; color: var(--accent); }
.trap-card.open .trap-more { visibility: hidden; height: 0; }
.trap-body { padding: 0 14px 14px 56px; line-height: 1.6; overflow-x: auto; }
.trap-body p { margin: 0 0 6px; }
.trap-head:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* Carte du chapitre sur téléphone : racines (prérequis) → tronc (le chapitre) → branches (les notions) */
.mm-tree { display: none; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 16px 16px 18px; }
.mt-roots { padding: 0 0 14px; margin: 0 0 4px; border-bottom: 2px dashed var(--border); position: relative; }
.mt-roots::after { content: ""; position: absolute; left: 28px; bottom: -14px; height: 14px; border-left: 2px dashed var(--border); }
.mt-cap { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.mt-chips { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 16px 6px 0; margin-right: -16px; mask-image: linear-gradient(90deg, #000 85%, transparent); scrollbar-width: none; }
.mt-chips::-webkit-scrollbar { display: none; }
.mt-chip { flex: 0 0 auto; width: 62%; max-width: 230px; scroll-snap-align: start; display: grid; gap: 2px; align-content: start; font-size: 13px; line-height: 1.3; color: var(--text); text-decoration: none; background: var(--surface-2); border: 1.5px dashed var(--border); border-radius: 12px; padding: 7px 10px; }
.mt-chip span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-chip small { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mt-chip.is-flagged { border-color: #c0643f; background: var(--warn-bg); color: var(--warn-ink); }
.mt-core { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 12px 14px; background: var(--hl); border-radius: 18px; position: relative; z-index: 1; }
.mt-core strong { display: block; font-size: 20px; line-height: 1.15; }
.mt-core small { display: block; font-size: 13px; margin-top: 2px; color: var(--text); opacity: .8; }
.mt-ring { flex: none; width: 46px; height: 46px; transform: rotate(-90deg); }
.mt-ring circle { fill: none; stroke-width: 5; }
.mt-ring .bg { stroke: rgba(40, 37, 29, .14); }
.mt-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .8s var(--ease-out); }
.mt-branches { list-style: none; margin: 0 0 0 28px; padding: 6px 0 0; border-left: 2px solid var(--ink); }
.mt-branches li { position: relative; padding: 6px 0 6px 22px; }
.mt-branches li::before { content: ""; position: absolute; left: -2px; top: 0; width: 20px; height: 50%; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); border-bottom-left-radius: 14px; }
.mt-branches li:last-child::after { content: ""; position: absolute; left: -2px; top: 50%; bottom: 0; width: 2px; background: var(--card); } /* le tronc s'arrête à la dernière branche */
.mt-leaf { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 14px; background: var(--bg); border: 2px solid var(--border); color: var(--text); text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.3; }
.mt-leaf:active { transform: scale(.98); }
.mt-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); background: var(--card); }
.mt-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mt-state { flex: none; font-size: 13px; color: var(--muted); font-weight: 700; }
.mt-leaf.is-ok { border-color: var(--accent); background: var(--accent-soft); }
.mt-leaf.is-ok .mt-dot { border-color: var(--accent); background: var(--accent); }
.mt-leaf.is-worked { border-color: #e0a24d; }
.mt-leaf.is-worked .mt-dot { border-color: #e0a24d; background: #e0a24d; }
.mt-leaf.is-fragile { border-color: #c0643f; background: var(--warn-bg); }
.mt-leaf.is-fragile .mt-dot { border-color: #c0643f; background: #c0643f; }
.prereq-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.prereq-list li { background: var(--card); border: 1.5px solid transparent; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 6px; justify-items: start; }
.prereq-flag { font-size: 13px; font-weight: 700; }

.drill { background: var(--card); border-radius: 20px; padding: 20px 22px 24px; box-shadow: var(--shadow); margin-top: 16px; }
.drill.ready .ex:not(.current), .drill.ready .ex-solution, .drill:not(.ended) .quiz-end, .drill.ended .quiz-head { display: none; }
.drill.ready .ex.solved .ex-solution { display: block; animation: rise .45s var(--ease-out) both; }
.drill:not(.ready) .quiz-head, .drill:not(.ready) .ex-hints .row, .drill:not(.ready) [data-next] { display: none; }
.drill:not(.ready) .ex { border-bottom: 1px solid var(--border-soft); padding-bottom: 22px; margin-bottom: 22px; }
.drill:not(.ready) [data-hint] { display: block; }
.ex { animation: rise .4s var(--ease-out) both; }
.ex-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 10px; }
.ex-diff { display: inline-flex; gap: 3px; }
.ex-diff i { width: 8px; height: 8px; border-radius: 2px; background: var(--draft); }
.ex-diff i.on { background: var(--ink); }
.ex-int { background: var(--surface-2); border-radius: 99px; padding: 2px 9px; }
.ex-prompt { font-size: 19px; line-height: 1.6; margin-bottom: 14px; }
.ex-prompt p { margin: 0; }
/* Sur petit écran, rien ne pousse la page de côté : les cellules de grille peuvent rétrécir,
   les titres longs passent à la ligne, une formule trop large défile dans son propre cadre. */
.notebook > *, .methods > *, .prog-section, .prog-sheet, .method summary > span, .written-head > * { min-width: 0; }
.method summary > span, .written-head strong, .mm-title { overflow-wrap: anywhere; }
.prog-sheet, .method .md, .written .md, .prereq-list li, .ex-steps, .ex-hint, .ex-diagnosis, .capacities li, .ex-prompt, .qo-text { overflow-x: auto; overflow-y: hidden; }
.prog-section .katex, .drill .katex { max-width: 100%; }
/* Tableaux de données dans un énoncé ou un corrigé : défilent dans leur cadre, jamais la page. */
.ex-prompt table, .ex-steps table, .qf-explain table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 10px 0; font-size: 15px; }
.ex-prompt th, .ex-prompt td, .ex-steps th, .ex-steps td { border-bottom: 1px solid var(--border-soft); padding: 7px 10px; text-align: center; white-space: nowrap; }
.ex-prompt th, .ex-steps th { background: var(--surface-2); font-weight: 700; }
.ex, .ex-prompt, .ex-steps, .drill { min-width: 0; max-width: 100%; }
.ex-prompt .katex-display, .ex-steps .katex-display { overflow-x: auto; overflow-y: hidden; }
.ex-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.ex.solved .quiz-opt:not(.good):not(.bad) { opacity: .5; }
.ex-diagnosis { margin-top: 14px; background: var(--warn-bg); color: var(--text); border-radius: 14px; padding: 14px 16px; border-left: 4px solid #c0643f; animation: pop .35s cubic-bezier(.2, .8, .2, 1.2) both; }
.ex-diagnosis p { margin: 0 0 4px; }
.ex-diag-title strong { color: var(--warn-ink); }
/* « Pourquoi ? » après une réussite : nommer l'erreur d'un autre élève (une fois par série, facultatif). */
.ex-why { margin: 12px 0 14px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border-left: 4px solid var(--accent); }
.ex-why-q { margin: 0 0 10px; }
.ex-why-ans { font-weight: 700; white-space: nowrap; }
.ex-why-opts { display: grid; gap: 8px; }
.ex-why-opts .quiz-opt { text-align: left; min-height: 48px; }
.ex-why-fb { margin: 10px 0 0; }
.ex-why-fb:empty { display: none; }
.ex-diag-pre a { font-weight: 700; }
.ex-hints { margin-top: 12px; }
.ex-hint { margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); line-height: 1.55; animation: rise .35s var(--ease-out) both; }
.ex-hint-n { display: block; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 2px; }
.ex-solution { margin-top: 18px; border-top: 1px dashed var(--border); padding-top: 16px; }
.ex.solved .qf-verdict { color: var(--accent); }
.ex-steps { line-height: 1.65; }
.ex-plot { margin: 14px 0 0; }
.ex-plot figcaption { font-size: 13px; margin-top: 6px; }
.plot { width: 100%; max-width: 460px; display: block; }
.plot-paper { fill: var(--bg); stroke: var(--border-soft); }
.plot-axis { stroke: var(--muted); stroke-width: 1.2; opacity: .75; }
.plot-grid { stroke: var(--border-soft); stroke-width: .6; }
.plot-tick { fill: var(--muted); font: 600 8.5px var(--font); }
.plot-asym { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 5 5; }
.plot-label { fill: var(--accent-ink); font: 700 11px var(--font); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.plot-curve { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; animation-duration: 2s; }
.plot-hole { fill: var(--bg); stroke: var(--ink); stroke-width: 2; }
.drill-errors ul { text-align: left; max-width: 520px; margin: 0 auto; padding-left: 20px; line-height: 1.55; }
.drill-next { margin: 22px auto 0; max-width: 520px; padding: 16px 18px; border-radius: 14px; background: var(--accent-soft); }
.drill-next-why { margin: 0 0 12px; line-height: 1.5; }
.drill-recap-list { list-style: none; text-align: left; max-width: 520px; margin: 0 auto; padding: 0; display: grid; gap: 6px; }
.drill-recap-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.drill-recap-list .r { flex: none; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.drill-recap-list li.good .r { background: var(--ok-bg); color: var(--ok-ink); }
.drill-recap-list li.bad .r { background: var(--warn-bg); color: var(--warn-ink); }
.drill .quiz-end { text-align: center; padding: 10px 0; }
.drill-resumed { margin: 0 0 4px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.drill-end-actions { display: grid; gap: 10px; max-width: 420px; margin: 18px auto 0; }
.drill-end-actions small { font-weight: 400; opacity: .8; }
.drill-end-actions [data-detail] { border: 1.5px solid var(--accent); min-height: 48px; }
.drill:not([data-view]) [data-detail] { display: none; }
.drill-recap-list li .btn { margin-left: auto; flex: none; }
.drill-recap-list li.before .r { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
/* Après une erreur : les choix encore possibles le disent ; vérification en cours (preuves serveur). */
.ex.has-miss:not(.solved) .quiz-opt:not(:disabled) { border-color: var(--accent); }
.ex.has-miss:not(.solved) .quiz-opt:not(:disabled)::after, .quiz-opt.is-checking::after { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.ex.has-miss:not(.solved) .quiz-opt:not(:disabled)::after { content: "possible"; }
.quiz-opt.is-checking::after { content: "Vérification…"; color: var(--muted); }

/* Série en plein écran : barre du haut, contenu qui défile, barre d'action fixe qui ne recouvre rien. */
/* Ancrée aux quatre bords plutôt qu'en hauteur (100dvh) : couvre toute la page même quand la barre d'adresse du
   téléphone se replie (sinon une bande de la page restait visible sous la série). */
.drill-dlg { position: fixed; inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--text); overflow: hidden; }
.drill-dlg[open] { display: flex; flex-direction: column; }
.drill-dlg::backdrop { background: rgba(10, 14, 18, .6); }
@media (min-width: 760px) and (min-height: 600px) { .drill-dlg { width: min(760px, 100vw); height: min(940px, 100dvh); border-radius: 24px; margin: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); } }
.dd-top { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 4px; border-bottom: 1px solid var(--border); background: var(--card); }
.dd-top .quiz-head { flex: 1; min-width: 0; margin: 0; gap: 8px; flex-wrap: wrap; }
.dd-top .quiz-head p { font-size: 14px; }
.drill-dlg.is-ended .dd-top .quiz-head { display: none; }
.dd-title { flex: 1; font-weight: 700; }
.dd-title[hidden], .dd-badge[hidden], .dd-status[hidden], .dd-hint[hidden], .dd-dock[hidden], .dd-sheet[hidden], .dd-actions [hidden], .dd-status [hidden], .dd-pausebar [hidden] { display: none !important; }
.dd-close { flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.dd-close:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.drill-dlg [tabindex="-1"]:focus { outline: none; } /* repères de lecture (titre, verdict, score) : focus posé par le script */
.dd-close svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.dd-close .dd-arrow, .dd-close.is-back .dd-x { display: none; }
.dd-close.is-back .dd-arrow { display: block; }
.dd-badge { flex: none; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); }
.dd-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 28px; }
.dd-body .drill { max-width: 680px; margin: 0 auto; padding: 0; background: none; box-shadow: none; border-radius: 0; }
.drill-dlg .ex-hints .row, .drill-dlg [data-next], .drill-dlg [data-save-note] { display: none; }
.drill.ready .ex.reviewing { display: block; }
.drill-dlg .drill[data-view="end"] [data-detail-view] { display: none; }
.drill-dlg .drill[data-view="detail"] .quiz-end > :not([data-detail-view]) { display: none; }
.drill-dlg .drill[data-view="review"] .quiz-end { display: none; }
.dd-dock { flex: none; display: grid; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--card); }
.dd-hint { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
.dd-actions { display: flex; flex-wrap: wrap; gap: 8px; max-width: 680px; width: 100%; margin: 0 auto; }
.dd-actions .btn { flex: 1 1 150px; justify-content: center; min-height: 48px; white-space: normal; }
/* Une réponse cachée sous la barre est annoncée : la pastille colle au bas de la zone qui défile. */
.dd-more { position: sticky; bottom: 8px; display: block; margin: 8px 0 0 auto; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--ink); color: var(--card); font: inherit; font-size: 13px; font-weight: 700; box-shadow: var(--shadow); cursor: pointer; }
.dd-more[hidden] { display: none; }
.dd-more:focus-visible { outline: 3px solid var(--hl); outline-offset: 3px; }
/* Téléphone : la barre tient sur une ligne, pour laisser la place aux choix. */
@media (max-width: 760px) {
  .dd-dock { gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .dd-hint { display: none; } /* « Touche ta réponse » : les grandes cartes de réponse le disent déjà */
  .dd-actions { flex-wrap: nowrap; gap: 6px; }
  .dd-actions .btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 8px; font-size: 14px; line-height: 1.2; }
}
.dd-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 680px; width: 100%; margin: 0 auto; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; line-height: 1.4; }
.dd-status.is-miss { background: var(--warn-bg); }
.dd-status .btn { flex: none; }
/* Pendant la saisie au clavier, la barre du bas se retire : « Vérifier » est à côté du champ. */
.drill-dlg:has(.ex-input input:focus) .dd-dock { display: none; }
/* Écran très bas (paysage, très grand texte) : tout défile ensemble, la barre suit le contenu. */
@media (max-height: 520px) {
  .drill-dlg[open] { display: block; overflow-y: auto; }
  .dd-body { overflow: visible; }
}
.dd-sheet { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 14, 18, .55); }
.dd-sheet-card { width: 100%; max-width: 560px; max-height: 90%; overflow-y: auto; display: grid; gap: 10px; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--card); }
.dd-sheet-card h2 { margin: 0; font-size: 20px; }
.dd-sheet-card p { margin: 0 0 6px; line-height: 1.5; }
.dd-sheet-actions { display: grid; gap: 8px; }
.dd-sheet-actions .btn { justify-content: center; min-height: 48px; white-space: normal; }
.dd-launch { margin-top: 16px; }
.dd-launch .cg-main { width: 100%; grid-template-columns: 1fr auto; }
.dd-pausebar { position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 31; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 16px; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); font-weight: 700; font-size: 15px; line-height: 1.35; }
.dd-pausebar[hidden] { display: none; }
.dd-pausebar span { flex: 1; min-width: 0; }
.dd-pausebar .btn { flex: none; background: #fff; color: var(--accent-ink); border-color: #fff; }
@media (max-width: 760px) { .dd-pausebar { bottom: calc(74px + env(safe-area-inset-bottom)); } }
.today-done { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-ink); font-weight: 700; }

/* « Vérifions ensemble » (prototype B) : un point à la fois, en plein écran ; l'action en bas, toujours au même endroit. */
.cg-verif { border: 0; color: #3a2606; background: linear-gradient(135deg, #ffe2b8, #f6c77d); }
.cg-verif small { color: rgba(58, 38, 6, .8); }
.trap-seen { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 1px 8px; }
.ve-dlg { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--text); overflow: hidden; }
.ve-dlg[open] { display: flex; flex-direction: column; }
.ve-dlg::backdrop { background: rgba(10, 14, 18, .6); }
@media (min-width: 760px) and (min-height: 600px) { .ve-dlg { width: min(720px, 100vw); height: min(900px, 100dvh); border-radius: 24px; margin: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); } }
.ve-top { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 4px; border-bottom: 1px solid var(--border); background: var(--card); }
.ve-close { flex: none; width: 48px; height: 48px; border: 0; background: none; color: var(--text); font-size: 20px; border-radius: 50%; cursor: pointer; }
.ve-close:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.ve-bars { flex: 1; display: flex; gap: 4px; }
.ve-bars i { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.ve-bars i.on { background: var(--accent); } .ve-bars i.ok { background: var(--ok-ink); } .ve-bars i.rv { background: var(--accent); opacity: .55; } .ve-bars i.ko { background: #c9902f; }
.ve-count { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ve-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 28px; }
.ve-body > * { max-width: 640px; margin-inline: auto; }
.ve-dock { flex: none; display: grid; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--card); }
.ve-dock > * { max-width: 640px; width: 100%; margin-inline: auto; }
.ve-dock .btn { justify-content: center; min-height: 48px; white-space: normal; }
.ve-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ve-big { font-family: var(--serif); font-size: clamp(24px, 6vw, 30px); line-height: 1.2; margin: 6px 0 12px; }
.ve-k { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ve-enonce { font-size: 18px; line-height: 1.55; margin-bottom: 14px; overflow-x: auto; }
.ve-enonce p { margin: 0; }
.ve-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.ve-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.ve-tag { flex: none; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.ve-tag.sur { background: var(--ok-bg); color: var(--ok-ink); } .ve-tag.revu { background: var(--accent-soft); color: var(--accent-ink); } .ve-tag.travail { background: #f8ead2; color: #7a4f0e; }
.ve-choices { display: grid; gap: 10px; }
.ve-choices .quiz-opt { width: 100%; }
.ve-fb { margin-top: 14px; padding: 12px 14px; border-radius: 14px; line-height: 1.55; overflow-x: auto; }
.ve-fb p { margin: 0 0 6px; }
.ve-fb.ok { background: var(--ok-bg); border-left: 4px solid var(--ok-ink); }
.ve-fb.ko { background: var(--warn-bg); border-left: 4px solid #c0643f; }
.ve-fb.info { background: var(--accent-soft); border-left: 4px solid var(--accent); }
.ve-ex { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--card); }
.ve-ex table { border-collapse: collapse; }
.ve-ex td, .ve-ex th { padding: 4px 10px; border-bottom: 1px solid var(--border-soft); text-align: center; }
.ve-formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 19px; margin: 6px 0 14px; }
.ve-frac { display: inline-flex; flex-direction: column; align-items: stretch; gap: 0; }
.ve-frac .ve-slot:first-child { border-bottom: 2px solid var(--text); border-radius: 10px 10px 0 0; }
.ve-slot { min-width: 160px; min-height: 44px; padding: 6px 10px; border: 1.5px dashed var(--accent); background: var(--card); color: var(--text); font: inherit; font-size: 15px; border-radius: 10px; cursor: pointer; }
.ve-labels, .ve-pool { display: grid; gap: 8px; margin-top: 8px; }
.ve-label, .ve-step, .ve-pill, .ve-yn-b { font: inherit; font-size: 15px; text-align: left; color: var(--text); background: var(--card); border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; min-height: 44px; cursor: pointer; }
.ve-label:disabled { opacity: .4; }
.ve-step[hidden] { display: none; }
.ve-steps { margin: 0 0 10px; padding-left: 24px; display: grid; gap: 6px; }
.ve-steps li { padding: 6px 0; line-height: 1.45; }
.ve-mine { min-height: 44px; border: 1.5px dashed var(--border); border-radius: 12px; padding: 8px 12px 8px 30px; }
.ve-gap { color: var(--accent); font-weight: 700; }
.ve-fixed { margin: 6px 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.ve-reset { margin-top: 8px; }
.ve-sort { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.ve-sort-t p { margin: 0; }
.ve-yn { display: flex; gap: 6px; }
.ve-yn-b { min-width: 56px; text-align: center; }
.ve-yn-b[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ve-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ve-col { display: grid; gap: 8px; align-content: start; }
.ve-pill { text-align: center; position: relative; }
.ve-pill.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ve-pill:not([data-n=""])[data-n] { border-color: var(--accent); background: var(--accent-soft); }
.ve-pill:not([data-n=""])[data-n]::after { content: attr(data-n); position: absolute; top: -8px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.ve-in { width: 4.5em; font: inherit; font-size: 18px; text-align: center; padding: 6px 8px; border: 1.5px solid var(--accent); border-radius: 10px; background: var(--card); color: var(--text); }
.ve-next { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); }
.ve-next p { margin: 0; }
.ve-dlg [tabindex="-1"]:focus { outline: none; }
.ve-note { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.ve-sheet { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 14, 18, .55); }
.ve-sheet-card { width: 100%; max-width: 560px; display: grid; gap: 10px; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--card); }
.ve-sheet-card h2 { margin: 0; font-size: 20px; }
.ve-sheet-card p { margin: 0 0 6px; line-height: 1.5; }
.ve-sheet-card .btn { justify-content: center; min-height: 48px; }
.ve-label:focus-visible, .ve-step:focus-visible, .ve-pill:focus-visible, .ve-yn-b:focus-visible, .ve-slot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  .prog-tabs { overflow-x: auto; }
  .prog-tabs a { flex: none; padding: 10px 14px; }
  .prog-sheet { padding: 18px 16px; }
  .mindmap { display: none; }
  .mm-tree { display: block; }
  .mm-heads, .mm-lines { display: none; }
  .mm-area { height: auto; display: flex; flex-direction: column; gap: 8px; margin: 0; }
  .mm-node { position: static; translate: none; width: auto; text-align: left; }
  .mm-notion:hover { transform: none; }
  .mm-center { order: -1; width: auto; }
  .mm-pre-node { order: 2; }
  .drill { padding: 16px; }
  .ex-prompt { font-size: 17px; }
}

/* Atelier (admin) : le patrimoine de CoachMyStudy */
.atelier-tabs { max-width: 560px; }
.atelier-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.atelier-levels a { text-decoration: none; font-weight: 700; font-size: 14px; color: var(--muted); padding: 7px 12px; border-radius: 99px; border: 1.5px solid var(--border-soft); }
.atelier-levels a.active { color: var(--text); border-color: var(--ink); background: var(--card); }
.atelier-group { margin-bottom: 30px; }
.atelier-h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.atelier-h2 small { font: 400 14px var(--font); }
.atelier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.atelier-card { display: grid; gap: 6px; align-content: start; background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); border-top: 4px solid var(--hl); transition: transform .2s var(--ease-out); }
.atelier-card:hover { transform: translateY(-2px); }
.atelier-card.is-empty { border-top-color: var(--border-soft); }
.atelier-code { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.atelier-cov { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.atelier-cov span { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); opacity: .6; }
.atelier-cov span.on { background: var(--accent-soft); color: var(--accent-ink); opacity: 1; }
.atelier-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.atelier-body { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 14px; line-height: 1.55; min-height: 420px; }
.atelier-hint { font-size: 13px; margin: 0 0 6px; }
.atelier-preview { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.atelier-choices { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; font-size: 15px; }
.atelier-choices li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.atelier-choices li.is-right { background: var(--accent-soft); }
.atelier-choices .qo-letter { width: 24px; height: 24px; font-size: 12px; }
@media (max-width: 900px) {
  .atelier-editor { grid-template-columns: 1fr; }
  .atelier-preview { position: static; max-height: none; }
  .grid.cols-3.atelier-samples { grid-template-columns: 1fr; }
}

/* CV de lycéen : une page A4 (794 × 1123 px), 10 mises en page, couleurs par variables. Toujours sur papier blanc. */
.cv { width: 794px; min-height: 1123px; box-sizing: border-box; background: #fff; color: var(--cv-ink); font-family: var(--font); font-size: 13.5px; line-height: 1.45; padding: 48px 52px; color-scheme: light; }
.cv h1, .cv h2 { font-family: var(--font); }
.cv--serif .cv-name, .cv--serif .cv-sec h2 { font-family: var(--serif); }
.cv-head { margin-bottom: 26px; }
.cv-name { font-size: 34px; line-height: 1.1; margin: 0; letter-spacing: -.01em; color: var(--cv-ink); }
.cv-headline { color: var(--cv-accent); font-weight: 700; margin: 6px 0 0; font-size: 15px; }
.cv-contact { color: #666; margin: 5px 0 0; font-size: 12.5px; }
.cv-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 34px; align-items: start; }
.cv-sec { margin-bottom: 20px; }
.cv-sec h2 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--cv-accent); margin: 0 0 10px; font-weight: 800; }
.cv-profile p { margin: 0; color: #333; }
.cv-items { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.cv-item-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cv-when { color: #777; white-space: nowrap; font-size: 12px; }
.cv-where { color: var(--cv-accent); font-size: 12.5px; font-weight: 600; }
.cv-detail { margin: 2px 0 0; color: #444; }
.cv-tags { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.cv-tags li { padding-left: 12px; position: relative; }
.cv-tags li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--cv-accent); }
/* classique */
.cv--classique .cv-head { text-align: center; border-bottom: 2px solid var(--cv-accent); padding-bottom: 18px; }
.cv--classique .cv-body { grid-template-columns: 1fr; }
.cv--classique .cv-aside { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; border-top: 1px solid var(--cv-soft); padding-top: 16px; }
.cv--classique .cv-sec h2 { border-bottom: 1px solid var(--cv-soft); padding-bottom: 4px; }
/* colonne (à gauche) et colonne à droite */
.cv--colonne .cv-body { grid-template-columns: 220px minmax(0, 1fr); }
.cv--colonne .cv-aside { order: -1; background: var(--cv-accent); color: #fff; padding: 20px 18px; border-radius: 6px; min-height: 860px; }
.cv--colonne .cv-aside h2 { color: #fff; opacity: .85; }
.cv--colonne .cv-aside .cv-tags li::before { background: #fff; }
.cv--colonne-droite .cv-aside { background: var(--cv-soft); padding: 18px; border-left: 4px solid var(--cv-accent); min-height: 860px; }
/* bandeau */
.cv--bandeau .cv-head { margin: -48px -52px 30px; padding: 42px 52px 30px; background: var(--cv-accent); }
.cv--bandeau .cv-name, .cv--bandeau .cv-headline { color: #fff; }
.cv--bandeau .cv-contact { color: rgba(255, 255, 255, .85); }
/* chronologie */
.cv--chronologie .cv-main .cv-items li { position: relative; padding-left: 20px; border-left: 2px solid var(--cv-soft); padding-bottom: 4px; }
.cv--chronologie .cv-main .cv-items li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--cv-accent); box-sizing: border-box; }
/* cartes */
.cv--cartes .cv-main .cv-sec, .cv--cartes .cv-aside .cv-sec { background: var(--cv-soft); padding: 14px 16px; border-radius: 10px; }
.cv--cartes .cv-head { border-left: 6px solid var(--cv-accent); padding-left: 16px; }
/* minimal */
.cv--minimal { padding: 64px 70px; }
.cv--minimal .cv-name { font-weight: 400; font-size: 38px; }
.cv--minimal .cv-head { border-bottom: 1px solid #ddd; padding-bottom: 20px; margin-bottom: 30px; }
.cv--minimal .cv-sec h2 { font-variant: small-caps; text-transform: lowercase; letter-spacing: .08em; font-size: 15px; color: var(--cv-ink); font-weight: 600; }
.cv--minimal .cv-where { color: #555; font-weight: 400; font-style: italic; }
/* audacieux */
.cv--audacieux .cv-head { border-left: 14px solid var(--cv-accent); padding-left: 20px; }
.cv--audacieux .cv-name { font-size: 54px; letter-spacing: -.02em; }
.cv--audacieux .cv-sec h2 { display: inline-block; background: var(--cv-accent); color: #fff; padding: 4px 10px; border-radius: 3px; }
/* deux colonnes */
.cv--deux-colonnes .cv-body { grid-template-columns: 1fr; }
.cv--deux-colonnes .cv-main { columns: 2; column-gap: 30px; }
.cv--deux-colonnes .cv-main .cv-sec { break-inside: avoid; }
.cv--deux-colonnes .cv-aside { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; background: var(--cv-soft); padding: 16px 18px; border-radius: 8px; }
.cv--deux-colonnes .cv-head { border-bottom: 3px solid var(--cv-accent); padding-bottom: 14px; }
/* compact */
.cv--compact { font-size: 12px; padding: 34px 38px; }
.cv--compact .cv-name { font-size: 28px; }
.cv--compact .cv-sec { margin-bottom: 14px; }
.cv--compact .cv-items { gap: 7px; }
.cv--compact .cv-sec h2 { border-bottom: 2px solid var(--cv-accent); padding-bottom: 3px; color: var(--cv-ink); }

/* Éditeur de CV (élève) */
.cv-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 26px; align-items: start; margin-top: 22px; }
.cv-fieldset { border: 0; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 16px 18px 18px; margin: 0 0 14px; min-width: 0; }
.cv-fieldset legend { font-family: var(--serif); font-weight: 600; font-size: 19px; padding: 0; float: left; width: 100%; margin-bottom: 6px; }
.cv-fieldset legend + * { clear: both; }
.cv-hint { font-size: 13.5px; margin: 0 0 10px; }
.cv-rows { display: grid; gap: 10px; margin-bottom: 8px; }
.cv-row { display: grid; grid-template-columns: 1.4fr 1fr .6fr; gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--border-soft); }
.cv-row input { margin: 0; }
.cv-row .cv-row-detail { grid-column: 1 / -1; }
.cv-layouts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cv-layout-pick input, .cv-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.cv-layout-pick span { display: inline-block; padding: 7px 11px; border-radius: 99px; border: 1.5px solid var(--border); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.cv-layout-pick input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.cv-layout-pick input:focus-visible + span, .cv-swatch:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.cv-palettes { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); cursor: pointer; position: relative; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
.cv-swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--sw); }
.cv-swatch:has(input:disabled) { opacity: .25; cursor: not-allowed; }
.cv-save { margin: 4px 0 14px; }
.cv-suggest { background: var(--card); border-left: 4px solid var(--hl); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; margin: 18px 0 0; max-width: 900px; }
.cv-suggest-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px dashed var(--border-soft); }
.cv-suggest-item:first-of-type { border-top: 0; padding-top: 0; }
.cv-guides { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cv-preview-col { position: sticky; top: 14px; }
.cv-preview-col .cv-stage .cv { zoom: .62; }
.atelier-cvbanner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; background: var(--card); border-left: 4px solid var(--hl); border-radius: 14px; padding: 14px 18px; margin: 0 0 18px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.atelier-cvbanner span { color: var(--accent); font-weight: 700; }
@media (max-width: 1000px) {
  .cv-editor { grid-template-columns: 1fr; }
  .cv-preview-col { position: static; order: -1; }
  .cv-preview-col .cv-stage .cv { zoom: .42; }
  .cv-row { grid-template-columns: 1fr 1fr; }
  .cv-row input:first-child { grid-column: 1 / -1; }
}

/* Vignettes (galerie de l'atelier, choix du modèle) */
.cv-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.cv-tile { display: grid; gap: 8px; }
.cv-thumb { width: 200px; height: 283px; overflow: hidden; border-radius: 8px; box-shadow: var(--shadow); border: 1px solid var(--border-soft); background: #fff; position: relative; }
.cv-thumb .cv { transform: scale(.2519); transform-origin: top left; pointer-events: none; }
.cv-tile.is-off .cv-thumb { opacity: .4; }
.cv-tile-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; }
.cv-pick input { position: absolute; opacity: 0; }
.cv-pick input:checked + .cv-thumb { outline: 3px solid var(--accent); outline-offset: 3px; }
.cv-stage { overflow: auto; background: var(--surface-2); border-radius: 18px; padding: 20px; }
.cv-stage .cv { box-shadow: var(--shadow); margin: 0 auto; }

/* Réviser : série du jour, recherche, chapitres par matière et par thème */
.practice-today { margin: 26px 0 8px; max-width: 680px; background: var(--card); border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow); border-left: 6px solid var(--subject, var(--accent)); }
.practice-today h2 { font-size: clamp(24px, 6vw, 32px); margin: 0 0 4px; line-height: 1.15; }
.practice-search { margin: 28px 0 8px; max-width: 680px; }
.practice-search input { width: 100%; }
.practice-subject { margin: 34px 0 0; }
.practice-subject > h2 { font-size: 26px; margin: 0 0 10px; padding-left: 12px; border-left: 4px solid var(--subject, var(--accent)); }
.practice-theme { margin: 18px 0 0; }
.practice-theme h3 { font-size: 15px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.practice-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.practice-list li { min-width: 0; }
.practice-chapter { display: grid; gap: 4px; height: 100%; box-sizing: border-box; padding: 12px 14px; min-height: 56px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: var(--text); text-decoration: none; border-left: 4px solid var(--border-soft); transition: transform .2s var(--ease-out); }
a.practice-chapter:hover { transform: translateY(-2px); }
a.practice-chapter:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.practice-chapter .t { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.practice-chapter .ps-subj { font-size: 13px; font-weight: 700; color: var(--muted); }
.practice-chapter .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.practice-chapter .state { font-weight: 700; }
.practice-chapter .go { justify-self: start; margin-top: 6px; font-weight: 700; color: var(--accent); }
.practice-chapter .bar { display: block; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.practice-chapter .bar > span { display: block; height: 100%; background: currentColor; }
.practice-chapter.is-new { border-left-color: var(--hl); }
.practice-chapter.is-worked { border-left-color: var(--accent); }
.practice-chapter.is-worked .state, .practice-chapter.is-worked .bar { color: var(--accent); }
.practice-chapter.is-fragile { border-left-color: var(--warn-ink); }
.practice-chapter.is-fragile .state, .practice-chapter.is-fragile .bar { color: var(--warn-ink); }
.practice-chapter.is-solid { border-left-color: var(--ok-ink); }
.practice-chapter.is-solid .state, .practice-chapter.is-solid .bar { color: var(--ok-ink); }

/* Atelier : file de relecture professeur */
.review-totals { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 4px 0 0; }
.review-totals p { margin: 0; display: grid; gap: 2px; }
.review-totals strong { font-size: 34px; line-height: 1; }
.review-totals span { font-size: 14px; color: var(--muted); }
.review-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; margin: 14px 0 0; max-width: 860px; }
.review-head { display: flex; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; align-items: flex-start; }
.review-title { font-size: 19px; margin: 2px 0 0; line-height: 1.3; }
.review-title a { color: var(--text); text-decoration: none; }
.review-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.review-points { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.review-points li { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.review-points li.done { opacity: .8; }
.review-form { display: grid; gap: 8px; }
.review-form textarea { width: 100%; box-sizing: border-box; }
.review-io { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; margin: 20px 0 0; max-width: 860px; }
.review-io-box { display: grid; gap: 10px; align-content: start; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; }
.review-io-box select { width: auto; margin: 0; }
.review-chapter-form { gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }

/* Essai : choix du chapitre par le parent, chapitres verrouillés */
.trial-choice { cursor: pointer; position: relative; padding-left: 46px; }
.trial-choice input { position: absolute; left: 14px; top: 16px; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.trial-choice:has(input:checked) { border-left-color: var(--accent); outline: 2px solid var(--accent); }
.trial-submit { position: sticky; bottom: 76px; margin: 26px 0 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.practice-chapter.is-locked { box-shadow: none; background: var(--surface-2); color: var(--muted); border-left-color: var(--border); }
.practice-chapter.is-locked .state { color: var(--muted); }

/* Progrès : entraînement des 30 derniers jours */
.training { margin: 40px 0 0; }
.training h2 { font-size: 26px; margin: 0; }
.training-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 0; }
.training-stats p { margin: 0; display: grid; gap: 4px; align-content: start; }
.training-stats strong { font-size: clamp(26px, 7vw, 36px); line-height: 1; }
.training-stats span { font-size: 14px; color: var(--muted); }
.training-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; align-items: end; height: 76px; margin: 18px 0 0; }
.training-days > span { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; }
.training-days i { align-self: end; display: block; border-radius: 4px 4px 2px 2px; background: var(--accent); min-height: 0; }
.training-days > span::before { content: ""; grid-row: 1; grid-column: 1; align-self: end; height: 3px; border-radius: 2px; background: var(--border-soft); }
.training-days i { grid-row: 1; grid-column: 1; }
.training-days small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.training-days .today small { color: var(--accent); font-weight: 700; }
@media print {
  @page { size: A4; margin: 0; }
  body.cv-print { background: #fff; margin: 0; }
  body.cv-print .cv { box-shadow: none; margin: 0; }
  body.cv-print .no-print { display: none !important; }
}

/* Mode Story : le chapitre en plein écran, une idée par écran. */
.story-launch { display: flex; align-items: center; gap: 16px; width: 100%; margin: 18px 0 6px; padding: 18px 20px; border: 0; border-radius: 24px; cursor: pointer; text-align: left; color: #fff; font: inherit; background: radial-gradient(120% 140% at 0% 0%, #13a3a8 0%, #01696f 45%, #123a52 100%); box-shadow: 0 14px 34px -14px rgba(1, 105, 111, .7); position: relative; overflow: hidden; }
.story-launch[hidden] { display: none; }
.story-launch::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255, 213, 154, .14); pointer-events: none; }
.story-launch .sl-play { flex: 0 0 56px; height: 56px; border-radius: 50%; background: #ffd59a; color: #123a52; display: grid; place-items: center; box-shadow: 0 0 0 0 rgba(255, 213, 154, .6); animation: sl-pulse 2.4s ease-out infinite; }
.story-launch .sl-play svg { width: 24px; height: 24px; fill: currentColor; margin-left: 3px; }
.story-launch strong { display: block; font-family: var(--serif); font-size: 21px; line-height: 1.2; }
.story-launch small { display: block; opacity: .85; font-size: 14px; margin-top: 2px; }
.story-launch:focus-visible { outline: 3px solid var(--hl); outline-offset: 3px; }
@keyframes sl-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 213, 154, .6); } 70%, 100% { box-shadow: 0 0 0 16px rgba(255, 213, 154, 0); } }

html.st-lock { overflow: hidden; }
.story { --st-a: #0e7c80; --st-b: #0b2a33; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: #fff; background: linear-gradient(160deg, var(--st-a), var(--st-b)); transition: background .4s ease; overflow: hidden; font-size: 18px; line-height: 1.6; }
.story::backdrop { background: rgba(10, 14, 18, .8); }
.story[data-kind="memory"] { --st-a: #b7791f; --st-b: #3a2606; }
.story[data-kind="method"] { --st-a: #5b45b0; --st-b: #1c1540; }
.story[data-kind="trap"] { --st-a: #c4462b; --st-b: #3d120a; }
.story[data-kind="start"], .story[data-kind="win"] { --st-a: #13a3a8; --st-b: #123a52; }
.st-bars { position: absolute; top: 10px; left: 14px; right: 60px; display: flex; gap: 4px; z-index: 3; }
.st-bars i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .28); overflow: hidden; position: relative; }
.st-bars i::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.st-bars i.done::after, .st-bars i.now::after { transform: scaleX(1); }
.st-close { position: absolute; top: 2px; right: 6px; z-index: 3; width: 48px; height: 48px; border: 0; background: none; color: #fff; cursor: pointer; display: grid; place-items: center; }
.st-close svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }

.st-track { position: absolute; inset: 0; bottom: 84px; }
.st-slide { position: absolute; inset: 0; padding: 50px 22px 0; display: flex; flex-direction: column; opacity: 0; transform: translateX(24px) scale(.98); pointer-events: none; transition: opacity .3s ease, transform .35s cubic-bezier(.2, .8, .2, 1); }
.st-slide.on { opacity: 1; transform: none; pointer-events: auto; }
.st-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.st-icon { width: 34px; height: 34px; padding: 7px; border-radius: 12px; background: rgba(255, 255, 255, .16); stroke: #fff; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; box-sizing: border-box; }
.st-tag { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.st-title { font-family: var(--serif); font-size: clamp(28px, 8vw, 36px); line-height: 1.12; margin: 0 0 16px; color: #fff; }
.st-start .st-title, .st-win .st-title { font-size: clamp(34px, 10vw, 46px); margin-top: auto; }
.st-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; overscroll-behavior: contain; padding-bottom: 20px; padding-top: 14px; -webkit-mask: linear-gradient(transparent, #000 16px, #000 calc(100% - 26px), transparent); mask: linear-gradient(transparent, #000 16px, #000 calc(100% - 26px), transparent); }
.st-body > * { margin-top: auto; margin-bottom: auto; flex-shrink: 0; }
.st-method .st-body > *, .st-trap .st-body > * { margin-top: 0; }
.st-idea .st-body, .st-memory .st-body { font-size: 19px; }
.st-body .katex { font-size: 1.12em; }
.st-start .st-body, .st-win .st-body { flex: 0 0 auto; margin-bottom: auto; -webkit-mask: none; mask: none; }
.st-body strong, .st-body b { color: #ffe2b8; }
.st-body a { color: #ffe2b8; }
.st-body ul, .st-body ol { padding-left: 22px; }
.st-body li { margin: 8px 0; }
.st-body .katex-display { background: rgba(255, 255, 255, .1); border-radius: 16px; padding: 14px 12px; margin: 12px 0; overflow-x: auto; }
.st-body table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.st-body th, .st-body td { border-bottom: 1px solid rgba(255, 255, 255, .2); padding: 8px 10px 8px 0; text-align: left; color: #fff; background: none; vertical-align: top; }
.st-body th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.st-body .timeline li { border-color: rgba(255, 255, 255, .4); }
.st-body .tl-when { background: #ffd59a; color: #3a2606; }
.st-hint { margin: 0 0 6px; font-size: 14px; font-weight: 700; opacity: .85; display: flex; align-items: center; gap: 8px; }
.st-hint::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #ffd59a; animation: sl-pulse 1.8s ease-out infinite; }

.st-menu { list-style: none; padding: 0 !important; display: grid; gap: 10px; margin: 6px 0 14px; }
.st-menu li { margin: 0; padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, .12); font-size: 17px; }
.st-menu b { font-family: var(--serif); font-size: 24px; margin-right: 6px; color: #ffd59a; }
.st-time { opacity: .85; font-weight: 700; }

/* Dévoilement : méthodes et pièges se découvrent au toucher, le défi mémoire reste flou jusqu'au toucher. */
.st-method .st-hidden, .st-trap .st-hidden { display: none; }
.st-shown { animation: st-pop .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes st-pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.story .m-when { background: rgba(255, 255, 255, .14); color: #fff; border: 0; }
.story .m-steps > li::before { background: #ffd59a; color: #1c1540; }
.story .m-steps > li::after { background: rgba(255, 255, 255, .3); }
.story .m-example { background: rgba(0, 0, 0, .22); border-color: rgba(255, 213, 154, .6); color: #fff; }
.story .m-example strong:first-child { background: #ffd59a; color: #1c1540; }
.story .m-tip { background: rgba(255, 213, 154, .16); color: #fff; border-color: #ffd59a; }
.st-ask { font-size: 20px; font-weight: 700; padding: 16px 18px; border-radius: 18px; background: rgba(0, 0, 0, .22); border: 2px dashed rgba(255, 255, 255, .4); }
.st-why { padding: 4px 18px; border-radius: 18px; background: rgba(255, 255, 255, .12); margin-top: 12px; }

.st-big { font-family: var(--serif); font-size: 24px; line-height: 1.25; }
.st-actions { display: grid; gap: 10px; margin-top: 20px; }
.st-cta, .st-again { min-height: 56px; border-radius: 18px; border: 0; font: inherit; font-weight: 800; font-size: 18px; cursor: pointer; }
.st-cta { background: #ffd59a; color: #123a52; box-shadow: 0 10px 24px -10px rgba(255, 213, 154, .8); }
.st-again { background: rgba(255, 255, 255, .14); color: #fff; }
.st-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.st-confetti i { position: absolute; top: -20px; width: 9px; height: 15px; border-radius: 3px; background: #ffd59a; opacity: 0; }
.st-win.on .st-confetti i { animation: st-fall 2.6s cubic-bezier(.3, .6, .5, 1) forwards; }
.st-confetti i:nth-child(3n) { background: #13d0c4; } .st-confetti i:nth-child(3n+1) { background: #ff8a65; } .st-confetti i:nth-child(4n) { background: #b9a6ff; width: 7px; height: 7px; border-radius: 50%; }
.st-confetti i:nth-child(1) { left: 4%; animation-delay: .05s; } .st-confetti i:nth-child(2) { left: 11%; animation-delay: .3s; } .st-confetti i:nth-child(3) { left: 18%; animation-delay: .12s; } .st-confetti i:nth-child(4) { left: 25%; animation-delay: .5s; } .st-confetti i:nth-child(5) { left: 31%; animation-delay: .2s; } .st-confetti i:nth-child(6) { left: 38%; animation-delay: .65s; } .st-confetti i:nth-child(7) { left: 44%; animation-delay: .08s; } .st-confetti i:nth-child(8) { left: 51%; animation-delay: .4s; } .st-confetti i:nth-child(9) { left: 57%; animation-delay: .18s; } .st-confetti i:nth-child(10) { left: 63%; animation-delay: .55s; } .st-confetti i:nth-child(11) { left: 69%; animation-delay: .1s; } .st-confetti i:nth-child(12) { left: 75%; animation-delay: .35s; } .st-confetti i:nth-child(13) { left: 82%; animation-delay: .25s; } .st-confetti i:nth-child(14) { left: 89%; animation-delay: .6s; } .st-confetti i:nth-child(15) { left: 95%; animation-delay: .15s; } .st-confetti i:nth-child(16) { left: 8%; animation-delay: .8s; } .st-confetti i:nth-child(17) { left: 22%; animation-delay: .95s; } .st-confetti i:nth-child(18) { left: 35%; animation-delay: .75s; } .st-confetti i:nth-child(19) { left: 48%; animation-delay: 1s; } .st-confetti i:nth-child(20) { left: 60%; animation-delay: .85s; } .st-confetti i:nth-child(21) { left: 72%; animation-delay: 1.1s; } .st-confetti i:nth-child(22) { left: 86%; animation-delay: .9s; } .st-confetti i:nth-child(23) { left: 15%; animation-delay: 1.2s; } .st-confetti i:nth-child(24) { left: 41%; animation-delay: 1.3s; } .st-confetti i:nth-child(25) { left: 66%; animation-delay: 1.15s; } .st-confetti i:nth-child(26) { left: 92%; animation-delay: 1.25s; } .st-confetti i:nth-child(27) { left: 28%; animation-delay: 1.4s; }
.st-confetti i:nth-child(2n) { animation-duration: 3.4s !important; } .st-confetti i:nth-child(5n) { animation-duration: 1.9s !important; } .st-confetti i:nth-child(7n) { animation-duration: 4.2s !important; }
@keyframes st-fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(105dvh) rotate(540deg); } }

.st-nav { position: absolute; left: 0; right: 0; bottom: 0; height: 84px; display: flex; gap: 10px; align-items: center; padding: 0 16px calc(env(safe-area-inset-bottom) + 4px); box-sizing: border-box; }
.st-prev, .st-next { height: 56px; border-radius: 18px; border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.st-prev { width: 56px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; }
.st-next { flex: 1; background: #fff; color: #123a52; font-size: 18px; }
.st-prev:focus-visible, .st-next:focus-visible, .st-close:focus-visible, .st-cta:focus-visible, .st-again:focus-visible { outline: 3px solid #ffd59a; outline-offset: 2px; }
.story[data-kind="win"] .st-nav { display: none; }
.story[data-kind="win"] .st-track { bottom: 0; }

/* Sur ordinateur, la story occupe tout l'écran ; seul le texte garde une colonne lisible, centrée. */
@media (min-width: 700px) {
  .story { --st-col: max(22px, calc((100vw - 860px) / 2)); font-size: 20px; }
  .st-slide, .bs-top, .vp-top { padding-left: var(--st-col); padding-right: var(--st-col); }
  .st-slide { padding-top: 72px; }
  .st-bars { left: var(--st-col); right: var(--st-col); top: 18px; }
  .st-close { top: 8px; right: 14px; }
  .st-nav { padding-left: var(--st-col); padding-right: var(--st-col); height: 104px; }
  .st-track { bottom: 104px; }
  .st-title { font-size: 44px; }
  .st-start .st-title, .st-win .st-title { font-size: 58px; }
  .st-idea .st-body, .st-memory .st-body { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .story-launch .sl-play, .st-hint::before { animation: none; }
  .st-slide, .st-bars i::after { transition: none; }
  .st-shown, .st-win.on .st-confetti i { animation: none; }
}

/* Chapitre sur téléphone : une partie à la fois (onglets), « Partie suivante » en bas de chacune. */
.pane-next { display: none; }
html.panes .prog-section.pane-off { display: none; }
html.panes .sheet { min-height: 100dvh; }
html.panes .prog-tabs { top: 64px; margin: 18px -14px 0; padding: 6px 14px; border-radius: 0; scrollbar-width: none; box-shadow: 0 8px 16px -14px rgba(0, 0, 0, .5); }
html.panes .prog-tabs::-webkit-scrollbar { display: none; }
html.panes .prog-tabs a { scroll-snap-align: start; }
html.panes .prog-section { scroll-margin-top: 140px; animation: pane-in .28s var(--ease-out, ease-out) both; }
html.panes .pane-next {
  display: flex; flex-direction: column; gap: 2px; margin: 26px 0 4px; padding: 16px 18px; border-radius: 16px;
  text-decoration: none; color: var(--text); background: var(--accent-soft); border: 1px solid var(--border-soft);
}
html.panes .pane-next small { color: var(--muted); font-size: 13px; font-weight: 700; }
html.panes .pane-next span { font-size: 18px; font-weight: 800; }
html.panes .pane-next:active { transform: scale(.98); }
@keyframes pane-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { html.panes .prog-section { animation: none; } }

/* Ce que le programme officiel demande : utile aux parents, replié en bas de page. */
.prog-fold { margin-bottom: 24px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.prog-fold > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); }
.prog-fold > summary::-webkit-details-marker { display: none; }
.prog-fold > summary::after { content: "+"; font-size: 20px; line-height: 1; }
.prog-fold[open] > summary::after { content: "−"; }
.prog-fold[open] > summary { margin-bottom: 10px; }

/* Degré de maîtrise : Bronze → Argent → Or → Diamant ; une médaille qui rouille se ternit. */
.medal { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; color: #3b2a12; }
.medal::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: .55; }
.mm-step { display: inline-block; margin-left: 6px; padding: 0 7px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; vertical-align: middle; opacity: .8; }
.medal.lv1 { background: linear-gradient(135deg, #f0c9a0, #c98a55); }
.medal.lv2 { background: linear-gradient(135deg, #f1f3f5, #b9c0c8); color: #2c3440; }
.medal.lv3 { background: linear-gradient(135deg, #ffe58a, #e3a823); }
.medal.lv4 { background: linear-gradient(135deg, #d9fbff, #8fd3f4 50%, #c7b8ff); color: #1d2f5a; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6) inset, 0 2px 8px -2px rgba(120, 140, 255, .6); }
.medal.rusty { filter: grayscale(.7) sepia(.5); opacity: .8; }
.mm-legend .medal { margin-left: 0; }
.mt-title .medal { margin-left: 8px; }

/* Questions (story et boss) : la carte question reste claire et lisible sur le fond coloré. */
.story[data-kind="quiz"] { --st-a: #e0592a; --st-b: #4a1530; }
.qz { display: grid; gap: 12px; }
.qz-prompt { background: rgba(255, 255, 255, .1); border-radius: 16px; padding: 12px 14px; font-weight: 600; }
.qz-prompt > :first-child { margin-top: 0; } .qz-prompt > :last-child { margin-bottom: 0; }
.qz-practice { margin: 0; color: inherit; opacity: .85; font-size: .9em; }
.qz-choices { display: grid; gap: 8px; }
.story .quiz-opt { background: #fff; color: #1d2430; border-color: transparent; }
.story .quiz-opt:disabled { cursor: default; }
.story .quiz-opt:disabled:not(.good):not(.bad) { opacity: .55; }
.qz-feedback:empty { display: none; }
.qz-feedback { background: rgba(0, 0, 0, .22); border-radius: 16px; padding: 12px 14px; }
.qz-feedback p { margin: 0 0 6px; } .qz-feedback p:last-child { margin: 0; }
.qz-ok { font-size: 22px; font-weight: 800; color: #b8f5d0; }
.qz-ko { font-weight: 800; color: #ffd59a; }
.qz-steps summary { cursor: pointer; font-weight: 700; text-decoration: underline; }
.qz-steps .md { margin-top: 8px; font-size: 16px; }
.st-quiz .st-body { justify-content: flex-start; }
.st-quiz .st-body > * { margin-top: 0; margin-bottom: 0; }
.st-confetti.small i { animation-duration: 1.6s !important; }
.st-actions a { display: grid; place-items: center; text-decoration: none; text-align: center; padding: 0 16px; }

/* Lanceur du boss, en tête de « S'entraîner ». */
.boss-launch { display: flex; align-items: center; gap: 14px; width: 100%; margin: 14px 0 6px; padding: 14px 18px 14px 12px; border: 0; border-radius: 22px; cursor: pointer; text-align: left; font: inherit; color: #fff; background: linear-gradient(135deg, #7a1f5c, #2a1046); box-shadow: 0 16px 30px -18px rgba(90, 20, 80, .9); transition: transform .2s var(--ease-out); }
.boss-launch:hover { transform: translateY(-2px); }
.boss-launch:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.boss-launch strong { display: block; font-size: 19px; }
.boss-launch small { display: block; opacity: .85; font-size: 14px; line-height: 1.4; }
.bl-face { flex: none; width: 64px; height: 64px; animation: boss-idle 2.4s ease-in-out infinite; }

/* Page chapitre : les actions d'abord. S'entraîner en grand, le reste en tuiles, deux par ligne sur téléphone. */
.chap-go { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 6px; max-width: 760px; }
.cg-tile { position: relative; display: grid; align-content: start; gap: 2px; min-height: 76px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; transition: transform .2s var(--ease-out); }
.cg-tile[hidden] { display: none; }
.cg-tile:hover { transform: translateY(-2px); }
.cg-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cg-tile strong { display: block; font-size: 17px; line-height: 1.25; }
.cg-tile small { display: block; font-size: 13px; line-height: 1.35; color: var(--muted); }
.cg-main { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px 18px; border: 0; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #13a3a8 0%, #01696f 45%, #123a52 100%); box-shadow: 0 14px 30px -18px rgba(1, 105, 111, .8); }
.cg-main strong { font-family: var(--serif); font-size: 22px; }
.cg-main small { color: rgba(255, 255, 255, .85); font-size: 14px; }
.cg-main i { font-style: normal; font-size: 24px; font-weight: 800; }
.cg-ico { width: 44px; height: 44px; border-radius: 50%; background: #ffd59a; color: #123a52; display: grid; place-items: center; }
.cg-ico svg { width: 22px; height: 22px; }
@media (max-width: 540px) { .cg-main ~ .cg-tile:last-child:nth-child(even) { grid-column: 1 / -1; } } /* deux colonnes : une tuile seule prend la ligne */
.cg-story { border: 0; color: #fff; background: linear-gradient(135deg, #0e6b70, #123a52); }
.cg-boss { border: 0; color: #fff; background: linear-gradient(135deg, #7a1f5c, #2a1046); grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.cg-story small, .cg-boss small { color: rgba(255, 255, 255, .82); }
.cg-boss .bl-face { width: 40px; height: 40px; }
.cp-exp { display: grid; gap: 4px; margin: 0 0 14px; padding: 14px 16px; border-radius: 16px; background: var(--hl-soft); color: var(--text); text-decoration: none; }
.cp-exp small { color: var(--accent-ink); font-weight: 700; }
.ex-tip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-soft); white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.mm-help { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.mm-help summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.mm-help .mm-legend { margin-top: 8px; }

/* Le combat. */
.boss-face { width: 100%; height: 100%; }
.bf-body { fill: #8b2d73; stroke: #2a1046; stroke-width: 3; }
.bf-horn { fill: #ffd59a; stroke: #2a1046; stroke-width: 3; stroke-linejoin: round; }
.bf-eye { fill: #fff; } .bf-pupil { fill: #1b0b26; }
.bf-mouth, .bf-brow { fill: none; stroke: #1b0b26; stroke-width: 4; stroke-linecap: round; }
.story.boss { --st-a: #5a1550; --st-b: #12071f; display: flex; flex-direction: column; }
.bs-top { display: flex; align-items: center; gap: 14px; padding: 16px 64px 6px 18px; }
.bs-avatar { flex: none; width: 84px; height: 84px; animation: boss-idle 2.4s ease-in-out infinite; }
.bs-who { flex: 1; min-width: 0; }
.bs-who small { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 800; opacity: .75; }
.bs-who strong { display: block; font-family: var(--serif); font-size: 21px; line-height: 1.2; }
.bs-hp { margin-top: 8px; height: 12px; border-radius: 12px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.bs-hp i { display: block; height: 100%; width: 100%; border-radius: 12px; background: linear-gradient(90deg, #ff5a5f, #ffb36b); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bs-lives { margin: 4px 18px 0; display: flex; gap: 6px; }
.heart { width: 22px; height: 20px; background: #ff5a7a; clip-path: path("M11 20 1.6 10.6A5.5 5.5 0 0 1 11 3.4a5.5 5.5 0 0 1 9.4 7.2z"); transition: transform .3s ease, opacity .3s ease; }
.heart.lost { opacity: .22; transform: scale(.8); }
.bs-arena { position: relative; flex: 1; overflow-y: auto; padding: 10px 18px 18px; }
.bs-round { margin: 0 0 10px; font-size: 14px; font-weight: 800; opacity: .8; }
.boss .st-nav { position: static; height: auto; padding: 8px 16px calc(env(safe-area-inset-bottom) + 14px); }
.boss.hit .bs-avatar { animation: boss-hit .5s ease; }
.boss.ouch { animation: boss-ouch .45s ease; }
.boss.lost .bs-avatar { animation: boss-laugh .6s ease 3; }
.boss.won .bs-avatar { transform: scale(.7) rotate(-12deg); opacity: .4; filter: grayscale(1); transition: all .8s ease; animation: none; }
.bs-verdict { font-family: var(--serif); font-size: 34px; font-weight: 700; margin: 10px 0 4px; }
.bs-sub { margin: 0 0 10px; opacity: .9; }
.bs-weak { background: rgba(255, 255, 255, .12); border-radius: 14px; padding: 12px 14px; }
@keyframes boss-idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes boss-hit { 0% { transform: none; filter: none; } 20% { transform: translateX(-10px) rotate(-8deg); filter: brightness(2.2); } 45% { transform: translateX(10px) rotate(6deg); } 70% { transform: translateX(-5px); } 100% { transform: none; } }
@keyframes boss-ouch { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(255, 60, 60, 0); } 30% { box-shadow: inset 0 0 0 10px rgba(255, 60, 60, .7); } }
@keyframes boss-laugh { 50% { transform: scale(1.12) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .bl-face, .bs-avatar, .boss.hit .bs-avatar, .boss.ouch, .boss.lost .bs-avatar { animation: none; } }
.story .quiz-opt.good { background: #dcf7ea; border-color: #01696f; }
.story .quiz-opt.bad { background: #ffd8cc; border-color: #c0643f; opacity: 1; }
.bs-round { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.bs-arena:focus { outline: none; }

/* « À savoir refaire » : la question se lit, le résultat est flouté jusqu'au toucher. */
.recall-hint { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.rc-row { display: block; padding: 10px 12px; margin: 0 0 8px; border-radius: 12px; background: var(--surface-2); overflow-x: auto; overflow-y: hidden; }
.rc-ans { display: inline-block; vertical-align: middle; font: inherit; color: inherit; border: 0; border-radius: 10px; padding: 2px 8px; margin: 2px 0; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); cursor: pointer; min-height: 34px; min-width: 56px; }
.rc-ans > span { display: inline-block; transition: filter .25s ease; }
.rc-ans:not(.shown):not(.st-shown) > span { filter: blur(7px); }
.rc-ans.shown, .rc-ans.st-shown { box-shadow: inset 0 0 0 2px var(--ok-ink, #01696f); }
.rc-ans:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.story .rc-row { background: rgba(255, 255, 255, .12); }
.story .rc-ans { background: rgba(255, 213, 154, .25); box-shadow: inset 0 0 0 2px #ffd59a; }
.story .recall-hint { color: inherit; opacity: .85; }

/* « Qui est le vrai prof ? » */
.vp-launch { background: linear-gradient(135deg, #0e6b70, #1f1550); margin: 0 0 16px; }
.vp-faces { flex: none; display: flex; }
.vp-faces .vp-av { width: 34px; height: 34px; font-size: 15px; margin-left: -8px; box-shadow: 0 0 0 2px #fff; }
.vp-faces .vp-av:first-child { margin-left: 0; }
.vp-av { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: 20px; }
.story.vp { --st-a: #0e5a66; --st-b: #160d33; }
.vp-top { padding: 18px 64px 4px 18px; }
.vp-top small { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 800; opacity: .75; }
.vp-top strong { display: block; font-family: var(--serif); font-size: 21px; line-height: 1.25; }
.vp-top .bs-lives { margin: 8px 0 0; }
.vp-q { font-size: 20px; font-weight: 800; margin: 4px 0 2px; }
.vp-help { margin: 0 0 12px; opacity: .8; font-size: 15px; }
.vp-list { display: grid; gap: 10px; margin-bottom: 12px; }
.vp-card { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; border: 0; border-radius: 18px; padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.5; color: #1d2430; background: #fff; cursor: pointer; transition: transform .15s ease, opacity .3s ease; }
.vp-card:active { transform: scale(.98); }
.vp-card:disabled { cursor: default; }
.vp-card:focus-visible { outline: 3px solid #ffd59a; outline-offset: 2px; }
.vp-say { min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 3px; } /* une fraction KaTeX ne fait plus apparaître de barre verticale */
.vp-say small { color: #6b6f7a; font-weight: 700; }
.vp-line { display: block; margin-top: 2px; }
.vp-card.vp-wrong { background: #e9ecef; opacity: .7; }
.vp-card.vp-busted { background: #ffd8cc; box-shadow: inset 0 0 0 3px #c0643f; animation: nudge .38s ease both; }
.vp-card.vp-busted .vp-av { filter: grayscale(1); }
.vp-why { margin-top: 8px; }
.vp-reveal { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.vp-reveal .vp-av { width: 72px; height: 72px; font-size: 32px; box-shadow: 0 0 0 4px #ffd59a; }
.vp.won .vp-reveal .bs-verdict { font-size: 28px; }

/* Bande de contexte « ‹ Maths » : la matière où l'on est, et le retour vers le haut. Sur téléphone, elle remplace le logo. */
.ctx-up { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; max-width: 46vw; padding: 0 14px 0 10px; border-radius: 999px; text-decoration: none; font-weight: 800; font-size: 16px; color: var(--text); background: color-mix(in srgb, var(--subject) 16%, var(--bg)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--subject) 55%, transparent); }
.ctx-up:hover { background: color-mix(in srgb, var(--subject) 24%, var(--bg)); }
.ctx-up:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ctx-arrow { font-size: 22px; line-height: 1; color: var(--subject); margin-top: -2px; }
.ctx-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .topbar:has(.ctx-up) .brand { display: none; } }

/* Environnement d'une matière : reprendre, à venir, adversaires, chapitres, tout le programme. */
.env-resume { position: relative; display: grid; gap: 2px; margin: 0 0 22px; padding: 16px 52px 16px 18px; border-radius: 20px; text-decoration: none; color: #fff; background: linear-gradient(135deg, var(--subject), color-mix(in srgb, var(--subject) 55%, #10202a)); box-shadow: 0 14px 28px -18px color-mix(in srgb, var(--subject) 80%, #000); transition: transform .2s var(--ease-out); }
.env-resume:hover { transform: translateY(-2px); }
.env-resume:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.env-resume small { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 800; opacity: .85; }
.env-resume strong { font-size: 20px; line-height: 1.25; }
.env-resume span { font-size: 14px; opacity: .9; }
.env-resume i { position: absolute; right: 18px; top: 50%; translate: 0 -50%; font-style: normal; font-size: 26px; font-weight: 800; }
/* « Reprendre » discret sous la prochaine étape : une seule action principale sur « Aujourd'hui ». */
.resume-link { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 2px; font-size: 15px; color: var(--muted); text-decoration: none; border-top: 1px solid var(--border-soft); }
.resume-link b { color: var(--text); }
.resume-link:hover, .resume-link:focus-visible { color: var(--accent); }
/* La raison du moteur reste entière au survol et pour les lecteurs d'écran ; à l'écran, deux lignes suffisent. */
.cockpit-practice .meta { display: block; } /* la raison se lit en entier : c'est le « pourquoi » de l'étape */
.env-block { margin: 0 0 22px; padding: 14px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.env-block .label-strong { margin: 0 0 6px; }
.env-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-soft); }
.env-row:first-of-type { border-top: 0; }
.env-row .t { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.env-row .t small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.env-row .when { color: var(--muted); font-size: 14px; white-space: nowrap; }
.env-row.is-exam .t::before { content: "Contrôle"; display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--subject); vertical-align: 1px; }
.env-row.is-adversary .t::before { content: "!"; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; font-size: 12px; font-weight: 900; color: #fff; background: #c0643f; vertical-align: 1px; }
.env-more { display: inline-block; margin-top: 6px; font-weight: 700; font-size: 14px; color: var(--accent); }
.env-prog { font-size: 13px; font-weight: 700; color: var(--muted); }
.ch-notions > summary { cursor: pointer; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.ch-notions[open] > summary { margin-bottom: 4px; }
.env-programme { margin-top: 26px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.env-programme > summary { cursor: pointer; display: grid; gap: 2px; list-style: none; }
.env-programme > summary::-webkit-details-marker { display: none; }
.env-programme > summary .label-strong { margin: 0; }
.env-programme > summary .label-strong::after { content: " +"; color: var(--accent); }
.env-programme[open] > summary .label-strong::after { content: " −"; }
.env-programme > summary small { color: var(--muted); font-size: 14px; }
.env-programme .practice-list { margin-top: 12px; }
.env-row.is-adversary .t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Le coach, toujours à portée : un bouton discret en haut, qui part du contexte de l'écran. */
.coach-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 12px; border-radius: 999px; text-decoration: none; font-weight: 800; font-size: 15px; color: var(--accent); background: var(--accent-soft); }
.coach-btn:hover { filter: brightness(.97); }
.coach-btn.active { color: var(--on-accent); background: var(--accent); }
.coach-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  .topbar .avatar { display: none; }
  .coach-btn { padding: 0 12px 0 10px; }
}
@media (max-width: 360px) { .coach-btn span { display: none; } .coach-btn { padding: 0 10px; } }
/* Accueil sur téléphone : la date et la classe tiennent sur une ligne (la voie, l'élève la connaît). */
@media (max-width: 420px) { .eb-track { display: none; } }
/* Avec la puce de la matière, le coach reste là mais en icône sous 420 px : la barre ne dépasse plus de l'écran. */
@media (max-width: 420px) { .topbar:has(.ctx-up) .coach-btn span { display: none; } .topbar:has(.ctx-up) .coach-btn { padding: 0 10px; } }
.only-phone { display: none; }
@media (max-width: 760px) {
  .hide-on-phone { display: none !important; } /* plus fort qu’un display écrit dans la balise */
  .only-phone { display: block; }
  .subnav form.only-phone button { white-space: nowrap; font: inherit; font-weight: 700; color: var(--muted); background: none; border: 1.5px solid var(--border); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
  .ctx-up { max-width: 40vw; }
}
@media (max-width: 420px) { .topbar .brand span { display: none; } }

/* Un piège posé comme une question : le calcul d'abord, puis les réponses, puis le nom du piège et son explication. */
.trap-card.is-quiz { padding: 16px 16px 14px; }
.trap-ask { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.trap-q { margin: 2px 0 0; font-weight: 800; font-size: 17px; line-height: 1.45; min-width: 0; overflow-x: auto; }
.trap-quiz .quiz-opt { min-height: 50px; padding: 10px 12px; }
.trap-reveal { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); border-left: 4px solid #c0643f; animation: pop .35s cubic-bezier(.2, .8, .2, 1.2) both; }
.trap-reveal.was-right { background: var(--ok-bg); border-left-color: var(--ok-ink, #01696f); }
.trap-reveal > :last-child { margin-bottom: 0; }
.trap-name { margin: 0 0 6px; font-weight: 800; }
.trap-name span { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.story .trap-reveal { color: #1d2430; }
.story .st-trap .trap-quiz .quiz-opt { background: #fff; color: #1d2430; }
.story .trap-reveal strong, .story .trap-reveal b { color: inherit; }

/* Comprendre (le déclic) : une notion, deux ou trois gestes, puis « sans les roulettes ». */
.cp-notion { margin: 0 0 22px; padding: 16px 16px 6px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); border-top: 6px solid var(--accent); }
.cp-title { margin: 0 0 10px; font-family: var(--serif); font-size: 21px; line-height: 1.25; }
.cp-move { padding: 12px 0 14px; border-top: 1px solid var(--border-soft); }
.cp-move:first-of-type { border-top: 0; }
.cp-kind { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.cp-move[data-kind="sans les roulettes"] .cp-kind { color: #a3502c; }
[data-theme="dark"] .cp-move[data-kind="sans les roulettes"] .cp-kind { color: #f0a07c; } /* 5,6:1 clair, 7:1 sombre */
.cp-move[data-kind="attendus"] .cp-kind { color: #6b4fd8; }
[data-theme="dark"] .cp-move[data-kind="attendus"] .cp-kind { color: #b9a8ff; }
.cp-q { margin: 0 0 10px; font-weight: 800; font-size: 17px; line-height: 1.45; overflow-x: auto; }
.cp-body > :first-child { margin-top: 0; } .cp-body > :last-child { margin-bottom: 0; }
.cp-limit { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 15px; }
.cp-reveal { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); animation: pop .35s cubic-bezier(.2, .8, .2, 1.2) both; }
.cp-reveal > :first-child { margin-top: 0; } .cp-reveal > :last-child { margin-bottom: 0; }
.cp-input input { flex: 1; min-width: 0; margin: 0; font-size: 18px; }
.cp-verdict { margin: 8px 0 0; font-weight: 800; }
.cp-input.is-ok .cp-verdict { color: var(--ok-ink, #01696f); }
.cp-input.is-ko .cp-verdict { color: #c0643f; }
.story .cp-move { border: 0; padding: 0; }
.story .cp-limit, .story .cp-reveal { color: #1d2430; }
.story .cp-choice { background: #fff; color: #1d2430; }

/* Série du pilote : les étapes qui retirent les aides, et la saisie libre. */
.ex-stage { margin: 0 0 10px; padding: 6px 12px; border-radius: 999px; display: inline-block; font-size: 13px; font-weight: 800; color: var(--accent); background: var(--accent-soft); }
.ex-stage.is-miss { color: #c0643f; background: var(--warn-bg); border-radius: 12px; }
.ex-input { margin: 4px 0 12px; }
.ex-input input { flex: 1; min-width: 0; margin: 0; font-size: 18px; }
.ex-input-msg { margin: 6px 0 0; color: #c0643f; font-weight: 700; }
.ex-diag-alt a { font-weight: 800; }
.cp-notion, .pc-comp { scroll-margin-top: 140px; }
.story .cp-reveal strong, .story .cp-limit strong, .story .cp-limit b { color: inherit; }
.md th .katex { text-transform: none; }
.nc-resume { font-style: normal; font-weight: 700; color: var(--subject); } .quiz-dots i.skipped { opacity: .35; }

/* Sélecteur de matière : un bouton à côté de la bande, une feuille qui monte du bas sur téléphone. */
.ctx-switch { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-left: -2px; border: 0; border-radius: 50%; cursor: pointer; color: var(--text); background: var(--surface-2); }
.ctx-switch svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctx-switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.switcher { width: min(480px, 100vw); max-width: 100vw; max-height: 85dvh; margin: auto auto 0; padding: 0 0 calc(env(safe-area-inset-bottom) + 10px); border: 0; border-radius: 24px 24px 0 0; background: var(--bg); color: var(--text); box-shadow: 0 -20px 50px rgba(0, 0, 0, .25); overflow-y: auto; animation: sw-up .28s cubic-bezier(.2, .8, .2, 1) both; }
.switcher::backdrop { background: rgba(10, 14, 20, .45); }
@media (min-width: 761px) { .switcher { margin: auto; border-radius: 24px; } }
@keyframes sw-up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .switcher { animation: none; } }
.sw-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 16px 12px 8px 18px; background: var(--bg); }
.sw-close { width: 44px; height: 44px; border: 0; background: none; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.sw-close svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.sw-list { list-style: none; margin: 0; padding: 0 12px; display: grid; gap: 6px; }
.sw-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 16px; text-decoration: none; color: var(--text); background: var(--card); box-shadow: var(--shadow); }
.sw-row.is-here { box-shadow: inset 0 0 0 2px var(--subject); }
.sw-row:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sw-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--subject); }
.sw-text { flex: 1; min-width: 0; display: grid; }
.sw-text strong { font-size: 17px; }
.sw-text small { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-text small.is-urgent { color: #c0643f; font-weight: 700; }
.sw-go { color: var(--muted); font-weight: 800; }
.sw-all { display: block; margin: 14px 18px 4px; font-weight: 700; color: var(--accent); }
.send-note { margin: 8px 0 0; font-size: 14px; font-weight: 700; } form.is-sending button[type="submit"] { opacity: .6; cursor: progress; }

/* Contrôle d'entraînement */
.ctl .quiz-opt[aria-pressed="true"] { border-color: var(--ink); background: var(--hl); }
.ctl [data-goto][data-done] { background: var(--ink); color: var(--bg); }
.ctl [data-goto][aria-current="step"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.ctl [data-goto].is-flagged::after { content: " ⚑"; }
.ctl [data-flag][aria-pressed="true"] { border-color: var(--ink); }
.next-detail { margin-top: 12px; font-size: 14px; }
.next-detail summary { cursor: pointer; font-weight: 600; }

/* Saisie mathématique au téléphone : les touches qui manquent au clavier décimal (− / ,), juste sous le champ. */
.mk-row { display: flex; gap: 8px; margin: 8px 0 0; }
.mk-key { flex: 1 1 0; max-width: 96px; min-height: 46px; border: 0; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); font: inherit; font-size: 22px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.mk-key:active { transform: translateY(1px); }
.mk-key:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.ex-input input, .ctl input[inputmode="decimal"] { font-size: max(18px, 1rem); } /* 16 px au moins : l'iPhone ne zoome pas */

/* Brouillon : une feuille quadrillée par-dessus l'activité, la question rappelée en haut. */
html.dr-lock { overflow: hidden; }
.dr-sheet { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--card); color: var(--text); animation: dr-up .2s var(--ease-out) both; }
@keyframes dr-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.dr-top { flex: none; display: flex; gap: 12px; align-items: flex-start; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--border); }
.dr-q { flex: 1; min-width: 0; max-height: 28vh; overflow: auto; font-size: 14px; line-height: 1.4; color: var(--muted); }
.dr-q .ex-prompt { margin: 0; }
.dr-q p { margin: 0 0 4px; }
.dr-top .btn { flex: none; min-height: 44px; }
.dr-paper { flex: 1; position: relative; min-height: 0; background-color: var(--card); background-image: linear-gradient(var(--border-soft) 1px, transparent 1px), linear-gradient(90deg, var(--border-soft) 1px, transparent 1px); background-size: 24px 24px; }
.dr-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.dr-svg.is-eraser { cursor: cell; }
.dr-svg path { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.dr-empty { position: absolute; left: 0; right: 0; top: 40%; margin: 0; text-align: center; color: var(--muted); pointer-events: none; }
.dr-tools { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.dr-tools button { min-height: 50px; border: 0; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.dr-tools button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.dr-tools button:disabled { opacity: .45; cursor: default; }
.dr-tools button:focus-visible, .dr-top .btn:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }

/* Bilan visuel de la série : l'anneau du score, puis les notions en trois colonnes. */
.end-hero { position: relative; width: 168px; height: 168px; margin: 4px auto 0; }
.end-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.end-ring circle { fill: none; stroke-width: 11; }
.end-ring .er-bg { stroke: var(--border-soft); }
.end-ring .er-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 0 327; transition: stroke-dasharray .9s var(--ease-out); }
.end-hero .big-number { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; font-size: 52px; }
.end-hero .big-number small { font-size: 22px; }
.end-notions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; max-width: 560px; margin: 16px auto 0; text-align: left; }
.en-col { border-radius: var(--radius); padding: 12px; }
.en-ok { background: var(--ok-bg); } .en-mid { background: var(--hl-soft); } .en-ko { background: var(--warn-bg); }
.en-h { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.en-ok .en-h { color: var(--ok-ink); } .en-mid .en-h { color: var(--late-ink); } .en-ko .en-h { color: var(--warn-ink); }
.en-t { margin: 4px 0 0; font-weight: 700; font-size: 15px; line-height: 1.3; }
@media (prefers-reduced-motion: reduce) { .dr-sheet { animation: none; } .end-ring .er-fg { transition: none; } }
.mk-key.mk-draft { flex: 1.8 1 0; max-width: none; font-size: 16px; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }

/* Navigation visuelle (téléphone d'abord) : menu latéral, mission du jour en carte, matières en cartes à jauge. */
.menu-btn { display: none; flex: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 0; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; }
.menu-btn:focus-visible, .drawer a:focus-visible, .drawer button:focus-visible, .hs-card:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.drawer { margin: 0; padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); width: min(300px, 86vw); max-width: none; height: 100%; max-height: none; border: 0; background: var(--card); color: var(--text); box-shadow: 8px 0 30px rgba(0, 0, 0, .18); overflow-y: auto; }
.drawer[open] { display: flex; flex-direction: column; gap: 2px; animation: drawer-in .2s var(--ease-out) both; }
.drawer::backdrop { background: rgba(29, 36, 48, .42); }
@keyframes drawer-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drawer-head .brand { font-size: 19px; }
.drawer-x { width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--surface-2); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.drawer a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 14px; color: var(--text); font-weight: 700; text-decoration: none; }
.drawer a.active { background: var(--accent-soft); color: var(--accent-ink); }
.drawer a.drawer-more { min-height: 40px; color: var(--muted); font-weight: 400; font-size: 15px; }
.drawer-sec { margin: 12px 12px 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.drawer-dot { flex: none; width: 12px; height: 12px; border-radius: 4px; }
.drawer hr { width: 100%; border: 0; border-top: 1px solid var(--border-soft); margin: 10px 0; }
.drawer-out button { width: 100%; min-height: 48px; padding: 0 12px; text-align: left; border: 0; border-radius: 14px; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.home-subjects { margin-top: 36px; }
.hs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.hs-card { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); color: var(--text); text-decoration: none; border-left: 4px solid var(--subject, var(--accent)); transition: transform .2s var(--ease-out); }
.hs-card:active { transform: scale(.98); }
.hs-ring { flex: none; }
.hs-ring circle { fill: none; stroke-width: 6; }
.hs-ring .bg { stroke: var(--border-soft); }
.hs-ring .fg { stroke: var(--subject, var(--accent)); stroke-linecap: round; }
.hs-ring text { font: 700 11px var(--font); fill: var(--text); }
.hs-txt { display: grid; min-width: 0; }
.hs-txt strong { font-size: 15px; line-height: 1.25; }
.hs-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Petit téléphone : jauge plus fine, pour que « Mathématiques » tienne sans se casser. */
@media (max-width: 400px) {
  .home-subjects .hs-card { gap: 6px; padding: 10px 8px; }
  .home-subjects .hs-card .hs-ring { width: 34px; height: 34px; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .hs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* La mission du jour : une grande carte, un seul bouton. */
  .home-mission .practice-chapter.cockpit-practice { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 0; border-radius: 24px; background: var(--accent); color: var(--on-accent); box-shadow: 0 14px 30px -18px rgba(1, 105, 111, .8); }
  .home-mission .practice-chapter.cockpit-practice .t { font-family: var(--serif); font-size: 24px; line-height: 1.15; }
  .home-mission .practice-chapter.cockpit-practice .ps-subj { color: rgba(255, 255, 255, .8); font-size: 14px; }
  .home-mission .practice-chapter.cockpit-practice .meta { display: block; color: rgba(255, 255, 255, .85); font-size: 14px; }
  .home-mission .practice-chapter.cockpit-practice .go { align-self: flex-start; margin-top: 10px; padding: 12px 18px; border-radius: 14px; background: #ffd59a; color: #3a2200; font-size: 17px; }
  .today-hello { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }
.sh-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hs-txt strong { overflow-wrap: break-word; hyphens: auto; } /* jamais « Mathématique / s » : couper seulement un mot qui ne tient pas seul */
@media (max-width: 760px) {
  .hs-card { gap: 10px; padding: 10px; }
  .hs-card .hs-ring { width: 40px; height: 40px; }
  .hs-txt strong { font-size: 14px; }
  .drawer a { min-height: 44px; }
  /* Accueil : la phrase du coach seule, son détail reste sur grand écran. */
  .coach-aside.only-narrow .coach-voice { font-size: 18px !important; }
  .coach-aside.only-narrow .coach-voice + p { display: none; }
}
@media (max-width: 760px) {
  /* Accueil en un écran : bonjour, coach en deux lignes, mission, matières. */
  .today-hello { font-size: 32px; margin-bottom: 0; }
  .coach-aside.only-narrow { margin-top: 12px !important; padding-top: 6px; padding-bottom: 6px; }
  .coach-aside.only-narrow .coach-sign { display: none; }
  .coach-aside.only-narrow .coach-voice { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: 17px !important; line-height: 1.3; }
  .home-mission { margin-top: 18px !important; }
  .env-resume { margin-top: 16px !important; }
  .home-subjects { margin-top: 22px; }
  /* Devoir urgent : la même carte que la prochaine étape, une action dominante. */
  .mission-card { padding: 20px; border-radius: 24px; background: var(--accent); color: var(--on-accent); box-shadow: 0 14px 30px -18px rgba(1, 105, 111, .8); }
  .mission-card .label-strong { color: rgba(255, 255, 255, .85) !important; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin: 0; }
  .mission-card .focus-title { margin: 6px 0 4px; font-size: 24px; color: #fff; }
  .mission-card .focus-title .mark { background: none; color: inherit; }
  .mission-card .focus-why { margin: 0; color: rgba(255, 255, 255, .85); font-size: 14px; }
  .mission-actions { margin-top: 14px !important; gap: 8px !important; align-items: center; }
  .mission-actions > .btn:first-child { flex: 1 1 100%; justify-content: center; background: #ffd59a; color: #3a2200; border-color: transparent; font-size: 17px; }
  .mission-actions .btn.quiet { min-height: 40px; padding: 6px 12px; background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .45); font-size: 14px; }
}
@media (max-width: 760px) {
  /* Après un devoir urgent, la prochaine étape d'entraînement reste là, en une ligne. */
  .next-step-after { margin-top: 18px !important; }
  .next-step-after .row.between a, .next-step-after .rhythm { display: none; }
  .next-step-after .cockpit-practice { margin-top: 6px !important; padding: 10px 12px; min-height: 0; }
  .next-step-after .cockpit-practice .meta { display: none; }
  .next-step-after .cockpit-practice .go { margin-top: 2px; }
}
@media (max-width: 760px) { .home-mission .rhythm { display: none; } }

/* Carte de maîtrise (espace matière) : une ligne par chapitre, ses notions en blocs. */
.mastery-map .row.between { margin-bottom: 6px; }
.mm-legend-btn { min-height: 40px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.mm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.mm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mm-row { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 2px; border-bottom: 1px solid var(--border-soft); color: var(--text); text-decoration: none; }
a.mm-row:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; border-radius: 8px; }
.mm-t { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.mm-blocks { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 46%; }
.mm-b { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.mm-b.m { background: #2f9e6b; } .mm-b.p { background: #f2b33d; } .mm-b.t { background: #e2553b; } .mm-b.n { background: var(--border-soft); box-shadow: inset 0 0 0 1px var(--border); }
.mm-more { margin-top: 8px; border: 0; background: none; font: inherit; cursor: pointer; }

/* Arrivée en mouvement : invisible jusqu'à son tour (au plus 1,5 s, jamais en mouvement réduit). */
.m-pending .home-mission, .m-pending .hs-card, .m-pending .sh-hero, .m-pending .env > .env-resume, .m-pending .env-tile, .m-pending .mastery-map .mm-b { opacity: 0; }
.m-burst { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.m-burst i { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; }

/* La matière, mini-application à sa couleur : le bandeau, sa jauge, puis les missions. */
.sh-hero { position: relative; overflow: hidden; padding: 18px 20px 22px; border: 0; border-radius: 28px; background: color-mix(in srgb, var(--subject, var(--accent)) 80%, #0c1a1c); color: #fff; }
.sh-hero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); pointer-events: none; }
.sh-hero .eyebrow, .sh-hero .sh-sub { color: rgba(255, 255, 255, .82); }
.sh-hero h1 { color: #fff; }
.sh-sub { margin: 4px 0 0; font-size: 15px; }
.sh-hero .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .4); background: transparent; }
.sh-hero .btn.quiet { color: #fff; border-color: rgba(255, 255, 255, .45); background: transparent; }
.sh-hero .btn:not(.ghost):not(.quiet) { background: #fff; color: var(--ink); border-color: #fff; }
.sh-hero .hs-ring .bg { stroke: rgba(255, 255, 255, .22); }
.sh-hero .hs-ring .fg { stroke: #ffd59a; }
.sh-hero .hs-ring text { fill: #fff; }
.sh-hero .sh-ring { width: 78px; height: 78px; }
.sh-hero .notion-meter { margin-top: 16px; }
.env-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 6px; }
.env-tile { display: flex; flex-direction: column; gap: 4px; min-height: 104px; padding: 12px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: transform .2s var(--ease-out); }
.env-tile:active { transform: scale(.97); }
.env-tile:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.env-tile svg { width: 26px; height: 26px; fill: none; stroke: var(--subject, var(--accent)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.env-tile b { font-size: 14px; line-height: 1.25; }
.env-tile small { font-size: 12px; color: var(--muted); }
.env-fold { margin-top: 18px; }
.env-fold > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; list-style: none; }
.env-fold > summary::-webkit-details-marker { display: none; }
.env-fold > summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; margin-right: 6px; }
.env-fold[open] > summary::after { transform: rotate(-135deg); }
@media (max-width: 760px) {
  .sh-hero { margin: -6px -14px 0; padding: 16px 18px 22px; border-radius: 0 0 28px 28px; }
  .sh-hero h1 { font-size: 30px; }
  .env-tiles { gap: 8px; }
  .env-tile { min-height: 96px; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .env-tile, .env-fold > summary::after { transition: none; } }
.sh-hero.subject-head { padding-left: 20px; }
.sh-hero.subject-head::before { display: none; }
.sh-hero .notion-meter .c { background: #fff; opacity: 1; }
.sh-hero .notion-meter .w { background: #fff; opacity: .55; }
.sh-hero .notion-meter .n { background: rgba(255, 255, 255, .2); }
/* Dans le bandeau, les boutons restent secondaires : l'action principale est la mission juste dessous. */
.sh-hero .row .btn { min-height: 40px; padding: 6px 14px; font-size: 15px; }
.sh-hero .btn:not(.ghost):not(.quiet) { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .45); }

/* Chapitre : le même bandeau que la matière ; le titre reste lisible sur la couleur. */
.ch-hero { margin-bottom: 4px; }
.sh-hero .mark, .sh-hero .mark.on { background: none; color: inherit; box-shadow: inset 0 -0.28em 0 rgba(255, 213, 154, .45); }
.cg-pic { display: block; margin-bottom: 6px; }
.cg-pic svg { width: 26px; height: 26px; fill: none; stroke: var(--subject, var(--accent)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-pending .chap-go .cg-tile:not([hidden]) { opacity: 0; }

/* Fin de série : « Et maintenant ? » devient la carte de la prochaine mission. */
.drill-next { padding: 18px 20px; border-radius: 24px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #13a3a8 0%, #01696f 45%, #123a52 100%); box-shadow: 0 14px 30px -18px rgba(1, 105, 111, .8); text-align: left; }
.drill-next .label-strong { color: rgba(255, 255, 255, .8); }
.drill-next .drill-next-why { color: #fff; font-size: 17px; }
.drill-next [data-next-actions] { justify-content: flex-start !important; }
.drill-next [data-next-actions] .btn:first-child { background: #ffd59a; color: #3a2200; border-color: transparent; font-size: 17px; }
.drill-next [data-next-actions] .btn.quiet { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.drill-next details, .drill-next summary, .drill-next a:not(.btn) { color: rgba(255, 255, 255, .88); }
.cg-story .cg-pic svg, .cg-boss .cg-pic svg { stroke: #fff; }

/* Bilan : la maîtrise enregistrée, distincte de la réussite de la série. */
.end-mastery { max-width: 560px; margin: 16px auto 0; padding: 14px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); text-align: left; }
.em-h { margin: 0; font-weight: 700; }
.em-why { margin: 2px 0 8px; font-size: 13px; color: var(--muted); }
.em-row { padding: 8px 0; border-top: 1px solid var(--border-soft); }
.em-t { margin: 0 0 4px; font-weight: 700; font-size: 15px; line-height: 1.3; }
.em-lv { display: inline-flex; align-items: center; gap: 3px; }
.em-lv i { width: 16px; height: 8px; border-radius: 4px; background: var(--border-soft); }
.em-lv i.on { background: var(--accent); }
.em-lv.lv3 i.on, .em-lv.lv4 i.on { background: #2f9e6b; }
.em-lv.rusty i.on { background: #b98a5a; }
.em-lv b { margin-left: 8px; font-size: 13px; }
.em-next { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

/* Série de jours (bienveillante) : la pastille de l'accueil, la semaine du bilan. */
.hello-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.streak-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: #fff1de; color: #8a4b08; font-weight: 700; font-size: 15px; }
.streak-chip svg { fill: #e08a1e; }
.streak-chip.is-pending { background: var(--surface-2); color: var(--muted); }
.streak-chip.is-pending svg { fill: var(--muted); }
[data-theme="dark"] .streak-chip { background: #3a2c17; color: #ffd59a; }
.end-streak { max-width: 560px; margin: 16px auto 0; padding: 14px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); text-align: left; }
.es-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 700; }
.es-h svg { fill: #e08a1e; }
.es-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.es-d { display: grid; justify-items: center; gap: 4px; }
.es-d i { width: 30px; height: 30px; border-radius: 10px; background: var(--surface-2); }
.es-d.done i { background: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.es-d.done i::after { content: "✓"; display: grid; place-items: center; height: 100%; color: #fff; font-weight: 700; font-style: normal; }
.es-d.rest i { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 4px, var(--border-soft) 4px 8px); }
.es-d.today i { box-shadow: inset 0 0 0 2px var(--accent); }
.es-d small { font-size: 11px; color: var(--muted); }
.es-why { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* Activité immersive (série en plein écran) : la question en carte, la progression en barre, les choix en grandes cartes,
   les coups de pouce en indices, les réussites d'affilée, le brouillon mis en avant quand il est conseillé. */
.drill-dlg .quiz-dots { flex: 1; min-width: 80px; gap: 4px; }
.drill-dlg .quiz-dots i { flex: 1; width: auto; height: 6px; border-radius: 3px; transform: none; }
.drill-dlg .quiz-dots i.on { background: var(--ink); transform: none; }
.drill-dlg .quiz-dots i.good { background: #2f9e6b; }
.drill-dlg .quiz-dots i.bad { background: #f2b33d; box-shadow: none; }
.dd-combo { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #fff1de; color: #8a4b08; font-size: 13px; font-weight: 700; white-space: nowrap; }
.dd-combo[hidden] { display: none; }
[data-theme="dark"] .dd-combo { background: #3a2c17; color: #ffd59a; }
.drill-dlg .ex-prompt { padding: 18px 18px 16px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); border-top: 5px solid var(--accent); font-size: 20px; line-height: 1.5; }
.drill-dlg .quiz-opt { min-height: 62px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border-color: transparent; }
.drill-dlg .quiz-opt:not(:disabled):active { transform: scale(.98); }
.drill-dlg .quiz-opt.good { border-color: #2f9e6b; background: #e6f5ec; }
.drill-dlg .quiz-opt.bad { border-color: #c0643f; background: var(--warn-bg); }
[data-theme="dark"] .drill-dlg .quiz-opt.good { background: #1f3328; }
.drill-dlg .ex-hint { position: relative; padding: 12px 14px 12px 46px; border-radius: 16px; }
.drill-dlg .ex-hint::before { content: ""; position: absolute; left: 14px; top: 13px; width: 20px; height: 20px; background: currentColor; color: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2.1h5c0-.9.4-1.6 1-2.1A6 6 0 0 0 12 3z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2.1h5c0-.9.4-1.6 1-2.1A6 6 0 0 0 12 3z'/%3E%3C/svg%3E") center / contain no-repeat; }
.drill-dlg .ex-input input { height: 56px; border-radius: 16px; font-size: 20px; font-weight: 700; }
.dd-draft.is-suggested { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.dd-draft.is-suggested::after { content: "conseillé"; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; }
@media (max-width: 760px) {
  .drill-dlg .quiz-head p .muted, .drill-dlg .quiz-head p .ex-tip { display: none; }
  .drill-dlg .ex-prompt { font-size: 19px; }
}
/* Zone tactile d'au moins 44 px pour le lien « Mes matières » au-dessus de la prochaine étape. */
.home-mission .row.between > a, .next-step-after .row.between > a { display: inline-flex; align-items: center; min-height: 44px; }
/* Cartes mission : un pétrole foncé fixe, quel que soit le thème (en sombre, l'accent devient clair et le blanc ne se lit plus). */
.home-mission .practice-chapter.cockpit-practice, .mission-card { background: #01696f; }

/* Comprendre, « manipuler » : ordonner, classer, curseur. Grandes zones à toucher, état lisible sans la couleur. */
.mp { margin-top: 10px; }
.mp-stage { margin-top: 10px; }
.mp-order { list-style: none; counter-reset: mp; margin: 0; padding: 0; display: grid; gap: 8px; }
.mp-step { counter-increment: mp; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 16px; background: var(--card); color: var(--text); box-shadow: var(--shadow); border: 2px solid transparent; }
.mp-step::before { content: counter(mp); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: 14px; }
.mp-step .mp-txt, .mp-item .mp-txt { flex: 1; min-width: 0; line-height: 1.4; }
.mp-arrows { display: flex; flex-direction: column; gap: 4px; }
.mp-arrow { width: 44px; height: 36px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer; }
.ex-manip .mp-arrow { height: 44px; } /* série d'exercices : flèches de 44 px au doigt */
.ex-manip .mp-check { width: 100%; } /* « Valider » : toute la largeur, sous la manipulation */
.mp-arrow:disabled { opacity: .35; }
.mp-sort { display: grid; gap: 8px; }
.mp-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 16px; background: var(--card); color: var(--text); box-shadow: var(--shadow); border: 2px solid transparent; }
.mp-cats { display: flex; gap: 6px; }
.mp-cat { min-height: 44px; padding: 6px 14px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.mp-cat[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.mp-step.ok, .mp-item.ok { border-color: #2f9e6b; }
.mp-step.ko, .mp-item.ko { border-color: #f2b33d; }
.mp-step.ok::before { content: "✓"; background: #2f9e6b; color: #fff; }
.mp-check { margin-top: 12px; }
.mp-say { margin: 8px 0 0; font-weight: 700; }
.mp-arrow:focus-visible, .mp-cat:focus-visible, .mp-range:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.mp-slide-lab { display: block; font-weight: 700; font-size: 18px; }
.mp-slide-lab output { font-variant-numeric: tabular-nums; }
.mp-range { width: 100%; height: 44px; accent-color: var(--accent); }
.mp-val { margin: 6px 0; font-size: 18px; }
.mp-val b { font-size: 24px; font-variant-numeric: tabular-nums; }
.mp-bars { display: grid; gap: 6px; }
.mp-bar { display: flex; align-items: center; gap: 8px; }
.mp-bar i { display: block; height: 14px; border-radius: 7px; background: var(--border); transition: width .15s ease-out; }
.mp-bar.val i { background: var(--accent); }
.mp-bar small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-cmp { margin: 8px 0 0; font-weight: 700; }
.mp-cmp.lt { color: var(--late-ink); } .mp-cmp.gt { color: var(--accent-ink); }
.mp-plot svg { width: 100%; max-width: 420px; height: auto; margin-top: 8px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); }
.mp-plot .ax, .mp-plot .ay { stroke: var(--border); stroke-width: 1.5; }
.mp-scene { margin: 0 0 12px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.mp-grab-hint { position: absolute; transform: translate(-50%, -115%); padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); animation: grab-hint 1.6s ease-in-out infinite; }
.mp-grab-hint.below { transform: translate(-50%, 15%); }
@keyframes grab-hint { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) { .mp-grab-hint { animation: none; } }
.mp-scene svg { display: block; width: 100%; height: auto; }
.mp-scene [data-glisser] { cursor: grab; touch-action: none; } /* le doigt déplace l’objet au lieu de faire défiler la page */
.mp-dragging .mp-scene [data-glisser] { cursor: grabbing; }
.mp-bet .cp-choice.chosen { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); } /* l'hypothèse retenue, jugée après l'expérience */
.mp-constat { margin-top: 14px; display: grid; gap: 8px; }
.mp-constat-q { margin: 0; font-weight: 700; }
.mp-constat-opt { text-align: left; font: inherit; padding: 12px 14px; min-height: 48px; border-radius: 14px; border: 2px solid var(--border); background: var(--card); color: inherit; cursor: pointer; }
.mp-constat-opt.ok { border-color: var(--ok-ink); background: var(--ok-bg); color: var(--ok-ink); }
.mp-constat-opt.ko { border-color: var(--warn-ink); background: var(--warn-bg); color: var(--warn-ink); }
.mp-constat-opt:disabled { cursor: default; }
.mp-verdict { margin: 10px 0 6px; font-weight: 700; }
.mp-verdict.ok { color: var(--ok-ink); } .mp-verdict.ko { color: var(--warn-ink); }
.mp-bet + .mp-intro { margin-top: 14px; }
.mp-plot .cv { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.mp-plot text { font: 11px var(--font); fill: var(--muted); }
/* Désigner : les parties du graphique se touchent ; rien ne les distingue avant (la forme ne trahit pas la réponse). */
.mp-pick svg { max-width: 560px; }
.mp-zone { fill: transparent; cursor: pointer; outline: none; transition: fill .2s ease; }
.mp-zone:hover, .mp-zone:focus-visible { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.mp-zone:focus-visible { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; }
.mp-zone.ok { fill: color-mix(in srgb, #2f9e6b 22%, transparent); }
.mp-zone.ko { fill: color-mix(in srgb, #c0643f 18%, transparent); }
.mp-pick .cv, .mp-pick line, .mp-pick text { pointer-events: none; }
.mp-pick-do { font-weight: 700; margin: 4px 0 0; }
.mp-ax-y { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.mp-ax-name { font-weight: 700; }
/* Construire : la réponse se compose en touchant les morceaux de la réserve ; un morceau touché dans la réponse y retourne. */
.mp-answer { list-style: none; counter-reset: mpb; margin: 10px 0; padding: 10px; min-height: 56px; display: grid; gap: 8px; border: 2px dashed var(--border); border-radius: 16px; }
.mp-answer.empty::before { content: "Touche les morceaux ci-dessous pour construire ta réponse, dans l’ordre."; color: var(--muted); font-size: 15px; align-self: center; }
.mp-built { counter-increment: mpb; display: flex; align-items: flex-start; gap: 8px; }
.mp-built::before { content: counter(mpb); flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 10px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: 13px; }
.mp-bank { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.mp-piece { font: inherit; font-size: 16px; line-height: 1.4; text-align: left; color: var(--text); background: var(--card); border: 2px solid var(--border); border-radius: 14px; padding: 10px 12px; min-height: 48px; cursor: pointer; box-shadow: var(--shadow); }
.mp-built .mp-piece { flex: 1; border-color: var(--accent); }
.mp-piece:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mp-piece.ok { border-color: #2f9e6b; }
.mp-piece.ko { border-color: #f2b33d; }
.mp-piece:disabled { cursor: default; }
/* Copie : un raisonnement à examiner ligne par ligne ; les lignes vérifiées restent marquées, la faute trouvée ressort. */
.mp-copy { list-style: none; counter-reset: mpc; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.mp-copy li { counter-increment: mpc; display: flex; align-items: center; gap: 8px; }
.mp-copy li::before { content: counter(mpc); flex: none; width: 24px; text-align: right; color: var(--muted); font-size: 13px; font-weight: 700; }
.mp-line { flex: 1; font: inherit; font-size: 17px; text-align: left; color: var(--text); background: var(--card); border: 2px solid var(--border); border-radius: 12px; padding: 10px 12px; min-height: 48px; cursor: pointer; overflow-x: auto; }
.mp-line:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mp-line.checked { border-color: #2f9e6b; }
.mp-line.ko { border-color: #f2b33d; }
.mp-line.found { border-color: #c0643f; background: var(--warn-bg); }
.mp-line:disabled { cursor: default; }
/* Construire, en phrase : des pastilles alignées qui forment la phrase. */
.mp-answer.mp-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; counter-reset: none; }
.mp-answer.mp-inline .mp-built::before { display: none; }
.mp-answer.mp-inline .mp-built .mp-piece, .mp-bank.mp-inline .mp-piece { flex: none; min-height: 44px; padding: 8px 12px; }
/* Trous : chaque trou est une liste native, habillée en pastille dans la phrase. */
.mp-gaps { margin: 8px 0 10px; font-size: 18px; line-height: 2.3; }
.mp-gap-line { margin: 0 0 6px; }
.mp-gap { font: inherit; font-size: 17px; font-weight: 700; color: var(--accent-ink, var(--accent)); background: var(--accent-soft); border: 2px solid var(--accent); border-radius: 12px; padding: 4px 8px; min-height: 44px; max-width: 100%; cursor: pointer; vertical-align: middle; }
.mp-gap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mp-gap.ok { border-color: #2f9e6b; background: #e6f5ec; color: #1d5a3a; }
.mp-gap.ko { border-color: #f2b33d; background: var(--warn-bg); color: var(--text); }
/* Placer : les étiquettes de la réserve ; quand l'une est choisie, les cases s'éclairent pour dire où la poser. */
.mp-chips:empty { display: none; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; padding: 10px; border-radius: 16px; background: var(--surface-2); min-height: 52px; }
.mp-chip { font: inherit; font-size: 15px; font-weight: 600; line-height: 1.3; text-align: left; color: var(--text); background: var(--card); border: 2px solid var(--border); border-radius: 12px; padding: 8px 12px; min-height: 44px; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.mp-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.mp-chip:focus-visible, .mp-drop:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mp-chip.ok { border-color: #2f9e6b; } .mp-chip.ko { border-color: #f2b33d; background: var(--warn-bg); }
.mp-chip:disabled, .mp-drop:disabled { cursor: default; }
.mp-drop { font: inherit; color: var(--text); cursor: pointer; border: 2px dashed var(--border); background: transparent; border-radius: 12px; transition: border-color .2s ease, background .2s ease; }
.mp-choosing .mp-drop:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.mp-drop .mp-chip { box-shadow: none; }
/* Figure (carte, schéma, géométrie) : l'image pleine largeur, ses repères numérotés posés en pourcentage. */
.mp-figure { position: relative; margin: 10px auto; max-width: 560px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.mp-fig-img { display: block; width: 100%; height: auto; }
.mp-mark { position: absolute; translate: -50% -50%; /* pas transform : l’animation « pop » l’écrirait et décentrerait le repère */ min-width: 40px; height: 40px; padding: 0 8px; border-radius: 999px; border: 3px solid #fff; background: var(--accent); color: #fff; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; }
.mp-mark:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.mp-mark.ok { background: #2f9e6b; } .mp-mark.ko { background: #c0643f; }
.mp-mark:disabled { cursor: default; }
.mp-mark-slot { border-style: dashed; background: rgba(1, 105, 111, .85); }
.mp-choosing .mp-mark-slot:not(:disabled) { background: var(--accent); box-shadow: 0 0 0 4px var(--hl); }
.mp-mark-slot:has([data-mp-chip]) { padding: 0; border: 0; background: transparent; box-shadow: none; height: auto; max-width: 46%; }
.mp-mark-slot:has([data-mp-chip]) .mp-mark-n { display: none; }
.mp-mark-slot .mp-chip { font-size: 13px; padding: 6px 10px; min-height: 36px; white-space: normal; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
/* Frise : une période par ligne, de la plus ancienne à la plus récente, le long d'un trait. */
.mp-frise { list-style: none; margin: 10px 0; padding: 0 0 0 14px; border-left: 4px solid var(--accent); display: grid; gap: 8px; }
.mp-period { position: relative; display: grid; grid-template-columns: max-content 1fr; gap: 10px; align-items: stretch; }
.mp-period::before { content: ""; position: absolute; left: -22px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.mp-years { font-weight: 800; font-variant-numeric: tabular-nums; padding-top: 12px; white-space: nowrap; font-size: 15px; }
.mp-period .mp-drop { min-height: 52px; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; text-align: left; }
@media (max-width: 520px) { .mp-period { grid-template-columns: 1fr; gap: 4px; } .mp-years { padding-top: 6px; } .mp-period::before { top: 10px; } }
/* Schéma : des boîtes reliées par des flèches ; à la verticale sur un téléphone. */
.mp-chain { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 10px auto; max-width: 440px; }
.mp-chain + .mp-chain { margin-top: 22px; padding-top: 18px; border-top: 2px dashed var(--border, #d8d2c6); } /* une seconde chaîne (une branche) se lit à part */
.mp-box { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; min-width: 110px; padding: 8px 12px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-weight: 600; text-align: center; }
.mp-box.mp-drop { box-shadow: none; }
.mp-arrow-r { font-size: 22px; color: var(--accent); font-weight: 800; transform: rotate(90deg); align-self: center; line-height: 1; }

.mp-reveal { margin-top: 12px; }
.mp-tip { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.mp-tip[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .mp-bar i { transition: none; } }
/* Classer : le cas sur toute la largeur (une formule ne se coupe pas), les catégories dessous. */
.mp-item .mp-txt { flex: 1 1 100%; }
/* Les catégories : une seule rangée de boutons égaux (le texte va à la ligne dans le bouton), pour qu'un classement
   de six cas tienne sur peu d'écrans. */
.mp-item .mp-cats { flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.mp-item .mp-cat { min-width: 0; padding: 6px 4px; border-radius: 14px; font-size: 13px; line-height: 1.2; }
.mp-item .katex { white-space: nowrap; }
/* Relier : deux colonnes de boutons ; le numéro de gauche s'inscrit dans la pastille de droite une fois reliés. */
.mp-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; margin-top: 8px; }
.mp-col { display: grid; gap: 8px; align-content: start; min-width: 0; }
.mp-col-lab { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.mp-end { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 2px solid transparent; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: var(--text); font: inherit; font-size: 15px; line-height: 1.3; text-align: left; overflow-wrap: break-word; hyphens: auto; cursor: pointer; }
.mp-end .mp-txt { flex: 1; min-width: 0; }
.mp-num { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: 13px; }
.mp-end .mp-num:empty { background: transparent; border: 1.5px dashed var(--border); }
.mp-end[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); }
.mp-end.linked .mp-num { background: var(--ink); color: var(--card); }
.mp-end.ok { border-color: #2f9e6b; }
.mp-end.ok .mp-num { background: #2f9e6b; color: #fff; }
.mp-end.ko { border-color: #f2b33d; }
.mp-end:disabled, .mp-word:disabled { opacity: 1; color: var(--text); cursor: default; }
/* Surligner : chaque mot est un bouton de 44 px de haut, dans le fil du texte ; la ponctuation reste du texte. */
.mp-mark-q { margin: 8px 0 6px; font-weight: 700; }
.mp-text { margin: 0; padding: 6px 10px; border-radius: 16px; background: var(--card); color: var(--text); box-shadow: var(--shadow); font-size: 17px; line-height: 44px; overflow-wrap: break-word; }
.mp-word { display: inline-block; min-height: 44px; max-width: 100%; margin: 0; padding: 0 3px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; line-height: 44px; white-space: normal; text-align: left; vertical-align: top; cursor: pointer; }
.mp-punct { margin-left: -3px; } /* collée au mot touchable, malgré sa marge intérieure */
.mp-word[aria-pressed="true"] { background: var(--hl); }
.mp-text { touch-action: pan-y; -webkit-user-select: none; user-select: none; } /* balayage horizontal = surligneur ; vertical = défilement */
.mp-word.ok { background: #2f9e6b; color: #fff; }
.mp-word.ko { box-shadow: inset 0 -4px 0 #f2b33d; }
.mp-end:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.mp-word:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

/* Défi du jour : une carte vive, sous la mission ; relevé, elle s'apaise sans disparaître. */
.daily-card { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px; border-radius: 22px; color: #fff; text-decoration: none; background: radial-gradient(120% 140% at 0% 0%, #8b5cf6 0%, #6a3fb8 50%, #3b2370 100%); box-shadow: 0 14px 30px -18px rgba(106, 63, 184, .9); transition: transform .2s var(--ease-out); }
.daily-card:active { transform: scale(.98); }
.daily-card:focus-visible { outline: 3px solid var(--hl); outline-offset: 3px; }
.dc-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #ffd59a; }
.dc-ico svg { fill: #6a3fb8; }
.dc-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dc-txt small { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: rgba(255, 255, 255, .8); }
.dc-txt strong { font-size: 17px; line-height: 1.25; }
.dc-txt span { font-size: 13px; color: rgba(255, 255, 255, .85); line-height: 1.35; }
.dc-go { flex: none; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-weight: 700; font-size: 14px; }
.daily-card.is-done { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.daily-card.is-done .dc-ico { background: var(--ok-bg); }
.daily-card.is-done .dc-ico svg { fill: var(--ok-ink); }
.daily-card.is-done .dc-txt small, .daily-card.is-done .dc-txt span { color: var(--muted); }
.daily-card.is-done .dc-go { background: var(--ok-bg); color: var(--ok-ink); }
.defi-hero { margin-bottom: 4px; }
.m-pending .daily-card { opacity: 0; }

/* « Précédemment dans… » : le résumé de la dernière séance, en voix off (italique du carnet), avant de reprendre. */
.previously { margin: 16px 0 0; padding: 14px 16px 14px 18px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border-left: 5px solid var(--accent); }
.pv-head { margin: 0 0 8px; font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.3; color: var(--muted); }
.pv-head em { font-style: italic; color: var(--text); font-weight: 600; }
.pv-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; line-height: 1.4; }
.pv-lines li { display: flex; gap: 8px; align-items: baseline; }
.pv-lines li > span { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.pv-when { color: var(--muted); }
.pv-ok > span { background: var(--ok-bg); color: var(--ok-ink); }
.pv-trap > span { background: var(--warn-bg); color: var(--warn-ink); }
.m-pending .previously .pv-head, .m-pending .previously li { opacity: 0; }

/* La collection : des cartes à la couleur de la matière, liseré or ou diamant ; une carte qui rouille pâlit. */
.col-subject { margin-top: 26px; }
.col-head { align-items: baseline; margin-bottom: 10px; }
.col-head h2 { margin: 0; font-size: 20px; }
.col-count { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.col-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 168px; padding: 14px 12px 12px; border-radius: 16px; text-decoration: none; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--subject) 85%, #fff) 0%, var(--subject) 55%, color-mix(in srgb, var(--subject) 70%, #000) 100%);
  border: 3px solid #d9a441; box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .35); transition: transform .2s var(--ease-out); }
.col-card:active { transform: scale(.97); }
.col-card:focus-visible { outline: 3px solid var(--hl); outline-offset: 3px; }
.col-card strong { font-family: var(--serif); font-size: 16px; line-height: 1.25; }
.col-card small { margin-top: auto; font-size: 12px; opacity: .85; line-height: 1.3; }
.cc-tier { align-self: flex-start; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #f3d27a; color: #4a3200; }
.col-card.is-diamond { border-color: transparent; background:
  linear-gradient(160deg, color-mix(in srgb, var(--subject) 85%, #fff) 0%, var(--subject) 55%, color-mix(in srgb, var(--subject) 70%, #000) 100%) padding-box,
  linear-gradient(120deg, #5fd0ff, #b98cff, #5ff0cf, #5fd0ff) border-box;
  background-size: 100% 100%, 300% 300%; animation: cc-shine 6s linear infinite; }
.col-card.is-diamond .cc-tier { background: linear-gradient(120deg, #c8f1ff, #efe0ff); color: #2c2560; }
@keyframes cc-shine { to { background-position: 0 0, 300% 0; } }
.col-card.is-rusty { filter: grayscale(.75) brightness(.95); border-style: dashed; border-color: #a9a59a; }
.col-card.is-rusty .cc-tier { background: var(--warn-bg); color: var(--warn-ink); }
.col-card.is-new::after { content: "Nouvelle"; position: absolute; top: -8px; right: -6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--hl); color: var(--ink); box-shadow: var(--shadow); }
.col-empty { margin: 0; }
@media (prefers-reduced-motion: reduce) { .col-card.is-diamond { animation: none; } }
.m-pending .col-card { opacity: 0; }

/* ==========================================================================================================
   Nouvelle direction (octobre 2026) : univers des matières, navigation immersive, accueil en scène.
   ========================================================================================================== */

/* Les univers : un motif par famille de matières, en blanc translucide sur la couleur de la matière. */
[data-world] { --motif: none; --motif-size: 28px 28px; }
[data-world="maths"] { --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cpath d='M0 .5H26M.5 0V26' stroke='white' stroke-opacity='.16'/%3E%3Ccircle cx='13' cy='13' r='1.3' fill='white' fill-opacity='.3'/%3E%3C/svg%3E"); --motif-size: 26px 26px; }
[data-world="physique"] { --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32'%3E%3Cpath d='M0 16C10 2 22 2 32 16S54 30 64 16' fill='none' stroke='white' stroke-opacity='.22' stroke-width='1.4'/%3E%3C/svg%3E"); --motif-size: 64px 32px; }
[data-world="lettres"] { --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='22'%3E%3Cpath d='M0 21.5H40' stroke='white' stroke-opacity='.2'/%3E%3C/svg%3E"); --motif-size: 40px 22px; }
[data-world="histoire"] { --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='90'%3E%3Cg fill='none' stroke='white' stroke-opacity='.2' stroke-width='1.2'%3E%3Cpath d='M0 70C35 48 70 82 140 52'/%3E%3Cpath d='M0 40C40 18 80 55 140 26'/%3E%3Cpath d='M0 12C30 0 90 28 140 4'/%3E%3C/g%3E%3C/svg%3E"); --motif-size: 140px 90px; }
[data-world="vivant"] { --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='52'%3E%3Cpath d='M15 1l14 8v16l-14 8L1 25V9zM15 33v19' fill='none' stroke='white' stroke-opacity='.2' stroke-width='1.2'/%3E%3C/svg%3E"); --motif-size: 30px 52px; }
[data-world="langues"] { --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='44'%3E%3Cpath d='M8 6h24a5 5 0 0 1 5 5v8a5 5 0 0 1-5 5H17l-7 6v-6H8a5 5 0 0 1-5-5v-8a5 5 0 0 1 5-5z' fill='none' stroke='white' stroke-opacity='.2' stroke-width='1.2'/%3E%3C/svg%3E"); --motif-size: 56px 44px; }
[data-world="societe"], [data-world="numerique"], [data-world="corps"], [data-world="arts"], [data-world="autre"] { --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M0 18L18 0' stroke='white' stroke-opacity='.16'/%3E%3C/svg%3E"); --motif-size: 18px 18px; }
.sh-hero[data-world] { background-image: var(--motif), linear-gradient(135deg, color-mix(in srgb, var(--subject, var(--accent)) 92%, #fff) 0%, color-mix(in srgb, var(--subject, var(--accent)) 78%, #07120f) 100%); background-size: var(--motif-size), auto; }

/* La barre du haut ne colle plus : elle part avec la page, l'écran est à la lecture. */
.topbar { position: relative; background: transparent; border-bottom: 0; }

/* Téléphone : la navigation devient une pastille flottante qui s'efface pendant la lecture. */
@media (max-width: 760px) {
  main.page { margin-bottom: 104px; }
  .bottomnav.dock {
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 6px; gap: 2px; align-items: center;
    border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 26px;
    background: color-mix(in srgb, var(--card) 86%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 18px 40px -18px rgba(20, 30, 28, .45); transition: transform .32s var(--ease-out), opacity .32s var(--ease-out);
  }
  .bottomnav.dock a { padding: 7px 2px 5px; border-radius: 18px; font-size: 11px; line-height: 1.1; }
  .bottomnav.dock .dock-coach { display: none; } /* le coach est en haut et dans le menu ; la pastille garde quatre lieux et la recherche */
  .bottomnav.dock .dock-search { flex: 0 0 56px; height: 56px; margin: -20px 2px 0; display: grid; place-items: center; align-content: center; border-radius: 50%; color: var(--on-accent); background: var(--accent); box-shadow: 0 10px 22px -10px var(--accent); }
  .bottomnav.dock .dock-search span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .bottomnav.dock .dock-search .ico { margin: 0; }
  .bottomnav.dock .dock-search.active { background: var(--accent-ink); }
  html.dock-away .bottomnav.dock { transform: translateY(calc(100% + 24px)); opacity: 0; }
  html.dock-away .bottomnav.dock:focus-within { transform: none; opacity: 1; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .bottomnav.dock { transition: none; } }

/* Ordinateur large : un rail à gauche, la page respire à côté ; la barre du haut ne garde que le contexte et l'élève. */
@media (min-width: 1100px) {
  body:has(.bottomnav.dock) .mainnav { display: none; }
  body:has(.bottomnav.dock) .topbar, body:has(.bottomnav.dock) main.page { margin-left: 104px; }
  body:has(.bottomnav.dock) .topbar { padding-left: max(28px, calc((100vw - 104px - 1200px) / 2)); }
  .bottomnav.dock {
    display: flex; flex-direction: column; gap: 6px; position: fixed; left: 0; top: 0; bottom: 0; z-index: 25; width: 104px; padding: 22px 10px;
    background: var(--surface-2); border-right: 1px solid var(--border-soft);
  }
  .bottomnav.dock a { display: grid; justify-items: center; gap: 4px; padding: 12px 4px; border-radius: 16px; text-decoration: none; color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: center; }
  .bottomnav.dock a:hover { color: var(--text); background: var(--card); }
  .bottomnav.dock a.active { color: var(--accent); background: var(--card); box-shadow: var(--shadow); }
  .bottomnav.dock .dock-search { order: -1; margin-bottom: 10px; color: var(--on-accent); background: var(--accent); }
  .bottomnav.dock .dock-search:hover { color: #fff; background: var(--accent-ink); }
  .bottomnav.dock .dock-coach { margin-top: auto; }
}

/* L'accueil en scène : nuit d'encre, le motif de la matière du moment, une lueur ; le salut en grand, la question en dessous. */
.home-stage {
  position: relative; overflow: hidden; padding: 22px 22px 24px; border-radius: 30px; color: #fff;
  background-color: #12211f;
  background-image: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--subject, var(--accent)) 70%, transparent) 0%, transparent 60%), var(--motif);
  background-size: auto, var(--motif-size);
  box-shadow: 0 30px 60px -36px rgba(10, 24, 22, .9);
}
.hst-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-stage .eyebrow { margin: 0; color: rgba(255, 255, 255, .72); }
.home-stage .today-hello { margin: 14px 0 0; color: #fff; font-size: clamp(40px, 7vw, 68px); line-height: 1; letter-spacing: -.02em; }
.home-stage .streak-chip { background: rgba(255, 213, 154, .16); color: #ffd59a; }
.home-stage .streak-chip svg { fill: #ffb347; }
.home-stage .streak-chip.is-pending { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .75); }
.home-stage .streak-chip.is-pending svg { fill: rgba(255, 255, 255, .6); }
.hst-voice { margin: 12px 0 0; max-width: 34ch; font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.35; color: rgba(255, 255, 255, .85); }
.hst-search { position: relative; display: flex; align-items: center; margin-top: 20px; max-width: 560px; }
.hst-search svg { position: absolute; left: 16px; color: #12211f; pointer-events: none; }
.home-stage .streak-chip { white-space: nowrap; flex: none; }
.hst-search input[type="search"] { width: 100%; min-height: 54px; margin: 0; padding: 0 18px 0 48px; border: 0; border-radius: 18px; background: #fff; color: #12211f; font: inherit; font-size: 17px; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .6); }
.hst-search input::placeholder { color: #6b6a63; }
.hst-search input:focus-visible { outline: 3px solid #ffd59a; outline-offset: 2px; }
@media (max-width: 760px) {
  .home-stage { margin: -18px -14px 0; padding: 18px 18px 22px; border-radius: 0 0 30px 30px; }
  .notebook .home-mission { margin-top: 20px !important; }
}

/* La mission prend la couleur et le motif de sa matière (et plus seulement le vert du site). */
/* La grande carte de mission, sur toutes les largeurs (elle n'existait que sur téléphone). */
.home-mission .practice-chapter.cockpit-practice[data-world] { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; border: 0; border-radius: 26px; color: #fff; }
.home-mission .cockpit-practice[data-world] .t { font-family: var(--serif); font-size: clamp(24px, 3vw, 32px); line-height: 1.12; }
.home-mission .cockpit-practice[data-world] .ps-subj { color: rgba(255, 255, 255, .82); font-size: 14px; }
.home-mission .cockpit-practice[data-world] .meta { display: block; max-width: 60ch; color: rgba(255, 255, 255, .88); font-size: 15px; }
.home-mission .cockpit-practice[data-world] .go { align-self: flex-start; margin-top: 12px; padding: 12px 20px; border-radius: 14px; background: #ffd59a; color: #3a2200; font-size: 17px; font-weight: 800; }
@media (min-width: 1100px) { body:has(.bottomnav.dock) .topbar .coach-btn { display: none; } }
.home-mission .practice-chapter.cockpit-practice[data-world] {
  background-color: var(--subject, var(--accent));
  background-image: var(--motif), linear-gradient(140deg, color-mix(in srgb, var(--subject, var(--accent)) 90%, #fff) 0%, color-mix(in srgb, var(--subject, var(--accent)) 80%, #061210) 100%);
  background-size: var(--motif-size), auto; box-shadow: 0 18px 36px -20px color-mix(in srgb, var(--subject, var(--accent)) 90%, #000);
}

/* Les cartes d'univers : une couverture (couleur, motif, jauge), puis le nom. */
.world-grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.hs-card.world-card { display: grid; grid-template-rows: auto 1fr; align-items: stretch; gap: 0; padding: 0; overflow: hidden; border-left: 0; border-radius: 22px; min-height: 0; }
.world-card .wc-cover {
  display: flex; align-items: flex-end; justify-content: space-between; height: 78px; padding: 10px 12px;
  background-color: var(--subject, var(--accent)); background-image: var(--motif), linear-gradient(150deg, color-mix(in srgb, var(--subject) 88%, #fff), color-mix(in srgb, var(--subject) 82%, #061210));
  background-size: var(--motif-size), auto;
}
.world-card .hs-ring { width: 46px; height: 46px; }
.world-card .hs-ring .bg { stroke: rgba(255, 255, 255, .25); }
.world-card .hs-ring .fg { stroke: #ffd59a; }
.world-card .hs-ring text { fill: #fff; }
.world-card .hs-txt { padding: 10px 12px 12px; }
.world-card .hs-txt strong { font-size: 15px; }
.world-card.is-soon .wc-cover { filter: saturate(.55); }
.world-card.is-soon .hs-txt small { color: var(--muted); font-style: italic; }
@media (max-width: 400px) { .home-subjects .world-card .hs-ring { width: 40px; height: 40px; } .world-grid { gap: 10px; } }

/* Le chemin de la matière : une ligne qui relie les étapes, la jauge dans chaque pastille, « Tu es ici » en relief. */
.chemin .ch-path { list-style: none; margin: 14px 0 0; padding: 0; position: relative; }
.chemin .ch-path::before { content: ""; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--subject) 40%, var(--border)) 0 8px, transparent 8px 14px); }
.cp-step { position: relative; }
.cp-stop { display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 2px; border-radius: 18px; color: var(--text); text-decoration: none; }
a.cp-stop:hover { background: color-mix(in srgb, var(--subject) 8%, transparent); }
a.cp-stop:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.cp-dot { position: relative; flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 4px var(--bg), var(--shadow); }
.cp-dot svg { position: absolute; inset: 4px; width: 48px; height: 48px; }
.cp-dot circle { fill: none; stroke-width: 5; }
.cp-dot .bg { stroke: var(--border-soft); }
.cp-dot .fg { stroke: var(--subject); stroke-linecap: round; }
.cp-dot b { position: relative; font-size: 15px; font-weight: 800; color: var(--muted); }
.cp-body { display: grid; gap: 4px; min-width: 0; }
.cp-body strong { font-size: 16px; line-height: 1.25; }
.cp-body .mm-blocks { justify-content: flex-start; }
.cp-here { justify-self: start; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #3a2200; background: #ffd59a; }
.is-here .cp-stop { background: color-mix(in srgb, var(--subject) 10%, var(--card)); box-shadow: var(--shadow); }
.is-here .cp-dot { width: 64px; height: 64px; margin-left: -4px; margin-right: -4px; background: var(--subject); }
.is-here .cp-dot svg { inset: 4px; width: 56px; height: 56px; }
.is-here .cp-dot .bg { stroke: rgba(255, 255, 255, .3); }
.is-here .cp-dot .fg { stroke: #ffd59a; }
.is-here .cp-dot b { color: #fff; font-size: 18px; }
.is-done .cp-dot { background: var(--subject); }
.is-done .cp-dot .bg, .is-done .cp-dot .fg { stroke: transparent; }
.is-done .cp-dot b { color: #fff; font-size: 20px; }
.is-new .cp-body strong { color: var(--muted); font-weight: 600; }
.is-locked { opacity: .55; }

/* Dans un chapitre, « S'entraîner » (et le lanceur de série) prend la couleur et le motif de sa matière. */
.chap-go[data-world] .cg-main, #entrainement .dd-launch .cg-main {
  background-color: var(--subject, var(--accent));
  background-image: var(--motif, none), linear-gradient(140deg, color-mix(in srgb, var(--subject, var(--accent)) 88%, #fff) 0%, color-mix(in srgb, var(--subject, var(--accent)) 78%, #061210) 100%);
  background-size: var(--motif-size, auto), auto;
  box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--subject, var(--accent)) 90%, #000);
}

/* Matières : la galerie d'univers (mêmes cartes que l'accueil, un peu plus grandes ; l'ajout reste en bout de rayon). */
.world-shelf { display: grid; margin-top: 22px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.world-shelf .wc-cover { height: 96px; align-items: flex-start; }
.wc-tag { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .22); }
.wc-avg { margin-top: 6px; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.wc-avg small { font-family: var(--font); font-size: 12px; font-weight: 400; color: var(--muted); }
.world-shelf .notebook-cover.add { min-height: 0; }
@media (max-width: 400px) { .world-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* Recherche élève (« Que veux-tu apprendre ? ») */
/* Recherche de l'élève (resources/views/student/search.blade.php) : champ en haut, résultats en cartes, lisible à 375 px. */
.rch-form { position: relative; margin: 6px 0 0; }
.rch-label { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.25; margin: 0 0 10px; color: #fff; }
.rch-field { display: flex; gap: 8px; }
.rch-field input[type="search"] { flex: 1; min-width: 0; min-height: 48px; font-size: 17px; border-radius: var(--radius-sm); border: 0; background: var(--card); color: var(--text); }
.rch-field input[type="search"]:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.rch-field .btn { flex: none; min-height: 48px; }
.rch-hint { margin: 8px 0 0; font-size: 14px; color: rgba(255, 255, 255, .82); }

.rch-results { margin-top: 20px; }
.rch-results[aria-busy="true"] { opacity: .6; transition: opacity .15s var(--ease-out); }
.rch-count, .rch-empty-lede, .rch-coach { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.rch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rch-card { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; font-family: var(--font); }
.rch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; font-size: 13px; color: var(--muted); }
.rch-mine { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.rch-title { font-family: var(--serif); font-size: 20px; line-height: 1.25; margin: 4px 0 2px; overflow-wrap: anywhere; }
.rch-title a { color: inherit; text-decoration: none; }
.rch-title a:hover, .rch-title a:focus-visible { text-decoration: underline; }
.rch-chapter { margin: 0; font-size: 14px; color: var(--muted); }
.rch-excerpt { margin: 8px 0 0; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.rch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rch-actions .btn { min-height: 40px; }
.rch-why { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

.rch-none { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.rch-none h2 { font-family: var(--serif); font-size: 20px; margin: 0 0 8px; overflow-wrap: anywhere; }
.rch-tips { margin: 8px 0 14px; padding-left: 20px; color: var(--muted); }

@media (max-width: 420px) {
  .rch-label { font-size: 19px; }
  .rch-field .btn { padding-inline: 12px; }
  .rch-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* La série dans l'univers de sa matière : le bandeau du haut porte la couleur et le motif ; la progression s'y lit en clair. */
.drill-dlg[data-world] .dd-top {
  border-bottom: 0; color: #fff;
  background-color: var(--subject, var(--accent));
  background-image: var(--motif), linear-gradient(120deg, color-mix(in srgb, var(--subject, var(--accent)) 92%, #fff), color-mix(in srgb, var(--subject, var(--accent)) 80%, #061210));
  background-size: var(--motif-size), auto;
}
.drill-dlg[data-world] .dd-top .dd-close, .drill-dlg[data-world] .dd-top .quiz-head p, .drill-dlg[data-world] .dd-top .dd-title { color: #fff; }
.drill-dlg[data-world] .quiz-dots i { background: rgba(255, 255, 255, .28); }
.drill-dlg[data-world] .quiz-dots i.on { background: #fff; }
.drill-dlg[data-world] .quiz-dots i.good { background: #7ee2b0; }
.drill-dlg[data-world] .quiz-dots i.bad { background: #ffd59a; }
.drill-dlg[data-world] .ex-prompt, .drill-dlg[data-world] .ex .quiz-q { border-top-color: var(--subject, var(--accent)); }
.drill-dlg[data-world] .end-ring .er-fg { stroke: var(--subject, var(--accent)); }

/* Le bouton Aide, dans le bandeau ; le panneau monte du bas sans couvrir la question (au plus 60 % de la hauteur). */
.dd-help { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; color: inherit; background: rgba(255, 255, 255, .18); }
.drill-dlg:not([data-world]) .dd-help { background: var(--surface-2); }
.dd-help svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.dd-help[aria-expanded="true"] { background: #fff; color: var(--ink); }
.dd-help:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.dd-help[hidden] { display: none; }
.dd-help-panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; max-height: 60%; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--card);
  box-shadow: 0 -18px 40px -20px rgba(10, 20, 18, .45); border-top: 4px solid var(--subject, var(--accent));
}
.dd-help-panel[hidden] { display: none; }
.dhp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dhp-head strong { font-family: var(--serif); font-size: 19px; }
.dhp-acts { display: grid; gap: 8px; }
.dhp-act { display: grid; gap: 2px; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 16px; text-align: left; font: inherit; color: var(--text); background: var(--bg); text-decoration: none; cursor: pointer; }
.dhp-act b { font-size: 16px; }
.dhp-act small { font-size: 13px; color: var(--muted); }
.dhp-act:disabled { opacity: .45; cursor: default; }
.dhp-act:not(:disabled):hover { border-color: var(--subject, var(--accent)); }
.dhp-act:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.dhp-course { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft); font-size: 15px; }
.dhp-course[hidden] { display: none; }
@media (min-width: 761px) { .dd-help-panel { left: auto; width: min(440px, 100%); right: 16px; border-radius: 22px 22px 0 0; } }

/* Parcours d'un chapitre pilote : sous-chapitres en étapes, micro-compétences en cartes, remédiation en premier. */
.pc-steps { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: none; }
.pc-step { position: relative; padding: 0 0 18px 40px; }
.pc-step::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--border); }
.pc-step:last-child::before { display: none; }
.pc-sub { display: flex; align-items: center; gap: 10px; margin: 0 0 10px -40px; font-weight: 800; font-size: 17px; line-height: 1.3; }
.pc-num { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--subject, var(--accent)); color: #fff; font-size: 15px; }
.pc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pc-comp { padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); border-left: 4px solid transparent; }
.pc-comp.is-mastered { border-left-color: #2f9e6b; }
.pc-comp.is-alert { border-left-color: #e0902b; }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pc-dim { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--hl-soft); color: var(--text); }
.pc-comprendre { background: #e5eef9; color: #1f4f86; }
.pc-memoriser { background: #f4ecdc; color: #7a5212; }
.pc-transferer { background: #e6f3ec; color: #1d6a43; }
.pc-state { font-size: 13px; }
.pc-state .medal { margin-left: 0; }
.pc-title { margin: 8px 0 6px; font-size: 16px; line-height: 1.4; font-weight: 600; }
.pc-alert { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: #fdf1df; color: #5b3a07; font-size: 14px; line-height: 1.45; }
.pc-alert a { color: inherit; font-weight: 800; }
.pc-go { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.pc-go a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--border); color: var(--text); font-size: 14px; font-weight: 700; text-decoration: none; }
.pc-go a:first-child { border-color: var(--subject, var(--accent)); color: var(--subject, var(--accent)); }
[data-theme="dark"] .pc-comprendre { background: #1d2b3d; color: #a9c8f0; }
[data-theme="dark"] .pc-memoriser { background: #33291a; color: #f0d29b; }
[data-theme="dark"] .pc-transferer { background: #18302a; color: #9fdcbc; }
[data-theme="dark"] .pc-alert { background: #3a2c17; color: #ffd59a; }
@media (max-width: 520px) {
  .pc-step { padding-left: 0; }
  .pc-step::before { display: none; }
  .pc-sub { margin-left: 0; }
}

/* Ton chemin (page du chapitre) : quatre étapes toujours dans le même ordre, l'étape en cours ouverte avec UNE action. */
.guide { margin: 18px 0 8px; padding: 18px 18px 14px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); border: 1.5px solid var(--border-soft); }
.guide-h { margin: 0 0 12px; font-weight: 800; font-size: 15px; color: var(--muted); }
.guide-steps { list-style: none; margin: 0; padding: 0; }
.gs { position: relative; display: flex; gap: 14px; padding: 0 0 14px; }
.gs:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; background: var(--border); }
.gs.is-done:not(:last-child)::before { background: var(--subject, var(--accent)); }
.gs-num { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 800; font-size: 16px; border: 2px solid var(--border); color: var(--muted); background: var(--card); }
.gs.is-done .gs-num { border-color: var(--subject, var(--accent)); background: var(--subject, var(--accent)); color: #fff; }
.gs.is-now .gs-num { border-color: var(--subject, var(--accent)); color: var(--subject, var(--accent)); box-shadow: 0 0 0 5px color-mix(in srgb, var(--subject, var(--accent)) 18%, transparent); }
.gs-body { min-width: 0; flex: 1; padding-top: 6px; }
.gs-t { margin: 0; font-weight: 800; font-size: 17px; line-height: 1.3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gs.is-next .gs-t, .gs.is-done .gs-t { font-weight: 600; color: var(--muted); }
.gs-tag { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--subject, var(--accent)); color: #fff; }
.gs-line { margin: 6px 0 12px; font-size: 15px; line-height: 1.45; color: var(--text); }
.gs-go { width: 100%; min-height: 52px; font-size: 17px; background: var(--subject, var(--accent)); color: #fff; text-align: center; }
.gs-go.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.gs-coach { margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.gs-who { display: block; font-size: 12px; font-weight: 800; color: var(--subject, var(--accent)); }
[data-theme="dark"] .gs-who { color: var(--accent-ink); }
.guide-more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.guide-more:not(:has(> :not([hidden]))) { display: none; }
.guide-ask { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.guide-ask-h { margin: 0 0 8px; font-weight: 700; font-size: .92rem; }
.guide-ask-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.ga-stuck { flex-basis: 100%; }
.ga-stuck > summary { list-style: none; cursor: pointer; display: inline-flex; }
.ga-stuck > summary::-webkit-details-marker { display: none; }
.ga-stuck[open] > summary { border-color: var(--subject, var(--accent)); }
.ga-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ga-list a { display: block; min-height: 44px; padding: 11px 14px; border: 1px solid var(--border-soft); border-radius: 12px; color: var(--text); text-decoration: none; background: var(--card); }
.ga-list a:hover, .ga-list a:focus-visible { border-color: var(--subject, var(--accent)); }
@media (min-width: 900px) { .gs-go { width: auto; padding: 0 28px; } }

/* Comprendre, une idée à la fois : la barre qui dit où l'on en est et mène à la suivante. */
.cp-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border-soft); }
.cp-pager .cp-of { font-size: 14px; font-weight: 700; color: var(--muted); }
.cp-pager .btn { min-height: 48px; }
.cp-notion.cp-off { display: none; }
.prog-tabs-h { margin: 22px 0 6px; font-size: 13px; font-weight: 800; color: var(--muted); }

/* Accueil : la carte de la méthode, comme un plan de métro (cinq stations reliées). */
.howto { margin: 22px 0; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); border: 1.5px solid var(--border-soft); }
.howto summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; min-height: 56px; cursor: pointer; list-style: none; font-weight: 800; font-size: 17px; }
.howto summary::-webkit-details-marker { display: none; }
.howto-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.howto-hint { margin-left: auto; width: 10px; height: 10px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease; }
.howto[open] .howto-hint { transform: rotate(-135deg); }
.howto-map { list-style: none; margin: 0; padding: 4px 18px 6px 18px; counter-reset: st; }
.howto-map li { counter-increment: st; position: relative; display: grid; gap: 2px; padding: 0 0 16px 50px; min-height: 40px; }
.howto-map li::before { content: counter(st); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--accent); color: var(--accent-ink, var(--accent)); font-weight: 800; background: var(--card); z-index: 1; }
.howto-map li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 32px; bottom: 0; width: 2.5px; background: var(--accent); opacity: .35; }
.howto-map b { font-size: 16px; }
.howto-map span { font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.howto-help { margin: 0; padding: 12px 18px 16px; border-top: 1px solid var(--border-soft); font-size: 14.5px; line-height: 1.5; }
[data-theme="dark"] .gs.is-now .gs-num { color: var(--text); }
.gs-face { display: inline-block; width: 22px; height: 22px; vertical-align: -5px; margin-right: 6px; } .gs-face svg { width: 100%; height: 100%; }
.cp-notion[data-of]::before { content: attr(data-of); display: block; margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--muted); }

/* Page d'une matière : où j'en suis (la mission), tous les chapitres pour explorer, une notion à chercher, les outils. */
.env-h { margin: 4px 0 10px; }
.env-why { display: block; margin-top: 8px; font-size: 14px; line-height: 1.4; opacity: .92; }
.env-search { display: flex; gap: 8px; margin: 4px 0 18px; }
.env-search input { flex: 1; min-width: 0; margin: 0; min-height: 48px; }
.env-search .btn { min-height: 48px; background: var(--subject, var(--accent)); color: #fff; }
.env-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 6px 0 18px; }
.env-tools .env-tile { min-height: 84px; }
@media (min-width: 900px) { .env-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Page Matières : continuer d'abord, les matières où l'on travaille, le reste en une ligne. */
.go-on { list-style: none; margin: 18px 0 8px; padding: 0; display: grid; gap: 10px; }
.go-on a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px; border-radius: 18px; background: var(--subject); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.go-on b { display: block; font-size: 16px; line-height: 1.3; }
.go-on small { display: block; font-size: 13px; opacity: .9; }
.go-on .go-arrow { margin-left: auto; font-size: 22px; }
.soon-line { margin: 18px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* Je prépare un contrôle : le prochain contrôle noté (préparer), une épreuve blanche par matière, les contrôles passés. */
.ct-next { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.ct-next li { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "when what" "go go"; gap: 8px 14px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border-left: 5px solid var(--subject); }
.ct-when { grid-area: when; display: grid; } .ct-when b { font-size: 17px; } .ct-when small { font-size: 12.5px; color: var(--muted); }
.ct-what { grid-area: what; display: grid; min-width: 0; } .ct-what strong { font-size: 15.5px; line-height: 1.3; } .ct-what small { font-size: 13px; color: var(--muted); }
.ct-go { grid-area: go; min-height: 48px; background: var(--subject); color: #fff; }
@media (min-width: 700px) { .ct-next li { grid-template-columns: 150px 1fr auto; grid-template-areas: "when what go"; } }
.ct-new { margin-top: 24px; }
.ct-how { margin: 0 0 12px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.ct-subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ct-subjects a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 58px; padding: 0 16px; border-radius: 16px; background: var(--subject); color: #fff; font-weight: 800; text-decoration: none; box-shadow: var(--shadow); }
.ct-past { margin-top: 26px; }

/* Je m'entraîne : des cartes-actions courtes (défi, notions à consolider, erreurs à battre, séries à reprendre). */
.tr-card { display: flex; align-items: center; gap: 14px; margin: 16px 0 0; padding: 16px; border-radius: 20px; color: #fff; text-decoration: none; background: linear-gradient(135deg, #7b4fe0, #4a2a9e); box-shadow: var(--shadow); }
.tr-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #ffd59a; }
.tr-ico svg { width: 22px; height: 22px; fill: #4a2a9e; }
.tr-txt { display: grid; gap: 2px; } .tr-txt small { font-size: 13px; opacity: .9; } .tr-txt strong { font-size: 17px; line-height: 1.3; } .tr-txt span { font-size: 14px; opacity: .9; }
.tr-sec { margin-top: 24px; }
.tr-empty { margin: 0; font-size: 15px; line-height: 1.5; }
.tr-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.tr-list a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.tr-t { display: grid; min-width: 0; } .tr-t b { font-size: 15.5px; line-height: 1.3; } .tr-t small { font-size: 13px; color: var(--muted); }
.tr-state .medal { margin-left: 0; }
.tr-rust { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); font-size: 12px; font-weight: 800; }
.tr-due { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--err-bg); color: var(--err-ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
.tr-dot { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--subject); }
.tr-go { font-size: 20px; color: var(--muted); }
.tr-more { font-size: 14px; font-weight: 700; }
.tr-note { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }

/* Mes progrès (/progres) : la semaine et sa frise, la prochaine action, maîtrisé / en bonne voie / fragile, à revoir,
   erreurs du carnet, contrôles, chapitres étudiés. Médailles : Bronze, Argent, Or, Diamant (Mastery), pâlies si elles rouillent. */
.pg-hero { padding: 18px 16px 14px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--border-soft); }
.pg-week { font-size: 21px; line-height: 1.3; margin: 2px 0 14px; }
.pg-frise { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; align-items: end; }
.pg-frise li { display: grid; justify-items: center; gap: 4px; }
.pg-frise small { font-size: 11px; color: var(--muted); }
.pg-frise .is-today small { color: var(--text); font-weight: 800; }
.pg-bar { position: relative; display: flex; align-items: flex-end; width: 100%; max-width: 22px; height: 64px; border-radius: 8px; background: var(--border-soft); overflow: hidden; }
.pg-bar::before { content: ""; position: absolute; inset: auto 0 0; height: var(--h); border-radius: 8px; background: var(--warn-ink); opacity: .55; }
.pg-bar i { position: absolute; inset: auto 0 0; height: var(--g); border-radius: 8px; background: var(--accent); }
.pg-legend { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pg-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--warn-ink); opacity: .55; }
.pg-key.is-right { background: var(--accent); opacity: 1; }

.pg-next { display: grid; gap: 4px; margin-top: 14px; padding: 16px; border-radius: 20px; background: var(--subject); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.pg-next-k { font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.pg-next strong { font-size: 18px; line-height: 1.3; }
.pg-next small { font-size: 14px; line-height: 1.4; opacity: .92; }
.pg-next-go { justify-self: start; margin-top: 8px; padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: rgba(0, 0, 0, .28); font-weight: 800; } /* fond assombri : texte blanc ≥ 5,9:1 sur toutes les couleurs de matière */

.pg-sec { margin-top: 26px; }
.pg-sec h2 { font-size: 20px; margin: 0 0 6px; }
.pg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pg-head a { font-weight: 700; font-size: 15px; white-space: nowrap; }
.pg-rule { margin: 0 0 10px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.pg-rule b { color: var(--text); }
.pg-empty { margin: 4px 0 0; font-size: 14.5px; color: var(--muted); }
.pg-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.pg-declared { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border); font-size: 14px; line-height: 1.45; color: var(--muted); }

.pg-tiers { display: grid; gap: 12px; }
.pg-tier { padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--border-soft); border-top: 5px solid var(--tier); box-shadow: var(--shadow); }
.pg-tier.is-known { --tier: #c9971c; }
.pg-tier.is-track { --tier: var(--accent); }
.pg-tier.is-fragile { --tier: var(--warn-ink); }
.pg-tier h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; }
.pg-tier .pg-rule { font-size: 13px; }
.pg-count { min-width: 30px; height: 30px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--tier); color: #fff; font-size: 15px; }
.pg-tier.is-fragile .pg-count { color: var(--bg); }
.pg-notion { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; border-top: 1px solid var(--border-soft); color: var(--text); text-decoration: none; }
.pg-notion > span:last-child { display: grid; min-width: 0; font-size: 14.5px; line-height: 1.3; font-weight: 600; }
.pg-notion small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.pg-more { display: inline-block; margin-top: 6px; font-weight: 700; font-size: 14px; }
.pg-medal { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 900; color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.pg-medal.is-l1 { background: #a8662f; }
.pg-medal.is-l2 { background: #7f8b97; }
.pg-medal.is-l3 { background: #c9971c; color: #2b2006; }
.pg-medal.is-l4 { background: linear-gradient(135deg, #5cc6e6, #2f7fc1); }
.pg-medal.is-rusty { filter: grayscale(.7); opacity: .6; }

.pg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pg-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border-soft); border-left: 5px solid var(--subject); }
.pg-li-main { display: grid; flex: 1; min-width: 0; }
.pg-li-main strong { font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.pg-li-main small { font-size: 12.5px; color: var(--muted); }
.pg-act { flex: none; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent); color: var(--on-accent, #fff); font-weight: 800; font-size: 14px; text-decoration: none; }

.pg-agenda { margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); border-left: 5px solid var(--subject); font-size: 14.5px; }
.pg-scores { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pg-scores a { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--border-soft); border-bottom: 4px solid var(--subject); color: var(--text); text-decoration: none; }
.pg-scores a > span { display: grid; min-width: 0; font-size: 14px; font-weight: 700; }
.pg-scores a > span small { font-size: 12px; font-weight: 400; color: var(--muted); }
.pg-score { font-size: 22px; line-height: 1; }
.pg-score small { font-size: 12px; color: var(--muted); }
.pg-score.is-ok { color: var(--ok-ink); } .pg-score.is-mid { color: var(--accent-ink); } .pg-score.is-low { color: var(--warn-ink); }

.pg-chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pg-chapters a { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--border-soft); border-left: 5px solid var(--subject); color: var(--text); text-decoration: none; }
.pg-ch-t { display: grid; min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.3; }
.pg-ch-t small, .pg-ch-s small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.pg-ch-s { display: grid; justify-items: end; font-size: 13px; color: var(--muted); }
.pg-ch-s b { font-size: 17px; color: var(--text); }
.pg-ch-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.pg-ch-bar i { display: block; height: 100%; background: var(--subject); }

/* Note de maîtrise /20 (MasteryGrade) : une carte par matière, jamais de rouge (une note basse n'est pas une faute) ;
   « provisoire » en pointillés, la prochaine marche à un toucher (44 px). nm- : _note-maitrise.blade.php. */
.nm-grid { display: grid; gap: 12px; }
.nm-card { padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--border-soft); border-top: 5px solid var(--subject); box-shadow: var(--shadow); min-width: 0; }
.env .nm-card { margin: 14px 0; box-shadow: none; }
.nm-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.nm-k { flex-basis: 100%; font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.nm-grade { font-size: 34px; line-height: 1.05; color: var(--text); font-family: var(--serif); }
.nm-grade small, .nm-ch-g b small { font-size: 14px; color: var(--muted); font-family: inherit; }
.nm-none { font-size: 18px; color: var(--muted); }
.nm-tag { display: inline-block; padding: 1px 9px; border-radius: 999px; border: 1.5px dashed var(--border); color: var(--muted); font-size: 12.5px; font-weight: 700; }
.nm-count { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.nm-up { margin: 8px 0 0; padding: 6px 10px; border-radius: 10px; background: var(--ok-bg); color: var(--ok-ink); font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
/* Une baisse se dit sans alarme (fond neutre, jamais de rouge) ; une phrase d’appui sous la note. */
.nm-down { margin: 8px 0 0; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 13.5px; overflow-wrap: anywhere; }
.nm-say { margin: 6px 0 0; font-size: 14px; color: var(--text); }
.nm-next { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; min-height: 52px; padding: 8px 12px; border-radius: 14px; background: var(--accent-soft); color: var(--text); text-decoration: none; }
.nm-next > span { display: grid; min-width: 0; font-size: 14.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.nm-next small { font-size: 12px; font-weight: 400; color: var(--muted); }
.nm-next b { flex: none; font-size: 13.5px; color: var(--accent-ink); }
.nm-fold { margin-top: 10px; }
.nm-fold > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; font-size: 14.5px; color: var(--accent-ink); }
.nm-list { list-style: none; margin: 0; padding: 0; display: grid; }
.nm-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border-soft); }
.nm-ch { display: grid; align-content: center; min-height: 44px; min-width: 0; color: var(--text); text-decoration: none; }
.nm-ch strong { font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
.nm-ch small, .nm-ch-g small { font-size: 12.5px; color: var(--muted); }
.nm-ch-g { display: grid; justify-items: end; text-align: right; gap: 2px; }
.nm-ch-g b { font-size: 18px; color: var(--text); }
.nm-wait { font-weight: 700; }
.nm-go { grid-column: 1 / -1; justify-self: start; max-width: 100%; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--border-soft); color: var(--accent-ink); font-weight: 800; font-size: 13.5px; text-decoration: none; }
.nm-rest { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.cp-note { justify-self: start; font-size: 12px; font-weight: 700; color: var(--accent-ink); }

@media (min-width: 900px) {
  .nm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .pg-hero { padding: 24px 28px 18px; }
  .pg-week { font-size: 26px; }
  .pg-bar { height: 90px; max-width: 34px; }
  .pg-tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .pg-scores { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pg-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.gs-teaser { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--hl-soft); font-size: 15px; line-height: 1.45; font-weight: 600; }
.gs-chip-note { font-weight: 600; color: var(--muted); }

/* Contrôles et progrès, plus de valeur (préparer, bilan, raviver). Mobile d'abord, couleurs par jetons (clair et sombre).
   pp- : préparation guidée d'un contrôle noté (controls.create?tache=…) : le plan jour par jour, une action par étape.
   bl- : bilan d'une épreuve blanche (controls.show, après la fin) : la phrase, chaque notion et son action, le retest.
   rv- : réactiver une notion fragile (« Raviver en 3 questions ») sur Je m'entraîne et Mes progrès. */
.pp-title { margin-bottom: 4px; font-size: 24px; line-height: 1.25; }
.pp-when { margin: 0 0 14px; font-size: 15px; color: var(--muted); }
.pp-when b { color: var(--text); }
.pp-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: none; }
.pp-step { display: grid; grid-template-columns: 58px minmax(0, 1fr); grid-template-areas: "day act" "chk act"; gap: 2px 10px; align-items: center; }
.pp-day { grid-area: day; display: grid; align-self: end; } .pp-day b { font-size: 16px; } .pp-day small { font-size: 12px; color: var(--muted); }
.pp-check { grid-area: chk; align-self: start; justify-self: start; padding: 1px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-ink); font-size: 12px; font-weight: 800; }
.pp-check::before { content: "✓ "; }
.pp-form { grid-area: act; margin: 0; }
.pp-btn { grid-area: act; display: grid; gap: 2px; width: 100%; min-height: 58px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--border-soft); background: var(--card); box-shadow: var(--shadow); color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.pp-btn strong { font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; } .pp-btn small { font-size: 13px; color: var(--muted); }
.pp-step.is-now .pp-btn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pp-step.is-now .pp-btn small { color: var(--on-accent); opacity: .9; }
.pp-step.is-done .pp-btn { box-shadow: none; background: var(--surface); }
.pp-solid, .pp-on { margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.pp-solid b { color: var(--ok-ink); }
.pp-on a { display: inline-flex; align-items: center; min-height: 44px; vertical-align: middle; font-weight: 700; }
.pp-more { margin-top: 14px; }
.pp-more > summary { padding: 12px 0; font-weight: 700; cursor: pointer; }

.bl-hero { margin-top: 8px; padding: 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--border-soft); box-shadow: var(--shadow); }
.bl-score { margin: 0; font-size: 40px; font-weight: 900; line-height: 1; } .bl-score small { font-size: 16px; font-weight: 700; color: var(--muted); }
.bl-say { margin: 8px 0 6px; font-size: 19px; line-height: 1.35; }
.bl-meta { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.bl-sec { margin-top: 22px; } .bl-sec h2 { font-size: 19px; margin: 0 0 8px; }
.bl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bl-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--border-soft); }
.bl-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); font-weight: 900; }
.bl-row.is-ok .bl-mark { background: var(--ok-bg); color: var(--ok-ink); }
.bl-row.is-miss { border-left: 5px solid var(--warn-ink); } .bl-row.is-miss .bl-mark { background: var(--warn-bg); color: var(--warn-ink); }
.bl-main { display: grid; min-width: 0; } .bl-main strong { font-size: 15px; line-height: 1.3; } .bl-main small { font-size: 13px; color: var(--muted); }
.bl-main .bl-err { color: var(--warn-ink); font-weight: 700; }
.bl-act { grid-column: 2; justify-self: start; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 14.5px; text-decoration: none; }
.bl-retest { margin-top: 14px; display: grid; gap: 4px; justify-items: start; } .bl-retest .btn { min-height: 48px; } .bl-retest small { font-size: 13px; color: var(--muted); }
.bl-more { margin-top: 24px; } .bl-more > summary { padding: 12px 0; font-weight: 700; cursor: pointer; }
.bl-more h2 { font-size: 18px; margin: 18px 0 8px; }
.bl-links { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (min-width: 700px) {
  .bl-row { grid-template-columns: 28px minmax(0, 1fr) auto; } .bl-act { grid-column: 3; justify-self: end; }
  .pp-step { grid-template-columns: 90px minmax(0, 1fr); }
}

.rv-list a { grid-template-columns: auto minmax(0, 1fr); }
.rv-go { grid-column: 1 / -1; justify-self: start; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 14px; }
@media (min-width: 700px) { .rv-list a { grid-template-columns: auto minmax(0, 1fr) auto; } .rv-list .rv-go { grid-column: auto; } }
.pg-notion.is-revive { flex-wrap: wrap; padding-bottom: 10px; }
.pg-notion.is-revive .rv-go { margin-left: 40px; font-size: 13.5px; }

/* Coach de la série : une carte courte dans l'exercice, sous les choix (elle ne cache rien), qui se ferme d'un toucher. */
.ex-coach { margin-top: 12px; padding: 8px 12px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--border-soft); border-left: 4px solid var(--accent); box-shadow: var(--shadow); }
.ex-coach.is-stop { background: var(--ok-bg); border-left-color: var(--ok-ink); box-shadow: none; }
.xc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px -6px 0 0; }
.xc-who { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); }
.xc-who svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.xc-x { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.xc-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.xc-x:hover, .xc-x:focus-visible { background: var(--surface-2); color: var(--text); }
.xc-body p { margin: 0 0 6px; line-height: 1.5; }
.xc-body > p:last-child { margin-bottom: 0; }
.xc-body p:focus { outline: none; }
.xc-q { font-weight: 800; font-size: 16.5px; }
.xc-k { font-weight: 800; color: var(--accent-ink); }
.xc-go { font-weight: 700; }
.xc-stop { font-weight: 800; color: var(--ok-ink); }
.xc-reasons { display: grid; gap: 6px; margin: 6px 0 2px; }
.xc-r { min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 15.5px; line-height: 1.35; text-align: left; cursor: pointer; }
.xc-r:hover, .xc-r:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.xc-solo { min-height: 44px; padding: 0 2px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.xc-img { margin: 6px 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 15px; }
.xc-img > :first-child { margin-top: 0; } .xc-img > :last-child { margin-bottom: 0; }
.xc-img img, .xc-img svg { max-width: 100%; height: auto; }
.xc-img .cp-limit { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
/* Bilan : ce qui est compris, et une question à un toucher. */
.end-reflect { max-width: 520px; margin: 16px auto 0; text-align: left; }
.er-q { margin: 0 0 8px; font-weight: 800; }
.er-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.er-chip { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.er-chip:hover, .er-chip:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.er-thanks { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-ink); font-weight: 700; }
.er-thanks:focus { outline: none; }
.drill-next [data-next-actions] .btn[data-stop] { font-size: 17px; }

/* === Chantier « accompagnement adaptatif » : le coach de la série se souvient (mémoire pédagogique) === */
.xc-memo { margin: 0 0 6px; font-size: 14.5px; font-weight: 700; color: var(--muted); }
.xc-pre { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.xc-why { margin: 6px 0 0; font-weight: 700; }
.er-memo { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-weight: 700; }

/* === Chantier « apprendre à apprendre » : Construire ma réponse, C'est flou pour moi, Mes stratégies === */
.cr { max-width: 720px; margin: 0 auto; }
.cr-head { margin: 0 0 14px; }
.cr-h { margin: 2px 0 0; font-family: var(--serif); font-size: clamp(22px, 5.6vw, 30px); line-height: 1.15; }
.cr-k { margin: 0 0 8px; font-size: 13.5px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.cr-consigne, .cr-plan, .cr-tags { margin: 0 0 16px; padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border-soft); }
.cr-c-q { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.35; }
.cr-c-doc { margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 15px; line-height: 1.45; }
.cr-c-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.cr .chip { min-height: 44px; }
.cr-paste { display: block; margin: 10px 0 0; }
.cr textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; line-height: 1.4; padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); color: var(--text); resize: vertical; }
.cr textarea:focus { outline: none; border-color: var(--accent); }
.cr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cr-empty { margin: 0 0 10px; color: var(--muted); font-weight: 700; }
.cr-b { padding: 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); transition: border-color .2s ease; }
.cr-b.is-active { border-color: var(--accent); }
.cr-b.is-ko { border-color: var(--warn-ink); }
.cr-b.is-flash, .cp-move.is-flash { animation: cr-flash .7s var(--ease-out); }
@keyframes cr-flash { from { background: var(--hl-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .cr-b.is-flash, .cp-move.is-flash { animation: none; } }
.cr-b-h { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.cr-b-n { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 14px; }
.cr-b-l { flex: 1; min-width: 0; font-size: 15.5px; line-height: 1.25; }
.cr-b-act { flex: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-size: 17px; cursor: pointer; }
.cr-b-act:disabled { opacity: .35; cursor: default; }
.cr-b-msg { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14.5px; font-weight: 700; }
.cr-bricks { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.cr-add { min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1.5px dashed var(--accent); background: transparent; color: var(--accent-ink); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; text-align: left; }
.cr-add:hover, .cr-add:focus-visible { background: var(--accent-soft); }
.cr-tg { border-top: 1px solid var(--border-soft); }
.cr-tg:first-of-type { border-top: 0; }
.cr-tg > summary { min-height: 44px; display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.cr-tg-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 10px; }
.cr-tag { min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; text-align: left; line-height: 1.2; }
.cr-tag small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.cr-tag:hover, .cr-tag:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.cr-check { margin: 0 0 16px; }
.cr-check > .btn { width: 100%; min-height: 50px; }
.cr-retour:not(:empty) { margin: 12px 0 0; }
.cr-ok, .cr-ko { padding: 12px 14px; border-radius: var(--radius-sm); }
.cr-ok { background: var(--ok-bg); color: var(--ok-ink); }
.cr-ko { background: var(--warn-bg); color: var(--warn-ink); }
.cr-ok-h, .cr-ko-h { margin: 0; font-weight: 800; line-height: 1.4; }
.cr-ko ul { margin: 8px 0 0; padding-left: 20px; }
.cr-ko li + li { margin-top: 4px; }
.cr-ok .cr-k { margin: 12px 0 4px; color: inherit; }
.cr-texte { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--card); color: var(--text); line-height: 1.5; }
.cr-foot { margin: 0; font-size: 14.5px; color: var(--muted); }
.cr-foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-ink); font-weight: 700; }
/* C'est flou pour moi : sous l'idée, une autre façon de la voir, sans quitter la page. */
.cp-flou { margin: 14px 0 0; }
.cp-flou-btn { min-height: 44px; }
.cp-train { margin: 10px 0 0; min-height: 44px; display: inline-flex; align-items: center; }
.cp-train.cp-verify { background: var(--accent); color: #fff; border-color: var(--accent); } /* retour d’une erreur : vérifier le progrès */
.cp-flou-alt { margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 15.5px; }
.cp-flou-alt > :first-child { margin-top: 0; } .cp-flou-alt > :last-child { margin-bottom: 0; }
.cp-flou-alt img, .cp-flou-alt svg, .cp-flou-alt table { max-width: 100%; }
.cp-flou-alt .md { overflow-x: auto; }
.cp-flou-k { margin: 0 0 6px; font-weight: 800; color: var(--accent-ink); }
.cp-flou-alt .cp-limit { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.cp-flou-alt .btn { min-height: 44px; }
/* Mes stratégies : ce que l'élève fait déjà, une seule chose à essayer. */
.pg-strat-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.pg-strat-list li { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.pg-strat-list small { color: var(--muted); font-weight: 700; white-space: nowrap; }
.pg-strat-list span, .pg-strat-try span { display: block; margin-top: 2px; color: var(--muted); font-size: 14.5px; }
.pg-strat-try { padding: 12px 14px; border-radius: 12px; border: 1.5px dashed var(--accent); }
.pg-strat-try p { margin: 0; }
.pg-strat-k { font-size: 13.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--accent-ink); margin: 0 0 4px !important; }
.pg-strat-try .pg-act { margin-top: 10px; display: inline-flex; min-height: 44px; align-items: center; }

/* Téléphone : la pastille du bas (≈ 83 px au-dessus du bord, plus la zone sûre) ne cache ni l'action du chapitre ni un
   retour. scroll-padding-bottom : ce que le défilement (focus, scrollIntoView, app.js « retour ») laisse libre en bas. */
@media (max-width: 760px) {
  html { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  /* Pendant une activité (mode de la page) ou un travail dans le chapitre : pas de pastille, rien à réserver pour elle. */
  html[data-mode], html.at-work { scroll-padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  html[data-mode] main.page { margin-bottom: calc(24px + env(safe-area-inset-bottom)); }
  html.at-work .bottomnav.dock { transform: translateY(calc(100% + 24px)); opacity: 0; }
  html.at-work .bottomnav.dock:focus-within { transform: none; opacity: 1; }
  /* « Ton chemin » : tant que l'action de l'étape en cours est sous la pastille ou plus bas (titre long, rappel « la
     dernière fois », accroche longue), son double flotte juste au-dessus de la pastille (app.js). */
  .gs-float { position: fixed; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 29; width: auto; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5); }
}
.gs-float[hidden] { display: none; }
/* Contrastes relevés au parcours du 20/10 : le chiffre blanc sur l'or (2,6:1) et, en sombre, le lien couleur matière du
   parcours sur la carte sombre (2,3:1). */
.pg-tier.is-known .pg-count { color: #2b2008; }
[data-theme="dark"] .pc-go a:first-child { color: color-mix(in srgb, var(--subject, var(--accent)) 45%, #fff); }
[data-theme="dark"] .pg-tier.is-track .pg-count { color: var(--bg); }
/* « Ton chemin » au survol : texte blanc gardé, fond foncé de la matière (le survol générique des .btn passait au cyan clair
   en sombre : 1,5:1). */
.gs-go:not(.ghost):hover { background: color-mix(in srgb, var(--subject, var(--accent)) 82%, #000); }
/* Carte « devoir urgent » de l'accueil, ordinateur : le fond pétrole (règle commune plus haut) s'appliquait sans les textes
   clairs, réservés au téléphone : titre d'étiquette invisible (1:1), texte et boutons secondaires à 2,4:1. */
@media (min-width: 761px) {
  .mission-card { color: #fff; padding: 22px 24px; border-radius: 24px; }
  .mission-card .label-strong { color: rgba(255, 255, 255, .85) !important; }
  .mission-card .focus-title { color: #fff; }
  .mission-card .focus-title .mark { background: none; color: inherit; }
  .mission-card .focus-why { color: rgba(255, 255, 255, .88); }
  .mission-card .mission-actions .btn.quiet { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .45); }
}

/* L'ambiance selon l'âge, un même produit. 6e-5e : plus rond, plus grand, plus chaleureux, de grandes cibles au doigt.
   Lycée : plus sobre et plus dense, titres mesurés, étiquettes droites plutôt qu'en italique. 4e-3e : la base. */
html[data-age="jeune"] { --radius: 18px; --radius-sm: 14px; --hl: #ffcb6b; --hl-soft: #fff0d3; }
html[data-age="jeune"] body { font-size: 17.5px; }
html[data-age="jeune"] h1 { font-size: 42px; }
html[data-age="jeune"] .sh-hero, html[data-age="jeune"] .home-mission .practice-chapter.cockpit-practice[data-world] { border-radius: 34px; }
html[data-age="jeune"] .today-hello { font-size: clamp(46px, 12vw, 68px); }
html[data-age="jeune"] .home-mission .cockpit-practice[data-world] .go { border-radius: 999px; padding: 14px 24px; font-size: 18px; }
html[data-age="jeune"] :is(.btn, .quiz-opt, .mp-chip, .mp-piece, .mp-line, .mp-gap, .cp-choice) { min-height: 52px; }
html[data-age="jeune"] .quiz-opt.good, html[data-age="jeune"] .mp-chip.ok, html[data-age="jeune"] .mp-piece.ok { animation: age-joy .5s cubic-bezier(.2, .8, .2, 1.4) both; }
@keyframes age-joy { 40% { transform: scale(1.04); } }
html[data-age="lycee"] { --radius: 10px; --radius-sm: 8px; }
html[data-age="lycee"] h1 { font-size: 34px; letter-spacing: -.02em; }
html[data-age="lycee"] h2 { font-size: 22px; }
html[data-age="lycee"] .eyebrow { font-family: var(--font); font-style: normal; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
html[data-age="lycee"] .sh-hero, html[data-age="lycee"] .home-mission .practice-chapter.cockpit-practice[data-world] { border-radius: 18px; }
html[data-age="lycee"] .today-hello { font-size: clamp(34px, 9vw, 54px); letter-spacing: -.03em; }
html[data-age="lycee"] .home-mission .cockpit-practice[data-world] .go { border-radius: 10px; }
html[data-age="lycee"] .card { box-shadow: none; }
@media (prefers-reduced-motion: reduce) { html[data-age="jeune"] :is(.quiz-opt, .mp-chip, .mp-piece) { animation: none !important; } }

/* Lecture professeur d'un « Comprendre » (lien de relecture) : chaque geste lisible, avec ses réponses attendues. */
.rv-cp { border-top: 1px solid var(--border-soft); padding-top: 12px; margin-top: 12px; }
.rv-move { margin: 10px 0 14px; padding-left: 12px; border-left: 3px solid var(--border); }
.rv-choices { margin: 0 0 6px; }
.rv-ok { color: var(--ok-ink, #1f5c3a); }
.rv-ko { color: var(--late-ink, #9a3f1f); }
.rv-fig { max-width: 420px; margin: 8px 0; }
.rv-mark { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; border: 2px solid #fff; }
.rv-reveal { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin-top: 6px; }
.rv-try { margin-top: 12px; border: 1px dashed var(--accent); border-radius: 12px; padding: 8px 12px; }
.rv-try > summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.rv-try[open] > summary { margin-bottom: 8px; }
/* Relecture : la décision du professeur sous chaque contenu en attente */
.rv-decide { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); display: grid; gap: 10px; }
.rv-decide .alert { margin: 0; }
.rv-choices-decide { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.rv-choices-decide label { display: flex; align-items: center; gap: 6px; font-weight: 600; min-height: 44px; }
.rv-field { display: grid; gap: 4px; font-weight: 600; }
.rv-field textarea, .rv-field input { width: 100%; font: inherit; }
.rv-decide .btn { justify-self: start; }
/* Téléphones modestes : les grands blocs d'un chapitre hors de l'écran ne sont ni mis en page ni peints tant qu'on ne
   s'en approche pas (natif ; la taille réservée évite que la page saute). */
/* Page élève seulement (ses parties ont un id) : l'aperçu professeur, fait d'un seul grand bloc par contenu, garde un
   rendu complet, pour que les défilements programmés y tombent juste. */
.prog-section[id] .prog-sheet, .prog-section[id] .cp-notion { content-visibility: auto; contain-intrinsic-size: auto 520px; }
.math-pending { visibility: hidden; } /* formule en attente de KaTeX : jamais de LaTeX brut à l'écran (app.js : veil) */
.drill-next-alt { margin: 12px 0 0; font-size: 15px; } .drill-next-alt a { color: inherit; opacity: .85; } /* la liberté, sans concurrencer la recommandation */
/* Réponses écrites : le choix après une réponse non prévue ; la réponse ouverte et ses critères */
.cp-wr-choice { flex-wrap: wrap; margin: 8px 0 0; }
.cp-write textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--card, #fff); margin: 0 0 10px; }
.cp-criteria { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cp-criteria label { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.cp-criteria input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

/* Notion élémentaire (/notion/4C11.a) : une seule difficulté, sans le reste du chapitre. Titre lisible au téléphone,
   progression en une ligne, prérequis proposé (jamais imposé), lien discret vers la carte du chapitre. */
.nt-title { margin: 0; font-size: clamp(22px, 5.4vw, 30px); line-height: 1.2; }
.nt-state { margin: 10px 0 0; font-size: 15px; display: grid; gap: 2px; }
.nt-state span { opacity: .9; }
.nt-method { margin-top: 14px; }
.nt-goal { margin: 8px 0 0; font-size: 15px; opacity: .9; }
.nt-pre { margin: 18px 0 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); display: grid; gap: 10px; justify-items: start; }
.nt-pre p { margin: 0; }
.nt-section { margin-top: 26px; }
.nt-map { margin: 32px 0 8px; text-align: center; font-size: 15px; }
.nt-map a { color: var(--muted); }
