/* =============================================
   Humble ISD Budget Transparency
   Apple-inspired design: black · blue · gray · white
   ============================================= */

:root {
  --black:       #000000;
  --near-black:  #1D1D1F;
  --dark-2:      #2C2C2E;
  --dark-3:      #3A3A3C;
  --mid:         #48484A;
  --gray:        #636366;
  --light:       #8E8E93;
  --divider:     #D2D2D7;
  --bg:          #F5F5F7;
  --white:       #FFFFFF;

  --blue:        #0071E3;
  --blue-hover:  #0077ED;
  --blue-dark:   #0058B0;
  --blue-light:  #2997FF;
  --blue-pale:   #E8F2FD;

  --green:       #34C759;
  --orange:      #FF9F0A;
  --red:         #FF3B30;
  --yellow:      #FFD60A;

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'SFMono-Regular', ui-monospace, Menlo, monospace;

  --radius:    12px;
  --radius-lg: 18px;
  --radius-pill: 980px;
  --max: 1120px;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--near-black);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* ── Nav ──────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.84);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(255,255,255,0.12);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark {
  width: 30px;
  height: 30px;
  background: var(--blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-text strong {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.logo-text span {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.02em;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.site-nav a {
  color: rgba(255,255,255,0.72);
  font-size: 14px;
  font-weight: 400;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s;
  white-space: nowrap;
}
.site-nav a:hover { color: #fff; text-decoration: none; }
.site-nav a.active { color: #fff; font-weight: 500; }
.nav-divider { width: 1px; height: 16px; background: rgba(255,255,255,0.15); margin: 0 4px; }

/* ── Hero ─────────────────────────────────── */
.hero {
  background: var(--black);
  color: #fff;
  padding: 80px 24px 88px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue-light);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.07;
  margin-bottom: 20px;
}
.hero h1 em { font-style: normal; color: var(--blue-light); }
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.68);
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.65;
  font-weight: 300;
}
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.18s var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn-blue {
  background: var(--blue);
  color: #fff;
}
.btn-blue:hover {
  background: var(--blue-hover);
  color: #fff;
  text-decoration: none;
  transform: scale(1.02);
}
.btn-outline-white {
  background: transparent;
  color: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(255,255,255,0.35);
}
.btn-outline-white:hover {
  border-color: rgba(255,255,255,0.7);
  color: #fff;
  text-decoration: none;
}
.btn-ghost {
  background: rgba(0,0,0,0.06);
  color: var(--near-black);
}
.btn-ghost:hover { background: rgba(0,0,0,0.1); text-decoration: none; }

/* ── Year-page header ─────────────────────── */
.page-hero {
  background: var(--near-black);
  color: #fff;
  padding: 40px 24px 44px;
}
.page-hero-inner { max-width: var(--max); margin: 0 auto; }
.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.page-hero p {
  color: rgba(255,255,255,0.65);
  font-size: 15px;
  max-width: 640px;
  line-height: 1.6;
}
.year-tabs {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.year-tab {
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid rgba(255,255,255,0.28);
  background: transparent;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  text-decoration: none;
}
.year-tab:hover { border-color: rgba(255,255,255,0.6); color: #fff; text-decoration: none; }
.year-tab.active { background: #fff; border-color: #fff; color: var(--near-black); font-weight: 600; }

/* ── Layout ───────────────────────────────── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 64px 24px; }
.section-sm { padding: 40px 24px; }
.section-header { text-align: center; margin-bottom: 44px; }
.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--near-black);
  margin-bottom: 10px;
}
.section-header p { color: var(--gray); max-width: 500px; margin: 0 auto; font-size: 16px; }

/* ── Stats grid ───────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid rgba(0,0,0,0.07);
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--light);
  margin-bottom: 8px;
}
.stat-value {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--near-black);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-value.blue { color: var(--blue); }
.stat-value.green { color: #1FAB5E; }
.stat-value.orange { color: #E85C00; }
.stat-value.red { color: var(--red); }
.stat-sub {
  font-size: 13px;
  color: var(--light);
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Community note ───────────────────────── */
.community-note {
  background: var(--near-black);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 28px auto;
  max-width: var(--max);
}
.community-note-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.community-note-body { flex: 1; }
.community-note-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.community-note-text {
  font-size: 14px;
  color: rgba(255,255,255,0.72);
  line-height: 1.65;
}
.community-note-text strong { color: rgba(255,255,255,0.9); }

/* ── View toggle ──────────────────────────── */
.budget-controls {
  max-width: var(--max);
  margin: 32px auto 0;
  padding: 0 24px;
}
.view-toggle {
  display: inline-flex;
  background: rgba(0,0,0,0.07);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.view-toggle-btn {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}
.view-toggle-btn.active {
  background: var(--white);
  color: var(--near-black);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.06);
}
.view-toggle-btn:hover:not(.active) { color: var(--near-black); }
.view-toggle-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.toggle-note {
  font-size: 13px;
  color: var(--light);
  margin-top: 8px;
}

/* ── Chart section ────────────────────────── */
.chart-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: var(--max);
  margin: 28px auto;
  padding: 0 24px;
  align-items: start;
}
.chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid rgba(0,0,0,0.07);
  text-align: center;
}
.chart-card-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--light);
  margin-bottom: 24px;
}
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}
.chart-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.chart-center-value {
  display: block;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--near-black);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.chart-center-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--light);
  margin-top: 4px;
}
.chart-hint {
  font-size: 13px;
  color: var(--light);
  margin-top: 16px;
}

