:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-grad: radial-gradient(
      1100px 600px at 12% -10%,
      rgba(99, 102, 241, 0.18),
      transparent 70%
    ),
    radial-gradient(
      900px 500px at 100% 0%,
      rgba(14, 165, 233, 0.14),
      transparent 70%
    ),
    var(--bg);
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-strong: #4338ca;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --green: #047857;
  --green-soft: #d1fae5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04),
    0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.18),
    0 4px 10px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 30px 60px -25px rgba(15, 23, 42, 0.35),
    0 12px 25px -10px rgba(15, 23, 42, 0.18);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-grad);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
}

code {
  background: #eef2f7;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.85em;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  color: white;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  box-shadow: var(--shadow-md);
}

.brand-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
}

.brand-title {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-year-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  color: white;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, transform 0.05s;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ---------- Layout ---------- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease both;
}

.tab-panel.active {
  display: block;
}

/* ---------- Home (three questions) ---------- */
#home-panel {
  padding-top: 4px;
}

.home-hero {
  margin-bottom: 24px;
}

.home-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--muted);
}

.home-title {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.home-lead {
  margin: 0 0 18px;
  font-size: clamp(0.98rem, 2.4vw, 1.06rem);
  color: var(--ink-2);
  line-height: 1.5;
  max-width: 56ch;
}

/* primary CTA right under the headline */
.home-cta-primary {
  margin: 4px 0 4px;
}

.home-cta-primary-btn {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-shadow: 0 8px 24px -10px rgba(79, 70, 229, 0.55);
  transition: transform 0.08s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 64px;
}

.home-cta-primary-btn:hover {
  box-shadow: 0 12px 28px -10px rgba(79, 70, 229, 0.65);
}

.home-cta-primary-btn:active {
  transform: scale(0.99);
}

.home-cta-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  font-size: 1.2rem;
}

.home-cta-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.home-cta-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.home-cta-sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.35;
}

.home-cta-arrow {
  font-size: 1.2rem;
  font-weight: 800;
  opacity: 0.85;
}

/* highlights strip — high-level numbers */
.home-highlights {
  margin: 18px 0 4px;
}

