/* ReadableSTEM web app. Plain CSS, no framework. Tokens (color, type, space, radius, fonts)
   are in tokens.css, which every page loads first; DESIGN.md says how they are used.
   Text is at least 7:1 on its background and nothing is smaller than 14px; focus rings are
   at least 3:1 against both the page and the control. Status is always written out in text;
   color only repeats it. Components are in the "Components" section; the /style page shows
   each one. */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  overflow-wrap: break-word;
}

.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--space-5); }

/* The type scale, in one place. Two kinds of screen: the ones people operate (the app: upload,
   documents, job page, review, Symbols, courses, account, admin) and the pages people read
   (body.mode-read: landing, guides, help, offices, privacy, terms, limits, pricing, security).
     operate: text 16px (--step-0); h1 --step-3, h2 --step-2, h3 --step-1, h4 --step-0
     read:    text 18px (--step-1); h1 --step-4, h2 --step-3, h3 --step-2, h4 --step-1
   Headings are Source Sans 3 700; on read pages h1 and h2 are Source Serif 4 600. `.hint` and
   `.small` are one step below the text (14px, and 16px on read pages). The header and footer
   are the same on every page, so they stay at 16px. No rule sets a heading's size by where it
   sits: a title that must be an h2 for the outline but should look smaller takes `.card-title`
   (below); anything else uses a lower level. The one named exception is the landing page's
   h1, which is display size. The student pages (pipeline/student_sheet.py) have their own sheet. */
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 700; line-height: var(--lh-head); text-wrap: balance; }
/* File names ("Ch2_Kinematics_lecture_notes_final_v3.pdf"), emails, URLs and codes often
   have no break points. `break-word` on the body wraps them in running text; `anywhere`
   also lowers the min-content width, so flex and grid items and the row headers of
   tables (file names, emails) shrink too: no sideways scrolling at 320 CSS px (WCAG
   1.4.10), also with the 1.4.12 text-spacing override. Other table cells keep whole
   words; a table wider than the screen scrolls inside its .table-scroll box. */
h1, h2, h3, .lede, summary, .error-summary, .error-message, tbody th { overflow-wrap: anywhere; }
h1 { font-size: var(--step-3); margin: var(--space-5) 0 var(--space-4); }
h2 { font-size: var(--step-2); margin: var(--space-6) 0 var(--space-3); }
h3 { font-size: var(--step-1); margin: var(--space-4) 0 var(--space-2); }
h4, h5, h6 { font-size: var(--step-0); margin: var(--space-4) 0 var(--space-2); }

.mode-read h1, .mode-read h2 { font-family: var(--font-display); font-weight: 600; }
.mode-read h1 { font-size: var(--step-4); line-height: var(--lh-head); letter-spacing: 0; margin: var(--space-6) 0 var(--space-4); }
.mode-read h2 { font-size: var(--step-3); margin: var(--space-7) 0 var(--space-3); }
.mode-read h3 { font-size: var(--step-2); }
.mode-read :is(h4, h5, h6) { font-size: var(--step-1); }
.mode-read { font-size: var(--step-1); }
.site-header, .site-footer { font-size: var(--step-0); }
/* The title of a card or box: a heading that must be an h2 or h3 in the outline but should not
   look as loud as the section titles. One size, 18px, on every kind of screen. */
:is(h1, h2, h3, h4, h5, h6).card-title { font-family: var(--font-sans); font-weight: 700; font-size: var(--step-1); }
/* A reading column of 68ch (about 65 to 75 characters a line). Tables, figures and the
   comparison keep the page width. */
.mode-read main > :is(p, ul, ol, dl, h1, h2, h3, h4, details, blockquote, pre, .hint, .crumb, .notice) { max-width: var(--prose-max); }

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:visited { color: var(--visited); }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

code, kbd, samp { font-family: var(--font-mono); font-size: max(0.875rem, 0.9em); }
code { overflow-wrap: anywhere; }
/* A script inside a script is as large as the script it is in (the student sheet's rule):
   the browser's "smaller" would take another step down on each level. */
sub sub, sub sup, sup sub, sup sup { font-size: inherit; }

/* Focus: thick dark ring with a light halo, visible on every background. In dark mode the
   ring is yellow with a dark gap. */
:focus-visible {
  outline: 3px solid var(--focus-outline);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-halo);
}
main:focus { outline: none; }

::selection { background: var(--accent); color: var(--on-accent); }

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -10rem;
  padding: var(--space-2) var(--space-4);
  background: var(--bg);
  color: var(--accent);
  border: 2px solid var(--focus-outline);
  border-radius: var(--radius-control);
  z-index: var(--z-skip);
}
.skip-link:focus { top: var(--space-2); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Less motion: no scrolling animation, transitions or animations at all. */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ============================================================== Components
   Each is shown, with its states, on /style (templates/style.html). */

/* Header: the brand, the main navigation, and Sign in. Below 40rem the navigation folds
   into a disclosure ("Menu"); it is a <details> that app.js closes on a narrow screen, so
   without JavaScript the links are simply all shown. */
.site-header { border-bottom: 1px solid var(--border-subtle); background: var(--bg); }
.header-row { position: relative; display: flex; align-items: center; gap: var(--space-2) var(--space-5); min-height: 4rem; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.brand { display: inline-flex; align-items: center; min-height: 2.75rem; gap: var(--space-2); font-weight: 700; font-size: var(--step-1); color: var(--ink); text-decoration: none; }
.brand:visited, .brand:hover { color: var(--ink); }
.brand svg { width: 1.5rem; height: 1.5rem; flex: none; }
.nav-menu { margin-left: auto; }
.nav-menu > summary { display: none; list-style: none; cursor: pointer; min-height: 2.75rem; align-items: center; padding: 0 var(--space-4); border: 2px solid var(--border-control); border-radius: var(--radius-control); font-weight: 700; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu::details-content { content-visibility: visible; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); align-items: center; }
.nav-list a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }
.nav-list a:visited { color: var(--ink); }
.nav-list a:hover, .nav-list a:focus-visible { text-decoration: underline; text-decoration-thickness: 2px; }
.nav-list a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.3em; }
/* Signed in: the workspace links first, the public ones quieter. */
.nav-list .nav-secondary a, .nav-list .nav-secondary a:visited { color: var(--ink-muted); }
.account { display: flex; align-items: center; gap: var(--space-3); }
.account .link-button { min-height: 2.75rem; }
.account .button-small { min-height: 2.75rem; }
.signed-in { color: var(--ink-muted); margin-right: var(--space-2); max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
@media (max-width: 39.99rem) {
  .header-row { flex-wrap: wrap; column-gap: var(--space-2); }
  .brand { flex: 1 1 auto; }
  .nav-menu { margin-left: 0; order: 2; }
  .account { order: 3; }
  .nav-menu > summary { display: inline-flex; }
  .nav-menu[open] > summary { background: var(--surface-2); }
  .nav-menu[open] { order: 4; flex-basis: 100%; }
  .nav-menu:not([open])::details-content { content-visibility: hidden; }
  .nav-menu > nav { padding: var(--space-2) 0 var(--space-2); }
  .nav-menu .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-menu .nav-list a { width: 100%; border-bottom: 1px solid var(--border-subtle); }
  .signed-in { display: none; }
}
@media (forced-colors: active) {
  .nav-menu > summary { border-color: ButtonText; }
  .brand svg { forced-color-adjust: auto; }
}

/* Footer: four columns (Product, Trust, Guides, Source), two on a tablet, one on a phone. */
.site-footer { margin-top: var(--space-8); padding: var(--space-7) 0 var(--space-6); border-top: 1px solid var(--border-subtle); background: var(--surface); }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6) var(--space-5); }
.footer-cols h2 { margin: 0 0 var(--space-3); }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.footer-cols a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.footer-note { margin: var(--space-6) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); color: var(--ink-muted); }
@media (max-width: 52rem) { .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* On a phone each column's links run in a row that wraps, so 44px targets do not make the
   footer taller than the short pages above it. */
@media (max-width: 30rem) {
  .footer-cols { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .footer-cols ul { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); }
}

/* App (signed-in) pages: the trust and help links on one line; public pages keep the full
   footer. */
.site-footer-compact { padding: var(--space-3) 0 var(--space-4); margin-top: var(--space-6); }
.site-footer-compact .footer-note { margin-top: var(--space-2); padding-top: var(--space-2); }
.footer-compact-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
.footer-compact-links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
/* A confirmation page: the compact footer is one tight line of links, so the choice above it is
   not pushed down a phone. */
.page-confirm .site-footer-compact { margin-top: var(--space-5); padding: var(--space-3) 0; }
.page-confirm .footer-compact-links { gap: 0 var(--space-4); font-size: var(--step--1); }
.page-confirm .footer-note { margin-top: var(--space-3); padding-top: var(--space-2); }

.small { color: var(--ink-muted); max-width: 48rem; }
.hint, .small, .stat-note, .diff-source { font-size: var(--step--1); }
.mode-read :is(.hint, .small, .stat-note, .diff-source) { font-size: var(--step-0); }
/* A hint that is only a link ("Refresh the status") is a target of its own: 24px high at 14px text. */
.hint > a:only-child { display: inline-flex; align-items: center; min-height: 1.5rem; }

main { padding-bottom: var(--space-6); }
main :is(p, li, dd) { max-width: 75ch; }
.lede { font-size: var(--step-2); line-height: 1.5; color: var(--ink); }

/* Buttons (primary, secondary, danger, small, disabled, link) are in controls.css, shared with
   the listening player and the showcase. */
.inline-form { display: inline; margin: 0; max-width: 100%; }
.tool-section .inline-form { display: block; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li + li { margin-top: var(--space-2); }
.button-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.actions { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; }
/* Cancel and keep actions beside a button ("No, keep it" under a delete confirmation, the
   table cell and notation forms' Cancel): links with a target of at least 44px. The selectors
   cover the pages without touching their templates; `.cancel-link` is for a new one. */
.cancel-link, .inline-form + p > a:only-child, .inline-controls > a:not([class]), .actions > li > a:not([class]) { display: inline-flex; align-items: center; min-height: 2.75rem; }
.canvas-download { margin: var(--space-5) 0 0; max-width: 40rem; }
.canvas-download .hint { margin-bottom: var(--space-3); }
/* The link that opens a delete confirmation: red text on the page color. The label says what
   is deleted, so color is not the only cue (the button form is `.button-danger-outline`,
   controls.css). */
a.danger-link, a.danger-link:visited { color: var(--err); }
a.danger-link:hover { color: var(--err-strong); }
@media (forced-colors: active) { a.danger-link { color: LinkText; } }

/* Tags: a status in words. The color only repeats the word; the shape is a 4px box. */
.tag { display: inline-block; font-weight: 700; font-size: var(--step--1); line-height: 1.2; padding: 0.2em 0.55em; border: 1px solid currentColor; border-radius: var(--radius-control); background: var(--bg); }
.tag-warn { color: var(--warn); background: var(--warn-tint); }
.tag-ok { color: var(--ok); background: var(--ok-tint); }
.tag-err { color: var(--err); background: var(--err-tint); }
@media (forced-colors: active) { .tag { border: 1px solid CanvasText; } }

/* Card: a framed container, 8px radius. Headings in a card are h3 unless the card is a section. */
.card { border: 1px solid var(--border-subtle); border-radius: var(--radius-frame); background: var(--bg); padding: var(--space-5); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card-surface { background: var(--surface); }
@media (forced-colors: active) { .card { border: 1px solid CanvasText; } }

/* Stat tile: one number, what it counts, the set it comes from, and a link that says how it
   was measured. The number is never shown without its caveat link. */
.stat { border: 1px solid var(--border-subtle); border-radius: var(--radius-frame); background: var(--surface); padding: var(--space-4) var(--space-5); }
.stat-value { margin: 0; font-family: var(--font-sans); font-weight: 700; font-size: var(--step-3); line-height: var(--lh-head); font-variant-numeric: tabular-nums; }
.stat-label { margin: var(--space-1) 0 0; font-weight: 700; }
.stat-note { margin: var(--space-2) 0 0; color: var(--ink-muted); }
.stat-note a { white-space: nowrap; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
@media (forced-colors: active) { .stat { border: 1px solid CanvasText; } }

/* Disclosures: every <summary> has one of two looks, set here and nowhere else. Plain, the
   default: bold, a 44px target, the accent on the marker. Boxed: the summary of a details that
   has its own frame (.compact-item, .compare-topic): inset to the frame, a rule under it while
   open. Other rules may lay a summary out (flex, inline) but not restyle it. The header menu
   (.nav-menu > summary) keeps its own rules. */
summary { display: list-item; cursor: pointer; min-height: 2.75rem; padding: var(--space-2) 0; font-weight: 700; }
summary::marker { color: var(--accent); }
:is(.compact-item, .compare-topic) > summary { padding: var(--space-2) var(--space-4); list-style-position: inside; }
:is(.compact-item, .compare-topic)[open] > summary { border-bottom: 1px solid var(--border-subtle); }

/* FAQ: native <details>; the whole summary line is the target. */
.faq details { border-top: 1px solid var(--border-subtle); }
.faq details:last-child { border-bottom: 1px solid var(--border-subtle); }
.faq details > :not(summary) { padding: 0 var(--space-1); }
@media (forced-colors: active) { .faq details { border-color: CanvasText; } }

/* Two panes, equal width: the PDF and the page it became. They stack below 52rem, before
   first, in reading order. */
.panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.pane { border: 1px solid var(--border-subtle); border-radius: var(--radius-frame); background: var(--surface); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.pane > h2, .pane > h3 { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: baseline; }
@media (max-width: 51.99rem) { .panes { grid-template-columns: minmax(0, 1fr); } }
@media (forced-colors: active) { .pane { border: 1px solid CanvasText; } }

/* Forms */
.field { margin: 0 0 var(--space-4); }
.field label { display: block; font-weight: 700; margin-bottom: var(--space-1); }
.hint { color: var(--ink-muted); margin: 0 0 var(--space-2); }
input[type="text"], input[type="email"], input[type="number"], textarea, select, input[type="file"] {
  font: inherit;
  max-width: 100%;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--border-control);
  border-radius: var(--radius-control);
  background: var(--bg);
  color: var(--ink);
}
input[type="text"], input[type="email"], textarea { width: 40rem; }
/* An error summary link focuses its field at the top of the window; keep the label,
   hint and error message above it in view too. Only the fallback without JavaScript:
   app.js scrolls the whole field into view, which a fixed margin cannot do on a narrow
   screen where those lines wrap. */
input, select, textarea { scroll-margin-top: var(--space-9); }
textarea { font-family: var(--font-mono); font-size: max(0.875rem, 0.9em); }
/* A LaTeX box opens at six lines (its rows) and grows with what is typed, where the browser can. */
textarea[name="latex"] { field-sizing: content; min-height: calc(6lh + 2 * var(--space-1)); max-height: 60vh; }
.checkbox-field { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-2); align-items: start; }
.checkbox-field input { width: 1.5rem; height: 1.5rem; margin: var(--space-1) 0 0; }
.checkbox-field label { font-weight: 400; margin: 0; }
.checkbox-field .hint { grid-column: 2; }

/* The file chooser's button is a secondary button, as everywhere else. */
input[type="file"] { padding: var(--space-1); }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 700; min-height: 2.25rem; margin-right: var(--space-3); padding: 0 var(--space-4);
  border: 2px solid var(--accent); border-radius: var(--radius-control); background: var(--bg); color: var(--accent); cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--accent-tint); }
@media (forced-colors: active) { input[type="file"]::file-selector-button { border-color: ButtonText; } }

/* The field error (templates/components/fields.html), one block. A field in error is told by
   more than color: its edge at the start is thicker, and its message has the word "Error"
   (spoken) and a shape before it (drawn here, so the browser-built line of the upload form
   has it too). Forced colors drop the red, so both use CanvasText and a thicker frame, and the
   control gets a double edge. The compound selector outranks `fieldset.field` and
   `.table-fieldset` further down, which take a frame off. */
:is(.field, .table-fieldset, .fallback).field-error {
  border: 2px solid var(--err);
  border-inline-start-width: var(--space-2);
  border-radius: var(--radius-control);
  padding: var(--space-3) var(--space-4);
}
.error-message { color: var(--err); font-weight: 700; margin: 0 0 var(--space-2); }
.error-message::before {
  content: "";
  display: inline-block;
  inline-size: 1.1em;
  block-size: 1.1em;
  margin-inline-end: 0.4em;
  vertical-align: -0.2em;
  background-color: currentcolor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 5h2.4v7h-2.4zm0 9h2.4v2.4h-2.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 5h2.4v7h-2.4zm0 9h2.4v2.4h-2.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
[aria-invalid="true"] { border-color: var(--err); }
@media (forced-colors: active) {
  :is(.field, .table-fieldset, .fallback).field-error {
    border: 3px solid CanvasText;
    border-inline-start-width: var(--space-2);
  }
  .error-message::before { background-color: CanvasText; }
  [aria-invalid="true"] { border-width: 4px; border-style: double; }
}
.error-summary {
  border: 4px solid var(--err);
  border-radius: var(--radius-frame);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) 0 var(--space-5);
}
.error-summary h2 { margin-top: var(--space-1); }
.error-summary a { color: var(--err); font-weight: 700; }

/* The notice (templates/components/notices.html), one block: info (the default), success
   (the ok tint and a check shape), warning (a thicker warn frame). The error kind is the
   error summary above. A shape, not color alone, marks success; forced colors draw every
   kind with one CanvasText frame and the shape in CanvasText. */
.notice { border: 1px solid var(--border-subtle); border-radius: var(--radius-frame); background: var(--accent-tint); padding: var(--space-2) var(--space-4); margin: var(--space-4) 0; }
.notice p { margin: var(--space-1) 0; }
.notice-warning { background: var(--warn-tint); border: 2px solid var(--warn); }
.notice-warning h2 { margin-top: var(--space-1); }
.notice-success { background: var(--ok-tint); border: 2px solid var(--ok); display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3); }
.notice-success::before {
  content: "";
  inline-size: 1.25rem;
  block-size: 1.25rem;
  margin-top: var(--space-2);
  background-color: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.3 14.2-4.2-4.2 1.7-1.7 2.5 2.5 5.1-5.1 1.7 1.7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.3 14.2-4.2-4.2 1.7-1.7 2.5 2.5 5.1-5.1 1.7 1.7z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.notice-success > * { grid-column: 2; }
.draft-note { border: 2px dashed var(--warn); border-radius: var(--radius-control); padding: var(--space-2) var(--space-4); color: var(--warn); background: var(--warn-tint); }
@media (forced-colors: active) {
  .notice { border: 1px solid CanvasText; }
  .notice-success::before { background-color: CanvasText; }
}

/* Tables. `position: relative` makes the scroller the containing block of the
   absolutely positioned .visually-hidden button text inside it; otherwise that text
   escapes the scroller and widens the whole page. */
.table-scroll { overflow-x: auto; position: relative; }
table { border-collapse: collapse; width: 100%; margin: var(--space-2) 0 var(--space-4); }
caption { text-align: left; padding-bottom: var(--space-2); color: var(--ink-muted); }
th, td { text-align: left; padding: var(--space-2) var(--space-2); border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
thead th { border-bottom: 2px solid var(--border-control); background: var(--surface); }
tbody th { font-weight: 700; }
/* A scrolling box that can be reached with the keyboard (templates/_table_scroll.html). */
.table-scroll:focus-visible { outline-offset: 0; }
.num { text-align: right; }

/* Status badges: the text says the status; the color only repeats it. A small radius,
   not a pill: a long status wraps on a phone, and a pill's curve cut through the words. */
.status-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border: 2px solid var(--border-control);
  border-radius: var(--radius-control);
  font-weight: 700;
  font-size: var(--step-0);
  background: var(--bg);
}
.status-done, .fix-accepted, .fix-edited { border-color: var(--ok); color: var(--ok); }
.status-failed, .fix-failed { border-color: var(--err); color: var(--err); }
.status-running, .fix-needs_review { border-color: var(--warn); color: var(--warn); }
.status-decisions, .status-partial { border-color: var(--warn); color: var(--warn); }
.status-sample { border-color: var(--ink-muted); color: var(--ink-muted); }

.job-status { padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); }
.job-status p { margin: var(--space-1) 0; }
.progress-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.progress-row label { font-weight: 700; }
progress { width: 16rem; height: 1.1rem; }

