*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --font-ui: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, Cambria, "Times New Roman", serif;
    --jpcc-navy: #062135;
    --jpcc-blue: #0a314d;
    --jpcc-gold: #c1a783;
    --jpcc-red: #760b1d;
    --jpcc-red-dark: #5d0816;
    --text: #152536;
    --muted: #5d6b78;
    --line: #d7dee6;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --page-bg: #f4f7fa;
}

html {
    min-height: 100%;
    background: var(--jpcc-navy);
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--page-bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: var(--jpcc-blue);
    font-weight: 600;
    text-decoration: none;
}

a:hover {
    color: var(--jpcc-red);
    text-decoration: underline;
}

a img {
    border: 0;
}

p, ol, ul {
    margin-top: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--jpcc-navy);
    font-family: var(--font-serif);
    line-height: 1.15;
    margin: 0 0 10px;
}

h1 {
    font-size: 1.9rem;
    font-weight: 600;
}

h2 {
    font-size: 1.45rem;
    font-weight: 600;
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.clear {
    clear: both;
}

.bold {
    font-weight: 700;
}

.page {
    background: var(--page-bg);
    min-height: calc(100vh - 48px);
}

.header {
    background: linear-gradient(135deg, var(--jpcc-blue) 0%, var(--jpcc-navy) 100%);
    border-bottom: 4px solid var(--jpcc-gold);
    color: #fff;
}

.title {
    align-items: center;
    display: flex;
    gap: 14px;
    margin: 0 auto;
    max-width: 1180px;
    min-height: 112px;
    padding: 12px 28px;
}

.site-logo {
    align-items: center;
    display: flex;
    flex: 0 0 88px;
    height: 88px;
    justify-content: center;
    width: 88px;
}

.site-logo img {
    display: block;
    height: 88px;
    width: 88px;
}

.site-header-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.title h1 {
    color: #fff;
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.08;
    margin: 0;
}

.site-official,
.site-subtitle {
    color: var(--jpcc-gold);
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.25;
    margin-top: 6px;
}

.main {
    margin: 0 auto;
    max-width: 1180px;
    min-height: 420px;
    padding: 22px 28px 34px;
}

.main > table:first-child,
form + div,
#divElectionOffice,
#divOffice,
#divCandidates,
#divVoterDemographic {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(6, 33, 53, 0.08);
    margin-bottom: 14px;
}

.main > table:first-child {
    border-left: 4px solid var(--jpcc-gold);
    width: 100%;
}

#divElectionOffice,
#divOffice,
#divCandidates,
#divVoterDemographic {
    padding: 0;
    overflow-x: auto;
}

#divCandidateChart,
#voterPartyChart,
#voterRaceChart {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(6, 33, 53, 0.08);
    margin: 12px 0;
    padding: 10px;
}

.footer {
    background: var(--jpcc-navy);
    border-top: 3px solid var(--jpcc-gold);
    min-height: 44px;
}

.election-filter {
    margin: 0 0 16px;
}

.election-filter-table {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 4px solid var(--jpcc-gold);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(6, 33, 53, 0.08);
    overflow: hidden;
    width: 100%;
}

.election-filter-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    vertical-align: middle;
}

.election-filter-table tr:last-child td {
    border-bottom: 0;
}