.home-highlights-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-highlight {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.home-highlight-num {
  font-size: clamp(1.4rem, 5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.home-highlight-lbl {
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.35;
}

.home-highlight-src {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

@media (min-width: 720px) {
  .home-highlights-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* questions section header */
.home-questions-section {
  margin: 22px 0 0;
}

.home-questions-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.home-questions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (max-width: 719px) {
  .home-questions {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 720px) {
  .home-questions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* tighter card */
.home-q {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 16px 18px;
  box-shadow: var(--shadow-sm);
}

.home-q-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-q-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.home-q-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.home-q-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-2);
  line-height: 1.5;
}

.home-q-text strong {
  color: var(--ink);
  font-weight: 700;
}

.home-q-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.home-q-actions-stack .home-q-btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 480px) and (max-width: 719px) {
  .home-q-actions:not(.home-q-actions-stack) {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .home-q-actions:not(.home-q-actions-stack) .home-q-btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.home-q-btn {
  min-height: 48px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, border-color 0.15s;
}

.home-q-btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.home-q-btn:active {
  transform: scale(0.98);
}

.home-q-btn-secondary {
  background: var(--panel-soft);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}

.home-q-btn-secondary:hover {
  background: #fff;
  border-color: var(--line);
}

.home-footnote {
  margin: 20px 0 0;
  line-height: 1.5;
  max-width: 52ch;
}

/* ---------- District Outlook ---------- */
.outlook-root {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 0 0 32px;
}

.outlook-hero {
  margin: 4px 0 0;
}

.outlook-title {
  margin: 0 0 6px;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.outlook-lead {
  margin: 0;
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 64ch;
}

.outlook-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 20px;
}

.outlook-section-head {
  margin: 0 0 14px;
}

.outlook-section-head h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.outlook-section-head .muted {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.outlook-subhead {
  margin: 18px 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.outlook-grid {
  display: grid;
  gap: 12px;
}

.outlook-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.outlook-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.outlook-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.outlook-stat-num {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.outlook-stat-down .outlook-stat-num {
  color: #b91c1c;
}

.outlook-stat-lbl {
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.4;
}

.outlook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.outlook-fineprint {
  margin: 12px 0 0;
  line-height: 1.5;
}

/* trend bars (district enrollment) */
.trend-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.trend-bar {
  flex: 1 1 0;
  min-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  position: relative;
}

.trend-bar-fill {
  width: 100%;
  max-width: 36px;
  background: linear-gradient(180deg, #4f46e5, #6366f1);
  border-radius: 6px 6px 0 0;
  min-height: 8px;
}

.trend-bar-projected .trend-bar-fill {
  background: linear-gradient(180deg, #f59e0b, #fbbf24);
}

.trend-bar-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.trend-bar-year {
  font-size: 0.72rem;
  color: var(--ink-2);
  white-space: nowrap;
}

.trend-bar-type {
  font-size: 0.68rem;
  color: var(--ink-2);
  font-style: italic;
  white-space: nowrap;
}

/* per-school list */
.outlook-school-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.outlook-school-row {
  margin: 0;
}

.outlook-school-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 2fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.outlook-school-link:hover {
  background: #f8fafc;
  border-color: var(--line);
}

.outlook-school-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outlook-school-bar {
  display: block;
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.outlook-school-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  border-radius: 999px;
}

.outlook-school-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  min-width: 48px;
  text-align: right;
}

/* race & ethnicity bars */
.race-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.race-bar {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 2fr) auto;
  gap: 10px;
  align-items: center;
}

.race-bar-label {
  font-size: 0.88rem;
  color: var(--ink);
}

.race-bar-track {
  display: block;
  height: 12px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.race-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: 999px;
}

.race-bar-num {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--ink);
  min-width: 48px;
  text-align: right;
}

/* per-pupil sparkline */
.spark-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 110px;
}

.spark-bar {
  flex: 1 1 0;
  min-width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}

.spark-bar-fill {
  width: 100%;
  max-width: 38px;
  background: linear-gradient(180deg, #10b981, #34d399);
  border-radius: 6px 6px 0 0;
  min-height: 12px;
}

.spark-bar-num {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* CTA grid */
.outlook-section-cta {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.outlook-section-cta h3 {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

.outlook-cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.outlook-cta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.12s ease, transform 0.12s ease,
    box-shadow 0.12s ease;
}

.outlook-cta:hover {
  border-color: #6366f1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -6px rgba(99, 102, 241, 0.4);
}

.outlook-cta-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
}

.outlook-cta-sub {
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.4;
}

@media (max-width: 720px) {
  .outlook-school-link {
    grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto;
    gap: 8px;
    padding: 8px 10px;
  }
  .outlook-school-name {
    font-size: 0.88rem;
  }
  .race-bar {
    grid-template-columns: 100px minmax(0, 1fr) auto;
    gap: 8px;
  }
  .trend-bars {
    height: 150px;
  }
  .trend-bar {
    min-width: 50px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Hero / Search ---------- */
.hero {
  text-align: center;
  margin: 24px auto 28px;
  max-width: 760px;
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.hero-accent {
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: "Instrument Serif", "Inter", serif;
  font-style: italic;
  font-weight: 400;
  padding: 0 4px;
}

.hero-sub {
  margin: 0 auto;
  max-width: 540px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.boundary-banner {
  margin: 18px auto 0;
  max-width: 640px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.86rem;
  text-align: left;
  line-height: 1.45;
}

.boundary-banner strong {
  color: var(--ink);
  font-weight: 700;
}

.boundary-banner-tag {
  background: white;
  color: var(--accent-strong);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-card {
  margin: 28px auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  text-align: left;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 12px;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  padding-left: 4px;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-soft);
  font-size: 1rem;
  transition: border 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
}

.field input::placeholder {
  color: #94a3b8;
}

.field input:hover {
  border-color: var(--line-strong);
}

.field input:focus {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.combo {
  position: relative;
}

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.suggestions.open {
  display: block;
}

.suggestions li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
}

.suggestions li:hover,
.suggestions li.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.suggestions .suggest-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.suggestions li.active .suggest-tag,
.suggestions li:hover .suggest-tag {
  color: var(--accent);
}

.btn-clear {
  height: 50px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-weight: 600;
  transition: background 0.15s, transform 0.05s;
}

.btn-clear:hover {
  background: white;
  border-color: var(--line-strong);
}

/* ---------- Answer card ---------- */
.answer {
  margin: 28px auto 0;
  max-width: 820px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: fadeIn 0.2s ease both;
}

.answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--school-color, #4f46e5), #1e293b);
  color: white;
}

.answer-head .pill {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.answer-head h3 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.answer-head p {
  margin: 4px 0 0;
  opacity: 0.85;
  font-size: 0.92rem;
}

.answer-body {
  padding: 22px 24px;
}

.assignment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.assignment-cell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel-soft);
}

.assignment-cell .assign-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.assignment-cell .assign-school {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.school-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--school-color, #4f46e5);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.answer-meta {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.answer-meta strong {
  color: var(--ink-2);
}

.answer-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-ghost {
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s, border 0.15s, transform 0.05s;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost:hover {
  background: var(--panel-soft);
  border-color: var(--line-strong);
}

.btn-mini {
  padding: 6px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* ---------- Redistricting alert (Lookup answer) ---------- */
.redistrict-banner {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff7ed 0%, #fef2f2 100%);
  border: 1px solid #fecaca;
  border-left: 5px solid #dc2626;
  border-radius: var(--radius);
  color: #7f1d1d;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.06);
}

.redistrict-banner-soft {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-left: 5px solid #d97706;
  color: #78350f;
  box-shadow: 0 1px 2px rgba(217, 119, 6, 0.06);
}

.redistrict-banner-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.redistrict-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #dc2626;
  color: white;
  border-radius: 999px;
  white-space: nowrap;
}

.redistrict-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: redistrict-pulse 1.6s ease-in-out infinite;
}

.redistrict-tag-soft {
  background: #d97706;
}

@keyframes redistrict-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}

.redistrict-banner-addr {
  font-size: 0.85rem;
  font-weight: 600;
  color: #7f1d1d;
  opacity: 0.85;
}

.redistrict-banner-soft .redistrict-banner-addr {
  color: #78350f;
}

.redistrict-lead {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.redistrict-rows {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.redistrict-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(220, 38, 38, 0.15);
  border-radius: 8px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.redistrict-row-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7f1d1d;
  background: #fee2e2;
  padding: 2px 7px;
  border-radius: 999px;
}

.redistrict-from {
  color: #6b7280;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(220, 38, 38, 0.4);
}

.redistrict-arrow {
  color: #dc2626;
  font-weight: 700;
  font-size: 1rem;
}

.redistrict-to {
  color: var(--ink-2);
  font-weight: 700;
  position: relative;
  padding-left: 14px;
}

.redistrict-to::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--school-color, #dc2626);
  transform: translateY(-50%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.redistrict-foot {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(127, 29, 29, 0.7);
}

.redistrict-banner-soft .redistrict-foot {
  color: rgba(120, 53, 15, 0.7);
}

/* ---------- Lookup inline minimap ---------- */
.answer-minimap-wrap {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  overflow: hidden;
}

.answer-minimap-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: white;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.answer-minimap-head strong {
  color: var(--ink-2);
  font-weight: 700;
}

.answer-minimap-note {
  margin-top: 2px;
  font-size: 0.78rem;
}

.answer-minimap {
  height: 240px;
  width: 100%;
  background: #f1f5f9;
  position: relative;
  transition: filter 0.15s ease;
}

.answer-minimap:hover {
  filter: brightness(1.04) saturate(1.06);
}

.answer-minimap::after {
  content: "Click to expand";
  position: absolute;
  top: 8px;
  right: 10px;
  background: rgba(15, 23, 42, 0.78);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  pointer-events: none;
  letter-spacing: 0.02em;
  z-index: 500;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.answer-minimap:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.answer-minimap.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.answer-minimap-empty {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.answer-minimap-foot {
  margin: 0;
  padding: 8px 14px 10px;
  font-size: 0.78rem;
  background: var(--panel-soft);
  border-top: 1px solid var(--line);
}

/* Hide tile attribution inside the minimap (the wrap already credits
   the source via the rest of the UI; the popup-attribution badge feels
   noisy at this size). */
.answer-minimap .leaflet-control-attribution {
  display: none;
}

/* ---------- Full-map spotlight (highlighted address) ---------- */
.parcel-spotlight-shape {
  animation: parcel-spotlight-pulse 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.85));
}

@keyframes parcel-spotlight-pulse {
  0%, 100% {
    stroke-opacity: 1;
    fill-opacity: 0.6;
  }
  50% {
    stroke-opacity: 0.6;
    fill-opacity: 0.85;
  }
}

.parcel-spotlight-pin {
  pointer-events: none;
}

.parcel-spotlight-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #facc15;
  border: 3px solid #92400e;
  box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.45),
    0 0 0 12px rgba(250, 204, 21, 0.18);
  animation: parcel-spotlight-dot 1.6s ease-in-out infinite;
}

@keyframes parcel-spotlight-dot {
  0%, 100% {
    box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.45),
      0 0 0 12px rgba(250, 204, 21, 0.18);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(250, 204, 21, 0.55),
      0 0 0 20px rgba(250, 204, 21, 0.05);
  }
}

.parcel-spotlight-label {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #0f172a;
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
}

.split-warning {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: var(--radius);
  font-size: 0.92rem;
  border: 1px solid #fde68a;
}

.split-options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.split-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.split-option .school-dot {
  width: 10px;
  height: 10px;
}

.split-option strong {
  flex: 1;
}

.split-option .range-tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--ink-2);
}

/* ---------- Stats ---------- */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 36px;
}

.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.stat span {
  color: var(--muted);
  font-size: 0.86rem;
}

.stat.amber strong {
  color: var(--amber);
}

.stat.blue strong {
  color: var(--accent);
}

/* ---------- Recent ---------- */
.recent {
  margin-top: 36px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-header h2,
.section-header h3 {
  margin: 0;
  letter-spacing: -0.01em;
}

.section-header h2 {
  font-size: 1.6rem;
}

.section-header h3 {
  font-size: 1rem;
}

.link {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 8px;
}

.link:hover {
  background: var(--accent-soft);
}

.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border 0.15s;
}

.recent-chip:hover {
  background: var(--panel-soft);
  border-color: var(--line-strong);
}

.inline-search {
  width: 240px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: white;
  font-size: 0.9rem;
}

.inline-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

/* ---------- Map ---------- */
.map-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: calc(100vh - 220px);
  min-height: 520px;
}

.map-legend {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.map-legend h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.map-legend > p {
  margin: 0 0 14px;
  font-size: 0.85rem;
}

.year-toggle-wrap {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.year-toggle-wrap[hidden] {
  display: none;
}

.year-toggle-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.year-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}

.year-pill {
  border: 0;
  background: transparent;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s;
}

.year-pill:hover {
  color: var(--ink);
}

.year-pill.active {
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  color: white;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}

.changes-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.changes-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.year-toggle-meta {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
}

.year-toggle-meta strong {
  color: var(--ink-2);
  font-weight: 700;
}

.legend-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, border 0.15s;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
}

.legend-item:hover {
  background: var(--panel-soft);
  border-color: var(--line);
}

.legend-item.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.legend-item.active .legend-count {
  color: var(--accent-strong);
}

.legend-item .school-dot {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.legend-item .legend-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
}

.legend-item .legend-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.map-wrap {
  position: relative;
  height: 100%;
}

.map {
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #f1f5f9;
}

.map-reset {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1000;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: white;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  transition: background 0.15s, transform 0.05s;
}

.map-reset:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.popup-zone-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.popup-zone-btn:hover {
  background: var(--accent-strong);
}

.zone-notice {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: min(420px, calc(100% - 32px));
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.92);
  color: white;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.zone-notice.hidden {
  display: none;
}

.leaflet-tooltip.street-name-tooltip {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

.leaflet-tooltip.street-name-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.92);
}

.leaflet-tooltip.parcel-change-tooltip {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.leaflet-tooltip.parcel-change-tooltip::before {
  border-top-color: var(--line);
}

.leaflet-tooltip.parcel-change-tooltip strong {
  display: block;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.leaflet-tooltip.parcel-change-tooltip .change-arrow {
  display: inline-block;
  margin: 0 6px;
  color: var(--muted);
  font-weight: 700;
}

.school-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 0.78rem;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.4);
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  margin: 14px 16px;
  font-family: "Inter", sans-serif;
}

.popup-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 4px;
}

.popup-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.popup-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.85rem;
}

/* ---------- Per-parcel multi-source popup ---------- */
.parcel-multi-source-popup .leaflet-popup-content {
  margin: 12px 14px;
  min-width: 280px;
  max-width: 360px;
}

.parcel-popup .popup-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 2px;
}

.parcel-popup .popup-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.parcel-popup .popup-change-banner {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.parcel-popup .popup-sources {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.parcel-popup .popup-sources th,
.parcel-popup .popup-sources td {
  padding: 4px 6px;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.parcel-popup .popup-sources th {
  font-weight: 600;
  color: var(--muted);
  width: 38%;
  white-space: nowrap;
}

.parcel-popup .popup-sources tr.src-redistricted td {
  color: #b45309;
  font-weight: 600;
}

.parcel-popup .popup-sources tr.src-zillow th,
.parcel-popup .popup-sources tr.src-redfin th {
  font-style: italic;
}

.parcel-popup .popup-section-title {
  margin: 10px 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.parcel-popup .popup-listings {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.parcel-popup .popup-listings th,
.parcel-popup .popup-listings td {
  padding: 3px 6px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.parcel-popup .popup-listings th {
  color: var(--muted);
  font-weight: 600;
}

.parcel-popup .popup-listings a {
  color: #2563eb;
  text-decoration: none;
}

.parcel-popup .popup-listings a:hover {
  text-decoration: underline;
}

/* ---------- Schools tab ---------- */
.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.school-card {
  display: block;
  width: 100%;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border 0.18s;
  cursor: pointer;
}

.school-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.school-card .swatch {
  height: 64px;
  background: linear-gradient(135deg, var(--school-color), #1e293b);
  position: relative;
}

.school-card .swatch .badge {
  position: absolute;
  bottom: -14px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: white;
  display: grid;
  place-items: center;
  color: var(--school-color);
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

.school-card .body {
  padding: 24px 18px 18px;
}

.school-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.school-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.school-card .body strong {
  display: block;
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--ink-2);
}

.school-card .boundary-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.school-card .boundary-tag.new-zone {
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent-strong);
  border: 1px solid rgba(79, 70, 229, 0.25);
}

.school-card .boundary-tag.preschool-only {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid #fde68a;
}

.boundary-note {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.5;
}

.boundary-note.preschool-only {
  background: var(--amber-soft);
  border-color: #fde68a;
  color: #78350f;
}

.boundary-note strong {
  font-weight: 700;
}

.school-detail {
  margin-top: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.school-detail-head {
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--school-color), #1e293b);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.school-detail-head h3 {
  margin: 0;
  font-size: 1.4rem;
}

.school-detail-head .pill {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.school-detail-body {
  padding: 22px 24px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-meta strong {
  display: block;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.detail-streets {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.detail-streets h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.street-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.street-list span {
  padding: 4px 0;
}

.street-list .split-flag {
  margin-left: 6px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
}

/* ---------- School-detail extra cards (projection / demo / budget) ---------- */
.detail-card {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft, #f8fafc);
}

.detail-card-projection {
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 60%);
  border-color: #cfe1f7;
}

.detail-card-demo {
  background: linear-gradient(180deg, #fdf6ff 0%, #f8fafc 70%);
  border-color: #e3d2ee;
}

.detail-card-budget {
  background: linear-gradient(180deg, #fff8ec 0%, #f8fafc 70%);
  border-color: #ecd7a8;
}

.detail-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-card-head h4 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink-2);
}

.detail-card-pill {
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.detail-card-foot {
  margin: 12px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.detail-card-foot a {
  color: var(--ink-2);
  text-decoration: underline;
}

/* Projection grade-cell row */
.grade-cell-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.grade-cell-row-mid {
  grid-template-columns: repeat(3, 1fr);
}

.grade-cell-row-pk {
  grid-template-columns: 1fr;
}

.grade-cell-pk {
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 70%);
  border-color: #a7f3d0;
}

.detail-card-intro {
  margin: -6px 0 12px;
  font-size: 0.85rem;
  line-height: 1.55;
}

.grade-cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.grade-cell-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.grade-cell-num {
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink-1);
  margin-top: 2px;
}

/* Demographics block */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.demo-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.demo-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.demo-stat-num {
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink-1);
}

.vs-district {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 2px;
}

.vs-district.vs-up {
  color: #047857;
}

.vs-district.vs-down {
  color: #b45309;
}

.vs-district.vs-flat {
  color: var(--muted);
}

.demo-race {
  margin-top: 6px;
}

.demo-race-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.demo-race-bar {
  display: flex;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  border: 1px solid var(--line);
}

.demo-race-seg {
  display: block;
  height: 100%;
  min-width: 0;
}

.seg-white {
  background: #a78bfa;
}

.seg-black {
  background: #f472b6;
}

.seg-hispanic {
  background: #fb923c;
}

.seg-asian {
  background: #34d399;
}

.seg-other {
  background: #94a3b8;
}

.demo-race-legend {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.demo-race-legend i.seg-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

/* Budget context block */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.budget-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.budget-stat-warn {
  border-color: #f4c1a1;
  background: #fff5ed;
}

.budget-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.budget-stat-num {
  font-variant-numeric: tabular-nums;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink-1);
}

.budget-stat-warn .budget-stat-num {
  color: #b45309;
}

.budget-stat-unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.budget-stat-foot {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ---------- Splits tab / changing-address list ---------- */
.splits-list {
  display: grid;
  gap: 14px;
}

.change-list-meta {
  margin: 0 0 12px;
}

.change-address-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.change-address-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

@media (min-width: 480px) {
  .change-address-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
}

.change-address-addr {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  word-break: break-word;
}

.change-school-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.change-line {
  margin: 0;
  line-height: 1.4;
}

.change-which {
  display: inline-block;
  min-width: 4.5rem;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.change-line .change-arrow {
  color: var(--accent);
  font-weight: 800;
  padding: 0 0.2em;
}

.split-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.split-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.split-card-head h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.split-card-head .pill {
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
}

.split-segments {
  display: grid;
  gap: 8px;
}

.split-segment {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.split-segment .school-dot {
  width: 10px;
  height: 10px;
}

.split-segment .seg-label {
  flex: 1;
  font-weight: 600;
  font-size: 0.92rem;
}

.split-segment .seg-range {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 8px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer p {
  margin: 0 auto;
  max-width: 64ch;
  line-height: 1.55;
}

.footer p + p {
  margin-top: 10px;
}

.footer-disclosure {
  color: var(--ink-2);
}

.footer-disclosure a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.footer-disclosure a:hover {
  color: var(--accent-strong);
}

/* ---------- Home: About this site ---------- */
.home-about {
  margin: 22px 0 0;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, #fafbff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.home-about-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  margin: 0 0 8px;
}

.home-about-title {
  margin: 0 0 10px;
  font-size: clamp(1.05rem, 3vw, 1.18rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--ink);
}

.home-about-body {
  margin: 0 0 10px;
  font-size: 0.94rem;
  color: var(--ink-2);
  line-height: 1.6;
}

.home-about-body:last-child {
  margin-bottom: 0;
}

.home-about-body em {
  color: var(--ink);
  font-style: italic;
}

.home-about-body strong {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- Home: Subscribe card ---------- */
.home-subscribe {
  margin: 14px 0 0;
  padding: 20px 18px 18px;
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-lg);
}

.home-subscribe-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4f46e5;
  font-weight: 800;
}

.home-subscribe-title {
  margin: 0 0 8px;
  font-size: clamp(1.1rem, 3.4vw, 1.28rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

.home-subscribe-text {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 56ch;
}

.home-subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-subscribe-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  min-height: 48px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-subscribe-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.home-subscribe-btn {
  min-height: 48px;
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid #4f46e5;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.18s ease;
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.5);
}

.home-subscribe-btn:hover {
  box-shadow: 0 10px 24px -10px rgba(79, 70, 229, 0.6);
}

.home-subscribe-btn:active {
  transform: scale(0.99);
}

.home-subscribe-success {
  margin: 0;
  padding: 12px 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  color: #065f46;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
}

.home-subscribe-fineprint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

@media (min-width: 480px) {
  .home-subscribe-form {
    flex-direction: row;
    align-items: stretch;
  }

  .home-subscribe-form .home-subscribe-input {
    flex: 1 1 auto;
  }

  .home-subscribe-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

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

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px;
  }

  .tabs {
    overflow-x: auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  main {
    padding: 20px 16px max(60px, env(safe-area-inset-bottom));
  }

  .home-q {
    padding: 16px 14px 18px;
    gap: 12px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .field-num {
    grid-row: 2;
  }

  .btn-clear {
    width: 100%;
  }

  .quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .assignment-grid {
    grid-template-columns: 1fr;
  }

  .map-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .map {
    height: 460px;
  }

  .map-legend {
    max-height: 320px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .inline-search {
    width: 100%;
  }

  .demo-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .demo-map {
    height: 480px;
  }

  .demo-controls {
    max-height: 360px;
  }
}

/* ============== Demographics tab ============== */

.demo-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: calc(100vh - 240px);
  min-height: 540px;
}

.demo-controls {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.demo-section h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.demo-layers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-layer {
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--panel-soft);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.demo-layer:hover {
  background: var(--accent-soft);
  border-color: var(--line);
}

.demo-layer.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.demo-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}

.demo-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.demo-gradient {
  height: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(
    to right,
    #eff6ff 0%,
    #93c5fd 25%,
    #3b82f6 50%,
    #1d4ed8 75%,
    #1e3a8a 100%
  );
}

.demo-gradient-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.demo-source {
  margin: 14px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.demo-map-wrap {
  position: relative;
  height: 100%;
}

.demo-map {
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.demo-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  z-index: 1500;
  max-width: 240px;
  font-variant-numeric: tabular-nums;
}

.demo-tooltip strong {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #e2e8f0;
}

.demo-tooltip table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.74rem;
  margin-top: 4px;
}

.demo-tooltip td {
  padding: 1px 0;
}

.demo-tooltip td:last-child {
  text-align: right;
  padding-left: 10px;
  font-weight: 600;
}

.demo-tooltip.hidden {
  display: none;
}

.demo-summary {
  margin-top: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.demo-summary h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.demo-summary p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.demo-summary table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}

.demo-summary th,
.demo-summary td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.demo-summary th:first-child,
.demo-summary td:first-child {
  text-align: left;
  font-weight: 600;
}

.demo-summary thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 2px solid var(--line);
}

.demo-summary tbody tr:last-child td {
  border-bottom: none;
}

.demo-summary .demo-school-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* ============== Enrollment widgets (Schools tab) ============== */

.enrollment-summary-card {
  margin: 4px 0 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.enrollment-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.enrollment-summary-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.enrollment-summary-head p {
  margin: 0;
  font-size: 0.85rem;
}

.enrollment-pill {
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--accent);
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.enrollment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 6px;
}

.enrollment-table th,
.enrollment-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.enrollment-table th:first-child,
.enrollment-table td:first-child,
.enrollment-table th:nth-child(2),
.enrollment-table td:nth-child(2) {
  text-align: left;
}

.enrollment-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.enrollment-table .totals-row td {
  border-top: 2px solid var(--line);
  border-bottom: none;
  background: var(--panel-soft);
  font-weight: 700;
}

.enrollment-table .legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.enrollment-table .delta-up {
  color: var(--green);
  font-weight: 700;
}

.enrollment-table .delta-down {
  color: #b91c1c;
  font-weight: 700;
}

.enrollment-footnote {
  margin: 12px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Enrollment card inside school detail panel */

.enrollment-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0 4px;
}

.enrollment-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.enrollment-card header h4 {
  margin: 0;
  font-size: 0.95rem;
}

.enrollment-grades-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px 0;
  margin-bottom: 10px;
}

.enrollment-grades-table td {
  text-align: center;
  padding: 8px 4px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  width: calc(100% / 6);
}

.enrollment-grade-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.enrollment-grade-num {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}

.enrollment-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.enrollment-row:last-child {
  border-bottom: none;
}

.enrollment-row strong {
  color: var(--ink-2);
}

.enrollment-row-highlight {
  background: var(--accent-soft);
  border-radius: 8px;
  margin: 4px 0;
  padding: 8px 10px;
  border-bottom: none;
}

.enrollment-row-highlight strong,
.enrollment-row-highlight span {
  color: var(--accent-strong);
  font-weight: 700;
}

.enrollment-row-second {
  background: var(--panel-soft);
  border-radius: 8px;
  margin: 0 0 4px;
  padding: 8px 10px;
  border-bottom: none;
  font-size: 0.82rem;
}

.enrollment-row-second strong {
  font-weight: 600;
  color: var(--ink-2);
}

.enrollment-row-na > span {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.enrollment-row-na > span > .muted {
  text-align: right;
  max-width: 62%;
  font-size: 0.78rem;
  line-height: 1.4;
  font-weight: 400;
}

.enrollment-row-highlight.enrollment-row-na {
  /* Soften the highlight band when the value is just a dash. */
  background: rgba(254, 243, 199, 0.35);
}

/* Inline pill explaining provenance of the projected K – 5 number. The
   projection is OURS, not the BOE's; the pill makes that visible without
   stealing focus from the headline number. Hovering reveals full context. */
.proj-source-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
  cursor: help;
  border: 1px solid rgba(37, 99, 235, 0.18);
}

/* "How we estimated" tray on the Schools tab — surfaces the backtest
   leaderboard, the winning method, accuracy figures, and verification
   checks so a reader can audit our methodology without leaving the page. */
.methodology-tray {
  margin-top: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.methodology-tray > summary {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--ink-2);
}

.methodology-tray h4 {
  margin: 16px 0 6px;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.methodology-leaderboard td.method-winner {
  background: rgba(34, 197, 94, 0.08);
  font-weight: 700;
}

.methodology-leaderboard code {
  font-size: 0.75rem;
  color: var(--muted);
}

.verify-pass {
  color: var(--accent-strong);
}

.verify-fail {
  color: #b91c1c;
  font-weight: 700;
}

.enrollment-grades-table-middle td {
  /* Three-cell middle-school grade row (6 / 7 / 8) gets a wider cell
     than the six-cell elementary row to keep the visual rhythm. */
  width: 33.33%;
}

/* Triangulation badge in the summary card */

.triangulation-badge {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--green-soft);
  border: 1px solid #10b981;
}

.triangulation-badge.warn {
  background: var(--amber-soft);
  border-color: #f59e0b;
}

.triangulation-badge.bad {
  background: #fee2e2;
  border-color: #b91c1c;
}

.triangulation-headline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: #064e3b;
}

.triangulation-badge.warn .triangulation-headline {
  color: #78350f;
}

.triangulation-badge.bad .triangulation-headline {
  color: #7f1d1d;
}

.triangulation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10b981;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
}

.triangulation-badge.warn .triangulation-icon {
  background: #f59e0b;
}

.triangulation-badge.bad .triangulation-icon {
  background: #b91c1c;
}

.triangulation-bullets {
  margin: 4px 0 0;
  padding-left: 28px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.triangulation-bullets li {
  margin: 0 0 4px;
}

.triangulation-bullets li:last-child {
  margin-bottom: 0;
}

/* District-wide enrollment trend banner (Schools tab) */

.district-trend-card {
  margin: 4px 0 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.district-trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.district-trend-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--accent-strong);
}

.district-trend-head p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-2);
}

.district-trend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.district-trend-cell {
  flex: 1 1 80px;
  min-width: 80px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  text-align: center;
}

.district-trend-label {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.district-trend-num {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

@media (max-width: 760px) {
  .district-trend-head {
    flex-direction: column;
  }
}

/* ---- Year-by-year transition card ---- */

.transition-card {
  margin: 0 0 24px;
  background: var(--amber-soft);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-lg);
  padding: 18px 22px 22px;
}

.transition-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.transition-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: var(--amber);
}

.transition-head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-2);
  max-width: 70ch;
}

.transition-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 760px) {
  .transition-tiles {
    grid-template-columns: 1fr;
  }
  .transition-head {
    flex-direction: column;
  }
}

.transition-tile {
  background: white;
  border: 1px solid #fcd34d;
  border-left: 6px solid var(--amber);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.transition-tile-pk {
  border-left-color: #2563eb;
}
.transition-tile-pk .transition-tile-num {
  color: #2563eb;
}

.transition-tile-g5 {
  border-left-color: var(--green);
}
.transition-tile-g5 .transition-tile-num {
  color: var(--green);
}

.transition-tile-redist {
  border-left-color: #b91c1c;
}
.transition-tile-redist .transition-tile-num {
  color: #b91c1c;
}

.transition-tile-num {
  font-size: 1.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.transition-tile-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.transition-tile-detail {
  font-size: 0.8rem;
  color: var(--ink-2);
  line-height: 1.45;
}

.transition-tray {
  background: white;
  border-color: #fcd34d;
}

.transition-tray > summary {
  color: var(--amber);
  font-weight: 700;
}

.transition-table-wrap {
  margin: 12px 0 16px;
}

.t-table-title {
  margin: 14px 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.t-table-year {
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--ink-1);
  font-weight: 800;
}

.t-table-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  white-space: nowrap;
}

.t-table-tag-actual {
  background: #ecfdf5;
  color: var(--green);
}

.t-table-tag-estimated {
  background: #fef3c7;
  color: var(--amber);
}

.t-table-tag-projected {
  background: #dbeafe;
  color: #1d4ed8;
}

.t-table-tag-pending {
  background: #f1f5f9;
  color: #64748b;
}

.t-table-source {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  flex: 1 1 100%;
}

.transition-table-estimate .t-grade-num {
  color: var(--ink-1);
}

.transition-table-this-year .t-row-total,
.transition-table-next .t-row-total {
  background: linear-gradient(0deg, rgba(254, 243, 199, 0.4), rgba(254, 243, 199, 0.4)),
    var(--panel-soft);
}

.transition-table-next .t-row-total {
  background: linear-gradient(0deg, rgba(219, 234, 254, 0.5), rgba(219, 234, 254, 0.5)),
    var(--panel-soft);
}

.t-grade-num-projected {
  color: #1d4ed8 !important;
}

.t-grade-num-pk {
  color: var(--amber) !important;
  background: #fef3c7;
}

.transition-2526-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--panel-soft);
}

.transition-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  table-layout: fixed;
}

.transition-table th,
.transition-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
}

.transition-table th:nth-child(1),
.transition-table td:nth-child(1) {
  width: 26%;
}
.transition-table th:nth-child(2),
.transition-table td:nth-child(2) {
  width: 9%;
}
.transition-table th:nth-child(3),
.transition-table td:nth-child(3),
.transition-table th:nth-child(4),
.transition-table td:nth-child(4),
.transition-table th:nth-child(5),
.transition-table td:nth-child(5),
.transition-table th:nth-child(6),
.transition-table td:nth-child(6),
.transition-table th:nth-child(7),
.transition-table td:nth-child(7),
.transition-table th:nth-child(8),
.transition-table td:nth-child(8) {
  width: 8%;
}
.transition-table th:nth-child(9),
.transition-table td:nth-child(9) {
  width: 17%;
}

.transition-table th {
  background: var(--panel-soft);
  font-weight: 700;
  color: var(--ink-2);
  font-size: 0.8rem;
}

.transition-table th:first-child,
.transition-table td.t-row-school {
  text-align: left;
  white-space: nowrap;
}

.transition-table .t-grade-empty {
  color: #cbd5e1;
}

.transition-table .t-grade-num {
  font-weight: 600;
  color: var(--ink);
}

.transition-table .t-row-total {
  font-weight: 700;
  background: var(--panel-soft);
}

.transition-table .legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.transition-table-next .t-slot {
  font-weight: 600;
  border-radius: 6px;
}

.transition-table-next .t-slot-on {
  background: #ecfdf5;
  color: var(--green);
}

.transition-table-next .t-slot-off {
  background: #f1f5f9;
  color: #94a3b8;
}

.transition-table-next .t-slot-new {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}

.transition-table-next .t-slot-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 6px;
  background: #fef3c7;
  color: var(--amber);
}

.transition-table-next .t-slot-num-val {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-1);
}

