/* ----- Layout containers ----- */
.container { max-width: 920px; margin: 0 auto; padding: 0 var(--sp-5); }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-5); }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 var(--sp-5); }

@media (max-width: 767px) {
  .container, .container-wide, .container-narrow { padding: 0 var(--sp-4); }
}

/* ----- Typography ----- */
.display { font-size: var(--t-display); letter-spacing: -0.025em; font-weight: 600; line-height: 1.15; color: var(--ink); }
.h2 { font-size: var(--t-h2); letter-spacing: -0.018em; font-weight: 600; color: var(--ink); }
.h3 { font-size: var(--t-h3); font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.lede { color: var(--ink-soft); font-size: var(--t-body); line-height: 1.55; max-width: 520px; }
.micro-cap { font-size: var(--t-xs); color: var(--mute); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }
.text-soft { color: var(--ink-soft); }
.text-mute { color: var(--mute); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 13px 24px; border-radius: var(--r); border: none; font-size: var(--t-sm); font-weight: 500; transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease); letter-spacing: -0.005em; }
.btn svg { flex-shrink: 0; }
.result-link-disabled { color: var(--mute); font-size: var(--t-sm); cursor: not-allowed; }
.btn-primary { background: var(--brand-green); color: #fff; box-shadow: 0 1px 2px rgba(58,148,70,.3), 0 4px 12px rgba(58,148,70,.18); }
.btn-primary:hover { background: var(--brand-green-d); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); }
.btn-outline { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-outline:hover { background: var(--surface-alt); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ----- Pills + kbd ----- */
.pill { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--t-xs); background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
kbd { background: var(--surface-alt); border: 1px solid var(--line); padding: 2px 6px; border-radius: var(--r-sm); font-size: 10px; font-family: var(--font-mono); color: var(--ink-soft); }
.kbd-hint { display: inline-flex; gap: var(--sp-1); align-items: center; color: var(--mute); font-size: var(--t-xs); }

/* ----- Cards ----- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--sh-1); }
.card-elevated { box-shadow: var(--sh-2); border: none; }
.card-floating { box-shadow: var(--sh-3); border: none; }

/* ----- Toast ----- */
#toast-root {
  position: fixed; bottom: var(--sp-5); left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: var(--sp-2);
}
.toast {
  background: var(--ink); color: #fff;
  padding: 10px var(--sp-4);
  border-radius: var(--r);
  font-size: var(--t-sm);
  box-shadow: var(--sh-2);
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast-show { opacity: 1; transform: translateY(0); }

/* ----- top-nav ----- */
.top-nav {
  padding: var(--sp-3) var(--sp-6);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-5);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.top-nav-brand { display: flex; align-items: center; justify-self: start; }
.top-nav-brand img { display: block; }

.top-nav-tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  justify-self: center;
}
.top-nav-tab {
  display: inline-flex; align-items: center;
  gap: var(--sp-2);
  padding: 7px 14px;
  border: none; background: transparent;
  border-radius: var(--r-pill);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.top-nav-tab:hover { color: var(--ink); background: rgba(255,255,255,.5); }
.top-nav-tab-active,
.top-nav-tab-active:hover {
  background: var(--surface);
  color: var(--brand-blue);
  box-shadow: var(--sh-1), 0 0 0 1px rgba(28,117,188,.18);
}
.top-nav-tab svg { flex-shrink: 0; }

.top-nav-end {
  display: flex; align-items: center; gap: var(--sp-4);
  font-size: var(--t-sm); color: var(--ink-soft);
  justify-self: end;
}
.top-nav-link { color: var(--ink-soft); }
.top-nav-link:hover { color: var(--ink); text-decoration: none; }
.top-nav-lang { color: var(--ink); font-weight: 500; }

@media (max-width: 900px) {
  .top-nav { grid-template-columns: auto 1fr auto; padding: var(--sp-3) var(--sp-4); }
  .top-nav-tab span { display: none; }
  .top-nav-tab { padding: 7px 10px; }
}

/* ----- progress-bar ----- */
.progress-bar { height: 2px; background: rgba(47,52,56,.06); position: relative; }
.progress-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--brand-blue), var(--brand-green)); border-radius: 0 2px 2px 0; transition: width var(--dur) var(--ease); }

