:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #e3e8f0;
  --ink: #191b23;
  --ink-muted: #6b7280;
  --border: #e1e6ef;
  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #dbeafe;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --error: #dc2626;
  --error-soft: #fee2e2;
  --bordeaux: #9f1239;
  --bordeaux-soft: #fce7f0;
  --orange: #c2410c;
  --orange-soft: #ffedd5;
  /* Largeur unique du contenu sur ordinateur : accueil, leçons, exercices,
     vocabulaire et verbes ont tous la même colonne (seul le grand tableau
     des verbes s'élargit, voir .verb-table-wide). */
  --content-width: 720px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(23,27,41,0.05), 0 8px 24px rgba(23,27,41,0.06);
  --font-display: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Inter", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10131a;
    --surface: #171b24;
    --surface-2: #1e232e;
    --ink: #eef1f6;
    --ink-muted: #9aa3b2;
    --border: #262c38;
    --accent: #5b9bf7;
    --accent-strong: #8fbcfa;
    --accent-ink: #07101a;
    --accent-soft: #1c2b42;
    --amber: #e7ab4c;
    --amber-soft: #3a2c14;
    --success: #55c88c;
    --success-soft: #163325;
    --error: #e2827a;
    --error-soft: #3a1c19;
    --bordeaux: #e893ac;
    --bordeaux-soft: #3a1826;
    --orange: #f0954a;
    --orange-soft: #3d2410;
    --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.35);
  }
}
:root[data-theme="dark"] {
  --bg: #10131a;
  --surface: #171b24;
  --surface-2: #1e232e;
  --ink: #eef1f6;
  --ink-muted: #9aa3b2;
  --border: #262c38;
  --accent: #5b9bf7;
  --accent-strong: #8fbcfa;
  --accent-ink: #07101a;
  --accent-soft: #1c2b42;
  --amber: #e7ab4c;
  --amber-soft: #3a2c14;
  --success: #55c88c;
  --success-soft: #163325;
  --error: #e2827a;
  --error-soft: #3a1c19;
  --bordeaux: #e893ac;
  --bordeaux-soft: #3a1826;
  --orange: #f0954a;
  --orange-soft: #3d2410;
  --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .display { font-family: var(--font-display); text-wrap: balance; }
h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3, h4 { font-weight: 600; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
button { font: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell { max-width: calc(var(--content-width) + 40px); margin: 0 auto; padding: 0 20px 64px; }

header.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: calc(var(--content-width) + 40px); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
}
nav.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
nav.tabs button {
  border: 0; background: transparent; color: var(--ink-muted);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 0.88rem;
  transition: background .15s ease, color .15s ease;
}
nav.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
nav.subtabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; margin-bottom: 24px; width: fit-content; }
nav.subtabs button {
  border: 0; background: transparent; color: var(--ink-muted);
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 0.84rem;
}
nav.subtabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
/* Lesson-part nav (e.g. "Leçon 1" / "Leçon 2" under a multi-part lesson):
   separate standalone pills rather than nav.subtabs's single joined
   segmented control — each part reads as its own distinct button, and a
   locked one (not yet unlocked by passing an exercise) can be grayed out
   on its own without looking like a broken segment of a shared control. */
.lesson-part-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.lesson-part-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 0.86rem;
}
.lesson-part-btn[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lesson-part-btn:disabled { background: var(--surface-2); border-color: var(--surface-2); color: var(--ink-muted); cursor: not-allowed; }
section.subscreen { display: none; }
section.subscreen.active { display: block; }
section.screen { display: none; padding-top: 28px; }
section.screen.active { display: block; }

/* ---- Accueil ---- */
.home-greeting { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.home-avatar {
  flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.home-greeting-title { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
.home-greeting-sub { color: var(--ink-muted); font-size: 0.92rem; margin-top: 2px; }
.home-grid { display: flex; flex-direction: column; gap: 16px; }
.home-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 22px; cursor: pointer; box-shadow: var(--shadow); width: 100%;
}
.home-card:hover { border-color: var(--accent); }
.home-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.home-card-icon {
  width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.home-card-chevron { color: var(--ink-muted); font-size: 1.3rem; line-height: 1; padding-top: 8px; }
.home-card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.home-card-stat { color: var(--ink-muted); font-size: 0.88rem; margin-top: -8px; }
.home-card-stat:empty { display: none; }
th.has-tooltip { position: relative; cursor: pointer; }
th.has-tooltip:hover::after, th.has-tooltip:focus-visible::after {
  content: attr(data-tooltip); position: absolute; left: 0; top: 100%; z-index: 5; margin-top: 4px;
  background: var(--ink); color: var(--bg); font-family: var(--font-body); font-size: 0.78rem; font-weight: 400;
  text-transform: none; letter-spacing: 0; padding: 5px 9px; border-radius: 6px; white-space: nowrap;
}
.theme-match { color: var(--ink-muted); font-size: 0.82rem; margin-top: 2px; }
.theme-match b { color: var(--accent-strong); font-weight: 600; }
details.home-howto { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; margin: 0 0 24px; }
details.home-howto summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; color: var(--accent-strong); font-size: 0.92rem; }
details.home-howto ul { margin: 10px 0 4px; padding-left: 1.15em; }
details.home-howto li { margin: 6px 0; }

/* ---- Règles ---- */
.rules-intro { color: var(--ink-muted); margin: 4px 0 24px; }
.tense-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tense-nav button {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font-family: var(--font-display);
  font-weight: 600; font-size: 0.84rem;
}
.tense-nav button[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.tense-panel { display: none; }
.tense-panel.active { display: block; }
.modal-panel { display: none; }
.modal-panel.active { display: block; }
.tense-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px;
  border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft);
}
.tense-cta:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.card .note { color: var(--ink-muted); font-size: 0.88rem; margin: 4px 0 14px; }
table.conj { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.conj th, table.conj td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
table.conj th { color: var(--ink-muted); font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; }
table.conj td.form { font-family: var(--font-mono); font-weight: 600; }
.cell-sub { font-family: var(--font-body); font-weight: 400; color: var(--ink-muted); font-size: 0.85em; margin-top: 3px; }
.say-cell { display: flex; align-items: flex-start; gap: 8px; }
.say-btn {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--accent-soft);
  color: var(--accent-strong); cursor: pointer; font-size: 0.75rem; padding: 0; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
}
.say-btn:hover { background: var(--accent); color: #fff; }
.pos-tag { font-family: var(--font-body); font-weight: 400; font-size: 0.72em; color: var(--ink-muted); vertical-align: sub; }
.table-scroll { overflow-x: auto; }
.rule-list { margin: 0; padding-left: 1.15em; color: var(--ink); }
.rule-list li { margin: 5px 0; }
.rule-list code, .inline-code { font-family: var(--font-mono); background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 0.88em; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---- Exercices ---- */
.practice-hero {
  background: linear-gradient(155deg, var(--accent-soft), var(--surface) 65%);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.practice-hero .count { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; line-height: 1; color: var(--accent-strong); }
.practice-hero .count-label { color: var(--ink-muted); font-size: 0.85rem; }
button.primary-btn {
  border: 0; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display);
  font-weight: 700; font-size: 0.98rem; padding: 13px 22px; border-radius: 999px; cursor: pointer;
  box-shadow: var(--shadow);
}
button.primary-btn:hover { background: var(--accent-strong); }
button.primary-btn:disabled { opacity: .5; cursor: not-allowed; }
button.ghost-btn {
  border: 1px solid var(--border); background: transparent; color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; padding: 9px 16px;
  border-radius: 999px; cursor: pointer;
}
button.ghost-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
/* Précédent/Suivant in the multi-part lesson reader mix ghost-btn (outline)
   and primary-btn (filled) for their look, but those two base classes
   have different padding/font-size — normalize both to the same box so
   the pair reads as one balanced control, not two mismatched sizes. */
/* Fixed width AND height (not just min-width): ghost-btn's 1px border vs
   primary-btn's none otherwise left them 2px off in height, which read
   as "not the same size" even once padding/font were already equal.
   JS toggles these buttons' visibility via style.display = "inline-flex",
   which makes text-align a no-op (flex containers center content via
   justify-content, not text-align) — set both so it centers either way. */
button.part-nav-btn { padding: 13px 22px; font-size: 0.98rem; width: 150px; height: 52px; text-align: center; justify-content: center; align-items: center; }
button.icon-back-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  margin-bottom: 18px; padding: 0;
}
button.icon-back-btn:hover { border-color: var(--accent); color: var(--accent-strong); }

details.filters { margin-bottom: 24px; }
details.filters summary {
  cursor: pointer; font-family: var(--font-display); font-weight: 600; color: var(--ink-muted);
  font-size: 0.88rem; padding: 4px 0;
}
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); padding: 6px 13px; border-radius: 999px;
  font-size: 0.82rem; cursor: pointer; user-select: none; font-family: var(--font-display); font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filter-label { width: 100%; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); margin-top: 8px; }
/* Vocab status filter: mirror the table's status-badge colors (Nouveau
   blue, Abordé amber, Su green) instead of the generic chip look, so the
   filter reads at a glance the same way the badges do. Selecting one
   solidifies its border to the matching color. */
#vocabStatusFilterGroup .chip[data-status="nouveau"] { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-soft); }
#vocabStatusFilterGroup .chip[data-status="aborde"] { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-soft); }
#vocabStatusFilterGroup .chip[data-status="su"] { background: var(--success-soft); color: var(--success); border-color: var(--success-soft); }
#vocabStatusFilterGroup .chip[data-status="nouveau"][aria-pressed="true"] { border-color: var(--accent); }
#vocabStatusFilterGroup .chip[data-status="aborde"][aria-pressed="true"] { border-color: var(--amber); }
#vocabStatusFilterGroup .chip[data-status="su"][aria-pressed="true"] { border-color: var(--success); }
/* Lesson level filter: same idea, but colors mirror .level-badge
   (level-a1 amber, level-a2 orange, level-b1 success, level-b2 accent)
   so the filter chip for a level looks like that level's own badge. */
#lessonLevelFilterGroup .chip[data-level="A1"] { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-soft); }
#lessonLevelFilterGroup .chip[data-level="A2"] { background: var(--orange-soft); color: var(--orange); border-color: var(--orange-soft); }
#lessonLevelFilterGroup .chip[data-level="B1"] { background: var(--success-soft); color: var(--success); border-color: var(--success-soft); }
#lessonLevelFilterGroup .chip[data-level="B2"] { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-soft); }
#lessonLevelFilterGroup .chip[data-level="A1"][aria-pressed="true"] { border-color: var(--amber); }
#lessonLevelFilterGroup .chip[data-level="A2"][aria-pressed="true"] { border-color: var(--orange); }
#lessonLevelFilterGroup .chip[data-level="B1"][aria-pressed="true"] { border-color: var(--success); }
#lessonLevelFilterGroup .chip[data-level="B2"][aria-pressed="true"] { border-color: var(--accent); }

.session-wrap { max-width: none; }
.exercise-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 28px; box-shadow: var(--shadow);
}
.exercise-meta { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.tense-title {
  font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1.1;
  color: var(--accent-strong); text-transform: uppercase; letter-spacing: .03em;
}
.wo-count { font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink-muted); }
.verb-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.verb-pill { display: flex; align-items: baseline; gap: 8px; }
.verb-pill .inf { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.verb-pill .fr { color: var(--ink-muted); font-style: italic; font-size: 0.9rem; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 0.7rem; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); }
.tag.person { background: var(--accent-soft); color: var(--accent-strong); }
.sentence { font-size: 1.5rem; line-height: 1.5; margin: 18px 0 6px; }
.sentence .blank-input {
  font-family: var(--font-mono); font-size: 1rem; font-weight: 600; width: 9.5em;
  border: none; border-bottom: 2px solid var(--accent); background: transparent; color: var(--ink);
  padding: 2px 2px; text-align: center;
  outline: none; box-shadow: none;
}
/* Some browsers draw their own colored glow around text inputs (e.g. a
   green box on a "valid" field). We only want our own underline plus the
   accessible focus ring below — never a browser-native glow. */