.summary-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--space-2) var(--space-4); margin: var(--space-2) 0 var(--space-4); }
.summary-list div { background: var(--surface); padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); }
.summary-list dt { color: var(--ink-muted); }
.summary-list dd { margin: 0; font-weight: 700; }
/* An address or a file name: the full row, normal weight, breaking only at its <wbr> points. */
.summary-list .summary-long { grid-column: 1 / -1; }
.summary-list .summary-long dd { font-weight: 400; overflow-wrap: break-word; }
@media (forced-colors: active) { .summary-list div { border: 1px solid CanvasText; } }
/* A state's symbol (✓ fine, ⚠ needs attention, – not known) beside its word: the shape says it
   without color, and the word still says it to a screen reader (the symbol is aria-hidden). */
.state { margin-right: var(--space-1); }

/* Review cards */
.fix-list { list-style: none; padding: 0; margin: var(--space-5) 0; }
.fix-card { border: 2px solid var(--border-subtle); border-radius: var(--radius-frame); padding: var(--space-1) var(--space-4) var(--space-4); margin: 0 0 var(--space-5); }
.status-card-needs_review { border-color: var(--warn); }
.status-card-failed, .status-card-abstained { border-color: var(--err); }
.status-card-accepted, .status-card-edited { border-color: var(--ok); }
.fix-card h2 { margin-top: var(--space-4); }
.meta { font-weight: 400; color: var(--ink-muted); font-size: var(--step-0); }
.fix-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: var(--space-2) 0; }
.fix-meta dt { color: var(--ink-muted); font-size: var(--step-0); }
.fix-meta dd { margin: 0; }
.check-list { margin: 0; padding-left: var(--space-4); }
.fix-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4) var(--space-6); align-items: start; }
/* minmax(0, ...), not 1fr: a 1fr column never shrinks below its content's min-content
   width, so a wide equation would widen the page instead of scrolling in its own box. */
@media (max-width: 48rem) { .fix-body { grid-template-columns: minmax(0, 1fr); } }
.crop { margin: var(--space-2) 0; }
.crop img { max-width: 100%; height: auto; border: 1px solid var(--border-subtle); background: var(--paper); }
.crop figcaption { color: var(--ink-muted); font-size: var(--step--1); }
/* The PDF's picture of an item (templates/_crop.html): shown at the size its element has in the
   PDF, one scale for every crop, never shrunk or cut. One wider than its column scrolls inside
   its own focusable box; app.js shows the line under it when there is more to see, and an edge
   shadow while the right-hand end is out of view. */
.crop-box { position: relative; max-width: 100%; }
.crop-scroll { overflow-x: auto; max-width: 100%; }
.crop-scroll:focus-visible { outline-offset: 0; }
.crop-scroll .crop-image { display: block; max-width: none; max-height: none; flex: none; border: 1px solid var(--border-subtle); background: var(--paper); }
.crop-more { margin: var(--space-1) 0 0; color: var(--ink-muted); font-size: var(--step--1); }
.crop-box[data-more]::after {
  content: ""; position: absolute; top: 0; right: 0; width: 1.5rem; height: 100%; pointer-events: none;
  background: linear-gradient(to right, transparent, var(--border-control)); opacity: 0.45;
}
@media (forced-colors: active) { .crop-box[data-more]::after { background: none; border-right: 4px solid CanvasText; opacity: 1; } }
.mathml-preview { font-size: var(--step-2); padding: var(--space-3); background: var(--surface); border-radius: var(--radius-control); overflow-x: auto; }
@media (forced-colors: active) { .mathml-preview { border: 1px solid CanvasText; } }
/* An equation that is all chemistry has no style on its element symbols (the MathML carries
   intent on <math>; Speech Rule Engine would read an explicit style aloud). Draw them upright
   wherever MathML is shown: the proposal, the comparison rows, the item lines and tables. */
math[intent] mi { text-transform: none; }
.alt-proposal { background: var(--surface); padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); }
@media (forced-colors: active) { .alt-proposal { border: 1px solid CanvasText; } }
.review-form { margin-top: var(--space-4); border-top: 1px solid var(--border-subtle); padding-top: var(--space-4); }

/* Review screen: progress, sections, groups, folded decided fixes.
   Document text (headings, alt text, captions) and codes can be long unbroken strings. */
.review-progress { margin: var(--space-4) 0; }
.review-progress, .review-toc, .review-group, .fix-card { overflow-wrap: anywhere; }
.review-toc { background: var(--surface); border-radius: var(--radius-control); padding: var(--space-1) var(--space-4) var(--space-3); margin: var(--space-5) 0; }
@media (forced-colors: active) { .review-toc { border: 1px solid CanvasText; } }
.review-toc h2 { margin: var(--space-3) 0 var(--space-1); }
.review-toc ul { margin: 0; padding-left: var(--space-4); }
.review-group { border-top: 2px solid var(--border-subtle); margin-top: var(--space-6); }
.review-group:focus { outline: none; }
.group-count { font-weight: 400; color: var(--ink-muted); font-size: var(--step-0); }
.part-label { font-weight: 700; margin: var(--space-3) 0 var(--space-1); }
.fix-card :is(h3, h4, h5) { margin-top: var(--space-4); }
.review-section { margin-top: var(--space-6); }
.review-section:focus { outline: none; }
.group-members { margin-top: var(--space-4); }
.explained { margin: var(--space-2) 0; }
.explained p { margin: var(--space-1) 0; }
.check-list li { margin: var(--space-1) 0; }
.changed-note { border: 1px solid var(--ok); border-radius: var(--radius-control); background: var(--ok-tint); padding: var(--space-2) var(--space-4); margin: var(--space-3) 0; }
@media (forced-colors: active) { .changed-note { border: 1px solid CanvasText; } }
.heading-proposal { background: var(--surface); padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); font-weight: 700; }
@media (forced-colors: active) { .heading-proposal { border: 1px solid CanvasText; } }
.prose-input { font-family: inherit; }
.review-item { scroll-margin-top: var(--space-2); }
.review-item:focus { outline: none; }
.done-group { margin: var(--space-4) 0 var(--space-2); }
.done-list { margin: var(--space-2) 0 0 var(--space-4); }
.done-item { border-bottom: 1px solid var(--border-subtle); }
.done-item > .fix-card { margin-top: var(--space-2); }
.decided-box { margin-top: var(--space-3); }

