/* ==========================================================================
   Anglais — feuille de style unique.

   Identité « carnet illustré » portée depuis DesignKit (l'app iPad) :
   papier chaud, encre douce, une marque teal pour les actions, dix couleurs
   marqueur pour repérer les sections et les catégories. Les valeurs
   hexadécimales sont celles de Packages/DesignKit/Sources/DesignKit/Theme.swift
   — une catégorie garde donc sa couleur d'un support à l'autre (WEB.md §7).

   Aucune police téléchargée, aucune ressource distante, aucun framework.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Jetons
   -------------------------------------------------------------------------- */

:root {
  /* Surfaces et encre — thème clair. */
  --background: #F6F3EC;
  --surface: #FEFDFB;
  --surface-sunken: #EDE8DE;
  --ink: #1E2024;
  --ink-secondary: #5B5F66;
  --ink-faint: #9AA0A6;
  --hairline: #E4DFD4;

  /* Marque. */
  --brand: #0F8A7E;
  --brand-ink: #FFFFFF;

  /* Repères de langue (teintes drapeau, discrètes). */
  --english: #3B77E0;
  --french: #E05252;

  /* Couleurs marqueur, identiques à Palette.markers. */
  --m-1: #F2795B;  /* corail */
  --m-2: #F0A93B;  /* ambre */
  --m-3: #E0B93E;  /* or */
  --m-4: #8FBE4B;  /* vert pomme */
  --m-5: #3FB6A8;  /* turquoise */
  --m-6: #4FA6E0;  /* ciel */
  --m-7: #6E77D6;  /* indigo */
  --m-8: #9B72CE;  /* violet */
  --m-9: #E56B8C;  /* rose profond */
  --m-10: #C08457; /* argile */

  /* Accent de la section courante ; réécrit par la page et par les onglets. */
  --accent: var(--brand);

  /* Typographie. Une seule famille pour le texte — arrondie, comme sur iPad —
     et le monospace réservé aux données : compteurs, formes verbales,
     raccourcis clavier. */
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
                  "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --text-xs: 0.8125rem;   /* 13px — étiquettes, pied de page */
  --text-sm: 0.9375rem;   /* 15px — méta */
  --text-base: 1.25rem;   /* 20px — corps minimum (AGENTS.md §12) */
  --text-lg: 1.5rem;      /* 24px */
  --text-display: clamp(2rem, 1.35rem + 2.6vw, 2.9rem);

  /* Rythme et formes — Metrics de DesignKit. */
  --gutter: 20px;
  --r-card: 28px;
  --r-tile: 20px;
  --r-chip: 14px;
  --shell: 1120px;

  --shadow-soft: 0 1px 2px rgba(30, 32, 36, 0.04), 0 10px 28px -16px rgba(30, 32, 36, 0.22);
  --shadow-lift: 0 2px 4px rgba(30, 32, 36, 0.05), 0 18px 40px -20px rgba(30, 32, 36, 0.30);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 180ms;

  color-scheme: light dark;
}

/* Deux teintes dérivées de l'accent de la section. Elles sont déclarées sur
   `*` et non sur `:root` à dessein : une propriété personnalisée est résolue
   sur l'élément qui la déclare, donc `--accent` doit être lu là où il est
   réellement hérité (la feuille, un onglet, une tuile).

   Pourquoi ne pas utiliser l'accent brut pour du texte : l'ambre et l'or sont
   illisibles sur du papier clair (moins de 2:1). Mélangés à l'encre, ils
   gardent leur teinte en passant AA — et le mélange s'inverse tout seul en
   thème sombre, où l'encre est claire.

   Les proportions sont calibrées sur la plus mauvaise des dix couleurs (l'or,
   #E0B93E) : 52 % d'accent donnent 4,8:1 pour du texte, 62 % donnent 3,2:1
   pour un aplat sur le fond creusé. Ne pas les augmenter sans refaire le
   calcul. */
* {
  --accent-ink: color-mix(in srgb, var(--accent) 52%, var(--ink));
  --accent-fill: color-mix(in srgb, var(--accent) 62%, var(--ink));
}

/* Thème sombre : seuls les jetons de surface changent, la palette marqueur
   reste identique pour que les repères de couleur ne bougent pas. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #14161A;
    --surface: #20232A;
    --surface-sunken: #191C22;
    --ink: #F2F0EA;
    --ink-secondary: #A9AEB6;
    --ink-faint: #70757D;
    --hairline: #2C3038;
    --brand: #35C4B4;
    --brand-ink: #0B1F1D;
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.28), 0 10px 28px -18px rgba(0, 0, 0, 0.65);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.34), 0 18px 44px -22px rgba(0, 0, 0, 0.75);
  }
}

:root[data-theme="dark"] {
  --background: #14161A;
  --surface: #20232A;
  --surface-sunken: #191C22;
  --ink: #F2F0EA;
  --ink-secondary: #A9AEB6;
  --ink-faint: #70757D;
  --hairline: #2C3038;
  --brand: #35C4B4;
  --brand-ink: #0B1F1D;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.28), 0 10px 28px -18px rgba(0, 0, 0, 0.65);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.34), 0 18px 44px -22px rgba(0, 0, 0, 0.75);
}

/* --------------------------------------------------------------------------
   2. Réinitialisation
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

/* L'attribut `hidden` doit gagner contre nos classes.
   `[hidden] { display: none }` de la feuille du navigateur a une spécificité
   nulle : la moindre classe qui pose `display` (une grille, une flexbox) la
   bat, et l'élément reste visible alors que le code le croit masqué. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--ink);
  font-family: var(--font-rounded);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; }
a { color: inherit; }
strong { font-weight: 700; }
sup { font-size: 0.65em; }

button, input, select, textarea { font: inherit; color: inherit; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.sprite { position: absolute; width: 0; height: 0; }

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 20;
  padding: 10px 18px;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 0 0 var(--r-chip) var(--r-chip);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   3. Éléments de texte partagés
   -------------------------------------------------------------------------- */

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  color: var(--accent-ink);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}

