/* Build Philly Now — PA Generation Queue site
   Brand tokens per BPN_BrandGuidelines_Feb2025.
   Headline font: Brother 1816 (bold, generally uppercase per brand book).
   Body font: Hanken Grotesk (matches BPN OZ analysis site convention).
*/

@font-face {
  font-family: "Brother 1816";
  src: url("../fonts/Brother1816-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/HankenGrotesk-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/HankenGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bpn-green: #00844d;
  --bpn-green-dark: #00693d;
  --bpn-bg: #eae7e4;
  --bpn-card: #f5f3f1;
  --bpn-dark: #1a1a1a;
  --bpn-muted: #6b6661;
  --bpn-border: #d8d4cf;
  --bpn-red: #b23a2f;
  --bpn-gold: #c99b2e;

  /* Fuel category colors */
  --fuel-solar: #c99b2e;
  --fuel-solar-storage: #d97706;
  --fuel-wind: #0891b2;
  --fuel-storage: #7e6dab;
  --fuel-nuclear: #b23a2f;
  --fuel-natural-gas: #6b6661;
  --fuel-other: #a9a39a;

  /* Status accents */
  --status-suspended: #b23a2f;
  --status-eng: #c99b2e;
  --status-construction: #00844d;
  --status-partial: #00844d;

  --font-head: "Brother 1816", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html {
  scroll-padding-top: 80px;
}
html, body {
  margin: 0;
  background: var(--bpn-bg);
  color: var(--bpn-dark);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.95rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--bpn-green); text-decoration: none; }
a:hover { text-decoration: underline; }
small { color: var(--bpn-muted); font-size: 0.88rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(234, 231, 228, 0.92);
  border-bottom: 1px solid var(--bpn-border);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 14px 24px; gap: 24px;
}
.nav-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--bpn-dark); min-width: 0;
}
.nav-brand-logo {
  height: 38px; width: auto;
  flex-shrink: 0;
  display: block;
}
.nav-brand-sub {
  font-family: var(--font-head); font-size: 0.95rem;
  color: var(--bpn-muted); letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-links { display: flex; gap: 22px; flex-shrink: 0; }
.nav-links a {
  color: var(--bpn-dark); font-weight: 500; font-size: 0.95rem;
  padding: 4px 0; border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav-links a.active, .nav-links a:hover {
  border-bottom-color: var(--bpn-green); text-decoration: none;
}

@media (max-width: 720px) {
  .nav-inner { gap: 12px; padding: 12px 16px; }
  .nav-brand-logo { height: 32px; }
  .nav-brand-sub { display: none; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.85rem; }
}

/* Hero */
.hero { padding: 64px 0 40px; }
.hero .tag {
  display: inline-block; background: var(--bpn-green); color: white;
  font-family: var(--font-head); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 3px; margin-bottom: 16px;
}
.hero h1 { font-size: 3.1rem; max-width: 880px; }
.hero .lede { font-size: 1.18rem; max-width: 760px; color: var(--bpn-dark); }
.hero .lede strong { font-weight: 600; }

.pullquote {
  border-left: 4px solid var(--bpn-green);
  padding: 12px 20px; margin: 28px 0; background: var(--bpn-card);
  font-size: 1.05rem; font-style: italic; max-width: 760px;
}
.pullquote cite {
  display: block; font-size: 0.85rem; font-style: normal;
  color: var(--bpn-muted); margin-top: 8px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 4px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  text-decoration: none; border: none; cursor: pointer;
  transition: transform 80ms ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--bpn-green); color: white; }
.btn-primary:hover { background: var(--bpn-green-dark); }
.btn-secondary {
  background: transparent; color: var(--bpn-dark);
  border: 1px solid var(--bpn-border);
}
.btn-secondary:hover { border-color: var(--bpn-green); color: var(--bpn-green); }

/* Section */
section { padding: 56px 0; border-top: 1px solid var(--bpn-border); }
section h2 .kicker {
  display: block; font-family: var(--font-body);
  font-size: 0.82rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--bpn-green); margin-bottom: 6px;
}
section h2 { display: block; }

/* The case in brief */
.brief-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px; margin-top: 36px;
}
@media (max-width: 820px) { .brief-grid { grid-template-columns: 1fr; gap: 20px; } }
.brief-card {
  background: var(--bpn-card); padding: 28px;
  border: 1px solid var(--bpn-border); border-radius: 4px;
}
.brief-num {
  font-family: var(--font-head); font-weight: 900; font-size: 2.6rem;
  color: var(--bpn-green); line-height: 1; margin-bottom: 12px;
}
.brief-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.brief-card p { font-size: 0.97rem; color: var(--bpn-dark); margin-bottom: 0; }

