/* ==== Design system (docs/design.md) ====================================
   Clean & calm: warm off-white, one Dutch-orange accent, white cards.
   Colour tokens are checked for WCAG AA by build/contrast.py.
   --bg-alt is the card/surface colour (old name kept so older rules work). */
:root {
  /* type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 0.8rem;
  --fs-sm: 0.9rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  /* spacing (4px grid) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-8: 3rem;
  /* shape + motion */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --tap: max(44px, 2.75rem);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur: 160ms;
  --topbar-h: 3.5rem;   /* rem, so the bars grow with the phone's font size */
  --bottombar-h: clamp(64px, 4rem, 84px);  /* grows with text, capped so it never eats the screen */
  /* colour: light */
  --bg: #fbfaf8;
  --bg-alt: #ffffff;
  --surface-2: #f4f1ed;
  --text: #1c1a18;
  --muted: #5e5850;
  --border: #e7e2db;
  --border-strong: #d3cbc0;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fdeee4;
  --accent-contrast: #ffffff;
  --correct: #15803d;
  --correct-bg: #ecf7ef;
  --incorrect: #b42318;
  --incorrect-bg: #fdeeec;
  --chip-bg: #f4f1ed;
  --chip-border: #d3cbc0;
  --shadow-1: 0 1px 2px rgba(28, 26, 24, 0.05), 0 1px 3px rgba(28, 26, 24, 0.06);
  --shadow-2: 0 4px 16px rgba(28, 26, 24, 0.08), 0 1px 3px rgba(28, 26, 24, 0.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161413;
    --bg-alt: #1f1c1a;
    --surface-2: #292522;
    --text: #f2eee9;
    --muted: #aba399;
    --border: #33302b;
    --border-strong: #4a443d;
    --accent: #fb8b4b;
    --accent-hover: #fdb184;
    --accent-soft: #3a2316;
    --accent-contrast: #1c0f06;
    --correct: #5fd38a;
    --correct-bg: #14281b;
    --incorrect: #ff8f80;
    --incorrect-bg: #351b17;
    --chip-bg: #292522;
    --chip-border: #4a443d;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

/* Explicit toggle wins over system preference in both directions. */
:root[data-theme="dark"] {
  --bg: #161413;
  --bg-alt: #1f1c1a;
  --surface-2: #292522;
  --text: #f2eee9;
  --muted: #aba399;
  --border: #33302b;
  --border-strong: #4a443d;
  --accent: #fb8b4b;
  --accent-hover: #fdb184;
  --accent-soft: #3a2316;
  --accent-contrast: #1c0f06;
  --correct: #5fd38a;
  --correct-bg: #14281b;
  --incorrect: #ff8f80;
  --incorrect-bg: #351b17;
  --chip-bg: #292522;
  --chip-border: #4a443d;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fbfaf8;
  --bg-alt: #ffffff;
  --surface-2: #f4f1ed;
  --text: #1c1a18;
  --muted: #5e5850;
  --border: #e7e2db;
  --border-strong: #d3cbc0;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fdeee4;
  --accent-contrast: #ffffff;
  --correct: #15803d;
  --correct-bg: #ecf7ef;
  --incorrect: #b42318;
  --incorrect-bg: #fdeeec;
  --chip-bg: #f4f1ed;
  --chip-border: #d3cbc0;
  --shadow-1: 0 1px 2px rgba(28, 26, 24, 0.05), 0 1px 3px rgba(28, 26, 24, 0.06);
  --shadow-2: 0 4px 16px rgba(28, 26, 24, 0.08), 0 1px 3px rgba(28, 26, 24, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;  /* never px: Android/browser font scaling must reach body text */
  line-height: 1.5;
}

#app { display: flex; min-height: 100vh; }

.nav-toggle {
  display: none;
  position: fixed;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 30;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0;
  margin: 0;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.sidebar-backdrop { display: none; }

#sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  overflow-y: auto;
  height: 100vh;
  position: sticky;
  top: 0;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
#sidebar h1 { font-size: 1.1rem; margin: 0; }
#theme-toggle {
  background: var(--chip-bg);
  color: var(--text);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.2;
}
.nav-level h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 1.25rem 0 0.4rem;
}
.nav-level ul { list-style: none; margin: 0; padding: 0; }
.nav-level li { margin: 0.1rem 0; }
.nav-level a {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}
.nav-level a:hover { background: var(--chip-bg); }
.nav-level a.active { background: var(--accent); color: var(--accent-contrast); }

#content { flex: 1; min-width: 0; padding: 2rem 2.5rem; max-width: 780px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.module h2, .grammar-index h1 { margin-top: 0; }
.grammar-index h2 { margin: var(--sp-5) 0 var(--sp-2); font-size: var(--fs-lg); }
.grammar-note {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.grammar-note p { margin: 0.6rem 0; }
.grammar-note p:first-child { margin-top: 0; }

.progress-bar {
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 1.5rem; font-size: 0.9rem; }

.toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.toc:empty { display: none; }
.toc ul { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.toc a { color: var(--accent); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.exercise-set { margin-bottom: 2rem; }
.exercise-set h3 { border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.set-verbs { margin: 0.3rem 0 0.8rem; }

.item {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.item-num { color: var(--muted); min-width: 1.5rem; }
.item-body { flex: 1; }
.item.correct .item-body { }
.item.incorrect .item-body { }
.feedback { margin-top: 0.4rem; font-size: 0.9rem; min-height: 1.2em; }
.item.correct .feedback { color: var(--correct); }
.item.incorrect .feedback { color: var(--incorrect); }

.prompt-en { margin: 0 0 0.4rem; }
.prompt-nl { margin: 0 0 0.5rem; font-size: 1.05rem; }

input[type="text"], textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
}
.blank-input { min-width: 10em; }
.full-sentence-input { width: 100%; margin-bottom: 0.3rem; }
textarea { width: 100%; resize: vertical; }
.answer-input.correct { border-color: var(--correct); background: var(--correct-bg); }
.answer-input.incorrect { border-color: var(--incorrect); background: var(--incorrect-bg); }

.mc-blank {
  display: inline-block;
  min-width: 4em;
  border-bottom: 2px dotted var(--muted);
  text-align: center;
}
.mc-options, .es-sentences { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0; align-items: flex-start; }
.mc-option, .es-option {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  text-align: left;
  margin: 0;
  padding: 0.4rem 0.7rem;
  width: 100%;
}
.es-option { white-space: normal; }
.mc-option:hover, .es-option:hover { border-color: var(--accent); }
.mc-option.correct, .es-option.correct { border-color: var(--correct); background: var(--correct-bg); color: var(--correct); }
.mc-option.incorrect, .es-option.incorrect { border-color: var(--incorrect); background: var(--incorrect-bg); color: var(--incorrect); }

.multiblank-passage { line-height: 2.2; }
.multiblank-passage .blank-input { min-width: 7em; margin: 0 0.2rem; }

.item-from { margin: 0 0 0.3rem; font-style: italic; }

.picker-list { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; margin-top: 1rem; }
.picker-list button { margin: 0; }

.session-toolbar { margin-bottom: 1rem; }

.topic-source-label {
  margin: 1.5rem 0 0.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.topic-source-label:first-child { border-top: none; padding-top: 0; margin-top: 0; }

button {
  font: inherit;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  margin-top: 0.4rem;
  margin-right: 0.4rem;
}
button:hover { opacity: 0.9; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 2.4rem; margin-bottom: 0.4rem; }
.chip {
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  margin: 0;
}
.chip.placed { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

.reveal { margin-top: 0.6rem; padding: 0.6rem 0.8rem; background: var(--chip-bg); border-radius: 8px; }
.self-mark { margin-top: 0.4rem; }

.answer-key { display: none; }

.freq-pos-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.freq-pos-chip {
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  margin: 0;
  font-size: 0.85rem;
  cursor: pointer;
}
.freq-pos-chip.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

.freq-lang-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.75rem; }
.freq-lang-chip {
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.35rem 1rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.freq-lang-chip.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

.freq-filter { width: 100%; margin: 0 0 1rem; }
.freq-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.freq-table td { padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; } /* T-089: no sideways scroll at 360 px, 200 % text */
.freq-rank { color: var(--muted); text-align: right; width: 3.5em; font-variant-numeric: tabular-nums; }
.freq-table tr { cursor: pointer; }
.freq-table tr:hover td { background: var(--chip-bg); }

.freq-line-primary { font-weight: 500; }
.freq-line-secondary {
  display: none;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85em;
  margin-top: 0.15rem;
}
.freq-table tr.revealed .freq-line-secondary { display: block; animation: freq-reveal 0.15s ease; }
@keyframes freq-reveal {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}
.freq-conjugated-form { color: var(--muted); font-weight: 400; font-size: 0.85em; }


/* Woordenboek (data from ~/projects/dutch-lexicon) */
.lex-search { width: 100%; margin: 0 0 0.5rem; font-size: 1.05rem; }
.lex-results { list-style: none; margin: 0 0 1rem; padding: 0; }
.lex-results li[data-word] {
  display: flex; gap: 0.75rem; align-items: baseline;
  padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); cursor: pointer;
}
.lex-results li[data-word]:hover { background: var(--chip-bg); }
.lex-result-word { font-weight: 500; white-space: nowrap; }
.lex-result-gloss { color: var(--muted); font-size: 0.9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lex-none { padding: 0.4rem 0.6rem; }
.lex-entry {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.2rem; margin: 0 0 1rem;
}
.lex-headword { margin: 0 0 0.4rem; font-size: 1.5rem; }
.lex-article { color: var(--muted); font-weight: 400; }
.lex-entry h4 {
  margin: 1rem 0 0.3rem; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted);
}
.lex-senses { margin: 0.4rem 0 0; padding-left: 1.3rem; }
.lex-senses li { margin-bottom: 0.6rem; }
.lex-pos {
  font-size: 0.75rem; color: var(--muted); border: 1px solid var(--chip-border);
  border-radius: 999px; padding: 0.05rem 0.5rem; margin-right: 0.5rem;
}
.lex-gloss { font-weight: 600; }
.lex-def-nl { margin: 0.25rem 0 0; }
.lex-def-en { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.92em; }
.lex-form-note { margin: 0; }
.lex-link { color: var(--accent); }
/* A page's quiet link to a related page, and the lesson list on #grammar. */
.page-link, .grammar-list a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--accent); }
.grammar-list { list-style: none; margin: 0; padding: 0; }
.grammar-list a { display: flex; }
.lex-uncertain {
  margin-left: 0.5rem; text-transform: none; letter-spacing: 0; font-weight: 500;
  color: var(--incorrect); background: var(--incorrect-bg); border-radius: 999px; padding: 0.05rem 0.5rem;
}
.lex-cognates { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.lex-cognate { margin-bottom: 0.3rem; }
.lex-cognate-word { font-weight: 600; margin-right: 0.5rem; }
.lex-relation {
  font-size: 0.75rem; border-radius: 999px; padding: 0.05rem 0.5rem; margin-right: 0.5rem;
  background: var(--correct-bg); color: var(--correct);
}
.lex-loanword .lex-relation { background: var(--chip-bg); color: var(--muted); }
.lex-false_friend .lex-relation { background: var(--incorrect-bg); color: var(--incorrect); }
.lex-cognate-note { color: var(--muted); font-size: 0.92em; }

.freq-lex { margin-top: 0.35rem; font-size: 0.85em; font-weight: 400; }
.freq-table tr:not(.revealed) .freq-lex { display: none; }
.freq-lex-etym { color: var(--muted); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(85vw, 320px);
    z-index: 25;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    padding-top: 4.5rem;
  }
  /* Closed drawer: also hidden from TalkBack and the Tab order, not just moved off-screen. */
  #sidebar { visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s; }
  body.sidebar-open #sidebar { transform: translateX(0); visibility: visible; transition: transform 0.2s ease, visibility 0s; }
  body.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 20;
  }
  body.sidebar-open { overflow: hidden; }

  #content {
    max-width: none;
    padding: 4.5rem 1rem 2rem;
  }

  .item { flex-direction: column; gap: 0.3rem; }
  .item-num { min-width: auto; font-weight: 600; }

  button, input[type="text"], textarea { font-size: max(16px, 1rem); }
  button { min-height: 2.75rem; padding: 0.5rem 0.9rem; }
  .nav-level a { padding: 0.6rem 0.5rem; }
  .chip { min-height: 2.5rem; display: inline-flex; align-items: center; }

  .filter-row { gap: 0.75rem 1.25rem; }
  .multiblank-passage { line-height: 2.6; }
}

@media print {
  #sidebar, .filter-row, .toc, .progress-bar, button, input, textarea { display: none !important; }
  .item { border: none; page-break-inside: avoid; }
  .chip-row.pool::before { content: "Word bank: "; }
  .chip-row.pool .chip { display: inline; background: none; border: none; padding: 0; margin-right: 0.3rem; }
  .chip-row.built { display: none; }
  #content { max-width: none; }
  .answer-key {
    display: block !important;
    margin-top: 3rem;
    border-top: 2px solid #000;
    padding-top: 1rem;
    page-break-before: always;
  }
  .answer-key-entry { margin: 0.3rem 0; }
}

/* ── Today's session (2026-11-12) ─────────────────────────────────────────── */
.today-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.today-head h2 { margin-bottom: 0.25rem; }
.today-streak {
  font-size: 0.85rem; font-weight: 600; color: var(--accent);
  background: var(--chip-bg); border: 1px solid var(--chip-border);
  border-radius: 999px; padding: 0.15rem 0.7rem;
}
.today-progress { height: 8px; background: var(--chip-bg); border-radius: 999px; overflow: hidden; margin-top: 0.5rem; }
.today-progress-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.3s ease; }
.today-progress-label { margin: 0.35rem 0 1.25rem; }
.today-section-head { margin: 1.5rem 0 0.5rem; }

.wotd-card {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 10px;
  padding: 1rem 1.25rem; margin-bottom: 0.5rem;
}
.wotd-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.wotd-word { font-size: 1.6rem; margin: 0.15rem 0 0.25rem; }
.wotd-gloss { font-weight: 600; margin: 0 0 0.5rem; }
.wotd-etym { margin: 0.5rem 0; }
.wotd-rel, .wotd-links { margin: 0.4rem 0 0; }
.wotd-history { margin-top: 0.75rem; font-size: 0.9rem; }
.wotd-history ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }

.vocab-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem; }
.vocab-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.vocab-card.knew { border-color: var(--correct); }
.vocab-card.missed { border-color: var(--incorrect); }
.vocab-front {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; width: 100%;
  background: none; border: none; color: var(--text); text-align: left;
  padding: 0.7rem 0.9rem; font: inherit; cursor: pointer; min-height: 44px;
}
.vocab-word { font-weight: 700; font-size: 1.05rem; }
.vocab-pos { margin-left: auto; font-size: 0.75rem; color: var(--muted); }
.vocab-back { display: none; padding: 0 0.9rem 0.75rem; font-size: 0.9rem; }
.vocab-card.open .vocab-back { display: block; }
.vocab-translation { font-weight: 600; margin-bottom: 0.3rem; }
.vocab-rate { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.vocab-rate button { flex: 1; }
.vocab-card.rated .vocab-rate { opacity: 0.55; }
.vocab-card.knew .vocab-knew { outline: 2px solid var(--correct); }
.vocab-card.missed .vocab-missed { outline: 2px solid var(--incorrect); }

.today-exercises { margin-top: 1.5rem; }
.item-body button { min-height: 44px; min-width: 44px; } /* touch target (list and module pages) */
.today-done {
  background: var(--correct-bg); border: 1px solid var(--correct);
  border-radius: 10px; padding: 1rem 1.25rem; margin-top: 1.5rem;
}
.today-done h3, .words .today-done h2 { margin-top: 0; color: var(--correct); }
.today-done .session-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 0.5rem 0 0; }
.button-link { font-weight: 600; }