/* ── Legend ───────────────────────────────── */
.legend-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid rgba(0,0,0,0.07);
  max-height: 520px;
  overflow-y: auto;
}
.legend-card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--light);
  padding: 0 8px 12px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.legend-item:hover { background: var(--bg); }
.legend-item.selected { background: var(--blue-pale); }
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.legend-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--near-black); line-height: 1.3; }
.legend-amount { font-size: 12px; font-weight: 600; color: var(--near-black); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-pct { font-size: 12px; color: var(--light); text-align: right; min-width: 34px; font-variant-numeric: tabular-nums; }

/* ── Drilldown panel ──────────────────────── */
.drilldown-panel { max-width: var(--max); margin: 0 auto 32px; padding: 0 24px; display: none; }
.drilldown-panel.visible { display: block; }
.drilldown-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--blue);
  overflow: hidden;
}
.drilldown-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 26px;
  gap: 16px;
  border-bottom: 1px solid var(--divider);
}
.drilldown-swatch {
  width: 14px;
  height: 48px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}
.drilldown-title h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 5px;
}
.drilldown-title p { font-size: 14px; color: var(--gray); line-height: 1.5; max-width: 520px; }
.drilldown-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  cursor: pointer;
  font-size: 14px;
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.drilldown-close:hover { background: var(--near-black); color: #fff; }

.drilldown-comparisons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--divider);
}
.comp-block {
  padding: 18px 20px;
  text-align: center;
  border-right: 1px solid var(--divider);
}
.comp-block:last-child { border-right: none; }
.comp-block.highlight { background: var(--blue-pale); }
.comp-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--light);
  margin-bottom: 6px;
}
.comp-value {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--near-black);
  font-variant-numeric: tabular-nums;
}
.comp-block.highlight .comp-value { color: var(--blue-dark); }
.comp-sub { font-size: 12px; color: var(--light); margin-top: 3px; }
.comp-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  font-weight: 600;
}
.badge-over { background: #fee2e2; color: #b91c1c; }
.badge-under { background: #dcfce7; color: #15803d; }

.drilldown-items { padding: 20px 26px; }
.drilldown-items h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--light);
  margin-bottom: 12px;
}
.line-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg);
}
.line-item:last-child { border-bottom: none; }
.li-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
  margin-top: 7px;
}
.li-name { font-size: 14px; font-weight: 500; color: var(--near-black); flex: 1; }
.li-note { font-size: 12px; color: var(--light); margin-top: 2px; }
.drilldown-acfr-note {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--blue-pale);
  border-radius: 8px;
  font-size: 13px;
  color: var(--blue-dark);
  line-height: 1.5;
}

