:root {
  --boys-color: #2A4FA0;
  --girls-color: #9C5570;
  --mixed-color: #5E7245;
  --boys-fill: rgba(42, 79, 160, 0.18);
  --girls-fill: rgba(156, 85, 112, 0.18);
  --mixed-fill: rgba(94, 114, 69, 0.18);
  --gb-accent: #1F3A8A;
  --gb-text: #1a1a1a;
  --sidebar-width: 280px;
  --header-height: 72px;
  --action-bar-height: 52px;
  /* FEAT-136 (US-003): control-scoped theme tokens — unify the map chrome to one
     visual language. Not the full FEAT-132 token migration. */
  --control-radius: 8px;
  --control-border: 1px solid #cbd5e1;
  --control-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  --control-active: #040F49;
  --control-focus: #C99B43;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: #f8fafc;
  color: #1e293b;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  height: var(--header-height);
  background: #040F49;
  color: white;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  border-bottom: 3px solid #C99B43;
}

.header-logo {
  height: 40px;
  width: auto;
  display: block;
}

/* ── Header navigation (pill tabs) ── */
.header-logo-link { display: inline-flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.header-logo-mark { display: none; height: 36px; width: auto; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;   /* right-align the nav group on desktop */
  min-width: 0;
}
.nav-pill {
  color: rgba(255,255,255,0.72);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-pill:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-pill.active { color: #fff; background: rgba(201, 155, 67,0.22); }

.header-auth {
  margin-left: 16px;   /* sits just after the right-aligned nav on desktop; pushed right on mobile (nav hidden) */
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid rgba(255,255,255,0.35);
  padding: 7px 16px;
  border-radius: var(--r-control);
  white-space: nowrap;
  flex-shrink: 0;
}
.header-auth:hover { border-color: #C99B43; }

.subtitle {
  font-size: 12px;
  color: #94a3b8;
  max-width: 600px;
  line-height: 1.4;
}

#app {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Sidebar — non-scrolling outer flex column. The middle `.sidebar-scroll`
 * is the only scrollable region so the search/sort group + select-all bar
 * stay pinned at the top and the compare bar stays pinned at the bottom. */
#sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.filter-group {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.filter-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 8px;
}

.filter-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 4px 10px;
  border-radius: var(--r-tag);
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
  font-size: 13px;
  color: #475569;
  transition: all 0.15s;
}

/* Hovering an UNSELECTED button: pale indigo tint, indigo text + border. */
.filter-btn:hover {
  background: #F4EFE2;
  color: #040F49;
  border-color: #040F49;
}

/* Selected: solid indigo, white text — persistent and declared after :hover so
   an active button keeps the solid fill (equal specificity, later rule wins). */
.filter-btn.active {
  background: #040F49;
  color: white;
  border-color: #040F49;
}

/* Hovering the SELECTED button stays solid (slightly darker), never the pale tint. */
.filter-btn.active:hover {
  background: #020A33;
  color: white;
  border-color: #020A33;
}

/* Keyboard focus ring — independent of the active fill. */
.filter-btn:focus-visible {
  outline: 2px solid #1F3A8A;
  outline-offset: 2px;
}


#map.pin-cursor {
  cursor: crosshair;
}

.overlap-btn {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--r-control);
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
  font-size: 12px;
  color: #475569;
  text-align: left;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.overlap-btn::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: var(--r-tag);
  border: 2px solid #94a3b8;
  flex-shrink: 0;
  transition: all 0.15s;
}
.overlap-btn.active {
  background: #fef3c7;
  border-color: #C99B43;
  color: #92400e;
  font-weight: 600;
}
.overlap-btn.active::before {
  background: #C99B43;
  border-color: #C99B43;
}

/* FEAT-136 (US-003): pin-mode "active" now uses the unified navy control treatment
   (.action-btn.active) instead of the old green fill. */
#pin-mode-btn.active { font-weight: 600; }
.overlap-btn:hover:not(.active) {
  background: #f8fafc;
  border-color: #94a3b8;
}

.overlap-status {
  margin-top: 6px;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: var(--r-tag);
  line-height: 1.4;
}
.overlap-status.info   { background: #eff6ff; color: #1e40af; }
.overlap-status.warn   { background: #fef9c3; color: #854d0e; }
.overlap-status.error  { background: #fef2f2; color: #991b1b; }
.overlap-status.hidden { display: none; }

.select-all-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 11px;
  color: #64748b;
}

.select-all-bar button {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--gb-indigo);
  cursor: pointer;
  padding: 2px 0;
}
.select-all-bar button:hover { text-decoration: underline; }

#school-list {
  padding: 8px 0;
}

.school-item {
  padding: 8px 16px;
  border-left: 3px solid transparent;
  transition: background 0.1s;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.school-item-checkbox {
  flex-shrink: 0;
  margin-top: 2px;
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #1F3A8A;
}

.school-item-body {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.school-item.unchecked {
  opacity: 0.45;
}

.school-item:hover {
  background: #f8fafc;
}

.school-item.active {
  background: #f0f9ff;
  border-left-color: #2A4FA0;
}

.school-item.boys { border-left-color: var(--boys-color); }
.school-item.girls { border-left-color: var(--girls-color); }
.school-item.mixed { border-left-color: var(--mixed-color); }

.school-type-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.school-type-dot.boys { background: var(--boys-color); }
.school-type-dot.girls { background: var(--girls-color); }
.school-type-dot.mixed { background: var(--mixed-color); }

.school-item-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
}

.school-item-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.school-item.hidden {
  display: none;
}

/* Map */
#map {
  flex: 1;
  min-height: 0;
  height: calc(100vh - var(--header-height) - var(--action-bar-height));
  z-index: 1;
}

/* Detail panel — redesigned tabbed card (design/design_handoff_school_card).
   #detail-panel is now just the floating positioning wrapper; the inner
   .sc.sc--panel card supplies its own background, radius, border and shadow. */
#detail-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 408px;
  max-width: calc(100vw - 40px);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  z-index: 1000;
  transition: transform 0.2s, opacity 0.2s;
}

#detail-panel.hidden {
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
}

/* Report-a-boundary link sits just under the floating card. */
#detail-panel > #detail-report-link.report-link {
  display: block;
  margin: 8px 2px 0;
  text-align: right;
  font-size: 11px;
}
#detail-panel > #detail-report-link.report-link.hidden { display: none; }

/* FEAT-165: school name + track star sit on one row. */
.detail-name-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  padding-right: 24px; /* clear the absolute-positioned close (×) button */
}

#detail-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

/* FEAT-165 (US-008): detail-panel accordion sections */
.detail-section {
  border-top: 1px solid #f1f5f9;
}
.detail-section > summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: #1f3a8a;
  padding: 9px 0;
  user-select: none;
}
.detail-section > summary::-webkit-details-marker { display: none; }
.detail-section > summary::after {
  content: '+';
  float: right;
  color: #94a3b8;
  font-weight: 400;
}
.detail-section[open] > summary::after { content: '\2212'; }
.detail-section-body {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  padding-bottom: 10px;
}

