/* GradeHub's look, in one place. The signed-in app (input.css) and the static
   pages (pages/assets/site.css) both read these tokens, so a colour, a radius or
   the typeface is changed here and nowhere else.

   The neutrals, type and card treatment follow Nightshade HQ (DeadRare
   services/dashboard/style/dashboard.css). The chrome is neutral on purpose:
   colour on a page means the brand lime, a degree class or a status.

   Light is the default. Dark is its own set, not a flip. theme.js puts the
   resolved theme on <html data-theme>; the media query below covers a browser
   with scripts off. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --page: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f1f0ed;
  --hover: rgba(11, 11, 11, 0.055);
  --surface-3: #e8e7e2;
  --seg-on: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #6b6964;
  --line: #e8e7e2;
  --axis: #c3c2b7;
  --hair: rgb(11 11 11 / 0.09);
  --scrim: rgb(0 0 0 / 0.4);

  /* GradeHub's main colour, and the dark green that is readable on it. */
  --lime: #a6e70f;
  --lime-ink: #1d2a00;
  --lime-soft: #eff9d3;
  --lime-text: #4d6d00;
  --focus: #0b0b0b;

  --link: var(--lime-text);
  --good: #1f7a2e;
  --bad: #b42323;
  --bad-soft: #fbe9e9;
  --warn: #e8a000;
  --warn-bg: #fdf1d3;
  --warn-ink: #6b4a00;

  /* Degree classes: First, 2:1, 2:2, Third. */
  --k-first: #1f7a2e;
  --k-21: #1c5cab;
  --k-22: #8a5a00;
  --k-third: #a4461a;

  /* The dark block (the hand-off, the pinned result). */
  --slab: #0b0b0b;
  --slab-ink: #ffffff;
  --slab-line: rgb(255 255 255 / 0.22);

  --radius: 12px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgb(11 11 11 / 0.04);
  --card-ring: 0 0 0 1px var(--hair), var(--shadow);
  --pop-shadow: 0 0 0 1px var(--hair), 0 8px 24px rgb(0 0 0 / 0.12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e0e0e;
  --surface: #171716;
  --surface-2: #222221;
  --hover: rgba(255, 255, 255, 0.09);
  --surface-3: #2e2e2c;
  --seg-on: #3a3a37;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --ink-3: #8f8d87;
  --line: #272725;
  --axis: #3d3d3a;
  --hair: rgb(255 255 255 / 0.09);
  --scrim: rgb(0 0 0 / 0.6);
  --lime-soft: #1c2607;
  --lime-text: #a6e70f;
  --focus: #a6e70f;
  --link: var(--lime-text);
  --good: #7fd68c;
  --bad: #e66767;
  --bad-soft: #2c1616;
  --warn: #fab219;
  --warn-bg: #2e2408;
  --warn-ink: #ffd98a;
  --k-first: #7fd68c;
  --k-21: #74b4ff;
  --k-22: #f0c060;
  --k-third: #f0a070;
  --slab: #222221;
  --slab-ink: #f0efec;
  --slab-line: rgb(255 255 255 / 0.14);
  --shadow: none;
  --pop-shadow: 0 0 0 1px var(--hair), 0 8px 24px rgb(0 0 0 / 0.5);
}

/* Scripts off: follow the system. Keep this list the same as the block above. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --page: #0e0e0e;
    --surface: #171716;
    --surface-2: #222221;
    --hover: rgba(255, 255, 255, 0.09);
    --surface-3: #2e2e2c;
    --seg-on: #3a3a37;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --ink-3: #8f8d87;
    --line: #272725;
    --axis: #3d3d3a;
    --hair: rgb(255 255 255 / 0.09);
    --scrim: rgb(0 0 0 / 0.6);
    --lime-soft: #1c2607;
    --lime-text: #a6e70f;
    --focus: #a6e70f;
    --link: var(--lime-text);
    --good: #7fd68c;
    --bad: #e66767;
    --bad-soft: #2c1616;
    --warn: #fab219;
    --warn-bg: #2e2408;
    --warn-ink: #ffd98a;
    --k-first: #7fd68c;
    --k-21: #74b4ff;
    --k-22: #f0c060;
    --k-third: #f0a070;
    --slab: #222221;
    --slab-ink: #f0efec;
    --slab-line: rgb(255 255 255 / 0.14);
    --shadow: none;
    --pop-shadow: 0 0 0 1px var(--hair), 0 8px 24px rgb(0 0 0 / 0.5);
  }
}

/* The theme switch: Light, Dark, System. Markup is the same in the app's footer
   and the static pages' footer; theme.js handles the presses. */
