@font-face {
    font-family: "Inter";
    src: url("/static/fonts/InterVariable.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

/* Keep the landing page content aligned to a readable desktop width. */
.index-page .site-footer__inner,
.index-page .site-footer__about {
    width: min(1080px, calc(100% - 40px));
}

@font-face {
    font-family: "Inter";
    src: url("/static/fonts/InterVariable-Italic.woff2") format("woff2");
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --am-blue-tint: #002E6D14;
    --am-red-tint: #C8102E0A;
    --am-blue-strong: #002E6D;
    --am-red-strong: #C8102E;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #002E6D14;
    color: #183e3d;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.sync-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: #0f224099;
}

.sync-overlay[hidden] {
    display: none;
}

.sync-card {
    min-width: 170px;
    padding: 22px 28px;
    border: 1px solid #FFFFFF66;
    border-radius: 14px;
    background: #FFFFFFF2;
    box-shadow: 0 18px 45px #10263D40;
    color: var(--am-blue-strong);
    text-align: center;
    font-size: 1.15rem;
}

.sync-dots::after {
    content: "";
    display: inline-block;
    width: 1.35em;
    text-align: left;
    animation: sync-dots 1.2s steps(4, end) infinite;
}

@keyframes sync-dots {
    0% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75%, 100% { content: "..."; }
}

body.result-page {
    min-height: 100vh;
    background: #002E6D14;
}

.result-container {
    background: transparent;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 28px 20px 48px;
    border-radius: 0;
}

button, input, select {
    font: inherit;
}

.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 900;
    background: linear-gradient(90deg, #C8102E 0%, #8b1030 34%, #002E6D 100%);
    border-bottom: 0;
    border-radius: 0 0 25px 25px;
    box-shadow: 0 12px 28px #002E6D2E, 0 4px 10px #00000026;
}

.topbar-page {
    padding-top: 84px;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-width: 0;
}

.controle-turno {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.turno-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.turno-option .turno-badge {
    display: inline-block;
    border: 1px solid #FFFFFF;
    background: transparent;
    color: #FFFFFF;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.turno-option .turno-badge:hover,
.turno-option .turno-badge:focus-visible,
.turno-option .turno-badge.is-active {
    border-color: #FFFFFF;
    background: #FFFFFF;
    color: #002E6D;
}

.second-round-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 18px;
}

.second-round-card h2 {
    margin-top: 0;
}

.second-round-cargo-nav {
    margin-left: auto;
}

.second-round-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.second-round-card__header p {
    margin: 0 0 14px;
    color: #526174;
}

.second-round-card__header small {
    color: #526174;
    text-align: right;
}

.second-round-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #F4F7FB;
}

.second-round-summary div {
    display: grid;
    gap: 3px;
}

.second-round-summary dt {
    color: #526174;
    font-size: 0.8rem;
}

.second-round-summary dd {
    margin: 0;
    color: var(--am-blue-900, #002E6D);
    font-weight: 800;
}

.second-round-candidates {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.second-round-candidate {
    cursor: default;
}

.second-round-dashboard__main {
    width: min(1740px, calc(100% - 36px));
    margin: 30px auto 44px;
}

.second-round-demo-notice {
    margin: 0 0 14px;
    padding: 11px 14px;
    border: 1px solid #edc66f;
    border-radius: 10px;
    background: #fff8e7;
    color: #694b0b;
    font-size: 0.88rem;
    font-weight: 800;
}

.second-round-notice-test {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #8da9c2;
    border-radius: 12px;
    background: #fff;
}

.second-round-notice-test > div:first-child > strong {
    color: #183e3d;
}

.second-round-notice-test p {
    margin: 4px 0 0;
    color: #607184;
    font-size: 0.82rem;
}

.second-round-notice-test__controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.second-round-notice-test__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #cbd7e0;
    border-radius: 9px;
    background: #f7f9fc;
    color: #183e3d;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.second-round-notice-test__button:hover {
    border-color: #8da9c2;
    background: #edf3f8;
}

.second-round-notice-test__button:focus-visible {
    outline: 3px solid #2f7d4a;
    outline-offset: 2px;
}

.second-round-dashboard__context,
.second-round-visual-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.second-round-dashboard__context {
    display: flex;
    flex-wrap: wrap;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #dce4eb;
    border-radius: 10px;
    background: #f7f9fc;
}

.second-round-dashboard__context p {
    display: flex;
    flex: 1 1 150px;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
    gap: 4px;
    margin: 0;
    color: #536579;
    font-size: 0.9rem;
    font-weight: 650;
}

.second-round-dashboard__context form {
    flex: 0 0 auto;
    margin-left: auto;
}

.second-round-visual-heading p {
    margin: 0;
    color: #536579;
}

.second-round-scope-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.second-round-scope-tabs button {
    min-height: 40px;
    padding: 8px 18px;
    border: 1px solid #cbd7e2;
    border-radius: 999px;
    background: #fff;
    color: #24415b;
    cursor: pointer;
    font-weight: 750;
}

.second-round-scope-tabs button[aria-pressed="true"] {
    border-color: #14558a;
    background: #14558a;
    color: #fff;
}

.second-round-scope-tabs button:focus-visible {
    outline: 3px solid #f2b544;
    outline-offset: 2px;
}

.second-round-dashboard__layout {
    display: grid;
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.second-round-dashboard__results,
.second-round-dashboard__visuals {
    display: grid;
    min-width: 0;
    gap: 14px;
}

.second-round-dashboard__results .second-round-card {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.second-round-dashboard .second-round-summary {
    display: block;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    background: #F4F7FB;
}

.second-round-summary__toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    padding: 12px 14px;
    color: var(--am-blue-900, #002E6D);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 800;
    list-style: none;
}

.second-round-summary__toggle::-webkit-details-marker {
    display: none;
}

.second-round-summary__chevron {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

.second-round-summary[open] > .second-round-summary__toggle .second-round-summary__chevron {
    transform: translateY(2px) rotate(225deg);
}

.second-round-summary__toggle:focus-visible {
    outline: 3px solid #f2b544;
    outline-offset: -3px;
}

.second-round-summary__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin: 0;
    padding: 0 14px 14px;
}

.second-round-summary__overview {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #F4F7FB;
}

.second-round-summary__overview--waiting {
    color: #68788A;
    font-size: 0.82rem;
}

.second-round-summary__updated-at > span {
    display: block;
    margin-bottom: 3px;
    color: #526174;
    font-size: 0.76rem;
    font-weight: 700;
}

.second-round-summary__updated-at small {
    display: block;
    color: #68788A;
    font-size: 0.76rem;
    line-height: 1.4;
}

.second-round-dashboard .second-round-summary__content > .second-round-summary__live-status {
    display: none;
}

.second-round-summary__live-status {
    flex-basis: 100%;
}

.second-round-summary__status-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.second-round-dashboard .second-round-summary__live-status dd {
    margin: 0;
}

.second-round-dashboard .second-round-summary__voting-metrics {
    min-width: 0;
}

.second-round-dashboard .second-round-summary__voting-metrics > dd {
    margin: 0;
}

.second-round-summary__updated-at {
    display: block;
}

.second-round-summary__sections {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    color: #344b62;
    font-size: 0.8rem;
}

.second-round-summary__sections strong {
    color: var(--am-blue-900, #002E6D);
    font-weight: 800;
    text-align: right;
}

.second-round-totalization-progress {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    overflow: hidden;
    border-radius: 999px;
    background: #dce4eb;
}

.second-round-totalization-progress > span {
    position: absolute;
    inset: 0 auto 0 0;
    background: #9EB735;
    transition: width 240ms ease;
}

.second-round-totalization-progress strong {
    position: relative;
    z-index: 1;
    padding: 0 8px;
    border-radius: 999px;
    background: #fff;
    color: #002E6D;
    font-size: 0.75rem;
    line-height: 1;
    white-space: nowrap;
}

.second-round-summary__voting-metrics > dd > dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.second-round-summary__voting-metrics > dd > dl > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 7px 8px;
    border-radius: 8px;
    background: #fff;
}

.second-round-summary__voting-metrics > dd > dl dt {
    color: #526174;
    font-size: 0.76rem;
}

.second-round-summary__voting-metrics > dd > dl dd {
    margin: 0;
    color: var(--am-blue-900, #002E6D);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: right;
}

.second-round-summary__voting-metrics > dd > dl dd span {
    color: #68788A;
    font-size: 0.7rem;
    font-weight: 600;
}

@media (min-width: 601px) {
    .second-round-summary__voting-metrics > dd > dl > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
        min-width: 0;
    }

    .second-round-summary__voting-metrics > dd > dl dt,
    .second-round-summary__voting-metrics > dd > dl dd {
        min-width: 0;
    }

    .second-round-summary__voting-metrics > dd > dl dd {
        overflow-wrap: anywhere;
        text-align: left;
    }
}

.second-round-dashboard .second-round-summary__live-status small {
    display: block;
    padding-left: 8px;
    border-left: 3px solid #2772a8;
    color: #68788A;
    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.4;
}

.second-round-dashboard .second-round-summary__live-status small[data-state="falha"] {
    border-left-color: #a43d35;
    color: #7f302a;
}

.second-round-dashboard .second-round-summary__live-status small[data-state="parcial"],
.second-round-dashboard .second-round-summary__live-status small[data-state="coletando"] {
    border-left-color: #c48116;
    color: #74500e;
}

.second-round-dashboard .second-round-summary__live-status small[data-state="totalizada"] {
    border-left-color: #2a9d68;
    color: #286344;
}

@media (prefers-reduced-motion: reduce) {
    .second-round-totalization-progress > span {
        transition: none;
    }
}

.second-round-dashboard__results .second-round-candidates {
    grid-template-columns: minmax(0, 1fr);
}

.second-round-candidates__scope {
    margin: 0 0 -6px;
    color: #536579;
    font-size: 0.88rem;
    font-weight: 750;
}

.vote-difference {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    color: #43566a;
    font-size: 0.82rem;
    font-weight: 750;
}

.vote-difference__arrows {
    display: flex;
    flex-direction: column;
    color: var(--am-blue-700, #14558a);
    font-size: 0.72rem;
    line-height: 0.65;
}

.second-round-vote-difference {
    margin-top: -5px;
    margin-bottom: -5px;
}

.map-detail__vote-difference {
    padding: 6px 0;
    border-block: 1px solid #e5eaf0;
}

.second-round-map-panel,
.second-round-chart-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dce4eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 18px #10263d0b;
}

.second-round-map-panel {
    padding: 12px;
}

.second-round-visual-heading {
    min-height: 44px;
    padding: 2px 4px 10px;
}

.second-round-visual-heading h2 {
    margin: 0 0 4px;
    color: var(--am-slate-900);
    font-size: 1.05rem;
}

.second-round-visual-heading p {
    font-size: 0.82rem;
}

.second-round-live-tag {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    color: #536579;
    font-size: 0.76rem;
}

.second-round-live-tag i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2a9d68;
    box-shadow: 0 0 0 3px #2a9d681c;
}

#second-round-map {
    display: block;
    width: 100%;
    height: 900px;
    border: 0;
    background: #fff;
}

.second-round-chart-panel {
    padding: 14px 16px 10px;
}

.second-round-reversal {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff3d9;
    color: #7b4d00;
    font-size: 0.78rem;
    font-weight: 800;
}

.second-round-dashboard [hidden] {
    display: none !important;
}

.second-round-chart-wrap {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

#second-round-chart {
    display: block;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: visible;
}

.second-round-chart__grid {
    stroke: #dce3e9;
    stroke-width: 1;
}

.second-round-chart__axis {
    fill: #405469;
    font-size: 14px;
}

.second-round-chart__line {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.second-round-chart__point {
    stroke: #fff;
    stroke-width: 2;
}

.second-round-chart__end-label {
    font-size: 14px;
    font-weight: 800;
}

.second-round-chart__initial {
    fill: #243b53;
    font-size: 18px;
    font-weight: 800;
}

.second-round-chart-note {
    margin: 5px 2px 0;
    color: #687b8e;
    font-size: 0.75rem;
    line-height: 1.45;
}

.map-page--embedded .map-page__main {
    width: 100%;
    margin: 0;
}

.result-page.topbar-page.map-page--embedded {
    min-height: 0;
    padding-top: 0;
}

.map-page--embedded .map-heading {
    display: none;
}

.map-page--embedded .map-scope-candidates {
    display: none;
}

.map-page--embedded #map-live-status {
    display: none;
}

.map-page--embedded #map-detail {
    display: none;
}

.map-page--embedded .map-workspace {
    grid-template-columns: minmax(0, 1fr) 190px;
}

@media (min-width: 768px) {
    .map-page--embedded .map-workspace {
        align-items: stretch;
    }

    .map-page--embedded .map-locality-panel {
        display: flex;
        flex-direction: column;
    }

    .map-page--embedded .map-locality-panel ul {
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
    }
}

@media (max-width: 767px) {
    .map-page--embedded .map-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .second-round-live-tag {
        padding-left: 4px;
    }

    .map-page--embedded .map-visual-card__header span {
        max-width: none;
        text-align: left;
    }

    .map-page--embedded .map-visual-card__scope,
    .map-page--embedded #map-progress {
        font-size: 0.72rem;
        line-height: 1.25;
    }

    .map-page--embedded .map-locality-panel__heading p {
        margin-bottom: 8px;
        line-height: 1.25;
    }

    .map-page--embedded .map-locality-panel ul {
        grid-template-columns: minmax(0, 1fr);
        max-height: 230px;
    }
}

.second-round-dashboard .index-header-context {
    display: flex;
}

.second-round-dashboard .second-round-candidate,
.second-round-dashboard .second-round-candidate .candidate-main,
.second-round-dashboard .second-round-candidate .candidate-body {
    min-width: 0;
}

.second-round-dashboard .second-round-candidate {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
    min-height: 0;
}

.second-round-dashboard .second-round-candidate::before {
    background: var(--candidate-color, #002E6D);
}

.second-round-dashboard .second-round-candidate .candidate-progress-ring::before {
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--candidate-color, #002E6D);
    content: "";
}

.second-round-dashboard .second-round-candidate .candidate-progress-ring .candidate-photo {
    z-index: 1;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.second-round-dashboard .second-round-candidate .candidate-progress-ring .candidate-photo--flavio {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.second-round-dashboard .second-round-candidate .candidate-main {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
}

.second-round-dashboard .second-round-candidate .candidate-figure--progress,
.second-round-dashboard .second-round-candidate .candidate-progress-ring {
    width: 76px;
    height: 76px;
}

.second-round-dashboard .second-round-candidate .candidate-progress-ring {
    --progress-ring-end-radius: 35.5px;
}

.second-round-dashboard .second-round-candidate .candidate-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.second-round-dashboard .second-round-candidate .candidate-body h3 {
    max-width: 100%;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
}

.second-round-dashboard .second-round-candidate .candidate-side {
    min-width: 0;
    align-items: flex-end;
    width: 100%;
}

.second-round-dashboard .second-round-candidate .majoritarian-vote-summary {
    font-size: 1.7rem;
}

.second-round-dashboard .second-round-candidate-status {
    margin-top: 5px;
}

.second-round-dashboard .second-round-candidate .candidate-status {
    margin-top: 5px;
}

.second-round-dashboard .second-round-candidate-status .status-pill {
    display: inline-flex;
    min-width: 0;
    padding: 4px 9px;
    font-size: 0.72rem;
    line-height: 1.2;
}

@media (max-width: 640px) {
    .second-round-card__header {
        flex-direction: column;
    }

    .second-round-card__header small {
        text-align: left;
    }
}

@media (max-width: 1100px) {
    .second-round-dashboard__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .second-round-dashboard__results .second-round-candidates {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    }

    #second-round-map {
        height: 640px;
    }
}

@media (max-width: 600px) {
    .second-round-dashboard__context {
        align-items: center;
        flex-direction: row;
    }

    .second-round-summary__voting-metrics > dd > dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .second-round-summary__voting-metrics > dd > dl > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
        padding: 6px;
    }

    .second-round-summary__voting-metrics > dd > dl dt {
        font-size: 0.68rem;
        line-height: 1.2;
    }

    .second-round-summary__voting-metrics > dd > dl dd {
        min-width: 0;
        overflow-wrap: anywhere;
        text-align: left;
    }

    .second-round-dashboard__main {
        width: min(100% - 24px, 1740px);
        margin-top: 20px;
    }

    .second-round-visual-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .second-round-dashboard .second-round-candidate .candidate-main {
        grid-template-columns: clamp(48px, calc(20vw - 16px), 64px) minmax(0, 1fr);
        gap: 6px;
    }

    .second-round-dashboard .second-round-candidate .candidate-figure--progress,
    .second-round-dashboard .second-round-candidate .candidate-progress-ring {
        width: clamp(48px, calc(20vw - 16px), 64px);
        height: clamp(48px, calc(20vw - 16px), 64px);
    }

    .second-round-dashboard .second-round-candidate .candidate-progress-ring {
        --progress-ring-end-radius: clamp(21.5px, calc(10vw - 10.5px), 29.5px);
    }

    .second-round-dashboard .second-round-candidate .candidate-body h3 {
        font-size: clamp(0.7rem, 3.2vw, 0.82rem);
        overflow-wrap: anywhere;
    }

    .second-round-dashboard .second-round-candidate .majoritarian-vote-summary {
        font-size: clamp(1.35rem, 6vw, 1.7rem);
    }

    .second-round-dashboard__context {
        flex-direction: row;
    }

    .second-round-map-panel,
    .second-round-chart-panel {
        padding: 10px;
    }

    #second-round-map {
        height: 540px;
    }
}

@media (max-width: 360px) {
    .second-round-dashboard .second-round-candidate {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    }

    .second-round-dashboard .second-round-candidate .candidate-main {
        grid-template-columns: clamp(48px, calc(20vw - 16px), 64px) minmax(0, 1fr);
        gap: 6px;
    }

    .second-round-dashboard .second-round-candidate .candidate-figure--progress,
    .second-round-dashboard .second-round-candidate .candidate-progress-ring {
        width: clamp(48px, calc(20vw - 16px), 64px);
        height: clamp(48px, calc(20vw - 16px), 64px);
    }

    .second-round-dashboard .second-round-candidate .candidate-progress-ring {
        --progress-ring-end-radius: clamp(21.5px, calc(10vw - 10.5px), 29.5px);
    }

}

@media (max-width: 900px) {
    .second-round-dashboard .topbar-inner {
        flex-wrap: wrap;
        gap: 10px 16px;
    }

    @media (max-width: 700px) {
        .second-round-notice-test {
            grid-template-columns: minmax(0, 1fr);
        }

        .second-round-notice-test__controls {
            justify-content: flex-start;
        }
    }

    .second-round-dashboard .index-header-context {
        display: flex;
        flex: 1 0 100%;
        justify-content: center;
        width: 100%;
    }

    .second-round-dashboard .second-round-cargo-nav {
        justify-content: center;
        margin-left: 0;
        margin-inline: auto;
    }

    .second-round-dashboard.result-page.topbar-page {
        padding-top: 164px;
    }

    .second-round-dashboard__main {
        margin-top: 10px;
    }
}

@media (max-width: 640px) {
    .second-round-dashboard.result-page.topbar-page {
        padding-top: 154px;
    }

    .second-round-dashboard__main {
        margin-top: 8px;
    }
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    min-width: 0;
}

.brand-logo {
    display: block;
    width: 195px;
    max-width: 100%;
    height: auto;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #FFFFFF1F;
    border: 2px solid #FFFFFFB2;
    font-weight: 900;
    color: #f9f5d8;
    letter-spacing: 0.04em;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.brand-text strong {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.brand-text small {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: #FFFFFFCC;
    text-transform: uppercase;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.topbar-nav a {
    color: #FFFFFFEB;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.topbar-nav a:hover {
    color: #ffffff;
    border-color: #FFFFFFA6;
}

.cargo-nav {
    gap: 10px;
}

.cargo-nav__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 13px !important;
    border: 1px solid #FFFFFF !important;
    border-radius: 6px;
    background: transparent;
    color: #FFFFFF !important;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.82rem;
    font-weight: 800 !important;
    line-height: 1.1;
    text-align: center;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.cargo-nav__button:hover,
.cargo-nav__button:focus-visible,
.cargo-nav__button.is-active {
    background: #FFFFFF;
    color: var(--am-blue-dark) !important;
    border-color: #FFFFFF !important;
    outline: none;
}

.cargo-nav__button:hover,
.cargo-nav__button:focus-visible {
    transform: translateY(-1px);
}

.result-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 28px 20px 48px;
    background-color: #002E6D14;
}

.municipio-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 20px;
    background: linear-gradient(90deg, var(--am-blue-tint) 0%, var(--am-red-tint) 100%);
    border: 1px solid #002E6D1A;
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    padding: 18px 20px;
    color: #0f2240;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 10px 25px #10263D0D;
}

.municipio-bar__info {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 20px;
    min-width: 0;
    flex-wrap: nowrap;
}

.municipio-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.municipio-bar > .refresh-btn {
    flex: 0 0 auto;
    margin-left: auto;
}

.turno-badge {
    border-radius: 18px;
    background: #FFFFFFD9;
    border: 1px solid #002E6D1F;
    padding: 8px 14px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: #002E6D;
}

.status-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #FFFFFFE6;
    border: 1px solid #002E6D1A;
    border-top: none;
    border-radius: 0 0 18px 18px;
    padding: 22px 18px;
    margin-bottom: 28px;
    box-shadow: 0 18px 32px #10263D14;
}

.status-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #153d3a;
}

