/* Residency Roadmap
 * Palette from the R.MAP mark: forest + sage on a cool clinical off-white.
 * Red and amber are reserved for report flags. */
:root {
  --forest: #1D4434;
  --forest-deep: #143226;
  --forest-hover: #24533F;
  --sage: #7E9F6B;
  --sage-soft: #E7EEE2;
  --sage-wash: #F0F4EE;
  --paper: #F4F6F3;
  --surface: #FFFFFF;
  --ink: #17221C;
  --muted: #5A6A61;
  --rule: #D9E1DB;
  --rule-strong: #B8C5BC;
  --red: #B42318;
  --red-soft: #FCEBE9;
  --amber: #8A5300;
  --amber-soft: #FDF1DB;

  --serif: 'IBM Plex Sans', 'Public Sans', system-ui, sans-serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-s: 0;
  --radius-m: 0;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; scroll-padding-bottom: 96px; }
a, button, label, select, summary, input { touch-action: manipulation; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: 'tnum' 0;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--forest); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--forest-hover); }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { font-family: var(--serif); text-transform: uppercase; letter-spacing: 0.02em; }
h1, h2 { font-weight: 700; color: var(--forest-deep); }
h1 { text-wrap: balance; font-size: clamp(2.35rem, 5.2vw, 3.6rem); line-height: 1.08; letter-spacing: 0.005em; }
h2 { text-wrap: balance; font-size: clamp(1.55rem, 2.6vw, 2rem); line-height: 1.18; letter-spacing: 0.02em; }
h3 { font-size: 1.0625rem; line-height: 1.35; font-weight: 600; }
p { max-width: 68ch; }
.muted { color: var(--muted); font-weight: 400; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 0; }
h1[tabindex="-1"]:focus { outline: none; }
.skip-link { position: absolute; left: 12px; top: -80px; background: var(--forest); color: #fff; padding: 12px 16px; border-radius: 0; z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 0;
  font: 600 0.9375rem/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-hover); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; border-color: var(--rule-strong); color: var(--forest); }
.btn-ghost:hover { border-color: var(--forest); }
.btn-light { background: #fff; color: var(--forest-deep); }
.btn-light:hover { background: var(--sage-soft); color: var(--forest-deep); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 0.875rem; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--rule); backdrop-filter: saturate(1.4) blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; color: var(--forest-deep); }
.brand img { height: 28px; width: auto; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.1875rem; letter-spacing: -0.005em; padding-left: 12px; border-left: 1px solid var(--rule); line-height: 28px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
.site-nav a:hover { color: var(--forest); text-decoration: underline; }
.menu-toggle { display: none; background: none; border: 1px solid var(--rule-strong); border-radius: 0; font: 600 0.875rem var(--sans); color: var(--ink); min-height: 44px; padding: 0 14px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); gap: 64px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.hero-copy h1 { max-width: 18ch; font-size: clamp(2rem, 4.6vw, 3.25rem); }
.hero-at { color: var(--sage); white-space: nowrap; }
.lede { font-size: 1.1875rem; line-height: 1.6; color: #2E3B34; margin-top: 24px; max-width: 54ch; }
.hero-figure { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--muted); max-width: 54ch; }
.hero-figure strong { color: var(--forest-deep); font-weight: 600; }

.finder { background: var(--paper); border: 1px solid var(--rule); border-radius: 0; padding: 32px; display: grid; gap: 16px; }
.finder-title { font-size: 1.375rem; }
.finder-note { font-size: 0.875rem; color: var(--muted); line-height: 1.5; }

.field { display: grid; gap: 6px; }
.field-label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
select, input[type="search"], input[type="text"], input[type="number"], textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: 400 1rem/1.4 var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 0;
}
select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231D4434' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select:disabled { background-color: var(--sage-wash); color: var(--muted); cursor: not-allowed; }
select:hover:not(:disabled), input:hover, textarea:hover { border-color: var(--muted); }
select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--forest); outline-offset: 0; border-color: var(--forest); }
textarea { resize: vertical; min-height: 96px; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 28px; }
.section-head p { color: var(--muted); margin-top: 8px; }
.section-head-tight { margin-bottom: 16px; align-items: baseline; }
.section-head-tight p { margin-top: 0; font-size: 0.9375rem; }

.how-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; align-items: start; }
.how-copy p { margin-top: 16px; color: #2E3B34; }
.plain-list { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.plain-list li { padding-left: 22px; position: relative; max-width: 56ch; }
.plain-list li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 8px; height: 8px; border-radius: 0; border: 2px solid var(--sage); }

/* ---------- Report (signature element) ---------- */
.report { background: var(--surface); border: 1px solid var(--rule); border-radius: 0; overflow: hidden; }
.report-caption { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--rule); font-size: 0.875rem; font-weight: 600; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.report-table th, .report-table td { padding: 12px 20px; text-align: left; vertical-align: middle; }
.report-table td { border-top: 1px solid var(--rule); }
.report-table thead th { font-size: 0.8125rem; font-weight: 600; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--rule-strong); padding-top: 12px; padding-bottom: 10px; }
.report-table .num { text-align: right; }
.report-table thead th:nth-child(3) { width: 34%; }
.report-table td.num { font-size: 1rem; font-weight: 500; }
.report-table .abn { color: var(--red); font-weight: 700; }
.report-table .abn-low { color: var(--amber); font-weight: 700; }
.panel-row th { background: var(--sage-wash); color: var(--forest-deep); font-family: var(--serif); font-weight: 600; font-size: 1rem; padding-top: 8px; padding-bottom: 8px; border-top: 1px solid var(--rule); }
.report-table tbody tr:first-child th { border-top: 0; }
.report-table tr.pending td:first-child { color: var(--muted); }
.n-col { color: var(--muted); width: 3.5rem; }
.report-table td.n-col { font-size: 0.875rem; font-weight: 400; }

