/* ------------------------------------------------------------------------
   TOKEN LAYER — the entire visual system, in one block.

   Every rule below this point reads from these variables: no raw hex, no raw
   border, no raw radius, no raw font stack. A theme is nothing but a
   replacement set of these values, injected as a <style> block by
   views/partials/head.ejs. The corollary matters: anything NOT expressed as a
   token here cannot change between themes.

   The values below are the Swiss broadsheet defaults (theme #1), and remain
   the fallback whenever no theme is active.
   ------------------------------------------------------------------------ */
:root {
  /* Surfaces and ink */
  --canvas: #f3f3f3;       /* page background */
  --paper: #e5e5e5;        /* secondary surface: filled frames, row hover, code */
  --ink: #151515;          /* primary text and lines */
  --accent: #fff824;       /* label bars, filled pill, focus ring, link hover */
  --accent-ink: #151515;   /* text sitting on --accent */
  --band: #151515;         /* full-bleed dark band: footer, .label--ink */
  --band-ink: #f3f3f3;     /* text sitting on --band */

  /* Surfaces that a second look needs to move independently. Each default is exactly what the
     rule used to hardcode, so declaring them changes nothing on its own — they exist so the admin
     chrome (and any future theme) can lift cards off the page without editing a component rule. */
  --frame-bg: transparent;      /* .frame — a card */
  --pill-bg: transparent;       /* .pill — a secondary button */
  --input-bg: var(--canvas);    /* text inputs, selects, textareas */
  --rail-bg: transparent;       /* the admin sidebar */
  --bar-bg: var(--paper);       /* the admin strip */
  --bar-ink: var(--ink);
  /* The primary button. Separate from --accent because a CMS wants a solid brand button and a
     pale tinted label, and Swiss wants both to be the same highlighter yellow. */
  --fill-bg: var(--accent);
  --fill-ink: var(--ink);
  --fill-border: var(--accent);
  /* Sidebar states. Swiss has no notion of a current page; the CMS look leans on it. */
  --nav-hover-bg: var(--accent);
  --nav-active-bg: var(--accent);
  --nav-active-ink: var(--accent-ink);
  --nav-radius: 0;
  --nav-pad: 5px 0;

  /* Lines, corners, elevation */
  --border: #151515;
  --border-width: 1px;
  --radius: 0;             /* frames, inputs, tables, images */
  --radius-pill: 9999px;   /* the action pill */
  --shadow-frame: none;
  --shadow-btn: none;      /* every action pill */
  --shadow-btn-fill: none; /* the filled primary pill only */

  /* Type */
  --font: 'Inter', 'Suisse', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-body: 18px;
  --leading-body: 1.17;
  --tracking-body: -0.01em;
  --weight-body: 400;
  --weight-bold: 700;
  --weight-display: 400;   /* Swiss sets headlines in regular; most themes want 700 */
  --tracking-display: -0.04em;
  --tracking-display-sm: -0.03em;
  --tracking-sub: -0.02em;
  --tracking-small: -0.01em;
  --size-display: clamp(42px, 9vw, 84px);
  --size-display-sm: clamp(34px, 6vw, 54px);
  --size-sub: 30px;
  --size-small: 13px;
  --size-label: 12px;
  --size-chrome: 12px;     /* topbar, footer, table headers, units beside a score */
  --leading-display: 0.96;
  --leading-display-sm: 0.93;
  --leading-sub: 0.96;
  --leading-small: 1.25;
  /* Big numerals: the scores on the applicant page and the writer dashboard */
  --size-score-md: 40px;
  --size-score-lg: 54px;
  --leading-score-md: 1;
  --leading-score-lg: 0.9;

  /* Small-caps chrome: topbar, footer, form labels, table headers, .label */
  --label-case: uppercase;
  --label-tracking: -0.01em;

  /* The action pill — the one component every design system has an opinion about */
  --size-pill: 12px;
  --pad-pill: 10px 16px;
  --pad-pill-sm: 6px 10px;

  /* Layout */
  --gap: 20px;
  --section: 44px;
  --pad-frame: var(--gap);
  --pad-tight: 12px var(--gap);   /* summary rows, error blocks — containers inside containers */
  /* The homepage's line-art illustrations and its big notched blocks. Grammar and the reasoning
     behind it: themes/syllabus/source/DESIGN.md ("Line-Art Illustration Panel"). */
  --art-fill: var(--canvas);  /* interior of a drawn panel — line-art, never a filled shape */
  --notch: 0;                 /* corner cut off a band block; 0 leaves it square */

  --measure: 900px;        /* page width */
  --measure-wide: 1280px;  /* .wide pages: admin lists, writer dashboard */

  /* Reading tokens: --leading-body (1.17) and the main measure are tuned for short UI
     copy and labels, not multi-paragraph prose. Long-form training content uses these
     instead — see the "Prose" block below. Source: ui-ux-pro-max accessibility guidance
     (2026-09-11): line-height 1.5 unitless and a ~65ch measure for extended reading text. */
  --leading-prose: 1.5;
  --prose-measure: 66ch;
}
* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--ink); text-decoration: none; }
a:hover { background: var(--accent); }
a.arrow::before { content: "\2933\00a0"; }