/* ===================================================================== review screen
   One decision at a time beside the page it is on (templates/review_split.html).
   Marks on the page image: the position of each comes from /jobs/{id}/review/marks.css?page=N
   (the CSP allows no inline styles). Every mark is a link of at least 24 x 24 CSS px
   (WCAG 2.5.8), and status is in its number, shape and text, never its color alone:
   a decision is a numbered disc and a solid frame, an optional item a "Note" label and
   a dashed frame, an accepted item a tick and a dotted frame (shown on request). The
   marks keep their own colors in forced-colors mode: they sit on the page image, which
   stays white whatever the theme, and system colors could make them white on white. */


.wrap-review { max-width: var(--review-max); }
.review-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--space-3) var(--space-6); padding: var(--space-4) 0 var(--space-3); border-bottom: 1px solid var(--border-subtle);
}
.review-title { flex: 1 1 26rem; min-width: 0; }
.review-head h1 { margin: 0; }
.review-file { font-weight: 400; font-size: var(--step-0); color: var(--ink-muted); margin-left: var(--space-1); }
.review-lede { margin: var(--space-1) 0 0; max-width: 46rem; }
.review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); }
.review-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }


/* Decisions as numbered steps: made (filled, ticked), current (ringed), waiting (outlined). */
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1); }
.step {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 2rem; padding: 0 var(--space-2); border-radius: var(--radius-control);
  border: 2px solid var(--mark-required); color: var(--mark-required); background: var(--bg);
  font-weight: 700; font-size: var(--step-0); text-decoration: none;
}
.step:visited { color: var(--mark-required); }
.step-done, .step-done:visited { background: var(--ok); border-color: var(--ok); color: var(--on-mark); }
.step-done::after { content: "\2713"; font-size: var(--step--1); margin-left: var(--space-1); }
.step-current:focus-visible { box-shadow: 0 0 0 5px var(--focus-halo); }
.step-current { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--mark-current); }
.steps-count { margin: 0; color: var(--ink-muted); font-size: var(--step-0); }
.steps-bar { width: 12rem; height: 0.8rem; accent-color: var(--ok); }
@media (forced-colors: active) {
  .step { border: 2px solid CanvasText; }
  .step-current { outline: 3px solid Highlight; outline-offset: 2px; }
}

/* Layout: decision first in the DOM; on a wide screen the page sits on the left. */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
@media (min-width: 64rem) {
  .split {
    grid-template-columns: minmax(0, 1.12fr) minmax(24rem, 1fr);
    grid-template-areas: "page decision" "page optional";
    grid-template-rows: auto 1fr;
    align-items: start;
  }
  .decision-area { grid-area: decision; }
  .optional-area { grid-area: optional; }
  .page-area {
    grid-area: page; position: sticky; top: var(--sticky-offset);
    /* The window's height less what is above the pane (the header, with the window at the top:
       app.js measures --page-top) and the offset below it, so its lower edge is in the window
       on load; with no script it is the window less two offsets. */
    max-height: calc(100vh - var(--page-top, var(--sticky-offset)) - var(--sticky-offset)); display: flex; flex-direction: column;
  }
  .page-scroll { flex: 1 1 auto; min-height: 14rem; }
}
/* Short windows (400% zoom on a laptop): nothing sticks, so nothing hides content. */
@media (min-width: 64rem) and (max-height: 32rem) {
  .page-area { position: static; max-height: none; }
}

/* The decision */
.decision-area {
  background: var(--bg); border: 2px solid var(--border-subtle); border-radius: var(--radius-frame);
  padding: var(--space-4) var(--space-5) var(--space-4); box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  overflow-wrap: anywhere;
}
@media (max-width: 40rem) { .decision-area { padding: var(--space-4) var(--space-4) var(--space-4); } }
.panel-decision { border-color: var(--mark-required); }
.panel-done { border-color: var(--ok); }
.panel-item, .panel-notice { border-color: var(--mark-optional); }
/* The notice after a decision: what was done, and Undo. */
.decision-notice {
  margin: 0 0 var(--space-4); padding: var(--space-2) var(--space-3); border: 1px solid var(--ok);
  background: var(--ok-tint); border-radius: var(--radius-control);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-4);
}
.decision-notice p { margin: 0; }
/* The status line when nothing was saved: empty, and a note only when a key had nothing to do. */
.decision-status { margin: 0; }
.decision-status:has([data-key-note]:not(:empty)) { margin: 0 0 var(--space-4); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-control); background: var(--surface); border-radius: var(--radius-control); }
@media (forced-colors: active) { .decision-status:has([data-key-note]:not(:empty)) { border: 2px solid CanvasText; } }
.undo-form { margin: 0; }
.undo-form .link-button { min-height: 44px; min-width: 44px; padding: 0 var(--space-2); font-weight: 700; }
@media (forced-colors: active) { .decision-notice { border: 2px solid CanvasText; } }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.panel-head h2 { margin: 0; }
.panel-head h2:focus { outline: none; }
.panel-head h2:focus-visible { outline: 3px solid var(--focus-outline); outline-offset: 2px; }
.panel-sub { display: block; font-size: var(--step-0); font-weight: 400; color: var(--ink-muted); margin-top: var(--space-1); }
.pill {
  display: inline-block; margin: 0; padding: var(--space-1) var(--space-3); border: 2px solid; border-radius: var(--radius-control);
  font-weight: 700; font-size: var(--step--1); white-space: nowrap;
}
.pill-required { color: var(--mark-required); border-color: var(--mark-required); background: var(--tint-required); }
.pill-done { color: var(--ok); border-color: var(--ok); background: var(--ok-tint); }
.pill-optional { color: var(--mark-optional); border-color: var(--mark-optional); background: var(--surface); }
@media (forced-colors: active) { .pill { border: 2px solid CanvasText; } }
.why { margin: var(--space-4) 0 var(--space-1); }
.on-page { margin: 0 0 var(--space-4); font-size: var(--step-0); }

/* Same-size compare: the PDF crop and the proposal share one scale. The frame is a
   size container; marks.css gives each equation its natural width and the proposal's
   font size and left edge in cqw (percent of the crop's width). */
.compare { background: var(--surface); border-radius: var(--radius-frame); padding: var(--space-3) var(--space-4) var(--space-3); margin: var(--space-2) 0 var(--space-4); }
@media (forced-colors: active) { .compare { border: 1px solid CanvasText; } }
.compare .part-label { margin: 0 0 var(--space-2); }
.cmp-frame { container-type: inline-size; width: 100%; }
.cmp-label { margin: var(--space-1) 0 var(--space-1); font-size: var(--step--1); font-weight: 700; color: var(--ink-muted); }
.cmp-image:not(.table-crop) { width: 100%; }
.cmp-image { display: block; height: auto; background: var(--paper); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); }
.cmp-row { background: var(--paper); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); overflow-x: auto; padding: 0.15em 0; }
/* The proposal is drawn in the family LaTeX PDFs are set in (Computer Modern; Latin
   Modern Math is its OpenType math font, served from here as a WOFF2: static/vendor/fonts,
   GUST Font License), so a bold letter next to a plain one looks as it does in the crop
   above. The browser's default math font (Noto Sans Math on Linux) draws a plain omega
   as heavy as a bold Computer Modern one. Only downloaded when an equation is shown. */