/* Context callouts: pulled-out data points beneath the brief grid */
.brief-callout-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; margin-top: 24px;
}
@media (max-width: 820px) { .brief-callout-row { grid-template-columns: 1fr; } }
.brief-callout {
  background: var(--bpn-bg); border-left: 3px solid var(--bpn-gold);
  padding: 18px 22px; border-radius: 0 4px 4px 0;
}
.brief-callout .callout-num {
  font-family: var(--font-head); font-weight: 800; font-size: 1.5rem;
  color: var(--bpn-dark); line-height: 1.1; margin-bottom: 6px;
}
.brief-callout p {
  font-size: 0.92rem; color: var(--bpn-dark); margin: 0;
}
.brief-callout cite {
  display: block; margin-top: 8px;
  font-size: 0.78rem; color: var(--bpn-muted); font-style: normal;
}
.brief-callout cite a { color: var(--bpn-muted); }

.chart-caption {
  margin-top: 16px;
  font-size: 0.86rem;
  color: var(--bpn-muted);
  display: grid; gap: 4px;
}
.chart-caption .caption-row strong { color: var(--bpn-dark); font-weight: 600; }
.chart-caption .caption-src { font-style: italic; }

/* Stat row */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; margin: 32px 0; border: 1px solid var(--bpn-border);
  background: var(--bpn-card);
}
@media (max-width: 820px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat {
  padding: 20px 22px; border-right: 1px solid var(--bpn-border);
}
.stat:last-child { border-right: none; }
@media (max-width: 820px) {
  .stat { border-right: none; border-bottom: 1px solid var(--bpn-border); }
  .stat:nth-child(2n) { border-right: none; }
}
.stat-num {
  font-family: var(--font-head); font-weight: 900;
  font-size: 2.2rem; line-height: 1; color: var(--bpn-dark);
}
.stat-label {
  font-size: 0.82rem; color: var(--bpn-muted);
  margin-top: 8px; line-height: 1.35;
}

/* Map */
.map-wrap {
  display: grid; grid-template-columns: 1fr 320px; gap: 24px;
  margin-top: 28px;
}
@media (max-width: 960px) { .map-wrap { grid-template-columns: 1fr; } }
#map {
  position: relative;
  height: 580px; border: 1px solid var(--bpn-border); border-radius: 4px;
  background: #f0ede8;
  overflow: hidden;
}

/* Choropleth legend (in-map overlay, lower-left) */
.map-legend {
  position: absolute;
  left: 12px; bottom: 12px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--bpn-border);
  border-radius: 4px;
  padding: 9px 11px;
  font-size: 0.78rem;
  line-height: 1.45;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  max-width: 200px;
}
.map-legend .legend-title {
  font-family: var(--font-head);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--bpn-muted);
  margin-bottom: 4px;
}
.map-legend .legend-row {
  display: flex; align-items: center; gap: 7px;
  margin-top: 2px;
}
.map-legend .legend-swatch {
  display: inline-block;
  width: 16px; height: 11px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 2px;
  flex-shrink: 0;
}
.map-side {
  display: flex; flex-direction: column; gap: 18px;
}
.map-controls {
  background: var(--bpn-card); border: 1px solid var(--bpn-border);
  border-radius: 4px; padding: 20px;
}
.map-controls h4 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--bpn-muted); margin-bottom: 14px; font-family: var(--font-body);
  font-weight: 700;
}
.threshold-slider-wrap { margin-bottom: 18px; }
.threshold-display {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.threshold-label { font-size: 0.95rem; font-weight: 500; }
.threshold-value {
  font-family: var(--font-head); font-weight: 700; font-size: 1.4rem;
  color: var(--bpn-green);
}
input[type=range] {
  width: 100%; -webkit-appearance: none; appearance: none;
  background: transparent; height: 24px;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; background: var(--bpn-border); border-radius: 2px;
}
input[type=range]::-moz-range-track {
  height: 4px; background: var(--bpn-border); border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; background: var(--bpn-green);
  border-radius: 50%; margin-top: -7px; cursor: pointer;
  border: 2px solid white; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; background: var(--bpn-green);
  border-radius: 50%; cursor: pointer;
  border: 2px solid white; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.threshold-readout {
  font-size: 0.88rem; color: var(--bpn-muted); margin-top: 10px;
}
.threshold-readout strong { color: var(--bpn-dark); font-weight: 600; }

.filter-group { margin-bottom: 16px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.92rem; padding: 5px 0; cursor: pointer;
}
.filter-group input[type=checkbox] {
  accent-color: var(--bpn-green); width: 16px; height: 16px;
}

.legend {
  background: var(--bpn-card); border: 1px solid var(--bpn-border);
  border-radius: 4px; padding: 18px 20px;
}
.legend h4 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--bpn-muted); margin-bottom: 12px; font-family: var(--font-body);
  font-weight: 700;
}
.legend-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem; padding: 4px 0;
}
.legend-dot {
  width: 12px; height: 12px; border-radius: 50%;
  flex-shrink: 0; border: 2px solid white; box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}