.sentence .blank-input:valid,
.sentence .blank-input:invalid,
.sentence .blank-input:required,
.sentence .blank-input:optional {
  outline: none; box-shadow: none;
}
.sentence .blank-input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.sentence .blank-input:disabled { color: var(--ink-muted); }
.fr-gloss { color: var(--ink-muted); font-style: italic; font-size: 0.94rem; margin-bottom: 20px; }
.feedback { border-radius: var(--radius); padding: 12px 14px; margin: 12px 0 18px; font-size: 0.92rem; display: none; }
.feedback.show { display: block; }
.feedback.correct { background: var(--success-soft); color: var(--success); }
.feedback.incorrect { background: var(--error-soft); color: var(--error); }
.feedback .answer { font-family: var(--font-mono); font-weight: 700; }
.feedback .hint { display: block; margin-top: 6px; color: var(--ink); opacity: .85; font-size: 0.88rem; }
.ex-instruction { color: var(--ink); font-weight: 600; }
/* L'exemple reste discret (gris) : c'est la phrase de l'exercice, juste
   en dessous, qui doit attirer l'œil. */
.ex-example { display: block; margin-top: 6px; padding: 8px 12px; border-radius: 10px; border: 1px dashed var(--border); color: var(--ink-muted); font-size: 0.88rem; }
.ex-example b { font-family: var(--font-display); font-weight: 600; color: var(--ink-muted); margin-right: 4px; }
/* Exemple repliable (<details>) : on touche « Exemple » pour l'ouvrir ou
   le fermer. La flèche tourne quand il est ouvert. */