/* ----- step-shell ----- */
.step-shell { padding: var(--sp-8) 0 var(--sp-7); }
.step-label { margin-bottom: var(--sp-4); }
.step-title { margin: var(--sp-1) 0 var(--sp-3); }
.step-content { margin-top: var(--sp-6); }
.step-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-7); align-items: center; }
.step-hint { margin-left: auto; }

/* ----- disclaimer-quiet ----- */
.disclaimer-quiet { margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--mute); line-height: 1.6; max-width: 560px; }
.disclaimer-quiet strong { color: var(--ink-soft); font-weight: 500; }
.amber-dot { display: inline-block; width: 6px; height: 6px; background: var(--status-possibly); border-radius: 50%; margin-right: var(--sp-2); vertical-align: middle; }

/* ----- shared chip primitive (refined) ----- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 500;
}

@media (max-width: 767px) {
  .top-nav { padding: var(--sp-3) var(--sp-4); }
  .step-shell { padding: var(--sp-6) 0 var(--sp-5); }
  .step-actions { flex-wrap: wrap; }
  .step-hint { display: none; }
}

/* ----- searchable dropdown ----- */
.sd { position: relative; max-width: 560px; }
.sd-trigger {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  font-size: var(--t-body); color: var(--ink);
  display: flex; align-items: center; gap: var(--sp-3);
  box-shadow: var(--sh-1), 0 0 0 4px var(--brand-blue-l);
  transition: box-shadow var(--dur-fast);
  text-align: left; cursor: pointer;
}
.sd-trigger[aria-expanded="true"] {
  border-color: var(--brand-blue);
}
.sd-icon {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--brand-blue-l), var(--brand-green-l));
  color: var(--brand-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.sd-text { flex: 1; }
.sd-text-empty { color: var(--mute); }

.sd-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  z-index: 100;
  display: flex; flex-direction: column;
  overflow: hidden;
  max-height: 420px;
}
.sd-search {
  position: relative;
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.sd-search-icon {
  color: var(--mute);
  font-size: 14px;
  width: 16px; text-align: center;
}
.sd-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--t-body);
  color: var(--ink);
  padding: 6px 0;
  outline: none;
  min-width: 0;
}
.sd-search-input::placeholder { color: var(--mute); }
.sd-search-clear {
  background: transparent;
  border: none;
  color: var(--mute);
  font-size: 18px;
  cursor: pointer;
  padding: 0 var(--sp-2);
  line-height: 1;
}
.sd-search-clear:hover { color: var(--ink); }

.sd-list {
  flex: 1;
  overflow-y: auto;
}
.sd-empty {
  padding: var(--sp-5);
  text-align: center;
  color: var(--mute);
  font-size: var(--t-sm);
}
.sd-group {
  position: sticky; top: 0;
  padding: var(--sp-2) var(--sp-5);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; color: var(--mute);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.sd-row {
  padding: 13px var(--sp-5);
  font-size: var(--t-sm); color: var(--ink);
  border-bottom: 1px solid rgba(47,52,56,.04);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.sd-row:hover { background: var(--surface-alt); }
.sd-row-active {
  background: linear-gradient(90deg, var(--brand-blue-l), rgba(28,117,188,0));
  border-left: 2px solid var(--brand-blue);
  padding-left: calc(var(--sp-5) - 2px);
  color: var(--brand-blue); font-weight: 500;
}
.sd-row-selected:not(.sd-row-active) { color: var(--brand-blue); }
.sd-row-sub { color: var(--mute); font-size: var(--t-xs); margin-left: var(--sp-3); flex-shrink: 0; }
.sd-row-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sd-row-label mark {
  background: var(--brand-green-l);
  color: var(--brand-green-d);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}

/* ----- stream-picker ----- */
.stream-picker-pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.stream-pill { padding: 8px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); font-size: var(--t-sm); color: var(--ink-soft); }
.stream-pill-active { border-color: var(--brand-blue); background: var(--brand-blue-l); color: var(--brand-blue); font-weight: 500; }
.stream-select { width: 100%; max-width: 320px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: var(--t-sm); color: var(--ink); }

/* ----- grade-band-picker ----- */
.gbp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-2); max-width: 560px; }
.gbp-tile { padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: var(--t-body); font-weight: 600; color: var(--ink); transition: all var(--dur-fast); }
.gbp-tile:hover { border-color: var(--brand-blue); }
.gbp-tile-active { border-color: var(--brand-blue); background: var(--brand-blue-l); color: var(--brand-blue); box-shadow: var(--sh-1); }
.gbp-tile-warn { border-color: rgba(176,69,69,.3); color: var(--status-unlikely); }
.gbp-tile-warn.gbp-tile-active { background: var(--status-unlikely-l); }