/* Type scale */
.display { font-family: var(--font-display); font-size: var(--size-display); line-height: var(--leading-display); letter-spacing: var(--tracking-display); font-weight: var(--weight-display); margin: 0; }
.display-sm { font-family: var(--font-display); font-size: var(--size-display-sm); line-height: var(--leading-display-sm); letter-spacing: var(--tracking-display-sm); font-weight: var(--weight-display); margin: 0; }
.sub { font-family: var(--font-display); font-size: var(--size-sub); line-height: var(--leading-sub); letter-spacing: var(--tracking-sub); font-weight: var(--weight-display); margin: 0; }
.small { font-size: var(--size-small); line-height: var(--leading-small); letter-spacing: var(--tracking-small); }
.label { display: inline-block; background: var(--accent); color: var(--accent-ink); font-size: var(--size-label); font-weight: var(--weight-bold); line-height: 1; letter-spacing: var(--label-tracking); text-transform: var(--label-case); padding: 3px 8px 4px; }
.label--ink { background: var(--band); color: var(--band-ink); }
.muted { opacity: 0.72; }
.tabular { font-variant-numeric: tabular-nums; }

/* Chrome */
.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px var(--gap); padding: 15px 20px; border-bottom: var(--border-width) solid var(--border); font-size: var(--size-chrome); font-weight: var(--weight-bold); text-transform: var(--label-case); letter-spacing: var(--label-tracking); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: flex-end; }
.topbar nav a { padding: 4px 0; }
/* Top left is always the way home, on every page. */
.brandlink { padding: 4px 0; }

/* The owner's "View as" switch, beside the way home because it changes what every page below it
   says. Chrome-sized rather than form-sized: the base select rule stretches to the full width of
   its container, which in a flex bar is the whole row. Everything else — the border, the radius,
   the arrow, the input background — is inherited from that rule, so a theme dresses this too. */
.viewas { display: flex; align-items: center; gap: 8px; margin: 0; flex: 0 1 auto; }
.viewas label { margin: 0; white-space: nowrap; }
.viewas select { width: auto; max-width: 220px; padding: 3px 28px 3px 8px; font-size: var(--size-chrome); font-weight: var(--weight-bold); background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%; }

/* ---- Two levels of navigation ----
   The bar above is the public site: the links any visitor needs, the same ones an admin sees.
   Below it, for an admin only, a strip that follows them everywhere — including out onto the
   public pages, so going to look at a change never means hunting for the way back. The sidebar
   then carries the administration itself, beside the page rather than crammed into the bar. */
.adminbar {
  display: flex; flex-wrap: wrap; gap: 8px var(--gap); align-items: center; justify-content: space-between;
  padding: 10px 20px; background: var(--bar-bg); color: var(--bar-ink);
  border-bottom: var(--border-width) solid var(--border);
  font-size: var(--size-chrome); font-weight: var(--weight-bold);
  text-transform: var(--label-case); letter-spacing: var(--label-tracking);
}
.adminbar nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }

.shell { flex: 1; display: flex; flex-direction: column; width: 100%; }
/* The sidebar only exists on admin pages, so only they become a two-column shell. `min-width: 0`
   on the second column is what stops a wide admin table stretching the grid instead of scrolling
   inside its own wrapper. */
@media (min-width: 900px) {
  .shell--admin {
    display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start;
  }
  .shell--admin > main { min-width: 0; }
  .sidebar { position: sticky; top: 0; border-right: var(--border-width) solid var(--border); border-bottom: 0; max-height: 100vh; overflow-y: auto; }
}
.sidebar {
  background: var(--rail-bg);
  padding: var(--gap); border: 0; border-bottom: var(--border-width) solid var(--border);
  font-size: var(--size-chrome); font-weight: var(--weight-bold);
  letter-spacing: var(--label-tracking);
}
/* The column goes on the inner nav, not on the <details>: see the note in partials/head.ejs. */
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; align-items: stretch; }
/* The fold-up control only exists on a phone; on a wide screen the sidebar is simply there. */
.sidebar > summary { padding: 0 0 12px; list-style: none; }
.sidebar > summary::-webkit-details-marker { display: none; }
.sidebar[open] > summary { border-bottom: 0; }
@media (min-width: 900px) { .sidebar > summary { display: none; } }
.sidebar .label { align-self: flex-start; margin: 16px 0 6px; }
.sidebar__nav > .label:first-child { margin-top: 0; }
.sidebar a { padding: var(--nav-pad); border-radius: var(--nav-radius); text-transform: none; letter-spacing: var(--tracking-small); }
.sidebar a:hover { background: var(--nav-hover-bg); }
/* The page you are on. Weight as well as colour, so it survives a theme with a quiet tint. */
.sidebar a[aria-current="page"] { background: var(--nav-active-bg); color: var(--nav-active-ink); }
/* A course a writer can't open yet on /training. Held back rather than hidden: the padlock and the
   reason are the point, so it stays legible — this is a step down in emphasis, not a greying-out. */
.course--locked { background: var(--paper); }
.course--locked .sub { opacity: 0.75; }
main { width: 100%; max-width: var(--measure); margin: 0 auto; padding: var(--section) 20px; }
main.wide { max-width: var(--measure-wide); }
footer { background: var(--band); color: var(--band-ink); font-size: var(--size-chrome); font-weight: var(--weight-bold); text-transform: var(--label-case); padding: 20px; display: flex; justify-content: space-between; gap: var(--gap); flex-wrap: wrap; }
footer a { color: var(--band-ink); }
footer a:hover { background: var(--accent); color: var(--accent-ink); }

/* Frames are the cards */
.frame { border: var(--border-width) solid var(--border); padding: var(--pad-frame); border-radius: var(--radius); background: var(--frame-bg); box-shadow: var(--shadow-frame); }
.section { margin-top: var(--section); }
.frame + .frame { margin-top: var(--section); }
.frame .label { margin: -1px 0 var(--gap) -1px; }
.frame--paper { background: var(--paper); }
.stack > * + * { margin-top: var(--gap); }
.cols { display: grid; gap: 40px; }
@media (min-width: 760px) { .cols { grid-template-columns: 1fr 1fr; } }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

/* Forms */
label { display: block; font-size: 12px; font-weight: var(--weight-bold); text-transform: var(--label-case); letter-spacing: var(--label-tracking); margin: var(--gap) 0 6px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=password], textarea, select {
  width: 100%; font: inherit; letter-spacing: inherit; color: var(--ink); background: var(--input-bg);
  border: var(--border-width) solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 0; appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
textarea { min-height: 360px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: var(--weight-body); text-transform: none; letter-spacing: -0.01em; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 20px; }
.check input { width: 14px; height: 14px; margin: 0; accent-color: var(--ink); }

.pill { display: inline-block; font: inherit; font-size: var(--size-pill); font-weight: var(--weight-bold); text-transform: var(--label-case); letter-spacing: var(--label-tracking); line-height: 1; padding: var(--pad-pill); border-radius: var(--radius-pill); border: var(--border-width) solid var(--border); background: var(--pill-bg); color: var(--ink); cursor: pointer; text-decoration: none; box-shadow: var(--shadow-btn); }
.pill:hover { background: var(--paper); }
.pill--fill { background: var(--fill-bg); border-color: var(--fill-border); color: var(--fill-ink); box-shadow: var(--shadow-btn-fill); }
.pill--fill:hover { background: var(--ink); color: var(--canvas); border-color: var(--border); }
.pill--sm { padding: var(--pad-pill-sm); }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: var(--section); }

