/* ============================================================
   Learning Curve — base stylesheet (legacy components, prose, widgets, practice).
   ALL colour tokens live in ui.css (one :root block; the café palettes are in themes.css),
   which also re-points every token this file reads (--bg, --ink, --line, --accent ...).
   This :root keeps only the font stacks.
   ============================================================ */
:root {
  /* UI and body */
  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* labels, chips, numbers (a wide display mono) */
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* code only: system mono, no download, narrower, better for reading code */
  --code: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
  /* maths only (var, .m): a system serif, no download (course text has no maths markup today) */
  --serif: Georgia, "Times New Roman", serif;
}
/* index.html <noscript>: a class, not a style attribute, because the CSP has no 'unsafe-inline' for styles */
.noscript-msg { padding: 2rem; font-family: var(--sans); }

/* ============ base ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Settings > Motion > Reduced (<html data-motion="reduced">, theme.js / app.js applyTheme()) does
   exactly what the device setting does, for a learner who cannot change that setting */
:root[data-motion="reduced"] { scroll-behavior: auto; }
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { animation: none !important; transition: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--c-go-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
/* focus rings, the shell (topbar, rail, tab bar, page) and the keys live in ui.css */

/* Everything below is Chunky Play: cards with a 2.5px --c-line edge and a hard --c-slab
   shadow, labels in uppercase Space Mono, code on the --c-code-* slate. Colours come only
   from ui.css tokens (every palette falls out of the same rules). Nothing under 12px. The lesson
   player, exercise, match step, Practice, sessions and exam live in ui-learn.css. */

/* the Drill's "How review works" copy (tools/verify_schedule.js reads .mod-goal) */
.mod-goal { font: 400 15px/1.55 var(--sans); color: var(--c-ink-2); max-width: 62ch; margin: 0 0 8px; }

/* ============ lesson content: .prose (read steps, lessons, exercise instructions) ============ */
.prose { max-width: none; }
/* long lesson prose: 17px / 1.62 at about 68ch (Settings' cards also carry .prose, so the
   reading size is scoped to lesson content) */
.step-content > .prose, .lesson-body, .topic-lesson { font-size: var(--fs-prose); line-height: 1.62; color: var(--c-ink); }
.prose p, .prose ul, .prose ol, .prose h2, .prose h3, .prose blockquote,
.prose .callout, .prose .keyterms { max-width: 68ch; }
/* The lesson's reading measure, set in the prose size rather than ch: Bricolage's "0" is wide,
   so 68ch came to 750px at 17px, about 90-100 characters a line. 35 x 17px = 595px holds about
   70-75, a comfortable line. Headings share the same right edge (a px measure, not their own
   em). Only the text blocks are capped; widgets, code and tables keep the full player width. */
.step-content > .prose > :is(p, ul, ol, h2, h3, blockquote, .callout, .keyterms) {
  max-width: min(68ch, calc(var(--fs-prose) * 35));
}
.prose p { margin: 0 0 1.1em; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  font: 800 var(--fs-title)/1.15 var(--sans); letter-spacing: -.015em; color: var(--c-ink);
  margin: 1.6em 0 .5em; text-wrap: balance;
}
.prose h3 { font: 800 var(--fs-h3)/1.25 var(--sans); letter-spacing: -.01em; color: var(--c-ink); margin: 1.5em 0 .45em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--c-ink); }
.prose strong { font-weight: 700; color: var(--c-ink); }
/* text links only: Settings cards carry .prose too, and their link-keys (a.btn) keep the key look */
.prose a:not(.btn):not(.ui-btn):not(.link-btn) { color: var(--c-go-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose code {
  font-family: var(--code); font-size: .9em; color: var(--c-ink);
  background: var(--c-recess); border: 1.5px solid var(--c-line-soft); border-radius: 6px; padding: .06em .35em;
}
/* the code slate: lesson listings, project starters, the widget code card, exercise output */
.prose pre, pre.starter, .codecard {
  background: var(--c-code-bg); color: var(--c-code-ink);
  border: var(--c-bw) solid var(--c-line); border-radius: var(--c-r-md); box-shadow: var(--c-sh);
  padding: 14px 16px; font: 400 13.5px/1.6 var(--code); overflow-x: auto; max-width: 100%;
  margin: 0 0 1.3em; tab-size: 4;
}
.prose pre code, pre.starter code { background: none; border: 0; padding: 0; font: inherit; color: inherit; }
pre .kw { color: var(--c-code-kw); }
pre .cm { color: var(--c-code-cm); }
pre .st { color: var(--c-code-st); }     /* scoped to pre: never the .st status chip */
.prose blockquote {
  margin: 1.4em 0; padding: 12px 16px; background: var(--c-recess); color: var(--c-ink);
  border: var(--c-bw-sm) solid var(--c-line); border-radius: 14px; font-style: normal;
}
.prose table {
  display: block; overflow-x: auto; max-width: 100%; margin: 0 0 1.3em;
  border: var(--c-bw) solid var(--c-line); border-radius: 12px; border-collapse: separate; border-spacing: 0;
  background: var(--c-card); font-size: 14.5px; line-height: 1.45;
}
.prose th, .prose td {
  padding: 8px 12px; text-align: left; vertical-align: top; border: 0;
  border-top: 1.5px solid var(--c-line-soft); border-left: 1.5px solid var(--c-line-soft);
}
.prose tr:first-child > th, .prose tr:first-child > td { border-top: 0; }
.prose th:first-child, .prose td:first-child { border-left: 0; }
.prose th { background: var(--c-recess); font: 700 12px/1.35 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--c-ink); }
/* columns keep a readable width and the table scrolls sideways instead of crushing them;
   the right-edge shade (a scroll-attached shadow covered by a content-attached card patch)
   shows only while there is more to the right */
.prose td, .prose th { min-width: 9em; }
.prose table {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0), var(--c-card) 70%) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0)) right / 12px 100% no-repeat scroll,
    var(--c-card);
}
.table-scroll { overflow-x: auto; max-width: 100%; }
.prose img, .prose figure img { max-width: 100%; height: auto; border: var(--c-bw) solid var(--c-line); border-radius: 14px; }
.prose figure { margin: 1.4em 0; }

