/* App styles on the Cairn design system. Every colour, space, radius, size, shadow and duration is a token
   from tokens.css (load it first). Components follow the design system artifact; see docs/design-system.md.
   This file also styles the components in /components/ (timing, coverage, adjuster, feedback), so there is
   one stylesheet and no raw values anywhere else. Checked by npm run design:lint. */

/* Fonts. Next draws a slashed zero that reads as a typo in "20 minutes", so its face leaves digits out
   (unicode-range) and prose digits come from the system font. Numbers that line up use the mono face. */
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-002F, U+003A-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; src: url("/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-002F, U+003A-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; src: url("/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Mono"; font-weight: 200 800; font-style: normal; font-display: swap; src: url("/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2") format("woff2-variations"), url("/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2") format("woff2"); }

/* ======================= base ======================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: var(--text-body); line-height: var(--leading-body); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
[hidden] { display: none !important; }
h1 { font-size: var(--text-display); line-height: var(--leading-display); font-weight: var(--weight-display); margin: 0 0 var(--space-2); }
h2 { font-size: var(--text-heading); line-height: var(--leading-heading); font-weight: var(--weight-heading); margin: 0 0 var(--space-3); }
h3 { font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-body-strong); margin: 0 0 var(--space-2); }
h1, h2, h3, .fix-headline { text-wrap: balance; }
p { margin: 0 0 var(--space-3); }
p, li, dd { text-wrap: pretty; }
@media (max-width: 599px) { h1 { font-size: var(--text-title); line-height: var(--leading-title); } }
.muted { color: var(--ink-muted); }
.small { font-size: var(--text-small); line-height: var(--leading-small); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.glyph { width: 12px; height: 12px; flex: none; }

header.top { display: flex; align-items: baseline; gap: var(--space-3); max-width: var(--content-max); margin: 0 auto; padding: var(--space-3) var(--space-5); }
header.top .brand { display: inline-flex; align-items: center; min-height: var(--target-min); min-width: var(--target-min); color: var(--ink); text-decoration: none; }
header.top .brand .logo { display: block; height: 30px; width: auto; color: var(--ink); }
@media (max-width: 599px) { header.top .brand .logo { height: 24px; } }
header.top .tag { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
header.top .tenant { margin-left: auto; align-self: center; display: inline-flex; align-items: center; min-height: var(--target-min); font-size: var(--text-small); color: var(--ink-muted); }
header.top a.tenant { color: var(--accent); }
main { max-width: var(--content-max); margin: 0 auto; padding: var(--space-4) var(--space-5) var(--space-8); }
@media (max-width: 599px) { header.top, main { padding-left: var(--space-4); padding-right: var(--space-4); } }

/* ======================= buttons ======================= */
/* A bare <button> is the primary action (one per screen). Secondary, quiet and danger are classes. */
button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 var(--space-5); border-radius: var(--radius-md); border: 1px solid transparent; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: var(--weight-body-strong); font-size: var(--text-body); line-height: var(--leading-body); cursor: pointer; transition: background-color var(--duration-quick) var(--ease-standard); }
button:hover { background: var(--accent-hover); }
button.secondary { background: var(--surface); color: var(--ink); border-color: var(--border); font-weight: var(--weight-body-strong); }
button.secondary:hover { background: var(--surface-sunken); }
button.link { min-height: 0; padding: 0; background: transparent; border: 0; color: var(--accent); font-weight: var(--weight-body); text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { color: var(--accent-hover); text-decoration-thickness: 2px; background: transparent; }
button.danger { color: var(--error); }
button:disabled, button[aria-disabled="true"] { background: var(--surface-sunken); color: var(--ink-muted); border-color: transparent; cursor: not-allowed; }
.btn-close { width: var(--target-min); height: var(--target-min); min-height: var(--target-min); padding: 0; display: grid; place-items: center; border: 0; background: none; color: var(--ink-muted); border-radius: var(--radius-md); }
.btn-close:hover { background: var(--surface-sunken); color: var(--ink); }
.btn-close svg { width: 20px; height: 20px; }

/* ======================= fields ======================= */
label { display: block; font-size: var(--text-body); line-height: var(--leading-body); font-weight: var(--weight-body-strong); margin: 0 0 var(--space-2); }
select, input[type="number"], input[type="text"], input[type="email"], textarea { width: 100%; min-height: var(--target-min); padding: 0 var(--space-3); font: inherit; font-size: var(--text-body); color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
select { appearance: none; padding-right: var(--space-7); background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%); background-position: right 20px center, right 15px center; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { padding: var(--space-3); min-height: 112px; resize: vertical; line-height: var(--leading-body); }
select:hover, input[type="number"]:hover, input[type="text"]:hover, input[type="email"]:hover, textarea:hover { border-color: var(--ink-muted); }
.field { margin-bottom: var(--space-5); }
.field-hint { margin: 0; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.error { color: var(--error); font-weight: var(--weight-body-strong); font-size: var(--text-small); line-height: var(--leading-small); margin-top: var(--space-3); }
.error:empty { display: none; }
/* Checkbox: a 20px box in a 44px row; the whole label is the hit area. Ticked uses met: a tick means done. */
.checks label, .confirm, .tick-hit { display: flex; align-items: flex-start; gap: var(--space-3); min-height: var(--target-min); padding: var(--space-2) 0; margin: 0; font-weight: var(--weight-body); cursor: pointer; }
.checks input, .confirm input, .tick { appearance: none; flex: none; width: 20px; height: 20px; margin: 0; transform: translateY(2px); border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.checks input::after, .confirm input::after, .tick::after { content: ""; width: 5px; height: 10px; border: solid var(--on-marker); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg) scale(0); transition: transform var(--duration-quick) var(--ease-standard); }
.checks input:checked, .confirm input:checked, .tick:checked { background: var(--met); border-color: var(--met); }
.checks input:checked::after, .confirm input:checked::after, .tick:checked::after { transform: translateY(-1px) rotate(45deg) scale(1); }

/* ======================= status: a glyph and a word ======================= */
.status { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-body-strong); white-space: nowrap; }
.s-before { color: var(--before-you-teach); }
.s-worth { color: var(--worth-doing); }
.s-iftime { color: var(--if-time); }
.s-met { color: var(--met); }
.s-partly { color: var(--partly); }
.s-missing { color: var(--missing); }
.s-job { color: var(--ink-muted); font-weight: var(--weight-body); }
.s-ready { color: var(--met); font-weight: var(--weight-body); }
.s-stopped { color: var(--error); font-weight: var(--weight-body); }
.badge { font-weight: var(--weight-body-strong); }
.badge.trust { color: var(--source-trust); }
.badge.public { color: var(--source-national); }

/* ======================= upload page ======================= */
.upload-grid { display: grid; gap: var(--space-7); grid-template-columns: minmax(0, 1fr); align-items: start; margin-top: var(--space-2); }
@media (min-width: 960px) { .upload-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); } }
p.lede { color: var(--ink-muted); margin: 0 0 var(--space-5); max-width: var(--measure); }
/* Class profile choices: one row of buttons per question, so every option is visible and one tap sets it. */
.choice-field { border: 0; padding: 0; margin: 0 0 var(--space-5); min-width: 0; }
.choice-field legend { padding: 0; margin-bottom: var(--space-2); font-weight: var(--weight-body-strong); }
.choice { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.choice label { position: relative; margin: 0; cursor: pointer; }
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; justify-content: center; min-height: var(--target-min); min-width: var(--target-min); padding: 0 var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-size: var(--text-body); font-weight: var(--weight-body); transition: background-color var(--duration-quick) var(--ease-standard); }
.choice label:hover span { border-color: var(--ink-muted); }
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 599px) { .choice span { padding: 0 var(--space-3); } }
.row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 599px) { .row { grid-template-columns: 1fr 1fr; } }
.row .field-hint { grid-column: 2 / -1; align-self: end; margin-bottom: var(--space-3); }
@media (max-width: 599px) { .row .field-hint { grid-column: 1 / -1; margin: 0; } }
/* Upload drop zone */
.drop { display: grid; justify-items: center; gap: var(--space-1); width: 100%; text-align: center; padding: var(--space-7) var(--space-5); border: 1px dashed var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-weight: var(--weight-body); cursor: pointer; transition: background-color var(--duration-quick) var(--ease-standard); }
.drop strong { display: block; font-size: var(--text-heading); line-height: var(--leading-heading); overflow-wrap: anywhere; }
.drop .hint { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop.has-file { border-style: solid; }
.profile { border: 0; padding: 0; margin: 0 0 var(--space-5); }
.profile-summary { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: center; margin: var(--space-4) 0; color: var(--ink-muted); }
.profile-summary b { color: var(--ink); }
.profile-summary button.link { min-height: var(--target-min); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
@media (max-width: 599px) { .checks { grid-template-columns: 1fr; } }
.submit-row { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; }
.flash { font-size: var(--text-small); line-height: var(--leading-small); color: var(--met); margin: var(--space-3) 0 0; }
.tonight h2 { display: flex; align-items: baseline; gap: var(--space-3); }
.tonight h2 span { font-size: var(--text-small); font-weight: var(--weight-body); color: var(--ink-muted); }
ul.lessons { list-style: none; margin: 0 0 var(--space-2); padding: 0; }
ul.lessons li { border-top: 1px solid var(--rule); }
ul.lessons li:last-child { border-bottom: 1px solid var(--rule); }
ul.lessons a.lesson { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); min-height: 56px; padding: var(--space-3) var(--space-1); text-decoration: none; color: var(--ink); }
ul.lessons a.lesson:hover .name { text-decoration: underline; text-underline-offset: 3px; }
ul.lessons .name { font-weight: var(--weight-body-strong); overflow-wrap: anywhere; }
ul.lessons .sub { grid-column: 1; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
ul.lessons .status { grid-row: 1; grid-column: 2; }
ul.lessons .result { grid-column: 1 / -1; font-size: var(--text-small); line-height: var(--leading-small); }
ul.lessons .result b { color: var(--before-you-teach); }
ul.lessons .empty { padding: var(--space-4) var(--space-1); color: var(--ink-muted); border: 0; }
details.earlier { margin-top: var(--space-5); }
details.earlier summary { display: inline-flex; align-items: center; min-height: var(--target-min); cursor: pointer; color: var(--accent); font-size: var(--text-small); }
.about-layers { margin-top: var(--space-6); font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.about-layers p { margin: 0 0 var(--space-2); }

/* ======================= report page ======================= */
.crumbs { margin: 0; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.deckname { font-size: var(--text-body); font-weight: var(--weight-body-strong); margin: 0; overflow-wrap: anywhere; }
.report-head { display: flex; gap: var(--space-3); align-items: baseline; flex-wrap: wrap; justify-content: space-between; }
/* The answer: the one thing a tired teacher reads. */
.answer { margin: var(--space-6) 0 0; max-width: 620px; }
.answer h1 { margin: 0; }
.answer h1 .mins { display: block; color: var(--ink-muted); font-weight: var(--weight-body); }
.answer-sub { margin: var(--space-3) 0 0; color: var(--ink-muted); max-width: var(--measure); }
.answer-sub .fit.over { color: var(--before-you-teach); }
.mount:empty { display: none; }
#buildBar { margin-top: var(--space-5); }

/* Slide thumbnails (the strip when a report has no timing). */
.slides { margin-top: var(--space-6); }
.slides > summary { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); cursor: pointer; font-size: var(--text-small); color: var(--accent); list-style: none; }
.slides > summary::-webkit-details-marker { display: none; }
.slides > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--duration-base) var(--ease-standard); }
.slides[open] > summary::before { transform: rotate(45deg); }
.strip { display: flex; gap: var(--space-4); overflow-x: auto; padding: var(--space-3) var(--space-1) var(--space-2); }
.thumb { position: relative; flex: none; display: grid; gap: var(--space-1); width: 128px; min-height: 0; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; font-weight: var(--weight-body); cursor: pointer; border-radius: var(--radius-sm); }
.thumb:hover { background: none; }
.thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: left top; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); }
.thumb .cap { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.thumb .cap b { font-family: var(--font-mono); color: var(--ink); }
.thumb.selected .cap { color: var(--accent); font-weight: var(--weight-body-strong); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.is-filtering .thumb:not(.selected) img { opacity: 0.45; }
@media (max-width: 599px) { .strip .thumb { width: 96px; } }
/* Marker: the count on a slide, coloured by its most urgent fix. The only colour on a thumbnail. */
.thumb .marker, .clock-slide .marker { position: absolute; z-index: 2; display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 var(--space-1); border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: var(--text-numeral); line-height: var(--leading-numeral); font-weight: var(--weight-body-strong); color: var(--on-marker); background: var(--if-time); }
.thumb .marker { top: -10px; right: -8px; }
.thumb.m1 .marker, .marker.r0 { background: var(--before-you-teach); }
.thumb.m2 .marker, .marker.r1 { background: var(--worth-doing); }
.marker.r2 { background: var(--if-time); }
.clock-slide .thumb.in-fix img { outline: 2px solid var(--ink-muted); outline-offset: 1px; }
.clock-slide .marker.current { min-width: 28px; height: 28px; top: -14px; box-shadow: 0 0 0 2px var(--bg); }

/* The checklist */
.checklist { margin-top: var(--space-7); max-width: 680px; }
.list-head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-1); }
.list-head h2 { margin: 0; }
.filter { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.filter button.link { min-height: var(--target-min); }
.group-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: var(--space-5) 0 var(--space-2); font-size: var(--text-heading); line-height: var(--leading-heading); }
.group-head .status { font-size: var(--text-heading); line-height: var(--leading-heading); }
.group-head .status .glyph { width: 14px; height: 14px; }
.group-head .count { font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-body); color: var(--ink-muted); }
ul.fixes { list-style: none; margin: 0; padding: 0; }
.fix { scroll-margin-top: var(--space-4); border: 1px solid transparent; border-radius: var(--radius-md); }
.fix + .fix { margin-top: var(--space-1); }
/* Fix number: the same circle and colour as the filmstrip marker for that fix. */
.fix-no { grid-column: 1; grid-row: 1 / span 2; display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 var(--space-1); border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: var(--text-numeral); line-height: var(--leading-numeral); font-weight: var(--weight-body-strong); color: var(--on-marker); background: var(--if-time); }
.fix-no.r0 { background: var(--before-you-teach); }
.fix-no.r1 { background: var(--worth-doing); }
.fix-row { display: grid; grid-template-columns: var(--target-min) minmax(0, 1fr); align-items: start; }
.tick-hit { justify-content: center; padding: var(--space-3) 0; }
.fix-toggle { display: grid; grid-template-columns: minmax(0, 1fr) 20px; gap: var(--space-1) var(--space-3); width: 100%; min-height: var(--target-min); padding: var(--space-3) var(--space-2) var(--space-3) 0; background: none; border: 0; border-radius: 0; color: var(--ink); font-weight: var(--weight-body); text-align: left; align-items: start; }
.fix-toggle:hover { background: none; }
.fix-headline { font-weight: var(--weight-body-strong); }
.fix-toggle:hover .fix-headline { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }
.fix-meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: 0 var(--space-4); font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.fix-meta > span { white-space: nowrap; }
.fix-meta .num { color: var(--ink); }
.chev { grid-column: 2; grid-row: 1; width: 9px; height: 9px; margin-top: var(--space-2); justify-self: center; border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: rotate(45deg); transition: transform var(--duration-base) var(--ease-standard); }
.fix.open .chev { transform: rotate(-135deg); margin-top: var(--space-3); }
.fix.is-done .fix-headline { color: var(--ink-muted); text-decoration: line-through; text-decoration-color: var(--met); text-decoration-thickness: 2px; }
.fix.focused { background: var(--accent-soft); }
.fix-detail { padding: 0 var(--space-2) var(--space-6) var(--target-min); display: grid; gap: var(--space-5); }
.fix-detail p { margin: 0; max-width: 62ch; }
.change { margin: 0; }
.why { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.why b { color: var(--ink); }
@media (min-width: 600px) {
  .fix-toggle { grid-template-columns: minmax(0, 1fr) auto 20px; align-items: baseline; }
  .fix-meta { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .chev { grid-column: 3; }
}
@media (max-width: 599px) { .fix-detail { padding-left: 0; } }
.all-clear { display: flex; gap: var(--space-2); align-items: baseline; padding: var(--space-4) 0; }

/* The slide card: the one raised object on a report. Shadow only, no edge. */
.slide-preview { margin: 0; max-width: 520px; }
.slide-card { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-raised); padding: var(--space-5); overflow: auto; cursor: zoom-in; }
.slide-card .slide-title { margin: 0 0 var(--space-3); font-weight: var(--weight-heading); font-size: var(--text-heading); line-height: var(--leading-heading); }
.slide-card .slide-body { margin: 0; white-space: pre-wrap; }
.slide-preview figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); margin-top: var(--space-3); font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.fig-actions { display: flex; gap: var(--space-1); }
.fig-actions button { background: transparent; border: 0; color: var(--accent); padding: 0 var(--space-2); font-weight: var(--weight-body); text-decoration: underline; text-underline-offset: 3px; }
.fig-actions button:hover { background: transparent; color: var(--accent-hover); text-decoration-thickness: 2px; }
/* Teacher notes under the slide: for the speaker notes, not the slide. A sunken well, no edge. */
.notes-preview figcaption { margin: 0 0 var(--space-2); }
.notes-body { margin: 0; padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface-sunken); white-space: pre-wrap; }
/* Full-size view of the slide content */
.slide-full { position: fixed; inset: 0; z-index: 56; background: var(--scrim); display: grid; place-items: center; padding: var(--space-8) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom)); }
.slide-full .slide-card { width: min(960px, 100%); max-height: 100%; cursor: auto; padding: var(--space-6); box-shadow: var(--shadow-overlay); }
.slide-full .slide-title { font-size: var(--text-title); line-height: var(--leading-title); }
.slide-full .slide-body { font-size: var(--text-heading); line-height: var(--leading-heading); }
.slide-full-close { position: absolute; top: max(var(--space-2), env(safe-area-inset-top)); right: var(--space-2); background: var(--surface); color: var(--ink); }
body.no-scroll { overflow: hidden; }

