/* England Schools Compare — shared stylesheet
   Design language mirrors the West Midlands prototype:
   cream + charcoal palette, Playfair Display headings, DM Sans body,
   pill badges, clean Leaflet maps. */

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

:root {
  --cream: #f5f0e8;
  --cream-dim: #ece7de;
  --charcoal: #1e1e2c;
  --mid: #4a4a5a;
  --grey: #475569;
  --grey-light: #cbd5e1;
  --blue: #2563eb;
  --green: #15803d;
  --orange: #9a3412;
  --purple: #7c3aed;
  --teal: #0d9488;
  --amber: #b45309;
  --red: #b91c1c;
  --line: #e5e0d8;
}

html, body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--charcoal); text-decoration: none; }
a:hover { color: var(--purple); }

h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; line-height: 1.2; }

/* ─── HEADER ─── */
.site-header {
  background: var(--charcoal); color: var(--cream);
  padding: 14px 24px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); }
.brand:hover { color: var(--cream); opacity: 0.85; }
.brand-mark {
  background: var(--purple); color: white;
  width: 30px; height: 30px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-weight: 700; font-size: 0.85rem;
}
.brand-name { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.05rem; }
.header-meta {
  margin-left: auto; font-size: 0.66rem; color: #a0a8b8;
  text-align: right; line-height: 1.55;
}

.crumbs {
  max-width: 1280px; margin: 8px auto 0;
  font-size: 0.7rem; color: #a0a8b8;
}
.crumbs a { color: #a0a8b8; }
.crumbs a:hover { color: var(--cream); }
.crumb-sep { margin: 0 4px; opacity: 0.5; }
.crumb-current { color: var(--cream); font-weight: 500; }

/* ─── AD SLOTS ─── */
.ad-slot {
  max-width: 1280px; margin: 18px auto;
  background: var(--cream-dim); border: 1px dashed var(--line);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--grey); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.ad-leaderboard, .ad-footer { height: 90px; max-width: 728px; }
.ad-rect { height: 250px; max-width: 300px; }
.ad-placeholder { user-select: none; }

/* ─── MAIN PAGE LAYOUT ─── */
.page {
  max-width: 1280px; margin: 0 auto; padding: 0 24px 40px;
}

/* ─── HERO ─── */
.hero {
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.hero h1 {
  font-size: 2.2rem; margin-bottom: 10px;
}
.hero-accent { color: var(--purple); font-style: italic; }
.hero-sub {
  font-size: 1rem; color: var(--mid); max-width: 720px;
}
.hero-region h1, .hero-la h1, .hero-list h1 { font-size: 1.9rem; }

/* ─── REGION GRID (homepage) ─── */
.region-grid { margin-bottom: 40px; }
.region-grid h2 { font-size: 1.4rem; margin-bottom: 18px; }
.region-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.region-card, .la-card {
  display: block;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  transition: all 0.15s;
}
.region-card:hover, .la-card:hover {
  border-color: var(--purple);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
  transform: translateY(-1px);
}
.region-card h3, .la-card h3 {
  font-size: 1.05rem; margin-bottom: 8px; color: var(--charcoal);
}
.region-stats, .la-stats {
  display: flex; gap: 14px;
  font-size: 0.75rem; color: var(--mid); margin-bottom: 6px;
}
.region-stats strong, .la-stats strong { color: var(--charcoal); font-weight: 600; }
.region-score, .la-score {
  font-size: 0.72rem; color: var(--grey);
  border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px;
}
.region-score strong, .la-score strong { color: var(--purple); font-weight: 600; }

/* ─── LA GRID (region page) ─── */
.la-grid-section { margin: 40px 0; }
.la-grid-section h2 { font-size: 1.4rem; margin-bottom: 18px; }
.la-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ─── MAP SECTION ─── */
.map-section {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 18px;
  margin-bottom: 28px;
}
.map-section h2 {
  font-size: 1.2rem; margin-bottom: 14px;
}
.map-container {
  width: 100%; height: 500px;
  border-radius: 8px; overflow: hidden;
  background: var(--cream-dim);
}
.map-container.map-small { height: 320px; }
.map-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 12px; font-size: 0.72rem; color: var(--mid);
}
.lg-item { display: inline-flex; align-items: center; gap: 5px; }
.lg-dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid var(--charcoal); display: inline-block;
}
.lg-note { margin-left: auto; color: var(--grey); font-size: 0.68rem; }