.status-copy strong {
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.status-copy span {
    font-size: 0.82rem;
    color: #4f7070;
}

.refresh-btn,
.full-list-btn {
    border: 1px solid #002E6D1F;
    background: linear-gradient(180deg, #002E6D 0%, #001f4d 100%);
    color: #fff;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.refresh-btn:hover,
.full-list-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px #C8102E38;
    background: linear-gradient(180deg, #C8102E 0%, #a80d27 100%);
}

.refresh-btn:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.refresh-btn:disabled:hover {
    box-shadow: none;
    background: linear-gradient(180deg, #002E6D 0%, #001f4d 100%);
}

.office-section {
    margin-top: 12px;
}

.office-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
}

.office-header h2 {
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: clamp(1.55rem, 2.8vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #112a2f;
}

.result-office-title {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
}

.result-office-title h2 {
    display: inline-flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
    white-space: nowrap;
}

.result-office-title__name {
    display: inline-block;
    flex: 0 0 auto;
    white-space: nowrap;
}

.result-office-title .municipios-votos-recentes {
    margin-top: 6px;
}

.result-tools {
    order: 2;
    display: flex;
    align-self: stretch;
    align-items: flex-end;
    gap: 10px;
    margin-left: auto;
    flex-wrap: nowrap;
}

.result-filters {
    display: flex;
    align-self: stretch;
    align-items: flex-end;
    gap: 6px;
}

@media (min-width: 901px) {
    .office-header--with-recent-tools .result-tools {
        align-self: flex-start;
        margin-left: 0;
    }

    .office-header--with-recent-tools .result-tools .result-filters {
        align-items: flex-start;
    }
}

.second-round-election-notices {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1100;
    width: min(420px, calc(100vw - 40px));
    pointer-events: none;
}

.second-round-election-notices[hidden] {
    display: none;
}

.second-round-election-notice {
    position: absolute;
    right: 0;
    bottom: calc(var(--notice-index) * 12px);
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 118px;
    padding: 18px 54px 18px 18px;
    border: 1px solid #d5e0ea;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 48px #10263d30;
    color: #183e3d;
    pointer-events: auto;
    animation: second-round-election-notice-in 220ms ease-out both;
}

.second-round-election-notice__progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    overflow: hidden;
    border-radius: 0 0 18px 18px;
    background: #e8f2ea;
}

.second-round-election-notice__progress-value {
    display: block;
    width: 100%;
    height: 100%;
    background: #2f7d4a;
    transition: width 60ms linear;
}

.second-round-election-notice__portrait {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    overflow: hidden;
    border: 3px solid #2f7d4a;
    border-radius: 50%;
    background: #e8f2ea;
    color: #2f7d4a;
    font-size: 1.1rem;
    font-weight: 800;
}

.second-round-election-notice__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.second-round-election-notice__copy {
    min-width: 0;
}

.second-round-election-notice__election {
    display: block;
    margin-bottom: 5px;
    color: #607184;
    font-size: 0.75rem;
    font-weight: 700;
}

.second-round-election-notice__copy p {
    margin: 0;
    color: #183e3d;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.second-round-election-notice__label {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e8f2ea;
    color: #276b3e;
    font-size: 0.82rem;
}

.second-round-election-notice__close {
    position: absolute;
    top: 9px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef2f5;
    color: #35495d;
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.second-round-election-notice__close:hover {
    background: #dfe7ed;
}

.second-round-election-notice__close:focus-visible {
    outline: 3px solid #2f7d4a;
    outline-offset: 2px;
}

@keyframes second-round-election-notice-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .second-round-election-notices {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
    }

    .second-round-election-notice {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 12px;
        min-height: 102px;
        padding: 14px 48px 14px 14px;
    }

    .second-round-election-notice__portrait {
        width: 62px;
        height: 62px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .second-round-election-notice {
        animation: none;
    }
}

.candidate-search-trigger {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid #10263d26;
    border-radius: 50%;
    background: #fff;
    color: #0b6b5d;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.candidate-search-trigger:hover,
.candidate-search-trigger:focus-visible {
    border-color: #0b6b5d;
    background: #fff;
    outline: none;
}

.candidate-search-trigger svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}

.tse-messages {
    order: 3;
    flex: 1 1 100%;
}

.result-filter {
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 8px 12px 9px;
    background: transparent;
    color: var(--am-blue-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.result-filter:hover,
.result-filter:focus-visible,
.result-filter.is-active {
    border-bottom-color: var(--am-blue-dark);
    outline: none;
}

.nominal-view[hidden],
.party-list[hidden] {
    display: none;
}

.party-list {
    display: grid;
    gap: 16px;
}

@media (min-width: 1024px) {
    .party-list {
        gap: 10px;
    }

    .party-group {
        border-radius: 8px;
    }

    .party-group__summary {
        padding: 10px 12px;
    }

    .party-group__content {
        padding: 0 8px 10px;
    }

    .legend-vote-progress {
        margin: 0 0 10px;
        padding: 8px 8px 7px;
    }

    .party-group__total {
        padding: 8px 6px;
    }

    .party-candidates {
        gap: 8px;
    }

    .party-candidate {
        min-height: 0;
        padding: 12px;
        gap: 10px;
    }

    .party-candidate .candidate-main {
        gap: 6px;
    }

    .party-candidate .candidate-photo,
    .party-candidate .candidate-iniciais {
        width: 52px;
        height: 52px;
    }

    .party-candidate .candidate-body h3 {
        font-size: 1rem;
    }

    .party-candidate .vote-value {
        font-size: 0.95rem;
    }

    .party-group__meta {
        gap: 6px;
        font-size: 0.8rem;
    }

    .party-group__meta strong {
        min-width: 24px;
        padding: 3px 6px;
    }
}

.party-group {
    border: 1px solid #002E6D55;
    border-radius: 10px;
    background: #FFFFFFB8;
    overflow: hidden;
}

.party-group__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    color: var(--am-blue-dark);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

@media (min-width: 1024px) {
    .party-group__summary {
        min-height: 52px;
    }
}

.party-group__summary::-webkit-details-marker {
    display: none;
}

.party-group__heading {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.party-status-pill {
    font-size: 0.7rem;
    padding: 4px 8px;
    white-space: nowrap;
}

.party-group__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #42566f;
    font-size: 0.9rem;
}

.party-group__meta strong {
    min-width: 28px;
    padding: 4px 7px;
    border-radius: 4px;
    background: var(--am-blue-dark);
    color: #fff;
    text-align: center;
}

.party-group__chevron {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.party-group[open] .party-group__chevron {
    transform: rotate(180deg);
}

.party-group__content {
    padding: 0 12px 14px;
}

.legend-vote-progress {
    margin: 0 0 14px;
    padding: 12px 10px 10px;
    border-radius: 10px;
    background: var(--am-white);
    box-shadow: 0 6px 16px #03112D0D;
}

.legend-vote-progress__labels,
.legend-vote-progress__values,
.legend-vote-progress__total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.legend-vote-progress__labels {
    color: var(--am-slate-900);
    font-size: 0.82rem;
    font-weight: 700;
}

.legend-vote-progress__bar {
    height: 12px;
    margin: 6px 0 8px;
    overflow: hidden;
    border-radius: 3px;
    background: #88A9C8;
}

.legend-vote-progress__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #6B8824;
}

.legend-vote-progress__values {
    color: #42566f;
    font-size: 0.75rem;
}

.legend-vote-progress__total {
    align-items: center;
    margin-top: 16px;
    color: var(--am-slate-900);
    font-size: 0.95rem;
    font-weight: 700;
}

.legend-vote-progress__total strong {
    color: #E5B500;
    font-size: 1.05rem;
}

.party-group__total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 8px;
    border-top: 1px solid #002E6D1A;
    color: #42566f;
    font-size: 0.82rem;
}

.party-candidates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.party-candidate {
    min-height: 0;
    padding: 16px;
    gap: 16px;
    align-items: stretch;
    flex-direction: column;
}

.party-candidate .candidate-main {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    width: 100%;
    align-items: center;
    gap: 8px;
}

.party-candidate .candidate-figure {
    width: 54px;
    height: 54px;
}

.party-candidate .candidate-main {
    min-width: 0;
}

.party-candidate .candidate-body {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    overflow: hidden;
}

.party-candidate .candidate-body h3 {
    overflow-wrap: anywhere;
}

.party-candidate .candidate-side {
    align-items: stretch;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.party-candidate .vote-value {
    font-size: clamp(1rem, 1.7vw, 1.3rem);
    white-space: nowrap;
}

.party-candidate .candidate-status {
    display: flex;
    align-items: center;
    margin: 0;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0C6D5A1A;
    color: #0b6b5d;
    font-size: 0.8rem;
    font-weight: 800;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    align-items: stretch;
}

.candidate-card {
    background: linear-gradient(90deg, var(--am-blue-tint) 0%, var(--am-red-tint) 100%);
    border: 1px solid #002E6D1A;
    border-radius: 20px;
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-height: 280px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 10px 26px #10263D0D;
    position: relative;
    overflow: hidden;
}

.candidate-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, #C8102E 0%, #002E6D 100%);
}

.candidate-card:hover,
.candidate-card:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 18px 32px #10263D1F;
    border-color: #002E6D2E;
    outline: none;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 4px;
    background: transparent;
}

.percent-value {
    font-size: clamp(1.85rem, 2.5vw, 2.7rem);
    font-weight: 700;
    color: #002E6D;
    line-height: 1;
    letter-spacing: -0.04em;
}

.majoritarian-vote-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: clamp(2rem, 2.8vw, 3rem);
}

.majoritarian-vote-summary .percent-value {
    color: #002E6D;
    font-size: 1em;
}

.majoritarian-votes {
    color: #002E6D;
    font-size: 0.5em;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.candidate-number {
    color: #002E6D;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.candidate-figure {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.candidate-photo,
.candidate-iniciais {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 15%;
    border: 3px solid #002E6D2E;
    background: linear-gradient(135deg, #7FBFFF3D, #002E6D14);
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #002E6D;
    box-shadow: inset 0 0 0 1px #FFFFFF99;
}

.candidate-figure--elected {
    --status-border-color: #9EB735;
}

.candidate-figure--not-elected {
    --status-border-color: #E9EDF2;
}

.candidate-figure--suplente {
    --status-border-color: #6D83A4;
}

.candidate-figure--annulled {
    --status-border-color: #FF4B5E;
}

.candidate-figure--annulled-sub-judice,
.candidate-figure--under-review {
    --status-border-color: #F8E142;
}

.candidate-figure--null-status {
    --status-border-color: #E8D0FF;
}

.candidate-figure--second-round {
    --status-border-color: #DB9736;
}

.candidate-figure--elected .candidate-photo,
.candidate-figure--elected .candidate-iniciais,
.candidate-figure--not-elected .candidate-photo,
.candidate-figure--not-elected .candidate-iniciais,
.candidate-figure--suplente .candidate-photo,
.candidate-figure--suplente .candidate-iniciais,
.candidate-figure--annulled .candidate-photo,
.candidate-figure--annulled .candidate-iniciais,
.candidate-figure--annulled-sub-judice .candidate-photo,
.candidate-figure--annulled-sub-judice .candidate-iniciais,
.candidate-figure--under-review .candidate-photo,
.candidate-figure--under-review .candidate-iniciais,
.candidate-figure--null-status .candidate-photo,
.candidate-figure--null-status .candidate-iniciais,
.candidate-figure--second-round .candidate-photo,
.candidate-figure--second-round .candidate-iniciais {
    border-color: var(--status-border-color);
}

.candidate-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    background: transparent;
}

.party-tag {
    font-size: 0.8rem;
    color: #4f7270;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.candidate-body h3 {
    margin: 0;
    font-size: clamp(1.1rem, 1.6vw, 1.65rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #112a2f;
    word-break: break-word;
}

.candidate-status {
    margin-top: auto;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    padding: 9px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
}

body.compact-label-dimensions .candidate-status .status-pill,
body.compact-label-dimensions .candidate-meta .candidate-status-pill {
    box-sizing: border-box;
    min-width: 0;
    padding: 5px 9px;
    border: 1px solid #D5DDE5;
    font-size: 0.72rem;
    line-height: 1.25;
}

.second-round-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    padding: 22px 24px;
    border-radius: 12px;
    background: #FFF7DC;
    color: #1F2937;
}

.tse-messages {
    flex: 1 1 22rem;
    min-width: 0;
    align-items: flex-start;
    margin: 0;
    padding: clamp(10px, 1.4vw, 16px) clamp(12px, 1.8vw, 20px);
    gap: clamp(8px, 1vw, 12px);
    font-size: clamp(0.72rem, 0.9vw, 0.95rem);
    line-height: 1.35;
}

.tse-messages > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tse-messages p {
    margin: 0;
    line-height: 1.45;
}

.tse-message-headline {
    font-weight: 700;
}

.tse-message-list {
    margin: 8px 0 0;
    padding-left: 20px;
    list-style: disc;
}

.tse-message-list li {
    margin-bottom: 6px;
    line-height: 1.45;
}

.tse-message-list li:last-child {
    margin-bottom: 0;
}

.second-round-notice__icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F5B41B;
    color: #FFFFFF;
    font-weight: 800;
}

.status-pill.elected {
    background: #9EB735;
    color: #fff;
    box-shadow: 0 8px 14px #9EB7352E;
}

.status-pill.not-elected {
    background: #e9edf2;
    color: #1a1a1a;
}

.status-pill.guaranteeing-vaga {
    background: #0F766E;
    color: #FFFFFF;
    box-shadow: 0 8px 14px #0F766E2E;
}

.status-pill.annulled {
    background: #FF4B5E;
    color: #FFFFFF;
    border-radius: 999px;
}

.status-pill.annulled-sub-judice,
.status-pill.under-review,
.candidate-status-pill.annulled-sub-judice,
.candidate-status-pill.under-review,
.party-status-pill.annulled-sub-judice,
.party-status-pill.under-review {
    background: #F8E142;
    color: #000000;
    border-radius: 999px;
}

.status-pill.null-status {
    background: #E8D0FF;
    color: #3D2E52;
    border-radius: 999px;
}

.status-pill.second-round {
    background: #DB9736;
    color: #FFFFFF;
    border-radius: 999px;
}

.status-pill.suplente {
    background: #6D83A4;
    color: #FFFFFF;
    border-radius: 999px;
}

@media (max-width: 900px) {
    .topbar-page {
        padding-top: 164px;
    }

    .topbar-inner,
    .status-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .office-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 8px;
    }

    .office-header:not(.office-header--with-recent-tools) {
        grid-template-columns: minmax(0, 1fr);
    }

    .office-header--with-recent-tools {
        grid-template-columns: max-content minmax(0, 1fr);
        column-gap: 16px;
    }

    .result-office-title {
        display: contents;
    }

    .office-header:not(.office-header--with-recent-tools) .result-office-title {
        display: grid;
        grid-column: 1;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .result-office-title h2 {
        grid-column: 1 / -1;
        grid-row: 1;
        font-size: clamp(1.15rem, 4.2vw, 1.55rem);
    }

    .result-office-title .municipios-votos-recentes {
        grid-column: 1 / -1;
        grid-row: 2;
        width: fit-content;
        min-width: 0;
        max-width: 100%;
        justify-self: end;
        margin-top: 0;
    }

    .office-header:not(.office-header--with-recent-tools) .result-office-title h2 {
        grid-column: 1;
    }

    .office-header:not(.office-header--with-recent-tools) .result-office-title .municipios-votos-recentes {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }

    .office-header--with-recent-tools .result-office-title .municipios-votos-recentes {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
    }

    .office-header--with-recent-tools .result-office-title h2 {
        grid-column: 1;
    }

    .brand-block {
        width: 100%;
        justify-content: center;
    }

    .controle-turno {
        width: 100%;
        justify-content: center;
    }

    .controle-turno .brand-block {
        width: auto;
    }

    .topbar-nav {
        width: 100%;
        justify-content: center;
    }

    .tse-messages {
        width: 100%;
        flex: 0 1 auto;
    }

    .result-filters {
        width: auto;
    }

    .result-tools {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        width: auto;
        min-width: 0;
        justify-content: flex-start;
        align-items: center;
        align-self: start;
        gap: 0;
        margin-left: 0;
    }

    .result-tools--with-recent {
        grid-column: 2;
        grid-row: 1;
        justify-self: start;
        align-self: center;
    }

    .office-header--with-recent-tools .result-tools .result-filters {
        align-items: center;
    }

    .office-header .tse-messages {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .result-tools .result-filters {
        min-width: 0;
        white-space: nowrap;
        align-items: center;
        gap: 2px;
    }

    .result-office-title .municipios-votos-recentes__toggle {
        width: fit-content;
        max-width: 100%;
    }

    .result-tools .result-filter {
        padding: 6px 6px 7px;
        font-size: 0.68rem;
    }
}

@media (max-width: 640px) {
    .office-header h2 {
        gap: 6px;
    }

    .candidate-search-trigger {
        width: 32px;
        height: 32px;
    }

    .candidate-search-trigger svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 420px) {
    .office-header h2 {
        font-size: 1rem;
        gap: 4px;
    }

    .candidate-search-trigger {
        width: 30px;
        height: 30px;
    }

    .result-tools .result-filter {
        padding-inline: 4px;
        font-size: 0.62rem;
    }
}

@media (max-width: 360px) {
    .office-header {
        column-gap: 0;
    }

    .office-header--with-recent-tools {
        column-gap: 0;
    }

    .office-header h2 {
        font-size: 0.8rem;
        gap: 2px;
    }

    .candidate-search-trigger {
        width: 28px;
        height: 28px;
    }

    .result-tools .result-filter {
        padding-inline: 2px;
        font-size: 0.56rem;
    }
}

@media (max-width: 640px) {
    .result-page.topbar-page {
        padding-top: 201px;
    }

    .result-page .result-container {
        padding-top: 18px;
        background: transparent !important;
    }

    .party-candidates {
        grid-template-columns: 1fr;
    }

    .party-candidate {
        padding: 14px;
    }

    .party-candidate .candidate-side {
        align-items: center;
    }

    .brand-block {
        width: 100%;
    }

    .controle-turno .brand-block {
        width: auto;
    }

    .topbar-nav {
        gap: 12px;
        font-size: 0.9rem;
    }

    .cargo-nav__button {
        font-size: 0.76rem;
        padding-inline: 9px !important;
    }

    .percent-value {
        font-size: 1.8rem;
        font-weight: 700;
    }
}

@media (max-width: 742px) {
    .candidate-summary-card {
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .candidate-summary-card .candidate-figure {
        margin-inline: auto;
    }

    .candidate-summary-card .candidate-body {
        align-items: center;
        text-align: center;
    }

    .candidate-summary-card .candidate-meta {
        justify-content: center;
    }
}

/* Landing page */
.index-page {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    background-color: #001E3B;
}

.index-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, #000000B8 0%, #00000085 45%, #00000038 75%, #00000014 100%),
        url("/static/images/teatro-amazonas-desktop.webp") center top / cover no-repeat;
}

@supports (height: 100lvh) {
    .index-page::before {
        height: 100lvh;
    }
}

.index-page > .index-container,
.index-page > .site-footer {
    position: relative;
    z-index: 1;
}

@media (max-width: 700px) {
    .index-page::before {
        background:
            linear-gradient(180deg, #000000B8 0%, #00000085 45%, #00000038 75%, #00000014 100%),
            url("/static/images/teatro-amazonas-desktop.webp") center top / auto 100vh no-repeat;
    }
}

@media (max-width: 534px) {
    .index-page {
        position: relative;
        background-color: #001E3B;
    }

    .index-page::before {
        background:
            linear-gradient(180deg, #000000B8 0%, #00000085 45%, #00000038 75%, #00000014 100%),
            url("/static/images/teatro-amazonas-desktop.webp") center top / auto 100vh no-repeat;
    }
}

@supports (height: 100lvh) {
    @media (max-width: 700px) {
        .index-page::before {
            background-size: auto 100lvh;
        }
    }
}

.site-footer {
    position: relative;
    margin-top: 0;
    border-top: 4px solid #C8102E;
    background: #002E6D;
    color: #FFFFFF;
}

.replay-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 18px 0;
    border-bottom: 1px solid #FFFFFF26;
}

.replay-controls__status {
    display: grid;
    gap: 4px;
}

.replay-controls__status strong {
    font-size: 0.9rem;
}

.replay-controls__status span {
    color: #FFFFFFCC;
    font-size: 0.78rem;
}

.replay-controls__buttons {
    display: flex;
    gap: 10px;
}

.replay-controls__buttons button {
    padding: 9px 13px;
    border: 1px solid #FFFFFF80;
    border-radius: 7px;
    background: transparent;
    color: #FFFFFF;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.replay-controls__buttons button:hover:not(:disabled),
.replay-controls__buttons button:focus-visible {
    background: #FFFFFF1F;
}

.replay-controls__buttons button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) auto;
    gap: 32px;
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 24px;
}

.site-footer__brand strong {
    display: block;
    font-size: 1.05rem;
}

.site-footer p {
    margin: 6px 0 0;
    color: #FFFFFFCC;
    font-size: 0.8rem;
    line-height: 1.55;
}

.site-footer__details p {
    margin-top: 0;
}

.site-footer__details p + p {
    margin-top: 8px;
}

.site-footer__links {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer__links a {
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
    color: #F8E142;
    text-decoration: underline;
}

.site-footer__about {
    border-top: 1px solid #FFFFFF26;
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 16px 0;
}

.site-footer__about p {
    max-width: 78ch;
    margin: 0;
}

.site-footer__about h2 {
    margin: 0 0 6px;
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.site-footer__copyright {
    padding: 12px 20px;
    background: #001F4D;
    color: #FFFFFFB8;
    font-size: 0.72rem;
    text-align: center;
}

@media (max-width: 700px) {
    .site-footer {
        margin-top: 0;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 18px;
        width: min(100% - 28px, 560px);
        padding: 24px 0 20px;
    }

    .replay-controls {
        align-items: flex-start;
        flex-direction: column;
        width: min(100% - 28px, 560px);
    }

    .site-footer__links {
        justify-content: flex-start;
    }

    .site-footer__about {
        width: min(100% - 28px, 560px);
    }

    .index-page .site-footer__inner,
    .index-page .site-footer__about {
        width: min(100% - 28px, 560px);
    }
}

.index-container {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.index-header-context {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    color: #FFFFFF;
    text-align: right;
}

.index-header-context strong {
    font-size: 1rem;
}

.index-header-context span {
    color: #FFFFFFCC;
    font-size: 0.78rem;
}

.index-intro {
    margin-bottom: 28px;
}

.index-intro .eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: #F8E142;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-shadow: 0 2px 4px #00000085;
    text-transform: uppercase;
}

.index-intro h1 {
    margin: 0;
    color: #FFFFFF;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    letter-spacing: -0.04em;
    text-shadow: 0 3px 8px #000000B8;
}

.index-intro p {
    margin: 8px 0 0;
    color: #FFFFFF;
    font-size: 1.05rem;
    text-shadow: 0 2px 6px #000000B8;
}

.grid-cargos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.turn-choice-dialog {
    width: min(420px, calc(100% - 32px));
    padding: 28px;
    border: 1px solid #FFFFFF38;
    border-radius: 20px;
    background: linear-gradient(135deg, #002E6D 0%, #001F4D 100%);
    box-shadow: 0 24px 70px #001A3D40;
    color: #FFFFFF;
}

.turn-choice-dialog::backdrop {
    background: #061A35B8;
    backdrop-filter: blur(4px);
}

.turn-choice-logo {
    display: block;
    width: min(100%, 280px);
    height: auto;
    margin: 0 auto 20px;
}

.turn-choice-dialog h2 {
    margin: 0 0 22px;
    color: #FFFFFF;
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
}

.turn-choice-options {
    display: flex;
    gap: 12px;
}

.turn-choice-pill {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 14px;
    border: 2px solid var(--am-blue-strong);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--am-blue-strong);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 800;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.turn-choice-pill:hover {
    background: #C8102E;
    border-color: #C8102E;
    color: #FFFFFF;
    transform: translateY(-2px);
}

.card-cargo-link {
    color: inherit;
    text-decoration: none;
}

.card-cargo {
    position: relative;
    display: flex;
    min-height: 210px;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    padding: 22px;
    border: 1px solid #10263D14;
    border-radius: 16px;
    background: #F7F9FB;
    box-shadow: 0 10px 24px #10263D0A;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card-cargo::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--am-red-strong), var(--am-blue-strong));
    content: "";
}

.card-cargo-link:hover .card-cargo,
.card-cargo-link:focus-visible .card-cargo {
    border-color: #002E6D45;
    box-shadow: 0 16px 30px #10263D1F;
    transform: translateY(-4px);
}

.card-cargo-link:focus-visible {
    border-radius: 16px;
    outline: 3px solid #C8102E66;
    outline-offset: 4px;
}

.card-cargo .badge {
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge[class*="major"] {
    background: #002E6D;
    color: #FFFFFF;
}

.badge.proporcional {
    background: #C8102E;
    color: #FFFFFF;
}

.card-cargo h2 {
    margin: 0;
    color: #112a2f;
    font-size: 1.35rem;
    letter-spacing: -0.025em;
}

.card-cargo p {
    margin: 0;
    color: #52666b;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #10263D14;
    color: #52666b;
    font-size: 0.86rem;
}

.card-footer strong,
.ver-mais {
    color: var(--am-blue-strong);
}

.ver-mais {
    font-weight: 900;
}

@media (max-width: 900px) {
    .index-header-context {
        display: none;
    }
}

@media (max-width: 700px) {
    .index-container {
        width: min(100% - 28px, 560px);
        padding-top: 30px;
    }
}

@media (max-width: 640px) {
    /*
     * O index não possui a navegação de cargos do resultado, portanto não
     * precisa reservar os 164px usados pelo cabeçalho das telas internas.
     */
    .index-page.topbar-page {
        padding-top: 172px;
    }

    .index-page .topbar-inner {
        min-height: 0;
        padding: 18px;
    }

    .index-page .brand-mark {
        width: 48px;
        height: 48px;
    }

    .index-page .brand-text strong {
        font-size: 1.15rem;
    }

    .index-page .brand-text small {
        font-size: 0.74rem;
    }

    .index-page .index-container {
        padding-top: 28px;
    }

    .index-page .index-intro h1 {
        font-size: clamp(1.7rem, 8vw, 2.25rem);
        line-height: 1.1;
    }

    .index-page .index-intro p {
        width: 100%;
        max-width: none;
        font-size: 0.98rem;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    .index-page .grid-cargos {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .index-page .card-cargo {
        min-height: 190px;
        padding: 20px;
    }
}


/* Amazonas (BR) theme override: azul, vermelho e branco */
:root{
    --am-blue: #0033A0; /* azul profundo */
    --am-red:  #C8102E; /* vermelho */
    --am-white: #ffffff;
    --am-muted: #f4f6fb;
    --am-text: #0b2540;
}

/* Topbar e marca */
.topbar{
    background: linear-gradient(90deg, var(--am-blue) 0%, var(--am-blue) 60%, var(--am-blue) 100%);
}
.brand-mark{
    background: var(--am-red);
    border: 2px solid #FFFFFFD9;
    color: var(--am-white);
}
.brand-text strong{color:var(--am-white)}
.brand-text small{color:#FFFFFFD9}
.topbar-nav a{color:#FFFFFFF2}
.topbar-nav a:hover{border-color: #FFFFFF66}

/* Painéis principais */
.municipio-bar{
    background: linear-gradient(90deg, #0033A014 0%, #C8102E08 100%);
    border: 1px solid #0033A00F;
    color: var(--am-text);
}
.status-panel{background: var(--am-white); border:1px solid #03112D0A}

/* Botões e ações */
.refresh-btn, .full-list-btn{
    border: 1px solid #0033A01F;
    background: linear-gradient(180deg, #0033A00F, #C8102E05);
    color: var(--am-blue);
}
.refresh-btn:hover, .full-list-btn:hover{transform:translateY(-1px); box-shadow: 0 6px 14px #03112D0F;}

/* Cards */
.candidate-card{border-color: #0033A014}
.candidate-card:hover{box-shadow:0 12px 28px #03112D0F}
.percent-value{color:var(--am-blue)}
.party-tag{color:var(--am-text)}
.candidate-photo{border-color: #0033A01F}

/* Tables and links */
.candidato-nome{color:var(--am-blue); text-decoration: none}
.candidato-nome:hover{color:var(--am-red)}
.ver-mais{color:var(--am-blue)}

/* Minor backgrounds */
.container{background: var(--am-white)}
.result-container{background: transparent !important}


/* Amazonas BR: Gradiente principal vermelho -> azul para identidade visual */
:root{
    --am-blue: #0033A0;
    --am-red:  #C8102E;
}

/* Gradiente principal aplicado ao topo e à marca */
.topbar{
    background: linear-gradient(90deg, var(--am-red) 0%, #8b1030 35%, var(--am-blue) 100%);
}
.brand-mark{
    background: linear-gradient(135deg, var(--am-red) 0%, var(--am-blue) 100%);
    color: #fff;
}

/* Botões com gradiente e contraste branco */
.refresh-btn, .full-list-btn{
    background: linear-gradient(180deg, var(--am-red) 0%, var(--am-blue) 100%);
    color: #ffffff;
    border: none;
}
.refresh-btn:hover, .full-list-btn:hover{
    transform: translateY(-1px);
    box-shadow: 0 8px 22px #0000001F;
}

/* Destaque nos links e nome de candidato */
.candidato-nome{color: var(--am-blue)}
.candidato-nome:hover{color: var(--am-red)}

/* Cards com leve borda colorida e fundo neutro */
.candidate-card{border:1px solid #C8102E14; background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%)}
.candidate-card:hover{box-shadow: 0 18px 40px #03112D14; transform: translateY(-6px)}

/* Pequeno destaque no percent-value usando gradiente text (fallback para cor sólida) */
.percent-value{background: linear-gradient(90deg, var(--am-red), var(--am-blue)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight:700}

/* Reforçar contraste do topo em telas pequenas */
@media (max-width: 640px){
    .topbar-inner{padding:14px}
}

/* Lista vertical de candidatos: foto à esquerda e identificação em uma linha. */
.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.candidate-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 126px;
    padding: 18px 22px 18px 18px;
}

.candidate-main {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.candidate-figure {
    flex: 0 0 auto;
    margin: 0;
}

.candidate-photo,
.candidate-iniciais {
    width: 76px;
    height: 76px;
    aspect-ratio: 1 / 1;
    flex: 0 0 76px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 15%;
}

.cards-grid .candidate-figure .candidate-photo {
    object-fit: cover;
    object-position: center top;
}

.cards-grid .candidate-figure .candidate-photo--samara {
    object-position: center;
}

.candidate-body {
    gap: 6px;
    min-width: 0;
}

.party-tag {
    color: var(--am-blue-dark);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

.candidate-body h3 {
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
}

.candidate-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}



.card-meta {
    justify-content: flex-end;
    padding-top: 0;
}

.candidate-status {
    margin-top: 0;
}

.results-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.results-layout__sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.abrangencia {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: var(--am-white);
    border: 1px solid #10263D0D;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: var(--am-shadow-soft);
}

.abrangencia__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border: 1.5px solid var(--am-blue-dark);
    border-radius: 999px;
    background: var(--am-white);
    color: var(--am-blue-dark);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.abrangencia__link:hover,
.abrangencia__link:focus-visible,
.abrangencia__link.is-active {
    background: var(--am-blue-dark);
    color: var(--am-white);
}

.mapa-apuracao-entry {
    padding: 12px;
    background: var(--am-white);
    border: 1px solid #10263D0D;
    border-radius: 14px;
    box-shadow: var(--am-shadow-soft);
}

.mapa-apuracao-entry__button {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--am-blue-dark);
    border-radius: 999px;
    background: var(--am-white);
    color: var(--am-blue-dark);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.mapa-apuracao-entry__button:hover,
.mapa-apuracao-entry__button:focus-visible,
.mapa-apuracao-entry__button[aria-expanded="true"] {
    background: var(--am-blue-dark);
    color: var(--am-white);
}

.mapa-apuracao-entry__button:focus-visible {
    outline: 3px solid #F2B544;
    outline-offset: 2px;
}

.mapa-apuracao-entry__status {
    margin: 10px 2px 0;
    color: var(--am-slate-700);
    font-size: 0.82rem;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .abrangencia {
        margin-bottom: 14px;
        border-radius: 14px;
    }
}

.municipio-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.municipio-modal[hidden] {
    display: none;
}

.municipio-modal__backdrop {
    position: absolute;
    inset: 0;
    background: #0A1C3599;
}

.municipio-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
    background: var(--am-white);
    border-radius: 18px;
    box-shadow: var(--am-shadow-soft);
    padding: 20px;
    gap: 12px;
}

.municipio-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.municipio-modal__header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--am-slate-900);
}

.municipio-modal__close {
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--am-slate-900);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}

.municipio-modal__close:hover,
.municipio-modal__close:focus-visible {
    background: #10263D14;
}

.municipio-modal__search {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #10263D26;
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--am-slate-900);
}

.municipio-modal__search:focus-visible {
    outline: none;
    border-color: var(--am-blue-dark);
}

.municipio-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.municipio-modal__list li a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--am-slate-900);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
}

.municipio-modal__list li a:hover,
.municipio-modal__list li a:focus-visible {
    background: #002E6D0F;
    color: var(--am-blue-dark);
}

.municipio-modal__empty {
    padding: 10px 12px;
    color: #68788A;
    font-size: 0.85rem;
}

.candidate-search-result__name,
.candidate-search-result__details {
    display: block;
}

.municipio-modal__list li .candidate-search-result__link {
    display: flex;
    align-items: center;
    gap: 12px;
}

.candidate-search-result__photo {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #e8edf3;
}

.candidate-search-result__initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--am-blue-dark);
    font-size: 0.85rem;
    font-weight: 800;
}

.candidate-search-result__content {
    min-width: 0;
}

.candidate-search-result__name {
    font-weight: 700;
}

.candidate-search-result__details {
    margin-top: 2px;
    color: #68788A;
    font-size: 0.8rem;
}

.candidate-search-result__stats {
    display: block;
    margin-top: 4px;
    color: var(--am-blue-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.general-data {
    background: var(--am-white);
    border: 1px solid #10263D0D;
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: var(--am-shadow-soft);
}

.general-data__toggle {
    display: none;
}

.general-data__summary {
    display: none;
}

@media (max-width: 900px) {
    .results-layout {
        display: block;
    }

    .general-data {
        margin-bottom: 14px;
        padding: 0;
        border-radius: 14px;
    }

    .general-data__toggle {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 9px;
        width: 100%;
        padding: 16px;
        border: 0;
        background: transparent;
        color: var(--am-slate-900);
        font-weight: 800;
        font-size: 1rem;
        text-align: left;
    }

    .general-data__chevron {
        display: inline-block;
        width: 8px;
        height: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-2px) rotate(45deg);
        transition: transform 0.2s ease;
    }

    .general-data.is-open .general-data__chevron {
        transform: translateY(2px) rotate(225deg);
    }

    .general-data__summary {
        display: block;
        padding: 0 16px 16px;
    }

    .general-data.is-open .general-data__summary {
        display: none;
    }

    .general-data__summary small {
        display: block;
        margin-bottom: 12px;
        color: #68788A;
        font-size: 0.68rem;
    }

    .general-data__summary-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 10px;
        color: var(--am-slate-900);
        font-size: 0.88rem;
    }

    .general-data__summary-row strong {
        font-weight: 800;
    }

    .general-data__content {
        display: none;
        padding: 0 16px 16px;
    }

    .general-data.is-open .general-data__content {
        display: block;
    }
}

.general-data__content h2 {
    margin: 0 0 10px;
    color: var(--am-slate-900);
    font-size: 1.2rem;
}

.general-data__card {
    padding: 16px 14px;
    border: 1px solid #E5EAF0;
    border-radius: 16px;
    background: var(--am-white);
    box-shadow: 0 10px 24px rgba(3, 17, 45, 0.04);
}

.general-data__card + .general-data__card {
    margin-top: 12px;
}

.general-data__card h3 {
    margin: 0 0 12px;
    color: #68788A;
    font-size: 0.95rem;
}

.general-data__total {
    margin: 2px 0 14px;
    color: #68788A;
    font-size: 0.78rem;
}

.general-data__total span {
    font-weight: 400;
}

.general-data__vote-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    color: #68788A;
    font-size: 0.85rem;
}

.general-data__vote-summary-values {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    color: var(--am-slate-900);
    font-weight: 400;
    white-space: nowrap;
}

.general-data__vote-summary-values strong {
    color: var(--am-blue-dark);
    font-weight: 700;
}

.vote-breakdown {
    gap: 10px !important;
}

.vote-breakdown__with-percentage dd {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
    color: var(--am-slate-900);
    font-weight: 400;
    text-align: right;
    white-space: nowrap;
}

.vote-breakdown__with-percentage dd strong {
    min-width: 4.6em;
    color: var(--am-blue-dark);
    font-size: 0.9em;
    font-weight: 700;
    text-align: right;
}

.vote-breakdown__indented {
    padding-left: 20px;
}

.vote-subrow {
    margin-left: 28px;
    padding-left: 12px;
    border-left: 1px solid #9EB735;
}

.dot {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border-radius: 2px;
    vertical-align: -2px;
}

.dot-valid { background: #9EB735; }
.dot-annulled { background: #FF4B5E; }
.dot-annulled-sub { background: #F8E142; }
.dot-blank { background: #6D83A4; }
.dot-null { background: #E8D0FF; }

.general-data__content small {
    display: block;
    margin-bottom: 16px;
    color: #68788A;
    font-size: 0.68rem;
}

.general-data dl {
    display: grid;
    gap: 11px;
    margin: 0;
}

.general-data dl div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.general-data dt,
.general-data dd {
    margin: 0;
    font-size: 0.88rem;
}

.general-data dd {
    color: var(--am-slate-900);
    font-weight: 800;
    text-align: right;
}

.general-data .vote-breakdown dd {
    font-weight: 400;
}

.general-data__content h3 {
    margin: 22px 0 10px;
    color: #68788A;
    font-size: 0.95rem;
}

.general-progress {
    position: relative;
    height: 14px;
    margin: 12px 0 4px;
    overflow: hidden;
    border-radius: 999px;
    background: #E9EDF2;
    text-align: center;
}

.general-progress span {
    position: absolute;
    inset: 0 auto 0 0;
    display: block;
    max-width: 100%;
    background: #9EB735;
}

.general-progress strong {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    color: var(--am-blue-dark);
    font-size: 0.72rem;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

.general-progress--votes {
    margin: 0 0 12px;
    background: #E8D0FF;
}

.general-progress--votes span {
    width: 100%;
    background: var(--vote-gradient);
}

.electorate-progress {
    margin-top: 14px;
}

.electorate-progress__labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: var(--am-slate-900);
    font-size: 0.78rem;
    line-height: 1.1;
}

.electorate-progress__labels div {
    display: flex;
    flex-direction: column;
}

.electorate-progress__labels div:last-child {
    align-items: flex-end;
}

.electorate-progress__labels strong {
    color: var(--am-blue-dark);
    font-size: 0.78rem;
}

.electorate-progress__bar {
    display: flex;
    height: 14px;
    overflow: hidden;
    border-radius: 4px;
    background: #E8D0FF;
}

.electorate-progress__bar span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    color: var(--am-blue-dark);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.electorate-progress__attended {
    background: #9EB735;
}

.electorate-progress__abstention {
    background: #E8D0FF;
}

.general-data__divider {
    border-top: 1px solid #002E6D40;
    padding-top: 12px;
}

.results-layout .office-section {
    min-width: 0;
    margin-top: 0;
}

@media (max-width: 640px) {
    .candidate-card {
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .candidate-main {
        gap: 12px;
    }

    .candidate-photo,
    .candidate-iniciais {
        width: 64px;
        height: 64px;
        flex-basis: 64px;
    }

    .candidate-side {
        align-items: flex-end;
    }

    .status-pill {
        min-width: 0;
        font-size: 0.75rem;
        padding: 7px 8px;
    }
}

/* Cargos majoritários usam cards em blocos e progresso circular junto à foto. */
.cards-grid--majoritarian {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.cards-grid--majoritarian .candidate-card {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 260px;
    padding: 20px 18px 16px;
    gap: 14px;
    text-align: center;
}

.cards-grid--majoritarian .candidate-main {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.cards-grid--majoritarian .candidate-body {
    width: 100%;
    align-items: center;
    text-align: center;
}

.cards-grid--majoritarian .candidate-side {
    align-items: center;
    width: 100%;
    margin-top: auto;
}

.candidate-figure--progress {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
}

.candidate-progress-ring {
    --status-progress-color: #F8E142;
    --progress-ring-end-radius: 45.5px;
    position: relative;
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    padding: 5px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--status-progress-color) 0 var(--vote-progress),
        #E9EDF2 var(--vote-progress) 100%
    );
}

.candidate-progress-ring.has-progress-end::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    margin: -2.5px;
    border-radius: 50%;
    background: var(--status-progress-color);
    content: "";
    transform: rotate(var(--vote-progress-angle)) translateY(calc(0px - var(--progress-ring-end-radius)));
}

.candidate-figure--elected .candidate-progress-ring {
    --status-progress-color: #9EB735;
}

.candidate-figure--suplente .candidate-progress-ring {
    --status-progress-color: #6D83A4;
}

.candidate-figure--annulled .candidate-progress-ring {
    --status-progress-color: #FF4B5E;
}

.candidate-figure--annulled-sub-judice .candidate-progress-ring,
.candidate-figure--under-review .candidate-progress-ring {
    --status-progress-color: #F8E142;
}

.candidate-figure--null-status .candidate-progress-ring {
    --status-progress-color: #E8D0FF;
}

.candidate-figure--second-round .candidate-progress-ring {
    --status-progress-color: #DB9736;
}

.candidate-progress-ring.is-counting-open,
.second-round-dashboard .candidate-progress-ring.is-counting-open {
    --status-progress-color: #002E6D;
}

.second-round-dashboard .candidate-progress-ring.is-counting-open {
    --status-progress-color: #F8E142;
}

.candidate-figure--annulled .candidate-progress-ring.is-counting-open {
    --status-progress-color: #FF4B5E;
}

.candidate-figure--annulled-sub-judice .candidate-progress-ring.is-counting-open {
    --status-progress-color: #F8E142;
}

.second-round-dashboard .candidate-figure--elected .candidate-progress-ring {
    --status-progress-color: #9EB735;
}

.second-round-dashboard .candidate-figure--not-elected .candidate-progress-ring {
    --status-progress-color: #F8E142;
}

.second-round-dashboard .candidate-figure--suplente .candidate-progress-ring {
    --status-progress-color: #6D83A4;
}

.second-round-dashboard .candidate-figure--annulled .candidate-progress-ring {
    --status-progress-color: #FF4B5E;
}

.second-round-dashboard .candidate-figure--annulled-sub-judice .candidate-progress-ring,
.second-round-dashboard .candidate-figure--under-review .candidate-progress-ring {
    --status-progress-color: #F8E142;
}

.second-round-dashboard .candidate-figure--null-status .candidate-progress-ring {
    --status-progress-color: #E8D0FF;
}

.second-round-dashboard .candidate-figure--second-round .candidate-progress-ring {
    --status-progress-color: #DB9736;
}

.candidate-progress-ring .candidate-photo,
.candidate-progress-ring .candidate-iniciais {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 3px solid #FFFFFF;
}

@media (max-width: 640px) {
    .cards-grid--majoritarian .candidate-card {
        min-height: 300px;
    }
}


/* Override per user request: gradient only on topbar; dark-blue buttons with red hover; light-blue numbers; preserve percentage size */
:root{
    --am-blue-dark: #002e6d; /* dark blue for buttons */
    --am-blue-light: #7fbfff; /* light blue for numbers */
    --am-blue-tint: #002E6D14;
    --am-red-tint: #C8102E0A;
    --am-red: #C8102E;
    --am-white: #ffffff;
    --am-slate-900: #10263d;
    --am-slate-700: #4b647a;
    --am-slate-200: #e7edf5;
    --am-shadow-soft: 0 14px 30px #10263D1A;
}

/* Topbar alone keeps gradient */
.topbar{background: linear-gradient(90deg, var(--am-red) 0%, #8b1030 35%, var(--am-blue-dark) 100%);} 

/* Brand mark should be non-gradient and use white background with blue border/text */
.brand-mark{background: var(--am-white) !important; color: var(--am-blue-dark) !important; border: 2px solid var(--am-blue-dark) !important}

/* Buttons: solid dark blue, hover becomes red */
.refresh-btn, .full-list-btn, .btn-voltar, button.primary {
    background: var(--am-blue-dark) !important;
    color: var(--am-white) !important;
    border: 1px solid #0000000F !important;
}
.refresh-btn:hover, .full-list-btn:hover, .btn-voltar:hover, button.primary:hover {
    background: var(--am-red) !important;
    color: var(--am-white) !important;
}

/* Numbers (votos e percentuais) in light blue */
.votos, .col-votos, td.votos, .metric strong, .col-percentual, td.percentual {
    color: var(--am-blue-dark) !important;
    font-weight: 800;
}

/* Keep percentage values prominent without making them visually heavy. */
.percent-value{
    color: var(--am-blue-dark);
    font-weight: 700;
}

.vote-value {
    font-size: clamp(1.25rem, 4vw, 2rem);
    color: var(--am-blue-dark);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
}

/* Candidate cards keep the Amazonas blue tint without adding red to the card background */
.candidate-card,
.candidate-cargo {
    background: #F7F9FB !important;
    border: 1px solid #002E6D1A !important;
}

/* Friendly and intuitive visual polish */
body.result-page {
    background: #002E6D14;
    color: var(--am-slate-900);
}

.result-container {
    width: 100%;
    max-width: none;
    padding-top: 18px;
}

.summary-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 0 18px;
}

.summary-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #FFFFFFCC;
    border: 1px solid #002E6D1A;
    color: var(--am-slate-700);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.summary-tag--primary {
    background: linear-gradient(90deg, #C8102E1F, #002E6D24);
    color: var(--am-blue-dark);
    border-color: #002E6D24;
}

.municipio-bar {
    box-shadow: var(--am-shadow-soft);
    border: 1px solid #10263D0F;
}

.status-panel {
    box-shadow: var(--am-shadow-soft);
    border: 1px solid #10263D0D;
}

.office-header h2 {
    letter-spacing: -0.04em;
}

.candidate-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #10263D14;
    box-shadow: 0 10px 24px #10263D0A;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.candidate-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--am-red), var(--am-blue-dark));
    opacity: 0.9;
}

.candidate-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--am-shadow-soft);
    border-color: #002E6D24;
}

/* Após o encerramento, somente eleitos e segundo turno recebem a borda oficial. */
.cards-grid .candidate-card.is-non-qualified-after-count {
    border-color: transparent;
}

.cards-grid .candidate-card.is-non-qualified-after-count:hover,
.cards-grid .candidate-card.is-non-qualified-after-count:focus-visible {
    border-color: transparent;
}

.cards-grid .candidate-card.is-qualified-after-count {
    border: 1px solid transparent;
    background-image:
        linear-gradient(#F7F9FB, #F7F9FB),
        linear-gradient(90deg, var(--am-red), var(--am-blue-dark));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.candidate-body h3 {
    line-height: 1.2;
    color: var(--am-slate-900);
}

.card-meta {
    align-items: center;
}

.candidate-iniciais {
    background: linear-gradient(135deg, #7FBFFF40, #002E6D14);
    border: 2px solid #002E6D1F;
    color: var(--am-blue-dark);
}

.status-pill {
    box-shadow: inset 0 0 0 1px #FFFFFF40;
}

@media (max-width: 640px) {
    .summary-strip {
        margin-bottom: 12px;
    }

    .status-panel {
        padding: 16px 14px;
    }
}

/* Página "Votação por Município" do candidato */
.candidate-summary-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 28px;
    margin-bottom: 28px;
}

.candidate-summary-card .candidate-figure {
    flex-shrink: 0;
}

.candidate-summary-card .candidate-photo,
.candidate-summary-card .candidate-iniciais {
    width: 132px;
    height: 132px;
    flex-basis: 132px;
}

.candidate-summary-card .candidate-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    text-align: left;
}

.candidate-summary-card .candidate-body h2 {
    margin: 0;
    font-size: clamp(1.3rem, 2vw, 1.9rem);
    letter-spacing: -0.02em;
    color: var(--am-slate-900);
}

.candidate-summary-card .candidate-age {
    margin: -4px 0 0;
    color: var(--am-slate-700);
    font-size: 0.95rem;
    font-weight: 500;
}

.candidate-performance {
    flex: 1 1 360px;
    min-width: min(100%, 320px);
    margin-left: auto;
    padding-left: 28px;
    border-left: 1px solid #03112D14;
}

.candidate-performance__tab {
    display: none;
}

.candidate-performance__tab::-webkit-details-marker {
    display: none;
}

.candidate-performance__tab::marker {
    content: '';
}

.candidate-performance__tab::after {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
    content: '';
}

.candidate-performance[open] > .candidate-performance__tab::after {
    transform: translateY(2px) rotate(225deg);
}

.candidate-performance__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--am-slate-900);
}

.candidate-performance__header strong {
    font-size: 0.88rem;
}

.candidate-performance__header span {
    color: var(--am-slate-700);
    font-size: 0.72rem;
}

.candidate-performance__chart {
    position: relative;
    min-height: 150px;
}

.candidate-performance__svg {
    display: block;
    width: 100%;
    height: 150px;
    touch-action: none;
    user-select: none;
}

.candidate-performance__grid {
    stroke: #03112D18;
    stroke-width: 1;
}

.candidate-performance__axis-label,
.candidate-performance__time {
    fill: var(--am-slate-700);
    font-size: 9px;
}

.candidate-performance__line {
    fill: none;
    stroke: var(--am-blue-dark);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
}

.candidate-performance__point {
    fill: var(--am-blue-light);
    stroke: var(--am-blue-dark);
    stroke-width: 1.5;
}

.candidate-performance__svg {
    cursor: crosshair;
    outline: none;
}

.candidate-performance__hover-line {
    visibility: hidden;
    stroke: var(--am-blue-dark);
    stroke-dasharray: 3 3;
    stroke-width: 1;
}

.candidate-performance__hover-point {
    visibility: hidden;
}

.candidate-performance__chart.is-hovering .candidate-performance__hover-line,
.candidate-performance__chart.is-hovering .candidate-performance__hover-point {
    visibility: visible;
}

.candidate-performance__hover-point {
    fill: var(--am-white);
    stroke: var(--am-blue-dark);
    stroke-width: 2;
}

.candidate-performance__tooltip {
    position: absolute;
    top: 2px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(15, 27, 42, 0.96);
    color: var(--am-white);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(12, 20, 34, 0.24);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.candidate-performance__empty {
    color: var(--am-slate-700);
    font-size: 0.78rem;
    font-style: italic;
}

.candidate-party-number {
    margin-top: 2px;
    color: var(--am-blue-dark);
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
}

.candidate-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.candidate-meta .candidate-party-number {
    margin-top: 0;
}

.candidate-status-pill {
    min-width: 0;
    padding: 4px 9px;
    font-size: 0.7rem;
    line-height: 1.1;
}

.candidate-state-total {
    margin-top: 8px;
    color: var(--am-blue-dark);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 900;
    line-height: 1.1;
}

/* Party ranking cards use a compact vertical layout in every viewport. */
.party-candidate {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
}

.party-candidate .candidate-main {
    display: grid;
    width: 100%;
    flex: 1 1 auto;
}

.party-candidate .candidate-body {
    flex: 1 1 auto;
    min-width: 0;
}

.party-candidate .candidate-side {
    display: flex;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 640px) {
    .party-candidates {
        grid-template-columns: 1fr;
    }

    .party-candidate .candidate-figure {
        width: 52px;
        height: 52px;
        min-width: 52px;
        flex-basis: 52px;
    }

    .party-candidate .candidate-photo,
    .party-candidate .candidate-iniciais {
        width: 52px;
        height: 52px;
        min-width: 52px;
        max-width: 52px;
        flex-basis: 52px;
    }

    .party-candidate .candidate-side {
        align-items: center;
    }
}

@media (max-width: 742px) {
    .candidate-summary-card {
        flex-wrap: wrap;
    }

    .candidate-performance {
        flex: 0 0 100%;
        order: 3;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        padding-top: 14px;
        padding-left: 0;
        border-top: 1px solid #03112D14;
        border-left: 0;
        box-sizing: border-box;
    }

    .candidate-performance__tab {
        display: block;
        padding: 10px 0;
        color: var(--am-blue-dark);
        cursor: pointer;
        font-size: 0.88rem;
        font-weight: 800;
        list-style-position: inside;
    }

    .candidate-performance__header {
        margin-top: 6px;
    }

    .candidate-performance__tooltip {
        top: 4px;
        max-width: min(210px, 72vw);
        white-space: normal;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* Compact labels for the party view, preventing clipping at narrow widths. */
.party-group__summary {
    min-width: 0;
    font-size: clamp(0.82rem, 1.6vw, 1rem);
    line-height: 1.2;
}

.party-group__name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.party-group__meta {
    flex: 0 0 auto;
    font-size: clamp(0.7rem, 1.4vw, 0.86rem);
    line-height: 1.1;
}

.party-group__total {
    font-size: clamp(0.68rem, 1.25vw, 0.8rem);
    line-height: 1.2;
}

.party-candidate .candidate-main,
.party-candidate .candidate-body,
.party-candidate .candidate-side {
    min-width: 0;
}

.party-candidate .candidate-figure {
    width: 54px;
    height: 54px;
    min-width: 54px;
    flex: 0 0 54px;
}

.party-candidate .candidate-photo,
.party-candidate .candidate-iniciais {
    width: 54px;
    height: 54px;
    min-width: 54px;
    max-width: 54px;
    aspect-ratio: 1 / 1;
    flex: 0 0 54px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 15%;
}

.party-candidate .party-tag {
    max-width: 100%;
    font-size: clamp(0.56rem, 1vw, 0.68rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.party-candidate .candidate-body h3 {
    max-width: 100%;
    font-size: clamp(0.72rem, 1.25vw, 0.9rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
    word-break: normal;
}

.party-candidate .vote-value {
    font-size: clamp(0.76rem, 1.15vw, 0.95rem);
    line-height: 1.1;
}

.party-candidate .status-pill {
    min-width: 0;
    max-width: 100%;
    padding: 4px 6px;
    font-size: clamp(0.52rem, 0.9vw, 0.64rem);
    line-height: 1.1;
    white-space: nowrap;
}

/* Hierarchy for the TSE-style federation view, using the existing palette. */
.federation-group {
    border-color: #002E6D55;
    background: #002E6D0A;
    box-shadow: var(--am-shadow-soft);
}

.federation-summary {
    min-height: 58px;
    padding: 16px 18px;
    background: #FFFFFF;
    border-bottom: 1px solid #002E6D1A;
    color: var(--am-blue-dark);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: background-color 0.18s ease;
}

.federation-summary:hover,
.federation-summary:focus-visible {
    background: #002E6D0F;
    outline: none;
}

.federation-summary .party-group__name {
    font-size: clamp(0.9rem, 1.7vw, 1.08rem);
}

.federation-summary .party-group__meta strong {
    background: var(--am-blue-dark);
}

.party-group--nested {
    margin: 12px;
    border-color: #C8102E35;
    border-radius: 8px;
    background: var(--am-white);
    box-shadow: 0 8px 18px #03112D0D;
}

.party-group--nested + .party-group--nested {
    margin-top: 16px;
}

.party-section__summary {
    padding: 12px 14px;
    background: #FFFFFF;
    color: var(--am-slate-900);
    cursor: default;
}

.party-section__summary .party-group__name {
    color: var(--am-blue-dark);
    font-size: clamp(0.82rem, 1.5vw, 1rem);
}

.party-group--nested .party-group__content {
    padding: 0 10px 12px;
}

.party-candidate-section + .party-candidate-section {
    margin-top: 18px;
}

.party-candidate-section__title {
    margin: 0 0 8px;
    padding: 0 4px;
    color: var(--am-blue-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.party-group--nested .party-group__total {
    border-top-color: #C8102E26;
}

.party-group--nested .party-candidates {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.party-group--nested .party-candidate {
    padding: 14px;
    border-color: #0033A01F;
    box-shadow: 0 8px 18px #03112D0D;
}

.party-group--nested .party-candidate:hover,
.party-group--nested .party-candidate:focus-visible {
    border-color: #C8102E55;
    box-shadow: 0 12px 24px #03112D14;
}

@media (max-width: 760px) {
    .party-group--nested .party-candidates {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .party-group--nested .party-candidate .candidate-side {
        flex-direction: column;
        align-items: flex-start;
    }

    .party-group--nested .party-candidate .candidate-status {
        width: 100%;
    }

    .party-group--nested .party-candidate .status-pill {
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .federation-summary {
        padding: 14px;
    }

    .party-group--nested {
        margin: 10px 8px;
    }

    .party-group--nested .party-candidates {
        grid-template-columns: 1fr;
    }
}

.municipios-section-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 16px;
    width: 100%;
    min-width: 0;
    margin-bottom: 14px;
}

.municipios-section-header > * {
    min-width: 0;
}

.municipios-section-title {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
}

.municipios-section-header__updated {
    color: var(--am-slate-700);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.municipios-votos-recentes {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    align-self: flex-start;
    margin-top: 6px;
    color: var(--am-blue-dark);
    font-size: 0.84rem;
    font-weight: 700;
}

.municipios-votos-recentes__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 5px 10px;
    border: 1px solid var(--am-blue-dark);
    border-radius: 999px;
    background: #fff;
    color: var(--am-blue-dark);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.municipios-votos-recentes__toggle:hover {
    background: #f3f7fc;
}

.municipios-votos-recentes__toggle:focus-visible {
    outline: 2px solid var(--am-blue-dark);
    outline-offset: 2px;
}

.municipios-votos-recentes__summary {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.municipios-votos-recentes__chevron {
    flex: 0 0 auto;
    transition: transform 0.16s ease;
}

.municipios-votos-recentes.is-expanded .municipios-votos-recentes__chevron {
    transform: rotate(180deg);
}

.municipios-votos-recentes__list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    max-height: 180px;
    margin-top: 8px;
    overflow: auto;
    border-left: 2px solid currentColor;
    padding-left: 12px;
    font-weight: 500;
}

.municipios-votos-recentes__list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.municipios-votos-recentes__list li + li {
    margin-top: 4px;
}

.municipios-votos-recentes__list li {
    overflow-wrap: anywhere;
}

.municipios-percentual-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 6px;
}

.municipios-percentual-filter__button {
    padding: 8px 14px;
    border: 1px solid var(--am-blue-dark);
    border-radius: 999px;
    background: var(--am-white);
    color: var(--am-blue-dark);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.municipios-percentual-filter__button.is-active {
    background: var(--am-blue-dark);
    color: var(--am-white);
}

.municipios-percentual-filter__button:focus-visible {
    outline: 3px solid var(--am-orange);
    outline-offset: 2px;
}

.municipios-percentual-description {
    margin: 0 0 12px;
    color: var(--am-slate-700);
    font-size: 0.82rem;
}

.municipios-coleta-status {
    margin: 0 0 12px;
    color: var(--am-slate-700);
    font-size: 0.82rem;
}

/* Última camada: prevalece sobre as regras legadas com !important. */
.cards-grid .candidate-card.is-non-qualified-after-count {
    border: 1px solid #002E6D1A !important;
}

.cards-grid .candidate-card.is-non-qualified-after-count:hover,
.cards-grid .candidate-card.is-non-qualified-after-count:focus-visible {
    border-color: #002E6D1A !important;
}

.cards-grid .candidate-card.is-qualified-after-count {
    border: 2px solid transparent !important;
    background-image:
        linear-gradient(#F7F9FB, #F7F9FB),
        linear-gradient(90deg, var(--am-red), var(--am-blue-dark)) !important;
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.second-round-dashboard .cards-grid .second-round-candidate.is-qualified-after-count {
    background-image:
        linear-gradient(#EFF4EF, #EFF4EF),
        linear-gradient(#2F7D4A, #2F7D4A) !important;
}

.second-round-dashboard .cards-grid .second-round-candidate.is-qualified-after-count::after {
    background: #2F7D4A;
}

.cards-grid .candidate-card.is-qualified-after-count::after,
.cards-grid .candidate-card.is-annulled-after-count::after,
.cards-grid .candidate-card.is-annulled-sub-judice-after-count::after,
.party-list .candidate-card.is-qualified-after-count::after,
.party-list .candidate-card.is-annulled-after-count::after,
.party-list .candidate-card.is-annulled-sub-judice-after-count::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border: 3px solid transparent;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--am-red), var(--am-blue-dark)) border-box;
    -webkit-mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.cards-grid .candidate-card.is-annulled-after-count::after,
.party-list .candidate-card.is-annulled-after-count::after {
    background: #FF4B5E;
}

.cards-grid .candidate-card.is-annulled-sub-judice-after-count::after,
.party-list .candidate-card.is-annulled-sub-judice-after-count::after {
    background: #F8E142;
}

.party-list .candidate-card.is-non-qualified-after-count,
.party-list .candidate-card.is-qualified-after-count {
    background: #E7ECF4 !important;
    border-color: transparent !important;
}

.party-list .candidate-card.is-non-qualified-after-count:hover,
.party-list .candidate-card.is-non-qualified-after-count:focus-visible,
.party-list .candidate-card.is-qualified-after-count:hover,
.party-list .candidate-card.is-qualified-after-count:focus-visible {
    background: #DCE4F0 !important;
    border-color: transparent !important;
}

/* A borda perimetral pós-apuração substitui a faixa superior original. */
.cards-grid .candidate-card.is-qualified-after-count::before,
.cards-grid .candidate-card.is-non-qualified-after-count::before,
.cards-grid .candidate-card.is-annulled-after-count::before,
.cards-grid .candidate-card.is-annulled-sub-judice-after-count::before,
.party-list .candidate-card.is-qualified-after-count::before,
.party-list .candidate-card.is-non-qualified-after-count::before,
.party-list .candidate-card.is-annulled-after-count::before,
.party-list .candidate-card.is-annulled-sub-judice-after-count::before {
    display: none;
}

.municipios-section-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--am-slate-900);
}

@media (max-width: 640px) {
    .municipios-section-header {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 6px;
    }

    .municipios-section-header__updated {
        text-align: left;
    }

    .municipios-votos-recentes {
        text-align: left;
    }
}

.office-section + .office-section {
    margin-top: 32px;
}

/* Centralização das telas de municípios no desktop */
.municipios-container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 901px) {
    .municipios-container {
        max-width: 880px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 20px;
        padding-right: 20px;
    }
}

.municipios-table-wrap {
    background: var(--am-white);
    border: 1px solid #10263D14;
    border-radius: 16px;
    box-shadow: var(--am-shadow-soft);
    overflow: hidden;
}

.municipios-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.municipios-table thead th {
    text-align: center;
    padding: 14px 20px;
    background: linear-gradient(90deg, var(--am-blue-tint) 0%, var(--am-red-tint) 100%);
    color: var(--am-blue-dark);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.municipios-table tbody td {
    padding: 12px 20px;
    border-top: 1px solid var(--am-slate-200);
    color: var(--am-slate-900);
    font-size: 0.95rem;
}

.municipios-table--3cols th,
.municipios-table--3cols td,
.municipios-table th.col-municipio,
.municipios-table td.col-municipio,
.municipios-table th.col-votos,
.municipios-table td.col-votos,
.municipios-table th.col-percentual,
.municipios-table td.col-percentual {
    text-align: center;
}

.municipios-table--4cols th,
.municipios-table--4cols td {
    width: 25%;
    text-align: center;
}

.municipios-table--3cols th,
.municipios-table--3cols td,
.municipios-table--3cols th.col-municipio,
.municipios-table--3cols td.col-municipio,
.municipios-table--3cols th.col-votos,
.municipios-table--3cols td.col-votos,
.municipios-table--3cols th.col-percentual,
.municipios-table--3cols td.col-percentual {
    width: 33.333%;
}

.municipios-table .municipio-row {
    cursor: pointer;
}

.municipios-table tbody tr:hover td {
    background: #002E6D0A;
}

.municipios-table .municipio-row:focus-visible {
    outline: 3px solid var(--am-orange);
    outline-offset: -3px;
}

.municipios-table .col-municipio {
    font-weight: 700;
    color: var(--am-slate-900);
}

.municipios-table .candidato-nome {
    color: var(--am-blue-dark);
    text-decoration: none;
    font-weight: 700;
}

.municipios-table .candidato-nome:hover {
    color: var(--am-red);
    text-decoration: underline;
}

.municipios-table .col-votos,
.municipios-table .col-percentual,
.municipios-table .col-secoes {
    text-align: center;
    font-weight: 800;
    color: var(--am-blue-dark);
}

.municipio-secoes-progress {
    display: grid;
    gap: 4px;
    width: 100%;
    min-width: 110px;
}

.municipio-secoes-progress__track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #E9EDF2;
}

.municipio-secoes-progress__track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #0F766E;
}

.municipio-secoes-progress__value {
    font-size: 0.78rem;
    line-height: 1;
}

.municipios-table--muted tbody td {
    color: var(--am-slate-700);
}

.municipios-table__empty {
    text-align: center;
    padding: 22px 18px;
    color: var(--am-slate-700);
    font-style: italic;
}

@media (max-width: 742px) {
    .candidate-summary-card {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .candidate-summary-card .candidate-figure {
        margin-inline: auto;
    }

    .candidate-summary-card .candidate-body {
        align-items: center;
        text-align: center;
    }

    .candidate-summary-card .candidate-meta {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .candidate-summary-card {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .candidate-performance {
        width: 100%;
        min-width: 0;
        margin-left: 0;
        padding-top: 16px;
        padding-left: 0;
        border-top: 1px solid #03112D14;
        border-left: 0;
    }

    .candidate-summary-card .candidate-photo,
    .candidate-summary-card .candidate-iniciais {
        width: 112px;
        height: 112px;
        flex-basis: 112px;
    }

    .municipios-table thead th,
    .municipios-table tbody td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 560px) {
    .municipios-table--4cols {
        table-layout: fixed;
    }

    .municipios-table--4cols thead th,
    .municipios-table--4cols tbody td {
        padding: 8px 6px;
        font-size: 0.72rem;
    }

    .municipios-table--4cols thead th {
        line-height: 1.15;
        overflow-wrap: normal;
        word-break: normal;
    }

    .municipios-table--4cols .col-percentual {
        white-space: nowrap;
    }

    .municipios-table--4cols .col-secoes {
        width: 25%;
    }

    .municipios-table--4cols .municipio-secoes-progress {
        min-width: 0;
    }

    .municipios-col-secoes-label {
        display: inline-flex;
        flex-direction: column;
    }

    .municipios-table--4cols .candidato-nome {
        display: block;
        overflow-wrap: anywhere;
    }

    .municipio-secoes-progress__value {
        font-size: 0.7rem;
    }
}

.voted-candidates-entry {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 16px;
    border: 1px solid var(--am-blue-dark);
    border-radius: 14px;
    background: var(--am-blue-dark);
    color: var(--am-white);
    box-shadow: var(--am-shadow-soft);
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.voted-candidates-entry:hover,
.voted-candidates-entry:focus-visible {
    background: #001f4d;
    color: var(--am-white);
    transform: translateY(-1px);
}

.voted-candidates-container {
    max-width: 1120px;
    margin: 0 auto;
}

.voted-candidates-report {
    padding: 24px;
    border: 1px solid #10263D0D;
    border-radius: 18px;
    background: var(--am-white);
    box-shadow: var(--am-shadow-soft);
}

.voted-candidates-report__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #10263D18;
}

.voted-candidates-report__logo {
    display: none;
}

.voted-candidates-report__eyebrow {
    margin: 0 0 6px;
    color: #C8102E;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.voted-candidates-report h1 {
    margin: 0;
    color: var(--am-slate-900);
    font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.voted-candidates-count {
    margin: 9px 0 0;
    color: #536579;
    font-size: 0.95rem;
}

.voted-candidates-count strong,
.voted-candidates-count__totals strong {
    color: var(--am-blue-dark);
    font-weight: 750;
}

.voted-candidates-count__totals {
    margin: 5px 0 0;
    color: #536579;
    font-size: 0.88rem;
    line-height: 1.6;
}

.voted-candidates-report__footer {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px solid #10263D18;
    color: #65768A;
    font-size: 0.78rem;
    text-align: right;
}

.voted-candidates-report__footer p {
    margin: 3px 0;
}

.voted-candidates-report__footer time {
    color: var(--am-slate-900);
    font-weight: 700;
}

.voted-candidates-selector {
    min-width: min(100%, 280px);
}

.voted-candidates-selector label {
    display: block;
    margin-bottom: 6px;
    color: var(--am-slate-900);
    font-size: 0.82rem;
    font-weight: 750;
}

.voted-candidates-selector__trigger {
    display: block;
    cursor: pointer;
}

.voted-candidates-selector__trigger:focus-visible {
    outline: 3px solid #F2B544;
    outline-offset: 2px;
}

.map-page__main {
    width: min(1600px, calc(100% - 28px));
    margin: 28px auto 42px;
}

.map-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.map-heading h1 {
    margin: 4px 0 8px;
    color: var(--am-slate-900);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.1;
}

.map-heading p {
    max-width: 720px;
    margin: 0;
    color: #536579;
    line-height: 1.55;
}

.map-back-link {
    flex: 0 0 auto;
    color: var(--am-blue-700, #14558a);
    font-weight: 750;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.map-live-status {
    margin-bottom: 16px;
    padding: 12px 15px;
    border: 1px solid #dbe5ed;
    border-left: 4px solid #2772a8;
    border-radius: 8px;
    background: #f4f8fb;
    color: #31495f;
    font-size: 0.9rem;
    line-height: 1.45;
}

.map-live-status[data-state="falha"] {
    border-left-color: #a43d35;
    background: #fff5f3;
}

.map-live-status[data-state="parcial"],
.map-live-status[data-state="coletando"] {
    border-left-color: #c48116;
}

.map-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    align-items: start;
    gap: 12px;
}

.map-visual-card,
.map-locality-panel {
    min-width: 0;
    border: 1px solid #dce4eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 18px #10263d0b;
}

.map-visual-card {
    padding: 12px 10px 10px;
}

.map-visual-card__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--am-slate-900);
}

.map-visual-card__context {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.map-visual-card__header strong {
    font-size: 1.05rem;
}

.map-visual-card__scope {
    color: #405469;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: left !important;
}

.map-visual-card__header span {
    color: #64778a;
    font-size: 0.82rem;
    text-align: right;
}

.map-scope-candidates {
    margin: 10px 0 8px;
    padding: 10px;
    overflow: hidden;
    border: 1px solid #25374a;
    border-radius: 10px;
    background: rgba(7, 17, 29, 0.88);
}

.map-scope-candidates__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #fff;
}

.map-scope-candidates__heading strong {
    font-size: 0.88rem;
}

.map-scope-candidates__heading span {
    color: #c0ccd7;
    font-size: 0.72rem;
}

.map-scope-candidates__track {
    display: grid;
    grid-auto-columns: calc((75% - 30px) / 4);
    grid-auto-flow: column;
    gap: 10px;
    overflow-x: auto;
    padding: 1px 1px 7px;
    scroll-snap-type: x mandatory;
    scrollbar-color: #98a7b5 #25374a;
    scrollbar-width: thin;
}

.map-scope-candidate {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 102px;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    overflow: hidden;
    border: 1px solid #dce4eb;
    border-radius: 8px;
    background: #fff;
    color: #20384d;
    scroll-snap-align: start;
}

.map-scope-candidate__accent {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
}

.map-scope-candidate__identity {
    display: grid;
    min-width: 0;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 2px 8px;
    padding-top: 2px;
}

.map-scope-candidate__portrait {
    position: relative;
    display: grid;
    width: 36px;
    height: 36px;
    grid-row: span 2;
    place-items: center;
    overflow: hidden;
    border: 1px solid #10263d1f;
    border-radius: 50%;
    background: #e8eef3;
    color: #31495f;
    font-size: 0.78rem;
    font-weight: 750;
}

.map-scope-candidate__portrait.has-photo {
    color: transparent;
}

.map-scope-candidate__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-scope-candidate__identity > strong {
    display: -webkit-box;
    overflow: hidden;
    color: #20384d;
    font-size: 0.78rem;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.map-scope-candidate__party {
    overflow: hidden;
    color: #687a8a;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-scope-candidate__results {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding-top: 5px;
    border-top: 1px solid #e0e7ec;
    font-size: 0.75rem;
}

.map-scope-candidate__results strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-scope-candidate__results span {
    flex: 0 0 auto;
    color: #405469;
    font-weight: 700;
}

.map-svg-wrap {
    position: relative;
    width: 100%;
    margin: 8px auto 2px;
}

#apuration-map {
    display: block;
    width: 90%;
    margin-inline: auto;
    max-height: min(78vh, 760px);
    overflow: visible;
}

.map-area {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 0.8;
    vector-effect: non-scaling-stroke;
    transition: fill 600ms ease, fill-opacity 600ms ease, stroke 160ms ease, filter 160ms ease;
}

.map-area:hover,
.map-area:focus-visible,
.map-area.is-selected {
    stroke: #172a3c;
    stroke-width: 2;
    filter: brightness(1.08);
    outline: none;
}

.map-area.is-tie {
    stroke: #34495e;
    stroke-width: 1.1;
}

.map-area.is-unavailable {
    stroke: #65788b;
    stroke-width: 1;
}

.map-area.is-context-dimmed {
    fill: #e6ebf0 !important;
    fill-opacity: 1 !important;
}

.map-area.is-lead-change {
    animation: map-lead-change 1.1s ease-out;
}

.map-state-label,
.map-state-callout__line {
    pointer-events: none;
}

.map-state-label__code,
.map-state-label__percent {
    font-family: inherit;
    font-weight: 800;
    dominant-baseline: middle;
    letter-spacing: 0.01em;
    fill: #fff;
    paint-order: stroke;
    stroke: #172a3c;
    stroke-linejoin: round;
    stroke-width: 2px;
}

.map-state-label__code {
    font-size: 8px;
}

.map-state-label__photo {
    clip-path: circle(50%);
}

.map-state-label__photo-ring {
    fill: none;
    stroke: #fff;
    stroke-width: 2.5px;
    vector-effect: non-scaling-stroke;
}

.map-state-label__percent {
    font-size: 7.2px;
}

.map-state-label--callout .map-state-label__code,
.map-state-label--callout .map-state-label__percent {
    fill: #20384d;
    stroke: #fff;
    stroke-width: 2.5px;
}

.map-state-label--callout .map-state-label__photo-ring {
    stroke: #20384d;
    stroke-width: 2px;
}

.map-state-label--coastal-compact .map-state-label__code {
    font-size: 7.2px;
}

.map-state-label--coastal-compact .map-state-label__percent {
    font-size: 6.6px;
}

.map-state-callout__line {
    stroke: #34495e;
    stroke-opacity: 0.45;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

@keyframes map-lead-change {
    0% { filter: brightness(1.65); }
    100% { filter: brightness(1); }
}

.map-detail {
    min-height: 104px;
    padding: 14px 15px;
    border-radius: 9px;
    background: #f5f8fa;
}

.map-detail h2 {
    margin: 0 0 7px;
    color: var(--am-slate-900);
    font-size: 1.05rem;
}

.map-detail__empty,
.map-detail__lead-label {
    margin: 0;
    color: #5d6e7e;
    font-size: 0.88rem;
    line-height: 1.5;
}

.map-detail__lead-label {
    margin-bottom: 8px;
    font-weight: 650;
}

.map-candidate-row {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 9px;
    row-gap: 2px;
    padding: 6px 0;
    color: #293d50;
    font-size: 0.87rem;
}

.map-candidate-row + .map-candidate-row {
    border-top: 1px solid #e0e7ec;
}

.map-candidate-row__swatch {
    grid-row: span 2;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.map-candidate-row__identity {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

.map-candidate-row__portrait {
    position: relative;
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    overflow: hidden;
    border: 1px solid #10263d1f;
    border-radius: 50%;
    background: #e8eef3;
    color: #31495f;
    font-size: 0.72rem;
    font-weight: 750;
}

.map-candidate-row__portrait.has-photo {
    color: transparent;
}

.map-candidate-row__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-candidate-row__identity strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-candidate-row > span:not(.map-candidate-row__swatch),
.map-candidate-row small {
    grid-column: 2;
    color: #687a8a;
    font-size: 0.77rem;
}

.map-candidate-row b {
    grid-column: 3;
    grid-row: 1;
    color: #20384d;
    font-size: 0.95rem;
    text-align: right;
}

.map-candidate-row small {
    grid-column: 3;
    grid-row: 2;
    text-align: right;
}

.map-detail__sections {
    display: block;
    margin-top: 8px;
    color: #637688;
}

.map-detail__results-link {
    display: inline-block;
    margin-top: 9px;
    color: var(--am-blue-700, #14558a);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.map-popup {
    position: absolute;
    z-index: 2;
    width: min(310px, calc(100% - 20px));
    max-height: none;
    padding: 11px 13px 12px;
    overflow: visible;
    border: 1px solid #cbd7e0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 9px 28px #10263d30;
}

.map-popup[hidden] {
    display: none;
}

.map-popup__content .map-detail {
    min-height: 0;
    padding: 2px 0 0;
    border-radius: 0;
    background: transparent;
}

.map-popup__content .map-detail h2 {
    margin-bottom: 4px;
    font-size: 0.98rem;
}

.map-popup__content .map-detail__lead-label,
.map-popup__content .map-detail__empty {
    font-size: 0.78rem;
}

.map-popup__content .map-detail__lead-label {
    margin-bottom: 4px;
}

.map-popup__content .map-detail__vote-difference {
    padding: 4px 0;
    font-size: 0.72rem;
}

.map-popup__content .vote-difference__arrows {
    font-size: 0.64rem;
}

.map-popup__content .map-candidate-row {
    column-gap: 7px;
    padding: 4px 0;
    font-size: 0.78rem;
}

.map-popup__content .map-candidate-row__identity {
    gap: 5px;
}

.map-popup__content .map-candidate-row__portrait {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 0.64rem;
}

.map-popup__content .map-candidate-row__identity strong {
    font-size: 0.78rem;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: normal;
}

.map-popup__content .map-candidate-row > span:not(.map-candidate-row__swatch),
.map-popup__content .map-candidate-row small {
    font-size: 0.69rem;
}

.map-popup__content .map-candidate-row b {
    font-size: 0.83rem;
}

.map-popup__content .map-detail__sections {
    margin-top: 5px;
    font-size: 0.69rem;
}

@media (max-width: 600px) {
    .map-popup__content .map-detail__lead-label {
        margin-bottom: 2px;
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .map-popup__content .map-candidate-row {
        column-gap: 5px;
        row-gap: 0;
        padding: 2px 0;
    }

    .map-popup__content .map-candidate-row__portrait {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }

    .map-popup__content .map-candidate-row > span:not(.map-candidate-row__swatch) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .map-popup__content .map-detail__vote-difference {
        padding: 2px 0;
    }

    .map-popup__content .map-detail__sections {
        margin-top: 3px;
    }
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 14px;
}

.map-tone-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin-top: 12px;
    padding: 9px 11px;
    border: 1px solid #dce4eb;
    border-radius: 8px;
    background: #f8fafc;
    color: #405469;
    font-size: 0.73rem;
}

.map-tone-legend__scale,
.map-tone-legend__statuses,
.map-tone-legend__statuses span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.map-tone-legend__scale strong {
    color: #20384d;
}

.map-tone-legend__scale > i {
    display: inline-block;
    width: 76px;
    height: 10px;
    border: 1px solid #687b8d;
    border-radius: 999px;
    background-color: #fff;
    background-image: linear-gradient(
        90deg,
        #96b6d8 0%,
        #1d4678 100%
    );
}

.map-tone-legend__statuses {
    flex-wrap: wrap;
}

.map-tone-legend__swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    overflow: hidden;
    border: 1px solid #526273;
    border-radius: 3px;
}

.map-tone-legend__swatch--tie {
    background-color: #f8fafc;
    background-image: repeating-linear-gradient(
        45deg,
        #c8102e 0 3px,
        #f8fafc 3px 6px,
        #1559a6 6px 9px,
        #f8fafc 9px 12px
    );
}

.map-tone-legend__swatch--unavailable {
    background-color: #eef2f6;
    background-image: radial-gradient(#8b9aaa 1px, transparent 1px);
    background-size: 5px 5px;
}

.map-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #405469;
    font-size: 0.78rem;
}

.map-legend__item i {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border: 1px solid #10263d22;
    border-radius: 3px;
}

.map-source {
    margin: 13px 0 0;
    color: #748392;
    font-size: 0.73rem;
    line-height: 1.45;
}

.map-locality-panel {
    padding: 12px;
}

.map-locality-panel__heading p {
    margin: 0 0 10px;
    color: #687a8a;
    font-size: 0.7rem;
    line-height: 1.4;
}

.map-locality-panel label {
    display: block;
    margin-bottom: 6px;
    color: var(--am-slate-900);
    font-size: 0.8rem;
    font-weight: 750;
}

.map-locality-panel input {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #cdd8e1;
    border-radius: 7px;
    color: #23384b;
    font: inherit;
    font-size: 0.82rem;
}

.map-locality-panel input:focus-visible,
.map-locality-panel button:focus-visible {
    outline: 3px solid #f2b544;
    outline-offset: 2px;
}

.map-locality-panel ul {
    display: grid;
    align-content: start;
    gap: 3px;
    max-height: 500px;
    margin: 10px -4px 0;
    padding: 0 4px;
    overflow: auto;
    list-style: none;
}

.map-locality-panel__list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    color: #687a8a;
    font-size: 0.7rem;
}

.map-locality-panel__list-toolbar button {
    padding: 3px 6px;
    border: 1px solid #cbd7e2;
    border-radius: 5px;
    background: #fff;
    color: #24415b;
    cursor: pointer;
    font: inherit;
}

.map-locality-panel__list-toolbar button:focus-visible {
    outline: 3px solid #f2b544;
    outline-offset: 2px;
}

.map-locality-panel__empty {
    padding: 10px 8px;
    color: #687a8a;
    font-size: 0.75rem;
}

.map-locality-panel li button {
    display: grid;
    gap: 5px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #405469;
    cursor: pointer;
    font: inherit;
    text-align: left;
    line-height: 1.3;
}

.map-locality-panel__name {
    overflow: hidden;
    color: #405469;
    font-size: 0.75rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-locality-panel__leader {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.map-locality-panel__photo,
.map-locality-panel__initial {
    width: 28px;
    height: 28px;
    border: 1px solid #dce4eb;
    border-radius: 50%;
}

.map-locality-panel__photo {
    object-fit: cover;
}

.map-locality-panel__initial {
    display: grid;
    place-items: center;
    background: #eef3f7;
    color: #526273;
    font-size: 0.7rem;
    font-weight: 750;
}

.map-locality-panel__candidate-name {
    overflow: hidden;
    color: #23384b;
    font-size: 0.73rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-locality-panel__percentage {
    color: #23384b;
    font-size: 0.73rem;
    font-weight: 750;
    white-space: nowrap;
}

.map-locality-panel__status {
    color: #687a8a;
    font-size: 0.72rem;
}

.map-locality-panel li button:hover,
.map-locality-panel li button.is-selected {
    background: #edf4f8;
    color: #183f60;
}

.mapa-apuracao-entry__button {
    display: block;
    text-align: center;
    text-decoration: none;
}

@media (max-width: 850px) {
    .map-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .map-locality-panel ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 270px;
    }
}

@media (max-width: 600px) {
    .map-page__main {
        width: min(100% - 24px, 1600px);
        margin-top: 20px;
    }

    .map-heading {
        display: block;
    }

    .map-back-link {
        display: inline-block;
        margin-top: 13px;
    }

    .map-visual-card {
        padding: 12px;
    }

    .map-visual-card__header {
        align-items: flex-start;
    }

    .map-visual-card__header span {
        max-width: 52%;
    }

    #apuration-map {
        max-height: 68vh;
    }

    .map-locality-panel ul {
        grid-template-columns: minmax(0, 1fr);
        max-height: 230px;
    }
}

@media (max-width: 767px) {
    #apuration-map {
        width: 100%;
    }

    .map-scope-candidates {
        display: block;
        margin: 9px 0 7px;
        padding: 8px;
    }

    .map-scope-candidates__heading {
        display: block;
        margin-bottom: 7px;
    }

    .map-scope-candidates__heading span {
        display: block;
        margin-top: 2px;
    }

    .map-scope-candidates__track {
        grid-auto-columns: minmax(205px, 78%);
        gap: 8px;
        padding-bottom: 8px;
        touch-action: pan-x;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .map-scope-candidate {
        min-height: 96px;
        padding: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-area {
        transition: none;
    }

    .map-area.is-lead-change {
        animation: none;
    }
}

.voted-candidates-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.voted-candidate {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 12px 2px;
    border-bottom: 1px solid #10263D14;
}

.voted-candidate:last-child {
    border-bottom: 0;
}

.voted-candidate__photo,
.voted-candidate__initials {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 50%;
    background: #002E6D12;
    color: var(--am-blue-dark);
    object-fit: cover;
    font-weight: 800;
}

.voted-candidate__identity {
    min-width: 0;
    flex: 1;
}

.voted-candidate__identity h2 {
    margin: 0;
    color: var(--am-slate-900);
    font-size: 0.98rem;
    line-height: 1.3;
}

.voted-candidate__identity span {
    display: block;
    margin-top: 3px;
    color: #65768A;
    font-size: 0.82rem;
}

.voted-candidate__result {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    text-align: right;
}

.voted-candidate__result strong {
    color: var(--am-blue-dark);
    font-size: 0.97rem;
}

.voted-candidate__result span {
    color: #65768A;
    font-size: 0.82rem;
}

.voted-candidates-empty {
    margin: 0;
    padding: 28px 0 10px;
    color: #65768A;
    text-align: center;
}

.voted-candidates-back {
    margin: 16px 0 0;
    text-align: center;
}

.voted-candidates-back a {
    color: var(--am-blue-dark);
    font-weight: 700;
    text-decoration: none;
}

.voted-candidates-back a:hover,
.voted-candidates-back a:focus-visible {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .voted-candidates-report {
        padding: 18px 14px;
    }

    .voted-candidates-report__header {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
    }

    .voted-candidate {
        gap: 10px;
    }

    .voted-candidate__photo,
    .voted-candidate__initials {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .voted-candidate__identity h2 {
        font-size: 0.88rem;
    }

    .voted-candidate__result strong {
        font-size: 0.86rem;
    }

    .voted-candidate__result span {
        max-width: 120px;
        font-size: 0.72rem;
    }
}

@media print {
    @page {
        margin: 14mm;
    }

    body.voted-candidates-page {
        padding: 0;
        background: #fff;
        color: #111;
    }

    .voted-candidates-page .topbar,
    .voted-candidates-page .municipio-bar,
    .voted-candidates-page .voted-candidates-selector,
    .voted-candidates-page .voted-candidates-back,
    .voted-candidates-page .municipio-modal,
    .voted-candidates-page .site-footer {
        display: none !important;
    }

    .voted-candidates-page .voted-candidates-container {
        max-width: none;
        padding: 0;
    }

    .voted-candidates-report {
        padding: 0;
        padding-bottom: 25mm;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .voted-candidates-report__header {
        display: block;
        padding-bottom: 12px;
    }

    .voted-candidates-report__brand {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .voted-candidates-report__logo {
        display: block;
        width: 48px;
        height: auto;
        flex: 0 0 auto;
        margin: 0;
    }

    .voted-candidate {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .voted-candidate__photo,
    .voted-candidate__initials {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .voted-candidates-report__footer {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 10;
        margin: 0;
        padding: 8px 0 0;
        border-top: 1px solid #777;
        background: #fff;
        color: #444;
        font-size: 8pt;
        line-height: 1.25;
        text-align: center;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .voted-candidates-report__credit {
        margin-left: 6px;
        font-weight: 700;
    }
}

@media (min-width: 901px) {
    .office-header--with-recent-tools {
        display: grid;
        grid-template-columns: max-content max-content;
        grid-template-rows: auto auto auto;
        align-items: start;
        column-gap: 16px;
        row-gap: 6px;
    }

    .office-header--with-recent-tools .result-office-title {
        display: contents;
    }

    .office-header--with-recent-tools .result-office-title h2 {
        grid-column: 1;
        grid-row: 1;
    }

    .office-header--with-recent-tools .result-office-title .municipios-votos-recentes {
        grid-column: 1;
        grid-row: 2;
        margin-top: 0;
    }

    .office-header--with-recent-tools .result-tools {
        grid-column: 2;
        grid-row: 1;
        align-self: stretch;
        width: fit-content;
        margin-left: 0;
    }

    .office-header--with-recent-tools .result-filters {
        align-items: center;
    }

    .office-header--with-recent-tools .tse-messages {
        grid-column: 1 / -1;
        grid-row: 3;
    }
}