/* Source links: underlined text with a glyph. Trust: a filled dot in the trust's colour. National: a ring. */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); }
.src { display: inline-block; min-height: var(--target-min); padding: var(--space-3) 0; background: none; border: 0; border-radius: 0; font: inherit; font-weight: var(--weight-body); font-size: var(--text-small); line-height: var(--leading-small); text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.src:hover { background: none; text-decoration-thickness: 2px; }
.src::before { content: ""; display: inline-block; box-sizing: border-box; width: 8px; height: 8px; margin-right: var(--space-2); border-radius: var(--radius-pill); vertical-align: 1px; }
.src.trust { color: var(--source-trust); }
.src.trust::before { background: var(--trust-accent); }
.src.public { color: var(--source-national); }
.src.public::before { border: 2px solid currentColor; }
.src b { font-weight: var(--weight-body-strong); }
.decision:empty { display: none; }
.deep > summary { display: inline-flex; align-items: center; min-height: var(--target-min); cursor: pointer; font-size: var(--text-small); color: var(--accent); width: fit-content; }
.deep dl { margin: var(--space-3) 0 0; display: grid; gap: var(--space-3); font-size: var(--text-small); line-height: var(--leading-small); max-width: 62ch; }
.deep dt { font-weight: var(--weight-body-strong); }
.deep dd { margin: var(--space-1) 0 0; color: var(--ink-muted); }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-3); max-width: 520px; }
.thumbs a { display: block; text-decoration: none; }
.thumbs img { width: 100%; border: 1px solid var(--rule); border-radius: var(--radius-sm); display: block; }
.thumbs span { font-size: var(--text-small); color: var(--ink-muted); }

