/* TeacherRated: the report card, turned around. Students hold the pencil: paper ground, graphite ink, one no. 2 pencil
   yellow for the main action, and grades circled the way a teacher marks a test. Yellow is a fill (with dark text on it)
   or a highlight, never text or a focus ring on white: it's too light to read there. Depth comes from a step in tone; only menus,
   dialogs and toasts float. Moderator portal: admin.css. */
:root {
  --ground: #f4f4f1;          /* paper: a neutral stone, almost no hue */
  --surface: #fff;            /* cards: one tone step up from the ground */
  --block: #e9e9e4;           /* tinted blocks */
  --block-strong: #d6d6cf;    /* rules between rows */
  --line-strong: #85857e;     /* borders of fields and controls (3.6:1 on white) */
  --action: #f2a516;          /* the pencil: the one main action per screen, always with --on-action text (8.0:1) */
  --action-hover: #e39400;
  --action-edge: #3a3a3a;     /* graphite: the pencil's lead */
  --on-action: #2b1d00;       /* text and marks on --action */
  --action-soft: #fde7b0;     /* highlighter tint: picked tags, soft badges (ink text on it) */
  --action-ink: #16181d;      /* where the red used to be text or an icon on white: graphite ink */
  --focus: #16181d;           /* focus rings: yellow is under 3:1 on white, so they stay ink */
  --action-deep: #16181d;     /* picked states and small buttons: ink */
  --action-deep-hover: #2b2e36;
  --action-deep-edge: #000;
  --ink: #16181d;
  --ink-soft: #55575f;        /* dates, counts, captions only (6.9:1 on the ground) */
  --danger: #c62337;
  --danger-hover: #b01d30;
  --danger-edge: #8f1526;
  --danger-soft: #fbe6e4;
  --warn-soft: #fbf0d2;
  --warn-ink: #6b4a00;
  --ok-soft: #e2f1e7;
  --ok-ink: #1d6b45;

  /* Grades (semantic: good, ok, bad, none): the ink of the circle and its number, and a soft fill for picked tiles. */
  --q-good: #1d7a48;
  --q-ok: #9a6400;
  --q-bad: #d0281f;
  --q-none: #85857e;
  --q-good-soft: #e2f1e7;
  --q-ok-soft: #f8edd1;
  --q-bad-soft: #fbe3e1;

  --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Headings and grades: a book serif, like a printed report card. System fonts only, so no font request. */
  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --fs-small: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-lead: 1.25rem;
  --fs-h2: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem);
  --fs-h1: clamp(2.5rem, 1.6rem + 3.4vw, 4rem);
  --fs-display: clamp(3.25rem, 1.2rem + 7.4vw, 7.5rem);

  --r-card: 14px;
  --r-field: 8px;
  --r-btn: 8px;
  --r-pill: 999px;
  --ledge: 2px;               /* the bottom border of a bordered control: the same as its other sides */
  --float: 0 1px 2px rgb(22 24 29 / 0.1), 0 14px 32px -12px rgb(22 24 29 / 0.28); /* only for things that float */

  --page: 1180px;
  --list: 876px;
  --gutter: clamp(16px, 4vw, 40px);
  --space-section: clamp(56px, 32px + 4vw, 96px); /* between the sections of a page */

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* small overshoot: the radio dot, a picked answer, the answered tick */
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  --t-press: 120ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; -webkit-tap-highlight-color: transparent; }
body { margin: 0; display: flex; flex-direction: column; min-height: 100dvh; background: var(--ground); color: var(--ink); font: 400 var(--fs-body)/1.55 var(--font); overflow-x: hidden; text-rendering: optimizeLegibility; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
/* Pencil-yellow underlines are a highlighter stroke: thick enough to see on white (thin yellow lines vanish). */
a, .link-btn { text-decoration-thickness: max(0.16em, 3px); }
button, input, select, textarea { font: inherit; color: inherit; caret-color: var(--focus); }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--block-strong); color: var(--ink); }
::placeholder { color: var(--ink-soft); opacity: 1; font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); }
p.muted { color: var(--ink); } /* running text stays in full ink */
#app:focus, [tabindex='-1']:focus-visible { outline: none; } /* focus moved by the router, not a control */
#app { flex: 1; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; text-decoration: none; font: 700 1.5rem/1 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; color: var(--ink); }
.logo-mark { width: 1.4em; height: 1.4em; margin-right: 0.35em; stroke: none; }
.logo-bubble { fill: var(--ink); }
.logo-t { fill: var(--action); }
.logo-my { color: var(--ink); background: linear-gradient(transparent 58%, var(--action) 58%, var(--action) 92%, transparent 92%); padding: 0 1px; }

/* ---------- buttons: square-cornered, one flat fill, a small press ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border: 2px solid transparent; border-radius: var(--r-btn);
  font: 700 1.0625rem/1.1 var(--font); text-align: center; text-decoration: none; cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease, border-color var(--t-hover) ease;
}
.btn svg { flex: none; stroke-width: 2.4; transition: transform var(--t-ui) var(--ease-out); }
.btn-primary { min-width: 150px; background: var(--action); color: var(--on-action); border-bottom-color: var(--action-edge); overflow: hidden; isolation: isolate; }
.btn-primary::before { content: ''; position: absolute; inset: -2px; z-index: -1; background: var(--ink); transform: translateY(101%); transition: transform 280ms var(--ease-out); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-pill { min-height: 44px; padding: 0 16px; gap: 8px; font-size: 1rem; background: var(--ink); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 44px; min-width: 0; padding: 0 16px; font-size: 1rem; }
.btn-sm.btn-primary { background: var(--action-deep); color: #fff; border-bottom-color: transparent; } /* small buttons are ink, so their text stays white */
.btn-wide { width: 100%; min-height: 58px; font-size: 1.1875rem; }
.link-btn { background: none; border: 0; padding: 0; border-radius: 4px; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--action); cursor: pointer; transition: color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.link-btn:disabled { color: var(--ink-soft); text-decoration: none; cursor: default; }
/* Every .btn is disabled only while its request is in flight, so disabled reads as "working". */
.btn:disabled { cursor: progress; background: var(--block); color: var(--ink-soft); border-color: var(--block); }
.btn:disabled::after { content: ''; position: absolute; right: 9px; top: calc(50% - 9px); width: 14px; height: 14px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
.btn-wide:disabled::after { right: 26px; top: calc(50% - 12px); width: 20px; height: 20px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled)::before { transform: none; }
  .btn-primary:hover:not(:disabled) { color: var(--action); }
  .btn-sm.btn-primary:hover:not(:disabled), .btn-pill:hover:not(:disabled) { background: var(--action-deep-hover); }
  .btn-outline:hover:not(:disabled) { background: var(--block); }
  .btn-primary:hover:not(:disabled) svg { transform: translateX(4px); }
  .btn-pill:hover svg { transform: rotate(90deg); }
  .btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
  .link-btn:hover:not(:disabled) { color: var(--action-ink); }
}
.btn:active:not(:disabled) { transform: scale(0.98); transition-duration: 60ms; }
.link-btn:active:not(:disabled) { transform: scale(0.97); }