.filter-label {
    color: var(--jpcc-blue);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.official-results-link {
    color: var(--jpcc-blue);
    display: inline-flex;
    font-weight: 800;
}

.results-alert {
    background: rgba(193, 167, 131, 0.14);
    border: 1px solid rgba(193, 167, 131, 0.45);
    border-radius: 4px;
    color: var(--jpcc-navy);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.45;
    margin-top: 10px;
    padding: 8px 10px;
}

.results-alert-signup {
    margin-top: 6px;
}

.jeffalerts-link {
    color: var(--jpcc-blue);
    font-weight: 800;
    text-decoration: underline;
}

.jeffalerts-link:hover {
    color: var(--jpcc-red);
}

.date-select select,
.year-select select {
    min-width: 120px;
}

.election-office-list {
    background: transparent;
    border: 0;
    box-shadow: none;
    margin-bottom: 18px;
}

.election-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.election-group {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(6, 33, 53, 0.08);
    overflow: hidden;
}

.election-group-header {
    align-items: center;
    background: linear-gradient(135deg, var(--jpcc-blue) 0%, var(--jpcc-navy) 100%);
    border-bottom: 3px solid var(--jpcc-gold);
    color: #fff;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 15px 16px;
}

.election-group-kicker {
    color: var(--jpcc-gold);
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.election-group h2 {
    color: #fff;
    font-size: 1.35rem;
    margin: 0;
}

.election-group h2 a {
    color: #fff;
    font-weight: 500;
}

.election-summary-link {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 4px;
    color: #fff;
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 7px 10px;
    text-transform: uppercase;
}

.election-summary-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

.election-header-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.office-link-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.office-nav-row {
    align-items: center;
    border-bottom: 1px solid var(--line);
    border-left: 4px solid transparent;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 54px;
    padding: 10px 14px 10px 12px;
}

.office-nav-row:nth-child(even) {
    background: var(--panel-soft);
}

.office-nav-row:last-child {
    border-bottom: 0;
}

.office-nav-row:hover {
    background: #eef3f7;
    border-left-color: var(--jpcc-gold);
}

.office-link {
    align-items: center;
    color: var(--jpcc-blue);
    display: flex;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.office-link:hover {
    color: var(--jpcc-red);
    text-decoration: none;
}

.office-nav-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.office-nav-actions a {
    align-items: center;
    background: #fff;
    border: 1px solid #b7c4d0;
    border-radius: 4px;
    color: var(--jpcc-blue);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    min-height: 30px;
    padding: 5px 8px;
    text-transform: uppercase;
}

.office-nav-actions a:hover {
    background: var(--jpcc-red);
    border-color: var(--jpcc-red);
    color: #fff;
    text-decoration: none;
}

.result-message {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--jpcc-gold);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(6, 33, 53, 0.08);
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
}

.result-message strong {
    color: var(--jpcc-navy);
}

.precinct-results,
.nonreporting-results {
    margin-bottom: 16px;
}

.precinct-summary-card,
.nonreporting-card,
.precinct-section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(6, 33, 53, 0.08);
    margin-bottom: 16px;
    overflow: hidden;
}

.precinct-summary-card {
    padding: 0;
}

.precinct-summary-header {
    border-bottom: 3px solid var(--jpcc-gold);
}

.precinct-summary-card h2,
.precinct-summary-card .result-office-header h2 {
    color: #fff;
    font-size: 1.35rem;
    margin: 0;
}

.precinct-summary-meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.86rem;
    font-weight: 700;
    gap: 8px 18px;
    padding: 13px 16px;
}

.precinct-summary-meta span {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 5px 8px;
}

.precinct-section .section-panel-header,
.nonreporting-card .section-panel-header {
    border-bottom: 3px solid var(--jpcc-gold);
}

.table-scroll-note {
    background: var(--panel-soft);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 14px;
}

.precinct-table-wrap {
    background: var(--panel);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
}

.precinct-results-table,
.nonreporting-table {
    border: 0;
    border-collapse: collapse;
    color: var(--text);
    font-size: 0.84rem;
    min-width: 980px;
    width: 100%;
}

.precinct-results-table {
    border-collapse: separate;
    border-spacing: 0;
}

.precinct-results-table th,
.precinct-results-table td,
.nonreporting-table th,
.nonreporting-table td {
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    vertical-align: top;
}

