:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --panel-2: #f2f0ea;
  --border: #d6d3cb;
  --border-light: #e6e3db;
  --text: #181a1b;
  --muted: #555c65;
  --accent: #0f5c52;
  --accent-soft: #e6f2f0;
  --green: #0f766e;
  --green-soft: #e6f4f1;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --nodata: #cbd5e1;
  --sea: #e8eff4;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.tabular, .stat-val, .money-kpi-val, .amount-val, .vote-badge, .spotlight-pct, .pillar-count {
  font-variant-numeric: tabular-nums;
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Left Sidebar */
#sidebar {
  width: 360px;
  min-width: 320px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 500;
  overflow: hidden;
}

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

.brand {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.brand-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}
.badge-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
}
.badge-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.brand-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.site-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 10px;
  padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.site-nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.site-nav-link:hover {
  color: var(--text);
  background: rgba(15, 92, 82, 0.06);
}
.site-nav-link.active {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
}

.panel {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}
.section-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 7px;
}
.section-header .section-label { margin-bottom: 0; }

.search-wrap { position: relative; }
#search-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}
#search-input:focus { border-color: var(--accent); }
.search-results {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 900;
  box-shadow: 0 6px 18px rgba(24, 26, 27, 0.12);
}
.search-item {
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--accent-soft); }
.search-item strong { color: var(--text); }
.search-item span { display: block; font-size: 11px; color: var(--muted); }

.city-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.chip {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.pillar-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pillar-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 3px;
  border: 1px solid var(--border-light);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.pillar-btn:hover { border-color: var(--border); background: var(--panel-2); }
.pillar-btn.active {
  border-color: var(--accent);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}
.pillar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.pillar-left span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.pillar-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}
.pillar-count {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* Evidence Card ("Why This Matters") */
.evidence-card {
  margin-top: 10px;
  padding: 10px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  font-size: 11.5px;
  line-height: 1.48;
}
.evidence-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.evidence-kicker {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.evidence-tagline {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 11.5px;
}
.evidence-summary {
  color: var(--text);
  margin: 0 0 7px;
  font-size: 11.5px;
}
.evidence-debate {
  padding: 6px 8px;
  border-radius: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 7px;
}
.evidence-debate strong { color: var(--text); }
.evidence-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 10.5px;
}
.evidence-citations a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.evidence-citations a:hover { color: var(--text); }

.mode-row { margin-top: 10px; }
.mini-label {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 5px;
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px;
  gap: 2px;
}
.segmented button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 5px 6px;
  border-radius: 2px;
  cursor: pointer;
}
.segmented button.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
}

.policy-panel { border-bottom: none; }
.hint {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--muted);
}
.policy-list {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}
.policy-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  font-size: 11.5px;
}
.policy-item.disabled { opacity: 0.5; }
.policy-item input[type="checkbox"] { cursor: pointer; accent-color: var(--accent); }
.policy-name {
  flex: 1;
  line-height: 1.3;
  cursor: pointer;
}
.dir-btn {
  min-width: 24px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.dir-btn.pos { color: var(--green); border-color: #99d5cc; background: var(--green-soft); }
.dir-btn.neg { color: var(--red); border-color: #f3b5b5; background: var(--red-soft); }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.sidebar-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
  flex-shrink: 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 5px 8px;
  text-align: center;
}
.stat-val { font-size: 14px; font-weight: 700; color: var(--text); }
.stat-lbl { font-size: 10px; color: var(--muted); }
.attribution {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.45;
}
.attribution a { color: var(--accent); text-decoration: none; }
.attribution a:hover { text-decoration: underline; }
.timestamp { margin-top: 3px; font-size: 10px; color: var(--muted); }
.footer-links-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Map Area */
#map-wrap {
  flex: 1;
  position: relative;
  height: 100%;
  min-width: 0;
}
#map {
  height: 100%;
  width: 100%;
  background: var(--sea);
}
/* Native crisp OpenStreetMap tiles (ODbL) — un-inverted, subtle opacity for choropleth legibility */
.osm-tiles {
  opacity: 0.72;
}

.basemap-switcher {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 460;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(24, 26, 27, 0.08);
}
.basemap-switcher button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 3px;
  cursor: pointer;
}
.basemap-switcher button:hover { color: var(--text); }
.basemap-switcher button.active {
  background: var(--accent);
  color: #ffffff;
}

