/* =====================================================================
   Vraiment — design system
   Encre (bleu-noir) · papier crème · sauge/prune (compréhension) · ambre (à discuter)
   Rouge brique : erreurs système uniquement. Aucune ressource externe.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light dark;

  /* surfaces */
  --paper: #fbf7ee;
  --paper-2: #f4eddc;
  --paper-3: #e9dfc8;
  --surface: #fffdf8;
  --line: #ded4bc;
  --line-strong: #c4b89c;

  /* encre */
  --ink: #16213a;
  --ink-2: #333e59;
  --ink-3: #566079;
  --ink-fill: #16213a;
  --on-ink: #fbf7ee;

  /* compréhension confirmée (sauge) */
  --sage: #365f4b;
  --sage-bg: #e3efe6;
  --sage-line: #a9c9b4;
  --sage-fill: #4b8267;

  /* information / compréhension partielle (prune) */
  --plum: #6a3b5c;
  --plum-bg: #f2e5ee;
  --plum-line: #d3b0c7;
  --plum-fill: #8a5479;

  /* à discuter (ambre) */
  --amber: #7d4c00;
  --amber-bg: #fcefd0;
  --amber-line: #e2bd6c;
  --amber-fill: #d39a1f;

  /* erreurs système (rouge brique) */
  --brick: #9a2d1f;
  --brick-bg: #f9e3dd;
  --brick-line: #e2aa9f;

  --focus: #1f4fd8;
  --shadow-1: 0 1px 2px rgba(22, 33, 58, .06), 0 2px 8px rgba(22, 33, 58, .05);
  --shadow-2: 0 2px 4px rgba(22, 33, 58, .06), 0 12px 32px rgba(22, 33, 58, .10);
  --shadow-3: 0 24px 64px rgba(22, 33, 58, .18);

  /* typographie */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: Seravek, "Gill Sans Nova", "Avenir Next", "Segoe UI", Ubuntu, Calibri, "DejaVu Sans", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --step--1: clamp(.82rem, .8rem + .1vw, .88rem);
  --step-0: clamp(1rem, .97rem + .15vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.08rem + .35vw, 1.3rem);
  --step-2: clamp(1.4rem, 1.25rem + .75vw, 1.75rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.5vw, 2.5rem);
  --step-4: clamp(2.2rem, 1.7rem + 2.6vw, 3.6rem);

  /* espacements et formes */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem; --s-9: 6.5rem;
  --r-1: 8px; --r-2: 12px; --r-3: 18px; --r-pill: 999px;
  --tap: 2.75rem;                 /* 44 px : cible tactile minimale */
  --wrap: 72rem; --wrap-narrow: 40rem; --wrap-read: 46rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1424;
    --paper-2: #131b2f;
    --paper-3: #1c263f;
    --surface: #172037;
    --line: #29344f;
    --line-strong: #3b4868;
    --ink: #f0eadb;
    --ink-2: #d2ccbd;
    --ink-3: #a6aa9f;
    --ink-fill: #f0eadb;
    --on-ink: #0e1424;
    --sage: #94cdab;
    --sage-bg: #17302a;
    --sage-line: #2f5a49;
    --sage-fill: #66a888;
    --plum: #dcaccf;
    --plum-bg: #2e1d2a;
    --plum-line: #5b3a52;
    --plum-fill: #b27a9e;
    --amber: #f2c673;
    --amber-bg: #33270e;
    --amber-line: #6b5120;
    --amber-fill: #e2ab3c;
    --brick: #f3a99a;
    --brick-bg: #3a1c17;
    --brick-line: #74382e;
    --focus: #8fb2ff;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .25);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    --shadow-3: 0 24px 64px rgba(0, 0, 0, .55);
  }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-sans); font-size: var(--step-0); line-height: 1.6;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; letter-spacing: -.012em; margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); font-family: var(--font-sans); letter-spacing: 0; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: color-mix(in srgb, var(--ink) 45%, transparent); }
a:hover { text-decoration-thickness: 2px; text-decoration-color: currentColor; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }
small, .small { font-size: var(--step--1); }
strong { font-weight: 650; }
code, kbd { font-family: var(--font-mono); font-size: .9em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; padding: .08em .4em; }
::selection { background: color-mix(in srgb, var(--amber-fill) 40%, transparent); }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-4); top: -4rem; z-index: 100; background: var(--ink-fill); color: var(--on-ink); padding: var(--s-3) var(--s-4); border-radius: var(--r-1); text-decoration: none; font-weight: 600; transition: top .15s; }
.skip-link:focus { top: var(--s-3); }

/* ---------- 3. Mise en page ---------- */
.container { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.container-narrow { width: min(100% - 2rem, var(--wrap-narrow)); margin-inline: auto; }
.container-read { width: min(100% - 2rem, var(--wrap-read)); margin-inline: auto; }
.page { padding-block: var(--s-6) var(--s-8); }
.stack > * + * { margin-top: var(--stack, var(--s-4)); }
.stack-sm { --stack: var(--s-2); } .stack-lg { --stack: var(--s-6); } .stack-xl { --stack: var(--s-7); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--s-3)); }
.cluster-between { justify-content: space-between; }
.cluster-end { justify-content: flex-end; }
.cluster-sm { --gap: var(--s-2); }
.grid { display: grid; gap: var(--gap, var(--s-5)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.split { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 60rem) { .split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .split-even { grid-template-columns: 1fr 1fr; } }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); }
.page-header p { color: var(--ink-3); margin-top: var(--s-2); max-width: 60ch; }
.section { padding-block: var(--s-8); }
.section-tight { padding-block: var(--s-7); }

.eyebrow { font-family: var(--font-sans); font-size: var(--step--1); font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.lead { font-size: var(--step-1); color: var(--ink-2); line-height: 1.5; max-width: 52ch; }
.muted { color: var(--ink-3); }
.serif { font-family: var(--font-serif); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.measure { max-width: 62ch; }
.mt-0 { margin-top: 0 !important; } .mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); }

