/* The frame around the paper.
 *
 * THESIS (docs/DESIGN.md, round three): smrtr is the examination booklet. A
 * blue book: the light-blue card cover with its printed fields, ruled leaves
 * inside with a red margin line, and the grader's red pencil answering in the
 * margin. A miss is the useful part.
 *
 * Inks, and each one means something. The cover's printing (--cover-print) is
 * the masthead, the wordmark and the footer. The leaf's printing (--print) is
 * every label, rule, reference and link a leaf came printed with. The ink
 * (--ink) is the learner's own work. The red pencil (--pencil) is the grader's
 * mark, so it appears on a wrong answer and nowhere else, and green
 * (--correct) appears on a right answer and nowhere else. The one printed red
 * is the margin line, which is part of the paper and carries no meaning.
 *
 * The INFORMATION ARCHITECTURE is still ttrd's: a masthead on every signed-in
 * page, the learner's mark in the corner doubling as the account and family
 * menu, a footer that closes every page, one content column.
 *
 * The rules from practice.css still hold. Nothing in this file renders a
 * score, a streak, or a count of right answers.
 */

/* ——— the token table ———
 *
 * Named for the material, never for a role, so no name can lie when a value
 * changes. Every color in the app is defined here once, with its Night value
 * in the block under it; the measured contrast of each is in docs/DESIGN.md.
 * Light is the booklet on a desk; Night is the same booklet under a lamp, a
 * designed palette and not an inversion. */
:root {
  /* The booklet. */
  --cover: #b4cbe6;        /* the blue-book cover: the masthead band, the back cover */
  --cover-deep: #9db9db;   /* the spine, the shadow side of a fold */
  --cover-pale: #dde8f5;   /* the app's working ground: a tint of the cover */
  --cover-print: #10233f;  /* what is printed on the cover: wordmark, fields */
  --cover-print-2: #2b3d5c;/* the cover's smaller printing (ink-3 is 3.7:1 on the cover) */
  --leaf: #fbfaf5;         /* the leaf that gets written on, and every panel */
  --leaf-edge: #ecebe2;    /* the shadow of a leaf's edge: a hover, an inset */

  /* The work. Fountain-pen blue-black, never #000. */
  --ink: #14213a;
  --ink-2: #44506a;
  --ink-3: #56627b;        /* 4.9:1 on the ground, 5.9:1 on a leaf */

  /* The leaf's printing: labels, references, links, focus. A printer's blue,
   * the ruling's own hue taken dark enough to read (6.5:1 on the ground). */
  --print: #23508f;
  --print-soft: #c4d5ec;                 /* a selection, a visited rule */
  --print-wash: rgb(35 80 143 / 7%);     /* a hover ground, a flash */

  /* The primary action is the cover's own ink, solid. */
  --action: #10233f;
  --action-deep: #07152a;                /* pressed */
  --on-action: #fbfaf5;                  /* 15.1:1 on the action */
  --action-glow: rgb(16 35 63 / 22%);
  --action-glow-lift: rgb(16 35 63 / 28%);

  /* The paper's printing. The ruling is the blue a blue book's leaves are
   * ruled in; the margin line is the red one down the left. */
  --ruling: rgb(44 96 168 / 18%);
  --margin-line: rgb(176 40 52 / 55%);

  /* How a leaf is ruled. A blue book's leaves are ruled across, wide, with
   * nothing running down them but the red margin line: --ruled. Only a leaf
   * with a figure on it is graph-ruled (--graph), because figures.js draws on
   * a 20px grid and its axes have to land on lines the paper already has.
   * Both read --ruling, so Night re-rules every leaf by changing one value. */
  --rule-pitch: calc(var(--square) * 1.5);
  --ruled: repeating-linear-gradient(transparent 0 calc(var(--rule-pitch) - 1px), var(--ruling) calc(var(--rule-pitch) - 1px) var(--rule-pitch));
  --graph: repeating-linear-gradient(var(--ruling) 0 1px, transparent 1px var(--square)), repeating-linear-gradient(90deg, var(--ruling) 0 1px, transparent 1px var(--square));

  /* Paper under prose: a block lays the leaf at half strength over the
   * ruling so the rules still read under the words (T60: at 50% a line under
   * a block measured 1.13:1 against the block, visibly ruled; do not raise
   * this without measuring the line again off a screenshot). */
  --wash: rgb(251 250 245 / 50%);

  /* Semantic, and only semantic. Nothing that is not a wrong answer may be
   * the pencil, and nothing that is not a right answer may be green. The
   * green is the lesson whiteboard's (walkthroughs/demo/stage.css). */
  --pencil: #9a1f2c;
  --correct: #146b33;

  /* Every border is the ink at low alpha, never a grey of its own. */
  --hair: rgb(20 33 58 / 14%);
  --hair-hard: rgb(20 33 58 / 24%);

  --shadow-ink: rgb(20 33 58 / 14%);
  --shadow: 0 6px 18px rgb(20 33 58 / 7%);
  --shadow-lift: 0 16px 38px rgb(20 33 58 / 12%);
  --shadow-sheet: 0 10px 26px rgb(20 33 58 / 10%);
  --shadow-drag: 0 12px 28px rgb(20 33 58 / 22%);

  /* The grain over the ground: how strongly, and how it blends. */
  --grain-opacity: 0.5;
  --grain-blend: multiply;

  --f-display: Newsreader, Georgia, serif;
  --f-ui: "Instrument Sans", system-ui, sans-serif;
  /* A blue book's cover and its printed fields are set in a condensed
   * grotesque, caps, tracked: every kicker, count, outline reference and
   * margin label is printed in it. (Round two typed them in Courier Prime;
   * a printed booklet is not typewritten.) */
  --f-print: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

  /* Two eases and no more. Everything that comes to rest uses the first; the
   * second belongs to the correcting hand alone (a caret, an annotation
   * arriving) and must not spread to ordinary hovers. */
  --ease-settle: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-mark: cubic-bezier(0.34, 1.4, 0.64, 1);

  --col: 74rem;
  --margin-col: 9.5rem;   /* the width of the margin, where annotation lives */
  --measure: 64ch;

  /* One height for everything that can sit in a row together: text inputs,
   * selects and buttons. Set in one place so a new control cannot arrive half
   * a centimetre short of its neighbours. */
  --control-h: 2.85rem;

  /* The figure renderer (prototypes/figures.js + figures.css) asks for colors
   * of its own. Mapping them here is the only place the app tells a figure
   * what ink to draw in. */
  --fig-ink: var(--print);
  /* The thing a figure is about (a plotted point, a marked length) before
   * anything is graded: the ink, so it stands apart from the printed axes
   * without wearing the red pencil, which is reserved for a wrong answer
   * (review, round three). figures.js never uses it to mark an answer. */
  --fig-mark: var(--ink);
  --fig-label: var(--ink-3);
  --fig-paper: var(--leaf);

  color-scheme: light dark;
}

/* ——— Night: the exam at night ———
 *
 * The booklet under a desk lamp. The cover goes to a deep blue-black, the
 * leaves to a lamp-lit blue, the ink to the pale blue-white of a cover's
 * printing, and the pencil and the green brighten so they still mean what
 * they mean. Same names, so nothing below this block knows which it is in. */
@media (prefers-color-scheme: dark) {
  :root {
    --cover: #1d355c;        /* proposal #0d1a30 sat 1.1:1 off the ground and the cover vanished */
    --cover-deep: #142846;
    --cover-pale: #101f38;
    --cover-print: #e8eef8;
    --cover-print-2: #b7c3d9;
    --leaf: #172640;
    --leaf-edge: #1f3250;

    --ink: #e8eef8;
    --ink-2: #b7c3d9;
    --ink-3: #9aa8c2;

    --print: #9ec2f0;
    --print-soft: #2c4c7a;
    --print-wash: rgb(158 194 240 / 9%);

    --action: #b4cbe6;
    --action-deep: #d2e1f3;
    --on-action: #0d1a30;
    --action-glow: rgb(0 0 0 / 35%);
    --action-glow-lift: rgb(0 0 0 / 45%);

    --ruling: rgb(140 176 230 / 13%);
    --margin-line: rgb(255 138 147 / 50%);
    --wash: rgb(23 38 64 / 50%);

    --pencil: #ff9aa2;
    --correct: #7fd89a;

    --hair: rgb(232 238 248 / 13%);
    --hair-hard: rgb(232 238 248 / 22%);

    --shadow-ink: rgb(0 0 0 / 40%);
    --shadow: 0 6px 18px rgb(0 0 0 / 28%);
    --shadow-lift: 0 16px 38px rgb(0 0 0 / 42%);
    --shadow-sheet: 0 12px 30px rgb(0 0 0 / 38%);
    --shadow-drag: 0 14px 32px rgb(0 0 0 / 55%);

    /* Multiply darkens, and on a dark ground it would only blacken. Screen
     * at a lower strength lifts the grain the way lamplight shows a card's
     * tooth. */
    --grain-opacity: 0.22;
    --grain-blend: screen;
  }
}

/* The lamp. At night the booklet is read under one: a warm pool of light high
 * on the desk, falling off to the ground's blue at the edges. An image on the
 * body, fixed, so it stays where the lamp is while the page scrolls; the
 * body's background-color stays the flat ground every probe measures
 * against. */
@media (prefers-color-scheme: dark) {
  body {
    background-image: radial-gradient(120% 70% at 50% -12%, rgb(255 236 200 / 7%), transparent 62%);
    background-attachment: fixed;
  }
}

html { min-height: 100%; }
body { min-height: 100vh; }

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  font-family: var(--f-ui);
  font-size: clamp(0.95rem, 0.9rem + 0.16vw, 1.03rem);
  color: var(--ink);
  background: var(--cover-pale);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* A blue book's cover is card stock and has a tooth. One grain layer, fixed,
 * over the whole ground: the thing that stops a flat fill reading as a flat
 * fill. Its strength and blend are tokens because Night needs the opposite
 * blend (multiply only blackens a dark ground).
 * pointer-events none and aria-hidden, so it is texture and nothing else. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

::selection { background: var(--print-soft); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb {
  background: var(--ink-3);
  border: 3px solid var(--cover-pale);
  border-radius: 8px;
}
::-webkit-scrollbar-track { background: var(--cover-pale); }

/* ——— the margin ———
 *
 * The signature. Every page is a narrow column and a wide one: the narrow one
 * holds what a margin holds (a typed label, an outline reference, a caret, an
 * annotation) and the wide one holds the work. Nothing structural lives in the
 * margin, so folding it above the body at 900px loses nothing.
 *
 * It is a COLUMN and never a border-left. A colored stripe down the edge of a
 * card is banned (developer.md) and the old "carry on with" card had one. */
.ruled {
  display: grid;
  grid-template-columns: minmax(0, var(--margin-col)) minmax(0, 1fr);
  gap: 0 clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}

.ruled > .margin {
  margin: 0;
  padding-top: 0.35rem;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.83rem;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--print);
  text-align: right;
}