.theme-switch { display: inline-flex; align-self: flex-start; width: fit-content; align-items: center; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; }
.theme-switch button {
  border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; line-height: 20px;
  min-width: 44px; min-height: 30px; padding: 5px 12px; border-radius: 7px; color: var(--ink-2);
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); font-weight: 600; box-shadow: var(--card-ring); }
@media (max-width: 820px) { .theme-switch button { min-height: 38px; } }
/* GradeHub static pages (/, /grade-calculator, /graduate-schemes).
   Hand-written and small on purpose: these pages are read on phones, from a
   search result, and must paint before any script runs.

   Colours, radii and the typeface come from ../../theme/tokens.css, which the
   build puts in front of this file (src/site.rs), so the signed-in app and
   these pages are one look, in light and in dark. Nothing below is a colour
   of its own. */

* { box-sizing: border-box; }
/* Room under a focused field for the result bar pinned to the bottom. */
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 96px; scroll-padding-top: 72px; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -0.011em; text-wrap: balance; }
h1 { font-size: clamp(24px, 4.6vw, 30px); line-height: 1.2; letter-spacing: -0.02em; margin-top: 6px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; text-wrap: pretty; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--page); padding: 10px 14px; border-radius: var(--radius-s); z-index: 10; font-weight: 600; text-decoration: none; }
.skip:focus { left: 8px; }

/* One column width for the header, every page and the footer, so their edges line up. */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
main { flex: 1; padding: 32px 0 72px; }
main > .wrap > * + * { margin-top: 20px; }
main > .wrap > .lede { margin-top: 8px; }
main > .wrap > .search { display: block; margin-top: 24px; }