/* callout: a raised card; its label is an ink tag sticker (no coloured stripe) */
.callout {
  background: var(--c-raised); color: var(--c-ink); border: var(--c-bw) solid var(--c-line);
  border-radius: var(--c-r-md); box-shadow: var(--c-sh-sm); padding: 14px 16px; margin: 0 0 1.3em;
  font-size: 16px; line-height: 1.55;
}
.callout > :last-child { margin-bottom: 0; }
/* the ink tag look, shared by callout labels and widget / project labels. Block-level so the
   text after a callout label (often a bare text node) starts on the next line. */
.callout-label, .widget-label, .build-label {
  display: block; width: -moz-fit-content; width: fit-content; margin: 0 0 8px;
  font: 700 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  background: var(--c-fill); color: var(--c-on-fill); border-radius: 6px; padding: 2px 8px 3px;
  transform: rotate(-2deg);
}

/* key terms: a bordered list; the term on a recess strip */
.keyterms {
  margin: 1.4em 0; display: grid; gap: 0; overflow: hidden; background: var(--c-card);
  border: var(--c-bw) solid var(--c-line); border-radius: 14px;
}
/* minmax(0, ...) so a row gives way instead of overflowing .keyterms, which clips (overflow:
   hidden, for its rounded corners) and would silently cut definition text off */
.keyterm { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); }
.keyterm + .keyterm { border-top: 1.5px solid var(--c-line-soft); }
.keyterm dt { font: 700 13px/1.4 var(--mono); color: var(--c-ink); padding: 11px 14px; margin: 0; background: var(--c-recess); }
.keyterm dd { margin: 0; padding: 11px 14px; font: 400 15px/1.5 var(--sans); color: var(--c-ink-2); }
@media (max-width: 620px) { .keyterm { grid-template-columns: minmax(0, 1fr); } .keyterm dt { padding-bottom: 7px; } }

/* self-check blocks are stripped from lessons today (app.js buildSteps); kept styled in case */
details.selfcheck {
  margin: 1.4em 0; max-width: 68ch; padding: 12px 16px; background: var(--c-recess);
  border: var(--c-bw-sm) solid var(--c-line); border-radius: 14px;
}
details.selfcheck summary {
  cursor: pointer; min-height: 32px; display: flex; align-items: center;
  font: 700 12px/1.25 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink);
}
details.selfcheck p { margin: .6em 0 .2em; font-size: 15px; }

