/* Nevada Politicians shared base stylesheet
 * Portal-agnostic layout + typography. Color tokens come from
 * portals/<name>/theme.css.
 *
 * GNOMEY 2026 standards: accessible (WCAG AA), self-hosted Inter +
 * Playfair Display at /fonts/, vanilla CSS only.
 */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007F, U+00A0-00FF, U+2000-206F, U+2070-209F;
}
@font-face {
  font-family: "Playfair Display";
  src: url("/fonts/playfair-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007F, U+00A0-00FF, U+2000-206F;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text, #1a1d22);
  background: var(--color-bg, #fafbfc);
}

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  margin: 1.5rem 0 0.75rem;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p { margin: 0.5rem 0 1rem; }

a { color: var(--color-link, #2851a3); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover, a:focus { color: var(--color-link-hover, #d4a017); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: #ffe;
  color: #000;
  outline: 3px solid #000;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.site-header .container { display: flex; align-items: center; gap: 1.5rem; }
.site-brand { font-size: 1.15rem; font-weight: 600; text-decoration: none; }
.site-nav { margin-left: auto; display: flex; gap: 1rem; flex-wrap: wrap; }
.site-nav a { color: inherit; text-decoration: none; padding: 0.25rem 0.5rem; }
.site-nav a:hover, .site-nav a:focus { text-decoration: underline; }
.tip-link { background: var(--color-brand-accent, #d4a017); color: #000; padding: 0.25rem 0.6rem; border-radius: 4px; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 0.3rem 0.7rem;
  font: inherit;
  cursor: pointer;
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-block; margin-left: auto; }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; }
  .site-nav.is-open { display: flex; }
}

main { padding: 1rem 0 4rem; }

.breadcrumb { font-size: 0.9rem; color: var(--color-muted, #6b7280); margin: 0 0 1rem; }
.breadcrumb a { color: inherit; }
.breadcrumb .sep { padding: 0 0.4rem; }

.politician-page { display: grid; gap: 2rem; grid-template-columns: 280px 1fr; align-items: start; }
@media (max-width: 800px) { .politician-page { grid-template-columns: 1fr; } }

.politician-rail {
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  padding: 1rem;
}
.politician-rail .photo,
.politician-rail .photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  background: var(--color-brand, #1c2128);
  color: #fff;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.politician-rail dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.75rem; font-size: 0.95rem; }
.politician-rail dt { color: var(--color-muted, #6b7280); }
.politician-rail dd { margin: 0; }

.politician-body section { margin-bottom: 2rem; }
.politician-body h2 { border-bottom: 2px solid var(--color-border, #e5e7eb); padding-bottom: 0.25rem; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-stub { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }
.badge-stale { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; }

.kv-table { width: 100%; border-collapse: collapse; }
.kv-table th, .kv-table td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--color-border, #e5e7eb); font-size: 0.95rem; }
.kv-table th { background: #f3f4f6; font-weight: 600; }

.also-on {
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-left: 4px solid var(--color-brand-accent, #d4a017);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin: 2rem 0;
  font-size: 0.95rem;
}
.also-on h3 { margin-top: 0; font-size: 1rem; }

.references ol { margin: 0; padding-left: 1.5rem; }
.references li { margin-bottom: 0.4rem; font-size: 0.9rem; }

.site-footer {
  background: var(--color-brand, #1c2128);
  color: #d1d5db;
  padding: 2rem 0 1rem;
  margin-top: 4rem;
}
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.footer-grid h4 { color: #fff; margin-top: 0; font-size: 1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.4rem; font-size: 0.9rem; }
.footer-bottom { border-top: 1px solid #4b5563; padding-top: 1rem; margin-top: 1.5rem; font-size: 0.85rem; color: #9ca3af; }
.footer-bottom a { color: #d1d5db; }

/* --- Homepage layout --- */

.page-hero {
  background: linear-gradient(180deg, var(--color-card, #fff) 0%, var(--color-bg, #fafbfc) 100%);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  padding: 2.5rem 0 2rem;
  text-align: center;
}
.page-hero h1 { margin: 0 0 0.5rem; font-size: 2.4rem; }
.hero-lede { max-width: 780px; margin: 0 auto 1.5rem; font-size: 1.1rem; }
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--color-brand, #1c2128);
  border-radius: 4px;
  text-decoration: none;
  color: var(--color-brand, #1c2128);
  background: var(--color-card, #fff);
  font-weight: 600;
}
.btn:hover, .btn:focus { background: var(--color-brand-accent, #d4a017); color: #000; }
.btn-primary {
  background: var(--color-brand, #1c2128);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus { background: var(--color-brand-accent, #d4a017); color: #000; }

.stat-section { margin: 2.5rem 0; }
.stat-section h2 { border-bottom: 2px solid var(--color-border, #e5e7eb); padding-bottom: 0.25rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.stat-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.1s, transform 0.1s;
}
.stat-card:hover, .stat-card:focus {
  border-color: var(--color-brand-accent, #d4a017);
  transform: translateY(-1px);
}
.stat-num {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-brand, #1c2128);
}
.stat-label { font-size: 0.95rem; color: var(--color-muted, #6b7280); margin-top: 0.25rem; }

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.spotlight-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-left: 4px solid var(--color-brand-accent, #d4a017);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
}
.spotlight-card:hover, .spotlight-card:focus {
  border-left-color: var(--color-brand, #1c2128);
}
.spotlight-name { font-weight: 700; font-size: 1.1rem; }
.spotlight-office { color: var(--color-muted, #6b7280); font-size: 0.9rem; margin-top: 0.25rem; }
.spotlight-party { font-size: 0.85rem; margin-top: 0.5rem; }

/* --- Footnotes (used by per-politician bios) --- */
.footnotes {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
  font-size: 0.85rem;
  color: var(--color-muted, #6b7280);
}
.footnote-ref { text-decoration: none; padding: 0 0.1rem; }
.footnote-ref:hover, .footnote-ref:focus { background: var(--color-brand-accent, #d4a017); color: #000; border-radius: 2px; }

/* --- Quality badges --- */
.quality-row { margin-bottom: 1rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* --- Header search --- */
.header-search { position: relative; flex: 0 1 280px; }
.header-search input {
  width: 100%;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
}
.header-search input::placeholder { color: rgba(255,255,255,0.7); }
.header-search input:focus {
  outline: 2px solid var(--color-brand-accent, #d4a017);
  background: rgba(255,255,255,0.95);
  color: var(--color-text, #1a1d22);
}
#np-search-results {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 0;
  list-style: none;
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 100;
}
#np-search-results li { border-bottom: 1px solid var(--color-border, #e5e7eb); }
#np-search-results li:last-child { border-bottom: 0; }
#np-search-results a {
  display: block;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
  color: var(--color-text, #1a1d22);
}
#np-search-results a:hover, #np-search-results a:focus {
  background: var(--color-brand-accent, #d4a017);
  color: #000;
}
.np-search-name { display: block; font-weight: 600; }
.np-search-meta { display: block; font-size: 0.8rem; color: var(--color-muted, #6b7280); }
.np-search-empty { padding: 0.6rem 0.8rem; color: var(--color-muted, #6b7280); }
@media (max-width: 720px) {
  .header-search { flex: 1 1 100%; order: 99; margin-top: 0.5rem; }
}

/* --- Roster filter controls --- */
.roster-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.filter-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--color-muted, #6b7280);
  flex: 1 1 200px;
}
.filter-label input,
.filter-label select {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 4px;
  background: #fff;
  color: var(--color-text, #1a1d22);
}
.filter-label input:focus,
.filter-label select:focus {
  outline: 2px solid var(--color-brand-accent, #d4a017);
  border-color: var(--color-brand, #1c2128);
}
#filter-count { align-self: center; padding-bottom: 0.5rem; }

/* --- Vote-agreement matrix --- */
.agreement-matrix { border-collapse: collapse; font-size: 0.7rem; }
.agreement-matrix th, .agreement-matrix td {
  border: 1px solid var(--color-border, #e5e7eb);
  padding: 0.15rem 0.3rem;
  text-align: center;
  white-space: nowrap;
}
.agreement-matrix th.sticky-col {
  position: sticky; left: 0;
  background: var(--color-card, #fff);
  text-align: left;
  z-index: 2;
  min-width: 200px;
}
.agreement-matrix th.rot {
  height: 130px; vertical-align: bottom;
  position: relative;
  min-width: 18px; max-width: 18px;
}
.agreement-matrix th.rot > div {
  transform: rotate(-90deg);
  white-space: nowrap;
  width: 18px;
  text-align: left;
  position: absolute;
  bottom: 4px; left: 0;
}
.agreement-matrix th.rot a { color: inherit; text-decoration: none; }
.agreement-matrix .cell-high { background: #c6efce; color: #0a4f1c; }
.agreement-matrix .cell-mid  { background: #fff2cc; color: #74570a; }
.agreement-matrix .cell-low  { background: #ffc7ce; color: #800009; }
.agreement-matrix .cell-na   { color: var(--color-muted, #6b7280); background: #fafafa; }
.agreement-matrix .diag { background: #1c2128; color: #1c2128; }

/* --- Auditor research leads --- */
.auditor-flags {
  background: #fffbeb;
  border-left: 4px solid #d97706;
  padding: 1rem 1.25rem;
  border-radius: 4px;
}
.auditor-flags h2 { margin-top: 0; color: #92400e; }
.auditor-flags h3 { color: #92400e; }
.auditor-flags table { background: #fff; }
.auditor-flags code { background: #fef3c7; padding: 0.05rem 0.3rem; border-radius: 2px; font-size: 0.95em; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- Topic chips on politician rail --- */
.topic-chip {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  margin: 0.1rem 0.2rem 0.1rem 0;
  font-size: 0.8rem;
  background: var(--color-card-bg, #f3f4f6);
  border: 1px solid var(--color-muted-bg, #d1d5db);
  border-radius: 999px;
  color: var(--color-text, #374151);
}

.warn-text {
  color: #b45309;
}

.elections-summary-chip {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.electoral-sparkline {
  margin: 0.5rem 0 1rem;
  max-width: 320px;
}
.electoral-sparkline figcaption {
  font-size: 0.78rem;
  color: #4b5563;
  margin-bottom: 0.25rem;
}
.electoral-sparkline .trendline {
  stroke: #1f2937;
  stroke-width: 1.5;
  fill: none;
}
.electoral-sparkline .win-dot { fill: #16a34a; }
.electoral-sparkline .loss-dot { fill: #dc2626; }
.electoral-sparkline .ref50 { stroke: #9ca3af; }
.electoral-sparkline .ref50-label { fill: #6b7280; font-size: 9px; }
.electoral-sparkline .yr { fill: #6b7280; font-size: 9px; }

.badge-competitive {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  font-size: 0.72rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-weight: 600;
}

.badge-winner {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  font-size: 0.72rem;
  background: #d1fae5;
  color: #065f46;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 0.3rem;
}

.industry-chip {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #3730a3;
  white-space: nowrap;
  vertical-align: 1px;
}

.qr-link {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-muted-bg, #d1d5db);
  font-size: 0.85rem;
}

.bill-outcome {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  border-left: 4px solid #6b7280;
  background: #f3f4f6;
  border-radius: 4px;
}
.bill-outcome-green { border-left-color: #16a34a; background: #f0fdf4; }
.bill-outcome-yellow { border-left-color: #ca8a04; background: #fefce8; }
.bill-outcome-red { border-left-color: #dc2626; background: #fef2f2; }
.bill-outcome-gray { border-left-color: #6b7280; background: #f3f4f6; }

.wayback-link {
  font-size: 0.78rem;
  color: #4b5563;
  text-decoration: none;
  border-bottom: 1px dotted #6b7280;
  margin-left: 0.25rem;
}
.wayback-link:hover, .wayback-link:focus-visible {
  color: #1f2937;
  border-bottom-style: solid;
}

.anomaly-watch {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--color-card-bg, #f9fafb);
  border-left: 4px solid var(--color-accent, #3730a3);
  border-radius: 4px;
}
.anomaly-watch .cta {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--color-accent, #3730a3);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
}
.anomaly-watch .cta:hover,
.anomaly-watch .cta:focus-visible {
  background: var(--color-accent-hover, #4338ca);
}
@media print { .anomaly-watch { display: none; } }
.qr-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.qr-link img {
  border: 1px solid var(--color-muted-bg, #d1d5db);
  background: #fff;
  padding: 2px;
}
@media print {
  .qr-link img { width: 120px; height: 120px; }
}

/* --- Bill flags (fiscal-effect badges) --- */
.bill-flags { margin: 0.5rem 0 1rem; }
.bill-flags .badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  margin-right: 0.4rem;
  font-size: 0.85rem;
  border-radius: 4px;
}
.badge-fiscal { background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; }
.badge-unfunded { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.bill-title {
  font-style: italic;
  color: var(--color-muted, #6b7280);
  margin: 0.5rem 0 1rem;
  border-left: 3px solid var(--color-brand-accent, #d4a017);
  padding-left: 0.75rem;
}

/* --- NRS reference hover-cards — visual styling for abbr.nrs-ref --- */
abbr.nrs-ref {
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  cursor: help;
  font-style: normal;
  text-transform: none;
}
abbr.nrs-ref:hover, abbr.nrs-ref:focus {
  background: var(--color-card-bg, #fef3c7);
  outline: 1px solid var(--color-brand-accent, #d4a017);
}

/* --- Mobile responsive: tables wrap with horizontal scroll on narrow screens
       so wide auditor-flag / scoreboard / agreement-matrix tables don't push
       the layout offscreen. Wrapper allows horizontal scroll while content
       stays readable. --- */
@media (max-width: 720px) {
  /* Wrap any kv-table in a scroll container at narrow widths */
  .kv-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: normal;
  }
  .kv-table thead, .kv-table tbody, .kv-table tr {
    display: table;
    width: 100%;
    table-layout: auto;
  }
  /* Compare-table specifically: stacks to single-column on narrow screens */
  .compare-table {
    font-size: 0.85rem;
  }
  .compare-table th, .compare-table td {
    padding: 0.3rem 0.4rem;
    font-size: 0.85rem;
  }
  /* Agreement matrix on narrow screens — keep horizontal scroll, shrink cells */
  .agreement-matrix { font-size: 0.65rem; }
  .agreement-matrix td { padding: 1px 2px; min-width: 14px; }
  /* Roster controls stack vertically */
  .roster-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .filter-label, .filter-label input, .filter-label select {
    width: 100%;
  }
  /* Page-header headings shrink */
  .page-header h1 { font-size: 1.5rem; }
  .page-header h2 { font-size: 1.1rem; }
  .hero-lede { font-size: 1rem; }
  /* Politician profile photo doesn't dominate viewport */
  .photo, .politician-rail img.photo { max-width: 200px; }
  /* Compare controls collapse to single column */
  .compare-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .compare-controls label { width: 100%; }
  /* FOIA letter pre — wrap long lines instead of horizontal scroll */
  .foia-letter { white-space: pre-wrap; word-break: break-word; font-size: 0.85rem; }
  /* Footer wraps */
  .site-footer ul { flex-direction: column; gap: 0.3rem; }
}

/* iPhone SE / 320px specific tweaks */
@media (max-width: 374px) {
  body { font-size: 0.95rem; }
  .page-header h1 { font-size: 1.3rem; }
  .kv-table th, .kv-table td { padding: 0.3rem 0.4rem; font-size: 0.8rem; }
  .breadcrumb { font-size: 0.8rem; }
}

/* --- Print stylesheet — paper output for journalists, hearings prep --- */
@media print {
  /* Hide chrome */
  .site-header, .site-nav, .header-search, .skip-link,
  .site-footer, .nav-toggle, .breadcrumb,
  .roster-controls, .compare-controls,
  #cmp-out, .scoreboard, .filter-label,
  .agreement-matrix { display: none !important; }

  body {
    color: #000;
    background: #fff;
    font-size: 10pt;
    line-height: 1.4;
  }
  main { max-width: 100%; padding: 0; }
  h1 { font-size: 18pt; }
  h2 { font-size: 14pt; page-break-after: avoid; }
  h3 { font-size: 12pt; page-break-after: avoid; }
  table { page-break-inside: avoid; border-collapse: collapse; width: 100%; }
  table, th, td { border: 1px solid #999; padding: 2pt 4pt; }
  thead { background: #eee; }
  /* Show hyperlink targets after the link text per W3C print best practice */
  a[href]:after { content: " (" attr(href) ")"; font-size: 8pt; color: #666; }
  a[href^="#"]:after,
  a[href^="javascript:"]:after,
  a[href^="mailto:"]:after { content: ""; }
  .photo, .thumb { max-width: 80pt; height: auto; }
  .photo-placeholder, .thumb-placeholder { display: none; }
  .auditor-flags {
    border-left: 2pt solid #000;
    padding-left: 0.5em;
    background: none;
    page-break-inside: avoid;
  }
  .footnotes { font-size: 9pt; color: #444; }
  .fundraising-sparkline svg { max-width: 4in; }
  /* Force page break before key sections */
  #campaign-finance, #legislative, #auditor-flags {
    page-break-before: auto;
    break-before: auto;
  }
}

/* --- Fundraising sparkline --- */
.fundraising-sparkline {
  margin: 1rem 0 1.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-card-bg, #f9fafb);
  border-left: 3px solid var(--color-brand-accent, #d4a017);
  border-radius: 2px;
}
.fundraising-sparkline figcaption {
  font-size: 0.85rem;
  color: var(--color-muted, #6b7280);
  margin-bottom: 0.4rem;
}
.fundraising-sparkline svg { width: 100%; max-width: 480px; height: auto; display: block; }
.fundraising-sparkline rect { fill: var(--color-link, #2851a3); }
.fundraising-sparkline rect.peak { fill: var(--color-brand-accent, #d4a017); }
.fundraising-sparkline rect:hover { fill: var(--color-link-hover, #1c3a73); }
.fundraising-sparkline text.yr {
  font-size: 9px;
  fill: var(--color-muted, #6b7280);
  font-family: ui-monospace, "Cascadia Mono", monospace;
}

/* --- Roster + leaderboard portrait thumbnails --- */
.thumb-cell { width: 44px; padding: 0.25rem 0.5rem; }
.thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--color-muted-bg, #e5e7eb);
}
.thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: #6b7280;
  user-select: none;
}
.thumb-placeholder.party-Republican { background: #b91c1c; }
.thumb-placeholder.party-Democratic { background: #1d4ed8; }
.thumb-placeholder.party-other { background: #6b7280; }

/* --- WCAG 2.4.7 Focus Visible — global fallback for any focusable element
   without an element-specific focus rule. Ensures keyboard users see a
   visible focus ring on every interactive control. --- */
:focus-visible {
  outline: 2px solid var(--color-brand-accent, #d4a017);
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-brand-accent, #d4a017);
  outline-offset: 2px;
}