.gbp-list { display: flex; flex-direction: column; gap: var(--sp-1); max-width: 560px; }
.gbp-row { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: var(--t-sm); color: var(--ink); }
.gbp-row-active { border-color: var(--brand-blue); background: var(--brand-blue-l); color: var(--brand-blue); }
.gbp-row-warn { color: var(--status-unlikely); }
.gbp-row-warn-tag { color: var(--status-unlikely); font-size: var(--t-xs); }

/* ----- level-cards ----- */
.level-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  max-width: 640px;
}
.level-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--sh-1);
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  font-family: inherit;
}
.level-card:hover {
  border-color: rgba(28,117,188,.4);
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
}
.level-card-active {
  border-color: var(--brand-blue);
  background: linear-gradient(180deg, var(--brand-blue-l) 0%, rgba(28,117,188,0) 60%);
  box-shadow: 0 0 0 4px rgba(28,117,188,.12), var(--sh-2);
}
.level-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-blue-l), var(--brand-green-l));
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}
.level-card-active .level-card-icon {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
  color: #fff;
}
.level-card-body { flex: 1; min-width: 0; }
.level-card-title {
  font-size: var(--t-h3);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.level-card-active .level-card-title { color: var(--brand-blue); }
.level-card-sub {
  font-size: var(--t-sm);
  color: var(--ink-soft);
  margin: 0 0 var(--sp-2);
  line-height: 1.5;
}
.level-card-hint {
  font-size: var(--t-xs);
  color: var(--mute);
  margin: 0;
  line-height: 1.5;
}
.level-card-check {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}
.level-card-active .level-card-check {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

@media (max-width: 600px) {
  .level-cards { grid-template-columns: 1fr; }
}

/* ----- home hero ----- */
.home-hero { padding: var(--sp-8) var(--sp-5); text-align: left; max-width: 920px; }
.hero-eyebrow { margin-bottom: var(--sp-3); }
.home-title { margin: 0 0 var(--sp-3); }
.home-lede { margin-bottom: var(--sp-7); }
.home-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-7); }
.home-tile { text-align: left; padding: var(--sp-6); cursor: pointer; transition: transform var(--dur-fast), box-shadow var(--dur-fast); border: 1px solid var(--line); background: var(--surface); }
.home-tile:hover { transform: translateY(-2px); box-shadow: var(--sh-3); }
.home-tile-icon {
  width: 44px; height: 44px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  margin-bottom: var(--sp-4);
}
.home-tile h2 { margin-bottom: var(--sp-2); }
.home-tile-cta { display: inline-block; margin-top: var(--sp-4); color: var(--brand-blue); font-weight: 600; font-size: var(--t-sm); }
.home-meta { font-size: var(--t-xs); padding-top: var(--sp-5); border-top: 1px solid var(--line); }

@media (max-width: 767px) { .home-tiles { grid-template-columns: 1fr; } }

