@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/PlusJakartaSans-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans SC";
  src: url("/assets/NotoSansSC-subset.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #0b2545;
  --navy-2: #16395f;
  --navy-3: #244b72;
  --red: #e1062d;
  --paper: #f9f7f4;
  --white: #fff;
  --ink: #132033;
  --muted: #6b7280;
  --line: #d9dee5;
  --soft: #edf0f3;
  --green: #16775b;
  --green-bg: #e8f4ef;
  --amber: #9a5c00;
  --amber-bg: #fff3d8;
  --red-bg: #fff0f2;
  --shadow: 0 16px 40px rgba(11, 37, 69, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Plus Jakarta Sans", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }

.shell {
  width: min(1480px, calc(100% - 64px));
  margin-inline: auto;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(32px, calc((100vw - 1480px) / 2));
  background: rgba(249, 247, 244, .94);
  border-bottom: 1px solid rgba(11, 37, 69, .12);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.brand img { width: 174px; display: block; }
.topbar-meta { display: flex; gap: 10px; align-items: center; }

.offline-pill, .cycle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}

.offline-pill { background: var(--navy); color: white; }
.offline-pill span { width: 7px; height: 7px; border-radius: 50%; background: #62d2a2; }
.cycle-pill { color: var(--navy); border: 1px solid #bcc6d2; }

.intro { padding: 72px 0 54px; }
.eyebrow, .step-label {
  display: block;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, .75fr);
  gap: 80px;
  align-items: end;
  margin-top: 16px;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 24px;
  color: var(--navy);
  font-size: clamp(42px, 5.1vw, 76px);
  line-height: .99;
  letter-spacing: -.055em;
  font-weight: 760;
}
h1 em { color: var(--red); font-style: normal; }
.lede { max-width: 730px; margin-bottom: 0; color: #536173; font-size: 18px; line-height: 1.75; }

.method-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 15px 16px;
  padding-left: 26px;
  border-left: 2px solid var(--red);
}
.method-card p { margin: 0; }
.method-index { color: var(--red); font-size: 12px; font-weight: 800; padding-top: 2px; }
.method-card strong { display: block; color: var(--navy); font-size: 14px; }
.method-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  background: transparent;
}
.mode-option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 6px;
  align-content: center;
  min-height: 96px;
  padding: 20px 24px;
  color: var(--muted);
  text-align: left;
  background: white;
  border: 1px solid #cfd6df;
}
.mode-option > span { grid-row: 1 / 3; align-self: start; padding-top: 2px; color: var(--red); font-size: 12px; font-weight: 800; }
.mode-option strong { min-width: 0; color: var(--navy); font-size: 15px; line-height: 1.35; }
.mode-option small { min-width: 0; max-width: 460px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.mode-option.active { background: var(--navy); }
.mode-option.active strong { color: white; }
.mode-option.active small { color: #bdcad8; }
.mode-option:focus-visible { outline: 3px solid rgba(225, 6, 45, .28); outline-offset: -3px; }

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, .78fr) minmax(0, 1.7fr);
  border: 1px solid #cfd6df;
  background: var(--white);
  box-shadow: var(--shadow);
  min-height: 760px;
}

.profile-panel { padding: 34px; background: #f3f1ee; border-right: 1px solid #cfd6df; }
.results-panel { min-width: 0; padding: 34px; }
.panel-heading, .results-toolbar, .coverage-head, .dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.results-toolbar { align-items: flex-end; }
#profile-input-notice { grid-column: 1 / -1; border-left: 3px solid var(--red); padding: 8px 12px; margin: 0 0 8px; font-size: 13px; line-height: 1.8; }
h2 { margin: 5px 0 0; color: var(--navy); font-size: 27px; line-height: 1.2; letter-spacing: -.035em; }

fieldset { margin: 28px 0 0; padding: 0; border: 0; }
legend { padding: 0; color: var(--navy); font-size: 13px; font-weight: 800; }
.legend-row { display: flex; align-items: center; justify-content: space-between; }
.field { display: grid; gap: 7px; margin-top: 15px; }
.field > span, .score-field > span { color: #526174; font-size: 11px; font-weight: 700; }

select, input[type="number"], input[type="text"], input[type="tel"], textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #c8d0da;
  border-radius: 3px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 104px; padding-block: 11px; resize: vertical; line-height: 1.55; }
select:focus, input:focus, textarea:focus { border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(36, 75, 114, .1); }
.score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.score-field { display: grid; gap: 6px; }
.field-hint { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

.text-button {
  padding: 0;
  color: var(--navy-3);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 800;
}
.text-button:hover { color: var(--red); }

.subject-rows { display: grid; gap: 8px; margin-top: 13px; }
.subject-row { display: grid; grid-template-columns: minmax(0, 1fr) 74px 32px; gap: 8px; align-items: center; }
.subject-row select { min-height: 40px; }
.remove-subject, .icon-button {
  border: 0;
  background: transparent;
  color: #7c8795;
  font-size: 22px;
  line-height: 1;
}
.remove-subject:hover, .icon-button:hover { color: var(--red); }
.profile-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 28px; }

.primary-button, .secondary-button {
  min-height: 45px;
  padding: 0 16px;
  border-radius: 3px;
  font-weight: 800;
  font-size: 12px;
  transition: transform .15s ease, background .15s ease;
}
.primary-button { color: white; background: var(--red); border: 1px solid var(--red); }
.secondary-button { color: var(--navy); background: transparent; border: 1px solid #9faebe; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.secondary-button:hover { background: white; }

.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; }
.compact-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.compact-field select { width: auto; min-height: 36px; padding-right: 34px; font-size: 11px; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 26px;
  background: var(--navy);
  color: white;
}
.summary-item { padding: 18px; border-right: 1px solid rgba(255,255,255,.16); }
.summary-item:last-child { border-right: 0; }
.summary-item strong { display: block; font-size: 24px; line-height: 1; }
.summary-item span { display: block; margin-top: 7px; color: #bdcad8; font-size: 10px; line-height: 1.4; }

.meaning-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  background: var(--line);
  border: 1px solid var(--line);
}
.meaning-note p { margin: 0; padding: 13px 15px; background: #f8f8f7; color: #586577; font-size: 10px; line-height: 1.6; }
.meaning-note strong { color: var(--navy); }
.meaning-note .reassurance { grid-column: 1 / -1; background: #fff7f8; color: #596273; }

.consult-bridge {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr) auto;
  gap: 22px;
  align-items: center;
  margin-top: 14px;
  padding: 20px;
  background: #eef2f6;
  border-left: 3px solid var(--red);
}
.consult-bridge h3 { margin: 5px 0 7px; color: var(--navy); font-size: 17px; line-height: 1.4; letter-spacing: -.02em; }
.consult-bridge-copy p { margin: 0; color: #566376; font-size: 10px; line-height: 1.65; }
.consult-points { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.consult-points li { position: relative; padding-left: 13px; color: #3d4e62; font-size: 10px; line-height: 1.45; }
.consult-points li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; background: var(--red); }
.consult-open { min-width: 148px; white-space: nowrap; }

.status-tabs { display: flex; gap: 6px; margin-top: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.status-tab {
  flex: none;
  padding: 8px 11px;
  color: #566376;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 750;
}
.status-tab span { margin-left: 5px; color: #8b95a3; }
.status-tab.active { color: var(--navy); background: #edf1f5; border-color: #dbe1e8; }

.dream-gap-board {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  background: #f8f8f7;
}
.dream-gap-head { display: flex; justify-content: space-between; gap: 24px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dream-gap-head strong { color: var(--navy); font-size: 14px; }
.dream-gap-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.evidence-level { flex: none; align-self: flex-start; color: var(--navy-3); font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.gap-checklist { display: grid; }
.gap-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(170px, .8fr); gap: 16px; align-items: start; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.gap-row:last-child { border-bottom: 0; }
.gap-state { display: inline-flex; align-items: center; gap: 7px; color: var(--navy); font-size: 10px; font-weight: 800; }
.gap-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--navy-3); }
.gap-state.pass::before { background: var(--green); }
.gap-state.fail::before { background: var(--red); }
.gap-state.unknown::before { background: var(--amber); }
.gap-rule { color: #36465a; font-size: 11px; line-height: 1.55; }
.gap-action { color: var(--muted); font-size: 10px; line-height: 1.55; }

.results-list { display: grid; gap: 12px; margin-top: 18px; }
.result-card { border: 1px solid var(--line); background: white; }
.result-card[hidden] { display: none; }
.card-main {
  display: grid;
  grid-template-columns: 48px minmax(190px, .85fr) minmax(260px, 1.4fr) 20px;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 18px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}
.uni-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 5px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #cfd6df;
}
.uni-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.uni-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: white;
  background: var(--navy);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.programme-title strong { display: block; color: var(--navy); font-size: 14px; line-height: 1.35; }
.programme-title span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.programme-title { min-width: 0; }
.programme-title .university-name, .programme-heading .university-name { display: block; margin: 0 0 6px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.programme-title .course-name, .programme-heading .course-name { display: block; color: var(--navy); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.name-reading-note { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.relation-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 5px;
  border: 1px solid #bac5d1;
  border-radius: 2px;
  color: var(--navy-3);
  font-size: 8px;
  font-weight: 800;
  vertical-align: 1px;
}
.relation-badge.related { color: #72510a; border-color: #d7c18c; background: #fff9e9; }
.match-line { display: grid; min-width: 0; gap: 6px; align-items: start; }
.status-badge {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 5px 8px;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: .03em;
  white-space: normal;
}
.status-badge.competitive { color: var(--green); background: var(--green-bg); }
.status-badge.eligible { color: var(--navy-3); background: #e9f1fa; }
.status-badge.near { color: var(--amber); background: var(--amber-bg); }
.status-badge.review, .status-badge.not_eligible { color: var(--red); background: var(--red-bg); }
.match-reason { min-width: 0; color: #4b5868; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.chevron { color: #8791a0; font-size: 16px; transform: rotate(90deg); transition: transform .15s ease; }
.result-card.open .chevron { transform: rotate(-90deg); }

.card-detail { display: none; padding: 0 18px 18px 82px; }
.result-card.open .card-detail { display: block; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-block { padding: 13px; background: #f7f7f6; }
.detail-block dt { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-block dd { margin: 7px 0 0; color: #2f3d4f; font-size: 11px; line-height: 1.65; }
.detail-notes { grid-column: 1 / -1; }
.case-panel { margin-top: 12px; padding: 14px; border: 1px solid #d7dde4; background: #fffdfa; }
.case-panel-head { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(0, 1.3fr); gap: 18px; align-items: start; }
.case-panel-head strong { display: block; color: var(--navy); font-size: 11px; }
.case-panel-head span { display: block; margin-top: 3px; color: var(--red); font-size: 9px; font-weight: 750; }
.case-panel-head p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.case-list { display: grid; gap: 8px; margin-top: 12px; }
.case-item { display: grid; grid-template-columns: minmax(110px, .35fr) minmax(220px, 1fr) minmax(180px, .75fr) auto; gap: 12px; align-items: start; padding-top: 10px; border-top: 1px solid var(--line); }
.case-item span, .case-item p { color: var(--muted); font-size: 9px; line-height: 1.5; }
.case-item strong { color: #2f3d4f; font-size: 10px; line-height: 1.55; }
.case-item p { margin: 0; }
.case-item a { color: var(--navy-3); font-size: 9px; font-weight: 750; white-space: nowrap; }
.source-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.source-link { color: var(--navy-3); font-size: 10px; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.freshness { margin-left: auto; color: var(--muted); font-size: 9px; }
.card-consult {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 13px 0 0;
  border-top: 1px solid var(--line);
}
.card-consult p { margin: 0; color: #526174; font-size: 10px; line-height: 1.55; }
.card-consult button { flex: none; min-height: 36px; padding: 0 12px; color: var(--navy); background: white; border: 1px solid #aab6c3; font-size: 10px; font-weight: 800; }
.card-consult button:hover { color: var(--red); border-color: var(--red); }
.empty-state { padding: 70px 24px; text-align: center; color: var(--muted); border: 1px dashed #bec7d1; }
.empty-state strong { display: block; color: var(--navy); margin-bottom: 8px; }
.load-more {
  min-height: 46px;
  color: var(--navy);
  background: #f2f4f6;
  border: 1px solid #cfd6df;
  font-size: 11px;
  font-weight: 800;
}
.load-more:hover { color: var(--red); background: white; }

.coverage { padding: 84px 0 100px; }
.coverage-head { align-items: end; }
.coverage-head > p { max-width: 530px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.coverage-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 28px; border-top: 1px solid var(--navy); border-bottom: 1px solid var(--navy); }
.coverage-item { min-height: 135px; padding: 24px; border-right: 1px solid #c7cfd8; }
.coverage-item:last-child { border-right: 0; }
.coverage-item strong { display: block; color: var(--navy); font-size: 31px; letter-spacing: -.04em; }
.coverage-item span { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.coverage-footer { display: flex; justify-content: space-between; align-items: center; gap: 32px; margin-top: 22px; }
.coverage-footer p { max-width: 850px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.coverage-footer .secondary-button { flex: none; }

.contribute {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  gap: 80px;
  align-items: start;
  margin-bottom: 100px;
  padding-top: 48px;
  border-top: 1px solid var(--navy);
}
.contribute h2 { max-width: 650px; font-size: clamp(28px, 3vw, 42px); line-height: 1.35; }
.contribute > div:last-child > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.contribute-actions { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 24px; }
.primary-link {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  color: white;
  background: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.primary-link:hover { background: #b50525; }
.quiet-link { padding: 0; color: var(--navy-3); background: transparent; border: 0; font-size: 11px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.tool-footer { padding: 26px 0; color: #b9c6d5; background: var(--navy); font-size: 10px; }
.tool-footer .shell { display: flex; gap: 28px; align-items: center; }
.tool-footer a { color: white; text-decoration: none; }
.tool-footer a:last-child { margin-left: auto; }

dialog {
  width: min(980px, calc(100% - 40px));
  max-height: 86vh;
  padding: 28px;
  border: 1px solid #bec8d3;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 32px 90px rgba(11, 37, 69, .28);
}
dialog::backdrop { background: rgba(7, 24, 44, .72); backdrop-filter: blur(4px); }
.dialog-filters { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 22px; padding: 13px 0; border-block: 1px solid var(--line); }
.dialog-filters span { color: var(--muted); font-size: 11px; }
.dialog-filters select { width: 190px; min-height: 38px; font-size: 11px; }
.source-list { display: grid; margin-top: 12px; }
.source-item { display: grid; grid-template-columns: 132px 1fr 110px; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.source-tier { color: var(--red); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.source-item a { color: var(--navy); font-size: 12px; font-weight: 800; text-decoration: none; }
.source-item a:hover { text-decoration: underline; }
.source-item p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.source-date { color: var(--muted); font-size: 9px; text-align: right; }

.consult-dialog { width: min(760px, calc(100% - 40px)); overflow: auto; }
.consult-dialog form { display: block; }
.consult-summary { margin: 22px 0 0; padding: 13px 15px; color: #435267; background: #edf1f5; border-left: 2px solid var(--navy); font-size: 11px; line-height: 1.65; }
.consult-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.consult-interests { margin-top: 22px; }
.interest-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.interest-grid label { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; color: #3d4e62; background: white; border: 1px solid #cfd6df; font-size: 10px; line-height: 1.45; cursor: pointer; }
.interest-grid input, .consent-line input { flex: none; margin-top: 2px; accent-color: var(--red); }
.consent-line { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; color: #536173; font-size: 9px; line-height: 1.6; cursor: pointer; }
.consult-form-footer { display: flex; justify-content: flex-end; align-items: center; gap: 18px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.consult-form-footer .primary-button { min-width: 122px; }
.form-status { flex: 1; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-status.error { color: var(--red); }
.form-status.success { color: var(--green); font-weight: 700; }
.contact-note { margin: 12px 0 0; color: #7a8492; font-size: 9px; line-height: 1.55; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .intro-grid { grid-template-columns: 1fr; gap: 35px; }
  .method-card { max-width: 620px; }
  .workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .profile-panel, .results-panel { padding: 25px; }
  .card-main { grid-template-columns: 44px minmax(150px, .9fr) minmax(170px, 1.1fr) 16px; gap: 12px; }
  .uni-mark { width: 44px; height: 44px; padding: 4px; }
  .card-detail { padding-left: 74px; }
  .consult-bridge { grid-template-columns: minmax(0, 1fr) minmax(210px, .8fr); }
  .consult-open { grid-column: 1 / -1; width: fit-content; }
}

@media (max-width: 820px) {
  .shell { width: min(100% - 32px, 680px); }
  .topbar { height: 68px; padding: 0 16px; }
  .brand img { width: 145px; }
  .cycle-pill { display: none; }
  .intro { padding: 48px 0 38px; }
  .lede { font-size: 15px; }
  .workspace { display: block; }
  .mode-switch { grid-template-columns: 1fr; }
  .profile-panel { border-right: 0; border-bottom: 1px solid #cfd6df; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.16); }
  .coverage-head, .coverage-footer { align-items: flex-start; flex-direction: column; }
  .coverage-grid { grid-template-columns: repeat(2, 1fr); }
  .coverage-item:nth-child(2) { border-right: 0; }
  .coverage-item:nth-child(-n+2) { border-bottom: 1px solid #c7cfd8; }
  .contribute { grid-template-columns: 1fr; gap: 22px; margin-bottom: 64px; }
  .consult-bridge { grid-template-columns: 1fr; align-items: start; }
  .consult-open { grid-column: auto; }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 20px); }
  .topbar-meta { gap: 0; }
  .offline-pill { font-size: 10px; }
  h1 { font-size: 40px; }
  .mode-switch { gap: 8px; margin-bottom: 10px; }
  .mode-option { grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; row-gap: 4px; min-height: 82px; padding: 15px 16px; }
  .profile-panel, .results-panel { padding: 20px 16px; }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-actions { grid-template-columns: 1fr; }
  .meaning-note { grid-template-columns: 1fr; }
  .results-toolbar { flex-direction: column; align-items: stretch; gap: 16px; }
  .toolbar-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .toolbar-actions select { width: 100%; min-width: 0; }
  .compact-field { display: grid; gap: 4px; }
  .compact-field select { max-width: min(100%, 180px); }
  .card-main { grid-template-columns: 42px minmax(0, 1fr) 16px; }
  .match-line { grid-column: 2 / 3; display: block; }
  .match-reason { margin-top: 6px; white-space: normal; }
  .chevron { grid-column: 3; grid-row: 1 / span 2; }
  .card-detail { padding: 0 14px 14px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-notes { grid-column: auto; }
  .case-panel-head, .case-item { grid-template-columns: 1fr; gap: 6px; }
  .case-item a { white-space: normal; }
  .dream-gap-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .gap-row { grid-template-columns: 1fr; gap: 6px; }
  .coverage { padding: 64px 0; }
  .coverage-grid { grid-template-columns: 1fr; }
  .coverage-item { border-right: 0; border-bottom: 1px solid #c7cfd8; }
  .coverage-item:last-child { border-bottom: 0; }
  .source-item { grid-template-columns: 1fr; gap: 7px; }
  .source-date { text-align: left; }
  .dialog-filters { align-items: stretch; flex-direction: column; }
  .dialog-filters select { width: 100%; }
  .consult-dialog { width: calc(100% - 20px); padding: 20px 16px; }
  .consult-form-grid, .interest-grid { grid-template-columns: 1fr; }
  .card-consult { align-items: stretch; flex-direction: column; }
  .card-consult button { width: 100%; }
  .consult-form-footer { align-items: stretch; flex-direction: column; }
  .consult-form-footer .primary-button { width: 100%; }
  .offline-pill { max-width: 154px; line-height: 1.25; text-align: center; }
  .contribute-actions { align-items: stretch; flex-direction: column; }
  .primary-link, .quiet-link { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; }
  .tool-footer .shell { align-items: flex-start; flex-direction: column; gap: 8px; }
  .tool-footer a:last-child { margin-left: 0; }
}

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