/* Resultados Eleitorais -- page styles on top of the site's /style.css (its tokens, both themes).
   Map depth follows the site's município maps: the leader's colour mixed into --rs-mix at
   35 / 55 / 75 / 95 % for leads under 5, 5-15, 15-30 and 30+ points (build_modelo_gov_2026). */
/* single-quantity maps (STYLE §2.3): turnout in the accent, blank in grey, null in the lavender
   the style guide uses for one quantity; more = deeper in both themes */
:root { --rs-mix: var(--surface); --rs-none: var(--border); --rs-branco: #6b7280; --rs-nulo: #7d68b0; }
:root[data-tema="dark"] { --rs-mix: var(--fg); --rs-branco: #9aa1ab; --rs-nulo: #b9a6d9; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="light"]) { --rs-mix: var(--fg); --rs-branco: #9aa1ab; --rs-nulo: #b9a6d9; } }

main.rs { width: 92%; max-width: 1340px; }
.rs-kicker { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.rs h1 { margin-bottom: 6px; }
.rs .lede { margin-top: 0; }

/* controls */
.rs-controls { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: flex-end; margin: 18px 0 14px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.rs-ctl { display: flex; flex-direction: column; gap: 5px; }
.rs-ctl > span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.rs-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.rs-seg button { font: inherit; font-size: 14px; padding: 5px 11px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); border-radius: 4px; cursor: pointer; }
.rs-seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 600; }
.rs-seg button:disabled { opacity: .45; cursor: default; }
.rs-ctl select, .rs-ctl input { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); border-radius: 4px; min-width: 190px; }
/* other years, same place (operator, 2 Nov 2026) */
.rs-anos { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin: 16px 0 -6px; }
.rs-anos > span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.rs-anos .rs-seg { gap: 4px; }
.rs-year { font-size: 13.5px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg); color: var(--fg); text-decoration: none; font-variant-numeric: tabular-nums; }
a.rs-year[href]:hover { border-color: var(--accent); color: var(--accent); }
.rs-year[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 600; }
.rs-year[aria-disabled] { opacity: .4; cursor: not-allowed; }
.rs-year.rs-muni { border-style: dashed; }
.rs-crumbs { font-size: 14.5px; color: var(--muted); margin: 4px 0 10px; }
.rs-crumbs a { color: var(--accent); text-decoration: none; }
.rs-crumbs a:hover { text-decoration: underline; }

/* layout */
.rs-grid { display: grid; grid-template-columns: minmax(300px, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: start; }
/* the map column follows the reader, but a tall map (São Paulo's zonas) is capped to the window so
   the page never locks: the svg scales down to fit, and the panel scrolls if the legend does not */
.rs-mapcol { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow-y: auto; }
.rs-map { max-height: calc(100vh - 250px); }
.rs-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px; }
.rs-map { width: 100%; height: auto; display: block; }
.rs-map path { stroke: var(--surface); stroke-width: .35; cursor: pointer; }
.rs-map.rs-states path { stroke-width: 1; }
.rs-map path:hover { stroke: var(--fg); stroke-width: 1.4; }
.rs-map path.sel { stroke: var(--fg); stroke-width: 2.2; }
.rs-map path.dim { opacity: .35; }
/* UF labels on the Brasil map; callouts for the small eastern states are click targets */
.rs-ufl text { font-size: 13px; font-weight: 600; letter-spacing: .03em; fill: var(--fg); paint-order: stroke;
  stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.rs-ufl.out { cursor: pointer; }
.rs-ufl.out .hit { fill: transparent; }
.rs-ufl.out:hover text { text-decoration: underline; }
.rs-ufl.out rect:not(.hit) { stroke: var(--border); stroke-width: 1; }
.rs-lead { stroke: var(--muted); stroke-width: .8; stroke-dasharray: 2 2; fill: none; }
/* zone numbers on zona maps */
.rs-zl { font-weight: 600; fill: var(--fg); paint-order: stroke; stroke: var(--surface); stroke-width: 2.5px;
  stroke-linejoin: round; pointer-events: none; }
/* the overseas map */
.rs-world .rs-land { stroke: var(--surface); stroke-width: .4; cursor: default; }
.rs-world .rs-land.has { cursor: pointer; }
.rs-world .rs-land.has:hover { stroke: var(--fg); stroke-width: 1; }
.rs-world .dim { opacity: .28; }
.rs-world circle { stroke: var(--surface); stroke-width: .6; cursor: pointer; fill-opacity: .95; }
.rs-world circle:hover, .rs-world circle.sel { stroke: var(--fg); stroke-width: 1.6; }
.rs-grat { stroke: var(--border-soft); stroke-width: .6; }
.rs-grat.eq { stroke: var(--border); }
.rs-cont { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; fill: var(--muted); pointer-events: none; }
.rs-maptools { display: flex; gap: 6px; margin: 0 0 8px; }
.rs-maptools button { font: inherit; font-size: 12.5px; padding: 3px 9px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); border-radius: 4px; cursor: pointer; }
.rs-maptools button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.rs-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--fg-soft); }
.rs-legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.rs-depth { display: flex; gap: 2px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.rs-depth span.box { width: 22px; height: 9px; display: inline-block; }
.rs-mapnote { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }

/* results */
.rs-head h2 { font-size: 22px; margin: 0 0 2px; border: 0; padding: 0; }
.rs-status { font-size: 14.5px; color: var(--fg-soft); margin: 0 0 12px; }
.rs-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums lining-nums; }
.rs-table th { font-weight: 500; font-variant-caps: all-small-caps; letter-spacing: .03em; color: var(--muted);
  text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--border); }