/* ---------- 4. En-tête et navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; gap: var(--s-4); min-height: 4rem; }
.logo { display: inline-flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1; }
.logo:hover { text-decoration: none; }
.logo-word { font-family: var(--font-serif); font-weight: 650; font-size: 1.55rem; letter-spacing: -.02em; }
.logo svg { display: block; width: 100%; height: .5rem; margin-top: -.12rem; color: var(--sage-fill); overflow: visible; }
.nav { display: flex; align-items: center; gap: var(--s-1); margin-left: var(--s-5); flex: 1; }
.nav-link { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-3); border-radius: var(--r-pill); text-decoration: none; color: var(--ink-2); font-weight: 550; font-size: .97rem; }
.nav-link:hover { background: var(--paper-2); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--paper-3); color: var(--ink); }
.nav-spacer { flex: 1; }
.nav-user { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.nav-toggle { display: none; margin-left: auto; }
@media (max-width: 52rem) {
  .site-header .bar { flex-wrap: wrap; padding-block: var(--s-2); }
  .js .nav-toggle { display: inline-flex; }
  .nav, .nav-user { flex-basis: 100%; margin-left: 0; }
  .nav { flex-direction: column; align-items: stretch; padding-bottom: var(--s-2); }
  .nav-user { flex-direction: column; align-items: stretch; padding-bottom: var(--s-3); border-top: 1px solid var(--line); padding-top: var(--s-3); }
  .js .nav:not(.is-open), .js .nav-user:not(.is-open) { display: none; }
  .nav-link { border-radius: var(--r-1); }
}
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s-6); color: var(--ink-3); font-size: var(--step--1); background: var(--paper-2); }
.site-footer a { color: var(--ink-2); }
.footer-grid { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); list-style: none; padding: 0; margin: 0; }

/* ---------- 5. Boutons ---------- */
.btn {
  --_bg: var(--surface); --_fg: var(--ink); --_bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-5);
  font: inherit; font-weight: 620; font-size: .98rem; line-height: 1.1; text-decoration: none; text-align: center;
  color: var(--_fg); background: var(--_bg); border: 1.5px solid var(--_bd); border-radius: var(--r-pill);
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background-color .12s, border-color .12s;
}
.btn:hover { text-decoration: none; border-color: var(--ink-2); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-primary { --_bg: var(--ink-fill); --_fg: var(--on-ink); --_bd: var(--ink-fill); }
.btn-primary:hover { border-color: var(--ink-fill); filter: brightness(1.12); }
@media (prefers-color-scheme: dark) { .btn-primary:hover { filter: brightness(.94); } }
.btn-secondary { --_bg: var(--paper-2); }
.btn-ghost { --_bg: transparent; --_bd: transparent; }
.btn-ghost:hover { background: var(--paper-2); box-shadow: none; border-color: transparent; }
.btn-sage { --_bg: var(--sage); --_fg: var(--paper); --_bd: var(--sage); }
@media (prefers-color-scheme: dark) { .btn-sage { --_fg: #0e1424; --_bg: #8fcba7; --_bd: #8fcba7; } }
.btn-danger { --_bg: transparent; --_fg: var(--brick); --_bd: var(--brick-line); }
.btn-danger:hover { background: var(--brick-bg); border-color: var(--brick); }
.btn-sm { min-height: 2.25rem; padding: 0 var(--s-4); font-size: .9rem; }
.btn-lg { min-height: 3.4rem; padding: 0 var(--s-6); font-size: 1.08rem; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 0; width: var(--tap); }
.btn[aria-busy="true"] { position: relative; color: transparent; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--_fg); border-right-color: transparent; animation: spin .8s linear infinite; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 6. Formulaires ---------- */
.field { display: grid; gap: var(--s-2); }
.field > label, .label { font-weight: 620; font-size: .97rem; color: var(--ink); }
.field .req { color: var(--ink-3); font-weight: 450; }
.hint { font-size: var(--step--1); color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: .65rem var(--s-4);
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-2);
  transition: border-color .12s, box-shadow .12s;
  appearance: none; -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: .85; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.textarea { min-height: 8rem; resize: vertical; line-height: 1.55; }
.select { padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23566079' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--amber); background: color-mix(in srgb, var(--amber-bg) 40%, var(--surface)); }
.field-error { display: flex; gap: var(--s-2); align-items: flex-start; color: var(--amber); font-size: var(--step--1); font-weight: 600; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-top: var(--s-5); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 620; margin-bottom: var(--s-2); }
.check { display: flex; gap: var(--s-3); align-items: flex-start; min-height: var(--tap); padding-block: var(--s-2); cursor: pointer; }
.check input { width: 1.35rem; height: 1.35rem; margin: .15rem 0 0; accent-color: var(--ink-fill); flex: none; }
.dropzone { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); padding: var(--s-5); border: 2px dashed var(--line-strong); border-radius: var(--r-2); background: var(--surface); }
.dropzone.is-over { border-color: var(--sage-fill); background: var(--sage-bg); }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.dz-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.dropzone label.btn { position: relative; z-index: 1; pointer-events: none; }
.dz-text { color: var(--ink-3); font-size: var(--step--1); flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.dropzone.has-file .dz-text { color: var(--ink); font-weight: 600; }
.input-file { padding: var(--s-4); border: 2px dashed var(--line-strong); border-radius: var(--r-2); background: var(--surface); width: 100%; font: inherit; }

/* choix de réponse (élève) : grandes cibles tactiles */
.choices { display: grid; gap: var(--s-3); }
.choices-2 { grid-template-columns: 1fr 1fr; }
.choice { position: relative; display: flex; align-items: center; gap: var(--s-3); min-height: 3.5rem; padding: var(--s-3) var(--s-4); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r-2); cursor: pointer; transition: border-color .12s, background-color .12s, transform .12s var(--ease); }
.choice:hover { border-color: var(--ink-3); background: var(--paper-2); }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice-mark { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center; transition: border-color .12s, background-color .12s; }
.choice-mark::after { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--on-ink); transform: scale(0); transition: transform .15s var(--ease); }
.choice-key { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-3); width: 1.4rem; text-align: center; }
.choice-text { flex: 1; font-size: 1.04rem; line-height: 1.4; overflow-wrap: anywhere; }
.choice:has(input:checked) { border-color: var(--ink-fill); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--ink-fill); }
.choice:has(input:checked) .choice-mark { background: var(--ink-fill); border-color: var(--ink-fill); }
.choice:has(input:checked) .choice-mark::after { transform: scale(1); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-tf { justify-content: center; min-height: 4.25rem; font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; text-align: center; }
.choice-tf .choice-text { flex: 0 1 auto; font-size: inherit; }
@media (max-width: 26rem) { .choices-2 { gap: var(--s-2); } .choice-tf { font-size: 1.15rem; } }

/* ---------- 7. Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-1); }
.card-body { padding: var(--s-5); }
.card-header { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.card-header h2, .card-header h3 { font-size: var(--step-1); }
.card-footer { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--line); background: var(--paper-2); border-radius: 0 0 var(--r-3) var(--r-3); }
.card-flat { box-shadow: none; background: var(--paper-2); }
.card-link { display: block; text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); text-decoration: none; }
.card-ok { background: var(--sage-bg); border-color: var(--sage-line); }
.card-warn { background: var(--amber-bg); border-color: var(--amber-line); }
.stat { display: grid; gap: var(--s-1); }
.stat-value { font-family: var(--font-serif); font-size: var(--step-3); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.stat-label { font-size: var(--step--1); color: var(--ink-3); font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-5); margin: 0; }
.kv dt { color: var(--ink-3); font-size: var(--step--1); font-weight: 600; padding-top: .15em; }
.kv dd { margin: 0; }
.kv-stack { grid-template-columns: 1fr; gap: 0; } .kv-stack dt { padding-top: var(--s-3); } .kv-stack dt:first-child { padding-top: 0; } .kv-stack dd { font-weight: 600; }

/* ---------- 8. Alertes, toasts ---------- */
.alert { display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-2); border: 1px solid var(--line); background: var(--paper-2); font-size: .98rem; }
.alert > .icon { margin-top: .2em; }
.alert-ok { background: var(--sage-bg); border-color: var(--sage-line); color: var(--ink); }
.alert-ok > .icon { color: var(--sage); }
.alert-info { background: var(--plum-bg); border-color: var(--plum-line); }
.alert-info > .icon { color: var(--plum); }
.alert-warn { background: var(--amber-bg); border-color: var(--amber-line); }
.alert-warn > .icon { color: var(--amber); }
.alert-error { background: var(--brick-bg); border-color: var(--brick-line); }
.alert-error > .icon { color: var(--brick); }
.alert-title { font-weight: 650; display: block; }
.toast-region { position: fixed; z-index: 90; bottom: var(--s-4); left: 50%; transform: translateX(-50%); width: min(100% - 2rem, 26rem); display: grid; gap: var(--s-2); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); background: var(--ink-fill); color: var(--on-ink); border-radius: var(--r-2); box-shadow: var(--shadow-2); animation: toast-in .25s var(--ease) both; font-size: .95rem; }
.toast.is-leaving { animation: toast-out .2s ease-in both; }
.toast .icon { margin-top: .15em; }