details.ex-example summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  -webkit-user-select: none; user-select: none;
}
details.ex-example summary::-webkit-details-marker { display: none; }
details.ex-example summary::after {
  content: ""; margin-left: auto; width: 7px; height: 7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s;
}
details.ex-example[open] summary::after { transform: translateY(2px) rotate(-135deg); }
details.ex-example[open] summary { margin-bottom: 4px; }
details.ex-example:not([open]) { padding-top: 6px; padding-bottom: 6px; }
.ex-example em { color: var(--ink-muted); }
/* La phrase à compléter : texte plein, et le trou « ____ » en couleur. */
#choicePrompt { color: var(--ink); font-weight: 600; }
#choicePrompt .choice-context { font-weight: 400; }
.blank-gap { color: var(--accent-strong); letter-spacing: -0.02em; }
.exercise-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.progress-track { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
.progress-fill { height: 100%; background: var(--accent); transition: width .25s ease; }
.session-summary { text-align: center; padding: 20px 6px; }
.session-summary .big { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; color: var(--accent-strong); }

/* ---- Progrès ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-tile .n { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; }
.stat-tile .l { color: var(--ink-muted); font-size: 0.8rem; }
.level-bars { display: flex; flex-direction: column; gap: 10px; }
.level-row { display: grid; grid-template-columns: 60px 1fr 46px; align-items: center; gap: 10px; font-size: 0.86rem; }
.level-row .bar-bg { background: var(--surface-2); border-radius: 6px; height: 10px; overflow: hidden; }
.level-row .bar-fill { height: 100%; background: var(--accent); }

footer.foot { text-align: center; color: var(--ink-muted); font-size: 0.78rem; margin-top: 40px; }

/* ---- Leçons ---- */
.lesson-search {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 0.95rem; margin-bottom: 22px;
}
.lesson-search::placeholder { color: var(--ink-muted); }
.lesson-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lesson-list { display: flex; flex-direction: column; gap: 14px; }
.lesson-list-row {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 18px; cursor: pointer; box-shadow: var(--shadow);
}
.lesson-list-row:hover { border-color: var(--accent); }
/* Whole-row green treatment for a fully-validated lesson (every exercise
   passed at ≥80%) — the small "Su" pill alone was too easy to miss
   scanning the list, so the row itself now reads "done" at a glance. */
.lesson-list-row[data-status="su"] { background: var(--success-soft); border-color: var(--success); }
.lesson-list-row[data-status="su"] .lesson-title { color: var(--success); }
.lesson-list-row[data-status="su"] .lesson-icon { background: var(--surface); }
.lesson-icon {
  flex: none; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.lesson-info { flex: 1; min-width: 0; }
.lesson-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--ink); line-height: 1.3; }
/* Level badge under the lesson title in the "Leçons" list row (reuses
   .level-badge, defined further down next to its color variants). */
.lesson-info .level-badge { margin-top: 5px; font-size: 0.72rem; }
/* Secondary action on a theme row: jump straight to every exercise of
   that theme (screen-theme-exercises) without opening the lesson first —
   a small icon button so it reads as a distinct action from the row's
   own click (which opens the lesson as before). */
.lesson-ex-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.lesson-ex-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.lesson-badge { flex: none; font-family: var(--font-display); font-weight: 700; font-size: 0.78rem; padding: 5px 12px; border-radius: 999px; }
.lesson-badge.nouveau { background: var(--accent-soft); color: var(--accent-strong); }
.lesson-badge.aborde { background: var(--amber-soft); color: var(--amber); }
.lesson-badge.su { background: var(--success-soft); color: var(--success); }
.lesson-chevron { flex: none; color: var(--ink-muted); font-size: 1.4rem; line-height: 1; }

.lesson-detail-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 28px; box-shadow: var(--shadow);
}
.lesson-detail-card .eyebrow { color: var(--ink-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-display); font-weight: 700; }
/* CECR level badge (A1/A2/B1/B2) — one color per level, borrowed from
   judo belt order starting at yellow (no white belt to start from here):
   jaune, orange, verte, bleue. Reuses the amber/success/accent tokens
   already used elsewhere for the first, third and fourth colors. */