/* Panels after the list: standards, timing, what is working. Flat, separated by space. */
.panels { margin-top: var(--space-8); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7) var(--space-7); }
@media (min-width: 960px) { .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .panels { margin-top: var(--space-7); gap: var(--space-6); } }
.panel h2 { font-size: var(--text-heading); line-height: var(--leading-heading); margin: 0 0 var(--space-3); }
.panel .note { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); margin: 0 0 var(--space-3); }
.panel ul.plain { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-2); }
.panel.wide { grid-column: 1 / -1; }
.about { color: var(--ink-muted); }
.about p { margin: 0 0 var(--space-2); }
.side-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; }
/* Lesson structure (built-in, when coverage.js is not loaded): a glyph and a word per phase. */
ol.phases { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
ol.phases li { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); color: var(--ink); }
ol.phases li button { all: unset; cursor: pointer; display: inline-flex; gap: var(--space-2); align-items: center; min-height: var(--target-min); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
ol.phases li button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
ol.phases .mark { font-weight: var(--weight-body-strong); color: var(--met); }
ol.phases li.missing { color: var(--missing); font-weight: var(--weight-body-strong); }
ol.phases li.missing .mark { color: var(--missing); }
/* Coverage and structure rows (components/coverage.js): each item is a status, a glyph and a word. */
.panel.coverage .structure { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); align-items: center; margin: 0 0 var(--space-5); }
.panel.coverage .structure:last-child { margin-bottom: 0; }
.panel.coverage .structure-title { flex-basis: 100%; font-weight: var(--weight-body-strong); margin: 0 0 var(--space-1); }
.panel.coverage .phase { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0; background: none; border: 0; border-radius: 0; color: var(--ink); font-size: var(--text-body); font-weight: var(--weight-body); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.panel.coverage .phase:hover { background: none; text-decoration-color: currentColor; }
.panel.coverage .phase .glyph { color: var(--met); }
.panel.coverage .phase.partly .glyph { color: var(--partly); }
.panel.coverage .phase.missing .glyph { color: var(--missing); }
.panel.coverage .phase.missing { font-weight: var(--weight-body-strong); }
.panel.coverage .phase.unseen .glyph { color: var(--ink-muted); }
.panel.coverage .phase.all-met { text-decoration: none; cursor: default; }
.panel.coverage .cov-more { font-size: var(--text-small); color: var(--ink-muted); }
.panel.coverage .cov-toggle { min-height: var(--target-min); padding: 0 var(--space-2); background: transparent; border: 0; color: var(--accent); font-size: var(--text-small); font-weight: var(--weight-body); text-decoration: underline; text-underline-offset: 3px; }
.panel.coverage .cov-toggle:hover { background: transparent; text-decoration-thickness: 2px; }

/* Progress: the steps of a check, never a spinner. */
.progress { display: grid; gap: var(--space-4); max-width: 440px; margin-top: var(--space-5); }
.bar { height: 4px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); transition: width var(--duration-slow) var(--ease-standard); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); color: var(--ink-muted); }
.steps li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: var(--space-3); align-items: center; }
.steps .glyph { width: 16px; height: 16px; }
.steps li.is-done { color: var(--ink); }
.steps li.is-done .glyph { color: var(--met); }
.steps li.is-on { color: var(--ink); font-weight: var(--weight-body-strong); }
.steps li.is-on .glyph { color: var(--accent); }
/* Page states: a heading, one sentence, the way forward. */
.state { display: grid; justify-items: start; gap: var(--space-3); padding: var(--space-7) 0; max-width: 52ch; }
.state h1 { margin: 0; font-size: var(--text-title); line-height: var(--leading-title); }
.state p, .state ul { margin: 0; color: var(--ink-muted); }
.state .actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.state-error h1 { color: var(--error); }

/* Side panel (600px and up) and bottom sheet (phone): where a source opens. */
.drawer-backdrop { position: fixed; inset: 0; z-index: 54; background: var(--scrim); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: min(460px, 100%); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-overlay); border-radius: var(--radius-lg) 0 0 var(--radius-lg); padding: var(--space-4) var(--space-5) var(--space-6); overflow-y: auto; transform: translateX(100%); transition: transform var(--duration-slow) var(--ease-exit), visibility 0s linear var(--duration-slow); visibility: hidden; }
.drawer.open { transform: none; visibility: visible; transition: transform var(--duration-slow) var(--ease-standard); }
.drawer-head { position: sticky; top: calc(-1 * var(--space-4)); z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) var(--target-min); gap: var(--space-2); align-items: start; margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-5)) var(--space-4); padding: var(--space-4) var(--space-5) var(--space-2); background: var(--surface); } /* title and close stay in view while the cited passage is scrolled into view */
.drawer-head h2 { margin: var(--space-2) 0 0; font-size: var(--text-heading); line-height: var(--leading-heading); }
.drawer .from { margin: var(--space-1) 0 0; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.drawer .from .who { font-weight: var(--weight-body-strong); }
.drawer .from .who.trust { color: var(--source-trust); }
.drawer .from .who.public { color: var(--source-national); }
#drawerSection:not(:empty)::before { content: ", "; }
ol.context { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-1); }
ol.context li { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1); padding: var(--space-3); border-radius: var(--radius-md); color: var(--ink-muted); }
ol.context li .ref { font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-body-strong); } /* refs here are words, so not mono */
ol.context li.cited { background: var(--trust-soft); color: var(--ink); }
ol.context.national li.cited { background: var(--accent-soft); }
.lightbox { position: fixed; inset: 0; z-index: 56; background: var(--scrim); display: none; align-items: center; justify-content: center; padding: var(--space-5); }
.lightbox.open { display: flex; }
.lightbox img { max-width: min(1100px, 100%); max-height: 100%; border-radius: var(--radius-md); box-shadow: var(--shadow-overlay); }