/* ── Woorden: vocabulary review (2026-11-13) ──────────────────────────────── */
.vocab-summary {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.85rem 1.1rem; margin-top: 0.75rem; color: var(--text); text-decoration: none;
}
.vocab-summary:hover { border-color: var(--accent); }
.vocab-summary-title { font-weight: 700; }
.vocab-summary-text { color: var(--muted); }
.vocab-summary-go { margin-left: auto; color: var(--accent); font-weight: 600; }

.words-stats { margin: 0 0 0.25rem; }
.words-stage { margin-top: 1.25rem; max-width: 560px; }
.wcard {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.25rem 1.25rem 1.5rem; min-height: 220px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.wcard-coach { margin: var(--sp-3) 0 0; }
.wcard-tags { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); min-height: 1em; margin-bottom: 0.75rem; }
.wcard-dutch { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.wcard-word { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.wcard-english { font-size: 1.25rem; font-weight: 600; }
.wcard.reverse > .wcard-english { font-size: 1.5rem; }
.wcard-back { display: none; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.wcard.flipped { cursor: default; }
.wcard.flipped .wcard-back { display: block; }
.wcard-extra { text-align: left; font-size: 0.9rem; margin-top: 0.75rem; }
.wcard-extra p { margin: 0.4rem 0; }
.wcard-show { width: 100%; margin-bottom: 0.75rem; min-height: 48px; font-size: 1rem; }
.wcard-rate { display: none; gap: 0.75rem; margin-bottom: 0.75rem; }
.wcard-rate.shown { display: flex; }
.wcard-rate button { flex: 1; min-height: 52px; font-size: 1.05rem; font-weight: 600; margin: 0; background: var(--bg-alt); border: 2px solid; }
.wcard-rate .vocab-missed { color: var(--incorrect); border-color: var(--incorrect); background: var(--incorrect-bg); }
.wcard-rate .vocab-knew { color: var(--correct); border-color: var(--correct); background: var(--correct-bg); }
.wcard-show { margin-right: 0; }

.lex-learn-row { margin: 1rem 0 0; }
.lex-learn.active { background: var(--correct-bg); color: var(--correct); }

/* ── Backend-driven pages: sync, Schrijven, Lezen, Luisteren, size test (2026-11-13) ── */
.sync-status { font-size: 0.75rem; color: var(--muted); padding: 0.5rem 1rem 1rem; }
.sync-status.off { color: var(--incorrect); }
.today-setting { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); margin: 1rem 0 0; cursor: pointer; }
.today-setting input { margin: 0; }
/* Later (t80) */
.wcard-later { width: 100%; margin: 0 0 0.75rem; min-height: 48px; }
.later-notice, .later-sweep { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
/* the empty status line stays in the tree (zero size): a live region added together with its text is often not read */
.later-sweep:empty, .later-notice:has(> span:empty):not(:has(button)) { margin: 0; }
.later-notice button, .later-sweep button, .later-undo-all, .later-undo { min-height: 44px; min-width: 44px; margin: 0; }
.later-list { list-style: none; padding: 0; margin: 1rem 0; max-width: 560px; }
.later-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--border); }
.later-text { display: flex; flex-direction: column; min-width: 0; }
.later-word { font-weight: 600; overflow-wrap: anywhere; min-height: 44px; display: flex; align-items: center; }
.words-later-link { display: inline-flex; align-items: center; min-height: 44px; }

.study { max-width: 720px; }
.study-intro { margin-top: 0; }
.study-error { color: var(--incorrect); background: var(--incorrect-bg); border: 1px solid var(--incorrect); border-radius: 8px; padding: 0.6rem 0.9rem; }
.study h3 { margin: 1.75rem 0 0.5rem; }
.link-button { background: none; color: var(--accent); padding: 0; margin: 0; min-height: 0 !important; text-decoration: underline; border-radius: 0; }
.link-button.danger { color: var(--incorrect); }
.study-list { list-style: none; margin: 0; padding: 0; }
.study-list li {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.7rem 0; border-bottom: 1px solid var(--border);
}
.study-list li > a { display: flex; flex-direction: column; flex: 1 1 16rem; min-width: 0; color: var(--text); text-decoration: none; }
.study-list li > a:hover .study-list-title { color: var(--accent); }
.study-list-title { font-weight: 600; }
.study-list-sub { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-list-sub.new { color: var(--accent); font-weight: 600; }
.study-list-sub.done { color: var(--correct); }
.study-list-meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.study-list-meta.pending { color: var(--accent); }
/* Lezen / Luisteren first screen: one "now" card, then quiet lines and folded extras. */
.now-card { padding: var(--sp-4); margin: 0 0 var(--sp-4); overflow-wrap: anywhere; }
.now-card h3 { margin: 0; }
.now-card p { margin: var(--sp-1) 0 var(--sp-3); }
.now-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.clip-dictee { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); }
.study-list.taps li { padding: var(--sp-1) 0; }
.study-list.taps li > a { position: relative; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: var(--sp-3); min-height: var(--tap); overflow-wrap: anywhere; }
.study-list.taps .study-list-title { flex: 1 1 12rem; min-width: 0; }
.quiet-more > summary { cursor: pointer; color: var(--accent); min-height: var(--tap); padding: var(--sp-3) 0; box-sizing: border-box; }

/* tap a word */
.tap-word { cursor: pointer; border-radius: 3px; }
.tap-word:hover { background: var(--chip-bg); }
.tap-word.tapped { background: var(--accent); color: var(--accent-contrast); }
.word-sheet-backdrop { position: fixed; inset: 0; z-index: 40; }
.word-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 640px; margin: 0 auto; max-height: 60vh; overflow-y: auto;
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border); border-bottom: none; border-radius: 14px 14px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.25);
  padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
}
.word-sheet { overscroll-behavior: contain; touch-action: pan-y; }
.word-sheet-grip { width: 2.5rem; height: 4px; border-radius: 2px; background: var(--border); margin: -0.4rem auto 0.6rem; }
.word-sheet-close {
  position: absolute; top: 0.4rem; right: 0.5rem; margin: 0;
  background: none; color: var(--muted); font-size: 1.5rem; line-height: 1; padding: 0.25rem 0.6rem;
}
.word-sheet .lex-headword { margin: 0 2rem 0.25rem 0; }
.word-sheet-alt { margin: 0.2rem 0 0.5rem; color: var(--muted); }
.word-sheet-reading { font-size: inherit; }
.word-sheet-back { display: block; margin: 0 2.5rem 0.5rem 0 !important; font-size: 0.9rem; text-decoration: none; }
.lex-def-nl .tap-word, .lex-example .tap-word, .lex-collocations .tap-word { cursor: pointer; }
.lex-def-nl .tap-word:hover, .lex-example .tap-word:hover, .lex-collocations .tap-word:hover { text-decoration: underline dotted; }
.word-sheet .lex-senses { margin: 0.5rem 0; padding-left: 1.25rem; }
.word-sheet-more { margin: 0.75rem 0 0; }
.word-sheet-sentence { margin-top: 0.9rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.lex-examples { margin: 0.5rem 0; }
.lex-example { margin: 0.4rem 0; padding-left: 0.75rem; border-left: 3px solid var(--chip-border); }
.lex-example .ex-nl { display: block; font-style: italic; }
.lex-example .ex-en { display: block; color: var(--muted); font-size: 0.9em; }
.lex-collocations { font-size: 0.9rem; color: var(--muted); }

/* Schrijven */
.writing-prompt { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; padding: 0.85rem 1.1rem; margin: 1rem 0; }
.writing-prompt .wotd-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.writing-prompt-text { font-size: 1.1rem; font-weight: 600; margin: 0.35rem 0 0.5rem; }
.writing-prompt p:last-child { margin-bottom: 0; }
.writing-area {
  width: 100%; box-sizing: border-box; font: inherit; line-height: 1.6;
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 0.9rem; resize: vertical;
}
.writing-area:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.writing-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.4rem; }
.writing-bar button { margin: 0; min-height: 44px; padding: 0.5rem 1.25rem; font-weight: 600; }
.writing-bar button:disabled, .listen-buttons button:disabled { opacity: 0.45; cursor: default; }
.writing-count.on-target { color: var(--correct); }
.writing-waiting { background: var(--bg-alt); border: 1px solid var(--accent); border-radius: 10px; padding: 0.85rem 1.1rem; margin: 1rem 0; }
.writing-waiting p { margin: 0.35rem 0 0; }
.writing-summary { display: flex; gap: 1rem; align-items: flex-start; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; padding: 0.85rem 1.1rem; margin: 1rem 0; }
.writing-summary p { margin: 0; }
.writing-level { font-size: 1.5rem; font-weight: 700; color: var(--accent); white-space: nowrap; }
.writing-text { white-space: pre-wrap; line-height: 1.7; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 0.9rem; }
.writing-text.corrected { border-color: var(--correct); }
.writing-err { background: var(--incorrect-bg); color: inherit; text-decoration: underline wavy var(--incorrect); text-underline-offset: 3px; border-radius: 3px; }
.writing-err sup { color: var(--incorrect); font-weight: 700; margin-left: 1px; text-decoration: none; display: inline-block; }
.writing-errors { padding-left: 1.5rem; }
.writing-errors li { margin: 0 0 0.9rem; padding: 0.15rem 0.35rem; border-radius: 6px; transition: background 0.4s; }
.writing-errors li.flash { background: var(--chip-bg); }
.writing-errors.upgrades { list-style: none; padding-left: 0; }
.err-old { color: var(--incorrect); text-decoration: line-through; }
.err-new { color: var(--correct); font-weight: 600; }
.err-plain { color: var(--muted); }
.err-cat { margin-left: 0.6rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border: 1px solid var(--chip-border); background: var(--chip-bg); border-radius: 999px; padding: 0.05rem 0.5rem; white-space: nowrap; }
.writing-clean { color: var(--correct); font-weight: 600; }
.writing-drills { background: var(--correct-bg); border: 1px solid var(--correct); border-radius: 10px; padding: 0.75rem 1rem; margin-top: 1.5rem; }