/* ============ widget card (interactive diagrams) ============ */
.widget {
  background: var(--c-card); border: var(--c-bw) solid var(--c-line); border-radius: var(--c-r);
  box-shadow: var(--c-sh); margin: 1.6em 0; overflow: hidden;
}
.widget-head { padding: 14px 16px 0; }
.widget-head:empty { display: none; }
.widget-title { font: 800 18px/1.2 var(--sans); letter-spacing: -.01em; color: var(--c-ink); margin: 2px 0 4px; }
.widget-sub { font: 400 14px/1.45 var(--sans); color: var(--c-ink-2); margin: 0 0 6px; max-width: 68ch; }
.widget-body { padding: 12px 16px 16px; }
/* inside a lesson the widget sits in .prose: keep .prose p margins off its own paragraphs */
.widget p.widget-sub { margin: 0 0 6px; }
.widget p.scene-cap { margin: 14px 0 0; }
@media (min-width: 900px) {
  .widget-head { padding: 18px 22px 0; }
  .widget-body { padding: 14px 22px 20px; }
}
/* the canvas frame is a ring, not a border, so the drawing keeps its exact pixel size */
.widget canvas, .scene canvas {
  display: block; width: 100%; border-radius: 12px; background: var(--chart-surface);
  box-shadow: 0 0 0 var(--c-bw-sm) var(--c-line);
}
.controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 14px; }
.control { display: flex; align-items: center; gap: 9px; font: 400 12.5px/1.3 var(--mono); color: var(--c-ink-2); flex-wrap: wrap; }
.control label { white-space: nowrap; }
.control output { color: var(--c-ink); font-weight: 700; min-width: 3.5ch; font-variant-numeric: tabular-nums; }
/* sliders in the chunky language: a recess track with a 2px edge, the travelled part filled in
   ink, and a raised key-style thumb. The native control glared near-white on
   cream cards, and its blue fill borrowed the main-action colour. Firefox fills the travelled part
   itself (::-moz-range-progress); Chrome and WebKit have no such part, so their track is a
   gradient that stops at --fill (0..1), which app.js sets on the input (rangeFill). The stop is
   the thumb's centre: half the 22px thumb in from each end of the track. */
/* The input box is 44px tall (the project's minimum touch target: a press anywhere on it moves
   the thumb there); the -6px margins keep its layout footprint at the old 32px, so rows of
   controls sit exactly where they did. The track and thumb are centred in the box. */
.control input[type=range] {
  -webkit-appearance: none; appearance: none; width: 130px; height: 44px; margin: -6px 0; padding: 0;
  background: transparent; cursor: pointer; accent-color: var(--c-fill);
}
.control input[type=range]::-webkit-slider-runnable-track {
  height: 12px; border: var(--c-bw-sm) solid var(--c-line); border-radius: 6px;
  background: linear-gradient(to right, var(--c-fill) 0 calc(11px + (100% - 22px) * var(--fill, 0)),
    var(--c-recess) calc(11px + (100% - 22px) * var(--fill, 0)));
}
.control input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -7px;
  background: var(--c-raised); border: var(--c-bw-sm) solid var(--c-line); border-radius: 7px; box-shadow: 0 2px 0 var(--c-slab);
}
.control input[type=range]::-moz-range-track {
  height: 8px; background: var(--c-recess); border: var(--c-bw-sm) solid var(--c-line); border-radius: 6px;
}
.control input[type=range]::-moz-range-progress { height: 8px; background: var(--c-fill); border-radius: 6px 0 0 6px; }
.control input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; background: var(--c-raised); border: var(--c-bw-sm) solid var(--c-line);
  border-radius: 7px; box-shadow: 0 2px 0 var(--c-slab);
}
.control input[type=range]:focus-visible { outline-offset: 4px; border-radius: 8px; }
/* a widget's text box (the BPE corpus): an input in the chunky look, 16px on phones (no iOS zoom) */
.widget textarea {
  display: block; width: 100%; min-height: 72px; padding: 10px 12px; resize: vertical;
  background: var(--c-raised); color: var(--c-ink); border: var(--c-bw) solid var(--c-line);
  border-radius: var(--c-r-key); box-shadow: inset 0 3px 0 var(--c-recess); font: 400 16px/1.5 var(--code);
}
@media (min-width: 900px) { .widget textarea { font-size: 14px; } }
.control code { font-family: var(--code); }
/* a widget's secondary buttons (btn-ghost in widget code) are SECONDARY keys here, not text links */
.widget .btn.btn-ghost, .scene-nav .btn.btn-ghost {
  background: var(--c-raised); color: var(--c-ink); border-color: var(--c-line); box-shadow: var(--c-sh-key); text-decoration: none;
}
@media (hover: hover) {
  .widget .btn.btn-ghost:hover:not(:disabled), .scene-nav .btn.btn-ghost:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 var(--c-slab); }
}
.widget .btn.btn-ghost:active:not(:disabled), .scene-nav .btn.btn-ghost:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-slab); }
.widget .btn.btn-ghost:disabled, .scene-nav .btn.btn-ghost:disabled {
  background: var(--c-dis-bg); border-color: var(--c-dis-line); color: var(--c-dis-ink); box-shadow: none; transform: none;
}
/* a widget's own main key (btn-primary in widget code) is an INK key: still the strongest key
   inside the diagram, but go-blue stays with the lesson footer's Next, the one main action */