.legend {
  position: absolute;
  bottom: 22px;
  left: 16px;
  z-index: 450;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  width: 252px;
  box-shadow: 0 2px 8px rgba(24, 26, 27, 0.09);
}
.legend-title { font-size: 11.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.legend-bar {
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(24, 26, 27, 0.12);
  background: linear-gradient(90deg, #e8dfc9 0%, #5ba395 50%, #0f5c52 100%);
}
.legend-bar.legend-abundance {
  background: linear-gradient(90deg, #e8dfc9 0%, #5ba395 50%, #0f5c52 100%);
}
.legend-bar.legend-pressure {
  background: linear-gradient(90deg, #e6f2f0 0%, #d97706 55%, #b91c1c 100%);
}
.legend-bar.legend-index {
  background: linear-gradient(90deg, #b91c1c 0%, #d97706 33%, #0284c7 67%, #15803d 100%);
}
.legend-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.legend-nodata {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 10.5px;
  color: var(--muted);
}
.swatch-nodata {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--nodata);
  border: 1px solid #94a3b8;
  flex-shrink: 0;
}

.hover-card {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 460;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  min-width: 230px;
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(24, 26, 27, 0.1);
}
.hover-title { font-family: var(--serif); font-weight: 700; font-size: 14.5px; color: var(--text); }
.hover-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.hover-metric { margin-top: 6px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Right 5-Tab Drawer */
.drawer {
  width: 520px;
  max-width: 54vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 550;
  height: 100%;
}
.hidden { display: none !important; }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.drawer-eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 700;
}
.drawer-header h2 {
  margin: 2px 0 3px;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.2;
  color: var(--text);
}
.drawer-rep-line {
  font-size: 12.5px;
  color: var(--muted);
}
.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.drawer-meta {
  padding: 9px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}
.drawer-meta strong { color: var(--text); font-variant-numeric: tabular-nums; }
.drawer-meta a { color: var(--accent); text-decoration: none; font-weight: 500; }
.drawer-meta a:hover { text-decoration: underline; }
.interest-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--green-soft);
  border: 1px solid #99d5cc;
  color: var(--accent) !important;
  font-weight: 600;
  font-size: 11px;
}
.interest-pill:hover { background: #d5ebe7; text-decoration: none !important; }

.drawer-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.drawer-tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 10px 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-tabs button:hover { color: var(--text); background: var(--bg); }
.drawer-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--bg);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Spotlight Cards (Bright Spots vs Opposition/Friction) */
.spotlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 14px;
}
.spotlight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 11px;
}
.spotlight-bright {
  border-left: 3px solid var(--green);
}
.spotlight-friction {
  border-left: 3px solid var(--red);
}
.spotlight-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.spotlight-bright .spotlight-title { color: var(--green); }
.spotlight-friction .spotlight-title { color: var(--red); }
.spotlight-item {
  font-size: 11.5px;
  padding: 5px 0;
  border-top: 1px solid var(--border-light);
  line-height: 1.35;
}
.spotlight-item:first-of-type { border-top: none; padding-top: 0; }
.spotlight-item a { color: var(--text); text-decoration: none; font-weight: 500; }
.spotlight-item a:hover { color: var(--accent); text-decoration: underline; }
.spotlight-pct {
  font-weight: 700;
  font-size: 11px;
}

.enrichment-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 11px;
  margin-bottom: 10px;
}
.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.role-chip {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.pillar-bar-row {
  margin-bottom: 9px;
}
.pillar-bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.bar-track {
  height: 7px;
  border-radius: 2px;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  transition: width 0.2s;
}

.vote-card, .speech-card, .da-card, .money-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.vote-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.vote-card-title { font-weight: 600; font-size: 12.5px; line-height: 1.35; color: var(--text); }
.vote-card-desc { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.vote-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
}
.vote-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--muted);
}
.vote-meta a, .speech-card a, .da-card a, .money-card a { color: var(--accent); text-decoration: none; font-weight: 500; }
.vote-meta a:hover, .speech-card a:hover, .da-card a:hover, .money-card a:hover { text-decoration: underline; }