/* ── Data table ───────────────────────────── */
.table-section { max-width: var(--max); margin: 0 auto 40px; padding: 0 24px; }
.table-section-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--near-black);
  margin-bottom: 14px;
}
.table-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.07);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: var(--near-black);
  color: rgba(255,255,255,0.85);
  text-align: left;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
thead th:not(:first-child) { text-align: right; }
tbody tr {
  border-bottom: 1px solid var(--bg);
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:hover { background: var(--blue-pale); }
tbody tr.selected { background: var(--blue-pale); }
tbody td { padding: 12px 16px; vertical-align: middle; }
tbody td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.td-name { display: flex; align-items: center; gap: 9px; }
.td-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.td-code {
  font-size: 11px;
  color: var(--light);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
  font-family: var(--font-mono);
}
.td-na { color: var(--divider); font-weight: 400; }
.td-pending { color: var(--light); font-weight: 400; font-style: italic; }
.td-over { color: #b91c1c; }
.td-under { color: #15803d; }
tfoot td {
  padding: 13px 16px;
  font-weight: 700;
  border-top: 2px solid var(--near-black);
  background: var(--bg);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
tfoot td:not(:first-child) { text-align: right; }

/* ── Amendment timeline ───────────────────── */
.timeline-section { max-width: var(--max); margin: 0 auto 40px; padding: 0 24px; }
.timeline-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 14px; }
.timeline-grid {
  display: grid;
  gap: 10px;
}
.timeline-item {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,0.07);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.timeline-item.adopted { border-left: 3px solid var(--near-black); }
.timeline-item.increase { border-left: 3px solid var(--red); }
.timeline-item.neutral { border-left: 3px solid var(--divider); }
.timeline-item.pending {
  border-left: 3px solid var(--divider);
  opacity: 0.5;
  font-style: italic;
}
.tl-date { font-size: 13px; font-weight: 600; color: var(--near-black); min-width: 130px; }
.tl-label { flex: 1; font-size: 14px; color: var(--gray); }
.tl-change {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 90px;
  text-align: right;
}
.tl-change.zero { color: var(--light); }
.tl-change.up { color: var(--red); }
.tl-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--near-black);
  font-variant-numeric: tabular-nums;
  min-width: 120px;
  text-align: right;
}

/* ── Sources / data notes ─────────────────── */
.sources-card {
  max-width: var(--max);
  margin: 0 auto 60px;
  padding: 0 24px;
}
.sources-inner {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.07);
  padding: 24px 26px;
}
.sources-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--light);
  margin-bottom: 14px;
}
.source-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg);
  font-size: 14px;
}
.source-row:last-child { border-bottom: none; }
.source-tag {
  display: inline-flex;
  align-items: center;
  background: var(--near-black);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 4px;
  white-space: nowrap;
  height: fit-content;
  margin-top: 1px;
}
.source-tag.blue { background: var(--blue); }
.source-tag.green { background: #1FAB5E; }
.source-desc { color: var(--gray); line-height: 1.55; }
.source-desc strong { color: var(--near-black); }

/* ── How-it-works section ─────────────────── */
.how-section {
  background: var(--near-black);
  padding: 80px 24px;
  color: #fff;
}
.how-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.how-text h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin-bottom: 16px;
}
.how-text h2 em { font-style: normal; color: var(--blue-light); }
.how-text p { color: rgba(255,255,255,0.65); font-size: 16px; line-height: 1.7; margin-bottom: 12px; }
.how-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.how-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
}
.how-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.how-icon-blue { background: rgba(0,113,227,0.25); }

/* ── Year cards (index) ───────────────────── */
.year-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
}
.year-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid rgba(0,0,0,0.07);
  text-decoration: none;
  color: var(--near-black);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s var(--ease);
}
.year-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 24px rgba(0,113,227,0.12);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--near-black);
}
.year-card.placeholder { opacity: 0.55; border-style: dashed; }
.year-card.placeholder:hover { transform: none; box-shadow: none; border-color: rgba(0,0,0,0.07); }
.yc-eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--light); }
.yc-year { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.05em; color: var(--near-black); line-height: 1; }
.yc-stat { font-size: 1.4rem; font-weight: 700; color: var(--blue); }
.yc-desc { font-size: 14px; color: var(--gray); line-height: 1.5; }
.yc-cta { font-size: 14px; font-weight: 600; color: var(--blue); display: flex; align-items: center; gap: 4px; margin-top: 4px; }