/* FEAT-165 (US-011): Details section key/value rows */
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
}
.detail-row-key { color: #94a3b8; flex-shrink: 0; }
.detail-row-val { color: #334155; text-align: right; font-weight: 500; }
.detail-row--sites { flex-direction: column; }
.detail-row--sites .detail-row-val { text-align: left; font-weight: 400; }
.detail-row-rank { color: #94a3b8; font-weight: 400; white-space: nowrap; }

/* FEAT-165 (US-012): empty-section fallback + Pro-gated locked rows + results trend */
.detail-section-empty { color: #94a3b8; font-style: italic; padding: 4px 0; }
.detail-locked-row .detail-row-key { display: flex; align-items: center; gap: 6px; }
.detail-locked-icon { display: inline-flex; color: #94a3b8; font-size: 13px; }
.detail-locked-link {
  color: #1f3a8a;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.detail-locked-link:hover { text-decoration: underline; }
/* FEAT-165 (US-016): data-provenance footer at the bottom of the detail card */
.detail-sources-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  line-height: 1.5;
  color: #94a3b8;
}
.detail-results-trend { padding: 6px 0 2px; }
.detail-results-trend > .detail-row-key { display: block; color: #94a3b8; margin-bottom: 3px; }
.detail-trend-line { color: #334155; font-weight: 500; }
.detail-trend-years { color: #94a3b8; font-weight: 400; }
.detail-trend-lines { color: #334155; font-weight: 500; }
/* Multi-year last-distance trend: direction badge beside the cutoff bars (Admissions tab) */
.sc-trend-badge { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 9999px; font-size: 10px; font-weight: 700; vertical-align: middle; }
.sc-trend-badge--expanding { background: #dcfce7; color: #166534; }
.sc-trend-badge--shrinking { background: #fee2e2; color: #991b1b; }
.sc-trend-badge--stable { background: #e2e8f0; color: #475569; }

/* FEAT-165 (US-014): Admissions section — priority-criteria list + oversubscription caveat */
.detail-criteria-list { margin: 0; padding-left: 18px; }
.detail-oversubscription-caveat {
  font-size: 12px;
  color: #64748b;
  padding: 2px 0 4px;
}

/* FEAT-165 (US-013): Ofsted section — year suffix, stale banner, inspection history */
.detail-ofsted-year { color: #64748b; font-weight: 400; }
.detail-ofsted-stale {
  font-size: 12px;
  color: #92400e;
  background: #fef3c7;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 4px 0;
}
.detail-ofsted-stale a { color: #92400e; }
.detail-ofsted-history { padding: 6px 0 2px; }
.detail-ofsted-history > .detail-row-key { display: block; color: #94a3b8; margin-bottom: 3px; }
.detail-ofsted-history-list { list-style: none; margin: 0; padding: 0; }
.detail-ofsted-history-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  color: #334155;
}
.detail-ofsted-history-date { color: #94a3b8; }
.detail-ofsted-history-grade { font-weight: 500; text-align: right; }

/* FEAT-165 (US-009): summary header mini-stat blocks */
.detail-mini-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.detail-tier-badge-row { flex-basis: 100%; }
.detail-mini-stat {
  flex: 1 1 0;
  min-width: 92px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 7px 9px;
}
.detail-mini-stat-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  color: #1f3a8a;
  margin-bottom: 4px;
}
.detail-mini-stat-body { font-size: 12px; color: #475569; line-height: 1.45; }
.detail-mini-stat-row { display: flex; justify-content: space-between; gap: 6px; }
.detail-mini-stat-key { color: #94a3b8; }
.detail-mini-stat-val { color: #334155; font-weight: 600; text-align: right; }
.detail-mini-stat-empty { color: #94a3b8; font-style: italic; }
.detail-mini-stat-distance {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  background: #e0e7ff;
  color: #1f3a8a;
  border-radius: 6px;
  padding: 1px 6px;
  font-weight: 600;
}

#detail-catchment-status {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--r-tag);
  margin-bottom: 12px;
}

#detail-catchment-status.available {
  background: #dcfce7;
  color: #166534;
}

#detail-catchment-status.missing {
  background: #fef9c3;
  color: #854d0e;
}

.showcase-info-card {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--r-tag);
  margin-bottom: 12px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  line-height: 1.5;
}
.showcase-info-card a { color: #1d4ed8; }

/* FEAT-84: historical-catchment rings toggle */
#detail-probability {
  margin-bottom: 12px;
}

#detail-probability:empty {
  display: none;
}

.probability-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
}

.probability-toggle input {
  cursor: pointer;
}

/* FEAT-84 (US-005): pin-relative band readout + trust copy */
.probability-readout {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 4px solid #94a3b8;
  border-radius: var(--r-tag);
  background: #f8fafc;
  font-size: 13px;
  color: #334155;
}

.probability-band-green   { border-left-color: #16a34a; }
.probability-band-amber   { border-left-color: #C99B43; }
.probability-band-red     { border-left-color: #dc2626; }
.probability-band-outside { border-left-color: #64748b; }

.probability-band-label {
  display: inline-block;
  font-weight: 700;
}

.probability-band-green   .probability-band-label { color: #15803d; }
.probability-band-amber   .probability-band-label { color: #b45309; }
.probability-band-red     .probability-band-label { color: #b91c1c; }
.probability-band-outside .probability-band-label { color: #475569; }

/* FEAT-76: Mock score panel (sidebar) */
.score-panel { padding-top: 4px; }
/* FEAT-157: .analytics-collapse-toggle / -chevron grouped here so Mock score and
   Commute share pixel-identical collapsible header + chevron styling. */
.score-panel-toggle,
.analytics-collapse-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-control);
  font: inherit;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  text-align: left;
}
.score-panel-toggle:hover,
.analytics-collapse-toggle:hover { background: #e2e8f0; }
.score-panel-title { flex: 1; }
.score-panel-chevron,
.analytics-collapse-chevron { color: #64748b; font-size: 12px; }
.score-lock-icon { font-size: 13px; }
.score-panel-body { padding: 10px 2px 2px; }
.score-input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}
.score-input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-control);
  font: inherit;
  box-sizing: border-box;
}
.score-input:focus { outline: 2px solid var(--gb-indigo); outline-offset: 1px; }
.score-input + .score-input-label { margin-top: 10px; }
.score-panel-note { margin: 6px 0 0; font-size: 11px; color: #64748b; }
.score-upsell-copy { margin: 0 0 8px; font-size: 12px; color: #334155; }
.score-unlock-btn {
  padding: 7px 12px;
  background: var(--gb-indigo);
  color: #fff;
  border: none;
  border-radius: var(--r-control);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.score-unlock-btn:hover { background: #163073; }

/* FEAT-76: score-eligibility rows in the eligibility card — reuse FEAT-84 band styling */
.eligibility-score-section { margin-top: 10px; }
.eligibility-score-heading { color: #1e293b; }
.eligibility-score-row {
  border-left: 4px solid #94a3b8;
  border-radius: var(--r-tag);
  background: #f8fafc;
  margin-top: 4px;
}
.score-band-label { margin-left: auto; font-size: 12px; }

/* FEAT-76 (US-002): pass/no-pass gate badge on an eligibility school row */
.score-badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.score-badge--passed { background: #dcfce7; color: #15803d; }
.score-badge--nopass { background: #fee2e2; color: #b91c1c; }

/* FEAT-117 (US-006): neutral oversubscription ratio badge on eligibility rows */
.oversubscription-badge {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  background: #f1f5f9;
  color: #475569;
  cursor: help;
}

/* FEAT-76 (US-003): score-band readout in the detail panel — reuse band styling */
#detail-score:empty { display: none; }
.detail-score-band {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 4px solid #94a3b8;
  border-radius: var(--r-tag);
  background: #f8fafc;
  font-size: 13px;
  color: #334155;
}

/* FEAT-76 (US-005): band-coloured glow on a school marker reflecting the entered
   score. Keeps the Ofsted/type pin fill (FEAT-32) — only adds an outer glow, or a
   dim for a no-pass. */
.leaflet-marker-icon.score-ring--green   { filter: drop-shadow(0 0 3px #16a34a) drop-shadow(0 0 1px #16a34a); }
.leaflet-marker-icon.score-ring--passed  { filter: drop-shadow(0 0 3px #16a34a); }
.leaflet-marker-icon.score-ring--amber   { filter: drop-shadow(0 0 3px #C99B43) drop-shadow(0 0 1px #C99B43); }
.leaflet-marker-icon.score-ring--red     { filter: drop-shadow(0 0 3px #dc2626) drop-shadow(0 0 1px #dc2626); }
.leaflet-marker-icon.score-ring--nopass  { opacity: 0.4; }

/* FEAT-155 (US-007): Tier Analysis state on the pin's inner SVG circle. A separate
   channel from the score outer-ring above — priority = solid green, open = solid
   grey, needs-info = hollow/dashed faint. No class = today's white inner circle. */
.leaflet-marker-icon.tier-state--priority svg circle { fill: #16a34a; stroke: #ffffff; stroke-width: 1.5; }
.leaflet-marker-icon.tier-state--open svg circle     { fill: #94a3b8; stroke: #ffffff; stroke-width: 1.5; }
.leaflet-marker-icon.tier-state--needs-info svg circle { fill: none; stroke: #64748b; stroke-width: 1.5; stroke-dasharray: 2 2; opacity: 0.75; }

/* FEAT-155 (US-007): tier badge on eligibility-card + sidebar rows */
.tier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}
.tier-badge--priority  { background: #dcfce7; color: #15803d; }
.tier-badge--open      { background: #f1f5f9; color: #475569; }
.tier-badge--needs-info { background: #f8fafc; color: #94a3b8; border: 1px dashed #cbd5e1; }

/* FEAT-155 (US-007): Tier Analysis panel chrome in the Analytics drawer */
/* FEAT-167: child selector shown when more than one child profile exists */
.tier-child-select { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 10px; }
.tier-child-select > span { font-weight: 600; color: #475569; }
.tier-child-select select { flex: 1 1 auto; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; color: #1e293b; background: #fff; }
.tier-analysis-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.tier-analysis-disclaimer { font-size: 12px; color: #64748b; margin: 8px 0 0; line-height: 1.4; }
.tier-analysis-noprofile { font-size: 13px; color: #475569; margin: 0; line-height: 1.4; }

/* Personal-circumstance toggles in the Tier analysis panel. Service premium is
   saved; the rest are session-only (see .tier-circ-note). */
.tier-circ-group { margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid #e2e8f0; }
.tier-circ-heading { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #475569; margin: 0 0 8px; }
.tier-circ-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #1e293b; line-height: 1.35; cursor: pointer; padding: 4px 0; }
.tier-circ-row input { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }
.tier-circ-note { font-size: 11px; color: #64748b; margin: 8px 0 0; line-height: 1.45; }
.tier-circ-edit { margin: 8px 0 0; background: none; border: none; padding: 0; font-size: 12px; font-weight: 600; color: var(--gb-indigo, #4f46e5); cursor: pointer; }
.tier-circ-edit:hover { text-decoration: underline; }

/* FEAT-76 (US-005): resolved-band badge on a sidebar school-list row */
.school-score-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.school-score-badge--green,
.school-score-badge--passed { background: #dcfce7; color: #15803d; }
.school-score-badge--amber  { background: #fef3c7; color: #b45309; }
.school-score-badge--red,
.school-score-badge--nopass { background: #fee2e2; color: #b91c1c; }

/* FEAT-76 (US-005): score-only summary in the Mock score panel (no pin dropped) */
.score-only-summary { margin-top: 10px; }
.score-only-summary:empty { display: none; }
.score-only-heading {
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
  margin-bottom: 4px;
}
.score-only-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 4px;
  padding: 5px 6px;
  margin-top: 4px;
  border: none;
  border-left: 4px solid #16a34a;
  border-radius: var(--r-tag);
  background: #f0fdf4;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.score-only-name { font-size: 12px; color: #334155; font-weight: 600; }
.score-only-label { margin-left: auto; font-size: 11px; color: #15803d; }

.probability-pin-distance {
  margin-left: 6px;
  color: #475569;
}

.probability-years {
  margin: 6px 0 0;
}

.probability-caveat {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #64748b;
}

.probability-verified {
  white-space: nowrap;
}

/* FEAT-84 (US-006): free-tier locked toggle + inline upsell */
.probability-toggle-locked {
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.probability-lock-icon {
  font-size: 12px;
  line-height: 1;
}

.probability-upsell {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-control);
  background: #f8fafc;
}

.probability-upsell-copy {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
}

.probability-unlock-btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--gb-indigo);
  border: none;
  border-radius: var(--r-control);
  cursor: pointer;
}

.probability-unlock-btn:hover {
  background: #163073;
}

#detail-admissions-link,
#detail-admissions-guide-link {
  font-size: 13px;
  color: var(--gb-indigo);
  text-decoration: none;
  font-weight: 500;
}

#detail-admissions-link:hover,
#detail-admissions-guide-link:hover {
  text-decoration: underline;
}

#detail-admissions-guide-link.hidden {
  display: none;
}

/* FEAT-165: admissions hyperlinks relocated into the Admissions accordion tab. */
.detail-admissions-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.detail-admissions-links a {
  font-size: 13px;
  color: var(--gb-indigo);
  text-decoration: none;
  font-weight: 500;
}
.detail-admissions-links a:hover { text-decoration: underline; }
.detail-admissions-links a.hidden { display: none; }

/* Legend */
#legend {
  position: absolute;
  /* Top-left row: Map key first, then the layers control to its right. #legend
     is relocated into #app by map.js, so top/left are relative to #app (which
     drops below the action bar) — the button tracks the Schools/Layers buttons
     when the search bar grows. Leftmost at map-left + Leaflet's 10px margin
     (= sidebar + 10); top 10px lines up with the layers control's 10px margin.
     Map key sits before layers so the layers panel expands into empty space —
     it can't render behind the Map key (z:45 still sits over the in-map controls,
     which live inside #map at z:1, a self-contained stacking context).

     z-index 45 matches the sibling .schools-pill so the whole top-left control
     row shares one band — and, crucially, sits *behind* the floating overlay
     cards (#detail-panel z:1000, #eligibility-overlay z:46). On mobile a card
     slides up across this row; like the layers control, the Map key is then
     painted over by the card where they overlap, instead of bleeding on top of
     it (it previously tied the card at z:1000 and won on paint order). */
  top: 10px;
  left: calc(var(--sidebar-width) + 10px);
  background: white;
  border-radius: var(--r-control);
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  padding: 12px 14px;
  z-index: 45;
  font-size: 12px;
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
#legend.legend-collapsed .legend-header { margin-bottom: 0; }
#legend.legend-collapsed #legend-body { display: none; }

/* Collapsed map key = an icon-only square button matching the Leaflet layers
   control (white, themed border/radius/shadow). The container sheds its own
   chrome so the toggle button carries the look. */
#legend.legend-collapsed {
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
#legend.legend-collapsed .legend-title { display: none; }
#legend.legend-collapsed .legend-toggle-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--control-active);
  background: #fff;
  border: var(--control-border);
  border-radius: var(--control-radius);
  box-shadow: var(--control-shadow);
}
#legend.legend-collapsed .legend-toggle-btn:hover {
  background: #F4EFE2;
  border-color: var(--control-active);
  color: var(--control-active);
}

.legend-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.legend-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.legend-toggle-btn:hover { color: #374151; }

#legend h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: #374151;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: var(--r-tag);
  border: 2px solid;
  flex-shrink: 0;
}
.legend-swatch.boys { background: var(--boys-fill); border-color: var(--boys-color); }
.legend-swatch.girls { background: var(--girls-fill); border-color: var(--girls-color); }
.legend-swatch.mixed { background: var(--mixed-fill); border-color: var(--mixed-color); }

.legend-note {
  color: #9ca3af;
  font-size: 11px;
  margin-top: 4px;
}

/* Boundary quality badge */
.boundary-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--r-tag);
  cursor: default;
  white-space: nowrap;
  vertical-align: middle;
}
.boundary-badge.polygon {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.boundary-badge.circle {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
}
.boundary-badge.polygon.stale {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.detail-section-body .boundary-badge {
  white-space: normal;
  vertical-align: baseline;
  font-size: 12px;
  font-weight: 400;
}

/* Ofsted grade badge */
.ofsted-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--r-tag);
  border: 1px solid;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Multi-site list in detail panel */
.detail-sites-list {
  margin: 4px 0 0 16px;
  padding: 0;
  font-size: 13px;
  color: #475569;
}

/* Detail panel warning banner */
.detail-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-control);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.detail-warning-banner.warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.detail-warning-banner.info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.detail-warning-banner.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.detail-warning-banner .warning-icon {
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1.4;
}

.school-item-alert {
  font-size: 11px;
  margin-left: 3px;
  vertical-align: middle;
  cursor: default;
}

.school-item-distance {
  color: var(--gb-indigo);
  font-weight: 600;
}

.school-item-drive {
  color: #64748b;
}

/* Geolocation button */
.geo-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: var(--r-tag);
  border: 1px solid #cbd5e1;
  background: white;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.geo-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
}

.geo-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.geo-btn.hidden {
  display: none;
}

/* Eligibility card (FEAT-10) */
.eligibility-card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--gb-cyan);
  border-radius: var(--r-control);
  background: var(--surface-paper);
  font-size: 13px;
  overflow: hidden;
}

.eligibility-overlay.hidden {
  display: none;
}

/* Eligibility overlay (FEAT-22) — floats top-right over the map */
.eligibility-overlay {
  position: fixed;
  top: 88px;
  right: 16px;
  width: 280px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  z-index: 46;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  margin: 0;
}

/* Eligible schools divider in sidebar list (FEAT-23) */
.school-list-divider {
  font-size: 11px;
  color: #94a3b8;
  padding: 6px 12px 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
}

.eligibility-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-paper);
}

.eligibility-card-title {
  flex-grow: 1;
  font-weight: 600;
  font-size: 12px;
  color: var(--gb-navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eligibility-drag-handle {
  background: none;
  border: none;
  padding: 2px;
  cursor: grab;
  color: var(--ink-faint);
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.eligibility-drag-handle:active {
  cursor: grabbing;
}

.eligibility-minimise-btn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--ink-faint);
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.eligibility-minimise-btn:hover {
  color: var(--gb-navy);
}

/* Minimised state — body and actions hidden, header stays */
#eligibility-overlay.minimised .eligibility-card-body,
#eligibility-overlay.minimised .eligibility-body-gate,
#eligibility-overlay.minimised .eligibility-gate-cta,
#eligibility-overlay.minimised .eligibility-group,
#eligibility-overlay.minimised .eligibility-changes-section,
#eligibility-overlay.minimised .eligibility-other-heading,
#eligibility-overlay.minimised .eligibility-caveat-footer,
#eligibility-overlay.minimised .eligibility-zone-upsell,
#eligibility-overlay.minimised .eligibility-save-upsell,
#eligibility-overlay.minimised .eligibility-card-actions,
#eligibility-overlay.minimised .eligibility-tab-bar,
#eligibility-overlay.minimised .eligibility-school-row,
#eligibility-overlay.minimised .eligibility-score-section,
#eligibility-overlay.minimised .eligibility-changes-same,
#eligibility-overlay.minimised .cross-la-panel,
#eligibility-overlay.minimised .commute-status,
#eligibility-overlay.minimised .eligibility-subsection-heading,
#eligibility-overlay.minimised .eligibility-subsection,
#eligibility-overlay.minimised .eligibility-tier-heading,
#eligibility-overlay.minimised .eligibility-commute-details,
#eligibility-overlay.minimised .eligibility-commute-prompt {
  display: none;
}

/* FEAT-153 US-015: commute-status row injected below the eligibility card header. */
.commute-status {
  padding: 8px 12px;
  font-size: 12px;
  color: #334155;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  line-height: 1.4;
}

/* FEAT-153 US-016: subsection split — "In your commute" / "Outside your commute".
   L0 of the card hierarchy: a tinted full-width band so the commute split reads as
   the strongest section break, above the tier (L1) and gender (L2) groupings. */
.eligibility-subsection-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gb-navy);
  margin: 0;
  padding: 8px 12px;
  background: var(--surface-muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.eligibility-subsection--outside-commute {
  opacity: 0.6;
}

/* FEAT-162 US-009: tier sub-group headings, collapsed outside-commute <details>,
   and the fallback "set a commute time" prompt.
   L1 of the card hierarchy: each tier is an indented box with a colour-coded left
   rail — indigo (personal circumstances), green (priority / in catchment, matching
   the Priority badge) and slate (open, matching the Open badge). The indent + rail
   make every tier read as a child of the L0 commute band above it. */
.eligibility-tier-group {
  margin: 6px 10px 6px 12px;
  border-left: 3px solid var(--line);
  border-radius: 0 6px 6px 0;
  background: rgba(15, 23, 42, 0.02);
  overflow: hidden;
}
.eligibility-tier-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin: 0;
  padding: 6px 12px 4px 10px;
}
/* Rows and gender sub-headings sit just inside the rail. */
.eligibility-tier-group .eligibility-school-row { padding-left: 10px; }
.eligibility-tier-group .eligibility-group { padding-top: 2px; }

.eligibility-tier-group--circumstances {
  border-left-color: var(--gb-indigo);
  background: rgba(31, 58, 138, 0.05);
}
.eligibility-tier-group--circumstances .eligibility-tier-heading {
  color: var(--gb-indigo);
}
.eligibility-tier-group--priority {
  border-left-color: var(--band-green);
  background: rgba(22, 163, 74, 0.045);
}
.eligibility-tier-group--priority .eligibility-tier-heading {
  color: #15803d;
}
.eligibility-tier-group--open {
  border-left-color: var(--ink-quiet);
  background: rgba(100, 116, 139, 0.035);
}
.eligibility-tier-group--open .eligibility-tier-heading {
  color: var(--ink-muted);
}
.eligibility-basis-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
  white-space: nowrap;
}
.eligibility-basis-chip--personal {
  color: var(--gb-accent);
  background: rgba(31, 58, 138, 0.1);
}
.eligibility-basis-chip--catchment {
  color: #475569;
  background: #e2e8f0;
}
summary.eligibility-subsection-heading {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
summary.eligibility-subsection-heading::-webkit-details-marker {
  display: none;
}
/* Disclosure caret so the collapsed "Outside" band reads as expandable. */
summary.eligibility-subsection-heading::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--t-fast);
  margin-left: 8px;
  flex-shrink: 0;
}
.eligibility-commute-details[open] > summary.eligibility-subsection-heading::after {
  transform: rotate(45deg);
}
.eligibility-commute-prompt {
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
.eligibility-commute-prompt-link {
  color: var(--gb-accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.eligibility-commute-prompt-link:hover,
.eligibility-commute-prompt-link:focus {
  text-decoration: underline;
}

/* FEAT-153 US-017: sidebar "Outside your commute" section sits below the
   pin pointer and renders dimmed so it reads as lowest-priority. */
.sidebar-outside-commute-section {
  opacity: 0.6;
}
.commute-status-adjust {
  color: #1F3A8A;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.commute-status-adjust:hover,
.commute-status-adjust:focus {
  text-decoration: underline;
}

#eligibility-overlay.minimised .eligibility-card-header {
  cursor: pointer;
  border-bottom: none;
}

/* Resize corner handles */
.eligibility-resize-br,
.eligibility-resize-bl {
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 10px;
  z-index: 10;
}

.eligibility-resize-br {
  right: 0;
  cursor: se-resize;
}

.eligibility-resize-bl {
  left: 0;
  cursor: sw-resize;
}

/* Sheet mode (all viewports): the legacy desktop resize corners don't apply. */
#eligibility-overlay.gb-bottom-sheet .eligibility-resize-br,
#eligibility-overlay.gb-bottom-sheet .eligibility-resize-bl {
  display: none;
}

.eligibility-sheet-handle {
  display: none;
  width: 40px;
  height: 5px;
  background: #cbd5e1;
  border-radius: var(--r-tag);
  margin: 0 auto;
  flex-shrink: 0;
}

/* Sheet mode (all viewports): the sheet's grab-handle replaces the desktop
   floating card's drag grip + minimise button, and the header centres on it. */
#eligibility-overlay.gb-bottom-sheet .eligibility-drag-handle,
#eligibility-overlay.gb-bottom-sheet .eligibility-minimise-btn {
  display: none;
}

#eligibility-overlay.gb-bottom-sheet .eligibility-sheet-handle {
  display: block;
}

#eligibility-overlay.gb-bottom-sheet .eligibility-card-header {
  justify-content: center;
}

/* FEAT-127 (US-001): mobile eligibility bottom-sheet. The drag/tap handle and
   detent heights are driven by utils/bottom-sheet.js; this block only supplies
   the docked layout, the dismiss x, and the no-transition drag state. */
/* FEAT-162 US-011: the × is now the sole clear-pin affordance and is shown on
   every viewport (the mobile bottom-sheet re-positions it below). */
.eligibility-sheet-close {
  display: inline-flex;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--ink-faint);
  line-height: 1;
  align-items: center;
}

.eligibility-sheet-close:hover {
  color: var(--gb-navy);
}

/* Sheet mode (all viewports): dock the card to the bottom edge, full-width, with
   rounded top corners, drag affordances and the in-sheet detail drill-in. Keyed on
   the JS-applied .gb-bottom-sheet class (not a media query) so the same docked
   layout is used on desktop. */
  #eligibility-overlay.gb-bottom-sheet {
    top: auto;
    bottom: 0;
    /* Span the MAP only, not the schools-list sidebar to its left. --sidebar-width
       is 0 on mobile, so the sheet stays edge-to-edge there; on desktop it starts at
       the sidebar's right edge. left + right define the width, so width must be auto
       (a width:100% would start at the offset and overflow the right edge). */
    left: var(--sidebar-width);
    right: 0;
    width: auto;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    transition: height 0.25s ease;
  }

  #eligibility-overlay.gb-bottom-sheet.gb-sheet-dragging {
    transition: none;
  }

  #eligibility-overlay.gb-bottom-sheet .eligibility-card-header {
    position: relative;
    padding-right: 34px;
    touch-action: none;
  }

  #eligibility-overlay.gb-bottom-sheet .eligibility-sheet-handle {
    cursor: grab;
    touch-action: none;
  }

  #eligibility-overlay.gb-bottom-sheet .eligibility-sheet-close {
    display: flex;
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
  }

  /* FEAT-127 (US-002): in-sheet school detail drill-in. The persistent
     #detail-panel is relocated into the sheet, so neutralise its floating
     positioning and let it flow inside the sheet body. */
  #eligibility-overlay.gb-sheet-detail .eligibility-sheet-back {
    position: absolute;
    top: 4px;
    left: 8px;
    z-index: 2;
  }

  #detail-panel.detail-in-sheet {
    position: static;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    width: auto;
    box-shadow: none;
    padding: 12px 16px 16px;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    z-index: auto;
  }

  /* The sheet's own detents handle show/hide, so the floating-card collapse and
     close buttons are redundant once relocated into the sheet. */
  #detail-panel.detail-in-sheet #detail-close,
  #detail-panel.detail-in-sheet #detail-collapse {
    display: none;
  }

/* The back affordance only exists while a detail is drilled into the sheet. */
.eligibility-sheet-back {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--ink-faint);
  line-height: 1;
  flex-shrink: 0;
}

.eligibility-sheet-back:hover {
  color: var(--gb-navy);
}

.eligibility-clear-btn {
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-faint);
  padding: 0 2px;
}

.eligibility-clear-btn:hover {
  color: var(--gb-navy);
}

.eligibility-empty {
  padding: 10px 12px;
  color: #64748b;
  font-size: 12px;
}

.eligibility-group {
  padding: 4px 0 2px;
}

/* L2 of the card hierarchy: the gender sub-heading sits below the L1 tier heading,
   so it is lighter and smaller than the tier heading and indented one step deeper.
   Its rows indent to match, keeping the Boys/Girls/Mixed split clearly nested. */
.eligibility-group-heading {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  padding: 0 12px 3px 18px;
}
.eligibility-tier-group--priority .eligibility-group-heading { padding-left: 18px; }
.eligibility-tier-group--priority .eligibility-school-row { padding-left: 18px; }

.eligibility-school-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 12px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  color: #1e293b;
  line-height: 1.4;
  transition: background 0.1s;
}

.eligibility-school-row:hover {
  background: var(--surface-muted);
}

.eligibility-school-name {
  flex: 1;
  min-width: 0;
}

/* FEAT-161 (US-008): score-ranked Open tier rows stack a plain-English
   sub-label beneath the school name line. */
.eligibility-school-row--score-ranked {
  flex-direction: column;
  align-items: stretch;
}

.eligibility-school-row-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.eligibility-score-sublabel {
  display: block;
  margin-top: 2px;
  padding-left: 14px;
  font-size: 10.5px;
  color: #64748b;
}

.zone-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}
.zone-dot--green  { background: #22c55e; }
.zone-dot--amber  { background: #C99B43; }
.zone-dot--red    { background: #ef4444; }
.zone-dot--outside { background: #6b7280; }
.zone-dot--locked { background: #9ca3af; cursor: pointer; }

.eligibility-zone-upsell {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: var(--r-control);
  font-size: 12px;
}
.eligibility-zone-upsell.hidden { display: none; }
.eligibility-zone-upsell-copy { margin: 0 0 8px; color: #431407; }
.eligibility-zone-upsell-actions { display: flex; gap: 8px; align-items: center; }
.eligibility-zone-upsell-btn {
  background: #f97316;
  color: #fff;
  border: none;
  border-radius: var(--r-tag);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.eligibility-zone-upsell-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #9a3412;
  padding: 0 4px;
  line-height: 1;
}

/* FEAT-86 US-008: save-address upsell card (free tier) */
.eligibility-save-upsell {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  border-radius: var(--r-control);
  font-size: 12px;
}
.eligibility-save-upsell.hidden { display: none; }
.eligibility-save-upsell-copy { margin: 0 0 8px; color: #233348; }
.eligibility-save-upsell-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eligibility-save-upsell-btn {
  background: #1F3A8A;
  color: #fff;
  border: none;
  border-radius: var(--r-tag);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: normal;
}
.eligibility-save-upsell-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #163073;
  padding: 0 4px;
  line-height: 1;
}

.eligibility-distance {
  font-size: 11px;
  font-weight: 600;
  color: var(--gb-indigo);
  margin-left: 8px;
  flex-shrink: 0;
  /* Sort the distance to the end of the (flex) row so it forms a right-aligned
     far-right column, after the school name and any tier/deadline badges. The
     school-name's flex:1 pushes this cluster to the right edge. Applies uniformly
     to the direct-child rows (priority groups, near-cutoff) and the nested
     .eligibility-school-row-line rows (open tier, your-circumstances). */
  order: 10;
}

/* Gated body overlay — free users see count but not school details */
.eligibility-body-gate {
  position: relative;
  overflow: hidden;
  border-radius: 0 0 8px 8px;
  /* Floor the height so the absolutely-positioned overlay (and its CTA) is
     always legible, even when the blur content is sparse (free users only
     have Gravesend client-side) or empty (count of 0). */
  min-height: 160px;
}
/* Teaser variant (FEAT-140): the CTA now sits above the body, so the blurred
   content needs no overlay and no min-height floor — it's purely a teaser. */
.eligibility-body-gate--teaser {
  min-height: 0;
}
/* Top-of-card upsell: copy + a prominent full-width Unlock button, directly
   under the headline so it's reachable without scrolling on mobile. */
.eligibility-gate-cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 16px;
  text-align: center;
  background: var(--gb-indigo-tint, #eef2ff);
  border-bottom: 1px solid #e2e8f0;
}
.eligibility-gate-cta-copy {
  margin: 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
}
.eligibility-body-blur {
  filter: blur(5px);
  user-select: none;
  pointer-events: none; /* gated teaser: block click-through to the blurred school rows */
}
.eligibility-body-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.82);
  padding: 20px 16px;
  text-align: center;
  gap: 12px;
  pointer-events: none;
}
.eligibility-body-overlay-copy {
  margin: 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
  max-width: 220px;
}
.eligibility-upgrade-btn {
  display: inline-block;
  background: var(--gb-indigo);
  color: #fff;
  border-radius: var(--r-control);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  pointer-events: auto;
}
.eligibility-upgrade-btn:hover { background: var(--gb-navy); }
/* Prominent block variant for the top-of-card gate CTA. */
.eligibility-upgrade-btn--block {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.3);
}

.eligibility-cutoff {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #64748b;
  margin-top: 1px;
}

.eligibility-caveat-footer {
  background: #fef9c3;
  border-top: 1px solid #fde68a;
  color: #854d0e;
  font-size: 11px;
  padding: 6px 12px;
}

/* FEAT-58: copy button and header actions */
.eligibility-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.eligibility-copy-btn {
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  background: white;
  color: #475569;
  border-radius: var(--r-tag);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}

.eligibility-copy-btn:hover {
  background: #f1f5f9;
}

/* FEAT-57: compare and clear-comparison buttons */
.eligibility-compare-btn {
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid #5E7245;
  color: #5E7245;
  background: transparent;
  border-radius: var(--r-tag);
  cursor: pointer;
  white-space: nowrap;
}

.eligibility-clear-comparison-btn {
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  background: white;
  color: #475569;
  border-radius: var(--r-tag);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}

.eligibility-clear-comparison-btn:hover {
  background: #f1f5f9;
}

/* FEAT-126 US-007: bottom action strip */
.eligibility-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  background: var(--surface-paper);
  flex-wrap: wrap;
}

.eligibility-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 4px 7px;
  border-radius: var(--r-control);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
  line-height: 1;
}

.eligibility-action-btn .gb-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.eligibility-action-btn--primary {
  border: 1px solid #1F3A8A;
  color: #1F3A8A;
  background: transparent;
}

.eligibility-action-btn--primary:hover {
  background: #ede9fe;
}

.eligibility-action-btn--secondary {
  border: 1px solid #cbd5e1;
  color: #475569;
  background: white;
}

.eligibility-action-btn--secondary:hover {
  background: #f1f5f9;
}

/* Locked-catchment padlock upsell popup (free tier, incl. signed-out). Themed to
   brand: centred copy + a solid indigo Pro CTA. No school count, no price. */
.gated-upsell-popup {
  text-align: center;
  padding: 4px 2px 2px;
  max-width: 220px;
}

.gated-upsell-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  border-radius: var(--r-pill, 999px);
  background: var(--gb-indigo-50, #F4EFE2);
  color: var(--gb-indigo, #1F3A8A);
}

.gated-upsell-icon svg {
  width: 16px;
  height: 16px;
}

.gated-upsell-copy {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2, #1e293b);
}

.gated-upsell-btn {
  display: inline-block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  border-radius: var(--r-control, 8px);
  background: var(--gb-indigo, #1F3A8A);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast, 0.15s ease);
}

.gated-upsell-btn:hover {
  background: var(--gb-navy, #040F49);
}

.gated-upsell-btn:focus-visible {
  outline: 2px solid var(--gb-cyan, #C99B43);
  outline-offset: 2px;
}

/* FEAT-162 US-011: "More" overflow menu — opens upward from the action strip. */
.eligibility-more-wrap {
  position: relative;
  display: inline-flex;
}

.eligibility-more-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-control);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  z-index: 20;
}

.eligibility-more-menu .eligibility-action-btn {
  justify-content: flex-start;
  width: 100%;
}

/* FEAT-162 US-011: Generate report inline "coming soon" tooltip. */
.eligibility-report-wrap {
  position: relative;
  display: inline-flex;
}

.eligibility-report-tooltip {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--r-control);
  background: var(--gb-text, #1a1a1a);
  color: #fff;
  z-index: 20;
}

/* FEAT-166: in sheet mode (all viewports) the action strip (incl. Generate report)
   is hidden at Peek (the sheet is a teaser there) and docks as a sticky footer at
   Half and Full so the primary actions stay reachable without dragging the sheet to
   Full — the reported bug was that the buttons were invisible at the Half detent the
   sheet opens at, and no amount of scrolling revealed them. The safe-area pad clears
   the iOS home indicator / browser chrome so the strip is never occluded. */
#eligibility-overlay.gb-bottom-sheet .eligibility-card-actions {
  display: none;
}
#eligibility-overlay.gb-bottom-sheet.gb-sheet-half .eligibility-card-actions,
#eligibility-overlay.gb-bottom-sheet.gb-sheet-full .eligibility-card-actions {
  display: flex;
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -6px 14px -6px rgba(15, 23, 42, 0.18);
}

/* FEAT-57: tab bar */
.eligibility-tab-bar {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 8px;
}

.eligibility-tab {
  display: inline-block;
  padding: 5px 10px;
  font-size: 13px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eligibility-tab.active {
  border-bottom: 2px solid var(--gb-indigo);
  color: #0f172a;
  font-weight: 600;
}

/* FEAT-57: changes section */
.eligibility-changes-section {
  border-top: 1px solid #e2e8f0;
  margin-top: 8px;
  padding-top: 8px;
  padding-left: 12px;
  padding-right: 12px;
  padding-bottom: 8px;
}

.eligibility-other-heading {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px 4px;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
}

.eligibility-changes-heading {
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.eligibility-change-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 12px;
}

.change-badge {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: var(--r-tag);
  font-weight: 500;
  flex-shrink: 0;
}

.change-badge.gained {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #15803d;
}

.change-badge.lost {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.change-school-name {
  color: #1e293b;
}

.eligibility-changes-same {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

/* FEAT-53 / FEAT-63: crossover badge */
.crossover-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: var(--r-tag);
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #C7BCA0;
  font-weight: 600;
  margin-left: 3px;
  vertical-align: middle;
}

/* Postcode search */
.postcode-input-row {
  display: flex;
  gap: 6px;
}

.postcode-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-tag);
  font-size: 13px;
  color: #1e293b;
  background: white;
  min-width: 0;
}

.postcode-input:focus {
  outline: 2px solid var(--gb-indigo);
  outline-offset: 1px;
  border-color: var(--gb-indigo);
}

.postcode-submit-btn {
  padding: 6px 12px;
  border-radius: var(--r-tag);
  border: 1px solid #cbd5e1;
  background: #040F49;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.postcode-submit-btn:hover {
  background: #334155;
}

.postcode-submit-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Hamburger button — hidden on desktop */
#menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: var(--r-tag);
}

/* Drawer overlay backdrop.
   z-index 48 sits above the floating map controls (#legend 45, .schools-pill 45,
   .eligibility-overlay 46, .featured-hint 47) so they dim with the rest of the
   map when a panel opens — otherwise the Map key button poked above the backdrop
   and looked "highlighted". Still below every drawer/panel (mobile #sidebar 50,
   .nav-drawer 1100, .filters-panel/.analytics-panel 1200). */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 48;
}

.drawer-overlay.visible {
  display: block;
}

/* FEAT-133: navigation drawer (mobile) — opened by the hamburger, slides from left */
.nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(80vw, 280px);
  background: #040F49;
  z-index: 1100;
  flex-direction: column;
  padding: 0 0 16px;
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0.25s ease;
}
.nav-drawer.open {
  transform: translateX(0);
  visibility: visible;
}
.nav-drawer-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}
.nav-drawer-logo {
  height: 28px;
  display: block;
}
.nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  box-sizing: border-box;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  padding: 12px 24px;
  border-left: 3px solid transparent;
}
.nav-drawer-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
/* FEAT-145: visible active-page indicator. */
.nav-drawer-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 600;
  border-left: 3px solid var(--gb-cyan);
}
/* FEAT-145: signed-out = filled indigo CTA, pinned at the top above the nav links. */
.nav-drawer-auth {
  justify-content: center;
  margin: 4px 16px 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--gb-indigo);
  background: var(--gb-indigo);
  color: #fff;
  font-weight: 600;
}
.nav-drawer-auth:hover { background: #163073; color: #fff; }
/* FEAT-145: signed-in = ghost/outlined (indigo border + text, transparent fill). */
.nav-drawer-auth.is-authenticated {
  background: transparent;
  border: 1px solid var(--gb-indigo-200);
  color: var(--gb-indigo-200);
}
.nav-drawer-auth.is-authenticated:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ── White action bar (FEAT-133 US-004) ── */
.action-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 16px;
  flex-shrink: 0;
  z-index: 20;
}
.action-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.action-postcode {
  /* Width sized so the Go button's right edge aligns with the schools-list
   * sidebar's right edge below: sidebar width minus the action-bar's 16px
   * left padding. Overridden on mobile (sidebar collapses to a drawer there). */
  flex: 0 0 calc(var(--sidebar-width) - 16px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.action-postcode form { width: 100%; }

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--control-radius);
  border: var(--control-border);
  box-shadow: var(--control-shadow);
  background: white;
  color: var(--control-active);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.action-btn:hover:not(:disabled) {
  background: #F4EFE2;
  border-color: var(--control-active);
  color: var(--control-active);
}
/* Active / pressed / selected: solid navy with white content (icon inherits via currentColor). */
.action-btn.active,
.action-btn[aria-pressed="true"],
.action-btn.active:hover:not(:disabled),
.action-btn[aria-pressed="true"]:hover:not(:disabled) {
  background: var(--control-active);
  border-color: var(--control-active);
  color: #fff;
}
.action-btn:focus-visible {
  outline: 2px solid var(--control-focus);
  outline-offset: 2px;
}
.action-btn:disabled { opacity: 0.5; cursor: default; }
.action-btn-icon { font-size: 16px; line-height: 1; }

/* FEAT-136 (US-002): inline icon baseline — sizes to the control's font-size and
   inherits its colour via currentColor. Visual theming is refined in FEAT-136 US-003. */
.gb-icon {
  display: inline-block;
  vertical-align: middle;
  flex: none;
}

/* geo-btn shares .geo-btn (feature-detect hide) — reset its sidebar layout in the bar */
.action-bar .geo-btn {
  width: auto;
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  color: #1e293b;
}

/* Action-bar status messages drop below the control row */
.action-bar .overlap-status { margin-top: 0; }

/* ── Filters popover (desktop) ── */
.filters-panel {
  position: fixed;
  top: calc(var(--header-height) + var(--action-bar-height) + 8px);
  right: 16px;
  width: 320px;
  max-height: calc(100vh - var(--header-height) - var(--action-bar-height) - 32px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-control);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  z-index: 1200;
}
.filters-panel.hidden { display: none; }
.filters-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.filters-panel-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
}
.filters-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0 4px;
}
.filters-close-btn:hover { color: #1e293b; }
.filters-panel #filter-group { border: none; background: #fff; }

/* Analytics popover body (Mock score + Overlap + Coverage heat-map).
   Reuses .filters-panel positioning/drawer styles; body adds padding and a
   light divider between the score panel and the overlap/heat-map section. */
.analytics-panel-body { padding: 12px 16px 16px; }
.analytics-panel-body .score-panel { padding-top: 0; }

/* FEAT-157: two labelled groups — "Map coverage" and "For your child" */
.analytics-group {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}
.analytics-group:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.analytics-group-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.analytics-collapsible + .analytics-collapsible { margin-top: 10px; }

/* FEAT-157: on/off tools render as labelled toggle switches */
.analytics-switch-row + .analytics-switch-row { margin-top: 10px; }
.overlap-btn.analytics-switch {
  justify-content: space-between;
  gap: 10px;
}
.overlap-btn.analytics-switch::before { content: none; }
.analytics-switch-label {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.analytics-switch-track {
  position: relative;
  flex: none;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s;
}
.analytics-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s;
}
.analytics-switch.active .analytics-switch-track,
.analytics-switch[aria-pressed="true"] .analytics-switch-track { background: var(--gb-indigo); }
.analytics-switch.active .analytics-switch-thumb,
.analytics-switch[aria-pressed="true"] .analytics-switch-thumb { transform: translateX(16px); }

/* FEAT-157: identical lock chrome across all four tools (free tier) */
.analytics-locked-tool { padding: 2px 0; }
.analytics-tool-head {
  display: flex;
  align-items: center;
  gap: 7px;
}
.analytics-lock { font-size: 13px; flex: none; }
.analytics-row-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}
.analytics-tool-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}
.analytics-tool-desc.hidden { display: none; }

/* FEAT-157: collapsible body shared by Mock score + Commute rows */
.analytics-collapse-body { padding: 10px 2px 2px; }
.analytics-collapse-body[hidden] { display: none; }

/* FEAT-157: single shared upgrade CTA at the panel foot */
.analytics-upsell-foot { margin-top: 18px; }
.analytics-upsell-foot.hidden { display: none; }
.analytics-unlock-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-control);
  border: 1px solid var(--gb-indigo);
  background: var(--gb-indigo);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.analytics-unlock-btn:hover { background: #163073; }

/* FEAT-153 US-013: Commute section (mode selector + minutes slider) */
.commute-panel { display: block; }
.commute-mode {
  display: flex;
  flex-wrap: wrap; /* FEAT-153A: third (PT) option wraps to its own row */
  gap: 8px;
  margin-bottom: 10px;
}
.commute-mode-option {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-control);
  background: #fff;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
}
.commute-mode-option:has(input:checked) {
  border-color: #1F3A8A;
  background: #F4EFE2;
  color: #233348;
  font-weight: 600;
}
.commute-mode-option input { accent-color: #1F3A8A; }
/* FEAT-153A: PT departure-window / no-boundary explainer under the mode radios */
.commute-pt-note {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #64748b;
}
.commute-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.commute-slider-label {
  font-size: 12px;
  color: #475569;
}
#commute-minutes {
  width: 100%;
  accent-color: #1F3A8A;
}
.commute-actions {
  display: flex;
  gap: 8px;
}
.commute-save-btn,
.commute-clear-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--r-control);
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.commute-save-btn {
  background: #1F3A8A;
  color: #fff;
  border-color: #1F3A8A;
}
.commute-save-btn:hover { background: #163073; }
.commute-clear-btn:hover { background: #f1f5f9; }
.commute-upsell-copy {
  margin: 0 0 10px;
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}
.commute-unlock-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-control);
  border: 1px solid #1F3A8A;
  background: #1F3A8A;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.commute-unlock-btn:hover { background: #163073; }

/* ── Schools pill (mobile only) — floats top-left over the map ── */
/* Icon-only square button matching the Leaflet layers control (white, themed
   border/radius/shadow). Mobile-only (display flipped on in the media query). */
.schools-pill {
  display: none;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 45;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: var(--control-border);
  border-radius: var(--control-radius);
  padding: 0;
  color: var(--control-active);
  box-shadow: var(--control-shadow);
  cursor: pointer;
}
.schools-pill-icon { display: inline-flex; font-size: 20px; line-height: 1; }
.schools-pill-count { display: none; }

/* FEAT-129 (US-005): featured example catchment hint */
.featured-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 47;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(360px, calc(100% - 24px));
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-pill);
  padding: 8px 8px 8px 16px;
  font-size: 13px;
  line-height: 1.3;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  /* Let map clicks pass through; only the dismiss button is interactive. */
  pointer-events: none;
}
.featured-hint-text { flex: 1; }
.featured-hint-dismiss {
  pointer-events: auto;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  border-radius: var(--r-tag);
}
.featured-hint-dismiss:hover { color: #040F49; }

/* Responsive */
@media (max-width: 767px) {
  :root { --sidebar-width: 0px; }

  /* Show hamburger + nav drawer */
  #menu-btn { display: flex; }
  .nav-drawer { display: flex; }

  /* Hide subtitle to save header space */
  .subtitle { display: none; }

  /* Two-tier header: hamburger left, full logo centred, auth right; pills move to drawer */
  header { gap: 8px; padding: 0 12px; position: relative; }
  .header-logo { display: block; height: 30px; }
  .header-logo-mark { display: none; }
  .header-logo-link { position: absolute; left: 50%; transform: translateX(-50%); }
  .header-nav { display: none; }
  .header-auth { margin-left: auto; padding: 6px 11px; font-size: 12.5px; }

  /* Sidebar becomes a bottom drawer */
  #sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-right: none;
    border-top: 1px solid #e2e8f0;
    border-radius: var(--r-card) var(--r-card) 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 50;
    overflow: hidden;
  }

  #sidebar.drawer-open {
    transform: translateY(0);
  }

  header h1 { font-size: 15px; }
  #detail-panel { left: 10px; right: 10px; width: auto; max-width: none; bottom: 10px; }
  /* Top-left button row: Schools (left: 12) · Map key (left: 64) · Layers.
     #legend is relocated into #app by map.js, so top:12 mirrors the Schools
     button's top:12 within #app — all three track the action bar together.
     Each clears the previous 44px button plus an 8px gap. */
  #legend { top: 12px; left: 64px; bottom: auto; }
  /* The layers control is a Leaflet corner control; offset it within the
     top-left corner so it lands third in the row (12 → 64 → 116). */
  .leaflet-top.leaflet-left .leaflet-control-layers { margin: 12px 0 0 116px; }
  .eligibility-overlay { top: 64px; right: 8px; left: 8px; width: auto; max-height: 50vh; }

  /* FEAT-133 (US-004): single-row action bar with icon-only buttons */
  .action-bar { padding: 8px 12px; }
  .action-bar-row { gap: 6px; }
  /* No sidebar to align to on mobile — restore flex-grow + uncapped width. */
  .action-postcode { flex: 1 1 auto; max-width: none; }
  .action-btn-label { display: none; }
  .action-btn { padding: 8px 10px; }

  /* Schools button visible on mobile; sidebar opens as a bottom drawer via it.
     Bump to 44px to match the touch-enlarged Leaflet layers control. */
  .schools-pill { display: inline-flex; width: 44px; height: 44px; }
  #legend.legend-collapsed .legend-toggle-btn { width: 44px; height: 44px; }

  /* FEAT-129 (US-005): drop the hint below the Schools pill row on mobile */
  .featured-hint { top: 56px; font-size: 12px; padding: 7px 6px 7px 12px; }

  /* Filters become a right-hand drawer */
  .filters-panel {
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: min(88vw, 340px);
    height: 100%;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: -2px 0 24px rgba(0, 0, 0, 0.25);
  }
}

/* Key dates (FEAT-09)
   The dedicated map-sidebar button and the standalone modal were removed when
   the UI moved into the account drawer's Tracked schools collapsible
   (auth-drawer.js → keyDatesCollapsibleHtml). The .key-dates-year-label /
   .key-dates-section* / .key-date-* rules below are still reused by that
   inline rendering. */

.key-dates-year-label {
  font-size: 11px;
  color: #94a3b8;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.key-dates-section {
  margin-bottom: 16px;
}

.key-dates-section-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.key-date-item {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: var(--r-tag);
  border-left: 3px solid #cbd5e1;
}

.key-date-item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.key-date-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  min-width: 0;
}

.key-date-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--gb-indigo);
  flex-shrink: 0;
  white-space: nowrap;
}

.key-date-description {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* Compare bar (FEAT-12) — pinned to the bottom of the sidebar.
 * Sits below the `.sidebar-scroll` flex item, which has `flex: 1 1 auto`
 * and absorbs all spare space — so the compare bar is naturally pushed to
 * the bottom edge of the sidebar regardless of school-list length, and
 * stays put when the list inside `.sidebar-scroll` is scrolled. */
.compare-bar {
  padding: 8px 12px;
  flex-shrink: 0;
  background: white;
  border-top: 1px solid #e2e8f0;
}
.compare-bar.hidden { display: none; }

.compare-btn {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-tag);
  border: 1px solid var(--gb-indigo);
  background: var(--gb-indigo);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.compare-btn:hover { background: #163073; border-color: #1d4ed8; }

/* Compare modal (FEAT-12) */
.compare-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compare-modal.hidden { display: none; }

.compare-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 94vw);
  max-height: 80vh;
  background: white;
  border-radius: var(--r-control);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 767px) {
  .compare-card {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-height: 80vh;
    border-radius: var(--r-card) var(--r-card) 0 0;
  }
}

.compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
  flex-shrink: 0;
}
.compare-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.compare-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0 2px;
}
.compare-close-btn:hover { color: #0f172a; }

.compare-body {
  overflow-y: auto;
  padding: 12px 0 16px;
  flex: 1;
}

.compare-table-wrap {
  overflow-x: auto;
  padding: 0 16px;
}

.compare-table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 13px;
}
.compare-table th,
.compare-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.compare-table thead th {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  white-space: nowrap;
}
.compare-row-header {
  font-weight: 600;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  background: #f8fafc;
  position: sticky;
  left: 0;
  z-index: 1;
}
.compare-school-col {
  min-width: 140px;
}
.compare-cell {
  color: #1e293b;
}
.compare-admissions-link {
  color: var(--gb-indigo);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.compare-admissions-link:hover { text-decoration: underline; }

.compare-sf-note {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
  padding: 0 16px;
}

/* Boarding badge (FEAT-34) */
.boarding-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--r-tag);
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Boarding note in eligibility card (FEAT-34) */
.eligibility-boarding-note {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #64748b;
  margin-top: 1px;
}

/* Deadline badge (FEAT-40) */
.deadline-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--r-tag);
  border: 1px solid #fde68a;
  background: #fef9c3;
  color: #92400e;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

/* LA portal line (FEAT-41) */
.postcode-la-portal-line {
  margin-top: 4px;
  font-size: 12px;
}

/* ── FEAT-42 / FEAT-142 (US-005): layers control corner-swap ────────────────
   The old top-right nudge (margin-top:48px to clear a then-top-right zoom) is
   gone: zoom now lives bottom-right and the layers control corner-swaps to
   top-left on desktop / top-right on mobile (placeLayersControl in map.js), so
   it sits at the natural corner offset with no extra nudge. */

/* School item header wrapper (name + track star) */
.school-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Star sits to the right of the school name */
.school-item-header .school-item-track-star {
  margin-left: auto;
}

/* ── FEAT-60: Scan nearby button ────────────────────────────────────────── */
.eligibility-scan-btn {
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid #0ea5e9;
  color: #0ea5e9;
  background: transparent;
  border-radius: var(--r-tag);
  cursor: pointer;
  margin-right: 4px;
}
.eligibility-scan-btn:hover {
  background: #f0f9ff;
}
.eligibility-scan-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── FEAT-60: Scan panel ────────────────────────────────────────────────── */
.scan-panel {
  position: fixed;
  top: 88px;
  right: 16px;
  width: 300px;
  z-index: 45; /* below eligibility-overlay */
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-control);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.scan-panel.hidden { display: none; }
.scan-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 8px;
  border-bottom: 1px solid #f1f5f9;
}
.scan-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.scan-panel-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}
.scan-panel-radius-group {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.scan-radius-btn {
  flex: 1;
  padding: 4px 0;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-tag);
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}
.scan-radius-btn.active {
  background: #0ea5e9;
  color: #fff;
  border-color: #0ea5e9;
}
.scan-panel-body {
  overflow-y: auto;
  flex: 1;
}
@media (max-width: 767px) {
  .scan-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: var(--r-card) var(--r-card) 0 0;
    max-height: 55vh;
  }
}