.precinct-results-table th,
.nonreporting-table th {
    background: var(--jpcc-blue);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.precinct-results-table .precinct-candidate-header th.candidate-col-odd,
.precinct-results-table .precinct-subhead-row th.candidate-col-odd {
    background: #0d3f63 !important;
}

.precinct-results-table .precinct-candidate-header th.candidate-col-even,
.precinct-results-table .precinct-subhead-row th.candidate-col-even {
    background: #123553 !important;
}

.precinct-results-table .candidate-col-odd {
    background: #f6f9fc !important;
}

.precinct-results-table .candidate-col-even {
    background: #e9f0f6 !important;
}

.precinct-results-table .candidate-subhead {
    border-bottom-color: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}

.precinct-results-table .precinct-total-row .candidate-col-odd {
    background: #f1f6fa !important;
}

.precinct-results-table .precinct-total-row .candidate-col-even {
    background: #dde8f1 !important;
}

.precinct-results-table tr:hover td {
    background: #eef3f7 !important;
}

.precinct-results-table .precinct-candidate-header th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.precinct-results-table thead th,
.precinct-results-table thead td {
    position: sticky;
    z-index: 6;
}

.precinct-results-table .precinct-candidate-header th {
    top: 0;
}

.precinct-results-table .precinct-subhead-row th {
    top: 38px;
}

.precinct-results-table .precinct-total-row th,
.precinct-results-table .precinct-total-row td {
    top: 76px;
}

.precinct-results-table .precinct-total-row th,
.precinct-results-table .precinct-total-row td {
    border-bottom: 2px solid var(--jpcc-gold);
    font-weight: 800;
}

.precinct-code-cell {
    background: #fff !important;
    border-left: 8px solid var(--jpcc-gold);
    font-weight: 800;
    white-space: nowrap;
    width: 5.5ch;
}

.precinct-code-cell a {
    color: var(--jpcc-blue);
}

.precinct-empty-cell {
    background: var(--panel-soft) !important;
    color: var(--muted);
    font-weight: 700;
    padding: 16px !important;
    text-align: center;
}

.precinct-sticky-col {
    min-width: 5.5ch;
    width: 5.5ch;
}

.precinct-results-table .precinct-sticky-col,
.precinct-results-table .precinct-code-cell {
    left: 0;
    position: sticky;
    z-index: 3;
}

.precinct-results-table th.precinct-sticky-col {
    background: var(--jpcc-blue) !important;
    box-shadow: 2px 0 0 rgba(6, 33, 53, 0.14);
    z-index: 8;
}

.precinct-results-table td.precinct-code-cell {
    box-shadow: 2px 0 0 rgba(6, 33, 53, 0.08);
    z-index: 4;
}

.nonreporting-card .precinct-table-wrap {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.nonreporting-table {
    min-width: 1050px;
}

.nonreporting-table tbody tr:nth-child(even) td {
    background: var(--panel-soft);
}

.status-not-reporting {
    background: #fff1f3;
    border: 1px solid #e8b7bf;
    border-radius: 3px;
    color: var(--jpcc-red);
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    padding: 4px 6px;
}

.precinct-location {
    border-left: 8px solid #b7c4d0;
    font-weight: 800;
    white-space: nowrap;
}

.location-1 {
    border-left-color: #0a7952;
}

.location-2,
.location-3 {
    border-left-color: #5d6b78;
}

.location-4,
.location-5 {
    border-left-color: var(--jpcc-gold);
}

.results-toolbar {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 4px solid var(--jpcc-gold);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(6, 33, 53, 0.08);
    margin-bottom: 16px;
    width: 100%;
}

.results-toolbar td {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
}

.results-toolbar tr:last-child td {
    border-bottom: 0;
}

.kiosk-toolbar {
    margin-bottom: 12px;
}

.kiosk-status {
    align-items: center;
    background: #f5f0e8;
    border: 1px solid #e0d1ba;
    border-left: 4px solid var(--jpcc-gold);
    border-radius: 6px;
    color: var(--jpcc-blue);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.86rem;
    font-weight: 800;
    gap: 8px 18px;
    margin-bottom: 16px;
    padding: 10px 14px;
}

.kiosk-results-list {
    gap: 20px;
}

.kiosk-office-card .result-office-header h2 {
    font-size: 1.35rem;
}

.kiosk-candidate-table th {
    font-size: 0.78rem;
}

.kiosk-candidate-table td {
    font-size: 1rem;
}

.toolbar-action {
    align-items: center;
    border: 1px solid #b7c4d0;
    border-radius: 4px;
    color: var(--jpcc-blue);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    min-height: 32px;
    padding: 6px 10px;
    text-transform: uppercase;
}

.toolbar-action:hover {
    background: #eef3f7;
    border-color: var(--jpcc-blue);
    color: var(--jpcc-red);
    text-decoration: none;
}

.last-refresh {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: right;
}

.election-results-list {
    background: transparent;
    border: 0;
    box-shadow: none;
    margin-bottom: 14px;
    overflow: visible;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-office-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(6, 33, 53, 0.08);
    overflow: hidden;
}

.result-office-header {
    align-items: center;
    background: linear-gradient(135deg, var(--jpcc-blue) 0%, var(--jpcc-navy) 100%);
    border-bottom: 3px solid var(--jpcc-gold);
    color: #fff;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 14px 16px;
}

.result-office-kicker {
    color: var(--jpcc-gold);
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.result-office-header h2 {
    color: #fff;
    font-size: 1.18rem;
    margin: 0;
}

.result-office-header h2 a {
    color: #fff;
    font-weight: 500;
}

.result-map-link {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 4px;
    color: #fff;
    flex: 0 0 auto;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 7px 10px;
    text-transform: uppercase;
}

.result-map-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

.result-office-meta {
    align-items: center;
    background: var(--panel-soft);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.84rem;
    font-weight: 700;
    gap: 8px 16px;
    padding: 11px 16px;
}

.result-office-meta.is-complete {
    background: #f5f0e8;
}

.result-office-meta a {
    color: var(--jpcc-blue);
}

.candidate-results-table {
    border: 0;
    margin: 0;
    table-layout: fixed;
    width: 100%;
}

.candidate-results-table th {
    background: #f3f6f9 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    color: var(--jpcc-blue) !important;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 9px 12px;
    text-transform: uppercase;
}

.candidate-results-table th:nth-child(2) {
    text-align: right;
}

.candidate-results-table th:nth-child(3) {
    padding-left: 70px !important;
    text-align: left;
}

.candidate-results-table td {
    border-bottom: 1px solid #e5ebf0;
    padding: 10px 12px;
}

.candidate-results-table tbody tr:nth-child(even) td {
    background: var(--panel-soft);
}

.candidate-results-table tbody tr:hover td {
    background: #eef3f7;
}

.candidate-results-table tr:last-child td {
    border-bottom: 0;
}

.candidate-name {
    color: var(--text);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.vote-count {
    color: var(--jpcc-navy);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    padding-right: 18px !important;
    text-align: right;
    width: 120px;
}

.vote-percent {
    padding-left: 18px !important;
    width: 38%;
}

.candidate-results-table th:nth-child(2),
.candidate-results-table td:nth-child(2) {
    width: 128px;
}

.candidate-results-table th:nth-child(3),
.candidate-results-table td:nth-child(3) {
    width: 38%;
}

.map-note {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    margin: 10px 2px 0;
}

.office-detail-results,
.office-voter-demographics {
    background: transparent;
    border: 0;
    box-shadow: none;
    margin-bottom: 16px;
    overflow: visible;
}

.office-detail-card,
.voter-demographic-card,
.chart-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(6, 33, 53, 0.08);
    overflow: hidden;
}

.precinct-detail-page {
    background: var(--background);
    color: var(--text);
    font-family: var(--font-sans);
    margin: 0;
}

.standalone-page-shell {
    margin: 0 auto;
    max-width: 1280px;
    padding: 18px 24px 28px;
}

.precinct-detail-summary {
    margin-bottom: 16px;
}

.precinct-detail-summary .precinct-summary-meta {
    padding: 12px 16px;
}

.precinct-detail-card {
    margin-bottom: 16px;
}

.office-detail-table,
.demographic-table {
    margin: 0;
}

.demographic-table th:nth-child(2),
.demographic-table td:nth-child(2) {
    color: var(--jpcc-navy);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    padding-right: 18px !important;
    text-align: right;
    width: 128px;
}

.demographic-table th:nth-child(2) {
    padding-right: 18px !important;
}

.demographic-table th:nth-child(3),
.demographic-table td:nth-child(3) {
    padding-left: 18px !important;
    text-align: left;
    width: 38%;
}

.office-result-totals {
    align-items: center;
    background: var(--panel-soft);
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.86rem;
    font-weight: 700;
    gap: 10px 20px;
    padding: 12px 16px;
}

.section-panel-header,
.chart-panel-header {
    background: linear-gradient(135deg, var(--jpcc-blue) 0%, var(--jpcc-navy) 100%);
    border-bottom: 3px solid var(--jpcc-gold);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 12px 16px;
    text-transform: uppercase;
}

.chart-panel {
    margin-bottom: 16px;
}

.chart-panel-wide {
    width: 100%;
}

.chart-surface {
    height: 320px;
    padding: 10px;
    width: 100%;
}

.chart-surface-wide {
    height: 500px;
}

.chart-surface canvas {
    display: block;
    height: 100% !important;
    width: 100% !important;
}

.chart-empty-state {
    align-items: center;
    background: #f8fafc;
    border: 1px dashed #b7c4d0;
    border-radius: 6px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    font-weight: 700;
    gap: 5px;
    height: 100%;
    justify-content: center;
    min-height: 240px;
    padding: 20px;
    text-align: center;
}

.chart-empty-state strong {
    color: var(--jpcc-navy);
    font-family: var(--font-serif);
    font-size: 1.1rem;
}

.chart-note {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    margin: -6px 2px 16px;
}

.demographic-chart-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.office-detail-card,
.voter-demographic-card,
.result-office-card,
.precinct-section,
.nonreporting-card,
.chart-panel {
    max-width: 100%;
}

#divCandidates.office-detail-results,
#divVoterDemographic.office-voter-demographics {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

#divCandidates .candidate-results-table,
#divVoterDemographic .candidate-results-table {
    width: 100%;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

td, th {
    padding: 8px 10px;
    vertical-align: top;
}

th {
    text-align: left;
}

.main table {
    color: var(--text);
}

.main th,
#divElectionOffice th,
#divOffice th,
#divCandidates th,
#divVoterDemographic th {
    background: var(--jpcc-blue) !important;
    border: 1px solid var(--jpcc-navy) !important;
    color: #fff !important;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.main th a,
#divElectionOffice th a,
#divOffice th a,
#divCandidates th a,
#divVoterDemographic th a {
    color: #fff !important;
}

.main table tr:nth-child(even) td {
    background: var(--panel-soft);
}

.main table tr:hover td {
    background: #eef3f7;
}

.main table table tr:nth-child(even) td,
.main table table tr:hover td {
    background: transparent;
}

.main table table td {
    padding: 6px 8px;
}

#divOffice.election-results-list {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

#divOffice .candidate-results-table th {
    background: #f3f6f9 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    color: var(--jpcc-blue) !important;
}

#divOffice .candidate-results-table tbody tr:nth-child(even) td {
    background: var(--panel-soft) !important;
}