/* ======================= the lesson clock ======================= */
.clock { margin-top: var(--space-6); }
.clock-scroll { overflow-x: auto; padding: var(--space-7) var(--space-2) var(--space-1); }
.clock-inner { position: relative; min-width: calc(var(--span) * 13px); }
.clock-row { position: relative; z-index: 1; height: var(--h); }
.clock-phases { --h: 24px; }
.clock-slides { --h: 64px; margin-top: var(--space-1); }
.clock-scale { --h: 28px; margin-top: var(--space-2); border-top: 2px solid var(--ink); }
.clock-phase { position: absolute; top: 0; height: 100%; padding-left: var(--space-2); border-left: 1px solid var(--border); font-size: var(--text-small); line-height: 24px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; }
.clock-phase .lbl { display: inline-block; }
/* A label that does not fit is hidden, and shown while one of its slides is hovered, focused or picked. */
.clock-phase.squeezed .lbl { visibility: hidden; }
.clock-slide { position: absolute; top: 0; height: 100%; }
.clock-slide .thumb { display: block; width: calc(100% - 2px); height: 100%; margin: 0 auto; }
.clock-slide .thumb img { width: 100%; height: 100%; aspect-ratio: auto; }
.clock-slide .thumb .marker, .clock-slide .marker { top: -12px; right: -6px; }
.clock-slide .num { position: absolute; left: var(--space-1); bottom: var(--space-1); max-width: calc(100% - var(--space-2)); overflow: hidden; padding: 0 var(--space-1); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: var(--text-numeral); line-height: var(--leading-numeral); font-weight: var(--weight-body-strong); pointer-events: none; }
.clock-slide .thumb.selected img { outline: 3px solid var(--accent); outline-offset: 1px; }
.clock-tick { position: absolute; top: 0; height: 6px; border-left: 2px solid var(--ink); }
.clock-tick span { position: absolute; top: var(--space-2); left: 0; transform: translateX(-50%); font-family: var(--font-mono); font-size: var(--text-numeral); line-height: var(--leading-numeral); color: var(--ink-muted); }
.clock-tick:first-child span { transform: none; }
/* Time past the bell: a plain tint. It is data, not decoration. */
.clock-over { position: absolute; z-index: 0; top: 0; bottom: 0; background: var(--before-you-teach-soft); pointer-events: none; }
.clock-bell { position: absolute; z-index: 3; top: -32px; bottom: 0; width: 0; border-left: 3px solid var(--before-you-teach); translate: -1.5px 0; pointer-events: none; transform-origin: bottom; animation: bell-settle var(--duration-slow) var(--ease-standard) both; }
.clock-bell span { position: absolute; top: 0; left: var(--space-2); padding: 0 var(--space-1); background: var(--bg); white-space: nowrap; font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-body-strong); color: var(--before-you-teach); }
.clock-bell.fits { border-left-color: var(--ink); }
.clock-bell.fits span { color: var(--ink); }
.clock-bell.end span { left: auto; right: var(--space-2); }
@keyframes bell-settle { from { transform: scaleY(0); } }
.clock-note { margin: var(--space-4) 0 0; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); max-width: var(--measure); }
.clock-note b { color: var(--ink); }
.clock-extra { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; margin-top: var(--space-3); font-size: var(--text-small); color: var(--ink-muted); }
.clock-extra .thumb { width: 80px; }
.clock-extra .thumb .cap { display: none; }

/* Lane T's timeline (components/timing.js), shown only when the clock cannot draw. */
.ipt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-2); }
.ipt-title { font-weight: var(--weight-body-strong); }
.ipt-fit { font-weight: var(--weight-body-strong); }
.ipt-fit.over, .ipt-after.over { color: var(--before-you-teach); }
.ipt-fit.ok, .ipt-after.ok { color: var(--met); }
.ipt-total { color: var(--ink-muted); font-size: var(--text-small); }
.ipt-track { position: relative; display: flex; height: 40px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-sunken); }
.ipt-seg { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 0 var(--space-2); font-size: var(--text-small); line-height: var(--leading-small); border-right: 1px solid var(--surface); overflow: hidden; white-space: nowrap; }
.ipt-seg.a { background: var(--accent-soft); }
.ipt-seg.b { background: var(--surface-sunken); }
.ipt-seg b { overflow: hidden; text-overflow: ellipsis; }
.ipt-seg i { font-style: normal; font-family: var(--font-mono); color: var(--ink-muted); }
.ipt-seg.tight { padding: 0 var(--space-1); align-items: center; }
.ipt-seg.tight b { display: none; }
.ipt-overrun { position: absolute; top: 0; bottom: 0; right: 0; pointer-events: none; background: var(--before-you-teach-soft); opacity: 0.7; }
.ipt-bell { position: absolute; top: 0; bottom: 0; width: 0; border-left: 3px solid var(--before-you-teach); translate: -1.5px 0; }
.ipt-scale { position: relative; height: 24px; font-family: var(--font-mono); font-size: var(--text-numeral); color: var(--ink-muted); }
.ipt-scale span { position: absolute; top: var(--space-1); }
.ipt-scale span + span { transform: translateX(-50%); white-space: nowrap; }
.ipt-scale span.end { transform: none; }
.ipt-after { margin: var(--space-1) 0 0; font-size: var(--text-small); }
/* Change to lesson time on a fix row: words in the priority colours, no fill. */
.ipt-chip { font-weight: var(--weight-body-strong); white-space: nowrap; }
.ipt-chip.add { color: var(--worth-doing); }
.ipt-chip.save { color: var(--met); }

/* ======================= Lane A adjuster: build bar and decision ======================= */
#buildBar .adj-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); max-width: 680px; margin: 0; }
#buildBar .adj-bar p { margin: 0; }
#buildBar .adj-bar .adj-main { flex: 1 1 280px; }
#buildBar .adj-bar .adj-sub { color: var(--ink-muted); font-size: var(--text-small); line-height: var(--leading-small); margin-top: var(--space-1); }
#buildBar .adj-bar ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); font-size: var(--text-small); line-height: var(--leading-small); }
#buildBar .adj-bar .adj-hand { margin-top: var(--space-2); }
#buildBar .adj-bar .adj-err { color: var(--error); font-weight: var(--weight-body-strong); }
#buildBar a.adj-download { display: inline-flex; align-items: center; justify-content: center; min-height: var(--target-min); padding: 0 var(--space-5); border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent); font-weight: var(--weight-body-strong); text-decoration: none; }
#buildBar a.adj-download:hover { background: var(--accent-hover); }
/* Once the deck is built, Download is the one filled button and Build becomes secondary. */
#buildBar .adj-bar:has(.adj-download) button[data-adj-build] { background: var(--surface); color: var(--ink); border-color: var(--border); }
/* coverage.js fallback highlight (unused while the report handles iprep:focus itself) */
.iprep-flash { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-md); transition: outline-color var(--duration-slow) var(--ease-exit); }
.iprep-flash.fade { outline-color: transparent; }
/* Use this fix or Keep mine: a two-way choice that stays visible. */
.adj-decision { display: inline-flex; width: fit-content; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.adj-decision button { min-height: var(--target-min); padding: 0 var(--space-4); border: 0; border-radius: 0; background: var(--surface); color: var(--ink); font-weight: var(--weight-body); }
.adj-decision button:hover { background: var(--surface-sunken); }
.adj-decision button + button { border-left: 1px solid var(--border); }
.adj-decision button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: var(--weight-body-strong); }