.margin .margin-note {
  display: block;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}

/* The caret: the proofreader's insertion mark from the wordmark, doing its
 * real job. It points from the margin at the line it is about. */
.margin-caret {
  display: block;
  width: 0.95rem;
  height: 0.5rem;
  margin: 0 0 0.3rem auto;
  color: var(--print);
}

.margin-caret svg { display: block; width: 100%; height: 100%; overflow: visible; }
.margin-caret path { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 56rem) {
  .ruled { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
  .ruled > .margin { text-align: left; padding-top: 0; }
  .margin-caret { margin-inline: 0; transform: rotate(90deg); }
}

.col {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding-inline: clamp(1rem, 3.5vw, 2.4rem);
}

/* Every page is ruled. The narrow column is the margin and holds what a
 * margin holds; everything else lines up against the same rule, whether it is
 * a heading, a list of decks or a row of actions. Blocks that carry their own
 * margin (a page head, a panel, the carry-on card) span both tracks and lay
 * out their own. */
.page {
  flex: 1;
  padding-block: clamp(1.5rem, 4vw, 2.75rem);
  display: grid;
  grid-template-columns: minmax(0, var(--margin-col)) minmax(0, 1fr);
  column-gap: clamp(1rem, 2.5vw, 2rem);
  align-content: start;
}

.page > * { grid-column: 2; min-width: 0; }

/* The margin beside a panel is empty, and that is what a margin is. Panels
 * were numbered down the page in September (01 Your decks, 02 Math) to give
 * the gutter something to hold; Derick, 2026-10-26: "We shouldn't have things
 * numbered unless they need to be numbered." A heading carries its section by
 * itself (design-director, section 5), and the margin holds only what a
 * margin holds: the page's kicker, the carry-on label, a caret, an
 * annotation. */

.page > .page-head,
.page > .panel,
.page > .resume,
.page > .practice-layout,
.page > .gate,
.page > .sheet,
.page > .flash,
.page > .actions.centered,
.page > .deck-form,
.page > .dev-cast { grid-column: 1 / -1; }

/* The desk's pages are a sheet with prose above and below it, and all of it
 * lines up on the sheet's own left edge rather than on the body column's.
 * ⚠ justify-self, never `margin: 0 auto`: an auto margin on a grid item
 * overrides the default stretch, so the block shrinks to fit its content.
 * That is how the explanation block came out 288px wide in a 702px column
 * while the facts block beside it came out 702. */
/* One column the width of the sheet, so the prose above and below it starts
 * on the sheet's own left edge. Centering each child instead left the
 * narrow prose at the container's edge and the sheet in the middle of it,
 * 140px apart. */
.page > .desk-page {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 52rem;
  justify-self: center;
  /* Room for the sticky line to rest below the last thing on the page. */
  padding-bottom: 4rem;
}

@media (max-width: 56rem) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .page > * { grid-column: 1; }
}

/* ——— masthead: the front cover ———
 *
 * A blue book's front cover: a band of the cover's own blue, and on it a
 * printed label in a double-ruled frame holding the name of the thing and a
 * printed line saying what is inside. The sections are printed on the cover
 * beside it, and the learner's mark sits in the corner where the Name field
 * goes. The cover's bottom edge is a real edge: the leaves start under it. */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--cover);
  border-bottom: 1px solid var(--cover-deep);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--cover-print) 10%, transparent), var(--shadow);
  color: var(--cover-print);
}

.masthead .col {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 2rem);
  padding-block: 0.6rem;
}

/* The cover label: a frame of two rules, the outer one heavier, the way the
 * box on a booklet's cover is printed. Drawn with inset shadows so the frame
 * adds no layout and cannot shift the wordmark. The carets hang below the
 * baseline, so the word keeps its room under it. */
.brand {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  flex-shrink: 0;
  min-width: 0;
  padding: 0.38rem 0.85rem 0.34rem;
  border-radius: 1px;
  box-shadow:
    inset 0 0 0 1.5px var(--cover-print),
    inset 0 0 0 3.5px var(--cover),
    inset 0 0 0 4.5px color-mix(in srgb, var(--cover-print) 55%, transparent);
}
.brand .wordmark { padding-bottom: 0.5rem; }

/* "smrtr" — smarter with the vowels edited out, two carets marking where they
 * went. The carets are the product's argument in two glyphs: a correction,
 * made in the margin. They tuck into the letter gaps below the baseline and
 * must never spread the word apart, and the word never wraps or splits. */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.62rem;
  letter-spacing: -0.035em;
  line-height: 1;
  white-space: nowrap;
  color: var(--cover-print);
}

/* The carets are proof marks and have to read as proof marks (round two,
 * rule 3). 0.42em with a 3.2-unit stroke: at the masthead's 21.6px that is a
 * 9px mark, and at a 16px wordmark still a 6.7px chevron with a visible apex
 * rather than a speck. Printed in the leaf's blue, so on the cover they read
 * as a second ink and not as part of the letters. */
.wordmark .caret {
  display: inline-block;
  width: 0.42em;
  height: 0.34em;
  margin: 0 -0.18em;
  align-self: flex-end;
  transform: translateY(74%) rotate(-3deg);
}

.wordmark .caret:last-of-type { transform: translateY(74%) rotate(4deg); }

.wordmark .caret svg { display: block; width: 100%; height: 100%; overflow: visible; }

.wordmark .caret path {
  fill: none;
  stroke: var(--print);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Says what this is, on every page, printed inside the cover label under the
 * name. Hidden on a phone where the name has to have the width. */
.brand-context {
  margin: 0;
  font-family: var(--f-print);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cover-print-2);
  white-space: nowrap;
}

.tabs { display: flex; flex: 1; gap: clamp(0.6rem, 2vw, 1.7rem); align-items: center; }

/* Not pills. A tab is a printed word on the cover with room under it for the
 * rule that marks the one you are on. */
.tab {
  position: relative;
  padding: 0.35rem 0.1rem;
  font-family: var(--f-print);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cover-print-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15rem;
  height: 2px;
  background: var(--cover-print);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-settle);
}

.tab:hover { color: var(--cover-print); }
.tab:hover::after { transform: scaleX(1); transform-origin: left; }
.tab.on { color: var(--cover-print); }
.tab.on::after { transform: scaleX(1); }

/* ——— the learner's mark, which is also the account menu ——— */

.learner-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--cover-print);
  background: var(--leaf);
  border: 1.5px solid var(--cover-print);
  border-radius: 50%;
}

/* Off the cover (the account page, the picker) the mark is on a leaf and
 * takes the leaf's quieter frame. */
.page .learner-mark { color: var(--print); border: 1px solid var(--hair-hard); }

.who-menu { position: relative; flex-shrink: 0; }

.who-menu summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
}

.who-menu summary:hover { border-color: color-mix(in srgb, var(--cover-print) 25%, transparent); background: color-mix(in srgb, var(--leaf) 35%, transparent); }
.who-menu summary::-webkit-details-marker { display: none; }

/* The cover's Name field, filled in: the printed label, then the name in the
 * hand the answers are written in, on a printed rule. */
.cover-field {
  font-family: var(--f-print);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cover-print-2);
}

.who-name-inline {
  min-width: 5.5rem;
  padding: 0 0.35rem 0.08rem;
  font-family: Charter, "Bitstream Charter", Cambria, serif;
  font-weight: 400;
  font-size: 1.02rem;
  color: var(--cover-print);
  border-bottom: 1px solid color-mix(in srgb, var(--cover-print) 55%, transparent);
  white-space: nowrap;
}

.who-drop {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 70;
  min-width: 14rem;
  padding: 0.4rem;
  background: var(--leaf);
  border: 1px solid var(--hair-hard);
  border-radius: 0.3rem;
  box-shadow: var(--shadow-lift);
}

.drop-label {
  margin: 0;
  padding: 0.3rem 0.55rem 0.1rem;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.drop-current {
  margin: 0 0 0.35rem;
  padding: 0 0.55rem 0.45rem;
  font-family: var(--f-display);
  font-weight: 600;
  border-bottom: 1px solid var(--hair);
}

.drop-item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: 0.2rem;
  cursor: pointer;
}

.drop-item:hover { background: var(--print-wash); color: var(--print); }

/* ——— footer: the back cover ———
 *
 * The booklet closes on its back cover: the same blue as the front, the
 * strapline, and a printed run of metadata. "keep going" is set in the
 * display italic because it is the one handwritten thing on the cover. */

.footplate {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--cover-deep);
  padding: 1.7rem 0 2.2rem;
  background: var(--cover);
  color: var(--cover-print);
}

.footplate .col {
  display: grid;
  grid-template-columns: minmax(0, var(--margin-col)) minmax(0, 1fr);
  gap: 0.55rem clamp(1rem, 2.5vw, 2rem);
  align-items: baseline;
  font-size: 0.86rem;
  color: var(--cover-print);
}

.foot-script {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--cover-print);
  text-align: right;
}

.foot-line { margin: 0; max-width: var(--measure); text-wrap: pretty; }

.foot-meta {
  grid-column: 2;
  margin: 0;
  font-family: var(--f-print);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cover-print-2);
}

.foot-meta a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 0.2em; }
.foot-meta a:hover { color: var(--cover-print); text-decoration-color: currentColor; }

@media (max-width: 56rem) {
  .footplate .col { grid-template-columns: minmax(0, 1fr); }
  .foot-script { text-align: left; }
  .foot-meta { grid-column: 1; }
}

/* ——— page furniture ——— */

/* The head of every page is the margin device: the typed kicker out in the
 * margin, the heading and the lede in the body column. */
.page-head {
  display: grid;
  grid-template-columns: minmax(0, var(--margin-col)) minmax(0, 1fr);
  gap: 0 clamp(1rem, 2.5vw, 2rem);
  margin: 0 0 clamp(1.8rem, 4vw, 2.8rem);
}

.page-head h1 {
  grid-column: 2;
  margin: 0;
  font-family: var(--f-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem);
  letter-spacing: -0.028em;
  line-height: 1.02;
  text-wrap: balance;
  color: var(--ink);
}

.page-head h1 em { font-style: italic; color: var(--print); }

.page-head .lede {
  grid-column: 2;
  margin: 0.7rem 0 0;
  font-size: 1.02rem;
  color: var(--ink-2);
  max-width: var(--measure);
  line-height: 1.6;
  text-wrap: pretty;
}

/* The kicker sits in the margin, typed, right-aligned against the rule the
 * heading starts at. */