/* Money Tab */
.money-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.money-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 10px;
}
.money-kpi-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.money-kpi-lbl {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--border-light);
  font-size: 11.5px;
}
.data-row:first-of-type { border-top: none; padding-top: 0; }
.data-row.highlight-branch {
  background: var(--accent-soft);
  margin: 0 -6px;
  padding: 6px;
  border-radius: 3px;
}
.amount-val {
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
}
.method-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}
.method-badge.open {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #99d5cc;
}
.method-badge.limited {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid #f2c97d;
}
.method-badge.other {
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.inline-form {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.inline-form input {
  flex: 1;
  padding: 7px 9px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}
.inline-form input:focus { outline: none; border-color: var(--accent); }
.primary-btn {
  padding: 7px 12px;
  border-radius: 3px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.primary-btn:hover { background: #0b4941; }
.secondary-btn {
  padding: 6px 10px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 11.5px;
  cursor: pointer;
}
.secondary-btn:hover { border-color: var(--accent); color: var(--accent); }

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.tag {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.tag-pos { background: var(--green-soft); color: var(--green); border-color: #99d5cc; }
.tag-neg { background: var(--amber-soft); color: var(--amber); border-color: #f2c97d; }
.tag-cat { background: var(--accent-soft); color: var(--accent); border-color: #b7dad4; font-weight: 600; }

.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.48;
}
.notice-warn {
  border-left-color: var(--amber);
  background: #fffdf7;
}
.muted { color: var(--muted); }

.bills-drawer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-size: 11.5px;
}
.bill-row {
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  margin-bottom: 5px;
}
.bill-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.bill-row a { color: var(--accent); text-decoration: none; font-weight: 600; }
.bill-row a:hover { text-decoration: underline; }
.vote-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.citation-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 310px;
  overflow-y: auto;
  margin: 8px 0 12px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 26, 27, 0.45);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  width: 680px;
  max-width: 95vw;
  max-height: 88vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(24, 26, 27, 0.22);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--text);
}
.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}
.modal-intro {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 12.5px;
}
.license-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.license-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.license-item p {
  margin: 5px 0 6px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.48;
}
.license-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
}
.license-links a { color: var(--accent); text-decoration: none; font-weight: 500; }
.license-links a:hover { text-decoration: underline; }

/* Physical Reality & Direct Votes Components */
.physical-mini-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.physical-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 11.5px;
}
.physical-mini-row:last-child { border-bottom: none; }
.physical-mini-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.physical-section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 11px 12px;
  margin-bottom: 10px;
}
.physical-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}
.physical-section-title {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}
.physical-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-bottom: 8px;
}
.physical-kpi {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 7px 9px;
}
.physical-kpi-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.physical-kpi-val.accent { color: var(--accent); }
.physical-kpi-val.warn { color: var(--amber); }
.physical-kpi-lbl {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}
.physical-kpi-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.vote-pill-aye {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #99d5cc;
  white-space: nowrap;
}
.vote-pill-no {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #f3b5b5;
  white-space: nowrap;
}
.topic-rules-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 11px;
}
.topic-rules-box summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}
.topic-rules-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
}
.quiet-ref {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}
.quiet-ref a { color: var(--muted); text-decoration: underline; }
.quiet-ref a:hover { color: var(--accent); }

/* 2026 House Attention vs. Bills Audit */
.attention-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 8px;
}
.attention-row {
  display: grid;
  grid-template-columns: 1fr 110px 64px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.attention-label {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attention-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.attn-track {
  height: 5px;
  background: var(--panel-2);
  border-radius: 1px;
  overflow: hidden;
}
.attn-fill-speech {
  height: 100%;
  background: var(--accent);
}
.attn-fill-div {
  height: 100%;
  background: var(--amber);
}
.attention-nums {
  text-align: right;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.attention-legend {
  display: flex;
  gap: 12px;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.attn-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  margin-right: 4px;
  vertical-align: middle;
}

/* Overall "How Are We Doing?" Index Weights & Scorecard */
.weights-box {
  margin-top: 8px;
  padding: 7px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 11px;
}
.weights-box summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}
.weights-sliders {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.weight-row {
  display: grid;
  grid-template-columns: 1fr 84px 36px;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}
.weight-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
.weight-val {
  text-align: right;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.weights-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid var(--border-light);
}

.scorecard-hero {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.scorecard-score {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.scorecard-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.scorecard-row {
  display: grid;
  grid-template-columns: 138px 1fr 42px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.scorecard-lbl {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scorecard-track {
  height: 7px;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}
.scorecard-fill {
  height: 100%;
  transition: width 0.2s;
}
.scorecard-num {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hover-pillars {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

/* Leaflet controls harmonize with light paper palette */
.leaflet-control-attribution {
  background: rgba(250, 249, 245, 0.92) !important;
  color: var(--muted) !important;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  font-size: 10.5px !important;
}
.leaflet-control-attribution a {
  color: var(--accent) !important;
}
.leaflet-bar {
  border: 1px solid var(--border) !important;
  box-shadow: 0 2px 6px rgba(24, 26, 27, 0.08) !important;
}
.leaflet-bar a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-bottom-color: var(--border-light) !important;
}
.leaflet-bar a:hover {
  background: var(--panel-2) !important;
}