#divOffice .candidate-results-table tbody tr:hover td {
    background: #eef3f7 !important;
}

#divOffice .candidate-results-table tr:last-child td {
    border-bottom: 0;
}

input[type="text"],
input[type="password"],
select,
textarea {
    background: #fff;
    border: 1px solid #b7c4d0;
    border-radius: 4px;
    color: var(--text);
    min-height: 34px;
    padding: 6px 9px;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: var(--jpcc-blue);
    box-shadow: 0 0 0 2px rgba(10, 49, 77, 0.15);
    outline: 0;
}

input[type="submit"],
input[type="button"],
button,
.submitButton {
    background: var(--jpcc-red);
    border: 1px solid var(--jpcc-red);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    min-height: 34px;
    padding: 7px 16px;
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
    background: var(--jpcc-red-dark);
}

fieldset {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    margin: 1em 0;
    padding: 1em;
}

legend {
    color: var(--jpcc-blue);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 2px 4px 8px;
    text-transform: uppercase;
}

fieldset.login label,
fieldset.register label,
fieldset.changePassword label {
    display: block;
}

input.textEntry,
input.passwordEntry {
    width: min(320px, 100%);
}

div.accountInfo {
    width: min(42rem, 100%);
}

.failureNotification {
    color: var(--jpcc-red);
    font-size: 1rem;
    font-weight: 700;
}