.widget .btn.btn-primary:not(:disabled), .scene-nav .btn.btn-primary:not(:disabled) {
  background: var(--c-fill); color: var(--c-on-fill); border-color: var(--c-line);
}
/* readouts are sentences: UI sans at a readable size; the numbers inside stay mono */
.readout {
  font: 400 14px/1.55 var(--sans); color: var(--c-ink-2); margin-top: 12px; font-variant-numeric: tabular-nums;
}
.readout b { font-family: var(--mono); font-size: 13px; color: var(--c-ink); font-weight: 700; }
.readout code { font-family: var(--code); }
/* series text is ink, marked by a swatch: series-2 as small text is only 3.3:1 */
.readout .r1, .readout .r2, .readout .r3 { color: var(--c-ink); font-weight: 700; }
.readout .r1::before, .readout .r2::before, .readout .r3::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px;
  border: 1.5px solid var(--c-line); border-radius: 3px; background: var(--series-1);
}
.readout .r2::before { background: var(--series-2); }
.readout .r3::before { background: var(--good); }

/* ---- interactive DOM widgets ---- */
.codecard { white-space: pre; }
.attn-sentence { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.attn-word {
  min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; cursor: pointer;
  font: 400 14.5px/1.2 var(--mono); color: var(--c-ink); background: var(--c-raised);
  border: var(--c-bw-sm) solid var(--c-line); border-radius: 8px; box-shadow: 0 2px 0 var(--c-slab);
}
.attn-word:active { transform: translateY(2px); box-shadow: none; }
.attn-word.focus { background: var(--c-fill); color: var(--c-on-fill); font-weight: 700; }
.bars { display: grid; gap: 8px; margin-top: 12px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 56px; gap: 10px; align-items: center; font: 400 12.5px/1.3 var(--mono); color: var(--c-ink); }
.bar-row .bar-track { height: 14px; border: var(--c-bw-sm) solid var(--c-line); border-radius: 6px; background: var(--c-recess); overflow: hidden; }
.bar-row .bar-fill { display: block; height: 100%; background: var(--series-1); transition: width .25s ease; }   /* a span: without block it never showed */
.bar-row .bar-val { text-align: right; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }

/* plain tables a widget builds (the Shapley orderings): the same spacing in a lesson and in a play step */
.widget-body table:not(.dirty-table) { border-collapse: collapse; font-size: 12.5px; }
.widget-body table:not(.dirty-table) th, .widget-body table:not(.dirty-table) td { padding: 5px 12px 5px 0; text-align: left; border: 0; background: none; }
.widget-body table:not(.dirty-table) th { font: 700 12px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--c-ink); }
.dirty-table {
  width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden;
  border: var(--c-bw) solid var(--c-line); border-radius: 12px; background: var(--c-card);
  font: 400 13px/1.4 var(--code); color: var(--c-ink);
}
.dirty-table td { white-space: nowrap; }
/* inside its scroller the FRAME belongs to the scroller, so a table wider than the phone keeps
   its right edge and corners (they used to be cut off at the scroll edge) */