/* ---------- 9. Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .4em; padding: .22rem .7rem; border-radius: var(--r-pill); font-size: var(--step--1); font-weight: 650; line-height: 1.3; border: 1px solid var(--line-strong); background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-ok { background: var(--sage-bg); border-color: var(--sage-line); color: var(--sage); }
.badge-info { background: var(--plum-bg); border-color: var(--plum-line); color: var(--plum); }
.badge-warn { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.badge-warn-strong { background: var(--amber-bg); border-color: var(--amber-fill); color: var(--amber); }
.badge-warn-strong::before { border-radius: 2px; transform: rotate(45deg); }
.badge-muted { color: var(--ink-3); }
.badge-error { background: var(--brick-bg); border-color: var(--brick-line); color: var(--brick); }
.badge-plain::before { display: none; }

/* ---------- 10. Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.table caption { text-align: left; padding: var(--s-4) var(--s-5); font-family: var(--font-serif); font-size: var(--step-1); font-weight: 600; }
.table th, .table td { padding: var(--s-3) var(--s-4); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table thead th { font-size: var(--step--1); font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; background: var(--paper-2); white-space: nowrap; position: sticky; top: 0; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--paper-2) 60%, transparent); }
.table .num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th button { all: unset; cursor: pointer; display: inline-flex; gap: .35em; align-items: center; min-height: 2rem; }
.table th button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.table th[aria-sort="ascending"] button::after { content: "↑"; } .table th[aria-sort="descending"] button::after { content: "↓"; }
.table th[aria-sort="none"] button::after { content: "↕"; opacity: .45; }
.table .row-link { font-weight: 620; }

/* ---------- 11. Onglets, feuille latérale, aide ---------- */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tab { all: unset; box-sizing: border-box; cursor: pointer; padding: 0 var(--s-4); min-height: var(--tap); display: inline-flex; align-items: center; font-weight: 620; color: var(--ink-3); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink-fill); }
.tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 6px; }
.tabpanel { padding-top: var(--s-5); }
dialog.sheet { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(100vw, 34rem); padding: 0; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); border-left: 1px solid var(--line); }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .28s var(--ease) both; }
dialog.sheet::backdrop { background: rgba(14, 20, 36, .45); animation: fade-in .2s both; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.sheet-body { padding: var(--s-5); overflow-y: auto; flex: 1; }
details.help { display: inline-block; position: relative; vertical-align: middle; }
details.help > summary { list-style: none; cursor: pointer; display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1.5px solid var(--ink-3); color: var(--ink-3); font-size: .8rem; font-weight: 700; font-family: var(--font-serif); }
details.help > summary::-webkit-details-marker { display: none; }
details.help > summary:hover { color: var(--ink); border-color: var(--ink); }
details.help > p { position: absolute; z-index: 20; left: 50%; transform: translateX(-50%); top: calc(100% + .4rem); width: min(18rem, 80vw); padding: var(--s-3) var(--s-4); background: var(--ink-fill); color: var(--on-ink); border-radius: var(--r-2); font-size: var(--step--1); line-height: 1.45; font-weight: 450; box-shadow: var(--shadow-2); text-align: left; text-transform: none; letter-spacing: 0; }

/* ---------- 12. Progression, jauge (la « lettre soulignée ») ---------- */
.progress { appearance: none; -webkit-appearance: none; width: 100%; height: .5rem; border: 0; border-radius: var(--r-pill); background: var(--paper-3); overflow: hidden; display: block; }
.progress::-webkit-progress-bar { background: var(--paper-3); border-radius: var(--r-pill); }
.progress::-webkit-progress-value { background: var(--ink-fill); border-radius: var(--r-pill); transition: width .35s var(--ease); }
.progress::-moz-progress-bar { background: var(--ink-fill); border-radius: var(--r-pill); }
.steps { display: flex; gap: var(--s-2); list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { flex: 1; counter-increment: step; display: flex; flex-direction: column; gap: var(--s-2); font-size: var(--step--1); font-weight: 600; color: var(--ink-3); }
.steps li::before { content: ""; height: 4px; border-radius: 2px; background: var(--paper-3); }
.steps li[aria-current="step"] { color: var(--ink); } .steps li[aria-current="step"]::before, .steps li.is-done::before { background: var(--ink-fill); }

.gauge { --g: var(--sage-fill); --g-text: var(--sage); display: grid; gap: var(--s-1); }
.gauge-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.gauge-value { font-family: var(--font-serif); font-size: var(--step-3); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; color: var(--g-text); letter-spacing: -.02em; }
.gauge-unit { font-size: .45em; font-weight: 500; color: var(--ink-3); margin-left: .12em; }
.gauge-label { font-size: var(--step--1); font-weight: 650; color: var(--ink-2); }
.gauge { max-width: 26rem; }
.gauge-svg { display: block; width: 100%; height: auto; overflow: visible; margin-top: var(--s-2); }
.gauge-track { fill: none; stroke: var(--paper-3); stroke-width: 5; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: var(--g); stroke-width: 5; stroke-linecap: round; animation: draw 1.1s var(--ease) .15s both; }
.gauge-band { fill: none; stroke: var(--g); stroke-width: 10; stroke-linecap: butt; opacity: .28; }
.gauge-caption { font-size: var(--step--1); color: var(--ink-3); }
.gauge-sm { max-width: 12rem; } .gauge-sm .gauge-value { font-size: var(--step-1); }
.gauge-lg { max-width: 34rem; } .gauge-lg .gauge-value { font-size: var(--step-4); }
.gauge-wide { max-width: none; }
.gauge-ok { --g: var(--sage-fill); --g-text: var(--sage); }
.gauge-info { --g: var(--plum-fill); --g-text: var(--plum); }
.gauge-warn { --g: var(--amber-fill); --g-text: var(--amber); }
.gauge-neutral { --g: var(--ink-3); --g-text: var(--ink); }
.underline-draw { display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 5; }
.u-word { position: relative; display: inline-block; white-space: nowrap; }
.u-word svg { position: absolute; left: -2%; width: 104%; bottom: -.22em; height: .3em; color: var(--sage-fill); overflow: visible; pointer-events: none; }
.u-word svg path { stroke-dasharray: 100; stroke-dashoffset: 0; animation: draw 1.2s var(--ease) .35s both; }

/* ---------- 13. États vides, pagination ---------- */
.empty { text-align: center; padding: var(--s-8) var(--s-5); border: 1.5px dashed var(--line-strong); border-radius: var(--r-3); background: color-mix(in srgb, var(--paper-2) 60%, transparent); display: grid; justify-items: center; gap: var(--s-3); }
.empty svg { width: 7rem; color: var(--ink-3); margin-bottom: var(--s-2); }
.empty .empty-title { font-family: var(--font-serif); font-weight: 600; font-size: var(--step-1); color: var(--ink); line-height: 1.2; } .empty p { color: var(--ink-3); max-width: 42ch; }
.pagination { display: flex; flex-wrap: wrap; gap: var(--s-1); justify-content: center; align-items: center; list-style: none; padding: 0; margin: var(--s-5) 0 0; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: var(--tap); padding: 0 var(--s-3); border-radius: var(--r-2); text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pagination a:hover { background: var(--paper-2); }
.pagination [aria-current="page"] { background: var(--ink-fill); color: var(--on-ink); }
.pagination .is-disabled { opacity: .4; }

/* ---------- 14. Pages d'authentification, erreurs ---------- */
.auth { display: grid; place-items: start center; padding: var(--s-7) var(--s-4) var(--s-8); }
.auth-card { width: min(100%, 27rem); }
.auth-card .card-body { padding: var(--s-6); }
.auth-title { margin-bottom: var(--s-2); }
.error-page { text-align: center; padding: var(--s-9) var(--s-4); display: grid; justify-items: center; gap: var(--s-4); }
.error-code { font-family: var(--font-serif); font-size: clamp(4rem, 14vw, 8rem); font-weight: 600; line-height: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.error-page.is-system .error-code { color: var(--brick); }

/* ---------- 15. Page publique (landing) ---------- */
.hero { position: relative; padding-block: var(--s-8) var(--s-8); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto auto; width: 46rem; height: 46rem; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--amber-fill) 20%, transparent), transparent); pointer-events: none; z-index: 0; }
.hero::after { content: ""; position: absolute; inset: auto auto -30% -15%; width: 38rem; height: 38rem; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--sage-fill) 16%, transparent), transparent); pointer-events: none; z-index: 0; }
.hero-grid { position: relative; z-index: 1; display: grid; gap: var(--s-7); align-items: center; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: 1.15fr .85fr; gap: var(--s-8); } }
.hero h1 { font-size: var(--step-4); line-height: 1.04; letter-spacing: -.025em; }
.hero .lead { margin-top: var(--s-5); }
.hero-actions { margin-top: var(--s-6); }
.hero-note { margin-top: var(--s-4); font-size: var(--step--1); color: var(--ink-3); }
.specimen { position: relative; display: grid; gap: var(--s-4); }
.specimen-card { padding: var(--s-5); }
.specimen-card + .specimen-card { margin-left: var(--s-6); }
.specimen-tag { position: absolute; top: -.7rem; right: var(--s-4); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: .1rem .7rem; font-size: .78rem; font-weight: 650; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; z-index: 2; }
.specimen-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.specimen-name { font-family: var(--font-serif); font-size: var(--step-1); font-weight: 600; }
.specimen-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
.specimen-card.is-tilt { transform: rotate(-1.2deg); }
.step-card { display: grid; gap: var(--s-3); align-content: start; }
.step-num { font-family: var(--font-serif); font-size: var(--step-3); color: var(--sage-fill); line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.band-ink { background: var(--ink-fill); color: var(--on-ink); }
.band-ink h2, .band-ink h3 { color: var(--on-ink); }
.band-ink .lead, .band-ink p { color: color-mix(in srgb, var(--on-ink) 82%, transparent); }
.band-ink .eyebrow { color: color-mix(in srgb, var(--on-ink) 65%, transparent); }
.principles { list-style: none; padding: 0; margin: var(--s-6) 0 0; display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.principles li { display: grid; gap: var(--s-2); padding-top: var(--s-4); border-top: 1.5px solid color-mix(in srgb, var(--on-ink) 28%, transparent); }
.principles h3 { font-size: var(--step-1); }
.pack { display: grid; gap: var(--s-3); align-content: start; height: 100%; }
.pack-price { font-family: var(--font-serif); font-size: var(--step-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.pack.is-featured { border-color: var(--ink-fill); box-shadow: var(--shadow-2); }
.prose { max-width: 62ch; }
.prose > * + * { margin-top: var(--s-4); }
.prose h2 { margin-top: var(--s-7); } .prose h3 { margin-top: var(--s-5); }
.prose ul, .prose ol { padding-left: 1.25rem; } .prose li + li { margin-top: var(--s-2); }
.callout { border-left: 4px solid var(--sage-fill); padding: var(--s-3) var(--s-5); background: var(--sage-bg); border-radius: 0 var(--r-2) var(--r-2) 0; }

/* ---------- 16. Parcours élève ---------- */
.student-shell { background: var(--paper); }
.student-header { padding-block: var(--s-4); }
.student-header .logo-word { line-height: 1.15; }
.start-lead { font-size: var(--step-0); margin-top: var(--s-4); }
.start-facts { color: var(--ink-2); font-weight: 600; }
.start-note { text-align: center; margin: 0; }
.start-form .field { margin: 0; }
.student-header .student-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.intro-card .card-body { padding: var(--s-6); }
.promise { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.promise li { display: flex; gap: var(--s-3); align-items: flex-start; }
.promise .icon { color: var(--sage); margin-top: .25em; }
.runner { padding-block: var(--s-4) var(--s-8); }
.runner-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); padding-block: var(--s-3); border-bottom: 1px solid var(--line); }
.runner-meta { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); font-size: var(--step--1); font-weight: 650; color: var(--ink-2); }
.runner-title { font-family: var(--font-sans); font-size: var(--step--1); font-weight: 650; color: var(--ink-3); letter-spacing: 0; }
.timer { display: inline-flex; align-items: center; gap: var(--s-1); font-variant-numeric: tabular-nums; padding: .15rem .65rem; border-radius: var(--r-pill); background: var(--paper-2); border: 1px solid var(--line); }
.timer.is-low { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.save-state { font-size: var(--step--1); color: var(--ink-3); display: inline-flex; align-items: center; gap: .35em; white-space: nowrap; flex: none; }
.runner-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.save-state[data-state="saving"] { color: var(--ink-3); } .save-state[data-state="error"] { color: var(--amber); font-weight: 650; }
.qcard { padding-top: var(--s-6); animation: slide-in .3s var(--ease) both; }
.js .qcard:not(.is-current) { display: none; }
.js #review .btn-lg { margin-top: var(--s-4); }
.qcard h2 { font-size: var(--step-2); line-height: 1.25; margin: var(--s-2) 0 var(--s-5); outline: none; overflow-wrap: anywhere; }
.qcard .textarea { min-height: 11rem; font-size: 1.05rem; }
.counter { text-align: right; font-size: var(--step--1); color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: var(--s-1); }
.runner-nav { display: flex; gap: var(--s-3); justify-content: space-between; margin-top: var(--s-6); }
.runner-nav .btn { flex: 1; max-width: 14rem; }
.runner-nav .btn-prev { flex: 0 0 auto; }
.runner-nav .spacer { flex: 1; }
.review-list { list-style: none; padding: 0; margin: var(--s-4) 0; display: grid; gap: var(--s-2); }
.review-list li a { display: flex; gap: var(--s-3); align-items: center; min-height: var(--tap); padding: var(--s-2) var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); text-decoration: none; }
.review-list li a:hover { border-color: var(--ink-3); }
.review-list .rn { font-weight: 700; font-variant-numeric: tabular-nums; width: 1.8rem; color: var(--ink-3); }
.review-list .rt { flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.review-list li a { align-items: flex-start; padding-block: var(--s-3); }
.review-list .rn { padding-top: .1em; }
.review-list .badge { margin-top: .1rem; }
.timer-flag { font-size: .8em; font-weight: 700; }
.timeup-banner { margin-top: var(--s-3); }
.dots { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--s-2); }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--paper-3); border: 1px solid var(--line-strong); }
.dot.is-done { background: var(--sage-fill); border-color: var(--sage-fill); } .dot.is-current { outline: 2px solid var(--ink-fill); outline-offset: 2px; }
.correction { display: grid; gap: var(--s-4); list-style: none; padding: 0; margin: 0; }
.correction > li { padding: var(--s-5); }
.correction h3 { font-family: var(--font-serif); font-size: var(--step-1); margin: var(--s-2) 0 var(--s-3); }
.answer-line { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); align-items: baseline; }
.answer-line .k { font-size: var(--step--1); font-weight: 650; color: var(--ink-3); min-width: 8.5rem; }
.thanks-mark { width: 5rem; color: var(--sage-fill); }