/* Lezen */
.reading-book { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 1rem; margin: 0.75rem 0; }
.reading-book summary { cursor: pointer; font-weight: 600; }
.reading-paste .writing-area { background: var(--bg); margin-top: 0.5rem; }
.reading-title { width: 100%; box-sizing: border-box; margin-top: 0.6rem; min-height: var(--tap); }
.reading-paste button, .reading-book summary { min-height: var(--tap); }
.reading-chapters { margin: 0.5rem 0; padding-left: 2rem; }
.reading-chapters li { margin: 0.3rem 0; }
.reader { font-size: 1.1rem; line-height: 1.8; }
.reader-para { margin: 0 0 1.1rem; }

/* Luisteren */
.listen-controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.listen-controls button { margin: 0; min-height: 44px; }
.listen-play { padding: 0.5rem 1.4rem; font-weight: 600; }
.listen-slow { background: var(--bg-alt); color: var(--text); border: 1px solid var(--border); }
.listen-slow.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.listen-buttons button { min-height: 44px; padding: 0.5rem 1.25rem; font-weight: 600; }
.listen-gaps { font-size: 1.1rem; line-height: 2.4; }
.gap-input { width: auto; display: inline-block; margin: 0 0.15rem; padding: 0.2rem 0.4rem; }
.gap-input.correct { border-color: var(--correct); background: var(--correct-bg); }
.gap-input.incorrect { border-color: var(--incorrect); background: var(--incorrect-bg); }
.listen-score { font-weight: 700; margin: 1rem 0 0.25rem; }
.listen-answer { font-size: 1.1rem; line-height: 1.7; margin: 0.25rem 0; }
.listen-answer .heard { color: var(--correct); }
.listen-answer .missed { color: var(--incorrect); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.listen-answer .tapped, .listen-line .tapped { color: var(--accent-contrast); }
.listen-line { display: flex; gap: 0.6rem; align-items: baseline; margin: 0.5rem 0; line-height: 1.6; }
.listen-mini { margin: 0; padding: 0.15rem 0.55rem; min-height: 0 !important; background: var(--bg-alt); color: var(--accent); border: 1px solid var(--border); flex: none; }

/* size test */
.vocab-test-table { border-collapse: collapse; margin: 1rem 0; }
.vocab-test-table th, .vocab-test-table td { text-align: left; padding: 0.3rem 1.5rem 0.3rem 0; border-bottom: 1px solid var(--border); }
.writing-scores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 0.5rem 0; }
.writing-score { display: flex; flex-direction: column; align-items: center; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 0.25rem; }
.writing-score strong { font-size: 1.15rem; color: var(--accent); }
.writing-reason { margin: 0.25rem 0 0.75rem; }
.writing-level-tabs { display: flex; gap: 0.4rem; margin: 0.5rem 0; }
.writing-level-tab { margin: 0; min-height: 40px; padding: 0.35rem 1.1rem; background: var(--bg-alt); color: var(--text); border: 1px solid var(--border); font-weight: 600; }
.writing-level-tab[aria-selected="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.writing-rewrite-notes { margin: 0.5rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.9rem; }

/* ── Raat: hex word game (2026-11-16) ─────────────────────────────────────── */
.raat-page h2 { margin-bottom: 0.25rem; }
.raat-intro { margin: 0 0 0.5rem; }
.raat-stats { font-size: 0.9rem; color: var(--muted); }
.raat-current {
  min-height: 2.2rem; margin: 0.4rem 0 0.2rem; text-align: center;
  font-size: 1.3rem; font-weight: 700; letter-spacing: 0.08em;
}
.raat-current.target { color: var(--correct); font-size: 1rem; letter-spacing: 0; }
.raat-current.bonus { color: var(--accent); font-size: 1rem; letter-spacing: 0; }
.raat-current.miss, .raat-current.same { color: var(--muted); font-size: 1rem; letter-spacing: 0; }
.raat-board-wrap { display: flex; justify-content: center; }
.raat-board {
  width: 100%; max-width: 420px; touch-action: none; user-select: none;
  -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer;
}
.raat-cell polygon { fill: var(--bg-alt); stroke: var(--chip-border); stroke-width: 0.05; }
/* Letters are placed by raatCentreLetters (measured glyph box), so nothing inherited may
   move them: "Easier reading" spacing on body reaches SVG text as 0.8px = 0.8 board units. */
.raat-letters text {
  fill: var(--text); font-size: 0.85px; font-weight: 700; text-anchor: start;
  letter-spacing: 0; word-spacing: 0; pointer-events: none; font-family: inherit;
}
.raat-cell.sel polygon { fill: var(--accent); stroke: var(--accent); }
.raat-letters text.sel { fill: var(--accent-contrast); }
.raat-cell.hint polygon { fill: var(--correct-bg); stroke: var(--correct); }
.raat-line { fill: none; stroke: var(--accent); stroke-width: 0.22; stroke-linecap: round; stroke-linejoin: round; opacity: 0.35; pointer-events: none; }
.raat-line.hint { stroke: var(--correct); }
.raat-actions { display: flex; justify-content: flex-end; margin: 0.25rem 0 0.5rem; }
.raat-clues, .raat-bonus { list-style: none; padding: 0; margin: 0.5rem 0; }
.raat-clues li {
  display: flex; align-items: baseline; gap: 0.5rem;
  padding: 0.45rem 0; border-bottom: 1px solid var(--border);
}
.raat-tick { flex: 0 0 1.1rem; font-weight: 700; color: var(--correct); }
.raat-clues li.missed .raat-tick, .raat-clues li.missed .raat-answer .tap-word { color: var(--incorrect); }
.raat-clue-text { flex: 1; }
.raat-clues li.got .raat-clue-text > strong { color: var(--muted); font-weight: 600; }
.raat-answer .tap-word { font-weight: 700; color: var(--correct); }
.raat-hint { flex: 0 0 auto; font-size: 0.9rem; }
.raat-tag {
  margin-left: 0.4rem; font-size: 0.75rem; padding: 0.05rem 0.4rem; border-radius: 999px;
  background: var(--chip-bg); border: 1px solid var(--chip-border); color: var(--muted);
}
.raat-bonus li { padding: 0.2rem 0; }
.raat-bonus .tap-word { font-weight: 700; }

/* today's goals, read marks, stats (activity.js) */
.today-goals-label { margin: 0.25rem 0 0.4rem; }
.today-goals { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(9.5rem, 100%), 1fr)); gap: 0.4rem; }
.today-goals a { display: flex; align-items: baseline; gap: 0.4rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; }
.today-goals a:hover { border-color: var(--accent); }
.today-goal-mark { width: 1rem; flex: none; color: var(--accent); font-weight: 700; }
.today-goal-label { font-weight: 600; }
.today-goal-text { margin-left: auto; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.today-goals li.done a { border-color: var(--accent); background: var(--chip-bg); }
.reader-read { margin: 1.5rem 0 0.5rem; }
.reader-read-done { color: var(--accent); font-weight: 600; }
.study-list-meta.done { color: var(--accent); }
.stats-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.5rem; margin: 0.75rem 0 1.25rem; }
.stats-card { border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.75rem; display: flex; flex-direction: column; }
.stats-value { font-size: 1.5rem; font-weight: 700; }
.stats-label { color: var(--muted); font-size: 0.85rem; }
.stats-table-wrap { overflow-x: auto; }
.stats-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: 0.3rem 0.4rem; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.stats-table th:first-child, .stats-table tbody th { text-align: left; font-weight: 500; }
.stats-table tr.stats-empty { color: var(--muted); }
.stats-all { padding-left: 1.25rem; }