/* Header: stays put, with the page showing faintly through it. */
.top { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--page) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand img { width: 24px; height: 24px; border-radius: 7px; }
.top nav { display: flex; gap: 4px; align-items: center; }
.top nav a { display: inline-block; line-height: 22px; color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.top nav a:hover { background: var(--hover); color: var(--ink); }
.top nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.top nav .nav-quiet { margin-left: 8px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px; padding: 5px 14px; border-radius: var(--radius-s); box-shadow: 0 0 0 1px var(--axis); }
.top nav .nav-quiet:hover { background: var(--hover); }
/* A narrow header keeps two short links. */
@media (max-width: 680px) {
  .top nav .nav-quiet, .nav-long { display: none; }
  .top nav { gap: 2px; }
  .top nav a { padding: 9px 10px; }
  .top nav a::first-letter { text-transform: uppercase; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  /* A phone shows the first input without a scroll. */
  main { padding: 16px 0 56px; }
  main > .wrap > .search { margin-top: 16px; }
  main > .wrap > * + * { margin-top: 12px; }
  h1 { margin-top: 2px; }
  .calc { margin-top: 14px !important; }
}

/* Text blocks */
/* The nav itself must not clip: the focus ring and the links' tap padding sit outside its line box. Each crumb clips only its own text (an element's overflow never cuts its own outline), so a long trail shrinks every crumb to an ellipsis and never scrolls the page; the slashes stay whole. */
.crumbs { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; white-space: nowrap; }
.crumbs > * { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* The links give way first, so the page's own name keeps its width for as long as it can; each keeps a few letters. */
.crumbs > a { flex-shrink: 1000; min-width: 5em; }
.crumbs > [aria-hidden] { flex: none; }
.crumbs a { color: var(--ink-3); text-decoration: none; padding: 8px 0; margin: -8px 0; }
.crumbs a:hover { color: var(--ink); }
.lede { color: var(--ink-2); max-width: 68ch; }
.fine { font-size: 13px; color: var(--ink-3); }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.mini { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: -10px; }
.note { background: var(--surface); box-shadow: var(--card-ring); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; color: var(--ink-2); }
.calc + script + .source { margin-top: 24px; }
.source { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--ink-3); }
.source a { color: var(--ink-2); }
/* A status pill. The usual state stays quiet: a dot and a word. */
.badge { display: inline-flex; align-items: center; gap: 7px; border-radius: 99px; padding: 2px 9px 2px 8px; font-weight: 500; font-size: 12px; background: var(--surface-2); color: var(--ink); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: none; }
.badge.ok { background: none; padding-left: 0; color: var(--ink-2); }
.badge.ok::before { background: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.warn::before { background: var(--warn); }

.prose { margin-top: 48px !important; }
.prose > * + * { margin-top: 12px; }
.prose > * { max-width: 68ch; }
.prose > .chips, .prose > .table, .prose > .list { max-width: none; }
.prose p, .prose li { color: var(--ink-2); }
.prose h3 small { white-space: nowrap; }
@media (max-width: 520px) { .prose { margin-top: 36px !important; } }
.prose h3 { margin-top: 24px; }
.prose h3 small { font-weight: 400; color: var(--ink-3); font-size: 13px; margin-left: 6px; }
.prose ul { margin: 12px 0 0; padding-left: 20px; }
.prose li + li { margin-top: 6px; }
blockquote { margin: 12px 0 0; padding: 2px 0 2px 12px; border-left: 2px solid var(--lime); color: var(--ink-2); font-size: 14px; }
.table { overflow-x: auto; background: var(--surface); box-shadow: var(--card-ring); border-radius: var(--radius); padding: 6px 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
th { color: var(--ink-3); font-size: 12px; font-weight: 500; }
td { color: var(--ink-2); }
td:first-child { color: var(--ink); }

/* A section that stays shut until asked for (the rules a calculator was built from). */
.more { margin-top: 32px !important; border-top: 1px solid var(--line); }
.more > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; padding: 14px 0; font-weight: 500; font-size: 14px; border-radius: 4px; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: "↓"; color: var(--ink-3); }
.more[open] > summary::after { content: "↑"; }
.more > summary span { color: var(--ink-3); font-weight: 400; font-size: 13px; }
.more > .prose { margin-top: 4px !important; padding-bottom: 8px; }

/* Chips, buttons, controls */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a, .chip { display: inline-flex; align-items: center; min-height: 32px; border-radius: 99px; padding: 4px 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; background: var(--surface); box-shadow: 0 0 0 1px var(--hair); }
.chips a:hover { color: var(--ink); background: var(--hover); }
.chips a[aria-current="page"] { background: var(--ink); color: var(--page); box-shadow: none; font-weight: 600; }
/* A grade on a scheme: a dot in the class's colour and the words. */
.chip { min-height: 24px; padding: 2px 9px 2px 8px; gap: 7px; font-size: 12px; background: var(--surface-2); box-shadow: none; color: var(--ink); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: none; }
.chip.g-first::before { background: var(--k-first); }
.chip.g-21::before { background: var(--k-21); }
.chip.g-22::before, .chip.g-third::before, .chip.g-none::before { background: var(--lime); }
.chip.g-unknown { color: var(--ink-3); }
.chip.g-above { background: var(--warn-bg); color: var(--warn-ink); }
.chip.g-above::before { background: var(--warn); }
.btn.ai::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); margin-right: 8px; flex: none; }
.card.above .btn.ai { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border-radius: var(--radius-s); background: var(--lime); color: var(--lime-ink); font-weight: 600; font-size: 14px; text-decoration: none; border: 0; cursor: pointer; }
.btn:hover { filter: brightness(0.95); }
.btn.ai { background: var(--ink); color: var(--page); }
.btn.big { min-height: 44px; font-size: 15px; padding: 10px 20px; background: var(--lime); color: var(--lime-ink); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--axis); }
.btn.ghost:hover { opacity: 1; background: var(--hover); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.link { background: none; border: 0; padding: 6px 0; color: var(--ink); cursor: pointer; font-weight: 500; font-size: 13px; text-decoration: underline; text-decoration-color: var(--axis); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }
.link.quiet { color: var(--ink-3); font-weight: 400; }
.icon { background: none; border: 0; width: 36px; height: 44px; font-size: 20px; line-height: 1; color: var(--ink-3); cursor: pointer; border-radius: 8px; }
.icon:hover { background: var(--hover); color: var(--ink); }

input[type="text"], input[type="search"], select {
  width: 100%; min-height: 44px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--axis); border-radius: var(--radius-s); font-size: 16px;
}
input::placeholder { color: var(--ink-3); opacity: 1; }
input:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--lime); }
input[aria-invalid="true"] { border-color: var(--bad); }
.search input { min-height: 48px; padding-left: 14px; }