/* ---------- 17. Animations ---------- */
@keyframes draw { from { stroke-dashoffset: 100; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(14px); } }
@keyframes sheet-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.rise { animation: rise .6s var(--ease) both; }
.rise-2 { animation-delay: .1s; } .rise-3 { animation-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- 18. Impression ---------- */
@media print {
  /* toujours en clair à l'impression, même si l'écran est en thème sombre */
  :root { --paper: #fff; --paper-2: #f5f2ea; --paper-3: #e6e1d3; --surface: #fff; --line: #cfc8b6; --line-strong: #9a927e;
    --ink: #111; --ink-2: #222; --ink-3: #444; --ink-fill: #111; --on-ink: #fff;
    --sage: #1f4a37; --sage-bg: #e8f1ea; --sage-line: #a9c9b4; --sage-fill: #4b8267;
    --plum: #6a3b5c; --plum-bg: #f2e5ee; --plum-line: #d3b0c7; --plum-fill: #8a5479;
    --amber: #6b4000; --amber-bg: #fcefd0; --amber-line: #e2bd6c; --amber-fill: #d39a1f; --brick: #8a261a; --brick-bg: #f9e3dd; --brick-line: #e2aa9f; }
  @page { margin: 14mm; }
  .site-header, .site-footer, .skip-link, .toast-region, .btn, .nav, .crumbs, .imp-banner, .no-print, .edit-box, .publish-bar, .journey { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.45; }
  .container, .container-narrow { width: 100%; }
  .page { padding-block: 0; }
  .print-only { display: block !important; }
  .card { box-shadow: none; break-inside: avoid; }
  .answer-card, .trace, .evidence li { break-inside: avoid; box-shadow: none; }
  .answers { gap: 3mm; }
  .coh { grid-template-columns: 1fr; }
  .page-header { margin-bottom: 4mm; }
  .badge, .score, .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  details:not([open]) > :not(summary) { display: none; }
}
.print-only { display: none; }
.print-head { border-bottom: 2px solid var(--ink); padding-bottom: var(--s-3); margin-bottom: var(--s-4); }
.print-head p { margin: 0; }

/* ---------- 19. Utilitaires ---------- */
.plain-list { list-style: none; padding: 0; margin: 0; }
.center .lead { margin-inline: auto; }
.w-full { width: 100%; }

/* ajustements exécuteur */
.runner-nav .btn { white-space: nowrap; max-width: none; }
.runner-nav .btn:not(.btn-prev) { flex: 1; }
.runner-nav .spacer { display: none; }
.review-list li a, .review-list .rt { min-width: 0; }
.review-list .badge { flex: none; }
.stack-sm.plain-list { --stack: var(--s-3); }
.principles h3 + p { margin-top: var(--s-1); }
.review-list { grid-template-columns: minmax(0, 1fr); } .review-list li { min-width: 0; }

/* ---------- 20. Session de support (impersonation) et pastille de crédits ---------- */
.imp-banner { position: sticky; top: 0; z-index: 60; background: var(--amber-fill); color: #1b1200; border-bottom: 2px solid var(--amber); font-size: .95rem; }
.imp-banner .imp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); padding-block: var(--s-2); }
.imp-banner p { margin: 0; line-height: 1.4; }
.imp-banner .imp-meta { font-weight: 450; }
.imp-banner .imp-quit { background: #1b1200; color: #fff6dd; border-color: #1b1200; }
.imp-banner .imp-quit:hover { background: #000; }
.site-header { top: var(--imp-offset, 0); }
.credit-pill { display: inline-flex; align-items: center; gap: .4em; min-height: 2rem; padding: 0 .75rem; border-radius: var(--r-pill); border: 1px solid var(--sage-line); background: var(--sage-bg); color: var(--sage); font-size: var(--step--1); font-weight: 650; text-decoration: none; white-space: nowrap; }
.credit-pill .icon { width: 1rem; height: 1rem; }
a.credit-pill:hover { text-decoration: none; filter: brightness(.97); }
.credit-pill.is-low { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
@media (max-width: 52rem) { .credit-pill { align-self: flex-start; } }

/* ---------- 21. Espace professeur ---------- */
.mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); } .mb-5 { margin-bottom: var(--s-5); } .pt-0 { padding-top: 0; }
.grow { flex: 1 1 14rem; } .wrap { overflow-wrap: anywhere; }
.h-sm { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 650; letter-spacing: 0; display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.h-md { font-size: var(--step-2); }
.input-short { max-width: 9rem; }
.cost-note { margin-left: var(--s-3); color: var(--ink-3); font-size: var(--step--1); }
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; font-size: var(--step--1); color: var(--ink-3); margin-bottom: var(--s-4); }
.crumbs a { color: var(--ink-3); } .crumbs [aria-current] { color: var(--ink-2); font-weight: 600; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-1); }
ul.chips { list-style: none; padding: 0; margin: 0; }
.roster-box > summary { margin-top: var(--s-2); }
.chip { display: inline-block; padding: .1rem .55rem; border-radius: var(--r-pill); background: var(--paper-2); border: 1px solid var(--line); font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.chip-scope-neighbor { background: var(--plum-bg); border-color: var(--plum-line); color: var(--plum); }
.chip-off { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }

/* listes en lignes */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row:last-child { border-bottom: 0; }
.row-pad { padding-inline: var(--s-5); }
.row-main { min-width: 0; flex: 1 1 14rem; } .row-main p { margin-top: .1rem; }
.row-side { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; justify-content: flex-end; }
.row-link { font-weight: 620; overflow-wrap: anywhere; }
.rows-tight .row { padding-block: var(--s-2); }
.stat-card .card-body { padding: var(--s-4) var(--s-5); }
.next-step-body { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); align-items: center; justify-content: space-between; }
.next-step-body > div { flex: 1 1 22rem; max-width: 46rem; } .next-step h2 { font-size: var(--step-2); margin: var(--s-1) 0 var(--s-2); }
.next-step.card-ok { border-width: 1.5px; }
.flag-list { margin: var(--s-2) 0 0; padding-left: 1.2rem; font-size: var(--step--1); }
.wait .progress { max-width: 28rem; } .wait h2 { font-size: var(--step-1); }
.wait-steps li { display: flex; gap: var(--s-2); align-items: center; }
progress.progress:not([value]) { background: linear-gradient(90deg, var(--paper-3) 0 30%, var(--sage-fill) 30% 60%, var(--paper-3) 60%); background-size: 200% 100%; animation: indet 1.4s linear infinite; }
@keyframes indet { to { background-position: -200% 0; } }

/* filtres, tableaux en cartes sur mobile */
.filters-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; }
.filters-go { display: flex; gap: var(--s-2); }
.sort-link { color: inherit; text-decoration: none; display: inline-flex; min-height: 2rem; align-items: center; }
.sort-link:hover { text-decoration: underline; }
@media (max-width: 44rem) {
  .table-cards thead { position: absolute; left: -9999px; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
  .table-cards td { display: flex; justify-content: space-between; gap: var(--s-3); border: 0; padding: .3rem 0; text-align: right; }
  .table-cards td::before { content: attr(data-label); font-size: var(--step--1); font-weight: 650; color: var(--ink-3); text-align: left; flex: none; }
  .table-cards td[data-label=""]::before { display: none; }
  .table-cards td.num { text-align: right; }
  .table-cards tbody tr:hover td { background: none; }
}

/* assistant de dépôt */
.wizard.is-ready .wizard-step:not(.is-active) { display: none; }
.wizard-steps { margin-bottom: var(--s-6); }
.wizard-steps li.is-done::before { background: var(--sage-fill); }
.wizard-step { padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-1); }
.wizard:not(.is-ready) .wizard-step + .wizard-step { margin-top: var(--s-5); }
.wizard:not(.is-ready) .wizard-nav button[data-next], .wizard:not(.is-ready) .wizard-nav button[data-prev] { display: none; }
.wizard .steps { display: none; } .wizard.is-ready .steps { display: flex; }
.step-title { font-size: var(--step-2); outline: none; }
.wizard-nav { display: flex; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-4); flex-wrap: wrap; }
.seg { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); overflow: hidden; background: var(--surface); }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: inline-flex; align-items: center; min-height: calc(var(--tap) - 3px); padding: 0 var(--s-4); font-weight: 600; font-size: .95rem; color: var(--ink-2); white-space: nowrap; }
.seg-opt input:checked + span { background: var(--ink-fill); color: var(--on-ink); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--r-pill); }
.pills { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span { display: inline-grid; place-items: center; min-width: 3.4rem; min-height: var(--tap); padding: 0 var(--s-4); border: 1.5px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill input:checked + span { background: var(--ink-fill); color: var(--on-ink); border-color: var(--ink-fill); }
.pill input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.pill:hover span { border-color: var(--ink-3); }
.options { display: grid; gap: var(--s-2); }
.option { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border: 1.5px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); cursor: pointer; min-height: var(--tap); }
.option input { margin-top: .3rem; width: 1.2rem; height: 1.2rem; accent-color: var(--ink-fill); flex: none; }
.option > span { display: grid; gap: .1rem; }
.option:has(input:checked) { border-color: var(--ink-fill); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--ink-fill); }
.option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.range-row { display: flex; align-items: center; gap: var(--s-4); }
.range-row input[type=range] { flex: 1; accent-color: var(--sage-fill); min-height: var(--tap); }
.seg-full { display: flex; width: 100%; } .seg-full .seg-opt { flex: 1; } .seg-full .seg-opt span { justify-content: center; width: 100%; }
.range-scale { display: flex; justify-content: space-between; font-size: var(--step--1); color: var(--ink-3); margin-top: calc(var(--s-1) * -1); padding-right: 3.2rem; }
.bank-explain { background: var(--paper-2); border-radius: var(--r-2); padding: var(--s-3) var(--s-4); font-size: var(--step--1); color: var(--ink-2); }
.range-row output { min-width: 3.2rem; font-weight: 700; text-align: right; }
.summary-wrap { position: sticky; top: 5.5rem; }
.cost-big { font-family: var(--font-serif); font-size: var(--step-3); font-weight: 600; line-height: 1.1; }
.quiz-form fieldset.card { display: block; } .quiz-form legend { float: left; width: 100%; margin: 0 0 var(--s-3); }
.quiz-form fieldset.card > .card-body > legend + * { clear: both; }
.check-inline { display: inline-flex; gap: var(--s-2); align-items: center; font-size: var(--step--1); font-weight: 600; min-height: var(--tap); cursor: pointer; }
.check-inline input { width: 1.2rem; height: 1.2rem; accent-color: var(--ink-fill); }