/* Repères de langue : l'anglais et le français ne se confondent jamais. */
.en, .fr {
  font-weight: 600;
  border-bottom: 2px solid currentColor;
  padding-bottom: 1px;
}
.en { color: var(--english); }
.fr { color: var(--french); }

/* Trait de surligneur — l'accent du carnet, à n'utiliser qu'une fois par
   écran, sur le mot qui compte. */
.hl {
  background-image: linear-gradient(transparent 58%, rgba(63, 182, 168, 0.42) 58%);
  background-image: linear-gradient(transparent 58%,
                    color-mix(in srgb, var(--accent) 42%, transparent) 58%);
  padding-inline: 0.12em;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   4. En-tête : le nom, puis les intercalaires
   -------------------------------------------------------------------------- */

.masthead {
  width: min(100% - 2 * var(--gutter), var(--shell));
  margin: 0 auto;
  padding-top: clamp(14px, 3vw, 28px);
}

.masthead__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gutter);
  padding: 0 clamp(8px, 2vw, 20px) 14px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.wordmark__name {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.wordmark__tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-faint);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1px 6px;
}

/* Les onglets sont les intercalaires du carnet : chaque section a sa couleur,
   et l'onglet actif se fond dans la feuille en dessous. */
.tabs__list {
  display: flex;
  gap: 4px;
  padding-left: clamp(28px, 3vw, 34px);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px 12px;
  min-height: 46px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--r-chip) var(--r-chip) 0 0;
  color: var(--ink-secondary);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tab::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.tab:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.tab:hover::before { opacity: 0.4; }
.tab:hover .tab__icon { color: var(--ink-secondary); }

.tab--active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--hairline);
  border-bottom: 1px solid var(--surface);
  margin-bottom: -1px;
  z-index: 1;
}
.tab--active::before { opacity: 1; }
.tab--active .tab__icon { color: var(--accent); }

.tab__icon {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   5. La feuille : le contenu de la page
   -------------------------------------------------------------------------- */

.sheet {
  flex: 1;
  width: min(100% - 2 * var(--gutter), var(--shell));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px) clamp(20px, 4vw, 56px) clamp(40px, 6vw, 64px);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
}

.page-head { max-width: 44ch; }
.page-head__title {
  margin-top: 8px;
  font-size: var(--text-display);
}
.page-head__lead {
  margin-top: 14px;
  color: var(--ink-secondary);
}

.colophon {
  width: min(100% - 2 * var(--gutter), var(--shell));
  margin: 0 auto;
  padding: 22px clamp(8px, 2vw, 20px) 32px;
  color: var(--ink-faint);
  font-size: var(--text-xs);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
}
.colophon a { color: var(--ink-secondary); }

/* --------------------------------------------------------------------------
   6. Composants
   -------------------------------------------------------------------------- */

.stack > * + * { margin-top: var(--gutter); }

.card {
  padding: clamp(20px, 3vw, 30px);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
}
.card--sunken { background: var(--surface-sunken); border-color: transparent; }
.card--accent {
  border-color: transparent;
  background: rgba(63, 182, 168, 0.10);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: inset 3px 0 0 var(--accent);
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--surface-sunken);
  border-radius: var(--r-tile);
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.tile__icon { width: 26px; height: 26px; color: var(--accent-ink); }
.tile__label { font-weight: 700; }
.tile__meta { font-size: var(--text-sm); color: var(--ink-secondary); }

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: var(--r-chip);
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-secondary);
  text-decoration: none;
}
.chip--on {
  border-color: transparent;
  background: rgba(63, 182, 168, 0.14);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--ink);
}
.chip__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 26px;
  border: 1px solid transparent;
  border-radius: var(--r-chip);
  background: none;
  font-size: var(--text-base);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-soft); }
.btn--primary:hover:not(:disabled) { box-shadow: var(--shadow-lift); }

.btn--quiet { background: var(--surface-sunken); color: var(--ink); }
.btn--quiet:hover:not(:disabled) { background: var(--hairline); }

.btn--ghost { border-color: var(--hairline); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-sunken); }

