/* Shared components. Class names are the contract for Learn and Practice.
   Hairlines are color-mix of --fg. Do not add a new colour.

   Buttons:        .btn  .btn.primary  .btn.block  .choice
   Segmented:      .seg > button[aria-pressed]
   Cards:          .card
   Progress:       .meter > .meter-fill   (set width in CSS or element.style)
   Tier ladder:    ol.ladder > li.ladder-rung.is-done|.is-current|.is-locked
   Chips:          .chip  .chip-ok  .chip-bad
   Tables:         table.data
   Empty / error:  .state
   Toast:          #toast.toast
   Tab bar:        nav.tabbar a[aria-current=page]
   Top nav:        header.top  nav.nav a[aria-current=page]
   Skeletons:      .skel-line  .skel-block
   Correct/wrong:  .is-correct  .is-incorrect   (the only colour on a control)
*/

/* THE MASTHEAD — the Sovereign Academy lockup (lane BRAND-SOVEREIGN-ACADEMY).
 *
 * It is the same sticky, translucent bar as before, with two brand decisions and no
 * third: the rule under it is the GOLD hairline rather than a plain ink one (the
 * identity's accent, at the one place every page passes through), and the wordmark
 * carries the pediment mark beside it so the masthead is the identity rather than a
 * line of text.
 *
 * The gold rule is drawn as a 1px `--gold-rule` (the accent at ~46%) instead of the
 * `--hair` (12% ink): at 12% a gold rule disappears, and at full `--gold` a 1px line
 * across a 1,400px bar reads as a divider that is shouting. The measured value is in
 * tokens.css.
 */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: calc(var(--tap) + var(--space-4));
  padding-top: env(safe-area-inset-top);
  padding-right: max(var(--space-4), env(safe-area-inset-right));
  padding-left: max(var(--space-4), env(safe-area-inset-left));
  /* A translucent bar over the gold rule. It was opaque paper, so on a long page the
     text scrolling under it was cut off mid-line exactly at the rule, which reads
     as a rendering fault rather than as a header. One compositor layer; dropped
     entirely when the reader asks for less transparency. */
  background: var(--bg);
  border-bottom: 1px solid var(--gold-rule);
}

@supports (backdrop-filter: blur(8px)) {
  .top {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(120%) blur(8px);
    -webkit-backdrop-filter: saturate(120%) blur(8px);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .top {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* THE LOCKUP: MARK, THEN WORD.
 *
 * `.brand-mark` is inline SVG in `index.html`, filled with `currentColor`, and this
 * rule is what makes it the accent: the mark is drawn in `--gold-ink` (the value that
 * clears 4.5:1 on parchment AND on the ivory card — see tokens.css) while the word
 * stays `--fg`. That is the one place gold is used as art rather than as a signal,
 * and it is the mark's whole job: the pediment is the identity, and the identity is
 * the accent.
 *
 * The 32x24 box is the temple's own 100:75 aspect, so the drawing is never squashed.
 * `flex: none` keeps the mark from being shrunk by a long word in a narrow bar, and
 * the 2px optical nudge lifts it onto the wordmark's baseline — the pediment's ink
 * sits low in its viewBox (y 5..71 of 75), so centring the BOX leaves it visibly below
 * the cap height.
 */
.brand {
  font-family: var(--font-text);
  font-size: var(--step-1);
  font-weight: 500;
  /* The one piece of letter-spacing in the chrome: a wordmark is set, not typed. */
  letter-spacing: -0.015em;
  text-decoration: none;
  color: var(--fg);
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  /* The wordmark IS the home link and it sat flush against the nav beside it, so
     the two read as one run of five words. */
  padding-right: var(--space-2);
}

.brand-mark {
  width: 32px;
  height: 24px;
  flex: none;
  display: block;
  color: var(--gold-ink);
  margin-top: -2px;
}

.brand-word { display: inline-block; }

/* Below 380px the bar has a mark, three nav words hidden behind the tab bar, and the
   theme control; the wordmark keeps its full size because it IS the product's name.
   Only the mark shrinks, and only by two pixels. */
@media (max-width: 379px) {
  .brand-mark { width: 28px; height: 21px; }
}

.nav {
  display: none;
  align-items: center;
  gap: var(--space-1);
}

.nav a {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-3);
  text-decoration: none;
  color: var(--muted);
  border-radius: var(--radius);
  font-size: var(--step-0);
  letter-spacing: -0.005em;
}

.nav a:hover { color: var(--fg); }

.nav a[aria-current="page"] {
  color: var(--fg);
  background: var(--surface-2);
}

.top-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  /* 1rem. The theme control and Sign out were a half-rem apart and read as one control. */
  gap: var(--space-4);
}

/* THE THEME AND SIGN-OUT CONTROLS ARE CHROME, NOT ACTIONS.
   Both were `.btn` — a 44px bordered rectangle — in the header of every page, so
   the two least important controls on a screen carried the same weight as
   "Start". As chrome they are text buttons at the muted colour, with a hairline
   on hover and the shared focus ring throughout. */
.top .btn {
  min-height: var(--tap);
  padding: 0 var(--space-2);
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: var(--step--1);
  letter-spacing: 0.01em;
}

.top .btn:hover {
  color: var(--fg);
  border-color: var(--hair-strong);
  background: transparent;
}

.who {
  color: var(--muted);
  font-size: var(--step--1);
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* On a phone the name does not fit beside the theme and sign-out controls, so the
   link becomes a round badge with the first letter; the accessible name is unchanged. */
@media (max-width: 719px) {
  .who {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: var(--tap);
    height: var(--tap);
    max-width: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--fg);
    font-size: 0;
    text-decoration: none;
  }
  .who::before {
    content: attr(data-initial);
    font-size: var(--step-0);
    font-weight: 600;
    line-height: 1;
  }
  .who[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--fg); }
}