/* answer diff + Claude's comment on a wrong answer */
.answer-diff-box { margin-top: 0.4rem; color: var(--text); }
.answer-diff { margin: 0.2rem 0; }
.diff-wrong { text-decoration: line-through; text-decoration-color: #c0392b; background: rgba(192, 57, 43, 0.15); border-radius: 3px; padding: 0 2px; }
.diff-missing { color: #c0392b; font-weight: 700; }
.answer-fixes { margin: 0.1rem 0; font-weight: 600; color: var(--text); }
.claude-note { margin-top: 0.5rem; padding: 0.5rem 0.75rem; border-left: 3px solid var(--accent); background: var(--chip-bg); border-radius: 0 8px 8px 0; color: var(--text); }
.claude-note p { margin: 0.25rem 0; }
.claude-note.pending { animation: claude-pulse 1.4s ease-in-out infinite; }
/* only the border pulses: fading the text broke 4.5:1 contrast mid-pulse (t107) */
@keyframes claude-pulse { 50% { border-left-color: transparent; } }
.claude-verdict { font-weight: 700; }
.claude-count { margin-top: 0.35rem; }
.claude-counted { color: var(--accent); font-weight: 600; }
/* a word tapped in plain page text (study.js wordAtPoint) */
::highlight(lookup) { background-color: var(--accent); color: var(--accent-contrast); }
#content p, #content li, #content td { -webkit-tap-highlight-color: transparent; }
.today-level { display: block; margin-top: 0.35rem; }
.today-level select { font: inherit; color: var(--text); background: var(--bg-alt); border: 1px solid var(--border); border-radius: 6px; padding: 0.15rem 0.3rem; }

/* Zeggen (zeggen.js): the field, the newest answer, older sentences as one line each;
   role-plays and weak spots beside them on wide screens. */
.say-columns { display: flex; flex-direction: column; gap: var(--sp-5); }
.say-main, .say-side { min-width: 0; }
@media (min-width: 1300px) {
  #content:has(.say-page) { max-width: 76rem; }
  .study.say-page { max-width: none; }
  .say-columns { display: grid; grid-template-columns: minmax(0, 44rem) minmax(0, 24rem); gap: var(--sp-6); align-items: start; }
  .say-page .say-side > div:first-child > h3 { margin-top: 0; }
}
.say-page .today-head { margin-bottom: var(--sp-4); }
.say-compose { margin: 0.75rem 0 1rem; }
.say-compose .say-input { width: 100%; box-sizing: border-box; }
.say-page .say-compose { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: min(var(--sp-4), 4.5vw); margin-top: 0; }
.say-field-label { display: block; font-weight: 700; margin-bottom: var(--sp-2); }
.say-page .say-input { background: var(--bg); border-color: var(--border-strong); font-size: var(--fs-lg); }
.say-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-2); }
.say-hint { flex: 1 1 12em; }
.say-send { min-height: var(--tap); }
.say-bar .say-send { margin: 0 0 0 auto; padding-inline: min(var(--sp-5), 6vw); max-width: 100%; }
.say-note { display: block; color: var(--incorrect); }
.say-note:empty { display: none; }
.say-wall .cap-wall { margin-top: 0; }
.say-wall .button-link, .say-wall .cap-wall-again { min-height: var(--tap); text-align: center; }
.say-page.walled .say-empty { display: none; } /* "try a sentence" under a closed box */
.say-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3) min(var(--sp-4), 4.5vw); margin: 0 0 var(--sp-3); overflow-wrap: anywhere; }
.say-page .say-card p { margin: 0 0 var(--sp-3); }
.say-card p { margin: 0 0 var(--sp-2); }
.say-label { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.say-label .t-sub { margin-left: 0.25em; }
.say-mine .diff-wrong { text-decoration-color: var(--incorrect); background: var(--incorrect-bg); }
.say-corrected { font-size: var(--fs-xl); font-weight: 600; line-height: 1.4; }
.say-good { font-size: var(--fs-lg); font-weight: 700; color: var(--correct); }
.say-natural { font-size: var(--fs-lg); }
.say-failed { color: var(--incorrect); }
.say-mistakes { list-style: none; padding: 0; margin: 0 0 var(--sp-3); }
.say-card ul.say-mistakes li { margin: 0 0 var(--sp-2); padding: var(--sp-2) var(--sp-3); background: var(--surface-2); border-radius: var(--r-sm); }
.say-why { font-size: var(--fs-sm); }
.say-mistakes .lex-link { display: inline-flex; align-items: center; min-height: var(--tap); }
.say-page .say-card ul.say-mistakes li:has(.lex-link) { padding-bottom: 0; }
.say-fix s { color: var(--incorrect); }
.say-cat { color: var(--muted); font-size: var(--fs-xs); }
.say-new { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: 0 0 var(--sp-3); }
.say-new .say-label { flex-basis: 100%; }
/* one primary action per page: word chips and Role-play are secondary */
.say-word, .say-card .say-scenario { min-height: var(--tap); margin: 0; font-size: var(--fs-sm); background: var(--bg-alt); color: var(--accent); border: 1px solid var(--border-strong); }
.say-word.active { background: var(--accent-soft); border-color: var(--accent); }
.say-comment { color: var(--muted); font-style: italic; }
/* history: one line each */
.say-history h3, .say-page .say-scenes h3 { font-size: var(--fs-md); margin: var(--sp-5) 0 var(--sp-2); }
.say-history { container-type: inline-size; }
.say-page .say-rows { list-style: none; margin: 0; padding: 0; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--r-md); }
.say-page ul.say-rows > li { margin: 0; border-bottom: 1px solid var(--border); }
.say-page ul.say-rows > li:last-child { border-bottom: 0; }
.say-row { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-2); width: 100%; min-height: var(--tap);
  margin: 0; padding: var(--sp-2) var(--sp-3); background: none; color: var(--text); border: 0; border-radius: 0; text-align: left; font-weight: 400; }
.say-row:hover { background: var(--surface-2); }
.say-row:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.say-row:active { transform: none; }
.say-mark { grid-column: 1; font-weight: 700; text-align: center; color: var(--accent); }
.say-mark[data-state="correct"] { color: var(--correct); }
.say-mark[data-state="failed"] { color: var(--incorrect); }
.say-row-text { grid-column: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.say-row-date { grid-column: 3; font-size: var(--fs-xs); white-space: nowrap; }
.say-row[aria-expanded="true"] { background: var(--surface-2); }
.say-row[aria-expanded="true"] .say-row-text { white-space: normal; overflow-wrap: anywhere; font-weight: 600; }
/* large text on a phone: the date moves under the sentence */
@container (max-width: 20em) {
  .say-row { grid-template-columns: 1.25rem minmax(0, 1fr); }
  .say-row-date { grid-column: 2; }
}
.say-panel .say-card { border: 0; border-radius: 0; box-shadow: none; background: none; margin: 0; }
.say-panel .say-mine.plain { display: none; } /* the open row already shows the whole sentence */
.say-page ul.study-list li { margin: 0; padding: 0; }
.say-page .study-list li > a { min-height: var(--tap); justify-content: center; padding: var(--sp-2) 0; flex-basis: min(16rem, 100%); overflow-wrap: anywhere; }
.say-page .study-list-meta { white-space: normal; overflow-wrap: anywhere; }
.say-weak summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 700; margin-top: var(--sp-3); }
.say-weak-list { padding-left: 1.1rem; }
.today-focus { margin: 0.35rem 0 0; }
/* Zeggen scenarios */
.say-actions { margin: 0.5rem 0 0; }
.say-scenario { font-size: 0.9rem; padding: 0.3rem 0.75rem; margin: 0; min-height: var(--tap); }
.say-setting { border-left: 3px solid var(--accent); padding: 0.1rem 0.75rem; margin: 0.5rem 0 1rem; }
.say-setting p { margin: 0.3rem 0; }
.say-partner { margin: 0 2.5rem 0.75rem 0; padding: 0.55rem 0.8rem; background: var(--chip-bg); border-radius: 12px 12px 12px 3px; }
.say-partner-name { display: block; font-size: 0.75rem; font-weight: 700; color: var(--accent); }
.say-partner-text { font-size: 1.1rem; }
.say-en-toggle { margin-left: 0.4rem; font-size: 0.8rem; }
.say-partner-en { display: block; margin-top: 0.2rem; }
.say-turn { margin-left: 2.5rem; border-radius: 12px 12px 3px 12px; }
.say-reply { position: sticky; bottom: 0; background: var(--bg); padding: 0.5rem 0; margin-bottom: 0; }
.say-stop { font-size: 0.9rem; }
.say-ended { border-top: 1px solid var(--border); margin-top: 1rem; }
@media (max-width: 720px) { .say-partner { margin-right: 1rem; } .say-turn { margin-left: 1rem; } }
.say-partner-en[hidden] { display: none; }

/* Mijn niveau (#niveau) */
.lvl-hero { display: flex; gap: 1rem; align-items: center; margin: 0.5rem 0 0.75rem; }
.lvl-badge { flex: none; width: 5.5rem; height: 5.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; background: var(--accent); color: var(--accent-contrast); }
.lvl-hero-text { flex: 1; min-width: 0; }
.lvl-headline { font-weight: 600; margin: 0 0 0.5rem; }
.lvl-scale { display: flex; gap: 3px; }
.lvl-step { flex: 1; text-align: center; font-size: 0.75rem; padding: 0.2rem 0; border-radius: 4px; color: var(--muted);
  background: var(--bg-alt); border: 1px solid var(--border); }