.level-badge { display: inline-block; font-weight: 700; padding: 1px 8px; border-radius: 999px; text-transform: none; letter-spacing: normal; vertical-align: middle; }
.level-badge.level-a1 { background: var(--amber-soft); color: var(--amber); }
.level-badge.level-a2 { background: var(--orange-soft); color: var(--orange); }
.level-badge.level-b1 { background: var(--success-soft); color: var(--success); }
.level-badge.level-b2 { background: var(--accent-soft); color: var(--accent-strong); }
.explanation-block { background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; font-size: 0.94rem; }
.explanation-block h4 { margin: 0 0 6px; font-size: 0.95rem; }
.explanation-block.tip { background: var(--accent-soft); color: var(--accent-strong); }
.explanation-block.tip p { color: var(--ink); }
.exercise-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.exercise-row {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; background: var(--surface); color: var(--ink); cursor: pointer; text-align: left;
}
.exercise-row:disabled, .exercise-row[aria-disabled="true"] { cursor: not-allowed; opacity: .5; }
.exercise-row .cta {
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
  padding: 7px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong);
}
.exercise-row[data-status="done"] .cta { background: var(--success-soft); color: var(--success); }
.exercise-row .sc { margin-left: auto; font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-muted); }
.session-message { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 4px 0 14px; }
.session-message.pass { color: var(--success); }
.session-message.fail { color: var(--error); }
.choice-context { font-size: 1rem; color: var(--ink-muted); margin-bottom: 10px; line-height: 1.45; }
.session-message.celebrate { color: var(--success); font-size: 1.2rem; }
.story-hero {
  background: linear-gradient(155deg, var(--accent-soft), var(--surface) 70%);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.story-hero .eyebrow { margin-bottom: 6px; }
.story-hero-title { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; margin: 6px 0 16px; display: flex; gap: 10px; align-items: center; }
.story-section-title { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--ink-muted); margin: 0 0 10px; }
.story-teaser { color: var(--ink-muted); font-size: 0.9rem; text-align: center; margin-top: 18px; }