.eyebrow {
  grid-column: 1;
  grid-row: 1;
  margin: 0.5rem 0 0;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--print);
  text-align: right;
  line-height: 1.4;
}

.eyebrow a { color: inherit; }

.page-head .pencil { grid-column: 1; grid-row: 1; justify-self: end; }

@media (max-width: 56rem) {
  .page-head { grid-template-columns: minmax(0, 1fr); }
  .page-head h1, .page-head .lede, .eyebrow { grid-column: 1; }
  .eyebrow { grid-row: auto; margin: 0 0 0.5rem; text-align: left; }
  .page-head .pencil { grid-row: auto; justify-self: start; margin-bottom: 0.5rem; }
}

/* Centered heads (the way in: sign in, who is practicing) keep one column.
 * A margin beside a 34rem card would be a margin beside nothing. */
.page-head.centered {
  display: block;
  text-align: center;
}
.page-head.centered .lede { margin-inline: auto; }
.page-head.centered .eyebrow { text-align: center; margin: 0 0 0.6rem; }

.flash {
  margin: 0 0 1.25rem;
  padding: 0.7rem 1rem 0.7rem 1.1rem;
  background: var(--print-wash);
  border: 1px solid var(--hair);
  border-radius: 0.3rem;
  font-size: 0.95rem;
}

/* Something went wrong: a password that didn't match, a link already used.
 * Not the red pencil, which marks a wrong answer and nothing else (review,
 * round three). The ink, a harder rule round it, and the word Problem in
 * bold ahead of the sentence, so the state never rests on a color. */
.flash.bad {
  color: var(--ink);
  background: var(--leaf);
  border-color: var(--hair-hard);
}
.flash.bad::before { content: "Problem: "; font-weight: 700; }

/* ——— links and buttons ——— */

a { color: inherit; text-decoration: none; }

/* A link in running text says so without color: an underline, offset below
 * the descenders (review, round three; WCAG 1.4.1). Controls that look like
 * controls are left alone: buttons, tabs, the menu, and the rows of a list
 * of links (a deck name, a table of contents row, the carry-on card, a skill
 * row), which say "link" by being a row with a hover. */
.page a:not(.check-link):not(.quiet):not(.tab):not(.deck-name a):not(.quiet-link):not(.domain-link):not(.resume):not(.drop-item):not(.skills.linked a):not(.rail-lesson) {
  color: var(--print);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
  text-underline-offset: 0.2em;
}
.page a:not(.check-link):not(.tab):hover { color: var(--action-deep); text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 0.2em; }

button { font: inherit; cursor: pointer; }

.check, .check-link, .quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  padding: 0.55rem 1.3rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 0.25rem;
  border: 1px solid var(--hair-hard);
  background: var(--leaf);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s var(--ease-settle), box-shadow 0.18s ease,
              border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.check, .check-link {
  background: var(--action);
  border-color: var(--action);
  color: var(--on-action);
  box-shadow: 0 4px 14px var(--action-glow);
}

.check:hover, .check-link:hover {
  background: var(--action-deep);
  border-color: var(--action-deep);
  color: var(--on-action);
  transform: translateY(-1px);
  box-shadow: 0 9px 22px var(--action-glow-lift);
}

.quiet:hover { border-color: var(--print); color: var(--print); transform: translateY(-1px); }

/* The small variants share a shorter height with each other, for the same
 * reason the full-size ones share theirs. */
.check-link.small { min-height: 2.3rem; padding: 0.35rem 0.9rem; font-size: 0.88rem; }
.check.wide { width: 100%; }
.quiet { min-height: var(--control-h); padding: 0.4rem 1rem; font-size: 0.9rem; }
.deck-actions .quiet, .member-actions .quiet { min-height: 2.3rem; }

.quiet-link {
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.quiet-link:hover { color: var(--print); }

.actions { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: center; margin: 1.75rem 0 0; }
.actions.centered { justify-content: center; }

/* ——— panels and cards ——— */

/* A panel is a section of the page, not a box on it. Its heading starts at
 * the body column and a hard rule runs the full width of the page under it,
 * margin included: section grammar by hairline rather than by card. */
.panel {
  margin: 0 0 clamp(2rem, 5vw, 3.4rem);
  display: grid;
  grid-template-columns: minmax(0, var(--margin-col)) minmax(0, 1fr);
  column-gap: clamp(1rem, 2.5vw, 2rem);
  align-content: start;
}

.panel > * { grid-column: 2; min-width: 0; }
.panel > .pick-head { grid-column: 1 / -1; }

@media (max-width: 56rem) {
  .panel { grid-template-columns: minmax(0, 1fr); }
  .panel > * { grid-column: 1; }
}

.panel-head {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.pick-head {
  display: grid;
  grid-template-columns: minmax(0, var(--margin-col)) minmax(0, 1fr);
  gap: 0.25rem clamp(1rem, 2.5vw, 2rem);
  margin: 0 0 1.3rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--hair-hard);
}

.pick-head .panel-head { grid-column: 2; }

.pick-note {
  grid-column: 2;
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-3);
  max-width: var(--measure);
  line-height: 1.55;
}

@media (max-width: 56rem) {
  .pick-head { grid-template-columns: minmax(0, 1fr); }
  .pick-head .panel-head, .pick-note { grid-column: 1; }
}

/* Carry on where you left off — the biggest thing on the home page, because it
 * is the thing most likely to be wanted. Drawn on the question paper itself,
 * so it reads as "your sheet, still open".
 *
 * It used to carry a 4px crimson border-left. That is the banned accent spine
 * (developer.md); the label now does the job the stripe was doing. */
.resume {
  display: grid;
  grid-template-columns: minmax(0, var(--margin-col)) minmax(0, 1fr) auto;
  gap: 0.2rem clamp(1rem, 2.5vw, 2rem);
  margin: 0 0 clamp(2rem, 5vw, 3rem);
  padding: 1.3rem clamp(1.1rem, 2.5vw, 1.6rem);
  color: var(--ink);
  background:
    var(--ruled),
    var(--leaf);
  border: 1px solid var(--hair-hard);
  border-radius: 0.3rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s var(--ease-settle), box-shadow 0.18s ease;
}

.resume:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.resume-label {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  padding-top: 0.5rem;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.81rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--print);
  text-align: right;
}

.resume-name {
  grid-column: 2;
  display: block;
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.05rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.1;
  color: var(--ink);
}

.resume-go {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--print);
  white-space: nowrap;
}

.resume:hover .resume-go .arrow { transform: translateX(0.25rem); }
.resume-go .arrow { transition: transform 0.25s var(--ease-settle); }

.resume-meta {
  grid-column: 2;
  display: block;
  margin-top: 0.35rem;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.87rem;
  letter-spacing: 0.03em;
  color: var(--ink-3);
}

@media (max-width: 56rem) {
  .resume { grid-template-columns: minmax(0, 1fr); }
  .resume-label { grid-column: 1; grid-row: auto; padding-top: 0; text-align: left; }
  .resume-name, .resume-meta, .resume-go { grid-column: 1; grid-row: auto; margin-top: 0.7rem; }
}

/* ——— the deck and domain grids ———
 *
 * A fixed set of cards never uses auto-fill: the count decides the columns, or
 * the last row comes out ragged (developer.md). These lists are generated, so
 * the count is not known here — but the card is wide enough that three columns
 * only happen when there is room, and a trailing card stretches to fill rather
 * than leaving a hole. */
.deck-grid, .who-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.deck-grid > *, .domain-grid > *, .who-grid > * { min-width: 0; }

/* An odd last deck takes the whole row rather than leaving a hole beside it
 * (layout-alignment: a fixed grid template fills every cell). Five decks were
 * 2 + 2 + 1 with half a row of nothing. */
.deck-grid > li:last-child:nth-child(odd) { grid-column: 1 / -1; }

@media (max-width: 52rem) {
  .deck-grid, .who-grid { grid-template-columns: minmax(0, 1fr); }
}

.deck-card {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.25rem 1.1rem;
  background: var(--leaf);
  border: 1px solid var(--hair);
  border-radius: 0.3rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s var(--ease-settle);
}

.deck-card:hover { border-color: var(--hair-hard); box-shadow: var(--shadow); transform: translateY(-2px); }

.deck-name {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.15;
  text-wrap: balance;
}

.deck-name a { color: var(--ink); }
.deck-name a:hover { color: var(--print); }

.deck-meta {
  margin: 0.4rem 0 0;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.deck-skills {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Three controls side by side at three widths read as three different kinds
 * of control: Practice 86px, Read back 104, Remove 89 (catalog A1, measured
 * 2026-10-26). One width for the group, from the widest label, and the row
 * stacks rather than squeezing when the card is narrow. The account page's
 * pair was already fixed this way; the deck card was missed. */
.deck-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(max-content, 1fr);
  justify-content: start;
  gap: 0.6rem;
  align-items: center;
  margin-top: auto;
  padding-top: 1.1rem;
  /* A full-row card (the odd last one) would otherwise stretch three
   * buttons across 750px; capped at what a half-width card gives them. */
  max-width: 24rem;
}
.deck-actions > * { text-align: center; }
/* Remove is a button_to, so the grid item is its <form> and the button inside
 * shrank to its word: 77px beside two 113px buttons. */
.deck-actions > form { display: grid; }
.deck-actions > form > * { width: 100%; }
@media (max-width: 26rem) {
  .deck-actions { grid-auto-flow: row; grid-auto-columns: auto; }
}

/* A table of contents, so full-width rows and not a card grid: the name on
 * the left, what is in it on the right, one rule per line. Two columns of
 * these left a hole wherever the count was odd, and read as five cards that
 * had lost their boxes. */
.domain-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.domain-grid > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1.5rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--hair);
}

.domain-grid > li:first-child { border-top: 1px solid var(--hair); }

.domain-grid > li.visited { border-bottom-color: var(--print-soft); }

.domain-link {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.domain-link:hover { color: var(--print); }

.domain-meta {
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  white-space: nowrap;
}

.domain-grid.big > li { padding-block: 1rem; }

/* On a phone the meta goes under the name on every row. Left to wrap on its
 * own, four rows folded and "Geometry" kept its meta beside it because it was
 * short enough, which is repeating rows with two different shapes. */
@media (max-width: 42rem) {
  .domain-grid > li { gap: 0.15rem 0; }
  .domain-meta { flex-basis: 100%; }
}

/* ——— the deck builder, full page ———
 *
 * The one page where the margin is already part of the content: the outline
 * references (I.1.A) are exactly what a margin holds, and they were here
 * before the system was. The form takes the page's own ruling so the tree
 * lines up with the heading above it. */

.deck-form {
  display: grid;
  grid-template-columns: minmax(0, var(--margin-col)) minmax(0, 1fr);
  column-gap: clamp(1rem, 2.5vw, 2rem);
  align-content: start;
}

.deck-form > * { grid-column: 2; min-width: 0; }
.deck-form > .pick-head, .deck-form > .deck-name-row, .deck-form > .deck-foot { grid-column: 1 / -1; }

@media (max-width: 56rem) {
  .deck-form { grid-template-columns: minmax(0, 1fr); }
  .deck-form > * { grid-column: 1; }
}

.deck-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin: 0 0 2.25rem;
}