.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--bg);
  border-top: 1px solid var(--hair);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar a {
  flex: 1 1 0;
  min-width: 0;
  /* 3rem, not the 44px minimum: a phone tab is a fingertip target and these are
     three short words, so the extra 4px costs nothing and the tap is unhurried. */
  min-height: 3rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-1);
  text-decoration: none;
  color: var(--muted);
  font-size: var(--step--1);
  letter-spacing: 0.005em;
}

.tabbar a[aria-current="page"] {
  color: var(--fg);
  /* A 2px rule over the word, and the label stays at one weight: switching to a
     heavier weight on the active tab reflows three centred words on every
     navigation, which on a phone is a visible twitch. */
  box-shadow: inset 0 2px 0 var(--fg);
}

@media (max-width: 719px) {
  body[data-auth="in"] .tabbar { display: flex; }
  body[data-auth="in"] {
    padding-bottom: calc(var(--tap) + env(safe-area-inset-bottom));
  }
  .toast { bottom: calc(var(--tap) + var(--space-4) + env(safe-area-inset-bottom)); }
}

@media (min-width: 720px) {
  body[data-auth="in"] .nav { display: flex; }
}

body[data-auth="out"] .nav,
body[data-auth="out"] .tabbar,
body[data-auth="out"] #who,
body[data-auth="out"] #signout { display: none !important; }

.btn {
  appearance: none;
  font: inherit;
  font-size: var(--step-0);
  line-height: 1.2;
  min-height: var(--tap);
  padding: 0 var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
}

/* EVERY BUTTON HAS THREE STATES, AND EACH ONE IS VISIBLE.
   The secondary button had no hover at all — it sat at the same colour from the
   moment the page painted until it was pressed — so a mouse user had no signal
   that it was a control. Hover fills it faintly, active pushes it a pixel, and
   focus is the shared 2px ring from base.css. */
.btn:hover {
  background: var(--surface-2);
}

/* THE PRIMARY BUTTON IS THE IDENTITY (lane BRAND-SOVEREIGN-ACADEMY).
 *
 * It used to be `--fg` on `--bg`, which on a parchment page was ink on ink — correct
 * contrast and no identity at all. It is now the brand inversion: midnight navy with
 * ivory ink on paper, antique gold with navy ink on the dark surface (10.58:1). The
 * three values are tokens (`--btn-primary-bg` / `-fg` / `-bg-hover`) so the decision
 * lives in tokens.css and a component never writes a `[data-theme]` selector.
 *
 * The focus accent is the gold edge, and it is a `:focus-visible` rule rather than a
 * hover one: a hover that turns the border gold says "this is special", a focus that
 * does says "this is where you are", and only the second is a promise.
 */
.btn.primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border-color: var(--btn-primary-edge);
  font-weight: 600;
  letter-spacing: 0.005em;
}

.btn.primary:hover {
  /* Not `opacity: 0.88` — that lightens the LABEL too, and on a themed page a
     half-transparent pill reads as disabled rather than as hovered. A token, so the
     navy and the gold each hover to their own mix. */
  background: var(--btn-primary-bg-hover);
  border-color: var(--btn-primary-bg-hover);
}

.btn.primary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--gold-rule);
}

.btn.block { width: 100%; }

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:disabled:hover, .btn[aria-disabled="true"]:hover {
  background: transparent;
}

.btn.primary:disabled:hover, .btn.primary[aria-disabled="true"]:hover {
  background: var(--btn-primary-bg);
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: background-color 120ms ease, border-color 120ms ease,
      color 120ms ease, opacity 120ms ease;
  }
  .btn:active:not(:disabled) { transform: translateY(1px); }
}

.choice {
  appearance: none;
  width: 100%;
  min-height: var(--tap);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  text-align: left;
  padding: var(--space-3);
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.choice .katex { font-size: 1.15em; }
.choice:has(.mtable) { padding-block: var(--space-4); }

.choice .key {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 1.25rem;
}

.choice[aria-pressed="true"] { border-color: var(--fg); }

.choice:hover { border-color: var(--fg); }

.choice.is-correct, .is-correct {
  border-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
}

.choice.is-incorrect, .is-incorrect {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, var(--surface));
}

.is-correct { color: var(--ok); }
.is-incorrect { color: var(--bad); }

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.seg button {
  appearance: none;
  min-height: var(--tap);
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: calc(var(--radius) - 1px);
  cursor: pointer;
}

.seg button:hover { color: var(--fg); }

.seg button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}

.card {
  background: var(--surface);
  /* A card's edge is a HAIRLINE, not a control border. At `--line` (a 4:1 border,
     meant to say "this is a control you can press") a card in a stack of cards
     competed with the button inside it, and on paper the page read as a wireframe.
     The warm hairline plus the surface lift is what makes it a card. */
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  padding: var(--space-5);
}

/* THE PLAN CARD (VERDICT §1.2, restructured by CHIC-TODAY-CLARITY).
 *
 * THE CARD IS READ IN THIS ORDER, and the CSS enforces it with spacing rather than
 * the markup alone: the skill's NAME first, then what the set holds and what it
 * costs, then the one sentence about why this skill, then the actions. The founder's
 * report was the opposite order — a second "Today" label, then four scheduling lines,
 * and only then the `<h1>` — where nothing on the card said which skill it was about.
 *
 *   .today-plan-head    the title and its state chip, on one row
 *   .today-plan-price   "5 questions · about 5 minutes"
 *   .today-plan-composition   "5 review"
 *   .next-why           one sentence (practice.css owns the type)
 *   .today-plan-note    the day's wider plan, in SKILLS, quiet, at the foot
 */