/* ---------- top bar: a masthead with an ink rule ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--ground); border-bottom: 2px solid var(--ink); view-transition-name: topbar; }
.topbar-inner { max-width: calc(var(--page) + 180px); margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.topbar-search { flex: 1; display: flex; gap: 8px; max-width: 640px; min-width: 0; }
.topbar-search input, .topbar-search select { height: 44px; border: 2px solid var(--line-strong); border-radius: var(--r-field); padding: 0 14px; background: var(--surface); color: var(--ink); min-width: 0; width: 0; }
.topbar-search input { flex: 1.3; }
.topbar-search select { flex: 1; cursor: pointer; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: var(--r-btn); border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 20px; cursor: pointer; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease; }
.icon-btn svg { stroke-width: 2.6; }
.icon-btn:active { transform: scale(0.95); }
.topbar-nav { display: flex; align-items: center; gap: 4px; flex: none; }
.topbar-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: var(--r-btn); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9375rem; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.topbar-link svg { font-size: 20px; transition: transform var(--t-ui) var(--ease-out); }
.topbar-link[aria-current='page'] { background: var(--block); }
.topbar-link .count { min-width: 22px; padding: 0 6px; border-radius: var(--r-pill); background: var(--action); color: var(--on-action); font-size: 0.8125rem; font-weight: 700; text-align: center; line-height: 22px; }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--action-deep-hover); }
  .topbar-link:hover { background: var(--block); }
  .topbar-link:hover svg { transform: translateY(-2px); }
}

/* ---------- hero: the headline is the picture ---------- */
.hero { background: var(--action); color: var(--on-action); padding: clamp(48px, 7vw, 112px) var(--gutter) clamp(48px, 6vw, 88px); border-bottom: 6px solid var(--action-edge); }
.hero :focus-visible { outline-color: var(--ink); }
.hero-inner { max-width: calc(var(--page) - 2 * var(--gutter)); margin: 0 auto; }
.hero-inner:has(.stack) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 48px; align-items: center; }
.hero-copy { display: grid; justify-items: start; gap: 24px; }
.hero h1 { font-size: var(--fs-display); line-height: 0.92; letter-spacing: -0.035em; max-width: 9ch; }
.hero h1 .line { display: block; overflow: hidden; padding: 0.1em 0; margin: -0.1em 0; } /* the mask each line rises out of, with room for the y */
.hero h1 .line > span { display: block; }
.hero-lead { margin: 0; font-size: var(--fs-lead); max-width: 36ch; }
.hero-search { position: relative; width: min(100%, 640px); }
.hero-search input {
  width: 100%; height: 64px; border: 2px solid var(--ink); border-radius: var(--r-btn);
  padding: 0 24px 0 58px; background: var(--surface); color: var(--ink); font-size: 1.1875rem;
}
.hero-search input:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.hero-search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); display: flex; color: var(--ink); font-size: 24px; pointer-events: none; transition: color var(--t-hover) ease; }
.hero-search:focus-within .hero-search-icon { color: var(--action-ink); }
.hero-search-icon svg { stroke-width: 2.6; }
.search-kbd { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); padding: 3px 8px; border: 2px solid var(--block-strong); border-radius: 6px; font: 600 var(--fs-small)/1.2 var(--font); color: var(--ink-soft); pointer-events: none; }
.hero-search input:not(:placeholder-shown) ~ .search-kbd, .hero-search input:focus ~ .search-kbd { display: none; }
@media (hover: none), (max-width: 700px) { .search-kbd { display: none; } }
.hero-note { margin: 0; }
.hero-link { font-weight: 700; color: var(--on-action); text-decoration-color: var(--on-action); text-decoration-thickness: 2px; transition: text-underline-offset var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .hero-link:hover { text-underline-offset: 0.36em; } }

/* Page header on every other page: a headline over an ink rule. */
.rate-head { background: var(--ink); color: var(--ground); padding: clamp(40px, 6vw, 80px) 0 clamp(32px, 4vw, 56px); }
.rate-head h1 { font-size: clamp(2.5rem, 1.6rem + 4.4vw, 5rem); line-height: 1; letter-spacing: -0.03em; margin: 0 0 14px; overflow-wrap: anywhere; }
.rate-head p { margin: 0; max-width: 52ch; font-size: 1.125rem; }
.rate-head p + p { margin-top: 10px; }
.rate-head a { color: inherit; font-weight: 700; text-decoration-color: var(--action); }

/* ---------- pages ---------- */
.page { max-width: var(--page); margin: 0 auto; padding: clamp(32px, 5vw, 56px) var(--gutter); }
.page-narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }
.section-title { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); letter-spacing: -0.02em; margin-bottom: 24px; }
.results-title { font-size: var(--fs-h2); line-height: 1.15; margin-bottom: 24px; max-width: var(--list); }
.results-scope { display: block; margin-top: 6px; font-size: var(--fs-lead); font-weight: 700; letter-spacing: 0; }
.eyebrow { display: block; font: 600 var(--fs-small)/1.2 var(--font); color: var(--ink-soft); }
.eyebrow-light { color: var(--ink); }
.recent { padding-top: 0; padding-bottom: var(--space-section); }
.flash { max-width: var(--page); width: calc(100% - 2 * var(--gutter)); margin: 20px auto 0; padding: 14px 20px; border-radius: var(--r-field); background: var(--ok-soft); font-weight: 700; }

/* ---------- search, saved, compare: a tinted band holds the title and the controls ---------- */
.list-band { background: var(--block); border-bottom: 2px solid var(--ink); }
.list-band .page { padding-top: clamp(36px, 5vw, 64px); padding-bottom: 28px; }
.list-band .results-title { font-size: var(--fs-h1); line-height: 1; letter-spacing: -0.025em; max-width: none; margin-bottom: 0; }
.list-band .results-head { gap: 14px 16px; margin-bottom: 0; }
.list-band .sort-label { margin-bottom: 4px; }
.list-band :is(.band-chips, .saved-actions, .compare-bar, .search-hint) { margin: 20px 0 0; }

/* ---------- filter chips above the search results (app.js bandChips) ---------- */
.band-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; max-width: var(--list); }
.band-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 2px solid transparent; border-radius: var(--r-pill); background: none; color: var(--ink); font-weight: 600; font-size: 1rem; cursor: pointer; transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.band-chip[aria-pressed='true'] { background: var(--surface); border-color: var(--ink); }
.band-chip:active { transform: scale(0.97); }
.band-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.band-count { color: var(--ink-soft); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .band-chip:hover:not([aria-pressed='true']) { background: var(--block-strong); } }

/* ---------- loading: a pixel grid and a label for the page, ruled lines for a review ---------- */
.loader { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 60vh; color: var(--ink-soft); font-weight: 600; }
.pixels { display: grid; grid-template-columns: repeat(3, 6px); gap: 2px; }
.pixels i { width: 6px; height: 6px; background: var(--ink); }
.skel { display: grid; gap: 10px; padding: 4px 0; }
.skel i { height: 12px; border-radius: 3px; background: var(--block); }
.skel i:last-child { width: 60%; }

/* ---------- home ledger: the numbers under the search box ---------- */
.ledger { display: flex; gap: clamp(32px, 6vw, 72px); width: min(100%, 640px); margin: 8px 0 0; padding-top: 20px; border-top: 2px solid var(--on-action); }
.ledger div { display: flex; flex-direction: column-reverse; }
.ledger dt { font-size: var(--fs-small); font-weight: 600; }
.ledger dd { margin: 0 0 8px; font: 700 var(--fs-h2)/1.1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; }
.flaps { display: flex; gap: 2px; }
.flap { position: relative; padding: 3px 0.16em; border-radius: 3px; background: var(--ink); color: var(--ground); }
.flap::after { content: ''; position: absolute; inset: 50% 0 auto; height: 1px; background: var(--ground); opacity: 0.45; }

/* ---------- home hero: three report cards, fanned ---------- */
.stack { position: relative; height: 440px; }
.stack-card {
  position: absolute; left: 50%; top: 0; width: min(290px, 78%); display: grid; gap: 6px; padding: 22px 24px;
  border: 2px solid var(--ink); border-radius: var(--r-card); background: var(--surface); color: var(--ink); text-decoration: none;
  transform: translate(calc(-50% + var(--x)), var(--y)) rotate(var(--r)); transition: transform 420ms var(--ease-out);
}
.stack-card:nth-child(1) { --x: -22%; --y: 8px; --r: -7deg; }
.stack-card:nth-child(2) { --x: 20%; --y: 96px; --r: 5deg; }
.stack-card:nth-child(3) { --x: -6%; --y: 212px; --r: -2deg; }
.stack-card:focus-visible { z-index: 4; }
.stack-dept { font-size: var(--fs-small); font-weight: 600; color: var(--ink-soft); }
.stack-name { font: 700 1.5rem/1.15 var(--font-display); }
.stack-grade { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 6px; }
.stack-bars { display: flex; align-items: flex-end; gap: 5px; height: 56px; }
.stack-bars i { width: 14px; height: 100%; border-radius: 3px; background: var(--ink); transform: scaleY(max(var(--h), 0.06)); transform-origin: bottom; }
.stack-foot { font-size: var(--fs-small); }
@media (hover: hover) and (pointer: fine) {
  .stack-card:hover { z-index: 4; transform: translate(calc(-50% + var(--x)), calc(var(--y) - 12px)) rotate(0deg) scale(1.03); }
}
.marquee { overflow: hidden; background: var(--ink); color: var(--ground); }
.marquee-track { display: flex; width: max-content; }
.marquee span { display: flex; align-items: center; gap: 28px; padding: 16px 14px; font: italic 700 1.375rem/1 var(--font-display); white-space: nowrap; }
.marquee span::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--action); }