/* parcours */
.journey { display: flex; gap: var(--s-2); list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.journey li { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--step--1); font-weight: 650; color: var(--ink-3); padding: .25rem .8rem .25rem .3rem; border-radius: var(--r-pill); background: var(--paper-2); }
.journey-dot { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); font-variant-numeric: tabular-nums; }
.journey-dot .icon { width: .95rem; height: .95rem; }
.journey-done { color: var(--sage); } .journey-done .journey-dot { background: var(--sage-fill); border-color: var(--sage-fill); color: var(--on-ink); }
.journey-current { color: var(--ink); background: var(--paper-3); } .journey-current .journey-dot { background: var(--ink-fill); border-color: var(--ink-fill); color: var(--on-ink); }

/* barres */
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.bars li { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 3rem; align-items: center; gap: var(--s-3); font-size: .95rem; }
span.bar { display: block; height: .7rem; border-radius: var(--r-pill); background: var(--paper-3); overflow: hidden; }
span.bar.bar-thin { height: .45rem; }
.bar-fill { display: block; height: 100%; border-radius: var(--r-pill); background: var(--ink-3); min-width: 2px; }
.bar-ok { background: var(--sage-fill); } .bar-info { background: var(--plum-fill); } .bar-warn, .bar-warn-strong { background: var(--amber-fill); } .bar-muted, .bar-neutral { background: var(--ink-3); }
.bar-val { text-align: right; font-weight: 650; }
@media (max-width: 30rem) { .bars li { grid-template-columns: 1fr 3rem; } .bars .bar { grid-column: 1 / -1; grid-row: 2; } }