.t-row-total-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  background: #fef3c7;
  color: var(--amber);
  vertical-align: middle;
}

.transition-2526 {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed #fcd34d;
}

.transition-2526 h4 {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: var(--amber);
}

.transition-2526 p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--ink-2);
  line-height: 1.5;
  max-width: 70ch;
}

/* ---- Pre-K row in per-school enrollment card ---- */

.enrollment-row-pk .pk-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.enrollment-row-pk .pk-tag-strong {
  background: #fef3c7;
  color: var(--amber);
}

.enrollment-row-pk .pk-tag-projected {
  background: #ecfdf5;
  color: var(--green);
}

.enrollment-row-pk-projected strong {
  color: var(--green);
}

.enrollment-row-pk-projected span:first-of-type {
  font-variant-numeric: tabular-nums;
}

.enrollment-row .delta-up {
  color: var(--green);
  font-weight: 700;
}

.enrollment-row .delta-down {
  color: #b91c1c;
  font-weight: 700;
}

.enrollment-trend {
  margin-top: 8px;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .enrollment-summary-head {
    flex-direction: column;
  }
  .enrollment-grades-table {
    border-spacing: 4px 0;
  }
  .enrollment-grades-table td {
    padding: 6px 2px;
  }
  .enrollment-grade-num {
    font-size: 0.95rem;
  }
}