/* ---- Word-order exercise ("le bon ordre") ---- */
.word-answer {
  display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; align-items: center;
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 16px 0 14px;
}
.word-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; min-height: 40px; }
.word-chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-family: var(--font-mono); font-size: 0.98rem; font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius); cursor: pointer;
}
.word-chip:hover { border-color: var(--accent); color: var(--accent-strong); }
.word-chip.answer { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.word-chip:disabled { cursor: default; opacity: .7; }

/* ---- Mots (vocabulaire) ---- */
.lesson-count-text { color: var(--ink-muted); font-size: 0.88rem; }
.vocab-word-card {
  display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow);
}
.vocab-word-card:hover { border-color: var(--accent); }
.vocab-check {
  flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--accent);
  background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 0.85rem; font-weight: 800; padding: 0;
}
.vocab-check.checked { background: var(--accent); color: #fff; }
.vocab-word-text { flex: 1; min-width: 0; }
.vocab-word-de { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--ink); }
.vocab-word-fr { color: var(--ink-muted); font-size: 0.88rem; margin-top: 2px; }
.vocab-row-audio {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--accent-soft);
  color: var(--accent-strong); cursor: pointer; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
}
.vocab-row-audio:hover { background: var(--accent); color: #fff; }
.mcq-option {
  display: block; width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1rem;
}
.mcq-option:hover:not(:disabled) { border-color: var(--accent); }
.mcq-option:disabled { cursor: default; }
.mcq-option.correct { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.mcq-option.incorrect { background: var(--error-soft); border-color: var(--error); color: var(--error); }
/* "Wenn ou ob ?" answers are single short words, not a list of phrases
   like the vocab quiz's — center them in their pill instead of the
   shared .mcq-option's left alignment (kept as-is elsewhere). */
#choiceOptions .mcq-option { text-align: center; }

/* ---- Word detail card ---- */
.vocab-detail-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
/* Quit-exercise confirmation modal: same overlay pattern as the vocab
   detail card, but a small centered dialog rather than a scrollable
   card. z-index above vocab-detail-overlay (70 vs 60) — in practice the
   two never stack, but keeping it higher avoids any future ambiguity. */
.confirm-quit-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.confirm-quit-card {
  background: var(--surface); border-radius: var(--radius-lg, var(--radius));
  box-shadow: var(--shadow, 0 20px 50px rgba(0,0,0,.3));
  padding: 26px 24px; max-width: 360px; width: 100%; text-align: center;
}
.confirm-quit-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--ink); margin-bottom: 20px; }
.confirm-quit-actions { display: flex; flex-direction: column; gap: 10px; }
.confirm-quit-actions button { width: 100%; }
.vocab-detail-card {
  background: var(--surface); border-radius: var(--radius-lg, var(--radius));
  box-shadow: var(--shadow, 0 20px 50px rgba(0,0,0,.3));
  padding: 24px; max-width: 420px; width: 100%; max-height: 88vh; overflow-y: auto;
}
.vocab-detail-top { display: flex; align-items: center; justify-content: space-between; }
.vocab-audio-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--accent-soft); color: var(--accent-strong); font-size: 1.05rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.vocab-audio-btn:hover { background: var(--accent); color: #fff; }
.vocab-detail-word { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; margin: 16px 0 2px; }
.vocab-detail-fr { color: var(--ink-muted); font-style: italic; font-size: 1.05rem; margin: 0 0 14px; }
.vocab-plural-pill {
  display: inline-block; font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-strong);
  background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 12px; margin-bottom: 4px;
}
.vocab-examples-title {
  font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-muted); border-top: 1px solid var(--border); padding-top: 16px; margin: 18px 0 12px;
}
.vocab-example { margin-bottom: 14px; }
.vocab-example-de { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.vocab-example-fr { color: var(--ink-muted); font-size: 0.92rem; margin-top: 2px; padding-left: 34px; }
.vocab-example-audio {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: none; background: transparent;
  color: var(--accent-strong); cursor: pointer; font-size: 0.95rem; padding: 0;
}
.vocab-example-audio:hover { color: var(--accent); }

/* ---- Vocab exercise question card ---- */
.vocab-question-card {
  background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius-lg);
  padding: 30px 20px 26px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.pos-pill {
  display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: 0.78rem;
  background: var(--error-soft); color: var(--error); padding: 5px 14px; border-radius: 999px;
}
/* Gender-coded variants for the vocab exercise's noun pill: der (masculin)
   green, die (féminin) blue, das (neutre) bordeaux — lets the learner
   spot the article at a glance instead of reading the label. */
.pos-pill.gender-masc { background: var(--success-soft); color: var(--success); }
.pos-pill.gender-fem { background: var(--accent-soft); color: var(--accent-strong); }
.pos-pill.gender-neut { background: var(--bordeaux-soft); color: var(--bordeaux); }
.vocab-question-word { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; color: var(--ink); }
/* "Phrase à trous" mode shows a full sentence instead of a single word —
   too long to read comfortably at the single-word size/weight. */
.vocab-question-word.sentence-mode { font-size: 1.3rem; font-weight: 700; line-height: 1.4; }

/* ---- Vocab exercise summary ---- */
.session-emoji-badge {
  width: 64px; height: 64px; border-radius: 50%; background: var(--error-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin: 0 auto 14px;
}
.vocab-summary-title { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--ink); }
.vocab-summary-sub { color: var(--ink-muted); font-size: 0.94rem; margin: 6px auto 20px; max-width: 34ch; }
.vocab-stat-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.vocab-stat-label { color: var(--ink-muted); font-size: 0.82rem; }
.vocab-stat-value { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; margin-top: 2px; }

/* ---- Verbes: category list / disabled row ---- */
.disabled-row { opacity: .55; cursor: default; }
.disabled-row:hover { border-color: var(--border); }

/* ---- Verbes: selectable table ---- */
.verb-select-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--accent-soft); color: var(--accent-strong); border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 14px; font-family: var(--font-display); font-weight: 700; font-size: 0.86rem;
}
.verb-select-bar button { background: none; border: none; color: var(--accent-strong); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
/* Capped height with its own scrollbar (rather than letting a full page
   of 30 rows push the pagination/train button far below the fold) — the
   sticky header keeps column labels visible while scrolling rows. */
.verb-table-wrap { overflow-x: auto; overflow-y: auto; max-height: 55vh; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
table.verb-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; white-space: nowrap; }
table.verb-table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; padding: 10px 14px; color: var(--ink-muted); font-family: var(--font-display);
  font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); background: var(--surface-2); vertical-align: middle;
}
table.verb-table th[data-sort] { cursor: pointer; user-select: none; }
table.verb-table th[data-sort]:hover { color: var(--accent-strong); }
table.verb-table th .sort-arrow { margin-left: 3px; color: var(--accent-strong); }
table.verb-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; line-height: 1.3; }
table.verb-table tr:last-child td { border-bottom: none; }
table.verb-table tbody tr:hover td { background: var(--accent-soft); }
table.verb-table td:not(:first-child) { cursor: pointer; }
table.verb-table td.verb-infinitive { color: var(--accent-strong); font-weight: 700; font-family: var(--font-mono); }
table.verb-table td.verb-form { font-family: var(--font-mono); }
.verb-type-badge {
  display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: 0.72rem;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.verb-type-badge.type-regulier { background: var(--accent-soft); color: var(--accent-strong); }
.verb-type-badge.type-irregulier { background: var(--error-soft); color: var(--error); }
.verb-type-badge.type-modal { background: var(--amber-soft); color: var(--amber); }
.verb-type-badge.type-auxiliaire { background: var(--success-soft); color: var(--success); }
.verb-type-badge.type-separable { background: var(--surface-2); color: var(--ink-muted); }
/* Auxiliary pill in the verb list table: haben (blue, the default/most
   common case) vs sein (green, the smaller special-case set) — same
   color logic as the type badges above. */
.aux-pill {
  display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: 0.72rem;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.aux-pill.aux-haben { background: var(--accent-soft); color: var(--accent-strong); }
.aux-pill.aux-sein { background: var(--amber-soft); color: var(--amber); }
/* Draggable column headers: grab cursor plus a visible accent bar on the
   column currently hovered as a drop target, so the reorder gesture reads
   clearly even though nothing else in the app uses native HTML5 DnD. */
table.verb-table th[draggable="true"] { cursor: grab; }
table.verb-table th.col-dragging { opacity: .4; }
table.verb-table th.col-drag-over { box-shadow: inset 3px 0 0 var(--accent); }
/* Case « flèche » et bouton « fiche » : utiles seulement sur téléphone. */
table.verb-table td.verb-chevron, table.verb-table td.verb-more { display: none; }

/* ---- Verbes : liste sur téléphone ----
   Même seuil que verbListMobileQuery (js/verbes-liste.js). Chaque ligne du
   tableau devient une ligne dépliable : case à cocher, verbe, traduction,
   flèche. Une ligne ouverte (tr.open) affiche le détail, une information
   par ligne, dans un ordre fixe (même si les colonnes ont été déplacées
   sur ordinateur). La page défile normalement : plus de double défilement. */
@media (max-width: 640px) {
  .verb-table-wide.verb-table-wrap { max-height: none; overflow: visible; }
  .verb-table-wide table.verb-table, table.verb-table tbody { display: block; white-space: normal; }
  .verb-table-wide table.verb-table thead { display: none; }
  .verb-table-wide table.verb-table tr {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center; column-gap: 10px; padding: 12px 14px;
    border-bottom: 1px solid var(--border); cursor: pointer;
  }
  .verb-table-wide table.verb-table tr:last-child { border-bottom: none; }
  .verb-table-wide table.verb-table tr.open { background: var(--surface-2); }
  .verb-table-wide table.verb-table tbody tr:hover td { background: transparent; }
  .verb-table-wide table.verb-table td { display: none; padding: 0; border: none; }
  .verb-table-wide table.verb-table td:first-child { display: block; grid-column: 1; grid-row: 1; }
  .verb-table-wide table.verb-table td[data-col="infinitive"] { display: block; grid-column: 2; grid-row: 1; }
  .verb-table-wide table.verb-table td[data-col="fr"] {
    display: block; grid-column: 3; grid-row: 1; color: var(--ink-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .verb-table-wide table.verb-table td.verb-chevron {
    display: block; grid-column: 4; grid-row: 1; color: var(--ink-muted);
    font-size: 1.2rem; transform: rotate(90deg); transition: transform .15s;
  }
  .verb-table-wide table.verb-table tr.open td.verb-chevron { transform: rotate(-90deg); }
  .verb-table-wide table.verb-table tr.open td[data-col="fr"] { white-space: normal; }
  .verb-table-wide table.verb-table tr.open td[data-col="praesens"],
  .verb-table-wide table.verb-table tr.open td[data-col="praeteritum"],
  .verb-table-wide table.verb-table tr.open td[data-col="participe"],
  .verb-table-wide table.verb-table tr.open td[data-col="auxiliaire"],
  .verb-table-wide table.verb-table tr.open td[data-col="type"] {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    grid-column: 1 / -1; padding: 5px 0 5px 36px;
  }
  .verb-table-wide table.verb-table tr.open td[data-col]::before {
    content: attr(data-label); color: var(--ink-muted); font-family: var(--font-body); font-size: 0.86rem;
  }
  .verb-table-wide table.verb-table tr.open td[data-col="infinitive"]::before,
  .verb-table-wide table.verb-table tr.open td[data-col="fr"]::before { content: none; }
  .verb-table-wide table.verb-table tr.open td[data-col="praesens"] { grid-row: 2; margin-top: 8px; }
  .verb-table-wide table.verb-table tr.open td[data-col="praeteritum"] { grid-row: 3; }
  .verb-table-wide table.verb-table tr.open td[data-col="participe"] { grid-row: 4; }
  .verb-table-wide table.verb-table tr.open td[data-col="auxiliaire"] { grid-row: 5; }
  .verb-table-wide table.verb-table tr.open td[data-col="type"] { grid-row: 6; }
  .verb-table-wide table.verb-table tr.open td.verb-more { display: block; grid-column: 1 / -1; grid-row: 7; padding: 8px 0 0 36px; }
  .verb-more-btn {
    border: none; background: none; padding: 0; cursor: pointer; font: inherit;
    font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; color: var(--accent-strong);
  }

  /* Liste de vocabulaire : une ligne par mot, la traduction sous le mot. */
  .vocab-table-wrap { max-height: none; }
  table.vocab-table thead { display: none; }
  table.vocab-table, table.vocab-table tbody { display: block; white-space: normal; }
  table.vocab-table tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center;
    column-gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border);
  }
  table.vocab-table tr:last-child { border-bottom: none; }
  table.vocab-table td { padding: 0; border: none; }
  table.vocab-table td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  table.vocab-table td:nth-child(2) { grid-column: 2; grid-row: 1; font-weight: 700; }
  table.vocab-table td:nth-child(3) { grid-column: 2; grid-row: 2; color: var(--ink-muted); font-size: 0.86rem; }
  table.vocab-table td:nth-child(4) { grid-column: 3; grid-row: 1 / span 2; }
  table.vocab-table td:nth-child(5) { grid-column: 4; grid-row: 1 / span 2; }
  table.vocab-table td[colspan] { grid-column: 1 / -1; grid-row: 1; }
}
.verb-table-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; font-family: var(--font-display); font-size: 0.86rem; color: var(--ink-muted);
}
.verb-table-pagination button {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600;
}
.verb-table-pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-strong); }
.verb-table-pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ---- Verbes: fiche détail ---- */
.verb-detail-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.verb-detail-word { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; margin-bottom: 2px; }
.verb-detail-fr { color: var(--ink-muted); font-size: 1.02rem; margin-bottom: 18px; }
.verb-detail-forms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.verb-detail-form-tile { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }
.verb-detail-form-label { color: var(--ink-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .03em; font-family: var(--font-display); font-weight: 700; }
.verb-detail-form-value { font-family: var(--font-mono); font-weight: 700; color: var(--accent-strong); font-size: 1.02rem; margin-top: 4px; }

.verb-ex-meta { display: flex; align-items: center; justify-content: space-between; }
.verb-ex-verb-label { color: var(--ink-muted); font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; }

/* ---- Verbes: exercise result ---- */
.verb-ex-summary-card {
  display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.verb-ex-ring-wrap { position: relative; width: 88px; height: 88px; flex: none; }
.verb-ex-ring { width: 88px; height: 88px; transform: rotate(-90deg); }
.verb-ex-ring .ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.verb-ex-ring .ring-fill { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.verb-ex-ring-pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1rem;
}
.verb-ex-result-count { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.verb-ex-result-msg { color: var(--ink-muted); font-size: 0.9rem; margin-top: 2px; }
.verb-ex-result-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.verb-ex-result-row.wrong { background: var(--error-soft); border-color: var(--error); }
.verb-ex-result-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.verb-ex-result-tense { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; }
.verb-ex-result-tag { font-family: var(--font-display); font-weight: 700; font-size: 0.78rem; }
.verb-ex-result-tag.ok { color: var(--success); }
.verb-ex-result-tag.ko { color: var(--error); }
.verb-ex-result-form { font-family: var(--font-mono); font-size: 0.95rem; }
.verb-ex-result-form .ok-text { color: var(--success); font-weight: 700; }
.verb-ex-result-hint { color: var(--error); font-size: 0.85rem; margin-top: 4px; }

/* ---- Compte : écran de connexion, barre du haut, page Admin ---- */
.attente-connexion .app-shell { display: none; }
.compte-ecran {
  position: fixed; inset: 0; z-index: 80; overflow-y: auto;
  background: var(--bg); display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 32px;
}
.compte-ecran[hidden], .compte-ecran [hidden] { display: none !important; }
.admin-ecran { background: rgba(0,0,0,.5); padding-top: 5vh; }
.compte-carte {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 28px 26px; width: 100%; max-width: 420px;
}
.admin-carte { max-width: 640px; }
.compte-titre { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--accent-strong); margin-bottom: 4px; }
.compte-sous-titre { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin-bottom: 14px; }
.compte-aide { color: var(--ink-muted); font-size: 0.92rem; margin: 0 0 16px; }
.compte-aide strong { color: var(--ink); }
.compte-form { display: flex; flex-direction: column; gap: 14px; }
.compte-form label { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; }
.compte-form input, .compte-form select, .admin-ligne select {
  font: inherit; font-family: var(--font-body); font-weight: 400; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px;
}
.compte-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.compte-message { font-size: 0.9rem; margin-top: 12px; min-height: 1.2em; color: var(--ink-muted); }
.compte-message.erreur { color: var(--error); }
.compte-message.ok { color: var(--success); }
.compte-liens { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 14px; }
.compte-actions { display: flex; flex-direction: column; gap: 10px; }
.lien-btn { background: none; border: 0; padding: 0; color: var(--accent-strong); cursor: pointer; font: inherit; font-size: 0.9rem; text-decoration: underline; text-align: left; }
.compte-barre { display: flex; gap: 8px; }
.compte-barre[hidden] { display: none; }
button.ghost-btn.petit { padding: 6px 12px; font-size: 0.8rem; }
.admin-entete { display: flex; align-items: center; justify-content: space-between; }
.admin-entete .icon-back-btn { margin: 0; }
.admin-h { font-family: var(--font-display); font-size: 0.95rem; margin: 22px 0 10px; }
.admin-compteur { color: var(--ink-muted); font-weight: 600; margin-left: 6px; }
.admin-liste { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.admin-ligne { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.admin-qui { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-qui span { color: var(--ink-muted); font-size: 0.84rem; overflow-wrap: anywhere; }
.admin-ligne select { padding: 6px 8px; font-size: 0.88rem; }
.admin-ajout-ligne { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 10px; }
@media (max-width: 560px) {
  .admin-ajout-ligne { grid-template-columns: 1fr; }
  .admin-ligne { flex-wrap: wrap; }
}

/* ---- Accueil : titre + bouton ❔, fenêtre « Comment ça marche ? » ---- */
.home-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-title-row h1 { margin: 0.67em 0 2px; }
.help-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 1.15rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.help-btn:hover { border-color: var(--accent); }
.howto-card { max-width: 480px; text-align: left; }
.howto-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.howto-list li { display: flex; gap: 12px; align-items: flex-start; }
.howto-list .howto-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.howto-list strong { display: block; font-family: var(--font-display); margin-bottom: 2px; }
.howto-list p { margin: 0; color: var(--ink-muted); font-size: 0.92rem; }

/* ---- Visite guidée de l'accueil ----
   Un voile sombre (fait par l'ombre géante du cadre lumineux) laisse voir
   seulement la carte expliquée ; la bulle se place juste en dessous (ou au
   dessus s'il n'y a pas la place). */
.tour-layer { position: fixed; inset: 0; z-index: 75; }
.tour-spot {
  position: fixed; border-radius: calc(var(--radius-lg) + 6px); pointer-events: none;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(8, 10, 16, .62);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
}
.tour-bubble {
  position: fixed; width: min(360px, calc(100vw - 32px)); background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 18px 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); transition: top .25s ease, left .25s ease;
}
.tour-bubble::before {
  content: ""; position: absolute; left: var(--arrow-x, 40px); width: 14px; height: 14px;
  background: var(--surface); border: 1px solid var(--border); transform: rotate(45deg);
}
.tour-bubble[data-side="below"]::before { top: -8px; border-right: 0; border-bottom: 0; }
.tour-bubble[data-side="above"]::before { bottom: -8px; border-left: 0; border-top: 0; }
.tour-step { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-muted); margin-bottom: 4px; }
.tour-title { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; }
.tour-text { margin: 0 0 14px; font-size: 0.93rem; color: var(--ink-muted); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-actions .primary-btn { padding: 10px 20px; font-size: 0.92rem; }

/* ---- Bulle info (paragraphes « ❕ » des leçons) ---- */
.info-bubble {
  display: flex; gap: 10px; align-items: flex-start; margin: 14px 0;
  background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: var(--radius); padding: 12px 14px; font-size: 0.95rem;
}
.info-bubble-icon {
  flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--amber); color: var(--surface);
  font-family: var(--font-display); font-weight: 800; font-size: 0.85rem;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px;
}
.info-bubble-text { flex: 1; min-width: 0; }

/* ---- Bouton son (barre du haut) ---- */
.son-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: transparent;
  cursor: pointer; font-size: 1rem; padding: 0; display: inline-flex; align-items: center; justify-content: center;
}
.son-btn:hover { border-color: var(--accent); }
body.son-coupe .say-btn, body.son-coupe .vocab-row-audio, body.son-coupe .vocab-audio-btn,
body.son-coupe .vocab-example-audio { opacity: .35; }

/* ---- Tableaux des leçons sur téléphone ----
   Une colonne marquée .col-mobile-hide (ex. « Exemple », « Français ») est
   masquée sur petit écran, pour que le tableau tienne sans défiler. */
@media (max-width: 640px) {
  table.conj .col-mobile-hide { display: none; }
}

/* ======================================================================
   Téléphone (640 px et moins)
   - onglets en bas de l'écran, comme une appli ; en haut, une barre fine
     avec le nom du site et les boutons son / Admin / déconnexion ;
   - titres plus petits, cartes et tableaux plus compacts ;
   - rien ne doit jamais dépasser sur le côté.
   ====================================================================== */
.brand { display: none; }
.tab-icon { display: none; }
html, body { overflow-x: clip; }
h1 { line-height: 1.2; }

@media (max-width: 640px) {
  .app-shell { padding: 0 14px calc(92px + env(safe-area-inset-bottom)); }
  section.screen { padding-top: 18px; }
  h1 { font-size: 1.65rem; }

  /* Pas de flou sur la barre du haut ici : il empêcherait la barre
     d'onglets de se coller en bas de l'écran. */
  header.topbar { backdrop-filter: none; background: var(--bg); }
  .topbar-inner { justify-content: space-between; flex-wrap: nowrap; padding: 10px 14px; gap: 10px; }
  .brand {
    display: block; font-family: var(--font-display); font-weight: 800; font-size: 0.98rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  }
  .compte-barre { gap: 6px; flex: none; }
  .compte-barre .ghost-btn.petit { padding: 6px 10px; font-size: 0.76rem; }
  .son-btn { width: 32px; height: 32px; }

  nav.tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    border-radius: 0; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
  }
  nav.tabs button {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 2px; border-radius: 12px; font-size: 0.72rem;
  }
  nav.tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-strong); }
  .tab-icon { display: block; font-size: 1.25rem; line-height: 1.1; }
  .tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  .lesson-detail-card, .exercise-card, .card { padding: 18px 16px; }
  .lesson-detail-card h1 { font-size: 1.5rem; }
  .tense-title { font-size: 1.25rem; }
  .sentence { font-size: 1.2rem; }
  #choicePrompt { font-size: 1.1rem !important; }
  .story-hero { padding: 18px 16px; }

  /* Tableaux : un peu plus serrés pour tenir dans la largeur. */
  table.conj { font-size: 0.86rem; }
  table.conj th, table.conj td { padding: 6px 6px; }
  table.conj th { font-size: 0.7rem; }
  /* Le bouton 🔊 disparaît : on touche le mot allemand (souligné en
     pointillés) pour l'entendre. */
  .say-btn { display: none; }
  td.say-td .say-cell > span { text-decoration: underline dotted color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 4px; cursor: pointer; }

  /* Listes de leçons : le petit badge et le bouton 🎯 prennent moins de place. */
  .lesson-list-row { gap: 12px; padding: 12px 14px; }
  .lesson-icon { width: 44px; height: 44px; font-size: 1.35rem; border-radius: 13px; }
  .lesson-badge { font-size: 0.7rem; padding: 4px 9px; }
  .lesson-ex-btn { width: 34px; height: 34px; font-size: 0.95rem; }

  /* Précédent / Suivant : se partagent la largeur au lieu d'une taille fixe. */
  button.part-nav-btn { width: auto; flex: 1 1 0; height: 48px; padding: 10px 12px; }
  .home-card { padding: 16px 18px; }
}
@media (max-width: 440px) {
  .brand-name { display: none; }
}