.deck-name-row .grow { flex: 1; min-width: 18rem; }

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-3);
}

/* Long enough to hold the example. A 14rem field cut off "Fractions before the
 * test", which reads as a length limit that is not there. */
.written.wide, select.written {
  width: 100%;
  max-width: 100%;
  height: var(--control-h);
  padding: 0.55rem 0.8rem;
  font-family: var(--f-ui);
  font-size: 1.02rem;
  color: var(--ink);
  background: var(--leaf);
  border: 1px solid var(--hair-hard);
  border-radius: 0.25rem;
}

.written.wide:focus {
  border-color: var(--print);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--print) 12%, transparent);
}

.deck-name-row .check { margin-top: 0; }

.domain-block { margin: 0 0 2.25rem; }

/* The red pencil is for a miss, and nothing on this page is wrong. */
.domain-name {
  margin: 0 0 0.85rem;
  padding-bottom: 0.4rem;
  font-family: var(--f-print);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--hair-hard);
}

.category-block { margin: 0 0 1.4rem; }

.category-name {
  margin: 0 0 0.45rem;
  font-family: var(--f-display);
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink);
}

/* Two columns, so 159 skills are not a mile of single-file list. */
.skills { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2.5rem; }

.skills li { break-inside: avoid; padding: 0.08rem 0; }

.skills label, .skills.linked a, .skills.linked .empty {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.3rem 0.5rem;
  font-size: 0.95rem;
  border-radius: 0.25rem;
  color: var(--ink);
  cursor: pointer;
}

.skills label:hover, .skills.linked a:hover { background: color-mix(in srgb, var(--print) 6%, transparent); }

/* Skill, group and area names are content, different on every row, so a
 * widow cannot be fixed by choosing the break: the browser has to avoid it.
 * `balance`, not `pretty`, for these short labels: Chromium's `pretty` only
 * rescues a short last word, and left "repeated / subtraction" and
 * "unlike / denominators" alone at 390 (wrapcheck); balanced lines put two
 * words on each. Running prose keeps `pretty`. */
.skills .skill-name { flex: 1; text-wrap: balance; }
.domain-link, .rail-skill-name, .category-name, .skills.linked .skill-name { text-wrap: balance; }
/* Not the typed area heading in the builder: balanced, "Capitalization,
 * Punctuation & Spelling" put "Capitalization," alone on its first line; left
 * to wrap, with the ampersand glued to "Spelling" (nb_amp), it breaks after
 * "Punctuation" and both lines carry two words. */
.lesson-offer, .review-answer, .pick-note, .plan-terms, .plan-note,
.verdict, .misconception, .passage p { text-wrap: pretty; }
.skills label.empty, .skills .empty { opacity: 0.4; cursor: default; }

.count { font-family: var(--f-print); font-size: 0.85rem; font-variant-numeric: tabular-nums; color: var(--ink-3); }

.deck-foot {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hair);
}

.deck-foot .check { margin-top: 0; }

/* ⚠ 52rem, not 40rem. A column has to hold a skill NAME, and the name is the
 * narrowest thing in the row: at 768 two columns left it 200px, which is less
 * than "Solve a system by substitution" needs, and fourteen names wrapped with
 * one word alone on the second line (wrapcheck, catalog B1). The row's chrome
 * is about 135px (the box, the outline reference at 3.4rem, the count and the
 * gaps), the longest names want about 260px, and two of those plus the 2.5rem
 * gap is 832px. Below that, one column. */
@media (max-width: 52rem) { .skills { columns: 1; } }

/* ——— account, family, learner picker ——— */

/* ——— the way in ———
 *
 * Sign in, who is practicing, reset a password. One card, centered, with the
 * sheet's own paper under it: the first thing anyone sees should be the
 * material the product is made of. */

.gate-head { max-width: 36rem; margin-inline: auto; }

.gate {
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(1.4rem, 3.5vw, 2rem);
  background:
    var(--ruled),
    var(--leaf);
  border: 1px solid var(--hair-hard);
  border-radius: 0.3rem;
  box-shadow: var(--shadow-lift);
}

.who-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 30rem) { .who-grid { grid-template-columns: minmax(0, 1fr); } }

/* A name on a class list: the mark, the name, what is waiting. */
.who-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 0.95rem;
  text-align: left;
  background: color-mix(in srgb, var(--cover-pale) 55%, transparent);
  border: 1px solid var(--hair);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.18s var(--ease-settle);
}

.who-card:hover {
  border-color: var(--print);
  background: var(--print-wash);
  transform: translateY(-1px);
}

.who-card-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who-card-name {
  font-family: var(--f-display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.who-card-meta {
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.81rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

/* The sign-in, reset and confirm forms. Stacked rather than in a row: these are
 * the only screens in the app where a person types more than one thing before
 * pressing anything, and side-by-side fields read as optional. */
.gate-form { display: flex; flex-direction: column; gap: 1rem; }
.gate-form .field { display: flex; flex-direction: column; gap: 0.3rem; }
.gate-form .written { width: 100%; box-sizing: border-box; }

/* Sign-up's honeypot: off screen, out of the tab order, and never announced.
 * Not display:none, which some scripts skip and some browsers refuse to
 * submit. app/lib/signup_guard.rb says what it is for. */
.hp-field {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The sentence a visitor arriving through a Tor exit sees above the form. */
.tor-notice { margin: 0 0 1.25rem; }

.gate-whom {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-3);
}

.gate-alt {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--hair);
  font-size: 0.9rem;
}

.gate-alt a { color: var(--print); text-decoration: underline; text-underline-offset: 2px; }
.gate-alt a:hover { color: var(--action-deep); }

/* One link on its own under a page head, rather than the row of two under a
 * form: nothing to spread apart, and no rule above it to close a form off. */
.gate-alt.bare { justify-content: center; margin-top: 1.5rem; padding-top: 0; border-top: 0; }

/* ——— adding somebody to the family ———
 *
 * One row, three labelled controls, their boxes on one line. A grid rather
 * than a flex row so each control has a column of its own: the name takes
 * what is left, the grade takes its own width, Add takes the width of the
 * word. The labels sit above, which is what tells you the grade belongs to
 * the person you are adding. */
/* Two ways to start, as a pair: same height, same shape, "or" between them.
 * See shared/_start_practice. */
/* The two actions share one width (catalog A1, and Derick 2026-11-27: "they
   just look all janky"). `1fr auto 1fr` on a grid sized to its content makes
   both equal 1fr columns take the width of the wider one, and leaves the OR
   between them at its own size. `flex` sized each to its own label: "Build a
   deck" came out 129px beside "Take a mix of everything" at 197px. */
.start-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  max-width: 100%;
}

/* A button label never wraps; the row gives way instead (catalog B2). */
.start-pair > .check-link, .start-pair > .quiet {
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

/* ⚠ 32rem, not 26rem. Two equal columns of the wider label plus the OR need
   about 440px, and at 440 "Take a mix of everything" was breaking before
   "everything". Below that the pair stacks and each one has the full width. */
@media (max-width: 32rem) {
  .start-pair { grid-template-columns: 1fr; justify-items: stretch; width: 100%; }
}
/* The third way in, under the pair rather than beside it. */
.start-extra { margin: 0.85rem 0 0; font-family: var(--f-ui); font-size: 0.95rem; }

.start-pair .or {
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.add-learner { border-top: 1px solid var(--hair); padding-top: 1.25rem; }
.add-learner-head {
  margin: 0 0 0.6rem;
  font-family: var(--f-ui);
  font-size: 1rem;
  font-weight: 600;
}
.add-learner-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 0.75rem;
  /* end, so the three boxes line up along their bottoms whatever height
   * their labels come out. */
  align-items: end;
}
.add-learner-row .written { width: 100%; }
.add-learner-row .listbox { flex: none; }

/* Three controls in a row need about 30rem before the name field starts
 * losing characters; below that they stack. They pushed the card past the
 * viewport at 390 and the page scrolled sideways. */
@media (max-width: 34rem) {
  .add-learner-row { grid-template-columns: minmax(0, 1fr); }
  .add-learner-go { justify-self: start; }
  .add-learner-row .listbox { width: 100%; }
}

.inline-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.inline-add.centered { max-width: 36rem; margin: 0 auto; }
.inline-add .written { flex: 1; min-width: 12rem; }
.inline-add .grow { flex: 1; min-width: 14rem; }

.family { list-style: none; margin: 0 0 1.25rem; padding: 0; }

.family li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--hair);
}

.family li.is-me { font-weight: 600; }
.family-name { font-family: var(--f-display); font-size: 1.05rem; }
.family-meta { font-size: 0.85rem; color: var(--ink-3); margin-right: auto; }

@media (max-width: 62rem) { .brand-context { display: none; } }

@media (max-width: 46rem) {
  .masthead .col { flex-wrap: wrap; gap: 0.6rem; }
  .tabs { order: 3; flex-basis: 100%; }
  .who-name-inline, .cover-field { display: none; }
  /* The mark belongs in the corner. Without this it sits against the
   * wordmark, because the tabs that used to push it right have wrapped
   * onto their own line. */
  .who-menu { margin-left: auto; }
}

/* "Next question" is a button_to inside the sheet, so it needs the same
 * treatment as every other primary button rather than a flat blue slab. */
.next {
  min-height: 2.8rem;
  padding: 0.55rem 1.3rem;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid var(--action);
  border-radius: 0.25rem;
  background: var(--action);
  color: var(--on-action);
  box-shadow: 0 4px 14px var(--action-glow);
  transition: transform 0.18s var(--ease-settle), box-shadow 0.18s ease, background 0.15s ease;
}

.next:hover {
  background: var(--action-deep);
  transform: translateY(-1px);
  box-shadow: 0 9px 22px var(--action-glow-lift);
}

/* The sheet sits in the page column now, not alone on a bare background. */
.page .sheet { box-shadow: var(--shadow); }

/* The sheet's own top line: a way back, then where you are. They ran together
 * as "DONE FRACTIONS I KEEP MISSING" without something between them. */
.topic .quiet-link { margin-right: 0.6rem; padding-right: 0.6rem; border-right: 1px solid var(--hair); }

/* ——— the pencil ——— */
/* "Grade 6 · Math" written down the barrel. It carries the context that used
 * to sit under the wordmark in the masthead, where it was easy to miss and
 * cramped against the logo. */