/* Project detail card */
.proj-card {
  background: var(--bpn-card); border: 1px solid var(--bpn-border);
  border-radius: 4px; padding: 20px; min-height: 200px;
}
.proj-card .empty {
  color: var(--bpn-muted); font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center;
  height: 160px; text-align: center; font-style: italic;
}
.proj-card h3 {
  font-size: 1.2rem; margin-bottom: 4px;
}
.proj-card .proj-meta {
  font-size: 0.85rem; color: var(--bpn-muted); margin-bottom: 14px;
}
.proj-card .proj-stat {
  display: flex; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--bpn-border);
  font-size: 0.92rem;
}
.proj-card .proj-stat:last-child { border-bottom: none; }
.proj-card .proj-stat-label { color: var(--bpn-muted); }
.proj-card .proj-stat-value { font-weight: 600; }
.proj-card .senator-tag {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 6px 10px;
  background: var(--bpn-bg); border-radius: 3px;
  font-size: 0.82rem;
}
.party-pill {
  display: inline-block; width: 18px; height: 18px;
  border-radius: 50%; color: white; font-weight: 700; font-size: 0.7rem;
  text-align: center; line-height: 18px;
}
.party-R { background: #b23a2f; }
.party-D { background: #1e5f9c; }
.party-V { background: #888; }

.districts-block {
  margin-top: 14px;
  padding: 14px 14px 10px;
  background: var(--bpn-bg);
  border-radius: 4px;
  border: 1px solid var(--bpn-border);
}
.districts-label {
  font-family: var(--font-head);
  font-size: 0.78rem; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bpn-green); margin-bottom: 4px;
}
.districts-sub {
  font-size: 0.78rem; color: var(--bpn-muted);
  margin-bottom: 12px; line-height: 1.4;
}
.districts-section { margin-bottom: 10px; }
.districts-section:last-child { margin-bottom: 0; }
.districts-section-h {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--bpn-muted); margin-bottom: 6px;
}
.dist-list { list-style: none; padding: 0; margin: 0; }
.dist-item {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 4px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--bpn-border);
}
.dist-item:last-child { border-bottom: none; }
.dist-name { color: var(--bpn-dark); }
.dist-num { color: var(--bpn-muted); font-size: 0.78rem; font-family: var(--font-head); letter-spacing: 0.04em; }
.dist-pct {
  font-size: 0.74rem; color: var(--bpn-muted); font-weight: 600;
  background: white; padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--bpn-border);
  min-width: 38px; text-align: right;
}

/* District choropleth map */
.map-toolbar {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 24px; margin-bottom: 12px;
  align-items: center;
}
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--bpn-border);
  border-radius: 4px;
  background: white;
  overflow: hidden;
}
.toggle-btn {
  font-family: var(--font-body);
  font-size: 0.86rem; font-weight: 600;
  background: white; border: none; cursor: pointer;
  padding: 8px 14px;
  color: var(--bpn-dark);
  border-right: 1px solid var(--bpn-border);
  transition: background 100ms ease, color 100ms ease;
}
.toggle-btn:last-child { border-right: none; }
.toggle-btn:hover { background: var(--bpn-bg); }
.toggle-btn.active {
  background: var(--bpn-green); color: white;
}
.toggle-btn.active:hover { background: var(--bpn-green-dark); }

.districts-map-wrap {
  position: relative;
  background: var(--bpn-card);
  border: 1px solid var(--bpn-border);
  border-radius: 4px;
  overflow: hidden;
}
#chamber-map {
  width: 100%;
  height: 540px;
}