/* ----- Mode A Step 4: grade picker, area filter, estimated toggle ----- */
.inline-warn { margin-top: var(--sp-3); padding: var(--sp-2) var(--sp-3); background: var(--status-unlikely-l); border-left: 3px solid var(--status-unlikely); color: var(--status-unlikely); font-size: var(--t-sm); border-radius: var(--r-sm); }
.optional-filter { margin-top: var(--sp-5); }
.optional-filter summary { cursor: pointer; padding: var(--sp-2) 0; }
.area-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-2); padding-top: var(--sp-3); }
.area-check { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--t-sm); cursor: pointer; }
.area-check input { accent-color: var(--brand-blue); }
.inline-toggle { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.switch { display: flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.switch input { accent-color: var(--brand-blue); width: 18px; height: 18px; }
.switch-text { color: var(--ink); font-weight: 500; }
.switch-help { font-size: var(--t-xs); margin-left: auto; }

/* ----- area-grid ----- */
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); }
.area-tile { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-align: left; transition: all var(--dur-fast); cursor: pointer; min-height: 100px; }
.area-tile:hover { transform: translateY(-2px); border-color: var(--brand-blue); box-shadow: var(--sh-2); }
.area-tile-active { border-color: var(--brand-blue); background: var(--brand-blue-l); }
.area-tile-name { font-weight: 600; color: var(--ink); font-size: var(--t-h3); }
.area-tile-meta { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: auto; }
.area-tile-flag { font-size: var(--t-xs); padding: 2px 8px; background: var(--surface-alt); color: var(--ink-soft); border-radius: var(--r-pill); }

@media (max-width: 767px) { .area-grid { grid-template-columns: 1fr 1fr; } }

/* ----- status badge ----- */
.status-badge { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 5px 11px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.02em; }
.status-badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-likely     { background: var(--status-likely-l);     color: var(--status-likely); }
.badge-likely     .status-badge-dot { background: var(--status-likely); }
.badge-possibly   { background: var(--status-possibly-l);   color: var(--status-possibly); }
.badge-possibly   .status-badge-dot { background: var(--status-possibly); }
.badge-borderline { background: var(--status-borderline-l); color: var(--status-borderline); }
.badge-borderline .status-badge-dot { background: var(--status-borderline); }
.badge-unlikely   { background: var(--status-unlikely-l);   color: var(--status-unlikely); }
.badge-unlikely   .status-badge-dot { background: var(--status-unlikely); }
.badge-unavail    { background: var(--status-unavail-l);    color: var(--status-unavail); }
.badge-unavail    .status-badge-dot { background: var(--status-unavail); }

/* ----- result card ----- */
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-6); box-shadow: var(--sh-1); transition: box-shadow var(--dur-fast); }
.result-card:hover { box-shadow: var(--sh-2); }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); }
.result-head-text { flex: 1; }
.result-name { font-size: var(--t-h3); font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.result-type { font-size: var(--t-xs); color: var(--mute); margin-top: 2px; line-height: 1.5; }
.result-meta { display: flex; gap: var(--sp-6); margin-top: var(--sp-4); flex-wrap: wrap; }
.result-meta-item { display: flex; flex-direction: column; gap: 2px; }
.result-meta-value { color: var(--ink); font-weight: 500; font-size: var(--t-sm); }
.result-tags { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }
.result-tag { font-size: var(--t-xs); padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-alt); color: var(--ink-soft); border: 1px solid var(--line); font-weight: 500; }
.result-prereq-warn { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--status-unlikely-l); color: var(--status-unlikely); border-radius: var(--r); font-size: var(--t-sm); font-weight: 500; }
.result-actions { display: flex; justify-content: space-between; align-items: center; margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.result-link { color: var(--brand-blue); font-weight: 500; font-size: var(--t-sm); }
.result-compare-toggle {
  display: inline-flex; gap: var(--sp-2); align-items: center;
  font-size: var(--t-sm); color: var(--ink-soft);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all var(--dur-fast) var(--ease);
}
.result-compare-toggle:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.result-compare-toggle:has(input:checked) {
  background: var(--brand-blue-l);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  font-weight: 500;
}
.result-compare-toggle input { accent-color: var(--brand-blue); }

/* ----- disclaimer banner ----- */
.disclaimer-banner { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: rgba(201,148,43,.06); border: 1px solid rgba(201,148,43,.18); border-radius: var(--r); font-size: var(--t-xs); color: var(--ink-soft); line-height: 1.55; }
.disclaimer-banner strong { color: var(--ink); font-weight: 600; }
.disclaimer-banner-text { flex: 1; }

/* ----- prereq banner ----- */
.prereq-banner { padding: var(--sp-4) var(--sp-5); background: var(--brand-blue-l); border-left: 4px solid var(--brand-blue); border-radius: var(--r-sm); }
.prereq-banner-title { font-weight: 600; color: var(--brand-blue); margin-bottom: var(--sp-2); }
.prereq-banner-body { font-size: var(--t-sm); color: var(--ink-soft); line-height: 1.6; }

/* ----- empty state ----- */
.empty-state { text-align: center; padding: var(--sp-8) var(--sp-5); }
.empty-state-icon { font-size: 48px; color: var(--mute); margin-bottom: var(--sp-5); }
.empty-state h2 { margin-bottom: var(--sp-3); }
.empty-state .lede { margin: 0 auto var(--sp-6); }
.empty-state-edit { margin-top: var(--sp-4); }

/* ----- gate page ----- */
.gate-page { padding: var(--sp-8) 0; text-align: left; }
.gate-page-icon { font-size: 48px; color: var(--status-possibly); margin-bottom: var(--sp-5); }
.gate-page h1 { margin-bottom: var(--sp-4); }
.gate-page-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-7); }