.btn__icon { width: 22px; height: 22px; flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Bouton d'écoute — présent sur chaque mot, chaque phrase, chaque exemple. */
.speak {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.speak:hover { background: var(--surface-sunken); }
.speak svg { width: 24px; height: 24px; }

.progress {
  height: 12px;
  border-radius: 99px;
  background: var(--surface-sunken);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent-fill);
  transition: width 320ms var(--ease);
}

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__value {
  font-size: clamp(2.4rem, 1.8rem + 2.2vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__label { font-size: var(--text-sm); color: var(--ink-secondary); }

/* Encart astuce : le ton reste bienveillant, jamais un avertissement. */
.note {
  padding: 18px 20px;
  border-radius: var(--r-tile);
  background: var(--surface-sunken);
  box-shadow: inset 3px 0 0 var(--accent);
  font-size: var(--text-sm);
}
.note__title { font-weight: 800; margin-bottom: 4px; }

.ticks { display: grid; gap: 10px; }
.ticks li {
  position: relative;
  padding-left: 34px;
  color: var(--ink-secondary);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0.55;
}

.kbd {
  display: inline-block;
  min-width: 26px;
  padding: 2px 7px;
  border: 1px solid var(--hairline);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: var(--surface-sunken);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-align: center;
}

.icon { width: 1.1em; height: 1.1em; vertical-align: -0.15em; }

/* Panneau de données : séparateurs, sous-titres, action destructrice et zone
   de message. Le rouge est réservé à ce qui efface — nulle part ailleurs
   l'interface ne gronde. */

.rule {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 26px 0;
}

.subhead {
  font-size: var(--text-base);
  font-weight: 800;
  margin-bottom: 14px;
}

.btn--danger {
  background: var(--surface-sunken);
  color: #B3261E;
  border-color: var(--hairline);
}
:root[data-theme="dark"] .btn--danger { color: #F2A9A2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn--danger { color: #F2A9A2; }
}
.btn--danger:hover:not(:disabled) { background: var(--hairline); }

.status {
  margin-top: 18px;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  min-height: 1.6em;
}
.status[data-tone="done"] { color: var(--accent-ink); font-weight: 600; }
.status[data-tone="problem"] { color: #B3261E; font-weight: 600; }
:root[data-theme="dark"] .status[data-tone="problem"] { color: #F2A9A2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .status[data-tone="problem"] { color: #F2A9A2; }
}

/* Le champ de fichier est piloté par son <label>, mis en forme en bouton :
   il reste focalisable au clavier mais ne s'affiche pas deux fois. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Le panneau réutilise .stat__value pour ses compteurs, en plus petit :
   ce sont des chiffres de diagnostic, pas la fierté de l'élève. */
[data-role="metrics"] .stat__value { font-size: 2rem; }

/* Résultats du banc d'essai de la base (page /dev/db-test). */
.checks { display: grid; gap: 2px; margin-top: 20px; }
.check {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: var(--text-sm);
}
.check:nth-child(odd) { background: var(--surface-sunken); }
.check__mark { font-weight: 800; }
.check[data-ok="true"] .check__mark { color: var(--accent-ink); }
.check[data-ok="false"] .check__mark { color: #B3261E; }
.check[data-ok="false"] { background: rgba(179, 38, 30, 0.10); }
.check__detail { color: var(--ink-secondary); font-family: var(--font-mono); font-size: var(--text-xs); }

/* --------------------------------------------------------------------------
   7. Chantier — ce qui n'est pas encore construit
   -------------------------------------------------------------------------- */

.worksite {
  margin-top: clamp(28px, 4vw, 44px);
  padding: clamp(22px, 3.5vw, 34px);
  border-radius: var(--r-tile);
  background: var(--surface-sunken);
  max-width: 62ch;
}
.worksite__stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  color: var(--accent-ink);
}
.worksite__title { margin-top: 12px; font-size: var(--text-lg); }
.worksite__lead { margin: 12px 0 20px; color: var(--ink-secondary); }

/* Interrupteurs de réglage : la case native, agrandie, avec son explication. */
.switches { display: grid; gap: 4px; }
.switch {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.switch:last-child { border-bottom: none; }
.switch__label { flex: 1; font-size: var(--text-sm); font-weight: 700; cursor: pointer; }
.switch__help {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  color: var(--ink-secondary);
}
.switch__input {
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Qui apprend : le sélecteur d'enfant et sa liste dans les réglages
   -------------------------------------------------------------------------- */

.who { position: relative; }

.who__button, .who__solo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 5px 12px 5px 5px;
  min-height: 42px;
  border: 1px solid var(--hairline);
  border-radius: 99px;
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 700;
}
.who__button { cursor: pointer; transition: background var(--dur) var(--ease); }
.who__button:hover { background: var(--surface-sunken); }
.who__solo { border-color: transparent; background: none; padding-left: 0; }

/* La pastille : l'initiale, dans la couleur de l'enfant. */
.who__dot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 26%, var(--surface-sunken));
  color: var(--accent-ink);
  font-size: var(--text-sm);
  font-weight: 800;
}
.who__caret { width: 16px; height: 16px; color: var(--ink-faint); }
.who__button[aria-expanded="true"] .who__caret { transform: rotate(180deg); }

.who__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.who__entry {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  min-height: 48px;
  border: none;
  border-radius: var(--r-chip);
  background: none;
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.who__entry:hover { background: var(--surface-sunken); }
.who__entry[aria-current="true"] { background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* La liste des réglages. */
.children { display: grid; gap: 10px; }
.child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-chip);
}
.child[data-current="true"] {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.child__name { flex: 1; min-width: 140px; min-height: 46px; font-size: var(--text-sm); }
.child__badge {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent-ink);
  white-space: nowrap;
}
.child__action { min-height: 44px; padding: 8px 16px; font-size: var(--text-sm); }

.children__add { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.children__input { flex: 1; min-width: 160px; min-height: 52px; font-size: var(--text-sm); }

@media (max-width: 700px) {
  .masthead__bar { flex-wrap: wrap; }
  .who__menu { right: auto; left: 0; }
}

/* --------------------------------------------------------------------------
   Vocabulaire : le choix de la portée, puis la séance
   -------------------------------------------------------------------------- */

.start { margin-top: clamp(24px, 4vw, 40px); }

/* L'en-tête de séance : l'icône de la portée, en grand, dans sa couleur. */
.start__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: clamp(24px, 4vw, 40px) 20px;
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-sunken));
  text-align: center;
}
.start__symbol {
  width: clamp(56px, 9vw, 78px);
  height: clamp(56px, 9vw, 78px);
  color: var(--accent-ink);
}
.start__scope-name { font-size: var(--text-lg); font-weight: 800; letter-spacing: -0.02em; }
.start__scope-size { font-size: var(--text-sm); color: var(--ink-secondary); }

.start__panel { margin-top: var(--gutter); }

.overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}
.overview__cell {
  padding: 18px 10px;
  border-radius: var(--r-tile);
  background: var(--surface-sunken);
}
.overview__value {
  display: block;
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.overview__label {
  display: block;
  margin-top: 6px;
  font-size: var(--text-xs);
  color: var(--ink-secondary);
}

.btn--wide { width: 100%; }

/* Les catégories, en bandeau : couleur et icône propres à chacune. */
.scopes { margin-top: clamp(30px, 5vw, 46px); }
.scopes__list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}
.scope-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 56px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-chip);
  text-decoration: none;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.scope-chip:hover { transform: translateY(-1px); background: var(--surface-sunken); }