.today-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.today-plan-ident {
  /* The chip sits beside a title that can wrap to three lines on a phone, so it is
     pinned to the first line's baseline rather than centred on the block. */
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  min-width: 0;
}

.today-plan-ident h1 {
  margin: 0;
  /* THE CHIP SITS BESIDE THE TITLE WHEN THERE IS ROOM, UNDER IT WHEN THERE IS NOT.
     Without `flex` the `<h1>` claims the whole row and the chip always wraps, which
     put "Solid" on its own line under a one-line title on a desktop — the stack the
     founder's report was about, just shorter. `min-width: 0` lets a long title
     shrink and wrap instead of pushing the chip off the row. */
  flex: 1 1 18ch;
  min-width: 0;
}

.today-plan-state { flex: 0 0 auto; }

.today-plan-price {
  margin: var(--space-3) 0 0;
  font-size: 1.0625rem;
}

.today-plan-price b { font-weight: 700; }

.today-plan-composition {
  margin: var(--space-1) 0 var(--space-4);
  color: var(--muted);
}

/* THE DAY'S WIDER PLAN, AT THE FOOT AND IN SKILLS (CHIC-TODAY-CLARITY).
   It used to sit ABOVE the title as "Today covers 6 skills; this set is the first of
   them" — one line above "5 questions", which a learner reads as "5 questions across
   6 skills". As a quiet note under the actions, in skills, it can only be read as
   what it is: the rest of the day's plan, which this card's set is the first part of. */
.today-plan-note {
  margin: var(--space-4) 0 0;
  color: var(--faint);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: 1.45;
}

/* THE ONE HEADLINE NUMBER AND ITS SENTENCE (VERDICT §1.13 item 7). The count is
   set large because it is the only figure Today prints; the sentence is the
   discipline that makes a single number honest, so it is not a footnote. */
.today-count {
  margin: var(--space-2) 0 0;
  font-size: 1.0625rem;
}

.today-count b {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.today-relates {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  max-width: 46ch;
}

.today-door { margin: var(--space-3) 0 0; }

/* THE TWO QUIET DOORS ON TODAY. They were one paragraph of two links at 20px tall
   with no separator, so "See what has moved, and what is next" ran straight into
   "Your record" and read as one long sentence. Now: one line, a middot between
   them, and each link a full 44px target. */
.today-doors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-2);
  margin: var(--space-2) 0 0;
  font-size: var(--step--1);
}
.today-doors a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
.today-doors a:hover { text-decoration-color: currentColor; }
.today-door-sep { color: var(--faint); }


/* THE DONE LINE (VERDICT §1.3): gains and new dues, never a loss. It reads as part
   of the result rather than as a footnote, because it is the only sentence on the
   screen that says what the sitting DID. */
.pq-done {
  margin: var(--space-3) 0 0;
  font-weight: 600;
}

/* THE CHILD'S TODAY (VERDICT §1.12), a different page rather than a hidden one: a
   dot row, two counts, no percentage and no comparison. */
.kid-today .kid-go { margin: var(--space-5) 0 0; }
.kid-today .kid-plan { margin: var(--space-2) 0 0; color: var(--muted); }
.kid-figures { margin: var(--space-6) 0 0; }
.kid-figure {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-3) 0 0;
}
.kid-figure b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.kid-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--space-2) 0 0;
}
.kid-dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
}
.kid-dots i.is-on { background: var(--fg); border-color: var(--fg); }
/* THE MILESTONE (CRITIC-02 S3-4). A skill crossing the mastery bar, in the child's
   own frame: no score, no percentage, no comparison (ADR 0010). It is monochrome and
   sits above the main button rather than beside it, so it reads as a quiet "well
   done" rather than a reward banner — the one gamification element the evidence
   supports is a private, non-comparative sentence. */
.kid-milestone {
  margin: var(--space-4) 0 0;
  font-family: var(--font-ui);
  font-size: var(--step-0);
  color: var(--fg);
  border-left: 3px solid var(--fg);
  padding-left: var(--space-3);
}
.kid-next { margin: var(--space-5) 0 0; }
.kid-next .ln-btn { margin-left: var(--space-2); }

@media (min-width: 720px) {
  .card { padding: var(--space-6); }
}

/* THE MASTERY METER CARRIES THE ACCENT (lane BRAND-SOVEREIGN-ACADEMY).
 *
 * A progress bar is the one quantity on a page that is neither right nor wrong, and
 * under the old monochrome rule it was ink — which made "how far you have come" look
 * like a piece of type. The fill is now the antique gold, which is the identity's
 * meaning: gold is what has been earned. The track stays a surface wash so the fill
 * is the only thing that reads.
 *
 * The fill is floored at 2px by consumers that matter (`plan-card-export.js` records
 * the same rule for an exported PNG), and at 4px of bar height a 1-skill fill is
 * visible without becoming a full bar.
 */
.meter {
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
}

@media (prefers-reduced-motion: no-preference) {
  .meter-fill { transition: width 240ms ease-out; }
}

.ladder {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-5) 0 0;
  padding: 0;
}

.ladder-rung {
  min-height: var(--tap);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: var(--space-2) 0;
  border-top: 2px solid var(--line);
}

.ladder-index {
  font-variant-numeric: tabular-nums;
  font-size: var(--step--1);
  color: var(--faint);
}

.ladder-name {
  font-size: var(--step--1);
  line-height: 1.3;
}

.ladder-rung.is-done {
  border-top-color: color-mix(in srgb, var(--gold) 62%, transparent);
}

.ladder-rung.is-current {
  border-top-color: var(--gold);
}

.ladder-rung.is-current .ladder-name { font-weight: 600; }

.ladder-rung.is-locked,
.ladder-rung.is-locked .ladder-index { color: var(--faint); }

