:root {
  --paper: #fcfbf8;
  --ink: #253b32;
  --muted: #627068;
  --green: #28654f;
  --line: #dce2d9;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 17px/1.7 var(--sans); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--green); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; touch-action: manipulation; }
button { background: none; border: 0; }
button:disabled { cursor: default; opacity: .45; }
a, button, summary, select, input { -webkit-tap-highlight-color: #dce8de; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }
.wrap { width: min(100% - 64px, 920px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--ink); font-size: 24px; font-weight: 650; letter-spacing: -1px; text-decoration: none; }
.brand span { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.header-inner nav { display: flex; gap: 28px; font-size: 14px; }
.header-inner nav a { text-decoration: none; padding-block: 12px; }
.skip { position: absolute; left: 20px; top: -100px; padding: 10px 18px; background: white; z-index: 100; }
.skip:focus { top: 12px; }
.study-heading { padding-top: 72px; }
.eyebrow { color: var(--muted); font-size: 13px; letter-spacing: .08em; margin-bottom: 17px; }
h1 { font: 400 clamp(36px, 4.7vw, 58px)/1.13 var(--serif); letter-spacing: -.035em; text-wrap: balance; }
.lead { font-size: 22px; line-height: 1.55; margin-top: 20px; max-width: 650px; }
.edition { color: var(--muted); font-size: 13px; margin-top: 20px; }
.study-intro { margin: 37px 0 46px; max-width: 690px; }
.study-intro > p + p { margin-top: 22px; }
.review-note { font-size: 14px; color: var(--muted); }
.review-note strong { font-weight: 550; color: var(--ink); }
.review-note a { white-space: nowrap; }
.round-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 27px; }
.round-tabs button { padding: 12px 0; color: var(--muted); border-bottom: 2px solid transparent; }
.round-tabs button[aria-pressed=true] { color: var(--green); border-color: var(--green); font-weight: 600; }
.primary-controls { display: flex; flex-wrap: wrap; gap: 20px; }
.primary-controls > * { flex: 1; min-width: min(100%, 230px); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; color: var(--muted); }
select, input[type=date], input[type=text] { border: 1px solid #bac6ba; border-radius: 4px; background: transparent; padding: 10px 12px; width: 100%; min-width: 0; min-height: 46px; }
select { background-color: var(--paper); }
.disclosure { border-bottom: 1px solid var(--line); }
.disclosure > summary { min-height: 52px; padding: 16px 0; font-size: 14px; color: var(--green); list-style: none; display: flex; justify-content: space-between; gap: 15px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: '+'; font-size: 20px; line-height: 1.3; }
.disclosure[open] > summary::after { content: '−'; }
#advanced-filters { margin-top: 15px; }
.filter-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 8px 0 25px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; }
input[type=checkbox] { accent-color: var(--green); height: 18px; width: 18px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 0 22px; }
.text-link { color: var(--green); padding: 8px 0; text-align: left; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.chart-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin: 42px 0 26px; }
.chart-section-head h2 { font-size: 18px; font-weight: 500; }
#chart-summary { font-size: 13px; color: var(--muted); margin-top: 5px; }
.view-toggle { display: flex; gap: 12px; font-size: 13px; }
.view-toggle button { padding: 4px 0; min-height: 32px; color: var(--muted); }
.view-toggle button[aria-pressed=true] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.chart-card { min-width: 0; }
.chart-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.candidate-name { font: 400 30px/1.3 var(--serif); letter-spacing: -.02em; }
.candidate-badge { display: none; }
.candidate-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
.candidate-latest { text-align: right; flex-shrink: 0; }
.candidate-value { font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.candidate-value small { font-size: 17px; margin-left: 5px; }
.chart-svg { width: 100%; height: auto; display: block; margin: 22px 0 0; overflow: visible; touch-action: pan-y; }
.chart-gridline { stroke: #dce2d9; stroke-width: .8; }
.chart-label, .chart-axis-title { fill: #5d7064; font: 10px var(--sans); }
.chart-axis-title { font-size: 9px; }
.chart-stem { stroke: var(--candidate); stroke-width: 1.8; opacity: .65; }
.dot-mark { fill: var(--paper); stroke: var(--candidate); stroke-width: 1.8; }
.dot-mark.single { fill: var(--candidate); }
.dot-hit { fill: transparent; }
.dot-mark, .focus-ring { pointer-events: none; }
.focus-ring { fill: var(--candidate); opacity: 0; }
.dot-link:hover .focus-ring, .dot-link:focus .focus-ring { opacity: .2; }
.dot-link:focus .dot-mark { stroke-width: 3; }
.runoff-threshold { stroke: #718477; stroke-dasharray: 5 4; }
.chart-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; margin: 8px 0 20px; }
.chart-card-footer button { font-size: 12px; }
.chart-note { max-width: 680px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.chart-note strong { font-weight: 500; color: var(--ink); }
.sources-section { margin-top: 72px; }
.sources-section h2, .reading-notes h2 { font: 400 30px/1.3 var(--serif); margin-bottom: 20px; letter-spacing: -.02em; }
.sources-section > p { max-width: 700px; }
#source-records { margin: 20px 0; }
#source-records .text-link { margin: 14px 0; }
.small { color: var(--muted); font-size: 13px; line-height: 1.8; }
.reading-notes { margin: 62px 0 85px; max-width: 700px; }
.reading-notes > div { margin: 25px 0; }
.reading-notes h3 { font-weight: 550; font-size: 16px; margin-bottom: 7px; }
.reading-notes p { color: var(--muted); font-size: 15px; }
.reading-notes > a { font-size: 14px; }
.table-wrap { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
caption { text-align: left; padding-block: 15px; }
th { font-weight: 500; font-size: 12px; color: var(--muted); }
th, td { padding: 14px 15px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td { font-variant-numeric: tabular-nums; }
.cell-sub { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); max-width: 240px; min-width: 110px; }
.audit-chip { font-size: 12px; color: #896228; white-space: nowrap; }
.audit-chip.checked { color: var(--green); }
.error-note { color: #9b392d; font-size: 14px; margin-top: 16px; }
.empty-state { padding: 48px 0; text-align: center; }
.empty-state h3 { font: 26px var(--serif); margin-bottom: 15px; }
.empty-state p { color: var(--muted); font-size: 15px; }
.btn { display: inline-flex; padding: 12px 0; color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.tooltip { position: fixed; z-index: 90; max-width: min(340px, calc(100vw - 24px)); background: #243d31; color: white; padding: 17px 19px; font-size: 13px; line-height: 1.65; pointer-events: none; border-radius: 5px; }
.tip-title { display: flex; justify-content: space-between; gap: 20px; font-weight: 600; margin-bottom: 7px; }
.tip-muted { color: #d3e1d4; font-size: 12px; }
.tip-audit { color: #f5d5a1; }
.tip-rule { border-top: 1px solid #ffffff33; padding-top: 7px; margin-top: 7px; }
.data-dialog { width: min(940px, calc(100vw - 32px)); max-height: 85vh; border: 1px solid var(--line); border-radius: 6px; padding: 0; color: var(--ink); background: var(--paper); }
.data-dialog::backdrop { background: #23372a66; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 25px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 20px; }
.dialog-body { padding: 22px 25px; }
.dialog-body > p { font-size: 15px; margin-bottom: 20px; }
.icon-button { min-width: 44px; min-height: 44px; }
.icon-button svg { width: 20px; height: 20px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: white; padding: 12px 20px; font-size: 14px; width: max-content; max-width: calc(100vw - 32px); }
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding-block: 28px; color: var(--muted); font-size: 12px; }
.index-page { max-width: 680px; padding-block: 80px 120px; min-height: 58vh; }
.index-page h1 { font-size: 44px; margin-bottom: 40px; }
.study-entry { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding-block: 26px; border-top: 1px solid var(--line); text-decoration: none; }
.study-entry strong { font-weight: 500; font-size: 20px; }
.study-entry > span > span { display: block; font-size: 14px; color: var(--muted); margin-top: 7px; }
.study-entry > span:last-child { font-size: 22px; }
.article-page { max-width: 730px; padding-block: 42px 70px; }
.back-link { font-size: 14px; }
.prose-header { margin: 36px 0 48px; }
.prose-header h1 { font-size: 44px; }
.prose { font-size: 17px; line-height: 1.9; }
.prose h2 { font: 400 29px/1.4 var(--serif); margin: 40px 0 18px; }
.prose p, .prose ul { margin-bottom: 22px; }
.prose a { overflow-wrap: anywhere; }
.prose li { margin-bottom: 10px; }
.prose blockquote { border-left: 2px solid var(--green); padding-left: 22px; margin: 32px 0; }
.preview-note { text-align: center; font-size: 12px; padding: 7px; color: var(--muted); border-bottom: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media(max-width: 600px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 40px); }
  .header-inner { min-height: 76px; gap: 14px; }
  .brand { font-size: 22px; }
  .brand span { display: none; }
  .header-inner nav { gap: 18px; font-size: 13px; }
  .study-heading { padding-top: 46px; }
  .lead { font-size: 20px; margin-top: 18px; }
  .study-intro { margin: 28px 0 34px; }
  .review-note a { white-space: normal; }
  .round-tabs { gap: 25px; }
  .field select, .field input { font-size: 16px; }
  .filter-main { gap: 16px 12px; }
  .filter-main .field:nth-child(-n+2) { grid-column: 1/-1; }
  .chart-section-head { flex-direction: column; gap: 15px; margin-top: 30px; }
  .view-toggle button { min-height: 44px; }
  .candidate-name { font-size: 24px; }
  .candidate-value { font-size: 23px; }
  .candidate-sub { font-size: 11px; }
  .chart-card-head { gap: 12px; }
  .chart-svg { margin-top: 24px; }
  .chart-card-footer { align-items: flex-start; gap: 10px; }
  .chart-card-footer > * { max-width: 55%; }
  .chart-card-footer button { min-height: 44px; padding-top: 0; }
  .chart-note { font-size: 13px; }
  .sources-section { margin-top: 50px; }
  .reading-notes { margin-top: 44px; margin-bottom: 55px; }
  .sources-section h2, .reading-notes h2 { font-size: 28px; }
  .index-page { padding-block: 52px 85px; }
  .prose-header h1 { font-size: 36px; }
  .prose { font-size: 16px; }
  .dialog-body, .dialog-head { padding: 18px; }
}
@media(prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  body { background: white; }
  .site-header, .site-footer, .primary-controls, #advanced-filters, .view-toggle, .round-tabs, .tooltip, .toast, .chart-card-footer button { display: none; }
  .wrap { width: 100%; }
  .study-heading { padding-top: 0; }
  .chart-card { break-inside: avoid; }
}