@font-face {
  font-family: "Latin Modern Math";
  src: local("Latin Modern Math"), local("LatinModernMath-Regular"),
       url("/static/vendor/fonts/latinmodern-math-1.959.woff2") format("woff2");
  font-display: swap;
}
.cmp-math { white-space: nowrap; font-size: var(--step-3); line-height: 1.3; }
.cmp-math-plain { padding: var(--space-1) var(--space-2); }
.cmp-math math { font-size: inherit; font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", math; }
.cmp-math .flagged { outline: max(2px, 0.07em) solid var(--err); outline-offset: 0.06em; border-radius: 0.08em; }
.cmp-none { margin: 0; padding: var(--space-2); background: var(--paper); border: 1px dashed var(--border-control); }
.speech { margin: var(--space-2) 0 0; color: var(--ink-muted); }
.speech-label { font-weight: 700; }
@media (forced-colors: active) {
  .cmp-row, .cmp-none { border-color: CanvasText; }
  .cmp-math .flagged { outline-color: Highlight; }
}

/* "Hear this" next to a decision, and the Play controls on the landing page. */
.hear { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: var(--space-2) 0; }
.hear button[hidden] { display: none; }
.hear-note { color: var(--ink-muted); max-width: var(--prose-max); }
.hear-note:empty { display: none; }

/* Equation: the PDF's picture can be shown larger. */
.enlarge-link { display: inline-flex; align-items: center; min-height: 1.5rem; margin: var(--space-1) 0 var(--space-2); font-size: var(--step--1); }
@media (max-width: 63.99rem) { .enlarge-link { min-height: 2.75rem; } }
.enlarge-dialog { width: min(96vw, 60rem); max-height: 92vh; padding: var(--space-3); border: 2px solid var(--ink); border-radius: var(--radius-frame); background: var(--bg); color: var(--ink); }
.enlarge-dialog::backdrop { background: rgb(0 0 0 / 0.6); }
.enlarge-body { overflow: auto; max-height: 72vh; margin-bottom: var(--space-3); background: var(--paper); border: 1px solid var(--border-subtle); }
.enlarge-image { display: block; width: auto; min-width: 100%; max-width: none; height: auto; }

.diff-wrap { position: relative; }
.diff-table { width: 100%; margin: var(--space-1) 0 var(--space-2); font-size: var(--step-0); }
.diff-table caption { text-align: left; font-weight: 700; padding-bottom: var(--space-1); }
.diff-table th, .diff-table td { padding: var(--space-1) var(--space-2); overflow-wrap: anywhere; }
.diff-symbol { font-size: var(--step-1); font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", serif; }
.diff-what { color: var(--ink-muted); font-weight: 400; font-size: var(--step--1); }
.diff-meaning td:last-child strong { color: var(--err); }
.same-line { color: var(--ok); margin: 0 0 var(--space-3); font-size: var(--step-0); }
/* The two readings with the symbols that differ marked, and the lines that name their items. */
mark.said-diff {
  background: var(--tint-required); color: var(--ink); font-weight: 700; padding: 0 0.1em; border-radius: var(--radius-control);
  text-decoration: underline 2px var(--mark-required); text-underline-offset: 0.2em;
}
.text-layer { font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", serif; color: var(--ink); }
.said-key { font-size: var(--step--1); margin: var(--space-1) 0 0; }
.item-math {
  display: inline-block; max-width: 100%; overflow: hidden; vertical-align: middle; white-space: nowrap;
  font-family: var(--font-math);
}
.item-math math { display: inline; display: inline math; font-size: 1.05em; }
/* "What differs" on a phone: one row per symbol, each value with its column's name, so
   no word is broken mid-word to fit four columns. */
@media (max-width: 30rem) {
  .diff-table thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .diff-table, .diff-table caption, .diff-table tbody, .diff-table tr, .diff-table th,
  .diff-table td { display: block; }
  .diff-table tr { padding: var(--space-1) 0; border-bottom: 1px solid var(--border-subtle); }
  .diff-table th, .diff-table td { border: 0; padding: var(--space-1) 0; overflow-wrap: normal; }
  .diff-table td::before { content: attr(data-label) ": "; color: var(--ink-muted); }
}

/* The suggested fix for a difference that changes the meaning: one button, first. */
.suggest { margin: var(--space-4) 0 var(--space-3); }
.suggest .button { min-width: 7rem; min-height: 2.75rem; font-weight: 700; }
.suggest .hint { margin: var(--space-1) 0 0; }
code.latex { overflow-wrap: anywhere; }

/* The live check of an edit, and a draft put back after signing in again (or one that could
   not be kept). Existing colors only. */
.live-status { margin: var(--space-1) 0 0; font-size: var(--step-0); }
.live-check:empty { display: none; }
.live-check { margin-top: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--surface); border-radius: var(--radius-control); }
.live-check .cmp-label { margin-top: 0; }
.live-results { margin: var(--space-2) 0 0; padding-left: var(--space-4); }
.kept-draft { margin: var(--space-1) 0 0; padding: var(--space-1) var(--space-2); border: 1px solid var(--accent); border-radius: var(--radius-control); background: var(--accent-tint); }
p.draft-failed { border-color: var(--warn); background: var(--warn-tint); }
@media (forced-colors: active) { .kept-draft { border: 1px solid CanvasText; } }

/* A second reader's other readings of a doubtful symbol: plain buttons, none chosen, each a
   44 px target; the spoken result sits beside its button and wraps on a narrow screen. */
.chips { margin: var(--space-4) 0 var(--space-3); }
.chip-group { margin: var(--space-2) 0 var(--space-3); }
.chip-lead { margin: 0 0 var(--space-1); overflow-wrap: anywhere; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.chip-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.chip { min-height: 44px; min-width: 44px; font-weight: 700; max-width: 100%; white-space: normal; text-align: left; }
.chip-said { color: var(--ink-muted); overflow-wrap: anywhere; }
/* The other reading of a typed equation (the page witness's): its formula sits in the same
   framed row as the proposal, its button is a target of 44 px and wraps like the chips. */
.other-reading .cmp-row { margin: var(--space-1) 0 0; }
.other-reading .speech { margin: var(--space-1) 0 var(--space-2); }
.other-form { margin: var(--space-2) 0 var(--space-3); }
.other-form .button-secondary { min-height: 44px; min-width: 44px; font-weight: 700; max-width: 100%; white-space: normal; text-align: left; }
@media (forced-colors: active) {
  .chip, .other-form .button-secondary { border: 2px solid ButtonText; }
}
.unseen-line { color: var(--ink-muted); margin: 0 0 var(--space-3); font-size: var(--step-0); }
/* Also the summary line of an upload option group (set after the review screen's own bold). */
.group-state { display: block; font-weight: 400; color: var(--ink-muted); margin: var(--space-1) 0 0; max-width: var(--prose-max); }
.redo-lead { margin: var(--space-4) 0 0; }
.redo-lead + .decide-row { margin-top: var(--space-2); }
.region-image { display: block; max-width: 100%; height: auto; margin: var(--space-2) 0 var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); background: var(--paper); }
@media (max-width: 40rem) {
  /* On a phone a region picture is shown whole in the box a crop is shown in
     (templates/_crop.html), up to one and a half times the column: it scrolls sideways a
     little, its words stay large enough to read, and nothing of what the person has to judge
     is cut off. At its own size (three pixels a point for a heading's band) a heading would
     run off the screen. Without its size on the tag it keeps shrinking to the column. */
  .region-box .region-image[width] { max-width: 150%; }
}
.figure-view { margin: var(--space-2) 0 var(--space-3); }
.figure-view img { display: block; max-width: 100%; max-height: 22rem; height: auto; border: 1px solid var(--border-subtle); background: var(--paper); }
.figure-view figcaption { margin-top: var(--space-1); color: var(--ink-muted); }
/* A chart data table read from the image: an optional extra, offered under the figure. */
.data-offer { margin: var(--space-2) 0 var(--space-4); padding-top: var(--space-1); border-top: 1px solid var(--border-subtle); }
.cap-label { font-weight: 700; }
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: 0 0 var(--space-3); }
.facts dt { color: var(--ink-muted); font-size: var(--step--1); }
.facts dd { margin: 0; font-weight: 700; }
.group-question { margin: var(--space-4) 0 var(--space-1); }
.group-pages { margin: 0 0 var(--space-4); }
.aside-link { font-size: var(--step-0); }

/* A heading group: each heading on its own. */
.member-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.member { padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.member:first-child { border-top: 0; }
.member-where { margin: 0 0 var(--space-1); font-weight: 700; }
.member .region-image { margin: var(--space-1) 0 var(--space-2); }
.member .decide-row { margin: 0; }

/* The form: Accept and Reject on one row, the edit box folded until it is needed. */
.decide-form textarea { width: 100%; }
.decide-form .field { margin-bottom: var(--space-3); }
.field-inline .inline-controls { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.decide-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0 var(--space-1); }
.decide-row:focus { outline: none; }
.decide-row .button, .decide-row .button-secondary { min-width: 7rem; min-height: 2.75rem; font-weight: 700; }
@media (max-width: 40rem) { .decide-row .button, .decide-row .button-secondary { flex: 1 1 8rem; } }
.decide-note { font-size: var(--step--1); margin: var(--space-1) 0 0; }
.edit-box { margin: var(--space-2) 0 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-control); padding: 0 var(--space-4); }
.edit-box[open] { padding-bottom: var(--space-4); }
/* With JavaScript, a changed field makes Save edit the main button (app.js). */
.is-edited [data-role="save"] { background: var(--accent); color: var(--on-accent); }
.is-edited [data-role="accept"] { background: var(--bg); color: var(--accent); }
/* Review choices: the primary action is filled; "Accept anyway" (the proposal changes the
   meaning) is cautioned in the warning colors, and the option that keeps the original
   ("Keep as image", "Make bold text") is quiet, so none of them looks like Save edit.
   In forced colors the caution has a dashed border, so it differs without color. */
button[data-tone="caution"] { background: var(--warn-tint); color: var(--warn); border-color: var(--warn); }
button[data-tone="caution"]:hover { background: var(--warn-tint); color: var(--warn); border-color: var(--warn); text-decoration: underline; }
button[data-tone="quiet"] { background: var(--bg); color: var(--ink); border-color: var(--border-control); }
button[data-tone="quiet"]:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
@media (forced-colors: active) { button[data-tone="caution"] { border-style: dashed; } }
/* The details a person rarely needs: folded under "More about this item". Small controls here
   are at least 24px high. */
.tech { margin-top: var(--space-4); font-size: var(--step-0); }
/* "More about this item": the details and the report link, folded. */
.more-box { margin-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
.more-box .tech { margin-top: 0; }
.decision-nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.decision-nav a[rel="next"] { margin-left: auto; }
.done-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.shortcuts { margin-top: var(--space-4); font-size: var(--step--1); }
.shortcuts .part-label { margin: 0 0 var(--space-1); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); margin: var(--space-2) 0; }
.keys div { display: contents; }
.keys div[hidden] { display: none; }
.keys dd { margin: 0; }
kbd { border: 1px solid var(--border-control); border-bottom-width: 2px; border-radius: 4px; padding: 0 var(--space-1); background: var(--bg); }

/* The decision bar: the choices and what each one does, in one block that sticks to the bottom
   of the window on a wide, tall screen. */
.decision-bar {
  margin: var(--space-4) 0 var(--space-3); padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--border-control); border-radius: var(--radius-frame);
}
.decision-bar .bar-lead { margin: 0 0 var(--space-2); font-weight: 700; }
.decision-bar .decide-row { margin: 0 0 var(--space-2); }
.decision-bar .decide-note { margin: var(--space-1) 0 0; }
.decision-bar .error-message { margin-top: 0; }
@media (min-width: 64rem) and (min-height: 40rem) {
  .decision-area .decision-bar { position: sticky; bottom: var(--sticky-offset); z-index: var(--z-sticky); }
  /* A focused control above the bar is never under it: the bar's own height (measured by
     app.js; two rows of choices with their notes without it) is kept clear when focus scrolls. */
  html:has(.decision-area .decision-bar) { scroll-padding-bottom: calc(var(--decision-bar-height, 15rem) + var(--sticky-offset) + var(--space-2)); }
}
@media (forced-colors: active) { .decision-bar { border: 2px solid CanvasText; } }

/* What is kept apart from the choices: leaving the original, or the item out of the conversion. */
.fallback { margin: var(--space-5) 0 var(--space-3); padding: var(--space-3) 0 0; border-top: 1px dashed var(--border-control); }
fieldset.fallback { border-width: 1px 0 0; border-style: dashed; border-color: var(--border-control); border-radius: 0; min-width: 0; }
.fallback-title, fieldset.fallback > legend { font-weight: 700; color: var(--ink-muted); padding: 0; margin: 0 0 var(--space-2); }
fieldset.fallback > legend { padding-right: var(--space-2); }
.fallback .hint { margin: 0 0 var(--space-2); }
.fallback .checkbox-field { margin: var(--space-2) 0 var(--space-3); }
.fallback-choice { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-2); }
.fallback-choice .hint { margin: 0; flex: 1 1 16rem; }
.fallback .not-a-table { margin-top: var(--space-2); }
.saved-state { margin: var(--space-2) 0; font-weight: 700; color: var(--ok); }

/* Optional items */
.optional-area { overflow-wrap: anywhere; }
.optional-box { background: var(--surface); border-radius: var(--radius-frame); padding: var(--space-1) var(--space-4); }
@media (forced-colors: active) { .optional-box { border: 1px solid CanvasText; } }
.optional-box[open] { padding-bottom: var(--space-4); }
.optional-list { list-style: none; margin: 0; padding: 0; }
.optional-list li { padding: var(--space-2) 0; border-top: 1px solid var(--border-subtle); }
.optional-note { display: block; color: var(--ink-muted); font-size: var(--step-0); }
.optional-none { color: var(--ink-muted); margin: 0; }

/* The page */
.page-area { background: var(--desk); border-radius: var(--radius-frame); padding: var(--space-3) var(--space-4) var(--space-4); min-width: 0; }
.page-area:focus { outline: none; }
@media (max-width: 40rem) { .page-area { padding: var(--space-2); } }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-4); }
.page-head h2 { margin: 0; }
.page-of { font-weight: 400; color: var(--ink-muted); }
.page-step { margin: 0; display: flex; gap: var(--space-4); font-size: var(--step-0); }
.page-step a { display: inline-flex; align-items: center; min-height: var(--target-min); }
.page-list ol { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1); }
.page-chip {
  display: inline-flex; align-items: center; gap: var(--space-1); min-width: 2.25rem; min-height: 2rem;
  padding: 0 var(--space-2); justify-content: center; border: 1px solid var(--border-control); border-radius: var(--radius-control);
  background: var(--bg); color: var(--ink); text-decoration: none; font-size: var(--step--1);
}
.page-chip:visited { color: var(--ink); }
.page-chip:hover { border-color: var(--accent); }
.page-chip[aria-current="page"] { border: 2px solid var(--mark-current); font-weight: 700; }
@media (forced-colors: active) {
  .page-chip { border: 2px solid CanvasText; }
  .page-chip[aria-current="page"] { outline: 3px solid Highlight; outline-offset: 2px; }
}
.chip-count { background: var(--mark-required); color: var(--on-mark); border-radius: var(--radius-control); padding: 0 var(--space-2); font-size: var(--step--1); font-weight: 700; white-space: nowrap; }
@media (forced-colors: active) { .chip-count { border: 1px solid CanvasText; } }
.page-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-4); margin: var(--space-2) 0; font-size: var(--step--1); }
.toggle-accepted { margin-left: auto; display: inline-flex; align-items: center; min-height: 1.5rem; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); color: var(--ink); }
.legend li { display: inline-flex; align-items: center; gap: var(--space-1); }
.key {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem;
  padding: 0 var(--space-1); font-weight: 700; font-size: var(--step--1); line-height: 1;
}
/* The keys explain marks drawn on the white page image, so they are drawn on white with the marks'
   own (--pmark-*) colors, in the dark theme too. */
.key-required { background: var(--pmark-required); color: #fff; border-radius: 0.7rem; }
.key-optional { background: var(--paper); min-width: 1.9rem; border: 1.5px dashed var(--pmark-optional); border-radius: var(--radius-control); }
.key-repeat { background: var(--paper); color: var(--pmark-required); border: 2px solid var(--pmark-required); border-radius: 0.7rem; }
.key-accepted { background: var(--paper); min-width: 1.9rem; color: var(--pmark-accepted); border: 1.5px dotted var(--pmark-accepted); border-radius: var(--radius-control); }
@media (forced-colors: active) {
  /* The legend keys show what the marks look like, and the marks keep their colors. */
  .legend .key { forced-color-adjust: none; box-shadow: 0 0 0 1px #fff; }
}
.page-scroll {
  position: relative; overflow: auto; border-radius: 4px; background: var(--desk);
  max-height: 80vh; overscroll-behavior: contain;
}
.page-scroll:focus-visible { outline-offset: -3px; }
/* Review split: the page is reachable on a phone. Below the two-column layout the page keeps a
   legible size (about 1 CSS px per point) and scrolls inside its own region; "Show on the page"
   (and app.js) scroll it to the mark. The page itself never scrolls sideways. */
.back-to-decision, .page-scroll-hint { display: none; margin: 0; }
@media (max-width: 63.99rem) {
  .page-scroll { max-height: 75vh; }
  .back-to-decision { display: block; }
  .page-scroll-hint { display: block; margin: var(--space-2) 0 0; }
  .page-scroll-hint .button-small { margin-top: var(--space-1); }
  /* More page to the right: an edge shadow that goes when the page is scrolled to its end. */
  .page-scroll {
    background:
      linear-gradient(to right, var(--desk) 30%, transparent) left center / 2rem 100% no-repeat local,
      linear-gradient(to left, var(--desk) 30%, transparent) right center / 2rem 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / 0.35), transparent) left center / 0.75rem 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / 0.35), transparent) right center / 0.75rem 100% no-repeat scroll,
      var(--desk);
  }
}
/* At least 36rem wide at every window width (about 1 CSS px per point for a Letter page):
   web.marks sizes the clickable areas for that (MIN_PAGE_PX). Narrower, the page
   scrolls inside its region. */