/* ── FAQ ──────────────────────────────────── */
.faq-wrap { max-width: 740px; margin: 64px auto; padding: 0 24px; }
.faq-wrap h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}
.faq-wrap > p { color: var(--gray); margin-bottom: 40px; font-size: 16px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--light);
  margin: 24px 0 8px;
}
.faq-item {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,0.07);
  overflow: hidden;
}
.faq-item.open { border-color: var(--blue); }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--near-black);
  gap: 16px;
  user-select: none;
  transition: background 0.12s;
}
.faq-q:hover { background: var(--bg); }
.faq-item.open .faq-q { color: var(--blue); }
.faq-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
  color: var(--light);
}
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--blue); }
.faq-a {
  display: none;
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--gray);
  line-height: 1.7;
}
.faq-item.open .faq-a { display: block; }
.faq-a p { margin-bottom: 10px; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-a strong { color: var(--near-black); }
.faq-submit {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  border: 1.5px dashed var(--divider);
  margin-top: 40px;
}
.faq-submit h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.faq-submit p { font-size: 14px; color: var(--gray); }

/* ── Footer ───────────────────────────────── */
.site-footer {
  background: var(--near-black);
  color: rgba(255,255,255,0.5);
  padding: 36px 24px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
}
.site-footer strong { color: rgba(255,255,255,0.85); }
.site-footer a { color: var(--blue-light); }

/* ── Misc utilities ───────────────────────── */
.disclaimer {
  background: var(--bg);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--gray);
  max-width: var(--max);
  margin: 20px auto 0;
  display: flex;
  gap: 10px;
  line-height: 1.5;
}
.disclaimer strong { color: var(--near-black); }

/* ── Scrollbar (legend) ───────────────────── */
.legend-card::-webkit-scrollbar { width: 4px; }
.legend-card::-webkit-scrollbar-track { background: transparent; }
.legend-card::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 2px; }

/* iOS smooth scroll on nav */
.site-nav { -webkit-overflow-scrolling: touch; }

/* Table scroll hint on mobile */
.table-wrap { position: relative; }

/* ── Responsive 768px ─────────────────────── */
@media (max-width: 768px) {
  .header-inner { padding: 0 16px; gap: 16px; }
  .logo-text { display: none; }
  .site-nav { gap: 0; overflow-x: auto; }
  .site-nav a { padding: 6px 10px; font-size: 13px; }
  .hero { padding: 56px 16px 64px; }
  .chart-section { grid-template-columns: 1fr; padding: 0 16px; }
  .how-inner { grid-template-columns: 1fr; gap: 36px; }
  .how-section { padding: 56px 20px; }
  .drilldown-comparisons { grid-template-columns: 1fr; }
  .comp-block { border-right: none; border-bottom: 1px solid var(--divider); }
  .comp-block:last-child { border-bottom: none; }
  .budget-controls { padding: 0 16px; }
  .drilldown-panel { padding: 0 16px; }
  .table-section { padding: 0 16px; }
  .sources-card { padding: 0 16px; }
  .timeline-section { padding: 0 16px; }
  .timeline-item { flex-wrap: wrap; gap: 8px; }
  .tl-date { min-width: unset; width: 100%; }
  /* Show scroll hint on wide tables */
  .table-wrap::after {
    content: "← scroll →";
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--light);
    padding: 8px 0 4px;
    letter-spacing: 0.05em;
  }
}