.barOuter {
    background: #f3f6f9;
    border: 1px solid #b7c4d0;
    border-radius: 4px;
    height: 22px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.barInner {
    background: linear-gradient(90deg, var(--jpcc-red) 0%, #9b2637 100%);
    color: #fff;
    height: 100%;
    min-width: 0;
    overflow: visible;
}

.barMetric {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 76px minmax(140px, 1fr);
}

.barValue {
    color: var(--jpcc-navy);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.loginDisplay {
    color: #d9e5ec;
    font-size: 0.85rem;
    padding: 0 24px 12px;
    text-align: right;
}

.loginDisplay a {
    color: #fff;
}

div.hideSkiplink,
div.menu {
    background: var(--jpcc-blue);
}

div.menu {
    padding: 0 18px;
}

div.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

div.menu ul li {
    display: inline-block;
}

div.menu ul li a,
div.menu ul li a:visited {
    color: #fff;
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 14px;
    text-decoration: none;
    white-space: nowrap;
}

div.menu ul li a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

@media (max-width: 850px) {
    body {
        font-size: 13px;
    }

    .title {
        align-items: flex-start;
        gap: 12px;
        min-height: 0;
        padding: 14px 16px;
    }

    .site-logo {
        flex-basis: 64px;
        height: 64px;
        width: 64px;
    }

    .site-logo img {
        height: 64px;
        width: 64px;
    }

    .title h1 {
        font-size: 1.42rem;
    }

    .site-official,
    .site-subtitle {
        font-size: 0.92rem;
    }

    .main {
        padding: 14px 12px 22px;
    }

    .results-toolbar,
    .election-filter-table {
        display: block;
        overflow: hidden;
    }

    .results-toolbar tbody,
    .results-toolbar tr,
    .results-toolbar td,
    .election-filter-table tbody,
    .election-filter-table tr,
    .election-filter-table td {
        display: block;
        width: 100%;
    }

    .results-toolbar td,
    .election-filter-table td {
        border-bottom: 1px solid var(--line);
    }

    .results-toolbar tr:last-child td:last-child,
    .election-filter-table tr:last-child td:last-child {
        border-bottom: 0;
    }

    .last-refresh {
        text-align: left;
    }

    .toolbar-action {
        justify-content: center;
        width: 100%;
    }

    .date-select select,
    .year-select select,
    #cmdSubmit {
        width: 100%;
    }

    .main > table:first-child,
    form + div,
    #divElectionOffice,
    #divOffice,
    #divCandidates,
    #divVoterDemographic {
        border-radius: 4px;
    }

    input[type="text"],
    input[type="password"],
    select,
    textarea,
    input[type="submit"],
    input[type="button"],
    button {
        max-width: 100%;
    }

    #divOffice.election-results-list,
    #divCandidates.office-detail-results,
    #divVoterDemographic.office-voter-demographics {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    #divOffice .candidate-results-table,
    #divCandidates .candidate-results-table,
    #divVoterDemographic .candidate-results-table {
        min-width: 640px;
    }

    .precinct-table-wrap {
        max-width: 100%;
        overflow-x: auto;
    }

    .precinct-results-table,
    .nonreporting-table {
        min-width: 760px;
    }

    .result-office-header,
    .election-group-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .election-header-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .office-nav-row {
        align-items: stretch;
        grid-template-columns: minmax(0, 1fr);
    }

    .office-nav-actions {
        justify-content: flex-start;
    }

    .office-nav-actions a {
        flex: 1 1 120px;
        justify-content: center;
    }

    .demographic-chart-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .chart-surface,
    .chart-surface-wide {
        height: 360px;
        min-width: 0;
        padding: 8px;
    }

    .chart-note {
        margin-top: -4px;
    }

    .barMetric {
        grid-template-columns: 72px minmax(120px, 1fr);
    }

    .candidate-results-table th:nth-child(3) {
        padding-left: 64px !important;
    }
}

@media (max-width: 520px) {
    .title {
        flex-direction: column;
    }

    .site-header-text {
        width: 100%;
    }

    .candidate-results-table th,
    .candidate-results-table td,
    .precinct-results-table th,
    .precinct-results-table td,
    .nonreporting-table th,
    .nonreporting-table td {
        padding-left: 8px;
        padding-right: 8px;
    }

    .chart-surface,
    .chart-surface-wide {
        height: 390px;
    }
}