.chip {
  display: inline-flex;
  align-items: center;
  /* Inline chips read as a WORD in a category, not as a small control: the hairline
     border was `--line` (the control weight), which made "Not started" beside a
     heading look pressable. */
  min-height: 1.75rem;
  padding: 0 var(--space-3);
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius);
  font-size: var(--step--1);
  color: var(--muted);
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.chip-ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 55%, transparent);
  background: color-mix(in srgb, var(--ok) 8%, transparent);
}

.chip-bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 55%, transparent);
  background: color-mix(in srgb, var(--bad) 8%, transparent);
}

/* A GOLD CHIP is the one that marks PROGRESS rather than a verdict — "proficient",
   "retained", "in progress". It is a third kind because the two verdict chips were
   being borrowed for it: a skill at 60% is neither right nor wrong, and colouring it
   green or red told a learner something the evidence does not say. */
.chip-gold {
  color: var(--gold-ink);
  border-color: color-mix(in srgb, var(--gold) 58%, transparent);
  background: var(--gold-wash);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

table.data th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: var(--space-3) var(--space-3) var(--space-3) 0;
  border-bottom: 1px solid var(--hair);
}

table.data td {
  text-align: left;
  vertical-align: middle;
  padding: var(--space-2) var(--space-3) var(--space-2) 0;
  border-bottom: 1px solid var(--hair);
}

table.data .num { text-align: right; white-space: nowrap; }

table.data th a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.table-wrap { overflow-x: auto; }

table.data a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.state { padding: var(--space-5) 0 var(--space-2); }

.state p { color: var(--muted); margin-top: var(--space-3); }

.state .btn, .state .actions { margin-top: var(--space-5); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(28rem, calc(100% - var(--space-6)));
  background: var(--fg);
  color: var(--bg);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--step--1);
}

.toast[hidden] { display: none; }

.skel-line, .skel-block {
  background: var(--surface-2);
  border-radius: var(--radius);
}

.skel-line {
  height: 0.85em;
  margin: var(--space-3) 0;
  max-width: 100%;
}

.skel-block {
  height: 9rem;
  margin-top: var(--space-5);
}

@media (prefers-reduced-motion: no-preference) {
  .skel-line, .skel-block { animation: skel 1.4s ease-in-out infinite; }
  .page { animation: enter 180ms ease-out; }
}

@keyframes skel {
  50% { opacity: 0.45; }
}

@keyframes enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.field label { font-size: var(--step--1); color: var(--muted); }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
textarea,
select {
  font-size: 1rem;
  line-height: 1.4;
  min-height: var(--tap);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  caret-color: var(--fg);
}

textarea { min-height: 8rem; resize: vertical; }

.form-error {
  color: var(--bad);
  margin-top: var(--space-4);
  min-height: 1.5em;
}

.stack { display: flex; flex-direction: column; gap: var(--space-4); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

a.link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}

a.link:hover { color: var(--fg); }

/* A LINK INSIDE A LIST OF SHORT ROWS IS PART OF THE ROW.
 *
 * `a.link` is an inline-FLEX 44px target for a link that stands alone on a line.
 * Inside a row of short text that flex box stretches the row's line box to 44px and
 * the caption beside it breaks into ragged lines. `base.css` already does this for a
 * bare paragraph; these are the classed containers that carry the same shape. The
 * row itself carries the height instead (`.pv-links li`, `.foot`), so the target is
 * still 44px and the caption stays on one line.
 *
 * NOTE: `.set-row a.link` is deliberately NOT in this list. A settings row's control
 * column is a column of controls, and "Change the aim" beside "Find your level" is
 * one of them; flattening it there produced a 24px target in a row of 44px ones. */
.pv-links a.link,
.pv-links a,
.rec-links a.link,
.foot a.link {
  min-height: 0;
  display: inline;
}

/* The quiet doors on Today and the placement line: inline text links whose PARENT
   paragraph carries the tap height, so the line box is not stretched. */
.placement-quiet a,
.today-doors a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

/* THE DIAGNOSTIC'S TWO LINKS ON THE ACCOUNT PAGE ("Find your level" / "Change the
   aim") sit in one action row, and the second is a `.link` — an inline-flex target
   whose flex baseline pushed it below the button beside it, so the pair read as a
   button and a footnote. They are one row of two controls, and the text link is as
   tall as the button next to it. */
.level-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}
.level-actions .link {
  min-height: var(--tap);
  padding-inline: var(--space-1);
}

/* THE "RIGHT NOW" ROW ON PROGRESS: a skill title at the reading size, its reason
   beneath, and its door. The title was a 27px-high link inside a row that is already
   a 44px target through `.pv-now-go`; it now takes the row's height so a thumb can
   land anywhere on the title, and it stops breaking mid-word. */
.pv-now-link {
  font-size: var(--step-1);
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  overflow-wrap: anywhere;
}

.block { margin-top: var(--space-7); }

.lead { margin-top: var(--space-5); }

.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0 0;
}

.figures.two { grid-template-columns: 1fr 1fr; }

.scope-block { margin-top: var(--space-5); }
.scope-block + .scope-block { margin-top: var(--space-7, 3rem); }
.scope-h {
  margin: 0 0 var(--space-3);
  font-size: var(--step-1);
  font-weight: 500;
}
.scope-note { margin-top: var(--space-5); font-size: var(--step--1); }

@media (max-width: 720px) {
  .figures,
  .figures.two { grid-template-columns: 1fr; }
}

.figures div {
  display: flex;
  flex-direction: column-reverse;
  border-top: 1px solid var(--hair);
  padding-top: var(--space-3);
}