.pencil {
  display: inline-flex;
  align-items: stretch;
  height: 1.9rem;
  margin: 0 0 0.9rem;
  filter: drop-shadow(0 2px 3px var(--shadow-ink));
}

.pencil-eraser {
  width: 0.7rem;
  background: #e3928f;
  border-radius: 0.35rem 0.1rem 0.1rem 0.35rem;
}

.pencil-ferrule {
  width: 0.55rem;
  background: repeating-linear-gradient(90deg, #b9c0c8 0 2px, #9aa3ad 2px 4px);
}

.pencil-barrel {
  display: flex;
  align-items: center;
  padding: 0 0.9rem;
  /* The middle of the barrel's gradient as a solid color under it, so a
   * probe that cannot read a gradient measures the label against the yellow
   * it is printed on and not against the page (it read 1.65:1 at Night). The
   * pencil is an illustration of a real pencil, so its colors are literal and
   * the same in both schemes: a pencil is yellow at night too. */
  background-color: #e0a92f;
  background-image: linear-gradient(180deg, #f0c04a 0%, #e0a92f 55%, #c9922a 100%);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5a3d0c;
  white-space: nowrap;
}

/* The sharpened cone, then the graphite. Clip-paths so the point stays sharp
 * whatever the label length or font size. */
.pencil-wood {
  width: 0.85rem;
  background: linear-gradient(180deg, #eddcc0 0%, #dcc49c 60%, #c9ae83 100%);
  clip-path: polygon(0 0, 100% 42%, 100% 58%, 0 100%);
}

.pencil-lead {
  width: 0.4rem;
  background: #3a3f45;
  clip-path: polygon(0 42%, 100% 50%, 0 58%);
}

/* ——— outline references ——— */
/* Every row has an address — I.1.A — so a skill can be pointed at rather than
 * described. */

.ref {
  flex-shrink: 0;
  min-width: 3.2rem;
  font-family: var(--f-print);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.04em;
  /* Typed in the printing's own ink, like every other label on the page.
   * It was set in the red pencil, which says a miss, and an address is not
   * a miss. */
  color: var(--print);
}

.domain-name .ref { min-width: 2rem; font-size: inherit; }
.category-name .ref { min-width: 2.6rem; font-size: 0.85rem; }
.skills .ref { min-width: 3.4rem; }

/* ——— gated buttons ——— */
/* A control that cannot act says so, rather than failing quietly when pressed. */

.check:disabled, .check[disabled] {
  background: var(--leaf);
  border-color: var(--hair);
  color: var(--ink-3);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.check:disabled:hover { transform: none; box-shadow: none; background: var(--leaf); color: var(--ink-3); }

.tally { margin-left: 0.5rem; font-weight: 700; color: var(--print); }

/* ——— the answer row ——— */
/* The Check button matches the height of the box it sits beside, with room
 * between them. */

.answer-row { display: flex; align-items: flex-end; gap: 0.9rem; margin-top: 0.5rem; }

/* The answer goes on a line, the way it does on paper: no fill, no box, a
 * ruled line under it and the answer written in the sheet's own serif at the
 * size a person writes. The boxed version was the one control on the sheet
 * that still looked like a form on a website. */
.answer-row .written {
  flex: 1;
  max-width: 15rem;
  height: var(--control-h);
  padding: 0.35rem 0.35rem 0.3rem;
  font-family: Charter, "Bitstream Charter", Cambria, serif;
  font-size: 1.5rem;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
}

.answer-row .written:focus { outline: none; border-bottom-color: var(--print); }
.answer-row .written:focus-visible { outline: none; box-shadow: 0 2px 0 0 var(--print); }
.answer-row .written::placeholder { color: var(--ink-3); }

.answer-row .check { min-height: var(--control-h); margin-top: 0; }

/* What the box still needs before Check will send ("a number", "something to
 * send"): guidance before an answer, not a mark on one, so not crimson. */
.answer-hint { margin: 0.5rem 0 0; min-height: 1.2rem; font-size: 0.88rem; color: var(--ink-2); }

.next-row { display: flex; align-items: center; gap: 0.9rem; margin-top: 1.5rem; outline: none; }
.next-row .next { margin-top: 0; }
.next-hint { font-size: 0.85rem; color: var(--ink-3); }

/* A focus ring in the pencil reads as an error on a text box, so the leaf's
 * printing, at full strength: a 45% ring measured under 3:1 against the
 * ground (review, round three). */
input:focus-visible, .written:focus-visible {
  outline: 3px solid var(--print);
  outline-offset: 2px;
}

/* The heading refs need to sit beside their titles, not against them. The
 * skill rows are already flex; these two were not, so min-width did nothing
 * and "I.1" ran straight into "Ratio concepts and language". */
.domain-name, .category-name {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

/* The outline reference is a label beside the heading, not part of its
 * text: the heading element holds the name alone, and the reference is
 * aria-hidden (review, round three). The wrapper carries the type. */
.domain-name > h3, .category-name > h4 { margin: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; text-wrap: inherit; }

/* ——— family management ——— */

.members { list-style: none; margin: 0 0 1.75rem; padding: 0; }

.member {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  align-items: start;
  /* Inset on both edges. The row used to run flush to the container, so the
   * learner's mark touched the left edge and Save touched the right. */
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--hair);
  border-radius: 0.35rem;
}

.member.is-me { background: color-mix(in srgb, var(--print) 4%, transparent); }

.member .learner-mark { grid-row: span 3; }

/* Name, the year of school, and a level per subject. Wrapping, because the
 * number of subjects is content and not a layout decision: a third subject
 * must find its own line rather than squeeze the name to nothing. Aligned on
 * the bottom of the boxes, so the labels above them can be any height. */
.member-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.member-form .field { flex: 0 0 auto; }
.member-form .field:first-child { flex: 1 1 12rem; min-width: 0; }
.member-name { width: 100%; }
.member-grade { flex: 0 0 auto; width: auto; min-width: 14rem; }
.member-save { flex-shrink: 0; }
.member-form .field-label { white-space: nowrap; }

.member-meta { margin: 0; font-size: 0.85rem; color: var(--ink-3); }

/* Side by side, the pair shares one width (the wider one's), so "Practice as
 * Holden" and "Remove" read as a pair rather than a long button and a short
 * one (wrapcheck, catalog A1: 160 and 89px). A max-content grid with 1fr
 * tracks gives every track the widest item's width without a hardcoded
 * number. */
.member-actions {
  display: grid;
  /* Two named slots, not auto-flow: every row has the same two columns whether
     or not it has both buttons, so Remove is in one place down the whole list
     (buttoncheck, catalog A2). */
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  /* ⚠ Not `max-content`. Each row is its own grid, so max-content made every
     row as wide as ITS OWN labels: Remove came out 89px on the row that has no
     "Practice as" button and 137px on the rows that do, and the column walked
     about down the list (buttoncheck, catalog A2). A width that does not read
     the row's content is the only way three rows can agree. */
  width: 100%;
  max-width: 22rem;
}

.member-slot { display: block; }

.member-actions form, .member-actions .quiet { width: 100%; }

/* On a phone the member row is 318px wide and two 160px buttons with their
 * gap do not fit, so the pair stacks: one max-content column, which is the
 * wider label's width, and both buttons fill it. A label never wraps; the
 * buttons give way (wrapcheck caught "Practice as / Holden" at 390). */
@media (max-width: 34rem) {
  /* Stacked, and still one width for every row: minmax(0, 1fr) over a
     full-width container, never max-content. */
  .member-actions { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: none; }
}

/* On a phone the mark cannot hold a column of its own: it left the name, the
 * grade and Save stacking in a 12rem gutter beside it. The mark goes on the
 * same line as the first field and everything below runs the full width. */
@media (max-width: 34rem) {
  .member { grid-template-columns: minmax(0, 1fr); padding-inline: 0; }
  .member .learner-mark { grid-row: auto; }
  .member-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.55rem; }
  .member-form .field { flex: none; }
  .member-form .listbox { width: 100%; }
  .member-save { justify-self: start; }
  .member-grade { width: 100%; min-width: 0; }
  .listbox { flex: 1 1 auto; width: 100%; }
}

/* "No questions at grade 9 yet" is a fact about the shelves, not a mark on
 * anyone's work, so it is not crimson. The words carry it. */
.warn { color: var(--ink-2); font-weight: 600; }

/* Remove is a quiet button like its neighbors. It was crimson, which in this
 * system means a wrong answer; the confirm dialog is what protects the
 * action, and the word says what it does. */
.quiet.danger { color: var(--ink-2); }
.quiet.danger:hover { border-color: var(--ink-2); color: var(--ink); }

.inline-add .grow { flex: 1; min-width: 14rem; }

/* ——— plan and billing ——— */
/* An honest empty state. Nothing here pretends to be a card on file. */

.plan-card {
  padding: 1.4rem 1.5rem;
  background: var(--leaf);
  border: 1px solid var(--hair);
  border-radius: 0.35rem;
  box-shadow: var(--shadow);
}

.plan-state { margin: 0 0 0.75rem; font-size: 1rem; }

/* Called a flag, not a badge. ConstitutionTest bans the word outright and is
 * right to: a billing pill does not need the one noun that must never get a
 * foothold in a product for children.
 *
 * Typed, in the printing's ink, like every other label. It carried the red
 * pencil and, when active, a green: both are reserved for an answer, and a
 * plan is not an answer. The word on the flag does the telling. */
.plan-flag {
  display: inline-block;
  margin-right: 0.6rem;
  padding: 0.2rem 0.6rem;
  font-family: var(--f-print);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--print);
  background: var(--print-wash);
  border-radius: 0.25rem;
}

.plan-note { margin: 0 0 1.25rem; font-size: 0.92rem; color: var(--ink-2); line-height: 1.6; }
/* The note under a button belongs to it, and the card ends where its text
 * does. The account page's note sat flush against Manage plan & billing. */
.actions + .plan-note { margin-top: 0.75rem; }
.plan-card > :last-child { margin-bottom: 0; }

.plan-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.9rem;
  margin: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--hair);
}

.plan-facts dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* The household's own facts, written in: graphite, the way a filled-in value
 * is. In navy they read as four links that went nowhere. */
.plan-facts dd { margin: 0.25rem 0 0; font-family: var(--f-display); font-size: 1.02rem; color: var(--ink); text-wrap: balance; }

/* A plan change that has not happened yet. Quieter than the plan itself, which
 * is still the true answer to "what am I on"; loud enough that a parent who
 * just switched in the portal can see their click landed. */
.plan-pending {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--f-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-3);
}