/* Le grand tableau de la liste des verbes a beaucoup de colonnes : sur
   ordinateur, il déborde un peu de la colonne commune, centré. */
@media (min-width: 900px) {
  .verb-table-wide { width: min(980px, calc(100vw - 40px)); position: relative; left: 50%; transform: translateX(-50%); }
}


/* Message quand le son ne peut pas marcher sur l'appareil */
.sound-notice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--amber-soft);
  color: var(--ink);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1000;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}
.sound-notice.show { opacity: 1; transform: none; }
.sound-notice p { margin: 0; flex: 1; }
.sound-notice-close {
  flex: none;
  border: 0;
  border-radius: 8px;
  padding: 6px 14px;
  background: var(--amber);
  color: var(--surface);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Écran de connexion : encart « Sur invitation uniquement » + demande d'accès */
.compte-invitation {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--accent-soft); border-radius: var(--radius); padding: 14px; margin-bottom: 20px;
}
.compte-invitation p { margin: 0; font-size: 0.9rem; line-height: 1.45; color: var(--ink); }
.compte-invitation-btn {
  font: inherit; font-weight: 700; font-size: 0.95rem; cursor: pointer;
  background: var(--surface); color: var(--accent-strong);
  border: 1px solid var(--accent); border-radius: 10px; padding: 11px 14px; min-height: 44px;
}
.compte-invitation-btn:hover { background: var(--accent); color: var(--accent-ink); }
.compte-indice { font-weight: 400; font-size: 0.8rem; color: var(--ink-muted); }
.compte-note {
  margin: 0; font-size: 0.82rem; line-height: 1.45; color: var(--ink);
  background: var(--amber-soft); border-radius: var(--radius); padding: 10px 12px;
}
.compte-etapes { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.compte-etape { display: flex; gap: 12px; align-items: flex-start; }
.compte-etape-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; background: var(--surface-2); color: var(--ink-muted);
}
.compte-etape.actif .compte-etape-num { background: var(--accent-strong); color: var(--accent-ink); }
.compte-etape.fait .compte-etape-num { background: var(--success-soft); color: var(--success); }
.compte-etape-titre { font-weight: 600; font-size: 0.95rem; }
.compte-etape.fait .compte-etape-titre { color: var(--ink-muted); }
.compte-etape-ok { font-weight: 600; font-size: 0.75rem; color: var(--success); margin-left: 4px; }
.compte-etape-texte { font-size: 0.84rem; line-height: 1.45; color: var(--ink-muted); margin-top: 2px; }
.admin-pastille {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px;
  background: var(--amber-soft); color: var(--amber); font-size: 0.75rem; font-weight: 700;
}
button.primary-btn.petit { padding: 6px 12px; font-size: 0.8rem; }