.figures dd {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.figures dt {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.rows { list-style: none; margin: var(--space-3) 0 0; padding: 0; }

.rows a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: var(--tap);
  padding: var(--space-3) 0;
  text-decoration: none;
  border-top: 1px solid var(--hair);
}

.rows li:last-child a {
  border-bottom: 1px solid var(--hair);
}

.rows-title { font-weight: 600; }

.rows-meta {
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.45;
}

.exam-num {
  font-family: var(--font-text);
  font-size: var(--step-3);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.exam-ready-line {
  margin: var(--space-4) 0 0;
}

.exam-ready-line a {
  display: inline-block;
  max-width: 100%;
  min-height: var(--tap);
  padding: var(--space-2) 0;
  line-height: 1.4;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* Sign-in layout. It lives here, not in the graph stylesheets: the form is
   public and those stylesheets load only when a map mounts. */
.signin-page {
  max-width: none;
}

.signin-split {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.signin-copy {
  width: min(100%, 40rem);
  min-width: 0;
}

.signin-copy .auth-switch { margin-top: var(--space-5); }
.signin-copy .auth-switch ~ .block { margin-top: var(--space-4); }
.signin-copy .form-error:empty { min-height: 0; margin-top: 0; }

@media (min-width: 900px) {
  .signin-page {
    padding-top: var(--space-6);
    padding-bottom: var(--space-4);
  }

  .signin-split {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-7);
    max-width: 80rem;
    margin-inline: auto;
  }

  .signin-copy {
    flex: 0 0 clamp(26rem, 42%, 34rem);
    width: auto;
    max-width: 34rem;
  }
}

.signin-split.is-solo { max-width: 34rem; margin-inline: auto; }
@media (min-width: 900px) {
  .signin-split.is-solo .signin-copy { flex: 1 1 auto; max-width: none; }
}

.landing-visual {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.landing-art {
  color: var(--fg);
}

.landing-art svg {
  display: block;
  width: min(100%, 28rem);
  height: auto;
  margin-inline: auto;
}

.landing-caption {
  margin: 0 auto;
  max-width: 28rem;
  color: var(--muted);
  font-family: var(--font-text);
  font-size: var(--step--1);
  line-height: 1.5;
}

.landing-art .hit { pointer-events: all; }

@media (hover: hover) and (pointer: fine) {
  .landing-art .mark {
    transition: opacity 180ms ease;
  }
  .landing-art:hover .mark {
    opacity: 0.42;
  }
  .landing-art:hover .mark:hover {
    opacity: 1;
  }
}

@media (min-width: 900px) {
  .landing-visual {
    flex: 1 1 0;
    position: sticky;
    top: var(--space-6);
  }
  .landing-art svg {
    width: min(100%, 30rem);
  }
  .landing-caption {
    margin-inline: 0;
  }
}

/* The intro hero (js/intro/hero.js), above the sign-in form for a signed-out visitor.
   The text, the buttons and the empty stage are all here so they paint with the
   page: the map itself is fetched afterwards and only draws into a box whose size
   is already reserved, so it can neither delay the first paint nor move anything.
   The stage is dark in both themes, as the map page is: the renderer paints its
   own background. */
.intro-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 80rem;
  margin: 0 auto var(--space-7);
}

.intro-copy { min-width: 0; }

.intro-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.intro-mark {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 16px;
}
.intro-name {
  font-family: var(--font-text);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
@media (max-width: 480px) {
  .intro-mark { width: 52px; height: 52px; border-radius: 13px; }
}

.intro-copy h1 {
  font-size: clamp(2rem, 6.4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

/* THE TWO LINES THAT CARRY THE VOICE (lane BRAND-SOVEREIGN-ACADEMY).
 *
 * `.intro-kicker` is the identity's own line — it is the slogan on the banner, the
 * social card and the manifest — set as a tracked small label above the claim. It is
 * the one place in the product the slogan appears in the chrome, so it is deliberately
 * quiet: gold ink at the smallest size in the scale, so it reads as a hallmark rather
 * than as a headline competing with the h1.
 *
 * `.intro-lede` is the Warm Atelier half: one sentence of mechanism under the claim,
 * at reading weight and in the muted ink, so a parent scanning the page gets the
 * answer to "what will this do" without reading the h1 twice. It sits BETWEEN the h1
 * and `.intro-sub` on purpose: `.intro-sub` is asserted character for character by
 * `tests/e2e/intro.mjs` (a count and nothing else), so anything with a clause in it
 * has to be its own element. */
.intro-kicker {
  margin: 0 0 var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.intro-lede {
  margin: var(--space-4) 0 0;
  max-width: 34rem;
  font-family: var(--font-text);
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--fg);
}

.intro-sub {
  margin-top: var(--space-3);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--muted);
  max-width: 34rem;
}

.intro-sub strong { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.intro-sub [data-intro-count] { display: inline-block; min-width: 4.2ch; }
.intro-sub [data-intro-subjects] { display: inline-block; min-width: 2ch; }

/* One door, not two: "Start learning" is the only action, and it is the primary
   button. The grid collapses to a single column, so the button keeps its full
   width wherever it sits.
   
   WITH `PUBLIC_PLACEMENT` ON there are two doors — the free placement test and the
   sign-in — and the test is the primary because it is the one thing a visitor can
   do without an account. Same single column: the pair stack rather than sitting
   side by side, so neither becomes a small target on a phone. */
.intro-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
  max-width: 22rem;
}

.intro-actions .btn.primary { grid-column: 1 / -1; }

.intro-actions .btn { text-decoration: none; }

/* The one sentence under the free test's door. Quiet, and it carries the only
   promise the page makes: twenty minutes, no account, one page at the end. */
.intro-free {
  margin-top: var(--space-4);
  max-width: 30rem;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--muted);
}

.intro-more {
  margin-top: var(--space-4);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--muted);
}

.intro-more a, .intro-more button { color: var(--fg); }
.intro-more button {
  appearance: none;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  cursor: pointer;
}

.intro-figure { margin: 0; min-width: 0; }

/* THE STAGE IS A PLATE, NOT A HOLE (lane BRAND-SOVEREIGN-ACADEMY).
 *
 * The canvas ground stays `#0a0c12`: it is the MAP RENDERER's own background
 * (`web/next/js/skillmap/render.js`, `BG`), drawn by the same code on #/map, and the
 * intro flow samples those pixels to prove the map drew — so the frame around it is
 * what this file may change, not the picture.
 *
 * What changes is the frame: a gold-tinted edge and a warm shadow, so the plate reads
 * as a framed atlas hanging on parchment rather than as a window cut out of the page.
 * The radius is the card's radius plus one step, which is the difference between a
 * screenshot and an object. */
.intro-stage {
  position: relative;
  height: clamp(340px, 100vw, 560px);
  background-color: #0a0c12;
  background-image: repeating-radial-gradient(circle at 50% 50%,
    transparent 0, transparent 26px, rgba(223, 200, 155, 0.07) 26px, rgba(223, 200, 155, 0.07) 27px);
  border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  isolation: isolate;
  color: #f0e2c9;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--gold) 10%, transparent),
              0 18px 40px -28px color-mix(in srgb, var(--brand-navy) 45%, transparent);
}

.intro-stage canvas {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.intro-stage-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.intro-load {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.intro-load[hidden] { display: none; }

.intro-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--muted);
}

/* The lit skill's name is one line and its detail at most two, and the box is that
   tall already, so the tour changing the words moves nothing below it. */
.intro-cap-text { min-width: 0; flex: 1 1 14rem; min-height: 4.5em; }
.intro-cap-title {
  display: block;
  color: var(--fg);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.intro-caption a { color: var(--fg); white-space: nowrap; }

@media (min-width: 900px) {
  .intro-cap-text { min-height: 3em; }
  .intro-hero {
    display: grid;
    grid-template-columns: minmax(0, 31rem) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-7);
  }
  .intro-h-lead { white-space: nowrap; }
  .intro-stage { height: clamp(480px, calc(100svh - 14rem), 700px); }
}

@media (prefers-reduced-motion: reduce) {
  .intro-stage-link { scroll-behavior: auto; }
}

/* "Report a problem" (js/report.js): a quiet link, and a native <dialog>.
   `.ln-report-top` is gone with the duplicated top-of-lesson link it positioned. */
.report-link {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  color: var(--muted);
}
.report-dialog {
  width: min(32rem, calc(100vw - 2rem));
  border: 1px solid var(--line, currentColor);
  border-radius: 8px;
  padding: var(--space-5, 1.5rem);
}
.report-dialog::backdrop { background: rgb(0 0 0 / 0.35); }
.report-form { display: grid; gap: var(--space-3, 0.75rem); font-family: var(--font-ui); }
.report-form h2 { margin: 0; }
.report-form label { display: grid; gap: var(--space-1, 0.25rem); }
.report-form select,
.report-form textarea { font: inherit; width: 100%; }
.report-status { margin: 0; min-height: 1.25em; color: var(--muted); }
.report-actions { display: flex; gap: var(--space-2, 0.5rem); }

/* Build-time figures (server/viz.py, sanitised by js/viz.js).
 *
 * Every stroke and fill in a figure is `currentColor`, so a figure takes the
 * text colour of wherever it sits and dark mode needs no second set of rules.
 * The SVG carries `width`/`height` for its natural size; `max-width` and
 * `height: auto` shrink it to the column without distorting it. */
.viz {
  display: block;
  max-width: 100%;
  height: auto;
  color: inherit;
  margin-inline: auto;
}
.viz-slot { display: block; max-width: 100%; }
.viz-fig,
.pq-fig {
  display: block;
  max-width: min(100%, 480px);
  margin: var(--space-4) auto;
  text-align: center;
}
.viz-alt {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}
/* In an answer option the figure sits above the text; the option keeps its tap
 * target (the option's own min-height) and grows to hold the picture. */
.pq-figo,
.fmt-fig {
  display: block;
  max-width: min(100%, 240px);
  margin-bottom: var(--space-2);
}
.pq-ex-fig { margin-top: 0; }

/* ------------------------------------------------------------- the Courses
   (also the account page's Learning row, below)

   The header pill that used to live here is GONE: the founder's decision is that
   the learning context is chosen on the account page, as a dropdown. Its styles
   went with it, because a rule that styles a control nobody renders is a lie about
   the interface. `#/courses` remains as an overview — linked from the account page
   under the dropdown — so the course rows below stay. */

.courses {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.course-row { margin: 0; }

/* A row of the overview: a card that reads, not a control. The grid keeps the
   title, the description and the numbers aligned across rows whatever their
   length. `data-course` stays on the <li> for the gate and the screenshots, but
   nothing here is clickable — the one control that changes the context is the
   account page's dropdown. */
.course-item {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.course-row.is-current .course-item {
  border-color: var(--fg);
  background: var(--surface-2);
}

.course-name {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  font-size: var(--step-1);
  letter-spacing: -0.01em;
}

.course-chip { flex: none; }

.course-blurb {
  color: var(--muted);
  max-width: 52ch;
  margin: 0;
}

.course-facts,
.course-progress {
  font-size: var(--step--1);
  margin: 0;
}

.course-progress { color: var(--fg); }

/* The first row is the default and the widest choice, so it is set apart without
   a second colour: a heavier rule on the left, which reads as "this one is
   different" rather than "this one is a warning". */
.course-row.is-all .course-item {
  border-left-width: 3px;
  border-left-color: var(--fg);
}

/* ------------------------------------------------------------------ time
 *
 * The study-time figures and the time-to-finish sentence. Monochrome by the
 * founder's rule: nothing here has a colour, and the only emphasis is a lighter
 * weight on the number. The block is a reading column, not a dashboard — three
 * figures on one line, then sentences — because the page's job is to say how far
 * along a learner is, not to score them.
 *
 * No countdown, no bar, no animation: a figure a student might plan around moves
 * when they study, and it should look like a fact rather than a goal.
 */
.tm-block {
  margin-top: var(--space-6, 2rem);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hair);
}
.tm-block > h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-1);
  font-weight: 500;
}
.tm-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
}
.tm-figures div {
  display: flex;
  flex-direction: column-reverse;
  border-top: 1px solid color-mix(in srgb, var(--fg) 16%, transparent);
  padding-top: var(--space-3);
}
.tm-figures dt {
  font-size: var(--step--1);
  color: var(--muted);
}
.tm-figures dd {
  margin: 0;
  font-size: var(--step-1);
  font-variant-numeric: tabular-nums;
}
.tm-conf,
.tm-note {
  font-size: var(--step--1);
  color: var(--muted);
  margin: var(--space-2) 0 0;
}
.tm-pace { margin: var(--space-3) 0 0; }
.tm-pace.muted { color: var(--muted); font-size: var(--step--1); }
.tm-fast,
.tm-note[data-untaught] { margin: var(--space-3) 0 0; }
.tm-link { margin: var(--space-3) 0 0; }

/* On a skill page: one sentence, set quieter than the sections around it. */
.skill-reach {
  font-size: var(--step--1);
  color: var(--muted);
  margin: var(--space-4) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--hair);
}