/* The flag's moods, in words rather than in color: "Active" is the printing's
 * navy like every other label, and a plan that is ending or has ended is the
 * same flag in the ink of a note. A green here would say "right answer" and
 * an amber would be a fourth color with a meaning nobody was taught. */
.plan-flag.is-warn,
.plan-flag.is-off  { color: var(--ink-2); background: var(--hair); }

/* ——— the plan chooser ——— */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--leaf);
  border: 1px solid var(--hair);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

/* The yearly plan is marked, not preselected. A default that quietly costs six
 * times more is a dark pattern wearing a helpful face. */
.plan.is-best { border-color: var(--print); }

.plan-tag {
  position: absolute;
  top: -0.65rem;
  left: 1.4rem;
  margin: 0;
  padding: 0.15rem 0.55rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-action);
  background: var(--action);
  border-radius: 0.25rem;
}

.plan-name {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.plan-price { margin: 0; display: flex; align-items: baseline; gap: 0.4rem; }

.plan-amount {
  font-family: var(--f-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--print);
  /* The sheet's lining figures, so $50 does not render with the dropped figures
   * that took three rounds to get out of the question paper. */
  font-variant-numeric: lining-nums tabular-nums;
}

.plan-per { font-size: 0.92rem; color: var(--ink-3); }

.plan-terms {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.plan form { margin-top: auto; }
.plan .check, .plan .quiet { width: 100%; }

/* ——— charge history ——— */

.charges { list-style: none; margin: 0; padding: 0; }

.charge {
  display: grid;
  grid-template-columns: minmax(0, 12rem) 1fr auto auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--hair);
}

.charge-date { font-size: 0.92rem; color: var(--ink-2); }
.charge-kind { font-size: 0.82rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }

.charge-amount {
  font-family: var(--f-display);
  font-size: 1.02rem;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}

/* Money going back to the family, not a warning. */
.charge-amount.is-back { color: var(--ink-3); }

.charge-link a { font-size: 0.88rem; color: var(--print); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 34rem) {
  .charge { grid-template-columns: 1fr auto; row-gap: 0.3rem; }
  .charge-kind { grid-row: 2; }
}

/* ——— the listbox ———
 *
 * A native select's option menu belongs to the operating system: no CSS
 * reaches it, which is why the grade menu kept rendering in the system font
 * however carefully the closed control was styled. The real select is still in
 * the DOM and still submits; it is just not what you look at.
 */

.listbox { position: relative; flex: 0 0 14rem; width: 14rem; }

/* Present for the form and for a browser without JS, absent from view. */
.listbox-native {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.listbox-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  height: var(--control-h);
  padding: 0 0.8rem;
  font-family: var(--f-ui);
  font-size: 0.95rem;
  color: var(--ink);
  text-align: left;
  background: var(--leaf);
  border: 1px solid var(--hair);
  border-radius: 0.35rem;
  cursor: pointer;
}

.listbox-button:hover { border-color: var(--print); }

.listbox-button[aria-expanded="true"] {
  border-color: var(--print);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--print) 12%, transparent);
}

.listbox-chevron { display: flex; flex-shrink: 0; width: 0.75rem; color: var(--print); }
.listbox-chevron svg { width: 100%; }
.listbox-chevron path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.listbox-button[aria-expanded="true"] .listbox-chevron { transform: rotate(180deg); }

.listbox-list {
  position: absolute;
  z-index: 80;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 15rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--leaf);
  border: 1px solid var(--hair);
  border-radius: 0.35rem;
  box-shadow: var(--shadow-lift);
}

.listbox-option {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.5rem 0.6rem;
  font-family: var(--f-ui);
  font-size: 0.92rem;
  color: var(--ink);
  border-radius: 0.25rem;
  cursor: pointer;
}

.listbox-option:hover, .listbox-option.active { background: color-mix(in srgb, var(--print) 8%, transparent); color: var(--print); }

.listbox-option[aria-selected="true"] { font-weight: 700; color: var(--print); }

/* The accent, not the red pencil: a tick on the chosen option is not a miss. */
.listbox-tick { width: 0.9rem; flex-shrink: 0; color: var(--print); opacity: 0; }
.listbox-option[aria-selected="true"] .listbox-tick { opacity: 1; }

/* .written.wide is width:100% because the deck-name field wants the whole row.
 * Inside a member row it has neighbours, so it has to yield — otherwise every
 * field claims a full line and one person takes half the screen. */
/* min-width: 0 on both the grid cell and the flex child. Without it a grid
 * item defaults to min-content width, the row refuses to shrink, and Save
 * overflows the padding that was just added. */
.member-form { align-items: center; min-width: 0; }
.member-form .written { width: auto; }
.member-name { flex: 1 1 10rem; min-width: 0; }

/* Inset on both edges: the mark used to touch the left edge and Save the
 * right. Overrides nothing — this is the row's only padding declaration. */
.member { padding: 1rem 1.25rem; gap: 0.45rem 0.9rem; }
.member .learner-mark { align-self: center; }

/* ——— the practice page, using the width ———
 *
 * The sheet and, beside it, the table of contents for the set. The rail is
 * not a readout about the student: no score, no accuracy, no streak, and
 * "left" counts questions not yet seen. */

.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  /* Two things side by side share their height (developer.md), which here is
   * also what makes the rail's hairline read as the page's own margin rule
   * rather than as a stray 120px line beside the sheet. */
  align-items: stretch;
  /* A question is short and a window is tall. Centering the row in what is
   * left of the viewport puts the sheet on the desk instead of pinning it to
   * the top with a screen of nothing under it. */
  align-content: center;
  min-height: calc(100vh - 15rem);
}

/* An auto inline margin on a grid item makes it shrink to fit instead of
 * filling its track, so the sheet was coming out 654px wide in a 795px
 * column and sitting off-center against the rail. */
.practice-layout > .sheet { margin-inline: 0; }

/* The rail is a slip clipped to the sheet, not a card: no fill, one hairline
 * down its inner edge, and everything in it typed. */
.rail {
  padding: 0.2rem 0 0 clamp(1rem, 2vw, 1.5rem);
  border-left: 1px solid var(--hair-hard);
  font-size: 0.9rem;
}

.rail-block + .rail-block { margin-top: 1.4rem; padding-top: 1.3rem; border-top: 1px solid var(--hair); }

.rail-label {
  margin: 0 0 0.35rem;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--print);
}

.rail-title {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}

.rail-meta {
  margin: 0.4rem 0 0;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.03em;
  color: var(--ink-3);
}

.rail-skills { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }

.rail-skills li {
  padding: 0.35rem 0 0.35rem 0.95rem;
  line-height: 1.4;
}

/* Where you are in the set. A marker, not a measurement, and a dash rather
 * than a stripe down the edge (the accent spine is banned). */
.rail-skills li.here { font-weight: 600; position: relative; }

.rail-skills li.here::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.82em;
  width: 0.6rem;
  height: 2px;
  background: var(--print);
}

.rail-skills li.here .rail-skill-name { color: var(--print); }

.rail-skill-name { display: block; color: var(--ink-2); }

.rail-lesson {
  display: inline-block;
  margin-top: 0.15rem;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.81rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--print);
}

.rail-out { font-size: 0.9rem; }

@media (max-width: 60rem) {
  .practice-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .rail { border-left: 0; border-top: 1px solid var(--hair); padding: 1.25rem 0 0; }
}

/* ——— reading back through a deck ———
 *
 * A record to read, not a marked paper. Each entry says in the margin whether
 * it was right or missed, typed, the same way the result sheet does — the old
 * version marked a miss with a red stripe down the left edge, which is the
 * banned accent spine and also said nothing a word could not say. */
.review-list { list-style: none; margin: 0; padding: 0; }

.review-item {
  display: grid;
  grid-template-columns: minmax(0, var(--margin-col)) minmax(0, 1fr);
  gap: 0.25rem clamp(1rem, 2.5vw, 2rem);
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--hair);
}

.review-item > * { grid-column: 2; }
.review-item > :first-child { grid-row: 1; }
.review-item:last-child { border-bottom: 0; }

.review-item .verdict-tag {
  grid-column: 1;
  grid-row: 1;
  margin: 0.2rem 0 0.15rem;
  font-family: var(--f-print);
  font-size: 0.81rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: right;
  color: var(--correct);
}

.review-item.wrong .verdict-tag { color: var(--pencil); }

.review-item .topic {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  text-align: right;
  color: var(--ink-3);
}

.review-item .stem.restated { font-size: 1.06rem; margin: 0 0 0.5rem; font-weight: 500; }

.review-answer { margin: 0 0 0.7rem; font-size: 0.95rem; color: var(--ink-2); }
.review-answer strong { font-weight: 600; }
.review-item.wrong .review-answer strong:last-of-type { color: var(--correct); }

@media (max-width: 56rem) {
  .review-item { grid-template-columns: minmax(0, 1fr); }
  .review-item > *, .review-item .topic, .review-item .verdict-tag { grid-column: 1; }
  .review-item .topic, .review-item .verdict-tag { grid-row: auto; text-align: left; }
}

/* ——— password fields, and the eye that reveals them ———
 *
 * The button sits inside the field's box rather than beside it, so the row
 * keeps the same height as every other control (see the form-controls rule in
 * ~/Developer/config/developer.md). `.has-reveal` buys the right padding the
 * icon needs — without it the last characters of a revealed password run
 * underneath it, which is the one moment you are looking at them. */
.password-row { position: relative; display: block; }

.written.has-reveal { padding-right: 3rem; }

.reveal {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: var(--control-h);
  padding: 0;
  color: var(--ink-3);
  background: none;
  border: 0;
  border-radius: 0 0.35rem 0.35rem 0;
  cursor: pointer;
}

.reveal:hover { color: var(--ink); }

/* Explicit, because `hidden` alone loses to whatever is giving svg a display
 * of its own — the attribute was set and the icon still drew. Both icons
 * visible at once is the state this rule exists to prevent. */
.reveal svg[hidden] { display: none; }

.reveal svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reveal:focus-visible {
  outline: 2px solid var(--print);
  outline-offset: -2px;
}

/* ---------- dev sign-in block (DEVELOPMENT ONLY) ----------
 *
 * The view gates this on Rails.env.development?; nothing here can reach a
 * production page. Ported from Task Happens and Rostr so the three read the
 * same, and drawn in smrtr's own navy rather than transplanted.
 *
 * Three signals that it is absent from production, all conventional rather than
 * invented: a dashed accent border (dashed means provisional), 45-degree hazard
 * piping, and the words themselves on a label strip laid across the piping.
 *
 * Additive by construction — a sibling of .gate, which is top-anchored, so
 * nothing a real user sees moves. One column definition drives the header and
 * every row, so "Sign in as" sits over the names rather than near them.
 */