.scope-chip--on {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.scope-chip__icon { width: 26px; height: 26px; flex: none; color: var(--accent-ink); }
.scope-chip__name { flex: 1; font-size: var(--text-sm); font-weight: 700; }
.scope-chip__count { color: var(--ink-faint); font-size: var(--text-xs); }

/* --------------------------------------------------------------------------
   La séance
   -------------------------------------------------------------------------- */

.session { display: flex; flex-direction: column; gap: 18px; }

.session__bar {
  display: flex;
  align-items: center;
  gap: 16px;
}
.session__quit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink-secondary);
  text-decoration: none;
  white-space: nowrap;
}
.session__quit:hover { color: var(--ink); }
.session__progress { flex: 1; }
.session__count { font-size: var(--text-sm); color: var(--ink-faint); white-space: nowrap; }
.session__status { margin: 0; min-height: 1.4em; }

/* La carte. Les deux faces coexistent, seule la rotation change — d'où le
   basculement franc, sans redessin du contenu. */
/* Le tapis. La carte était posée sur la feuille de la page, exactement de la
   même couleur : rien ne la détachait, et on ne voyait pas qu'il y avait un
   objet. Elle repose maintenant sur un fond franchement plus sombre, teinté
   de la catégorie — 3,5:1 au pire des dix couleurs. C'est ce contraste, plus
   que la bordure, qui fait lire « carte posée sur une table ». */
.card3d {
  perspective: 1600px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: clamp(16px, 3vw, 30px);
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--accent-ink) 80%, var(--surface-sunken));
}
/* Au survol, la carte se soulève : elle annonce qu'on peut agir dessus. */
.card3d:hover .card3d__inner:not(.is-flipped) { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) {
  .card3d:hover .card3d__inner:not(.is-flipped) { transform: none; }
}
.card3d__inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 520ms var(--ease);
  /* La hauteur se déduit de la place qui RESTE, et non d'un pourcentage de
     l'écran : ce qui entoure la carte — barre de séance, trois réponses,
     bouton suivant, onglets — occupe une hauteur à peu près fixe. Un simple
     pourcentage laissait les réponses hors de vue en paysage, où l'écran est
     large mais bas. */
  /* 570 px, c'est ce que mesure tout ce qui entoure la carte sur tablette et
     sur ordinateur : en-tête, onglets, barre de séance, marge du tapis, les
     trois réponses, et un peu d'air. */
  min-height: clamp(180px, calc(100dvh - 570px), 420px);
}
.card3d__inner.is-flipped { transform: rotateY(180deg); }
/* Remise au recto sans animation, entre deux cartes : voir resetFlip(). */
.card3d__inner.is-instant { transition: none; }

.card3d__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: clamp(24px, 4vw, 40px) clamp(24px, 4vw, 40px) 76px;
  border-radius: var(--r-card);
  /* Sur le tapis, c'est le contraste qui détache la carte : la bordure n'a
     plus qu'à adoucir l'arête. */
  border: 1px solid color-mix(in srgb, var(--surface) 70%, var(--accent));
  background: var(--surface);
  /* Le halo décalé dessine une seconde carte derrière : le paquet se devine,
     et l'objet se lit tout de suite comme une carte à jouer. */
  /* Une seconde carte dépasse derrière : le paquet se devine. Elle est
     claire, pour ressortir du tapis. */
  box-shadow:
    10px 10px 0 -3px color-mix(in srgb, var(--surface) 55%, transparent),
    0 14px 30px -10px rgba(0, 0, 0, 0.45);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  text-align: center;
}
/* Le liseré, à quelques millimètres du bord : c'est lui qui fait « carte à
   jouer » plutôt que « rectangle blanc ». */
.card3d__face::before {
  content: "";
  position: absolute;
  inset: clamp(8px, 1.4vw, 13px);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--hairline));
  border-radius: calc(var(--r-card) - clamp(8px, 1.4vw, 13px));
  pointer-events: none;
}

.card3d__face--back {
  transform: rotateY(180deg);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  /* Seconde barrière : tant que la carte n'est pas retournée, le verso n'est
     pas seulement de dos, il est absent du rendu. `backface-visibility` ne
     protège que la moitié de la rotation. */
  visibility: hidden;
}
.card3d__inner.is-flipped /* Le liseré, à quelques millimètres du bord : c'est lui qui fait « carte à
   jouer » plutôt que « rectangle blanc ». */
.card3d__face::before {
  content: "";
  position: absolute;
  inset: clamp(8px, 1.4vw, 13px);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--hairline));
  border-radius: calc(var(--r-card) - clamp(8px, 1.4vw, 13px));
  pointer-events: none;
}

.card3d__face--back { visibility: visible; }