/* rapport d'analyse */
.limits { border-color: var(--amber-line); background: color-mix(in srgb, var(--amber-bg) 55%, var(--surface)); }
.limits ul { margin: 0; padding-left: 1.2rem; } .limits li + li { margin-top: var(--s-2); }
.limits .h-sm .icon { color: var(--amber); }
.signals { list-style: none; margin: 0; padding: 0; }
.signal { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); display: grid; gap: var(--s-2); }
.signal:last-child { border-bottom: 0; }
.signal-head { display: flex; gap: var(--s-2) var(--s-3); align-items: center; flex-wrap: wrap; }
.weight { display: flex; align-items: center; gap: var(--s-3); max-width: 22rem; } .weight .bar { flex: 1; }
.traces { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.trace { padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); border-left-width: 5px; }
.trace-strong { border-left-color: var(--amber-fill); } .trace-notice { border-left-color: var(--amber-line); } .trace-info { border-left-color: var(--line-strong); }
.trace-head { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.evidence { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.evidence blockquote { margin: 0 0 var(--s-1); padding-left: var(--s-3); border-left: 3px solid var(--line-strong); font-style: italic; overflow-wrap: anywhere; }
.hl-text { font-family: var(--font-serif); font-size: 1.12rem; line-height: 1.85; max-width: 68ch; margin-top: var(--s-4); overflow-wrap: anywhere; }
.hl-text, .hl { color: var(--ink); }
.hl { padding: .06em .12em; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; text-underline-offset: .22em; }
.hl-1 { background: color-mix(in srgb, var(--amber-fill) 12%, transparent); text-decoration: underline dotted 2px var(--amber-fill); }
.hl-2 { background: color-mix(in srgb, var(--amber-fill) 24%, transparent); text-decoration: underline dashed 2px var(--amber-fill); }
.hl-3 { background: color-mix(in srgb, var(--amber-fill) 40%, transparent); text-decoration: underline solid 2px var(--amber); }
.hl-4 { background: color-mix(in srgb, var(--amber-fill) 58%, transparent); text-decoration: underline double 3px var(--amber); }
.hl-p { display: none; font-family: var(--font-sans); font-size: .62em; font-weight: 700; color: var(--ink); margin-left: .15em; vertical-align: super; }
.hl-wrap:has(#show-p:checked) .hl-p { display: inline; }
.legend { list-style: none; padding: 0; margin: var(--s-2) 0 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--step--1); color: var(--ink-3); }
.report-top .gauge-lg { max-width: none; }
.report-top .gauge-lg .gauge-value { font-size: var(--step-4); }

/* éditeur de questionnaire */
.qlist { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-4); }
.qedit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--s-4) var(--s-5); box-shadow: var(--shadow-1); display: grid; gap: var(--s-3); scroll-margin-top: 6rem; }
.qedit.is-off { opacity: .62; background: var(--paper-2); }
.qedit-head, .answer-head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.qnum { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; border-radius: 50%; background: var(--ink-fill); color: var(--on-ink); font-weight: 700; font-size: .9rem; }
.qedit-tools { margin-left: auto; display: flex; gap: var(--s-1); } .qedit-tools form { display: contents; }
.qprompt { font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.4; font-weight: 550; overflow-wrap: anywhere; }
.opts { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.opts li { display: flex; gap: var(--s-3); align-items: flex-start; padding: .35rem var(--s-3); border-radius: var(--r-1); border: 1px solid var(--line); background: var(--paper); }
.opts li.is-correct { background: var(--sage-bg); border-color: var(--sage-line); font-weight: 600; }
.opt-mark { flex: none; width: 1.2rem; text-align: center; font-weight: 800; color: var(--sage); }
.just { padding-left: var(--s-3); border-left: 3px solid var(--line-strong); }
.qedit-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: flex-start; }
.qedit-actions > form { display: block; }
.edit-box { flex: 1 1 100%; } .edit-box > summary { list-style: none; cursor: pointer; display: inline-flex; } .edit-box > summary::-webkit-details-marker { display: none; }
.edit-box[open] > summary { background: var(--paper-3); }
.edit-box:not([open]) { flex: 0 0 auto; }
.edit-inline:not([open]) { display: inline-block; } .edit-inline[open] { flex-basis: 100%; }
.opt-edit { display: flex; gap: var(--s-3); align-items: center; }
.opt-radio { display: grid; place-items: center; min-width: var(--tap); min-height: var(--tap); } .opt-radio input { width: 1.3rem; height: 1.3rem; accent-color: var(--sage-fill); }
.opt-fixed { font-weight: 600; }
.summary-wrap { position: sticky; top: 5.5rem; }
@media (max-width: 59.9rem) { .summary-wrap { position: static; } }
.bank-body { display: grid; gap: var(--s-4) var(--s-6); align-items: end; }
@media (min-width: 52rem) { .bank-body { grid-template-columns: minmax(0, 1fr) 15rem; } }
.qlist { max-width: 60rem; }
.publish-settings { max-width: 60rem; }
/* barre de publication : toujours visible en bas de l'écran pendant la relecture */
.publish-bar { position: sticky; bottom: 0; z-index: 40; margin-top: var(--s-6); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line-strong); box-shadow: 0 -6px 20px rgba(22, 33, 58, .08); padding-block: var(--s-3) calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); }
.publish-bar-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); }
.publish-bar-text { margin: 0; font-size: var(--step--1); color: var(--ink-2); }
.preview-list { list-style: none; padding: 0; margin: var(--s-4) 0 0; display: grid; gap: var(--s-5); }
.preview-opts { list-style: none; padding: 0; margin: var(--s-3) 0 0; display: grid; gap: var(--s-2); }
.preview-opts li, .preview-free { padding: var(--s-3) var(--s-4); border: 1.5px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); }
.preview-free { min-height: 5rem; }

