/* Election results: home block (or the older home strip), the result link in Política and /apuracao. Loaded only on
   those pages (functions.php).
   Results always sit on a light panel (also in the dark theme): each candidate has a side stripe, percentage and bar in
   their own color (--apu-cor, set per item by the template). WCAG AA: red 4.99:1, blue 5.93:1, gray 7.58:1 on white;
   white on the green badge 4.77:1. */
.apu-faixa, .apu-page, .apu-home, .apu-resultado-link, .apu-litoral, .apu-urgentes {
  --apu-tinta: #0b1b2b;
  --apu-votos: #5b6675;
  --apu-trilho: #e6eaf0;
  --apu-painel: #fff;
  --apu-verde: #16843f;
  --apu-cinza: #4a5563;
  --apu-azul: #0b4fa8;
  --apu-fundo: #f5f7fa;
}

/* Home strip: portal blue frame, white panel with the two candidates. */
.apu-faixa { color: #fff; background: var(--lnh-primary, var(--lnh-deep-blue)); }
.apu-faixa-inner { display: grid; gap: .5rem; width: min(calc(100% - 2rem), 1200px); margin-inline: auto; padding-block: .7rem .8rem; }
.apu-faixa-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .7rem; margin: 0; font-size: .85rem; }
.apu-faixa-label strong { font-size: .95rem; }
.apu-faixa-label span { color: #d3e2ea; }
.apu-faixa .apu-ensaio { padding: .05rem .45rem; border-radius: .25rem; color: var(--apu-tinta); background: #ffd76a; font-size: .75rem; font-weight: 700; }
.apu-faixa-cands { display: grid; gap: .65rem; margin: 0; padding: .75rem .85rem; border-radius: .6rem; color: var(--apu-tinta); background: var(--apu-painel); list-style: none; }
.apu-faixa-cands li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: .15rem .6rem; padding-left: .7rem; border-left: 6px solid var(--apu-cor, var(--apu-cinza)); }
.apu-faixa-name { min-width: 0; font-weight: 700; }
.apu-faixa .apu-bar { grid-column: 1 / -1; }
.apu-faixa-meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin: 0; color: #d3e2ea; font-size: .8rem; }
.apu-faixa-meta a { margin-left: auto; color: #fff; font-weight: 700; }
@media (min-width: 700px) {
  .apu-faixa-cands { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
}

/* Results page */
.apu-page { padding-top: 1.25rem; }
.apu-status { margin: 0 0 1rem; color: var(--lnh-muted); font-size: .9rem; }
.apu-status--ensaio { padding: .55rem .75rem; border-left: 3px solid #e2a300; color: var(--lnh-ink); background: var(--lnh-soft); }
.apu-status--alerta { padding: .55rem .75rem; border-left: 3px solid #c0392b; color: var(--lnh-ink); background: var(--lnh-soft); }
.apu-section { margin-top: 1.75rem; }
.apu-section-title { margin: 0 0 .8rem; padding-bottom: .4rem; border-bottom: 2px solid var(--lnh-blue); font-size: clamp(1.15rem, 3.5vw, 1.4rem); }
.apu-grid { display: grid; gap: .8rem; margin-top: .8rem; }
.apu-box { padding: .9rem .95rem; border: 1px solid var(--apu-trilho); border-radius: .6rem; color: var(--apu-tinta); background: var(--apu-painel); }
.apu-box--destaque { border-color: #c9d2de; box-shadow: 0 .2rem .8rem #0b1b2b14; }
.apu-box-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .8rem; }
.apu-box-head h2, .apu-box-head h3 { margin: 0; color: var(--apu-tinta); font-size: 1.05rem; }
.apu-box--destaque .apu-box-head h2 { font-size: 1.25rem; }
.apu-urnas { color: var(--apu-votos); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.apu-progress { height: .3rem; margin: .55rem 0 .8rem; border-radius: 1rem; background: var(--apu-trilho); overflow: hidden; }
.apu-progress span { display: block; height: 100%; background: var(--apu-cinza); }
.apu-cands { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.apu-cand { padding-left: .75rem; border-left: 6px solid var(--apu-cor, var(--apu-cinza)); }
.apu-cand-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.apu-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .45rem; min-width: 0; color: var(--apu-tinta); }
.apu-party { color: var(--apu-votos); font-size: .78rem; }
/* Same size for every candidate (neutrality); never wraps between the number and the % sign. */
.apu-pct { flex: 0 0 auto; color: var(--apu-cor, var(--apu-cinza)); font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.apu-box--destaque .apu-pct { font-size: 1.5rem; }
.apu-bar { display: block; height: .65rem; margin-top: .3rem; border-radius: 1rem; background: var(--apu-trilho); overflow: hidden; }
.apu-bar span { display: block; height: 100%; border-radius: inherit; background: var(--apu-cor, var(--apu-cinza)); }
.apu-votes, .apu-meta { color: var(--apu-votos); font-size: .8rem; font-variant-numeric: tabular-nums; }
.apu-meta { margin: .7rem 0 0; }
.apu-empty { margin: .5rem 0 0; color: var(--apu-votos); }
.apu-badge { display: inline-block; padding: .05rem .5rem; border-radius: 1rem; color: #fff; background: var(--apu-verde); font-size: .75rem; font-weight: 800; }
.apu-nota { margin: .9rem 0 0; padding: .65rem .8rem; border-radius: .5rem; background: var(--lnh-soft); font-size: .9rem; }
.apu-fonte { margin-top: 1.5rem; color: var(--lnh-muted); font-size: .8rem; }
@media (min-width: 700px) {
  .apu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .apu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .apu-grid--cidades { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Home block "Apuração ao vivo", right below the headline: white card (also in the dark theme) with "Apuração das
   Eleições 2026", a box with the status, the share of ballot boxes counted and the update time, then one row per
   candidate (initials in their color, number, name, party, own bar; percentage and votes on the right). Same type
   size for both candidates (neutrality). */
.apu-home { display: grid; gap: .8rem; min-width: 0; padding: .95rem .9rem 1rem; border: 1px solid #d5dce5; border-radius: .75rem; color: var(--apu-tinta); background: var(--apu-painel); box-shadow: 0 .2rem .9rem #0b1b2b12; }
.apu-home-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .6rem; }
.apu-home-eyebrow { display: block; color: var(--apu-votos); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.apu-home-h { margin: 0; color: var(--apu-azul); font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.apu-home-turno { padding: .25rem .65rem; border: 1px solid #d5dce5; border-radius: 1rem; background: var(--apu-fundo); font-size: .78rem; font-weight: 800; }
.apu-home-ensaio { flex: 1 0 100%; padding: .2rem .5rem; border-radius: .3rem; color: var(--apu-tinta); background: #ffe7a3; font-size: .72rem; font-weight: 700; }

.apu-home-box { display: grid; gap: .45rem; padding: .7rem .75rem; border: 1px solid #e1e6ed; border-radius: .55rem; background: var(--apu-fundo); }
.apu-home-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .6rem; margin: 0; font-size: .85rem; font-variant-numeric: tabular-nums; }
.apu-home-status strong { font-weight: 800; }
.apu-home-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 1rem; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.apu-home-pill--live { color: #b3121f; background: #fde4e6; }
.apu-home-pill--final { color: #0f6b33; background: #dcf3e4; }
.apu-home-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #e0182b; box-shadow: 0 0 0 0 #e0182b80; animation: apu-home-pulse 1.6s ease-out infinite; }
@keyframes apu-home-pulse { 70% { box-shadow: 0 0 0 .4rem #e0182b00; } 100% { box-shadow: 0 0 0 0 #e0182b00; } }
.apu-home-progress { display: block; height: .4rem; border-radius: 1rem; background: var(--apu-trilho); overflow: hidden; }
.apu-home-progress span { display: block; height: 100%; border-radius: inherit; background: var(--apu-azul); }
.apu-home-time { color: var(--apu-votos); font-size: .74rem; font-variant-numeric: tabular-nums; }

.apu-home-title { margin: 0; font-size: 1rem; font-weight: 800; }
.apu-home--antes .apu-home-title { font-size: 1.3rem; line-height: 1.2; }
.apu-home-sub { margin: 0; color: var(--apu-votos); font-size: .86rem; }
.apu-home-wait { margin: .4rem 0 0; color: var(--apu-votos); }

/* Countdown */
.apu-home-count { display: flex; gap: .45rem; margin-top: .2rem; }
.apu-home-count-box { display: grid; flex: 1 1 0; justify-items: center; max-width: 5.5rem; padding: .45rem .2rem .35rem; border: 1px solid #e1e6ed; border-radius: .45rem; background: var(--apu-painel); }
.apu-home-count-box[hidden] { display: none; }
.apu-home-count-box strong { color: var(--apu-azul); font-size: 1.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.apu-home-count-box small { color: var(--apu-votos); font-size: .72rem; font-weight: 700; }

/* Scoreboard */
.apu-home-race { display: grid; gap: .35rem; }
.apu-home-placar { display: grid; margin: 0; padding: 0; list-style: none; }
.apu-home-cand { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .7rem 0; }
.apu-home-cand + .apu-home-cand { border-top: 1px solid var(--apu-trilho); }
.apu-home-ini { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; color: #fff; background: var(--apu-cor, var(--apu-cinza)); font-size: 1rem; font-weight: 800; letter-spacing: .02em; }
.apu-home-who { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .45rem; min-width: 0; }
.apu-home-name { display: flex; align-items: baseline; gap: .3rem; min-width: 0; }
.apu-home-num { flex: none; color: var(--apu-azul); font-size: .95rem; white-space: nowrap; font-weight: 800; font-variant-numeric: tabular-nums; }
.apu-home-name strong { min-width: 0; font-size: .95rem; line-height: 1.2; }
.apu-home-selo { padding: .05rem .45rem; border-radius: .25rem; color: #fff; background: #e07b00; font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.apu-home-selo--eleito { background: var(--apu-verde); }
.apu-home-party { flex: 1 0 100%; color: var(--apu-votos); font-size: .74rem; }
.apu-home-bar { flex: 1 0 100%; display: block; height: .4rem; margin-top: .15rem; border-radius: 1rem; background: var(--apu-trilho); overflow: hidden; }
.apu-home-bar span { display: block; height: 100%; border-radius: inherit; background: var(--apu-cor, var(--apu-cinza)); }
.apu-home-nums { display: grid; justify-items: end; }
.apu-home-pct { color: var(--apu-tinta); font-size: 1.3rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.apu-home-votos { color: var(--apu-votos); font-size: .72rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* São Sebastião and Ilhabela, one compact line each. */
.apu-home-cidades { display: grid; gap: .5rem; margin: 0; padding: .7rem .75rem; border-radius: .55rem; background: var(--apu-fundo); list-style: none; }
.apu-home-cidades li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .6rem; }
.apu-home-cidades li + li { padding-top: .5rem; border-top: 1px solid var(--apu-trilho); }
.apu-home-cidade { display: grid; min-width: 0; line-height: 1.25; }
.apu-home-cidade strong { font-size: .92rem; }
.apu-home-urnas { color: var(--apu-votos); font-size: .74rem; font-variant-numeric: tabular-nums; }
.apu-home-mini { display: flex; gap: .7rem; font-size: .95rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.apu-home-mini > span { color: var(--apu-cor, var(--apu-cinza)); font-weight: 800; }
.apu-home-mini abbr { text-decoration: none; font-size: .72rem; }

.apu-home-alerta { margin: 0; padding: .45rem .6rem; border-left: 3px solid #c0392b; border-radius: .25rem; background: #fdf1ef; font-size: .8rem; }
.apu-home-materias { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.apu-home-materias a { display: grid; gap: .1rem; padding: .6rem .75rem; border: 1px solid #e1e6ed; border-radius: .5rem; color: var(--apu-tinta); background: var(--apu-fundo); font-weight: 700; line-height: 1.3; text-decoration: none; }
.apu-home-kicker { color: var(--apu-azul); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }

.apu-home-btn { display: flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.75rem; padding: .55rem 1rem; border-radius: .5rem; color: #fff; background: var(--apu-azul); font-size: .92rem; font-weight: 800; text-decoration: none; }
.apu-home-btn:hover, .apu-home-btn:focus-visible { color: #fff; filter: brightness(1.12); }
/* Election lead: big title (eve and voting day), voter service, race header with the counted share. */
.apu-home-h--big { color: var(--apu-tinta); font-size: clamp(1.45rem, 6.2vw, 2.1rem); line-height: 1.12; }
.apu-home-h-when { color: var(--apu-azul); white-space: nowrap; }
.apu-home-count-label { margin: 0; font-size: .8rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--apu-votos); }
.apu-home-servico { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; font-size: .9rem; line-height: 1.35; }
.apu-home-servico li { padding: .55rem .7rem; border-left: 4px solid var(--apu-azul); border-radius: .35rem; background: var(--apu-fundo); }
.apu-home-servico strong { display: block; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--apu-azul); }
.apu-home-race-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.apu-home-urnas-top { color: var(--apu-votos); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.apu-home-foot { display: grid; gap: .45rem; }
.apu-home-foot .apu-home-time { text-align: center; }
.apu-home-solo { padding-top: 1rem; }

/* Eve: the block opens the headlines section; the carousel goes below it, the four calls on the right (desktop). */
.home-lead--apuracao > .apu-home { order: -1; }

/* Special mode: block, then Eleições no Litoral Norte and Urgente na região (desktop: Urgente on the right). */
.apu-especial { display: grid; gap: 1rem; padding-top: 1rem; }
.apu-litoral, .apu-urgentes { min-width: 0; padding: .95rem .9rem; border: 1px solid #d5dce5; border-radius: .75rem; color: var(--apu-tinta); background: var(--apu-painel); }
.apu-litoral-head h2, .apu-urgentes h2 { margin: 0; color: var(--apu-tinta); font-size: 1.15rem; }
.apu-litoral-head p { margin: .2rem 0 0; color: var(--apu-votos); font-size: .82rem; }
.apu-litoral-list { display: grid; gap: .6rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.apu-litoral-city { padding: .65rem .7rem; border-radius: .55rem; background: var(--apu-fundo); }
.apu-litoral-city.is-destaque { border: 1px solid #c9d5e6; }
.apu-litoral-city-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.apu-litoral-city-head h3 { margin: 0; color: var(--apu-tinta); font-size: .98rem; }
.apu-litoral-urnas { color: var(--apu-votos); font-size: .74rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.apu-litoral-cands { display: grid; gap: .4rem; margin: .45rem 0 0; padding: 0; list-style: none; }
.apu-litoral-cands li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .1rem .45rem; font-size: .88rem; font-variant-numeric: tabular-nums; }
.apu-litoral-ini { padding: .05rem .3rem; border-radius: .25rem; color: #fff; background: var(--apu-cor, var(--apu-cinza)); font-size: .66rem; font-weight: 800; }
.apu-litoral-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apu-litoral-pct { font-weight: 800; }
.apu-litoral-delta { min-width: 4.4rem; color: var(--apu-votos); font-size: .76rem; text-align: right; white-space: nowrap; }
.apu-litoral-delta small { font-size: .66rem; }
.apu-litoral-bar { grid-column: 1 / -1; display: block; height: .3rem; border-radius: 1rem; background: var(--apu-trilho); overflow: hidden; }
.apu-litoral-bar span { display: block; height: 100%; background: var(--apu-cor, var(--apu-cinza)); }
.apu-urgentes ul { display: grid; gap: .6rem; margin: .7rem 0 0; padding: 0; list-style: none; }
.apu-urgente { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .65rem; align-items: start; }
.apu-urgente--texto { grid-template-columns: minmax(0, 1fr); }
.apu-urgente-img img { display: block; width: 5.5rem; height: 5.5rem; border-radius: .45rem; object-fit: cover; }
.apu-urgente h3 { margin: .25rem 0 .15rem; font-size: .95rem; line-height: 1.3; }
.apu-urgente h3 a { color: var(--apu-tinta); text-decoration: none; }
.apu-urgente time { color: var(--apu-votos); font-size: .75rem; }

@media (min-width: 600px) {
  .apu-litoral-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 850px) {
  .home-lead--apuracao > .apu-home { grid-column: 1; grid-row: 1; }
  .home-lead--apuracao > .headline-carousel { grid-column: 1; grid-row: 2; }
  .home-lead--apuracao > .lead-calls { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
  .apu-especial { grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 1fr); align-items: start; }
  .apu-especial > .apu-home { grid-column: 1; grid-row: 1; }
  .apu-especial > .apu-urgentes { grid-column: 2; grid-row: 1; }
  .apu-especial > .apu-litoral { grid-column: 1 / -1; grid-row: 2; }
  .apu-especial .apu-litoral-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .apu-home { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 1.25rem; padding: 1.1rem 1.2rem 1.2rem; }
  .apu-home > .apu-home-ensaio, .apu-home > .apu-home-head, .apu-home > .apu-home-box, .apu-home > .apu-home-race, .apu-home > .apu-home-materias, .apu-home > .apu-home-alerta, .apu-home > .apu-home-servico { grid-column: 1 / -1; }
  .apu-home-servico { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apu-home-placar { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
  .apu-home-cand + .apu-home-cand { border-top: 0; }
  .apu-home-foot { align-self: end; }
  .apu-home--antes > .apu-home-btn { grid-column: 1; justify-self: start; }
}

/* After the count: one link to the result at the top of the Política section of the home. */
.apu-resultado-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .15rem .8rem; margin: 0 0 1rem; padding: .7rem .9rem; border-left: 5px solid var(--lnh-primary, var(--lnh-deep-blue)); border-radius: .5rem; color: var(--apu-tinta); background: var(--apu-painel); box-shadow: 0 .15rem .6rem #0b1b2b14; text-decoration: none; }
.apu-resultado-kicker { grid-column: 1 / -1; color: var(--apu-votos); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.apu-resultado-texto { font-weight: 800; line-height: 1.3; }
.apu-resultado-cta { color: var(--lnh-primary, var(--lnh-deep-blue)); font-size: .85rem; font-weight: 800; white-space: nowrap; }

/* Bars that follow the TSE readings (urnas and candidates, home block and /apuracao): the script starts each one at
   its previous width after a swap, so it slides to the new value; nothing moves when the reading did not change. */
[data-apu-anim] { transition: width .8s ease; }
.apu-home-progress { display: block; height: .35rem; margin: -.1rem 0 .2rem; border-radius: 1rem; background: var(--apu-trilho); overflow: hidden; }
.apu-home-progress span { display: block; height: 100%; border-radius: inherit; background: #2fb35f; }

/* Eleições no Litoral Norte: the latest milestone story on top. */
.apu-litoral-materia { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .7rem; align-items: center; margin: .75rem 0 0; padding: .6rem; border: 1px solid #c9d5e6; border-radius: .6rem; color: var(--apu-tinta); background: var(--apu-fundo); text-decoration: none; }
.apu-litoral-materia img { display: block; width: 6.5rem; height: auto; aspect-ratio: 16 / 9; border-radius: .4rem; object-fit: cover; }
.apu-litoral-materia > span { display: grid; gap: .15rem; min-width: 0; }
.apu-litoral-materia-kicker { color: var(--apu-azul); font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.apu-litoral-materia strong { font-size: .95rem; line-height: 1.3; }
@media (prefers-reduced-motion: reduce) {
  [data-apu-anim] { transition: none; }
}

/* Candidate row (home block and /apuracao): photo or initials, full name on one line with "22 · PL" below, the badge
   beside the percentage, votes under it, and the bar across. */
.apu-cand-list { display: grid; margin: 0; padding: 0; list-style: none; }
.apu-cand-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto auto; align-items: center; column-gap: .5rem; padding: .7rem 0; }
.apu-cand-row + .apu-cand-row { border-top: 1px solid var(--apu-trilho); }
.apu-cand-ini { grid-row: 1 / span 2; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; color: #fff; background: var(--apu-cor, var(--apu-cinza)); font-size: .9rem; font-weight: 800; }
.apu-cand-foto { grid-row: 1 / span 2; display: block; width: 2.5rem; height: 2.5rem; border-radius: 50%; box-shadow: 0 0 0 3px var(--apu-cor, var(--apu-cinza)); object-fit: cover; background: var(--apu-trilho); }
.apu-cand-who { grid-column: 2; grid-row: 1 / span 2; display: grid; min-width: 0; }
.apu-cand-name { overflow: hidden; color: var(--apu-tinta); font-size: .95rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.apu-cand-party { color: var(--apu-votos); font-size: .72rem; }
.apu-cand-nums { grid-column: 3; grid-row: 1 / span 2; display: grid; justify-items: end; }
.apu-cand-pct-line { display: inline-flex; align-items: center; gap: .3rem; }
.apu-cand-selo { padding: .06rem .3rem; border-radius: .25rem; color: #fff; background: #b45f00; font-size: .56rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.apu-cand-selo--eleito { background: var(--apu-verde); }
.apu-cand-pct { color: var(--apu-tinta); font-size: 1.2rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.apu-cand-votos { color: var(--apu-votos); font-size: .7rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.apu-cand-bar { grid-column: 2 / -1; grid-row: 3; display: block; height: .35rem; margin-top: .4rem; border-radius: 1rem; background: var(--apu-trilho); overflow: hidden; }
.apu-cand-bar span { display: block; height: 100%; border-radius: inherit; background: var(--apu-cor, var(--apu-cinza)); }
@media (min-width: 850px) {
  .apu-cand-list.apu-home-placar { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
  .apu-cand-list.apu-home-placar .apu-cand-row + .apu-cand-row { border-top: 0; }
}
.apu-litoral-materia-hora { text-transform: none; }
.apu-litoral-foto { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 2px var(--apu-cor, var(--apu-cinza)); object-fit: cover; }

/* /apuracao (Partes 1 e 2), phone first: header, tabs, race cards, grid map, timeline. */
.apu-pagina { display: grid; gap: 1rem; padding-top: 1rem; color: var(--lnh-ink); }
.apu-pagina-head { display: grid; gap: .1rem; }
.apu-pagina-head .apu-home-h { font-size: clamp(1.5rem, 6.5vw, 2.1rem); }
.apu-pagina-status { margin: -.4rem 0 0; color: var(--lnh-muted); font-size: .88rem; }
.apu-pagina .apu-home-ensaio { margin: 0; }
.apu-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; padding: .3rem; border-radius: .7rem; background: var(--lnh-soft); }
.apu-tabs[hidden] { display: none; }
.apu-tabs button { min-height: 2.75rem; border: 0; border-radius: .5rem; color: var(--lnh-ink); background: transparent; font: inherit; font-weight: 800; cursor: pointer; }
.apu-tabs button[aria-selected="true"] { color: #fff; background: var(--apu-azul); }
.apu-painel { display: grid; gap: 1rem; }
.apu-painel[hidden] { display: none; }
.apu-painel-title { margin: 0; }

.apu-disputa { display: grid; gap: .35rem; min-width: 0; padding: .9rem .9rem .5rem; border: 1px solid #d5dce5; border-radius: .75rem; color: var(--apu-tinta); background: var(--apu-painel); }
.apu-disputa--destaque { box-shadow: 0 .2rem .9rem #0b1b2b12; }
.apu-disputa-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.apu-disputa-title { margin: 0; color: var(--apu-tinta); font-size: 1.02rem; }
.apu-disputa--destaque .apu-disputa-title { font-size: 1.15rem; }
.apu-disputa-urnas { color: var(--apu-votos); font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.apu-disputa-espera { margin: .2rem 0 .5rem; color: var(--apu-votos); font-size: .9rem; }

/* Grid map: 6 columns × 9 rows, one square per state in the leader's color (gray without numbers). */
.apu-mapa-sec { display: grid; gap: .6rem; padding: .9rem; border: 1px solid #d5dce5; border-radius: .75rem; color: var(--apu-tinta); background: var(--apu-painel); }
.apu-mapa-sec .apu-section-title { margin: 0; padding: 0; border: 0; color: var(--apu-tinta); font-size: 1.02rem; }
.apu-mapa { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(9, auto); gap: 4px; max-width: 22rem; margin-inline: auto; width: 100%; }
.apu-mapa-uf { display: grid; place-items: center; aspect-ratio: 1; min-height: 2.75rem; padding: 0; border: 0; border-radius: .35rem; color: #fff; background: var(--apu-cor, #9aa3ae); font: inherit; font-size: .78rem; font-weight: 800; letter-spacing: .02em; cursor: pointer; }
.apu-mapa-uf.is-vazio { color: var(--apu-tinta); background: var(--apu-trilho); }
.apu-mapa-uf[aria-pressed="true"] { outline: 3px solid var(--apu-tinta); outline-offset: 1px; }
.apu-mapa-uf:focus-visible { outline: 3px solid #ffd76a; outline-offset: 1px; }
.apu-mapa-detalhe .apu-disputa { border-color: var(--apu-trilho); }
.apu-mapa-dica { margin: 0; color: var(--apu-votos); font-size: .85rem; text-align: center; }
.apu-mapa-legenda { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1rem; margin: 0; color: var(--apu-votos); font-size: .78rem; }
.apu-mapa-legenda span { display: inline-flex; align-items: center; gap: .35rem; }
.apu-mapa-legenda i { display: inline-block; width: .8rem; height: .8rem; border-radius: .2rem; background: var(--apu-cor, var(--apu-trilho)); }
.apu-mapa-legenda .is-vazio i { background: var(--apu-trilho); }

/* Timeline of the milestones, with the link to each story. */
.apu-tempo { padding: .9rem; border: 1px solid #d5dce5; border-radius: .75rem; color: var(--apu-tinta); background: var(--apu-painel); }
.apu-tempo .apu-section-title { margin: 0 0 .5rem; padding: 0; border: 0; color: var(--apu-tinta); font-size: 1.02rem; }
.apu-tempo ol { display: grid; margin: 0; padding: 0; list-style: none; }
.apu-tempo li { position: relative; display: grid; grid-template-columns: 3.2rem 4.6rem minmax(0, 1fr); align-items: baseline; gap: .4rem; padding: .55rem 0 .55rem .9rem; border-left: 2px solid var(--apu-trilho); font-size: .9rem; }
.apu-tempo li::before { position: absolute; top: .9rem; left: -.38rem; width: .65rem; height: .65rem; border-radius: 50%; background: var(--apu-azul); content: ""; }
.apu-tempo time { color: var(--apu-votos); font-size: .8rem; font-variant-numeric: tabular-nums; }
.apu-tempo-marco { color: var(--apu-azul); font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.apu-tempo a { color: var(--apu-tinta); font-weight: 700; }
.apu-pagina .apu-grid { margin-top: 0; }
@media (min-width: 900px) {
  .apu-pagina { grid-template-columns: minmax(0, 1fr); max-width: 1100px; }
  .apu-painel[data-apu-painel="presidente"] { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .apu-painel[data-apu-painel="presidente"] > .apu-disputa--destaque, .apu-painel[data-apu-painel="presidente"] > .apu-litoral, .apu-painel[data-apu-painel="presidente"] > .apu-tempo { grid-column: 1 / -1; }
  .apu-mapa { max-width: 26rem; }
}
.apu-cand-name--l { font-size: .84rem; }
.apu-cand-name--xl { font-size: .74rem; }

/* Governor map: elected in the 1st round (party color, white inner frame) or live 2nd round (leader color). */
.apu-mapa-uf.is-primeiro { box-shadow: inset 0 0 0 3px #ffffffb3; }
.apu-mapa-legenda .is-primeiro i { background: var(--apu-cinza); box-shadow: inset 0 0 0 2px #ffffffb3; }
.apu-mapa-legenda .is-segundo i { background: linear-gradient(90deg, #1e5bd8 50%, #d7262e 50%); }
.apu-selo-1turno { padding: .1rem .45rem; border-radius: .3rem; color: #fff; background: var(--apu-verde); font-size: .68rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.apu-mapa-sec h3.apu-section-title { margin: 0; padding: 0; border: 0; color: var(--apu-tinta); font-size: 1.02rem; }

/* 1º turno: deputies (search in the browser) and the most voted in each Litoral Norte city. */
.apu-deps-sec { display: grid; gap: .5rem; padding: .9rem; border: 1px solid #d5dce5; border-radius: .75rem; color: var(--apu-tinta); background: var(--apu-painel); }
.apu-busca input { width: 100%; min-height: 2.75rem; padding: .5rem .75rem; border: 1px solid #c9d2de; border-radius: .5rem; color: var(--apu-tinta); background: #fff; font: inherit; }
.apu-deps { display: grid; max-height: 26rem; margin: 0; padding: 0; overflow-y: auto; list-style: none; counter-reset: dep; }
.apu-deps li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: .5rem; padding: .45rem .1rem; border-top: 1px solid var(--apu-trilho); font-size: .88rem; }
.apu-deps li[hidden] { display: none; }
.apu-deps-nome { min-width: 0; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.apu-deps-partido { color: var(--apu-votos); font-size: .72rem; font-weight: 700; }
.apu-deps-votos { min-width: 4.5rem; color: var(--apu-votos); font-size: .78rem; text-align: right; font-variant-numeric: tabular-nums; }
.apu-deps--top { max-height: none; }
.apu-busca-vazio { margin: 0; color: var(--apu-votos); font-size: .85rem; }
.apu-mais-votados { display: grid; gap: .8rem; }
.apu-mais-cidade { padding: .7rem; border-radius: .55rem; background: var(--apu-fundo); }
.apu-mais-cidade h4 { margin: 0 0 .2rem; font-size: .98rem; }
.apu-mais-cargo { margin: .5rem 0 0; color: var(--apu-azul); font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.apu-como { padding: .8rem .9rem; border-radius: .6rem; color: var(--lnh-muted); background: var(--lnh-soft); font-size: .82rem; }
.apu-como h2 { margin: 0 0 .3rem; color: var(--lnh-ink); font-size: .9rem; }
.apu-como p { margin: 0; }
@media (min-width: 700px) {
  .apu-mais-votados { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.apu-pagina .screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Three tabs on one line at 360 px; the race card inside a map panel is narrower, so it loses padding instead of
   cutting names. */
.apu-tabs button { padding: 0 .2rem; font-size: .86rem; white-space: nowrap; }
.apu-mapa-sec { padding: .8rem .7rem; }
.apu-mapa-detalhe .apu-disputa { padding: .7rem .55rem .4rem; }
.apu-mapa-detalhe .apu-cand-name { font-size: .88rem; }
.apu-mapa-detalhe .apu-cand-name--l { font-size: .8rem; }
.apu-mapa-detalhe .apu-cand-name--xl { font-size: .7rem; }

/* ---------------------------------------------------------------------------------------------------------------
   Padrão v3 (docs/DESIGN-APURACAO.md): avatar padrão, selos, cores e tamanhos fixos. Vem por último e vale sobre as
   regras antigas acima.
   --------------------------------------------------------------------------------------------------------------- */
.apu-faixa, .apu-page, .apu-home, .apu-resultado-link, .apu-litoral, .apu-urgentes {
  --apu-tinta: #111827;
  --apu-votos: #4b5563;
  --apu-trilho: #e5e7eb;
  --apu-verde: #16a34a;
  --apu-selo-lidera: #374151;
  --apu-selo-eleito: #16a34a;
  --apu-selo-vivo: #d7263d;
}
/* Avatar: círculo, rosto no quadro padrão (no arquivo), fundo na cor do candidato, anel branco de 3 px (com um fio
   cinza por fora para aparecer sobre o branco). */
.apu-avatar, .apu-cand-foto, .apu-litoral-foto, .apu-home-mini-foto { box-sizing: content-box; border: 3px solid #fff; border-radius: 50%; background: var(--apu-cor, #4b5563); box-shadow: 0 0 0 1px #d1d5db; object-fit: cover; }
.apu-cand-foto { width: 2.5rem; height: 2.5rem; }
/* Selos: mesma forma, cantos arredondados, texto branco em caixa alta. */
.apu-selo, .apu-cand-selo, .apu-home-selo, .apu-badge, .apu-selo-1turno, .apu-home-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .45rem; border: 1px solid transparent; border-radius: .35rem; color: #fff; background: var(--apu-selo-lidera); font-size: .66rem; font-weight: 800; letter-spacing: .04em; line-height: 1.3; text-transform: uppercase; white-space: nowrap; }
.apu-cand-selo--eleito, .apu-home-selo--eleito, .apu-badge, .apu-selo-1turno, .apu-selo--eleito, .apu-selo--venceu { background: var(--apu-selo-eleito); }
.apu-home-pill--live, .apu-selo--vivo { background: var(--apu-selo-vivo); color: #fff; }
.apu-home-pill--live::before, .apu-selo--vivo::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: #fff; animation: apu-v3-blink 1.2s ease-in-out infinite; }
.apu-home-pill--final, .apu-selo--final { border-color: var(--apu-selo-eleito); color: var(--apu-selo-eleito); background: transparent; }
@keyframes apu-v3-blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .apu-home-pill--live::before, .apu-selo--vivo::before { animation: none; } }
/* Barras: trilho #E5E7EB, preenchimento na cor do candidato, 8 px nas linhas de candidato e 6 px nas cidades. */
.apu-cand-bar { height: 8px; background: var(--apu-trilho); }
.apu-cand-pct { font-size: 1.25rem; }
/* Cards brancos com cantos de 16 px. */
.apu-disputa, .apu-mapa-sec, .apu-litoral { border-radius: 16px; }

/* Home: São Sebastião e Ilhabela com foto, nome e % dos dois. */
.apu-home-cidades li { grid-template-columns: minmax(0, 1fr); }
.apu-home-mini { display: grid; gap: .3rem; white-space: normal; }
.apu-home-mini > span { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .45rem; color: var(--apu-tinta); font-weight: 600; font-size: .9rem; }
.apu-home-mini-foto { width: 24px; height: 24px; }
.apu-home-mini-nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apu-home-mini-nome small { color: var(--apu-votos); font-size: .72rem; font-weight: 600; }
.apu-home-mini-pct { color: var(--apu-cor, var(--apu-tinta)); font-weight: 800; font-variant-numeric: tabular-nums; }

/* "Como o Litoral Norte está votando · 2º turno × 1º turno": card por cidade, duas colunas (1º | 2º) e a variação. */
.apu-cmp { display: grid; gap: .7rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.apu-cmp-city { display: grid; gap: .55rem; padding: .75rem .75rem .8rem; border: 1px solid #e5e7eb; border-top: 5px solid var(--apu-lider, #9ca3af); border-radius: 16px; background: #fff; }
.apu-cmp-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.apu-cmp-head h3 { margin: 0; color: var(--apu-tinta); font-size: 1rem; }
.apu-cmp-status { color: var(--apu-votos); font-size: .74rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.apu-cmp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; margin-left: 2.85rem; color: var(--apu-votos); font-size: .66rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.apu-cmp-cand { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: .5rem; row-gap: .3rem; }
.apu-cmp-cand + .apu-cmp-cand { padding-top: .55rem; border-top: 1px solid #f0f2f5; }
.apu-cmp-foto { grid-row: 1 / span 2; align-self: start; width: 1.75rem; height: 1.75rem; }
.apu-cmp-who { display: grid; min-width: 0; line-height: 1.2; }
.apu-cmp-who strong { overflow: hidden; color: var(--apu-tinta); font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.apu-cmp-who small { color: var(--apu-votos); font-size: .72rem; }
.apu-cmp-var { color: var(--apu-cor, var(--apu-tinta)); font-size: .8rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.apu-cmp-vals { grid-column: 2 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; }
.apu-cmp-val { display: grid; gap: .2rem; color: var(--apu-tinta); font-size: .85rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.apu-cmp-val.is-espera { color: var(--apu-votos); font-size: .74rem; font-weight: 600; }
.apu-cmp-bar { display: block; height: 6px; border-radius: 1rem; background: var(--apu-trilho); overflow: hidden; }
.apu-cmp-bar span { display: block; height: 100%; background: var(--apu-cor, var(--apu-cinza)); }
.apu-cmp-val--1 .apu-cmp-bar span { opacity: .55; }
.apu-cmp-vant { margin: 0; color: var(--apu-lider, var(--apu-tinta)); font-size: .8rem; font-weight: 800; }
@media (min-width: 760px) {
  .apu-cmp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .apu-especial .apu-cmp { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Mapa do Brasil (SVG inline): estado na cor de quem lidera (mais clara com vantagem pequena), cinza sem números,
   SP com contorno destacado; tocar abre o resultado do estado. */
.apu-mapa-svg { display: block; width: 100%; max-width: 30rem; height: auto; margin-inline: auto; }
.apu-mapa-svg .apu-uf { cursor: pointer; outline: none; }
.apu-mapa-svg .apu-uf path { fill: var(--apu-uf, #d1d5db); stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; transition: filter .15s; }
.apu-mapa-svg .apu-uf:hover path, .apu-mapa-svg .apu-uf:focus-visible path { filter: brightness(.88); }
.apu-mapa-svg .apu-uf[aria-pressed="true"] path { stroke: #111827; stroke-width: 3; }
.apu-mapa-svg .apu-uf-sp-borda { fill: none; stroke: #111827; stroke-width: 2.6; pointer-events: none; }
.apu-mapa-svg text { fill: #fff; font: 800 17px/1 Inter, system-ui, sans-serif; letter-spacing: .02em; pointer-events: none; text-anchor: middle; dominant-baseline: central; }
.apu-mapa-svg text.is-escuro { fill: #111827; }
.apu-mapa-legenda .is-claro i { opacity: .55; }
/* Nome sempre visível: os longos quebram em duas linhas, nunca com reticências. */
.apu-cand-name, .apu-cmp-who strong, .apu-home-mini-nome { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.apu-cand-name--l, .apu-cand-name--xl { font-size: .86rem; line-height: 1.2; }
/* Comparação: o nome da cidade nunca se divide; o status desce se faltar espaço. */
.apu-cmp-head { flex-wrap: wrap; }
.apu-cmp-head h3 { white-space: nowrap; }
/* Bloco da home: o título nunca quebra por causa do selo; o selo e as urnas descem se faltar espaço. */
.apu-home-race-head { flex-wrap: wrap; row-gap: .35rem; }
.apu-home-title { white-space: nowrap; }
.apu-home-urnas-top { display: inline-flex; align-items: center; gap: .4rem; }