/* ── Responsive 640px ─────────────────────── */
@media (max-width: 640px) {
  /* View toggle: stack vertically so all 3 buttons are always reachable */
  .view-toggle {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-radius: var(--radius);
  }
  .view-toggle-btn {
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    white-space: normal;
  }

  /* Community note: stack icon on top */
  .community-note { flex-direction: column; gap: 10px; }
  .community-note-icon { font-size: 22px; }

  /* Section padding */
  .section { padding: 44px 16px; }
  .section-sm { padding: 28px 16px; }
  .faq-wrap { padding: 0 16px; margin: 44px auto; }

  /* Budget table: hide least-important columns */
  #budget-table th:nth-child(5),
  #budget-table td:nth-child(5),
  #budget-table tfoot td:nth-child(5),
  #budget-table th:nth-child(6),
  #budget-table td:nth-child(6),
  #budget-table tfoot td:nth-child(6) { display: none; }

  /* Debt table: hide Population column */
  #debt-table th:nth-child(5),
  #debt-table td:nth-child(5) { display: none; }

  /* Debt charts: shorter on portrait mobile */
  .debt-chart-tall { height: 220px !important; }
  .debt-chart-short { height: 180px !important; }

  /* Page hero padding */
  .page-hero { padding: 28px 16px 32px; }

  /* Drilldown items padding */
  .drilldown-items { padding: 16px 18px; }
  .line-item { gap: 10px; }
}

/* ── Responsive 480px ─────────────────────── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .year-cards { grid-template-columns: 1fr; }
  .drilldown-header { flex-direction: column; }
  .tl-total { display: none; }

  /* Receipt header: smaller text so rate rows don't overflow */
  .rhb-row { font-size: 11px; gap: 8px; }
  .rhb-row.total { font-size: 13px; }
  .rhb-title { font-size: 13px; }

  /* Receipt lines: tighter on very small screens */
  .rl-name { font-size: 13.5px; }
  .rl-sub { font-size: 11px; }
  .rl-pct { font-size: 15px; }

  /* How section */
  .how-section { padding: 44px 16px; }

  /* Stat value slightly smaller to prevent clipping */
  .stat-value { font-size: 1.4rem; }
}

/* ═══════════════════════════════════════════════════════════
   GAME — Notice Screen
   ══════════════════════════════════════════════════════════ */

.game-container {
  background: var(--black);
}

.game-notice {
  min-height: calc(100vh - 52px);
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 80px;
}

.game-notice-inner {
  max-width: 540px;
  width: 100%;
  text-align: center;
  color: #fff;
}

.notice-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 28px;
}

.notice-headline {
  font-size: clamp(2.4rem, 7vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #fff;
  margin-bottom: 20px;
}

.notice-headline em {
  font-style: italic;
  color: var(--blue-light);
}

.notice-sub {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Form ───────────────────────────── */
.notice-form {
  background: #111;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px;
  text-align: left;
  margin-bottom: 20px;
}

.notice-form-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 10px;
}

.notice-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 0 14px;
  gap: 6px;
  transition: border-color 0.2s;
  margin-bottom: 12px;
}

.notice-input-wrap:focus-within {
  border-color: var(--blue-light);
  background: rgba(41,151,255,0.06);
}

.notice-input-wrap.input-error {
  border-color: var(--red);
  animation: shake 0.45s var(--ease);
}

.ni-prefix {
  font-size: 1.2rem;
  font-weight: 300;
  color: rgba(255,255,255,0.4);
  user-select: none;
  pointer-events: none;
}

.ni-input {
  background: none;
  border: none;
  outline: none;
  width: 100%;
  padding: 14px 0;
  font-size: 1.3rem;
  font-weight: 400;
  color: #fff;
  font-variant-numeric: tabular-nums;
  font-family: var(--font);
  caret-color: var(--blue-light);
}

.ni-input::placeholder { color: rgba(255,255,255,0.2); }

.notice-checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  margin-bottom: 18px;
  user-select: none;
}

.notice-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-light);
  cursor: pointer;
  flex-shrink: 0;
}

.notice-pay-btn {
  width: 100%;
  padding: 15px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  animation: pay-pulse 3s ease-in-out infinite;
  transition: background 0.2s, transform 0.1s;
  font-family: var(--font);
}

.notice-pay-btn:hover {
  background: var(--blue-hover);
  animation: none;
  transform: translateY(-1px);
}

.notice-pay-btn:disabled {
  opacity: 0.55;
  animation: none;
  cursor: default;
  transform: none;
}

@keyframes pay-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(41,151,255,0); }
  50% { box-shadow: 0 0 0 8px rgba(41,151,255,0.22); }
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ── Divider + secondary ────────────── */
.notice-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.2);
  font-size: 13px;
  margin: 4px 0 16px;
}