.lvl-step.done { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); opacity: 0.55; }
.lvl-step.current { opacity: 1; font-weight: 700; }
.lvl-step.half { background: linear-gradient(90deg, var(--accent) 50%, var(--bg-alt) 50%); border-color: var(--accent); }
.lvl-summary, .lvl-change { margin: 0.5rem 0; }
.lvl-focus { padding-left: 1.4rem; }
.lvl-focus-item { margin: 0 0 0.9rem; }
.lvl-focus-item p { margin: 0.2rem 0; }
.lvl-focus-title { font-weight: 700; }
.lvl-go { display: inline-block; margin-top: 0.2rem; font-weight: 600; }
.lvl-skills { list-style: none; padding: 0; }
.lvl-skill { border: 1px solid var(--border); border-radius: 10px; padding: 0.5rem 0.75rem; margin: 0 0 0.5rem; }
.lvl-skill p { margin: 0.3rem 0 0; }
.lvl-skill-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; }
.lvl-chip { font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 6px; background: var(--accent); color: var(--accent-contrast); }
.lvl-chip.unknown { background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border); }
.lvl-list { padding-left: 1.2rem; }
.lvl-list li { margin: 0.2rem 0; }
.lvl-gaps { margin: 0.75rem 0; }
.lvl-gaps summary { cursor: pointer; color: var(--muted); }
.lvl-foot { margin-top: 1.25rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.lvl-pending { display: flex; align-items: center; gap: 0.5rem; }
.spinner { flex: none; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.today-mylevel { margin: 0.25rem 0 0; }
@media print { .lvl-foot button { display: none; } }

/* Inburgering (#inburgering): practice tests in the DUO computer-exam format */
.ib .secondary { background: var(--chip-bg); color: var(--text); border: 1px solid var(--chip-border); }
.ib-tests { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: 0.6rem; margin: 1rem 0; }
.ib-card { display: flex; flex-direction: column; gap: 0.2rem; border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem; color: var(--text); text-decoration: none; background: var(--bg-alt); }
.ib-card:hover { border-color: var(--accent); }
.ib-coming { opacity: 0.55; }
.ib-card-state { color: var(--accent); }
.ib-history { padding-left: 1.2rem; }
.ib-pass, .ib-correct { color: var(--correct); }
.ib-fail { color: var(--incorrect); }
.ib-intro { border: 1px solid var(--border); border-radius: 10px; padding: 1rem; background: var(--bg-alt); }
.ib-warn { color: var(--incorrect); }
.ib-start { font-size: 1.05rem; padding: 0.6rem 1.2rem; }
.ib-exam { border: 2px solid var(--border); border-radius: 8px; background: var(--bg-alt); min-height: 26rem; display: flex; flex-direction: column; }
.ib-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; padding: 0.6rem 0.9rem; border-bottom: 2px solid var(--border); font-weight: 600; }
.ib-part { color: var(--muted); font-weight: 500; }
.ib-clock { font-variant-numeric: tabular-nums; }
.ib-clock-low { color: var(--incorrect); }
.ib-body { flex: 1; padding: 1rem 0.9rem; }
.ib-situation { margin: 0 0 0.6rem; }
.ib-question { font-weight: 600; font-size: 1.1rem; margin: 0 0 0.9rem; }
.ib-options { display: flex; flex-direction: column; gap: 0.5rem; }
.ib-option { display: flex; gap: 0.75rem; align-items: center; text-align: left; margin: 0; padding: 0.7rem 0.8rem; background: var(--bg); color: var(--text); border: 2px solid var(--border); border-radius: 8px; }
.ib-option.chosen { border-color: var(--accent); background: var(--chip-bg); }
.ib-letter { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); font-weight: 700; }
.ib-option.chosen .ib-letter { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.ib-nav { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; padding: 0.6rem 0.9rem; border-top: 2px solid var(--border); }
.ib-nav .ib-next, .ib-nav .ib-handin { margin-left: auto; }
.ib-flag.on { color: var(--accent); border-color: var(--accent); }
.ib-confirm { flex-basis: 100%; }
.ib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); gap: 0.35rem; margin-bottom: 0.6rem; }
.ib-cell { margin: 0; padding: 0.45rem 0; }
.ib-cell.open { background: var(--chip-bg); color: var(--muted); border: 1px dashed var(--chip-border); }
.ib-cell.flagged::after { content: " ⚑"; }
.ib-result { display: flex; gap: 1rem; align-items: center; border-radius: 10px; padding: 0.8rem 1rem; margin: 0.5rem 0 1rem; }
.ib-result-pass { background: var(--correct-bg); }
.ib-result-fail { background: var(--incorrect-bg); }
.ib-score { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ib-verdict { font-weight: 600; margin: 0 0 0.2rem; }
.ib-themes { display: flex; flex-direction: column; gap: 0.35rem; }
.ib-theme { display: grid; grid-template-columns: minmax(9rem, 16rem) 1fr 3rem; gap: 0.6rem; align-items: center; font-size: 0.92rem; }
.ib-theme-bar { height: 0.6rem; background: var(--chip-bg); border-radius: 4px; overflow: hidden; }
.ib-theme-bar span { display: block; height: 100%; background: var(--correct); }
.ib-theme.weak .ib-theme-bar span { background: var(--incorrect); }
.ib-theme-score { text-align: right; font-variant-numeric: tabular-nums; }
.ib-review { padding-left: 1.4rem; }
.ib-rq { margin-bottom: 0.8rem; padding-left: 0.5rem; border-left: 3px solid var(--correct); }
.ib-rq.wrong { border-left-color: var(--incorrect); }
.ib-rq p { margin: 0.15rem 0; }
.ib-review.only-wrong .ib-rq.right { display: none; }
@media (max-width: 720px) {
  .ib-option { min-height: 3rem; }
  .ib-theme { grid-template-columns: 8rem 1fr 2.5rem; }
}
@media print { .ib-exam .ib-nav { display: none; } }

/* Woorden: write a sentence with the word */
.wcard-sentence { width: 100%; margin: 0 0 0.75rem; min-height: 44px; }
.wsentence { margin-bottom: 0.75rem; }
.wsentence-input { width: 100%; box-sizing: border-box; }
.wsentence-send { margin-top: 0.5rem; min-height: 44px; }
.wsentence-state:empty { display: none; }
.word-check { border-left: 4px solid var(--border); padding: 0.5rem 0.75rem; margin-bottom: 1rem; background: var(--bg-alt); }
.word-check.good { border-color: var(--correct); }
.word-check.partly { border-color: var(--accent); }
.word-check.missing { border-color: var(--incorrect); }

/* Attribution page + sidebar footer link */
.sidebar-foot { font-size: 0.8rem; padding: 0 1rem 1rem; margin: 0; }
.sidebar-foot a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.attribution h3 { margin-top: 1.4rem; }
.attribution ul { padding-left: 1.2rem; }
.attribution li { margin: 0.5rem 0; overflow-wrap: anywhere; }
.attribution table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.attribution th, .attribution td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border, #8884); vertical-align: top; overflow-wrap: anywhere; }

/* ==== Design system: components (2026-11-23) ===========================
   Applied on top of the page-specific rules above; see docs/design.md.  */
html { scroll-padding-top: var(--sp-4); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
h2 { font-size: var(--fs-2xl); line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; margin: 0 0 var(--sp-3); }
h3 { font-size: var(--fs-lg); line-height: 1.3; letter-spacing: -0.005em; font-weight: 650; margin: var(--sp-5) 0 var(--sp-2); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent-soft); }
.small { font-size: var(--fs-sm); }

.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Focus: always visible for keyboard users, never for taps. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* Buttons: primary = filled accent; .link-button = text; options/chips keep their own look. */
button {
  font-weight: 600;
  border-radius: var(--r-sm);
  padding: 0.5rem 1rem;
  min-height: 2.5rem;
  line-height: 1.25;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), filter var(--dur) var(--ease), transform var(--dur) var(--ease);
}
button:hover { opacity: 1; filter: brightness(0.94); }
:root[data-theme="dark"] button:hover { filter: brightness(1.1); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: default; filter: none; transform: none; }
.mc-option, .es-option, .chip, .freq-pos-chip, .freq-lang-chip { font-weight: 500; }
.mc-option, .es-option { border-radius: var(--r-sm); padding: 0.6rem 0.85rem; }
.link-button, .link-button:hover { filter: none; font-weight: 500; transform: none; }
.button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 2.75rem; padding: 0.55rem 1.2rem; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-contrast); text-decoration: none;
  transition: filter var(--dur) var(--ease);
}
.button-link:hover { color: var(--accent-contrast); filter: brightness(0.94); }
#theme-toggle { font-weight: 500; font-size: var(--fs-xs); min-height: 2rem; background: var(--surface-2); border-color: var(--border); }

/* Inputs */
input[type="text"], input[type="search"], input[type="number"], textarea, select {
  font: inherit; color: var(--text); background: var(--bg-alt);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 0.5rem 0.7rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }

/* Cards: one look for every boxed thing. */
.card, .grammar-note, .toc, .lex-entry, .wotd-card, .vocab-summary, .today-done, .writing-prompt,
.stats-card, .ib-card, .say-card, .empty-state {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.vocab-summary, .ib-card, .today-goals a { transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.vocab-summary:hover, .ib-card:hover { box-shadow: var(--shadow-2); }
.today-goals a { border-radius: var(--r-sm); background: var(--bg-alt); min-height: var(--tap); align-items: center; }
.today-goals li.done a { background: var(--accent-soft); }

/* Badges / pills */
.badge, .today-streak {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1;
  padding: 0.35rem 0.65rem; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent); border: none;
}
.badge.neutral { background: var(--surface-2); color: var(--muted); }

/* Progress bars */
.today-progress { border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.today-progress-fill { background: var(--accent); border-radius: var(--r-pill); transition: width 300ms var(--ease); }

/* Empty states */
.empty-state { text-align: center; padding: var(--sp-6) var(--sp-5); margin: var(--sp-4) 0; }
.empty-state h3, .words .empty-state h2 { margin: var(--sp-3) 0 var(--sp-2); }
.empty-state p { max-width: 28rem; margin: 0 auto var(--sp-4); }
.empty-state.not-found h1 { font-size: var(--fs-lg); line-height: 1.3; font-weight: 650; margin: var(--sp-3) 0 var(--sp-4); }
.empty-icon {
  width: 3.5rem; height: 3.5rem; margin: 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.empty-icon .icon { width: 1.75rem; height: 1.75rem; }
.empty-state.compact { padding: var(--sp-4); text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 0 var(--sp-4); align-items: start; }
.empty-state.compact .empty-icon { grid-row: span 3; width: 2.75rem; height: 2.75rem; margin: 0; }
.empty-state.compact h3 { margin: 0 0 var(--sp-1); }
.empty-state.compact p { margin: 0 0 var(--sp-3); }
.empty-state.compact .button-link { justify-self: start; }

/* Sidebar + brand */
#sidebar { padding: var(--sp-5) var(--sp-3); background: var(--bg-alt); }
.sidebar-header { padding: 0 var(--sp-2); margin-bottom: var(--sp-4); gap: var(--sp-2); }
.brand { display: inline-flex; align-items: center; gap: var(--sp-2); text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 2rem; height: 2rem; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-contrast);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem;
}
.brand-name { font-weight: 750; font-size: var(--fs-lg); letter-spacing: -0.01em; }
.nav-level h3 { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; margin: var(--sp-5) var(--sp-2) var(--sp-2); }
#nav-main .nav-level { margin-bottom: var(--sp-3); }
.nav-level:first-child h3 { margin-top: 0; }
.nav-level a {
  min-height: 3rem; /* 48 px rows, with or without a Dutch line */
  align-items: center; justify-content: flex-start; gap: var(--sp-3);
  padding: 0.45rem var(--sp-2); border-radius: var(--r-sm); font-size: var(--fs-sm);
  transition: background-color var(--dur) var(--ease);
}
.nav-level a:hover { background: var(--surface-2); color: var(--text); }
.nav-level a.active { background: var(--accent-soft); color: var(--accent); }
.nav-icon { color: var(--muted); }
.nav-level a.active .nav-icon { color: var(--accent); }
.nav-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.nav-en { font-weight: 550; }
.nav-nl { font-size: var(--fs-xs); color: var(--muted); }
.nav-level a.active .nav-nl { color: var(--accent); opacity: 0.85; }
.sync-status, .sidebar-foot { padding: 0 var(--sp-2); }

#content { padding: var(--sp-6) var(--sp-6) var(--sp-8); max-width: 760px; }
#content > * { animation: page-in 220ms var(--ease); }
@keyframes page-in { from { transform: translateY(4px); } to { transform: none; } }
.today-head { gap: var(--sp-3); flex-wrap: wrap; }

/* Top bar + bottom bar: phones only. */
.topbar, .bottom-nav { display: none; }

@media (max-width: 720px) {
  html { scroll-padding-top: calc(var(--topbar-h) + env(safe-area-inset-top) + var(--sp-2));
         scroll-padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + var(--sp-2)); }
  h2 { font-size: var(--fs-xl); }
  .topbar {
    display: flex; align-items: center; gap: var(--sp-2);
    position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--sp-3) 0 calc(var(--sp-2) + env(safe-area-inset-left));
    background: var(--bg);  /* solid: a backdrop blur costs frames on low-end phones */
    border-bottom: 1px solid var(--border);
  }
  .topbar-brand { display: inline-flex; align-items: center; min-height: 2.75rem; /* 44 px target, same look */ font-weight: 750; font-size: var(--fs-lg); color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
  .nav-toggle {
    position: static; display: flex; box-shadow: none; border: none; background: transparent;
    width: var(--tap); height: var(--tap); margin: 0; font-size: 0; color: var(--text);
  }
  .nav-toggle::before {
    content: ""; width: 24px; height: 24px; background: currentColor;
    -webkit-mask: var(--menu-icon) center / contain no-repeat; mask: var(--menu-icon) center / contain no-repeat;
  }
  .nav-toggle { --menu-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E"); }
  body.sidebar-open .nav-toggle { --menu-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
  #sidebar {
    padding-top: calc(var(--topbar-h) + env(safe-area-inset-top) + var(--sp-3));
    /* The drawer ends where the bar starts (t114): padding alone left the last rows behind the bar until scrolled,
       where a tap hit the bar instead. */
    height: calc(100dvh - var(--bottombar-h) - env(safe-area-inset-bottom));
    padding-bottom: var(--sp-4);
    box-shadow: var(--shadow-2); border-right: none;
  }
  #sidebar .sidebar-header { display: none; } /* the brand is in the top bar */
  #nav-main { display: none; } /* these pages are on the bottom bar */
  .nav-level a { padding: 0.55rem var(--sp-2); min-height: max(var(--tap), 3rem); } /* 48 px, also for a row without a Dutch line */
  #content {
    padding: calc(var(--topbar-h) + env(safe-area-inset-top) + var(--sp-4)) calc(var(--sp-4) + env(safe-area-inset-right))
             calc(var(--bottombar-h) + env(safe-area-inset-bottom) + var(--sp-6)) calc(var(--sp-4) + env(safe-area-inset-left));
  }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--bottombar-h) + env(safe-area-inset-bottom));
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--bg-alt); border-top: 1px solid var(--border);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: var(--tap); margin: 0; padding: var(--sp-1) 0; border-radius: 0;
    background: none; color: var(--muted); font-size: min(0.72rem, 16px); font-weight: 600; text-decoration: none;
    min-width: 0; white-space: nowrap;
  }
  .bottom-nav button:hover { filter: none; }
  /* The Dutch words are longer (Vandaag, Woorden): on a narrow screen they stop growing before they leave
     their fifth, also with "Easier reading" (one short word per slot, so no extra letter spacing here). */
  .bottom-nav span:lang(nl) { font-size: min(0.72rem, 16px, 3.6vw); letter-spacing: normal; }
  .bottom-nav .icon { width: min(1.5rem, 28px); height: min(1.5rem, 28px); padding: 2px 14px; box-sizing: content-box; border-radius: var(--r-pill); transition: background-color var(--dur) var(--ease); }
  .bottom-nav .active { color: var(--accent); }
  .bottom-nav .active .icon { background: var(--accent-soft); }
  body.sidebar-open .bottom-nav { z-index: 26; }
  .empty-state { padding: var(--sp-5) var(--sp-4); }
  .today-goals a { flex-wrap: wrap; row-gap: 0; }
  .today-goal-text { white-space: normal; }
}

/* Large text (Android font scale up to 200%): nothing may push the page sideways. */
body { overflow-wrap: break-word; }
input, textarea, select { max-width: 100%; }
.blank-input { min-width: min(10em, 100%); }
.wcard-word { overflow-wrap: anywhere; }
.empty-state.compact { grid-template-columns: auto minmax(0, 1fr); }
/* With very large text the side-by-side card has no room: stack icon above the text. */
#content { container-type: inline-size; }
@container (max-width: 20rem) {
  .empty-state.compact { grid-template-columns: minmax(0, 1fr); }
  .empty-state.compact .empty-icon { grid-row: auto; margin-bottom: var(--sp-3); }
}

/* Skip link: first Tab stop, visible only when focused. */
.skip-link { position: absolute; left: var(--sp-2); top: -10rem; z-index: 50; padding: var(--sp-2) var(--sp-4);
  display: inline-flex; align-items: center; min-height: 2.75rem; /* 44 px target */
  background: var(--accent); color: var(--accent-contrast); border-radius: var(--r-sm); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: calc(var(--sp-2) + env(safe-area-inset-top)); color: var(--accent-contrast); }
#content:focus { outline: none; }

/* Reading comfort (dyslexia-friendly spacing), a per-device option: html[data-spacing="wide"].
   Follows the WCAG 1.4.12 text-spacing values; layouts must survive it (no fixed text heights). */
:root[data-spacing="wide"] body { line-height: 1.8; letter-spacing: 0.05em; word-spacing: 0.16em; }
:root[data-spacing="wide"] p, :root[data-spacing="wide"] li { margin-bottom: 1em; }
:root[data-spacing="wide"] h2, :root[data-spacing="wide"] h3 { letter-spacing: 0.02em; line-height: 1.4; }
.sidebar-tools { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0 var(--sp-2); margin-bottom: var(--sp-3); }
#spacing-toggle, #rv-toggle { font-weight: 500; font-size: var(--fs-xs); min-height: 2rem; background: var(--surface-2); border-color: var(--border); color: var(--text); }
#spacing-toggle[aria-pressed="true"], #rv-toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

/* Tablets / wide screens: cards in two columns where the content is a list of cards. */
@media (min-width: 1000px) {
  #content { max-width: 960px; }
  .today-goals { grid-template-columns: repeat(3, 1fr); }
  .empty-state { max-width: 40rem; }
}

/* ==== Your path (#pad, web/path.js) =======================================
   One winding line of stops, A0 → C2, one line each; finished and far-off stages
   are folded away. The line is an SVG per row in a gutter (px-capped so 200 %
   text keeps room for the words); state is always also written out in text or
   shape, never colour alone. */
.path-page { --path-gutter: min(4rem, 72px); --path-marker: min(1.75rem, 32px); max-width: 44rem; }
.path-map { margin-bottom: var(--sp-6); }
.path-nodes { list-style: none; margin: 0; padding: 0; }
/* any margin breaks the line (and "Easier reading" gives list rows one) */
.path-page .path-map section, .path-page .path-map h2, .path-page .path-map .path-nodes > li, .path-page .path-map button { margin: 0; }
.path-row, .path-stage-head { display: grid; grid-template-columns: var(--path-gutter) minmax(0, 1fr); align-items: center; }
.path-gutter { position: relative; align-self: stretch; min-height: calc(var(--tap) + var(--sp-3)); }
.path-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.path-seg { fill: none; stroke-width: 3; stroke-linecap: round; }
.path-seg.travelled { stroke: var(--accent); }
.path-seg.ahead { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 2 6; }
.path-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: var(--path-marker); height: var(--path-marker); border-radius: 50%;
  display: grid; place-items: center; background: var(--bg); border: 2px solid var(--muted); color: var(--muted);
}
.path-marker .icon { width: 62%; height: 62%; }
.state-done .path-marker { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.state-current .path-marker {
  background: var(--accent); border-color: var(--accent); color: var(--accent-contrast);
  width: calc(var(--path-marker) * 1.25); height: calc(var(--path-marker) * 1.25);
  animation: path-here 2.4s var(--ease) infinite;
}
.state-next .path-marker, .state-started .path-marker { border-color: var(--accent); color: var(--accent); }
.state-coming .path-marker { border-style: dashed; }
@keyframes path-here {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 0 0.5rem var(--accent-soft); }
}
/* stage: one line that folds its stops */
.path-stage h2 { margin: 0; font-size: var(--fs-md); }
.path-stage-head {
  grid-template-columns: var(--path-gutter) minmax(0, 1fr) auto; width: 100%; min-height: var(--tap); padding: 0 var(--sp-2) 0 0;
  background: none; border: 0; border-radius: var(--r-md); box-shadow: none; color: var(--text); font: inherit; text-align: left;
}
.path-stage-head:hover { background: var(--bg-alt); }
.path-stage-head:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.path-stage-pin {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  min-width: min(2.75rem, 52px); padding: 0.3rem 0.4rem; border-radius: var(--r-pill);
  background: var(--surface-2); border: 2px solid var(--border-strong); color: var(--text);
  font-weight: 700; font-size: var(--fs-sm); text-align: center; line-height: 1.2;
}
.path-stage.here .path-stage-pin { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.path-stage-text { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--sp-3); padding: var(--sp-2); min-width: 0; }
.path-stage-title { font-weight: 700; overflow-wrap: anywhere; }
.path-stage-count { color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }
.path-chevron { width: 1.25rem; height: 1.25rem; color: var(--muted); }
.path-stage-head[aria-expanded="true"] .path-chevron { transform: rotate(180deg); }
.path-stage:last-child .path-stage-head[aria-expanded="false"] .path-seg.below { display: none; }
/* stop: one line */
.path-node-body { padding: var(--sp-1) 0 var(--sp-1) var(--sp-2); min-width: 0; }
.path-node-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--r-md); }
.path-node-btn, div.path-node-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--sp-3);
}
.path-node-btn {
  width: 100%; min-height: var(--tap); text-align: left; background: none; color: var(--text); border: 0;
  border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); box-shadow: none; font: inherit;
}
.path-node-btn:hover { background: var(--surface-2); }
.path-node-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.path-node-title { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.path-node-state { font-size: var(--fs-sm); color: var(--muted); margin-left: auto; }
.state-current .path-node-card { border: 2px solid var(--accent); }
.state-current .path-node-state, .state-next .path-node-state { color: var(--accent); font-weight: 600; }
.state-done .path-node-state { color: var(--correct); }
.state-later .path-node-card, .state-coming .path-node-card, .state-open .path-node-card, .state-done .path-node-card { background: transparent; }
.state-coming .path-node-card { border-style: dashed; min-height: var(--tap); padding: var(--sp-2) var(--sp-3); }
.path-bar { display: block; flex-basis: 100%; height: 0.375rem; margin: var(--sp-1) 0; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.path-bar span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.path-node-card .path-continue.button-link { display: flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: 0;
  margin: 0 var(--sp-2) var(--sp-2); padding-inline: var(--sp-2); white-space: normal; overflow-wrap: anywhere; text-align: center; }
/* opened stop */
.path-panel { position: relative; margin: 0 0 var(--sp-2) var(--path-gutter); padding: var(--sp-1) var(--sp-3);
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.path-panel::before { content: ""; position: absolute; top: -0.5rem; bottom: -0.5rem; left: calc(var(--path-gutter) / -2 - 1px); border-left: 2px dashed var(--muted); }
.path-node.travelled:not(.state-current) .path-panel::before { border-left: 3px solid var(--accent); }
.path-node:last-child .path-panel::before { bottom: 0; }
.path-panel-title { margin: var(--sp-2) 0; color: var(--muted); }
.path-points { list-style: none; margin: 0; padding: 0; }
.path-points li { border-bottom: 1px solid var(--border); }
.path-points li:last-child { border-bottom: none; }
.path-later { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.path-point { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; column-gap: var(--sp-2); align-items: center;
  min-height: var(--tap); padding: var(--sp-1) 0; color: var(--text); text-decoration: none; }
.path-point:hover .point-name { text-decoration: underline; }
.path-point:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.point-mark { color: var(--accent); text-align: center; }
.point-label { min-width: 0; }
.point-name { display: block; overflow-wrap: anywhere; color: var(--accent); font-weight: 600; }
.point-type { display: block; font-size: var(--fs-sm); color: var(--muted); }
.point-count { font-size: var(--fs-sm); color: var(--muted); }
.path-gist summary, .set-note summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; color: var(--accent); }
.path-exam { display: flex; flex-wrap: wrap; gap: 0 var(--sp-4); margin: var(--sp-2) 0; }
.path-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: center; }
.path-actions .path-link { color: var(--accent); min-height: var(--tap); min-width: var(--tap); display: inline-flex; align-items: center; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .path-page { --path-gutter: min(3rem, 48px); --path-marker: min(1.5rem, 28px); }
  /* px caps: at 200 % text the room goes to the words, not the padding */
  .path-node-body { padding-left: min(var(--sp-2), 6px); }
  .path-node-btn { padding: var(--sp-2) min(var(--sp-2), 8px); }
  .path-node-card .path-continue.button-link { margin-inline: min(var(--sp-2), 6px); padding-inline: min(var(--sp-1), 4px); }
}
.path-empty { padding: var(--sp-2) 0 var(--sp-2) var(--path-gutter); }
/* One set of a module (#<module>/<set>), reached from a grammar point */
.set-back { margin: 0 0 var(--sp-2); }
.set-back-link { display: inline-flex; align-items: center; gap: 0.25rem; min-height: var(--tap); }
.set-where { margin-top: 0; }
.set-done { color: var(--correct); font-weight: 600; }
.path-node-review { flex-basis: 100%; text-align: right; font-size: var(--fs-sm); color: var(--muted); }
.path-page > h1, .set-practice > h1 { font-size: var(--fs-2xl); line-height: 1.2; font-weight: 700; margin: 0 0 var(--sp-3); }
.filter-row label { display: inline-flex; align-items: center; gap: 0.25rem; min-height: var(--tap); }
/* Today: one line linking to the path */
.path-here-link { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-4);
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-1); color: var(--text); text-decoration: none; }
.path-here-link:hover { box-shadow: var(--shadow-2); }
.path-here-link .icon { width: 1.5rem; height: 1.5rem; flex: none; color: var(--accent); }
.path-here-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.path-here-go { color: var(--accent); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .state-current .path-marker { animation: none; box-shadow: 0 0 0 0.25rem var(--accent-soft); }
}
@media print {
  .topbar, .bottom-nav { display: none !important; }
  .card, .grammar-note, .toc, .lex-entry, .wotd-card, .stats-card, .ib-card, .say-card { box-shadow: none; }
}