.district-detail {
  margin-top: 18px;
  padding: 18px 22px;
  background: var(--bpn-card);
  border: 1px solid var(--bpn-border);
  border-radius: 4px;
  min-height: 120px;
}
.district-detail-empty {
  color: var(--bpn-muted);
  font-style: italic;
  text-align: center;
  padding: 28px 0;
}
.dd-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 12px;
  border-bottom: 1px solid var(--bpn-border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.dd-title { font-size: 1.2rem; font-weight: 700; font-family: var(--font-head); margin: 0; }
.dd-meta { font-size: 0.85rem; color: var(--bpn-muted); margin-top: 4px; }
.dd-cosponsor-tag {
  display: inline-block; padding: 4px 10px; border-radius: 3px;
  font-family: var(--font-head); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700;
}
.dd-cosponsor-tag.sponsor    { background: var(--bpn-green); color: white; }
.dd-cosponsor-tag.cosponsor  { background: #d9e8df; color: var(--bpn-green-dark); border: 1px solid var(--bpn-green); }
.dd-cosponsor-tag.not-signed { background: var(--bpn-bg); color: var(--bpn-muted); border: 1px solid var(--bpn-border); }
.dd-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 14px;
}
@media (max-width: 600px) { .dd-stats { grid-template-columns: 1fr; } }
.dd-stat-num {
  font-family: var(--font-head); font-weight: 700;
  font-size: 1.6rem; line-height: 1.1;
  color: var(--bpn-green);
}
.dd-stat-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--bpn-muted); margin-top: 2px;
}
.dd-projects-list {
  margin: 0; padding: 0; list-style: none;
}
.dd-projects-list li {
  display: grid; grid-template-columns: 12px 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--bpn-border);
  font-size: 0.88rem;
}
.dd-projects-list li:last-child { border-bottom: none; }
.dd-fuel-dot { width: 10px; height: 10px; border-radius: 50%; }
.dd-proj-name { font-weight: 600; }
.dd-proj-county { color: var(--bpn-muted); font-size: 0.78rem; }
.dd-proj-mw { font-weight: 700; color: var(--bpn-dark); }
.districts-map-legend {
  position: absolute;
  left: 16px; bottom: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--bpn-border);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--bpn-dark);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  z-index: 5;
  max-width: 220px;
}
.districts-map-legend .legend-title {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--bpn-muted);
  margin-bottom: 6px;
}
.districts-map-legend .legend-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 3px;
}
.districts-map-legend .legend-swatch {
  display: inline-block;
  width: 18px; height: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Hover tooltip for districts */
.district-tooltip {
  position: absolute;
  pointer-events: none;
  background: white;
  border: 1px solid var(--bpn-border);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 10;
  max-width: 260px;
  display: none;
}
.district-tooltip.visible { display: block; }
.district-tooltip .tt-name {
  font-weight: 700;
  font-family: var(--font-head);
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.district-tooltip .tt-meta {
  font-size: 0.75rem;
  color: var(--bpn-muted);
  margin-bottom: 8px;
}
.district-tooltip .tt-stat {
  display: flex; justify-content: space-between;
  padding: 2px 0;
  font-size: 0.8rem;
}
.district-tooltip .tt-stat strong { color: var(--bpn-green); }

.proj-card .proj-doc-link {
  display: inline-block; margin-top: 12px;
  font-size: 0.85rem; font-weight: 600;
  color: var(--bpn-green); text-decoration: none;
  border-bottom: 1px solid var(--bpn-green);
  padding-bottom: 1px;
}
.proj-card .proj-doc-link:hover {
  color: var(--bpn-green-dark, #006139);
  border-bottom-color: var(--bpn-green-dark, #006139);
}

/* Charts */
.chart-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  margin-top: 28px;
}
@media (max-width: 820px) { .chart-grid { grid-template-columns: 1fr; gap: 24px; } }
.chart-card {
  background: var(--bpn-card); border: 1px solid var(--bpn-border);
  border-radius: 4px; padding: 24px;
}
.chart-card h3 {
  font-size: 1.1rem; margin-bottom: 4px;
}
.chart-card .chart-sub {
  font-size: 0.88rem; color: var(--bpn-muted); margin-bottom: 18px;
}
.chart-host { position: relative; min-height: 280px; }

/* Threshold table for the spotlight section */
.threshold-table {
  width: 100%; border-collapse: collapse; margin-top: 16px;
  font-size: 0.92rem;
}
.threshold-table thead th {
  background: var(--bpn-bg); text-align: left;
  padding: 10px 14px; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--bpn-muted); font-weight: 700;
  border-bottom: 1px solid var(--bpn-border);
}
.threshold-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--bpn-border);
}
.threshold-table tr:last-child td { border-bottom: none; }
.threshold-table tr.highlight {
  background: #fff8e6;
}
.threshold-table tr.highlight td:first-child {
  border-left: 3px solid var(--bpn-gold);
}
.threshold-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.threshold-table .pct { color: var(--bpn-muted); font-size: 0.85rem; font-weight: 400; }