/* ---------- teacher cards ---------- */
.card-list { display: grid; gap: 14px; max-width: var(--list); }
.card-grid { max-width: none; }
@media (min-width: 1100px) { .card-grid { grid-template-columns: 1fr 1fr; } }
.t-card {
  position: relative; display: grid; grid-template-columns: 92px 1fr auto; gap: 22px; align-items: start;
  padding: 20px 18px 20px 20px; background: var(--surface); border: 2px solid transparent; border-radius: var(--r-card);
  transition: border-color var(--t-hover) ease, transform var(--t-ui) var(--ease-out);
}
.t-card-score { display: grid; justify-items: center; align-content: start; gap: 6px; text-align: center; }
.t-card-score .muted { font-size: var(--fs-small); }
.t-card-body :is(h2, h3) { font-size: 1.5rem; line-height: 1.15; }
.t-card-link { text-decoration: none; }
.t-card-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.t-card-link:focus-visible { outline: none; }
.t-card:has(.t-card-link:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.t-card:has(.t-card-link:active) { transform: scale(0.99); }
.t-dept { margin: 4px 0 0; color: var(--ink-soft); }
.t-card-stats { display: grid; gap: 4px; margin: 12px 0 0; } /* one stat per line */
.t-card-stats svg { margin-right: 8px; font-size: 18px; vertical-align: -3px; color: var(--ink-soft); }
.t-card-stats b { font-weight: 700; margin-right: 2px; }
.save-btn { position: relative; z-index: 1; flex: none; align-self: start; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--r-btn); background: none; color: var(--ink-soft); font-size: 24px; cursor: pointer; transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.save-btn:active { transform: scale(0.9); }
.save-btn[aria-pressed='true'] { color: var(--action-ink); }
.save-btn[aria-pressed='true'] svg { fill: var(--action); }
@media (hover: hover) and (pointer: fine) {
  .t-card:hover .t-card-link { text-decoration: underline; text-decoration-color: var(--action); }
  .t-card:hover { border-color: var(--ink); transform: translateY(-3px); }
  .t-card:hover .qbox { transform: rotate(0deg) scale(1.06); } /* the grade squares up to you */
  .save-btn:hover { background: var(--block); color: var(--ink); }
}

/* Grades: the number circled in its colour, a little off true, as a pen would. Not pressable. */
.qbox { --ring: 2.5px; display: grid; place-items: center; width: 76px; height: 64px; border: var(--ring) solid transparent; border-radius: 50%; font: 700 1.875rem/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; transform: rotate(-3deg); transition: transform var(--t-ui) var(--ease-out); }
/* The ring itself is a pseudo-element, so it can be inked in like a pen stroke (motion block: draw). */
:is(.qbox, .tp-score, .sbox) { position: relative; }
:is(.qbox, .tp-score, .sbox)::before { content: ''; position: absolute; inset: calc(-1 * var(--ring)); border: var(--ring) solid currentColor; border-radius: inherit; pointer-events: none; }
.q-good { color: var(--q-good); }
.q-ok { color: var(--q-ok); }
.q-bad { color: var(--q-bad); }
.q-none { color: var(--q-none); }
.q-diff { color: var(--ink); }
.qbox-sm { --ring: 2px; display: inline-grid; width: 56px; height: 44px; font-size: 1.25rem; }

.empty-cta { display: grid; justify-items: start; gap: 14px; margin-top: 36px; max-width: var(--list); }
.empty-cta p { margin: 0; font-size: var(--fs-lead); font-weight: 700; }
.page > .empty-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 24px 28px; border: 2px solid var(--ink); border-radius: var(--r-card); }

/* Sponsor slots under the teacher list (app.js): tinted, labelled, never styled like a review. Hidden until used. */
.sponsored { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; max-width: var(--list); margin-top: 32px; }
.sponsor-card { min-height: 120px; padding: 18px 22px; border-radius: var(--r-card); background: var(--block); }
.sponsor-label { display: inline-block; margin: 0 0 8px; padding: 2px 12px; border-radius: var(--r-pill); background: var(--surface); font-size: var(--fs-small); font-weight: 800; }