.card3d__eyebrow {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.card3d__lang {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card3d__lang.en { color: var(--english); }
.card3d__lang.fr { color: var(--french); }
.card3d__word {
  font-size: clamp(2rem, 1.2rem + 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.badge {
  padding: 4px 12px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent-ink);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.card3d__note {
  max-width: 34ch;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
}
/* L'invitation à retourner. C'est un vrai bouton : il se voit, il s'atteint
   au clavier, et il dit ce qui va se passer. Cliquer n'importe où sur la
   carte marche toujours. */
.flip {
  position: absolute;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  min-height: 46px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.flip:hover { background: color-mix(in srgb, var(--accent) 26%, var(--surface)); }
.flip__icon { width: 20px; height: 20px; color: var(--accent-ink); }
.flip .kbd { opacity: 0.65; }

/* Sans animation, on bascule d'un coup : le contenu prime sur l'effet. */
@media (prefers-reduced-motion: reduce) {
  .card3d__inner { transition: none; }
}

/* Mode saisie. Aucune assistance : l'autocorrection donnerait la réponse. */
.typed { display: flex; flex-direction: column; gap: 12px; }
.typed__label { font-size: var(--text-sm); color: var(--ink-secondary); }
.typed__input {
  padding: 14px 18px;
  min-height: 58px;
  border: 2px solid var(--hairline);
  border-radius: var(--r-chip);
  background: var(--surface);
  font-size: var(--text-lg);
  font-weight: 600;
}
.typed__input:focus { border-color: var(--brand); outline: none; }

/* Le retour après réponse. Le rouge n'apparaît nulle part : une erreur n'est
   pas une faute, c'est une carte qui revient plus tôt. */
.verdict {
  padding: 16px 20px;
  border-radius: var(--r-tile);
  background: var(--surface-sunken);
  box-shadow: inset 3px 0 0 var(--ink-faint);
}
.verdict[data-verdict="correct"] { box-shadow: inset 3px 0 0 var(--m-4); }
.verdict[data-verdict="almost"] { box-shadow: inset 3px 0 0 var(--m-2); }
.verdict[data-verdict="incorrect"] { box-shadow: inset 3px 0 0 var(--m-6); }
.verdict__lead { font-weight: 700; }
.verdict__messages { margin-top: 8px; display: grid; gap: 6px; }
.verdict__messages li { font-size: var(--text-sm); color: var(--ink-secondary); }

/* Les trois réponses honnêtes.
   Chacune a sa couleur et son signe : la carte qui revient (↺), celle qu'on
   tient presque (◐), celle qu'on sait (✓). Aucune n'est rouge — « je ne
   savais pas » n'est pas une faute, c'est une carte qui reviendra plus tôt. */
.judge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.btn--judge {
  flex-direction: column;
  gap: 8px;
  min-height: 108px;
  padding: 16px 10px;
  font-size: var(--text-sm);
  text-align: center;
  background: color-mix(in srgb, var(--judge) 14%, var(--surface-sunken));
  border: 2px solid color-mix(in srgb, var(--judge) 34%, transparent);
  color: var(--ink);
}
.btn--judge:hover:not(:disabled) {
  background: color-mix(in srgb, var(--judge) 26%, var(--surface-sunken));
  border-color: color-mix(in srgb, var(--judge) 60%, transparent);
}
.btn--judge:focus-visible { outline-color: color-mix(in srgb, var(--judge) 70%, var(--ink)); }
.judge__icon {
  width: 30px;
  height: 30px;
  color: color-mix(in srgb, var(--judge) 55%, var(--ink));
}
.judge__label { line-height: 1.25; text-wrap: balance; }
.btn--judge .kbd { opacity: 0.6; font-weight: 600; }

.judge--miss { --judge: var(--m-6); }   /* ciel : elle reviendra */
.judge--close { --judge: var(--m-2); }  /* ambre : tout près */
.judge--hit { --judge: var(--m-4); }    /* vert pomme : acquis */

/* Sans clavier, un raccourci clavier n'apprend rien : sur un écran tactile,
   on ne garde que le libellé. */
@media (hover: none) and (pointer: coarse) {
  .flip .kbd,
  .btn--judge .kbd,
  .btn--wide .kbd { display: none; }
}

/* Compte à rebours du passage automatique. */
.btn--wide { position: relative; overflow: hidden; }
.countdown {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: currentColor;
  opacity: 0.45;
  transform-origin: left center;
  transform: scaleX(1);
}
.countdown.is-running { transform: scaleX(0); }
@media (prefers-reduced-motion: reduce) {
  .countdown { transition: none !important; }
}

/* Écran de fin. */
.summary {
  padding: clamp(24px, 4vw, 38px);
  border-radius: var(--r-card);
  background: var(--surface-sunken);
  text-align: center;
}
.summary__title { margin-top: 10px; font-size: var(--text-lg); }
.summary__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 26px 0;
}
.summary__stats .stat { align-items: center; }
.summary .btn-row { justify-content: center; }

@media (max-width: 560px) {
  /* Les trois réponses gardent leur rang : empilées, elles occupaient deux
     cents pixels et sortaient de l'écran. Resserrées, elles en prennent
     quatre-vingts et restent visibles sans défiler. */
  .judge { gap: 7px; }
  .btn--judge {
    min-height: 78px;
    padding: 10px 4px;
    gap: 5px;
    font-size: 0.75rem;
    letter-spacing: -0.01em;
  }
  .judge__icon { width: 24px; height: 24px; }
  .overview { grid-template-columns: 1fr; }
  .summary__stats { grid-template-columns: 1fr; }
  .session { gap: 12px; }
  .card3d { padding: 12px; }
  /* Sur un téléphone, l'entourage est plus compact : la barre d'onglets est
     en bas, la marge de page plus étroite. La carte peut donc reprendre de la
     hauteur. */
  /* Sur un téléphone l'entourage se resserre à 400 px : marge de page plus
     étroite, onglets en bas, réponses plus compactes. */
  .card3d__inner { min-height: clamp(170px, calc(100dvh - 400px), 320px); }
}

/* --------------------------------------------------------------------------
   Cours : le parcours, puis la leçon
   -------------------------------------------------------------------------- */

.lessons { margin-top: clamp(24px, 4vw, 36px); }

.levels { display: flex; flex-wrap: wrap; gap: 10px; }
.level {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-chip);
  text-decoration: none;
}
.level--on { border-color: transparent; background: color-mix(in srgb, var(--brand) 14%, transparent); }
.level__code { font-weight: 800; font-size: var(--text-base); letter-spacing: -0.02em; }
.level__label { font-size: var(--text-sm); color: var(--ink-secondary); }
.level__count { color: var(--ink-faint); font-size: var(--text-xs); }

.next-lesson {
  margin-top: 22px;
  padding: 18px 22px;
  border-radius: var(--r-tile);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface-sunken));
}
.next-lesson__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-weight: 700;
  text-decoration: none;
}
.next-lesson__link:hover { text-decoration: underline; }

.theme { margin-top: clamp(28px, 4vw, 40px); }
.theme__name {
  font-size: var(--text-base);
  font-weight: 800;
  padding-bottom: 10px;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.theme__lessons { margin-top: 6px; }

.lesson-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 12px;
  border-radius: var(--r-chip);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}