.rs-table td { padding: 6px 6px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; color: var(--fg-soft); }
.rs-table td.num, .rs-table th.num { text-align: right; white-space: nowrap; }
.rs-table td.name { color: var(--fg); font-weight: 500; }
.rs-table td.name small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.rs-table tr.lead td.name { font-weight: 600; }
.rs-table .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.rs-head .sw.big { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 8px; vertical-align: 1px; }
.rs-table td.name a, .rs-table td a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.rs-table td.name a:hover, .rs-table td a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.rs-hint { font-variant-caps: normal; letter-spacing: 0; font-size: 12px; color: var(--muted); font-weight: 400; }
.rs-bar { height: 6px; border-radius: 3px; margin-top: 4px; min-width: 1px; }
.rs-badge { display: inline-block; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
  padding: 1px 7px; border-radius: 9px; margin-left: 6px; border: 1px solid var(--accent); color: var(--accent); }
.rs-badge.out { border-color: var(--muted); color: var(--muted); }
.rs-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 14px; margin: 14px 0 4px; }
.rs-totals div { font-size: 13px; color: var(--muted); }
.rs-totals b { display: block; font-size: 17px; font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums lining-nums; }
.rs-sub { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 20px 0 6px; }
.rs-more { font: inherit; font-size: 13.5px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 6px 0; }
.rs-note { font-size: 13px; color: var(--muted); }
.rs-scroll { max-height: 520px; overflow-y: auto; }
.rs-sources { margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--fg-soft); }
.rs-sources h2 { font-size: 15px; margin: 0 0 6px; border: 0; padding: 0; }
.rs-sources ul { margin: 6px 0 12px; padding-left: 18px; }
.rs-loading { color: var(--muted); font-size: 14px; padding: 20px 0; }
.rs-draft { display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  border: 1px dashed var(--muted); border-radius: 9px; padding: 1px 8px; margin-left: 8px; vertical-align: 3px; }

/* landing */
.rs-years { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.rs-years > a, .rs-years > span { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); text-decoration: none; color: var(--fg); font-size: 17px; font-weight: 500; }
.rs-years > a:hover { border-color: var(--accent); color: var(--accent); }
.rs-years > span { opacity: .55; }
.rs-years small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 3px; }
/* landing: the by-office index (operator, 2 Nov 2026) */
.rs-h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500;
  margin: 28px 0 0; }
.rs-offices { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 28px; margin: 12px 0 18px; }
.rs-offkind { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.rs-office { padding: 9px 0; border-top: 1px solid var(--border); }
.rs-office h3 { font-size: 14px; font-weight: 500; margin: 0 0 6px; }
.rs-office-years { display: flex; flex-wrap: wrap; gap: 5px; }
.rs-office-years a { font-size: 13.5px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); color: var(--fg); text-decoration: none; font-variant-numeric: tabular-nums; }
.rs-office-years a:hover { border-color: var(--accent); color: var(--accent); }
.rs-office-years small { display: inline; margin-left: 5px; font-size: 11.5px; color: var(--muted); }

@media (max-width: 900px) {
  main.rs { width: 100%; padding: 22px 16px 56px; }
  .rs-grid { grid-template-columns: 1fr; }
  .rs-mapcol { position: static; max-height: none; overflow: visible; }
  .rs-map { max-height: 70vh; }
  .rs-ctl select, .rs-ctl input { min-width: 0; width: 100%; }
}

.rs-metrics { flex-wrap: wrap; margin-bottom: 10px; }