.page-frame { position: relative; margin: 0 auto; min-width: 36rem; background: var(--paper); box-shadow: 0 1px 4px rgb(0 0 0 / 0.25); forced-color-adjust: none; }
.page-image { display: block; width: 100%; height: auto; }
@media (forced-colors: active) { .page-frame { border: 1px solid CanvasText; } }
.page-note { margin: var(--space-2) 0 0; font-size: var(--step-0); }
.page-failed:not([hidden]) { display: block; }
/* Fit the page to the screen: no sideways scrolling of the page image. */
.page-scroll.fit-width .page-frame { min-width: 0; }

/* A phone: the Decision / Page bar is a row above the decision, and stays at the bottom of the
   window only when the window is tall enough to spare the room (32rem). At 400% zoom on a
   laptop the window is 16rem tall, and a fixed bar took a quarter of it (F-412). */
.view-toggle { display: none; }
@media (max-width: 63.99rem) {
  .view-toggle { display: flex; gap: var(--space-2); padding: var(--space-2) 0; background: var(--bg); }
  .view-toggle a {
    flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 2.75rem;
    border: 2px solid var(--accent); border-radius: var(--radius-control); background: var(--bg);
    color: var(--accent); font-weight: 700; text-decoration: none;
  }
  .view-toggle a[aria-current="true"] { background: var(--accent); color: var(--on-accent); text-decoration: underline; text-underline-offset: 0.25em; }
}
@media (max-width: 63.99rem) and (min-height: 32rem) {
  .view-toggle {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-fixed);
    padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border-control);
  }
  .wrap-review { padding-bottom: 5rem; }
  html:has(.view-toggle) { scroll-padding-bottom: 5rem; } /* a focused control is never under the bar */
  /* The footer's last links stay above the bar when the page is scrolled to its end. */
  body:has(.view-toggle) .site-footer { padding-bottom: calc(var(--space-4) + 4rem); }
}
@media (forced-colors: active) {
  .view-toggle a { border-color: ButtonText; }
  .view-toggle a[aria-current="true"] { background: Highlight; color: HighlightText; border-color: Highlight; }
}

/* A mark is a link (the clickable area: at least 24 x 24 CSS px, overlapping no other
   mark; web.marks places it) with a frame inside that hugs the item. The link itself is
   invisible; clicks on the frame and the tag go to it. */
.box {
  position: absolute; display: block; min-width: 24px; min-height: 24px;
  border-radius: 4px; text-decoration: none; color: inherit;
}
/* marks.css gives each mark its frame inside the link (--fl, --ft, --fw, --fh) and, for an
   equation in a line of text, its number's place in the page margin (--tag-left). */