/* ======================= Lane F training mode and comments (components/feedback.js) ======================= */
/* The training bar: a quiet strip in muted ink, so it reads as a tool and not as part of the page design. */
.ifb-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-4); padding: 0 var(--space-5); background: var(--surface-sunken); color: var(--ink-muted); border-bottom: 1px solid var(--rule); font-size: var(--text-small); line-height: var(--leading-small); }
.ifb-banner .ifb-how { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-3); }
.ifb-banner .ifb-hint { color: var(--ink-muted); }
.ifb-banner .ifb-end { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); }
.ifb-banner a { display: inline-flex; align-items: center; min-height: var(--target-min); color: var(--ink-muted); }
.ifb-banner a:hover { color: var(--ink); }
.ifb-banner .ifb-btn { min-height: var(--target-min); padding: 0; border: 0; background: none; color: var(--accent); font-size: var(--text-small); text-decoration: underline; text-underline-offset: 3px; }
.ifb-banner .ifb-btn:hover { background: none; color: var(--accent-hover); }
.ifb-banner .ifb-btn[aria-pressed="true"] { color: var(--ink); text-decoration: none; }
.ifb-banner .ifb-switch { font-weight: var(--weight-body); }
.ifb-off { display: flex; align-items: center; padding: 0 var(--space-5); font-size: var(--text-small); color: var(--ink-muted); border-bottom: 1px solid var(--rule); }
@media (max-width: 599px) { .ifb-banner, .ifb-off { padding-left: var(--space-4); padding-right: var(--space-4); } .ifb-banner .ifb-end { margin-left: 0; } }
/* Buttons inside the band, comment box and arm bar. */
.ifb-btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--target-min); padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--text-body); font-weight: var(--weight-body-strong); cursor: pointer; }
.ifb-btn:hover { background: var(--surface-sunken); }
.ifb-btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.ifb-btn.primary:hover { background: var(--accent-hover); }
/* The on/off switch */
.ifb-switch { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); margin: 0; cursor: pointer; font-size: var(--text-small); font-weight: var(--weight-body-strong); }
.ifb-off .ifb-switch { font-weight: var(--weight-body); }
.ifb-switch input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 40px; height: 24px; margin: 0; border-radius: var(--radius-pill); background: var(--ink-muted); cursor: pointer; transition: background-color var(--duration-quick) var(--ease-standard); }
.ifb-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: var(--radius-pill); background: var(--bg); transition: transform var(--duration-quick) var(--ease-standard); }
.ifb-switch input:checked { background: var(--met); }
.ifb-switch input:checked::after { transform: translateX(16px); }
/* The one-time tip next to Comment */
.ifb-tip { position: absolute; z-index: 61; width: min(320px, calc(100vw - var(--space-6))); display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-overlay); font-size: var(--text-body); line-height: var(--leading-body); }
.ifb-tip p { margin: 0; }
.ifb-tip .ifb-btn { justify-self: start; }
/* Picking what to comment on */
body.ifb-armed, body.ifb-armed * { cursor: crosshair !important; }
.ifb-hover { outline: 2px dashed var(--accent) !important; outline-offset: 2px; }
.ifb-target { outline: 2px solid var(--accent) !important; outline-offset: 2px; }
.ifb-pressing { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Pins: a 24px marker inside a 44px target, above the report (markers go to 4) and under bars and sheets. */
.ifb-pin { position: absolute; z-index: 6; width: 44px; height: 44px; min-height: 0; padding: 0; margin: 0; border: 0; background: transparent; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.ifb-pin:hover { background: transparent; }
.ifb-pin b { min-width: 24px; height: 24px; padding: 0 var(--space-1); border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent); font-family: var(--font-mono); font-size: var(--text-numeral); line-height: 24px; font-weight: var(--weight-body-strong); text-align: center; }
.ifb-pin.resolved b { background: var(--ink-muted); }
.ifb-pin:focus-visible { outline: none; }
.ifb-pin:focus-visible b { outline: 3px solid var(--focus); outline-offset: 2px; }
/* The comment box: surface, overlay shadow, no edge. A bottom sheet on phones. */
.ifb-box { position: absolute; z-index: 60; width: min(400px, calc(100vw - var(--space-6))); display: grid; gap: var(--space-4); padding: var(--space-5); background: var(--surface); color: var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay); font-size: var(--text-body); line-height: var(--leading-body); }
.ifb-box > * { margin-top: 0; margin-bottom: 0; }
.ifb-box h4 { margin: 0; font-size: var(--text-body); line-height: var(--leading-body); }
.ifb-box .ifb-quote { margin: 0; color: var(--ink-muted); font-size: var(--text-small); line-height: var(--leading-small); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Kinds look like ordinary checkboxes (the buttons keep aria-pressed). */
.ifb-tags { display: grid; gap: 0; margin: 0; }
.ifb-tags .ifb-btn { position: relative; justify-content: flex-start; gap: var(--space-3); min-height: var(--target-min); padding: 0; border: 0; background: none; font-weight: var(--weight-body); }
.ifb-tags .ifb-btn:hover { background: none; }
.ifb-tags .ifb-btn::before { content: ""; flex: none; box-sizing: border-box; width: 20px; height: 20px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.ifb-tags .ifb-btn[aria-pressed="true"]::before { background: var(--met); border-color: var(--met); }
.ifb-tags .ifb-btn::after { content: ""; position: absolute; left: 7px; top: calc(50% - 6px); width: 5px; height: 10px; border: solid var(--on-marker); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform var(--duration-quick) var(--ease-standard); }
.ifb-tags .ifb-btn[aria-pressed="true"]::after { transform: rotate(45deg) scale(1); }
.ifb-box textarea { min-height: 112px; }
.ifb-note { margin: 0; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.ifb-err { margin: 0; font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-body-strong); color: var(--error); }
.ifb-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; align-items: center; }
.ifb-actions .ifb-left { margin-right: auto; }
.ifb-actions [data-ifb-cancel] { border: 0; background: transparent; color: var(--accent); font-weight: var(--weight-body); text-decoration: underline; text-underline-offset: 3px; }
.ifb-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.ifb-list li { padding: var(--space-3) 0; border-top: 1px solid var(--rule); }
.ifb-list li:first-child { border-top: 0; padding-top: 0; }
.ifb-meta { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
/* Tags read as plain words: "Not right, Wording". */
.ifb-chip, .fb-chip { font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-body-strong); color: var(--ink); }
.ifb-chip + .ifb-chip::before, .fb-chip + .fb-chip::before { content: ", "; font-weight: var(--weight-body); }
.ifb-status { margin-left: var(--space-3); font-size: var(--text-small); font-weight: var(--weight-body-strong); color: var(--accent); }
.ifb-status.done, .ifb-status.wont_fix { color: var(--ink-muted); }
.ifb-row-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
/* Toast: inverted ink, bottom centre on phones, bottom left from 960px. */
.ifb-toast { position: fixed; left: 50%; bottom: calc(var(--space-4) + var(--ifb-dock-top, var(--space-2))); transform: translateX(-50%); z-index: 70; display: inline-flex; align-items: center; min-height: 48px; padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-overlay); font-size: var(--text-small); line-height: var(--leading-small); max-width: min(480px, calc(100vw - var(--space-6))); }
@media (min-width: 960px) { .ifb-toast { left: var(--space-5); transform: none; } }
/* Touch: the Comment button sits in an opaque strip at the bottom, so it never covers text. */
.ifb-dock { display: none; position: fixed; z-index: 50; left: 0; right: 0; bottom: var(--ifb-fab-lift, 0px); justify-content: flex-end; align-items: center; background: var(--surface); border-top: 1px solid var(--rule); padding: var(--space-2) calc(var(--space-4) + env(safe-area-inset-right, 0px)) calc(var(--space-2) + var(--ifb-dock-safe, 0px)) calc(var(--space-4) + env(safe-area-inset-left, 0px)); }
body.ifb-touch-ui .ifb-dock { display: flex; }
body.ifb-docked { padding-bottom: var(--ifb-dock-h, 0px); }
.ifb-fab { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 var(--space-5) 0 var(--space-4); border: 0; border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent); font-size: var(--text-body); font-weight: var(--weight-body-strong); -webkit-tap-highlight-color: transparent; }
.ifb-fab svg { width: 20px; height: 20px; flex: none; }
.ifb-fab[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
body.ifb-touch-ui .ifb-banner [data-ifb-arm] { display: none; }
.ifb-armbar { position: fixed; z-index: 56; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: var(--space-3); padding: calc(var(--space-3) + env(safe-area-inset-top, 0px)) calc(var(--space-4) + env(safe-area-inset-right, 0px)) var(--space-3) calc(var(--space-4) + env(safe-area-inset-left, 0px)); background: var(--ink); color: var(--bg); font-size: var(--text-body); font-weight: var(--weight-body-strong); box-shadow: var(--shadow-overlay); }
.ifb-armbar span { flex: 1; }
.ifb-armbar .ifb-btn { background: transparent; color: var(--bg); border-color: var(--bg); }
.ifb-scrim { position: fixed; inset: 0; z-index: 59; background: var(--scrim); }
.ifb-box.ifb-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 85vh; max-height: 85dvh; overflow-y: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: var(--space-2) calc(var(--space-4) + env(safe-area-inset-right, 0px)) calc(var(--space-5) + env(safe-area-inset-bottom, 0px)) calc(var(--space-4) + env(safe-area-inset-left, 0px)); }
.ifb-sheet::before { content: ""; display: block; width: 36px; height: 4px; border-radius: var(--radius-pill); background: var(--border); margin: 0 auto; }
.ifb-sheet .ifb-actions .ifb-btn { flex: 1; }
.ifb-sheet .ifb-actions .ifb-left { flex: 1 1 100%; margin: 0; }
.ifb-sheet .ifb-list { max-height: none; }