/* Budget & funding tab */

.budget-shell {
  max-width: 960px;
}

.budget-triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 800px) {
  .budget-triple {
    grid-template-columns: 1fr;
  }
}

.budget-triple-item {
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}

.budget-triple-item h4 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
}

.budget-triple-item p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.budget-card {
  margin-bottom: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.budget-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--ink);
}

.budget-card-boe h4 {
  margin: 0 0 2px;
  font-size: 0.95rem;
}

.budget-ufb-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.budget-ufb-block:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.budget-year-pill {
  display: inline-block;
  margin-left: 4px;
  font-weight: 600;
  color: var(--accent-strong);
}

p.small {
  font-size: 0.78rem;
  margin: 0 0 6px;
}

.budget-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.budget-mini-table th,
.budget-mini-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.budget-mini-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.budget-num {
  font-weight: 600;
  text-align: right;
}

.budget-boe-row {
  margin-top: 0;
}

.budget-doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 8px;
}

.budget-doc-table th,
.budget-doc-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.budget-doc-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.budget-doc-table a {
  font-weight: 600;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.budget-src {
  font-size: 0.78rem;
  color: var(--ink-2);
  max-width: 240px;
}

.budget-indep-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.budget-indep-list a {
  font-weight: 600;
  color: var(--accent-strong);
}

.budget-page-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.78rem;
  line-height: 1.65;
  word-break: break-all;
}