.dev-cast {
  --dev-col: 7rem;
  --dev-gap: 0.9rem;
  --dev-pad: 0.7rem;
  --dev-stripe: color-mix(in srgb, var(--print) 12%, transparent);

  max-width: 34rem;
  margin: 1.25rem auto 1rem;
  overflow: hidden;
  background: var(--leaf);
  border: 2px dashed color-mix(in srgb, var(--print) 55%, transparent);
  border-radius: 0.5rem;
}

.dev-cast-tape {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.4rem 0.7rem;
  /* The text IS centered, and saying so with text-align keeps this band out of
     wrapcheck's left-edge check, which looks for the first element in <main>
     that is not centered and had been measuring the mark against this tape
     (catalog A2). Flex centering alone leaves textAlign at start. */
  text-align: center;
  font-family: var(--f-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
  background: repeating-linear-gradient(
    45deg,
    var(--dev-stripe) 0 8px,
    transparent 8px 16px
  );
}

.dev-cast-tape-top { border-bottom: 2px dashed color-mix(in srgb, var(--print) 45%, transparent); }
.dev-cast-tape-bottom { border-top: 2px dashed color-mix(in srgb, var(--print) 45%, transparent); }

/* Edges left and right only: a strip laid across the tape, not a card on it.
 * The two phrases are flex items that wrap as whole units, so a phone shows
 * them on two centered lines rather than breaking one of them mid-phrase. */
.dev-cast-tape-label {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem 0.55rem;
  padding: 0.5rem 1.15rem;
  text-align: center;
  background: var(--leaf);
  color: var(--print);
  border-left: 2px dashed color-mix(in srgb, var(--print) 45%, transparent);
  border-right: 2px dashed color-mix(in srgb, var(--print) 45%, transparent);
}

/* The separator between the phrases is drawn, not typed, so it goes away with
 * the dots when the label wraps onto two lines. */
.dev-cast-tape-label .u + .u::before { content: "· "; }

@media (max-width: 32rem) {
  .dev-cast-tape-label::before, .dev-cast-tape-label::after { display: none; }
  .dev-cast-tape-label .u + .u::before { content: none; }
}

.dev-cast-tape-label::before,
.dev-cast-tape-label::after {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--print);
}

.dev-cast-body { padding: 0.45rem; }

.dev-cast-head,
.dev-cast-row {
  display: grid;
  grid-template-columns: var(--dev-col) 1fr 1.25rem;
  column-gap: var(--dev-gap);
  width: 100%;
  padding: 0.6rem var(--dev-pad);
  border: 1px solid transparent;
  border-radius: 0.4rem;
  background: transparent;
  text-align: left;
  font: inherit;
  font-family: var(--f-ui);
  color: inherit;
  cursor: pointer;
}

.dev-cast-head { align-items: center; padding-block: 0.5rem; }
.dev-cast-row { align-items: start; }

.dev-cast-head:hover,
.dev-cast-row:hover { background: var(--leaf-edge); border-color: var(--hair); }

.dev-cast-head-title { font-size: 0.85rem; font-weight: 700; color: var(--ink); }

@media (max-width: 32rem) { .dev-cast-head-sub { display: none; } }

.dev-cast-head-sub {
  min-width: 0;
  font-size: 0.78rem;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dev-cast-chevron { display: grid; place-items: center; color: var(--ink-3); }
.dev-cast-chevron svg { display: block; transition: transform 180ms ease; }
.dev-cast.is-collapsed .dev-cast-chevron svg { transform: rotate(180deg); }

/* 0fr to 1fr is the only way to transition to a content-determined height
 * without measuring it in JavaScript; the child needs min-height:0 to shrink. */
.dev-cast-panel {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 180ms ease, opacity 140ms ease, visibility 0s;
}

.dev-cast-panel > .dev-cast-table { min-height: 0; overflow: hidden; }

.dev-cast.is-collapsed .dev-cast-panel {
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 180ms ease, opacity 140ms ease, visibility 0s 180ms;
}

.dev-cast-table {
  display: grid;
  gap: 0.3rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--hair);
}

.dev-cast-who { display: grid; gap: 0.1rem; }
.dev-cast-name { font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.dev-cast-role { font-size: 0.72rem; color: var(--ink-3); letter-spacing: 0.02em; }
.dev-cast-blurb { font-size: 0.82rem; line-height: 1.45; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .dev-cast-panel,
  .dev-cast-chevron svg { transition: none; }
}

@media (max-width: 32rem) {
  .dev-cast-head,
  .dev-cast-row { grid-template-columns: 1fr 1.25rem; }
  .dev-cast-row { row-gap: 0.25rem; }
  .dev-cast-blurb { grid-column: 1 / -1; }
  .dev-cast-who {
    grid-auto-flow: column;
    justify-content: start;
    gap: 0.45rem;
    align-items: baseline;
  }
}

/* ——— the subject switch ———
 *
 * Math and language arts, on the browse surface. Underlined tabs rather than
 * the pill tabs in the masthead: those are the app's sections and this is a
 * filter inside one of them, so it must not read as a fourth section.
 *
 * Rendered only when more than one subject is stocked at the learner's grade.
 * A tab strip with one tab is a control that cannot do anything.
 */
.subject-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1.5rem;
  border-bottom: 1px solid var(--hair);
}

.subject-tab {
  padding: 0.55rem 0.95rem;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.subject-tab:hover { color: var(--print); }

.subject-tab.on {
  color: var(--print);
  /* The accent, not the red pencil: red on this page would say something was
   * wrong with the subject you are looking at. */
  border-bottom-color: var(--print);
}

/* The subject heading in the deck builder, where both trees are on one page
 * because a deck is allowed to mix them. */
.subject-head {
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  font-family: var(--f-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--print);
  border-bottom: 2px solid var(--hair);
}

.subject-head:first-of-type { margin-top: 1rem; }

/* Operator ledger (/admin/errors): a wide table scrolls inside its own box,
   the page never scrolls sideways; times and paths never wrap. */
.table-scroll { overflow-x: auto; }
.ledger { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.ledger th, .ledger td { text-align: left; vertical-align: top; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--hair); }
.ledger .nowrap { white-space: nowrap; }
.ledger pre { white-space: pre-wrap; font-size: 0.8rem; margin: 0.3rem 0 0; }

/* Legal pages: running prose at a reading measure, headings that group. */
/* ——— the legal pages ———
 *
 * Still a sheet, because they are part of the same product, but a page of
 * continuous prose is the one place the grid stops being a design decision
 * and starts being a reason to give up. The rules stay visible under a wash
 * and the printed margin comes off: there is no margin column here to print
 * one beside. */
.legal {
  max-width: 66ch;
  min-height: 0;
  padding: clamp(1.6rem, 4vw, 3rem) clamp(1.4rem, 3.5vw, 2.6rem);
  background-image:
    linear-gradient(var(--wash), var(--wash)),
    var(--ruled);
  font-family: var(--f-ui);
  font-variant-numeric: normal;
}

.legal h1 {
  margin: 0 0 0.6rem;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2rem, 1.5rem + 1.8vw, 2.6rem);
  letter-spacing: -0.028em;
  line-height: 1.05;
}

.legal .lede {
  margin: 0 0 2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--hair-hard);
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.6;
}

/* The date is its own sentence, so it gets its own line rather than
   breaking the lede mid-phrase on a phone (wrapcheck). */
.legal .lede .updated { display: block; }

.legal h2 {
  margin: 2.2rem 0 0.6rem;
  font-family: var(--f-print);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--print);
}

.legal p {
  margin: 0 0 0.9rem;
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--ink);
  text-wrap: pretty;
}

/* ——— the error ledger ———
 *
 * A table, not paperwork. The paper and the printed margin come off: a grid
 * behind a grid of rows is two grids fighting, and a rule down the middle of
 * a When column is just wrong. */
.sheet:not(:has(> .topic)):not(.legal) {
  min-height: 0;
  /* 100%, never none. A sheet carries `margin: 0 auto`, and an auto inline
   * margin makes a grid item size to fit its content: with no max-width the
   * ledger's widest row set the sheet's width and the page scrolled sideways
   * at 390. Same trap that made the practice sheet 654px in a 795px column. */
  max-width: 100%;
  background: var(--leaf);
  background-image: none;
  font-family: var(--f-ui);
  font-variant-numeric: normal;
}

.sheet:not(:has(> .topic)):not(.legal) h1 {
  margin: 0 0 0.5rem;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  letter-spacing: -0.024em;
}

.ledger th {
  font-family: var(--f-print);
  font-size: 0.81rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--print);
}

.ledger td.nowrap { font-family: var(--f-print); font-size: 0.9rem; }
.legal h2 { margin: 1.6rem 0 0.4rem; font-size: 1.1rem; }
.legal p { margin: 0 0 0.75rem; }
.foot-meta a { color: inherit; }

/* A phrase kept whole, so a line breaks where the copy chose (wrapcheck). */
.u { white-space: nowrap; }

/* ——— the desk, and the two things it puts on a learner's page ——————————
 *
 * The desk is Derick reading the content and saying it is right. Its pages
 * are the app's own paper: no second visual language for an admin area,
 * because an admin area that looks like a different product is a place you
 * forget to look after.
 */

.desk-tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem 2rem;
  margin: 1.5rem 0 2rem;
  padding: 0 0 1.2rem;
  border-bottom: 1px solid var(--hair);
}

.desk-tally div { margin: 0; }
.desk-tally dt {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.7rem;
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--print);
}
.desk-tally dd { margin: 0; font-size: 0.92rem; color: var(--ink-3); }

/* `pretty` because this note runs two or three lines and left one word
   alone on the last one at 440. */
.desk-note { margin: 0 0 1rem; font-size: 0.95rem; color: var(--ink-3); max-width: var(--measure); text-wrap: pretty; }

.desk-list, .desk-queue { margin: 0 0 2rem; padding: 0; list-style: none; }
.desk-queue { counter-reset: queue; }
.desk-list > li, .desk-queue > li {
  padding: 0.9rem 0;
  border-top: 1px solid var(--hair);
}
.desk-queue > li { counter-increment: queue; }

