/* Minimal styling. Editorial, light, no framework. */

:root {
  --bg: #fdfaf4;
  --ink: #1c1c1c;
  --muted: #6b6b6b;
  --faint: #999;
  --accent: #8f2b45;                /* wine, saturated a touch + nudged purple so it doesn't read brown (Smith) */
  --accent-soft: #f2e7e8;
  --p: oklch(42% 0.135 15); --p2: oklch(54% 0.11 15); --p3: oklch(70% 0.07 15); --pSoft: oklch(93% 0.024 15); --pDeep: oklch(33% 0.12 15);
  --green: #235c3c;   /* deepened (feedback_redesign handoff §1) */
  --green-soft: #e4eee7;
  --green-vivid: #1f9d4a;       /* brighter green for outcome-right text */
  --blue: #4a89c7;
  --blue-soft: #e5eef6;
  --red: #7f2a24;       /* oxblood - darker than every logo tint, reads as a mark not a brand (handoff §1) */
  --red-soft: #f8e7e4;
  --amber: #b58a00;
  --amber-soft: #f8efd5;
  --green-partial: #5d9a77; /* R4 partial family - PROVISIONAL, Design owns the value; must sit clearly lighter than --green on cream, clearly darker than the wash */
  --touched: #4a89c7;      /* practised, right or wrong (handoff §5) */
  --line: #e6e1d6;
  --core: #8f2b45;
  --preview: #b0616e;
  --review: #cd9aa2;
  --fluency: #e3c8cc;
  --arcane: #efe0e2;
}

* { box-sizing: border-box; }

body {
  font-family: Lora, Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  line-height: 1.55;
}

header {
  position: sticky; top: 0; z-index: 40; background: var(--bg);   /* Linguics permanently there (Smith) */
  border-bottom: 1px solid var(--line);
  padding: 14px 28px 0 28px;
  /* (r140: #identity-box no longer anchors here - it is a flex item in the
     single header row. The note is kept so nobody re-adds the overlay.) */
}
/* r131 FREE THE TOP. The page was spending four full-width bands before any
   content: identity strip, brand row, tab row, filter bar. The identity strip
   is now pinned inside the header (no band, and it stops scrolling away while
   the header stays), and the filter bar shares the tab row. Two bands back. */
/* r140 THE THIRD BAND. Brand row and tab row are now ONE row: brand hard left,
   tabs and filters to the right of it, everything bottom-aligned so the active
   tab still meets the header's bottom border like a folder tab. */
.header-row2 { display: flex; align-items: flex-end; gap: 6px 18px; flex-wrap: wrap; }
.header-row2 .brand-row { margin: 0; flex: 0 0 auto; align-self: center; }
/* r141 MY OWN REGRESSION, measured: the identity chip wrapped to a line of its
   own (top 90 vs the nav's 14), so r140 removed one band and handed one back -
   the header measured 133px on vocab, not the 49px I claimed. Smith spotted it:
   "Smith test has gone to a funny place now... it's just wrapped itself round."
   Cause: #header-filter-slot took flex:1 and pushed identity off the end. The
   identity chip is SHORT and belongs beside the brand, so it goes there with an
   auto margin, and the wide filter bar is the thing allowed to take a second
   line - it is the only item that genuinely cannot share one. */
#identity-box { order: 1; margin-left: auto; }
#header-filter-slot { order: 2; flex: 1 1 100%; min-width: 0; display: flex; justify-content: flex-end; }
/* r137: the filter bar carries `position: sticky; top: 110px` from when it lived
   in the page. Inside the header - which is ITSELF sticky - that makes it detach
   and float over the content below, which is the text-on-top-of-text in Smith's
   screenshots and a large part of why the top eats so much room. Static here. */
/* r141: measured at 121px total header on vocab, of which the filter bar is two
   wrapped lines (drill chips, then Direction / Restrict to / Sub-band). Tighter
   leading and gaps buy back most of a line without hiding any control. */
/* r187: a bar parked in the slot by an earlier strand stayed VISIBLE after the
   switch, because .filter-bar's display:flex outranks the hidden attribute's
   UA rule - so Grammar's Topic/Level/Input row sat above Vocabulary's scope
   strip (Smith's r186 shots). The attribute must win. */
.filter-bar[hidden] { display: none; }
#header-filter-slot .filter-bar { position: static; top: auto; z-index: auto;
  margin: 0; padding: 0; border: none; background: transparent;
  flex-wrap: wrap; justify-content: flex-end; align-items: center;
  gap: 3px 10px; font-size: 12.5px; line-height: 1.25; }
#header-filter-slot .filter-bar select { font-size: 13px; padding: 2px 5px; }
#header-filter-slot .filter-mode-chip { padding: 2px 9px; font-size: 12px; }
#header-filter-slot .filter-mode-row { display: inline-flex; }
.tagline-scope { color: var(--faint); font-style: italic; font-size: 0.9em; }   /* italic like 'atomised' (Smith) */

header h1 { margin: 0; font-size: 22px; font-weight: 600; }
/* THE SHRINK. In a working session the tagline stands down - it is the line a
   new visitor needs, not the line a learner mid-answer needs, and it was the
   single biggest consumer of the band it lived in. It returns in full on the
   entry screen. */
.tagline { margin: 0; color: var(--muted); font-style: italic; font-size: 14px;
  align-self: center; flex: 0 1 auto; min-width: 0; display: none; }
body.entry-active .tagline, body.coverage-active .tagline { display: block; }

nav#strand-nav { display: flex; gap: 6px; margin-bottom: -1px; }
nav#strand-nav button {
  background: transparent;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--bg);
  border-radius: 6px 6px 0 0;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
nav#strand-nav button.active { color: var(--accent); border-color: var(--accent); border-bottom-color: var(--bg); font-weight: 600; }

main {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 28px;
  padding: 24px 28px 32px;
  max-width: 1480px;
}

.content { min-width: 0; }

.strand h2 { margin-top: 0; font-weight: 600; font-size: 19px; }
.note { color: var(--muted); font-size: 13px; font-style: italic; margin-top: -6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }

/* Bucket-filter banner (when drilled into a specific bucket via overview click) */
.bucket-filter-banner {
  background: var(--amber-soft);
  border: 1px solid var(--amber);
  border-radius: 3px;
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.bucket-filter-banner .clear-btn {
  background: white;
  border: 1px solid var(--amber);
  padding: 3px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.bucket-filter-banner .clear-btn:hover { background: var(--bg); }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 13px;
  flex-wrap: wrap;
  position: sticky; top: 110px; z-index: 35;   /* QoderWork 2026-07-22: direction sticky; clears the ~110px sticky header */
}
@media (max-width:600px) {
  .filter-bar { top: 78px; }   /* QoderWork 2026-07-22: shorter header on mobile (no nav tabs) */
}
.filter-bar label { color: var(--muted); }
.filter-bar select {
  padding: 3px 6px;
  font-family: inherit;
  font-size: 13px;
  /* r147 (Smith: "I know that will get missed... it's coloured cream and just
     makes it hide"). It was painted in var(--bg) - the PAGE'S OWN GROUND - so a
     control sat on a surface of exactly its own colour and read as text. A
     dropdown has to look like something you can open. White field, a firmer
     rule, and the navy accent on hover and focus. */
  border: 1px solid var(--rule, #cfc7b5);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
/* r147: the deck you got is not the deck you asked for, said plainly and once.
   Informational, so it takes the accent rule rather than the red one - nothing
   has gone wrong, the app simply could not honour the request. */
.strand-notice {
  margin: 0 0 12px; padding: 9px 13px; font-size: 13.5px;
  background: var(--accent-soft, #f2f0fa); border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0; color: var(--ink);
}
.filter-bar select:hover { border-color: var(--accent); }
.filter-bar select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-bar .filter-count {
  margin-left: auto;
  color: var(--faint);
  font-size: 12px;
}
/* Mid-session mode switcher chips.  QoderWork 2026-07-22 */
.filter-mode-row { display: flex; gap: 4px; width: 100%; margin-bottom: 4px; }
.filter-mode-chip {
  font: inherit; font-size: 12px; padding: 3px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--muted); cursor: pointer;
}
.filter-mode-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

/* Translation session score: olive shade, no threshold.  QoderWork 2026-07-22 */
/* r141: quiet type over a thin progress rule, replacing the olive slab whose
   darkness encoded the score (Smith: "the dark green's so out of place").
   The bar uses the house partial-green, and only the RULE carries the shade -
   the figures stay legible ink at every score. */
.translation-session-score {
  margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap;
  padding: 2px 0 4px; border-radius: 0; background: none;
  position: relative;
}
.translation-session-score.has-score::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  border-radius: 1px;
  background: linear-gradient(to right,
    var(--green-partial, #5d9a77) 0, var(--green-partial, #5d9a77) var(--sess-pct, 0%),
    var(--line) var(--sess-pct, 0%), var(--line) 100%);
}
.session-reset-btn {
  font: inherit; font-size: 11px; padding: 1px 6px; margin-left: 4px;
  border: 1px solid var(--line); border-radius: 4px;
  background: transparent; color: var(--faint); cursor: pointer;
}
.session-reset-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Drill "known words" direction filter chips.  QoderWork 2026-07-22 */
.drill-known-row {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin: 4px 0 2px; font-size: 12px;
}
.drill-known-label { color: var(--muted); margin-right: 2px; }
.drill-known-chip {
  font: inherit; font-size: 11px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--muted); cursor: pointer;
}
.drill-known-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.drill-known-chip:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* Question card */
.qcard {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 22px;
}
.qcard .meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.qcard .meta .sep { color: var(--faint); }
.qcard .prompt {
  font-size: 22px;
  margin: 16px 0 24px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}
/* r219, Smith 2026-09-08 on the reported-speech card: "it just needs a bit of
   space because it's just a bit cluttered at the top... Marco ha detto, if you had
   a space between those lines, then it would read more easily."
   6px against a 22px type size on a 1.5 line-height is less than half a line, so
   three separate utterances - the instruction, the sentence being reported, and
   the transformation to complete - ran together as one block. 14px separates them
   without stretching a two-line prompt. */
.qcard .prompt .prompt-segment {
  display: block;
  margin: 0 0 14px;
}
.qcard .prompt .prompt-segment:last-child { margin-bottom: 0; }
/* Successive lines WITHIN one segment stay tight; the space belongs between
   segments, not inside them. */
.qcard .prompt .prompt-segment-line + .prompt-segment-line { margin-top: 2px; }
.qcard .prompt .prompt-italian {
  font-size: 22px;
}
.qcard .prompt .prompt-english {
  font-style: italic;
  font-size: 18px;
  color: var(--muted);
  margin-top: 2px;
}
/* Genuine trailing cues already follow the sentence in DOM order. CSS must
   not reorder narration, punctuation or source/target transformation arrows. */
.qcard .prompt .prompt-cue {
  font-size: 22px;
  margin: 10px 0 2px;
  padding: 6px 0 0;
  color: var(--ink);
  border-top: 1px dashed var(--line);
  border-bottom: none;
}
.qcard .prompt .prompt-cue .prompt-cue-label {
  color: var(--muted);
  font-style: italic;
  margin-right: 6px;
  font-size: 18px;
}
.qcard .prompt .prompt-cue .prompt-cue-word {
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 4px;
}
@keyframes cue-attention-pulse {
  0%   { opacity: 0; transform: translateY(-4px) scale(0.97); }
  60%  { opacity: 1; transform: translateY(0)    scale(1.04); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}
.qcard textarea, .qcard input[type=text] {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: inherit;
  font-size: 18px;
  background: var(--bg);
  margin-bottom: 6px;
}
.qcard textarea { min-height: 110px; resize: vertical; }

.accent-bar {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.accent-bar button {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.accent-bar button:hover { background: white; }
.marker-cost {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  margin-top: 8px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.accent-bar .accent-hint {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  margin-left: 4px;
  align-self: center;
}

/* r140 ONE ROW, NOT TWO. Smith asked whether Intent/Guess/Sense/Flair could be
   killed outright to give the result room. They cannot: `intent` is posted to
   the marker and the prompt acts on it ("if intent is sense, don't penalise
   non-literal mappings"), and <g>/<s>/<f> license stylistic reach. Deleting
   them would change how answers are marked. So they are COMPRESSED instead -
   the two bars share one line and give the band back anyway. */
.intent-bar { margin-top: 8px; display: flex; gap: 8px; align-items: center; font-size: 13px;
  flex-wrap: wrap; }
.intent-bar label { color: var(--muted); }
.intent-bar select { padding: 2px 6px; font-family: inherit; font-size: 13px; }
.intent-bar .annotation-bar { margin: 0 0 0 6px; padding-left: 10px; border-left: 1px solid var(--line); }
/* r141: the live consequence of the Intent setting, in words, next to it. */
.intent-why { color: var(--faint); font-style: italic; font-size: 12px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.annotation-bar { display: flex; gap: 6px; margin-top: 6px; }
.annotation-bar button {
  padding: 3px 8px;
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 3px;
  cursor: pointer;
}

/* Vocab help bar */
.vocab-help-bar {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}
.vocab-help-bar .label { color: var(--muted); font-size: 12px; }
.vocab-help-btn {
  background: var(--amber-soft);
  border: 1px solid var(--amber);
  border-radius: 3px;
  padding: 3px 9px;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink);
}
.vocab-help-btn:hover { background: white; }
.vocab-revealed {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 3px 9px;
  font-size: 12.5px;
  color: var(--ink);
}
.vocab-revealed .reveal-label { color: var(--muted); margin-right: 4px; }
.vocab-revealed .reveal-value { font-weight: 600; }

/* Clickable words in the prompt (those with a vocab_help entry) */
.prompt-clickable-word {
  cursor: pointer;
  border-bottom: 1px dotted var(--accent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.prompt-clickable-word:hover {
  background: var(--accent-soft);
}

/* Aspect menu popup (for rich vocab_help entries) */
.aspect-menu {
  position: absolute;
  background: white;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 4px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  min-width: 220px;
}
.aspect-menu .aspect-header {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.aspect-menu .aspect-header strong { color: var(--accent); }
.aspect-menu .aspect-option {
  display: block;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  border-radius: 3px;
}
.aspect-menu .aspect-option:hover { background: var(--accent-soft); }
.aspect-menu .aspect-empty { padding: 6px 8px; color: var(--muted); font-style: italic; font-size: 12px; }

/* Slash menu popup */
.slash-menu {
  position: absolute;
  background: white;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 4px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  min-width: 200px;
}
.slash-menu .slash-option {
  display: block;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  border-radius: 3px;
}
.slash-menu .slash-option:hover,
.slash-menu .slash-option.focused { background: var(--accent-soft); }
.slash-menu .slash-header { font-size: 11px; color: var(--muted); padding: 3px 8px; }
.slash-menu .slash-empty { padding: 6px 8px; color: var(--muted); font-style: italic; font-size: 12px; }

.actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.actions button {
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 4px;
  cursor: pointer;
}
.actions button.secondary {
  background: white;
  color: var(--accent);
}
.actions button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.actions .kbd-hint { color: var(--faint); font-size: 12px; }

/* Result panel */
.result {
  /* r139: the wine wash is gone (Smith, twice: "we shouldn't have that pink").
     It tinted every verdict the same colour before the reader reached the
     green/red that carries the meaning, and it cost padding the feedback area
     cannot spare. White, one hairline, meaning carried by the marks inside. */
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--line);
}
.result .overall {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 14px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.result .overall .score { font-size: 22px; font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
/* r268: a long summary (the unmarked translation's common-error note) squeezed
   the score into a one-character column, so "0 / 0" read top to bottom. The
   score keeps its width; the summary wraps beside it. */
/* r142: on the VOCAB card the score and "You wrote:" each took a full row with
   its own rule under it - 47px for about eleven characters of information
   (Smith: "why are we saying zero of one on one line, you wrote on one line").
   They share a line here, with one rule under the pair. Grammar and translation
   keep the roomier treatment: their answers are sentences, not one word. */
#vocab-host .result .overall {
  margin-bottom: 0; padding-bottom: 6px; border-bottom: none;
  flex-wrap: wrap; row-gap: 2px;
}
#vocab-host .result .overall .score { font-size: 17px; }
#vocab-host .result-you-wrote {
  margin: 0 0 8px; padding: 0 0 8px; font-size: 13.5px;
}
.markpoint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 3px;
  font-size: 14px;
  background: white;
}
/* feedback_redesign §2: the verdict rule comes OFF the card edge and sits
   inside, immediately left of the correction it judges (.corr-diff /
   .diff-matched). R4: got-it rules are HEAVIER (3px) than partial and wrong
   (2px), so lighter always also means thinner. */
.markpoint.hit, .markpoint.miss, .markpoint.partial { border-left: none; }
.markpoint.not_attempted { border-left: 4px solid var(--line); opacity: 0.7; }
.markpoint .label { font-weight: 600; flex: 0 0 220px; }
.markpoint .label .proposed-tag { font-weight: normal; color: var(--amber); font-style: italic; font-size: 12px; }
.markpoint .evidence { color: var(--muted); font-size: 12px; }
.markpoint.proposed { background: var(--amber-soft); }

.outcome-status {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}
.outcome-status.outcome-right { color: var(--green-vivid); }
.outcome-status.outcome-wrong { color: var(--red); }
.outcome-status.outcome-partial { color: var(--amber); }
.outcome-status.outcome-none { color: var(--muted); }

/* Inline variant: sits beside the answer chip on the same row, not above. */
.outcome-status-inline {
  display: inline-block;
  margin: 0 0 0 8px;
  padding: 0;
  font-size: 12.5px;
  vertical-align: baseline;
  letter-spacing: 0.01em;
}

.bucket-description {
  font-weight: normal;
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
  margin-top: 3px;
  line-height: 1.35;
  /* Job 8c (QoderWork 2026-08-06): descriptions now carry authored bullets
     (\u2022 + newline); pre-line renders them without collapsing to one line. */
  white-space: pre-line;
}

/* Give the explanation most of a grammar result row. A one-word correction
   should not reserve the space that its explanation needs to be readable. */
#strand-grammar .markpoint {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(140px, 1fr);
  gap: 18px;
  padding: 12px;
  margin: 10px 0;
}
#strand-grammar .markpoint > * { min-width: 0; overflow-wrap: anywhere; }
#strand-grammar .markpoint .bucket-description {
  font-size: 13px;
  line-height: 1.5;
  margin-top: 8px;
}
.learning-point { margin: 0 0 .65em; }
.learning-point:last-child { margin-bottom: 0; }
.bucket-description strong { font-weight: 700; color: var(--ink); }
.markpoint-response-part { color: var(--muted); font-size: 12px; font-weight: 400; margin-bottom: 6px; }
.result-explanation > .learning-point:first-of-type { margin-top: 5px; }

.grammar-response-parts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  margin: 14px 0;
}
.grammar-response-part {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px;
  background: #fffdf8;
}
.grammar-response-part-heading { display: flex; align-items: baseline; gap: 8px; }
.grammar-response-part-number { color: var(--muted); font-size: 13px; }
.grammar-response-part-prompt { font-size: 21px; line-height: 1.4; }
.grammar-response-part-cue { display: block; font-size: 15px; margin: 8px 0; color: var(--muted); }
.grammar-response-part-cue strong { color: var(--accent); }
.grammar-response-part-input { box-sizing: border-box; width: 100%; }
.grammar-multipart-instruction { font-size: 17px; line-height: 1.5; margin: 12px 0; }
@media (max-width: 600px) {
  #strand-grammar .markpoint { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #strand-grammar .markpoint .bucket-description { font-size: 14px; }
  .grammar-response-part { padding: 12px; }
}

.result-you-wrote {
  margin: 4px 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.comparison { margin-top: 2px; font-size: 13.5px; }
.cmp-row { padding: 2px 0; }
.cmp-label { color: var(--muted); font-size: 12px; display: inline-block; min-width: 92px; }
.cmp-value { font-weight: 600; padding: 1px 7px; border-radius: 3px; }
.cmp-value.cmp-learner { color: var(--red); background: var(--red-soft); }
.cmp-value.cmp-correct { color: var(--green); background: var(--green-soft); }
.markpoint-explanation { margin-top: 6px; }

/* Glossary terms inside explanations: hoverable definition. */
.gloss-term {
  border-bottom: 1px dotted var(--accent);
  cursor: help;
  text-decoration: none;
}
.gloss-term:hover {
  background: var(--accent-soft);
}

.result-explanation {
  /* R8 (feedback_redesign_riders v4): explanations are set from authored text
     whose blank lines are the paragraph breaks; HTML and textContent both
     collapse them. pre-line renders authored newlines and is inert on today's
     single-block texts. */
  white-space: pre-line;
  margin-top: 12px;
  padding: 10px 14px 11px;
  background: white;
  border-left: 3px solid var(--accent);
  border-radius: 0 3px 3px 0;
  font-size: 14px;
  line-height: 1.5;
}
/* translation_feedback_display v1 §1: an explanation's authored **bold** is
   the key sentence and reads in ink; only the "Why:" label keeps the wine. */
.result-explanation strong { color: var(--ink); }
.result-explanation strong.why-label { color: var(--accent); }

/* Bucket tree (Browse view) */
.bucket-tree { font-size: 14px; }
.bucket-node { padding: 4px 0; }
.bucket-node .chev { display: inline-block; width: 14px; cursor: pointer; user-select: none; color: var(--faint); }
.bucket-node .label-row { display: flex; align-items: center; gap: 8px; }
.bucket-node .label { flex: 1; }
.bucket-node .level-pip {
  display: inline-block;
  width: 10px; height: 10px; border-radius: 50%; margin-left: 2px;
}
.bucket-node.collapsed > .children { display: none; }
.bucket-node .children { margin-left: 18px; border-left: 1px dotted var(--line); padding-left: 10px; }

/* ====================================================================
   Live stats (right-hand aside)
   ==================================================================== */

#live-stats {
  border-left: 1px solid var(--line);
  padding-left: 22px;
  max-height: calc(100vh - 140px);
  /* Independent scrolling: the coverage panel scrolls inside its own box,
     so reading it never drags the drill card off-screen (and vice versa). */
  overflow-y: auto;
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.live-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;             /* QoderWork 2026-07-22: strip wraps to its own line */
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.live-header .pulse-strip { flex-basis: 100%; }   /* QoderWork 2026-07-22: full-width own row */
.live-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.live-controls { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }   /* QoderWork 2026-07-22 */
.live-controls label { cursor: pointer; }

#live-stats-content {
  overflow-y: auto;
  font-size: 12px;
  flex: 1;
  padding-right: 4px;
  padding-top: 2px;
}

.live-overview {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.overview-cell {
  flex: 1 1 195px;
  min-width: 180px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  padding: 5px 6px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.overview-cell:hover { border-color: var(--accent); }
/* r219, Smith 2026-09-08: every group in the topics panel was reading as a single
   letter — C, T, D, A, N, W, I, R, Q — so no group was identifiable.
   CAUSE: .overview-meta was `flex: 0 0 auto` (cannot shrink) while .overview-label
   defaulted to `flex: 0 1 auto` (can). The meta text is long — "2 attempted of 66
   available questions" — so in a narrow tile the meta took its full intrinsic
   width and crushed the label below one character. The ellipsis never even showed,
   there being less than a character of room to put it in.
   The label is the tile's IDENTITY and must always be readable; the count is
   secondary and can drop to its own line. So the header wraps, the label carries a
   floor it cannot be squeezed under, and the meta is now the one that yields. */
.overview-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 6px;
}
.overview-label {
  flex: 1 1 auto;
  min-width: 6.5em;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}
.overview-meta {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: 0 1 auto;
  min-width: 0;
}
.overview-children {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
}
/* r222, Smith 2026-09-29: "look at the dots stretching behind." A topic's dot row
   ran straight out of its tile and painted across the tiles beside it, and the
   panel grew a horizontal scrollbar.
   CAUSE, and it is the same fault as the other two this round - an element free to
   size to its own content with nothing to shrink against. .overview-dots already
   said `flex-wrap: wrap`, but WRAPPING NEEDS A BOUNDARY TO WRAP AT, and .overview-mini
   was `flex: 0 0 auto` with a min-width and NO max-width. So the mini sized itself to
   however many dots the topic had, the dots never met an edge, and a verb form with
   sixty leaves simply drew a sixty-dot line through its neighbours.
   max-width gives the row the edge it was always looking for; min-width:0 lets the
   mini shrink inside a narrow column instead of forcing the column wider. */
.overview-mini {
  flex: 0 0 auto;
  max-width: 100%;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 3px 4px 4px;
}
.overview-mini:hover { border-color: var(--accent); }
.overview-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-height: 9px;
}
.overview-dot {
  width: 9px;
  height: 9px;
  border-radius: 1.5px;
  background: var(--bg);
  display: inline-block;
}

.live-bucket-row.jumped {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.legend {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.legend-row { display: flex; gap: 8px; align-items: center; padding: 2px 0; }
.legend-cell {
  width: 22px; height: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  display: inline-block;
  background: white;
}
.legend-cell.demo-green-full { background: var(--green); }
.legend-cell.demo-green-half { background: #97be9f; }
.legend-cell.demo-blue-full  { background: #4a89c7; }
.legend-cell.demo-blue-half  { background: #a4c4e3; }

.live-bucket-node { }
.live-bucket-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  min-height: 18px;
}
.live-bucket-row .chev {
  display: inline-block;
  width: 12px;
  cursor: pointer;
  user-select: none;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
  flex: 0 0 12px;
}
.live-bucket-row .label-text {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-bucket-row .pip {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: 0 0 6px;
}

.live-cell-pair {
  display: flex;
  gap: 3px;
  flex: 0 0 auto;
}
.live-cell-green, .live-cell-blue {
  width: 22px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
  flex: 0 0 22px;
}

.live-ratio {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  width: 34px;
  flex: 0 0 34px;
  font-variant-numeric: tabular-nums;
}
.live-ratio.empty { color: var(--faint); }

.last-n {
  display: flex;
  gap: 1px;
  width: 80px;
  flex: 0 0 80px;
  justify-content: flex-end;
  font-size: 11px;
  line-height: 1;
}
.last-n .mark {
  font-weight: bold;
  width: 8px;
  text-align: center;
}
.last-n .mark.hit { color: var(--green); }
.last-n .mark.miss { color: var(--red); }
.last-n .mark.dot { color: var(--line); }

.live-bucket-node.collapsed > .children { display: none; }
.live-bucket-node .children {
  margin-left: 10px;
  border-left: 1px dotted var(--line);
  padding-left: 8px;
}

.live-bucket-row.aggregate .label-text { color: var(--ink); }
.live-bucket-row.leaf .label-text { color: var(--muted); }
/* Freshness (grammar_view v8): .fresh is a MARKER only - the visible pulse
   is .fresh-flash, applied by scrollToFreshBuckets AFTER the scroll lands so
   the learner is looking at the tile when it fires. Slower and stronger than
   the old 600ms wash, which was over before the scroll arrived. */
.live-bucket-row.fresh-flash,
.overview-mini.fresh-flash { animation: fresh-flash-strong 1400ms ease-in-out 1; }
.overview-dot.fresh-flash { animation: fresh-dot-flash 1400ms ease-in-out 1; position: relative; z-index: 3; }
@keyframes fresh-dot-flash {
  0%   { transform: scale(1);   box-shadow: none; }
  20%  { transform: scale(1.9); box-shadow: 0 0 0 3px var(--accent); }
  45%  { transform: scale(1.2); box-shadow: 0 0 0 1px var(--accent); }
  65%  { transform: scale(1.9); box-shadow: 0 0 0 3px var(--accent); }
  100% { transform: scale(1);   box-shadow: none; }
}
@keyframes fresh-flash-strong {
  0%   { background: transparent;      box-shadow: none; }
  18%  { background: var(--amber-soft); box-shadow: 0 0 0 3px var(--accent); }
  45%  { background: transparent;      box-shadow: 0 0 0 1px var(--accent); }
  65%  { background: var(--amber-soft); box-shadow: 0 0 0 3px var(--accent); }
  100% { background: transparent;      box-shadow: none; }
}

/* Entry-screen loading state (entry_load_and_level_strip Defect 2): quiet
   line where the counts would go; replaced in place when content lands. */
.entry-loading { color: var(--muted); font-style: italic; margin: 10px 0; }

/* Vocab session builder (vocab_session_builder v3): two-lens frequency
   control, category chips, special-drills box. The inactive lens is greyed
   but LIVE - clicking anything in it switches lens; it must never read as
   disabled, hence the hover lift. */
.entry-lens { padding: 8px 10px; border-radius: 8px; margin: 4px 0; }
.entry-lens.lens-dim { opacity: 0.45; cursor: pointer; }
.entry-lens.lens-dim:hover { opacity: 0.8; }
.entry-lens-toggle { display: flex; gap: 6px; margin: 4px 0 2px; }
.entry-freq-inputs { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.entry-freq-inputs input[type="number"] { width: 84px; font-size: 16px; padding: 4px 6px; }
.entry-freq-inputs span { color: var(--muted); font-size: 13px; }
.entry-band-row .entry-chip { font-size: 12px; }
.entry-tier-row { margin-top: 4px; }
.entry-vocab-summary { color: var(--muted); font-size: 13px; margin: 6px 0 2px; }
.entry-special-drills { border: 1px solid rgba(128,128,128,0.35); border-radius: 8px; padding: 8px 12px 10px; margin-top: 14px; }
.entry-special-drills .entry-config-head { margin-top: 0; }

/* Choose-or-type chips (live_round ask 2): tappable stated choices beside
   the input; a tap submits exactly what typing would have. */
.stated-choice-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.stated-choice { font-size: 16px; padding: 8px 16px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--ink); cursor: pointer; }
.stated-choice:hover { background: var(--accent); color: #fff; }

/* MCQ key badges (live_round ask 3): the number that selects each choice. */
.mcq-key-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-right: 9px; border: 1px solid var(--line); border-radius: 50%; font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.mcq-choice { display: flex; align-items: center; text-align: left; }

/* Paradigm-person bands (person_split v2, orientation per Smith 2026-07-20):
   HORIZONTAL STACKS - each person is a thin horizontal bar, stacked
   vertically, io at the top through loro at the bottom; the dot doubles in
   height to make room. Untouched bars stay neutral. */
.overview-dot.person-split { width: 14px; height: 20px; background: var(--bg); display: inline-flex; padding: 0; }
.overview-dot-bands { display: flex; flex-direction: column; width: 100%; height: 100%; gap: 1px; }
.overview-dot-bands .person-band { flex: 1 1 0; background: #f3efe2; min-height: 1px; }
.row-person-bands { display: inline-flex; gap: 1px; margin-left: 8px; vertical-align: middle; }
.row-person-bands .person-band { width: 9px; height: 11px; border-radius: 2px; background: #f3efe2; border: 1px solid var(--line); }

/* Wide paradigms wrap into a small grid (paradigm_bands v1); the dot grows. */
.overview-dot-bands.paradigm-grid { flex-direction: row; flex-wrap: wrap; gap: 1px; }
.overview-dot-bands.paradigm-grid .person-band { flex: 0 0 3px; height: 4px; }
.overview-dot.person-split.grid { width: 34px; height: 18px; }
.row-person-bands.paradigm-grid { flex-wrap: wrap; max-width: 130px; }
.row-person-bands.paradigm-grid .person-band { width: 7px; height: 7px; }

/* Declared two-axis paradigms keep whole rows aligned. Article headings and
   preposition headings are readable; the coloured cells do not print answers. */
.overview-mini.has-paradigm-matrix { width: 100%; }
.overview-mini.has-paradigm-matrix > .overview-mini-label { white-space: normal; }
.overview-mini.has-paradigm-matrix .overview-dots { display: flex; flex-direction: column; gap: 8px; }
.overview-form-group { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; min-width: 0; width: 100%; }
.overview-form-label { font-size: 10px; color: var(--muted); line-height: 1.3; }
.overview-dot.person-split.matrix { display: block; width: 100%; height: auto; padding: 0; }
.overview-dot.matrix.fresh-flash { animation: fresh-flash-strong 1400ms ease-in-out 1; }
.overview-dot-bands.paradigm-matrix,
.row-person-bands.paradigm-matrix { display: flex; flex-direction: column; gap: 3px; width: 100%; max-width: 240px; height: auto; margin: 0; }
.paradigm-matrix-row { display: grid; grid-template-columns: 18px repeat(var(--paradigm-columns), minmax(0, 1fr)); gap: 3px; align-items: center; }
.paradigm-matrix-heading { color: var(--ink); font-size: 11px; font-style: normal; font-weight: normal; text-align: center; line-height: 16px; }
.paradigm-matrix-row > .person-band { display: block; min-width: 0; width: 100%; height: 14px; border: 1px solid var(--line); border-radius: 2px; }
.live-bucket-row.has-paradigm-matrix { flex-wrap: wrap; }
.live-bucket-row.has-paradigm-matrix > .label-text { white-space: normal; }
.row-paradigm-matrix { flex: 0 0 100%; min-width: 0; padding: 2px 0 5px 20px; }

/* Stable drilled-state anchor (drill_into_reach v2 defect 1): the box you
   are drilled into keeps a steady outline, so the single-box state reads as
   "you are here", not just a pulse per Mark. */
.live-bucket-row.drilled, .overview-cell.drilled { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }

/* In-session level toggles (entry_load_and_level_strip v4): set semantics in
   the filter bar, matching the welcome strip's mental model. */
.filter-chip-levels { display: inline-flex; align-items: center; gap: 3px; }
.level-toggle { font-size: 14px; padding: 4px 11px; border-radius: 11px; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--muted); }
.level-toggle.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.level-toggle:hover { border-color: var(--accent); }

/* Ratified category picker (display_theme_grouping v3/v4): section headers,
   sub-theme rows, and the "..." expander that reveals them. */
.entry-cat-section { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 10px 0 2px; }
.entry-cat-subrow { flex-basis: 100%; margin: 2px 0 4px 18px; }
.entry-cat-subrow .entry-chip { font-size: 12px; }
.entry-cat-expander { min-width: 26px; padding-left: 6px; padding-right: 6px; color: var(--muted); }

@keyframes flash {
  0% { background: var(--amber-soft); }
  100% { background: transparent; }
}

footer {
  border-top: 1px solid var(--line);
  padding: 7px 28px;
  display: flex;
  /* r140 gave the streak and build id a shared baseline; r141 stops the whole
     bar wrapping to three lines to do it. MY REGRESSION, measured: the footer
     went to 85px over 3 lines, and Smith saw the build id fall onto its own
     row. flex-wrap:wrap was the cause. Now: one line, nothing allowed to wrap,
     and the long middle status text is the piece that ellipsises if the window
     is narrow - it is the least load-bearing thing on the bar. */
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  overflow: hidden;
  justify-content: space-between;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
footer > span { white-space: nowrap; flex: 0 0 auto; }
footer > span:empty { display: none; }
footer > #content-status { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Narrow viewports: fold the live panel below */
@media (max-width: 1080px) {
  main { grid-template-columns: 1fr; }
  #live-stats { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 16px; position: static; max-height: none; }
}

/* ====================================================================
   Vocab strand multi-axis right-hand panel (frequency / gender / themes)
   ==================================================================== */
/* ============================================================================
   VOCAB QUADRANT LAYOUT (r130, Smith's ruling 2026-08-05: "you just have to
   make it and see what happens").

     question  |  themes
     freq      |  themes
     freq      |  strip

   THE PAGE MUST NEVER SCROLL. The body is sized to the viewport and every
   region owns its own overflow, so reading one panel can never move another -
   the r126 rule applied by construction rather than retrofitted.

   #vocab-axes-host is `display: contents`. That is deliberate and load-bearing:
   the axes renderer, the per-answer recolour, the flash and the drill panel all
   do `host.querySelector(...)`, i.e. they search DESCENDANTS. Keeping the
   element in the tree keeps all five lookups working untouched, while its three
   children (frequency, gender, themes) become direct grid items and can sit in
   different quadrants. Move those sections out of the host instead and the
   flash and recolour lookups quietly find nothing - no crash, just feedback
   that stops arriving.
   ============================================================================ */
#vocab-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* r135: the question row is a FIXED HEIGHT, not a share of one.
     r133 made it a `fr` share to stop the jump, and a share of a viewport that
     the header had already eaten was not enough to hold the card - Smith's shot
     shows Mark and Skip sliced in half and "literally no space to see even the
     right answer". A share cannot promise a minimum; a fixed track can.
     380px holds meta + prompt + input + buttons with room left for the result,
     the result scrolls inside .card-result, and because the track never changes
     size, answering still moves nothing. The frequency square takes what is
     left, which is the trade Smith already blessed ("that whole thing could be
     shrunk, it doesn't really affect it very much"). */
  /* r139: the frequency square shrinks, on Smith's instruction ("feel free to
     shrink the frequency thing... there's no way you're going to get it all in
     unless you do"). Question keeps its 330; the heatmap takes a smaller floor. */
  /* ==========================================================================
     r141 THE RULE CHANGED, and I had it wrong. Smith, 2026-08-06:
       "I don't mind if it scrolls. Why it's scrolling is better. Scrolling is
        better than clipping off things so you can't see them - way better."
       "we must have sufficient room for the card. That is the absolute number
        one thing... it's unusable as it is. It's broken."
     So no-scrolling was never the rule - it was a SYMPTOM of the real rule,
     which is: don't make the page taller than a normal screen, and never buy
     that by cutting the card. Where those fight, the card wins and the page
     scrolls.
     Measured on the live r140 page at a 791px viewport, which is how these
     numbers stopped being guesses:
       - the result box was 58px. Two lines. That is the "unusable".
       - the frequency square held 403px of content in a 226px box with
         overflow:hidden - 177px of the heatmap silently CUT OFF. It was never
         failing to shrink; it was being clipped.
       - 132px of grid was reserved for a gender strip that is not rendered at
         all on Italian->English, so an eighth of the page was held for nothing.
       - the axes header was an EMPTY white box costing 30px with its gap.
     Card row 330 -> 430. The strip and header rows collapse to nothing when
     empty (auto, not a fixed track), and the heatmap takes what is left.
     ========================================================================== */
  /* r203: 430 -> 380. The 430 bought room for the RESULT inside the card; since
     r184 a long result OVERLAYS the panel beneath instead, so the card's
     resting track only has to hold the prompt, the input, the buttons and a
     short verdict. The 50px goes to the frequency panel, which is why its
     square stopped scrolling inside its box. */
  grid-template-rows: 380px auto minmax(0, 1fr) auto;
  grid-template-areas:
    "question themes"
    "axeshead themes"
    "freq     themes"
    "freq     strip";
  gap: 12px 20px;
  /* r131: two bands reclaimed at the top (identity strip pinned, filter bar
     folded into the tab row), so the body gets them back. The question card and
     the frequency square must both show in full - neither may scroll. */
  /* dvh, not vh: on mobile the toolbars make vh lie and the strip falls off the
     bottom. The subtrahend is the three header bands + the footer, measured. */
  /* NO min-height. r135 set 700px and that is what made the page scroll: when
     the viewport could not give 700px the body took it anyway and everything
     below ran off. The grid must fit what there is, or the promise that nothing
     scrolls is not a promise. */
  /* r140: THE SUBTRAHEND IS NO LONGER GUESSED. 232px was measured against the
     three-band header; removing a band makes any hard-coded number wrong the
     same day, and re-tuning it after every layout change is exactly the loop
     that produced the jumping and then the scrolling. --chrome-h is written by
     measureChrome() from the real header + footer + main padding, on load and
     on resize, so this stays true whatever the top bar does next.
     The old `min-height: 460px` is GONE: a min-height is a promise the viewport
     may not be able to keep, and when it cannot, the page scrolls. */
  /* r141: BOTH, and the pair is the point.
     `height` stays DEFINITE, because the heatmap's row is a 1fr share and a
     share of an auto-height grid resolves to content size - measured: dropping
     to height:auto blew the frequency square out to 3,198px and the page to
     3,091px of overflow. That is the "bigger than a normal screen" failure.
     `min-height` then guarantees the card its 430px and the heatmap a floor, so
     on a short viewport the page SCROLLS rather than crushing the card. */
  height: calc(100dvh - var(--chrome-h, 232px));
  min-height: 580px;
}
/* The card fills its quadrant and never scrolls as a whole: the question, the
   input and the buttons are always on screen. Only the result region moves. */
/* ============================================================================
   r184 (2026-09-06) A GROWING RESULT OVERLAYS THE PANEL BENEATH IT. Smith's
   ruling, via Housing_Design_vocab_page_brief v5:
     "It just overwrites the thing beneath it. If it gets big, it just goes on
      top of it. It doesn't push it down, it goes on top of it, because the
      thing below can go. You're not having people scrolling to save some view."
   This retires the fixed-track-plus-inner-scrollbox above (r135-r142), which
   was the right answer to a constraint that no longer exists. That technique
   protected the frequency square by capping the mark; under the ruling the
   square is not worth protecting at the moment the learner is reading a mark.
   Mechanism, chosen for stillness: the grid track stays a fixed 430px and the
   host stays exactly that tall, so NOTHING in the grid is ever re-laid-out.
   The card inside is allowed to be taller than its host and to paint past it,
   over the frequency square, above it in stacking order. The square is never
   resized, hidden or scrolled, so when the mark collapses it is simply
   uncovered - scroll position intact, no repaint of its own.
   Cap: the card may grow to the column's full height. Only past THAT does it
   scroll internally - scrolling beats clipping, but a mark taller than the
   whole column is the pathological case, not the design case.
   ============================================================================ */
#vocab-host { grid-area: question; min-width: 0; min-height: 0; overflow: visible; display: flex; flex-direction: column;
              position: relative; z-index: 8; }
#vocab-host > .qcard { display: flex; flex-direction: column; flex: 0 0 auto;
                       min-height: 100%; box-sizing: border-box;
                       max-height: calc(100dvh - var(--chrome-h, 232px));
                       overflow-y: auto; }
#vocab-host .card-result { flex: 0 0 auto; min-height: 0; overflow: visible; }
/* The edge only reads as an edge once the card is over something. Toggled by
   app.js from a ResizeObserver on the card (offsetHeight > host height). */
#vocab-host > .qcard.is-overlaying { box-shadow: 0 12px 32px rgba(28,28,28,0.18); border-color: #c9bfae; }
/* ============================================================================
   r142 THE CARD'S OWN SPACE. Smith: "look at the space... it's just a mess",
   "there is so much space saving in that space... have it so big that there's
   never going to be a scroll". Measured on r141, the 408px card spent 66px on
   NOTHING - a 33px prompt line carried 40px of margin, the meta line 14 more,
   the buttons 12 - and 41px sat empty below the result while the result itself
   scrolled by 113px. Space was being held by the furniture and denied to the
   only part that carries meaning.
   The card's own margin-bottom (22px) also went unspent inside a fixed track.
   ============================================================================ */
#vocab-host > .qcard { margin-bottom: 0; padding: 16px 20px 10px; }
#vocab-host .result .markpoint { margin: 4px 0 2px; padding: 6px 8px; }
#vocab-host .qcard .meta { margin-bottom: 4px; font-size: 11.5px; }
#vocab-host .qcard .prompt { margin: 6px 0 10px; }
#vocab-host .qcard input[type=text] { margin-bottom: 2px; }
#vocab-host .qcard .actions { margin-top: 8px; }
#vocab-axes-host { display: contents; }
#vocab-practice-column { display: contents; }
#vocab-drill-summary[hidden] { display: none; }
/* A drill's question and overview share the left scroll area. Long feedback
   stays in flow above its statistics instead of covering another grid track. */
#vocab-body.drill-layout { grid-template-rows: minmax(0, 1fr); grid-template-areas: none; min-height: 0; }
#vocab-body.drill-layout #vocab-practice-column {
  display: flex; flex-direction: column; grid-column: 1; grid-row: 1 / -1;
  min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-gutter: stable; padding-bottom: 8px;
}
#vocab-body.drill-layout #vocab-host { flex: 0 0 auto; min-width: 0; }
#vocab-body.drill-layout #vocab-host > .qcard { min-height: 0; max-height: none; overflow: visible; box-shadow: none; }
#vocab-drill-summary { margin-top: 18px; flex: 0 0 auto; min-width: 0; }
#vocab-drill-summary .drill-session-summary { margin-top: 0; margin-bottom: 10px; }
/* r141: Smith - "What's that little bar above the frequency?" It was an EMPTY
   white bordered box: no content, but 8px of padding top and bottom, a border
   and a 12px grid gap, so ~30px of the page spent on nothing. It collapses when
   it has no children; when it does have some it looks as before. */
.vocab-axes-header { grid-area: axeshead; min-width: 0; }
.vocab-axes-header:empty { display: none; padding: 0; border: none; }
/* r141 THE FREQUENCY SQUARE. `overflow: hidden` meant the box did not shrink the
   heatmap, it AMPUTATED it - 990 dots wanting 403px inside a 226px box, with the
   bottom 177px simply gone and no scrollbar to say so. Two fixes, because either
   alone is wrong: the dots now scale from a variable so the square genuinely
   gets smaller, AND what still does not fit scrolls instead of vanishing. */
.vocab-axis-freq   { grid-area: freq;   min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; }
/* --freq-dot drives every dimension in the heatmap, so one number resizes it. */
#vocab-body { --freq-dot: 6px; }
.vocab-axis-themes { grid-area: themes; min-width: 0; min-height: 0; overflow-y: auto; padding-right: 4px; }
.vocab-axis-gender { grid-area: strip;  min-width: 0; min-height: 0; overflow-y: auto; }
/* Expanded (Smith 2026-08-05): it keeps its own strip and grows UPWARDS,
   stealing from the themes for the extra room - it never crosses into the
   question or the frequency square. Same column, more rows. */
.vocab-axis-gender.axis-expanded { grid-column: 2; grid-row: 2 / -1; overflow-y: auto; z-index: 1; }
.vocab-axis-gender.axis-expanded .vocab-cell { font-size: 13px; }
/* A drill replaces the whole right side with its own live breakdown. */
.drill-session-panel { grid-column: 2; grid-row: 1 / -1; min-height: 0; overflow-y: auto; }
/* When vocab strand is active, hide the live-stats aside entirely and let
   the vocab-axes panel claim the whole right side. */
body.strand-vocab-active main { grid-template-columns: 1fr; }
body.strand-vocab-active #live-stats { display: none; }

/* The r126 containment now lives on the SECTIONS (above), not on the host -
   `display: contents` means the host has no box to bound. Same guarantee,
   applied one level down: themes, strip and the question card each scroll
   inside themselves and the page itself never does. */

/* Superseded by the quadrant grid above (r130): the flex sizing here is inert
   inside a grid container and the gap is set once, with the layout. Kept only
   as a floor on the question column so a narrow window cannot crush the card. */
#vocab-host { min-width: 280px; }

/* r258 (Smith 17 Oct): the word range as a heavy black outline over the
   heatmap, word frequency only. app.js draws one SVG path per block along the
   edge of the cells in range (rangeOutlineSvg); it replaces the wine box
   outline a drilled hundred or ten used to get. Above the dots, never in the
   way of a hover or a click. */
.freq-focused, .freq-flanking { position: relative; }
.freq-range-outline {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  overflow: visible; pointer-events: none; z-index: 3;
}
.freq-range-outline path { fill: none; stroke: var(--ink); stroke-linecap: square; }

/* Active filter highlight on cells (theme / gender) */
.vocab-cell.filter-active {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Top-N dropdown — more prominent than the other filter-bar selects */
.filter-bar select.filter-bar-topn {
  padding: 5px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  background: white;
  border-radius: 3px;
}
.filter-bar-topn-label {
  font-weight: 600;
  color: var(--accent);
}

/* Axes header - number inputs + colour pickers + report button */
.vocab-axes-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
}
.vocab-numinput, .vocab-colinput {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vocab-input-label { color: var(--muted); font-size: 11px; }
.vocab-numinput input[type="number"] {
  width: 60px;
  padding: 2px 4px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.vocab-colinput input[type="color"] {
  width: 28px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
  cursor: pointer;
}
.vocab-palette-report {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  cursor: pointer;
}
.vocab-palette-report:hover { background: white; }
.vocab-filter-status {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  margin-top: 2px;
  font-size: 12px;
}
.vocab-filter-status-label { color: var(--accent); font-weight: 600; }
/* r143: in the filter bar it is one chip on the same line as Direction /
   Restrict to / Sub-band, not a full-width band with a dashed rule over it.
   The rule and the 100% basis were right for a strip of its own; up here they
   would put the bar onto a second line, which is the band we just removed. */
.vocab-filter-status-hoisted {
  flex-basis: auto; border-top: none; padding: 1px 4px 1px 9px; margin: 0;
  border: 1px solid var(--accent); border-radius: 12px;
  background: var(--accent-soft, #fff); gap: 7px;
}
.vocab-filter-status-hoisted .vocab-back-all {
  border: none; background: none; padding: 2px 6px; text-decoration: underline;
}
.vocab-back-all {
  padding: 3px 10px;
  border: 1px solid var(--accent);
  background: var(--accent-soft, white);
  color: var(--accent);
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
}

/* New focused dot-grid */
.freq-heatmap-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  background: transparent;
  padding: 0;
}
.freq-block-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.freq-block-col .freq-tick {
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.freq-block-col .freq-tick.focused {
  font-weight: 600;
  color: var(--accent);
}
.freq-focused {
  display: grid;
  grid-template-columns: repeat(10, auto);
  grid-template-rows: repeat(11, auto);
  /* Bigger horizontal gap than vertical so 3x3 blocks read as columns.
     r141: gaps scale with the dot so the square shrinks as a whole picture
     rather than becoming widely-spaced specks. */
  column-gap: calc(var(--freq-dot, 9px) * 0.78);
  row-gap: calc(var(--freq-dot, 9px) * 0.33);
  background: rgba(0,0,0,0.05);
  padding: 4px;
  border-radius: 3px;
}
.freq-focused-box {
  display: grid;
  grid-template-columns: repeat(3, var(--freq-dot, 9px));
  grid-template-rows: repeat(3, var(--freq-dot, 9px));
  gap: 0;
}
.freq-dot {
  width: var(--freq-dot, 9px);
  height: var(--freq-dot, 9px);
  background: rgb(236, 229, 210);
  border-radius: 0;
  cursor: default;
}
.freq-dot.not-curated {
  background: transparent;
  border: 1px dashed rgba(0,0,0,0.1);
  width: 6px;
  height: 6px;
}
.freq-dot:hover {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  z-index: 1;
  position: relative;
}
.freq-dot.flash {
  outline: 2px solid var(--accent);
  animation: vocab-cell-flash 0.8s ease-out;
}

/* Flanking blocks: 10x11 grid of small cells (sized inline by JS) */
.freq-flanking {
  background: rgba(0,0,0,0.05);
  padding: 4px 2px;
  border-radius: 3px;
  cursor: pointer;
  transition: outline 0.12s ease;
}
.freq-flanking:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.freq-flank-cell {
  background: rgb(236, 229, 210);
}
/* A flanking cell / lemma dot containing ANY practised lemma stays marked
   even when the aggregate colour is diluted (Smith 2026-07-21: a practised
   skill must not read as untouched). */
/* r139: the blue practised-ring is RETIRED (Smith: "let's retire the blue
   squares... it's totally swamping the colour"). It was meant to separate
   practised-but-poor from never-seen, but at this cell size the ring is most of
   the cell, so every practised word read blue first and its own red/green
   second. The colour already says it: untouched cells sit at the cream end of
   the ramp. Kept as a no-op rule rather than deleted so the classes still exist
   for anything that queries them. */
.freq-flank-cell.has-practice { box-shadow: none; }
.vocab-lemma-dot.has-practice { box-shadow: none; }
/* Gender drill: fixed-option classifier choices — compact 2-col grid.  QoderWork 2026-07-22 */
/* Gender drill, two tiers (r127). Seven equal buttons framed a two-way decision
   as a seven-way one - Smith: "it looks just intimidating". Masculine and
   Feminine lead at full size; the five split patterns are a quiet cluster. */
.gender-choices { display: flex; flex-direction: column; gap: 7px; border: 1.5px solid var(--border); border-radius: 8px; padding: 8px; background: var(--cream, #faf9f6); }
.gender-primary { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.gender-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.gender-secondary-cap { font-size: 11.5px; color: var(--muted); font-style: italic; padding-left: 2px; }
.gender-choice { display: flex; align-items: baseline; gap: 5px; text-align: left; font-size: 13px; padding: 5px 8px; }
.gender-choice.gc-primary { align-items: center; justify-content: center; gap: 9px; text-align: center; font-size: 25px; font-weight: 700; padding: 18px 12px; line-height: 1.15; }
.gender-choice.gc-primary .gc-num { font-size: 13px; opacity: 0.55; }
.gender-choice.gc-secondary { font-size: 12px; padding: 5px 7px; }
.gender-choice .gc-num { font-weight: 700; color: var(--accent); font-size: 10px; min-width: 1.1em; opacity: 0.7; }
.gender-choice .gc-label { font-weight: 600; line-height: 1.25; }
.gender-choice .gc-label { min-width:0; overflow-wrap:anywhere; }
.gender-choice.gc-correct { outline: 2px solid var(--green); background: var(--green-soft); }
.gender-choice.gc-wrong { outline: 2px solid var(--red); background: var(--red-soft); }
.gd-lemma { color: var(--accent); }
.gd-reveal:empty { display:none; }
.gd-reveal { margin-top:12px; }
.gd-declension { margin-top:6px; padding:10px 14px; font-size:16px; line-height:1.45; font-weight:400; background:var(--cream, #faf9f6); border-radius:6px; border:1px solid var(--border); border-left:4px solid var(--accent); overflow-wrap:anywhere; }
.gd-form-line + .gd-form-line { margin-top:3px; }
.gd-italian { font-weight:600; }
.gd-translation { font-weight:500; }
.gd-answered .gender-choices { gap:5px; padding:6px; }
.gd-answered .gender-choice.gc-primary { font-size:20px; padding:10px 8px; }
.gd-pattern { margin-top: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; line-height: 1.45; }
.gd-pattern-title { display: block; font-size: 15px; }
.gd-pattern p { margin: 5px 0 0; }
.gd-pattern-examples { font-weight: 600; }
.gd-pattern-note { color: var(--muted); }

/* Spelling drill: MCQ discrimination choices.  QoderWork 2026-07-22 */
.spelling-choices { border: 1.5px solid var(--border); border-radius: 8px; padding: 8px; background: var(--cream, #faf9f6); }
.spelling-choice { display: flex; align-items: baseline; gap: 6px; text-align: left; font-size: 15px; padding: 7px 10px; }
.spelling-choice .gc-num { font-weight: 700; color: var(--accent); font-size: 10px; min-width: 1.1em; opacity: 0.7; }
.spelling-choice .gc-label { font-weight: 600; line-height: 1.3; }
.spelling-choice.gc-correct { outline: 2px solid var(--green); background: var(--green-soft); }
.spelling-choice.gc-wrong { outline: 2px solid var(--red); background: var(--red-soft); }
.stress-choice.gc-correct { outline: 2px solid var(--green); background: var(--green-soft); }
.stress-choice.gc-wrong { outline: 2px solid var(--red); background: var(--red-soft); }
.mcq-choice.correct-pick { background:#e9f6ee; border-color:#2e7d4f; color:#1b5e33; font-weight:600; }
.mcq-choice.wrong-pick { background: var(--red-soft); border-color: var(--red); color: var(--red); }
/* Keep the post-mark reveal colour on hover (don't let :hover repaint it). */
.mcq-choice.correct-pick:hover { background:#e9f6ee; border-color:#2e7d4f; box-shadow:none; }
.mcq-choice.wrong-pick:hover { background: var(--red-soft); border-color: var(--red); box-shadow:none; }
.mcq-choice.gc-correct:hover, .stress-choice.gc-correct:hover, .mcq-choice.ms-correct:hover { background:rgba(46,125,79,0.12); border-color:#2e7d4f; box-shadow:none; }
.mcq-choice.gc-wrong:hover, .stress-choice.gc-wrong:hover, .mcq-choice.ms-wrong:hover { background: var(--red-soft); border-color: var(--red); box-shadow:none; }
.mcq-choice.ms-missed:hover { background:rgba(200,118,24,0.1); border-color:#c87618; box-shadow:none; }
/* Retrieval-help pilot bar (prominent "don't know the word?"). */
.retrieval-help-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:8px 0; padding:10px 14px; background:#eaf1fb; border:1px solid #b9d0ef; border-radius:8px; font-size:14px; }
.retrieval-help-q { color:#25406b; }
.retrieval-help-reveal { font-weight:600; padding:5px 14px; border:1px solid #3a6bbf; border-radius:6px; background:#3a6bbf; color:#fff; cursor:pointer; }
.retrieval-help-reveal.revealed { background:#fff; color:#25406b; border-style:dashed; cursor:default; font-style:italic; }

/* r148: the old .freq-tick-row block lived here and is DELETED. Nothing has
   built a .freq-tick-row since the heatmap became per-block columns, but
   `.freq-tick.focused { width: 341px }` still matched the live tick - and a
   .freq-block-col is as wide as its widest child, so the 1-990 column was
   341px wide to hold a 30px label under a ~230px grid. 111px of nothing,
   which is the "<1000 bit takes up space it shouldn't" Smith reported. The
   341 was computed for 9px dots and r141 made the dot a variable, so it had
   been a lie since. The live tick styling is .freq-block-col .freq-tick,
   above; the tick now sizes to its text and centres under its own block. */

.vocab-axis {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  background: white;
}
.vocab-axis-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}
.vocab-axis-name {
  font-weight: 600;
  color: var(--accent);
}
.vocab-axis-focus {
  font-size: 11.5px;
  color: var(--muted);
}

/* r186 frequency panel furniture (Design round 3 as Smith steered it):
   the corpus in three numbers on the title line, the running-Italian figure
   on its own line, a rail under the field, and a caption. The title row now
   wraps its right-hand items rather than truncating the name. */
.vocab-axis-freq .vocab-axis-title { flex-wrap: wrap; gap: 4px 10px; }
.freq-lines { margin: -4px 0 4px; }
.freq-line { font-size: 12px; color: var(--muted); line-height: 1.35; }
.freq-line strong { font-size: 14.5px; color: var(--ink); font-weight: 600; }
.freq-line-sel { color: var(--ink); }
/* r202 vocabulary coverage in the live-stats panel (grammar + translation) */
.overview-vocab-coverage { margin: 14px 0 4px; padding: 10px 10px 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.overview-vocab-coverage-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 13px; }
/* r219: each band packs its own words to the LEFT - right, then wrong, then the
   blank tail of what has not been met. Taller than 14px because there are now
   three things to read inside each band instead of one flat average. */
.vocab-cov-strip { display: flex; gap: 2px; height: 20px; }
.vocab-cov-cell { flex: 1 1 0; min-width: 0; border-radius: 2px; cursor: pointer; border: 1px solid rgba(0,0,0,.06); overflow: hidden; background: transparent; }
.vocab-cov-cell:hover { outline: 2px solid var(--accent); outline-offset: -1px; }
.cov-pack { display: flex; width: 100%; height: 100%; }
.cov-seg { display: block; height: 100%; min-width: 0; flex-basis: 0; }
.cov-seg.right { background: #235c3c; }          /* the house green the dots use */
/* r240, Smith's ruling 9: a half-right word (0.20 to 0.70) is its own segment,
   PART-FILLED - green to just over half its height on the blank tail's cream - so
   it reads as partly known rather than as a third colour. Design owns
   --green-partial (provisional). */
.cov-seg.half { background: linear-gradient(to top, var(--green-partial, #5d9a77) 0 55%, #eee8dc 55% 100%); }
.cov-seg.wrong { background: var(--red, #8c2f39); }
.cov-seg.unmet { background: #eee8dc; }          /* the blank tail: the point of the picture */
/* Dot mode, used only when a band is wide enough to give every word its own
   pixel or two. Wraps into rows so the "dotiness" reads at any height. */
.cov-pack.dots { flex-wrap: wrap; align-content: flex-start; gap: 1px; }
.cov-dot { flex: 0 0 2px; height: 2px; border-radius: 50%; }
.cov-dot.right { background: #235c3c; }
.cov-dot.half { background: var(--green-partial, #5d9a77); }
.cov-dot.wrong { background: var(--red, #8c2f39); }
.cov-dot.unmet { background: #ded7c4; }
.vocab-cov-ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); margin: 3px 0 4px; }
.overview-vocab-coverage .freq-lines { margin: 4px 0 0; }
.overview-vocab-coverage .freq-line { font-size: 11.5px; }
.overview-vocab-coverage .freq-line strong { font-size: 13px; }
/* r202 grammar: the topic revealed after the go; translation: the marker line */
.result-topic-reveal, .result-marker-line { margin-top: 10px; font-size: 12.5px; color: var(--ink); }
.result-topic-key { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-right: 6px; }
.result-topic-leaf { color: var(--muted); }
.score-feeds { font-size: 11px; color: var(--faint); font-style: italic; margin-left: 8px; }
/* r208 question types, grammar live panel */
.overview-qtypes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 4px 0 10px; font-size: 12px; color: var(--muted); }
.overview-qtypes-title { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.overview-qtype strong { color: var(--ink); font-weight: 600; }
/* r216 question types under the grammar card (Design) */
.card-foot-qtypes { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.card-foot-key { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-right: 4px; }
.qtype-chip { font-size: 11.5px; color: var(--accent); border: 1px solid var(--accent-soft); background: transparent; border-radius: 999px; padding: 2px 9px; }
/* r216 the live panel on grammar / translation: a named panel with packed
   columns (Design: "packed-column topic cards, each carrying a grid so mass
   is felt, not stated"), no pulse strip, no last-10, no proficient note. */
.live-subtitle { font-size: 11.5px; color: var(--muted); font-style: italic; margin: -6px 0 8px; }
body:not(.strand-vocab-active) #live-stats .pulse-strip,
body:not(.strand-vocab-active) #live-stats #last10-row,
body:not(.strand-vocab-active) #live-stats .proficient-note,
body:not(.strand-vocab-active) #live-stats .analysis-open-link { display: none; }
/* r219, Smith 2026-09-08: "there's a problem with how this is rendering here so you
   don't know what all these things are."  This rule was CSS multi-column, and
   multi-column fragments OVERLAP when a child is taller than the column can take —
   which is what put the spelling cards (Digraphs, Hard vs soft c/g, qu/cu/cqu) on
   top of the Present indicative and Passato prossimo rows in his screenshot.
   `break-inside: avoid` is a request, not a guarantee, and r216 narrowing this
   column to 46% is what made it start failing.
   Grid items cannot overlap, so the fault is now structurally impossible rather
   than tuned away — the same move as r206 on the rail: replace two things that can
   disagree with one that cannot. auto-fill keeps Design's packed columns and takes
   whatever count the width allows. */
.live-overview .overview-category-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 8px;
  align-items: start;
}
/* r222: grid items default to `min-width: auto`, so one over-wide child widens
   its whole column rather than being made to fit - which is where the panel's
   horizontal scrollbar came from. */
.live-overview .overview-category-group > * { margin-bottom: 0; min-width: 0; }
/* r216: the practice column and the topics column share the width closer to Design's grammar page (~54/46) */
main { grid-template-columns: minmax(0, 1fr) minmax(440px, 46%); }

.freq-rail-cell { display: block; width: 100%; height: 9px; margin-top: 3px; padding: 0; border: 1px solid var(--line); background: #f1ece2; border-radius: 1px; cursor: pointer; box-sizing: border-box; }
.freq-rail-cell:hover { border-color: var(--muted); }
.freq-rail-cell.scope { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.freq-rail-cell.view { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #fff; }
.freq-rail-cell.view.scope { box-shadow: inset 0 0 0 1px var(--ink), 0 0 0 1px var(--accent); }
.freq-caption { display: flex; justify-content: space-between; gap: 10px; margin-top: 3px; font-size: 11px; color: var(--muted); flex-wrap: wrap; line-height: 1.3; }
.freq-caption-legend { color: var(--faint); font-style: italic; }
.axis-legend { display: inline-flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend-sq { display: inline-block; width: 9px; height: 9px; border-radius: 1px; margin: 0 3px 0 6px; box-sizing: border-box; vertical-align: -1px; }
.legend-sq.scope { border: 1.5px solid var(--accent); }
.legend-sq.view { border: 1.5px solid var(--ink); }

/* r186 THE RULES STRIP: four chips, two numbers each (rule-mean shaded white
   to green with the depth capped so black text always reads; running Italian
   in plain digits), over a ~4px unnumbered coverage strip. Provisional rules
   carry the dagger and no numbers. The open rule's breakdown sits beneath. */
.rules-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 2px 0 8px; }
.rule-chip { text-align: left; font-family: inherit; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px 6px; min-width: 0; cursor: pointer; color: var(--ink); }
.rule-chip:hover { border-color: var(--accent); }
.rule-chip.open { border-color: var(--accent); background: var(--accent-soft); }
.rule-chip.provisional { cursor: default; color: var(--muted); background: transparent; }
.rule-chip.provisional:hover { border-color: var(--line); }
.rule-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.rule-name { font-weight: 600; font-size: 13px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-mean { font-size: 12.5px; font-weight: 600; padding: 1px 5px; border-radius: 3px; color: var(--ink); }
.rule-running { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rule-dagger { color: #9a6a00; font-size: 12px; }
/* r219: the strip is now one block per constituent rule, equal width because the
   aggregation weights every rule equally. 4px could not be hovered reliably, and
   Smith's ask is explicitly a hover affordance, so it grows to 9px. */
.rule-strip { display: flex; gap: 1px; height: 9px; background: #eee8dc; border-radius: 2px; margin: 5px 0 4px; overflow: hidden; }
.rule-strip-fill { height: 100%; background: #c9b99a; border-radius: 2px; }
.rule-seg { flex: 1 1 0; min-width: 0; height: 100%; background: #f3efe2; cursor: help; }
.rule-seg.unmet { background: #e6e0d0; }
.rule-seg:hover { outline: 1px solid var(--ink); outline-offset: -1px; position: relative; z-index: 2; }
.rule-chip.provisional .rule-strip { opacity: .5; }
.rule-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* r209 the rule pop-open: head line + one row per class, house table style */
.rule-pop { margin: 2px 0 8px; }
.rule-pop-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.rule-pop-name { font-weight: 600; color: var(--accent); }
.rule-pop-nums { margin-left: auto; display: inline-flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.rule-pop-nums strong { color: var(--ink); font-weight: 600; margin-left: 4px; }
.rule-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rule-table th { font-weight: 600; color: var(--muted); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.rule-table th.l, .rule-table td.l { text-align: left; }
.rule-table td { padding: 4px 6px; text-align: center; vertical-align: middle; border-bottom: 1px solid #f0ebe0; color: var(--ink); font-variant-numeric: tabular-nums; }
.rule-table td.muted { color: var(--faint); font-style: italic; }
.rule-row { cursor: pointer; }
.rule-row:hover td { background-color: #faf6ee; }
.rule-row.filter-active td.l { color: var(--accent); font-weight: 600; }
.rule-row.bin td.l { color: var(--muted); }
.rule-row-sub { font-size: 10.5px; color: var(--muted); font-style: italic; }

.vocab-heatmap {
  display: flex;
  align-items: stretch;
  gap: 1px;
  height: 220px;
  background: var(--line); /* shows as thin separator between strips */
  padding: 0;
  overflow-x: auto;
}
.vocab-strip {
  flex: 0 0 auto;
  cursor: pointer;
  transition: outline 0.12s ease, transform 0.12s ease;
  outline: 0 solid transparent;
}
.vocab-strip.in-focus  { width: 22px; }
.vocab-strip.out-focus { width: 4px; opacity: 0.85; }
.vocab-strip:hover { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; position: relative; }
.vocab-strip.flash {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  animation: vocab-strip-flash 0.7s ease-out;
}
@keyframes vocab-strip-flash {
  0%   { box-shadow: 0 0 0 6px rgba(74,137,199,0.55); }
  100% { box-shadow: 0 0 0 0   rgba(74,137,199,0);   }
}

.vocab-heatmap-ticks {
  display: flex;
  align-items: flex-start;
  gap: 1px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  height: 14px;
}
.vocab-tick.in-focus  { width: 22px; text-align: right; padding-right: 2px; }
.vocab-tick.out-focus { width: 4px; overflow: hidden; }

.vocab-axis-gender, .vocab-axis-themes {
  min-height: 48px;
}
.vocab-axis-toggle {
  font-size: 11px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  border-radius: 3px;
  cursor: pointer;
}
.vocab-axis-toggle:hover { background: var(--bg); }

.vocab-cellgrid-host {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vocab-cellgrid-section { }
.vocab-cellgrid-title {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.vocab-cellgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}
.vocab-cell {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 3px;
  padding: 5px 7px;
  font-size: 11.5px;
  cursor: default;
  position: relative;
  background: white;
  transition: outline 0.12s ease;
}
.vocab-cell.avg-mode {
  min-height: 36px;
  min-width: 120px;
  max-width: 200px;
  flex: 0 0 auto;
}
.vocab-cell.dot-mode {
  background: white;
  min-width: 96px;
  flex: 0 0 auto;
}
.vocab-cell:hover { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.vocab-cell-head { display: flex; flex-direction: column; }
.vocab-cell-label { font-weight: 600; line-height: 1.2; }
.vocab-cell-meta { font-size: 10px; color: rgba(0,0,0,0.55); margin-top: 1px; }
/* r189 averaged themes: a segmented strip (one segment per slice of the theme's
   words, coloured by that slice's own average) and the honest note beneath. */
.vocab-cell-avgstrip { display: flex; gap: 1px; height: 5px; margin-top: 5px; border-radius: 2px; overflow: hidden; }
.vocab-cell-avgseg { flex: 1 1 0; min-width: 0; }
.vocab-cell-avgseg.untouched { opacity: .55; }
.vocab-cell-avgnote { font-size: 9.5px; color: rgba(0,0,0,0.5); font-style: italic; margin-top: 3px; }
/* r213 the themes hierarchy: two navigations, parents with folding children */
.vocab-axis-navtitle { font-family: Fraunces, Georgia, serif; font-size: 14px; font-weight: 600; color: var(--ink); margin: 10px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--line); }
.vocab-cell-kids { margin-left: 6px; font: inherit; font-size: 10.5px; color: var(--accent); background: transparent; border: 1px solid var(--accent-soft); border-radius: 999px; padding: 0 6px; cursor: pointer; vertical-align: 1px; }
.vocab-cell-kids:hover, .vocab-cell-kids.open { background: var(--accent-soft); }
.vocab-cell.vocab-cell-child { margin-left: 14px; border-left: 3px solid var(--accent-soft); }
.vocab-cell.vocab-cell-parent-only { border-style: dashed; }
/* r197 a dictionary bin: muted ground, no score */
.vocab-cell.bin-mode { background: #f6f2ea; border-style: dashed; }
.vocab-cell-binwhy { font-size: 9.5px; color: rgba(0,0,0,0.5); font-style: italic; margin-top: 3px; }
.vocab-cell-binbias { font-size: 10.5px; color: var(--ink); margin-top: 3px; }
.vocab-cell-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 4px;
  max-width: 132px;
}
.vocab-lemma-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: rgb(236, 229, 210);
}
.vocab-lemma-dot:hover {
  outline: 2px solid var(--accent);
  z-index: 1;
  position: relative;
}
.vocab-lemma-dot.flash {
  outline: 2px solid var(--accent);
  animation: vocab-cell-flash 0.8s ease-out;
}
.vocab-cell.flash {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  animation: vocab-cell-flash 0.8s ease-out;
}
@keyframes vocab-cell-flash {
  0%   { box-shadow: 0 0 0 8px rgba(74,137,199,0.55); }
  100% { box-shadow: 0 0 0 0   rgba(74,137,199,0);   }
}

/* Vocab strand narrow: stack axes below the card */
@media (max-width: 1200px) {
  #vocab-body { display: block; height: auto; min-height: 0; }
  #vocab-host, .vocab-axis-freq, .vocab-axis-themes, .vocab-axis-gender, .drill-session-panel {
    overflow: visible; max-height: none; margin-bottom: 14px;
  }
  /* Stacked: nothing sits beside the card to overlay, so the card simply grows
     in flow. Release the desktop cap and the overlay shadow. */
  #vocab-host > .qcard { max-height: none; min-height: 0; overflow: visible; }
  #vocab-host > .qcard.is-overlaying { box-shadow: none; }
  /* Stacked layout: the panel sits BELOW the card, so it is no longer competing
     with it for the viewport and an inner scrollbox would just be a second
     scroll trap. Release the desktop containment. */
  #vocab-axes-host { width: 100%; max-width: 100%; position: static; max-height: none; overflow-y: visible; }
  #vocab-body.drill-layout #vocab-practice-column { display: block; overflow: visible; padding: 0; }
  #vocab-drill-summary { margin: 18px 0 24px; }
}

/* MCQ choices (Bug 1 fix, 2026-05-28) */
.mcq-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.mcq-choice {
  text-align: left;
  padding: 10px 14px;
  font-size: 17px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: background-color 60ms ease, border-color 60ms ease;
}
.mcq-choice:hover {
  background: var(--cream);
  border-color: var(--accent);
}
.mcq-choice:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mcq-choice.selected {
  background: var(--accent-soft, #e8f0fb);
  border-color: var(--accent);
  font-weight: 500;
}

/* Error-ID qtype: sentence words as inline tappable tokens.  QoderWork 2026-07-22 */
.errorid-words {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline;
  margin: 14px 0; font-size: 18px; line-height: 1.6;
}
.errorid-word {
  font: inherit; font-size: 18px; padding: 3px 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 5px;
  cursor: pointer; color: var(--text);
  transition: background-color 60ms ease, border-color 60ms ease;
}
.errorid-word:hover { background: var(--cream); border-color: var(--accent); }
.errorid-word:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.errorid-word.selected { background: var(--accent-soft, #e8f0fb); border-color: var(--accent); font-weight: 600; }
.errorid-word.correct-pick { background: #e6f4ea; border-color: var(--green); color: var(--green); font-weight: 600; }
.errorid-word.wrong-pick { background: var(--red-soft, #fdeaea); border-color: var(--red); color: var(--red); }
.errorid-word.reveal-correct { background: #e6f4ea; border-color: var(--green); font-weight: 600; }

/* Usage notes block in the vocab result panel (rendered from the curated
   entry's `usage_notes` array). Sits beneath the markpoint rows; styled
   distinctly from the canonical Right answer so the learner reads it
   as supplementary information, not as additional correct answers.
   See inter_chat/Architecture_Housing_usage_notes_rendering.md. */
.result-usage-notes {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent-soft, #d5dff0);
  background: var(--cream, #faf7ef);
  border-radius: 3px;
}
.result-usage-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #6a6a6a);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.result-usage-line {
  font-size: 14px;
  line-height: 1.5;
  margin: 2px 0 2px 4px;
}
.result-usage-line .cmp-sense {
  color: var(--text, #1f1f1f);
  font-weight: 500;
}
.result-usage-line .cmp-usage {
  color: var(--muted, #555);
  font-style: italic;
}

/* Phrase-level note from a graded any_phrases match (e.g. "tolerated but
   standard is sagge"). Italic muted, smaller than the explanation, sits
   close to the matched/evidence line.
   See inter_chat/Architecture_Housing_engine_graded_any_phrases.md. */
.markpoint-phrase-note {
  font-size: 13px;
  font-style: italic;
  color: var(--muted, #6a6a6a);
  margin-top: 2px;
}
.markpoint-phrase-note .cmp-label {
  font-style: normal;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* Load-failure banner. Shows above the content when a required data file
   failed to load. End-user friendly text; no jargon. Inline Refresh +
   dismiss. See inter_chat/Architecture_Housing_cache_busting_and_data_load_messaging.md. */
.load-failure-banner {
  /* A warning is a row above practice, never one of the two practice columns. */
  grid-column: 1 / -1;
  align-self: start;
  justify-self: stretch;
  min-width: 0;
  box-sizing: border-box;
  margin: 0 0 12px;
  max-width: none;
  padding: 10px 14px;
  background: #fff4e0;
  border: 1px solid #e6b96a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.load-failure-banner[hidden] { display: none; }
.load-failure-banner .load-failure-msg {
  flex: 1;
  color: #5a3d10;
}
.load-failure-banner .load-failure-reload {
  background: #c87618;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}
.load-failure-banner .load-failure-reload:hover {
  background: #a85f0d;
}
.load-failure-banner .load-failure-dismiss {
  background: transparent;
  color: #8a7a55;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  font-family: inherit;
}
.load-failure-banner .load-failure-dismiss:hover { color: #5a3d10; }

#build-version { font-size: 13px; font-style: italic; opacity: 0.85; }
#update-ready { align-self: center; font-size: 12px; }
#update-ready[hidden] { display: none; }

/* Quiet 30-day practice grid (Smith 2026-07-20): 6x5, one cell per day,
   newest bottom-right; today gets a faint ring. Deliberately undemonstrative. */
#streak-host { display: inline-flex; align-items: center; gap: 8px; margin-left: 12px; height: 20px; }
/* r141: the streak's little grid was 6px cells over as many rows as it needed,
   which made it 38px tall - it, alone, was setting the footer's height and it is
   what Smith saw as the streak "lumped on top of" the build id. Nothing else on
   that bar is over 19px. 4px cells, and the grid is capped so a long history
   cannot grow the footer. */
/* r142: r141 shrank this to 4px to stop it setting the footer's height, and it
   went too far - Smith: "it's so small... the streak thing has completely gone
   wrong, it just needs a little more room". So it gets its room back at 5px AND
   goes hard right, past the build id, where nothing else competes for the space.
   Capping the height is what stops it dictating the bar; shrinking it was never
   the necessary part. */
/* r148, Smith ("last 30 grid looks like last 21; prefer 5x6 than 3x7"). It
   WAS last 21: 7 columns of 30 cells is 5 rows, and max-height:20px with
   align-content:center showed the middle 3 rows and clipped the rest - the
   newest days among them. Now 6 columns x 5 rows = exactly 30, nothing
   hidden. The height cap moves to the HOST instead, so the grid can be its
   full 31px and still not set the footer's height (r141's real finding);
   it overflows into the footer's own 7px padding, which was empty. */
.streak-grid { display: grid; grid-template-columns: repeat(6, 5px); grid-auto-rows: 5px; gap: 1.5px;
  align-content: center; }
.streak-day { background: #e9e5d8; border-radius: 1.5px; }
.streak-day.did { background: var(--accent); opacity: 0.55; }
.streak-day.today { box-shadow: 0 0 0 1px var(--accent); }
.streak-label { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* r148: a scope control that has been overridden by the other one. Dimmed,
   not disabled - see the comment at its use site. */
/* r150, Smith: "just a light dimming would do it". r148 went to 0.4/0.45,
   which reads as disabled rather than as standing down - and it is not
   disabled, you can still click straight into it. */
.filter-bar-topn-label.scope-off { opacity: 0.62; }
.filter-bar-topn.scope-off { opacity: 0.68; }

/* Inline segment lines (live_round2 ask 2): operand quotes flow with their
   instruction; the italian styling still marks them out within the line. */
.prompt-segment-line { display: block; }
.qcard .prompt .prompt-segment-line > .prompt-segment { display: inline; margin: 0; }
.qcard .prompt .prompt-context { font-size: 18px; color: var(--muted); }

/* Unmissable accent banner (live_round2 ask 3): full marks stand, the slip
   does not hide. Amber family, distinct from right/wrong colouring. */
.accent-slip-banner { display: flex; align-items: baseline; gap: 8px; margin: 8px 0; padding: 8px 12px; background: var(--green-soft); border-left: 4px solid var(--green-partial); border-radius: 4px; font-size: 15px; }
.accent-slip-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #a06f0a; font-weight: 600; }
.accent-slip-banner s { opacity: 0.7; }
.accent-slip-word { font-size: 17px; color: #7a5502; }

/* Estate sign-in (shared_login_and_pulse v1): quiet identity block in the
   header; the pill says whether pulses are reaching the class sheet. */
/* r131: pinned inside the header, top right. Costs no vertical band of its own
   and no longer scrolls away while the sticky header stays put. */
/* r140: a flex item at the end of the single header row, not an absolutely
   positioned overlay. The overlay only worked while the header had a spare band
   above the tabs; with one band it sat on top of the filter bar. */
#identity-box { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 12px; background: transparent;
  flex: 0 0 auto; align-self: center; white-space: nowrap; }
.identity-who { color: var(--ink); }
.identity-signin, .identity-save { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.identity-name { width: 120px; font-size: 13px; padding: 3px 6px; }
.identity-class { font-size: 13px; }
.identity-edit { font-size: 11px; }
.pulse-pill { font-size: 11px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); }
.pulse-pill.ok { border-color: #7fae7f; color: #2e6b2e; }
.pulse-pill.bad { border-color: #c98383; color: #8c3232; }

/* Sign-in gate (Smith 2026-07-20: compulsory, light). */
.entry-gate-form { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.entry-gate-form .identity-name { width: 220px; font-size: 18px; padding: 8px 10px; }
.entry-gate-form .identity-class { font-size: 16px; padding: 7px; }
.entry-gate-form .identity-save { font-size: 16px; padding: 8px 20px; }
.proficient-note { font-size: 11px; color: var(--muted); }   /* QoderWork 2026-07-22 */

/* Pulse strip: 9 full-width boxes (5 vocab + ACC/STR/GEN/SP).  QoderWork 2026-07-22 */
.pulse-strip { display: flex; gap: 3px; margin: 2px 0 8px; width: 100%; }
.strip-box9 { flex: 1; display: flex; align-items: center; justify-content: center; height: 28px; border-radius: 4px; background: #eceadf; border: 1px solid var(--line); cursor: default; position: relative; overflow: hidden; }
.strip-box9[data-kind="vocab"] { cursor: pointer; }
.strip-box9-label { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; z-index: 1; }
.flash-good { animation: strip-good 900ms ease-out 1; }
.flash-bad { animation: strip-bad 900ms ease-out 1; }
.flash-warm { animation: strip-warm 900ms ease-out 1; }
@keyframes strip-good { 0% { background: #2f8f4e; } 100% {} }
@keyframes strip-bad { 0% { background: var(--red); } 100% {} }
@keyframes strip-warm { 0% { background: #d99a1b; } 100% {} }

/* Second-chance prompt — inline beneath the input on a chip-stem-mismatch
   wrong answer. Kind tone, never chiding. Enter confirms, Esc retries.
   See inter_chat/Architecture_Housing_second_chance_on_chip_mismatch.md. */
.second-chance-prompt {
  margin: 10px 0;
  padding: 12px 14px;
  background: #fff8e6;
  border: 1px solid #e6c878;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  outline: none;
}
.second-chance-msg {
  flex: 1;
  color: #5a3d10;
  line-height: 1.4;
}
.second-chance-msg strong {
  color: var(--accent);
  font-weight: 700;
}
/* Residue prompt: wraps to accommodate the review note.  QoderWork 2026-07-22 */
.residue-prompt { flex-wrap: wrap; }
.residue-review-note {
  flex-basis: 100%; font-size: 12px; font-style: italic;
  color: #7a5502; margin-top: -4px;
}
.second-chance-confirm,
.second-chance-retry {
  border: 1px solid #c87618;
  border-radius: 3px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  background: white;
  color: #5a3d10;
}
.second-chance-confirm {
  background: #c87618;
  color: white;
}
.second-chance-confirm:hover { background: #a85f0d; }
.second-chance-retry:hover { background: #fff4e0; }

/* Vocab success animation — richer treatment for hits.
   The neutral .flash is kept for non-hit feedback. The new .flash-hit adds
   a colour pulse + brief scale bounce + an expanding green ring outside the
   cell. The z-index lift ensures the outline/ring isn't covered by adjacent
   dots in the dense focused grid (which was the "partial borders" symptom).
   See inter_chat/Architecture_Housing_vocab_success_animation.md. */
.freq-dot.flash,
.freq-dot.flash-hit,
.vocab-lemma-dot.flash,
.vocab-lemma-dot.flash-hit,
.vocab-cell.flash,
.vocab-cell.flash-hit,
.freq-flank-cell.flash,
.freq-flank-cell.flash-hit {
  position: relative;
  z-index: 3;
}
.freq-dot.flash-hit,
.vocab-lemma-dot.flash-hit {
  outline: 2px solid #1b8a4a;
  animation: vocab-success-pulse 900ms cubic-bezier(.2,.7,.3,1.2) 1;
}
.vocab-cell.flash-hit,
.freq-flank-cell.flash-hit {
  outline: 2px solid #1b8a4a;
  outline-offset: -2px;
  animation: vocab-success-pulse-cell 900ms cubic-bezier(.2,.7,.3,1.2) 1;
}
@keyframes vocab-success-pulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0  rgba(27,138,74,0.65); }
  30%  { transform: scale(1.45); box-shadow: 0 0 0 5px rgba(27,138,74,0.55); }
  60%  { transform: scale(1.10); box-shadow: 0 0 0 9px rgba(27,138,74,0.25); }
  100% { transform: scale(1);    box-shadow: 0 0 0 12px rgba(27,138,74,0);   }
}
@keyframes vocab-success-pulse-cell {
  0%   { box-shadow: 0 0 0 0   rgba(27,138,74,0.65); }
  35%  { box-shadow: 0 0 0 8px rgba(27,138,74,0.55); }
  100% { box-shadow: 0 0 0 14px rgba(27,138,74,0);   }
}

/* Stats panel category structure — small headers above grouped topic tiles.
   Verbs first (curriculum: present → passato → imperfect → future →
   condizionale → tense_choice), then Adjectives, then Pronouns.
   See inter_chat/Architecture_Housing_stats_panel_structure.md. */
.overview-category-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #6a6a6a);
  margin: 14px 0 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line, #e3e0d8);
}
.overview-category-header:first-child {
  margin-top: 4px;
}
.overview-category-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.overview-vocab-footer {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line, #e3e0d8);
  text-align: center;
}
.overview-vocab-link {
  background: transparent;
  border: 1px solid var(--accent, #4a89c7);
  color: var(--accent, #4a89c7);
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}
.overview-vocab-link:hover {
  background: var(--accent-soft, #e8f0fb);
}

/* Stats panel layout fix 2026-06-08 — the original .overview-cell used
   flex: 1 1 195px for a wrap-row layout (basis=width). After the
   category-grouping refactor put cells inside a flex-direction:column
   group, the same basis became a min-HEIGHT, so each tile reserved
   195px even with one short row of content. Override to size by
   content. Also reroute the outer container to column flow so
   headers and groups stack vertically rather than competing for row
   space. See inter_chat/Architecture_Housing_grammar_view_space_and_scroll.md. */
.live-overview {
  flex-direction: column;
  flex-wrap: nowrap;
}
.overview-category-group .overview-cell {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Candidate-tenses post-answer tick (Phase 1).
   inter_chat/Architecture_Housing_candidate_tenses_tick.md */
.tense-candidates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 2px; }
.tense-candidates-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.tense-chip { border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px; font-size: 13px; background: #f6f6f6; color: #555; }
.tense-chip.correct { border-color: #2e7d32; background: #e8f5e9; color: #1b5e20; font-weight: 600; }

/* ====================================================================
   Mobile (phone) adaptations, 2026-07-09.
   The 1080px fold already stacks the live panel below the drill; this
   section makes the drill flow comfortable at phone width and adapts
   input for touch-first devices.
   ==================================================================== */

/* Touch-first devices (any width): keyboard hints are meaningless on a
   screen with no physical keyboard, and tap targets grow toward 44px. */
@media (hover: none) and (pointer: coarse) {
  .actions .kbd-hint { display: none; }
  .actions button { padding: 12px 20px; font-size: 16px; }
  .mcq-choice { padding: 13px 14px; }
  .accent-bar button { padding: 8px 12px; font-size: 16px; min-width: 40px; }
  .accent-bar .accent-hint { display: none; }
  .vocab-back-all { padding: 8px 12px; font-size: 13px; }
}

/* Phone width */
@media (max-width: 600px) {
  header { padding: 12px 14px 0 14px; }
  main { padding: 14px 14px 28px; gap: 18px; }

  nav#strand-nav { flex-wrap: wrap; row-gap: 4px; }
  nav#strand-nav button { padding: 8px 10px; font-size: 13px; }

  .qcard .prompt { font-size: 19px; margin: 12px 0 18px; }
  .qcard .prompt .prompt-italian { font-size: 19px; }
  .qcard .prompt .prompt-english { font-size: 16px; }
  .qcard .prompt .prompt-cue { font-size: 19px; margin-bottom: 10px; }
  .qcard .prompt .prompt-cue .prompt-cue-label { font-size: 15px; }

  .filter-bar { flex-wrap: wrap; gap: 8px; }
  .intent-bar { flex-wrap: wrap; }
  .vocab-help-bar { flex-wrap: wrap; }

  /* Fixed-width structures (the 341px focused dot grid plus flanking
     strips, the cell grids, the bucket tree's indentation) scroll
     sideways within their own box instead of stretching the page. */
  .freq-heatmap-row,
  .vocab-cellgrid-host,
  .live-overview,
  #live-stats,
  #buckets-host { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .result { padding: 12px; }
  .cmp-label { min-width: 72px; }
  .tense-candidates { gap: 5px; }

  /* ------------------------------------------------------------------
     r227 THE SCOPE STRIP, Smith: "everything's over on the left-hand side...
     Everything's squashed and unreadable. You have to scroll down for things."
     MEASURED at 375px before touching it: the strip was 143px tall - 18% of the
     screen - in FOUR rows, and the card did not start until y=234, so 29% of the
     phone was spent before the question appeared. The four chips had four
     different left edges (51, 125, 175, 226) and right edges within a pixel of
     each other: a staircase.
     CAUSE: `.scope-right { margin-left: auto }`. On a wide screen that pushes the
     count and the setup button to the far end, which is right. When the strip
     wraps to one chip per line, the same auto margin shoves every line's content
     to the right edge, so each chip hangs off the right and its left edge lands
     wherever its own width happens to put it. Nothing was aligned to anything.
     Phone gets a flat left edge, chips that share rows, and the right-hand group
     on a full-width row of its own where it can be read.
     ALSO: the strip is `position: sticky; top: 110px`, which on a phone pinned a
     143px block over the card being answered. Static here; the card matters more.
     ------------------------------------------------------------------ */
  /* The flex-end lives on `#header-filter-slot .filter-bar` - an id plus a class -
     so a plain `.filter-bar.scope-strip` override loses on specificity. It has to
     be matched. My first attempt at this did not, and made the strip 9px TALLER
     while leaving the staircase exactly where it was; measuring the result is the
     only reason I know that. */
  #header-filter-slot .filter-bar,
  .filter-bar.scope-strip, .filter-row.scope-strip, .scope-strip {
    position: static;
    justify-content: flex-start;
    align-items: center;
    gap: 4px 6px;
    padding: 5px 10px 6px;
    margin-bottom: 8px;
  }
  /* THE ACTUAL LEVER, and it was not the alignment. A <select> sizes itself to its
     LONGEST OPTION, not to the value showing - so the "all words" chip was 236px of
     a 347px strip to display two words, and no two chips could ever share a row.
     Capping this is what took the strip from four rows to two; left-aligning only
     stopped it looking like a staircase. */
  #header-filter-slot .filter-bar select,
  .scope-chip select { max-width: 28vw; text-overflow: ellipsis; }
  .filter-chip.scope-chip { min-height: 30px; font-size: 12px; max-width: 100%; }
  .filter-chip.scope-chip select, .scope-chip strong { font-size: 12px; }
  /* "PRACTISING" goes: it labels something the chips beside it already say, and on
     a phone it was costing a whole row to do it. The legend STAYS at a readable
     size - a variant that shrank it to font-size:0 saved another 17px and would
     have left the provenance dot on screen with nothing to explain it, which is
     hiding meaning to buy pixels. */
  .scope-strip .scope-lead { display: none; }
  .scope-strip .scope-legend { font-size: 10.5px; flex: 0 1 auto; }
  .scope-strip .scope-right { margin-left: 0; gap: 8px; }

  /* ------------------------------------------------------------------
     r220 THE PHONE ACTION ROW, Smith 2026-09-08: "This mark button is too
     small for your thumb. Why is it on the left? It's annoying over there
     when things are usually on the right. It should go across the screen,
     and the skip should be smaller."
     The primary action takes the full width - which answers left-versus-
     right by removing the question, and gives a target no thumb can miss.
     Everything that is not the primary action drops to a quiet row beneath
     it, so "throw the question away" can never again be the biggest, most
     saturated thing on the card. (It was, on all four drills, because their
     Skip was built with class "btn" instead of "secondary" - fixed in the
     JS in the same build.)
     ------------------------------------------------------------------ */
  .actions { flex-wrap: wrap; row-gap: 10px; margin-top: 14px; }
  .actions > button:not(.secondary):not(.card-history-btn) {
    order: 0;
    flex: 1 0 100%;
    min-height: 52px;
    font-size: 17px;
    padding: 14px 20px;
    border-radius: 4px;
  }
  .actions > button.secondary,
  .actions > button.card-history-btn {
    order: 1;
    flex: 0 0 auto;
    min-height: 40px;
    font-size: 13.5px;
    padding: 9px 16px;
    background: transparent;
    color: var(--muted);
    border-color: #e0d7c4;
    margin-left: 0;
  }
  /* back sits hard right, where a returning thumb expects it */
  .actions > button.card-history-btn { margin-left: auto; }

  /* The footer legend ran off the right edge - "needs changing" cut mid-word
     and the last keys off-screen entirely. CAUSE: `footer > span` sets
     white-space:nowrap and flex:0 0 auto on every direct child, so the legend
     could neither wrap nor shrink, and .axis-legend's own flex-wrap could not
     win against inherited nowrap. Exempt the legend from both. */
  footer { flex-wrap: wrap; row-gap: 6px; }
  footer > #axis-legend-host,
  footer > #axis-legend-host span,
  .axis-legend { white-space: normal; }
  footer > #axis-legend-host { flex: 1 1 100%; min-width: 0; }

  /* The floating Feedback button sat on top of the Coverage pull-up bar -
     on top of the one thing that tells you a mark fired. Keep the bar's own
     text clear of it. */
  #pullup-bar { padding-right: 128px; }
}

/* ====================================================================
   Interaction round, 2026-07-09: button separation + outcome colours.
   ==================================================================== */

/* Skip/Next lives at the far edge, away from Mark: no more fat-finger
   territory between "mark my answer" and "throw the question away". */
.actions button.secondary { margin-left: auto; }
.actions .kbd-hint { margin-left: 8px; }

/* "You wrote" reflects the outcome instead of always reading as red. */
.cmp-value.cmp-learner-right { color: var(--green); background: var(--green-soft); }
.cmp-value.cmp-learner-partial { color: var(--amber); background: transparent; }

/* Per-word colouring in "You wrote" (QoderWork 2026-07-22): green = word found in reference, pink = not. */
.yw-right { color: var(--green); }
.yw-wrong { color: var(--red); background: var(--red-soft); }

/* ==================== entry / welcome screen ==================== */
.entry-screen[hidden] { display: none; }
body.entry-active nav#strand-nav { display: none; }
/* r141 (Smith: the front page "says a lot of other rubbish"). The strand's
   filter bar - drill chips, Direction, Restrict to, Sub-band, the 13993-of-18048
   count - lives in the header, so the ENTRY screen was wearing the controls of a
   session that has not started. You choose all of that on the entry screen
   itself, a few centimetres below. It belongs to a running session only.
   Identity STAYS - the front door is exactly where you would change user. */
body.entry-active #header-filter-slot { display: none; }
body.entry-active main { display: block; }
body.entry-active .content,
body.entry-active #live-stats { display: none; }

.entry-screen { padding: 8px 16px 40px; }
/* r190 TWO-COLUMN ENTRY (Design round 3 as steered): cards left, the chosen
   strand's configurator right. .entry-col keeps its width so the cards read as
   they did; the side column takes the rest, and until a strand is chosen it
   carries a welcome panel. Below 860px the two stack. */
.entry-two { display: grid; grid-template-columns: minmax(300px, 468px) minmax(0, 1fr); gap: 0 40px; max-width: 1060px; margin: 0 auto; align-items: start; }
.entry-two:not(.has-config) { grid-template-columns: minmax(300px, 468px) minmax(0, 300px); }
.entry-col { max-width: 468px; margin: 0; padding-bottom: 8px; }
.entry-side { padding-top: 24px; min-width: 0; }
.entry-side .entry-config { margin-top: 38px; border-top: none; padding-top: 0; }
@media (max-width: 860px) {
  .entry-two, .entry-two:not(.has-config) { grid-template-columns: 1fr; gap: 0; }
  .entry-col { margin: 0 auto; }
  .entry-side { padding-top: 0; }
  .entry-side .entry-config { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
}
/* the feed link in the cards' gutter: one line, a dot at the origin, arrowheads
   only at the destinations. Drawn once in a 0-300 box stretched to the stack. */
.entry-cards.has-feed { display: grid; grid-template-columns: 22px 1fr; grid-auto-rows: auto; column-gap: 8px; row-gap: 10px; }
.entry-cards.has-feed > .entry-card { grid-column: 2; }
.entry-feed { grid-column: 1; grid-row: 1 / span 3; width: 22px; height: 100%; overflow: visible; }
.entry-feed path { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; opacity: .8; stroke-linecap: round; }
.entry-feed polygon, .entry-feed circle { fill: var(--accent); opacity: .85; }
.entry-greeting { font-size: 24px; font-weight: 600; margin: 24px 0 4px; }
.entry-subhead { margin: 0 0 20px; color: var(--muted); }
/* ============================================================================
   r142 THE FRONT DOOR SHOULD NOT NEED SCROLLING. Smith: "this start isn't very
   good... having to start at the bottom and just scroll down. It's not a great
   front page." Measured: the entry column is capped at 468px inside a 1,424px
   page - 956px of unused width - so everything stacks vertically and the
   direction chips fall off the bottom of his screen.
   Nothing is redesigned. On a wide screen the two shortcuts sit side by side
   and the three strand cards become a row of three; on a narrow one it stacks
   exactly as before. Height comes down by roughly the two rows that were
   pushing the fold.
   ============================================================================ */
@media (min-width: 900px) {
  .entry-col { max-width: 880px; }
  .entry-quickstarts { flex-direction: row; }
  .entry-quickstarts > * { flex: 1 1 0; min-width: 0; }
  .entry-cards { flex-direction: row; align-items: stretch; }
  .entry-cards > .entry-card { flex: 1 1 0; min-width: 0; }
  /* Stacked inside each card so three fit across without squeezing the text. */
  .entry-cards > .entry-card { flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; }
  .entry-coverage-link { display: inline-block; margin-right: 18px; }
}

.entry-cards { display: flex; flex-direction: column; gap: 10px; }
.entry-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.entry-card:hover { border-color: var(--preview); }
.entry-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.entry-card-badge {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #fff;
}
.badge-grammar { background: var(--accent); }
.badge-translation { background: var(--green); }
.badge-vocab { background: var(--blue); }
.entry-card-text { display: flex; flex-direction: column; }
.entry-card-name { font-size: 17px; font-weight: 600; }
.entry-card-desc { font-size: 13px; color: var(--muted); }
.entry-card-meta { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.entry-quick-head { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 18px 0 6px; }

.entry-config { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.entry-config-head { font-size: 16px; font-weight: 600; margin: 14px 0 2px; }
.entry-config-head:first-child { margin-top: 0; }
.entry-config-hint { margin: 0 0 10px; color: var(--faint); font-size: 13px; font-style: italic; }
.entry-travel-note { margin-top: 18px; color: var(--muted); }

.entry-part { margin-bottom: 10px; }
.entry-part-tick {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 16px; color: var(--ink); padding: 6px 0; width: 100%;
}
.entry-part-caret { margin-left: auto; color: var(--faint); font-size: 14px; }
.entry-part-tick .tickbox {
  width: 20px; height: 20px; border: 2px solid var(--faint); border-radius: 5px; flex: 0 0 auto;
  position: relative;
}
.entry-part-tick.on .tickbox { background: var(--accent); border-color: var(--accent); }
.entry-part-tick.on .tickbox::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.entry-part-label { font-weight: 600; }
.entry-drill { margin: 4px 0 6px 30px; }

.entry-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.entry-chip {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-family: inherit; font-size: 13px; color: var(--ink);
  cursor: pointer; min-height: 34px;
}
.entry-chip:hover { border-color: var(--preview); }
.entry-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* r166, Smith: "we also want an intro page... stop it going down a page. keep
   start on the home page." Start was sticky ONLY under 600px - on every desktop
   it sat at the bottom of a column of configuration, so the front door required
   scrolling to find its own front door. r142 widened the layout and helped, but
   the config grows (drills, classes, levels, themes) and any fix that depends on
   the content staying short is a fix that expires.
   Sticky at ALL widths instead: Start is pinned to the bottom of the viewport
   while the entry screen is open, so it is reachable at any scroll position and
   at any amount of configuration. The gradient keeps the content readable as it
   passes underneath rather than being cut off by a hard edge. */
.entry-start-wrap {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 22px;
  padding: 14px 0 12px;
  background: linear-gradient(to top, var(--bg) 70%, rgba(253,250,244,0));
}
.entry-start {
  width: 100%; background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 15px; font-family: inherit; font-size: 17px; font-weight: 600; cursor: pointer;
}
.entry-start:hover { background: #32467a; }

/* ---- entry: quick-start shortcuts ---- */
.entry-quickstarts { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 20px; }
.entry-quick { text-align: left; border: none; border-radius: 12px; padding: 14px 16px; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: 2px; }
.entry-quick .quick-title { font-size: 16px; font-weight: 600; }
.entry-quick .quick-sub { font-size: 13px; opacity: .85; }
.entry-quick-mistakes { background: var(--accent); color: #fff; box-shadow: 0 2px 10px rgba(58,79,138,.28); }
.entry-quick-resume { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); }

/* ---- entry: level strip ---- */
.entry-level-strip { display: flex; gap: 6px; margin: 6px 0 4px; }
.entry-level-cell { flex: 1 1 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; padding: 8px 4px; font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; }
.entry-level-cell .lvl-name { font-size: 13px; font-weight: 600; }
.entry-level-cell .lvl-count { font-size: 12px; color: inherit; opacity: .7; }
.entry-level-cell.sel { border-color: var(--amber); box-shadow: inset 0 0 0 3px var(--amber); position: relative; }
.entry-level-cell.sel::after { content: "\2713"; position: absolute; top: 2px; right: 5px; font-size: 12px; font-weight: 700; color: var(--amber); }
.entry-level-cell.empty { opacity: .4; cursor: default; }

/* ---- entry: mobile ---- */
@media (hover: none) and (pointer: coarse) {
  .entry-chip { min-height: 44px; padding: 10px 15px; }
  .entry-level-cell { min-height: 56px; }
  .entry-card { padding: 16px; }
  .entry-part-tick { padding: 10px 0; }
}
@media (max-width: 600px) {
  .entry-screen { padding: 4px 12px 96px; }
  .entry-greeting { font-size: 22px; }
  .entry-start-wrap { margin-top: 16px; }   /* r166: stickiness is now global */
  .entry-start { padding: 16px; font-size: 18px; }
}

/* ---- result reveal: make the mark 'fire' perceptible (2026-07-13 feedback) ---- */
.result { animation: result-reveal 0.42s cubic-bezier(.2,.7,.3,1); }
@keyframes result-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.result .overall { animation: result-pop 0.5s ease; }
@keyframes result-pop { 0% { transform: scale(.97); } 55% { transform: scale(1.015); } 100% { transform: scale(1); } }
.result-explanation { animation: result-late 0.75s ease; }
@keyframes result-late { 0%, 38% { opacity: 0; } 100% { opacity: 1; } }
.grammar-updated-hint {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 15px; font-family: inherit; font-size: 13px; cursor: pointer;
  min-height: 40px; animation: result-late 0.95s ease;
}

/* ---- entry: per-band competence bar (subordinate to availability) ---- */
.entry-level-cell .lvl-mastery { width: 100%; height: 4px; border-radius: 2px; background: rgba(0,0,0,0.09); margin-top: 4px; overflow: hidden; }
.entry-level-cell .lvl-mastery i { display: block; height: 100%; border-radius: 2px; }
.entry-level-cell.sel .lvl-mastery { background: rgba(255,255,255,0.35); }

/* ==================== coverage matrix view ==================== */
.coverage-view[hidden] { display: none; }
body.coverage-active nav#strand-nav { display: none; }
body.coverage-active main { display: block; }
body.coverage-active .content,
body.coverage-active #live-stats,
body.coverage-active #entry-screen { display: none; }

.coverage-view { padding: 8px 16px 40px; }
.coverage-col { max-width: 720px; margin: 0 auto; }
.coverage-bar { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; }
.coverage-title { flex: 1; margin: 0; font-size: 22px; font-weight: 600; text-align: center; }
.coverage-back, .coverage-transpose, .coverage-viewtoggle { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-family: inherit; font-size: 13px; cursor: pointer; min-height: 40px; }
.coverage-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; text-align: center; }
.coverage-scroll { width: 100%; }
.coverage-scroll.wide { overflow-x: auto; }
.coverage-matrix { border-collapse: separate; border-spacing: 3px; width: 100%; }
.coverage-matrix th { font-weight: 600; font-size: 12px; text-align: center; color: var(--muted); padding: 2px 3px; }
.coverage-matrix th.coverage-rowhead { text-align: left; font-size: 12px; color: var(--ink); white-space: nowrap; padding-right: 8px; }
.coverage-cell { position: relative; height: 34px; min-width: 40px; border: 1px solid var(--line); border-radius: 5px; background: #faf8ef; overflow: hidden; cursor: pointer; padding: 0; }
.coverage-fill { position: absolute; bottom: 0; left: 0; right: 0; }
/* Per-area strips (coverage_matrix_2d v5): one strip per leaf in scope,
   colour = that leaf's own state, faint when untouched. No aggregate colour. */
.coverage-strips { display: flex; flex-direction: column; height: 100%; width: 100%; gap: 0; align-items: stretch; justify-content: flex-end; }
/* Immiscible-liquid layers (Smith): gapless. Coloured layers pack at the
   BOTTOM, the CREAM band of achievable-but-unobtained areas sits directly
   above them - nothing interleaves and unobtained never holds colour up.
   Cream = yet to get (Smith glossary); the lighter cell background is the
   beyond-the-areas space in the layers view; grey is reserved for
   unobtainable boxes. Tooltips stay per-layer. */
.coverage-strip { flex: 0 0 4px; width: 100%; background: #e9e3cf; }
.coverage-strips.dense .coverage-strip { flex: 1 1 0; min-height: 0; }
.coverage-group-row th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 12px 6px 3px; background: transparent; border: 0; }
.coverage-cat-head th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); border: 0; }
.coverage-strip.touched { /* background set inline per leaf */ }
.coverage-na { background: #d9d6cc; cursor: default; opacity: .55; }  /* unobtainable: completely blank, greyed out (Smith glossary) */
.entry-coverage-link { display: block; width: 100%; margin-top: 18px; background: transparent; border: none; color: var(--accent); font-family: inherit; font-size: 14px; text-align: center; cursor: pointer; padding: 10px; }
@media (max-width: 600px) {
  .coverage-col { max-width: 100%; }
  .coverage-matrix th.coverage-rowhead { font-size: 11px; }
  .coverage-cell { height: 30px; min-width: 34px; }
}

/* ==================== unified filter chip row ==================== */
/* Topic, Level and the drill read as ONE system, so no active restriction can
   hide. See inter_chat/Architecture_Housing_drill_filter_ux_and_dropdown_labels.md */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 6px 4px 12px; font-size: 13px; color: var(--ink); min-height: 34px;
}
.filter-chip.active { border-color: var(--accent); background: var(--accent-soft); }
.filter-chip-key { color: var(--muted); font-size: 12px; }
.filter-chip.active .filter-chip-key { color: var(--accent); }
.filter-chip select {
  border: none; background: transparent; font-family: inherit; font-size: 13px;
  color: inherit; padding: 2px 4px; max-width: 200px; cursor: pointer;
}
.filter-chip.drill { padding-right: 4px; }
.filter-chip.drill strong { font-weight: 600; }
.drill-note { color: var(--muted); font-size: 12px; font-style: italic; margin-left: 4px; }
.linkish {
  background: none; border: none; padding: 0 2px; font-family: inherit; font-size: 12px;
  color: var(--accent); text-decoration: underline; cursor: pointer;
}
.chip-x {
  background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1;
  color: var(--muted); padding: 2px 6px; border-radius: 50%;
}
.chip-x:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.filter-row .filter-count { color: var(--faint); font-size: 12px; margin-left: auto; }

/* ============================================================================
   r185 THE SCOPE STRIP (vocabulary). Design round 3b as Smith steered it:
     PRACTISING · [● Vocabulary] [● Recognition · it→en] [○ Top 1,000 ×] [● Family relations ×] · clear all · ● set on the way in    [Set up a different practice]
   One line, one description of the whole scope. Dots carry provenance: filled =
   the entry screen set it, hollow = set here. Chips reuse .filter-chip so the
   three strands' bars are one family. Small caps lead, quiet legend, the way
   back to the entry screen on the right - an outline, never a primary (one
   solid-wine action per screen, and on this page that is Mark).
   ============================================================================ */
.filter-bar.scope-strip, .filter-row.scope-strip { gap: 8px; }
.scope-right .translation-session-score { font-size: 12px; }

/* r198 BACK: the previous-answer view. A quiet line above the card; the
   previous card itself on a faintly different ground with every control
   disabled, so it reads as a record and not as a question. */
.card-history-nav { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: var(--muted); }
.actions button.card-history-btn { padding: 4px 9px; font-size: 12px; opacity: 1; cursor: pointer; }
.card-history-label { color: var(--faint); font-style: italic; white-space: nowrap; }
.qcard.card-previous { background: #fbf8f1; border-style: dashed; }
.qcard.card-previous button:disabled, .qcard.card-previous input, .qcard.card-previous textarea { opacity: .7; cursor: default; }
.scope-lead { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-right: 2px; }
.scope-chip { min-height: 30px; padding: 2px 6px 2px 9px; gap: 5px; }
.scope-chip select { max-width: 220px; font-size: 13px; }
.scope-chip strong { font-weight: 600; font-size: 13px; }
.scope-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--accent); box-sizing: border-box; flex: 0 0 auto; }
.scope-dot.entry { background: var(--accent); }
.scope-dot.session { background: transparent; }
.scope-clear { font-size: 12px; }
.scope-legend { color: var(--faint); font-size: 11.5px; display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; }
.scope-right { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; }
.scope-right .filter-count { color: var(--faint); font-size: 12px; }
.scope-setup { font-size: 12px; padding: 4px 10px; }
.scope-hint { font-size: 11px; color: var(--faint); font-style: italic; }
.filter-chip.level-boxes { padding-left: 6px; }
.filter-chip.level-boxes .level-toggle { font-size: 12px; padding: 2px 7px; border-radius: 3px; }
.filter-chip.scope-quiet select { color: var(--muted); font-size: 12px; }

/* ---- zero-result state: name the blocker, offer the fix ---- */
.empty-state { padding: 18px; }
.empty-state-msg { font-style: italic; margin-bottom: 10px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty-action {
  background: #fff; border: 1px solid var(--accent); color: var(--accent);
  border-radius: 999px; padding: 8px 14px; font-family: inherit; font-size: 13px;
  cursor: pointer; min-height: 36px;
}
.empty-action:hover { background: var(--accent-soft); }

/* ---- sidebar tiles: invite the drill ---- */
.overview-cell, .overview-mini, .overview-dot, .live-bucket-row { cursor: pointer; }
.overview-cell:hover, .overview-mini:hover {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.overview-dot:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.live-bucket-row:hover { background: var(--accent-soft); }
@media (hover: none) and (pointer: coarse) {
  .filter-chip { min-height: 44px; }
  .empty-action { min-height: 44px; }
}

/* Second line of the question-shaped tile headline (Smith 2026-07-21). */
.overview-meta-sub { opacity: 0.72; font-size: 0.92em; }

/* Temporary 'clear' coverage palette (Smith 2026-07-21): white = still-to-get (in
   scope), grey = not achievable (matches .coverage-na). Toggle scaffolding. */
.coverage-matrix.palette-clear .coverage-cell { background: #d9d6cc; }
.coverage-matrix.palette-clear .coverage-strip { background: #ffffff; }
.coverage-matrix.palette-clear .coverage-na { background: #d9d6cc; opacity: 1; }

/* ==================== Analysis surface (Smith 2026-07-21) ==================== */
.analysis-header { display:flex; align-items:center; gap:12px; flex-wrap:wrap; max-width:720px; margin:0 auto 12px; }
.analysis-header .coverage-title { margin:0; }
.analysis-switch { display:flex; gap:6px; margin-left:auto; }
.analysis-switch button { font:inherit; padding:4px 14px; border:1px solid var(--line,#e3ddc9); border-radius:999px; background:#fff; color:var(--ink,#2b2b2b); cursor:pointer; }
.analysis-switch button.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.analysis-section { max-width:720px; margin:0 auto 26px; }
.analysis-section-title { font-family:Georgia,serif; font-size:1.05rem; color:var(--ink,#2b2b2b); margin:0 0 8px; display:flex; align-items:center; gap:8px; }
.analysis-chip { font-size:.68rem; text-transform:uppercase; letter-spacing:.04em; color:#8a836f; border:1px solid var(--line,#e3ddc9); border-radius:999px; padding:1px 7px; font-weight:400; }
.analysis-placeholder { color:#8a836f; font-style:italic; border:1px dashed var(--line,#e3ddc9); border-radius:8px; padding:12px 14px; background:#fffdf7; }
.analysis-kpis { display:flex; gap:14px; flex-wrap:wrap; }
.kpi { border:1px solid var(--line,#e3ddc9); border-radius:8px; padding:10px 16px; background:#fff; min-width:88px; text-align:center; }
.kpi-val { font-size:1.5rem; font-family:Georgia,serif; color:var(--accent); line-height:1.1; }
.kpi-label { font-size:.78rem; color:#6b6552; }
.gaps-list, .toperr-list { margin:0; padding-left:20px; color:var(--ink,#2b2b2b); }
.gaps-list li, .toperr-list li { margin:2px 0; }
.analysis-open-link { display:block; font:inherit; margin-top:4px; padding:6px 10px; border:1px solid var(--line,#e3ddc9); border-radius:6px; background:#fff; color:var(--accent); cursor:pointer; width:auto; text-align:right; }   /* QoderWork 2026-07-22 */
@media (max-width:600px) {
  .analysis-header, .analysis-section, .coverage-col { max-width:100%; }
  .analysis-switch { margin-left:0; width:100%; }
  .analysis-switch button { flex:1 1 0; }
  .coverage-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .analysis-kpis { gap:8px; }
  .kpi { min-width:70px; padding:8px 10px; }
  .kpi-val { font-size:1.25rem; }
}

/* Analysis: in-place cell detail + person×tense grid (Smith 2026-07-21) */
.cell-detail { border:1px solid var(--line,#e3ddc9); border-radius:8px; padding:12px 14px; margin:10px auto 0; max-width:720px; background:#fffdf7; }
.cell-detail-head { display:flex; align-items:center; justify-content:space-between; }
.cell-detail-close { border:none; background:none; font-size:1.3rem; cursor:pointer; color:#8a836f; line-height:1; }
.cell-detail-areas { margin:6px 0; padding-left:20px; }
.cell-detail-sub { font-weight:600; margin-top:8px; font-size:.9rem; }
.cell-detail-mc { margin:4px 0; padding-left:20px; }
.cell-detail-practise { margin-top:10px; font:inherit; padding:6px 14px; border:1px solid var(--accent); border-radius:6px; background:var(--accent); color:#fff; cursor:pointer; }
.analysis-note { color:#8a836f; font-style:italic; }
.pt-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.pt-grid { border-collapse:collapse; }
.pt-grid th, .pt-grid td { border:1px solid var(--line,#e3ddc9); padding:5px 8px; text-align:center; font-size:.85rem; min-width:52px; }
.pt-grid thead th, .pt-grid tbody th { background:#f3efe2; font-weight:600; }
.pt-grid td.pt-empty { background:#fff; color:#c9c3b0; }
@media (max-width:600px){ .pt-grid th, .pt-grid td { min-width:44px; padding:4px 5px; font-size:.75rem; } }

/* Stress drill + confusion matrix  QoderWork 2026-07-23 (r79 UX overhaul QoderWork 2026-07-23) */
.stress-legend { font-size:.72rem; margin-top:2px; color:var(--faint,#8a836f); }
.stress-choices { gap:10px; }
.stress-choice {
  position:relative; padding:14px 16px 14px 32px; font-size:1.15rem;
  border:1.5px solid var(--border,#c8c4b8); border-radius:8px;
  background:#fff; cursor:pointer; transition:border-color .12s, box-shadow .12s;
}
.stress-choice:hover { border-color:var(--accent,#8f2b45); box-shadow:0 1px 4px rgba(0,0,0,.08); }
.stress-choice:active { box-shadow:inset 0 1px 3px rgba(0,0,0,.1); }
.stress-choice .gc-num {
  position:absolute; top:4px; left:6px; font-size:9px; font-weight:700;
  color:var(--faint,#8a836f); opacity:.6; min-width:auto; line-height:1;
}
.stress-choice .gc-label { font-weight:500; letter-spacing:.03em; color:#968e7f; }
/* Stress marking modes: default = bold only; .stress-mark-underline adds underline;
   .stress-mark-both adds both; .stress-mark-apostrophe hides bold (text has ' prefix) */
.stress-choice .gc-label strong { font-weight:700; text-decoration:none; color:var(--ink,#2a2a2a); }
.stress-mark-underline .stress-choice .gc-label strong { text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:2px; font-weight:500; }
.stress-mark-both .stress-choice .gc-label strong { font-weight:700; text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:2px; }
.stress-mark-apostrophe .stress-choice .gc-label strong { font-weight:500; text-decoration:none; }
.stress-choice .gc-label .stress-apo-mark { color:var(--ink,#2a2a2a); font-weight:700; }
/* Translation line under the prompt word  QoderWork 2026-07-23 */
.stress-translation { font-style:italic; margin-top:1px; }
/* Apostrophe-mode stressed syllable: the ' prefix marks the stressed syllable  QoderWork 2026-07-23 */
.stress-apo-mark { font-weight:600; }
/* Rule-of-thumb hint after the explanation  QoderWork 2026-07-23 */
.stress-rule-hint { font-size:.88em; color:var(--faint,#8a836f); border-left-width:3px; margin-top:2px; }
.stress-confusion td.stress-confusion-diag { outline:1px solid var(--accent,#2f8f4e); outline-offset:-1px; }
.stress-confusion .stress-confusion-pct { font-size:.72rem; color:#8a836f; }
/* Entry-screen stress example (capitano variants)  QoderWork 2026-07-23 */
.entry-stress-example { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 2px; margin-top:6px; font-size:.92rem; }
.entry-stress-variant { font-family:var(--font-body,serif); letter-spacing:.02em; }
.entry-stress-variant strong { font-weight:700; text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:2px; }
.entry-stress-or { font-size:.78rem; color:var(--faint,#8a836f); font-style:italic; margin:0 2px; }

/* Drill session panel (right-hand breakdown during drills)  QoderWork 2026-07-23 */
.drill-session-panel { padding:8px 0; }
.drill-session-title { margin:0 0 6px; font-size:1rem; }
.drill-coverage-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:12px 0 6px; }
.drill-coverage-summary section { padding:10px 9px; border:1px solid var(--line); border-radius:4px; min-width:0; }
.drill-coverage-summary h4 { margin:0 0 8px; min-height:2.8em; font-size:.77rem; line-height:1.4; font-weight:500; }
.drill-coverage-summary p { margin:7px 0 0; font-size:.7rem; line-height:1.4; color:var(--muted); }
.gender-coverage-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
.gender-coverage-summary h4 { min-height:0; }
.gender-coverage-summary p { overflow-wrap:anywhere; }
.ds-coverage-percent { font-size:1.2rem; }
.ds-word-coverage { margin:6px 0 12px; font-size:.72rem; color:var(--muted); }
.drill-session-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:10px 0 18px; }
.drill-session-summary section { padding:8px 0; border-top:1px solid var(--line); }
.drill-session-summary h4 { margin:0 0 5px; font-size:.78rem; font-weight:500; }
.ds-summary-percent { font-size:1rem; font-variant-numeric:tabular-nums; }
.drill-session-summary p { margin:2px 0 0; font-size:.78rem; color:var(--muted); }
.drill-session-table { width:100%; table-layout:fixed; border-collapse:collapse; font-size:.82rem; }
.drill-session-table caption { text-align:left; font-weight:600; margin-bottom:8px; }
.drill-session-table th, .drill-session-table td { padding:5px 6px; vertical-align:middle; border-bottom:1px solid var(--line); }
.drill-session-table thead th { text-align:left; font-size:.76rem; color:var(--muted); font-weight:500; }
@media (min-width:1201px) {
  .drill-session-table thead th { position:sticky; top:0; z-index:2; background:var(--bg); }
}
body.pullup-open .drill-session-table thead th { position:sticky; top:0; z-index:2; background:var(--bg); }
.drill-session-table .ds-col-stat { width:5.25rem; }
.drill-session-table .ds-col-type { width:5.8rem; }
.drill-session-table .ds-col-knowledge { width:5rem; }
.drill-session-table .ds-col-words { width:3.5rem; }
.drill-session-table thead th:not(:first-child), .drill-session-table td { text-align:center; }
.drill-session-table .ds-cat-label { text-align:left; font-weight:400; overflow-wrap:anywhere; }
.ds-stat-numbers { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:2px 4px; font-variant-numeric:tabular-nums; }
.ds-cat-count, .ds-cat-percent { white-space:nowrap; }
.ds-cat-count { color:var(--muted); font-size:.72rem; }
.ds-cat-percent, .ds-summary-percent, .ds-knowledge-percent, .ds-coverage-percent { display:inline-block; padding:3px 5px; border-radius:3px; font-weight:600; white-space:nowrap; font-variant-numeric:tabular-nums; }
.ds-corpus-count { font-variant-numeric:tabular-nums; }
.ds-word-total { display:inline-block; min-width:1.7em; padding:2px 5px; border-radius:3px; }
.ds-word-total.has-words { background:var(--accent-soft); color:var(--accent); font-weight:600; }
.ds-row-name { display:block; line-height:1.3; }
.ds-explanation-dot { display:inline-block; width:14px; height:14px; margin-left:5px; border:1px solid currentColor; border-radius:50%; font:600 10px/12px Georgia,serif; text-align:center; vertical-align:middle; color:var(--muted); cursor:help; }
.ds-explanation-dot:focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
.drill-session-table .ds-exception .ds-cat-label { padding-left:calc(6px + var(--ds-depth,1) * 12px); border-left:2px dotted var(--line); }
.ds-exception .ds-row-name::before { content:"↳ "; color:var(--muted); }
.ds-parent-reference { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.ds-row-kind { display:inline-block; padding:2px 5px; border-radius:3px; font-size:.66rem; font-weight:500; line-height:1.2; }
tr[data-kind="pattern"] .ds-row-kind { color:#345e83; background:rgba(74,137,199,.12); }
tr[data-kind="group"] .ds-row-kind { color:#465c2d; background:rgba(93,108,51,.12); }
tr[data-kind="exception"] .ds-row-kind { color:var(--accent); background:var(--accent-soft); }
.ds-provisional, .ds-ungraded { display:block; margin:2px 0 0; font-size:.62rem; font-weight:400; color:var(--muted); line-height:1.25; }
.ds-provisional { text-decoration:underline dotted; text-underline-offset:2px; }
.ds-inventory-note { display:block; margin-top:4px; font-size:.65rem; font-weight:400; color:var(--muted); line-height:1.4; }
.drill-session-table .ds-group-heading th { padding:10px 6px 4px; text-align:left; font-weight:500; font-size:.73rem; color:var(--muted); }
.ds-current-pattern { background:var(--accent-soft); box-shadow:inset 3px 0 var(--accent); }
.drill-session-table .ds-current-pattern .ds-cat-label { font-weight:600; }
.ds-fired { animation:ds-fired .9s ease-out; }
@keyframes ds-fired { from { background:#f6dfaa; } to { background:var(--accent-soft); } }
/* r298 (Smith's EDICT, 15 November 2026): reduced motion gets a brief outline, not nothing; see the end of this file. */
@media (max-width:600px) {
  .drill-coverage-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .drill-coverage-summary section:last-child { grid-column:1 / -1; }
  .gender-coverage-summary section:last-child { grid-column:auto; }
  .drill-coverage-summary h4 { min-height:0; }
  .drill-session-table th, .drill-session-table td { padding:5px 3px; }
  .drill-session-table { font-size:.76rem; }
  .drill-session-table thead th { font-size:.66rem; overflow-wrap:anywhere; }
  .drill-session-table .ds-col-type { width:4rem; }
  .drill-session-table .ds-col-stat { width:2.8rem; }
  .drill-session-table .ds-col-knowledge { width:4rem; }
  .drill-session-table .ds-col-words { width:3rem; }
  .ds-word-total { padding:2px 3px; }
  .ds-cat-count { font-size:.65rem; }
}
.drill-session-note { margin:10px 0 0; font-size:.74rem; color:var(--muted); }
.drill-session-matrix { margin-top:16px; }
.drill-session-matrix h4 { margin:0 0 6px; font-size:.88rem; }
.drill-session-matrix .stress-confusion { border-collapse:collapse; font-size:.82rem; }
.drill-session-matrix .stress-confusion th,
.drill-session-matrix .stress-confusion td { border:1px solid rgba(128,128,128,.25); padding:4px 8px; text-align:center; min-width:32px; }
.drill-session-matrix .stress-confusion th { font-weight:600; background:rgba(128,128,128,.07); }

/* Analysis: family heatmap + surface lenses (Smith 2026-07-21) */
.fam-heat { display:flex; flex-direction:column; gap:5px; }
.fam-row { display:flex; align-items:center; gap:8px; }
.fam-label { flex:0 0 42%; font-size:.85rem; }
.fam-track { flex:1 1 auto; background:#f3efe2; border-radius:3px; height:14px; overflow:hidden; }
.fam-bar { display:block; height:100%; background:#cc6a5a; }
.fam-count { flex:0 0 30px; text-align:right; font-size:.8rem; color:#6b6552; }
.lens-strip { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; }
.lens-card { border:1px solid var(--line,#e3ddc9); border-radius:8px; padding:10px 12px; background:#fff; }
.lens-head { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.lens-count { color:#6b6552; font-size:.85rem; white-space:nowrap; }
.lens-blurb { font-size:.85rem; color:#6b6552; margin-top:3px; }
.lens-sentence { font-size:.8rem; font-style:italic; color:#8a836f; margin-top:6px; }
@media (max-width:600px){ .lens-strip { grid-template-columns:1fr; } .fam-label { flex-basis:46%; } }

/* Choose-or-type chips: stacked + numbered (Smith 2026-07-21) */
.stated-choice-row { display:flex; flex-direction:column; align-items:stretch; gap:6px; }
.stated-choice { display:flex; align-items:center; gap:10px; text-align:left; }
.stated-choice-num { flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; background:var(--accent); color:#fff; font-size:.8rem; font-weight:600; }
.stated-choice-txt { flex:1 1 auto; }

/* Brand type: Fraunces headings/wordmark + wine ics (Claude Design overhaul) */
h1, h2, h3, .wordmark, .coverage-title, .analysis-section-title { font-family: Fraunces, Georgia, serif; }
.wordmark { font-weight: 550; letter-spacing: -0.01em; }
.wm-ics { color: var(--accent); }

/* Knowledge-atom logo (3x3 wine L-trace) in the header (Claude Design overhaul) */
.brand-row { display:flex; align-items:center; gap:11px; flex-wrap:wrap; margin-bottom:6px; }
.brand-logo { display:grid; grid-template-columns:repeat(3,8px); grid-auto-rows:8px; gap:1.5px; }
.brand-logo i { border-radius:1px; background:#ece7db; }
.brand-logo i.d { background:var(--p, #8f3a44); }
.brand-logo i.m { background:var(--p2, #b06b76); }
.brand-logo i.l { background:var(--p3, #d6aab0); }
.brand-row .wordmark, .brand-row .tagline { margin:0; }

/* Mobile bottom tab bar (Claude Design overhaul): Grammar / Translate / Vocab / Analysis */
#mobile-tabs { display: none; }
@media (max-width: 600px) {
  #mobile-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--bg, #fdfaf4); border-top: 1px solid var(--line, #e6e1d6); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  #mobile-tabs button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; font: inherit; font-size: 10.5px; color: var(--muted, #6b6b6b); cursor: pointer; padding: 4px 0; }
  #mobile-tabs button.active { color: var(--accent, #8f2b45); font-weight: 600; }
  #mobile-tabs .mtab-ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 12px; border: 1px solid var(--line, #e6e1d6); }
  #mobile-tabs button.active .mtab-ic { background: var(--accent, #8f2b45); color: #fff; border-color: var(--accent, #8f2b45); }
  nav#strand-nav { display: none; }
  body { padding-bottom: 62px; }
}

/* r210 PHONE PULL-UP: fold, don't cut. Above 600px the bar does not exist and
   the panels lay out as they always have. Below it, the live-stats aside (and,
   on the vocabulary page, the axes) hide behind a bar that sits on the tab
   bar; tapping it lifts them as a sheet that scrolls inside itself. */
#pullup-bar { display: none; }
@media (max-width: 600px) {
  #pullup-bar { display: flex; align-items: center; gap: 4px; position: fixed; left: 0; right: 0; bottom: 62px; z-index: 49;
    background: #fff; border: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    padding: 9px 14px; font: inherit; font-size: 12.5px; color: var(--ink); text-align: left; cursor: pointer; }
  #pullup-bar[hidden] { display: none; }
  #pullup-label { font-weight: 600; color: var(--accent); }
  .pullup-hint { color: var(--muted); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pullup-caret { color: var(--faint); transition: transform .15s; }
  body.pullup-open .pullup-caret { transform: rotate(180deg); }
  .pullup-fired { display: none; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  #pullup-bar.fired .pullup-hint { display: none; }
  #pullup-bar.fired .pullup-fired { display: inline; }
  /* r227, Smith: "Nothing fires visibly. You need some way of making it show the
     firing." MEASURED FIRST, and it was not broken - a wrong answer on `anatomia`
     put `fired fired-miss` on the bar with the text "the 8,000s · Science and
     technology · Biology and life sciences", every time.
     It fires. It fires where nobody is looking. After pressing Mark the eye is on
     the card's own verdict; the indicator was a pale tint and 12.5px of text on a
     39px strip at the very bottom edge, for 2.6 seconds, with the Feedback pill
     parked on top of it. Peripheral vision does not read pale colour or small
     text - it reads MOTION. So the bar now moves when it fires, the tints are
     strong enough to register at the edge of vision, and it holds long enough to
     still be there when you look down after reading the result (5s, set in JS).
     A quiet left-edge rule stays until the next card, so arriving late still
     tells you something happened. */
  @keyframes pullup-fire {
    0%   { transform: translateY(0); }
    22%  { transform: translateY(-7px); }
    46%  { transform: translateY(0); }
    62%  { transform: translateY(-3px); }
    100% { transform: translateY(0); }
  }
  #pullup-bar.fired { animation: pullup-fire 620ms cubic-bezier(.22,1,.36,1) 1; border-left: 4px solid transparent; }
  #pullup-bar.fired .pullup-fired { font-size: 13px; }
  #pullup-bar.fired-hit { background: #cfe4d6; border-left-color: var(--green, #235c3c); }
  #pullup-bar.fired-hit .pullup-fired { color: #16452c; }
  #pullup-bar.fired-miss { background: #f4d5cf; border-left-color: var(--red, #7f2a24); }
  #pullup-bar.fired-miss .pullup-fired { color: #6d211c; }
  #pullup-bar.fired-mixed { background: #f4e3b4; border-left-color: #9a6a00; }
  #pullup-bar.fired-mixed .pullup-fired { color: #7a5400; }
  /* the trace: outlives the flash, cleared when the next card is built */
  #pullup-bar.fired-trace { border-left: 4px solid var(--line); }
  #pullup-bar.fired-trace.trace-hit { border-left-color: var(--green, #235c3c); }
  #pullup-bar.fired-trace.trace-miss { border-left-color: var(--red, #7f2a24); }
  #pullup-bar.fired-trace.trace-mixed { border-left-color: #9a6a00; }
  /* r298: with reduced motion the bar takes the brief outline at the end of this file. */
  body { padding-bottom: 100px; }
  /* folded: the panels are off the page entirely */
  body:not(.pullup-open):not(.entry-active) #live-stats,
  body:not(.pullup-open).strand-vocab-active #vocab-axes-host { display: none; }
  /* pulled up: a sheet above the bar, scrolling inside itself */
  body.pullup-open #live-stats,
  body.pullup-open.strand-vocab-active #vocab-axes-host {
    display: block; position: fixed; left: 0; right: 0; bottom: 100px; max-height: 65vh; overflow-y: auto; z-index: 48;
    background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -12px 32px rgba(28,28,28,.16); padding: 10px 12px 14px; }
  body.pullup-open.strand-vocab-active #live-stats { display: none; }
  body.pullup-open.strand-vocab-active #vocab-axes-host > .vocab-axis { max-height: none; overflow: visible; margin-bottom: 14px; }
  body.pullup-open #vocab-body { display: block; height: auto; min-height: 0; }
  #wk-fb-btn { bottom: 112px !important; }
}

/* Keep the WEB_KIT feedback pill clear of the mobile tab bar (feedback.js not forked).
   r227: the 112px above was written specifically to clear the pull-up bar, and THIS
   BLOCK WAS SILENTLY DEFEATING IT - same file, later rule, same specificity, so 74px
   won and the pill landed on top of the bar. It has been sitting on the one element
   that tells a learner a mark fired. My r221 padding-right on the bar treated the
   symptom; this is the cause.
   The pill now clears the bar by default and only drops to 74px where there is no
   bar to clear - the entry screen and Analysis. */
@media (max-width: 600px) {
  #wk-fb-btn { bottom: 112px !important; }
  body.entry-active #wk-fb-btn,
  body.coverage-active #wk-fb-btn { bottom: 74px !important; }
  #wk-fb-panel { bottom: 160px !important; }
  body.entry-active #wk-fb-panel,
  body.coverage-active #wk-fb-panel { bottom: 122px !important; }
}

/* Stuck? Help sits under the question, right-justified (Smith 2026-07-21) */
.vocab-help-bar { justify-content: flex-end; }

/* Sub-aspect label on each overview mini-cell (Smith 2026-07-21) */
.overview-mini-label { font-size: 8.5px; color: var(--muted); line-height: 1.1; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Stats-pane top pinned + last-10 coloured (Smith 2026-07-21) */
/* r222, Smith 2026-09-29: a tile from the group above ("Using piacere well") was
   showing ABOVE the sticky Topics header, cut off at the panel's top edge.
   TWO causes, and both were already solved for the vocabulary panel and never
   carried across to this one:
   1. #live-stats carries `padding: 12px 15px`, so a header pinned at `top: 0`
      leaves the panel's own 12px of padding as a TRANSPARENT STRIP, and whatever
      scrolls underneath shows through it. This is word for word the fault Smith
      reported on the themes panel - "there's a little transparent bit so you can
      see it" - and the fix is the same one: negative margins so the header's
      ground spans the padding it sits in, with its own padding restoring the
      spacing inside.
   2. The ground was var(--bg) (#fdfaf4) while the panel itself is #fffdf8, so
      even where it did cover, it covered in the wrong cream.
   The shadow is there so content passing beneath reads as passing beneath,
   rather than as a rendering fault. */
#live-stats .live-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fffdf8;
  margin: -12px -15px 0;
  padding: 12px 15px 4px;
  box-shadow: 0 4px 7px -5px rgba(0,0,0,0.22);
}
#live-stats .live-header .pulse-strip { margin-top: 0; }
#last10-row .mark.hit { color: var(--green, #2e7d4f); font-weight: 600; }
#last10-row .mark.miss { color: var(--red, #b03030); font-weight: 600; }

/* Surface why the AI translation marker didn't fire (Smith 2026-07-21) */
.marker-ai-error { color: var(--red, #b03030); background: var(--red-soft, #f7e4e4); border: 1px solid #e6b8b8; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.ai-upsell { border: 1.5px solid var(--accent); border-radius: 8px; padding: 12px 14px; margin: 10px 0; background: rgba(143,43,69,0.05); }
.ai-upsell-msg { font-size: 14px; margin-bottom: 8px; }
.ai-upsell-cta { font-size: 13px; font-weight: 600; padding: 6px 14px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; }
.ai-upsell-cta:disabled { opacity: 0.7; cursor: default; background: #9a9a9a; border-color: #9a9a9a; }
/* multi_select qtype: toggleable checkbox choices. */
/* multi_select native chrome (cue_notation_renderer v4/v5, r124). Sits between
   the prompt and the choices, in the accent colour so it reads as an
   instruction rather than as metadata - the previous home was the faint CEFR
   breadcrumb, which is why authors kept writing the sentence into prompts. */
.ms-chrome {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
  margin: 10px 0 8px; padding: 7px 12px;
  background: var(--accent-soft, #eaf1fb);
  border-left: 3px solid var(--accent);
  border-radius: 0 5px 5px 0;
  font-size: 13.5px;
}
.ms-chrome-main { font-weight: 700; color: var(--accent); letter-spacing: 0.01em; }
.ms-chrome-note { color: var(--muted); font-style: italic; font-size: 12.5px; }

.ms-choice { display: flex; align-items: baseline; gap: 8px; text-align: left; }
.ms-choice .ms-check { display: inline-block; width: 14px; height: 14px; border: 1.5px solid #999; border-radius: 3px; flex: 0 0 auto; position: relative; top: 2px; }
.ms-choice.ms-selected .ms-check { background: var(--accent); border-color: var(--accent); }
.ms-choice.ms-selected .ms-check::after { content: "\2713"; color: #fff; font-size: 11px; line-height: 14px; position: absolute; left: 2px; top: -2px; }
.ms-choice .ms-text { flex: 1; }
.ms-choice.ms-correct { outline: 2px solid var(--green); background: var(--green-soft); }
.ms-choice.ms-wrong { outline: 2px solid var(--red); background: var(--red-soft); }
.ms-choice.ms-missed { outline: 2px dashed #c87618; background: rgba(200,118,24,0.07); }
/* multi_select_buckets v4 item 2: each choice's authored note, shown once marked. */
.ms-choice .ms-note { display: block; margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--muted); font-style: italic; }
.ms-choice .ms-note strong { color: var(--ink); font-style: normal; }
/* multi-select category picker: removable selected chips. */
.entry-cat-selected { align-items: center; }
.entry-chip.entry-cat-remove { background: var(--accent); color: #fff; border-color: var(--accent); }
.entry-chip.entry-cat-remove:hover { filter: brightness(1.1); }


/* Apostrophe-escalation advisory. Never corrects, only suggests; see
   inter_chat/AccentAuthor_Housing_apostrophe_input.md. */
.accent-nudge {
  flex-basis: 100%;
  margin-top: 4px;
  font-size: 13px;
  color: #8a6d1f;
  font-style: italic;
}


/* Compound cue: the lemma is the operand, the spec is the constraint on it.
   See inter_chat/Architecture_Housing_cue_notation_renderer.md. */
.prompt-cue-spec { color: #6b6459; font-style: italic; }


/* Accent drill: the whole point of the item is a mark two pixels tall, so the
   type has to be big enough to see it. Smith 2026-08-02: "let's make the font
   bigger so the accents can be seen." Scoped to the accent drill only - the
   grammar and vocab cards keep their sizes. */
.accent-drill-card .prompt { font-size: 26px; line-height: 1.55; }
.accent-drill-card .accent-choices .mcq-choice {
  font-size: 30px;
  line-height: 1.4;
  padding-top: 10px;
  padding-bottom: 10px;
  letter-spacing: .01em;
}
/* THE "1Correct" BUG. gender-choice, spelling-choice and stress-choice each
   style their .gc-num; .accent-choice never had a rule, so the number inherited
   the button's full font size with no margin and rendered flush against the
   label - "1Correct", "2Incorrect", with the digit as big as the word. Smith
   2026-08-02. Matched to the others, and given real separation. */
.accent-choice .gc-num {
  font-weight: 700;
  color: var(--accent);
  font-size: 11px;
  min-width: 1.4em;
  opacity: .7;
  margin-right: 10px;
  align-self: center;
}
.accent-choice .gc-label { font-weight: 600; line-height: 1.3; }
.accent-drill-card .stress-translation { font-size: 15px; }
/* r258 (Smith 17 Oct: the word "looks like part of the english"). The prompt is
   set in the house language styles (.prompt-english italic and muted,
   .prompt-italian upright); the word being judged stands on its own line, large
   and in the wine the gender drill gives its noun, so the accent is the thing
   you see. "Correct" / "Incorrect" are English verdicts, not forms to inspect:
   ordinary buttons, not 30px bold. */
.accent-drill-card .prompt .prompt-italian { font-size: 26px; color: var(--ink); }
.accent-drill-card .prompt .accent-target { font-size: 38px; font-weight: 600; line-height: 1.2; color: var(--accent); letter-spacing: .02em; }
/* r258 ("this needs a translation sooner"): the tested word's meaning sits in
   the prompt, under the question and before the choices, in the house English
   style (muted italic) at reading size - it was a 15px grey line after them. */
.accent-drill-card .prompt .accent-meaning { font-size: 18px; font-style: italic; color: var(--muted); margin-top: 2px; }
.accent-drill-card .prompt .accent-target + .accent-meaning { margin-top: -8px; }
/* r258 (Smith 17 Oct: "better if the selected word went green red, rather than
   repeated"). The accent buttons never had the marked colours the spelling,
   gender and stress buttons have, so a pick changed nothing and the result had
   to say the word again. Now the pick turns red if wrong, the right form green
   (so a right pick goes green), with a tick or cross for anyone who cannot tell
   the colours apart, and the other choices step back. Spelling gets the same. */
.accent-choice.gc-correct { outline: 2px solid var(--green); background: var(--green-soft); color: var(--green); }
.accent-choice.gc-wrong { outline: 2px solid var(--red); background: var(--red-soft); color: var(--red); }
.accent-choice.gc-correct .gc-label::after, .spelling-choice.gc-correct .gc-label::after { content: " \2713"; font-weight: 700; }
.accent-choice.gc-wrong .gc-label::after, .spelling-choice.gc-wrong .gc-label::after { content: " \2717"; font-weight: 700; }
/* In "spot the error" the right pick IS the misspelt word, so it goes green
   without a tick that would read as "this spelling is right". */
.spelling-errorid .spelling-choice.gc-correct .gc-label::after { content: none; }
/* A marked card's choices no longer react to the pointer, so a hover cannot
   repaint the verdict colours. */
.accent-choice:disabled, .spelling-choice:disabled { pointer-events: none; }
.accent-choice:disabled:not(.gc-correct):not(.gc-wrong),
.spelling-choice:disabled:not(.gc-correct):not(.gc-wrong) { opacity: .45; }
.accent-drill-card .accent-choices .mcq-choice.accent-choice-verdict { font-size: 18px; letter-spacing: 0; }
.accent-choice-verdict .gc-label { font-weight: 500; }
@media (max-width: 600px) {
  .accent-drill-card .prompt .prompt-italian { font-size: 22px; }
  .accent-drill-card .prompt .accent-target { font-size: 32px; }
}
/* Same reasoning for the accent SLIP banner and the result comparison, where
   the learner has to spot which mark differs. */
.accent-drill-card .result-you-wrote,
.accent-drill-card .cmp-value { font-size: 22px; }


/* Legend for the person bands - the strip is 7-9px per segment so per-row
   headers cannot fit; naming the order once at the top of the panel is what it
   actually needs. accent_stress_and_new_qtypes section 4. */
.band-legend { display: flex; align-items: center; gap: 1px; margin: 0 0 8px 0;
  font-size: 10px; color: var(--muted); letter-spacing: .02em; }
.band-legend-label { margin-right: 7px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .06em; opacity: .8; }
.band-legend-cell { width: 9px; text-align: center; overflow: visible; white-space: nowrap;
  transform: scale(.92); transform-origin: center; }


/* Canvas A6 - tense-choice confusion matrix.
   Column headings are ANGLED and seated at the BOTTOM of the header band, so a
   long tense name never dictates the column width and the label stays against
   the data it names (estate data-table rules). Rotated text is wrapped so the
   header band stays shallow rather than as tall as the longest name. */
.tc-grid { margin: 0 auto; }
.tc-grid th.tc-colhead {
  vertical-align: bottom;
  height: 108px;
  padding: 4px 2px;
  background: transparent;
  border: none;
  font-weight: 600;
}
.tc-grid th.tc-colhead span {
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: normal;
  max-height: 100px;
  line-height: 1.1;
  font-size: .78rem;
  text-align: left;
}
.tc-grid th.tc-corner {
  background: transparent; border: none; font-size: .68rem; color: var(--faint,#8a836f);
  font-weight: 500; text-align: right; vertical-align: bottom; padding-right: 8px; white-space: nowrap;
}
.tc-grid th.tc-rowhead { text-align: left; white-space: nowrap; font-size: .82rem; padding-right: 10px; }
.tc-grid td { min-width: 58px; height: 44px; font-variant-numeric: tabular-nums; color: #2a2a2a; }
.tc-grid td.tc-diag { border-width: 2px; border-color: #cfc7ae; }
.tc-controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.tc-toggle {
  font: inherit; font-size: .78rem; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line,#e3ddc9); background: #fff; color: var(--ink,#2a2a2a); cursor: pointer;
}
.tc-toggle.on { background: var(--navy,#3a4f8a); border-color: var(--navy,#3a4f8a); color: #fff; }


/* ---- Feedback panel redesign, r119 (handoff + riders R1-R6) ---- */
.markers-note { background: #f6f2e8; border-left: 3px solid #d8d2c2; padding: 8px 12px; margin: 8px 0; font-style: italic; }
.markers-note-label { display: block; font-style: normal; font-weight: 700; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.good-translation { margin: 8px 0; }
.good-translation .gt-label { display: block; font-weight: 700; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.good-translation .gt-line { font-size: 17px; }
/* translation_feedback_display v1 §2-§3: "This would also have been OK" on a
   right answer; the item's own explanation, folded when right, open when not. */
.good-translation.also-ok .gt-label { color: var(--green); }
.result details.item-why { margin-top: 10px; }
.result details.item-why > summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--accent); }
.result details.item-why > .result-explanation { margin-top: 6px; }
.stub-not-marked { margin: 8px 0; color: var(--muted); font-style: italic; }
.sent-marked .sent-span { text-underline-offset: 3px; }
.sent-marked .span-right { text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 3px; }
.sent-marked .span-wrong { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.sent-marked .span-mixed { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; }
/* Translation feedback: one aligned row per element, with a readable verdict.
   Blue means partly correct here; the coverage palette keeps its own meaning. */
#strand-translation .sent-marked .span-mixed { text-decoration-color: var(--blue); }
.el-head { margin: 18px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); }
.el-list { border-top: 1px solid var(--line); }
.el-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.el-label { min-width: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.el-evidence { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  min-width: 0; font-size: 17px; }
.el-evidence > :first-child { min-width: 0; overflow-wrap: anywhere; }
.el-glyph { flex: 0 0 20px; text-align: center; font-size: 18px; font-weight: 700; }
.el-row.hit .el-evidence { color: var(--green); }
.el-row.partial .el-evidence { color: #245a86; }
.el-row.miss .el-glyph { color: var(--red); }
.el-row.not_attempted .el-evidence { color: var(--muted); }
.el-row.proposed .el-label::after { content: " (suggested skill)"; font-size: 11px; }
.el-reason { position: relative; align-self: center; }
.el-dots { display: list-item; padding: 2px 0; border-radius: 3px; color: var(--muted);
  text-align: center; cursor: pointer; list-style: none; }
.el-dots::-webkit-details-marker { display: none; }
.el-dots::marker { content: ""; }
.el-dots:hover, .el-reason[open] .el-dots { color: var(--ink); background: var(--blue-soft); }
.el-dots:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.el-explanation { display: none; position: absolute; top: calc(100% + 4px); left: 50%;
  transform: translateX(-50%); z-index: 5; width: min(360px, calc(100vw - 48px));
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); box-shadow: 0 4px 16px rgba(0,0,0,.12);
  color: var(--ink); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.el-reason[open] .el-explanation { display: block; }
.el-expected { display: block; margin-top: 6px; font-weight: 600; }
@media (max-width: 560px) {
  .el-row { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 7px; padding: 8px 0; }
  .el-label { font-size: 12px; }
  .el-evidence { font-size: 15px; gap: 5px; }
  .el-dots { min-height: 36px; line-height: 32px; }
}
.corr-diff { display: flex; gap: 8px; align-items: baseline; padding-left: 8px; border-left: 2px solid var(--red); margin: 2px 0; flex-wrap: wrap; }
.corr-diff.partial { border-left-color: var(--green-partial); }
.diff-learner { color: var(--muted); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.diff-arrow { color: var(--red); }
.diff-correct { color: var(--ink); font-weight: 600; }
.diff-matched { display: flex; gap: 8px; align-items: baseline; padding-left: 8px; border-left: 3px solid var(--green); margin: 2px 0; font-weight: 600; }
.diff-matched .diff-tick { color: var(--green); font-weight: 700; }
.mcq-choice.wrong-pick::after { content: "your pick"; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-left: 8px; opacity: 0.75; }
.last10-marks .mark.partial, .last-n .mark.partial { color: var(--green-partial); }

.score-impressionistic { margin-left: 10px; opacity: 0.85; }

/* Start button states (r129). A disabled Start must still read as the thing it
   will become, and a failed start must say so where the learner is looking. */
.entry-start[disabled] { opacity: 0.55; cursor: progress; }
.entry-start-wait { font-size: 12.5px; color: var(--muted); font-style: italic; margin-top: 6px; }
.entry-start-error { margin-top: 8px; padding: 8px 12px; font-size: 13px;
  background: var(--red-soft); border-left: 3px solid var(--red); border-radius: 0 4px 4px 0; }

/* r133: label the correct answer when the diff cannot speak for itself (the
   learner's half is suppressed as a duplicate, which is every vocab item). */
.diff-correct-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-right: 7px; }

/* The learner's own word, named back on a miss (r134). Quiet blue - it is
   information, not a verdict, and must never read as a second mark. */
.their-answer { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px;
  margin-top: 10px; padding: 8px 12px; font-size: 14px;
  background: var(--blue-soft); border-left: 3px solid var(--blue); border-radius: 0 4px 4px 0; }
.their-answer-lead, .their-answer-mid { color: var(--muted); font-size: 13px; }
.their-answer-said { font-style: italic; }
.their-answer-is { font-weight: 700; color: #25406b; }
/* r150: the honest empty case. Deliberately NOT blue - blue is content,
   and this is a note about the limits of our own word list. */
/* r152: the "we noticed it and cannot file it yet" panel. Quiet, growing
   register - never failing, never suspicious of the answer, never a mark. */
.result-growing { margin-top: 10px; padding: 8px 12px; border-left: 3px solid var(--line);
  background: rgba(0,0,0,0.02); border-radius: 0 4px 4px 0; font-size: 13px; }
.result-growing-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 3px; }
.result-growing-line { color: var(--ink, inherit); }
.result-growing-foot { color: var(--muted); font-style: italic; margin-top: 3px; font-size: 12px; }

/* r186 the one-word card's result (Design round 3): label, answer first and
   large, the blue line, the verdict. No fraction, no arrow. */
.vocab-result-label { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-top: 12px; }
.vocab-result-answer { font-family: "Fraunces", Georgia, serif; font-size: 26px; line-height: 1.15; color: var(--ink); margin: 2px 0 2px; text-wrap: pretty; }
.vocab-result-alts { font-size: 17px; color: var(--ink); margin: 2px 0 4px; line-height: 1.3; }   /* r200 (Smith): the other senses are answers too, not a footnote */
.vocab-their-answer { font-size: 14px; gap: 5px; }
.vocab-their-answer .their-answer-mid { font-size: 13px; }
.vocab-result-verdict { margin-top: 2px; font-size: 17px; }
.vocab-result-verdict strong { font-weight: 600; }
.vocab-result-verdict.right strong { color: var(--green, #235c3c); }   /* r194 (Smith): the vivid green read as bright; the deep house green instead */
.vocab-result-verdict.half strong { color: #9a6a00; }
.vocab-result-verdict.wrong strong { color: var(--red, #7f2a24); }   /* r198 (Smith): a wrong RED, not Linguics wine */
.vocab-result-verdict span { color: var(--muted); font-size: 13px; }
.vocab-result-why { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.vocab-result-usage { margin-top: 10px; font-size: 12px; color: var(--muted); }
.vocab-result-usage-head { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-right: 4px; }
.their-answer.their-answer-blank { background: transparent; border-left-color: var(--line);
  color: var(--muted); font-size: 13px; font-style: italic; }

/* Footer streak (r135). Quiet - it is a fact about the learner, not a nag. */
#streak-host { color: var(--muted); cursor: help; }
#streak-host b { color: var(--accent); font-weight: 600; }

/* Direction lens on every analysis panel (r136). Quiet, but always present -
   it names WHICH statistic you are reading, and the panels must never differ
   in how they say it. */
/* r142 (Smith): the direction lens "just blended in as the same colour of the
   background... at least have it with a white background, but maybe dark blue",
   and he wants it sitting CLOSE to the title rather than adrift at the far end
   of the row. It is the label that says which of two different skills these
   numbers measure, so reading as background texture is the wrong weight
   entirely. Navy on a tinted chip, tucked up beside the heading. */
.vocab-axis-title .vocab-axis-lens {
  margin-left: 10px; margin-right: auto;
  color: var(--navy, #3a4f8a); background: #eef1f8;
  border: 1px solid #d6dcee; border-radius: 3px;
  padding: 1px 7px; font-style: normal; font-size: 11px;
  white-space: nowrap;
}
.vocab-axis-title .vocab-axis-lens::before { content: none; }
.vocab-axis-lens { margin-left: 9px; font-size: 11.5px; font-style: italic;
  color: var(--muted); white-space: nowrap; cursor: help; }
.vocab-axis-lens::before { content: "\00b7"; margin-right: 8px; color: var(--line); font-style: normal; }

/* r137: the themes column keeps its heading while its body scrolls, so you
   always know which panel you are inside (Smith: "we want at least themes to be
   sticky"). Solid background or the rows show through it. */
/* r139: these were sticky but SEE-THROUGH, so the rows scrolled visibly behind
   the heading text (Smith: "things go behind it"). An opaque background is not
   enough on its own - the title must also span the full scroll width and stop
   the content at its edge, hence the negative margins and the rule beneath. */
/* r142: STILL see-through, and now I know why. `--bg` is the page cream, but the
   panel behind these headings is WHITE, and the sticky bar sat at `top: 0` in a
   box whose 4px of padding sits ABOVE that origin - so a sliver of row showed
   through over the title (Smith: "there's a little transparent bit so you can
   see it... it's still hanging behind the themes"). Three fixes together: an
   opaque WHITE ground, negative top so the bar covers the padding it sits in,
   and the frequency title made sticky too - it scrolled away entirely once the
   heatmap became a scrollbox, which is why "Most frequently used Italian words"
   vanished and the panel read as broken. */
.vocab-axis-themes .vocab-axis-title,
.vocab-axis-gender .vocab-axis-title,
.vocab-axis-freq .vocab-axis-title {
  position: sticky; top: -1px; z-index: 6;
  background: #fff;
  margin: -6px -8px 6px; padding: 8px 8px 6px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 7px -5px rgba(0,0,0,0.22);
}
/* The footer must never be see-through: content scrolling under it was drawing
   straight through the text in Smith's shots. */
footer { background: var(--bg); position: relative; z-index: 20; }

/* r139 footer order (Smith): build to the left, streak pushed hard right so it
   is not lost in the middle of the status line.
   r142: the STREAK goes furthest right of all, past the build id, because the
   feedback widget floats over that corner and was covering the build number
   ("we can't see the build number, the feedback covers it up"). The streak is a
   picture and survives a partial overlap; a version string does not. So the
   streak takes the corner and the build id steps left of it, clear of the
   widget - and the whole bar keeps a right margin the widget cannot reach. */
#build-version { order: 8; margin-left: auto; }
#streak-host { order: 9; margin-left: auto; }
/* A quiet footer trigger; the six choices stay inside the estate panel. */
#footer-feedback-host { order: 0; }
#footer-feedback-host #wk-fb-btn { position: static; right: auto; bottom: auto; z-index: auto;
  padding: 2px 0; border: 0; border-radius: 0; box-shadow: none; background: transparent;
  color: var(--muted); font: inherit; font-size: 11px; font-weight: 400; }
#footer-feedback-host #wk-fb-btn:hover { color: var(--ink); text-decoration: underline; }
#footer-feedback-host #wk-fb-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
html #wk-fb-panel { left: 28px; right: auto; bottom: 48px; width: min(360px, calc(100vw - 56px));
  max-height: calc(100vh - 80px); background: var(--bg); color: var(--ink); border-color: var(--line); }
html #wk-fb-panel p.wk-fb-lead { font-weight: 400; }
html #wk-fb-panel button.wk-fb-reason { background: transparent; border-color: var(--line); }
html #wk-fb-panel button.wk-fb-reason:hover { background: var(--blue-soft); }
html #wk-fb-send { background: var(--accent); border-color: var(--accent); }
#ll-feedback-marking { margin: 10px 0; padding: 0; border: 0; font-size: 12px; }
#ll-feedback-marking legend { margin-bottom: 6px; color: var(--muted); }
#ll-feedback-marking label { display: flex; align-items: baseline; gap: 7px; padding: 5px 0; cursor: pointer; }
#ll-feedback-marking input { flex: 0 0 auto; accent-color: var(--accent); }
.ll-feedback-contact { margin-top: 8px; font-size: 12px; }
.ll-feedback-contact summary { color: var(--muted); cursor: pointer; }

/* ============================================================================
   r217 ENTRY SCREEN TO DESIGN'S MEASUREMENTS. Taken from the inline styles in
   the round-3 file (incoming drafts/design/vocab_page_round3_2026-09-06,
   ENTRY SCREEN block), not from a screenshot: 330px left column, 16px gap,
   small-caps 9.5px headings, strand rows in Fraunces 17 with an 11.5px line,
   quick rows 12.5px with a right-hand figure, the configurator as a bordered
   panel headed by name + summary + Start (Fraunces 15, 11px 34px), option
   cards in a three-column grid, 2px radii throughout - Design's corners are
   square, not pills.
   ============================================================================ */
.entry-two { grid-template-columns: 330px minmax(0, 1fr); gap: 16px; max-width: 1368px; padding: 0; }
.entry-two:not(.has-config) { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 32px; max-width: 1120px; }
.entry-two:not(.has-config) .entry-side { grid-column: 2; grid-row: 1; padding-top: 28px; }
.entry-two:not(.has-config) .entry-col { grid-column: 1; grid-row: 1; }
.entry-two:not(.has-config) .entry-cards { grid-auto-rows: 1fr; }
.entry-two:not(.has-config) .entry-card { min-height: 144px; }
.entry-two:not(.has-config) .entry-card-name { font-size: 21px; }
.entry-two:not(.has-config) .entry-card-desc { font-size: 14px; line-height: 1.45; }
.entry-welcome { padding: 30px 32px; background: #f5efe5; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 2px; }
/* r279 (Smith, 1 November 2026: "could this be smaller font?"): 24px, as on phones (below); it was up to 34px.
   The measure widens to 31ch so the lines still break where they did at 34px (22ch). */
.entry-welcome h2 { max-width: 31ch; margin: 0; font-family: Fraunces, Georgia, serif; font-size: 24px; line-height: 1.25; font-weight: 500; color: var(--ink); text-wrap: pretty; }
.entry-welcome p { max-width: 34ch; margin: 20px 0 0; font-size: 15px; line-height: 1.6; color: #4b4638; }
.entry-col { max-width: none; min-width: 0; }
.entry-greeting.entry-smallcaps, .entry-quick-head { font-family: inherit; font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: #8a8272; font-weight: 600; margin: 8px 0 9px; }
.entry-cards.has-feed { grid-template-columns: 47px minmax(0, 1fr); column-gap: 0; row-gap: 9px; position: relative; }
.entry-feed { width: 27px; justify-self: end; }
.entry-feed path { stroke-width: 1.5; }
/* r224, Smith: "'feeds into' v small." It was 7.5px against a 15px body, rotated
   and hard against the frame, so it cost the space and did not deliver the words.
   Architecture's call (entry_labels_and_stale_html v1 SS3) was mine to make, and
   its two options were: drop the text and rely on the arrow plus its title, or
   give it a size it can be read at. I have taken the second, and the reason is
   the phone: `title` is a HOVER affordance and there is no hover on a touch
   screen, so "keep the arrow and its tooltip" quietly deletes the meaning for
   every mobile learner rather than shrinking it. The vertical spine is Design's
   composition and stays; it just gets a legible size. 10px with the existing
   tracking reads at arm's length. The gutter reserves a separate 20px lane
   for the words before the 27px connector, keeping the text off the spine. */
.entry-feed-label {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-size: 10px; line-height: 1.2; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.entry-card { border-radius: 2px; padding: 12px 13px; gap: 10px; background: #fffdf8; border: 1px solid var(--line); align-items: flex-start; }
.entry-card.selected { background: #f6ecee; border-color: var(--accent); box-shadow: none; }
.entry-card-badge { width: 26px; height: 26px; font-size: 13px; border-radius: 3px; margin-top: 1px; }
.entry-card-text { flex: 1 1 auto; min-width: 0; width: 100%; }
.entry-card-namerow { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; }
.entry-card-name { font-family: Fraunces, Georgia, serif; font-size: 17px; font-weight: 500; }
.entry-card-meta { font-size: 10.5px; color: #8a8272; margin: 0; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
.entry-card-desc { font-size: 11.5px; color: #4b4638; margin-top: 5px; text-wrap: pretty; }
.entry-quickstarts { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; }
.entry-quick { flex-direction: row; align-items: baseline; justify-content: space-between; border: 1px solid var(--line); background: #fffdf8; border-radius: 2px; padding: 8px 11px; font-size: 12.5px; box-shadow: none; color: var(--ink); }
.entry-quick .quick-title { font-size: 12.5px; font-weight: 400; }
.entry-quick .quick-figure { font-size: 12px; color: #b9ae99; white-space: nowrap; }
.entry-quick-mistakes { background: #fffdf8; color: var(--ink); }
.entry-quick-mistakes .quick-title { font-weight: 600; }
.entry-quick:hover { border-color: var(--accent); }
.entry-side { padding-top: 0; }
.entry-side .entry-config { margin-top: 0; background: #fffdf8; border: 1px solid var(--line); border-radius: 2px; padding: 0; display: flex; flex-direction: column; }
.entry-panel-head { display: flex; align-items: center; gap: 16px; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.entry-panel-name { font-family: Fraunces, Georgia, serif; font-size: 21px; font-weight: 500; margin: 0; }
.entry-panel-sub { font-size: 11.5px; color: #8a8272; margin-top: 2px; }
.entry-start-top { margin-left: auto; font-family: Fraunces, Georgia, serif; font-size: 15px; padding: 11px 34px; background: var(--accent); color: #fdfaf4; border: 1px solid var(--accent); border-radius: 2px; cursor: pointer; width: auto; }
.entry-start-top:hover { background: #7a2439; }
.entry-side .entry-config > *:not(.entry-panel-head):not(.entry-start-wrap) { margin-left: 18px; margin-right: 18px; }
.entry-side .entry-config > .entry-config-head { margin-top: 15px; }
.entry-config-head { font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: #8a8272; font-weight: 600; margin: 15px 0 2px; }
.entry-config-hint { font-size: 10px; color: #a89f8d; margin: 2px 0 6px; font-style: normal; }
.entry-chip { border-radius: 2px; font-size: 11.5px; padding: 3px 10px; border: 1px solid #e0d7c4; background: #fffdf8; color: var(--ink); }
.entry-chip.active { background: #f6ecee; border-color: var(--accent); color: var(--ink); font-weight: 400; box-shadow: inset 0 0 0 1px var(--accent); }
.entry-chip-row { gap: 6px; margin: 6px 0; }
.entry-cards-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.entry-chip.entry-chip-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; font-size: 14px; text-align: left; }
.entry-chip-sub { font-size: 11px; color: #8a8272; font-weight: 400; }
.entry-lens-toggle { display: flex; gap: 6px; margin: 6px 0 2px; }
.entry-vocab-summary { font-size: 11px; color: #6b6b6b; margin: 8px 0 2px; }
.entry-travel-note { font-size: 11.5px; color: #8a8272; padding-top: 12px; border-top: 1px solid #ece5d7; margin-top: 15px; }
.entry-side .entry-config .entry-start-wrap { margin: 0; padding: 12px 18px; background: linear-gradient(to top, #fffdf8 70%, rgba(255,253,248,0)); }
.entry-side .entry-config.top-start-visible .entry-start-wrap { display: none; }
.entry-coverage-link { font-size: 12px; color: #6b6b6b; border: 1px solid #e0d7c4; background: transparent; padding: 6px 13px; border-radius: 2px; cursor: pointer; margin-top: 10px; }
@media (max-width: 860px) {
  .entry-two, .entry-two:not(.has-config) { grid-template-columns: 1fr; }
  .entry-two:not(.has-config) { gap: 20px; }
  .entry-two:not(.has-config) .entry-side { grid-column: 1; grid-row: 1; padding-top: 0; }
  .entry-two:not(.has-config) .entry-col { grid-row: 2; }
  .entry-two:not(.has-config) .entry-cards { grid-auto-rows: auto; }
  .entry-two:not(.has-config) .entry-card { min-height: 0; }
  .entry-welcome { padding: 20px 22px; }
  .entry-welcome h2 { max-width: none; font-size: 24px; }
  .entry-welcome p { max-width: none; margin-top: 10px; font-size: 14px; }
  .entry-side .entry-config.top-start-visible .entry-start-wrap { display: block; }
}

/* ============================================================================
   r217 GRAMMAR / TRANSLATION PAGES TO DESIGN'S MEASUREMENTS (GRAMMAR PAGE and
   TRANSLATION PAGE blocks of the round-3 file). Body 54/46 with 12px gaps; a
   34px strip in 9.5px small caps with 11.5px 2px-radius chips; the card in a
   #fffdf8 panel, meta 10.5px, prompt Fraunces 25px; choices as 14.5px rows
   with a 17px numbered ring; Mark 13.5px wine, Skip outlined; the result
   headline Fraunces 15px green; the topics panel in THREE packed columns of
   compact cards. Scoped to the two pages and the live panel.
   ============================================================================ */
main { grid-template-columns: minmax(0, 54fr) minmax(0, 46fr); gap: 12px; padding: 12px 28px 28px; max-width: 1480px; }
body.strand-vocab-active main { gap: 12px; }
.filter-bar.scope-strip, .filter-row.scope-strip { gap: 7px; }
.scope-lead { font-size: 9.5px; letter-spacing: .15em; }
.filter-chip.scope-chip { border-radius: 2px; min-height: 26px; padding: 2px 8px; font-size: 11.5px; background: #fffdf8; border-color: #e0d7c4; }
.filter-chip.scope-chip select, .scope-chip strong { font-size: 11.5px; font-weight: 400; }
.filter-chip.level-boxes .level-toggle { font-size: 10.5px; padding: 2px 8px; border-radius: 2px; }
.scope-setup { font-size: 11.5px; padding: 3px 10px; border-radius: 2px; border-color: #e0d7c4; color: #6b6b6b; background: transparent; }
#strand-grammar .qcard, #strand-translation .qcard { background: #fffdf8; border: 1px solid var(--line); border-radius: 2px; padding: 12px 18px 13px; margin-bottom: 8px; }
#strand-grammar .qcard .meta, #strand-translation .qcard .meta { font-size: 10.5px; color: #8a8272; margin-bottom: 0; }
#strand-grammar .qcard .prompt, #strand-translation .qcard .prompt { font-family: Fraunces, Georgia, serif; font-size: 25px; line-height: 1.3; margin: 5px 0 10px; text-wrap: pretty; }
#strand-grammar .qcard .prompt .prompt-italian, #strand-grammar .qcard .prompt .prompt-english { font-size: 25px; }
#strand-grammar .mcq-choices { gap: 4px; }
#strand-grammar .mcq-choice { border-radius: 2px; padding: 8px 13px; font-size: 14.5px; gap: 10px; background: #fffdf8; }
#strand-grammar .mcq-key-badge { width: 17px; height: 17px; font-size: 10px; color: #8a8272; border: 1px solid #d8cfbc; background: transparent; }
/* r220: this rule had NO phone guard, so Design's desktop button size (13.5px on
   6px of padding) also applied on touch and overrode the coarse-pointer rule that
   grows targets toward 44px - which is why Smith's thumb could not hit Mark. The
   desktop sizing is now fenced above 600px; the phone block below owns touch. */
@media (min-width: 601px) {
  #strand-grammar .actions button, #strand-translation .actions button { font-size: 13.5px; padding: 6px 22px; border-radius: 2px; }
}
#strand-grammar .actions button.secondary, #strand-translation .actions button.secondary { padding: 6px 16px; border-color: #e0d7c4; color: #6b6b6b; background: transparent; }
#strand-grammar .actions .kbd-hint, #strand-translation .actions .kbd-hint { font-size: 10px; color: #8a8272; font-style: italic; margin-left: auto; }
#strand-grammar .result, #strand-translation .result { background: #fffdf8; border: 1px solid var(--line); border-radius: 2px; padding: 13px 15px; }
#strand-grammar .result .overall .score, #strand-translation .result .overall .score { font-family: Fraunces, Georgia, serif; font-size: 15px; }
#strand-grammar .result .overall { gap: 8px; align-items: baseline; }
.result-topic-reveal { margin-top: 11px; padding-top: 10px; border-top: 1px solid #ece5d7; font-size: 13px; }
.result-topic-reveal .result-topic-key { display: block; font-size: 10px; letter-spacing: .13em; margin: 0 0 4px; color: #8a8272; }
#strand-grammar .result-explanation { margin-top: 11px; padding: 9px 11px; background: #e5eef6; border-left: 2px solid #4a89c7; font-size: 12.5px; line-height: 1.5; }
.card-foot-qtypes { border-radius: 2px; padding: 5px 12px 6px; gap: 8px; }
.card-foot-key { font-size: 8.5px; letter-spacing: .1em; }
.qtype-chip { font-size: 10px; color: #6b6b6b; border: 1px solid #e0d7c4; border-radius: 10px; padding: 1px 8px; }
#live-stats { background: #fffdf8; border: 1px solid var(--line); border-radius: 2px; padding: 12px 15px; }
#live-stats .live-header h3 { font-family: Fraunces, Georgia, serif; font-size: 14.5px; font-weight: 500; margin: 0; }
.live-subtitle { font-size: 10.5px; margin: 0 0 6px; }
/* r219: THIS was the rule that actually did it. r216-r218 took the panel from two
   multi-column columns to THREE, inside a column the same pass had narrowed to 46%
   - about 183px per column - and that is what produced both of Smith's faults at
   once: multi-column fragments overflowing into their neighbours (the spelling
   cards painted over Passato prossimo), and .overview-label MEASURED AT ZERO WIDTH
   on all 24 tiles on the live page, because the meta string needed the whole column.
   Design's three columns are honoured, but as a grid minimum rather than a
   multi-column count: auto-fill gives three at this width and drops to two or one
   as the panel narrows, and grid items cannot overlap at any width. */
body:not(.strand-vocab-active) .live-overview .overview-category-group { column-gap: 14px; }
body:not(.strand-vocab-active) .live-overview .overview-category-header { font-size: 10px; letter-spacing: .12em; color: var(--accent); border-bottom: 1px solid #ece5d7; margin: 4px 0 5px; padding-bottom: 3px; }
body:not(.strand-vocab-active) .overview-cell { padding: 6px 8px 7px; margin-bottom: 6px; border-radius: 2px; background: #fdfaf4; }
body:not(.strand-vocab-active) .overview-label { font-size: 11.5px; font-weight: 600; }
body:not(.strand-vocab-active) .overview-meta { font-size: 9px; color: #8a8272; }
body:not(.strand-vocab-active) .overview-mini { padding: 2px 6px 3px; border-radius: 1px; }


/* r230: a class whose regime its author seat has not yet confirmed. Marked, not
   hidden - the score is real, the classification is provisional. */
.rule-seg.provisional { outline: 1px dotted rgba(154,106,0,.55); outline-offset: -1px; }

/* r236: the teacher's sets on the entry screen. Same row shape as the
   quick-starts beneath them, so the two read as one list with a heading each. */
.entry-sets { margin-bottom: 14px; }
.entry-set-row .entry-quick-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.entry-set-row.is-empty { opacity: .55; cursor: default; }
.entry-set-row.is-empty:hover { border-color: var(--line); }

/* Acknowledge a selection/Next immediately while the new practice is prepared. */
.vocab-refresh-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.vocab-refresh-status::before, .vocab-refresh-card .prompt::before {
  content: ""; display: inline-block; width: 12px; height: 12px; flex: 0 0 auto;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: vocab-refresh-spin .8s linear infinite;
}
.vocab-refresh-card .prompt { flex-direction: row; align-items: center; gap: 10px; }
.vocab-refresh-card > button { align-self: flex-start; }
@keyframes vocab-refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .vocab-refresh-status::before, .vocab-refresh-card .prompt::before { animation: none; }
}
.ds-category-pick {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ds-category-pick:hover, .ds-category-pick[aria-pressed="true"] { text-decoration: underline; }
.ds-category-pick:focus-visible { outline: 2px solid var(--accent, #922747); outline-offset: 3px; }
.rule-row.gender-exception .l { padding-left: 26px; }
.vocab-cell.gender-exception { padding-inline-start: 24px; border-inline-start: 2px solid var(--line); }
.gd-other-routes { margin-top: 8px; font-size: 0.9em; }
.gd-other-routes summary { cursor: pointer; color: var(--muted); }
.gd-other-routes .gd-route-exception { padding-inline-start: 12px; }

/* negative_anchors_and_wordreference v1 §2 and v2 (Smith 2026-10-12): one small,
   consistent look-up mark after an Italian word, opening WordReference in a new
   tab; and a quiet "offensive in some uses" beside a word Vocab tagged vulgar or
   offensive. Muted, no colour of its own. */
.wr-link { margin-left: 6px; font-size: 14px; font-weight: 400; font-style: normal; color: var(--muted); text-decoration: none; }
.wr-link:hover, .wr-link:focus-visible { color: var(--accent); text-decoration: underline; }
.register-label { margin-left: 8px; font-size: 12px; font-weight: 400; font-style: italic; color: var(--muted); }

/* r298 (Smith's EDICT, 15 November 2026: nothing marks the drawn cell before an answer; every
   change of colour flashes). Rule 2 in the drill panel: a figure whose colour changed on this
   answer flashes once in its new colour, with the double pulse the overview's dots use. A
   confusion-matrix cell keeps its place in the table and pulses an inner ring instead. The
   practice calendar's day flashes like an overview dot on the day's first answer. */
.ds-chip-flash { animation: ds-chip-flash 1400ms ease-in-out 1; position: relative; z-index: 1; }
.stress-confusion td.ds-chip-flash { animation-name: ds-cell-flash; position: static; }
.streak-day.streak-flash { animation: fresh-dot-flash 1400ms ease-in-out 1; position: relative; z-index: 3; }
/* A flanking cell of the frequency map is recoloured on a miss as on a hit, and had a flash for the
   hit only: on a miss it was lifted above its neighbours and nothing more. It takes the neutral
   flash the dots beside it have. The cell is five pixels wide, so the ring goes round it, not
   inside it, and its new colour shows. */
.freq-flank-cell.flash { outline: 2px solid var(--accent); animation: vocab-cell-flash 0.8s ease-out; }
@keyframes ds-chip-flash {
  0%   { transform: scale(1);    box-shadow: none; }
  20%  { transform: scale(1.14); box-shadow: 0 0 0 3px var(--accent); }
  45%  { transform: scale(1.04); box-shadow: 0 0 0 1px var(--accent); }
  65%  { transform: scale(1.14); box-shadow: 0 0 0 3px var(--accent); }
  100% { transform: scale(1);    box-shadow: none; }
}
@keyframes ds-cell-flash {
  0%, 100% { box-shadow: none; }
  20%, 65% { box-shadow: inset 0 0 0 3px var(--accent); }
  45%      { box-shadow: inset 0 0 0 1px var(--accent); }
}
/* The same edict, for a learner who has asked for reduced motion: a brief outline stands in
   for every flash. Nothing moves, grows or washes; the outline is there for the flash's own
   length and then gone. Each outline keeps its flash's colour (green for a hit on the map,
   the pulse strip's three verdict colours). It sits inside a row, a bar or a large cell, so
   that a scrolling panel cannot clip it, and round a dot or a narrow cell, so that the new
   colour shows. */
@keyframes edict-outline {
  0%, 100% { outline: 2px solid var(--edict-outline, var(--accent)); outline-offset: var(--edict-offset, 1px); }
}
@media (prefers-reduced-motion: reduce) {
  .live-bucket-row.fresh-flash, .overview-mini.fresh-flash, .overview-dot.fresh-flash, .overview-dot.matrix.fresh-flash,
  .ds-fired, .ds-chip-flash, .stress-confusion td.ds-chip-flash, .streak-day.streak-flash, #pullup-bar.fired { animation: edict-outline 1400ms step-end 1; }
  .flash-good, .flash-bad, .flash-warm { animation: edict-outline 900ms step-end 1; }
  .freq-dot.flash, .vocab-lemma-dot.flash, .vocab-cell.flash, .freq-flank-cell.flash { animation: edict-outline 800ms step-end 1; }
  .vocab-strip.flash { animation: edict-outline 700ms step-end 1; }
  .freq-dot.flash-hit, .vocab-lemma-dot.flash-hit, .vocab-cell.flash-hit, .freq-flank-cell.flash-hit { animation: edict-outline 900ms step-end 1; --edict-outline: #1b8a4a; }
  .live-bucket-row.fresh-flash, .ds-fired, .stress-confusion td.ds-chip-flash, #pullup-bar.fired,
  .flash-good, .flash-bad, .flash-warm, .vocab-strip.flash, .vocab-cell.flash, .vocab-cell.flash-hit { --edict-offset: -2px; }
  .freq-dot.flash, .freq-dot.flash-hit, .vocab-lemma-dot.flash, .vocab-lemma-dot.flash-hit,
  .freq-flank-cell.flash, .freq-flank-cell.flash-hit { --edict-offset: 0px; }
  .flash-good { --edict-outline: #2f8f4e; }
  .flash-bad { --edict-outline: var(--red); }
  .flash-warm { --edict-outline: #d99a1b; }
}