@media (max-width: 720px) {
  .tm-figures { grid-template-columns: 1fr; gap: var(--space-3); }
}

/* ------------------------------------------------------------------ progress
 *
 * The learner's own Progress page (#/progress). It answers three questions —
 * what have I mastered, what am I on now, how far to my goal — then this week's
 * effort, then every skill grouped by subject.
 *
 * MONOCHROME, as the founder's rule requires: the only colour on this page is
 * the correctness colour, and nothing here uses it. Hierarchy comes from the
 * type ramp and one rule above each block, which is the same device the
 * study-time block uses, so the page reads as one document rather than as a
 * dashboard of cards.
 *
 * NO NUMBERS AS GRAPHICS. The one meter is the same 4px rule the rest of the app
 * uses; there is no ring, no gauge, no streak counter. A page a learner opens to
 * see where they are should not also be a scoreboard, which is the compliance
 * rule (B-1/B-6) and the founder's own bar at once.
 */
.pv .read > h1 { margin-bottom: var(--space-3); }

.pv-goal {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--step--1);
}
.pv-goal strong { color: var(--fg); font-weight: 500; }

.pv-block {
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hair);
}
.pv-block > h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-1);
  font-weight: 500;
}
.pv-minor {
  margin: var(--space-5) 0 var(--space-2);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.01em;
}