/* Senator targets */
.senator-targets {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px; margin-top: 28px;
}
.sen-card {
  background: var(--bpn-card); border: 1px solid var(--bpn-border);
  padding: 18px 20px; border-radius: 4px;
  border-left: 3px solid var(--bpn-red);
}
.sen-card.party-D-card { border-left-color: #1e5f9c; }
.sen-card .sen-name {
  font-family: var(--font-head); font-weight: 700; font-size: 1.05rem;
  margin-bottom: 4px;
}
.sen-card .sen-meta {
  font-size: 0.82rem; color: var(--bpn-muted); margin-bottom: 12px;
}
.sen-card .sen-stat {
  font-size: 0.92rem;
  display: flex; justify-content: space-between;
  padding: 4px 0;
}
.sen-card .sen-stat-num { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Downloads */
.dl-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px; margin-top: 28px;
}
.dl-card {
  background: var(--bpn-card); border: 1px solid var(--bpn-border);
  padding: 18px 20px; border-radius: 4px;
  text-decoration: none; color: var(--bpn-dark);
  display: block; transition: border-color 120ms ease;
}
.dl-card:hover { border-color: var(--bpn-green); text-decoration: none; }
.dl-card .dl-tag {
  display: inline-block; background: var(--bpn-dark); color: var(--bpn-bg);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 2px; margin-bottom: 10px;
  text-transform: uppercase;
}
.dl-card .dl-tag.primary { background: var(--bpn-green); color: white; }
.dl-card h4 { font-size: 1.02rem; margin-bottom: 4px; }
.dl-card p { font-size: 0.85rem; color: var(--bpn-muted); margin: 0; }

/* Footer */
footer {
  padding: 48px 0; border-top: 1px solid var(--bpn-border);
  font-size: 0.88rem; color: var(--bpn-muted);
}
footer p { margin-bottom: 0.5em; }
footer a { color: var(--bpn-green); }

/* Note callout */
.note {
  background: #fff8e6; border-left: 3px solid var(--bpn-gold);
  padding: 14px 18px; margin: 24px 0; font-size: 0.92rem;
  border-radius: 0 4px 4px 0;
}
.note strong { color: var(--bpn-dark); }

/* Methodology two-col */
.method-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px; margin-top: 28px;
}
@media (max-width: 820px) { .method-grid { grid-template-columns: 1fr; } }
.method-card h4 {
  font-family: var(--font-head); font-weight: 700; font-size: 1.05rem;
  border-bottom: 2px solid var(--bpn-green); padding-bottom: 8px;
  margin-bottom: 12px;
}
.method-card p { font-size: 0.92rem; }

/* Map popup */
.maplibregl-popup-content {
  background: var(--bpn-card) !important;
  border: 1px solid var(--bpn-border);
  font-family: var(--font-body);
  padding: 14px 16px !important;
  border-radius: 3px !important;
  max-width: 280px;
}
.maplibregl-popup-tip { display: none; }
.popup-name {
  font-family: var(--font-head); font-weight: 700;
  font-size: 1rem; margin-bottom: 2px;
}
.popup-meta { font-size: 0.82rem; color: var(--bpn-muted); margin-bottom: 8px; }
.popup-stat {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; padding: 3px 0;
}
.popup-stat-label { color: var(--bpn-muted); }

.filter-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--bpn-border);
  font-size: 0.78rem;
  color: var(--bpn-muted);
  line-height: 1.4;
}
.filter-group label.is-disabled {
  color: var(--bpn-muted);
  opacity: 0.55;
  cursor: not-allowed;
}