/* ======================= feedback page ======================= */
.fb-how { margin: 0 0 var(--space-5); max-width: var(--measure); }
.fb-grid { display: grid; gap: var(--space-7); grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: var(--space-7); }
@media (min-width: 960px) { .fb-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.fb-table { width: 100%; border-collapse: collapse; font-size: var(--text-small); line-height: var(--leading-small); }
.fb-table th, .fb-table td { text-align: left; padding: var(--space-2) var(--space-2) var(--space-2) 0; border-top: 1px solid var(--rule); vertical-align: top; }
.fb-table th { color: var(--ink-muted); font-weight: var(--weight-body-strong); border-top: 0; }
.fb-table td.n, .fb-table th.n { text-align: right; white-space: nowrap; }
.fb-rate { display: inline-block; min-width: 42px; margin-right: var(--space-2); font-family: var(--font-mono); font-weight: var(--weight-body-strong); }
.fb-bar { display: inline-block; vertical-align: middle; width: 60px; height: 4px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; margin-left: var(--space-2); }
.fb-bar i { display: block; height: 100%; background: var(--met); }
.fb-big { font-size: var(--text-title); line-height: var(--leading-title); font-weight: var(--weight-title); margin: 0; }
.fb-intro { margin: 0 0 var(--space-3); }
.fb-filters { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 var(--space-4); }
.fb-filters label { margin: 0 0 var(--space-1); font-size: var(--text-small); }
.fb-filters select { width: auto; min-width: 160px; }
.fb-list { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.fb-item { padding: var(--space-4) 0; border-top: 1px solid var(--rule); }
.fb-item:last-child { border-bottom: 1px solid var(--rule); }
.fb-item.done .fb-text, .fb-item.wont_fix .fb-text { color: var(--ink-muted); }
.fb-head { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: baseline; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); margin-bottom: var(--space-2); }
.fb-head b { color: var(--ink); }
.fb-text { margin: var(--space-1) 0; white-space: pre-wrap; }
.fb-snap { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--surface-sunken); font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.fb-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-3); font-size: var(--text-small); }
.fb-actions a { display: inline-flex; align-items: center; min-height: var(--target-min); margin-right: var(--space-2); }
.fb-status { font-weight: var(--weight-body-strong); }
.fb-status.open { color: var(--accent); }
.fb-empty { color: var(--ink-muted); padding: var(--space-4) 0; }
.fb-filterbox > summary { display: none; }
.fb-wrap { overflow-x: auto; }
@media (max-width: 599px) {
  .fb-grid { gap: var(--space-6); }
  .fb-filterbox { margin: 0 0 var(--space-4); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .fb-filterbox > summary { display: flex; align-items: center; justify-content: space-between; min-height: var(--target-min); font-weight: var(--weight-body-strong); cursor: pointer; list-style: none; }
  .fb-filterbox > summary::-webkit-details-marker { display: none; }
  .fb-filterbox > summary::after { content: "Show"; font-weight: var(--weight-body); color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
  .fb-filterbox[open] > summary::after { content: "Hide"; }
  .fb-filterbox .fb-filters { display: grid; grid-template-columns: 1fr 1fr; padding: 0 0 var(--space-4); margin: 0; }
  .fb-filters select { width: 100%; min-width: 0; }
  /* Tables become one block per row. */
  .fb-table thead { display: none; }
  .fb-table, .fb-table tbody, .fb-table tr, .fb-table td { display: block; width: 100%; }
  .fb-table tr { padding: var(--space-3) 0; border-top: 1px solid var(--rule); }
  .fb-table tr:first-child { border-top: 0; }
  .fb-table td { border: 0; padding: var(--space-1) 0; text-align: right; }
  .fb-table td::before { content: attr(data-label); float: left; color: var(--ink-muted); text-align: left; }
  .fb-table td:first-child { font-weight: var(--weight-body-strong); text-align: left; }
  .fb-table td:first-child::before { content: none; }
  .fb-table td:first-child a { display: inline-flex; align-items: center; min-height: var(--target-min); }
  .fb-table td.fb-none { display: none; }
  .fb-head { flex-direction: column; gap: 0; }
  .fb-actions a { flex: 1 1 100%; }
  .fb-actions button { flex: 1; }
}

/* ======================= phones and touch ======================= */
/* Touch: every control is at least 44px to tap. */
@media (pointer: coarse) {
  .clock-inner { min-width: calc(var(--span) * 19px); }
  .thumb { min-width: var(--target-min); }
}
/* Phones: one-handed layout. */
@media (max-width: 599px) {
  /* Build my deck sits in a bar at the bottom, in reach of a thumb. A hairline, no shadow. */
  #buildBar:not(:empty) { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; margin: 0; background: var(--surface); border-top: 1px solid var(--rule); padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom)); }
  #buildBar .adj-bar { flex-wrap: nowrap; gap: var(--space-3); max-width: none; }
  #buildBar .adj-bar .adj-main { flex: 1 1 auto; min-width: 0; font-size: var(--text-small); line-height: var(--leading-small); }
  #buildBar .adj-bar .adj-main .adj-sub, #buildBar .adj-bar .adj-main ul { display: none; }
  #buildBar .adj-bar button[data-adj-build], #buildBar a.adj-download { flex: none; padding: 0 var(--space-4); }
  body:has(#buildBar:not(:empty)) main { padding-bottom: calc(var(--space-8) + var(--space-7) + env(safe-area-inset-bottom)); }
  /* The source panel becomes a bottom sheet with a grabber. */
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 85vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; transform: translateY(100%); padding: var(--space-2) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom)); }
  .drawer::before { content: ""; display: block; width: 36px; height: 4px; border-radius: var(--radius-pill); background: var(--border); margin: 0 auto var(--space-1); }
  .drawer.open { transform: none; }
  .drawer-head { position: sticky; top: calc(-1 * var(--space-2)); z-index: 1; background: var(--surface); margin: 0 calc(-1 * var(--space-4)) var(--space-3); padding: 0 var(--space-2) var(--space-2) var(--space-4); }
}

/* ======================= flow v2: Tonight ======================= */
ul.lessons .lesson-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-4); align-items: center; padding: var(--space-3) var(--space-1); }
ul.lessons .lesson-row .name { display: inline-flex; align-items: center; min-height: var(--target-min); color: var(--ink); text-decoration: none; }
ul.lessons .lesson-row .name:hover { text-decoration: underline; }
ul.lessons .lesson-row .sub { grid-column: 1; }
ul.lessons .lesson-row .next { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
.btn-link-primary, .btn-link-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: var(--target-min); padding: 0 var(--space-5); border-radius: var(--radius-md); font-weight: var(--weight-body-strong); text-decoration: none; white-space: nowrap; }
.btn-link-primary { background: var(--accent); color: var(--on-accent); }
.btn-link-primary:hover { background: var(--accent-hover); color: var(--on-accent); text-decoration: none; }
.btn-link-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.btn-link-secondary:hover { background: var(--surface-sunken); color: var(--ink); text-decoration: none; }
@media (max-width: 599px) { ul.lessons .lesson-row { grid-template-columns: 1fr; } ul.lessons .lesson-row .next { grid-column: 1; grid-row: auto; justify-self: start; } }

/* ======================= flow v2: the lesson workspace ======================= */
body.workspace main { max-width: 1440px; padding-top: 0; }
body.workspace header.top { max-width: 1440px; }
.ws-bar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3) var(--space-5); padding: var(--space-3) 0; background: var(--bg); border-bottom: 1px solid var(--rule); }
.ws-title .deckname { font-size: var(--text-body); }
.ws-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-1); }
.ws-steps button { min-height: var(--target-min); padding: 0 var(--space-3); background: transparent; border: 0; color: var(--ink-muted); font-weight: var(--weight-body); gap: var(--space-2); }
.ws-steps button:hover { background: var(--surface-sunken); }
.ws-steps button:disabled { background: transparent; color: var(--ink-muted); opacity: 0.6; }
.ws-steps .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-pill); border: 1.5px solid currentColor; font-size: var(--text-numeral); line-height: 1; }
.ws-steps .is-on button { color: var(--accent); font-weight: var(--weight-body-strong); background: var(--accent-soft); }
.ws-steps .is-on .num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ws-steps .is-done button { color: var(--met); }
.ws-primary { justify-self: end; }
@media (max-width: 959px) { .ws-bar { grid-template-columns: minmax(0, 1fr) auto; } .ws-steps { grid-column: 1 / -1; grid-row: 2; } }
@media (max-width: 599px) {
  .ws-bar { position: static; grid-template-columns: 1fr; }
  .ws-steps { grid-row: auto; }
  .ws-steps li:not(.is-on) .ws-step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ws-primary { justify-self: stretch; }
  .ws-primary > * { width: 100%; }
}
.ws-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); margin-top: var(--space-5); align-items: start; }
@media (min-width: 960px) { .ws-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-7); } .ws-panel { position: sticky; top: 96px; max-height: calc(100vh - 112px); overflow-y: auto; padding-right: var(--space-1); } }
.ws-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }
.ws-panel { min-width: 0; }
.ws-time { margin: 0; max-width: var(--measure); }
.ws-time .over { color: var(--before-you-teach); }
/* The large slide, now and after the change */
.ba { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (min-width: 600px) { .ba.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ba figure { margin: 0; min-width: 0; }
.ba-before img, .ba-after img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.ba-before a { display: block; }
.ba figcaption { margin-top: var(--space-2); font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.ba .slide-preview { max-width: none; }
.ba .slide-card { aspect-ratio: 16 / 9; }
.ba-none { display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink-muted); font-weight: var(--weight-body-strong); }
.ws-stage .clock { margin-top: 0; }
.film .clock-scroll { padding-top: var(--space-6); }
.film .clock-phases { margin-top: var(--space-1); }
/* The fixes panel */
.ws-tabs { display: flex; gap: var(--space-4); border-bottom: 1px solid var(--rule); margin-bottom: var(--space-4); }
.ws-tabs button { min-height: var(--target-min); padding: 0 var(--space-1); background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--ink-muted); font-weight: var(--weight-body); }
.ws-tabs button:hover { background: transparent; color: var(--ink); }
.ws-tabs button[aria-selected="true"] { color: var(--ink); font-weight: var(--weight-body-strong); border-bottom-color: var(--accent); }
.ws-summary { margin: 0 0 var(--space-4); }
.ws-summary h1 { font-size: var(--text-title); line-height: var(--leading-title); }
.ws-panel .fixes { max-width: none; }
.ws-panel .fix-toggle { padding: var(--space-3); grid-template-columns: 24px minmax(0, 1fr) 20px; align-items: start; border-radius: var(--radius-md); }
.ws-panel .fix-toggle:hover { background: var(--surface-sunken); }
.ws-panel .fix-headline { grid-column: 2; grid-row: 1; }
.ws-panel .fix-meta { grid-column: 2; grid-row: 2; justify-content: flex-start; }
.ws-panel .chev { grid-column: 3; grid-row: 1; }
.ws-panel .fix-detail { padding: 0 var(--space-4) var(--space-5) var(--space-7); gap: var(--space-4); }
/* The open fix is a card: white ground and a border, with a larger headline. The closed ones are plain rows. */
.ws-panel .fix.open { background: var(--surface); border-color: var(--border); margin: var(--space-2) 0; }
.ws-panel .fix.open .fix-toggle:hover { background: none; }
.ws-panel .fix.open .fix-headline { font-size: var(--text-heading); line-height: var(--leading-heading); }
.ws-panel .fix.open .fix-no { min-width: 28px; height: 28px; }
.fix.is-reject .fix-headline { color: var(--ink-muted); }
.prep { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
/* The three choices: one row of equal buttons. The chosen one is solid, like the class choices on upload. */
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.choices button { padding: 0 var(--space-2); background: var(--surface); color: var(--ink); border-color: var(--border); text-align: center; }
.choices button:hover { background: var(--surface-sunken); }
.choices button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.deep .why { margin: var(--space-3) 0 var(--space-2); }
details.later { margin-top: var(--space-4); }
details.later > summary { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-4); background: var(--surface-sunken); border-radius: var(--radius-md); list-style: none; align-items: center; min-height: var(--target-min); cursor: pointer; color: var(--accent); font-weight: var(--weight-body-strong); }
details.later > summary::-webkit-details-marker { display: none; }
details.later > summary:hover { text-decoration: underline; }
details.later > summary .why-chev { flex: none; }
details.later[open] > summary { margin-bottom: var(--space-3); }
details.later[open] > summary .why-chev { transform: translateY(2px) rotate(-135deg); }
.ws-panel .panel { margin-bottom: var(--space-6); }
/* Phone: the choice for the open fix sits in a bar at the bottom. */
.ws-decide { display: none; }
@media (max-width: 599px) {
  .ws-decide:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-2); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--rule); }
  .ws-decide button { padding: 0 var(--space-2); font-size: var(--text-small); }
  .ws-decide button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
  body.workspace:has(.ws-decide:not([hidden])) main { padding-bottom: calc(var(--space-8) + var(--space-6) + env(safe-area-inset-bottom)); }
  .ws-panel .choices { display: none; }
}
/* Step 2 and 3 */
.ws-check, .ws-narrow { max-width: 960px; margin-top: var(--space-6); }
.ws-narrow { max-width: 640px; }
.ba-list { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; gap: var(--space-7); }
.ba-row { display: grid; gap: var(--space-3); }
.ba-note { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; justify-content: space-between; }
.ba-note p { margin: 0; max-width: var(--measure); }
.todo { margin-top: var(--space-7); }
.actions-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-5) 0; }