/* The three figures. Same grid as `.tm-figures` and `.figures`, so the page's
   numbers line up with the study-time block further down and with Today. */
.pv-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
}
.pv-figures div {
  display: flex;
  flex-direction: column-reverse;
  border-top: 1px solid color-mix(in srgb, var(--fg) 16%, transparent);
  padding-top: var(--space-3);
}
.pv-figures dt {
  order: 2;
  margin-top: var(--space-1);
  font-size: var(--step--1);
  color: var(--muted);
}
.pv-figures dd {
  margin: 0;
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.pv[data-week] .pv-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.pv-sentence { margin: var(--space-3) 0 0; }
.pv-note {
  margin: var(--space-3) 0 0;
  font-size: var(--step--1);
  color: var(--muted);
}
.pv-reason {
  display: block;
  margin-top: 2px;
  font-size: var(--step--1);
  color: var(--muted);
}

/* --- what you are on now ------------------------------------------------ */
.pv-nexts { list-style: none; margin: 0; padding: 0; }
.pv-next {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
}
.pv-next:first-child { border-top: 0; padding-top: 0; }
.pv-next.is-primary { padding-bottom: var(--space-4); }
.pv-next-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  text-decoration: none;
  min-height: var(--tap);
  flex: 1 1 auto;
}
.pv-next-title { font-size: var(--step-1); }
.pv-next.is-primary .pv-next-title { font-weight: 500; }
.pv-next-go {
  flex: 0 0 auto;
  align-self: center;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--fg);
  font-size: var(--step--1);
}
.pv-next-go:hover,
.pv-next-go:focus-visible { background: var(--surface-2); }

.pv-due { list-style: none; margin: 0; padding: 0; }
.pv-due li {
  padding: var(--space-2) 0;
  border-top: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
}
.pv-due a { min-height: var(--tap); display: inline-flex; align-items: center; }

/* --- this week ---------------------------------------------------------- */
.pv-moved { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.pv-moved li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
}