.notice-divider::before,
.notice-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.notice-general-btn {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  color: rgba(255,255,255,0.7);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-family: var(--font);
  margin-bottom: 20px;
}

.notice-general-btn:hover {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
  background: rgba(255,255,255,0.04);
}

.notice-skip {
  margin-top: 4px;
}

.notice-skip a {
  font-size: 12px;
  color: rgba(255,255,255,0.22);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.04em;
}

.notice-skip a:hover { color: rgba(255,255,255,0.5); }


/* ═══════════════════════════════════════════════════════════
   GAME — Receipt Screen
   ══════════════════════════════════════════════════════════ */

.game-receipt {
  background: var(--black);
  min-height: calc(100vh - 52px);
  padding: 48px 24px 80px;
}

.receipt-outer {
  max-width: 600px;
  margin: 0 auto;
}

.receipt-card {
  background: #111;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 28px;
}

/* ── Receipt header (monospace, dark) ── */
.receipt-header-block {
  background: #000;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 24px 28px 20px;
  text-align: center;
  font-family: var(--font-mono);
}

.rhb-district {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 6px;
}

.rhb-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 4px;
}

.rhb-fy {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 18px;
}

.rhb-rows {
  text-align: left;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rhb-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  font-variant-numeric: tabular-nums;
  gap: 16px;
}

.rhb-row.total {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 10px;
  margin-top: 4px;
}

/* ── Breakdown header label ─────────── */
.receipt-breakdown-header {
  padding: 14px 28px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  font-family: var(--font-mono);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ── Individual receipt lines ───────── */
.receipt-line {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  padding: 12px 28px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.receipt-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.rl-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.rl-name-block {
  flex: 1;
  min-width: 0;
}

.rl-name {
  font-size: 14.5px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
}

.rl-sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
  line-height: 1.4;
}

.rl-amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 1px;
}

.rl-pct {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  line-height: 1.2;
}

.rl-amt {
  font-size: 11.5px;
  color: rgba(255,255,255,0.4);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.rl-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin: 8px 0 6px 20px;
  overflow: hidden;
}

.rl-bar {
  height: 100%;
  border-radius: 2px;
  width: 0;
  transition: width 0.7s var(--ease);
}

.rl-callout {
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 7px 10px 7px 20px;
  margin-top: 6px;
  line-height: 1.5;
}

/* ── Receipt footer rows ────────────── */
.receipt-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border-top: 1.5px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.02);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.receipt-surplus-row {
  padding: 14px 28px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.rsr-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.rsr-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.rsr-note {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  line-height: 1.5;
}

/* ── CTAs below receipt ─────────────── */
.receipt-ctas {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.receipt-ctas .btn {
  display: block;
  text-align: center;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.15s;
}

.receipt-ctas .btn:hover {
  opacity: 0.86;
  transform: translateY(-1px);
  text-decoration: none;
}

.rf-more {
  background: none;
  border: none;
  color: rgba(255,255,255,0.28);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.2s;
  letter-spacing: 0.03em;
}

.rf-more:hover { color: rgba(255,255,255,0.6); }


/* ═══════════════════════════════════════════════════════════
   GAME — Responsive
   ══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .game-notice {
    padding: 48px 20px 60px;
    align-items: flex-start;
    padding-top: 56px;
  }

  .notice-headline { font-size: 2.2rem; }
  .notice-sub { font-size: 0.9375rem; }

  .notice-form { padding: 18px; border-radius: 12px; }

  .ni-input { font-size: 1.1rem; }

  .game-receipt { padding: 32px 16px 60px; }

  .receipt-header-block { padding: 20px 20px 16px; }
  .receipt-breakdown-header { padding: 12px 20px 8px; }

  .receipt-line { padding: 10px 20px 8px; }
  .rl-bar-track { margin-left: 0; }

  .rl-pct { font-size: 14px; }

  .receipt-total-row { padding: 12px 20px; }
  .receipt-surplus-row { padding: 12px 20px 14px; }

  .receipt-ctas .btn { padding: 13px 16px; }
}