.lesson-row:hover { background: var(--surface-sunken); }
.theme__lessons li:last-child .lesson-row { border-bottom: none; }

.lesson-row__status {
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-faint);
}
.lesson-row[data-status="completed"] .lesson-row__status {
  border-color: transparent;
  background: var(--accent);
  color: var(--surface);
}
.lesson-row[data-status="inProgress"] .lesson-row__status { border-color: var(--accent); color: var(--accent-ink); }

.lesson-row__body { flex: 1; display: block; }
.lesson-row__title { display: block; font-weight: 700; }
.lesson-row__summary {
  display: block;
  margin-top: 2px;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
}
.lesson-row__after {
  display: block;
  margin-top: 6px;
  font-size: var(--text-xs);
  color: var(--ink-faint);
}
.lesson-row__minutes { flex: none; color: var(--ink-faint); font-size: var(--text-xs); margin-top: 3px; }

/* Le lecteur. Une colonne de texte étroite : on lit une leçon, on ne balaie
   pas un tableau de bord. */
.lesson { margin-top: clamp(20px, 3vw, 32px); }
.lesson__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
}
.lesson__after { margin-top: 10px; font-size: var(--text-sm); color: var(--ink-secondary); }

.lesson__body { max-width: 64ch; margin-top: clamp(24px, 4vw, 36px); }
.lesson__body > * + * { margin-top: 20px; }
.lesson__heading { margin-top: 34px; font-size: var(--text-lg); }
.lesson__paragraph { line-height: 1.65; }

.lesson__list { display: grid; gap: 8px; padding-left: 4px; }
.lesson__list li { position: relative; padding-left: 26px; }
.lesson__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.6;
}

/* Les exemples : l'anglais d'abord, en gros, sa traduction en dessous. */
.example {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 16px;
  margin: 0;
  padding: 18px 20px;
  border-radius: var(--r-tile);
  background: var(--surface-sunken);
  border-left: 3px solid var(--english);
}
.example__en {
  grid-column: 1;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--english);
}
.example__fr { grid-column: 1; font-size: var(--text-sm); color: var(--ink-secondary); }
.example__speak { grid-column: 2; grid-row: 1 / 3; }

.lesson__table { margin: 0; }
.lesson__caption {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink-secondary);
  margin-bottom: 8px;
}
.lesson__table-scroll { overflow-x: auto; border-radius: var(--r-tile); }
.lesson__table table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.lesson__table th, .lesson__table td { padding: 10px 14px; text-align: left; }
.lesson__table thead th {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-sunken));
  font-weight: 800;
  white-space: nowrap;
}
.lesson__table tbody tr:nth-child(even) { background: var(--surface-sunken); }

.keypoint {
  padding: 20px 22px;
  border-radius: var(--r-tile);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.keypoint__label {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.keypoint__text { margin-top: 6px; font-weight: 600; }

.practice, .quiz, .lesson__done { margin-top: clamp(34px, 5vw, 50px); max-width: 64ch; }
.practice__list { display: grid; gap: 10px; }
.practice__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-chip);
  text-decoration: none;
}
.practice__link:hover { background: var(--surface-sunken); }
.practice__icon { width: 26px; height: 26px; flex: none; color: var(--accent-ink); }
.practice__label { flex: 1; font-weight: 700; }
.practice__detail { color: var(--ink-faint); font-size: var(--text-xs); }

/* Le quiz. Une erreur n'y est jamais rouge : on montre la bonne réponse. */
.quiz__questions { display: grid; gap: 26px; counter-reset: question; }
.quiz__question { padding-left: 34px; position: relative; }
.quiz__question::before {
  counter-increment: question;
  content: counter(question);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
}
.quiz__prompt { font-weight: 700; }
.quiz__choices { display: grid; gap: 6px; margin-top: 12px; }
.quiz__choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: 50px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-chip);
  cursor: pointer;
}
.quiz__choice:hover { background: var(--surface-sunken); }
.quiz__choice input { width: 22px; height: 22px; accent-color: var(--brand); }
.quiz__feedback { margin-top: 10px; font-size: var(--text-sm); color: var(--ink-secondary); }
.quiz__question[data-correct="true"] .quiz__feedback { color: var(--accent-ink); font-weight: 700; }
.quiz__question[data-correct="false"] .quiz__feedback { font-weight: 600; }
.quiz form > .btn { margin-top: 26px; }

.lesson__nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(36px, 5vw, 52px);
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.lesson__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 46%;
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-secondary);
}
.lesson__nav-link:hover { color: var(--ink); }
.lesson__nav-link--next { text-align: right; }

/* --------------------------------------------------------------------------
   Conjugaison
   -------------------------------------------------------------------------- */

.conj { margin-top: clamp(20px, 3vw, 32px); }
.conj__filters { display: grid; gap: 14px; }
.conj__search { display: flex; gap: 10px; }
.conj__input { flex: 1; font-size: var(--text-base); min-height: 52px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.conj__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 16px;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
}

.conj__scroll { overflow-x: auto; border-radius: var(--r-tile); border: 1px solid var(--hairline); }
.conj__table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.conj__table th, .conj__table td { padding: 11px 14px; text-align: left; vertical-align: middle; }
.conj__table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 2px solid var(--hairline);
  font-weight: 800;
  white-space: nowrap;
}
.conj__table thead th:nth-child(n+3) { color: var(--accent-ink); }
.conj__table tbody tr:nth-child(even) { background: var(--surface-sunken); }
.conj__table tbody th { font-weight: 700; white-space: nowrap; }
.conj__fr { color: var(--ink-secondary); }
.conj__form { white-space: nowrap; }
.conj__form [data-form] { font-weight: 600; }
.conj__flag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--m-2) 26%, transparent);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-secondary);
  text-transform: lowercase;
}
.speak--small { width: 34px; height: 34px; margin-left: 6px; vertical-align: middle; }
.speak--small svg { width: 18px; height: 18px; }
.conj__empty { margin-top: 30px; color: var(--ink-secondary); }