.table-scroll:has(> .dirty-table) { border: var(--c-bw) solid var(--c-line); border-radius: 12px; background: var(--c-card); }
.table-scroll > .dirty-table { border: 0; border-radius: 0; width: max-content; min-width: 100%; }
.dirty-table th, .dirty-table td {
  padding: 8px 10px; text-align: left; border: 0;
  border-top: 1.5px solid var(--c-line-soft); border-left: 1.5px solid var(--c-line-soft);
}
.dirty-table tr:first-child > th, .dirty-table tr:first-child > td { border-top: 0; }
.dirty-table th:first-child, .dirty-table td:first-child { border-left: 0; }
.dirty-table th { background: var(--c-recess); font: 700 12px/1.35 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.dirty-table td { cursor: pointer; }
.dirty-table td:hover { box-shadow: inset 0 0 0 2px var(--c-line); }
.dirty-table td.found { background: var(--c-ok-wash); color: var(--c-ok-ink); font-weight: 700; cursor: default; }
.dirty-table td.miss { background: var(--c-bad-wash); }

.agent-log { display: grid; gap: 8px; margin-top: 12px; }
.agent-msg {
  padding: 10px 14px; font: 400 14px/1.45 var(--sans); color: var(--c-ink);
  background: var(--c-raised); border: var(--c-bw-sm) solid var(--c-line); border-radius: 12px;
  border-left-width: 5px; border-left-color: var(--c-line);
}
.agent-msg .agent-role {
  display: block; margin-bottom: 3px; font: 700 12px/1.3 var(--mono); letter-spacing: .06em;
  text-transform: uppercase; color: var(--c-muted);
}
.agent-msg.role-model { border-left-color: var(--series-1); }
.agent-msg.role-tool { border-left-color: var(--series-2); font: 400 13px/1.45 var(--code); }
.agent-msg.role-user { border-left-color: var(--c-line); }

/* a segmented control (the Settings .seg look): recess track, the chosen option filled */
.pill-toggle {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; max-width: 100%;
  background: var(--c-recess); border: var(--c-bw) solid var(--c-line); border-radius: 14px;
  box-shadow: inset 2px 2px 0 var(--c-inset);
}
.pill-toggle button {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--c-ink); font: 700 13px/1.1 var(--mono);
}
.pill-toggle button.on { background: var(--c-fill); color: var(--c-on-fill); box-shadow: 0 2px 0 var(--c-slab); }

.cost-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 6px; }
.cost-field label { display: block; margin-bottom: 5px; font: 700 12px/1.3 var(--mono); letter-spacing: .05em; color: var(--c-muted); }
.cost-field input, .cost-field select { width: 100%; }
.cost-out { margin-top: 16px; display: flex; gap: 14px 26px; flex-wrap: wrap; }
.cost-stat .cost-stat-label { font: 700 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); }
.cost-stat .cost-stat-val { font: 700 24px/1.2 var(--mono); color: var(--c-ink); font-variant-numeric: tabular-nums; }

/* ---- scene: a pinned visual with stepped captions (LC.scene) ----
   The caption sits in a fixed-height box so that advancing a step moves the drawing and
   nothing else — a caption that grows and shoves the canvas up defeats the whole device. */
