/* ===== tokens — light default ===== */
:root {
  --page:    #FAFAF7;
  --paper:   #FFFFFF;
  --paper-2: #F2F1EB;
  --rule:    #D8D2C2;
  --ink:     #0B0B0B;
  --ink-2:   #3A3A3A;
  --ink-3:   #7A6F5C;
  --red:        #b71c1c;
  --red-lite:   #e53935;
  --blue:      #0d47a1;
  --blue-lite: #1e88e5;
  --display: 'Inter', system-ui, sans-serif;
  --sans:    'Inter', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;
  --t-fast:  150ms;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page:    #0E0E12;
  --paper:   #161620;
  --paper-2: #1C1C28;
  --rule:    #2A2A35;
  --ink:     #EDEDED;
  --ink-2:   #C3C3D0;
  --ink-3:   #9090A8;
  --red:        #e53935;
  --red-lite:   #b71c1c;
  --blue:      #1e88e5;
  --blue-lite: #0d47a1;
  color-scheme: dark;
}

/* ===== fonts ===== */
@font-face { font-family: Inter; font-weight: 400; src: url(/static/fonts/Inter-Regular.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Inter; font-weight: 700; src: url(/static/fonts/Inter-Bold.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; src: url(/static/fonts/JetBrainsMono-Regular.woff2) format("woff2"); font-display: swap; }

/* ===== reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 14px/1.5 var(--sans); color: var(--ink); background: var(--page); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; }

/* ===== layout ===== */
.layout { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }

/* ===== sidebar ===== */
.sidebar {
  padding: 24px 16px;
  border-right: 1px solid var(--rule);
  background: var(--page);
  overflow-y: auto;
}

.sb-pinned { margin-bottom: 4px; }

/* every row — button reset + row geometry */
.sb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 12px;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  font: 14px var(--sans);
  color: var(--ink-2);
  text-align: left;
  gap: 6px;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.sb-row:hover { color: var(--ink); }
.sb-row.is-active {
  color: var(--ink);
  border-left-color: var(--red);
  background: var(--paper);
}

.sb-row .ct {
  font: 11px var(--mono);
  color: var(--ink-3);
  margin-left: auto;
}

.sb-row-label { flex: 1; min-width: 0; }
.sb-row[data-facet="committee"] .sb-row-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* section labels */
.sb-label {
  font: 10px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 16px 12px 6px;
  border-top: 1px solid var(--rule);
  margin-top: 4px;
}
.sb-section:first-of-type .sb-label { border-top: none; margin-top: 0; }

/* typeahead multi-select dropdown facets (STATE / DISTRICT / COMMITTEES / ISSUES) */
.dd-section {
  padding: 0 12px;
  margin-top: 4px;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  padding-bottom: 4px;
}
.sb-section + .dd-section,
.dd-section + .dd-section { /* tighter spacing between dropdowns */ }
.dd-label {
  font: 10px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 0 6px;
  border-top: none;
  margin-top: 0;
  display: flex; align-items: center; gap: 6px;
}
.dd-label .dd-sel-count {
  background: var(--red); color: #fff;
  font: 700 9px var(--mono);
  padding: 1px 5px;
  letter-spacing: 0;
  min-width: 14px; text-align: center;
}
.dd-label .dd-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  font: 700 10px var(--mono);
  letter-spacing: 0;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.dd-label .dd-clear:hover { color: #fff; background: var(--red); border-color: var(--red); }
.dd-control {
  display: flex;
  align-items: stretch;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  transition: border-color var(--t-fast);
}
.dd-section.is-open .dd-control { border-color: var(--ink-3); }
.dd-section.is-open .dd-control,
.dd-section.is-open .dd-panel { background: var(--paper-2); }
.dd-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 8px 10px;
  font: 13px var(--sans);
  color: var(--ink);
  outline: none;
}
.dd-input::placeholder { color: var(--ink-3); }
.dd-toggle {
  background: transparent;
  border: none;
  width: 32px;
  font: 600 16px var(--sans);
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
  transition: color var(--t-fast), transform var(--t-fast);
}
.dd-toggle:hover { color: var(--ink); }
.dd-section.has-selection .dd-toggle { color: var(--red); }
.dd-section.is-open .dd-toggle { transform: rotate(45deg); color: var(--ink-2); }
.dd-panel {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-top: none;
  max-height: 280px;
  overflow-y: auto;
}
.dd-panel[hidden] { display: none; }
.dd-list { list-style: none; padding: 0; margin: 0; }
.dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  font: 13px var(--sans);
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.dd-item:hover { background: color-mix(in srgb, var(--blue) 8%, var(--paper-2)); color: var(--ink); }
.dd-item.is-active { background: var(--blue); color: #fff; }
.dd-item.is-active .dd-item-count { color: rgba(255,255,255,0.7); }
.dd-item.is-active:hover { background: color-mix(in srgb, var(--blue) 90%, #000); }
.dd-item.is-hidden { display: none; }
.dd-item-label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-item-count { font: 11px var(--mono); color: var(--ink-3); flex-shrink: 0; }

/* dot indicator */
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; flex-shrink: 0; }

/* state search */
.sb-state-search {
  display: block;
  width: calc(100% - 24px);
  margin: 4px 12px 2px;
  padding: 0 10px;
  height: 32px;
  font: 13px var(--mono);
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
 
  outline: none;
}
.sb-state-search::placeholder { color: var(--ink-3); }
.sb-state-search:focus { border-color: var(--red); }

/* sidebar overflow + search visibility */
.sb-row.sb-overflow { display: none; }
.sb-section.is-expanded .sb-row.sb-overflow,
.sb-section.is-searching .sb-row.sb-overflow { display: flex; }
.sb-row.is-hidden { display: none !important; }
.sb-section.is-expanded .sb-more,
.sb-section.is-searching .sb-more { display: none; }

/* ===== site header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--page);
  background: color-mix(in srgb, var(--page) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  --ctl-h: 36px;
}
.site-header .inner {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: center;
  padding: 14px 0;
}
.site-header .wordmark {
  padding-left: 16px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-transform: none;
  white-space: nowrap;
  text-decoration: none;
}
.site-header .wordmark:hover { color: var(--red); text-decoration: none; }
.site-header .wordmark .brand-dot { color: var(--red); }
.site-header .header-tools {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  min-width: 0;
}
.site-header .search {
  flex: 1 1 280px;
  height: var(--ctl-h);
  box-sizing: border-box;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  padding: 0 14px;
}
.site-header .search::placeholder { color: var(--ink-3); }
.site-header .search:focus { outline: 2px solid var(--red); outline-offset: 2px; }

/* ===== main ===== */
.main { padding: 24px; min-width: 0; }

/* ===== results ===== */
.results-header {
  font: 11px var(--mono); color: var(--ink-3); letter-spacing: .06em;
  margin-bottom: 12px; text-transform: uppercase;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.results-header .count { flex: 1 1 auto; min-width: 0; }
.results-header .count strong { color: var(--red); font-weight: 600; }
.results-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.results-action {
  font: 11px var(--mono); letter-spacing: .04em; text-transform: uppercase;
  padding: 6px 12px; background: var(--paper);
  border: 1px solid var(--rule); color: var(--ink-2);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.results-action:hover:not(:disabled) { border-color: var(--red); color: var(--ink); }
.results-action:disabled { opacity: .4; cursor: not-allowed; }
.results-export { background: var(--paper); color: var(--ink); border-color: var(--ink-3); }
.results-export:hover:not(:disabled) { background: var(--red); color: #fff; border-color: var(--red); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }

/* ===== cards ===== */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
 
  padding: 14px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  position: relative;
  transition: border-color var(--t-fast);
}
.card:hover { border-color: var(--red); }
.card-photo {
  width: 64px; height: 80px;
 
  background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  font: 700 18px var(--mono);
  color: var(--ink-3);
  flex-shrink: 0;
}
.card-body { flex: 1; min-width: 0; padding-right: 28px; padding-bottom: 24px; }
.card-pills { display: flex; gap: 6px; margin-bottom: 6px; }
.pill { padding: 2px 9px; font: 600 11px var(--mono); }
.pill-party { color: #fff; }
.pill-r { background: var(--red); }
.pill-d { background: var(--blue); }
.pill-i  { background: #4b5563; color: #fff; }
.pill-neutral { background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--rule); }
.card-name { margin: 0 0 2px; font: 700 16px var(--sans); color: var(--ink); }
.card-sub { font: 11px var(--mono); color: var(--ink-3); }
.card-detail-link { position: absolute; bottom: 12px; right: 12px; font: 11px var(--mono); padding: 3px 8px; border: 1px solid var(--rule); color: var(--ink-2); }
.card-detail-link:hover { border-color: var(--red); color: var(--ink); text-decoration: none; }

/* selection checkbox (top-right of card) */
.card-select-wrap {
  position: absolute;
  top: 10px; right: 10px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.card-select {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px;
  margin: 0; padding: 0;
  background: var(--paper);
  border: 1.5px solid var(--ink-3);
  cursor: pointer;
  position: relative;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.card-select:hover { border-color: var(--red); }
.card-select:checked { background: var(--red); border-color: var(--red); }
.card-select:checked::after {
  content: ""; position: absolute;
  left: 4px; top: 0px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.card.is-selected { border-color: var(--red); background: color-mix(in srgb, var(--red) 4%, var(--paper)); }
.card.is-selected .card-photo { opacity: .92; }

/* ===== staff cards (issue mode) ===== */
/* Staff cards have no photo — body fills the card; Detail link reserves bottom-right room */
.staff-card .card-body { padding-right: 28px; padding-bottom: 24px; }
.staff-card .card-name { font: 700 14px var(--sans); margin-bottom: 4px; }
.staff-card .staff-title {
  font: 10px var(--mono); color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 6px;
}
.staff-card .issue-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 6px;
}
.staff-card .issue-tag {
  font: 10px var(--mono);
  color: #fff; background: var(--red);
  padding: 2px 6px;
  max-width: 140px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.staff-card .issue-tag-more {
  background: var(--paper-2);
  color: var(--ink-3);
  border: 1px solid var(--rule);
}
.staff-card .for-line {
  font: 11px var(--mono); color: var(--ink-3);
  margin-bottom: 6px;
}
.staff-card .staff-contact {
  font: 11px var(--mono); color: var(--ink-2);
}
.staff-card a.staff-contact-link { color: var(--ink-2); }
.staff-card a.staff-contact-link:hover { color: var(--red); text-decoration: none; }

/* ===== load more ===== */
.load-more {
  display: block; margin: 24px auto; padding: 10px 24px;
  background: var(--paper); border: 1px solid var(--rule);
  font: 12px var(--mono); color: var(--ink-2);
  transition: border-color var(--t-fast);
}
.load-more:hover { border-color: var(--red); color: var(--ink); }

/* ===== drawer (overlay, slides in from right; never pushes the grid) ===== */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--paper);
  border-left: 1px solid var(--rule);
  box-shadow: -8px 0 24px -8px rgba(0,0,0,.18);
  z-index: 70;
  transform: translateX(100%);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }
@media (max-width: 759px) { .drawer { width: 100vw; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--rule); }
.drawer-head .label { font: 11px var(--mono); color: var(--ink-3); letter-spacing: .06em; }
.drawer-head button { background: none; border: 1px solid var(--rule); padding: 4px 8px; font: 11px var(--mono); color: var(--ink-2); }
.drawer-head button:hover { border-color: var(--red); color: var(--ink); }
.drawer-body { padding: 20px; }
.drawer-name-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-name-row h2 { margin: 0 0 4px; font: 700 20px var(--sans); color: var(--ink); flex: 1; min-width: 0; }
.drawer-star { background: none; border: none; padding: 0; font: 14px var(--sans); color: var(--ink-2); cursor: pointer; line-height: 1; }
.drawer-star:hover { color: var(--red); }
.drawer-sub { font: 12px var(--mono); color: var(--ink-3); margin-bottom: 16px; }
.drawer-cta {
  display: block; text-align: center;
  background: var(--red); color: #fff;
  padding: 10px;
  font: 600 13px var(--mono); margin-top: 16px; text-decoration: none;
  transition: opacity var(--t-fast);
}
.drawer-cta:hover { opacity: .88; text-decoration: none; }

/* ===== detail pages ===== */
.detail, .org-detail, .issue-detail { max-width: 880px; margin: 0 auto; padding: 24px; }
.crumbs { font: 12px var(--mono); color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--red); }
.hero { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 32px; }
.hero-photo { width: 140px; height: 174px; background: var(--paper-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-monogram { font: 700 32px var(--mono); color: var(--ink-3); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.hero-meta h1 { margin: 0 0 4px; font: 800 34px/1.1 var(--sans); letter-spacing: -.02em; color: var(--ink); }
.hero-sub { font: 14px var(--mono); color: var(--ink-3); margin-bottom: 14px; }
.pills { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pills .pill { padding: 4px 12px; font-size: 12px; }
.section-nav {
  display: flex; gap: 14px; flex-wrap: wrap; padding: 14px 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin-bottom: 24px; font: 12px var(--mono);
}
.section-nav a { color: var(--ink-3); padding: 4px 0; }
.section-nav a:hover { color: var(--red); text-decoration: none; }
section h2 { margin: 32px 0 12px; font: 600 18px var(--sans); color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
section .empty { color: var(--ink-3); font-style: italic; }
section p { color: var(--ink-2); }
section pre { background: var(--paper); border: 1px solid var(--rule); padding: 12px; font: 12px var(--mono); overflow-x: auto; color: var(--ink-2); }

/* ===== detail page lists ===== */
.committee-list, .contact-list, .social-list, .external-list, .terms-list { list-style: none; padding: 0; margin: 0; }
.committee-list li, .contact-list li, .social-list li, .external-list li, .terms-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-2);
}
.committee-list li:last-child, .contact-list li:last-child,
.social-list li:last-child, .external-list li:last-child,
.terms-list li:last-child { border-bottom: 0; }
.committee-list .rank {
  display: inline-block;
  min-width: 100px;
  font: 600 10px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 8px;
}
.committee-list .rank-chair { color: var(--red); }
.committee-list .rank-ranking-member { color: var(--blue); }
.committee-list .rank-vice-chair { color: var(--blue); }
.contact-list strong, .external-list strong {
  display: inline-block;
  min-width: 120px;
  font: 600 11px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.terms-list li { font: 13px var(--mono); }
.social-list, .external-list { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.social-list li, .external-list li { padding: 8px 0; border: 0; flex: 0 0 auto; }

/* social icons (detail page + drawer share these) */
.social-icon { width: 18px; height: 18px; flex-shrink: 0; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--t-fast);
}
.social-link:hover { color: var(--red); }
.social-link span { font: 13px var(--mono); }

/* staff (v2.0) */
.staff-list { list-style: none; padding: 0; margin: 0; }
.staff-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-2);
}
.staff-row:last-child { border-bottom: 0; }
.staff-name { font: 600 14px var(--sans); color: var(--ink); margin-bottom: 2px; }
.staff-title { font: 12px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.staff-issues { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.staff-issues .issue-tag {
  font: 10px var(--mono);
  color: #fff; background: var(--red);
  padding: 2px 6px;
  text-decoration: none;
}
.staff-issues .issue-tag:hover { background: var(--ink); color: #fff; text-decoration: none; }
.staff-contact { font: 12px var(--mono); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.staff-email, .staff-phone, .staff-linkedin { color: var(--blue); }
.staff-email:hover, .staff-phone:hover, .staff-linkedin:hover { color: var(--red); }
.staff-linkedin { display: inline-flex; align-items: center; gap: 4px; }
.staff-linkedin .social-icon { width: 14px; height: 14px; }
.staff-inferred { font-size: 9px; color: var(--ink-3); margin-left: 2px; cursor: help; }
.staff-source { font: 11px var(--mono); margin-top: 12px; color: var(--ink-3); }
.staff-source .mono { color: var(--ink-2); }
.staff-emails-note { font-style: italic; }
.muted { color: var(--ink-3); font-weight: 400; }

/* offices */
.office {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-2);
}
.office .office-label {
  font: 600 11px var(--mono);
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.office.office-dc .office-label { color: var(--red); }
.office div { line-height: 1.5; }
.office .office-building { color: var(--ink-3); font-size: 12px; }
.office .office-contact { margin-top: 6px; font: 12px var(--mono); }

/* card photo img */
.card-photo { overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* drawer summary blocks */
.drawer-committees { margin: 12px 0; }
.drawer-committees .drawer-section-label { font: 600 10px var(--mono); letter-spacing: .08em; color: var(--ink-3); margin-bottom: 6px; text-transform: uppercase; }
.drawer-committees ul { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--ink-2); }
.drawer-committees li { padding: 3px 0; line-height: 1.4; }
.drawer-committees .rank { font: 600 10px var(--mono); color: var(--ink-3); margin-right: 6px; }
.drawer-committees .rank-chair { color: var(--red); }
.drawer-committees .rank-ranking-member, .drawer-committees .rank-vice-chair { color: var(--blue); }
.drawer-office { margin: 12px 0; font-size: 13px; color: var(--ink-2); }
.drawer-office .drawer-section-label { font: 600 10px var(--mono); letter-spacing: .08em; color: var(--red); margin-bottom: 6px; text-transform: uppercase; }
.drawer-office div { line-height: 1.5; }
.drawer-office a { font: 12px var(--mono); }

.drawer-social { margin: 12px 0; }
.drawer-social .drawer-section-label { font: 600 10px var(--mono); letter-spacing: .08em; color: var(--red); margin-bottom: 6px; text-transform: uppercase; }
.drawer-social-row { display: flex; gap: 14px; align-items: center; }
.drawer-social-row .social-icon { width: 20px; height: 20px; }

/* ===== v3 profile dossier: KPI strip, legislation, votes, finance ===== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-bottom: 24px;
}
.kpi-tile { background: var(--paper); padding: 16px 18px; }
.kpi-num { font: 800 26px/1 var(--sans); letter-spacing: -.02em; color: var(--ink); }
.kpi-label {
  font: 600 10px var(--mono); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 6px; line-height: 1.3;
}

.subhead {
  font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin: 18px 0 8px;
}
.subhead .muted { text-transform: none; letter-spacing: 0; }

/* legislation */
.legis-list { list-style: none; padding: 0; margin: 0; }
.legis-row {
  display: flex; gap: 14px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.legis-row:last-child { border-bottom: 0; }
.legis-bill {
  flex: 0 0 84px; font: 700 12px var(--mono); color: var(--blue);
  text-decoration: none; white-space: nowrap;
}
.legis-bill:hover { color: var(--red); }
.legis-main { flex: 1 1 auto; min-width: 0; }
.legis-title { font: 500 14px/1.35 var(--sans); color: var(--ink); text-decoration: none; }
a.legis-title:hover { color: var(--red); }
.legis-meta { font: 11px var(--mono); color: var(--ink-3); margin-top: 4px; line-height: 1.4; }
.legis-source, .vote-source, .finance-source { font: 11px var(--mono); color: var(--ink-3); margin-top: 12px; }

/* votes */
.vote-split {
  display: flex; height: 10px; width: 100%; margin: 4px 0 10px;
  background: var(--paper-2); overflow: hidden; border: 1px solid var(--rule);
}
.vote-seg { display: block; height: 100%; }
.vote-legend, .bar-legend {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px;
  padding: 0; margin: 0 0 14px; font: 11px var(--mono); color: var(--ink-2);
}
.vote-legend li, .bar-legend li { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; flex: 0 0 auto; display: inline-block; }
.seg-yea { background: #2e9e5b; }
.seg-nay { background: var(--red); }
.seg-present { background: #c98a18; }
.seg-missed { background: var(--ink-3); }

.vote-list { list-style: none; padding: 0; margin: 0; }
.vote-row {
  display: flex; gap: 12px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.vote-row:last-child { border-bottom: 0; }
.position {
  flex: 0 0 78px; font: 700 10px var(--mono); letter-spacing: .06em;
  text-transform: uppercase; text-align: center; padding: 3px 0; color: #fff;
}
.position-yea { background: #2e9e5b; }
.position-nay { background: var(--red); }
.position-present { background: #c98a18; }
.position-not-voting { background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--rule); }
.vote-main { flex: 1 1 auto; min-width: 0; }
.vote-desc { font: 500 14px/1.35 var(--sans); color: var(--ink); }
.vote-desc a.vote-link { color: var(--ink); text-decoration: none; }
.vote-desc a.vote-link:hover { color: var(--red); text-decoration: underline; }
.vote-meta { font: 11px var(--mono); color: var(--ink-3); margin-top: 4px; }

/* finance */
.finance-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-bottom: 18px;
}
.finance-stat { background: var(--paper); padding: 14px 16px; }
.finance-num { font: 800 20px/1 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.finance-lab {
  font: 600 10px var(--mono); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 6px;
}
.finance-comp { margin: 14px 0; }
.comp-head {
  font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px;
}
.bar {
  display: flex; height: 14px; width: 100%; overflow: hidden;
  border: 1px solid var(--rule); background: var(--paper-2); margin-bottom: 10px;
}
.bar-seg { display: block; height: 100%; }
.bar-val { color: var(--ink-3); }
.seg-small { background: #2e9e5b; }
.seg-large { background: var(--blue-lite); }
.seg-pac { background: #c98a18; }

@media (max-width: 560px) {
  .legis-bill { flex-basis: 64px; }
  .position { flex-basis: 64px; }
}

/* ===== hero actions: contact / social / external moved into hero-meta ===== */
.hero-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font: 12px var(--mono); }
.hero-contact a { color: var(--blue); }
.hero-contact a:hover { color: var(--red); }
.hero-social { gap: 6px 12px; }
.hero-social .social-link { color: var(--ink-2); }
.hero-social .social-link:hover { color: var(--red); }
.hero-social .social-icon { width: 19px; height: 19px; }
.hero-external { color: var(--ink-3); }
.hero-external a { color: var(--ink-3); position: relative; }
.hero-external a:not(:last-child)::after { content: "·"; position: absolute; right: -9px; color: var(--rule); }
.hero-external a:hover { color: var(--red); }

/* ===== compare: button + side-by-side overlay ===== */
.results-compare { border-color: var(--blue); color: var(--blue); }
.results-compare:hover:not(:disabled) { background: var(--blue); color: #fff; border-color: var(--blue); }

.compare-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--t-fast); }
.compare-overlay.is-open { opacity: 1; }
.compare-overlay[hidden] { display: none; }
.compare-backdrop { position: absolute; inset: 0; background: rgba(11,11,11,.55); }
.compare-panel {
  position: relative; background: var(--page); border: 1px solid var(--rule);
  width: min(1100px, 94vw); max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.35); transform: translateY(8px);
  transition: transform var(--t-fast);
}
.compare-overlay.is-open .compare-panel { transform: translateY(0); }
.compare-loading { padding: 48px; text-align: center; color: var(--ink-3); font: 13px var(--mono); }
.compare-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--rule); flex: 0 0 auto; }
.compare-head h2 { margin: 0; font: 700 18px var(--sans); color: var(--ink); }
.compare-head .muted { font: 400 13px var(--mono); color: var(--ink-3); }
.compare-close { background: none; border: 0; font-size: 18px; color: var(--ink-3); cursor: pointer; line-height: 1; padding: 4px; }
.compare-close:hover { color: var(--red); }
.compare-scroll { overflow: auto; padding: 4px; }

.compare-grid { display: grid; grid-template-columns: 132px repeat(var(--cmp-cols), minmax(150px, 1fr)); align-items: stretch; }
.cmp-cell { padding: 10px 12px; border-bottom: 1px solid var(--rule); min-width: 0; }
.cmp-rowlabel { font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); display: flex; flex-direction: column; gap: 2px; justify-content: center; background: var(--paper-2); position: sticky; left: 0; z-index: 1; }
.cmp-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-3); opacity: .8; }
.cmp-corner { background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.cmp-section { font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: var(--paper-2); border-bottom: 2px solid var(--rule); padding: 8px 12px; }
.cmp-value { font: 14px var(--sans); color: var(--ink-2); }
.cmp-lead { font-weight: 700; color: var(--ink); background: rgba(46,158,91,.10); }
.cmp-empty { color: var(--ink-3); }

.cmp-memhead { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; border-bottom: 2px solid var(--rule); }
.cmp-photo { width: 56px; height: 70px; background: var(--paper-2); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cmp-photo img { width: 100%; height: 100%; object-fit: cover; }
.cmp-mono { font: 700 20px var(--mono); color: var(--ink-3); }
.cmp-name { font: 700 14px/1.2 var(--sans); color: var(--ink); text-decoration: none; }
.cmp-name:hover { color: var(--red); }
.cmp-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.cmp-pills .pill { padding: 2px 7px; font-size: 10px; }
.cmp-sub { font: 11px var(--mono); color: var(--ink-3); }

.cmp-list { list-style: none; margin: 0; padding: 0; font: 12px/1.4 var(--sans); }
.cmp-list li { margin-bottom: 4px; }
.cmp-rank { font: 600 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--red); }
.cmp-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.cmp-tags .issue-tag { font: 10px var(--mono); color: #fff; background: var(--red); padding: 2px 6px; }

/* compare: head actions + trending-vote rows */
.compare-head-actions { display: flex; align-items: center; gap: 10px; }
.compare-copy { font: 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; background: var(--paper); border: 1px solid var(--blue); color: var(--blue); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.compare-copy:hover { background: var(--blue); color: #fff; }
.cmp-vote-label { background: var(--paper-2); position: sticky; left: 0; z-index: 1; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.cmp-vote-bill { font: 600 10px var(--mono); color: var(--blue); letter-spacing: .04em; }
.cmp-vote-title { font: 11px/1.3 var(--sans); color: var(--ink-2); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.cmp-vote-title:hover { color: var(--red); }
.cmp-vote-label .cmp-tags { margin-top: 2px; }
.cmp-vote-cell { display: flex; align-items: center; }
.cmp-vote-cell .position { flex: 0 0 auto; font-size: 10px; padding: 3px 9px; }