/* Help and the feedback form (L-44, pages/help.js, pages/feedback-form.js); the form reuses .auth-form/.auth-field.
   "Report a problem" (pages/feedback-link.js): quiet, but a full tap target and an icon + words. */
.help-page, .support-page { max-width: 40rem; }
.help-topic { margin: var(--sp-5) 0; }
.help-topic h2 { font-size: var(--fs-lg); margin: 0 0 var(--sp-2); }
.help-topic p { margin: 0 0 var(--sp-2); }
.help-contact { padding: var(--sp-4) var(--sp-5); }
.help-contact .button-link { min-height: var(--tap); display: inline-flex; align-items: center; }
.support-kind { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.support-kind legend { font-weight: 600; padding: 0; margin-bottom: var(--sp-1); }
.support-form textarea { min-height: 8rem; }
.support-shown { margin: var(--sp-1) 0 0; padding: var(--sp-2) var(--sp-3); border-inline-start: 3px solid var(--border-strong);
  font-size: var(--fs-sm); overflow-wrap: anywhere; white-space: pre-wrap; }
.support-after { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.support-after .button-link, .support-after .link-button { min-height: var(--tap); display: inline-flex; align-items: center; }
.support-form .auth-check { min-height: 3rem; } /* 48 dp targets (T-156) */
.support-form button[aria-disabled="true"] { cursor: progress; opacity: 0.7; }
.report-link { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 3rem; padding-inline: var(--sp-1);
  color: var(--muted); font-size: var(--fs-sm); }
.report-link:hover { color: var(--accent); }
.report-link .icon { width: 1rem; height: 1rem; }
.pl > .report-link { justify-self: start; }

/* Account pages (R4, web/account.js). Text in rem so it follows the phone's font size. */
input[type="email"], input[type="password"] {
  font: inherit; color: var(--text); background: var(--bg-alt);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 0.5rem 0.7rem;
}
input[type="email"]:focus, input[type="password"]:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-page { max-width: 32rem; }
.auth-form { display: flex; flex-direction: column; gap: var(--sp-4); margin: var(--sp-4) 0; }
.auth-form > button[type="submit"] { align-self: flex-start; min-height: var(--tap); }
/* Account → Your data (L-09): export + delete with an inline confirm step */
.acct-delete { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.acct-delete-confirm[hidden] { display: none; }
.acct-delete-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.acct-data button, .auth-section > button { min-height: var(--tap); }
/* text-style buttons on the Account screens still get a full tap target (show password, log out a device) */
.auth-page .link-button { min-height: var(--tap) !important; min-width: var(--tap); display: inline-flex; align-items: center; }
.auth-field { display: flex; flex-direction: column; gap: var(--sp-1); }
.auth-field label { font-weight: 600; }
.auth-field input { width: 100%; min-height: var(--tap); box-sizing: border-box; }
.auth-pw-row { display: flex; gap: var(--sp-2); align-items: center; }
.auth-pw-row input { flex: 1; min-width: 0; }
.auth-show { min-height: var(--tap); flex: none; }
.auth-hint { margin: 0; font-size: var(--fs-xs); }
.auth-check { display: flex; gap: var(--sp-2); align-items: center; min-height: var(--tap); }
.auth-check input { width: 1.4rem; height: 1.4rem; flex: none; accent-color: var(--accent); }
.auth-msg:empty { display: none; }
.auth-msg { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); border: 1px solid var(--border); }
.auth-msg.error { border-color: var(--incorrect); background: var(--incorrect-bg); color: var(--incorrect); }
.auth-msg.ok { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.auth-msg.info { color: var(--muted); }
.auth-links { margin: var(--sp-3) 0; }
.auth-alt { margin: var(--sp-5) 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.auth-alt p { margin: 0; }
.auth-section { padding: var(--sp-4) var(--sp-5); margin: var(--sp-4) 0; }
.auth-section h3 { margin-top: 0; }
.auth-done { padding: var(--sp-4) var(--sp-5); }
.auth-devices { list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.auth-devices li { display: flex; flex-direction: column; gap: var(--sp-1); align-items: flex-start; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.auth-devices li:last-child { border-bottom: none; }
.auth-devices .badge { margin-left: var(--sp-2); }
.auth-note { margin: 0; padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--accent); background: var(--surface-2); }

/* Usage meter, soft stop, Plans page (caps.js). Text + icon carry the meaning; the bar
   and the tint are extra. rem only; nothing here animates. */
.cap-icon { width: 1.1em; height: 1.1em; vertical-align: -0.15em; flex: none; }
.cap-line { margin: var(--sp-2) 0 0; }
.cap-line[hidden] { display: none; }
.cap-plans-link { display: inline-block; padding: 0.6rem 0; min-height: var(--tap); box-sizing: border-box; font-weight: 600; }
.cap-stop { margin: var(--sp-3) 0; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border-strong); border-left: 4px solid var(--accent); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); }
.cap-stop p { margin: var(--sp-1) 0; }
.cap-stop-title { display: flex; gap: var(--sp-2); align-items: center; }
.cap-rows { list-style: none; padding: 0; margin: var(--sp-3) 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.cap-row p { margin: var(--sp-1) 0; }
.cap-row progress { display: block; width: 100%; height: 0.75rem; accent-color: var(--accent); }
.plans-note { padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--accent); background: var(--surface-2); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: var(--sp-4); margin: var(--sp-4) 0; }
.plan-card { padding: var(--sp-4) var(--sp-5); }
.plan-card h2, .plan-card h3 { margin-top: 0; font-size: var(--fs-lg); display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.plan-card.plan-mine { border-color: var(--accent); border-width: 2px; }
.plan-items { padding-left: 1.2rem; margin: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
/* L-12: the Plus offer on a stop card, the Plans page's buy/status blocks, confirm and paid screens.
   Text + icon everywhere, never colour alone; every control at least --tap high; nothing animates. */
.cap-offer-actions, .plans-actions, .plans-confirm-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-top: var(--sp-2); }
.cap-offer-actions .button-link, .cap-offer-actions button, .plans-actions button, .plans-confirm-row button,
.plans-body .button-link, .plans-body button { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); box-sizing: border-box; text-align: center; }
.cap-offer-see, .cap-offer-later, .plans-cancel, .plans-cancel-no { background: var(--chip-bg); color: var(--text); border: 1px solid var(--chip-border); }
.cap-offer-see:hover { color: var(--text); }
.cap-offer-plus { font-weight: 600; }
.cap-gate { border-left-color: var(--accent); }
.plans-buy h2, .plans-status h2, .plans-summary h2, .plans-body .auth-section h2 { margin-top: 0; font-size: var(--fs-lg); }
.plans-buy, .plans-status, .plans-summary { padding: var(--sp-4) var(--sp-5); margin: var(--sp-4) 0; }
.plans-opts { list-style: none; padding: 0; margin: var(--sp-3) 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.plans-opt .button-link { width: 100%; }
.plans-left { margin: var(--sp-1) 0 0; }
.plans-state:focus, .plans-cancel-q:focus, .plans-live:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.plans-live:empty { display: none; }
.plans-agree { display: flex; gap: var(--sp-3); align-items: flex-start; margin: var(--sp-4) 0; }
.plans-agree-box { flex: none; width: var(--tap); height: var(--tap); margin: 0; accent-color: var(--accent); }
.plans-h1, .ib-gate-h { font-size: var(--fs-2xl); line-height: 1.2; font-weight: 700; margin: 0 0 var(--sp-3); }
.ib-gate-h { font-size: var(--fs-xl); }
.plans-page .study-error:empty { display: none; }
.plans-opt-link, .plans-opt-link:hover { background: var(--chip-bg); color: var(--text); border: 1px solid var(--accent); }
.plans-agree label { padding: 0.5rem 0; min-height: var(--tap); box-sizing: border-box; cursor: pointer; }
.ib-plus { margin-top: var(--sp-1); align-self: flex-start; }
.explain-this { margin-top: var(--sp-2); display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.explain-btn { min-height: var(--tap); }

/* Strings table (core/strings.js): a label is one span per language; the Dutch name under an
   English label is quieter. .visually-hidden: text for screen readers only (flag s in strings.md). */
.t-label .t-sub { color: var(--muted); font-weight: 400; font-size: 0.875em; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
#theme-toggle, #spacing-toggle, #rv-toggle { min-height: 2.75rem; } /* 44 px tap targets */

/* ==== Woorden and Later at every screen width (t80, jake's note) ===========
   One centred column, everything in it the same width. Only the answer buttons are
   loud; "Not now", the sentence button and the Undos are quiet. */
#content:has(> .words) { margin-inline: auto; }
.words { max-width: 40rem; margin-inline: auto; }
.words .words-stage, .words .later-list { max-width: none; }
.words .wcard-dutch .vocab-pos { margin-left: 0; }
.words .words-later { text-align: center; }
.words .words-later { margin: var(--sp-3) 0 0; }
.words .words-later:empty { display: none; }
.words .words-options-btn { display: block; min-height: 48px; min-width: 48px; margin: var(--sp-3) auto 0; }
.words .words-options-btn[hidden], .words .words-options[hidden] { display: none; }
.words-options { text-align: center; }
.words-options a { display: inline-flex; align-items: center; min-height: 44px; }
.words-test { margin: var(--sp-2) 0 0; }
.words .wcard-later, .words .wcard-more, .words .wcard-sentence, .words .words-options-btn, .words .later-notice-undo, .words .later-sweep-undo, .words .later-undo, .words .later-undo-all {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
@media (min-width: 1400px) and (min-height: 50rem) {
  .words { max-width: 48rem; }
  .words .wcard { min-height: 18rem; padding: var(--sp-6); }
  .words .wcard-word { font-size: 2.75rem; }
}
.rr-undo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-2); }
.rr-undo .rr-undo-button { background: transparent; border: 1px solid var(--border); color: var(--text); min-height: 44px; min-width: 44px; margin: 0; }

/* The card's controls (t101): under the card, in thumb reach, wrapping to rows instead of going
   sideways. On the back, when large text makes the card taller than the screen, the answer pair
   stays at the bottom of it (never on the front, where it would cover the word). Spacing around the
   card is capped, so it does not double with the text. */
.words .words-stage { margin-top: var(--sp-3); }
.words .wcard { padding: min(1.25rem, 24px); }
.words .wcard-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: var(--sp-3) 0 var(--sp-2); }
/* t112: the dock (the card's buttons + the notice with its Undo). On the back it sticks to the bottom,
   so the answer pair stays under the thumb when large text makes the card tall; never on the front,
   where it would cover the word. */
.words .wcard-dock { padding-bottom: var(--sp-2); }
.words .wcard-dock.is-stuck { position: sticky; bottom: 0; z-index: 5; background: var(--bg); }
.words .wcard-dock .later-notice { margin-top: 0; justify-content: center; }
.words .wcard-dock .later-notice:has(> span:empty):not(:has(button)) { margin: 0; } /* empty: zero height, still in the tree (t143) */
.words .wcard-word-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--sp-2); }
.words .wcard-play { display: inline-flex; align-items: center; justify-content: center; min-width: 3rem; min-height: 3rem; padding: 0; margin: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 50%; color: var(--text); }
.words .wcard-play[hidden] { display: none; }
.words .wcard-play .icon { width: 1.5rem; height: 1.5rem; }
.words [role="group"][tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
.words .words-state { text-align: center; }
.words .words-state h2 { margin: 0 0 var(--sp-3); }
.words .words-error h2 { color: var(--text); }
.words .words-state-action { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; min-width: 3rem; margin: 0; }
.words .words-keys-btn { min-height: 2.75rem; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.words .wcard-actions button { margin: 0; min-width: 0; }
.words .wcard-actions .wcard-show { flex: 3 1 10rem; width: auto; }
.words .wcard-actions .wcard-later { flex: 1 1 6rem; width: auto; }
.words .wcard-rate { flex: 1 1 100%; flex-wrap: wrap; gap: var(--sp-2); margin: 0; }
.words .wcard-rate button { flex: 1 1 8rem; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); background: var(--surface-2); border: 2px solid var(--border); color: var(--text); }
.words .wcard-quiet { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); }
.words .wcard-quiet:empty { display: none; }
.words .wcard-quiet button { flex: 1 1 10rem; min-height: 48px; margin: 0; }
.words .wcard-more-panel { margin-top: var(--sp-3); }
.words .wcard-more-panel[hidden] { display: none; }
.words .wcard-sentence { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); }
/* a focused word or link on a long card is scrolled clear of the stuck buttons */
.words .wcard-back .tap-word, .words .wcard-back a { scroll-margin-bottom: 12rem; }
@media (max-width: 720px) {
  .words .wcard-dock.is-stuck { bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); }
  /* one thumb (t112): a tall card puts its buttons in the bottom 40 % of a phone screen (and Not now, under them on
     the back, above the bar). The extra height gives way as the text grows (6rem = 96px at 100 %), so at 200 % the
     word and Show answer both stay on screen. */
  .words .wcard { min-height: calc(42dvh + 96px - 6rem); display: flex; flex-direction: column; justify-content: center; }
  /* heading, word and gaps stop growing before they push the buttons off a 360 px screen at 200 % */
  .words .today-head h1 { font-size: min(1.75rem, 12vw); }
  .words .wcard-word { font-size: min(2rem, 13vw); }
  .words .wcard-tags { margin-bottom: min(0.75rem, 12px); }
  .words .wcard-coach { margin-top: min(var(--sp-3), 12px); }
}