/* ─── TOP LISTS (homepage / region / LA) ─── */
.top-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
.top-col h2 { font-size: 1.25rem; margin-bottom: 14px; }
.top-list {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.top-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}
.top-row:last-child { border-bottom: none; }
.top-row:hover { background: var(--cream-dim); }
.top-rank {
  font-size: 0.7rem; font-weight: 700; color: white;
  min-width: 24px; height: 24px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.top-info { flex: 1; min-width: 0; }
.top-name {
  display: block; font-size: 0.85rem; font-weight: 500;
  color: var(--charcoal);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-meta { display: block; font-size: 0.7rem; color: var(--grey); margin-top: 2px; }
.see-all {
  display: block;
  text-align: center;
  margin-top: 10px;
  padding: 9px;
  background: white; border: 1px solid var(--line); border-radius: 8px;
  font-size: 0.78rem; font-weight: 500;
  color: var(--purple);
  transition: all 0.12s;
}
.see-all:hover {
  background: var(--purple); color: white; border-color: var(--purple);
}

/* ─── PILLS ─── */
.pill {
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
  display: inline-block;
  flex-shrink: 0;
}
.pill-vhigh { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.pill-high  { background: #ecfccb; color: #3f6212; }
.pill-mid   { background: #fef9c3; color: #854d0e; }
.pill-avg   { background: #ffedd5; color: #9a3412; }
.pill-low   { background: #fee2e2; color: #991b1b; }
.pill-na    { background: #f1f5f9; color: #475569; }

/* ─── RANKED LIST (LA primary/secondary page) ─── */
.ranked-list { display: flex; flex-direction: column; gap: 8px; }
.list-row {
  display: flex; gap: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.15s;
}
.list-row:hover {
  border-color: var(--purple);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.1);
}
.list-rank {
  font-size: 0.85rem; font-weight: 700; color: white;
  min-width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.list-main { flex: 1; min-width: 0; }
.list-name-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.list-name {
  font-size: 0.95rem; font-weight: 600; color: var(--charcoal);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-meta {
  font-size: 0.72rem; color: var(--mid); margin-bottom: 8px;
}
.list-metrics {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 0.72rem;
}
.metric {
  display: inline-flex; flex-direction: column; gap: 1px;
}
.metric-label { color: var(--grey); font-size: 0.68rem; }
.metric-val { color: var(--charcoal); font-weight: 600; font-size: 0.85rem; }
.rank-tag {
  display: block; margin-top: 8px;
  font-size: 0.66rem; color: var(--grey);
}

/* ─── INDIVIDUAL SCHOOL PAGE ─── */
.school-hero {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.school-hero-main { flex: 1; }
.school-hero h1 { font-size: 2.1rem; margin-bottom: 8px; }
.school-subline {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 0.85rem; color: var(--mid); margin-bottom: 6px;
}
.school-subline span:not(:nth-child(odd)) { color: var(--grey-light); }
.school-address { font-size: 0.8rem; color: var(--grey); }
.school-hero-score {
  text-align: center; flex-shrink: 0; padding-top: 4px;
}
.score-label {
  font-size: 0.68rem; color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.score-pill {
  font-size: 1.5rem; padding: 8px 18px; font-weight: 700;
}

.ranks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
.rank-tile {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.rank-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--purple);
  margin-bottom: 4px;
}
.rank-label {
  font-size: 0.72rem; color: var(--mid);
}

.school-section {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 22px;
}
.school-section h2 {
  font-size: 1.25rem; margin-bottom: 18px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.stat {
  padding: 14px;
  background: var(--cream-dim);
  border-radius: 8px;
}
.stat-label {
  font-size: 0.72rem; color: var(--mid);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 4px;
}
.stat-note {
  font-size: 0.7rem; color: var(--grey);
}
.stat-bar {
  height: 6px; background: white; border-radius: 4px;
  overflow: hidden; margin: 6px 0;
}
.stat-fill { height: 100%; border-radius: 4px; }

.trend-row {
  margin-top: 18px; padding: 12px 14px;
  background: var(--cream-dim); border-radius: 8px;
  font-size: 0.82rem;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.trend-label { color: var(--mid); font-weight: 500; margin-right: 8px; }
.trend-prev { color: var(--grey); }
.trend-curr { color: var(--charcoal); font-weight: 600; }
.trend-up { color: var(--green); font-weight: 600; }
.trend-down { color: var(--red); font-weight: 600; }
.trend-flat { color: var(--grey); }

.demo-row {
  display: flex; flex-wrap: wrap; gap: 22px;
}
.demo-item {
  display: inline-flex; flex-direction: column;
}
.demo-label {
  font-size: 0.7rem; color: var(--grey); text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 3px;
}
.demo-val {
  font-size: 1.05rem; font-weight: 600; color: var(--charcoal);
}

.no-data {
  padding: 20px; background: var(--cream-dim); border-radius: 8px;
  color: var(--mid); font-size: 0.85rem;
}

/* ─── NEARBY SECTION ─── */
.nearby-section {
  background: white; border: 1px solid var(--line);
  border-radius: 12px; padding: 22px 24px;
  margin-bottom: 22px;
}
.nearby-section h2 { font-size: 1.2rem; margin-bottom: 14px; }
.nearby-list { display: flex; flex-direction: column; gap: 6px; }
.nearby-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  transition: all 0.12s;
}
.nearby-row:hover {
  border-color: var(--purple); background: var(--cream-dim);
}
.nearby-info { flex: 1; min-width: 0; }
.nearby-name {
  display: block; font-size: 0.85rem; font-weight: 500; color: var(--charcoal);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nearby-meta { display: block; font-size: 0.7rem; color: var(--grey); }

/* ─── FOOTER ─── */
.site-footer {
  background: var(--charcoal); color: #a0a8b8;
  padding: 28px 24px 22px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 28px;
  font-size: 0.78rem;
}
.site-footer strong { color: var(--cream); font-family: 'Playfair Display', serif; font-size: 0.95rem; }
.footer-tagline { font-size: 0.72rem; }
.footer-source { font-size: 0.72rem; line-height: 1.7; }
.footer-nav { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.footer-nav a { color: #a0a8b8; font-size: 0.78rem; }
.footer-nav a:hover { color: var(--cream); }

/* ─── LEAFLET POPUP STYLING ─── */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.16);
}
.leaflet-popup-content { margin: 12px 14px; font-family: 'DM Sans', sans-serif; font-size: 0.78rem; }
.pp b { font-family: 'Playfair Display', serif; font-size: 0.95rem; display: block; margin-bottom: 4px; }
.pp-meta { color: var(--grey); font-size: 0.72rem; }
.pp-nodata { color: var(--grey); font-size: 0.72rem; font-style: italic; display: inline-block; margin-top: 4px; }
.pp a { color: var(--purple); font-weight: 600; font-size: 0.78rem; display: inline-block; margin-top: 4px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .top-section { grid-template-columns: 1fr; }
  .ranks-grid { grid-template-columns: repeat(2, 1fr); }
  .school-hero { flex-direction: column; }
  .school-hero-score { align-self: flex-start; text-align: left; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { flex-direction: row; text-align: left; }
  .header-meta { display: none; }
}
@media (max-width: 640px) {
  .page { padding: 0 16px 32px; }
  .hero { padding: 24px 0 18px; margin-bottom: 22px; }
  .hero h1, .school-hero h1 { font-size: 1.7rem; }
  .map-container { height: 380px; }
  .ranks-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .rank-num { font-size: 1.3rem; }
  .school-section { padding: 16px 18px; }
  .stat-grid { gap: 12px; }
}

/* ─── OFFICIAL EXTERNAL LINKS ─── */
.official-links .official-blurb {
  color: var(--mid);
  font-size: 0.88rem;
  margin: -4px 0 14px;
}
.official-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.official-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--cream-dim);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
  position: relative;
}
.official-card::after {
  content: "↗";
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--grey);
  font-size: 0.85rem;
}
.official-card:hover {
  border-color: var(--purple);
  transform: translateY(-1px);
}
.official-card:hover::after { color: var(--purple); }
.official-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--charcoal);
}
.official-host {
  font-size: 0.75rem;
  color: var(--grey);
  font-variant: small-caps;
  letter-spacing: 0.02em;
}
@media (max-width: 900px) {
  .official-grid { grid-template-columns: 1fr; }
}

/* ─── ACCESSIBILITY HELPERS ─── */
.visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px; height: 1px; overflow: hidden;
  white-space: nowrap;
}

/* ─── HEADER SEARCH ─── */
.header-search {
  position: relative;
  flex: 1; max-width: 360px;
  margin: 0 18px;
}
.header-search input {
  width: 100%;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #3a3a4a;
  background: #2a2a3a;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}
.header-search input::placeholder { color: #8b8ba0; }
.header-search input:focus {
  border-color: var(--purple);
  background: #303045;
}
.search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  overflow: hidden;
  z-index: 100;
}
.search-suggest:empty { display: none; }
.search-suggest .suggest-row {
  display: block;
  padding: 9px 14px;
  font-size: 0.82rem;
  color: var(--charcoal);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.search-suggest .suggest-row:last-child { border-bottom: none; }
.search-suggest .suggest-row:hover,
.search-suggest .suggest-active { background: var(--cream-dim); }
.search-suggest .suggest-row strong {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 1px;
}
.search-suggest .suggest-meta {
  font-size: 0.7rem; color: var(--grey);
}

/* ─── GLOSSARY (?) ICON ─── */
.glossary-q {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--cream-dim);
  border: 1px solid var(--grey-light);
  color: var(--mid);
  font-size: 0.65rem; font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
  vertical-align: 1px;
}
.glossary-q:hover {
  background: var(--purple); color: white; border-color: var(--purple);
}

/* ─── YEAR PILL + LAST UPDATED ─── */
.school-hero-meta {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 4px;
  margin-right: 10px;
}
.year-pill {
  display: inline-block;
  padding: 3px 10px;
  background: var(--charcoal); color: var(--cream);
  border-radius: 14px;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.02em;
}
.last-updated {
  font-size: 0.7rem; color: var(--grey);
}

/* ─── SCORE CAVEAT ─── */
.score-caveat {
  text-align: center;
  font-size: 0.7rem; color: var(--mid);
  max-width: 200px;
  margin: 6px auto 0;
  line-height: 1.4;
}
.score-caveat a {
  color: var(--purple); text-decoration: underline;
}

/* ─── CATCHMENT NOTICE ─── */
.catchment-notice {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fff7ed;
  border-left: 3px solid #b45309;
  border-radius: 4px;
  font-size: 0.78rem; color: var(--mid);
  max-width: 720px;
}

/* ─── "WHY NO DATA?" LINK INSIDE STAT TILES ─── */
.why-no-data {
  display: inline-flex; align-items: center;
  margin-top: 4px;
  padding: 4px 9px;
  background: white;
  border: 1px dashed var(--grey-light);
  border-radius: 14px;
  font-size: 0.7rem; color: var(--purple); font-weight: 600;
  text-decoration: none;
}
.why-no-data::before { content: "?"; margin-right: 4px; }
.why-no-data:hover { background: var(--purple); color: white; border-color: var(--purple); }

/* ─── COHORT TOGGLE ─── */
.cohort-toggle {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 20px 0 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.cohort-toggle label {
  font-size: 0.85rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
}
.cohort-toggle .cohort-checkbox { accent-color: var(--purple); }
.cohort-toggle .cohort-help {
  font-size: 0.74rem; color: var(--grey);
}
.cohort-toggle a { color: var(--purple); }

/* ─── NEAR-ME WIDGET (homepage) ─── */
.near-me-section {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 28px;
}
.near-me-section h2 { font-size: 1.3rem; margin-bottom: 6px; }
.near-me-blurb {
  color: var(--mid); font-size: 0.9rem; margin-bottom: 14px;
}
.near-me-form {
  display: flex; gap: 8px;
  max-width: 420px;
}
.near-me-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit; font-size: 0.95rem;
  text-transform: uppercase;
}
.near-me-form input:focus {
  outline: none; border-color: var(--purple);
}
.near-me-form button {
  padding: 10px 22px;
  background: var(--purple); color: white;
  border: none; border-radius: 8px;
  font-family: inherit; font-weight: 600; font-size: 0.9rem;
  cursor: pointer;
}
.near-me-form button:hover { background: #6d28d9; }
.near-me-status {
  margin-top: 10px; font-size: 0.82rem; color: var(--mid);
}
.near-me-status.near-me-error { color: var(--red); }
.near-me-results { margin-top: 18px; }
.near-me-results h3 {
  font-size: 1rem; margin-bottom: 10px;
  font-family: 'Playfair Display', serif;
}

/* ─── COMPARE PAGE ─── */
.compare-pickers {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: end;
  margin: 22px 0 18px;
}
.compare-picker { position: relative; }
.compare-picker label {
  font-size: 0.75rem;
  color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 6px; display: block;
}
.compare-input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 0.95rem;
}
.compare-input:focus { outline: none; border-color: var(--purple); }
.compare-vs {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; color: var(--grey);
  padding-bottom: 10px;
}
.compare-suggest {
  position: absolute; top: 100%; left: 0; right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  margin-top: 4px;
  max-height: 280px; overflow: auto;
  z-index: 50;
}
.compare-suggest:empty { display: none; }
.compare-suggest .suggest-row {
  display: block; padding: 9px 14px;
  font-size: 0.85rem; color: var(--charcoal);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.compare-suggest .suggest-row:last-child { border-bottom: none; }
.compare-suggest .suggest-row:hover { background: var(--cream-dim); }
.compare-suggest strong { display: block; font-weight: 600; margin-bottom: 1px; }
.compare-suggest .suggest-meta { font-size: 0.72rem; color: var(--grey); }
.compare-loading { color: var(--grey); font-size: 0.85rem; padding: 12px 0; }
.compare-table {
  width: 100%; border-collapse: collapse;
  margin: 14px 0 12px;
  font-size: 0.85rem;
}
.compare-table th, .compare-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.compare-table thead th {
  background: var(--cream-dim);
  font-size: 0.95rem; font-weight: 600;
}
.compare-table thead th a { color: var(--purple); }
.compare-meta { display: block; font-weight: 400; font-size: 0.72rem; color: var(--grey); margin-top: 2px; }
.compare-table tbody th { font-weight: 500; color: var(--mid); width: 36%; }
.compare-table td { color: var(--charcoal); font-weight: 600; }
.compare-table .section-row td {
  background: var(--cream-dim);
  font-size: 0.75rem; color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600;
}
.compare-table .better-a td:nth-child(2) { background: #ecfdf5; color: #065f46; }
.compare-table .better-b td:nth-child(3) { background: #ecfdf5; color: #065f46; }
.compare-caveat { font-size: 0.78rem; color: var(--grey); margin-top: 12px; }
.article-lede { color: var(--mid); font-size: 1rem; max-width: 760px; margin-bottom: 18px; }
.article-h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; margin: 22px 0 8px;
}
.article-footnote {
  margin-top: 14px; font-size: 0.78rem; color: var(--grey);
}
.article-footnote code {
  background: var(--cream-dim); padding: 2px 6px; border-radius: 4px;
  font-family: SF Mono, Menlo, monospace; font-size: 0.78rem;
}

/* ─── FOOTER FEEDBACK ─── */
.footer-feedback {
  font-size: 0.7rem; color: #a0a8b8; margin-top: 6px;
}
.footer-feedback a { color: var(--cream); text-decoration: underline; }
.footer-feedback-note { color: #707080; font-style: italic; }

/* ─── RESPONSIVE TWEAKS ─── */
@media (max-width: 900px) {
  .header-search { max-width: 200px; margin: 0 10px; }
  .school-hero-meta { align-items: flex-start; margin-right: 0; }
  .compare-pickers { grid-template-columns: 1fr; }
  .compare-vs { text-align: center; padding: 0; }
}
@media (max-width: 640px) {
  .header-search { display: none; }
  .compare-table th, .compare-table td { padding: 8px; font-size: 0.78rem; }
}

/* ─── 3-SCHOOL COMPARE UI ─── */
.compare-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: end;
  margin: 22px 0 18px;
}
.compare-pickers .compare-vs { display: none; } /* legacy "vs" no longer needed */
.compare-picker-c { position: relative; }
.compare-remove {
  background: transparent;
  border: none;
  color: var(--grey);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  padding: 0 4px;
  line-height: 1;
}
.compare-remove:hover { color: var(--red); }
.compare-add-slot {
  display: flex; align-items: end;
}
.compare-add-btn {
  width: 100%;
  padding: 10px 14px;
  background: white;
  border: 1.5px dashed var(--grey-light);
  border-radius: 8px;
  color: var(--purple);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.compare-add-btn:hover {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
  border-style: solid;
}

.compare-scroll {
  overflow-x: auto;
  margin: 14px 0 12px;
}
.compare-table.compare-cols-2 { min-width: 0; }
.compare-table.compare-cols-3 { min-width: 580px; }
.compare-table tbody td.cell-best {
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
}
.compare-table tbody tr:hover td { background: #fafaf7; }
.compare-table tbody tr:hover td.cell-best { background: #d1fae5; }
.compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.compare-table tbody th {
  position: sticky;
  left: 0;
  background: white;
  z-index: 1;
}

@media (max-width: 900px) {
  .compare-pickers { grid-template-columns: 1fr; gap: 12px; }
  .compare-add-slot { margin-top: 0; }
  .compare-table { font-size: 0.78rem; }
  .compare-table th, .compare-table td { padding: 8px; }
}