.errors { border: var(--border-width) solid var(--border); padding: var(--pad-tight); margin-bottom: var(--gap); }
.errors .label { margin: 0 0 8px; }

/* Tables */
.tablewrap { overflow-x: auto; border-top: var(--border-width) solid var(--border); }
table { border-collapse: collapse; width: 100%; font-size: 14px; letter-spacing: -0.01em; }
th { text-align: left; font-size: var(--size-chrome); font-weight: var(--weight-bold); text-transform: var(--label-case); padding: 10px 8px; border-bottom: var(--border-width) solid var(--border); white-space: nowrap; }
td { padding: 10px 8px; border-bottom: var(--border-width) solid var(--border); vertical-align: top; }
tr.row { cursor: pointer; }
tr.row:hover { background: var(--paper); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.frame table td, .frame table th { padding: 8px 8px; }
.frame table tr:last-child td { border-bottom: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: end; margin-bottom: var(--gap); }
.toolbar label { margin: 0 0 6px; }
.toolbar > div { min-width: 180px; }

.post { white-space: pre-wrap; }

/* Pasted text inside a writer's post on the applicant page (admin-detail), so a reviewer can see
   what arrived by paste rather than by typing. */
.post mark.pasted { background: var(--accent); color: var(--accent-ink); padding: 0 1px; }
.kv { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; }
.kv strong { font-weight: var(--weight-bold); font-size: 12px; text-transform: var(--label-case); margin-right: 6px; }

details { border: var(--border-width) solid var(--border); }
details + details { margin-top: 12px; }
summary { cursor: pointer; padding: var(--pad-tight); list-style: none; display: flex; gap: 16px; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary .score { font-size: var(--size-sub); line-height: var(--leading-sub); letter-spacing: var(--tracking-sub); min-width: 5.2em; }
summary .score small { font-size: var(--size-chrome); letter-spacing: 0; opacity: 0.6; }
details[open] summary { border-bottom: var(--border-width) solid var(--border); }
details .body { padding: 0 var(--gap) var(--gap); }
.overall-cell { font-weight: var(--weight-bold); }
.overall-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.overall-head .score { font-size: var(--size-score-lg); line-height: var(--leading-score-lg); letter-spacing: var(--tracking-display-sm); min-width: 3.4em; }
.overall-head .score small { font-size: var(--size-chrome); letter-spacing: 0; opacity: 0.6; }
.overall-head > div { flex: 1 1 260px; }
.topic-filter { margin-top: 4px; }
.topic-filter summary { padding: 10px 12px; }
.topic-filter .body { padding: 0 12px 12px; }

pre { font-family: var(--font-mono); font-size: 13px; line-height: 1.5; letter-spacing: 0; white-space: pre-wrap; word-break: break-word; margin: 0; }
ol, ul { margin: 0 0 12px 20px; padding: 0; }
li { margin-bottom: 4px; }

/* ---- Responsive ---- */
.sticky-bar { position: sticky; top: 0; z-index: 2; background: var(--canvas); padding: 10px 0; margin: -10px 0 10px; }
summary { flex-wrap: wrap; }
summary .score { min-width: 4.6em; }

@media (max-width: 760px) {
  main { padding: 28px 16px; }
  .topbar { padding: 12px 16px; }
  .topbar nav { justify-content: flex-start; width: 100%; }
  .adminbar { padding: 10px 16px; }
  .adminbar nav { width: 100%; }
  .actions { gap: 10px; }
  .toolbar > div { min-width: 0; flex: 1 1 140px; }
  footer { flex-direction: column; gap: 8px; }
  details .body { padding: 0 12px 12px; }
  details table tr { display: grid; grid-template-columns: auto 1fr; }
  details table td:last-child { grid-column: 1 / -1; padding-top: 0; border-bottom: var(--border-width) solid var(--border); }
  details table td:not(:last-child) { border-bottom: 0; }
  /* Submissions list becomes stacked cards */
  table.list, table.list tbody, table.list tr, table.list td { display: block; }
  table.list thead, table.list tr.head { display: none; }
  table.list tr.row { border: var(--border-width) solid var(--border); padding: 12px 14px 10px; margin-bottom: 12px; }
  table.list td { border: 0; padding: 2px 0; display: flex; gap: 12px; justify-content: space-between; align-items: baseline; text-align: left; }
  table.list td.num { text-align: right; }
  table.list td::before { content: attr(data-label); font-size: 11px; font-weight: var(--weight-bold); text-transform: var(--label-case); letter-spacing: 0; opacity: 0.72; flex: 0 0 auto; }
  table.list td.no-label::before { content: none; }
  table.list td.hide-m, table.list td:empty { display: none; }
  table.list td.title-cell { font-size: 18px; letter-spacing: -0.01em; padding-bottom: 6px; display: flex; justify-content: space-between; }
  .tablewrap.list-wrap { border-top: 0; overflow: visible; }
}
@media (pointer: coarse) {
  .pill { min-height: 44px; padding: 12px 18px; }
  .pill--sm { min-height: 40px; padding: 10px 14px; }
  input[type=checkbox] { width: 20px; height: 20px; }
  .check input { width: 20px; height: 20px; }
  summary { padding: var(--pad-tight); }
}

@media (max-width: 1100px) {
  table.list th.hide-m, table.list td.hide-m { display: none; }
}

input[type=range] { accent-color: var(--ink); height: 28px; margin: 0; }
table.weights td { vertical-align: middle; }

/* Dual-handle range slider: two overlapping <input type=range>, each with a transparent track so
   only its thumb is clickable, stacked in one relatively-positioned box. */
.range-slider { position: relative; height: 28px; width: 220px; }
.range-slider input[type=range] {
  position: absolute; left: 0; top: 0; width: 100%; height: 28px; margin: 0;
  background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.range-slider input[type=range]::-webkit-slider-runnable-track { background: var(--ink); height: 2px; }
.range-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 16px; height: 16px; margin-top: -7px;
  border-radius: var(--radius-pill); background: var(--accent); border: var(--border-width) solid var(--border); cursor: pointer;
}
.range-slider input[type=range]::-moz-range-track { background: var(--ink); height: 2px; }
.range-slider input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 14px; height: 14px; border-radius: var(--radius-pill);
  background: var(--accent); border: var(--border-width) solid var(--border); cursor: pointer;
}

/* Openings board and the admin page behind it */
.plans { display: grid; gap: var(--gap); }
@media (min-width: 760px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.role + .role { margin-top: 24px; padding-top: 24px; border-top: var(--border-width) solid var(--border); }
textarea.ta-sm { min-height: 140px; }

/* Writer dashboard */
.dash-head { display: flex; gap: var(--gap); justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.dash-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.dash { display: grid; gap: var(--section); margin-top: var(--section); align-items: start; }
/* Grid items default to min-width:auto, so a wide table inside would push the whole page sideways
   instead of scrolling inside its own .tablewrap. */
.dash > * { min-width: 0; }
@media (min-width: 1000px) { .dash { grid-template-columns: minmax(0, 1fr) 320px; } }
.dash-rail .frame table td { padding: 6px 0; }
.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gap); }
.ring-card { border: var(--border-width) solid var(--border); padding: var(--gap); }
.ring { width: 110px; height: 110px; display: block; }
.ring-num { font-size: 18px; font-weight: var(--weight-bold); fill: var(--ink); letter-spacing: -0.02em; }
.grade { padding: 12px 0; }
.grade + .grade { border-top: var(--border-width) solid var(--border); }
.grade-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.grade .score { font-size: var(--size-score-md); line-height: var(--leading-score-md); letter-spacing: var(--tracking-display-sm); }
.grade .score small { font-size: var(--size-chrome); letter-spacing: 0; opacity: 0.6; }
/* A label inside a frame carries a 20px bottom margin (it's the frame's own heading tag). A label
   used as a status chip inside a table must not, or it stretches the row. */
.frame table .label { margin: 0; vertical-align: middle; }
.frame table.curriculum td { vertical-align: middle; height: 38px; line-height: 1; padding: 6px 8px; }

/* Prose: long-form training lesson/quiz copy (see training.formatProse). Editorial-grid /
   print-inspired treatment — thin ink rules as section dividers rather than yellow label pills
   (a lesson runs 8-12 section headers; that many pills would be noise, not hierarchy), relaxed
   1.5 line-height and a ~66ch measure for actual reading rather than the app's short-copy
   defaults, and a bordered paper-toned card for worked examples so they read as a distinct beat
   instead of blending into the surrounding paragraphs. */
.prose { max-width: var(--prose-measure); }
.prose > * + * { margin-top: 1.1em; }
.prose p { line-height: var(--leading-prose); margin: 0; }

.prose-heading { margin: 0; padding-top: 1em; border-top: var(--border-width) solid var(--border); font-size: 13px; font-weight: var(--weight-bold); text-transform: var(--label-case); letter-spacing: 0.03em; }
.prose > .prose-heading:first-child { padding-top: 0; border-top: 0; }
.prose-heading + * { margin-top: 0.6em; }
.prose-heading .aside { display: block; margin-top: 3px; font-size: 13px; font-weight: var(--weight-body); text-transform: none; letter-spacing: -0.01em; opacity: 0.72; }

.prose-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; line-height: var(--leading-prose); }
.prose-list li { display: flex; gap: 10px; align-items: baseline; }
.prose-list .marker { flex: 0 0 auto; font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; opacity: 0.5; }