/* Source card: a pop-up anchored to the link; a bottom sheet on phones. Shadow only, no edge. */
.src-scrim { position: fixed; inset: 0; z-index: 56; background: var(--scrim); }
.src-card { position: absolute; z-index: 57; width: min(440px, calc(100vw - var(--space-5))); max-height: 60vh; overflow-y: auto; padding: var(--space-4) var(--space-5) var(--space-5); background: var(--surface); color: var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay); }
.src-card-head { display: grid; grid-template-columns: minmax(0, 1fr) var(--target-min); gap: var(--space-2); align-items: start; margin-bottom: var(--space-3); }
.src-card-head h2 { margin: var(--space-2) 0 0; font-size: var(--text-heading); line-height: var(--leading-heading); }
.src-card-head h2:focus { outline: none; }
.src-card .from { margin: var(--space-1) 0 0; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.src-card .from .who { font-weight: var(--weight-body-strong); }
.src-card .from .who.trust { color: var(--source-trust); }
.src-card .from .who.public { color: var(--source-national); }
#srcSection:not(:empty)::before { content: ", "; }
.src-card-link { margin: 0; }
.src-card-link a { display: inline-flex; align-items: center; min-height: var(--target-min); }
.src-card.is-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 80vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: var(--space-2) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom)); }
.src-card.is-sheet::before { content: ""; display: block; width: 36px; height: 4px; border-radius: var(--radius-pill); background: var(--border); margin: 0 auto var(--space-2); }

/* ======================= flow v2 polish: a stage that never moves ======================= */
/* One slide in a fixed 16:9 frame. The switch row, the change line and the navigation have fixed heights,
   so moving between slides never moves the buttons, the fixes panel or the filmstrip. */
.stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.stage-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--target-min); }
.stage-label { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.stage-tools { display: flex; gap: var(--space-4); }
.stage-tools button.link { min-height: var(--target-min); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.seg button { min-height: var(--target-min); padding: 0 var(--space-4); border: 0; border-radius: 0; background: var(--surface); color: var(--ink); font-weight: var(--weight-body); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--surface-sunken); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: var(--weight-body-strong); }
.stage-frame { position: relative; aspect-ratio: 16 / 9; width: 100%; overflow: hidden; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-sm); touch-action: pan-y; }
.stage-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage-frame .slide-card.fill { position: absolute; inset: 0; border-radius: 0; box-shadow: none; overflow: auto; cursor: auto; }
.stage-frame .slide-card.notes { background: var(--surface-sunken); }
.stage-frame .ba-none { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; padding: var(--space-5); text-align: center; }
.stage-change { margin: 0; height: calc(3 * var(--leading-small)); overflow-y: auto; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink); }
.stage-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); }
.stage-count { text-align: center; font-size: var(--text-small); color: var(--ink-muted); }
.stage-nav button { min-width: 112px; }
.stage-nav button:disabled { background: var(--surface); color: var(--ink-muted); border-color: var(--rule); }
/* Build progress, shown in the frame */
.build-progress { position: absolute; inset: 0; display: grid; align-content: center; gap: var(--space-3); padding: var(--space-5) var(--space-6); overflow: auto; }
.build-title { margin: 0; font-size: var(--text-heading); line-height: var(--leading-heading); font-weight: var(--weight-heading); }
.build-now { margin: 0; }
@media (prefers-reduced-motion: reduce) { .build-progress .bar > span { transition: none; } }
@media (max-width: 599px) { .build-progress { padding: var(--space-3) var(--space-4); gap: var(--space-2); } .build-progress .steps { display: none; } }

/* The filmstrip fits the width; rows wrap instead of scrolling. Timing is an estimate: a neutral bell. */
.film #film { display: grid; gap: var(--space-4); padding-top: var(--space-5); overflow-x: clip; }
.film .clock-inner.film-row { min-width: 0; width: 100%; }
.film .clock-scale { --h: 24px; }
.film .clock-bell { z-index: 0; border-left-color: var(--ink-muted); border-left-width: 2px; animation: none; top: 0; }
.film .bell-tick { border-left-color: var(--ink-muted); height: 10px; }
.film .bell-tick span { white-space: nowrap; color: var(--ink); font-weight: var(--weight-body-strong); transform: none; left: var(--space-1); }
.film .bell-tick.end span { left: auto; right: var(--space-1); }
.film .clock-bell span { color: var(--ink-muted); font-weight: var(--weight-body); }
.film .clock-slide .thumb.selected img { outline: 3px solid var(--accent); outline-offset: 1px; }
.film-time { margin: 0; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.time-note { color: var(--ink-muted); }

/* Choices from an earlier visit, and the Build button's list */
.earlier-note { margin: 0 0 var(--space-3); font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.earlier-note button.link { min-height: var(--target-min); }
.build-wrap { position: relative; display: inline-block; }
.build-tip { display: none; position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 20; width: max-content; max-width: min(360px, calc(100vw - var(--space-6))); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-overlay); font-size: var(--text-small); line-height: var(--leading-small); }
.build-tip b { display: block; margin-bottom: var(--space-1); }
.build-tip span { display: block; }
.build-wrap:hover .build-tip, .build-wrap:focus-within .build-tip { display: block; }
@media (max-width: 599px) { .build-wrap { display: block; } .build-tip { right: auto; left: 0; } }

/* Phones: the stage is full width with Previous and Next under it. */
@media (max-width: 599px) { .stage-nav button { min-width: 0; padding: 0 var(--space-4); } }
.change-list { margin: 0; }

/* Why this matters: a secondary button under the choices. The standard a fix serves, in the trust's colour. */
/* Why this matters opens more reading, so it looks like a link with an icon, not like the choice buttons. */
details.why-box > summary { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0; border: 0; background: none; color: var(--accent); font-size: var(--text-body); font-weight: var(--weight-body-strong); list-style: none; cursor: pointer; }
details.why-box > summary::-webkit-details-marker { display: none; }
details.why-box > summary:hover span:first-of-type { text-decoration: underline; text-underline-offset: 3px; }
.why-icon { width: 20px; height: 20px; flex: none; }
.why-chev { width: 8px; height: 8px; margin-left: var(--space-1); border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--duration-base) var(--ease-standard); }
details.why-box[open] .why-chev { transform: translateY(2px) rotate(-135deg); }
details.why-box .why { margin: var(--space-3) 0 var(--space-1); font-size: var(--text-body); line-height: var(--leading-body); color: var(--ink); }
details.why-box .chips { display: grid; gap: 0; }
.serves { margin: 0; }
.serves .src { font-size: var(--text-body); line-height: var(--leading-body); padding: var(--space-2) 0; }
.ws-tabs .tab-count { margin-left: var(--space-2); color: var(--source-trust); font-weight: var(--weight-body-strong); }
.gaps-summary { margin: 0 0 var(--space-4); color: var(--source-trust); }
.gaps-summary b { font-weight: var(--weight-body-strong); }
.gaps-summary .glyph { color: var(--met); }

