/* Extensão editorial: mantém Encode Sans, cores e superfícies do portal. */
.page-eleicoes .site-header { width: 100%; padding: 0 max(24px, calc((100% - var(--max)) / 2)); background: var(--violet); }
@media (max-width: 780px) {
    .page-eleicoes .site-header { padding: 0 16px; }
}
.election-home-wrap,
.election-page-content { width: min(var(--max), calc(100% - 48px)); margin-inline: auto; }
.election-home-wrap { padding-top: 26px; }
.election-panel { --election-flavio: #167347; --election-lula: #b1122b; border: 1px solid var(--line); border-radius: 8px; padding: 22px; background: var(--paper); font-variant-numeric: tabular-nums; }
.election-panel [hidden] { display: none !important; }
.election-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.election-heading h2 { --h2-size: 24px; --h2-weight: 800; margin: 0; color: var(--purple); font-size: 24px; line-height: 1.2; font-weight: 800; }
.election-heading > a { color: var(--purple); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.election-heading > span { font-size: 12px; color: var(--muted); }
.election-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.election-filters > label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 600; }
.election-filters select { min-height: 42px; max-width: 240px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); padding: 0 30px 0 12px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.election-filters select:disabled { opacity: .65; cursor: wait; }
.election-filters > .election-archive-toggle { display: flex; align-items: center; gap: 7px; min-height: 42px; font-size: 12px; color: var(--ink); cursor: pointer; }
.election-archive-toggle input { width: 16px; height: 16px; accent-color: var(--purple); }
.election-turns { display: flex; gap: 3px; margin: 0; padding: 0; border: 0; }
.election-turns legend { color: var(--muted); font-size: 11px; font-weight: 600; margin-bottom: 5px; }
.election-turns label { position: relative; cursor: pointer; }
.election-turns input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.election-turns span { display: grid; place-items: center; min-height: 42px; padding: 0 12px; background: var(--soft); border-radius: 6px; color: var(--ink); font-size: 12px; font-weight: 700; }
.election-turns input:checked + span { background: var(--yellow); }
.election-turns input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 3px; }
.election-refresh { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: var(--purple); min-height: 42px; padding: 0 10px; cursor: pointer; font-size: 12px; font-weight: 700; margin-left: auto; }
.election-refresh svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.election-refresh:hover { background: var(--soft); border-radius: 6px; }
.election-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 15px 0 8px; }
.election-location { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 13px; }
.election-flag { width: 24px; height: 18px; flex: none; border-radius: 2px; }
.election-progress { font-size: 12px; font-weight: 600; color: var(--purple); }
.election-message { padding: 9px 12px; margin: 4px 0 16px; background: var(--soft); color: var(--ink); font-size: 12px; border-radius: 5px; }
.election-message.is-warning { background: #fff5d1; color: #61480c; }
.election-scoreboard { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(230px, 1fr); gap: 24px; padding-top: 8px; }
.election-leaders { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.election-candidate { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 3px 10px; align-items: center; }
.election-portrait { position: relative; grid-row: span 2; display: grid; place-items: center; width: 46px; height: 52px; border-radius: 6px; overflow: hidden; background: var(--soft); color: var(--purple); font-size: 18px; font-weight: 800; }
.election-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.election-candidate-name { min-width: 0; }
.election-candidate-name h3 { --h3-size: 14px; --h3-weight: 800; margin: 0; line-height: 1.2; font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.election-candidate-name > span { color: var(--muted); display: block; font-size: 11px; line-height: 1.5; }
.election-candidate-name .election-candidate-status { color: var(--purple); font-weight: 700; }
.election-candidate-votes { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; grid-column: 2; }
.election-candidate-votes strong { color: var(--candidate-color); font-size: 22px; line-height: 1.3; font-weight: 800; }
.election-candidate-votes > span { color: var(--muted); font-size: 11px; }
.election-vote-bar { grid-column: 1 / -1; height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.election-vote-bar > span { display: block; height: 100%; background: var(--candidate-color); }
.election-difference { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.election-difference strong { color: var(--ink); }
.election-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; padding: 0 0 0 22px; border-left: 1px solid var(--line); margin: 0; align-content: start; }
.election-totals dt { color: var(--muted); font-size: 10px; font-weight: 500; }
.election-totals dd { font-size: 15px; line-height: 1.4; font-weight: 700; margin: 2px 0 0; }
.election-totals small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); }
.election-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; font-size: 10px; color: var(--muted); }
.election-footer a { font-weight: 700; color: var(--purple); text-decoration: underline; text-underline-offset: 3px; }
.election-views { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 12px 0 20px; }
.election-views button { border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; padding: 12px 3px; cursor: pointer; }
.election-views button[aria-pressed="true"] { border-bottom-color: var(--purple); color: var(--purple); }
.election-remaining { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 20px 36px; }
.election-remaining > h3 { --h3-size: 17px; --h3-weight: 700; grid-column: 1 / -1; font-size: 17px; margin: 0; }
.election-candidate--small .election-candidate-votes strong { font-size: 17px; }
.election-method { max-width: 90ch; font-size: 12px; color: var(--muted); margin: 22px 0 0; }
.election-map-panel { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1.6fr); gap: 36px; align-items: start; }
.election-map-panel h3 { --h3-size: 21px; --h3-weight: 700; font-size: 21px; color: var(--purple); margin: 14px 0 10px; }
.election-map-panel .election-candidate-name h3 { --h3-size: 14px; --h3-weight: 800; margin: 0; }
.election-map-panel p { font-size: 13px; line-height: 1.65; }
.election-map-detail { min-height: 100px; }
.election-map { position: relative; margin: 0; }
.election-map svg { display: block; width: 100%; max-height: 550px; }
.election-map path { cursor: pointer; stroke: var(--paper); stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: fill .2s ease; }
.election-map path:hover, .election-map path:focus-visible { stroke: var(--ink); stroke-width: 2; outline: none; }
.election-map path[aria-pressed="true"] { stroke: var(--purple); stroke-width: 3; }
.election-map svg text { pointer-events: none; text-anchor: middle; dominant-baseline: middle; fill: var(--ink); stroke: var(--paper); stroke-width: 3px; paint-order: stroke; font-size: 12px; font-weight: 700; }
.election-map-selection { display: grid; gap: 14px; margin-block: 18px; }
.election-map-selection > p { margin: 0; }
.election-map figcaption { font-size: 10px; color: var(--muted); padding-top: 12px; }
.election-map-tooltip { position: absolute; z-index: 5; width: min(310px, calc(100% - 16px)); padding: 13px; border-radius: 10px; background: var(--paper); color: var(--ink); box-shadow: 0 8px 28px #1c172033; }
.election-map-tooltip[data-interaction="hover"], .election-map-tooltip[data-interaction="hover"] * { pointer-events: none; }
.election-map-tooltip[data-interaction="hover"] > button { visibility: hidden; }
.election-map-tooltip h4 { margin: 0; padding-right: 22px; font-size: 15px; line-height: 1.3; font-weight: 800; }
.election-map-tooltip h4 > span { color: var(--muted); font-size: 10px; margin-left: 5px; font-weight: 500; }
.election-map-tooltip .election-tooltip-status { font-size: 10px; margin: 5px 0 8px; color: var(--muted); }
.election-map-tooltip ol { list-style: none; max-height: 285px; overflow-y: auto; overscroll-behavior: contain; padding: 0; margin: 0; scrollbar-width: thin; }
.election-map-tooltip li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 9px 0; border-top: 1px solid var(--line); }
.election-tooltip-photo { width: 28px; height: 32px; overflow: hidden; border-radius: 50%; background: var(--soft); }
.election-tooltip-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.election-tooltip-name strong { display: block; font-size: 10px; line-height: 1.3; }
.election-tooltip-name small { display: block; color: var(--muted); font-size: 9px; line-height: 1.3; margin-top: 3px; }
.election-tooltip-percent { font-size: 14px; font-weight: 800; white-space: nowrap; }
.election-map-tooltip .election-tooltip-time { margin: 8px 0 0; font-size: 9px; color: var(--muted); }
.election-map-tooltip > button { position: absolute; right: 5px; top: 4px; display: grid; place-items: center; width: 28px; height: 28px; padding: 5px; background: transparent; color: var(--muted); border: 0; cursor: pointer; }
.election-map-tooltip > button svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; }
.election-map-legend { display: grid; gap: 9px; margin-top: 22px; font-size: 12px; }
.election-map-legend > span { display: flex; gap: 8px; align-items: center; }
.election-map-legend i { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.election-map-neutral { background: #c9c4cd; }
.election-national { min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--purple); font-size: 12px; font-weight: 700; cursor: pointer; }
.election-national:hover { background: var(--soft); }
.election-panel :is(button, select):focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
.election-page-hero h1 { margin: 0 0 12px; }
.election-panel--compact { padding: 8px 10px 5px; border: 0; }
.election-panel--compact .election-heading,
.election-panel--compact .election-summary,
.election-panel--compact .election-filter-caption,
.election-panel--compact .election-turns legend,
.election-panel--compact .election-message:not(.is-warning) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.election-panel--compact .election-filters { gap: 6px; border: 0; padding-bottom: 4px; align-items: center; }
.election-filter-tag { display: grid; place-items: center; background: var(--yellow); border-radius: 999px; min-height: 30px; padding: 0 13px; font-size: 10px; font-weight: 700; }
.election-panel--compact .election-filters > label { display: block; }
.election-panel--compact .election-filters select { min-height: 30px; height: 30px; font-size: 11px; max-width: 180px; border-radius: 999px; padding-left: 10px; }
.election-panel--compact .election-turns { border: 1px solid var(--line); border-radius: 999px; padding: 1px; gap: 1px; }
.election-panel--compact .election-turns span { min-height: 26px; padding: 0 9px; border-radius: 999px; font-size: 10px; background: transparent; }
.election-panel--compact .election-turns input:checked + span { background: var(--yellow); }
.election-panel--compact .election-refresh { min-height: 30px; margin: 0; padding: 0 4px; }
.election-panel--compact .election-refresh svg { width: 15px; height: 15px; }
.election-panel--compact .election-refresh > span { display: none; }
.election-panel--compact .election-progress { font-size: 10px; font-weight: 500; margin-left: auto; }
.election-complete-link { font-size: 11px; font-weight: 700; color: var(--purple); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; padding: 6px; }
.election-panel--compact .election-message.is-warning { margin: 5px 0; padding: 6px 8px; font-size: 11px; }
.election-panel--compact .election-scoreboard { grid-template-columns: minmax(0, 2.4fr) minmax(240px, 1fr); gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.election-panel--compact .election-main-score { display: grid; grid-template-columns: minmax(0, 1fr) 120px; align-items: center; gap: 12px; }
.election-panel--compact .election-leaders { grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr); gap: 9px; align-items: center; }
.election-panel--compact .election-candidate { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 5px; }
.election-panel--compact .election-portrait { grid-row: 1; width: 36px; height: 43px; font-size: 13px; }
.election-panel--compact .election-candidate-name h3 { --h3-size: 12px; --h3-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.election-panel--compact .election-candidate-name > span { font-size: 9px; }
.election-panel--compact .election-candidate-name .election-candidate-status { display: none; }
.election-panel--compact .election-candidate-votes { grid-column: 3; display: block; text-align: right; white-space: nowrap; }
.election-panel--compact .election-candidate-votes strong { font-size: 17px; }
.election-panel--compact .election-candidate-votes > span { display: block; font-size: 9px; }
.election-panel--compact .election-leaders > .election-candidate:last-child { direction: rtl; }
.election-panel--compact .election-leaders > .election-candidate:last-child .election-candidate-votes { direction: ltr; text-align: left; }
.election-headtohead { display: flex; height: 6px; overflow: hidden; border-radius: 3px; background: var(--soft); }
.election-panel--compact .election-difference { display: grid; gap: 1px; align-content: center; margin: 0; padding-left: 12px; border-left: 1px solid var(--line); font-size: 9px; line-height: 1.3; }
.election-panel--compact .election-difference strong { font-size: 13px; color: var(--purple); }
.election-panel--compact .election-totals { padding-left: 12px; gap: 3px 12px; grid-template-columns: 1fr 1fr; }
.election-panel--compact .election-totals dt { font-size: 9px; line-height: 1.2; }
.election-panel--compact .election-totals dd { font-size: 12px; line-height: 1.15; margin: 1px 0 0; }
.election-panel--compact .election-totals small { display: inline; font-size: 9px; font-weight: 400; margin-left: 3px; }
.election-panel--compact .election-footer { border: 0; margin-top: 3px; padding-top: 0; font-size: 9px; }
.election-strip-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 10px; color: var(--muted); margin: 2px 0 4px; }
.election-strip-tools > div { display: inline-flex; align-items: center; gap: 5px; }
.election-strip-tools button { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; color: var(--purple); background: var(--paper); cursor: pointer; }
.election-strip-tools button:disabled { opacity: .4; cursor: default; }
.election-strip-tools svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.election-candidate-strip { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--purple) var(--soft); scroll-snap-type: x proximity; border: 1px solid var(--line); border-radius: 8px; }
.election-candidate-strip::-webkit-scrollbar { height: 5px; }
.election-candidate-strip::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }
.election-candidate-strip > ol { list-style: none; display: flex; gap: 0; padding: 0; margin: 0; }
.election-candidate-strip li { flex: 0 0 248px; min-width: 0; padding: 8px 12px; border-right: 1px solid var(--line); scroll-snap-align: start; }
.election-candidate-strip li:last-child { border-right: 0; }
.election-panel--compact .election-candidate-strip .election-candidate-status { display: block; color: var(--purple); font-size: 8px; }
@media (max-width: 1100px) {
    .election-panel--compact .election-scoreboard { grid-template-columns: minmax(0, 1fr) 230px; }
    .election-panel--compact .election-main-score { display: block; }
    .election-panel--compact .election-difference { display: flex; flex-wrap: wrap; gap: 5px; border: 0; padding: 4px 0 0; }
    .election-panel--compact .election-difference strong { font-size: 10px; }
    .election-panel--compact .election-leaders { grid-template-columns: 1fr 36px 1fr; }
}
@media (max-width: 800px) {
    .election-scoreboard { grid-template-columns: 1fr; gap: 18px; }
    .election-totals { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .election-map-panel { grid-template-columns: 1fr; gap: 8px; }
    .election-map-detail { min-height: 0; }
    .election-map-legend { margin-top: 14px; }
    .election-panel--compact .election-scoreboard { grid-template-columns: 1fr; gap: 8px; }
    .election-panel--compact .election-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 0; border-top: 1px solid var(--line); padding: 7px 0 0; }
    .election-panel--compact .election-totals small { display: block; margin: 0; }
}
@media (max-width: 520px) {
    .election-home-wrap, .election-page-content { width: calc(100% - 28px); }
    .election-panel { padding: 16px 12px; }
    .election-panel--compact { padding: 5px 0; }
    .election-heading { align-items: start; }
    .election-heading h2 { --h2-size: 20px; font-size: 20px; }
    .election-heading > a { font-size: 11px; }
    .election-heading > span { display: none; }
    .election-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .election-filters select { width: 100%; max-width: none; min-width: 0; }
    .election-filters > label { min-width: 0; }
    .election-filters > label[data-election-city-label] { grid-column: 1 / -1; }
    .election-turns { grid-column: 1; }
    .election-turns span { padding-inline: 9px; white-space: nowrap; }
    .election-refresh { align-self: end; margin-left: auto; padding-inline: 2px; }
    .election-summary { gap: 5px; padding-top: 12px; }
    .election-location { font-size: 12px; }
    .election-progress { font-size: 11px; }
    .election-leaders { gap: 16px; }
    .election-candidate { grid-template-columns: 34px minmax(0, 1fr); gap: 5px 7px; }
    .election-portrait { width: 34px; height: 44px; grid-row: 1; }
    .election-candidate-name h3 { --h3-size: 12px; font-size: 12px; }
    .election-candidate-votes { grid-column: 1 / -1; }
    .election-candidate-votes strong { font-size: 21px; }
    .election-candidate-votes > span { font-size: 10px; }
    .election-totals { grid-template-columns: 1fr 1fr; gap: 10px; }
    .election-totals dd { font-size: 14px; }
    .election-remaining { grid-template-columns: 1fr; }
    .election-remaining .election-candidate { grid-template-columns: 34px minmax(0, 1fr) auto; }
    .election-remaining .election-candidate-votes { grid-column: 3; display: block; text-align: right; }
    .election-remaining .election-candidate-votes > span { display: block; }
    .election-footer { font-size: 10px; }
    .election-panel--compact .election-filters { display: flex; gap: 5px; }
    .election-panel--compact .election-filters > label { width: auto; flex: 1 0 30%; min-width: 90px; }
    .election-panel--compact .election-filters > label[data-election-city-label] { flex-basis: 100%; }
    .election-panel--compact .election-filters select { width: 100%; max-width: none; font-size: 10px; padding-right: 18px; }
    .election-panel--compact .election-filter-tag { display: none; }
    .election-panel--compact .election-turns { flex: none; }
    .election-panel--compact .election-turns span { padding-inline: 7px; }
    .election-panel--compact .election-progress { font-size: 9px; margin-left: 0; }
    .election-panel--compact .election-complete-link { font-size: 10px; margin-left: auto; padding: 3px 0; }
    .election-panel--compact .election-scoreboard { padding: 8px; }
    .election-panel--compact .election-leaders { grid-template-columns: 1fr 1fr; gap: 12px; }
    .election-panel--compact .election-headtohead { display: none; }
    .election-panel--compact .election-candidate { grid-template-columns: 28px minmax(0, 1fr); }
    .election-panel--compact .election-portrait { width: 28px; height: 34px; }
    .election-panel--compact .election-candidate-name h3 { --h3-size: 11px; }
    .election-panel--compact .election-candidate-votes { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 5px; }
    .election-panel--compact .election-leaders > .election-candidate:last-child { direction: ltr; }
    .election-panel--compact .election-candidate-votes strong { font-size: 17px; }
    .election-panel--compact .election-totals dd { font-size: 11px; }
    .election-panel--compact .election-totals dt { font-size: 8px; }
    .election-panel--compact .election-footer { font-size: 8px; }
    .election-candidate-strip li { flex-basis: 210px; padding: 8px; }
    .election-panel--compact .election-candidate-strip .election-candidate { grid-template-columns: 28px minmax(0, 1fr) auto; }
    .election-panel--compact .election-candidate-strip .election-candidate-votes { grid-column: 3; display: block; }
    .election-strip-tools { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    .election-map path { transition: none; }
}
