/* Scaled for Preps: the B2B layer over Scaled's "Instrument" system (docs/scaled-for-preps/DESIGN-PLAN.md).
   Light is the reference theme, on warm paper; the vivid emerald of Scaled becomes the colour of data in dark mode,
   and actions use a deep green that carries white text (5.9:1). Sand is for scores only, coral for what needs work.
   Loaded after Scaled's styles, in the app (app.html) and on the public pages. No inline style anywhere (CSP). */
:root {
  --bg: #F6F5F0;      --bg-2: #EEECE5;      --surface: #FFFFFF;   --surface-2: #F3F2EC;  --surface-3: #E7E5DD;
  --line: #DCDAD2;    --line-2: #C7C4BA;    --field: #7E8682;
  --ink: #14181A;     --ink-2: #4A5250;     --ink-3: #626A67;
  --accent: #0A7350;  --accent-hi: #085E42; --accent-ink: #FFFFFF; --accent-text: #0A7350; --accent-soft: #E3F1EA; --accent-line: #9CCBB4;
  --data: #139A6A;    --sand: #8A5410;      --sand-soft: #F4EBDA;
  --warn: #B23C0B;    --warn-soft: #FBEAE1;
  --focus: #0A7350;
  --f-text: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1312; --bg-2: #131817; --surface: #161B19; --surface-2: #1B211F; --surface-3: #232B28; --line: #2A332F; --line-2: #37433D; --field: #66746D;
    --ink: #ECEFEC; --ink-2: #A9B4AE; --ink-3: #8C9892;
    --accent: #2EE59D; --accent-hi: #5CEDB5; --accent-ink: #04140D; --accent-text: #2EE59D; --accent-soft: #12271E; --accent-line: #1F6B4C;
    --data: #2EE59D; --sand: #E6D3AE; --sand-soft: #2A2519; --warn: #FF8F66; --warn-soft: #33201A; --focus: #2EE59D; --glow: 0 0 0 0 transparent;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1312; --bg-2: #131817; --surface: #161B19; --surface-2: #1B211F; --surface-3: #232B28; --line: #2A332F; --line-2: #37433D; --field: #66746D;
  --ink: #ECEFEC; --ink-2: #A9B4AE; --ink-3: #8C9892;
  --accent: #2EE59D; --accent-hi: #5CEDB5; --accent-ink: #04140D; --accent-text: #2EE59D; --accent-soft: #12271E; --accent-line: #1F6B4C;
  --data: #2EE59D; --sand: #E6D3AE; --sand-soft: #2A2519; --warn: #FF8F66; --warn-soft: #33201A; --focus: #2EE59D; --glow: 0 0 0 0 transparent;
}
@font-face { font-family: "Newsreader"; src: url("/fonts/Newsreader-Variable.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/SourceSerif4-Variable.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

/* type: calmer than Scaled's poster headings; table headers in plain sentence case */
h1, .h1 { font-weight: var(--w-semi); letter-spacing: -0.02em; }
h2, .h2 { font-weight: var(--w-semi); letter-spacing: -0.015em; }
.table th { font: var(--w-semi) var(--t-sm) / 1.3 var(--f-sans); letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.badge { font: var(--w-semi) 12px / 1 var(--f-sans); letter-spacing: 0; text-transform: none; }
.d-block { display: block; }
.r { text-align: right; }
.grow { flex: 1; }
.bar > i { background: var(--data); }
.bar.warn > i { background: var(--warn); }

/* the organisation in the top bar */
/* the logo follows the palette (deep green in light, Scaled's emerald in dark), in the app and on the site */
.logo svg > rect { fill: var(--accent); }
.logo svg > g { fill: var(--accent-ink); }
.org-chip { display: inline-flex; align-items: center; gap: var(--s2); max-width: 220px; padding: 4px 10px 4px 6px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; }
.org-chip span { overflow: hidden; text-overflow: ellipsis; }
.org-chip img { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; }
@media (max-width: 560px) { .org-chip { max-width: 120px; } .appbar .logo span { display: none; } }

/* staff pages: the bar, the sections, the bands */
.staffbar .appbar-in { min-height: 56px; }
.staff-nav { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; padding-bottom: 0; }
.staff-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3); color: var(--ink-2); font-size: var(--t-md); font-weight: var(--w-medium); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.staff-nav a:hover { color: var(--ink); }
.staff-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.acct-menu { position: relative; }
.acct-menu summary { list-style: none; gap: var(--s2); }
.acct-menu summary::-webkit-details-marker { display: none; }
.acct-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; padding: var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); z-index: var(--z-menu); display: grid; gap: 2px; }
.acct-menu .menu a, .acct-menu .menu button { display: flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s3); border: 0; background: none; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-size: var(--t-md); text-align: left; }
.acct-menu .menu a:hover, .acct-menu .menu button:hover { background: var(--surface-2); }
.demo-band, .paused-band { border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.demo-band { background: var(--sand-soft); color: var(--ink); }
.demo-band .wrap, .paused-band .wrap { padding-block: var(--s2); }
.paused-band { background: var(--warn-soft); color: var(--ink); }

/* staff pages: layout */
.coach-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.panel { padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.kpi-row { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.kpi { display: grid; gap: 2px; padding: var(--s4) var(--s5); border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .k { font-size: var(--t-sm); color: var(--ink-2); }
.kpi .v { font: var(--w-semi) var(--t-3xl) / 1.1 var(--f-mono); letter-spacing: -0.03em; }
.kpi .s { font-size: var(--t-sm); color: var(--ink-3); }
.warn-t { color: var(--warn); }
.pos { color: var(--accent-text); }

/* needs attention */
.attn { display: grid; gap: var(--s2); }
.attn-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.attn-item { display: grid; gap: 2px; justify-items: start; padding: var(--s3) var(--s4); border: 0; border-right: 1px solid var(--line); background: none; text-align: left; min-height: 64px; }
.attn-item:last-child { border-right: 0; }
.attn-item b { font: var(--w-semi) var(--t-2xl) / 1.1 var(--f-mono); }
.attn-item span { font-size: var(--t-sm); color: var(--ink-2); }
.attn-item:hover { background: var(--surface-2); }
.attn-item.is-on { background: var(--warn-soft); box-shadow: inset 0 -2px var(--warn); }

/* weak spots: one line per question type */
.tbars { display: grid; gap: var(--s2); padding: 0; margin: 0; list-style: none; }
.tbars li { display: grid; grid-template-columns: minmax(130px, 220px) 1fr 44px 96px; align-items: center; gap: var(--s3); font-size: var(--t-md); }
.tbars .bar { height: 8px; }
.tbars .num { text-align: right; font-weight: var(--w-semi); }
@media (max-width: 560px) { .tbars li { grid-template-columns: 1fr 44px; } .tbars .bar { grid-column: 1 / -1; grid-row: 2; } .tbars li > .small { display: none; } }

/* the roster: the student line and its 26-mock strip */
.roster th[scope="row"] { font: inherit; font-weight: var(--w-semi); color: var(--ink); text-transform: none; letter-spacing: 0; background: none; border-bottom: 1px solid var(--line); vertical-align: top; padding: var(--s3) var(--s4); white-space: normal; min-width: 180px; }
.roster td { vertical-align: top; }
.roster a { color: var(--ink); text-decoration: none; }
.roster a:hover { text-decoration: underline; }
.strip { display: inline-grid; grid-template-columns: repeat(13, 7px); gap: 2px; }
.strip i { width: 7px; height: 7px; border-radius: 1.5px; background: var(--surface-3); }
.strip i.on { background: var(--data); opacity: .55; }
.strip i.best { background: var(--data); }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.flag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-pill); font-size: 12px; font-weight: var(--w-medium); background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.flag-essay { background: var(--sand-soft); color: var(--sand); }
.flag-never { background: var(--surface-3); color: var(--ink-2); }
.filters .input, .filters .select { min-height: 40px; width: auto; }
.filters .input { width: 220px; max-width: 100%; }
@media (max-width: 760px) { .hide-sm { display: none; } .roster th[scope="row"] { min-width: 140px; } }

/* student page */
.score-chart { width: 100%; height: auto; max-height: 140px; }
.score-chart .ln { stroke: var(--data); stroke-width: 2.5; }
.score-chart .pt { fill: var(--surface); stroke: var(--data); stroke-width: 2; }
.score-chart .lb { font: 600 11px var(--f-mono); fill: var(--ink-2); }
.plain-list { display: grid; gap: var(--s3); padding: 0; margin: 0; list-style: none; }
.plain-list > li + li { border-top: 1px solid var(--line); padding-top: var(--s3); }
.essay-item .essay-text { max-height: 260px; overflow: auto; padding: var(--s3); margin-block: var(--s2); background: var(--surface-2); border-radius: var(--r); font-family: var(--f-text); font-size: var(--t-base); line-height: 1.6; }
.essay-form .input.num { width: 80px; }
.cred { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); padding: var(--s4); background: var(--surface-2); border-radius: var(--r); margin: 0; }
.cred dt { color: var(--ink-2); }
.cred dd { margin: 0; word-break: break-all; }
.big-code { font-size: 40px; font-weight: var(--w-semi); letter-spacing: .08em; text-align: center; padding: var(--s4); border: 1px dashed var(--line-2); border-radius: var(--r); }
.link-box { padding: var(--s3); background: var(--surface-2); border-radius: var(--r); word-break: break-all; font-size: var(--t-sm); }
.code-input { text-transform: uppercase; letter-spacing: .12em; font-size: var(--t-xl); text-align: center; }
.code { letter-spacing: .06em; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip-check { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s3); border: 1px solid var(--line-2); border-radius: var(--r-pill); font-size: var(--t-sm); cursor: pointer; }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.hw-students { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px var(--s3); max-height: 240px; overflow: auto; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r); }
.logo-prev, .join-logo { border-radius: var(--r-sm); object-fit: contain; background: var(--surface-2); }
.set-form { max-width: 560px; }
.inv-form .select { width: auto; }
.empty-state { padding: var(--s10) var(--s5); text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty-state p { margin-inline: auto; max-width: 46ch; }

/* the student's homework */
.hw-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--accent-line); border-radius: var(--r); background: var(--accent-soft); }
.hw-list { display: grid; gap: var(--s3); padding: 0; margin: 0; list-style: none; }
.hw-item { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }

/* print: the student report ("Print or save as PDF") */
.print-only { display: none; }
@media print {
  .appbar, .staff-nav, .demo-band, .paused-band, .no-print, .tabbar, .toasts, .skip { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; color: #000; }
  .panel, .kpi-row, .table-wrap { border-color: #bbb; break-inside: avoid; }
  .page { padding: 0; }
}

/* ===================================================================== the public site */
/* the public pages only (the app keeps its own look), after antimetal.com (design/antimetal-reference.md): warm paper
   and ink, an editorial serif at normal weight for headlines, Geist for text, Geist Mono for labels, slow reveals */
.pub { --f-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1); --t-hover: .15s;
  --bg: #F5F6F1; --bg-2: #EEEFE9; --surface: #FBFBF8; --surface-2: #EFEFE9; --surface-3: #E6E6DF; --line: #E0DFD8; --line-2: #CDCBC3;
  --ink: #1A1614; --ink-2: #5C5956; --ink-3: #6E6A66;
  --accent: #1A1614; --accent-hi: #3A3431; --accent-ink: #F5F6F1; --accent-text: #4C6436; --accent-soft: #E8ECE0; --accent-line: #B9C4A8; --focus: #4C6436;
  --sage: #6D8352; background: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pub {
  --bg: #1A1614; --bg-2: #1F1A18; --surface: #221D1B; --surface-2: #2A2522; --surface-3: #332D2A; --line: #352F2C; --line-2: #4A423E;
  --ink: #FAFBF7; --ink-2: #BBBBB7; --ink-3: #9C9893;
  --accent: #FAFBF7; --accent-hi: #FFFFFF; --accent-ink: #1A1614; --accent-text: #A9BC8F; --accent-soft: #262A1F; --accent-line: #4D5B3D; --focus: #A9BC8F; --sage: #A9BC8F; } }
:root[data-theme="dark"] .pub {
  --bg: #1A1614; --bg-2: #1F1A18; --surface: #221D1B; --surface-2: #2A2522; --surface-3: #332D2A; --line: #352F2C; --line-2: #4A423E;
  --ink: #FAFBF7; --ink-2: #BBBBB7; --ink-3: #9C9893;
  --accent: #FAFBF7; --accent-hi: #FFFFFF; --accent-ink: #1A1614; --accent-text: #A9BC8F; --accent-soft: #262A1F; --accent-line: #4D5B3D; --focus: #A9BC8F; --sage: #A9BC8F; }
html:has(> body.pub) { background: #F5F6F1; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]):has(> body.pub) { background: #1A1614; } }
html[data-theme="dark"]:has(> body.pub) { background: #1A1614; }
.pub .logo svg > rect { fill: #0A7350; }
.pub .logo svg > g { fill: #FFFFFF; }
.pub h1, .pub h2, .pub .h1, .pub .h2, .pub .h3 { font-family: var(--f-display); font-weight: 400; font-optical-sizing: auto; color: var(--ink); }
.pub h2, .pub .h2 { font-size: clamp(2.1375rem, 1.702rem + 1.859vw, 3.375rem); line-height: 1.08; letter-spacing: -0.02em; }
.pub h3.h3, .pub .h3 { font-size: clamp(1.6875rem, 1.41rem + 1.184vw, 2.475rem); line-height: 1.15; letter-spacing: -0.015em; }
.pub .h4 { font-weight: 500; letter-spacing: -0.01em; }
.eyebrow, .pub h2.eyebrow { margin: 0; font: 400 12px / 1.4 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.pub .btn { font-weight: 500; transition: background-color var(--t-hover) var(--ease-out), border-color var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out), transform var(--t-hover) var(--ease-out); }
.pub .btn:active { transform: translateY(1px); }
.pub a { transition: color var(--t-hover) var(--ease-out); }
.pub .table-wrap, .pub .shot img, .pub .shot-item img { border-radius: 8px; }
/* motion: hidden only when the script runs and motion is welcome; without the script everything is visible */
@keyframes pub-rise { from { opacity: 0; translate: 0 1rem; } }
@keyframes pub-word { from { opacity: 0; translate: 0 .375rem; filter: blur(4px); } }
@media (prefers-reduced-motion: no-preference) {
  [data-js] .pub [data-reveal]:not([data-revealed]) { opacity: 0; }
  [data-js] .pub [data-reveal][data-revealed] { animation: pub-rise .8s var(--ease-out) backwards; animation-delay: var(--d, 0ms); }
  [data-d="1"] { --d: 80ms; } [data-d="2"] { --d: 160ms; } [data-d="3"] { --d: 240ms; }
  [data-js] .pub .hero-word { display: inline-block; animation: pub-word .7s var(--ease-out) backwards; animation-delay: calc(var(--i) * 40ms + 60ms); }
}
.pub main { display: block; }
.pub .pub-nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--accent); }
.lang-link { display: inline-grid; place-items: center; min-width: var(--hit-sm); height: var(--hit-sm); padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink-2); font: var(--w-semi) var(--t-sm) / 1 var(--f-sans); text-decoration: none; }
.lang-link:hover { color: var(--ink); border-color: var(--line-2); }
@media (max-width: 1080px) { .pub .pub-nav { display: none; } .pub .site-menu { display: block; } }
/* "Sign in" stays in the bar on a phone (the theme switch moved to the footer to make room); it is also first in the menu */
@media (max-width: 760px) { .pub .site-bar .site-acts .btn-ghost { display: inline-flex; } }
@media (max-width: 560px) { .pub .lang-link { display: none; } }
@media (max-width: 359px) { .pub .site-bar .site-acts .btn-ghost { display: none; } }
.pub-hero { padding-block: clamp(40px, 6vw, 72px) clamp(36px, 4vw, 56px); }
.pub-hero .wrap { display: grid; gap: var(--s10); }
.pub-hero-copy { display: grid; gap: var(--s5); align-content: start; max-width: 64em; }
.pub-hero h1 { font-size: clamp(2.7rem, 1.4rem + 4.6vw, 5.6rem); line-height: 1; letter-spacing: -0.035em; max-width: 14em; }
.pub-hero .lede { font-size: clamp(18px, 1.5vw, 20px); color: var(--ink-2); }
.pub .lede { max-width: 62ch; }
.margin-note { max-width: 62ch; }
@media (max-width: 420px) { .pub-hero { padding-block: var(--s8) var(--s8); } .pub-hero-copy { gap: var(--s4); } }
.pub-ctas { gap: var(--s3); margin-bottom: var(--s2); }
.pub-head { padding-block: var(--s12) var(--s6); }
.pub-head h1 { font-size: clamp(2.7rem, 1.987rem + 3.042vw, 4.725rem); line-height: 1.02; letter-spacing: -0.025em; }
.pub-head .lede { margin-top: var(--s4); }
.narrow-l > * { max-width: 820px; }                 /* same left edge as the full-width sections below */
.pub-sec { padding-block: clamp(64px, 8vw, 120px); border-top: 1px solid var(--line); }
.pub-sec h2 { margin-bottom: var(--s5); }
.pub p, .pub dd, .pub li, .pub figcaption { text-wrap: pretty; }
.pub .field-error:empty { display: none; }
.more { display: inline-flex; align-items: center; min-height: var(--hit-sm); font-weight: var(--w-medium); }
@media (pointer: coarse) { .more { min-height: var(--hit); } }
.pub-sec .stack-sm h2 { margin-bottom: 0; }
/* the home page's measured results: two figures set very big on a dark ink band (dark in both themes) */
.impact { --i-bg: #1A1614; --i-ink: #FAFBF7; --i-ink-2: #BBBBB7; --i-line: #3A3431; background: var(--i-bg); color: var(--i-ink); padding-block: clamp(48px, 6vw, 88px) clamp(56px, 7vw, 104px); }
:root[data-theme="dark"] .impact { --i-bg: #231E1C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .impact { --i-bg: #231E1C; } }
.impact .eyebrow { color: #9C9893; }
.impact-item .impact-n::first-letter { color: #A9BC8F; }
.impact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: clamp(32px, 5vw, 72px) 0 0; padding: 0; list-style: none; }
.impact-item { display: grid; gap: var(--s3); align-content: start; padding-right: clamp(24px, 4vw, 64px); }
.impact-item + .impact-item { padding: 0 0 0 clamp(24px, 4vw, 64px); border-left: 1px solid var(--i-line); }
.impact-item .impact-n { margin-bottom: -.06em; font: 300 clamp(6rem, 3rem + 12vw, 15rem) / .8 var(--f-display); letter-spacing: -0.05em; color: var(--i-ink); white-space: nowrap; font-variant-numeric: lining-nums; }
.impact-item h3 { font-family: var(--f-display); font-weight: 400; margin: 0; color: var(--i-ink); font-size: clamp(1.6875rem, 1.41rem + 1.184vw, 2.475rem); line-height: 1.12; letter-spacing: -0.015em; max-width: 16em; }
.impact-item p { color: var(--i-ink-2); line-height: 1.6; max-width: 36em; }
@media (max-width: 860px) { .impact-list { grid-template-columns: 1fr; gap: var(--s8); } .impact-item { padding: 0; } .impact-item + .impact-item { padding: var(--s8) 0 0; border-left: 0; border-top: 1px solid var(--i-line); } }
/* what the students get: four figures in a ruled row */
.figures-sec { padding-block: clamp(56px, 7vw, 104px) clamp(64px, 8vw, 120px); }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: var(--s5) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.figures li { display: grid; gap: var(--s3); align-content: start; padding: var(--s5) var(--s5) var(--s5) 0; border-right: 1px solid var(--line); }
.figures li + li { padding-left: var(--s5); }
.figures li:last-child { border-right: 0; }
.figures b { font: 300 clamp(2.8rem, 1.2rem + 3.3vw, 4.2rem) / .9 var(--f-display); letter-spacing: -0.04em; color: var(--ink); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.figures span { color: var(--ink-2); max-width: 18em; }
@media (max-width: 860px) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } .figures li:nth-child(2) { border-right: 0; } .figures li:nth-child(3) { padding-left: 0; } .figures li:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 420px) { .figures b { font-size: clamp(2.2rem, 10vw, 2.8rem); } .figures li { padding-inline: 0 var(--s3); } .figures li + li { padding-left: var(--s3); } .figures li:nth-child(3) { padding-left: 0; } }
.scores-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4) var(--s8); padding-block: var(--s8) var(--s10); }
.scores-line h3 { font: 400 clamp(1.6875rem, 1.41rem + 1.184vw, 2.475rem) / 1.12 var(--f-display); letter-spacing: -0.015em; }
.scores-line p { color: var(--ink-2); max-width: 46ch; align-self: end; }
@media (max-width: 760px) { .scores-line { grid-template-columns: 1fr; } }
/* product captures: the light or the dark one follows the theme */
.shot { margin: 0; display: grid; gap: var(--s2); }
.shot img, .shot-item img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.shot figcaption { font-size: var(--t-sm); color: var(--ink-2); }
.shot-dark { display: none; }
/* each capture sits on a soft coloured backdrop (sage, sand or slate, from the palette of design/antimetal-reference.md),
   so the app never melts into the page's own paper */
.frame { --f1: #DCE3CF; --f2: #C3CFAE; --f3: #EEF0E6; position: relative; padding: clamp(14px, 3.6vw, 56px); border-radius: 12px; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, var(--f3) 0%, transparent 55%), radial-gradient(90% 80% at 100% 100%, var(--f2) 0%, transparent 60%), var(--f1); }
.frame-sand { --f1: #EADFCD; --f2: #D9C3A2; --f3: #F5EEE2; }
.frame-blue { --f1: #D7E0E6; --f2: #B5C6D2; --f3: #ECF0F2; }
.shots .shot-item:nth-child(4n+2) .frame { --f1: #EADFCD; --f2: #D9C3A2; --f3: #F5EEE2; }
.shots .shot-item:nth-child(4n+3) .frame { --f1: #D7E0E6; --f2: #B5C6D2; --f3: #ECF0F2; }
.shots .shot-item:nth-child(4n+4) .frame { --f1: #E6D9D6; --f2: #CFB3AE; --f3: #F3ECEA; }
.shots .frame { padding: clamp(12px, 2.4vw, 32px); }
.pub .frame img { vertical-align: top; border: 1px solid rgb(26 22 20 / .08); border-radius: 8px; box-shadow: 0 1px 2px rgb(26 22 20 / .06), 0 12px 32px -8px rgb(26 22 20 / .22); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .frame { --f1: #2A2F25; --f2: #3B4630; --f3: #22251E; } :root:not([data-theme="light"]) .frame-sand, :root:not([data-theme="light"]) .shots .shot-item:nth-child(4n+2) .frame { --f1: #332B22; --f2: #4A3B2A; --f3: #27221C; } :root:not([data-theme="light"]) .frame-blue, :root:not([data-theme="light"]) .shots .shot-item:nth-child(4n+3) .frame { --f1: #262C31; --f2: #34414B; --f3: #1F2327; } :root:not([data-theme="light"]) .shots .shot-item:nth-child(4n+4) .frame { --f1: #302725; --f2: #463532; --f3: #261F1E; } :root:not([data-theme="light"]) .pub .frame img { border-color: rgb(255 255 255 / .08); box-shadow: 0 12px 32px -8px rgb(0 0 0 / .6); } }
:root[data-theme="dark"] .frame { --f1: #2A2F25; --f2: #3B4630; --f3: #22251E; }
:root[data-theme="dark"] .frame-sand, :root[data-theme="dark"] .shots .shot-item:nth-child(4n+2) .frame { --f1: #332B22; --f2: #4A3B2A; --f3: #27221C; }
:root[data-theme="dark"] .frame-blue, :root[data-theme="dark"] .shots .shot-item:nth-child(4n+3) .frame { --f1: #262C31; --f2: #34414B; --f3: #1F2327; }
:root[data-theme="dark"] .shots .shot-item:nth-child(4n+4) .frame { --f1: #302725; --f2: #463532; --f3: #261F1E; }
:root[data-theme="dark"] .pub .frame img { border-color: rgb(255 255 255 / .08); box-shadow: 0 12px 32px -8px rgb(0 0 0 / .6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .shot-dark { display: block; } :root:not([data-theme="light"]) .shot-light:not(.shot-any) { display: none; } }
:root[data-theme="dark"] .shot-dark { display: block; }
:root[data-theme="dark"] .shot-light:not(.shot-any) { display: none; }
.demo-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-right: 6px; border-radius: var(--r-pill); background: var(--sand-soft); color: var(--sand); font: var(--w-semi) 11px / 1 var(--f-sans); letter-spacing: .04em; text-transform: uppercase; }
.shots { display: grid; gap: var(--s8) var(--s6); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shot-item { margin: 0; display: grid; gap: var(--s3); align-content: start; }
.shot-item figcaption { display: grid; gap: var(--s1); }
@media (max-width: 760px) { .shots { grid-template-columns: 1fr; } }
.compare-table td { vertical-align: top; white-space: normal !important; padding-block: var(--s4); }
.compare-table td:first-child { color: var(--ink-2); width: 45%; }
.compare-table td:last-child { font-weight: var(--w-medium); }
/* on a phone each row becomes a pair: "Without a platform" above "With …", each with its own label */
@media (max-width: 640px) {
  .compare-table thead { display: none; }
  .compare-table, .compare-table tbody, .compare-table tr, .compare-table td { display: block; width: auto !important; }
  .compare-table tr { padding-block: var(--s3); border-bottom: 1px solid var(--line); }
  .compare-table tr:last-child { border-bottom: 0; }
  .compare-table td { padding: var(--s1) var(--s4); border: 0; overflow-wrap: anywhere; }
  .compare-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; font: var(--w-medium) var(--t-xs) / 1.3 var(--f-sans); color: var(--ink-3); }
}
.timeline { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; border-left: 2px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: var(--s4); padding: var(--s3) 0 var(--s3) var(--s5); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline .when { font-weight: var(--w-semi); color: var(--ink); }
.timeline-l li { grid-template-columns: 220px 1fr; }
@media (max-width: 640px) { .timeline li, .timeline-l li { grid-template-columns: 1fr; gap: var(--s1); } }
/* the packs: a ruled list; name and seats, what you get, the button; a card per pack on a phone */
.pack-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.pack { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: var(--s3) var(--s6); align-items: center; padding-block: var(--s5); border-bottom: 1px solid var(--line); }
.pack-id { display: grid; gap: 2px; }
.pack-id h2 { margin: 0; }
.pack-seats { font-size: var(--t-sm); color: var(--ink-2); }
.pack-seats .num { font-weight: var(--w-semi); color: var(--ink); }
.pack-what { color: var(--ink-2); max-width: 52ch; }
.pack-act .btn { white-space: nowrap; }
@media (max-width: 700px) {
  .pack-list { gap: var(--s3); border-top: 0; }
  .pack { grid-template-columns: 1fr; gap: var(--s2); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
  .pack-pilot { border-color: var(--accent-line); }
  .pack-id { grid-auto-flow: column; justify-content: space-between; align-items: baseline; }
  .pack-act { margin-top: var(--s2); }
  .pack-act .btn { width: 100%; justify-content: center; }
}
.pack-table th[scope="row"] { font: var(--w-semi) var(--t-base) / 1.3 var(--f-sans); color: var(--ink); background: none; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--line); padding: var(--s4); }
.pack-table td { padding-block: var(--s4); white-space: normal !important; }
.pack-table tr:last-child th { border-bottom: 0; }
.pack-table td.num { font-family: var(--f-mono); font-weight: var(--w-semi); }
.pack-table td.r { white-space: nowrap !important; }
.feature-list { display: grid; gap: var(--s5) var(--s8); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin: 0; }
.feature-list dt { font-weight: var(--w-semi); }
.feature-list dd { margin: var(--s1) 0 0; color: var(--ink-2); }
.feature-list + .shot { margin-top: var(--s6); }
/* seven coach features on three columns: the last one takes the whole row rather than sitting alone in a corner */
@media (min-width: 1020px) { .feature-list > div:last-child:nth-child(3n+1) { grid-column: 1 / -1; } .feature-list > div:last-child:nth-child(3n+1) dd { max-width: 62ch; } }
.doc-rows { display: grid; margin: 0; border-top: 1px solid var(--line); }
.doc-rows > div { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--s5); padding-block: var(--s5); border-bottom: 1px solid var(--line); }
.doc-rows dt { font-weight: var(--w-semi); }
.doc-rows dd { margin: 0; font-family: var(--f-text); font-size: 17px; line-height: 1.6; max-width: 62ch; }
@media (max-width: 760px) { .doc-rows > div { grid-template-columns: 1fr; gap: var(--s2); } }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; padding: var(--s4) var(--s8) var(--s4) 0; font-weight: var(--w-semi); list-style: none; position: relative; min-height: var(--hit); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 4px; top: var(--s4); font: var(--w-semi) 20px / 1 var(--f-mono); color: var(--ink-3); }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding: 0 0 var(--s5); font-family: var(--f-text); font-size: 17px; line-height: 1.6; color: var(--ink); max-width: 62ch; }
.pub-cta-line { margin-top: var(--s8); }
.pub-two { gap: var(--s8); }
.pub-cta-box { align-content: start; }
.split-demo { display: flex; align-items: center; justify-content: space-between; gap: var(--s6); flex-wrap: wrap; }
.demo-grid { display: grid; gap: var(--s8); grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .demo-grid { grid-template-columns: 1fr; } }
.form-two { gap: var(--s4); }
.seg-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.legal-doc h2 { font-size: var(--t-lg); margin: var(--s6) 0 var(--s2); }
.legal-doc p, .legal-doc li { font-family: var(--f-text); font-size: 17px; line-height: 1.6; max-width: 66ch; }
.legal-doc ul { padding-left: 1.2em; }
.legal-doc p + p { margin-top: var(--s3); }

/* fieldsets: no browser frame (demo form, homework form) */
.pub fieldset, .coach fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pub legend, .coach legend { padding: 0; margin-bottom: var(--s2); font-size: var(--t-sm); font-weight: var(--w-medium); color: var(--ink); }
.demo-grid .timeline li { grid-template-columns: 28px 1fr; }
.who { padding-top: var(--s6); border-top: 1px solid var(--line); }
.who-list { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; color: var(--ink-2); }
.who-list li { padding-left: var(--s4); position: relative; }
.who-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
/* the footer carries the theme switch on the public pages */
.foot-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--s3) var(--s6); flex-wrap: wrap; }
@media (pointer: coarse) { .site-foot .theme-switch button { width: var(--hit); height: var(--hit); } }

/* white label on the public pages: the same sign-in page under two fictional brands (fixed colours, light preview) */
.wl { margin: 0; display: grid; gap: var(--s3); }
.wl-pair { display: grid; gap: var(--s5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .wl-pair { grid-template-columns: 1fr; } }
.wl .bp-body { padding: var(--s6) var(--s5); }
.wl .bp-welcome { font-size: var(--t-lg); }
.wl-north { --b-accent-l: #1F4C9E; --b-data-l: #3567C2; }
.wl-harbor { --b-accent-l: #9C3D1A; --b-data-l: #C25228; }

/* ===================================================================== an organisation's brand (js/preps/brand.js) */
html[data-brand-color] { --accent: var(--b-accent-l); --accent-hi: var(--b-accent-hi-l); --accent-ink: var(--b-ink-l); --accent-text: var(--b-accent-l); --accent-soft: var(--b-soft-l); --accent-line: var(--b-line-l); --data: var(--b-data-l); --focus: var(--b-accent-l); }
@media (prefers-color-scheme: dark) {
  html[data-brand-color]:not([data-theme="light"]) { --accent: var(--b-accent-d); --accent-hi: var(--b-accent-hi-d); --accent-ink: var(--b-ink-d); --accent-text: var(--b-accent-d); --accent-soft: var(--b-soft-d); --accent-line: var(--b-line-d); --data: var(--b-data-d); --focus: var(--b-accent-d); }
}
html[data-brand-color][data-theme="dark"] { --accent: var(--b-accent-d); --accent-hi: var(--b-accent-hi-d); --accent-ink: var(--b-ink-d); --accent-text: var(--b-accent-d); --accent-soft: var(--b-soft-d); --accent-line: var(--b-line-d); --data: var(--b-data-d); --focus: var(--b-accent-d); }
html[data-brand-color] .exam { --x-next: var(--b-accent-l); }
/* the organisation's logo in place of ours; its name is the brand name; the chip would repeat it */
html[data-org-logo] .logo > svg { display: none; }
html[data-org-logo] .logo::before { content: ""; flex: none; width: 30px; height: 30px; border-radius: 7px; background: var(--surface) var(--org-logo) center / contain no-repeat; box-shadow: inset 0 0 0 1px var(--line); }
html[data-branded] .appbar .org-chip { display: none; }
html[data-branded] .logo span { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { html[data-branded] .appbar .logo span { display: inline; max-width: 150px; font-size: 16px; } }
.powered { font-size: var(--t-xs); color: var(--ink-3); }
.powered a { color: inherit; }

/* the organisation's own page (/p/…) */
.prep-home { min-height: 100vh; display: grid; grid-template-rows: 1fr auto; background:
  linear-gradient(var(--accent), var(--accent)) top / 100% 4px no-repeat, var(--bg); }
.prep-home-in { display: grid; gap: var(--s10); grid-template-columns: minmax(0, 1.2fr) minmax(300px, 400px); align-items: center; padding-block: var(--s16); }
.prep-id { display: grid; gap: var(--s4); justify-items: start; max-width: 34em; }
.prep-logo { width: 88px; height: 88px; border-radius: 18px; object-fit: contain; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); padding: 8px; }
.prep-mono { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); font: var(--w-semi) 40px / 1 var(--f-sans); }
.prep-id h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; }
.prep-welcome { font-family: var(--f-text); font-size: 20px; line-height: 1.55; color: var(--ink-2); }
.prep-facts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); padding: 0; margin: var(--s2) 0 0; list-style: none; font-size: var(--t-sm); color: var(--ink-2); }
.prep-facts li { display: inline-flex; align-items: center; gap: var(--s2); }
.prep-facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.prep-acts { display: grid; gap: var(--s4); }
.prep-card { display: grid; gap: var(--s4); padding: var(--s6); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.prep-card-staff { padding: var(--s5) var(--s6); background: transparent; box-shadow: none; }
.prep-code { display: grid; gap: var(--s2); padding-top: var(--s4); border-top: 1px solid var(--line); }
.prep-code label { font-size: var(--t-sm); color: var(--ink-2); }
.prep-code .row { flex-wrap: nowrap; }
.prep-code .code-input { font-size: var(--t-base); letter-spacing: .1em; min-width: 0; flex: 1; }
.prep-foot { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding-block: var(--s5); border-top: 1px solid var(--line); }
@media (max-width: 860px) { .prep-home-in { grid-template-columns: 1fr; gap: var(--s8); padding-block: var(--s10); } }
.menu-powered { display: block; padding: var(--s2) var(--s3) 0; border-top: 1px solid var(--line); margin-top: var(--s1); }

/* brand settings: colour fields and the live preview (its colours set on the element itself, through CSSOM) */
.color-input { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.hex-input { width: 110px; text-transform: lowercase; }
.slug-input { width: 220px; }
.set-two { align-items: start; }
.brand-preview { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #F6F5F0; color: #14181A; box-shadow: inset 0 3px var(--b-accent-l, #0A7350); }
.bp-bar { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid #DCDAD2; background: #fff; }
.bp-bar img { border-radius: 4px; object-fit: contain; }
.bp-mono { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--b-accent-l, #0A7350); color: #fff; font: 600 12px / 1 var(--f-sans); }
.bp-name { font-size: var(--t-sm); }
.bp-body { display: grid; gap: var(--s3); justify-items: start; padding: var(--s5) var(--s4); }
.bp-welcome { font-family: var(--f-text); font-size: var(--t-base); color: #4A5250; }
.bp-btn { display: inline-flex; align-items: center; height: 38px; padding: 0 var(--s4); border-radius: var(--r-sm); background: var(--b-accent-l, #0A7350); color: #fff; font-weight: var(--w-semi); font-size: var(--t-sm); }
.bp-link { color: var(--b-accent-l, #0A7350); font-size: var(--t-sm); text-decoration: underline; text-underline-offset: 3px; }
.bp-bars { display: flex; gap: 3px; align-items: flex-end; height: 22px; }
.bp-bars i { width: 8px; border-radius: 2px; background: var(--b-data-l, #139A6A); }
.bp-bars i:nth-child(1) { height: 9px; } .bp-bars i:nth-child(2) { height: 15px; } .bp-bars i:nth-child(3) { height: 22px; }
.steps-list { display: grid; gap: var(--s2); margin: var(--s3) 0 0; padding-left: 1.2em; line-height: 1.55; }
/* file fields (logos, student lists): the button looks like ours */
input[type="file"].input { height: auto; min-height: 44px; padding: 6px; font-size: var(--t-sm); color: var(--ink-2); cursor: pointer; }
input[type="file"].input::file-selector-button { height: 32px; margin-right: var(--s3); padding: 0 var(--s3); border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); font: var(--w-semi) var(--t-sm) / 1 var(--f-sans); cursor: pointer; }
input[type="file"].input::file-selector-button:hover { border-color: var(--field); }

@media (max-width: 760px) {
  .staff-nav { flex-wrap: wrap; overflow: visible; gap: 0 var(--s1); }
  .staff-nav a { min-height: 40px; padding: 0 var(--s2); }
  .kpi { padding: var(--s3); }
  .kpi .v { font-size: var(--t-2xl); }
}

.table td.num, .table td:first-child.num { white-space: nowrap; }
@media (max-width: 760px) { .filters { width: 100%; } .filters .input, .filters .select { flex: 1 1 100%; width: 100%; } }

/* admin: the quote (prices come from the server, admin only) */
.quote-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.quote-grid .select { min-width: 0; width: 100%; }
.quote-table .total th, .quote-table .total td { border-top: 2px solid var(--line-strong, var(--line)); background: none; text-align: left; }
.small.block { display: block; }

/* admin: an issued invoice, on screen and printed (A4) */
.invoice { max-width: 820px; display: grid; gap: var(--s6); padding: var(--s8); }
.inv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); align-items: flex-start; }
.inv-head h1 { margin: 0; }
.inv-kicker, .inv-label { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3, var(--muted)); margin: 0 0 var(--s1); font-weight: 600; }
.inv-dates { display: grid; grid-template-columns: auto auto; gap: var(--s1) var(--s4); margin: 0; font-size: .9rem; }
.inv-dates dt { color: var(--ink-3, var(--muted)); } .inv-dates dd { margin: 0; text-align: right; }
.inv-parties { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.inv-parties p, .inv-pay p { margin: 0; line-height: 1.55; }
.inv-wrap { border: 0; }
.inv-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2) var(--s6); margin: 0 0 0 auto; width: min(100%, 480px); }
.inv-totals dt { color: var(--ink-2, inherit); text-align: right; } .inv-totals dd { margin: 0; text-align: right; }
.inv-totals .total { border-top: 2px solid var(--line-strong, var(--line)); padding-top: var(--s2); font-size: 1.05rem; color: var(--ink); }
.inv-mention { font-size: .85rem; margin: 0; padding: var(--s3) var(--s4); border-left: 3px solid var(--line-strong, var(--line)); background: var(--surface-2, transparent); }
#bl-box > summary { cursor: pointer; }
#bl-box > summary > span { margin-left: var(--s2); }
.inv-qty { display: none; }
@media (max-width: 600px) {
  .invoice { padding: var(--s5); gap: var(--s5); }
  .inv-dates { grid-template-columns: 1fr; gap: 0; } .inv-dates dd { text-align: left; margin-bottom: var(--s2); }
  .inv-lines th, .inv-lines td { padding-inline: var(--s2); font-size: .85rem; }
  .inv-lines .inv-cu { display: none; }
  .inv-qty { display: block; color: var(--ink-3, var(--muted)); margin-top: 2px; }
}
@media print {
  @page { size: A4; margin: 16mm; }
  html, body, #app, main, .page { min-height: 0 !important; height: auto !important; }
  .invoice { break-inside: avoid; }
  .invoice { border: 0; padding: 0; max-width: none; box-shadow: none; }
  .inv-mention { background: none; }
}