.scene { margin: 6px 0 10px; }
.scene-cap { font: 400 15px/1.55 var(--sans); color: var(--c-ink); margin: 14px 0 0; min-height: 5.2em; max-width: 72ch; }
.scene-nav { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.scene-dots { display: flex; flex-wrap: wrap; gap: 0; flex: 1 1 auto; justify-content: center; }
/* a 44px hit target that draws a 12px rounded square */
.scene-dot {
  position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.scene-dot::before {
  content: ""; width: 12px; height: 12px; border-radius: 4px;
  border: var(--c-bw-sm) solid var(--c-line); background: var(--c-raised);
}
.scene-dot.on::before { background: var(--c-fill); }
@media (max-width: 480px) {
  .scene-cap { min-height: 7em; font-size: 14.5px; }
  .scene-nav .btn { flex: 1 1 auto; }
  .scene-dots { order: -1; width: 100%; flex: 0 0 auto; }
}

/* ============ question card (checkpoint, sessions, exam) ============ */
.quiz {
  background: var(--c-card); border: var(--c-bw) solid var(--c-line); border-radius: var(--c-r);
  box-shadow: var(--c-sh); padding: 16px; margin: 0;
}
@media (min-width: 900px) { .quiz { padding: 20px; } }
.quiz-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.quiz-head h2 { font: 800 16px/1.25 var(--sans); letter-spacing: -.01em; color: var(--c-ink); margin: 0; }
.quiz-score { margin-left: auto; flex: none; font-variant-numeric: tabular-nums; }
.quiz-sub { font: 400 14px/1.45 var(--sans); color: var(--c-ink-2); margin: 0 0 14px; }
/* the checkpoint's result strip */
.quiz-result {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px;
  background: var(--c-recess); border: var(--c-bw-sm) solid var(--c-line); border-radius: 12px;
}
.quiz-result .ui-icon { width: 34px; height: 34px; border-radius: 10px; }
.quiz-result .ui-icon svg { width: 20px; height: 20px; }
.quiz-result-text { font: 700 15px/1.35 var(--sans); color: var(--c-ink); }

/* ============ resources (the optional last step) ============ */
.resources { margin: 0; }
.resources .res-sub { font: 400 14.5px/1.5 var(--sans); color: var(--c-ink-2); margin: 0 0 14px; max-width: 68ch; }
.res-list { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.res-item {
  display: flex; gap: 4px 10px; align-items: center; flex-wrap: wrap; min-height: 44px;
  padding: 10px 14px; background: var(--c-raised); color: var(--c-ink);
  border: var(--c-bw-sm) solid var(--c-line); border-radius: 12px; font-size: 15px;
}
.res-item a { font-weight: 700; color: var(--c-go-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.res-item .res-note { color: var(--c-ink-2); font-size: 14px; }
.res-item .res-free { margin-left: auto; }

/* ============ progress backup status (Settings) ============ */
.backup-state { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }
.backup-msg { min-height: 1.2em; font-size: 14px; margin: 6px 0 0 !important; }
.backup-msg.ok { color: var(--c-ok-ink); }
.backup-msg.bad { color: var(--c-bad); }

/* ============ projects ladder (the Build Things overview) ============ */
.proj-group { margin: 1.6em 0; }
.proj-group h3 { font: 800 17px/1.25 var(--sans); letter-spacing: -.01em; color: var(--c-ink); margin: 0 0 .6em; }
.proj-list { display: grid; gap: 10px; }
.proj-list .proj-item { align-items: flex-start; }
.proj-list .proj-item input[type="checkbox"] { margin-top: 1px; }
.proj-item .proj-name { font-weight: 700; font-size: 15px; }
.proj-item .proj-desc { font-size: 14px; color: var(--c-ink-2); }
.proj-item.checked .proj-name { text-decoration: line-through; }
.proj-item.checked .proj-desc { color: var(--c-muted); }

/* ============ guided project card ("Build it") ============ */
.build-needs { margin: 8px 0 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.milestones { margin: 12px 0 16px; padding-left: 0; counter-reset: ms; list-style: none; display: grid; gap: 8px; }
.milestone { counter-increment: ms; }
.milestones .milestone label { align-items: flex-start; gap: 10px; }
.milestone label::before { content: counter(ms); flex: none; min-width: 14px; font: 700 12px/22px var(--mono); color: var(--c-muted); }
.milestone label > span { padding-top: 1px; }
.milestone.checked span { text-decoration: line-through; }
pre.starter { margin: 12px 0 6px; }
.build-h { font: 800 16px/1.3 var(--sans); color: var(--c-ink); margin: 18px 0 8px; }
.build-checks { margin: 0 0 8px; padding-left: 1.3em; font-size: 14.5px; line-height: 1.5; color: var(--c-ink-2); }
.build-checks li { margin-bottom: .35em; }
.build-checks li::marker { color: var(--c-ink); }   /* criteria to meet, not done: ink, not green */
.widget.build details { margin-top: 10px; }
.widget.build summary {
  display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; list-style: none;
  font: 700 14px/1.3 var(--sans); color: var(--c-ink);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.widget.build summary::-webkit-details-marker { display: none; }
/* flex hid the native marker: a chevron says it opens (points down once open) */
.widget.build summary::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 0 3px;
  border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(-45deg);
}
.widget.build details[open] > summary::before { transform: rotate(45deg); margin-top: -4px; }

/* Inline code carries unbreakable tokens — torch.nn.functional.scaled_dot_product_attention,
   /Users/you/projects/digits/models, GaussianProcessRegressor(...) — that are a single "word"
   wider than a phone text column, so they pushed the document past the viewport on a handful
   of lesson steps. Break them mid-token, but only when the whole token cannot fit on a line,
   so nothing changes wherever there is room. Code BLOCKS are untouched: pre keeps white-space:
   pre and scrolls inside its own box, which is the right behaviour for a listing. */
code { overflow-wrap: break-word; }