.box-frame {
  position: absolute; display: block; border-radius: 3px; pointer-events: none;
  left: var(--fl, 0%); top: var(--ft, 0%); width: var(--fw, 100%); height: var(--fh, 100%);
}
.box-required .box-frame { border: 2.5px solid var(--pmark-required); box-shadow: 0 0 0 1.5px #fff, inset 0 0 0 1px #fff; background: rgb(253 243 225 / 0.18); }
/* A heading group's heading on a page other than the one its decision counts on: the
   same number, outlined instead of filled, and a thinner frame. */
.box-repeat .box-frame { border: 2px solid var(--pmark-required); box-shadow: 0 0 0 1px #fff; }
.box-optional .box-frame { border: 1.5px dashed var(--pmark-optional); box-shadow: 0 0 0 1px #fff; }
.box-accepted .box-frame { border: 1.5px dotted var(--pmark-accepted); box-shadow: 0 0 0 1px #fff; }
.box.is-current { z-index: var(--z-raised); }
.box.is-current .box-frame { border: 2.5px solid var(--pmark-current); box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgb(26 79 160 / 0.25); background: rgb(232 238 250 / 0.15); }
.box:hover .box-frame { border-style: solid; }
/* The number sits just outside the frame on the left (in the margin, for a heading), or
   in the page margin on the same line for an equation in a line of text. */
.box-tag {
  position: absolute; pointer-events: none;
  right: var(--tag-right, calc(100% - var(--fl, 0%) + 4px)); left: var(--tag-left, auto);
  top: calc(var(--ft, 0%) + var(--fh, 100%) / 2 - 11px);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  font: 700 14px/1 var(--font-sans); white-space: nowrap;
  box-shadow: 0 0 0 1.5px #fff;
}
.box-required .box-tag { background: var(--pmark-required); color: #fff; }
.box-repeat .box-tag { background: #fff; color: var(--pmark-required); border: 2px solid var(--pmark-required); }
/* Optional items and accepted items stay quiet: the frame's shape (dashed, dotted; the
   legend says which is which) with its label ("Note", a tick) only while it is pointed
   at, focused or selected, so it never covers the words around it at rest. Its link
   name always says what it is. */
.box-optional .box-tag, .box-accepted .box-tag {
  display: none; right: auto;
  left: var(--tag-left, calc(var(--fl, 0%) - 4px)); top: var(--label-top, calc(var(--ft, 0%) - 25px));
  min-width: 0; height: 22px; padding: 0 5px; border-radius: var(--radius-control); background: #fff; font-size: 14px;
}
.box-optional .box-tag { color: var(--pmark-optional); border: 1px dashed var(--pmark-optional); }
.box-accepted .box-tag { color: var(--pmark-accepted); border: 1px dotted var(--pmark-accepted); font-size: 14px; }
.box-optional:hover .box-tag, .box-optional:focus-visible .box-tag, .box-optional.is-current .box-tag,
.box-accepted:hover .box-tag, .box-accepted:focus-visible .box-tag, .box-accepted.is-current .box-tag { display: inline-flex; }
.box.is-current .box-tag { background: var(--pmark-current); color: #fff; border: 0; }
/* Focus: after the status rules, so a focused mark always shows the focus ring. */
.page-frame .box:focus-visible { outline: 3px solid var(--focus-outline); outline-offset: 2px; box-shadow: 0 0 0 5px var(--focus-halo); z-index: var(--z-raised-top); }
.page-frame .box:target { outline: 3px solid var(--focus-outline); outline-offset: 2px; z-index: var(--z-raised-top); }

/* ===================================================================== tables (review)
   The table card (templates/_table_card.html): the image of the table, then the table as
   the student gets it, in its own focusable box that scrolls sideways when the table is
   wider than the card (the page itself never does). Its cells keep whole words: the card
   breaks long words anywhere, which would squeeze a wide table into one-letter columns.
   Every cell has a rule round it, so a cell spanning the wrong rows or columns shows. */
.table-crop { max-width: 100%; } /* its own size, from the width and height on the tag */
/* On a phone the picture of the table from the PDF takes the whole width (T1-19). */
@media (max-width: 40rem) { .table-compare .table-crop { width: 100%; max-width: none; } }
.table-view { background: var(--paper); border: 1px solid var(--border-subtle); border-radius: 4px; overflow-wrap: normal; margin: 0 0 var(--space-2); }
/* A table shown as paper keeps the light surface for its header cells in dark mode too. */
.table-view { --surface: var(--paper-surface); }
.table-view table { width: auto; margin: 0; }
.table-view caption { text-align: left; font-weight: 700; padding: var(--space-2) var(--space-2) var(--space-1); }
.table-view th, .table-view td { border: 1px solid var(--border-control); padding: var(--space-1) var(--space-2); overflow-wrap: normal; }
.table-view thead th { border-bottom-width: 3px; }
.table-view math { font-family: var(--font-math); }
.table-findings { margin: var(--space-1) 0 var(--space-3); }
.table-edit .inline-controls { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }
.table-edit .table-pick, .table-edit .table-cell-form { margin: var(--space-1) 0 var(--space-4); }
.table-edit .field { margin-bottom: var(--space-2); }
.table-fieldset { border: 0; padding: 0; margin: 0 0 var(--space-2); min-width: 0; }
.table-fieldset legend { font-weight: 700; padding: 0; margin-bottom: var(--space-1); }
.table-fieldset .checkbox-field { margin: var(--space-1) 0; }
.table-continue { margin: var(--space-3) 0 0; font-weight: 700; }
@media (forced-colors: active) {
  .table-view { border-color: CanvasText; }
}
/* What the checks found, each with its correction; one place to change it. */
.finding-list { list-style: none; margin: 0; padding: 0; }
.finding { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); padding: var(--space-2) 0; border-top: 1px solid var(--border-subtle); }
.finding:first-child { border-top: 0; }
.finding-text { flex: 1 1 18rem; min-width: 0; }
/* The cells that differ: a list under the sentence of the check, the full width of the finding.
   In the table, the same cells have a dashed frame and a ≠ sign, so no color carries it. */
.cell-differences { flex: 1 0 100%; min-width: 0; }
.cell-differences .part-label { margin: 0 0 var(--space-1); }
.difference-list { margin: 0 0 var(--space-1); padding-left: var(--space-4); }
.difference { margin: 0 0 var(--space-1); overflow-wrap: anywhere; }
.difference-place { font-weight: 700; }
.table-view .cell-differs { outline: 2px dashed var(--paper-accent); outline-offset: -4px; }
.table-view .cell-differs::after { content: " \2260"; font-weight: 700; color: var(--paper-accent); }
@media (forced-colors: active) { .table-view .cell-differs { outline-color: CanvasText; } .table-view .cell-differs::after { color: CanvasText; } }
.finding-action { margin: 0; }
a.finding-action { display: inline-flex; align-items: center; min-height: 2.25rem; font-weight: 700; }
.table-source-grid { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.table-source-grid .part-label { margin-top: 0; }

/* My documents as a to-do list. Statuses reuse the badge styles above, in words first. */
.documents-summary { margin: var(--space-2) 0 var(--space-3); }
.documents h3 { margin: var(--space-5) 0 var(--space-1); }
.doc-file { display: block; font-weight: 400; color: var(--ink-muted); font-size: var(--step-0); margin: -0.5rem 0 var(--space-4); overflow-wrap: anywhere; }
/* The same column widths in every group's table, so the groups line up. */
.doc-table { table-layout: fixed; }
.doc-table th:nth-child(1) { width: 40%; }
.doc-table th:nth-child(2) { width: 22%; }
.doc-table th:nth-child(4) { width: 9.5rem; }
.doc-table .status-badge { margin: 0 var(--space-2) var(--space-1) 0; }
.doc-table td a, .doc-table th a { display: inline-flex; align-items: center; min-height: 1.5rem; }
.doc-table .doc-file { margin: var(--space-1) 0 0; }
.doc-table td.row-actions > a { margin: 0 var(--space-4) 0 0; }
.row-primary { font-weight: 700; }
/* Phones: each document is a block of lines instead of a table row wider than the
   screen (UX review MF22). The table keeps its roles in the markup, so a screen reader
   still hears it as a table; the labels below are for the eye, with empty alternative
   text where the browser supports it so they are not read twice. */
@media (max-width: 37.5rem) {
  .doc-table thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table th, .doc-table td { display: block; }
  .doc-table tr { padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); }
  .doc-table th, .doc-table td { border: 0; padding: var(--space-1) 0; }
  .doc-table th:nth-child(n) { width: auto; }
  .doc-table td[data-label]::before {
    content: attr(data-label) ": ";
    content: attr(data-label) ": " / "";
    color: var(--ink-muted);
  }
}
/* Days and pseudonyms are short codes: never break them to make room. */
.usage-table tbody th { overflow-wrap: normal; white-space: nowrap; }

/* The questions after a download: a fieldset that looks like the other fields. */
fieldset.field { border: 0; padding: 0; min-width: 0; }
fieldset.field legend { font-weight: 700; padding: 0; margin-bottom: var(--space-2); }
.choice-row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.choice { display: inline-flex; align-items: center; gap: var(--space-2); }
.choice input { width: 1.3rem; height: 1.3rem; margin: 0; }
.field .choice label { display: inline; font-weight: 400; margin: 0; }
input[type="text"].input-short { width: 8rem; }
input[type="number"].input-short { width: 6rem; }
.feedback { border-top: 1px solid var(--border-subtle); margin-top: var(--space-4); }
.steps-list li { margin: var(--space-1) 0; }

/* The job page: its one-line settings and the student-file fields, links to its groups, then
   each group under one heading with a rule above; where to post it; and how long a document has
   been waiting. */
.setting-line { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.setting-line p { margin: 0; }
.inline-details > summary { display: inline-block; }
.inline-details > form { margin-top: var(--space-3); }
/* The job page's settings and link-only blocks are framed cards under their group's heading:
   the student file's fields side by side where there is room, and the cards of "Settings and
   sharing" in a row with the link (a button) at the foot of each. */
.job-group > .card { margin-top: var(--space-4); }
.student-fields { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); margin-top: var(--space-3); }
.student-setting { margin: 0; max-width: 40rem; }
.student-setting input[type="text"] { width: 100%; max-width: 40rem; }
.link-cards { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.link-cards > .card { display: flex; flex-direction: column; margin: 0; }
.link-card-action { margin-top: auto; padding-top: var(--space-2); }
.group-fact { margin: var(--space-2) 0; }
.group-crops { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.group-crops figure { margin: 0; }
.group-crops img { display: block; height: auto; border: 1px solid var(--border-subtle); }
@media (min-width: 40.0625rem) { .group-crops img { width: 100%; } }
.group-crops figcaption { color: var(--ink-muted); font-size: var(--step-0); margin-top: var(--space-1); }

.jump-links { margin: var(--space-4) 0 var(--space-2); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.jump-links ul { list-style: none; margin: 0; padding: var(--space-2) 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); }
.jump-links a { display: inline-flex; align-items: center; min-height: 1.75rem; }
.job-group { margin-top: var(--space-7); border-top: 1px solid var(--border-subtle); }
.job-group > h2 { margin-top: var(--space-4); }
#review-and-download { margin-top: var(--space-5); border-top: 0; }
#review-and-download > section > h2 { margin-top: var(--space-2); }
section.job-group { padding-top: 0; }
#results-line { max-width: var(--prose-max); }
#counts-detail { margin: 0 0 var(--space-4); }
#counts-detail .summary-list { margin-top: var(--space-3); }

/* "Where will you post it?": one flat list, each way with its own link, the recommended one
   first. */
.routes { list-style: none; margin: var(--space-2) 0 var(--space-5); padding: 0; max-width: var(--prose-max); }
.route { border-top: 1px solid var(--border-subtle); padding: var(--space-3) 0; }
.route:last-child { border-bottom: 1px solid var(--border-subtle); }
.route h4 { margin: 0 0 var(--space-1); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: baseline; }
.route p { margin: 0 0 var(--space-2); }
.route .canvas-download { margin: var(--space-3) 0 0; }
.route form.canvas-download { margin: 0; }

/* How long a document has been waiting, and the plain note when it is longer than usual. */
.wait-note { margin: var(--space-2) 0 var(--space-3); }
.wait-note p { margin: var(--space-1) 0; }
.wait-elapsed { color: var(--ink-muted); }
.wait-slow { border: 1px solid var(--border-subtle); border-radius: var(--radius-frame); background: var(--accent-tint); padding: var(--space-2) var(--space-4); max-width: var(--prose-max); }
.wait-slow[hidden] { display: none; }
/* The deletion time and "Keep for 7 days", once, under the actions of the job page. */
.retention-line { margin: var(--space-5) 0; }
.retention-line p { margin: 0 0 var(--space-2); }
.retention-line form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.retention-line .hint { margin: 0; }
@media (forced-colors: active) {
  .wait-slow, .jump-links, .route, .job-group { border-color: CanvasText; }
}

/* Notices about text (T3-7) and the page tools (T3-5, T3-16) */
.notice-names { font-style: normal; }
.notice-excerpt { margin: var(--space-2) 0; }
.notice-excerpt blockquote { margin: var(--space-1) 0 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); background: var(--surface); }
.notice-excerpt blockquote p { margin: 0; }
.notice-actions { margin: var(--space-2) 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.tool-section { padding: var(--space-2) 0 var(--space-3); border-top: 1px solid var(--border-subtle); }
.tool-section:focus { outline: none; }  /* a link or redirect to a tool lands focus on it */
.tool-section:first-of-type { border-top: 0; }
.tool-section h3 { margin: 0 0 var(--space-1); }
.page-left-out { border: 2px dashed var(--mark-optional); border-radius: var(--radius-control); padding: var(--space-2) var(--space-2); }
.text-lines { list-style: none; margin: var(--space-2) 0; padding: 0; max-height: 16rem; overflow-y: auto; }
.text-lines li { padding: var(--space-1) 0; border-top: 1px solid var(--border-subtle); }
.text-lines li:first-child { border-top: 0; }
.text-lines a[aria-current="true"] { font-weight: 700; }
.line-kind { color: var(--ink-muted); }
/* The page's marks as text, under the image (review_split.html). */
.mark-list { list-style: none; margin: var(--space-2) 0; padding: 0; }
.mark-list li { padding: var(--space-1) 0; border-top: 1px solid var(--border-subtle); }
.mark-list li:first-child { border-top: 0; }
.mark-list a[aria-current="true"] { font-weight: 700; }
.tool-editor { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--mark-current); background: var(--surface); border-radius: var(--radius-control); }
.tool-editor h4 { margin: 0 0 var(--space-2); }
.tool-editor .heading-make { margin-top: var(--space-3); }
.region-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); max-width: 26rem; }
.region-grid input[type="number"] { width: 100%; max-width: 9rem; }
.region-preview { margin: var(--space-2) 0 var(--space-3); }
.region-preview img { max-width: 100%; height: auto; border: 1px solid var(--border-subtle); background: var(--paper); }
.region-preview figcaption { color: var(--ink-muted); font-size: var(--step-0); }
.not-a-table, .accept-clean, .read-cell { margin-top: var(--space-3); }
/* Notation found in a course's documents (T3-12): one ticked row per symbol, the guessed
   meaning under it; no table, so nothing is wider than a phone screen. */
.suggestion-list { list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.suggestion { padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); }
.suggestion .checkbox-field { margin: 0 0 var(--space-2); }
.suggestion .field { margin: 0 0 var(--space-1) var(--space-6); }
.suggestion select { max-width: 100%; }
#suggestions p, #suggestions .button { overflow-wrap: anywhere; }
#suggestions .button { max-width: 100%; white-space: normal; text-align: left; }

/* Review at scale: accept many at once, the decision filter, the preview list, "Report this
   item", "Leave this page out", the finish notice and the guides list. Existing colors
   only; every control is a native link, button or field, 44 px high where it stands alone
   (WCAG 2.5.5 target; 2.5.8 needs 24). */
.bulk-offers, .decision-filter { margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); background: var(--surface); border-radius: var(--radius-control); }
.bulk-offers h3, .decision-filter h3 { margin: 0 0 var(--space-1); }
.bulk-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.bulk-list .button-secondary, .decision-filter .button-secondary, .bulk-confirm .button-secondary,
.bulk-confirm .button, .leave-out .button-secondary, .notify-box .button-secondary { min-height: 2.75rem; }
.filter-fields { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); align-items: flex-start; }
.decision-filter .field { margin-bottom: var(--space-2); }
/* A flex item will not shrink below its widest child (the Kind select's longest option), so at 320px with
   WCAG 1.4.12 text spacing the form ran 4px past the viewport; let it shrink and the select follow. */
.filter-fields > .field { min-width: 0; max-width: 100%; }
.filter-fields select { width: 100%; }
.decision-filter select, .decision-filter input[type="number"] { min-height: 2.75rem; }
.filter-result { font-weight: 700; }
.bulk-preview { padding-left: var(--space-5); }
.bulk-preview li { margin: 0 0 var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-subtle); overflow-wrap: anywhere; }
.bulk-preview li p { margin: 0 0 var(--space-1); }
.report-link { margin: var(--space-3) 0 0; font-size: var(--step-0); }
.report-link a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.report-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.leave-out { margin-top: var(--space-3); }
.leave-out .part-label { margin-top: 0; }
.notify-box { margin: var(--space-3) 0; }
.notify-box .hint { margin-top: var(--space-2); }
.notify-box [aria-disabled="true"] { cursor: default; }
.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list li { margin: 0 0 var(--space-5); max-width: 48rem; }
.guide-list h2 { margin: 0 0 var(--space-1); }
.crumb { margin: var(--space-2) 0 0; }
.crumb a { display: inline-block; min-height: 24px; }
.doc-table .row-link { display: block; margin-top: var(--space-1); min-height: 24px; }

@media (forced-colors: active) {
  .bulk-offers, .decision-filter { border: 2px solid CanvasText; }
  .notify-box [aria-disabled="true"] { color: GrayText; border-color: GrayText; }
}

/* The Symbols screen (templates/review_inventory.html): one form per symbol, the places it
   stands as a list under a <details>, a small picture of each equation beside its LaTeX. */
.symbols-intro { max-width: 48rem; }
.symbol-family { margin: var(--space-5) 0; }
.symbol-family > h2 { margin: 0 0 var(--space-2); }
.family-glyphs { font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", serif; letter-spacing: 0.1em; }
.symbol-form { margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); max-width: 48rem; }
.symbol-form h3 { margin: 0 0 var(--space-1); }
.symbol-glyph { font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", serif; font-size: var(--step-2); margin-right: var(--space-1); }
.symbol-count { margin: 0 0 var(--space-2); }
.symbol-form select { min-height: 2.75rem; max-width: 100%; }
.symbol-form .button { min-height: 2.75rem; }
.symbol-places { margin: var(--space-3) 0; }
.places { list-style: none; margin: var(--space-1) 0 0; padding: 0; }
.place { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: flex-start; padding: var(--space-2) 0; border-top: 1px solid var(--border-subtle); }
.place-crop { max-height: 3.5rem; max-width: 12rem; width: auto; height: auto; border: 1px solid var(--border-subtle); background: var(--paper); }
.place-text { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.place-text p { margin: 0 0 var(--space-1); }
.place-where a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.place-keep { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 2.75rem; }
.place-keep input { width: 1.5rem; height: 1.5rem; flex: none; }
.symbols-notice { margin: var(--space-4) 0; }
.symbols-notice .notice { margin: 0; flex: 1 1 auto; }
.symbol-affect { margin: var(--space-2) 0; font-weight: 700; }
/* Symbols: where a change lands, and an empty state with a small example. */
.symbol-where { margin: var(--space-2) 0; overflow-wrap: anywhere; }
.symbol-where-label { font-weight: 700; }
.symbols-empty { max-width: 40rem; }
.symbols-example { margin: var(--space-4) 0; max-width: 24rem; }
.symbols-example figcaption { margin-bottom: var(--space-2); font-size: var(--step--1); color: var(--ink-muted); }
.symbols-example-card { padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px dashed var(--border-control); border-radius: var(--radius-control); }
.symbols-example-card p { margin: 0 0 var(--space-1); }
.symbols-example-name { font-weight: 700; }

@media (forced-colors: active) {
  .symbol-form, .symbols-notice .notice { border: 2px solid CanvasText; }
  .symbol-form .button { border: 2px solid ButtonText; }
  .place-crop { forced-color-adjust: none; }
}

/* The upload form is three groups in the order they are decided (the file, how it is
   converted, how long it is kept). Each option has one line of consequence beside it and the
   long text sits in a `.more-detail` disclosure; the two option groups between the file and its
   button are one line each until opened. A group's summary is its name, "Change", and what is
   set now. Flat: 1px rules and the existing tints. */
.heading-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-4); }
.heading-row h2 { margin-right: auto; }
.sample-link { display: inline-flex; align-items: center; min-height: 1.5rem; margin: 0; }
.sample-link.inline-form { display: inline-flex; }
fieldset.option-group { margin: var(--space-5) 0 0; padding: var(--space-3) 0 0; border-top: 1px solid var(--border-subtle); }
fieldset.option-group > legend { font-weight: 700; padding: 0 var(--space-2) 0 0; }
fieldset.option-group > .hint { margin-top: var(--space-1); }
.more-detail { margin: 0 0 var(--space-3); max-width: var(--prose-max); }
.checkbox-field .more-detail { grid-column: 2; margin: 0; }
.more-detail ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }

/* The page heading with an action beside it ("Upload another file"). */
.page-heading h1 { margin-right: auto; }
.page-heading { align-items: center; }

/* Upload: the file and its button are the form; the two option groups between them are one
   line each until opened. A group's summary is its name, "Change", and what is set now. */
.upload-form .file-field { margin-bottom: var(--space-3); }
.main-file-detail { margin: 0 0 var(--space-3); }
.option-groups { border-top: 1px solid var(--border-subtle); margin: var(--space-4) 0 0; }
details.option-group { border-bottom: 1px solid var(--border-subtle); }
.group-name { font-weight: 700; margin-right: var(--space-3); }
.group-change { color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; }
details.option-group[open] .group-change { display: none; }
.group-body { padding: 0 0 var(--space-3) var(--space-5); }
.group-body .field:last-child { margin-bottom: var(--space-2); }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-5); }
.submit-row .upload-status { margin: 0; }
.vendor-line { margin-top: var(--space-3); max-width: 40rem; }
.upload-status { font-weight: 700; }
.upload-status:empty { display: none; }
@media (forced-colors: active) { .option-groups, details.option-group { border-color: CanvasText; } }

/* Sharing (templates/share.html). Role rows: the whole row is the label of a native radio (at least
   44px high), with the right's name and what it allows inside it. The copy row holds the address
   field and the "Copy link" button (static/copy-link.js shows it; the field works alone). The
   three steps lead; the button and the copy row each carry the access's end. */