@media (max-width: 560px) {
  .conj__search { flex-direction: column; }
  .lesson__nav { flex-direction: column; }
  .lesson__nav-link { max-width: none; }
}

/* --------------------------------------------------------------------------
   Progrès : la vue de l'élève, puis le suivi du parent
   -------------------------------------------------------------------------- */

.progress-page { margin-top: clamp(20px, 3vw, 32px); }

.hero-stats {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--r-card);
  background: var(--surface-sunken);
}
.hero-stats__main, .hero-stats__streak { display: flex; flex-direction: column; gap: 4px; }
.hero-stats__streak { text-align: right; }
.hero-stats__value {
  font-size: clamp(2.6rem, 1.6rem + 4vw, 4.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.hero-stats__label { font-size: var(--text-sm); color: var(--ink-secondary); }
.hero-stats__note { margin-top: 6px; font-size: var(--text-xs); color: var(--ink-faint); }
.hero-stats__bar { margin-top: 12px; max-width: 260px; }

/* L'anneau du jour : un cercle dont on ne peint qu'une part. */
.ring { position: relative; width: clamp(110px, 18vw, 150px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--hairline); stroke-width: 10; }
.ring__fill {
  fill: none;
  stroke: var(--brand);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 600ms var(--ease);
}
.ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.ring__value { font-size: var(--text-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.ring__unit { font-size: var(--text-xs); color: var(--ink-secondary); }

.badges, .mastery { margin-top: clamp(30px, 5vw, 46px); }
.badges__list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.badge-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  padding: 18px;
  border-radius: var(--r-tile);
  background: var(--surface-sunken);
}
.badge-card__icon { grid-row: 1 / 3; width: 30px; height: 30px; color: var(--ink-faint); align-self: center; }
.badge-card__title { font-weight: 700; font-size: var(--text-sm); }
.badge-card__detail { font-size: var(--text-xs); color: var(--ink-faint); }
.badge-card[data-achieved="true"] { background: color-mix(in srgb, var(--brand) 12%, var(--surface-sunken)); }
.badge-card[data-achieved="true"] .badge-card__icon { color: var(--brand); }
.badge-card[data-achieved="true"] .badge-card__detail { color: var(--ink-secondary); }

.mastery__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
}
.mastery__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 12px;
  padding: 14px 16px;
  border-radius: var(--r-chip);
  border: 1px solid var(--hairline);
  text-decoration: none;
}
.mastery__link:hover { background: var(--surface-sunken); }
.mastery__icon { grid-row: 1; width: 22px; height: 22px; color: var(--accent-ink); }
.mastery__name { font-size: var(--text-sm); font-weight: 700; }
.mastery__count { font-size: var(--text-xs); color: var(--ink-faint); }
.mastery__bar { grid-column: 1 / 4; height: 8px; }
.mastery__bar .progress__fill { background: var(--accent-fill); }

.progress-page__parent {
  margin-top: clamp(30px, 5vw, 44px);
  font-size: var(--text-sm);
  color: var(--ink-secondary);
}

/* --- Espace parent ------------------------------------------------------- */

.gate__row { display: flex; gap: 10px; margin-top: 18px; }
.gate__input { max-width: 160px; text-align: center; letter-spacing: 0.4em; }

.switch__range { display: flex; align-items: center; gap: 12px; flex: none; }
.switch__slider { width: 160px; height: auto; }

.figures {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  margin: 24px 0 8px;
}
.figure {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-radius: var(--r-tile);
  background: var(--surface-sunken);
}
.figure__value { font-size: var(--text-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.figure__label { font-size: var(--text-sm); font-weight: 600; }
.figure__note { font-size: var(--text-xs); color: var(--ink-faint); }

.chart-block { margin-top: clamp(28px, 4vw, 40px); }
.chart-block__note { margin: -6px 0 14px; font-size: var(--text-sm); color: var(--ink-secondary); }
.chart-block__empty { color: var(--ink-faint); font-size: var(--text-sm); }

/* Les graphiques viennent du serveur ; leurs couleurs sont d'ici. */
.chart { width: 100%; height: clamp(160px, 26vw, 210px); overflow: visible; }
.chart__axis { stroke: var(--hairline); stroke-width: 1; }
.chart__grid { stroke: var(--hairline); stroke-width: 1; stroke-dasharray: 3 5; }
.chart__bar { fill: var(--accent-fill); }
.chart__empty-day { fill: var(--hairline); }
.chart__line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart__area { fill: var(--brand); opacity: 0.12; }
.chart__point { fill: var(--brand); }
.chart__label, .chart__level {
  fill: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.bars { display: grid; gap: 10px; }
.bars__row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: 14px; align-items: center; }
.bars__label { font-size: var(--text-sm); }
.bars__track { height: 10px; }
.bars__value { font-size: var(--text-xs); color: var(--ink-secondary); }

.leeches { display: grid; gap: 8px; }
.leech {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 14px;
  padding: 12px 16px;
  border-radius: var(--r-chip);
  background: var(--surface-sunken);
}
.leech__title { font-weight: 700; font-size: var(--text-sm); }
.leech__subtitle { grid-row: 2; font-size: var(--text-xs); color: var(--ink-secondary); }
.leech__count { grid-row: 1 / 3; align-self: center; font-size: var(--text-xs); color: var(--ink-faint); }

@media (max-width: 700px) {
  .hero-stats { grid-template-columns: 1fr; text-align: center; }
  .hero-stats__streak { text-align: center; }
  .hero-stats__main { align-items: center; }
  .hero-stats__bar { width: 100%; }
  .ring { margin: 0 auto; }
  .bars__row { grid-template-columns: 1fr auto; }
  .bars__track { grid-column: 1 / 3; }
  .switch { flex-direction: column; align-items: stretch; }
  .switch__range { justify-content: space-between; }
  .switch__slider { flex: 1; }
}

/* --------------------------------------------------------------------------
   Exercices de grammaire
   -------------------------------------------------------------------------- */

.skills { margin-top: clamp(24px, 4vw, 36px); }
.skills__lead { max-width: 62ch; color: var(--ink-secondary); }
.skills__list {
  display: grid;
  gap: 10px;
  margin-top: clamp(24px, 4vw, 34px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.skill-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-height: 62px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-chip);
  text-decoration: none;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.skill-card:hover { transform: translateY(-1px); background: var(--surface-sunken); }
.skill-card__icon { width: 24px; height: 24px; flex: none; color: var(--accent-ink); }
.skill-card__label { flex: 1; font-weight: 700; font-size: var(--text-sm); }
.skill-card__count { color: var(--ink-faint); font-size: var(--text-xs); }
.skill-card__go { color: var(--ink-faint); }

.exercise {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(22px, 4vw, 36px);
  border-radius: var(--r-card);
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.exercise__skill {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.exercise__instruction { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.02em; }
.exercise__hint { font-size: var(--text-sm); color: var(--ink-secondary); }
.exercise__actions { align-items: center; }

/* La phrase à trou. */
.cloze {
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.02em;
}
.cloze span + span::before { content: " "; }
.cloze__blank {
  display: inline-block;
  min-width: 3.2em;
  padding: 0 0.3em;
  border-bottom: 3px solid var(--accent);
  text-align: center;
  color: var(--accent-ink);
}

/* Les propositions du choix multiple. */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.choice {
  min-height: 56px;
  padding: 12px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-chip);
  background: var(--surface-sunken);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.choice:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 18%, var(--surface-sunken)); }
.choice:disabled { opacity: 0.55; cursor: default; }

/* La remise en ordre. Chaque mot est un bouton : le clavier marche tout seul,
   et la cible tactile reste large. */
.reorder { display: flex; flex-direction: column; gap: 14px; }
.reorder__line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 68px;
  padding: 12px;
  border-radius: var(--r-tile);
  border: 2px dashed var(--hairline);
  background: var(--surface-sunken);
}
.reorder__line:empty::after {
  content: "Place les mots ici";
  color: var(--ink-faint);
  font-size: var(--text-sm);
  align-self: center;
}
.reorder__bank { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; }
.word {
  min-height: 46px;
  padding: 8px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-chip);
  background: var(--surface);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.word:hover:not(:disabled) { background: var(--surface-sunken); transform: translateY(-1px); }
.word:disabled { opacity: 0.6; cursor: default; }
.reorder__line .word { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }

/* Ce qu'on montre après la réponse : la phrase entière et sa traduction. */
.reveal {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  padding: 18px 20px;
  border-radius: var(--r-tile);
  background: var(--surface-sunken);
  border-left: 3px solid var(--english);
}
.reveal__en { font-size: var(--text-base); font-weight: 700; color: var(--english); }
.reveal__fr { font-size: var(--text-sm); color: var(--ink-secondary); }
.reveal .speak { grid-column: 2; grid-row: 1 / 3; }

@media (max-width: 560px) {
  .choices { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Méthode : une page qui se lit, adressée au parent
   -------------------------------------------------------------------------- */

.method { max-width: 66ch; margin-top: clamp(20px, 3vw, 32px); }
.method__intro {
  padding: 20px 22px;
  border-radius: var(--r-tile);
  background: color-mix(in srgb, var(--accent) 11%, var(--surface-sunken));
  color: var(--ink-secondary);
}
.method__part { margin-top: clamp(34px, 5vw, 48px); }
.method__part > * + * { margin-top: 16px; }
.method__title {
  font-size: var(--text-lg);
  padding-bottom: 10px;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.method__part p { line-height: 1.65; }
.method__aside {
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  padding-left: 16px;
  border-left: 2px solid var(--hairline);
}
.method__advice li { color: var(--ink); }
.method__advice strong { display: block; }

/* Les cinq boîtes, avec l'attente qui s'allonge. */
.boxes { display: grid; gap: 8px; margin-top: 22px; }
.boxes__row {
  display: grid;
  grid-template-columns: minmax(140px, auto) 1fr minmax(120px, auto);
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--r-chip);
  background: var(--surface-sunken);
  font-size: var(--text-sm);
}
.boxes__row--acquired { background: color-mix(in srgb, var(--m-4) 16%, var(--surface-sunken)); }
.boxes__name { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.boxes__number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--surface);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
}
.boxes__bar {
  height: 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
}
.boxes__fill { display: block; height: 100%; border-radius: 99px; background: var(--accent-fill); }
.boxes__wait { color: var(--ink-secondary); font-size: var(--text-xs); text-align: right; }

@media (max-width: 620px) {
  .boxes__row { grid-template-columns: 1fr auto; }
  .boxes__bar { grid-column: 1 / 3; }
}

/* --------------------------------------------------------------------------
   8. Écrans étroits : les intercalaires deviennent une barre d'onglets,
      comme sur iPad.
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: var(--surface);
    border-top: 1px solid var(--hairline);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabs__list { padding: 0; gap: 0; }
  .tab {
    flex: 1 1 0;
    flex-direction: column;
    gap: 3px;
    padding: 8px 4px;
    min-height: 62px;
    border: none;
    border-radius: 0;
    font-size: 0.6875rem;
    letter-spacing: -0.01em;
  }
  .tab::before { inset: auto 0 0; height: 3px; border-radius: 3px 3px 0 0; }
  .tab--active { background: none; margin-bottom: 0; }
  .tab:hover { background: none; }
  .tab__icon { width: 24px; height: 24px; }

  .masthead { padding-top: 12px; }
  .sheet { border-radius: var(--r-tile); }
}

/* --------------------------------------------------------------------------
   9. Confort
   -------------------------------------------------------------------------- */

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