/* ----- results page ----- */
.results-page { padding: var(--sp-7) var(--sp-5); }
.results-loading { padding: var(--sp-7) 0; text-align: center; }
.results-summary { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; padding-bottom: var(--sp-5); margin-bottom: var(--sp-5); border-bottom: 1px solid var(--line); }
.results-summary-chip { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); }
.results-summary-text { font-size: var(--t-sm); color: var(--ink); font-family: var(--font-mono); }
.results-edit { padding: 4px 12px; font-size: var(--t-xs); }
.results-summary-meta { font-size: var(--t-h3); color: var(--ink); font-weight: 600; }
.results-summary-actions { margin-left: auto; display: flex; gap: var(--sp-2); }
.results-list { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-5); }
.results-list-collapsed { margin-top: var(--sp-4); }
.results-section { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.results-section-summary { cursor: pointer; padding: var(--sp-3) 0; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: var(--sp-2); }
.results-section-count { background: var(--surface-alt); padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--t-xs); color: var(--mute); }
.results-excluded-est { margin-top: var(--sp-5); padding: var(--sp-4); background: var(--surface-alt); border-radius: var(--r); }

/* ----- compare-tray ----- */
.compare-tray {
  position: fixed; bottom: var(--sp-4); right: var(--sp-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5);
  display: none; gap: var(--sp-3); align-items: center;
  z-index: 50;
}
.compare-tray-show { display: flex; }
.compare-tray-count { font-size: var(--t-sm); color: var(--ink); }
.compare-tray-count strong { font-size: var(--t-h3); margin: 0 4px; color: var(--brand-blue); }

@media (max-width: 767px) {
  .compare-tray { right: var(--sp-3); bottom: var(--sp-3); padding: var(--sp-2) var(--sp-3); }
}

/* ----- Compare view ----- */
.compare-page { padding: var(--sp-7) var(--sp-5); }
.compare-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.compare-head-text { display: flex; flex-direction: column; gap: var(--sp-2); }
.compare-head-query { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--t-sm); color: var(--ink-soft); }
.compare-head-query .pill { font-family: var(--font-mono); font-size: var(--t-xs); }
.compare-head-actions { display: flex; gap: var(--sp-2); align-items: center; }