.map-controls-help {
  font-size: 0.82rem;
  color: var(--bpn-muted);
  line-height: 1.45;
  margin: 0 0 10px;
}

.maplibregl-popup.proj-popup { z-index: 50; }

/* Project popup attached to bubble (replaces the side-panel proj-card) */
.maplibregl-popup.proj-popup .maplibregl-popup-content {
  background: var(--bpn-card);
  border: 1px solid var(--bpn-border);
  border-radius: 4px;
  padding: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  width: 300px;
  max-width: 300px;
  font-family: var(--font-body);
}
.maplibregl-popup.proj-popup .maplibregl-popup-close-button {
  font-size: 1.4rem;
  color: var(--bpn-muted);
  padding: 4px 10px 0;
}
.maplibregl-popup.proj-popup .maplibregl-popup-tip {
  border-top-color: var(--bpn-border);
  border-bottom-color: var(--bpn-border);
}
.proj-card-popup {
  padding: 14px 16px 12px;
  max-height: 440px;
  overflow-y: auto;
}
.proj-card-popup h3 { font-size: 1.1rem; }
.proj-card-popup .proj-meta { font-size: 0.8rem; margin-bottom: 12px; }
.proj-card-popup .proj-stat { font-size: 0.88rem; padding: 5px 0; }
.proj-card-popup .districts-block { padding: 12px 14px 10px; margin-top: 12px; }
.proj-card-popup .districts-sub { font-size: 0.76rem; line-height: 1.4; margin-bottom: 10px; }
.proj-card-popup .dist-item { font-size: 0.82rem; padding: 4px 0; gap: 8px; }