.budget-page-list .mono {
  font-size: 0.72rem;
  color: var(--muted);
}

.budget-card-meta a {
  font-weight: 600;
  color: var(--accent-strong);
}

/* ---------------------------------------------------------------------- */
/* Dual-audience UX: TL;DR card, detail tray, glossary tooltip            */
/* ---------------------------------------------------------------------- */

.tldr-card {
  margin: 0 0 18px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #fff 70%);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tldr-card .tldr-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent-strong);
}

.tldr-headline {
  margin: 0;
  font-family: "Instrument Serif", "Inter", serif;
  font-weight: 500;
  font-size: clamp(1.15rem, 1.05rem + 0.55vw, 1.5rem);
  line-height: 1.32;
  color: var(--ink);
}

.tldr-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tldr-stat {
  flex: 1 1 160px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tldr-stat-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.tldr-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.what-this-means {
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.what-this-means strong {
  color: var(--accent-strong);
}

.detail-tray {
  margin: 16px 0 0;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
}

.detail-tray > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--accent-strong);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.detail-tray > summary::-webkit-details-marker {
  display: none;
}

.detail-tray > summary::before {
  content: "›";
  display: inline-block;
  transition: transform 0.18s ease;
  font-size: 1rem;
  color: var(--muted);
}

.detail-tray[open] > summary::before {
  transform: rotate(90deg);
}

.detail-tray > summary:hover {
  color: var(--accent);
}

.detail-tray-body {
  padding: 4px 16px 16px;
  border-top: 1px solid var(--line);
}

.detail-tray-body > *:first-child {
  margin-top: 8px;
}

.glossary-term {
  border-bottom: 1px dotted var(--muted);
  cursor: help;
}

.glossary-term:hover {
  border-bottom-color: var(--accent);
}

/* ---------------------------------------------------------------------- */
/* Budget tab — FY27 narrative + UFB history                              */
/* ---------------------------------------------------------------------- */

.fy27-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 8px 0 18px;
}