/* A segmented choice, as the range picker on Nightshade HQ. */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: var(--radius-s); padding: 3px; gap: 2px; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-weight: 500; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; min-height: 34px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); font-weight: 600; box-shadow: var(--card-ring); }
.seg.wide { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.seg.wide button { white-space: normal; text-wrap: balance; line-height: 1.2; padding: 6px; min-height: 44px; }
.filters { display: grid; gap: 12px; margin-top: 24px !important; }
.filters .seg { display: flex; flex-wrap: nowrap; }
.filters .seg button { flex: 1 1 auto; padding: 6px 10px; min-height: 44px; }
@media (min-width: 760px) { .filters { grid-template-columns: 1fr auto; align-items: center; } .filters .seg button { min-height: 38px; } }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); box-shadow: var(--card-ring); border-radius: var(--radius); overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.list a { display: block; padding: 12px 16px; text-decoration: none; color: var(--ink); font-weight: 500; }
.list a:hover { background: var(--hover); }
/* The list clips its rows to the rounded edge, so the ring sits inside the row instead of outside it. */
.list a:focus-visible { outline-offset: -3px; }
.list a span { display: block; font-size: 13px; font-weight: 400; color: var(--ink-3); margin-top: 1px; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 760px) { .cards { grid-template-columns: 1fr 1fr; } .cards.one { grid-template-columns: 1fr; } }
.card { border-radius: var(--radius); padding: 20px; background: var(--surface); box-shadow: var(--card-ring); display: flex; flex-direction: column; gap: 10px; }
.card .employer { font-size: 13px; font-weight: 500; color: var(--ink-3); text-decoration: none; }
.card .employer:hover { color: var(--ink); }
.card .facts { font-size: 13px; color: var(--ink-3); }
.card blockquote { margin: 0; }
.card .actions { margin-top: auto; padding-top: 6px; }
.card .actions .btn { flex: 1 1 140px; max-width: 220px; padding: 8px 12px; white-space: nowrap; }
.card .facts + .facts { margin-top: -6px; }
.cards > li:only-child { grid-column: 1 / -1; }

/* Calculator: the mark sheet on the left, the result beside it. */
.calc { min-height: 420px; margin-top: 24px !important; }
.calc-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 820px) { .calc-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } .result { position: sticky; top: 72px; } }
.calc-form { display: grid; gap: 16px; }
.applies { margin-top: -4px; }
.year { border-radius: var(--radius); padding: 20px; background: var(--surface); box-shadow: var(--card-ring); display: grid; gap: 10px; }
.year.off { background: none; box-shadow: none; color: var(--ink-3); padding: 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.year.off h3 { font-size: 13px; color: var(--ink-2); }
.year.off p { font-size: 13px; }
.year.off .link { font-size: 13px; }
.year-tools { display: inline-flex; align-items: center; gap: 12px; }
.year-tools .link { font-size: 13px; }
.year-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.weight { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; border-radius: 99px; padding: 2px 9px 2px 8px; background: var(--surface-2); color: var(--ink-3); white-space: nowrap; }
.weight.on { color: var(--ink); }
.weight.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); flex: none; }
.avg { display: grid; gap: 6px; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.avg-in { display: flex; align-items: center; gap: 8px; }
.avg-in input { font-size: 20px; font-weight: 600; min-height: 52px; max-width: 200px; color: var(--ink); }
.avg-in input::placeholder { font-weight: 400; color: var(--ink-3); }
.unit { font-size: 18px; font-weight: 600; color: var(--ink-3); }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.m-head, .m-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px var(--mark-w, 88px) 62px 36px; gap: 6px; align-items: center; }
.m-head.g, .m-row.g { --mark-w: 112px; }
.m-split { padding: 6px 0; font-size: 12px; min-height: 44px; white-space: nowrap; text-align: left; }
output.m-mark { font-weight: 600; font-size: 15px; padding: 0 2px; white-space: nowrap; }
/* A module split into its coursework and exams: the pieces hang off a rule
   under the module they belong to. */