/* Gauge: 1–10 track. The tinted band is the unflagged range, like a reference interval. */
.gauge { position: relative; display: block; height: 8px; border-radius: 0; background: var(--rule); max-width: 240px; }
.gauge::before { content: ''; position: absolute; top: 0; bottom: 0; left: 33.3%; right: 0; background: var(--sage-soft); border-radius: 0; box-shadow: inset 0 0 0 1px #CFDDC8; }
.gauge-inverse::before { left: 0; right: 33.3%; border-radius: 0; }
.gauge-mark { position: absolute; top: 50%; width: 4px; height: 18px; margin-left: -2px; transform: translateY(-50%); background: var(--forest); border-radius: 0; box-shadow: 0 0 0 2px var(--surface); }
.flag { display: inline-block; padding: 2px 8px; border-radius: 0; font-size: 0.8125rem; font-weight: 700; line-height: 1.4; }
.flag-high { background: var(--red-soft); color: var(--red); }
.flag-low { background: var(--amber-soft); color: var(--amber); }

.report-answers { border-top: 1px solid var(--rule-strong); padding: 20px; }
.report-answers h3 { font-family: var(--serif); font-size: 1rem; color: var(--forest-deep); margin-bottom: 12px; }
.report-answers dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 28px; }
.report-answers dt { font-size: 0.8125rem; color: var(--muted); }
.report-answers dd { font-weight: 600; }
.report-answers dd .muted { font-weight: 400; font-size: 0.875rem; margin-left: 4px; }