.role-list { display: grid; gap: var(--space-2); max-width: 40rem; }
.field .role-row {
  display: flex; align-items: flex-start; gap: var(--space-3);
  min-height: 2.75rem; margin: 0; padding: var(--space-3) var(--space-4);
  border: 2px solid var(--border-control); border-radius: var(--radius-control);
  background: var(--bg); font-weight: 400; cursor: pointer;
}
.role-row input[type="radio"] { flex: none; width: 1.5rem; height: 1.5rem; margin: 0.125rem 0 0; accent-color: var(--accent); }
.role-text { display: grid; gap: 0.125rem; min-width: 0; }
.role-name { font-weight: 700; }
.role-help { color: var(--ink-muted); }
.field .role-row:hover { border-color: var(--accent-hover); background: var(--accent-tint); }
.field .role-row:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.copy-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; max-width: 40rem; }
/* The address a person copies is a read-only box that wraps, so all of it shows (never one line
   cut off). `field-sizing` grows it to the text where the browser can; `rows` is the fallback. */
.copy-row textarea { flex: 1 1 16rem; width: auto; min-width: 0; field-sizing: content; resize: none; overflow-wrap: anywhere; }
.copy-row [hidden] { display: none; }
#share-copy-state:empty { display: none; }
.share-list { list-style: none; margin: 0; padding: 0; }
.share-list li { padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.share-person { margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
.share-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.share-actions button { overflow-wrap: anywhere; }
.share-steps { margin: 0 0 var(--space-4); max-width: var(--prose-max); }
.share-submit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.share-submit .hint { margin: 0; flex: 1 1 16rem; }
.share-help { margin: var(--space-5) 0; max-width: var(--prose-max); }
@media (forced-colors: active) {
  .field .role-row, .field .role-row:hover { border-color: CanvasText; }
  .field .role-row:has(input:checked) { border-color: Highlight; outline: 2px solid Highlight; outline-offset: 1px; }
}

/* The comparison guide (templates/guide_compare.html): a four-column table does not fit a phone,
   so it keeps a readable width and scrolls inside its focusable box. Row headings keep whole
   words (the rule for headings breaks them anywhere). The topic column stays in view while the
   tools scroll, and the ReadableSTEM column is tinted so the page's subject is easy to find. */
.compare-table { min-width: 46rem; }
.compare-table tbody th { overflow-wrap: normal; width: 8rem; }
.compare-wide tbody th { position: sticky; left: 0; background: var(--bg); z-index: var(--z-raised); }
.compare-wide thead th:nth-child(2), .compare-wide tbody td:nth-child(2) { background: var(--surface); }
.compare-wide thead th:first-child { position: sticky; left: 0; z-index: var(--z-raised-top); }
.compare-table .source-note { display: block; margin-top: var(--space-1); color: var(--ink-muted); font-size: var(--step--1); }
/* The comparison guide's short decision list, and the guides index's audience line. */
.decision-list { padding-left: var(--space-5); }
.decision-list li { margin: 0 0 var(--space-3); }
.guide-for { margin: 0 0 var(--space-1); font-weight: 700; color: var(--ink-muted); }

/* The same cells twice: the table from 52rem up, and under it one native <details> per topic on a
   phone. Closed, it shows the topic and ReadableSTEM's answer (as plain text); open, it lists
   every tool with its source and date. The view that is not shown is not rendered, so a reader
   of either gets each fact once. No script. */
.compare-stack { display: none; }
@media (max-width: 51.99rem) {
  .compare-wide-view { display: none; }
  .compare-stack { display: block; }
  .mode-read main > .compare-stack { max-width: none; }
  .compare-topic { margin: 0 0 var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-frame); background: var(--bg); }
  .compare-topic-name { font-weight: 700; font-size: var(--step-1); }
  .compare-lead { display: block; margin-top: var(--space-1); color: var(--ink-muted); overflow-wrap: anywhere; }
  .compare-topic[open] .compare-lead { display: none; }
  .compare-topic dl { margin: 0; padding: var(--space-3) var(--space-4) var(--space-4); }
  .compare-topic dt { margin: var(--space-3) 0 var(--space-1); font-weight: 700; }
  .compare-topic dt:first-child { margin-top: 0; }
  .compare-topic dd { margin: 0; overflow-wrap: anywhere; }
  .compare-topic dd .source-note { display: block; margin-top: var(--space-1); color: var(--ink-muted); }
}
@media (forced-colors: active) { .compare-topic, .compare-topic[open] summary { border-color: CanvasText; } }

/* The /style page (templates/style.html). */
.style-display { font-family: var(--font-display); font-weight: 600; font-size: var(--step-5); line-height: var(--lh-display); margin: 0 0 var(--space-3); }
.style-h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--step-4); line-height: var(--lh-head); margin: 0 0 var(--space-3); }
.style-h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--step-3); line-height: var(--lh-head); margin: 0 0 var(--space-3); }
.style-h3 { font-weight: 700; font-size: var(--step-2); line-height: var(--lh-head); margin: 0 0 var(--space-3); }
.style-swatches { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-3); }
.swatch { display: block; height: 3rem; margin-bottom: var(--space-1); border: 1px solid var(--border-control); border-radius: var(--radius-control); forced-color-adjust: none; }
.swatch-ink { background: var(--ink); }
.swatch-ink-muted { background: var(--ink-muted); }
.swatch-accent { background: var(--accent); }
.swatch-surface { background: var(--surface); }
.swatch-border-control { background: var(--border-control); }
.swatch-focus-halo { background: var(--focus-halo); }
.style-panes { margin-top: var(--space-5); }
.style-form { max-width: 40rem; }

/* /style: every demonstration control is an inert example, and the three states are shown. */
.style-example { margin: 0 0 var(--space-5); padding: var(--space-4); border: 1px dashed var(--border-control); border-radius: var(--radius-frame); }
.style-example > :last-child { margin-bottom: 0; }
.style-example-label { margin: 0 0 var(--space-3); font-weight: 700; color: var(--ink-muted); }
.style-live { margin: var(--space-2) 0 0; color: var(--ink-muted); }
.style-states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: 0 0 var(--space-5); }
@media (max-width: 63.99rem) { .style-states { grid-template-columns: minmax(0, 1fr); } }
.style-scheme { padding: var(--space-4); border: 1px solid var(--border-control); border-radius: var(--radius-frame); background: var(--bg); color: var(--ink); min-width: 0; }
.style-scheme h3 { margin: 0 0 var(--space-3); }
.style-scheme p { margin: 0 0 var(--space-3); max-width: none; }
.style-scheme .button-row { margin: 0 0 var(--space-3); }
.style-focus { display: inline-block; padding: var(--space-1) var(--space-3); outline: 3px solid var(--focus-outline); outline-offset: 2px; box-shadow: 0 0 0 5px var(--focus-halo); }
/* The dark preview carries the dark tokens of tokens.css (a test keeps the two equal). */
.style-scheme-dark {
  color-scheme: dark;
  --bg: #0f1115; --surface: #171a20; --surface-2: #1e222a; --ink: #e9ebef; --ink-muted: #b4bac4;
  --border-control: #7d8491; --border-subtle: #343944; --accent: #8ab4ff; --accent-hover: #a8c4ff;
  --accent-tint: #1a2540; --on-accent: #0f1115; --visited: #c9a7f0; --focus-outline: #ffd33d;
  --focus-halo: #0f1115; --ok: #7fd69b; --ok-tint: #12261a; --warn: #ffc46b; --warn-tint: #2a2010;
  --err: #ff9a92; --err-tint: #2c1515; --err-strong: #ffb8b2;
}
/* The forced-color preview approximates the system colors: the real rules are in the
   forced-colors media queries of this file and controls.css, shown by switching the mode on. */
.style-scheme-forced {
  --bg: Canvas; --surface: Canvas; --ink: CanvasText; --ink-muted: CanvasText; --accent: LinkText;
  --border-control: ButtonText; --border-subtle: CanvasText; --on-accent: ButtonFace;
  --focus-outline: Highlight; --focus-halo: Canvas; --ok: CanvasText; --ok-tint: Canvas;
  --warn: CanvasText; --warn-tint: Canvas; --err: CanvasText; --err-tint: Canvas;
  border-color: CanvasText; forced-color-adjust: none; color-scheme: light;
}
.style-scheme-forced .button { background: ButtonText; color: ButtonFace; border: 2px solid ButtonText; }
.style-scheme-forced .button-secondary, .style-scheme-forced .button-danger-outline { background: ButtonFace; color: ButtonText; border: 2px solid ButtonText; }
.style-scheme-forced .tag { border: 1px solid CanvasText; background: Canvas; color: CanvasText; }
.style-scheme-forced .notice { border: 1px solid CanvasText; background: Canvas; }
.style-scheme-forced .style-focus { box-shadow: none; }
@media (forced-colors: active) {
  .style-example, .style-scheme { border-color: CanvasText; }
}

/* ============================================================== Landing (templates/landing.html)
   Persuade surface: the hero is the real before/after from the demo (scripts/hero_assets.py). */
@font-face {
  font-family: "LM Math Hero";
  src: url("/static/vendor/fonts/lm-math-hero-1.959.woff2") format("woff2");
  font-display: swap;
}
.mode-landing .hero { padding: var(--space-6) 0 var(--space-5); }
.mode-landing .hero h1 { font-size: var(--step-5); line-height: var(--lh-display); letter-spacing: -0.01em; max-width: 28ch; margin: var(--space-4) 0 var(--space-5); }
.mode-landing .hero .lede { max-width: var(--prose-max); margin: 0 0 var(--space-3); }
.mode-landing .hero .hero-rest { max-width: var(--prose-max); margin: 0 0 var(--space-5); color: var(--ink-muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); margin: 0 0 var(--space-7); }
/* The one line under the buttons keeps the real before/after near the top. */
.mode-landing .hero .hero-actions { margin-bottom: var(--space-3); }
.hero-hint { margin: 0 0 var(--space-6); }
.mode-landing .hero { padding-bottom: 0; }
.mode-landing .hero .hero-hint { margin-bottom: 0; }
/* The hero's second column: the whole product, the demo page in a real window. One column
   below 60rem (the picture drops under the text); the picture is shown whole, at the width of
   its column, never cropped. It is a picture of a light page, so it keeps its colors in dark
   mode and the frame says where it ends. */
.hero-shot { margin: var(--space-5) 0 0; min-width: 0; }
.hero-shot a { display: block; line-height: 0; background: var(--paper); border: 1px solid var(--border-control); border-radius: var(--radius-frame); overflow: hidden; }
.hero-shot-img { display: block; width: 100%; height: auto; }
.hero-shot figcaption { margin-top: var(--space-2); font-size: var(--step--1); color: var(--ink-muted); }
@media (min-width: 60rem) {
  .mode-landing .hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
  .hero-shot { margin-top: var(--space-4); }
}
/* "Hear the difference": one equation, two readings, side by side from 48rem. No card, no badge:
   a label, the equation on a small sheet of paper, what a screen reader says, one Play button. */
.diff-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); margin: var(--space-4) 0 0; }
.diff-row { min-width: 0; }
.diff-row h3 { margin: 0 0 var(--space-2); line-height: var(--lh-ui); color: var(--ink-muted); }
.sheet { background: var(--paper); color: var(--paper-ink); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); padding: var(--space-3); --ink: var(--paper-ink); --ink-muted: var(--paper-ink-muted); --accent: var(--paper-accent); --focus-outline: var(--paper-focus-outline); --focus-halo: var(--paper-focus-halo); }
.diff-eq { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 14rem; max-width: 100%; min-height: 7rem; }
.diff-eq img { display: block; max-width: 100%; height: auto; }
.eq { display: flex; justify-content: center; align-items: center; gap: var(--space-5); }
.eq math { font-family: "LM Math Hero", "Latin Modern Math", "STIX Two Math", "Cambria Math", math; font-size: 1.5em; }
.eq-label { font-size: var(--step-0); }
.diff-says { margin: var(--space-3) 0 var(--space-1); line-height: var(--lh-ui); overflow-wrap: anywhere; }
.diff-says-label { display: block; font-size: var(--step--1); color: var(--ink-muted); }
.diff .hear { margin: var(--space-2) 0 0; }
.diff .button-small { min-height: 2.75rem; }
.diff-source { margin: var(--space-5) 0 0; color: var(--ink-muted); max-width: 75ch; }
@media (min-width: 48rem) {
  .diff-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-7); }
}

.three-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); counter-reset: step; }
.three-steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: var(--space-3); }
.three-steps h3 { margin: 0 0 var(--space-2); }
.three-steps h3::before { content: counter(step) ". "; color: var(--ink-muted); }
.three-steps p { margin: 0; font-size: var(--step-0); }
.steps-section { margin-top: var(--space-7); }
.steps-section h2 { margin-top: 0; }
.mode-read main > .steps-section { max-width: none; }