.m-split-box { display: grid; gap: 8px; }
.parts { display: grid; gap: 6px; margin-left: 6px; padding: 2px 0 2px 12px; border-left: 2px solid var(--lime); }
.parts .m-head { margin-top: 2px; }
.mod-note { font-size: 13px; color: var(--ink-3); }
.mod-note.bad { color: var(--bad); font-weight: 500; }
.m-head { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.m-row input, .m-row select { padding: 6px 10px; min-height: 40px; }
/* On a phone the name gets a line of its own, so "Dissertation" is readable. */
@media (max-width: 520px) {
  .year { padding: 16px; }
  /* Each module is a small block: its name with the remove button beside it,
     then credits and mark, each under its own label. */
  .m-head { display: none; }
  .m-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 58px; gap: 4px 8px; padding-top: 10px; border-top: 1px solid var(--line); }
  .m-row input, .m-row select { min-height: 44px; }
  .m-row .m-name { grid-column: 1 / 3; grid-row: 1; }
  .m-row .icon { grid-column: 3; grid-row: 1; justify-self: end; }
  .m-row::before, .m-row::after { grid-row: 2; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 4px; }
  .m-row::before { content: "Credits"; grid-column: 1; }
  .m-row::after { content: attr(data-mark); grid-column: 2; }
  .m-row .m-credits { grid-column: 1; grid-row: 3; }
  .m-row .m-mark { grid-column: 2; grid-row: 3; }
  .m-row .m-split { grid-column: 3; grid-row: 3; }
  .m-row > span:empty { display: none; }
  .p-row { border-top: 0; padding-top: 4px; }
  .p-row::before { content: "Worth %"; }
  .parts .m-head { display: none; }
}
/* The suggestions under a name box (suggest.js): one list for the page, moved
   under the box in use. */
