:root {
  color-scheme: light;
  --ink: #18243a;
  --muted: #68758b;
  --line: #dfe5ee;
  --paper: #fff;
  --canvas: #f3f5f9;
  --navy: #263b66;
  --blue: #365bc4;
  --purple: #6546ad;
  --accent: #e8edff;
  --green: #167d53;
  --amber: #8a5408;
  --shadow: 0 12px 34px rgba(25, 39, 68, .065);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 15px; line-height: 1.45; }
button, select { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; z-index: 10; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-150%); color: white; background: #171c2c; border-radius: 7px; }
.skip-link:focus { transform: translateY(0); }
.masthead { color: #fff; background: linear-gradient(110deg, #22365e 0%, #354a82 54%, #554484 100%); box-shadow: 0 2px 12px #17294b20; }
.masthead-inner { width: min(1160px, calc(100% - 40px)); min-height: 72px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid #ffffff6a; border-radius: 11px; background: #ffffff15; font-size: 20px; font-weight: 800; }
.brand-copy { display: grid; line-height: 1.12; }
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 5px; color: #d1d9ec; font-size: 9px; font-weight: 750; letter-spacing: .14em; }
.masthead-note { display: flex; align-items: center; gap: 9px; color: #e0e5f1; font-size: 12px; font-weight: 600; }
.private-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; color: #e9e5ff; border: 1px solid #bdb0ed6b; border-radius: 6px; background: #251a4933; font-size: 9px; font-weight: 750; letter-spacing: .015em; }
.private-badge span { color: #c1b2ff; font-size: 9px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #a8e8c7; box-shadow: 0 0 0 4px #a8e8c728; }
.page-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 35px 0 22px; }
.eyebrow, .control-kicker { margin: 0; color: #69758b; font-size: 10px; font-weight: 800; letter-spacing: .115em; }
.intro .eyebrow { color: var(--purple); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 7px 0 5px; font-size: clamp(25px, 3vw, 34px); line-height: 1.13; letter-spacing: -.045em; }
.intro-copy { margin: 0; color: var(--muted); font-size: 14px; }
.source-chip { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: #4e5d73; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 10px; line-height: 1.3; white-space: nowrap; }
.source-chip strong { color: #273650; font-size: 11px; }
.source-seal, .tse-mini { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; color: #fff; background: var(--navy); border-radius: 50%; font-size: 9px; font-weight: 900; letter-spacing: -.03em; }
.control-panel { padding: 17px 20px 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: var(--shadow); }
.mode-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.mode-label { display: grid; gap: 3px; }
.control-hint { color: var(--muted); font-size: 11px; }
.segmented { display: inline-flex; align-items: center; padding: 3px; background: #f0f2f7; border: 1px solid #e5e8ef; border-radius: 9px; }
.segmented button { min-height: 34px; padding: 6px 13px; color: #66738a; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; white-space: nowrap; transition: background .16s ease, color .16s ease, box-shadow .16s ease; }
.segmented button[aria-pressed="true"] { color: #283d70; background: #fff; box-shadow: 0 1px 4px #1b2b491c; }
.segmented button:hover:not([aria-pressed="true"]) { color: #293956; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #8ba9ff; outline-offset: 2px; }
.simulation-notice { display: flex; align-items: start; gap: 9px; margin-top: 14px; padding: 10px 12px; color: #734b0d; background: #fff8e9; border: 1px solid #f0dfb6; border-radius: 8px; font-size: 11px; }
.simulation-notice strong { font-weight: 800; }
.notice-icon { display: grid; flex: 0 0 auto; width: 17px; height: 17px; place-items: center; color: #fff; background: #c58a25; border-radius: 50%; font-size: 11px; font-weight: 800; }
.filter-row { display: flex; align-items: end; gap: 13px; margin-top: 16px; }
.scope-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.scope-field legend, .select-field .control-kicker { display: block; margin-bottom: 6px; }
.scope-switch button { min-width: 97px; }
.select-field { display: grid; min-width: 170px; }
.select-field select { width: 100%; height: 42px; padding: 0 36px 0 12px; color: #273650; border: 1px solid #d9dfeb; border-radius: 8px; background-color: #fff; cursor: pointer; font-size: 12px; font-weight: 650; }
.municipality-field { min-width: 220px; flex: 1; }
.results-section { margin-top: 25px; }
.results-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.results-heading-row .eyebrow { margin-bottom: 3px; color: var(--purple); }
h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; line-height: 1.2; }
.view-switch { padding: 2px; }
.view-switch button { min-height: 29px; padding: 4px 11px; font-size: 11px; }
.result-state { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 15px 18px; color: #34445e; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.result-state[hidden], [hidden] { display: none !important; }
.result-state strong, .result-state small { display: block; }
.result-state strong { font-size: 13px; }
.result-state small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.state-spinner { width: 19px; height: 19px; border: 2px solid #dbe2f3; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-banner { margin-bottom: 12px; padding: 11px 13px; color: #8a3030; background: #fff0f0; border: 1px solid #f1cbcb; border-radius: 8px; font-size: 12px; }
.error-banner a { color: inherit; font-weight: 800; }
.results-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 32px; margin-bottom: 9px; color: #6d798d; font-size: 11px; }
.count-summary { display: flex; align-items: center; gap: 7px; }
.count-summary strong { color: #28364e; font-size: 12px; }
.meta-divider { width: 1px; height: 13px; margin: 0 3px; background: #cbd2df; }
.stale-label { color: #865b13; font-size: 10px; font-weight: 700; }
.candidate-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.candidate-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 3px 12px #1b29400a; }
.candidate-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rank-number { display: grid; flex: 0 0 auto; width: 25px; height: 25px; place-items: center; color: #546887; background: #f0f3f8; border-radius: 7px; font-size: 10px; font-weight: 850; font-variant-numeric: tabular-nums; }
.candidate-photo { display: grid; flex: 0 0 auto; width: 52px; height: 52px; overflow: hidden; place-items: center; color: #fff; background: linear-gradient(145deg, #425d9c, #7655a2); border-radius: 50%; font-size: 16px; font-weight: 800; }
.candidate-photo img { width: 100%; height: 100%; object-fit: cover; }
.candidate-info { min-width: 0; flex: 1; }
.candidate-name { overflow: hidden; color: #1f2c42; font-size: 15px; font-weight: 760; line-height: 1.22; text-overflow: ellipsis; }
.candidate-subline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; color: #69768b; font-size: 11px; }
.candidate-number { color: #344a7c; font-weight: 800; font-variant-numeric: tabular-nums; }
.candidate-party { padding: 2px 6px; color: #59677f; background: #f0f2f6; border-radius: 4px; font-weight: 700; }
.candidate-result { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 13px; }
.candidate-votes { color: #506078; font-size: 11px; font-variant-numeric: tabular-nums; }
.candidate-percent { color: var(--navy); font-size: 20px; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.candidate-percent small { color: #8090a6; font-size: 10px; font-weight: 600; }
.candidate-bar { height: 5px; overflow: hidden; margin-top: 7px; background: #edf0f6; border-radius: 9px; }
.candidate-bar span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, #4165cb, #7958b8); transition: width .25s ease; }
.candidate-status { display: inline-flex; margin-top: 8px; padding: 3px 7px; color: var(--green); background: #e8f6ef; border-radius: 5px; font-size: 9px; font-weight: 800; }
.candidate-results[data-view="list"] { display: flex; flex-direction: column; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.candidate-results[data-view="list"] .candidate-card { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(120px, .8fr) minmax(130px, .8fr); align-items: center; gap: 15px; padding: 10px 14px; border: 0; border-bottom: 1px solid #edf0f4; border-radius: 0; box-shadow: none; }
.candidate-results[data-view="list"] .candidate-card:last-child { border-bottom: 0; }
.candidate-results[data-view="list"] .candidate-photo { width: 39px; height: 39px; font-size: 13px; }
.candidate-results[data-view="list"] .rank-number { width: 22px; height: 22px; }
.candidate-results[data-view="list"] .candidate-name { font-size: 13px; }
.candidate-results[data-view="list"] .candidate-result { margin: 0; }
.candidate-results[data-view="list"] .candidate-percent { font-size: 16px; }
.candidate-results[data-view="list"] .candidate-bar { margin: 0; }
.candidate-results[data-view="list"] .candidate-status { margin-top: 4px; }
.empty-detail { margin-top: 10px; color: #78859a; font-size: 11px; }
.map-section { margin-top: 22px; }
.map-section .eyebrow { margin-bottom: 2px; color: var(--purple); }
.map-hint { color: #78859a; font-size: 10px; }
.map-panel { display: grid; grid-template-columns: minmax(0, 1fr) 235px; align-items: center; gap: 16px; min-height: 230px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mt-map { display: grid; min-height: 205px; place-items: center; }
.mt-map svg { display: block; width: min(100%, 290px); max-height: 230px; overflow: visible; }
.mt-map path { fill: #dce7f5; stroke: #fff; stroke-width: 1.15; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: fill .12s ease, stroke .12s ease; }
.mt-map path[data-municipality-code] { cursor: pointer; }
.mt-map path[data-municipality-code]:hover, .mt-map path[data-municipality-code]:focus-visible { fill: #aec2eb; stroke: #526ca5; stroke-width: 2; outline: none; }
.mt-map path.is-selected { fill: #6b5ab0; stroke: #fff; stroke-width: 1.8; }
.map-loading { max-width: 230px; color: #7b8799; font-size: 11px; text-align: center; }
.map-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 12px; color: #748097; background: #f6f7fb; border-radius: 8px; font-size: 10px; }
.map-key { width: 10px; height: 10px; border: 1px solid #7b6bbc; border-radius: 3px; background: #6b5ab0; }
.map-caption #map-selection { flex: 0 0 100%; padding-left: 17px; color: #283956; font-size: 12px; font-weight: 750; }
.map-footnote { margin: 7px 1px 0; color: #818da0; font-size: 10px; }
.stats-section { margin-top: 21px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
h3 { margin: 0; font-size: 14px; letter-spacing: -.015em; }
.stats-scope { color: #738097; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat-card { min-width: 0; min-height: 104px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.stat-label { display: block; color: #738097; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.stat-card strong { display: block; margin-top: 8px; color: #273b67; font-size: 21px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-detail { display: block; margin-top: 6px; overflow: hidden; color: #728096; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.progress-track { height: 4px; overflow: hidden; margin-top: 8px; background: #ebeff6; border-radius: 9px; }
.progress-track span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.data-footnote { display: flex; align-items: center; gap: 8px; margin: 13px 1px 0; color: #7b8799; font-size: 10px; }
.tse-mini { width: 21px; height: 21px; font-size: 6px; }
.data-footnote #source-state { margin-left: auto; color: #52627a; font-weight: 700; white-space: nowrap; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; width: min(1160px, calc(100% - 40px)); margin: 28px auto 0; padding: 14px 0 22px; color: #8490a2; border-top: 1px solid #dce2eb; font-size: 10px; }
.page-footer span:first-child { color: #50617d; font-weight: 750; }

@media (max-width: 720px) {
  .masthead-inner, .page-shell, .page-footer { width: min(100% - 28px, 580px); }
  .masthead-inner { min-height: 64px; }
  .intro { align-items: start; padding-top: 27px; }
  .source-chip { margin-top: 7px; }
  .control-panel { padding: 15px; }
  .filter-row { flex-wrap: wrap; }
  .scope-field { flex: 1 1 100%; }
  .scope-switch { width: 100%; }
  .scope-switch button { flex: 1; }
  .select-field { min-width: 0; flex: 1 1 40%; }
  .municipality-field { flex-basis: 55%; }
  .candidate-results { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .candidate-results[data-view="list"] .candidate-card { grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; }
  .candidate-results[data-view="list"] .candidate-bar { grid-column: 1 / -1; grid-row: 2; }
  .candidate-results[data-view="list"] .candidate-result { grid-column: 2; grid-row: 1; }
  .candidate-results[data-view="list"] .candidate-photo { width: 36px; height: 36px; }
  .map-panel { grid-template-columns: minmax(0, 1fr) 180px; gap: 10px; padding: 12px; }
  .mt-map { min-height: 190px; }
}
@media (max-width: 470px) {
  body { font-size: 14px; }
  .masthead-inner, .page-shell, .page-footer { width: calc(100% - 24px); }
  .masthead-note { font-size: 10px; }
  .brand-copy strong { font-size: 15px; }
  .brand-mark { width: 35px; height: 35px; }
  .intro { display: block; padding: 23px 0 16px; }
  h1 { font-size: 27px; }
  .intro-copy { max-width: 290px; font-size: 12px; }
  .source-chip { display: inline-flex; margin-top: 13px; padding: 6px 9px; }
  .source-seal { width: 29px; height: 29px; }
  .mode-row { display: grid; gap: 10px; }
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1; padding-inline: 7px; font-size: 10px; }
  .control-hint { font-size: 10px; }
  .simulation-notice { font-size: 10px; }
  .filter-row { gap: 9px; margin-top: 13px; }
  .select-field { flex-basis: calc(50% - 5px); }
  .municipality-field { flex-basis: 100%; }
  .select-field select { height: 40px; }
  .results-section { margin-top: 21px; }
  .results-heading-row { align-items: center; }
  h2 { font-size: 20px; }
  .view-switch button { padding-inline: 9px; }
  .candidate-card { padding: 13px; }
  .candidate-photo { width: 46px; height: 46px; }
  .candidate-name { font-size: 14px; }
  .map-section .section-title-row { align-items: start; flex-direction: column; gap: 4px; }
  .map-panel { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .mt-map { min-height: 205px; }
  .mt-map svg { width: min(100%, 270px); }
  .map-caption { justify-content: center; }
  .map-caption #map-selection { text-align: center; padding-left: 0; }
  .stats-grid { gap: 7px; }
  .stat-card { min-height: 97px; padding: 10px; }
  .stat-label { font-size: 8px; }
  .stat-card strong { font-size: 19px; }
  .stat-detail { font-size: 9px; }
  .data-footnote { align-items: start; font-size: 9px; }
  .data-footnote #source-state { white-space: normal; text-align: right; }
  .page-footer { flex-direction: column; gap: 3px; margin-top: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.embedded-panel .masthead,.embedded-panel .page-footer{display:none}
.candidate-pagination{grid-column:1/-1;display:flex;gap:12px;flex-wrap:wrap;align-items:center;padding:18px 0}.candidate-pagination button{min-height:44px;border:1px solid #d5cbe5;background:white;color:#563879;border-radius:8px;padding:10px 16px;cursor:pointer}.candidate-pagination button:disabled{opacity:.45;cursor:default}.candidate-pagination span{font-size:13px}
.candidate-details-button,.detail-action,.detail-back,.detail-tabs button,.detail-party-list button{cursor:pointer;min-height:44px;border:1px solid #d5cbe5;background:#fff;color:#563879;border-radius:8px;padding:10px 14px;font:600 14px/1.5 inherit}
.candidate-details-button{margin-top:14px;width:100%;text-align:left}
.detail-panel{margin-top:22px;background:#fff;border:1px solid #e0e5ec;border-radius:12px;padding:24px}
.detail-back{margin-bottom:16px}.detail-source{color:#65517f;background:#f1edf7;border-radius:8px;padding:12px;font-size:14px;line-height:1.7}
.detail-panel h2{margin:18px 0 8px;font-size:28px;line-height:1.35}.detail-panel h3{font-size:21px;margin:20px 0 14px}.detail-panel p{line-height:1.75;margin:12px 0}
.detail-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:22px 0}.detail-tabs [aria-current=page]{background:#624489;color:white;border-color:#624489}
.detail-filters{display:flex;flex-wrap:wrap;gap:14px;margin-bottom:20px}.detail-filters label{display:flex;flex-direction:column;gap:7px;flex:1 1 200px;font-size:14px;font-weight:600}.detail-filters select{min-height:44px;width:100%;min-width:0;border:1px solid #cfd6e2;border-radius:8px;background:white;padding:10px;color:#202a3d;font-size:16px}
.detail-facts{margin:18px 0}.detail-facts>div{display:grid;grid-template-columns:minmax(160px,1fr) 2fr;gap:20px;padding:14px 0;border-bottom:1px solid #e7eaf0}.detail-facts dt{font-weight:600}.detail-facts dd{margin:0;overflow-wrap:anywhere;line-height:1.65}
.detail-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.detail-metrics article{background:#f5f7fa;border:1px solid #e1e5ed;border-radius:10px;padding:18px}.detail-metrics span{display:block;font-size:13px;line-height:1.6;color:#566277}.detail-metrics strong{display:block;margin-top:10px;font-size:25px;overflow-wrap:anywhere}
.detail-notice{border-left:4px solid #7657a2;background:#f4f0fa;padding:16px}.detail-party-list{display:grid;gap:9px}.detail-party-list button{text-align:left}
.detail-photo{width:88px;height:104px;object-fit:cover;border-radius:10px;margin:0 0 12px;border:1px solid #e0e5ec}
.candidate-details-button:focus-visible,.detail-panel button:focus-visible,.detail-filters select:focus-visible{outline:3px solid #936bc1;outline-offset:3px}
@media(max-width:600px){.detail-panel{padding:16px}.detail-panel h2{font-size:24px}.detail-metrics{grid-template-columns:1fr}.detail-facts>div{grid-template-columns:1fr;gap:5px}.detail-filters{display:block}.detail-filters label{margin-bottom:14px}.detail-tabs button{flex:1 1 auto}}
/* Horários separados: publicação do TSE, coleta do servidor e entrega ao navegador. */
.refresh-panel{margin:0 0 18px;padding:14px 18px;background:#fff;border:1px solid #e1dce9;border-radius:12px;color:#554b65;font-size:13px}.refresh-panel>div:first-child{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}.refresh-panel small{display:block;margin-top:7px;line-height:1.6}.refresh-track{height:5px;margin-top:10px;background:#ece7f3;border-radius:4px;overflow:hidden}.refresh-track span{display:block;height:100%;width:0;background:#67438c;transition:width 1s linear}@media(prefers-reduced-motion:reduce){.refresh-track span{transition:none}}