/* ---------- departments ---------- */
.browse { padding-top: var(--space-section); padding-bottom: var(--space-section); }
.dept-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 40px; border-top: 2px solid var(--ink); }
.dept-chip { position: relative; isolation: isolate; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 14px; border-bottom: 2px solid var(--block-strong); color: var(--ink); text-decoration: none; font: 700 1.3125rem/1.2 var(--font-display); transition: color var(--t-hover) ease; }
.dept-chip::before { content: ''; position: absolute; inset: 0 0 -2px; z-index: -1; background: var(--ink); transform: scaleY(0); transform-origin: bottom; transition: transform 320ms var(--ease-out); }
.dept-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; font-size: 22px; transition: transform var(--t-ui) var(--ease-out); }
.dept-count { margin-left: auto; min-width: 32px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: 700 var(--fs-small)/28px var(--font); text-align: center; }
.dept-chip.is-empty { color: var(--ink-soft); }
.dept-chip:active .dept-icon { transform: scale(0.9); }
@media (hover: hover) and (pointer: fine) {
  .dept-chip:hover { color: #fff; }
  .dept-chip:hover::before { transform: none; }
  .dept-chip:hover .dept-icon { transform: rotate(-8deg) scale(1.12); }
}

/* ---------- teacher page: a band in the colour of the grade, then the detail ---------- */
.tp-band { background: var(--block); border-bottom: 2px solid var(--ink); }
.band-good { background: var(--q-good-soft); }
.band-ok { background: var(--q-ok-soft); }
.band-bad { background: var(--q-bad-soft); }
.tp-band-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 56px; align-items: center; padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(36px, 5vw, 64px); }
.tp-band-score { display: grid; justify-items: center; text-align: center; }
.tp-band :is(.tp-based, .conf, .tp-where, .tp-empty) { margin-bottom: 0; }
.tp-band .teaches { margin: 20px 0 0; }
.tp-band .conf { margin-top: 8px; }
.tp-band .tags li, .tp-band .course-chip:not([aria-current='true']) { background: var(--surface); }
.tp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 48px; align-items: start; }
.tp-score { --ring: 3px; display: inline-flex; align-items: baseline; gap: 8px; padding: 30px 48px 28px; border: var(--ring) solid transparent; border-radius: 50%; transform: rotate(-3deg); view-transition-name: grade; }
.tp-big { font: 700 clamp(4.5rem, 2.6rem + 7vw, 8rem)/0.9 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tp-of { font: 700 1.5rem/1 var(--font-display); color: var(--ink-soft); }
.tp-based { margin: 22px 0 28px; }
.tp-based .link-btn { padding: 9px 0; margin: -9px 0; } /* a 44px tap target without moving the line */
.tp-title { display: flex; align-items: flex-start; gap: 8px; }
.tp-name { font-size: clamp(2.75rem, 1.6rem + 5vw, 5.5rem); line-height: 0.98; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.tp-where { margin: 14px 0 24px; max-width: 40ch; }
.tp-where a { font-weight: 700; text-decoration-color: var(--action); }
.tp-feedback { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.tp-feedback > div { display: grid; align-content: start; gap: 2px; min-width: 136px; padding: 16px 20px; border-radius: var(--r-card); background: var(--surface); }
.tp-feedback b { font: 700 2.25rem/1.05 var(--font-display); font-variant-numeric: tabular-nums; }
.tp-feedback span { font-weight: 600; }
.tp-feedback small { font-size: var(--fs-small); color: var(--ink-soft); }
.tp-empty { display: grid; gap: 4px; margin-bottom: 28px; padding: 22px 24px; border-radius: var(--r-card); background: var(--surface); }
.tp-empty b { font: 700 var(--fs-h2)/1.1 var(--font-display); }
.conf { display: flex; align-items: center; gap: 8px; margin: -20px 0 28px; font-size: var(--fs-small); font-weight: 600; }
.conf-bars { display: inline-flex; align-items: flex-end; gap: 2px; }
.conf-bars i { width: 4px; background: var(--block-strong); border-radius: 1px; }
.conf-bars i:nth-child(1) { height: 7px; }
.conf-bars i:nth-child(2) { height: 11px; }
.conf-bars i:nth-child(3) { height: 15px; }
.conf-1 .conf-bars i:nth-child(1) { background: var(--q-bad); }
.conf-2 .conf-bars i:nth-child(-n + 2) { background: var(--q-ok); }
.conf-3 .conf-bars i { background: var(--q-good); }
.teaches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.teaches-label { font-weight: 700; margin-right: 4px; }
.course-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 16px; border-radius: var(--r-pill); border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem; transition: border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.course-chip[aria-current='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.course-chip:active { transform: scale(0.97); }
.tldr { margin: -8px 0 24px; max-width: 46ch; }
.tp-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 16px; }
/* Remove your own post (051): quiet, shown on every page and review so it never marks which posts are yours. */
.remove-mine { display: inline-flex; align-items: center; min-height: 44px; margin-left: 16px; color: var(--ink-soft); font-weight: 600; text-decoration-color: var(--block-strong); }
.mini-title { font-size: var(--fs-lead); margin: 36px 0 12px; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 5px 14px; border-radius: var(--r-pill); background: var(--ground); font-size: 0.9375rem; font-weight: 600; }
.tp-main .tags li { background: var(--surface); }
.tag-count { display: inline-block; min-width: 24px; margin-left: 4px; padding: 0 7px; border-radius: var(--r-pill); background: var(--block); text-align: center; font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .course-chip:hover { border-color: var(--ink); } }

.panel { padding: 24px; border-radius: var(--r-card); background: var(--surface); }
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: var(--fs-lead); margin-bottom: 18px; }
.panel-blue { background: var(--block); }
.panel-sub { margin: -10px 0 16px; }
.trend-read { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-height: 44px; }
.trend-read b { font: 700 2.25rem/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; }
.trend-read span { font-size: var(--fs-small); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.trend-read .trend-delta { font-weight: 700; }
.trend-read .trend-delta.q-good { color: var(--q-good); }
.trend-read .trend-delta.q-bad { color: var(--q-bad); }
.trend-plot { margin-top: 8px; border-radius: var(--r-field); cursor: crosshair; touch-action: pan-y; }
.trend-plot svg { display: block; width: 100%; height: auto; }
.trend-area { fill: var(--block); stroke: none; }
.trend-line { stroke: var(--ink); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.trend-cursor { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.trend-dot { fill: var(--action); stroke: var(--surface); stroke-width: 2; }
.trend-ends { display: flex; justify-content: space-between; margin-top: 6px; font-size: var(--fs-small); color: var(--ink-soft); }
.dist-row { display: grid; grid-template-columns: 104px 1fr 32px; align-items: center; gap: 12px; margin-bottom: 12px; }
.dist-label { text-align: right; font-weight: 600; }
.dist-track { height: 24px; border-radius: 4px; background: var(--ground); overflow: hidden; }
.dist-bar { display: block; height: 100%; background: var(--ink); transform-origin: left; }
.dist-bar-navy { background: var(--ink-soft); }
@media (hover: hover) { .dist-row:hover .dist-bar { background: var(--action); } }
.dist-count { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.similar { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.similar a { display: flex; align-items: center; gap: 10px; min-height: 44px; max-width: 170px; line-height: 1.2; font-weight: 600; text-decoration: none; }
.sbox { --ring: 2px; flex: none; display: grid; place-items: center; width: 48px; height: 40px; border: var(--ring) solid transparent; border-radius: 50%; font: 700 1.125rem/1 var(--font-display); }
@media (hover: hover) and (pointer: fine) { .similar a:hover span:last-child { text-decoration: underline; } }

/* ---------- rating cards ---------- */
.ratings { padding-top: 8px; padding-bottom: var(--space-section); }
.ratings-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; max-width: var(--list); margin-bottom: 18px; }
.ratings-head .section-title { margin: 0; }
.ratings-controls { display: flex; gap: 8px; }
.ratings-controls select { height: 44px; border: 2px solid var(--line-strong); border-radius: var(--r-field); padding: 0 14px; background: var(--surface); cursor: pointer; }
.filter-note { margin: -6px 0 16px; }
.r-card { display: grid; grid-template-columns: 84px 1fr; gap: 26px; max-width: var(--list); padding: 28px 0; border-top: 2px solid var(--block-strong); }
.r-scores { display: grid; gap: 14px; align-content: start; justify-items: center; text-align: center; }
.r-scores .eyebrow { margin-bottom: 6px; }
.r-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.r-course { font: 700 1.375rem/1.2 var(--font-display); }
.r-head time { color: var(--ink-soft); }
.r-meta { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.r-meta li { padding: 3px 12px; border-radius: var(--r-pill); background: var(--block); }
.r-comment { margin: 16px 0; max-width: 62ch; overflow-wrap: anywhere; }
.r-votes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; }
.vote { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 6px 14px; border: 2px solid var(--block-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-soft); font-size: 18px; cursor: pointer; transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.vote span { font-size: 1rem; font-weight: 700; }
.vote[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.vote-down svg { transform: scaleY(-1); }
.report { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-height: 44px; padding: 6px 12px; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-soft); font-size: 1rem; text-decoration: underline; cursor: pointer; transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.report:disabled { text-decoration: none; cursor: default; }
.vote:active, .report:active:not(:disabled) { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .vote:hover { border-color: var(--line-strong); color: var(--ink); }
  .vote[aria-pressed='true']:hover { color: #fff; border-color: #000; }
  .report:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger-edge); }
}
.more-reviews { display: flex; justify-content: center; max-width: var(--list); margin: 24px 0 8px; }

/* replies */
.replies { margin-top: 14px; }
.reply-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.reply { padding: 12px 16px; border-left: 3px solid var(--block-strong); }
.reply-meta { margin: 0 0 4px; font-size: 1rem; color: var(--ink-soft); }
.reply-text { margin: 0; overflow-wrap: anywhere; }
.reply-actions { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.reply-actions .report { margin-left: 0; }
.reply-open { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.reply-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- forms ---------- */
.rate-form { padding-top: 32px; padding-bottom: var(--space-section); display: grid; gap: 12px; }
.rate-form > .btn-wide { margin-top: 8px; }
/* 056: "ask for your school" sits right under the email check */
.rate-form:has(+ :is(.school-request, .school-asked)) { padding-bottom: 0; }
.rate-form.school-request { padding-top: 28px; }
.school-asked { padding-top: 28px; padding-bottom: var(--space-section); }
.school-asked p { margin: 0; padding: 20px 24px; border-radius: var(--r-card); background: var(--surface); }
.q-card { position: relative; margin: 0; min-width: 0; padding: 26px 28px 30px; border: 2px solid transparent; border-radius: var(--r-card); background: var(--surface); transition: border-color var(--t-ui) ease; }
.q-card:focus-within { border-color: var(--ink); }
/* Answered questions get a tick, by CSS alone: a checked choice, a typed answer, or a picked option. */
fieldset.q-card legend { padding-right: 44px; }
fieldset.q-card::after { content: ''; position: absolute; top: 24px; right: 24px; width: 28px; height: 28px; border: 2px solid var(--block-strong); border-radius: 50%; background: center / 16px no-repeat; transform: scale(0.85); transition: background-color var(--t-ui) ease, border-color var(--t-ui) ease, transform 320ms var(--ease-spring); }
fieldset.q-card:is(:has(input:checked), :has(:is(input:not([type]), textarea):not(:placeholder-shown)), :has(option:checked:not([value='']))):not(.has-error)::after { border-color: var(--q-good); background-color: var(--q-good); background-image: var(--tick); transform: none; }
.q-card legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font: 700 1.375rem/1.25 var(--font-display); }
.q-label { display: block; margin-bottom: 12px; font: 700 1.375rem/1.25 var(--font-display); }
.req { color: var(--danger); }
.opt { margin-left: 4px; font: 400 1rem/1 var(--font); color: var(--ink-soft); }
:is(.q-card, .reply-form, .request-reply-form, .chat-form, .askedit-form) :is(input:not([type]), input[type='password'], input[type='email'], select, textarea) {
  width: 100%; min-height: 52px; padding: 12px 16px; border: 2px solid var(--line-strong); border-radius: var(--r-field); background: var(--surface);
  transition: border-color var(--t-hover) ease;
}
:is(.q-card, .reply-form, .request-reply-form, .chat-form, .askedit-form) textarea { min-height: 96px; line-height: 1.5; resize: vertical; }
.q-card textarea { min-height: 150px; }
:is(.q-card, .reply-form, .request-reply-form, .chat-form, .askedit-form) :is(input, select, textarea):focus-visible { border-color: var(--ink); }
[aria-invalid='true'] { border-color: var(--danger) !important; }
.q-card.has-error { border-color: var(--danger); }
.q-card.has-error legend { color: var(--danger); }
.field-help { margin: 8px 0 0; font-size: 1rem; color: var(--ink-soft); }
.field-help a { color: var(--ink); font-weight: 700; text-decoration-color: var(--action); }
.counter { margin: 8px 0 0; text-align: right; font-size: 1rem; color: var(--ink-soft); }
.counter.is-near { color: var(--warn-ink); font-weight: 700; }
.counter.is-over { color: var(--danger-edge); font-weight: 700; }
.form-error { margin: 0; padding: 14px 18px; border-radius: var(--r-field); background: var(--danger-soft); color: var(--danger-edge); font-weight: 700; }

/* 1 to 5 scale: numbered tiles; the picked one is tinted with its grade and gets a check */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; clear: both; }
.seg { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 68px; border: 2px solid var(--line-strong); border-radius: var(--r-field); background: var(--surface); color: var(--ink); font: 700 1.5rem/1 var(--font-display); transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, border-color var(--t-hover) ease; }
.seg.picked span { border-color: var(--ink); }
.seg.picked span::after, .tag-picker input:checked + span::before { content: ''; width: 6px; height: 12px; border: solid currentColor; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; position: relative; z-index: 1; }
.seg:active span { transform: scale(0.97); }
/* The fill runs up the scale, tile by tile. */
.seg:nth-child(2) span { transition-delay: 0ms, 35ms, 0ms; }
.seg:nth-child(3) span { transition-delay: 0ms, 70ms, 0ms; }
.seg:nth-child(4) span { transition-delay: 0ms, 105ms, 0ms; }
.seg:nth-child(5) span { transition-delay: 0ms, 140ms, 0ms; }
.lvl-good .seg.on span { background: var(--q-good-soft); }
.lvl-ok .seg.on span { background: var(--q-ok-soft); }
.lvl-bad .seg.on span { background: var(--q-bad-soft); }
.lvl-diff .seg.on span { background: var(--ink); color: var(--action); }
.lvl-diff .seg.picked span { border-color: #000; }
.scale-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 0.9375rem; color: var(--ink-soft); }
.scale-pick { color: var(--ink); font-weight: 700; }

.yesno { display: flex; flex-wrap: wrap; gap: 10px; clear: both; }
.yesno label, .tag-picker label { position: relative; cursor: pointer; }
.yesno input, .tag-picker input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.yesno span { display: grid; place-items: center; min-width: 108px; min-height: 52px; padding: 0 22px; border: 2px solid var(--line-strong); border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font-weight: 600; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, border-color var(--t-hover) ease; }
.yesno input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--action); }
.yesno input:focus-visible + span, .tag-picker input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; clear: both; }
.tag-picker span { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px; border: 2px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, border-color var(--t-hover) ease; }
.tag-picker input:checked + span { background: var(--action-soft); border-color: var(--action-edge); color: var(--ink); }
.tag-picker input:disabled + span { opacity: 0.5; cursor: not-allowed; }
.yesno label:active span, .tag-picker label:active span { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .seg:hover span, .yesno label:hover span, .tag-picker label:hover input:not(:disabled) + span { border-color: var(--ink); }
  .seg.picked:hover span { border-color: var(--ink); }
}
.guidelines { clear: both; margin-bottom: 14px; padding: 14px 18px; border-radius: var(--r-field); background: var(--block); font-size: 1rem; }
.guidelines ul { margin: 6px 0 0; padding-left: 20px; }
.guidelines a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; color: var(--ink); font-weight: 700; text-decoration-color: var(--action); }
.agree { display: flex; gap: 12px; align-items: flex-start; font-size: 1rem; cursor: pointer; }
/* Checkbox, ported from beUI's motion checkbox (beui.dev, MIT, (c) 2026 Saurabh Chauhan) onto the native input, so
   `required`, the keyboard and form data work as before. Pressed, it squishes; checked, the box fills and the tick
   draws in left to right (the path only moves rightward, so a wipe draws it in stroke order); unchecked, it fades out. */
.agree input {
  appearance: none; flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin: -2px 0 0;
  border: 2.5px solid var(--line-strong); border-radius: 6px; background: var(--surface); cursor: pointer;
  transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.agree input::before {
  content: ''; width: 18px; height: 18px;
  background: var(--tick) center / contain no-repeat;
  opacity: 0; transform: scale(0.5); filter: blur(4px); clip-path: inset(0 100% 0 0);
  transition: opacity 120ms ease, transform 120ms var(--ease-out), filter 120ms ease, clip-path 0s linear 120ms;
}
.agree input:checked { background: var(--action-deep); border-color: var(--action-deep); }
.agree input:checked::before {
  opacity: 1; transform: none; filter: none; clip-path: inset(0);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out), filter 160ms ease, clip-path 300ms var(--ease-out) 40ms;
}
.agree input:active:not(:disabled) { transform: scale(0.92); }
.agree input:disabled, .agree input:disabled + span { opacity: 0.55; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .agree:hover input:not(:checked):not(:disabled) { border-color: var(--ink); background: var(--ground); }
}
@media (prefers-reduced-motion: reduce) {
  .agree input:active:not(:disabled) { transform: none; }
  .agree input::before, .agree input:checked::before { transform: none; filter: none; clip-path: none; transition: opacity 120ms ease; }
}
.agree a, .post-note a { color: var(--ink); font-weight: 700; text-decoration-color: var(--action); }
.post-note { padding: 16px 20px; border-radius: var(--r-field); background: var(--block); font-size: 1rem; }
.post-note p { margin: 0 0 6px; }
.post-note p:last-child { margin: 0; }
.submitted { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 32px; padding-bottom: 72px; }

/* ---------- home: "how it works", pending list ---------- */
.how { padding-top: 8px; padding-bottom: var(--space-section); }
.how-list { list-style: none; margin: 0; padding: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 40px; border-top: 2px solid var(--ink); }
.how-list li { display: flex; gap: 14px; align-items: flex-start; }
.how-list svg { flex: none; width: 26px; height: 26px; margin-top: 1px; color: var(--action-ink); stroke-width: 2.2; }
.how-list b { display: block; font: 700 1.25rem/1.25 var(--font-display); margin-bottom: 2px; }
.how-list a { color: var(--ink); font-weight: 700; text-decoration-color: var(--action); }
.pending { padding-bottom: 0; }
.pending-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: var(--list); }
.pending-item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r-card); background: var(--surface); }
.pending-item.is-approved { background: var(--ok-soft); }
.pending-item span { flex: 1; min-width: 200px; }