.suggest { position: absolute; z-index: 40; margin: 0; padding: 4px; list-style: none; max-width: min(420px, calc(100vw - 32px)); max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); border-radius: 10px; box-shadow: var(--card-ring), 0 12px 32px -12px rgb(0 0 0 / 0.28); font-size: 14px; }
.suggest li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--surface-2); }
.suggest-name { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.suggest-note { flex: none; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.year-sum { font-size: 13px; color: var(--ink-3); }
.year-sum:empty, .year-sum:empty + * { display: none; }
.year-sum.bad { color: var(--bad); font-weight: 500; }
.saved { margin-top: 2px; }
.saved .link { padding: 10px 0; }

/* The result: one figure, its hint, the picture, the next step. */
.result { border-radius: var(--radius); padding: 20px; background: var(--surface); box-shadow: var(--card-ring); display: grid; gap: 12px; }
.klass { font-size: clamp(44px, 12vw, 60px); font-weight: 600; letter-spacing: -0.035em; line-height: 1; margin-top: -4px; }
.k-first { color: var(--k-first); }
.k-upper_second { color: var(--k-21); }
.k-lower_second { color: var(--k-22); }
.k-third, .k-pass { color: var(--k-third); }
.k-none { color: var(--ink-2); font-size: 30px; }
.mark { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.empty { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.target { font-size: 14px; font-weight: 500; padding: 2px 0 2px 12px; border-left: 2px solid var(--lime); }
/* Every mark on one picture: see chart.js. */
.marks { margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.marks figcaption { font-size: 12px; color: var(--ink-3); }
.marks figcaption strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.mk-plot { position: relative; height: 150px; margin: 14px 0 44px; }
.mk-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.mk-line i { position: absolute; right: 0; top: -8px; padding-left: 6px; background: var(--surface); font-style: normal; font-size: 11px; font-weight: 500; line-height: 14px; color: var(--ink-2); white-space: nowrap; }
.mk-line i b { font-weight: 400; color: var(--ink-3); }
.mk-line i u { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; background: currentColor; }
.mk-line.you { right: 60px; border-top: 2px solid var(--ink); z-index: 2; transition: bottom 0.25s ease; }
.mk-years { position: absolute; inset: 0 60px 0 0; z-index: 1; display: flex; gap: 12px; }
.mk-year { position: relative; flex-basis: 0; min-width: 0; }
.mk-cells { height: 100%; display: flex; gap: 2px; align-items: flex-end; border-bottom: 1px solid var(--axis); }
.mk { container-type: inline-size; flex-basis: 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; border-radius: 3px 3px 0 0; }
.mk.todo { background: var(--surface-2); }
.mk-fill { position: relative; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: currentColor; font-size: 0; transition: height 0.25s ease; }
.mk-fill.part { background: repeating-linear-gradient(135deg, currentColor 0 5px, transparent 5px 8px); outline: 1px solid currentColor; outline-offset: -1px; }
.mk-fill b { position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); font-size: 11px; font-weight: 600; font-style: normal; line-height: 14px; color: var(--surface); }
.mk-fill.part b { background: var(--surface); color: var(--ink); border-radius: 4px; padding: 0 3px; }
@container (max-width: 16px) { .mk-fill b { display: none; } }
.mk-fill.k-none { color: var(--bad); }
.mk-fill.out { background: none; outline: 2px solid currentColor; outline-offset: -2px; }
.mk-fill.out b { color: var(--ink); }
.mk-key { margin-top: 4px; }
.working summary { cursor: pointer; font-weight: 500; font-size: 13px; color: var(--ink-3); padding: 11px 0; width: fit-content; list-style: none; border-radius: 4px; }
.working summary::-webkit-details-marker { display: none; }
.working summary::after { content: " ↓"; }
.working[open] summary::after { content: " ↑"; }
.working summary:hover { color: var(--ink); }
.working > * + * { margin-top: 14px; }
.working > summary + * { margin-top: 2px; }
.result .proj { color: var(--ink-2); font-size: 13px; }
.sum-drop { display: block; margin-top: 4px; }
.mk-label { position: absolute; left: 0; top: 100%; max-width: 100%; margin-top: 5px; font-size: 12px; line-height: 1.3; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-label em { display: block; font-style: normal; font-weight: 400; color: var(--ink-3); }
.call { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius-s); padding: 10px 12px; font-size: 13px; }
.call.good { background: var(--lime-soft); color: var(--lime-text); }
.call.bad { background: var(--bad-soft); color: var(--bad); }
.needs h3 { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.needs ul { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); font-size: 13px; }
.needs li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.needs li strong { color: var(--ink); font-weight: 600; }
.needs li.good strong { color: var(--good); }
.needs li.muted { color: var(--ink-3); }
.needs li.muted strong { font-weight: 400; color: var(--ink-3); }

/* The result repeated at the bottom of a phone screen while it is out of view */
.dock { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 6; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; border: 0; border-radius: var(--radius); background: var(--slab); color: var(--slab-ink); box-shadow: 0 0 0 1px var(--slab-line), 0 8px 28px rgb(0 0 0 / 0.28); cursor: pointer; text-align: left; }
.dock strong { font-size: 15px; font-weight: 600; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dock span { font-size: 13px; opacity: 0.8; white-space: nowrap; flex: none; }
.dock .dock-go { margin-left: auto; color: var(--lime); opacity: 1; font-weight: 600; }
@media (max-width: 360px) { .dock .dock-go { display: none; } }
@media (max-height: 480px) { .dock { display: none; } }
@media (min-width: 820px) { .dock { display: none; } }

/* The hand-off to AI Super Hire */
.bridge { margin-top: 16px; border-radius: var(--radius); padding: clamp(20px, 3.5vw, 28px); background: var(--slab); color: var(--slab-ink); box-shadow: 0 0 0 1px var(--slab-line); display: grid; gap: 12px; }
.bridge:empty { display: none; }
.bridge h2 { font-size: clamp(18px, 4vw, 22px); letter-spacing: -0.015em; }
.bridge p { color: color-mix(in srgb, var(--slab-ink) 80%, transparent); font-size: 14px; }
.bridge .eyebrow { color: var(--lime); }
.bridge .fine { font-size: 12px; color: color-mix(in srgb, var(--slab-ink) 64%, transparent); }
.bridge .chips-lead { align-self: center; font-size: 13px; color: color-mix(in srgb, var(--slab-ink) 64%, transparent); }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--slab-ink); font-weight: 500; font-size: 14px; }
.points li { padding-left: 18px; position: relative; }
.points li::before { content: ""; position: absolute; left: 1px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
main > .wrap > .bridge { margin-top: 48px; }
.bridge > p { max-width: 68ch; }
@media (max-width: 520px) {
  /* On a phone the three points carry the pitch, so the block stays smaller than the result above it. */
  .bridge .pitch { display: none; }
  .bridge { gap: 10px; padding: 20px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding: 1px 16px 1px 1px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips a, .chips .chip { flex: none; }
  .chips a { min-height: 40px; padding: 4px 14px; }
  /* The row scrolls, so it clips: keep the ring inside the chip. */
  .chips a:focus-visible { outline-offset: -3px; }
  .bridge .chips { margin-right: -20px; padding-right: 20px; }
  .mini { margin-bottom: -6px; }
  td:last-child, th:last-child { white-space: nowrap; }
  .prose h3 small { display: block; margin: 2px 0 0; white-space: normal; }
  .actions .btn { flex: 1 1 100%; min-height: 44px; }
  .card .actions .btn { flex: 1 1 0; }
}
.bridge .chips a { background: transparent; color: var(--slab-ink); box-shadow: 0 0 0 1px var(--slab-line); }
.bridge .btn.ghost { background: transparent; color: var(--slab-ink); box-shadow: inset 0 0 0 1px var(--slab-line); }

/* Footer: one quiet line of links and the theme switch. */
.foot { border-top: 1px solid var(--line); padding: 20px 0; font-size: 13px; color: var(--ink-3); }
.foot-in { display: flex; flex-direction: column; gap: 16px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 20px; align-items: center; }
.foot nav a { color: var(--ink-3); text-decoration: none; padding: 8px 0; }
.foot nav a:hover { color: var(--ink); }
@media (min-width: 760px) { .foot-in { flex-direction: row; align-items: center; justify-content: space-between; } .foot .theme-switch { align-self: center; } }

@media (prefers-reduced-motion: reduce) { .mk-fill, .mk-line.you { transition: none; } }

.note.signed { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 0 0 16px; color: var(--ink-2); }
.note.signed strong { color: var(--ink); }
.note.signed a { font-weight: 600; white-space: nowrap; }

/* The homepage. The hero fills the screen under the header: the pitch and the
   university search on the left, the example calculator on the right. */
.hero { display: grid; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(30px, 7vw, 46px); line-height: 1.08; letter-spacing: -0.03em; margin-top: 10px; }
.hero h2 { margin-top: 28px; font-size: 15px; }
.hero .eyebrow { color: var(--lime-text); font-weight: 600; }
.hero-pitch > .search { display: block; margin-top: 10px; }
.hero-pitch > .fine { margin-top: 8px; }
/* The search results. Closed they take no room. Open (`searching`, set by
   filter.js when the box is clicked) they take one fixed height whatever they
   hold, and the title and points above shrink to make the room, so the box
   moves up once and then stays where it is while the visitor types. */
.hero-pitch > .results { height: 0; overflow: hidden; transition: height 0.22s ease; }
.hero-pitch > .results > .list { margin-top: 8px; max-height: calc(100% - 8px); overflow-y: auto; overscroll-behavior: contain; }
.hero-pitch > .results > .note { margin-top: 8px; }
.hero-pitch.searching > .results { height: var(--results-h); }
.hero-pitch { --results-h: 264px; }
.hero h1, .hero h2 { transition: font-size 0.22s ease, margin 0.22s ease; }
/* The points fold away with a grid row going 1fr to 0fr, so they take their own
   height however much text scaling wraps them: no fixed cap to outgrow. */
.hero-points-fold { display: grid; grid-template-rows: 1fr; margin-top: 18px; transition: grid-template-rows 0.22s ease, opacity 0.18s ease, margin 0.22s ease; }
.hero-points-fold > .hero-points { min-height: 0; overflow: hidden; }
.hero-pitch.searching h1 { font-size: clamp(20px, 4.4vw, 26px); margin-top: 6px; }
.hero-pitch.searching h2 { margin-top: 14px; }
.hero-pitch.searching .hero-points-fold { grid-template-rows: 0fr; opacity: 0; margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .hero-pitch > .results, .hero h1, .hero h2, .hero-points-fold { transition: none; } }
.hero-pitch > .actions { margin-top: 16px; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 16px; color: var(--ink-2); }
.hero-points li { padding-left: 20px; position: relative; }
.hero-points li::before { content: ""; position: absolute; left: 1px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.hero-points strong { color: var(--ink); font-weight: 600; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; min-height: calc(100dvh - 57px - 64px); padding-bottom: 32px; }
}
.demo { background: var(--surface); box-shadow: var(--card-ring), 0 24px 60px -24px rgb(0 0 0 / 0.18); border-radius: 16px; padding: clamp(20px, 3vw, 28px); }
.demo-result { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 6px; }
.demo-result strong { font-size: clamp(40px, 7vw, 56px); line-height: 1; letter-spacing: -0.035em; font-weight: 600; }
.demo-result span { font-weight: 600; color: var(--lime-text); }
.demo-bar { position: relative; height: 10px; margin-top: 18px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.demo-bar span { position: absolute; inset: 0 auto 0 0; background: var(--lime); border-radius: 99px; transition: width 0.25s ease; }
.demo-bar i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--axis); }
.demo-scale { position: relative; height: 18px; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.demo-scale span { position: absolute; top: 0; }
.demo-rows { list-style: none; margin: 14px 0 12px; padding: 0; border-top: 1px solid var(--line); }
.demo-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.demo-name { font-weight: 500; min-width: 0; }
.demo-name small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-3); }
.demo-rows input { width: 76px; min-height: 40px; padding: 6px 10px; text-align: right; font-weight: 600; border: 0; border-radius: var(--radius-s); background: var(--surface); box-shadow: inset 0 0 0 1px var(--axis); }
@media (prefers-reduced-motion: reduce) { .demo-bar span { transition: none; } }

/* A homepage section: a big heading, a line under it, then its content. */
.band { margin-top: clamp(56px, 9vw, 96px) !important; }
.band > * + * { margin-top: 14px; }
.band > h2 { font-size: clamp(22px, 4.4vw, 30px); letter-spacing: -0.02em; max-width: 24ch; }
.band > .lede { max-width: 62ch; font-size: 16px; }
.band > .chips, .band > .features, .band > .cards, .band > .actions { margin-top: 22px; }
.home > .bridge { margin-top: clamp(56px, 9vw, 96px) !important; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.features li { background: var(--surface); box-shadow: var(--card-ring); border-radius: var(--radius); padding: 20px; }
.features h3 { font-size: 16px; }
.features p { margin-top: 6px; color: var(--ink-2); }
@media (min-width: 760px) { .features, .reviews { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.review-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.review-name:hover { text-decoration: underline; }
.faq details { border-top: 1px solid var(--line); margin-top: 0; }
.faq details:first-of-type { margin-top: 22px; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font-weight: 600; border-radius: 4px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-3); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 18px; color: var(--ink-2); max-width: 68ch; }

/* The narrowest phones */
@media (max-width: 340px) {
  .top-in { gap: 8px; }
  .top nav { gap: 14px; }
  .filters .seg { flex-wrap: wrap; }
  .filters .seg button { padding: 6px; font-size: 13px; }
}