.desk-who, .desk-skill, .desk-step-id {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.desk-said { margin: 0 0 0.3rem; max-width: var(--measure); }
/* `pretty`, the same as the learner's own `.stem`: `balance` evens the
   line lengths and will split a phrase to do it, which is what a question
   can least afford. */
.desk-stem { margin: 0; max-width: var(--measure); text-wrap: pretty; }
.desk-reply { margin: 0.3rem 0 0; color: var(--print); max-width: var(--measure); }
.desk-crumb { margin: 0 0 1.2rem; font-size: 0.9rem; color: var(--ink-3); }
.desk-warn { color: var(--ink); font-weight: 700; }
/* A desk warning paragraph is a notice, not a wrong answer: the ink, bold,
 * inside a hair rule. */
p.desk-warn { padding: 0.6rem 0.8rem; border: 1px solid var(--hair-hard); border-radius: 0.25rem; background: var(--leaf); }

/* The boxes. They save themselves, so they look like the text they hold
 * rather than like a form: the border is there to say where the box ends. */
.desk-h { margin: 1.6rem 0 0.4rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-wrap: balance; color: var(--ink-3); }
.desk-edit textarea {
  display: block;
  width: 100%;
  max-width: var(--measure);
  padding: 0.6rem 0.75rem;
  font: inherit;
  line-height: 1.55;
  color: var(--ink);
  background: var(--leaf);
  border: 1px solid var(--hair);
  border-radius: 3px;
  resize: vertical;
}
.desk-edit textarea:focus { outline: 2px solid var(--print); outline-offset: 1px; border-color: transparent; }

.desk-step { margin: 1.2rem 0; padding: 0.9rem 0 0; border-top: 1px solid var(--hair); }
.desk-step textarea + textarea { margin-top: 0.4rem; }

.desk-pool { margin: 0.4rem 0 0; max-width: var(--measure); }
.desk-pool div { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 0.2rem 1rem; padding: 0.35rem 0; border-top: 1px solid var(--hair); }

/* On a phone the two columns leave the box about four characters wide and
   the reason breaks a letter at a time ("answe / red / with"). The option
   goes above its reason instead. */
@media (max-width: 44rem) {
  .desk-pool div { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
}
.desk-pool dt { margin: 0; font-weight: 600; }
.desk-pool dt.is-answer { color: var(--print); }
.desk-pool dd { margin: 0; font-size: 0.95rem; color: var(--ink-3); }

.desk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 1.8rem 0 0; }

/* The one line that says whether a save happened, kept on screen. The boxes
 * run down a long page and a save that says nothing reads exactly like a
 * save that failed. */
.desk-actions.is-sticky {
  position: sticky;
  bottom: 0;
  z-index: 40;
  padding: 0.7rem 0;
  background: color-mix(in srgb, var(--cover-pale) 92%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--hair);
}
.desk-state { margin: 0; font-size: 0.92rem; color: var(--ink-3); }

.desk-report { padding: 0.9rem 0; border-top: 1px solid var(--hair); }
.desk-answer { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.6rem; }
.desk-answer input[type="text"] { flex: 1 1 16rem; min-width: 0; padding: 0.5rem 0.7rem; font: inherit; border: 1px solid var(--hair); border-radius: 3px; background: var(--leaf); }

.desk-link { margin: 0.4rem 0 0; font-size: 0.88rem; }

/* On a learner's own page: what Derick has said, and how to say it back.
 * Both are quiet. A worksheet does not wear a badge. */
.checked {
  margin: 1.2rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-3);
}
.checked.is-checked { color: var(--print); }
.checked-mark { font-weight: 700; }

.report { margin: 0.4rem 0 0; }
.report-mine { margin: 0 0 0.3rem; font-size: 0.85rem; color: var(--ink-3); }
.report-reply { margin: 0 0 0.3rem; font-size: 0.85rem; color: var(--print); }
.report-open {
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink-3);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.report-open:hover { color: var(--print); }
.report-form { display: grid; gap: 0.5rem; max-width: 34rem; margin-top: 0.6rem; }
.report-form label { font-size: 0.85rem; color: var(--ink-3); }
.report-form textarea { padding: 0.6rem 0.7rem; font: inherit; border: 1px solid var(--hair); border-radius: 3px; background: var(--leaf); resize: vertical; }
.report-form input[type="submit"] { justify-self: start; }

/* A shared passage, shown and not edited. Pre, because the blank line
 * between paragraphs is the only markup a passage has. */
.desk-passage {
  max-width: var(--measure);
  margin: 0;
  padding: 0.6rem 0.75rem;
  font: inherit;
  line-height: 1.55;
  white-space: pre-wrap;
  background: var(--leaf);
  border: 1px solid var(--hair);
  border-radius: 3px;
}

/* ——— the desk's own sheet ———
 *
 * The question as a learner meets it, with every piece of prose on it a box.
 * Derick, 2026-10-27: "If that's what I'm vetting is the question, it should
 * look like the question, and then I should be able to edit in place anything
 * that I see there."
 *
 * So the box is not a box. It inherits the font, the size and the color of
 * the thing it replaces and carries one dotted line underneath to say it can
 * be typed in. The old page's bordered grey textareas under uppercase labels
 * were a form about a question rather than the question. */
/* ⚠ width, because .sheet centers itself with `margin: 0 auto` and an auto
 * margin on a grid item turns off the default stretch: the sheet then takes
 * its fit-content width. On the practice page it is inside .practice-layout
 * and fills it; here it is a grid item, and a question whose options are "1",
 * "2", "3" and "4" shrank the paper to 535px and broke the stem across two
 * lines. The paper is a leaf of paper whatever is written on it. */
.desk-sheet { width: 100%; }

.desk-how { max-width: var(--measure); margin: 0 0 1.6rem; }
.desk-how ul { margin: 0; padding-left: 1.1rem; }
.desk-how li {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-3);
}

.desk-sheet .ink {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 0 0.1rem;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--hair-hard);
  border-radius: 0;
  /* Sized to its own text by the desk controller, so a stem never scrolls
   * inside a box three lines tall. resize is off for the same reason: the
   * height is the text's, not a thing to drag. */
  resize: none;
  overflow: hidden;
}
.desk-sheet .ink:hover { border-bottom-color: var(--print); }
.desk-sheet .ink:focus {
  outline: 0;
  border-bottom: 1px solid var(--print);
  background: var(--print-wash);
}

/* What the learner actually reads, when the box cannot show it: a template's
 * numbers, a stacked fraction, an exponent. */
.desk-as-read {
  max-width: var(--measure);
  margin: 0.3rem 0 1rem;
  font-size: 0.95rem;
  color: var(--ink-3);
}
.desk-as-read-label {
  margin-right: 0.4rem;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The options, each carrying the reason it is wrong. The list is the
 * learner's list; the reason is the desk's. */
/* The options a learner is shown, lettered the way they are on the sheet,
 * each with the reason it is wrong written under it. One list and not two:
 * a page that prints the options at the top and again at the bottom beside
 * their reasons is a page where the two can disagree.
 *
 * Deliberately not the .options class. Those rules letter a <label>, and the
 * only label here is the reason box, so reusing them put the A, B, C on the
 * reasons and left the options unlettered. */
.desk-options {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  counter-reset: opt;
}
.desk-options li { counter-increment: opt; margin: 0 0 0.6rem; }
.desk-options .opt-row {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  margin: 0;
  padding: 0.6rem 0.95rem;
  font-size: 1.04rem;
  line-height: 1.45;
  text-wrap: pretty;
  background: var(--wash);
  border: 1px solid var(--hair);
  border-radius: 3px;
}
.desk-options .opt-row::before {
  content: counter(opt, upper-alpha);
  display: grid;
  place-items: center;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  align-self: center;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--ink-3);
  border: 1.5px solid var(--hair-hard);
  border-radius: 50%;
  background: var(--leaf);
}
.desk-options .opt { flex: 1; min-width: 0; }
.desk-options .opt-absent { color: var(--ink-3); font-style: italic; }
.desk-options .is-answer .opt-row { border-color: var(--correct); }
.desk-options .is-answer .opt-row::before { border-color: var(--correct); color: var(--correct); }
.desk-options .opt-tag {
  flex: none;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--correct);
}
/* The reason hangs under its option, lined up with the option's text rather
 * than with its bubble: 1.6rem of bubble and 0.8rem of gap, plus the row's
 * own padding. */
.desk-options .opt-why {
  display: block;
  margin: 0.35rem 0 0;
  padding-left: calc(1.6rem + 0.8rem + 0.95rem);
}
.desk-options .opt-why-label {
  display: block;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.desk-options .opt-why .ink { font-size: 0.95rem; color: var(--ink-3); }
@media (max-width: 34rem) {
  .desk-options .opt-why { padding-left: 0; }
}

.desk-written-answer { max-width: var(--measure); }

/* Everything below the sheet: what they read after a miss, the facts about
 * this one, what has been reported. */
.desk-block { margin: 2rem 0 0; }
.desk-miss { max-width: var(--measure); }
.desk-miss-lead { margin: 0 0 0.6rem; font-size: 1.05rem; }
.desk-miss-full { margin: 0 0 0.6rem; }
.desk-block .ink {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 0 0.1rem;
  font: inherit;
  color: inherit;
  line-height: 1.55;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--hair-hard);
  border-radius: 0;
  resize: none;
  overflow: hidden;
}
.desk-block .ink:hover { border-bottom-color: var(--print); }
.desk-block .ink:focus {
  outline: 0;
  border-bottom: 1px solid var(--print);
  background: var(--print-wash);
}

.desk-facts { margin: 0; max-width: var(--measure); }
.desk-facts div {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  gap: 0.2rem 1rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--hair);
}
.desk-facts dt {
  margin: 0;
  font-family: var(--f-print);
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  align-self: center;
}
.desk-facts dd { margin: 0; }
@media (max-width: 44rem) {
  .desk-facts div { grid-template-columns: minmax(0, 1fr); }
}

.desk-aside {
  max-width: var(--measure);
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-3);
}
.desk-aside code { word-break: break-all; }

/* ——— every small capital label is printed ———
 *
 * Round three sets every kicker, field and margin label in the cover's
 * condensed grotesque. These few were set in the chrome's sans in capitals
 * (the plan names, the plan facts, the BEST VALUE tag, a charge's kind, the
 * desk's labels, a sorting pile's name), which put two label voices on one
 * page: MONTHLY in Instrument Sans beside ACCOUNT in Barlow. */
.plan-name, .plan-facts dt, .plan-tag, .charge-kind,
.desk-who, .desk-skill, .desk-step-id, .desk-h,
.bin-name, .pair-bin, .misconception-label {
  font-family: var(--f-print);
  font-weight: 600;
  letter-spacing: 0.12em;
}
.plan-name, .plan-facts dt, .charge-kind, .desk-who, .desk-skill, .desk-step-id, .desk-h { font-size: 0.82rem; }
.plan-tag, .misconception-label { font-size: 0.8rem; }
.bin-name, .pair-bin { font-size: 0.9rem; }

/* A table of contents straight under a panel's rule starts on that rule: its
 * own top border drew a second line 20px under the first. */
.pick-head + .domain-grid > li:first-child { border-top: 0; padding-top: 0.2rem; }

/* The plan's one-line state is short copy: balanced, not left to strand
 * "buy." alone at 390 (wrapcheck). */
.plan-state { text-wrap: balance; }