.prose-example { border: var(--border-width) solid var(--border); background: var(--paper); padding: 14px 18px; display: grid; gap: 6px; }
.prose-example .row { line-height: var(--leading-prose); }
.prose-example .row.deep { padding-left: 18px; opacity: 0.72; font-size: 15px; }

/* Article elements — real h1-h6, blockquote, figure/caption, code. Same tokens and grammar
   as the block above, for content that carries its own markup instead of going through
   training.formatProse's plain-text parser (a rendered article, a richer training page).
   Yellow stays reserved for labels/pill/focus per the design language, so quotes and code
   lean on ink and paper only. */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { margin: 0; font-family: var(--font-display); font-weight: var(--weight-display); text-wrap: balance; }
.prose h1 { font-size: clamp(32px, 5vw, 44px); line-height: 1.05; letter-spacing: -0.03em; }
.prose h2 { font-size: clamp(24px, 3.6vw, 32px); line-height: 1.12; letter-spacing: -0.025em; }
.prose h3 { font-size: 23px; line-height: 1.18; letter-spacing: -0.02em; }
.prose h4 { font-size: 19px; line-height: 1.25; letter-spacing: -0.015em; }
.prose h5 { font-size: 18px; line-height: var(--leading-prose); font-weight: var(--weight-bold); }
.prose h6 { font-size: 13px; line-height: 1.3; font-weight: var(--weight-bold); text-transform: var(--label-case); letter-spacing: 0.03em; }