/* ---------- search, saved, compare ---------- */
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.results-head .results-title { margin-bottom: 16px; }
.sort-label { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px; font-weight: 600; white-space: nowrap; }
.sort-label select, .compare-add select { height: 44px; border: 2px solid var(--line-strong); border-radius: var(--r-field); padding: 0 14px; background: var(--surface); cursor: pointer; }
.search-hint { margin: -8px 0 20px; }
.did-you-mean { font-size: var(--fs-lead); }
.did-you-mean a { color: var(--ink); font-weight: 700; text-decoration-color: var(--action); }
.saved-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.table-scroll { overflow-x: auto; max-width: 100%; border-radius: var(--r-card); }
.course-table, .compare-table { width: 100%; max-width: var(--list); border-collapse: separate; border-spacing: 0; border-radius: var(--r-card); background: var(--surface); }
:is(.course-table, .compare-table) :is(th, td) { padding: 12px 16px; border-bottom: 2px solid var(--ground); text-align: left; vertical-align: middle; }
:is(.course-table, .compare-table) tbody tr:last-child :is(th, td) { border-bottom: 0; }
.course-table thead th { font-size: 0.9375rem; font-weight: 600; color: var(--ink-soft); }
.course-table td { font-variant-numeric: tabular-nums; }
.course-table a, .compare-table thead th a { display: inline-flex; align-items: center; min-height: 44px; } .course-table a { color: var(--ink); font-weight: 700; text-decoration-color: var(--action); }
.course-table tr.is-active { background: var(--block); }
.course-table-wrap { padding-top: 0; }
.compare { max-width: var(--page); }
.compare-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 20px; }
.compare-add { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 600; }
.compare-table { max-width: none; min-width: 560px; table-layout: fixed; }
.compare-table tbody th { position: sticky; left: 0; z-index: 1; width: 170px; background: var(--surface); font-weight: 600; color: var(--ink-soft); }
.compare-table thead th { padding-top: 22px; font: 700 1.625rem/1.15 var(--font-display); vertical-align: top; }
.compare-table td:has(.best) { background: var(--q-good-soft); }
.compare-table thead th a { text-decoration: none; }
.compare-table td .tags li { font-size: 0.8125rem; }
.compare-table q { display: block; font-size: 1rem; }
.remove-btn { display: block; min-height: 44px; margin-top: 2px; font-size: 0.9375rem; color: var(--ink-soft); }
.best { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--q-good); color: #fff; font-size: 0.8125rem; font-weight: 700; vertical-align: middle; }
@media (hover: hover) and (pointer: fine) { .compare-table thead th a:hover { text-decoration: underline; } }