/* publié */
.share-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 52rem) { .share-grid { grid-template-columns: minmax(0, 1fr) 15rem; } }
.nowrap-cluster { flex-wrap: nowrap; } .nowrap-cluster .input { flex: 1; min-width: 0; }
.qr { width: 11rem; margin-inline: auto; background: #fff; padding: .5rem; border-radius: var(--r-2); border: 1px solid var(--line); } .qr svg { display: block; width: 100%; height: auto; }
.live { display: inline-flex; align-items: center; gap: .4em; font-family: var(--font-sans); font-size: var(--step--1); font-weight: 650; color: var(--sage); letter-spacing: 0; }
.live-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--sage-fill); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.stats-row .card-body { padding: var(--s-4) var(--s-5); }
.summary-line { cursor: pointer; display: block; } .summary-line::-webkit-details-marker { display: none; }
details.card > summary { list-style: none; }
.results td { vertical-align: middle; }

/* résultat d'un élève */
.coh { display: grid; gap: var(--s-6); }
@media (min-width: 52rem) { .coh { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.coh-verdict { margin: var(--s-3) 0; } .coh-verdict .badge { font-size: 1rem; padding: .3rem .9rem; }
.coh-text { font-family: var(--font-serif); font-size: var(--step-1); line-height: 1.45; max-width: 46ch; }
.answers { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-4); }
.answer-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--s-4) var(--s-5); display: grid; gap: var(--s-3); scroll-margin-top: 6rem; }
.answer-card.is-review { border-color: var(--amber-fill); border-width: 2px; background: color-mix(in srgb, var(--amber-bg) 40%, var(--surface)); }
.answer-score { margin-left: auto; }
.score { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 650; padding: .1rem .7rem; border-radius: var(--r-pill); border: 1.5px solid currentColor; }
.score-ok { color: var(--sage); } .score-mid { color: var(--plum); } .score-low { color: var(--amber); }
.answer-lines { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-4); margin: 0; }
.answer-lines dt { font-size: var(--step--1); font-weight: 650; color: var(--ink-3); padding-top: .1em; } .answer-lines dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 36rem) { .answer-lines { grid-template-columns: 1fr; gap: 0; } .answer-lines dd { margin-bottom: var(--s-2); } }
.student-text { white-space: pre-wrap; display: block; padding: var(--s-3); background: var(--paper-2); border-radius: var(--r-1); border: 1px solid var(--line); }
.nav-toggle.btn { display: none; }
@media (max-width: 52rem) { .js .nav-toggle.btn { display: inline-flex; } }
.signal details summary { cursor: pointer; min-height: 2rem; }
.qr { display: block; box-sizing: border-box; width: min(100%, 12rem); margin-inline: auto; } .qr svg { display: block; width: 100%; height: auto; max-width: 100%; }
.nav-link { white-space: nowrap; }
.site-header .bar { gap: var(--s-3); }
.nav { margin-left: var(--s-3); }
.imp-banner p { flex: 1 1 24rem; } .imp-banner form { flex: none; }
.nav-user .btn { white-space: nowrap; }

