/* Comfortable reading sizes shared by the voting pages and dashboard. */
:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  --muted: #566354;
}
body { font-size: 1rem; line-height: 1.6; }
h1, h2, h3, .polls-title, .stat-card strong, .poll-toolbar > p,
.verification-choice, .empty-state h3, .admin-header h1, .login-card h1,
.poll-card h3, .admin-poll h3 {
  font-family: inherit;
  font-style: normal;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
h2, .polls-title { font-size: clamp(1.8rem, 4vw, 2.25rem); }
p { overflow-wrap: break-word; }
.site-header {
  height: auto;
  min-height: 112px;
  flex-wrap: wrap;
  gap: 18px 24px;
  padding-top: 22px;
  padding-bottom: 22px;
}
.site-header .brand { display: block; position: relative; overflow: hidden; width: 240px; max-width: 100%; min-width: 0; aspect-ratio: 1790 / 604; flex-shrink: 0; font-size: 1.4rem; line-height: 1.3; }
.brand-mark { flex-shrink: 0; }
/* Frame the existing artwork's visible bounds, excluding transparent padding. */
.brand-logo { display: block; position: absolute; width: 121.17318436%; max-width: none; height: auto; left: -10.5027933%; top: -11.25827815%; aspect-ratio: 2169 / 725; object-fit: contain; }
.footer-brand { display: block; position: relative; overflow: hidden; width: 200px; min-width: 0; max-width: 100%; aspect-ratio: 1790 / 604; flex-shrink: 0; }
.brand-caption { margin-top: 0; font-size: 0.72rem; letter-spacing: 0.035em; line-height: 1.5; }
.site-header nav { font-size: 0.94rem; align-self: center; }
.site-header nav a { min-height: 44px; }
.site-header .nav-active::after { bottom: 0; }
.admin-link { font-size: 0.89rem; min-height: 46px; }
.site-header > .admin-link { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.admin-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.eyebrow, .section-heading .eyebrow {
  font-size: 0.78rem;
  line-height: 1.7;
  letter-spacing: 0.1em;
}
.section-heading > div > p:last-child { font-size: 1rem; color: var(--muted); max-width: none; }
.live-label { font-size: 0.84rem; color: #526448; }
.poll-toolbar { flex-wrap: wrap; gap: 10px 24px; }
.tabs { flex-wrap: wrap; gap: 8px 24px; }
.tab { font-size: 0.94rem; min-height: 48px; color: #58634f; }
.tab > span { font-size: 0.84rem; }
.poll-toolbar > p { font-size: 0.89rem; font-weight: 400; color: var(--muted); }
.poll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.poll-card { padding: 26px; }
.card-top { flex-wrap: wrap; gap: 12px; }
.category { font-size: 0.89rem; color: #536547; }
.badge, .account-row h3 .badge { font-size: 0.78rem; line-height: 1.5; padding: 5px 9px; }
.poll-number { font-size: 0.78rem; color: #64705b; letter-spacing: 0.07em; }
.poll-card h3, .admin-poll h3 { font-size: 1.45rem; min-height: 0; line-height: 1.4; }
.poll-description { font-size: 1rem; color: var(--muted); min-height: 0; line-height: 1.7; }
.vote-option { font-size: 1rem; min-height: 54px; padding: 13px 15px; color: #43543b; }
.custom-radio { width: 19px; height: 19px; }
.card-bottom { flex-wrap: wrap; gap: 14px; align-items: center; }
.result-note { font-size: 0.84rem; color: #59664f; }
.result-note > span { font-size: 1rem; }
.button, .vote-button, .admin-actions button, .admin-tools .button,
.accounts-section .button, .visibility-button, .text-button, .register-pagination button {
  font-size: 0.94rem;
  line-height: 1.5;
  min-height: 46px;
}
.vote-button { padding: 12px 16px; }
.vote-button:disabled { color: #4c613f; }
.card-error, .error-box, .toast { font-size: 0.94rem; line-height: 1.65; }
.results, .results > p, .result-row strong, .result-row small { font-size: 0.94rem; }
.results > p, .result-row small { color: var(--muted); }
.result-row > div { flex-wrap: wrap; gap: 6px 16px; }
progress { height: 9px; }
.empty-state { font-size: 1rem; color: var(--muted); padding: 36px 24px; }
.empty-state h3 { font-size: 1.4rem; }
.privacy-note { font-size: 0.89rem; color: var(--muted); line-height: 1.75; max-width: 1050px; }
.privacy-note strong { font-weight: 650; color: #43583a; }
.privacy-note svg { width: 21px; height: 21px; }
footer { font-size: 0.89rem; color: var(--muted); flex-wrap: wrap; gap: 16px 24px; }
.footer-brand { font-size: 1.1rem; }
.admin-header h1 { font-size: clamp(1.8rem, 4vw, 2.25rem); }
.admin-header p, .login-card > p, .admin-tools p, .account-explanation {
  font-size: 1rem; color: var(--muted); line-height: 1.7;
}
.login-card { max-width: 540px; }
.login-card h1 { font-size: 1.8rem; }
.form-field, #account-active-field { font-size: 0.94rem; }
.form-field input, .form-field textarea, .form-field select {
  font-size: 1rem;
  line-height: 1.5;
  min-height: 50px;
  min-width: 0;
}
.form-field small { font-size: 0.84rem; color: var(--muted); line-height: 1.7; }
.form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card span { font-size: 0.78rem; color: var(--muted); }
.stat-card strong { font-size: 2rem; }
.admin-poll { grid-template-columns: minmax(0, 1fr); }
.admin-poll .meta { font-size: 0.94rem; color: var(--muted); }
.admin-actions { flex-wrap: wrap; }
.admin-actions button { padding: 11px 15px; }
.visibility-control { flex-wrap: wrap; }
.visibility-control p { font-size: 0.94rem; color: var(--muted); }
.modal { max-width: 680px; max-height: 90vh; max-height: 90dvh; overflow: auto; }
.modal-heading { gap: 16px; align-items: flex-start; }
.modal-heading h2 { font-size: 1.5rem; }
.icon-button { width: 44px; min-width: 44px; height: 44px; font-size: 1.8rem; }
.form-actions { flex-wrap: wrap; gap: 12px; }
.form-actions .button { white-space: normal; }
.option-editor input { min-width: 0; }
.option-editor button { min-width: 44px; min-height: 44px; font-size: 1.5rem; }
.admin-notice, .verification-intro { font-size: 0.94rem; color: var(--muted); line-height: 1.7; }
.verification-choice { font-size: 1.1rem; line-height: 1.6; }
.declaration { font-size: 0.94rem; color: #43563c; line-height: 1.7; }
.declaration input { width: 22px; height: 22px; }
.verification-privacy { font-size: 0.84rem; color: var(--muted); line-height: 1.7; }
.voter-record h3 { font-size: 1.1rem; }
.voter-record p { font-size: 1rem; }
.voter-record small, .register-pagination > span { font-size: 0.84rem; color: var(--muted); }
.register-pagination { flex-wrap: wrap; }
.session-identity { font-size: 0.89rem; color: var(--muted); flex-wrap: wrap; }
.editor-limit { font-size: 0.84rem; color: var(--muted); max-width: 280px; }
.accounts-section h2 { font-size: 1.7rem; }
.account-row { flex-wrap: wrap; }
.account-row h3 { font-size: 1.05rem; }
.account-row p { font-size: 0.94rem; color: var(--muted); }
.account-status { font-size: 0.84rem; color: var(--muted); }

@media (max-width: 800px) {
  .poll-grid { grid-template-columns: minmax(0, 1fr); }
  .site-header { min-height: 100px; }
  .section-heading { flex-wrap: wrap; }
  .admin-tools { flex-wrap: wrap; align-items: flex-start; }
  .admin-tools p { max-width: none; }
  .accounts-section .admin-tools { align-items: flex-start; }
}
@media (max-width: 640px) {
  .site-header { padding: 20px 22px; gap: 16px; }
  .site-header .brand { width: 230px; font-size: 1.25rem; }
  .brand-caption { font-size: 0.68rem; }
  .site-header > .admin-link { margin-left: auto; }
  .polls-section { padding: 36px 22px; }
  .tab { font-size: 0.89rem; }
  .tabs { gap: 8px 16px; }
  .poll-card { padding: 22px; }
  .card-bottom { align-items: stretch; flex-direction: column; }
  .vote-button { justify-content: space-between; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .button { width: 100%; }
  .admin-stats { grid-template-columns: minmax(0, 1fr); }
  .stat-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
  .stat-card strong { margin: 0; }
  .admin-main { padding: 32px 22px; }
  .modal { padding: 22px; }
  .account-row { padding: 18px; }
  .toast { width: calc(100vw - 32px); }
}
@media (max-width: 380px) {
  .admin-main, .polls-section { padding-left: 18px; padding-right: 18px; }
  .poll-card { padding: 18px; }
  .modal { padding: 18px; }
}

/* Username-and-password sign-in and account forms. */
#login-form > .button { display: flex; width: 100%; margin-top: 22px; }
.alternative-signin { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.alternative-signin summary { cursor: pointer; font-size: 0.94rem; font-weight: 600; color: var(--forest); }
.alternative-signin p { font-size: 0.89rem; line-height: 1.7; color: var(--muted); }
.alternative-signin .button { width: 100%; gap: 12px; }
#account-password-fields { min-width: 0; }
#account-form input[readonly] { background: #edf1e6; color: #536448; }
#account-form select:disabled { color: #536448; opacity: 1; }

/* Exact street/house choices and numbered voter-register exports. */
.address-fields { border: 0; padding: 0; margin: 22px 0; min-width: 0; }
.address-fields > legend { padding: 0; font-size: 0.94rem; font-weight: 600; }
.address-fields .form-row { gap: 18px; }
.address-fields .form-field { min-width: 0; margin: 14px 0 8px; }
.address-fields select:disabled { color: #69765f; background: #edf1e6; opacity: 1; }
.address-status { font-size: 0.84rem; line-height: 1.7; color: var(--muted); margin: 8px 0 0; }
#address-error .text-button { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: underline; }
.register-export-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 18px 0; }
.register-export-controls p { flex: 1; min-width: 160px; margin: 0; font-size: 0.84rem; color: var(--muted); line-height: 1.7; }
.voter-number { color: var(--forest); font-weight: 750; margin-right: 0.2em; }
@media (max-width: 640px) {
  .address-fields .form-row { gap: 0; }
  .register-export-controls { align-items: stretch; flex-direction: column; }
  .register-export-controls .button { width: 100%; }
}

/* Per-poll house participation and legacy address review. */
.household-dialog { max-width: 940px; }
.households-poll-title { font-size: 1.05rem; font-weight: 650; line-height: 1.6; margin: 8px 0 16px; overflow-wrap: anywhere; }
.household-tools { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.household-summary { display: flex; align-items: center; gap: 30px; padding: 24px; margin: 24px 0; background: var(--sage); border-radius: 9px; }
.households-chart { flex: 0 0 180px; width: 180px; height: 180px; border-radius: 50%; background: conic-gradient(var(--forest) 0 var(--full-end, 0%), #89a56b var(--full-end, 0%) var(--one-end, 0%), #c18b38 var(--one-end, 0%) var(--review-end, 0%), #a34f42 var(--review-end, 0%) var(--over-end, 0%), #d3ddc6 var(--over-end, 0%) 100%); border: 1px solid #bccbb0; }
.households-chart.empty { background: #e5e8df; border-style: dashed; }
.household-totals { min-width: 0; }
.household-totals p { margin: 12px 0; font-size: 0.94rem; line-height: 1.6; }
.household-totals strong { font-size: 1.3rem; margin-right: 4px; }
.household-key { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 9px; vertical-align: middle; border: 1px solid #a6b59a; }
.household-key.voted, .household-key.two-votes { background: var(--forest); border-color: var(--forest); }
.household-key.one-vote { background: #89a56b; border-color: #78935d; }
.household-key.over-limit { background: #a34f42; border-color: #a34f42; }
.household-key.not-voted { background: #d3ddc6; }
.household-filters { margin-top: 24px; }
.household-filters .form-field { min-width: 0; }
.households-shown { font-size: 0.84rem; line-height: 1.7; color: var(--muted); }
.household-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.household-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.94rem; }
.household-table th, .household-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); line-height: 1.6; }
.household-table thead th { background: var(--sage); font-weight: 650; }
.household-table tbody th { font-weight: 500; }
.household-table tbody tr:last-child > * { border-bottom: 0; }
.household-status { display: inline-block; padding: 3px 9px; border-radius: 5px; white-space: nowrap; font-size: 0.84rem; font-weight: 600; }
.household-status.voted, .household-status.two-votes { background: #e3eddb; color: var(--forest); }
.household-status.one-vote { background: #eff1df; color: #4f6438; }
.household-status.over-limit { background: #f7e5df; color: #8a382d; }
.household-status.not-voted { background: #f0f1ed; color: #56614f; }
.household-record-count { display: block; margin-top: 6px; color: var(--muted); font-size: 0.78rem; }
.household-issues { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; margin: 24px 0; }
.household-issues h3 { font-size: 1.15rem; margin: 0 0 12px; }
.household-issue { border: 1px solid var(--line); border-radius: 7px; padding: 18px; margin: 16px 0; }
.household-issue h4 { font-size: 1rem; margin: 0 0 12px; }
.household-issue > p { font-size: 0.89rem; line-height: 1.7; overflow-wrap: anywhere; }
.household-correction .form-field { min-width: 0; }
.household-correction .form-row { gap: 18px; }
.household-correction select:disabled { background: #edf1e6; opacity: 1; color: #69765f; }
@media (max-width: 640px) {
  .household-summary { flex-direction: column; align-items: flex-start; padding: 20px; gap: 12px; }
  .households-chart { align-self: center; }
  .household-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .household-tools .button { padding: 12px; }
  .household-table th, .household-table td { padding: 12px 10px; font-size: 0.84rem; }
  .household-status { padding: 3px 7px; font-size: 0.78rem; }
  .household-correction .form-row { gap: 0; }
  .household-correction .button { width: 100%; }
}

.household-key.needs-review { background: #c18b38; border-color: #a47831; }
.household-status.needs-review { background: #f6ead5; color: #755016; }

.voter-record .address-correction-note { font-size: 0.84rem; color: var(--muted); line-height: 1.7; }

/* House counts and voting slots always use the active filters. */
.households-scope { font-size: 1rem; line-height: 1.6; margin: 12px 0; overflow-wrap: anywhere; }
.household-vote-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.household-vote-metrics > div { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 14px 16px; background: #fff; }
.household-vote-metrics dt { font-size: 0.84rem; line-height: 1.55; color: var(--muted); }
.household-vote-metrics dd { margin: 6px 0 0; font-size: 1.3rem; font-weight: 700; color: var(--forest); }
.household-vote-count { white-space: nowrap; }
.household-filters { margin-top: 16px; }
@media (max-width: 640px) {
 .household-vote-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
 .household-vote-metrics > div { padding: 12px; }
 .household-table { min-width: 490px; }
}

/* Keep filters and the chart visible together on standard phone screens. */
@media (min-width: 380px) and (max-width: 640px) {
 .household-dialog .household-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 10px; }
 .household-dialog .household-filters .form-field { width: auto; margin: 12px 0; }
 .household-dialog .household-filters select { padding-left: 10px; padding-right: 24px; }
 .household-summary { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: start; gap: 12px; padding: 14px 12px; margin: 16px 0; }
 .households-chart { width: 110px; height: 110px; align-self: start; margin-top: 6px; }
 .household-totals p { font-size: 0.89rem; line-height: 1.55; margin: 0 0 10px; }
 .household-totals p:last-child { margin-bottom: 0; }
 .household-totals strong { font-size: 1.1rem; }
 .household-key { width: 12px; height: 12px; margin-right: 5px; }
}

/* Street pie and breakdown keep street shares separate from participation rates. */
.household-chart-controls { margin-top: 4px; }
.street-chart-section { margin: 20px 0; padding: 22px; background: var(--sage); border-radius: 9px; }
.street-chart-section h4 { margin: 0 0 18px; font-size: 1.1rem; line-height: 1.5; }
.street-chart-overview { display: block; }
.street-chart-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; padding: 4px 0; }
.street-chart-scroll:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
.street-chart { width: 100%; min-width: 400px; max-width: 760px; height: auto; margin: 0 auto 18px; }
.street-pie-svg { display: block; width: 100%; height: auto; overflow: visible; }
.street-pie-slice { stroke: var(--sage); stroke-width: 1.4px; }
.street-pie-leader { stroke-width: 1.5px; stroke-linecap: round; stroke-linejoin: round; }
.street-pie-label text { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; }
.street-pie-label-street { font-weight: 750; }
.street-pie-label-detail { font-weight: 550; }
.street-pie-empty { fill: #e5e8df; stroke: #aebba5; stroke-width: 1.5px; stroke-dasharray: 5 4; }
.street-pie-empty-text { fill: #536448; font-size: 16px; font-family: system-ui, sans-serif; }
.street-chart-scroll-note { display: none; margin: 0 0 14px; font-size: 0.84rem; line-height: 1.6; color: var(--muted); }
.street-chart-caption { font-weight: 650; line-height: 1.6; margin: 0 0 12px; }
.street-chart-help { font-size: 0.89rem; line-height: 1.65; color: var(--muted); margin: 12px 0; }
.street-summary-wrap { margin-top: 20px; overflow-x: auto; border: 1px solid #bdcbb2; border-radius: 7px; background: #fff; }
.street-summary-table { width: 100%; min-width: 710px; border-collapse: collapse; text-align: left; font-size: 0.89rem; line-height: 1.6; }
.street-summary-table th, .street-summary-table td { padding: 12px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.street-summary-table thead th { background: #edf1e6; font-weight: 650; }
.street-summary-table tbody th { white-space: nowrap; font-weight: 650; }
.street-summary-table tbody tr:last-child > * { border-bottom: 0; }
.street-summary-table small { display: block; color: var(--muted); line-height: 1.65; margin-top: 4px; }
.street-chart-key { display: inline-block; width: 14px; height: 14px; margin-right: 7px; border-radius: 3px; vertical-align: -1px; border: 1px solid #819178; }
@media (max-width: 640px) {
 .street-chart-section { padding: 18px 14px; }
 .street-chart { width: 100%; height: auto; }
 .street-chart-scroll-note { display: block; }
 .street-summary-table th, .street-summary-table td { padding: 11px 12px; }
}
@media (min-width: 380px) and (max-width: 640px) {
 .household-dialog .household-chart-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
 .household-dialog .household-chart-controls .form-field { min-width: 0; margin: 12px 0; }
 .household-dialog .household-chart-controls select { padding-left: 10px; padding-right: 24px; }
}

/* Keep the shared brand and page content on the same horizontal guides. */
:root { --site-gutter: 56px; }
@media (max-width: 1000px) { :root { --site-gutter: 30px; } }
@media (max-width: 760px) { :root { --site-gutter: 22px; } }
@media (max-width: 380px) { :root { --site-gutter: 18px; } }
.site-header, footer, main.community-main, .polls-section, .admin-main {
  padding-inline: var(--site-gutter);
}