/* ---------- home: top and lowest rated, as ruled class lists ---------- */
.board { padding-top: 0; padding-bottom: var(--space-section); }
.board-head { max-width: 760px; margin-bottom: 20px; }
.board-head .section-title { margin-bottom: 6px; }
.board-note { margin: 0; color: var(--ink-soft); }
.board-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 48px; }
.board-col { padding-top: 14px; border-top: 2px solid var(--ink); }
.board-title { font-size: 1.375rem; margin-bottom: 4px; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'name value' 'bar bar'; gap: 6px 16px; padding: 10px 0 14px; border-bottom: 2px solid var(--block); }
.board-row:last-child { border-bottom: 0; }
.board-row:first-child .board-who b { font: 700 1.5rem/1.15 var(--font-display); }
.board-row:first-child .board-value b { font-size: 2.5rem; }
.board-row:first-child .board-track { height: 12px; border-radius: 6px; }
.board-name { grid-area: name; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 44px; text-decoration: none; }
.board-rank { flex: none; width: 24px; font: 700 1.25rem/1 var(--font-display); color: var(--ink-soft); transition: color var(--t-hover) ease; }
.board-who { display: grid; min-width: 0; line-height: 1.2; }
.board-who b { font-size: 1.0625rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-who small { font-size: var(--fs-small); color: var(--ink-soft); }
.board-value { grid-area: value; display: grid; justify-items: end; line-height: 1.15; }
.board-value b { font: 700 1.625rem/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; }
.board-value small { font-size: 0.8125rem; color: var(--ink-soft); white-space: nowrap; }
.board-track { grid-area: bar; height: 8px; border-radius: 4px; background: var(--block); overflow: hidden; }
.board-bar { display: block; height: 100%; background: var(--q-good); transform-origin: left; }
.board-lowest .board-bar { background: var(--q-bad); }
/* difficulty isn't good or bad, so both lists stay neutral */
.board-hardest .board-bar { background: var(--ink); }
.board-easiest .board-bar { background: var(--line-strong); }
.board-empty { margin: 12px 0 16px; }
@media (hover: hover) and (pointer: fine) {
  .board-name:hover b { text-decoration: underline; text-decoration-color: var(--action); }
  .board-name:hover .board-rank { color: var(--action-ink); }
}

/* ---------- requests ---------- */
.request-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; clear: both; }
.request-kind { position: relative; cursor: pointer; }
.request-kind input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.request-kind span { display: grid; gap: 2px; height: 100%; padding: 14px 18px; border: 2px solid var(--line-strong); border-radius: var(--r-field); background: var(--surface); transition: border-color var(--t-hover) ease, background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.request-kind b { font-size: 1.0625rem; font-weight: 700; }
.request-kind small { font-size: 1rem; line-height: 1.35; color: var(--ink-soft); }
.request-kind input:checked + span { border-color: var(--ink); background: var(--block); }
.request-kind input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.request-kind:active span { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .request-kind:hover span { border-color: var(--ink); } }
.request-privacy { margin: 0; font-size: 1rem; }
.request-message { margin: 8px 0 0; max-width: 70ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.request-row { align-items: flex-start; }
.request-row.is-done, .request-row.is-dismissed { opacity: 0.75; }
.request-closed { margin: 12px 0 32px; }
.request-closed summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.request-reply { margin-top: 10px; padding: 12px 14px; border-radius: 18px; background: var(--block); }
.request-reply p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.request-reply .muted, .request-noreply { font-size: 0.875rem; }
.request-noreply { margin: 8px 0 0; }
.request-reply-form { display: grid; gap: 8px; max-width: 70ch; margin-top: 10px; }
.request-reply-form .btn { justify-self: start; }
.request-chat { max-width: 70ch; margin-top: 10px; }
.request-chat > .muted { margin: 0 0 6px; font-size: 0.875rem; }
.request-chat-open { margin-top: 20px; }
.chat-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 40vh; overflow-y: auto; }
.chat-msg { justify-self: start; max-width: 85%; padding: 10px 14px; border-radius: 20px 20px 20px 6px; background: var(--ground); }
.chat-msg.is-mine { justify-self: end; border-radius: 20px 20px 6px 20px; background: var(--block); }
.chat-msg span { font-size: 0.8125rem; color: var(--ink-soft); }
.chat-msg p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: grid; gap: 8px; }
.chat-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Cards that float over the page: owner replies, the one-time notice, private edit requests. */
.reply-card, .site-notice, .edit-card { color: var(--ink); background: var(--surface); border-radius: var(--r-card); box-shadow: var(--float); }
.reply-card { position: fixed; left: 50%; bottom: 20px; z-index: 40; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); display: grid; gap: 8px; padding: 20px 22px; }
.reply-card p { margin: 0; }
.reply-card-eyebrow, .site-notice-eyebrow, .edit-card-eyebrow { font-size: var(--fs-small); font-weight: 700; color: var(--action-ink); }
.reply-card-asked { font-size: 1rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.reply-card-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-card .btn { justify-self: end; }
.site-notice { position: fixed; left: 50%; bottom: 20px; z-index: 30; transform: translateX(-50%); width: min(620px, calc(100% - 32px)); display: flex; align-items: center; gap: 18px; padding: 18px 20px 18px 22px; }
.site-notice.is-leaving { opacity: 0; transform: translate(-50%, 12px); transition: opacity 180ms ease, transform 180ms var(--ease-out); }
.site-notice-text { flex: 1; min-width: 0; }
.site-notice p { margin: 0; }
.site-notice-eyebrow { margin-bottom: 4px !important; }
.site-notice-body { line-height: 1.45; overflow-wrap: anywhere; }
.site-notice-actions { flex: none; }
.edit-state { display: grid; gap: 4px; margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: var(--warn-soft); font-size: 1rem; }
.askedit-form { display: grid; gap: 6px; max-width: 70ch; margin-top: 8px; font-size: 0.9375rem; }
.askedit-form label { font-weight: 800; }
.edit-cards { position: fixed; left: 50%; bottom: 16px; z-index: 45; transform: translateX(-50%); width: min(600px, calc(100% - 24px)); display: grid; gap: 10px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.edit-cards:empty { display: none; }
.edit-card { display: grid; gap: 8px; padding: 20px 22px; }
.edit-card p { margin: 0; }
.edit-card-eyebrow { color: var(--warn-ink); }
.edit-card-title { font: 700 1.1875rem/1.3 var(--font-display); }
.edit-card-reason, .edit-card-deadline { font-size: 1rem; overflow-wrap: anywhere; }
.edit-form { display: grid; gap: 12px; }
.edit-field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; font-size: 0.9375rem; font-weight: 800; }
.edit-field legend { padding: 0; margin-bottom: 6px; }
.edit-field :is(input:not([type]), select, textarea) { width: 100%; padding: 10px 12px; border: 2px solid var(--line-strong); border-radius: 14px; font-weight: 600; }
.edit-field textarea { resize: vertical; }
.edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edit-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.edit-scale label, .edit-yesno label, .edit-tags label { position: relative; cursor: pointer; }
.edit-scale input, .edit-yesno input, .edit-tags input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.edit-scale span { display: grid; place-items: center; min-height: 44px; padding: 6px 2px; border-radius: 14px; background: var(--ground); font-size: 1rem; font-weight: 900; line-height: 1.1; }
.edit-scale small { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }
.edit-scale input:checked + span { background: var(--action-deep); color: #fff; }
.edit-scale input:checked + span small { color: #fff; }
.edit-yesno { display: flex; flex-wrap: wrap; gap: 8px; }
.edit-yesno span { display: grid; place-items: center; min-height: 44px; padding: 0 18px; border: 2px solid var(--line-strong); border-radius: var(--r-pill); font-weight: 800; }
.edit-yesno input:checked + span { background: var(--action-deep); border-color: var(--action-deep); color: #fff; }
.edit-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.edit-tags span { display: flex; align-items: center; min-height: 36px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--ground); font-size: 0.875rem; font-weight: 700; }
.edit-tags input:checked + span { background: var(--block-strong); }
.edit-tags input:disabled + span { opacity: 0.45; }
:is(.edit-scale, .edit-yesno, .edit-tags) input:focus-visible + span { outline: 3px solid var(--action-deep); outline-offset: 2px; }
.edit-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* "Go to review" highlight */
.r-card.is-target { outline: 3px solid var(--focus); outline-offset: 4px; background: var(--block); }

/* ---------- menus: every dropdown (select.js) and search suggestions (suggest.js) ---------- */
.topbar-search, .suggest-host { position: relative; }
.suggest {
  position: absolute; top: calc(100% + 8px); z-index: 30; margin: 0; padding: 8px; list-style: none; max-height: 380px; overflow-y: auto;
  background: var(--surface); color: var(--ink); border-radius: var(--r-card); box-shadow: var(--float); text-align: left; transform-origin: top left;
}
.hero-search .suggest { top: calc(100% + 10px); }
.suggest-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: var(--r-field); cursor: pointer; }
.suggest-item[aria-selected='true'] { background: var(--block); }
.suggest-score { --ring: 2px; flex: none; width: 46px; height: 38px; font-size: 1.0625rem; }
.suggest-text { display: grid; min-width: 0; line-height: 1.25; }
.suggest-text b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-text span { font-size: 0.9375rem; color: var(--ink-soft); }
.suggest-all { margin-top: 4px; color: var(--action-ink); font-weight: 700; }
.select-wrap { position: relative; display: inline-block; min-width: 0; vertical-align: middle; }
.native-hidden { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.select-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 44px; padding: 0 12px 0 18px;
  border: 2px solid var(--line-strong); border-radius: var(--r-field); background: var(--surface); color: var(--ink);
  text-align: left; cursor: pointer; transition: border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.select-btn:active { transform: scale(0.98); }
.select-btn[aria-expanded='true'] { border-color: var(--ink); }
.select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* "Select department" / "Choose…" in forms look like placeholders; filter values like "All courses" don't. */
:is(.q-card, .admin-add, .admin-edit, .compare-add) .select-value.is-placeholder { color: var(--ink-soft); }
.select-chevron { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t-ui) var(--ease-out); }
.select-btn[aria-expanded='true'] .select-chevron { transform: rotate(180deg); }
.select-menu { left: 0; top: calc(100% + 6px); min-width: 100%; width: max-content; max-width: calc(100vw - 32px); outline: none; }
.select-menu-end { left: auto; right: 0; transform-origin: top right; }
.select-menu .select-item { gap: 10px; padding: 8px 14px 8px 10px; white-space: nowrap; }
.select-menu .select-item[aria-selected='true'] { background: none; font-weight: 700; color: var(--ink); }
.select-menu .select-item.is-active { background: var(--block); }
.select-check { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--action-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.select-item[aria-selected='true'] .select-check { visibility: visible; }
.select-group { padding: 12px 10px 4px; font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft); }
.select-group:first-child { padding-top: 6px; }
.topbar-search .select-wrap { flex: 0 0 140px; }
.q-card .select-wrap, .admin-add .select-wrap, .admin-edit .select-wrap { display: block; }
:is(.q-card, .admin-add, .admin-edit) .select-btn { border-radius: var(--r-field); padding-left: 16px; }
.q-card .select-btn { height: 52px; }
.has-error .select-btn, .select-wrap:has([aria-invalid='true']) .select-btn { border-color: var(--danger); }
@media (hover: hover) and (pointer: fine) {
  .suggest-item:hover, .select-menu .select-item:hover { background: var(--block); }
  .select-btn:hover { border-color: var(--ink); }
}

/* ---------- dialog, crisis lines, toast ---------- */
/* Report reasons (044) */
.report-dialog { box-sizing: border-box; width: min(460px, calc(100vw - 24px)); max-width: calc(100vw - 24px); padding: 26px; border: 0; border-radius: var(--r-card); background: var(--surface); color: var(--ink); box-shadow: var(--float); }
.report-dialog::backdrop { background: rgb(22 24 29 / 0.45); }
.report-dialog h2 { margin: 0 0 14px; font-size: 1.5rem; }
.report-dialog fieldset { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; }
.report-dialog legend { margin-bottom: 8px; font-weight: 700; }
.report-dialog label { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 8px 14px; border-radius: var(--r-field); background: var(--ground); line-height: 1.3; cursor: pointer; }
.report-dialog label:has(input:checked) { background: var(--block); outline: 2px solid var(--ink); outline-offset: -2px; }
/* Radio, ported from beUI's motion radio (beui.dev, MIT, (c) 2026 Saurabh Chauhan) onto the native input, so arrow
   keys, the group's single tab stop and the form value work as before. beUI glides one dot between options with a
   shared layout animation; without script, the old dot shrinks away and the new one springs in. */
.report-dialog input {
  appearance: none; flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin: 0;
  border: 2.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); cursor: pointer;
  transition: border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.report-dialog input::before {
  content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--ink);
  transform: scale(0.4); opacity: 0; transition: transform 140ms var(--ease-out), opacity 140ms ease;
}
.report-dialog input:checked { border-color: var(--ink); }
.report-dialog input:checked::before { transform: none; opacity: 1; transition: transform 320ms var(--ease-spring), opacity 120ms ease; }
.report-dialog input:active { transform: scale(0.92); }
.report-dialog input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .report-dialog label:hover input:not(:checked) { border-color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  .report-dialog input:active { transform: none; }
  .report-dialog input::before, .report-dialog input:checked::before { transform: none; transition: opacity 120ms ease; }
}
.report-dialog p { margin: 0; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
/* Crisis lines (044): shown when a post or report looks like someone may hurt themselves. Calm, no bounce. */
.crisis { position: fixed; left: 50%; top: 16px; z-index: 60; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); display: grid; gap: 10px; justify-items: start; padding: 22px 24px; border: 3px solid var(--action-deep); border-radius: var(--r-card); background: var(--surface); color: var(--ink); box-shadow: var(--float); }
.crisis p { margin: 0; }
.crisis-title { font: 700 1.5rem/1.25 var(--font-display); }
.crisis a { color: var(--ink); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: min(92vw, 520px); padding: 14px 22px; border-radius: var(--r-field); background: var(--ink); color: #fff; font-weight: 600; box-shadow: var(--float); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity 200ms ease, transform var(--t-ui) var(--ease-spring); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 12px 18px; border-radius: var(--r-btn); background: var(--ink); color: #fff; font-weight: 700; }
.skip-link:focus { top: 12px; }

/* ---------- policies ---------- */
.legal { padding-top: 32px; padding-bottom: 72px; max-width: 760px; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.legal-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-btn); border: 2px solid var(--block-strong); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; transition: border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.legal-tabs a[aria-current='page'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.legal-tabs a:active { transform: scale(0.97); }
.legal-notice { margin: 0 0 28px; padding: 16px 20px; border-radius: var(--r-field); background: var(--block); }
.legal h2 { margin: 36px 0 10px; font-size: 1.5rem; }
.legal p, .legal li { max-width: 68ch; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--ink); font-weight: 700; text-decoration-color: var(--action); }
@media (hover: hover) and (pointer: fine) { .legal-tabs a:not([aria-current='page']):hover { border-color: var(--ink); } }

/* ---------- footer ---------- */
.footer { padding: 48px var(--gutter) 0; background: var(--ink); color: #fff; text-align: center; font-size: 1rem; overflow: hidden; }
.footer p { margin: 4px 0; }
.footer-disclaimer { max-width: 760px; margin: 0 auto 16px !important; line-height: 1.55; }
.footer-disclaimer b { font-weight: 700; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; }
.footer-btn, .footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--block-strong); font-weight: 600; text-decoration: underline; cursor: pointer; }
.footer :focus-visible { outline-color: var(--block-strong); }
@media (hover: hover) and (pointer: fine) { .footer-btn:hover, .footer-links a:hover { color: #fff; } }

.footer .footer-mark { margin: 40px 0 -0.16em; font: 700 clamp(3.5rem, 15.5vw, 15rem)/0.8 var(--font-display); letter-spacing: -0.04em; color: var(--action-deep-hover); white-space: nowrap; user-select: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .topbar-link-text { display: none; }
}
@media (max-width: 900px) {
  .tp { grid-template-columns: 1fr; gap: 36px; }
  .tp-band-inner { grid-template-columns: 1fr; }
  .tp-band-score { justify-items: start; text-align: left; }
  .hero-inner:has(.stack) { grid-template-columns: 1fr; }
  .stack { height: 420px; }
  .stack-card:nth-child(1) { --x: -10%; }
  .stack-card:nth-child(2) { --x: 10%; }
  .dept-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .board-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar-link-text { display: none; }
  .topbar .logo { font-size: 1.125rem; }
  .topbar-nav { gap: 2px; }
  .topbar-nav .btn-pill { padding: 0 12px; }
  .topbar-nav .btn-pill svg { display: none; }
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding-top: 8px; padding-bottom: 10px; }
  .topbar-search { order: 3; flex-basis: 100%; max-width: none; display: grid; grid-template-columns: 1fr 128px auto; gap: 6px; }
  .topbar-search input, .topbar-search select { width: 100%; padding: 0 14px; }
  .hero-search input { height: 60px; font-size: 1.125rem; padding-left: 52px; }
  .how-list { grid-template-columns: 1fr; }
  .dept-chips { grid-template-columns: 1fr; }
  .results-head { flex-direction: column; align-items: flex-start; gap: 0; }
  .ratings-controls { flex-wrap: wrap; }
  .t-card { grid-template-columns: 70px 1fr auto; gap: 12px; padding: 18px 8px 18px 16px; }
  .t-card .qbox { width: 64px; height: 54px; font-size: 1.5rem; }
  .t-card-stats { font-size: 1rem; }
  .t-card-stats svg { display: none; } /* no room beside the stat on one line */
  .r-card { grid-template-columns: 1fr; gap: 16px; padding: 24px 0; }
  .r-scores { grid-template-columns: auto auto; justify-content: start; gap: 16px; }
  .r-head { flex-direction: column; gap: 2px; }
  .dist-row { grid-template-columns: 92px 1fr 26px; gap: 10px; }
  .seg span { height: 54px; }
  .request-kinds { grid-template-columns: 1fr; }
}
@media (max-width: 700px) and (min-width: 480px) {
  .topbar-request .topbar-link-text { display: inline; }
}
/* Phones: the mark alone (the link keeps its "TeacherRated home" label), so logo and links share one row. */
@media (max-width: 560px) {
  .logo-word, .logo-my { display: none; }
  .logo-mark { width: 36px; height: 36px; margin-right: 0; }
}
@media (max-width: 600px) {
  .site-notice { flex-direction: column; align-items: stretch; bottom: 12px; }
  .site-notice-actions { display: flex; justify-content: flex-end; }
}
@media (max-width: 480px) {
  .edit-row { grid-template-columns: 1fr; }
  .tp-feedback > div { flex: 1 1 128px; min-width: 0; padding: 14px 16px; }
}

/* ---------- motion: everything that travels lives here, so reduced motion simply gets the finished page ---------- */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 360deg; }
@media (prefers-reduced-motion: no-preference) {
  /* Content rises in once per page visit (app.js sets .is-entering only when a new page is drawn). */
  .is-entering :is(.t-card, .r-card, .dept-chip, .board-col, .panel, .tp-feedback > div, .q-card, .how-list, .section-title, .course-table, .hero-copy > :not(h1), .tp-band-text > *, .tp-band-score, .list-band .page > *, .rate-head .page-narrow > *, .table-scroll, .page > .empty-cta) { animation: blur-rise 420ms var(--ease-out) backwards; }
  .is-entering .hero-copy > :nth-child(2) { animation-delay: 220ms; }
  .is-entering .hero-copy > :nth-child(3) { animation-delay: 290ms; }
  .is-entering .hero-copy > :nth-child(4) { animation-delay: 360ms; }
  .is-entering .hero-copy > :nth-child(5) { animation-delay: 430ms; }
  /* The headline rises out of a mask, a line at a time. Then the report cards are dealt. */
  .is-entering .hero h1 .line > span { animation: line-up 800ms var(--ease-out) backwards; }
  .is-entering .hero h1 .line + .line > span { animation-delay: 90ms; }
  .is-entering .stack-card { animation: deal 760ms var(--ease-out) backwards; }
  .is-entering .stack-card:nth-child(1) { animation-delay: 180ms; }
  .is-entering .stack-card:nth-child(2) { animation-delay: 300ms; }
  .is-entering .stack-card:nth-child(3) { animation-delay: 420ms; }
  .is-entering .stack-bars i { animation: grow-y 600ms var(--ease-out) 700ms backwards; }
  .is-entering .stack .qbox::before { animation-delay: 800ms; }
  .is-entering :is(.tp-band-score, .rate-head p, .list-band .page > :nth-child(2)) { animation-delay: 80ms; }
  .is-entering .list-band .page > :nth-child(3) { animation-delay: 140ms; }
  /* A picked answer lands with a small bounce. */
  .seg.picked span, :is(.yesno, .tag-picker) input:checked + span { animation: pick 320ms var(--ease-spring); }
  .marquee-track { animation: marquee 50s linear infinite; }
  /* Pages cross-fade. The clicked grade travels to the teacher page (app.js), and the top bar holds still. */
  ::view-transition-old(root) { animation: fade-out 120ms ease both; }
  ::view-transition-new(root) { animation: fade-in 240ms ease both; }
  ::view-transition-group(grade) { animation-duration: 460ms; animation-timing-function: cubic-bezier(0.77, 0, 0.175, 1); }
  ::view-transition-group(topbar) { animation: none; }
  /* A red pen line under the top bar that follows how far you have read. */
  @supports (animation-timeline: scroll()) {
    .topbar::after { content: ''; position: absolute; inset: auto 0 -2px; height: 2px; background: var(--action); transform-origin: left; animation: progress linear both; animation-timeline: scroll(root); }
  }
  /* Grades are circled as a pen would: the ring sweeps round from the top left. */
  .is-entering :is(.qbox:not(.suggest-score), .tp-score, .sbox)::before { mask: conic-gradient(from -50deg, #000 var(--sweep), #0000 0); animation: draw 640ms var(--ease-out) 160ms backwards; }
  .is-entering .flap { animation: flap 340ms var(--ease-out) backwards; animation-delay: calc(520ms + var(--i) * 70ms); }
  .is-entering :is(.t-card, .r-card, .dept-chip, .board-col, .panel, .tp-feedback > div, .q-card):nth-child(2) { animation-delay: 40ms; }
  .is-entering :is(.t-card, .r-card, .dept-chip, .board-col, .panel, .tp-feedback > div, .q-card):nth-child(3) { animation-delay: 80ms; }
  .is-entering :is(.t-card, .r-card, .dept-chip, .board-col, .panel, .tp-feedback > div, .q-card):nth-child(n + 4) { animation-delay: 120ms; }
  .dist-bar, .board-bar { animation: grow 600ms var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 50ms); }
  /* Below the fold, the entrance waits until the content scrolls into view (app.js revealOnScroll). */
  .is-entering .wait, .is-entering .wait :is(.qbox, .sbox)::before, .is-entering .wait :is(.dist-bar, .board-bar) { animation-play-state: paused; }
  .pixels i { animation: pixel 1.26s linear infinite both; }
  .pixels i:nth-child(1) { animation-delay: 0ms; }
  .pixels i:nth-child(2) { animation-delay: 140ms; }
  .pixels i:nth-child(3) { animation-delay: 280ms; }
  .pixels i:nth-child(6) { animation-delay: 420ms; }
  .pixels i:nth-child(9) { animation-delay: 560ms; }
  .pixels i:nth-child(8) { animation-delay: 700ms; }
  .pixels i:nth-child(7) { animation-delay: 840ms; }
  .pixels i:nth-child(4) { animation-delay: 980ms; }
  .pixels i:nth-child(5) { animation-delay: 1120ms; }
  .loader-text { background: linear-gradient(90deg, var(--ink-soft) 40%, var(--ink) 50%, var(--ink-soft) 60%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }
  .skel i { animation: skel-pulse 1.4s ease-in-out infinite; }
  .suggest { animation: menu-in 170ms var(--ease-out); }
  .report-dialog[open] { animation: rise-in 220ms var(--ease-out); }
  .report-dialog[open]::backdrop { animation: fade-in 200ms ease; }
  .crisis { animation: crisis-in 300ms var(--ease-out) backwards; }
  .site-notice { animation: notice-in 320ms var(--ease-out) backwards; }
  .form-error:not([hidden]) { animation: nudge 360ms var(--ease-out); }
  .r-card.is-target { animation: review-flash 1.6s ease 2; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transform: translate(-50%, 0); transition: opacity 200ms ease; }
  .btn:disabled::after { animation-duration: 1.6s; }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes blur-rise { from { opacity: 0; transform: translateY(8px); filter: blur(6px); } }
@keyframes flap { from { opacity: 0; transform: perspective(240px) rotateX(-90deg); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes draw { from { --sweep: 0deg; } }
@keyframes line-up { from { transform: translateY(115%); } }
@keyframes deal { from { opacity: 0; transform: translate(-50%, 70%) rotate(16deg); } }
@keyframes pick { from { transform: scale(0.9); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pixel { 0%, 100% { opacity: 0.18; } 12% { opacity: 1; background: var(--action); } 40% { opacity: 0.18; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }
@keyframes skel-pulse { 50% { opacity: 0.5; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes crisis-in { from { opacity: 0; transform: translate(-50%, -8px); } }
@keyframes notice-in { from { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes nudge { 25% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }
@keyframes review-flash { 50% { background: var(--block-strong); } }