/* ==== Word decks (t88): Frequency List panel + the deck line on Woorden ===== */
.decks { margin-bottom: var(--sp-4); }
.decks h3 { margin: var(--sp-3) 0 var(--sp-2); font-size: 1rem; }
.frequency-list .decks ul.deck-list { list-style: none; padding: 0; margin: 0; }
.frequency-list .decks ul.deck-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin: 0; padding: var(--sp-2) 0; border-top: 1px solid var(--border); }
.deck-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 12rem; }
.deck-name, .words-deck-name { overflow-wrap: anywhere; }
.deck-name { font-weight: 600; }
.deck-actions, .deck-rename, .deck-filter-row, .deck-prompt-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.deck-actions { max-width: 100%; }
.deck-actions button, .deck-actions .button-link, .deck-filter-row button, .deck-prompt button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; margin: 0; }
.decks button.deck-quiet, .deck-filter-row button.deck-quiet, .deck-rename button[type="button"] { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.deck-rename input { flex: 1 1 10rem; min-width: 0; min-height: 44px; }
.deck-actions .button-link.deck-study { background: var(--surface-2); border: 1px solid var(--accent); color: var(--text); }
.deck-status:empty { display: none; }
.deck-filter-row { margin: 0 0 var(--sp-3); }
/* "All words" (t92): the scope switch, and the end of the chunked table */
.freq-scope { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; cursor: pointer; }
.freq-scope[hidden], .freq-table tbody[hidden] { display: none; }
.freq-scope input { width: 1.25rem; height: 1.25rem; margin: 0; }
.freq-scope-note { margin: 0; }
.freq-more-box { display: flex; flex-direction: column; align-items: center; overflow-anchor: none; }
.freq-more { min-height: 44px; min-width: 44px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.deck-match { flex: 1 1 10rem; }
.deck-prompt { margin: var(--sp-3) 0 0; }
.deck-prompt label { display: block; font-weight: 600; margin-bottom: var(--sp-1); }
.deck-prompt input { flex: 1 1 14rem; min-width: 0; min-height: 44px; }
.deck-prompt-error { color: var(--text); font-weight: 600; }
.deck-prompt-error:empty { display: none; }
.words .words-deck { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-3); margin: 0; }
.words .words-deck:empty { display: none; }
.words-deck a { display: inline-flex; align-items: center; min-height: 44px; }
.wotd-card .lex-learn { min-height: 44px; }
.words .empty-state h2, .words .today-done h2 { font-size: 1.125rem; letter-spacing: normal; }

/* A page that loads on demand did not arrive (core/lazy.js) */
.load-failed button { min-height: 44px; margin: var(--sp-3) 0 0; }

/* "Not yet checked" mark (public build only; web/core/unchecked.js, T-102). A quiet badge.neutral
   pill in a 44 px tap area; one line of explanation opens under it. */
.nc { margin: 0 0 var(--sp-2); }
.nc-mark, .nc-mark:hover {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0; margin: 0;
  background: none; border: none; color: inherit; opacity: 1; filter: none; transform: none;
}
.nc-mark .badge { font-weight: 500; }
.nc-mark[aria-expanded="true"] .badge { color: var(--text); }
.nc-ring { width: 1rem; height: 1rem; flex: none; }
.nc-why { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); color: var(--muted); max-width: 34rem; }
.wcard .nc { margin: 0; }
.nc-item { position: relative; }
.nc-dot { position: absolute; top: var(--sp-2); right: 0; color: var(--muted); line-height: 0; }
.grammar-note.nc-item { padding-right: var(--sp-6); }
.grammar-note > .nc-dot { right: var(--sp-2); }
.ib-rq.nc-item { padding-right: var(--sp-5); }

/* ==== Settings ▸ Advanced (L-30): the menu's switch, four grade buttons, key hints, compact cards ===== */
.nav-adv { margin: var(--sp-2) 0 0; }
.nav-switch { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: var(--tap);
  margin: 0; padding: 0.55rem var(--sp-2); text-align: start; background: transparent; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.nav-switch-state { font-weight: 600; white-space: nowrap; }
.nav-switch[aria-checked="true"] .nav-switch-state::before { content: "✓ "; }
.nav-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* four buttons: two by two on a phone, one row when there is room, one column at large text */
.words .wcard-rate.four.shown { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.words .wcard-rate.four button { min-width: 0; }
.words .key-hint { font: inherit; font-size: var(--fs-xs); font-weight: 600; line-height: 1.4; padding: 0 0.35em; margin-inline-start: var(--sp-1);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--muted); background: var(--bg); }
.words-compact .words-stage { margin-top: var(--sp-2); }
.words-compact .wcard { padding: min(0.75rem, 12px); }
.words-compact .wcard-actions { gap: var(--sp-1); padding: var(--sp-2) 0 var(--sp-1); }
.words-compact .wcard-rate { gap: var(--sp-1); }
.words-compact .wcard-rate button { min-height: 48px; }
.words-compact .wcard-word { font-size: min(1.75rem, 11vw); }
@media (max-width: 720px) {
  .words.words-compact .wcard { min-height: calc(32dvh + 96px - 6rem); }
}