.proof-strip { margin: 0 0 var(--space-5); max-width: none; }
.proof-set { margin: 0 0 var(--space-3); color: var(--ink-muted); font-size: var(--step-0); }
.mode-read .proof-strip .stat-row { list-style: none; }
.stat-count { margin: 0; }

@media (max-width: 39.99rem) {
  /* A headline of 36px runs to five or six lines on a phone; 30px keeps it to four. */
  .mode-landing .hero h1 { font-size: var(--step-3); line-height: 1.15; }
  .hero-actions { margin-bottom: var(--space-6); }
  .hero-hint { margin-bottom: var(--space-5); }
}
@media (max-width: 51.99rem) {
  .three-steps { grid-template-columns: minmax(0, 1fr); }
  .mode-landing .hero { padding-top: var(--space-4); }
}
@media (forced-colors: active) {
  .sheet, .three-steps li { border-color: CanvasText; }
  .sheet { forced-color-adjust: none; }
}

/* The offices page (templates/offices.html): "On this page", what is sent where (a table from
   40rem, a list on a phone), the recipients, and the data-flow diagram. Tables that may be wider
   than a phone scroll in a focusable box (templates/_table_scroll.html); a table that fits is
   not squeezed. */
/* "On this page" on the offices page. */
.toc { margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-frame); background: var(--surface); max-width: var(--prose-max); }
.toc-label { margin: 0 0 var(--space-2); font-weight: 700; }
.toc ul { margin: 0; padding-left: var(--space-5); columns: 2 18rem; column-gap: var(--space-5); }
.toc li { margin: 0 0 var(--space-1); break-inside: avoid; }
.toc a { display: inline-flex; align-items: center; min-height: 1.5rem; }
@media (forced-colors: active) { .toc { border-color: CanvasText; } }
.recipients-table, .retention-table { min-width: 34rem; }
.recipients-table td:nth-child(2) { width: 42%; }
.cell-list { margin: 0; padding-left: var(--space-4); }
.cell-list li { margin: 0 0 var(--space-1); }
.cell-list li:last-child { margin-bottom: 0; }
/* What is sent where (templates/_data_matrix.html): a table from 40rem, a list on a phone. */
.matrix-stack { display: none; }
.matrix-caption { margin: 0 0 var(--space-2); font-weight: 700; }
.matrix-stack li { padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.matrix-stack li:last-child { border-bottom: 1px solid var(--border-subtle); }
.matrix-line { display: block; margin-top: var(--space-1); color: var(--ink-muted); }
.matrix-key { font-weight: 700; color: var(--ink); }
@media (max-width: 39.99rem) {
  .matrix-wide-view { display: none; }
  .matrix-stack { display: block; }
  .mode-read main > .matrix-stack { max-width: none; }
}
/* The data-flow diagram: one column, scaled to the screen. It is drawn for white, so it stays on
   white paper in dark mode. */
.data-flow-figure { margin: var(--space-2) 0 var(--space-4); max-width: 26rem; background: var(--paper); color: var(--paper-ink); padding: var(--space-4); border-radius: var(--radius-frame); border: 1px solid var(--border-subtle); }
.data-flow { display: block; width: 100%; height: auto; }
.data-flow-figure figcaption { color: var(--paper-ink-muted); font-size: var(--step-0); margin-top: var(--space-1); }

/* Limits: a term and what it is, side by side from 40rem. */
.limits-list { margin: var(--space-3) 0 var(--space-5); }
.limits-list > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--space-1) var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.limits-list > div:last-child { border-bottom: 1px solid var(--border-subtle); }
.limits-list dt { font-weight: 700; }
.limits-list dd { margin: 0; }
@media (max-width: 39.99rem) { .limits-list > div { grid-template-columns: minmax(0, 1fr); } }

/* Sign-in: the consent is plain text right under the buttons it is about. */
.signin-consent { max-width: 40rem; margin: var(--space-4) 0 var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.signin-form { margin: 0 0 var(--space-3); }

/* Status: when it was checked, and the optional refresh, above the facts. */
.status-checked { margin: 0 0 var(--space-4); font-weight: 700; }
.status-checked a { font-weight: 400; }

/* Confirmations: the danger button names its object and "No, keep it" is a button of the same
   size beside it (side by side when they fit). */
.confirm-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: stretch; margin: var(--space-5) 0 var(--space-4); }
.confirm-actions .inline-form { display: flex; max-width: 100%; }
.confirm-actions .button-danger { overflow-wrap: anywhere; }
.confirm-export { margin: var(--space-4) 0; }
.confirm-export .actions { margin: 0; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
@media (max-width: 37.5rem) {
  .confirm-actions { flex-direction: column; }
  .confirm-actions .inline-form, .confirm-actions .button-secondary { width: 100%; }
  .confirm-actions .button-danger { width: 100%; }
}

/* Account: the one setting people change (how long documents are kept) is its own block,
   before the limits. The deletion notes are a short list with the long wording folded away. */
.account-keep { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-frame); padding: var(--space-3) var(--space-5) var(--space-4); margin: var(--space-5) 0; }
.account-delete-details { margin: 0 0 var(--space-4); max-width: var(--prose-max); }
@media (forced-colors: active) { .account-keep { border-color: CanvasText; } }

/* Courses: documents and symbols per course, a jump list on a course page, the starter set
   as rows (a tick, an editable symbol and its meaning), adding documents, and the settings
   kept apart under a rule. */
.course-table td, .course-table th { vertical-align: middle; }
.course-table td a { display: inline-flex; align-items: center; min-height: 1.5rem; }
.starter-form { margin: var(--space-4) 0 var(--space-5); max-width: 40rem; }
.starter-form h3 { margin-bottom: var(--space-1); }
.starter-list { list-style: none; margin: var(--space-3) 0; padding: 0; display: grid; gap: var(--space-2); }
.starter-row { display: grid; grid-template-columns: 8rem minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2) var(--space-3); align-items: center; padding: var(--space-1) 0; border-top: 1px solid var(--border-subtle); }
.starter-row .field, .starter-row .checkbox-field { margin: 0; }
.starter-row input[type="text"], .starter-row select { width: 100%; min-height: 2.75rem; }
@media (max-width: 37.5rem) {
  .starter-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .starter-row .checkbox-field { grid-column: 1 / -1; }
  .course-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .course-table, .course-table tbody, .course-table tr, .course-table th, .course-table td { display: block; }
  .course-table tr { padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); }
  .course-table th, .course-table td { border: 0; padding: var(--space-1) 0; }
  .course-table td[data-label]::before { content: attr(data-label) ": "; content: attr(data-label) ": " / ""; color: var(--ink-muted); }
}
.attach-documents { margin: var(--space-4) 0; max-width: var(--prose-max); }
.course-settings { margin-top: var(--space-7); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.course-settings h3 { margin-top: var(--space-4); }


/* Choosing pages: two page fields and "Add part" (script), the parts as a list with their
   page counts and one summary line, and the typed form folded under "Type the pages instead". */
.parts-section { margin: var(--space-4) 0; }
.parts-builder { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: flex-end; margin: var(--space-3) 0 var(--space-2); }
.parts-builder[hidden] { display: none; }
.parts-builder .field { margin: 0; }
.parts-builder input[type="number"] { width: 8rem; min-height: 2.75rem; }
.parts-builder-note { flex-basis: 100%; margin: 0; min-height: 1.4em; }
.parts-summary { margin: var(--space-3) 0 var(--space-2); font-weight: 700; }
.parts-list { list-style: none; margin: 0 0 var(--space-4); padding: 0; max-width: 40rem; }
/* One line per row, the label wrapping inside its own space, so the action (Remove, Review, Open)
   sits at the right edge of every row, also on a 320px screen. */
.parts-row { display: flex; align-items: baseline; gap: var(--space-1) var(--space-4); padding: var(--space-2) 0; border-top: 1px solid var(--border-subtle); }
.parts-row:last-child { border-bottom: 1px solid var(--border-subtle); }
.parts-name { font-weight: 700; flex: 1 1 5rem; min-width: 0; }
.parts-count { color: var(--ink-muted); }
.parts-problem { color: var(--err); flex: 1 1 8rem; min-width: 0; }
.parts-row .link-button { margin-left: auto; flex: none; min-height: 2rem; }
.parts-row .link-button[hidden] { display: none; }
.parts-empty { margin: 0 0 var(--space-4); }
.parts-advanced { margin: var(--space-3) 0 var(--space-4); max-width: 40rem; }
@media (forced-colors: active) { .parts-problem { color: CanvasText; } .parts-row { border-color: CanvasText; } }

/* Batch: what to do next, and how long ago it was uploaded, above the documents. */
.batch-next { margin: var(--space-4) 0; }
.batch-next p { margin: 0 0 var(--space-2); }
.batch-elapsed { color: var(--ink-muted); }

/* The review list: a compact row per waiting decision, the first decision first; the tools for
   finding or speeding up the others folded. */
.compact-item { border: 1px solid var(--border-subtle); border-radius: var(--radius-frame); margin: 0 0 var(--space-3); }
.compact-item > summary { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; }
.compact-item > .fix-card { border: 0; margin: 0; padding-top: var(--space-1); }
.compact-status { margin-left: auto; font-weight: 700; }
.compact-item .fix-meta { display: none; }
@media (forced-colors: active) { .compact-item { border-color: CanvasText; } }
.list-links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: var(--space-1) 0 0; }
.list-links a { display: inline-flex; align-items: center; min-height: 1.75rem; }
.list-tools { margin: var(--space-2) 0 var(--space-4); padding: 0 var(--space-4); border: 1px solid var(--border-subtle); border-radius: var(--radius-frame); }
.list-tools[open] { padding-bottom: var(--space-3); }
.list-tools .review-toc { margin: var(--space-3) 0; }
.list-tools .review-toc h3 { margin: var(--space-3) 0 var(--space-1); }
@media (forced-colors: active) { .list-tools { border-color: CanvasText; } }

/* The comparison chart (templates/_proof_chart.html): horizontal bars, a name and a number on
   every bar, three fills (solid, hatched, dotted) so color is not the only difference. */
.proof-chart { margin: var(--space-5) 0; max-width: 52rem; }
.mode-read main > .proof-chart { max-width: 52rem; }
.proof-chart-title { margin: 0 0 var(--space-3); }
.chart-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.chart-row { margin: 0 0 var(--space-4); }
.chart-measure { margin: 0 0 var(--space-1); font-weight: 700; }
.chart-better { margin-left: var(--space-2); font-weight: 400; color: var(--ink-muted); font-size: var(--step--1); }
.chart-line { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 6rem; align-items: center; gap: var(--space-3); min-height: 1.75rem; }
.chart-name { font-size: var(--step-0); }
.chart-value { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.chart-bar { display: block; width: 100%; height: 16px; }
.chart-track { fill: var(--surface-2); stroke: var(--border-subtle); stroke-width: 1; }
.chart-sys-1 .chart-fill { fill: var(--accent); }
.chart-sys-2 .chart-fill { fill: url(#chart-hatch); stroke: var(--ink-muted); stroke-width: 1; }
.chart-sys-3 .chart-fill { fill: url(#chart-dots); stroke: var(--ink-muted); stroke-width: 1; }
.pat-bg { fill: var(--bg); }
.pat-stroke, .pat-fill { fill: var(--ink-muted); }
.proof-chart figcaption { margin-top: var(--space-3); }
.proof-chart figcaption p, .chart-source { margin: 0 0 var(--space-2); }
.chart-mini { margin-top: var(--space-4); }
.chart-mini caption { font-weight: 700; color: var(--ink); }
.chart-source { color: var(--ink-muted); }
@media (max-width: 39.99rem) {
  .chart-line { grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--space-3); margin-bottom: var(--space-2); }
  .chart-bar { grid-column: 1 / -1; grid-row: 2; }
  .chart-value { grid-column: 2; grid-row: 1; }
  .chart-name { grid-column: 1; grid-row: 1; }
}
@media (forced-colors: active) {
  .chart-bar { forced-color-adjust: none; }
  .chart-track { fill: Canvas; stroke: CanvasText; }
  .chart-sys-1 .chart-fill { fill: CanvasText; }
  .chart-sys-2 .chart-fill, .chart-sys-3 .chart-fill { stroke: CanvasText; }
  .pat-bg { fill: Canvas; }
  .pat-stroke, .pat-fill { fill: CanvasText; }
}

/* The review record (T3-6): printed on its own, without the site's navigation. */
/* A finger (F-288, SW17): the small targets of the review screen and the link-styled buttons
   grow to --target-touch. The page chips, the Previous and Next page links and every
   .link-button (also where a rule above makes one smaller). */
@media (pointer: coarse) {
  .page-chip, .link-button, .parts-row .link-button { min-height: var(--target-touch); min-width: var(--target-touch); }
  .page-step a { min-height: var(--target-touch); }
}

@media print {
  .site-header, .site-footer, .skip-link, .no-print { display: none; }
  .table-scroll { overflow: visible; }
  tr, section { break-inside: avoid; }
}