/* Scan result rows */
.scan-result-row {
  padding: 8px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.scan-result-main {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.scan-postcode {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  font-family: monospace;
  letter-spacing: 0.03em;
}
.scan-count-badge {
  display: inline-block;
  background: #040F49;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-control);
  min-width: 20px;
  text-align: center;
}
.scan-diff {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: var(--r-tag);
}
.scan-diff.positive { background: #dcfce7; color: #15803d; }
.scan-diff.negative { background: #fee2e2; color: #b91c1c; }
.scan-diff.same     { background: #f1f5f9; color: #64748b; }
.scan-result-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.scan-dist {
  font-size: 11px;
  color: #94a3b8;
}
.scan-place-btn {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid #0ea5e9;
  color: #0ea5e9;
  background: transparent;
  border-radius: var(--r-tag);
  cursor: pointer;
}
.scan-place-btn:hover { background: #f0f9ff; }
.scan-loading, .scan-empty, .scan-error {
  padding: 16px 14px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
}
.scan-error { color: #ef4444; }
.scan-caveat {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #854d0e;
  font-size: 11px;
  padding: 6px 14px;
  margin: 0;
}

.postcode-la-portal-link {
  color: var(--gb-indigo);
  text-decoration: none;
  font-weight: 600;
}

.postcode-la-portal-link:hover {
  text-decoration: underline;
}

/* Ofsted grade legend swatches (FEAT-32) */
.legend-swatch.ofsted-outstanding  { background: #0D9488; border-color: #0D9488; }
.legend-swatch.ofsted-good         { background: #1F3A8A; border-color: #1F3A8A; }
.legend-swatch.ofsted-ri           { background: #D97706; border-color: #D97706; }
.legend-swatch.ofsted-inadequate   { background: #DC2626; border-color: #DC2626; }

.legend-section-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #374151;
  margin: 10px 0 4px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

/* FEAT-35: Year of entry note */
.entry-note {
  margin: 6px 0 0;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

/* FEAT-59 — Coverage heat-map */
#heatmap-btn {
  /* Inherits from the existing overlap-toggle button styles.
     Add only overrides here if needed. */
}
#heatmap-btn.active {
  background: #040F49;
  color: #fff;
}
.heatmap-legend-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  margin-top: 8px;
}
.heatmap-gradient-bar {
  height: 14px;
  border-radius: var(--r-tag);
  border: 1px solid rgba(0,0,0,0.12);
  margin-bottom: 4px;
}
.heatmap-gradient-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #475569;
  margin-bottom: 4px;
}
.approx-note {
  font-size: 10px;
  color: #854d0e;
  font-weight: 400;
}
.heatmap-legend-caveat {
  font-size: 10px;
  color: #854d0e;
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: var(--r-tag);
  padding: 4px 6px;
  margin-top: 4px;
}

.entry-note.hidden {
  display: none;
}

.hidden {
  display: none;
}

/* FEAT-33 / FEAT-37: Detail panel link spacing */
#detail-panel a + a {
  display: block;
  margin-top: 6px;
}

/* FEAT-16: boundary report link */
.report-link {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  color: #94a3b8;
  text-decoration: none;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
}

.report-link:hover {
  color: #475569;
  text-decoration: underline;
}

/* ── FEAT-45: Pin marker pulse animation ── */
@keyframes pin-pulse {
  0%   { transform: scale(1.0); }
  30%  { transform: scale(1.25); }
  100% { transform: scale(1.0); }
}

.pin-marker svg {
  animation: pin-pulse 500ms ease-out 1;
  transform-origin: center;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .pin-marker svg { animation: none; }
}

/* ── FEAT-46: Filter group wrapper ── */
#filter-group {
  padding: 10px 12px 6px;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.filter-group-heading {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px 0;
}

.filter-subgroup {
  margin-bottom: 10px;
}

.filter-subgroup:last-child {
  margin-bottom: 0;
}

.filter-subgroup-label-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.filter-subgroup-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── FEAT-47: Info icon button ── */
.filter-info-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #94a3b8;
  padding: 0 2px;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.1s;
}

.filter-info-btn:hover,
.filter-info-btn:focus {
  color: #475569;
  outline: 2px solid #cbd5e1;
  outline-offset: 1px;
}

/* ── FEAT-47/49: Shared tooltip element — compact ── */
#filter-tooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  max-width: min(220px, calc(100vw - 32px));
  background: #040F49;
  color: #f1f5f9;
  font-size: 11px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: var(--r-control);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  pointer-events: none;
  white-space: normal;
  word-wrap: break-word;
}

#filter-tooltip.visible {
  display: block;
}

/* FEAT-61: Opacity controls */
.opacity-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.opacity-control-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.opacity-btn-group {
  display: flex;
  gap: 4px;
}

.opacity-btn {
  padding: 2px 8px;
  border-radius: var(--r-tag);
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
  font-size: 12px;
  color: #475569;
  transition: background 0.15s, color 0.15s;
}

.opacity-btn.active {
  background: #040F49;
  color: white;
  border-color: #040F49;
}

.opacity-btn:hover:not(.active) {
  background: #f1f5f9;
}

/* FEAT-63: Overlap suggestion section */
.school-list-divider.overlap-divider {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
  border-top: 1px solid #bfdbfe;
  border-bottom: 1px solid #bfdbfe;
}

.school-item.overlap-suggestion {
  background: #dbeafe;
}

.school-item.overlap-suggestion:hover {
  background: #bfdbfe;
}


/* FEAT-80: School name filter + sort dropdown */
.school-name-filter-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.school-name-filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.school-name-filter-input {
  width: 100%;
  padding: 6px 28px 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-tag);
  font-size: 13px;
  color: #1e293b;
  background: white;
}

/* Sort button + popup menu, sits to the right of the search input */
.school-sort {
  position: relative;
  flex: 0 0 auto;
}

.school-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-tag);
  background: white;
  color: #1e293b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}

.school-sort-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.school-sort-btn:focus-visible {
  outline: 2px solid #1F3A8A;
  outline-offset: 1px;
}

.school-sort-btn[aria-expanded="true"] {
  border-color: #1F3A8A;
  background: #F4EFE2;
}

.school-sort-btn-icon {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: #475569;
}

.school-sort-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 600;
  min-width: 180px;
  padding: 4px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-tag);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.school-sort-menu.hidden {
  display: none;
}

.school-sort-option {
  text-align: left;
  padding: 6px 10px 6px 24px;
  border: none;
  background: none;
  border-radius: var(--r-tag);
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  position: relative;
}

.school-sort-option:hover,
.school-sort-option:focus-visible {
  background: #f1f5f9;
  outline: none;
}

.school-sort-option[aria-checked="true"] {
  color: #1F3A8A;
  font-weight: 600;
}

.school-sort-option[aria-checked="true"]::before {
  content: "✓";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #1F3A8A;
}

.school-name-filter-input:focus {
  outline: 2px solid #1F3A8A;
  outline-offset: 1px;
  border-color: #1F3A8A;
}

.school-name-filter-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #94a3b8;
  padding: 0 2px;
}