.fy27-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fy27-card .fy27-num {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.fy27-card .fy27-num.fy27-down {
  color: #b91c1c;
}

.fy27-card .fy27-num.fy27-up {
  color: var(--amber);
}

.fy27-card .fy27-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
}

.fy27-card .fy27-note {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.action-items {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.action-items li {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.4;
}

.ufb-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}

.ufb-history-table th,
.ufb-history-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.ufb-history-table th:first-child,
.ufb-history-table td:first-child {
  text-align: left;
}

.ufb-history-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--panel-soft);
  position: sticky;
  top: 0;
}

.ufb-history-table tbody th {
  font-weight: 600;
  color: var(--ink);
}

.ufb-history-table .ufb-empty {
  color: var(--muted);
  font-weight: 400;
}

.ufb-history-wrap {
  overflow-x: auto;
}

@media (max-width: 760px) {
  .tldr-stats {
    gap: 8px;
  }
  .tldr-stat {
    flex: 1 1 calc(50% - 4px);
  }
  .fy27-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------------------------------------------------------------------- */
/* Triple-verify badge + sources tray                                     */
/* ---------------------------------------------------------------------- */

.verification-block {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.verify-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.verify-pill::before {
  content: "✓";
  font-size: 0.75rem;
  font-weight: 700;
}

.verify-pill.verify-pass {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.verify-pill.verify-partial {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.verify-pill.verify-partial::before {
  content: "✓·";
}

.verify-pill.verify-fail {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.verify-pill.verify-fail::before {
  content: "✗";
}

.verify-tray {
  margin: 0;
}

.verify-tray > summary {
  padding: 8px 12px;
  font-size: 0.8rem;
}

.verify-source-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.verify-source {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.verify-source-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.verify-source-value {
  color: var(--ink);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.verify-source-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.verify-source-note {
  font-size: 0.78rem;
  color: var(--ink-2);
  line-height: 1.4;
}

.verify-source-link {
  font-size: 0.75rem;
}

.verify-source-value-ok {
  color: #047857 !important;
  font-size: 1.1rem !important;
}

.verification-block-cohort {
  margin: 14px 0 4px;
}

.verify-subtray {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.verify-subtray > summary {
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 0;
}

.verify-cohort-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.verify-cohort-check {
  display: grid;
  grid-template-columns: 22px max-content 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 5px 8px;
  font-size: 0.78rem;
  background: var(--panel-soft, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.verify-cohort-check.ok .verify-cohort-icon {
  color: #047857;
}

.verify-cohort-check.fail {
  background: #fef2f2;
  border-color: #fecaca;
}

.verify-cohort-check.fail .verify-cohort-icon {
  color: #b91c1c;
}

.verify-cohort-icon {
  font-weight: 700;
  text-align: center;
}

.verify-cohort-label {
  color: var(--ink-1);
  font-weight: 600;
}

.verify-cohort-detail {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
}

.verify-summary-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.verify-summary-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.85rem;
}

.verify-summary-icon {
  text-align: center;
  font-size: 1rem;
}

.verify-summary-label {
  color: var(--ink);
  font-weight: 500;
}

.verify-summary-paths {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Boundary anomalies tab ---------- */
.anomalies-root {
  display: grid;
  gap: 22px;
}

.anomaly-intro {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 70ch;
}

.anomaly-section-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.anomaly-summary,
.anomaly-evidence,
.anomaly-schools {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.anomaly-summary-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.anomaly-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.anomaly-summary-table th,
.anomaly-summary-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.anomaly-summary-table th[scope="col"] {
  background: var(--bg);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.anomaly-summary-table th[scope="row"] {
  font-weight: 700;
  color: var(--ink-1);
}

.anomaly-summary-table .num,
.anomaly-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.anomaly-neighbor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.anomaly-neighbor-pill {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.anomaly-arrow {
  color: var(--muted);
  font-weight: 400;
  margin: 0 4px;
}

.anomaly-evidence-links {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.anomaly-evidence-links a {
  color: var(--brand);
  text-decoration: underline;
  font-weight: 600;
}

.anomaly-school-card {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.anomaly-school-card:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.anomaly-school-head {
  margin-bottom: 14px;
}

.anomaly-school-title {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.anomaly-school-sub {
  margin: 0 0 10px;
  color: var(--ink-2);
  line-height: 1.4;
  font-size: 0.92rem;
}

.anomaly-school-stats {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.anomaly-school-stats li {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 8px);
  padding: 8px 10px;
}

.anomaly-stat-num {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.anomaly-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.anomaly-school-streets {
  display: grid;
  gap: 10px;
}

.anomaly-street {
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 8px);
  background: var(--bg);
}

.anomaly-street > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-1);
}

.anomaly-street > summary::-webkit-details-marker {
  display: none;
}

.anomaly-street-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-variant-numeric: tabular-nums;
}

.anomaly-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: white;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
}

.anomaly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.anomaly-table th,
.anomaly-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.anomaly-table thead th {
  background: var(--bg);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
}

.anomaly-table tr:last-child td {
  border-bottom: 0;
}

.anomaly-house {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.anomaly-pin code {
  font-size: 0.78rem;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}

.anomaly-distance {
  color: var(--ink-2);
  white-space: nowrap;
}

.anomaly-prior-changed {
  color: var(--brand);
  font-weight: 600;
}

.anomaly-prior-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--brand);
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.anomaly-cluster {
  white-space: nowrap;
}

.anomaly-cluster-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink-2);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.anomaly-cluster-tag.anomaly-cluster-single {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
}

.anomaly-records {
  font-size: 0.82rem;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  color: var(--ink-2);
}

.anomaly-record-link {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.anomaly-record-link:hover,
.anomaly-record-link:focus {
  text-decoration: underline;
}

.anomaly-action {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 719px) {
  .anomaly-school-stats {
    grid-template-columns: 1fr;
  }

  .anomaly-table th,
  .anomaly-table td {
    padding: 8px;
    font-size: 0.84rem;
  }

  .anomaly-pin code {
    font-size: 0.72rem;
  }
}