.prose blockquote { margin: 0; padding-left: var(--gap); border-left: calc(var(--border-width) * 2) solid var(--border); font-size: 20px; line-height: 1.4; letter-spacing: -0.01em; }
.prose blockquote p { line-height: inherit; }
.prose blockquote cite { display: block; margin-top: 8px; font-size: 12px; font-weight: var(--weight-bold); text-transform: var(--label-case); letter-spacing: 0.03em; font-style: normal; opacity: 0.72; }

.prose figure { margin: 0; }
.prose figure img, .prose figure svg { display: block; width: 100%; height: auto; border: var(--border-width) solid var(--border); }
.prose figcaption { margin-top: 8px; font-size: 13px; line-height: 1.4; opacity: 0.72; }

.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--paper); padding: 0.15em 0.4em; }
.prose pre { border: var(--border-width) solid var(--border); background: var(--paper); padding: var(--gap); margin: 0; overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: 13px; white-space: pre; }

.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Real <ul>/<ol> for markup content — distinct from .prose-list, which is the parser's
   numbered-marker layout. Strip the global ol/ul bottom-margin (line ~132) so only the
   .prose > * + * top-gap sets vertical rhythm; keeping both would just double the gap. */
.prose > ul, .prose > ol { margin: 0; padding-left: 1.3em; }
.prose > ul { list-style: disc; }
.prose > ol { list-style: decimal; }
.prose > ul li, .prose > ol li { line-height: var(--leading-prose); margin-bottom: 6px; }
.prose > ul li:last-child, .prose > ol li:last-child { margin-bottom: 0; }