.compare-no-query-hint {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--brand-blue-l);
  border: 1px solid rgba(28,117,188,.2);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-5);
  color: var(--ink);
  font-size: var(--t-sm);
  line-height: 1.5;
}
.compare-no-query-hint svg { color: var(--brand-blue); flex-shrink: 0; margin-top: 2px; }
.compare-no-query-hint strong { color: var(--brand-blue); font-weight: 600; display: block; margin-bottom: 2px; }
/* ----- compare table ----- */
.compare-table {
  display: grid;
  grid-template-columns: 200px repeat(calc(var(--cmp-cols) - 1), minmax(220px, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
  position: relative;
}

.cmp-section { display: contents; }

.cmp-section-title {
  grid-column: 1 / -1;
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-blue);
  background: linear-gradient(90deg, rgba(28,117,188,.08), rgba(28,117,188,0) 50%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cmp-section:first-child .cmp-section-title { border-top: none; }

.cmp-row { display: contents; }

.cmp-cell {
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--t-sm);
  color: var(--ink);
  border-top: 1px solid rgba(47,52,56,.05);
  line-height: 1.5;
  transition: background var(--dur-fast) var(--ease);
}
.cmp-section .cmp-row:first-child .cmp-cell { border-top: none; }

.cmp-cell-label {
  color: var(--ink-soft);
  font-weight: 500;
  background: var(--surface-alt);
  border-right: 1px solid var(--line);
}

/* Header row — institution names + type chip */
.cmp-row-head .cmp-cell {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
  padding: var(--sp-5);
  border-top: none;
}
.cmp-cell-head {
  display: flex; flex-direction: column;
  gap: var(--sp-2);
  align-items: flex-start;
}
.cmp-cell-head strong {
  font-size: var(--t-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
}
.cmp-cell-head-sub {
  font-size: var(--t-xs);
  color: var(--ink-soft);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  padding: 3px 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}

/* Hover — soft background, not opacity */
.cmp-row:not(.cmp-row-head):hover .cmp-cell {
  background: var(--brand-blue-l);
}
.cmp-row:not(.cmp-row-head):hover .cmp-cell-label {
  background: rgba(28,117,188,.14);
  color: var(--brand-blue);
}

/* Cell content helpers */
.cmp-yes {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--brand-green);
  font-weight: 600;
}
.cmp-no { color: var(--mute); font-weight: 400; }
.cmp-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-blue);
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--brand-blue);
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  transition: all var(--dur-fast) var(--ease);
}
.cmp-link:hover {
  background: var(--brand-blue);
  color: #fff;
  text-decoration: none;
}

/* Status badge inside compare cells gets a touch more presence */
.cmp-cell .status-badge {
  font-size: var(--t-sm);
  padding: 6px 12px;
}

@media (max-width: 767px) {
  .compare-table { grid-template-columns: 1fr; border-radius: var(--r); }
  .cmp-cell-label { background: var(--surface-alt); border-right: none; border-bottom: 1px solid var(--line); }
  .cmp-row-head .cmp-cell { border-bottom: 2px solid var(--brand-blue); }
  .cmp-section .cmp-row:first-child .cmp-cell { border-top: 1px solid rgba(47,52,56,.05); }
}

@media (max-width: 480px) {
  .result-meta { gap: var(--sp-3); }
  .result-meta-item { min-width: calc(50% - var(--sp-3)); }
  .result-actions { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
  .results-summary-meta { font-size: var(--t-body); }
  .results-summary-actions { width: 100%; }
}

/* ----- Loading skeleton ----- */
.skeleton-wrap { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-7) var(--sp-5); max-width: 920px; margin: 0 auto; }
.skeleton-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-5); }
.skeleton-line { height: 14px; background: linear-gradient(90deg, var(--surface-alt) 0%, var(--line) 50%, var(--surface-alt) 100%); background-size: 200% 100%; border-radius: var(--r-sm); margin-bottom: var(--sp-3); animation: skeletonShimmer 1.4s var(--ease) infinite; }
.skeleton-line-w60 { width: 60%; }
.skeleton-line-w40 { width: 40%; }
.skeleton-line-w80 { width: 80%; }
@keyframes skeletonShimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton-line { animation: none; } }

/* ----- share popover ----- */
.share-popover {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-3);
  padding: var(--sp-3);
  z-index: 200;
  width: 360px;
  max-width: calc(100vw - var(--sp-5) * 2);
  position: fixed;
}
.share-popover-row { display: flex; gap: var(--sp-2); align-items: center; }
.share-popover-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-alt);
  color: var(--ink);
  min-width: 0;
}
.share-popover-input:focus { box-shadow: var(--sh-focus); outline: none; }
.share-popover-copy { padding: 8px 16px; font-size: var(--t-xs); }
.share-popover-close {
  position: absolute;
  top: 4px; right: 8px;
  background: transparent;
  border: none;
  color: var(--mute);
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}
.share-popover-close:hover { color: var(--ink); }