/* ---------- Seat matrix ---------- */
.section-matrix { background: var(--surface); }
.matrix-total { color: var(--muted); text-align: right; font-size: 0.9375rem; white-space: nowrap; }
.matrix-total strong { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1.1; color: var(--forest-deep); font-weight: 600; font-variant-numeric: tabular-nums; }
.filters { display: grid; grid-auto-flow: row dense; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.filters .field-search, .filters .field-college, .filters .field-branch { grid-column: span 3; }
.btn-more { margin-top: 14px; }
.data-table tr.state-row th { position: static; background: var(--surface); color: var(--forest-deep); font-family: var(--serif); font-size: 1.0625rem; font-weight: 600; padding: 18px 16px 8px; border-bottom: 1px solid var(--rule-strong); }
.data-table tbody tr.state-row:first-child th { padding-top: 12px; }
.data-table tr.state-row + tr.group-start td { border-top: 0; }
.table-scroll { max-height: 68vh; overflow: auto; border: 1px solid var(--rule); border-radius: 0; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.data-table .college-col { width: 38%; }
.data-table th { position: sticky; top: 0; z-index: 1; background: var(--sage-wash); text-align: left; font-size: 0.8125rem; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--rule-strong); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #FAFBF9; }
.data-table td a { font-weight: 500; text-decoration: none; color: var(--ink); }
.data-table td a:hover { color: var(--forest); text-decoration: underline; }
.data-table .num { font-weight: 600; color: var(--forest-deep); }
.col-code { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-type { color: var(--muted); }
.cell-sub { display: block; font-size: 0.8125rem; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.college-cell { font-weight: 600; }
.data-table tr.group-start td { border-top: 1px solid var(--rule-strong); }
.data-table tbody tr.group-start:first-child td { border-top: 0; }
.data-table tr.cont td { border-bottom-color: #EEF2EF; }
.empty-cell { text-align: center; color: var(--muted); padding: 40px 16px !important; }
.source-note { margin-top: 14px; font-size: 0.875rem; color: var(--muted); max-width: 90ch; }

/* ---------- Contribute band ---------- */
.contribute { background: var(--forest); color: #E8F0E9; }
.contribute-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding-top: 56px; padding-bottom: 56px; }
.contribute h2 { color: #fff; }
.contribute p { margin-top: 10px; color: #C9D8CD; max-width: 58ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 40px 0 48px; font-size: 0.875rem; color: var(--muted); }
.footer-inner { display: grid; gap: 12px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 1.0625rem; color: var(--forest-deep); }
.footer-brand img { height: 22px; width: auto; }
.footer-meta a { color: var(--muted); }

/* ---------- Department page ---------- */
.detail { padding: 28px 0 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.875rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.dept-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding: 28px 0 32px; }
.dept-title h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
.dept-college { font-family: var(--serif); font-size: clamp(1.15rem, 2vw, 1.4rem); color: #2E3B34; margin-top: 8px; }
.dept-meta { margin-top: 12px; font-size: 0.9375rem; color: var(--muted); }
.dept-actions { display: flex; gap: 10px; flex-shrink: 0; }

.summary { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--rule); border-radius: 0; }
.summary > div { padding: 20px 24px; }
.summary > div + div { border-left: 1px solid var(--rule); }
.summary dt { font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.summary dd { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.2; color: var(--forest-deep); margin-top: 4px; font-variant-numeric: tabular-nums; }
.summary dd small { font-size: 1rem; color: var(--muted); font-weight: 500; margin-left: 2px; }
.summary dd.sub { font-family: var(--sans); font-size: 0.8125rem; font-weight: 400; color: var(--muted); line-height: 1.4; margin-top: 2px; }

.notice { margin-top: 16px; padding: 16px 20px; border-radius: 0; background: var(--amber-soft); color: #4D3200; font-size: 0.9375rem; border-left: 3px solid #D08B1E; }
.notice-preview { background: var(--sage-wash); color: #2E3B34; border-left-color: var(--sage); }
.notice p { max-width: none; }

.section-tight { padding-top: 56px; }

/* Reviews */
.reviews { display: grid; gap: 16px; }
.review { background: var(--surface); border: 1px solid var(--rule); border-radius: 0; padding: 24px; }
.review-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.review-head h3 { text-transform: none; letter-spacing: 0; font-family: var(--serif); font-size: 1.25rem; color: var(--forest-deep); }
.review-meta { font-size: 0.875rem; color: var(--muted); margin-top: 4px; }
.review-index { white-space: nowrap; color: var(--muted); font-size: 0.875rem; }
.review-index strong { font-family: var(--serif); font-size: 1.5rem; color: var(--forest-deep); font-variant-numeric: tabular-nums; }
.review-scores { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 0.875rem; color: var(--muted); }
.review-scores strong { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 4px; }
.review-block { margin-top: 16px; }
.review-block h4 { font-size: 0.875rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.review > p { margin-top: 16px; }
.review-details { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 14px; }
.review-details summary { cursor: pointer; font-weight: 600; font-size: 0.9375rem; color: var(--forest); }
.review-details dl { display: grid; gap: 10px; margin-top: 14px; }
.review-details dl > div { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; font-size: 0.875rem; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.review-details dt { color: var(--muted); }
.review-details dd { font-weight: 600; }

.empty { background: var(--surface); border: 1px dashed var(--rule-strong); border-radius: 0; padding: 32px; }
.empty h3 { font-family: var(--serif); font-size: 1.25rem; color: var(--forest-deep); }
.empty p { color: var(--muted); margin: 8px 0 20px; }

/* ---------- Survey ---------- */
.survey-section { margin-top: 72px; padding: 56px 0 72px; border-top: 1px solid var(--rule-strong); display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: 56px; align-items: start; }
.survey-intro { position: sticky; top: 96px; }
.survey-intro p { margin-top: 14px; color: #2E3B34; }
.guideline { font-size: 0.875rem; color: var(--muted) !important; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 0; }

.survey { background: var(--surface); border: 1px solid var(--rule); border-radius: 0; }
.survey-part { padding: 32px 32px 8px; }
.survey-part + .survey-part { border-top: 1px solid var(--rule); }
.survey-part-head { display: flex; gap: 14px; align-items: baseline; margin-bottom: 20px; }
.part-num { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 0; border: 1px solid var(--sage); color: var(--forest); font-weight: 600; font-size: 0.875rem; font-variant-numeric: tabular-nums; transform: translateY(-2px); }
.survey-part-head h3 { font-family: var(--serif); font-size: 1.3rem; color: var(--forest-deep); }
.survey-part-head p { font-size: 0.875rem; color: var(--muted); margin-top: 2px; }

.q { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
.q > legend, .q > label { display: block; font-weight: 600; font-size: 0.9875rem; line-height: 1.45; margin-bottom: 10px; padding: 0; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.8125rem; margin-left: 6px; }
.hint { font-size: 0.8125rem; color: var(--muted); margin-top: 6px; }
.q.missing { padding-left: 14px; border-left: 3px solid var(--red); }
.q.missing > legend, .q.missing > label { color: var(--red); }
.q-error { margin-top: 8px; font-size: 0.875rem; font-weight: 600; color: var(--red); }
.q-error::before { content: '! '; }
.draft-note { margin-top: 16px !important; padding: 12px 16px; font-size: 0.875rem; background: var(--sage-wash); border-left: 3px solid var(--sage); border-radius: 0; color: #2E3B34; }
.link-button { background: none; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: 600; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; max-width: 520px; }
.scale label, .choices label { position: relative; cursor: pointer; }
.scale input, .choices input, .q-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale span { display: grid; place-items: center; height: 44px; border: 1px solid var(--rule-strong); border-radius: 0; font-weight: 600; font-size: 0.9375rem; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--surface); transition: background-color .12s, border-color .12s, transform .1s; }
.scale label:active span, .choices label:active span { transform: scale(0.96); }
.scale label:hover span, .choices label:hover span { border-color: var(--forest); }
.scale input:checked + span { background: var(--forest); border-color: var(--forest); color: #fff; }
.scale input:focus-visible + span, .choices input:focus-visible + span, .q-toggle input:focus-visible + span { outline: 2px solid var(--forest); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; gap: 16px; max-width: 520px; margin-top: 6px; font-size: 0.8125rem; color: var(--muted); }
.scale-ends span:last-child { text-align: right; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices span { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--rule-strong); border-radius: 0; font-size: 0.9375rem; background: var(--surface); line-height: 1.3; transition: background-color .12s, border-color .12s; }
.choices input:checked + span { background: var(--sage-soft); border-color: var(--forest); color: var(--forest-deep); font-weight: 600; box-shadow: inset 0 0 0 1px var(--forest); }

.input-suffix { display: inline-flex; align-items: center; gap: 10px; }
.input-suffix input { width: 120px; }
.input-suffix span { color: var(--muted); font-size: 0.9375rem; }

.q-toggle label { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 600; }
.q-toggle span::before { content: ''; display: inline-block; vertical-align: middle; width: 40px; height: 24px; margin-right: 12px; border-radius: 0; background: var(--rule-strong); transition: background-color .15s; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.q-toggle span { position: relative; display: inline-flex; align-items: center; }
.q-toggle span::after { content: ''; position: absolute; left: 3px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 0; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(20,50,38,.3); }
.q-toggle input:checked + span::before { background: var(--forest); }
.q-toggle input:checked + span::after { transform: translateX(16px); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.submit-bar { position: sticky; bottom: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 16px 32px; background: rgba(255,255,255,.97); border-top: 1px solid var(--rule-strong); border-radius: 0; }
.progress { font-size: 0.875rem; color: var(--muted); }
.progress strong { color: var(--forest-deep); font-variant-numeric: tabular-nums; }
.form-status { font-size: 0.875rem; color: var(--forest); }
.form-status.error { color: var(--red); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: min(92vw, 460px); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--forest-deep); color: #fff; padding: 12px 18px; border-radius: 0; font-size: 0.9375rem; transition: opacity .15s ease-in, transform .15s ease-in; }
.toast.show { opacity: 1; transform: translate(-50%, 0); transition-duration: .24s; transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .how-grid, .survey-section { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-grid { padding-top: 48px; padding-bottom: 56px; }
  .survey-intro { position: static; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field-search, .filters .field-college, .filters .field-branch { grid-column: 1 / -1; }
  .filters .field-sort { grid-column: 1 / -1; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary > div:nth-child(3) { border-left: 0; }
  .summary > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .dept-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .menu-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; background: #fff; border-bottom: 1px solid var(--rule); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .site-nav .btn { margin-top: 12px; min-height: 44px; }
  .brand-name { font-size: 1.0625rem; }
  .section { padding: 56px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .matrix-total { text-align: left; }
  .filters { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filters .field-search, .filters .field-college, .filters .field-branch { grid-column: 1 / -1; }
  .col-type { display: none; }
  .data-table .college-col { width: 40%; }
  .data-table th.num { width: 3rem; }
  .data-table td { overflow-wrap: anywhere; }
  .data-table th.num, .data-table td.num { padding-left: 4px; }
  .data-table th, .data-table td { padding-left: 10px; padding-right: 10px; }
  .matrix-total strong { font-size: 1.6rem; }
  .data-table th, .data-table td { padding: 10px 12px; }
  .contribute-inner { flex-direction: column; align-items: flex-start; gap: 24px; }
  .report-table th, .report-table td { padding-left: 14px; padding-right: 14px; }
  .report-table .n-col { display: none; }
  .report-table thead th:nth-child(3) { width: 26%; }
  .report-table th, .report-table td { padding-left: 12px; padding-right: 12px; }
  .report-table th:nth-child(4), .report-table td:nth-child(4) { padding-left: 4px; }
  .gauge { min-width: 52px; }
  .dept-actions { width: 100%; }
  .dept-actions .btn { flex: 1; }
  .survey-part { padding: 24px 16px 4px; }
  .submit-bar { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .form-status { grid-column: 1 / -1; grid-row: 2; }
  .scale { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .scale span { height: 44px; font-size: 0.9375rem; }
  .review { padding: 18px; }
  .review-details dl > div { grid-template-columns: 1fr; gap: 2px; }
  .finder { padding: 20px; }
}

@media (max-width: 340px) {
  .report-table td:nth-child(3), .report-table th:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Write-a-review bar ---------- */
.cta-bar { background: var(--paper); border-bottom: 1px solid var(--rule); padding: 16px 0; }
.flip { transform-origin: center; }
.flip-front {
  width: 100%; min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--forest); color: #fff; border: 0; cursor: pointer; padding: 16px 24px;
  font: 700 clamp(1.35rem, 3vw, 1.9rem)/1.1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  transition: background-color .15s ease, transform .1s ease;
}
.flip-front { position: relative; animation: frontGlow 2.2s ease-in-out infinite; }
.flip-front:hover { background: var(--forest-hover); }
.flip-front-click {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.55); font: 700 0.8125rem/1.3 var(--serif); letter-spacing: 0.14em; color: #fff;
}
.flip-front:hover .flip-front-click { background: #fff; color: var(--forest-deep); }
@keyframes frontGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(126, 159, 107, 0), 0 0 0 0 rgba(208, 139, 30, 0); }
  50% { box-shadow: 0 0 0 3px rgba(126, 159, 107, 0.75), 0 0 32px 6px rgba(208, 139, 30, 0.45); }
}
.flip-front:active { transform: scale(0.995); }
.flip-front-sub { font: 400 0.9375rem/1.4 var(--sans); letter-spacing: 0; text-transform: none; color: #C9D8CD; }
.flip-back {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; gap: 12px; align-items: end;
  background: var(--surface); border: 2px solid var(--forest); padding: 16px 20px;
}
.flip-back[hidden] { display: none; }
.cta-hint { grid-column: 1 / -1; font-size: 0.875rem; color: var(--muted); margin-top: -2px; }
.cta-write {
  min-width: 128px; background: var(--rule); color: var(--muted); border: 1px solid var(--rule-strong);
  font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase; cursor: not-allowed;
}
.cta-write.ready { background: var(--forest); color: #fff; border-color: var(--forest); cursor: pointer; animation: glow 1.4s ease-in-out infinite; transition: none; }
.cta-write.ready:hover { background: var(--forest-hover); }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(126, 159, 107, 0.0), 0 0 0 0 rgba(208, 139, 30, 0.0); }
  50% { box-shadow: 0 0 0 4px rgba(126, 159, 107, 0.7), 0 0 28px 8px rgba(208, 139, 30, 0.55); }
}
.cta-close { min-height: 44px; padding: 0 14px; background: transparent; border: 1px solid var(--rule-strong); color: var(--ink); font: 600 0.875rem var(--sans); cursor: pointer; }
.cta-close:hover { border-color: var(--forest); }

/* ---------- Profile chip + dialog ---------- */
.profile-chip { display: inline-flex; align-items: stretch; min-height: 44px; padding: 0; border: 1px solid var(--forest); background: var(--surface); cursor: pointer; font: 600 0.8125rem var(--sans); }
.chip-level { display: inline-flex; align-items: center; padding: 0 12px; background: var(--forest); color: #fff; }
.chip-points { display: inline-flex; align-items: center; padding: 0 12px; color: var(--forest-deep); font-variant-numeric: tabular-nums; }
.profile { width: min(560px, calc(100vw - 32px)); border: 2px solid var(--forest); padding: 24px; color: var(--ink); background: var(--surface); }
.profile::backdrop { background: rgba(20, 50, 38, 0.45); }
.profile-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-head h2 { font-size: 1.4rem; }
.profile-note { font-size: 0.8125rem; color: var(--muted); margin-top: 16px; }
.badges-title { font-family: var(--serif); color: var(--forest-deep); margin: 20px 0 10px; }

/* ---------- Game: progress, tiers, sections, badges ---------- */
.progress { min-width: 0; }
.progress-top { display: flex; justify-content: space-between; gap: 12px; font-size: 0.875rem; color: var(--muted); }
.progress-top strong { color: var(--forest-deep); font-variant-numeric: tabular-nums; }
.pts { display: inline-block; color: var(--forest-deep); }
.progress-track { height: 8px; background: var(--rule); margin: 6px 0; position: relative; overflow: hidden; }
.progress-track > span { position: absolute; inset: 0 auto 0 0; background: var(--sage); transition: width .3s cubic-bezier(0.22, 1, 0.36, 1); }
.tier { display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; padding: 2px 8px; border: 1px solid var(--rule-strong); color: var(--muted); }
.tier-complete { border-color: var(--sage); color: var(--forest); }
.tier-detailed { background: var(--sage-soft); border-color: var(--forest); color: var(--forest-deep); }
.tier-gold { background: var(--amber-soft); border-color: #D08B1E; color: #6B4200; }
.submit-bar { grid-template-columns: minmax(0, 1fr) auto; }
.submit-bar .form-status { grid-column: 1 / -1; grid-row: 2; }
.submit-bar .form-status:empty { display: none; }
.part-num.done { background: var(--forest); border-color: var(--forest); color: #fff; }

.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 12px; border: 1px dashed var(--rule-strong); background: var(--paper); }
.badge-mark { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--rule-strong); color: transparent; }
.badge-name { font-weight: 700; font-size: 0.875rem; color: var(--muted); }
.badge-how { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }
.badge.earned { border: 1px solid var(--forest); background: var(--sage-wash); }
.badge.earned .badge-mark { background: var(--forest); border-color: var(--forest); color: #fff; }
.badge.earned .badge-name { color: var(--forest-deep); }

.level { margin-top: 16px; }
.level-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 0.875rem; }
.level-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--forest-deep); }
.level .progress-track { height: 10px; }
.level p { font-size: 0.875rem; }

.survey-done { background: var(--surface); border: 2px solid var(--forest); padding: 32px; }
.survey-done:focus { outline: none; }
.survey-done h3 { font-family: var(--serif); font-size: 1.75rem; color: var(--forest-deep); }
.survey-done > p { color: var(--muted); margin-top: 6px; }
.survey-done h4 { font-size: 0.875rem; color: var(--muted); margin: 20px 0 8px; }
.done-stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule); margin-top: 20px; }
.done-stats > div { padding: 16px 20px; }
.done-stats > div + div { border-left: 1px solid var(--rule); }
.done-stats dt { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.done-stats dd { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; color: var(--forest-deep); }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.unclaimed { display: inline-block; margin-bottom: 10px; padding: 2px 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; background: var(--amber-soft); color: #6B4200; border: 1px solid #D08B1E; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti span { position: absolute; display: block; }

@media (max-width: 960px) {
  .flip-back { grid-template-columns: 1fr 1fr; }
  .flip-back .field:first-child { grid-column: 1 / -1; }
  .flip-back .field:nth-child(2), .flip-back .field:nth-child(3) { grid-column: 1 / -1; }
  .cta-write { grid-column: 1; }
}
@media (max-width: 760px) {
  .cta-bar { padding: 12px 0; }
  .flip-front { min-height: 76px; }
  .flip-front-sub { font-size: 0.8125rem; }
  .flip-back { padding: 16px; }
  .site-nav .profile-chip { margin-top: 12px; align-self: flex-start; }
  .survey-done { padding: 20px 16px; }
  .done-stats dd { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cta-write.ready { animation: none; box-shadow: 0 0 0 4px rgba(126, 159, 107, 0.55); }
  .flip-front { animation: none; box-shadow: 0 0 0 3px rgba(126, 159, 107, 0.6), 0 0 24px 4px rgba(208, 139, 30, 0.35); }
}
@media (max-width: 760px) {
  .progress-top { font-size: 0.8125rem; white-space: nowrap; }
  .submit-bar { gap: 12px; }
}

.review-code { display: inline-block; padding: 0 6px; margin-right: 4px; border: 1px solid var(--rule-strong); color: var(--forest-deep); font-weight: 600; font-variant-numeric: tabular-nums; }
.done-code { margin-top: 12px !important; padding: 12px 16px; border: 1px solid var(--forest); background: var(--sage-wash); color: var(--ink) !important; }
.done-code strong { font-variant-numeric: tabular-nums; font-size: 1.1rem; }

/* ---------- Admin ---------- */
.btn-danger { background: var(--surface); color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-danger.armed { background: var(--red); color: #fff; }
.admin-main { padding-top: 32px; padding-bottom: 64px; }
.admin-account { display: flex; align-items: center; gap: 12px; font-size: 0.875rem; }
.admin-panel { max-width: 640px; }
.admin-panel h1 { font-size: 2rem; margin-bottom: 16px; }
.admin-login form { display: grid; gap: 16px; max-width: 400px; background: var(--surface); border: 1px solid var(--rule); padding: 24px; }
.admin-login .form-status { color: var(--red); font-weight: 600; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.admin-tabs { display: flex; border: 1px solid var(--forest); }
.admin-tab { min-height: 44px; padding: 0 18px; border: 0; background: var(--surface); color: var(--forest-deep); font: 600 0.9375rem var(--sans); cursor: pointer; }
.admin-tab + .admin-tab { border-left: 1px solid var(--forest); }
.admin-tab[aria-selected="true"] { background: var(--forest); color: #fff; }
.admin-search { min-width: min(100%, 340px); }
.admin-summary { margin: 16px 0 12px; font-size: 0.875rem; }
.admin-list { display: grid; gap: 12px; }
.admin-card { background: var(--surface); border: 1px solid var(--rule); padding: 20px 24px; }
.admin-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.admin-code { font-size: 1.05rem; padding: 4px 10px; border-color: var(--forest); }
.admin-card-title h2 { font-family: var(--serif); font-size: 1.2rem; color: var(--forest-deep); }
.admin-card-title p { font-size: 0.875rem; margin-top: 2px; }
.admin-actions { display: flex; gap: 8px; }
.admin-card .review-block h3 { font-size: 0.875rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
code { font-size: 0.9em; background: var(--sage-wash); padding: 1px 4px; }
@media (max-width: 760px) {
  .admin-card { padding: 16px; }
  .admin-card-head { grid-template-columns: auto minmax(0, 1fr); }
  .admin-actions { grid-column: 1 / -1; }
  .admin-actions .btn { flex: 1; }
  .admin-account .muted { display: none; }
}

@media (max-width: 420px) {
  .brand-name { display: none; }
  .brand img { height: 26px; }
}

/* ---------- Summary card ---------- */
.card-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
.card-preview { background: var(--paper); border: 1px solid var(--rule); display: grid; place-items: center; min-height: 200px; }
.card-preview img { display: block; width: 100%; height: auto; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.card-actions .btn { flex: 1 1 auto; }
.card-status { margin-top: 10px; font-size: 0.875rem; color: var(--forest); min-height: 1.2em; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .dept-actions { flex-wrap: wrap; }
  .dept-actions .btn { flex: 1 1 40%; }
  .dept-actions #mapLink { order: 1; }
  .dept-actions #cardButton { order: 2; flex-basis: 100%; }
}

/* ---------- Specialty questionnaires ---------- */
.survey-length { font-size: 0.9375rem; color: var(--forest-deep) !important; font-weight: 600; }
.q-hint { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.q-multi .choices span { gap: 8px; }
.q-multi .choices span::before { content: ''; flex: none; width: 14px; height: 14px; border: 1.5px solid var(--rule-strong); background: var(--surface); }
.q-multi .choices input:checked + span::before { background: var(--forest); border-color: var(--forest); box-shadow: inset 0 0 0 2px var(--surface); }
.q-grid .grid-row { padding: 12px 0 14px; border-top: 1px solid var(--rule); }
.q-grid .grid-row:first-of-type { border-top: 0; padding-top: 4px; }
.grid-label { font-size: 0.9375rem; font-weight: 500; margin-bottom: 8px; }
.q-grid .choices span { min-height: 40px; padding: 6px 12px; font-size: 0.875rem; }
.scale-11 { grid-template-columns: repeat(11, minmax(0, 1fr)); max-width: 572px; }
.scale-11 + .scale-ends { max-width: 572px; }

.report-findings { border-top: 1px solid var(--rule-strong); }
.report-findings > summary { cursor: pointer; padding: 16px 20px; font-family: var(--serif); font-weight: 600; font-size: 1rem; color: var(--forest-deep); list-style-position: inside; }
.report-findings > summary .muted { font-family: var(--sans); font-size: 0.8125rem; font-weight: 400; margin-left: 6px; }
.findings { list-style: none; margin: 0; padding: 0 20px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 32px; }
.finding { padding: 12px 0; border-top: 1px solid var(--rule); }
.finding-q { font-size: 0.8125rem; color: var(--muted); line-height: 1.45; }
.finding-a { margin-top: 4px; font-size: 0.9375rem; }
.finding-a .muted { font-size: 0.8125rem; }
.finding-next { display: block; font-size: 0.8125rem; color: var(--muted); }
.finding-chip { display: inline-block; margin: 2px 6px 2px 0; padding: 1px 8px; border: 1px solid var(--rule-strong); font-size: 0.8125rem; }
.finding-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.finding-rows li { font-size: 0.875rem; }
.finding-rows li > span:first-child { display: block; font-size: 0.8125rem; color: var(--muted); }
@media (max-width: 760px) {
  .scale.scale-11 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .findings { grid-template-columns: 1fr; padding: 0 14px 8px; }
  .report-findings > summary { padding: 14px; }
}

/* ---------- List pages ---------- */
.list-note { margin: 4px 0 20px; max-width: 70ch; }
.list-table-wrap { max-height: none; }
.list-table td a { font-weight: 600; }
.list-table .num { text-align: right; white-space: nowrap; }
.list-foot { font-size: 0.875rem; margin-top: 12px; }
@media (max-width: 760px) {
  .list-table .col-type, .list-table th:nth-child(2) { display: none; }
  .list-table th, .list-table td { padding: 10px 8px; }
  .hero-copy h1 { font-size: 1.85rem; }
}

/* ---------- Preference list ---------- */
.pref-controls {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px 20px; align-items: end;
  margin-top: 24px; padding: 20px; background: var(--surface); border: 1px solid var(--rule-strong);
}
.pref-college-field, .pref-branch-field { grid-column: span 1; }
.pref-add { min-height: 48px; grid-column: 1 / -1; justify-self: start; min-width: 200px; }
.quota-switch { border: 0; margin: 0; padding: 0; min-width: 0; }
.quota-switch legend { padding: 0; margin-bottom: 6px; }
.quota-options { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--forest); }
.quota-options label { position: relative; cursor: pointer; display: flex; }
.quota-options label > span { flex: 1; }
.quota-options input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.quota-options span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; min-height: 52px; padding: 8px 12px; font-size: 0.875rem; color: var(--forest-deep); background: var(--surface); transition: background-color .15s ease, color .15s ease; }
.quota-options strong { font: 700 1.125rem/1.2 var(--serif); letter-spacing: 0.04em; }
.quota-options small { flex-basis: 100%; font-size: 0.75rem; color: var(--muted); }
.quota-options input:checked + span { background: var(--forest); color: #fff; }
.quota-options input:checked + span small { color: #C9D8CD; }
.quota-options input:focus-visible + span { outline: 3px solid var(--sage); outline-offset: -3px; }
.quota-options label + label span { border-left: 2px solid var(--forest); }

.pref-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 32px; font-size: 0.875rem; color: var(--muted); }
.pref-code { font: 600 0.9375rem/1.3 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: 0.04em; }
.pref-code-sample { padding: 4px 8px; background: var(--forest); color: #fff; }

.pref-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pref-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pref-actions button:disabled { opacity: .45; cursor: not-allowed; }
.pref-count { margin: 8px 0 16px; font-size: 0.875rem; min-height: 2.6em; }
.pref-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pref-item {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: stretch; min-height: 46px;
  background: var(--forest); color: #fff;
}
.pref-item.flash { animation: prefFlash 1s ease-out; }
@keyframes prefFlash { from { box-shadow: 0 0 0 3px rgba(208, 139, 30, 0.8); } to { box-shadow: 0 0 0 3px rgba(208, 139, 30, 0); } }
.pref-rank { display: flex; align-items: center; justify-content: center; background: var(--forest-deep); font: 700 1.0625rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.pref-body {
  display: grid; grid-template-columns: minmax(0, 17rem) 40px minmax(0, 1fr); align-items: center; column-gap: 12px;
  padding: 0 14px; min-width: 0; white-space: nowrap;
}
.pref-body > * { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pref-grip {
  align-self: stretch; display: flex; align-items: center; justify-content: center; min-height: 44px;
  cursor: grab; touch-action: none; color: rgba(255, 255, 255, 0.7); transition: color .15s ease, background-color .15s ease;
}
.pref-grip::before {
  content: ''; width: 14px; height: 14px;
  background: radial-gradient(circle, currentColor 2.2px, transparent 2.6px) 0 0 / 8px 8px;
  margin-right: -2px;
}
.pref-grip:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.pref-item.dragging .pref-grip { color: #D08B1E; cursor: grabbing; }
.pref-item .pref-code { color: #CFE0C2; font-size: 0.875rem; }
.pref-branch { font: 600 0.9375rem/1.3 var(--serif); color: #fff; text-decoration: none; }
.pref-branch:hover { text-decoration: underline; }
.pref-item a { -webkit-touch-callout: none; -webkit-user-drag: none; }
.pref-college { font-size: 0.875rem; color: #DCE7DF; }
.pref-move { display: flex; align-items: stretch; border-left: 1px solid rgba(255, 255, 255, 0.16); }
.pref-move button {
  width: 42px; min-height: 44px; border: 0; border-left: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: #fff;
  font-size: 0.875rem; cursor: pointer; transition: background-color .15s ease;
}
.pref-move button:first-child { border-left: 0; }
.pref-move button:hover:not(:disabled) { background: var(--forest-hover); }
.pref-move button:focus-visible { outline: 3px solid #D08B1E; outline-offset: -3px; }
.pref-move button:disabled { opacity: .3; cursor: default; }
.pref-move button[data-move="remove"] { font-size: 0.8125rem; }
.pref-empty { padding: 28px 20px; border: 2px dashed var(--rule-strong); color: var(--muted); text-align: center; }
.pref-note { margin-top: 32px; }

@media (max-width: 760px) {
  .pref-controls { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .pref-add { width: 100%; }
  .pref-item { grid-template-columns: 34px minmax(0, 1fr) auto; min-height: 50px; }
  .pref-rank { font-size: 0.9375rem; }
  .pref-body { grid-template-columns: minmax(0, 1fr) 40px; row-gap: 0; column-gap: 4px; padding: 0 0 0 10px; line-height: 1.3; }
  .pref-branch { grid-area: 1 / 1; align-self: end; }
  .pref-college { grid-area: 2 / 1; align-self: start; }
  .pref-grip { grid-area: 1 / 2 / 3 / 3; }
  .pref-item .pref-code { font-size: 0.6875rem; line-height: 1.35; }
  .pref-branch { font-size: 0.875rem; line-height: 1.3; }
  .pref-college { font-size: 0.8125rem; line-height: 1.35; }
  .pref-move { display: grid; grid-template-columns: 34px 34px; grid-template-rows: 1fr 1fr; }
  .pref-move button { width: auto; min-height: 28px; border-left: 0; }
  .pref-move button[data-move="up"] { grid-area: 1 / 1; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
  .pref-move button[data-move="down"] { grid-area: 2 / 1; }
  .pref-move button[data-move="remove"] { grid-area: 1 / 2 / 3 / 3; border-left: 1px solid rgba(255, 255, 255, 0.16); }
}
@media (prefers-reduced-motion: reduce) { .pref-item.flash { animation: none; } }
/* Drag to reorder */
.pref-item { position: relative; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: grab; transition: transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .2s ease; }
.pref-item.pressing { transform: scale(0.99); transition-duration: .35s; }
.pref-list.sorting .pref-item:not(.dragging) { cursor: grabbing; }
.pref-item.dragging { z-index: 5; cursor: grabbing; transition: box-shadow .2s ease; box-shadow: 0 18px 40px rgba(20, 50, 38, 0.35), 0 0 0 3px #D08B1E; }
.pref-item.settling { transition: transform .18s ease-out, box-shadow .18s ease; box-shadow: none; }
body:has(.pref-list.sorting) { -webkit-user-select: none; user-select: none; }
@media (prefers-reduced-motion: reduce) { .pref-item, .pref-item.settling { transition: none; } .pref-item.pressing { transform: none; } }
.pref-bulk-title { font-size: 0.875rem; display: flex; flex-direction: column; gap: 2px; }

.pref-print { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  .site-header, .cta-bar, .site-footer, footer, .pref-controls, .pref-aiq-note, .pref-legend, .pref-toolbar, .pref-count, .pref-list, .pref-empty, .pref-note, .breadcrumb, .dept-head, .toast, #homePage, #detailPage, #listPage { display: none !important; }
  html, body { background: #fff !important; }
  .pref-page, .pref-page .wrap { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .pref-print { display: block; color: #000; font: 8.5pt/1.15 'Public Sans', Arial, sans-serif; }
  .pref-print, .pref-print * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pref-print-banner { display: flex; align-items: center; justify-content: space-between; gap: 8mm; margin: 0 0 4mm; padding: 5mm 7mm; background: #1D4434 !important; color: #fff; }
  .pref-print-brand { display: flex; flex-direction: column; gap: 1.5mm; }
  .pref-print-brand img { height: 11mm; width: auto; display: block; }
  .pref-print-brand span { font: 500 9.5pt/1 'Public Sans', Arial, sans-serif; color: #C9D8CD; }
  .pref-print-head { margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 1mm; font-size: 8.5pt; color: #C9D8CD; text-align: right; }
  .pref-print-head strong { font: 700 11pt/1.1 'IBM Plex Sans', Arial, sans-serif; letter-spacing: 0.04em; color: #fff; }
  .pref-print-mark { position: fixed; top: 50%; left: 50%; width: 150mm; transform: translate(-50%, -50%) rotate(-28deg); opacity: 0.07; z-index: 0; pointer-events: none; }
  .pref-print-table, .pref-print-foot { position: relative; z-index: 1; }
  .pref-print-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .pref-print-table th, .pref-print-table td { padding: 0.6mm 1.6mm; border: 0.3pt solid #999; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pref-print-table th { background: rgba(231, 238, 226, 0.92) !important; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pref-print-table th:nth-child(1), .pref-print-table td:nth-child(1) { width: 9mm; text-align: right; }
  .pref-print-table th:nth-child(2), .pref-print-table td:nth-child(2) { width: 38mm; }
  .pref-print-table th:nth-child(3), .pref-print-table td:nth-child(3) { width: 52mm; }
  .pref-print-table td.code { font-family: Menlo, Consolas, monospace; font-weight: 600; }
  .pref-print-table tr { break-inside: avoid; }
  .pref-print-table thead { display: table-header-group; }
  .pref-print-foot { margin-top: 3mm; font-size: 7.5pt; color: #444; max-width: none; }
}

/* ---------- List Builder ---------- */
.pref-builder { grid-column: 1 / -1; display: grid; gap: 22px; padding-top: 20px; border-top: 1px solid var(--rule); }
.pref-builder .builder-body { max-width: 760px; }
.pref-builder .field, .pref-builder select { width: 100%; }
.builder-step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; }
.builder-step[hidden] { display: none; }
.builder-n { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--forest); color: #fff; font: 700 0.9375rem var(--serif); margin-top: 26px; }
.builder-body { display: grid; gap: 10px; min-width: 0; }
.builder-chips { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.builder-chips:empty { display: none; }
.builder-chip { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 40px 40px 40px; align-items: stretch; min-height: 44px; background: var(--forest); color: #fff; }
.builder-chip .chip-n { display: flex; align-items: center; justify-content: center; background: var(--forest-deep); font: 700 0.875rem var(--serif); }
.builder-chip .chip-name { align-self: center; padding: 0 12px; font: 600 0.9375rem/1.3 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.builder-chip .chip-count { align-self: center; padding: 0 10px; font-size: 0.8125rem; color: #C9D8CD; white-space: nowrap; }
.builder-chip .chip-count::after { content: ' options'; }
.builder-chip button { border: 0; border-left: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: #fff; cursor: pointer; font-size: 0.8125rem; }
.builder-chip button:hover:not(:disabled) { background: var(--forest-hover); }
.builder-chip button:disabled { opacity: .3; cursor: default; }
.builder-chip button:focus-visible { outline: 3px solid #D08B1E; outline-offset: -3px; }
.builder-regions { display: flex; flex-wrap: wrap; gap: 6px; }
.builder-regions[hidden], .builder-states[hidden], .builder-types[hidden] { display: none; }
.region { min-height: 40px; padding: 0 14px; border: 2px solid var(--forest); background: var(--surface); color: var(--forest-deep); font: 600 0.875rem var(--sans); cursor: pointer; }
.region[aria-pressed="true"] { background: var(--forest); color: #fff; }
.region:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }
.builder-title { font: 700 1.125rem/1.25 var(--serif); text-transform: uppercase; letter-spacing: 0.03em; color: var(--forest-deep); }
.builder-title .one-go { color: var(--red); }
.builder-states-field { display: grid; gap: 6px; }
.builder-states-field[hidden] { display: none; }
.builder-states { border: 1px solid var(--rule-strong); background: var(--surface); }
.builder-states[open] { border-color: var(--forest); }
.builder-states summary {
  list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 14px; font: 500 1rem var(--sans); color: var(--ink);
}
.builder-states summary::-webkit-details-marker { display: none; }
.builder-states summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--forest-deep); border-bottom: 2px solid var(--forest-deep); transform: rotate(45deg) translateY(-3px); transition: transform .15s ease; flex: none; }
.builder-states[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.builder-states summary:hover { background: var(--sage-wash); }
.builder-states summary:focus-visible { outline: 2px solid var(--forest); outline-offset: 0; }
.builder-states-panel { border-top: 1px solid var(--rule); padding: 10px 14px 12px; }
.builder-states-actions { display: flex; gap: 8px; margin-bottom: 6px; }
.builder-states-actions .cta-close { min-height: 36px; }
.builder-state-grid input { width: 18px; height: 18px; flex: none; accent-color: var(--forest); }
.builder-state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; padding: 8px 0 4px; font-size: 0.875rem; }
.builder-state-grid label { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.builder-types { display: flex; flex-wrap: wrap; gap: 8px; }
.type-toggle { position: relative; cursor: pointer; }
.type-toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.type-toggle span { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 2px solid var(--rule-strong); font: 600 0.875rem var(--sans); color: var(--muted); background: var(--surface); }
.type-toggle span::before { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; }
.type-toggle input:checked + span { border-color: var(--forest); color: var(--forest-deep); }
.type-toggle input:checked + span::before { background: var(--forest); border-color: var(--forest); box-shadow: inset 0 0 0 2px #fff; }
.type-toggle input:focus-visible + span { outline: 3px solid var(--sage); outline-offset: 2px; }
.builder-add { min-height: 48px; justify-self: start; min-width: 280px; margin-left: 44px; }
.builder-add:disabled { opacity: .55; cursor: not-allowed; }
.pref-aiq-note { margin: 16px 0 0; font-size: 0.875rem; }
/* Rank number doubles as "move to position" */
button.pref-rank { border: 0; color: #fff; cursor: pointer; padding: 0; }
button.pref-rank:hover { background: #0f281e; text-decoration: underline; text-underline-offset: 3px; }
button.pref-rank:focus-visible { outline: 3px solid #D08B1E; outline-offset: -3px; }
input.pref-rank-input { width: 100%; min-width: 0; border: 0; background: #fff; color: var(--forest-deep); text-align: center; font: 700 1rem var(--serif); -moz-appearance: textfield; }
input.pref-rank-input::-webkit-outer-spin-button, input.pref-rank-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@media (max-width: 760px) {
  .builder-step { grid-template-columns: minmax(0, 1fr); }
  .builder-n { display: none; }
  .builder-chip { grid-template-columns: 26px minmax(0, 1fr) auto 36px 36px 36px; }
  .builder-chip .chip-count::after { content: ''; }
  .builder-add { width: 100%; min-width: 0; margin-left: 0; }
}
