/* Resultados por cargo (Governador, Senador, Deputados): mapa por estado/município, legenda, candidatos e barras.
 * Usa as variáveis de cor e as classes do app.css (claro/escuro). */

/* ------------------------------------------------------------ mapa */
.cmap .map-svg .mun { stroke: var(--map-stroke); stroke-width: .7; vector-effect: non-scaling-stroke; cursor: pointer; transition: opacity .15s; outline: none; }
.cmap .map-svg .mun.empty { fill: var(--map-empty); cursor: default; }
.cmap .map-svg .mun:hover, .cmap .map-svg .mun:focus-visible { stroke: var(--ink); stroke-width: 1.8; }
.cmap .map-svg a:focus-visible .mun, .cmap .map-svg a:focus-visible .uf { stroke: var(--ink); stroke-width: 2.4; }
.cmap .map-svg { max-height: 70vh; }
.cmap .map-svg .uf.waiting { stroke: var(--ink-2); stroke-width: 1.6; stroke-dasharray: 5 3; }
.cmap .map-svg .uf.absent { opacity: .5; }
.swatch-dash { background: var(--map-empty); border: 2px dashed var(--ink-2); }
.swatch-faint { background: var(--map-empty); opacity: .5; border: 1px solid var(--border-strong); }

/* ------------------------------------------------------------ filtros do mapa */
.cfilters { display: grid; gap: 10px; margin-bottom: 12px; }
.cfilter-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cfilter-form select, .cfilter-form input[type="search"] { min-height: 38px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; min-width: 0; max-width: 100%; }
.cfilter-form select { flex: 1 1 160px; }
.cfilter-form input[type="search"] { flex: 1 1 180px; }

/* ------------------------------------------------------------ legenda */
.clegend-cat { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.clegend-cat li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .86rem; }
.clegend-cat .ln { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clegend-heat { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.clegend-heat div { display: grid; gap: 4px; justify-items: center; text-align: center; font-size: .7rem; color: var(--muted); }
.clegend-heat i { display: block; width: 100%; height: 14px; border-radius: 2px; }

/* ------------------------------------------------------------ barras (cadeiras / partidos) */
.cbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.cbars li { display: grid; grid-template-columns: 96px 32px minmax(0, 1fr); align-items: center; gap: 8px; font-size: .88rem; }
.cbars .k { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.cbars .k:hover { text-decoration: underline; }
.cbars .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.cbars .t { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.cbars .t span { display: block; height: 100%; background: var(--ink-2); border-radius: 5px; }

/* ------------------------------------------------------------ candidatos */
.ccands { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ccands li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ccands li:last-child { border-bottom: 0; }
.ccands li:not(:has(.cphoto)) { grid-template-columns: minmax(0, 1fr) auto; }
.cphoto { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-3); border: 1px solid var(--border); }
.cinfo { min-width: 0; line-height: 1.3; }
.cbar { height: 6px; border-radius: 3px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.cbar span { display: block; height: 100%; background: var(--ink-2); border-radius: 3px; }
.cnum { text-align: right; line-height: 1.25; white-space: nowrap; }

.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 800px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .cbars li { grid-template-columns: 78px 28px minmax(0, 1fr); } }