/* rapport d'analyse : résumé calme, détails repliés */
.report-summary .gauge-band-solid { opacity: .5; }
.report-range { max-width: 32rem; }
.fold > summary { cursor: pointer; }
.fold > summary .h-sm { font-family: var(--font-serif); font-weight: 600; font-size: var(--step-1); }
.fold[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: var(--s-4); }
.fold > summary:focus-visible { outline-offset: -3px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hl-3 { background: color-mix(in srgb, var(--amber-fill) 34%, transparent); }
  :root:not([data-theme="light"]) .hl-4 { background: color-mix(in srgb, var(--amber-fill) 44%, transparent); }
}

/* cibles tactiles confortables (≥ 44 px) sur écrans tactiles */
@media (pointer: coarse) {
  .btn-sm { min-height: var(--tap); }
  .site-footer a, .footer-links a, .hint a { display: inline-flex; align-items: center; min-height: var(--tap); }
  details.help > summary { position: relative; }
  details.help > summary::after { content: ""; position: absolute; inset: -.65rem; }
  .check input { width: 1.6rem; height: 1.6rem; }
  .table .check { min-height: var(--tap); }
}

/* résultats : les pastilles d'information (réponse proche, contestation) passent à la ligne au lieu d'écraser la colonne du nom */
.results td[data-label="À noter"] .badge { white-space: normal; max-width: 16rem; }
.results td[data-label="À noter"] { min-width: 10rem; }

/* Extraction du contenu visuel (F2) : aperçu du texte lu, explication des modes */
.doc-preview { font-family: var(--font-mono); font-size: .86rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 24rem; overflow: auto;
  background: var(--paper-2); border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: var(--r-2, 10px); padding: var(--s-4); margin: 0; }
.hint.block, .block { display: block; }
.extract-modes > summary { cursor: pointer; padding: var(--s-3) var(--s-4); font-weight: 600; min-height: var(--tap); display: flex; gap: var(--s-2); align-items: center; }
.extract-modes .card-body { padding-top: 0; }
textarea.mono { font-family: var(--font-mono); font-size: .88rem; }