/* ======================================================================
   Afficher / masquer le mot de passe (écrans de connexion)
   ====================================================================== */
.mdp-champ { position: relative; display: block; }
.mdp-champ input { width: 100%; box-sizing: border-box; padding-right: 48px !important; }
button.mdp-oeil {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%;
  color: var(--ink-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
button.mdp-oeil:hover, button.mdp-oeil[aria-pressed="true"] { color: var(--accent-strong); }
button.mdp-oeil:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ======================================================================
   Téléphone : boutons « Retour » en bas de l'écran
   Même seuil de 640 px que le reste. Les boutons .retour-btn (en haut à
   gauche sur ordinateur) flottent en bas à gauche, juste au-dessus de la
   barre d'onglets : c'est là que tombe le pouce. Dans les exercices, la
   flèche ← devient « ← Quitter ». Sur l'écran d'une leçon, « Retour à la
   leçon » (liste des exercices) se place à droite pour ne pas chevaucher.
   ====================================================================== */
@media (max-width: 640px) {
  .retour-btn {
    position: fixed; z-index: 29; left: 14px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    margin: 0 !important;
    background: var(--surface) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
  }
  button.ghost-btn.retour-btn { padding: 10px 18px; font-size: 0.9rem; }
  button.ghost-btn.retour-btn::before { content: "←"; margin-right: 6px; }
  button.icon-back-btn.retour-btn { width: auto; height: auto; border-radius: 999px; padding: 10px 18px; font-size: 0.9rem; font-family: var(--font-display); font-weight: 600; gap: 6px; }
  button.icon-back-btn.retour-btn::after { content: "Quitter"; }
  #lecExercisePickerBackBtn { left: auto; right: 14px; }
  /* Place pour que le bouton ne cache pas le bas de la page. */
  .app-shell:has(section.screen.active .retour-btn) { padding-bottom: calc(146px + env(safe-area-inset-bottom)); }
}