.rep-line {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--bpn-border);
  font-size: 0.88rem;
}
.rep-line:last-child { border-bottom: none; }
.rep-line .rep-name { flex: 1; }
.rep-line .rep-dist {
  color: var(--bpn-muted);
  font-size: 0.76rem;
  font-family: var(--font-head);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* County-popup specific */
.county-loc-note {
  font-size: 0.76rem; color: var(--bpn-muted);
  background: var(--bpn-bg); padding: 8px 10px;
  border-radius: 3px; margin: 0 0 12px;
  line-height: 1.4;
}
.county-proj-list {
  list-style: none; padding: 0; margin: 0 0 14px;
}
.county-proj {
  padding: 8px 0;
  border-bottom: 1px solid var(--bpn-border);
}
.county-proj:last-child { border-bottom: none; }
.county-proj.below-threshold { opacity: 0.55; }
.cp-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.88rem;
}
.cp-fuel-dot {
  display: inline-block; width: 9px; height: 9px;
  border-radius: 50%; flex-shrink: 0;
}
.cp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-mw { color: var(--bpn-dark); font-weight: 700; white-space: nowrap; }
.cp-meta {
  font-size: 0.74rem; color: var(--bpn-muted);
  margin-top: 2px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.cliff-badge {
  display: inline-block;
  background: var(--bpn-red); color: white;
  font-size: 0.66rem; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.proj-gia-mini {
  font-size: 0.66rem; font-weight: 700;
  color: var(--bpn-green);
  border: 1px solid var(--bpn-green);
  padding: 1px 6px; border-radius: 3px;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.proj-gia-mini:hover {
  background: var(--bpn-green); color: white;
  text-decoration: none;
}
.proj-card-popup h3 {
  font-size: 1.05rem; line-height: 1.2;
  margin: 0 4px 4px 0;
  padding-right: 24px; /* room for close button */
}
.proj-card-popup .proj-meta { font-size: 0.78rem; color: var(--bpn-muted); margin-bottom: 10px; }
.proj-card-popup .proj-stat {
  display: flex; justify-content: space-between;
  padding: 5px 0; border-bottom: 1px solid var(--bpn-border);
  font-size: 0.86rem;
}
.proj-card-popup .proj-stat:last-of-type { border-bottom: none; }
.proj-card-popup .proj-stat-label { color: var(--bpn-muted); }
.proj-card-popup .proj-stat-value { font-weight: 600; }
.proj-card-popup .districts-block {
  margin-top: 10px;
  padding: 10px 12px 8px;
  background: var(--bpn-bg);
  border-radius: 3px;
  border: 1px solid var(--bpn-border);
}
.proj-card-popup .districts-label { font-size: 0.7rem; }
.proj-card-popup .districts-sub { font-size: 0.72rem; }
.proj-card-popup .dist-item { font-size: 0.78rem; }
.proj-card-popup .proj-doc-link {
  display: inline-block; margin-top: 10px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--bpn-green); text-decoration: none;
  border-bottom: 1px solid var(--bpn-green);
  padding-bottom: 1px;
}
.proj-card-popup .proj-doc-link:hover {
  color: var(--bpn-green-dark, #006139);
  border-bottom-color: var(--bpn-green-dark, #006139);
}

/* =====================================================================
   MEMO PAGE
   ===================================================================== */
.memo-page { max-width: 780px; margin: 0 auto; padding: 48px 24px 80px; }
.memo-page h1 { font-size: 2.2rem; line-height: 1.15; }
.memo-page h2 { font-size: 1.4rem; margin-top: 2em; padding-bottom: 6px; border-bottom: 1px solid var(--bpn-border); }
.memo-page h3 { font-size: 1.1rem; margin-top: 1.6em; }
.memo-page p { margin: 0 0 1em; line-height: 1.65; }
.memo-page strong { font-weight: 700; }
.memo-page table {
  width: 100%; border-collapse: collapse; margin: 1.2em 0;
  font-size: 0.9rem; background: var(--bpn-card);
  border: 1px solid var(--bpn-border);
}
.memo-page th, .memo-page td {
  padding: 8px 10px; text-align: left;
  border-bottom: 1px solid var(--bpn-border);
}
.memo-page th {
  background: var(--bpn-bg); font-family: var(--font-head);
  text-transform: uppercase; font-size: 0.72rem;
  letter-spacing: 0.08em; color: var(--bpn-muted);
}
.memo-page td.num { text-align: right; font-variant-numeric: tabular-nums; }
.memo-page hr { border: 0; border-top: 1px solid var(--bpn-border); margin: 2em 0; }
.memo-page ul, .memo-page ol { padding-left: 1.4em; line-height: 1.6; }
.memo-page li { margin-bottom: 0.4em; }
.memo-page blockquote {
  border-left: 3px solid var(--bpn-green);
  padding: 4px 16px; margin: 1em 0;
  color: var(--bpn-dark); font-style: italic;
}
.memo-page blockquote cite { display: block; font-size: 0.82rem; color: var(--bpn-muted); margin-top: 6px; font-style: normal; }
.memo-page code { background: var(--bpn-card); padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
.memo-page .memo-meta { color: var(--bpn-muted); font-size: 0.95rem; margin-bottom: 2em; }
.memo-page .memo-status {
  display: inline-block; background: var(--bpn-bg);
  border: 1px solid var(--bpn-border); border-radius: 3px;
  padding: 4px 10px; margin-top: 6px;
  font-family: var(--font-head); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bpn-muted);
}

/* Sponsor cards in memo */
.sponsor-cards {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 14px; margin: 1.5em 0;
}
@media (max-width: 720px) { .sponsor-cards { grid-template-columns: 1fr; } }
.sponsor-card {
  background: var(--bpn-card);
  border: 1px solid var(--bpn-border);
  border-left: 3px solid var(--bpn-green);
  border-radius: 0 4px 4px 0;
  padding: 14px 16px;
}
.sponsor-card .sc-bill {
  font-family: var(--font-head); font-weight: 700;
  font-size: 1.1rem; color: var(--bpn-dark);
  margin: 0 0 4px;
}
.sponsor-card .sc-title {
  font-size: 0.82rem; color: var(--bpn-muted);
  margin: 0 0 10px; line-height: 1.4;
}
.sponsor-card .sc-prime {
  font-size: 0.88rem; font-weight: 600; color: var(--bpn-dark);
}
.sponsor-card .sc-prime small { display: block; color: var(--bpn-muted); font-weight: 500; margin-top: 1px; }
.sponsor-card .sc-meta {
  font-size: 0.78rem; color: var(--bpn-muted);
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--bpn-border);
}

/* Memo-specific permit-time stat box */
.permit-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin: 1.4em 0;
}
@media (max-width: 720px) { .permit-stats { grid-template-columns: 1fr; } }
.permit-stat {
  background: var(--bpn-bg);
  border-radius: 4px;
  padding: 16px 18px;
  border-left: 3px solid var(--bpn-gold);
}
.permit-stat .ps-num {
  font-family: var(--font-head); font-weight: 700;
  font-size: 1.7rem; color: var(--bpn-dark); line-height: 1;
}
.permit-stat .ps-label {
  font-size: 0.84rem; color: var(--bpn-dark);
  margin-top: 6px; line-height: 1.4;
}
.permit-stat .ps-source {
  font-size: 0.72rem; color: var(--bpn-muted);
  margin-top: 6px; font-style: italic;
}

/* Mobile memo */
@media (max-width: 720px) {
  .memo-page { padding: 28px 16px 56px; }
  .memo-page h1 { font-size: 1.7rem; }
  .memo-page h2 { font-size: 1.2rem; margin-top: 1.6em; }
  .memo-page h3 { font-size: 1.02rem; }
  .memo-page table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* =====================================================================
   MOBILE POLISH
   ===================================================================== */

/* Tablet and smaller — under ~900px */
@media (max-width: 900px) {
  /* Map sidebar collapses below the map */
  .map-side { gap: 14px; }
  #map { height: 440px; }
  /* Chamber map height reduced */
  #chamber-map { height: 460px; }
}

/* Phone — under 720px */
@media (max-width: 720px) {
  .container { padding: 0 16px; }

  /* Hero */
  .hero { padding: 36px 0 24px; }
  .hero h1 { font-size: 2.05rem; line-height: 1.1; }
  .hero .lede { font-size: 1.02rem; }
  .hero-actions { gap: 10px; }
  .btn { padding: 10px 14px; font-size: 0.9rem; }

  /* Section spacing */
  section { padding: 36px 0; }
  section h2 { font-size: 1.55rem; }
  section h2 .kicker { font-size: 0.72rem; letter-spacing: 0.12em; }

  /* Stat row already collapses to 2 cols at 820px; tighten */
  .stat-row { margin: 20px 0; }
  .stat { padding: 14px 16px; }
  .stat-num { font-size: 1.6rem; }
  .stat-label { font-size: 0.76rem; margin-top: 4px; }

  /* Pullquote tighter */
  .pullquote { padding: 10px 16px; font-size: 0.95rem; }

  /* Map: project marker sidebar already stacks; keep map a touch shorter */
  #map { height: 380px; }

  /* Chamber map */
  .map-toolbar { gap: 8px; flex-direction: column; align-items: stretch; }
  .toggle-group { width: 100%; }
  .toggle-btn { flex: 1; padding: 8px 10px; font-size: 0.84rem; }
  #chamber-map { height: 380px; }

  /* Legend: smaller, less max-width to fit narrow viewports */
  .districts-map-legend {
    left: 8px; bottom: 8px;
    padding: 8px 10px; font-size: 0.72rem;
    max-width: 180px;
  }
  .districts-map-legend .legend-title { font-size: 0.66rem; }

  /* District detail panel */
  .district-detail { padding: 14px 16px; }
  .dd-title { font-size: 1.05rem; }
  .dd-stats { grid-template-columns: 1fr; gap: 8px; }
  .dd-stat-num { font-size: 1.3rem; }
  .dd-projects-list li {
    grid-template-columns: 10px 1fr auto;
    font-size: 0.82rem;
  }
  .dd-projects-list .dd-proj-county { display: none; }

  /* Project popup card: shrink districts block */
  .districts-block { padding: 12px; }
  .districts-section-h { font-size: 0.66rem; }
  .dist-item { font-size: 0.8rem; gap: 6px; }

  /* Threshold table: horizontal scroll */
  .threshold-table { font-size: 0.85rem; }
  .threshold-table th, .threshold-table td { padding: 6px 8px; }

  /* Top projects: simplify; allow horizontal scroll */
  #top-projects-host { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Brief callout numbers are quite long; smaller */
  .brief-callout .callout-num { font-size: 1.15rem; line-height: 1.2; }
  .brief-callout p { font-size: 0.88rem; }

  /* Threshold slider readout */
  .map-controls { padding: 14px; }

  /* Charts: shorter on mobile */
  .chart-host { font-size: 0.85rem; }

  /* Method/method-grid spacing */
  .method-card { padding: 16px; }

  /* Footer */
  footer { padding: 28px 0; font-size: 0.85rem; }
}

/* Small phones — under 480px */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.85rem; }
  .nav-brand-sub { display: none; }
  .stat-row { grid-template-columns: 1fr; }
  .stat:nth-child(2n) { border-bottom: 1px solid var(--bpn-border); }
  .nav-links { gap: 10px; }
  .nav-links a { font-size: 0.8rem; padding: 4px 0; }
}