/* --- every skill, by subject ------------------------------------------- */
.pv-subject {
  margin-top: var(--space-3);
  border-top: 1px solid var(--hair);
}
.pv-subject > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--tap);
  padding: var(--space-3) 0;
  cursor: pointer;
  list-style: none;
}
.pv-subject > summary::-webkit-details-marker { display: none; }
.pv-subject > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pv-subject[open] > summary::after { content: "−"; }
.pv-subject-name { font-size: var(--step-1); }
.pv-subject-count {
  margin-left: auto;
  font-size: var(--step--1);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pv-skills { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.pv-skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid color-mix(in srgb, var(--fg) 8%, transparent);
}
.pv-skill a {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.pv-more { margin: 0 0 var(--space-3); }
.pv-more > summary {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: var(--step--1);
  cursor: pointer;
}

.pv-links { list-style: none; margin: 0; padding: 0; }
.pv-links li {
  padding: var(--space-2) 0;
  border-top: 1px solid var(--hair);
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.55;
  /* The ROW is the tap target, not the anchor inside it: an inline link in a
     two-line caption keeps its line box, and the whole row is 44px tall whatever
     the caption's length. */
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  gap: 0 var(--space-1);
  min-height: var(--tap);
  font-size: var(--step-0, 1rem);
}

@media (max-width: 720px) {
  .pv-figures { grid-template-columns: 1fr; gap: var(--space-3); }
  .pv[data-week] .pv-figures { grid-template-columns: 1fr 1fr; }
  .pv-next { flex-direction: column; gap: var(--space-2); }
  .pv-next-go { align-self: flex-start; }
}

/* --- THE CHOOSER: a card per course and per subject ---------------------
 *
 * The founder's decision of 22 Nov makes this page the place a learner picks what
 * to study, so the cards ARE the page. Each one is a bordered block rather than a
 * raised "dashboard tile": the product is monochrome and the one thing that should
 * read as active is the card you are focused on, which it does with a thicker
 * left rule and the word Focused — not with a colour.
 *
 * The percentage is the largest number on the card because it is the answer to the
 * only question a chooser is asked ("how far away is this?"), and it is set with
 * tabular figures so two cards side by side line up.
 */
.pv-chooser .pv-block { margin-top: var(--space-6); }

.pv-focus-line {
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--step-1);
}
.pv-focus-status { margin: 0; min-height: 1.2em; }
.pv-focus-status[data-state="error"] { color: var(--bad); }

.pv-cards {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--space-4);
}

.pv-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent);
  border-radius: var(--radius);
  background: var(--surface, transparent);
  border-left: 3px solid color-mix(in srgb, var(--fg) 14%, transparent);
}
.pv-card.is-active {
  border-left-color: var(--fg);
  border-color: color-mix(in srgb, var(--fg) 30%, transparent);
}

.pv-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.pv-card-title {
  margin: 0;
  font-size: var(--step-0);
  font-weight: 500;
  line-height: 1.25;
}
.pv-card-pct { margin: 0; display: flex; align-items: baseline; gap: var(--space-2); }
.pv-card-num {
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.pv-card-of { font-size: var(--step--1); color: var(--muted); }

.pv-card .meter { margin: 0; }
.pv-card-sentence { margin: 0; font-size: var(--step--1); }
.pv-card-includes {
  margin: 0;
  font-size: var(--step--1);
  color: var(--muted);
}
.pv-active-mark { margin: 0; }
.pv-card-action { margin: auto 0 0; }
.pv-card-action .btn { width: 100%; }

/* All subjects spans the grid: it is the context every course belongs to,
   and a card the same size as "Arithmetic" would read as an eleventh course. */
.pv-card-all { grid-column: 1 / -1; }

.pv-now-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0;
}
.pv-now-go { margin-left: auto; min-height: var(--tap); display: inline-flex; align-items: center; }

@media (max-width: 720px) {
  .pv-cards { grid-template-columns: 1fr; }
  .pv-now-go { margin-left: 0; }

  /* THE CHOOSER ON A PHONE IS A LIST OF ROWS, NOT A STACK OF PANELS.
   *
   * Twenty-two cards at 208px made this page 7,675px tall on a 390px screen
   * (measured), which is four and a half screens of scrolling past courses that all
   * read the same — the clutter the founder named. The same card becomes a row: the
   * title and the percentage on one line, the progress rule under them, the one
   * sentence that differs per course, and the Focus control out to the right where a
   * thumb reaches it. Nothing is removed; the height comes from the layout, and the
   * page drops by roughly half. */
  .pv-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-1) var(--space-3);
    padding: var(--space-3) var(--space-4);
  }
  .pv-card-head { grid-column: 1 / -1; }
  .pv-card > .meter { grid-column: 1 / -1; }
  .pv-card-sentence,
  .pv-card-includes { grid-column: 1; }
  .pv-card-includes { font-size: var(--step--2); }
  .pv-card-action,
  .pv-active-mark {
    grid-column: 2;
    grid-row: 3 / span 2;
    align-self: center;
    margin: 0;
  }
  .pv-card-action .btn { width: auto; white-space: nowrap; }
  /* The tallest card in the stack sets nothing: every row is its own height, so a
     course with no "includes" line is one line shorter rather than padded to match. */
  .pv-card-sentence:empty,
  .pv-card-includes:empty { display: none; }
}

/* --- the destination tracks strip on Progress (lane WEALTH-3) --------------
   A strip, not a catalogue: four names with their measured size, above the chooser.
   The chooser underneath is the page's subject and its cards are bordered blocks, so
   this uses plain rows with a rule between — a second set of cards would read as a
   second set of choices, which is exactly what it is not. */
.pv-tracks { margin-top: var(--space-6); }
.pv-track-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0 var(--space-5);
}
.pv-track { border-top: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); }
.pv-track:first-child { border-top: 0; }
.pv-track a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3) 0;
  text-decoration: none;
  min-height: var(--tap);
}
.pv-track-title { font-size: var(--step-0); }
.pv-tracks .pv-track-size {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* --- the destination tracks rail under the introduction's hero (lane WEALTH-3) ---
   ONE line under the hero and nothing else. The hero's own note records that the page
   is the hero and nothing more, so this is a rail: quiet type, no card, no border
   except the rule that separates it from the hero above. It exists because the first
   question an adult asks is "does this cover what I need", and the answer is eight
   named outcomes rather than a skill count. */
.intro-rail {
  max-width: 80rem;
  margin: 0 auto var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hair);
}
.intro-rail h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--step--1);
  font-weight: 500;
  font-family: var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.intro-rail p {
  margin: 0;
  max-width: 52rem;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--muted);
}
.intro-rail a { color: var(--fg); }