/* A saved lesson's embedded YouTube/Vimeo video (from the admin Quill editor's video button) —
   responsive without needing a wrapper div. */
.prose iframe.ql-video { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: var(--border-width) solid var(--border); }

/* Quill "snow" theme, pulled onto the same tokens as the rest of the admin — thin ink borders,
   no radius, no shadow, Inter instead of Quill's default stack. Everything else about the
   editor's own layout (toolbar rows, icon SVGs) is left alone. */
.quill-host { background: var(--canvas); }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--border); border-radius: var(--radius); font-family: var(--font); }
.ql-toolbar.ql-snow { background: var(--paper); }
.ql-editor { font-size: 16px; line-height: var(--leading-prose); min-height: inherit; }
.ql-snow .ql-stroke { stroke: var(--ink); }
.ql-snow .ql-fill { fill: var(--ink); }
.ql-snow.ql-toolbar button:hover, .ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active, .ql-snow .ql-toolbar button.ql-active { background: var(--accent); }

/* Theme preview bar — shown only to an admin who pressed Preview on /admin/settings. Deliberately
   outside the token layer: it must stay legible whatever the theme being tried on does. */
.preview-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: #151515; color: #f3f3f3;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: 13px; letter-spacing: 0; line-height: 1.3;
}
.preview-bar form { display: flex; gap: 10px; align-items: center; margin: 0; }
.preview-bar .pill { border-color: #f3f3f3; color: #f3f3f3; box-shadow: none; }
.preview-bar .pill--fill { background: #fff824; border-color: #fff824; color: #151515; }
.preview-bar .pill:hover { background: #f3f3f3; color: #151515; }

/* Settings: the theme picker and its live preview strip */
.themes { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.theme-card { display: grid; gap: var(--gap); align-content: start; }
.theme-card .actions { flex-wrap: wrap; }
.theme-card form { margin: 0; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border: var(--border-width) solid var(--border); border-radius: var(--radius); }
.previews { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.previews figure { margin: 0; display: grid; gap: 8px; }
.previews iframe { width: 100%; height: 440px; border: var(--border-width) solid var(--border); border-radius: var(--radius); background: var(--canvas); }

/* Where a publication's work gets read, on its application page. Sits inside the dark band block,
   so it inherits --band-ink and only needs layout. */
.sources { display: grid; gap: var(--gap); margin-top: var(--section); }
@media (min-width: 720px) { .sources { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; } }
.tier-head { display: block; font-size: var(--size-label); font-weight: var(--weight-bold); text-transform: var(--label-case); letter-spacing: var(--label-tracking); }
.source-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.source-list li { margin: 0; }

/* One traffic-source row on the publication profile form: channel, tier, note. Stacks on a phone. */
.source-row { display: grid; gap: 12px; }
@media (min-width: 720px) { .source-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.4fr); align-items: end; } }

/* Pager (partials/pager.ejs). Wraps on a phone rather than scrolling sideways, and the count
   pushes to the far end on a wide screen so the controls stay together on the left. */
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: var(--gap); }
.pager > .small { margin-left: auto; }
@media (max-width: 720px) { .pager > .small { margin-left: 0; width: 100%; } }

/* ---- Editorial pages ----
   The homepage and each publication's application page: the two places the app draws rather than
   types, and the two a stranger judges us on. The illustration grammar is lifted from
   themes/syllabus/source/DESIGN.md: 1 to 1.5px ink strokes on a canvas fill, colour only as
   selective fills (--accent for highlights, --band for data and secondary elements), no gradients,
   no shadows, elements overlapping and breaking their frame. Every value is a token, so a theme
   re-colours every drawing; nothing here is a hard-coded hex.

   Namespaced under .editorial rather than .editorial so both pages can use it — the rules were always
   general, only the name was specific. Pages opt in with pageClass. */
.editorial .art { display: block; width: 100%; height: auto; }
.editorial .art .l { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.editorial .art .lt { fill: none; stroke: var(--ink); stroke-width: 1; }
.editorial .art .p { fill: var(--art-fill); stroke: var(--ink); stroke-width: 1.5; }  /* a drawn panel */
.editorial .art .a { fill: var(--accent); }                                          /* highlight block */
.editorial .art .ao { fill: var(--accent); stroke: var(--ink); stroke-width: 1.5; }
.editorial .art .s { fill: var(--ink); }                                             /* solid bar, arrowhead */
.editorial .art .d { fill: var(--band); }                                            /* data, secondary */
.editorial .art text { font-family: var(--font-mono); font-size: 13px; fill: var(--ink); }
.editorial .art .ring { fill: none; stroke: var(--band); stroke-width: 14; }      /* donut track */
.editorial .art .ring-seg { fill: none; stroke: var(--accent); stroke-width: 14; } /* its one coloured segment */

/* The same drawing on a band block: cream strokes, band-coloured panels, yellow unchanged. */
.editorial .art--invert .l, .editorial .art--invert .lt { stroke: var(--band-ink); }
.editorial .art--invert .p { fill: var(--band); stroke: var(--band-ink); }
.editorial .art--invert .ao { stroke: var(--band-ink); }
.editorial .art--invert .s, .editorial .art--invert .d { fill: var(--band-ink); }
.editorial .art--invert .ring { stroke: var(--band-ink); }
.editorial .art--invert text { fill: var(--band-ink); }

/* The reference cuts the top-left and bottom-right corners off its big blocks. --notch is 0 in
   Swiss, so the same markup stays square there. */
.editorial .notch { clip-path: polygon(var(--notch) 0, 100% 0, 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, 0 100%, 0 var(--notch)); }

.editorial .hero { display: grid; gap: var(--gap); align-items: center; }
@media (min-width: 860px) { .editorial .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; } }
.editorial .lede { font-family: var(--font-display); font-size: var(--size-sub); line-height: var(--leading-sub); letter-spacing: var(--tracking-sub); font-weight: var(--weight-body); }

/* One illustration per section, sides alternating — the reference's editorial rhythm. */
.editorial .rows { display: grid; gap: var(--section); margin-top: var(--section); }
.editorial .row { display: grid; gap: var(--gap); align-items: center; }
@media (min-width: 860px) {
  .editorial .row { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 56px; }
  .editorial .row--flip > .row-art { order: -1; }
}
.editorial .row-text > * + * { margin-top: 16px; }

/* The contrast block: the page's one dark surface, notched, with its illustration inverted. */
.editorial .band-block { background: var(--band); color: var(--band-ink); margin-top: var(--section); padding: clamp(32px, 5vw, 64px) clamp(20px, 4vw, 56px); }
.editorial .band-block a { color: var(--band-ink); }
.editorial .band-block .cols { align-items: start; }

.editorial .steps { display: grid; gap: var(--gap); margin: 0; padding: 0; list-style: none; }
.editorial .steps li { margin: 0; display: flex; gap: var(--gap); align-items: baseline; }
.editorial .steps .n { flex: 0 0 auto; min-width: 1.5em; font-size: var(--size-score-md); line-height: var(--leading-score-md); letter-spacing: var(--tracking-display-sm); font-variant-numeric: tabular-nums; opacity: 0.4; }
.editorial .steps .n + div { min-width: 0; }