.school-name-filter-clear:hover {
  color: #475569;
}

.school-list-empty {
  padding: 8px 0 2px;
  font-size: 13px;
  color: #64748b;
}

/* FEAT-82: circle-school crossover caveat */
.crossover-circle-caveat {
  font-size: 10px;
  color: #6b7280;
  font-style: italic;
  margin-top: 2px;
  line-height: 1.3;
}

/* FEAT-69: Postcode search history chips */
.postcode-history { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.postcode-history-chip { display: inline-flex; align-items: center; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: var(--r-pill); padding: 3px 8px 3px 10px; font-size: 12px; gap: 4px; }
.postcode-history-chip-label { background: none; border: none; padding: 0; cursor: pointer; font-size: 12px; color: #1e293b; font-weight: 500; }
.postcode-history-chip-label:hover { color: #1F3A8A; text-decoration: underline; }
.postcode-history-chip-label:focus-visible { outline: 2px solid #1F3A8A; border-radius: var(--r-tag); }
.postcode-history-chip-remove { background: none; border: none; padding: 0 0 0 2px; cursor: pointer; font-size: 14px; color: #94a3b8; line-height: 1; }
.postcode-history-chip-remove:hover { color: #ef4444; }
.postcode-history-chip-remove:focus-visible { outline: 2px solid #1F3A8A; border-radius: var(--r-tag); }

/* FEAT-70: Cross-LA eligibility explainer */
.cross-la-panel { margin-top: 10px; padding: 10px 12px; background: #f0fdf4; border: 1px solid #86efac; border-radius: var(--r-control); font-size: 12px; }
.cross-la-heading { font-weight: 600; color: #15803d; margin-bottom: 4px; font-size: 12px; }
.cross-la-body { color: #374151; margin: 0 0 6px 0; line-height: 1.5; }
.cross-la-portal-list { margin: 0 0 6px 0; padding-left: 16px; }
.cross-la-portal-list li { margin-bottom: 2px; }
.cross-la-portal-link { color: var(--gb-indigo); text-decoration: none; font-weight: 600; }
.cross-la-portal-link:hover { text-decoration: underline; }
.cross-la-guidance { margin: 4px 0 0 0; }
.cross-la-guidance-link { color: #6b7280; font-size: 11px; text-decoration: underline; }
.cross-la-guidance-link:hover { color: #374151; }

/* ── Account page (account.html) ───────────────────────────────────────────── */
.account-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  background: #f8fafc;
}
.account-card {
  background: white;
  border-radius: var(--r-control);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 32px;
  width: 100%;
  max-width: 420px;
}
.account-loading { color: #64748b; font-size: 14px; }
.account-heading { font-size: 18px; font-weight: 600; color: #0F172A; margin-bottom: 20px; }
.account-form { display: flex; flex-direction: column; }
.account-label { font-size: 13px; font-weight: 500; color: #1e293b; margin-bottom: 6px; }
.account-input {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-control);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
  font-family: inherit;
}
.account-input:focus { border-color: #1F3A8A; box-shadow: 0 0 0 2px rgba(31, 58, 138,0.15); }
.account-btn-primary {
  padding: 10px 16px;
  background: #1F3A8A;
  color: white;
  border: none;
  border-radius: var(--r-control);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.account-btn-primary:hover { background: #163073; }
.account-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.account-message { margin-top: 10px; font-size: 13px; color: #059669; }
.account-email { font-size: 14px; color: #1e293b; margin-bottom: 6px; }
.account-tier-label { font-size: 14px; color: #1e293b; margin-bottom: 4px; }
.account-tier-expiry { font-size: 13px; color: #64748b; margin-bottom: 20px; }
.account-upgrade-section { margin-top: 20px; margin-bottom: 20px; }
.account-upgrade-heading { font-size: 14px; font-weight: 600; color: #1e293b; margin-bottom: 10px; }
.account-upgrade-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: #040F49;
  color: white;
  border: none;
  border-radius: var(--r-control);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 8px;
  font-family: inherit;
  text-align: left;
}
.account-upgrade-btn:hover { background: #112266; }
.account-divider { border: none; border-top: 1px solid #e2e8f0; margin: 20px 0; }
.account-delete-btn {
  font-size: 13px;
  color: #ef4444;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}
.account-delete-btn:hover { color: #b91c1c; }
.account-switch { margin-top: 14px; font-size: 13px; color: #64748b; text-align: center; }
.account-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #1F3A8A;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  text-decoration: underline;
}
.account-link-btn:hover { color: #163073; }

/* ── Cookie consent banner ── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #040F49;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 10000;
  font-size: 13px;
}
.cookie-banner.hidden { display: none; }
.cookie-banner-text { flex: 1; line-height: 1.5; }
.cookie-banner-link { color: #C99B43; }
.cookie-accept-btn {
  background: #1F3A8A;
  color: white;
  border: none;
  border-radius: var(--r-tag);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.cookie-accept-btn:hover { background: #163073; }

/* ── Tier expiry banner ── */
.tier-expiry-banner {
  background: #fef3c7;
  border-bottom: 1px solid #C99B43;
  color: #92400e;
  font-size: 12px;
  padding: 8px 12px;
  text-align: center;
}
.tier-expiry-banner.hidden { display: none; }

.checkout-success-banner {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  border-radius: var(--r-control);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  text-align: center;
}

/* ── Plans page (FEAT-131: ported from the Claude Design handover) ───────────
   Design tokens are sourced from tokens.css. The handover's :root block, its
   standalone site-header rules and its footer rules are deliberately NOT copied
   here — style.css already owns the repo's single header/footer. */

.plans-page {
  height: auto;
  min-height: 100vh;
}

/* ── Page shell ── */
main.plans-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

/* ── Hero ── */
.plans-hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 44px;
}
.plans-hero .badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gb-indigo);
  background: var(--gb-indigo-50);
  border: 1px solid var(--gb-indigo-200);
  padding: 5px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 22px;
}
.plans-hero .badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--gb-indigo);
}
.plans-hero h1 {
  font-size: var(--h1-display);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 16px;
  text-wrap: balance;
}
.plans-hero h1 em {
  font-style: italic;
  color: var(--gb-indigo);
  font-weight: 800;
}
.plans-hero p {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 600px;
  margin: 0 auto;
  text-wrap: pretty;
}

/* ── Billing toggle ── */
.billing-toggle {
  display: inline-flex;
  background: var(--surface-paper);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px;
  margin: 28px auto 0;
  box-shadow: var(--shadow-card);
}
.billing-toggle button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-faint);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.billing-toggle button.active {
  background: var(--gb-indigo);
  color: #fff;
  box-shadow: 0 1px 2px rgba(31, 58, 138, 0.3);
}
.billing-toggle .save-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(34, 197, 94, 0.18);
  color: #15803D;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
}
.billing-toggle button.active .save-tag {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

/* ── Tier cards ── */
.tier-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 40px;
  margin-bottom: 24px;
  align-items: stretch;
}

@media (max-width: 880px) {
  /* OPTION A — full marketing cards give way to a compact price strip;
     the comparison table becomes the hero for side-by-side comparison. */
  .tier-cards { display: none; }
}

/* ── Mobile price strip (Option A) ── */
.price-strip { display: none; }
@media (max-width: 880px) {
  .price-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 32px 0 28px;
  }
  .price-strip .ps-col {
    background: var(--surface-paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 8px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
  }
  .price-strip .ps-col--featured {
    border: 1.5px solid var(--gb-indigo);
    box-shadow: 0 0 0 3px rgba(31, 58, 138, 0.08);
  }
  .price-strip .ps-pop {
    position: absolute;
    top: -9px; left: 50%; transform: translateX(-50%);
    font-size: 8px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: #fff; background: var(--gb-cta-gradient);
    padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap;
  }
  .price-strip .ps-name { font-size: 12px; font-weight: 700; color: var(--ink); }
  .price-strip .ps-price { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1; }
  .price-strip .ps-price small { font-size: 11px; font-weight: 500; color: var(--ink-faint); }
  .price-strip .ps-meta { font-size: 9.5px; color: var(--ink-quiet); min-height: 12px; line-height: 1.25; }
  .price-strip .ps-cta {
    width: 100%; font-size: 11px; font-weight: 600; padding: 8px 6px;
    border-radius: var(--r-control); text-decoration: none; border: 1px solid transparent;
  }
  .price-strip .ps-cta--solid { background: var(--gb-cta-gradient); color: #fff; }
  .price-strip .ps-cta--secondary { background: var(--surface-paper); color: var(--gb-indigo); border: 1.5px solid var(--gb-indigo-200); }

  /* Hide the billing toggle on mobile — both prices are visible together */
  .billing-toggle { display: none; }

  /* Reorder so the comparison table is the hero (Option A):
     hero → price strip → table → business banner → FAQ */
  main.plans-main { display: flex; flex-direction: column; }
  .plans-hero      { order: 1; }
  .price-strip     { order: 2; }
  .compare-section { order: 3; }
  .business-banner { order: 4; margin-bottom: 0; }
  .faq-section     { order: 5; }

  /* Comparison table becomes the focus: sticky plan names, drop the
     Business column (it has its own banner) so 4 columns fit cleanly. */
  .compare-section { scroll-margin-top: 12px; }
  .plans-page .compare-table th:nth-child(5),
  .plans-page .compare-table td:nth-child(5) { display: none; }
  .plans-page .compare-table thead th { font-size: 11px; padding: 12px 6px 10px; }
  .plans-page .compare-table thead th .th-price { font-size: 10px; }
  .plans-page .compare-table thead th.col-feature { padding-left: 14px; }
  .plans-page .compare-table tbody td { font-size: 12px; padding: 11px 6px; }
  .plans-page .compare-table tbody td.feat { padding-left: 14px; }
  .plans-page .compare-table tbody tr.section-row td { padding-left: 14px; font-size: 10.5px; }
  .qual-cell { font-size: 10.5px; padding: 2px 6px; }
  /* Table fits 4 cols on mobile — drop the scroll container so the
     sticky plan-name header can pin to the viewport while scrolling. */
  .compare-scroll { overflow-x: visible; }
}

.tier-card {
  background: var(--surface-paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}
.tier-card:hover {
  border-color: var(--gb-indigo-200);
  box-shadow: var(--shadow-pop);
  transform: translateY(-2px);
}

.tier-card--featured {
  border: 1.5px solid var(--gb-indigo);
  box-shadow: 0 0 0 4px rgba(31, 58, 138, 0.08), var(--shadow-card);
}
.tier-card--featured:hover {
  box-shadow: 0 0 0 4px rgba(31, 58, 138, 0.14), var(--shadow-pop);
}

.tier-card--business {
  background:
    radial-gradient(circle at top right, rgba(201, 155, 67, 0.12), transparent 60%),
    linear-gradient(180deg, #0B1A66 0%, var(--gb-navy) 100%);
  color: #E0E7FF;
  border-color: rgba(255,255,255,0.1);
}
.tier-card--business:hover {
  border-color: var(--gb-cyan);
  box-shadow: 0 8px 32px rgba(4, 15, 73, 0.4);
}

/* ── Business banner (horizontal) ── */
.business-banner {
  margin-top: 0;
  margin-bottom: 72px;
  border-radius: 16px;
  padding: 32px 36px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr auto;
  align-items: center;
  gap: 36px;
  background:
    radial-gradient(circle at top right, rgba(201, 155, 67, 0.14), transparent 55%),
    linear-gradient(120deg, #0B1A66 0%, var(--gb-navy) 100%);
  color: #E0E7FF;
  border: 1px solid rgba(255,255,255,0.1);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.business-banner:hover {
  border-color: var(--gb-cyan);
  box-shadow: 0 8px 32px rgba(4, 15, 73, 0.4);
}
.business-banner .bb-intro .tier-eyebrow { color: var(--gb-cyan); }
.business-banner .bb-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #fff;
  margin: 6px 0 8px;
}
.business-banner .bb-tagline {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(224, 231, 255, 0.78);
  max-width: 32ch;
}
.business-banner .bb-features {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  margin: 0;
  padding: 0;
}
.business-banner .bb-features li {
  font-size: 13.5px;
  color: rgba(224, 231, 255, 0.92);
  line-height: 1.4;
  padding-left: 26px;
  position: relative;
}
.business-banner .bb-features li::before {
  content: '';
  position: absolute;
  left: 0; top: 1px;
  width: 17px; height: 17px;
  border-radius: 999px;
  background-color: rgba(201, 155, 67, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23C99B43' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.business-banner .bb-cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 180px;
}
.business-banner .bb-cta .tier-price {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.015em;
  text-align: center;
}
.business-banner .bb-cta .bb-price-meta {
  font-size: 12px;
  color: rgba(224, 231, 255, 0.55);
  text-align: center;
  margin-bottom: 4px;
}

@media (max-width: 880px) {
  .business-banner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 24px;
    margin-top: 20px;
  }
  .business-banner .bb-cta { min-width: 0; }
}
@media (max-width: 480px) {
  .business-banner .bb-features { grid-template-columns: 1fr; }
}

.tier-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gb-cta-gradient);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(31, 58, 138, 0.35);
}

.tier-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gb-indigo);
}
.tier-card--business .tier-eyebrow { color: var(--gb-cyan); }

.tier-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-top: 4px;
}
.tier-card--business .tier-name { color: #fff; }

.tier-tagline {
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.45;
  margin-top: 6px;
  min-height: 38px;
}
.tier-card--business .tier-tagline { color: rgba(224, 231, 255, 0.78); }

.tier-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}
.tier-price {
  font-size: 38px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.tier-card--business .tier-price { color: #fff; }

.tier-price-unit {
  font-size: 13px;
  color: var(--ink-faint);
  font-weight: 500;
}
.tier-card--business .tier-price-unit { color: rgba(224, 231, 255, 0.7); }

.tier-save {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #15803D;
  background: rgba(34, 197, 94, 0.16);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  align-self: center;
  white-space: nowrap;
}

.tier-price-meta {
  font-size: 12px;
  color: var(--ink-quiet);
  margin-top: 4px;
  min-height: 16px;
}
.tier-card--business .tier-price-meta { color: rgba(224, 231, 255, 0.55); }

.tier-cta {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: var(--r-control);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter var(--t-fast), background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.tier-cta--solid {
  background: var(--gb-cta-gradient);
  color: #fff;
}
.tier-cta--solid:hover { filter: brightness(1.06); }

.tier-cta--secondary {
  background: var(--surface-paper);
  color: var(--gb-indigo);
  border: 1.5px solid var(--gb-indigo-200);
}
.tier-cta--secondary:hover {
  background: var(--gb-indigo-50);
  border-color: var(--gb-indigo);
}
.tier-cta--disabled {
  background: var(--surface-muted);
  color: var(--ink-faint);
  border: 1.5px solid var(--line);
  cursor: default;
  pointer-events: none;
}
.tier-cta--ghost-light {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.tier-cta--ghost-light:hover {
  background: rgba(255,255,255,0.16);
  border-color: var(--gb-cyan);
}

.tier-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding-top: 4px;
}
.tier-features .group-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.tier-card--business .tier-features .group-label {
  color: rgba(224, 231, 255, 0.5);
  border-top-color: rgba(255,255,255,0.12);
}
.tier-features li.feat {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.45;
  padding-left: 24px;
  position: relative;
}
.tier-card--business .tier-features li.feat { color: rgba(224, 231, 255, 0.9); }

.tier-features li.feat::before {
  content: '';
  position: absolute;
  left: 0; top: 2px;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--gb-indigo-50);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%231F3A8A' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.tier-card--business .tier-features li.feat::before {
  background-color: rgba(201, 155, 67, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23C99B43' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.tier-features li .qual {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gb-indigo);
  background: var(--gb-indigo-50);
  border-radius: var(--r-tag);
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: 1px;
}
.tier-card--business .tier-features li .qual {
  color: var(--gb-cyan);
  background: rgba(201, 155, 67, 0.14);
}

/* ── Comparison table ── */
.compare-section {
  background: var(--surface-paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.compare-header {
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.compare-header h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.compare-header p {
  font-size: 14px;
  color: var(--ink-faint);
  max-width: 420px;
}

/* Scoped to .plans-page: the map's school-comparison drawer reuses the bare
   .compare-table class, so these rules must not leak onto map.html. */
.plans-page .compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
.plans-page .compare-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-paper);
  z-index: 2;
  padding: 16px 14px 14px;
  text-align: left;
  vertical-align: bottom;
  border-bottom: 1px solid var(--line);
}
.plans-page .compare-table thead th.col-feature {
  text-align: left;
  padding-left: 32px;
}
.plans-page .compare-table thead th .th-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: block;
}
.plans-page .compare-table thead th .th-price {
  display: block;
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 500;
  margin-top: 2px;
}
.plans-page .compare-table thead th.col-featured .th-name {
  color: var(--gb-indigo);
}
.plans-page .compare-table thead th.col-featured {
  background: var(--gb-indigo-50);
}

.plans-page .compare-table tbody tr.section-row td {
  padding: 18px 14px 10px 32px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gb-indigo);
  background: var(--surface-muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.plans-page .compare-table tbody td {
  padding: 13px 14px;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  transition: background var(--t-fast);
}
.plans-page .compare-table tbody td.feat {
  text-align: left;
  padding-left: 32px;
  color: var(--ink-2);
  font-weight: 500;
}
.plans-page .compare-table tbody td.col-featured {
  background: rgba(238, 242, 255, 0.4);
}
.plans-page .compare-table tbody tr:hover td:not(.feat) { background: var(--surface-muted); }
.plans-page .compare-table tbody tr:hover td.col-featured { background: var(--gb-indigo-50); }
.plans-page .compare-table tbody tr:hover td.feat { color: var(--ink); }

.plans-page .compare-table tbody tr:last-child td { border-bottom: none; }

.yes, .no, .qual-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.yes {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--gb-indigo-50);
  color: var(--gb-indigo);
}
.yes::before {
  content: '';
  width: 12px; height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231F3A8A' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.no {
  color: var(--ink-quiet);
  font-size: 18px;
  line-height: 1;
}
.no::before { content: '–'; }
.qual-cell {
  font-weight: 600;
  color: var(--ink);
  font-size: 12.5px;
  gap: 4px;
  padding: 2px 8px;
  background: var(--surface-muted);
  border-radius: var(--r-pill);
}
.qual-cell.limited { color: var(--ink-faint); background: var(--surface-muted); }
.qual-cell.soon {
  color: var(--ink-faint);
  background: var(--surface-muted);
  font-style: italic;
  font-weight: 500;
}
.qual-cell.full, .qual-cell.advanced {
  color: var(--gb-indigo);
  background: var(--gb-indigo-50);
}

.feat-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.feat-label .info {
  width: 14px; height: 14px;
  color: var(--ink-quiet);
  cursor: help;
  flex-shrink: 0;
}
.feat-label .new {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--band-green);
  background: rgba(22, 163, 74, 0.12);
  padding: 1px 6px;
  border-radius: var(--r-tag);
}

/* ── Mobile collapse table ── */
@media (max-width: 720px) {
  .plans-page .compare-table thead th.col-feature { padding-left: 18px; }
  .plans-page .compare-table tbody td.feat { padding-left: 18px; }
  .plans-page .compare-table tbody tr.section-row td { padding-left: 18px; }
  .plans-page .compare-table { font-size: 12.5px; }
  .compare-header { padding: 24px 18px 18px; }
  .compare-header h2 { font-size: 24px; }
}

/* ── FAQ ── */
.faq-section {
  margin-top: 72px;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
.faq-section h2 {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 28px;
}
.faq-list {
  display: grid;
  gap: 10px;
}
.faq-item {
  background: var(--surface-paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.faq-item[open] {
  border-color: var(--gb-indigo-200);
  box-shadow: var(--shadow-card);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '';
  width: 18px; height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  transition: transform var(--t-base);
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item .answer {
  padding: 0 22px 20px;
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ── Responsive tier card layout polish ── */
@media (max-width: 1080px) {
  .tier-card--featured .tier-card-badge { top: -10px; }
}

/* ── Comparison table: hover-sync visual ── */
.plans-page .compare-table tr:not(.section-row) td.col-hover,
.plans-page .compare-table thead th.col-hover {
  background: rgba(238, 242, 255, 0.7);
}
.plans-page .compare-table thead th.col-hover .th-name { color: var(--gb-indigo); }

/* Merged "Pro" column — desktop hides it, mobile uses it instead of
   the separate Pass / Monthly columns (built at runtime — see US-021). */
.compare-merged { display: none; }
@media (max-width: 880px) {
  .compare-full   { display: none; }
  /* table-layout: fixed pins the columns to the percentages below so the cloned
     table can never widen past the viewport (otherwise the flex-column main grows
     to its min-content width — see US-021). */
  .compare-merged { display: table; width: 100%; table-layout: fixed; }
  .compare-merged th:first-child,
  .compare-merged td.feat { width: 44%; }
  .compare-merged th:nth-child(2),
  .compare-merged tr:not(.section-row) td:nth-child(2) { width: 26%; }
  .compare-merged th.pro-cell,
  .compare-merged td.pro-cell { width: 30%; }
  .compare-merged .ms {
    display: flex; align-items: center; justify-content: center; gap: 6px;
  }
  .compare-merged .ms + .ms { margin-top: 6px; }
  .compare-merged .ms b {
    font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--ink-quiet);
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   FEAT-136 (US-003): Themed map controls — unify chrome to one visual language.
   Uses the control-scoped tokens declared in :root. The .filter-btn group
   (FEAT-128) and .action-btn (themed in place above) are intentionally not
   repeated here. Hover #F4EFE2 + navy border; active solid navy + white;
   keyboard focus a cyan ring.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Leaflet zoom control ── */
.leaflet-control-zoom.leaflet-bar {
  border: var(--control-border);
  border-radius: var(--control-radius);
  box-shadow: var(--control-shadow);
  overflow: hidden; /* clip the +/− links to the rounded container */
}
.leaflet-control-zoom a {
  color: var(--control-active);
  background: #fff;
}
.leaflet-control-zoom a:hover {
  background: #F4EFE2;
  color: var(--control-active);
}
.leaflet-control-zoom a:focus-visible {
  outline: 2px solid var(--control-focus);
  outline-offset: -2px; /* inset so the ring shows inside the clipped container */
  z-index: 1;
}

/* ── Leaflet layers / satellite control — themed to match the Schools /
   Map-key icon buttons (white square, themed border/radius/shadow, Lucide
   layers glyph injected by map.js in place of Leaflet's bitmap sprite). ── */
.leaflet-control-layers {
  border: var(--control-border);
  border-radius: var(--control-radius);
  box-shadow: var(--control-shadow);
}
/* Leaflet's .leaflet-touch rule swaps in a heavier 2px border — restore ours. */
.leaflet-touch .leaflet-control-layers { border: var(--control-border); }

/* Desktop: offset the layers control within its top-left corner so it sits
   to the right of the Map key (corner at map-left + a 56px margin = sidebar +
   56). Scoped to min-width so it can't clash with the mobile 116px rule. */
@media (min-width: 768px) {
  .leaflet-top.leaflet-left .leaflet-control-layers { margin: 10px 0 0 56px; }
}

/* Collapsed toggle = icon-only square. Selectors stay at (0,2,0) so they win
   over Leaflet's own .leaflet-touch / .leaflet-retina rules by source order. */
.leaflet-control-layers .gb-layers-toggle {
  /* 36px toggle + the container's 1px border each side = a 38px outer box,
     matching the Schools / Map-key buttons exactly (44px outer on mobile). */
  width: 36px;
  height: 36px;
  background-image: none;
  color: var(--control-active);
  font-size: 20px;
}
/* Centre the glyph only while collapsed, so Leaflet can still hide the toggle
   (display:none) once the Map/Satellite panel expands. */
.leaflet-control-layers:not(.leaflet-control-layers-expanded) .gb-layers-toggle {
  display: grid;
  place-items: center;
}
.leaflet-control-layers .gb-layers-toggle:hover {
  background: #F4EFE2;
  color: var(--control-active);
}
@media (max-width: 767px) {
  .leaflet-control-layers .gb-layers-toggle { width: 42px; height: 42px; }
}

/* ── Opacity segmented buttons ── */
.opacity-btn {
  border-radius: var(--control-radius);
}
.opacity-btn:hover:not(.active) {
  background: #F4EFE2;
  border-color: var(--control-active);
  color: var(--control-active);
}
.opacity-btn:focus-visible {
  outline: 2px solid var(--control-focus);
  outline-offset: 2px;
}

/* ── Coverage heat-map toggle ── */
#heatmap-btn {
  border-radius: var(--control-radius);
}
#heatmap-btn:focus-visible {
  outline: 2px solid var(--control-focus);
  outline-offset: 2px;
}

/* ── Schools pill (mobile) — keeps its pill radius, gains the shared states ── */
.schools-pill:hover {
  background: #F4EFE2;
  border-color: var(--control-active);
}
.schools-pill:focus-visible {
  outline: 2px solid var(--control-focus);
  outline-offset: 2px;
}

/* ── Legend collapse toggle + close buttons — focus ring only (borderless icons) ── */
.legend-toggle-btn:focus-visible,
#detail-close:focus-visible,
.filters-close-btn:focus-visible,
.scan-panel-close:focus-visible,
.compare-close-btn:focus-visible {
  outline: 2px solid var(--control-focus);
  outline-offset: 2px;
  border-radius: var(--r-tag);
}

/* ── FEAT-148-US002: /schools.html admissions-guides index ─────────────────── */

body.schools-page {
  display: block;
  height: auto;
  min-height: 100vh;
  background: #f8fafc;
  color: #1e293b;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.sch-shell { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 720px) { .sch-shell { padding: 0 18px; } }

/* Light, centred hero matching Features / Plans (sits on the light page surface,
   no dark band). Typography (Spectral serif h1, italic em, de-pilled mono eyebrow)
   is unified in scheme.css; this block owns layout + the light-surface colours. */
.sch-hero {
  background: transparent;
  color: var(--ink);
  text-align: center;
  padding: 72px 0 56px;
}
.sch-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; text-transform: uppercase;
  margin-bottom: 22px;
}
.sch-hero .eyebrow-dot {
  width: 6px; height: 6px; background: var(--gb-cyan);
}
.sch-hero h1 {
  font-size: var(--h1-display);
  line-height: 1.08;
  margin: 0 auto 16px;
  max-width: 22ch;
  color: var(--ink);
}
.sch-hero h1 em {
  /* Emphasis is the italic typeface, not colour — same ink (scheme.css enforces). */
  font-style: italic;
  color: inherit;
}
.sch-hero .lede {
  font-size: 18px; line-height: 1.55; color: var(--ink-muted); max-width: 60ch; margin: 0 auto;
}
/* Mobile scale, matching .features-hero so the two heroes are consistent small-screen. */
@media (max-width: 720px) {
  .sch-hero { padding: 56px 0 40px; }
  .sch-hero h1 { font-size: 36px; }
  .sch-hero .lede { font-size: 16px; }
}

.sch-filters {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-card);
  padding: 14px 16px;
  margin: -36px auto 0;
  box-shadow: 0 6px 24px -12px rgba(15, 23, 42, 0.25);
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
}
@media (max-width: 720px) {
  .sch-filters { grid-template-columns: 1fr; padding: 12px; }
}
.sch-search { position: relative; }
.sch-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.sch-search input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-control);
  font: inherit; color: #1e293b;
  background: #f8fafc;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.sch-search input:focus { outline: none; border-color: #1F3A8A; background: #fff; box-shadow: 0 0 0 3px rgba(31, 58, 138, 0.15); }
.sch-search input::placeholder { color: #94a3b8; }

.sch-filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.sch-filter-btn {
  font: inherit; font-size: 13px; font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-control);
  padding: 8px 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.sch-filter-btn:hover { background: #F4EFE2; color: #1F3A8A; border-color: #E4D5A8; }
.sch-filter-btn[aria-pressed="true"] {
  background: #C99B43;
  color: #fff; border-color: transparent;
}

/* National expansion: region groups wrap the LA/sub-area sections. */
.sch-region { padding: 40px 0 0; }
.sch-region[hidden] { display: none; }
.sch-region-head { margin: 0 0 4px; border-bottom: 2px solid #E4D5A8; padding-bottom: 12px; }
.sch-region-title {
  font-size: 28px; font-weight: 800; color: #1F3A8A;
  letter-spacing: -0.01em; margin: 0;
  display: inline-flex; align-items: center; gap: 12px;
}
.sch-region-title .badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #1F3A8A; background: #F4EFE2; border: 1px solid #E4D5A8;
  border-radius: var(--r-pill); padding: 4px 10px;
}
.sch-region-meta { font-size: 13px; color: #64748b; margin-top: 6px; }
/* Sub-area/LA sections sit tighter under a region head. */
.sch-region .sch-section { padding: 32px 0 0; }
.sch-region .sch-section .sch-section-title { font-size: 19px; }

.sch-section { padding: 56px 0 0; }
.sch-section:last-of-type { padding-bottom: 64px; }
.sch-section[hidden] { display: none; }
.sch-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.sch-section-title {
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.01em;
  margin: 0;
  display: inline-flex; align-items: center; gap: 12px;
}
.sch-section-title .badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #1F3A8A;
  background: #F4EFE2;
  border: 1px solid #E4D5A8;
  border-radius: var(--r-pill);
  padding: 4px 10px;
}
.sch-section-meta { font-size: 13px; color: #64748b; }

.sch-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
@media (max-width: 880px) { .sch-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .sch-grid { grid-template-columns: 1fr; } }

.sch-card {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-card);
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  position: relative;
}
.sch-card.has-guide { cursor: pointer; }
.sch-card.has-guide:hover {
  border-color: #E4D5A8;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -10px rgba(15, 23, 42, 0.15);
}
.sch-card.no-guide { background: #f8fafc; cursor: default; }
.sch-card[hidden] { display: none !important; }

.sch-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sch-card-gender {
  width: 36px; height: 36px; border-radius: var(--r-control);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.sch-card[data-gender="boys"]  .sch-card-gender { background: rgba(42, 79, 160, 0.12); color: #2A4FA0; }
.sch-card[data-gender="girls"] .sch-card-gender { background: rgba(156, 85, 112, 0.12); color: #9C5570; }
.sch-card[data-gender="mixed"] .sch-card-gender { background: rgba(94, 114, 69, 0.14); color: #5E7245; }

.sch-card-name {
  font-size: 16px; font-weight: 700; color: #0F172A;
  line-height: 1.3; letter-spacing: -0.005em;
  margin: 14px 0 4px;
}
.sch-card.no-guide .sch-card-name { color: #475569; }

.sch-card-meta {
  font-size: 13px; color: #64748b;
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  margin-bottom: 14px;
}
.sch-card-meta span { display: inline-flex; align-items: center; gap: 5px; }

.sch-card-cta {
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; font-weight: 600;
}
.sch-card.has-guide .sch-card-cta { color: #1F3A8A; }
.sch-card.no-guide  .sch-card-cta { color: #94a3b8; }
.sch-card-cta .status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.sch-card.has-guide .status { color: #7C8AA0; }
.sch-card.no-guide  .status { color: #94a3b8; }
.sch-card-cta .status-dot { width: 6px; height: 6px; border-radius: 50%; background: #7C8AA0; }
.sch-card.has-guide .sch-card-cta svg { transition: transform .15s; }
.sch-card.has-guide:hover .sch-card-cta svg { transform: translateX(2px); }

.sch-empty {
  text-align: center;
  padding: 64px 24px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--r-card);
  color: #64748b;
  margin-top: 32px;
}
.sch-empty svg { color: #cbd5e1; margin-bottom: 14px; }
.sch-empty strong { display: block; font-size: 16px; color: #0F172A; font-weight: 700; margin-bottom: 4px; }


body.schools-page :focus-visible { outline: 3px solid #C99B43; outline-offset: 2px; border-radius: var(--r-tag); }

/* ============================================================
   FEAT-149: per-school admissions guide page (.adm-* namespace)
   ============================================================ */

/* Glossary tooltips (.gloss-pop) are absolutely positioned and centred on
   inline words, so ones near the right edge spill past the viewport and add
   horizontal scroll — the "white bar" running up the right on mobile. Clip the
   overflow at the root so it can't be scrolled to, without creating a scroll
   container or affecting sticky/vertical scroll. The clip must sit on the
   element the viewport takes its overflow from (html), not just body. */
html:has(body.admissions-page),
body.admissions-page {
  overflow-x: clip;
}

body.admissions-page {
  display: block;
  height: auto;
  min-height: 100vh;
  background: #f8fafc;
  color: #1e293b;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.adm-shell { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 720px) { .adm-shell { padding: 0 18px; } }

.adm-hero {
  background:
    linear-gradient(rgba(4, 15, 73, 0.92), rgba(4, 15, 73, 0.78)),
    radial-gradient(1200px 400px at 80% -20%, rgba(201, 155, 67, 0.35), transparent 60%),
    linear-gradient(135deg, #040F49 0%, #1e1b8a 100%);
  color: #fff;
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}
.adm-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: #C99B43;
}
.adm-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: #E4D5A8;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  margin-bottom: 18px;
}
.adm-hero h1 {
  font-size: var(--h1-page);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  max-width: 22ch;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  color: #fff;
}
.adm-hero .lede {
  font-size: 17px; line-height: 1.55; color: #e2e8f0; max-width: 58ch; margin: 0 0 28px;
}
.adm-hero-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-pill);
  padding: 7px 13px;
}
.adm-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #C99B43; }
.adm-chip svg { color: #E4D5A8; }

.adm-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin: 32px auto -36px;
  max-width: 1032px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-card);
  box-shadow: 0 6px 24px -12px rgba(15, 23, 42, 0.25);
  position: relative; z-index: 2;
  overflow: hidden;
}
@media (max-width: 720px) {
  .adm-stats { grid-template-columns: repeat(2, 1fr); margin-bottom: -20px; }
}
.adm-stat { padding: 20px 22px; border-right: 1px solid #e2e8f0; }
.adm-stat:last-child { border-right: 0; }
@media (max-width: 720px) {
  .adm-stat:nth-child(2n) { border-right: 0; }
  .adm-stat:nth-child(-n+2) { border-bottom: 1px solid #e2e8f0; }
}
.adm-stat-num { font-size: 28px; font-weight: 800; color: #0F172A; letter-spacing: -0.01em; line-height: 1; }
.adm-stat-num .unit { font-size: 13px; color: #64748b; font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.adm-stat-lbl { display: flex; align-items: center; gap: 7px; color: #475569; font-size: 13px; margin-top: 8px; }
.adm-stat-lbl svg { color: #94a3b8; }

.adm-deadline {
  background: #C99B43;
  color: #fff;
  border-radius: var(--r-card);
  padding: 22px 26px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
  margin-top: 72px;
  box-shadow: 0 10px 30px -16px rgba(31, 58, 138, 0.5);
}
@media (max-width: 720px) {
  .adm-deadline { grid-template-columns: 1fr; gap: 10px; padding: 20px; margin-top: 48px; }
}
.adm-deadline-ic {
  width: 48px; height: 48px; border-radius: var(--r-card);
  background: rgba(255,255,255,0.18);
  display: grid; place-items: center;
}
.adm-deadline .label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; font-weight: 600;
}
.adm-deadline .date { font-size: 20px; font-weight: 700; margin-top: 2px; }
.adm-deadline .countdown { text-align: right; }
.adm-deadline .countdown .num { font-size: 36px; font-weight: 800; line-height: 1; }
.adm-deadline .countdown .lbl { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; margin-top: 4px; }
@media (max-width: 720px) { .adm-deadline .countdown { text-align: left; } }

.adm-band { padding: 56px 0; border-top: 1px solid #e2e8f0; }
.adm-band:first-of-type { border-top: 0; }
.adm-band.alt { background: #fff; }

.adm-section-head { max-width: 720px; margin: 0 0 32px; }
.adm-eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #1F3A8A;
  background: #F4EFE2;
  border: 1px solid #E4D5A8;
  border-radius: var(--r-pill);
  padding: 5px 12px;
  margin-bottom: 14px;
}
.adm-section-head h2 {
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #0F172A;
  margin: 0 0 10px;
  text-wrap: balance;
}
.adm-section-head .lede {
  font-size: 16px; color: #475569; line-height: 1.6; max-width: 60ch;
}

.adm-tldr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 880px) { .adm-tldr { grid-template-columns: 1fr; } }
.adm-tldr .card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-card);
  padding: 22px;
  position: relative;
}
.adm-tldr .card .ic {
  width: 40px; height: 40px; border-radius: var(--r-control);
  background: #F4EFE2;
  color: #1F3A8A;
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.adm-tldr .card h3 { font-size: 17px; font-weight: 700; color: #0F172A; margin: 0 0 8px; }
.adm-tldr .card p { font-size: 14.5px; color: #475569; line-height: 1.55; margin: 0; }
.adm-tldr .card .num {
  position: absolute; top: 18px; right: 22px;
  font-size: 13px; font-weight: 700; color: #94a3b8;
  letter-spacing: 0.05em;
}

.adm-steps { display: grid; gap: 12px; }
.adm-step {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 18px; align-items: start;
  background: #fff; border: 1px solid #e2e8f0; border-radius: var(--r-card);
  padding: 20px 22px;
  transition: border-color .15s, box-shadow .15s;
}
.adm-step:hover { border-color: #E4D5A8; box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.12); }
.adm-step.is-key {
  background: linear-gradient(180deg, #F4EFE2 0%, #fff 100%);
  border-color: #E4D5A8;
}
.adm-step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: #F4EFE2; color: #1F3A8A;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px;
  border: 1.5px solid #E4D5A8;
}
.adm-step.is-key .adm-step-num {
  background: #C99B43;
  color: #fff; border-color: transparent;
}
.adm-step.is-past { opacity: 0.6; }
.adm-step.is-past .adm-step-num {
  background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0;
  position: relative;
}
.adm-step.is-past .adm-step-num::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  color: #7C8AA0;
  font-weight: 800;
  font-size: 15px;
}
.adm-step.is-past .adm-step-num { color: transparent; }
.adm-step-title { font-size: 16.5px; font-weight: 700; color: #0F172A; margin: 4px 0 4px; }
.adm-step-title svg { color: #94a3b8; vertical-align: -3px; margin-right: 6px; }
.adm-step-body { font-size: 14.5px; color: #475569; line-height: 1.55; max-width: 60ch; }
.adm-step-body a { color: #1F3A8A; }
.adm-step-when {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #64748b; white-space: nowrap; padding-top: 8px;
}
@media (max-width: 720px) {
  .adm-step { grid-template-columns: 36px 1fr; }
  .adm-step-when { grid-column: 1 / -1; padding-top: 4px; }
}

.adm-criteria { display: grid; gap: 16px; }

.adm-crit-group {
  border: 1.5px solid #e2e8f0; border-radius: var(--r-card); overflow: hidden;
}
.adm-crit-cat-hd {
  background: #0F172A; color: #fff;
  padding: 13px 20px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}
.adm-crit-cat-desc {
  background: #f8fafc;
  padding: 12px 20px;
  font-size: 14px; color: #475569; line-height: 1.55;
  border-bottom: 1px solid #e2e8f0;
}
.adm-crit-group-body {
  background: #f8fafc;
  padding: 10px 12px 12px;
  display: grid; gap: 8px;
}
.adm-crit-group-body .adm-crit { border-radius: var(--r-control); }

.adm-crit {
  background: #fff; border: 1px solid #e2e8f0; border-radius: var(--r-card);
  overflow: hidden;
}
.adm-crit-btn {
  width: 100%; text-align: left; background: transparent; border: 0; font: inherit; color: inherit;
  padding: 16px 20px;
  display: grid; grid-template-columns: 40px 1fr auto; gap: 18px; align-items: center;
  cursor: pointer;
}
.adm-crit-btn:hover { background: #f8fafc; }
.adm-crit-rank {
  width: 34px; height: 34px; border-radius: var(--r-control);
  background: #f1f5f9; color: #475569;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px;
}
.adm-crit-title { font-size: 16px; font-weight: 700; color: #0F172A; }
.adm-crit-title svg { color: #94a3b8; vertical-align: -3px; margin-right: 6px; }
.adm-crit-tag {
  display: inline-block; margin-top: 3px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: #64748b;
}
.adm-crit-chev { color: #94a3b8; transition: transform .2s; }
.adm-crit[data-open="true"] .adm-crit-chev { transform: rotate(180deg); }
.adm-crit-detail {
  padding: 14px 20px 18px 78px;
  border-top: 1px dashed #e2e8f0;
}
@media (max-width: 720px) {
  .adm-crit-btn { grid-template-columns: 34px 1fr 20px; gap: 12px; padding: 14px; }
  .adm-crit-detail { padding: 14px; }
}
.adm-crit-detail .plain { font-size: 15px; color: #0F172A; line-height: 1.6; margin: 0 0 10px; }
.adm-crit-detail .legal { font-size: 13.5px; color: #64748b; line-height: 1.55; margin: 0; }
.adm-crit-detail .legal strong { color: #475569; font-weight: 700; }

.adm-distance {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: center;
}
@media (max-width: 880px) { .adm-distance { grid-template-columns: 1fr; gap: 24px; } }
.adm-distance-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: var(--r-card); padding: 24px;
}
.adm-distance-fig {
  height: 220px;
  background: #f8fafc;
  border-radius: var(--r-control);
  border: 1px dashed #cbd5e1;
  margin: 14px 0;
  overflow: hidden;
}
.adm-distance-card h3 { font-size: 17px; font-weight: 700; color: #0F172A; margin: 6px 0 4px; }
.adm-distance-card .caption { font-size: 14px; color: #475569; line-height: 1.55; margin: 6px 0 0; }
.adm-distance .sec-title { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #1F3A8A; }

.adm-map-cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600;
  color: #fff;
  background: #C99B43;
  border-radius: var(--r-control); padding: 10px 16px;
  text-decoration: none;
  margin-top: 16px;
}
.adm-map-cta:hover { filter: brightness(1.06); }
.adm-map-cta:focus-visible { outline: 3px solid #C99B43; outline-offset: 2px; }

.adm-twoup { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .adm-twoup { grid-template-columns: 1fr; } }
.adm-info-card { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--r-card); padding: 24px; }
.adm-info-card h3 { font-size: 17px; font-weight: 700; color: #0F172A; margin: 12px 0 8px; }
.adm-info-card p { font-size: 14.5px; color: #475569; line-height: 1.6; margin: 0 0 10px; }
.adm-info-card .footnote { font-size: 13px; color: #64748b; margin: 6px 0 0; }
.adm-info-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  color: #1F3A8A;
  background: #F4EFE2;
  border: 1px solid #E4D5A8;
  border-radius: var(--r-pill);
  padding: 4px 10px;
}
.adm-aside {
  background: #fff; border: 1px solid #e2e8f0; border-left: 3px solid #7C8AA0;
  border-radius: var(--r-control);
  padding: 18px 20px;
  display: grid; grid-template-columns: auto 1fr; gap: 16px;
  margin-top: 28px;
}
.adm-aside .ic { color: #7C8AA0; margin-top: 2px; }
.adm-aside strong { font-size: 15px; font-weight: 700; color: #0F172A; }
.adm-aside p { font-size: 14px; color: #475569; line-height: 1.55; margin: 4px 0 0; }

.adm-sixth {
  background: #040F49;
  color: #fff;
  border-radius: var(--r-card);
  padding: 36px;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px;
  position: relative;
  overflow: hidden;
}
.adm-sixth::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px 300px at 100% 0%, rgba(201, 155, 67, 0.18), transparent 60%);
  pointer-events: none;
}
@media (max-width: 880px) { .adm-sixth { grid-template-columns: 1fr; padding: 28px; } }
.adm-sixth > * { position: relative; z-index: 1; }
.adm-sixth .eyebrow {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #C99B43; margin-bottom: 12px;
}
.adm-sixth > div:first-child > h3 { font-size: 28px; font-weight: 800; letter-spacing: -0.015em; margin: 0 0 12px; color: #fff; }
.adm-sixth p { color: #E4D5A8; font-size: 14.5px; line-height: 1.6; margin: 0 0 16px; max-width: 50ch; }
.adm-sixth h3 { font-size: 18px; font-weight: 700; color: #fff; margin: 0 0 10px; }
.adm-gcse {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  background: rgba(255,255,255,0.06);
  padding: 12px; border-radius: var(--r-control);
  border: 1px solid rgba(255,255,255,0.1);
}
.adm-gcse .pill {
  text-align: center; padding: 12px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-control);
}
.adm-gcse .grade { font-size: 24px; font-weight: 800; color: #fff; line-height: 1; }
.adm-gcse .lbl { font-size: 11px; color: #E4D5A8; font-weight: 600; margin-top: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
.adm-sports { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.adm-sports .sport {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 13px; color: #fff;
}
.adm-sports .sport span.muted { color: #94a3b8; }

.adm-faq { display: grid; gap: 8px; max-width: 800px; margin: 0 auto; }
.adm-faq-item { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--r-control); overflow: hidden; }
.adm-faq-q {
  width: 100%; text-align: left; background: transparent; border: 0; font: inherit; color: inherit;
  padding: 16px 20px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  font-size: 15.5px; font-weight: 700; color: #0F172A;
  cursor: pointer;
}
.adm-faq-q:hover { background: #f8fafc; }
.adm-faq-q .chev { color: #94a3b8; transition: transform .2s; }
.adm-faq-item[data-open="true"] .adm-faq-q .chev { transform: rotate(45deg); color: #1F3A8A; }
.adm-faq-a { padding: 0 20px 18px; color: #475569; font-size: 14.5px; line-height: 1.6; }

.gloss {
  border-bottom: 1.5px dotted #1F3A8A;
  cursor: help;
  position: relative;
  color: inherit;
}
.gloss:focus { outline: none; color: #1F3A8A; }
.gloss-pop {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 260px; max-width: 80vw;
  padding: 12px 14px;
  background: #0F172A;
  color: #fff;
  border-radius: var(--r-control);
  font-size: 13px; line-height: 1.5;
  z-index: 80;
  box-shadow: 0 12px 28px -10px rgba(15, 23, 42, 0.6);
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease;
  font-weight: 400;
}
.gloss-pop::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #0F172A;
}
.gloss-pop b { display: block; font-size: 13.5px; color: #C99B43; margin-bottom: 4px; font-weight: 700; }
.gloss:hover .gloss-pop, .gloss:focus-visible .gloss-pop { opacity: 1; }
.adm-hero .gloss { border-bottom-color: #C99B43; }

.adm-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .adm-related { grid-template-columns: 1fr; } }
.adm-related a {
  display: block; text-decoration: none;
  background: #fff; border: 1px solid #e2e8f0; border-radius: var(--r-card);
  padding: 18px 20px;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
.adm-related a:hover { border-color: #E4D5A8; transform: translateY(-1px); }
.adm-related .school-name { font-size: 15.5px; font-weight: 700; color: #0F172A; }
.adm-related .school-meta { font-size: 13px; color: #64748b; margin-top: 6px; display: flex; gap: 10px; }
.adm-related .school-meta span { display: inline-flex; align-items: center; gap: 4px; }
.adm-related .school-arrow {
  display: inline-flex; align-items: center; gap: 4px;
  color: #1F3A8A; font-size: 13px; font-weight: 600; margin-top: 10px;
}


body.admissions-page :focus-visible { outline: 3px solid #C99B43; outline-offset: 2px; border-radius: var(--r-tag); }

.adm-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: #E4D5A8;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  margin-bottom: 18px;
}
.adm-hero-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: #C99B43; }
.adm-hero-em {
  font-style: normal;
  background: #C99B43;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.adm-distance-h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.015em; color: #0F172A; margin: 10px 0; }
.adm-distance-lede { font-size: 16px; color: #475569; line-height: 1.6; margin: 0 0 12px; }
.adm-distance-foot { font-size: 14.5px; color: #64748b; line-height: 1.55; margin: 0; }
.adm-distance-svg { display: block; }
.adm-distance-card .sec-title-muted { color: #64748b; }
.adm-section-head-centred { text-align: center; margin: 0 auto 32px; }

/* FEAT-152 — Track school star (sidebar) and detail-panel track button. */
.school-item-track-star {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
}
.school-item-track-star:hover { color: #C99B43; }
.school-item-track-star:focus-visible { outline: 2px solid #C99B43; outline-offset: 2px; }
.school-item-track-star[aria-pressed="true"] { color: #C99B43; }
.school-item-track-star .gb-icon { width: 18px; height: 18px; fill: none; }
.school-item-track-star[aria-pressed="true"] .gb-icon { fill: currentColor; }

/* FEAT-165: star-only track toggle to the right of the school name. */
#detail-track-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  color: #cbd5e1; /* unfilled grey star until tracked */
  transition: color 0.1s, transform 0.1s;
}
/* Hover must differ from the tracked gold, else an untracked star looks tracked
   while the cursor is still on it (and "won't go back" after you click to untrack). */
#detail-track-btn:hover { color: #94a3b8; transform: scale(1.12); }
#detail-track-btn:focus-visible { outline: 2px solid #C99B43; outline-offset: 2px; border-radius: 4px; }
#detail-track-btn[aria-pressed="true"] { color: #C99B43; }
#detail-track-btn[aria-pressed="true"]:hover { color: #b8893a; }
#detail-track-btn .detail-track-icon { font-size: 20px; line-height: 1; }

/* ── Design consistency pass ──────────────────────────────────────────────── */

/* Legal pages (privacy.html, terms.html) */
body.legal-page-body { height: auto; min-height: 100vh; display: block; }
.legal-page { min-height: 100vh; }
.legal-shell { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.legal-hero { padding: 56px 0 28px; }
.legal-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gb-indigo);
  background: var(--gb-indigo-50); border: 1px solid var(--gb-indigo-200);
  padding: 5px 12px; border-radius: var(--r-pill);
}
.legal-eyebrow-dot { width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--gb-indigo); }
.legal-hero h1 {
  font-size: var(--h1-page); line-height: 1.1; font-weight: 800;
  letter-spacing: -0.025em; color: var(--ink);
  margin: 18px 0 14px; text-wrap: balance;
}
.legal-hero h1 em { font-style: italic; color: var(--gb-indigo); font-weight: 800; }
.legal-hero .lede { font-size: 17px; line-height: 1.55; color: var(--ink-muted); margin: 0; }
.legal-body { padding: 16px 24px 80px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.legal-body h2 { font-size: 18px; color: var(--ink); margin-top: 32px; margin-bottom: 8px; }
.legal-body h3 { font-size: 15px; color: var(--ink); margin-top: 20px; margin-bottom: 6px; }
.legal-body ul { padding-left: 20px; margin: 8px 0 0; }
.legal-body li { list-style: disc; margin-bottom: 6px; }
.legal-body p, .legal-body li { color: var(--ink-muted); }
.legal-body a { color: var(--gb-indigo); }

/* Canonical button system */
.gb-btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 14px system-ui, -apple-system, sans-serif;
  color: #fff;
  background: var(--gb-indigo);
  border: 0;
  padding: 10px 18px;
  border-radius: var(--r-control);
  cursor: pointer;
  transition: background var(--t-fast);
}
.gb-btn-primary:hover { background: #163073; }
.gb-btn-primary:focus-visible { outline: 3px solid var(--gb-cyan); outline-offset: 2px; }
.gb-btn-primary:disabled { background: var(--ink-quiet); cursor: default; }

.gb-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 14px system-ui, -apple-system, sans-serif;
  color: var(--gb-indigo);
  background: #fff;
  border: 1.5px solid var(--gb-indigo-200);
  padding: 10px 18px;
  border-radius: var(--r-control);
  cursor: pointer;
}
.gb-btn-secondary:hover { background: var(--gb-indigo-50); }

.gb-btn-gradient {
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 15px system-ui, -apple-system, sans-serif;
  color: #fff;
  background: var(--gb-cta-gradient);
  border: 0;
  padding: 12px 22px;
  border-radius: var(--r-control);
  cursor: pointer;
}
.gb-btn-gradient:hover { filter: brightness(1.06); }

/* Unified site footer */
.gb-footer {
  background: var(--gb-navy);
  color: #cbd5e1;
  margin-top: 64px;
}
.gb-footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 40px 24px 28px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px;
}
@media (max-width: 720px) {
  .gb-footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; padding: 32px 18px 20px; }
  .gb-footer-brand { grid-column: 1 / -1; }
}
.gb-footer-logo img { display: block; height: 24px; }
.gb-footer-blurb { color: #cbd5e1; line-height: 1.55; margin: 14px 0 0; font-size: 13.5px; max-width: 38ch; }
.gb-footer-nav h3 { color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 12px; }
.gb-footer-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gb-footer-nav a { color: #C7BCA0; text-decoration: none; font-size: 13.5px; }
.gb-footer-nav a:hover { text-decoration: underline; color: #fff; }
.gb-footer-base {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 24px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* Context block on admissions pages — above .gb-footer */
.gb-footer-context {
  background: var(--surface-warm);
  border-top: 1px solid var(--line);
  padding: 48px 24px;
}
.gb-footer-context-inner { max-width: 1180px; margin: 0 auto; }
.gb-footer-context .row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 720px) { .gb-footer-context .row { grid-template-columns: 1fr; gap: 24px; } }
.gb-footer-context h3 {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink); margin: 0 0 12px;
}
.gb-footer-context ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gb-footer-context a { color: var(--gb-indigo); text-decoration: none; }
.gb-footer-context a:hover { text-decoration: underline; }
.gb-footer-context .contact-line { display: flex; align-items: center; gap: 8px; color: var(--ink-muted); }
.gb-footer-context .contact-line svg { color: var(--ink-quiet); flex-shrink: 0; }
.adm-fine {
  margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-faint); line-height: 1.55; max-width: 70ch;
}

/* Map page — compact footer to maximise map area */
.map-footer {
  flex-shrink: 0;
  padding: 8px 20px;
  background: #040F49;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  border-top: 1px solid #1e293b;
}
.map-footer a { color: #C99B43; text-decoration: none; }
.map-footer a:hover { text-decoration: underline; }