/* ======================= check the new deck: what changed ======================= */
/* The slide sits in a box with its own shape, so a ring placed in slide fractions lands on the right part. */
.stage-frame > .shot { position: absolute; inset: 0; margin: auto; height: 100%; max-width: 100%; }
.shot img { display: block; width: 100%; height: 100%; }
.ring { position: absolute; border: 3px solid var(--accent); border-radius: var(--radius-md); box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
.check-card { display: grid; gap: var(--space-3); padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.check-card p { margin: 0; }
.check-head { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.check-count { color: var(--ink); font-weight: var(--weight-body-strong); }
.check-fix { display: flex; align-items: flex-start; gap: var(--space-3); font-weight: var(--weight-body-strong); }
.check-fix .fix-no { flex: none; }
.check-what { max-width: 62ch; }
.check-why { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--surface-sunken); border-radius: var(--radius-sm); }
.check-why-label { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); font-weight: var(--weight-body-strong); }
.check-reason { max-width: 62ch; }
.diff { display: grid; gap: var(--space-2); }
.diff-head { font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-body-strong); }
.diff dl { display: grid; gap: var(--space-2); margin: 0; }
.diff dl > div { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--space-3); align-items: baseline; }
.diff dt { font-size: var(--text-small); color: var(--ink-muted); }
.diff dd { margin: 0; white-space: pre-line; }
.diff del { color: var(--ink-muted); text-decoration-color: var(--before-you-teach); text-decoration-thickness: 2px; }
.diff ins { text-decoration: none; background: var(--met-soft); color: var(--ink); padding: 0 var(--space-1); border-radius: var(--radius-sm); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.diff-more summary { cursor: pointer; color: var(--accent); font-size: var(--text-small); min-height: var(--target-min); display: inline-flex; align-items: center; }
.diff-more p { white-space: pre-line; color: var(--ink-muted); font-size: var(--text-small); line-height: var(--leading-small); }
.check-panel .todo { margin-top: var(--space-6); }
.check-panel .todo h2 { margin-bottom: var(--space-1); }
.check-panel .todo .muted { margin: 0 0 var(--space-3); }
.diff-notes { white-space: pre-line; font-size: var(--text-small); line-height: var(--leading-small); }
.fix-steps { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-2); max-width: 62ch; }
.fix-steps li { padding-left: var(--space-1); }
.fix-steps li::marker { font-family: var(--font-mono); font-weight: var(--weight-body-strong); color: var(--ink-muted); }

/* The trust's mark beside everything from the trust, so trust material stands apart from national material. */
.trust-mark { display: inline-block; width: 24px; height: 24px; margin-right: var(--space-2); vertical-align: -5px; object-fit: contain; }
.src.trust:has(.trust-mark)::before { display: none; }
h2.with-mark { display: flex; align-items: center; }
h2.with-mark .trust-mark { width: 32px; height: 32px; vertical-align: middle; }
.structure-title .trust-mark { vertical-align: -4px; }
.ws-summary.overview { display: grid; gap: var(--space-4); margin-bottom: var(--space-5); }
.ws-summary.overview p { margin: 0; }
.overview-verdict { font-size: var(--text-heading); line-height: var(--leading-heading); font-weight: var(--weight-body-strong); text-wrap: pretty; max-width: 40ch; }
/* Arriving from a standard: a banner names it and the fixes that deal with it. */
.from-standard-banner { display: grid; gap: var(--space-1); margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); background: var(--trust-soft); border-radius: var(--radius-md); color: var(--ink); font-size: var(--text-body); line-height: var(--leading-body); }
.from-standard-banner p { margin: 0; }
.from-head { display: flex; align-items: flex-start; gap: var(--space-1); }
.from-head .trust-mark { flex: none; margin-top: 0; vertical-align: 0; }
.from-fixes { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.from-actions { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
.from-actions button.link { min-height: var(--target-min); font-size: var(--text-small); }
/* Filmstrip markers take the colour of the fix they number, not of the slide's most urgent fix. */
.clock-slide .marker.r0 { background: var(--before-you-teach); }
.clock-slide .marker.r1 { background: var(--worth-doing); }
.clock-slide .marker.r2 { background: var(--if-time); }

/* What works well and Check yourself: same layout. Glyph and heading on one line; the text and bullets
   start under the heading text, so every left edge lines up. */
.aside-blocks { display: grid; gap: var(--space-5); margin-top: var(--space-6); }
.aside-block { display: grid; gap: var(--space-1); font-size: var(--text-small); line-height: var(--leading-small); }
.aside-head { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-weight: var(--weight-body-strong); color: var(--ink); }
.aside-head .glyph { width: 16px; height: 16px; color: var(--ink-muted); }
.aside-block.works .aside-head .glyph { color: var(--met); }
.aside-body { padding-left: var(--space-5); }
.aside-body p { margin: 0; max-width: 62ch; }
.aside-body ul { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); max-width: 62ch; }
.aside-body ul li { list-style: disc; }

/* Sprint 2: optional slides, grouped fixes, the overview's carry-on line */
.film .clock-slide .thumb.optional img { opacity: 0.4; border-style: dashed; }
details.fix-group { margin-top: var(--space-2); }
details.fix-group > summary { display: flex; align-items: center; gap: var(--space-3); min-height: var(--target-min); padding: var(--space-2) var(--space-4); cursor: pointer; list-style: none; font-weight: var(--weight-body-strong); border-bottom: 1px solid var(--rule); }
details.fix-group > summary::-webkit-details-marker { display: none; }
details.fix-group > summary:hover span:first-child { text-decoration: underline; }
details.fix-group .fix-group-count { margin-left: auto; color: var(--ink-muted); font-weight: var(--weight-body); font-size: var(--text-small); line-height: var(--leading-small); }
details.fix-group > summary .why-chev { flex: none; }
details.fix-group[open] > summary .why-chev { transform: translateY(2px) rotate(-135deg); }
details.fix-group[hidden] { display: none; }
.overview-go { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.lesson-remove { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: 0; padding: 0 var(--space-1) var(--space-2); font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.lesson-remove button.link { min-height: var(--target-min); }
.lesson-remove button.link.danger { color: var(--before-you-teach); }
/* Help page */
main.help { max-width: 70ch; }
main.help h2 { margin: 0 0 var(--space-2); font-size: var(--text-heading); line-height: var(--leading-heading); }
main.help p, main.help li { text-wrap: pretty; }
main.help section { margin-top: var(--space-7); }
main.help ul { padding-left: var(--space-5); display: grid; gap: var(--space-2); }
.help-steps { margin: var(--space-6) 0 0; padding-left: var(--space-5); display: grid; gap: var(--space-6); }
.help-steps > li::marker { font-family: var(--font-mono); font-weight: var(--weight-body-strong); font-size: var(--text-heading); color: var(--ink-muted); }
.help-steps > li > p { margin: 0 0 var(--space-2); }
header.top .tenant + .tenant { margin-left: var(--space-4); }

/* The standards again on the download step: each gap the new deck closes, with its standard under it. */
.std-after h2 { margin-bottom: var(--space-1); }
.std-after h2:not(:first-child) { margin-top: var(--space-6); }
.std-after .muted { margin: 0 0 var(--space-3); }
.std-after li { margin-bottom: var(--space-3); }
.std-after .std-fix { margin: 0; font-weight: 600; }
.std-after .serves { margin: var(--space-1) 0 0; }
.std-after ul { list-style: none; padding-left: 0; }
.std-after .std-fix { display: flex; gap: var(--space-2); align-items: baseline; }

/* Sign-in page: one narrow column, the logo above it. */
body.sign-in main { max-width: 44ch; padding-top: var(--space-8); }
.sign-in-brand { margin-bottom: var(--space-7); color: var(--ink); }
.sign-in-brand .logo { display: block; height: 40px; width: auto; }
body.sign-in .lede { margin-bottom: var(--space-6); }
.sign-in-note { margin-top: var(--space-6); }
body.sign-in section > p { text-wrap: pretty; }
body.sign-in h1:focus { outline: none; } /* focus is moved here by script only, to say the new heading */
header.top button.sign-out { align-self: center; margin-left: var(--space-4); font-size: var(--text-small); }
header.top .reviews-left { align-self: center; margin-left: var(--space-4); font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); white-space: nowrap; }
header.top .reviews-left.none-left { color: var(--error); font-weight: var(--weight-body-strong); }
