/**
 * Estilos dedicados para Resultados e Apuração Eleitoral.
 *
 * Design responsivo (320px a 1440px) integrado aos tokens de design do plugin.
 * Referência provisória de layout apuração-2026, com suporte a múltiplos estados
 * (aguardando, parcial, matematicamente definido, totalizado, indisponível).
 *
 * @package EleicoesRegionais
 */

:root {
	--er-results-radius: var(--er-radius-card, 12px);
	--er-results-surface: var(--er-surface, #ffffff);
	--er-results-bg: var(--er-results-surface, #ffffff);
	--er-results-border: var(--er-border, #e2e8f0);
	--er-results-text: var(--er-ink, #0f172a);
	--er-results-ink: var(--er-results-text, #0f172a);
	--er-results-muted: var(--er-muted, #64748b);
	--er-results-brand: var(--er-brand, #1d4ed8);
	--er-results-brand-light: rgba(29, 78, 216, 0.08);
	--er-results-success: #15803d;
	--er-results-success-light: #f0fdf4;
	--er-results-warning: #b45309;
	--er-results-warning-light: #fffbeb;
	--er-results-defined: #047857;
	--er-results-defined-light: #ecfdf5;
	--er-results-bar-bg: #e2e8f0;
	--er-results-bar-fill: var(--er-results-brand);
	--er-results-focus: #2563eb;
	--er-results-font: inherit;
	--er-results-max-width: 100%;
}

/* Container raiz */
.er-results {
	position: relative;
	box-sizing: border-box;
	max-width: 100%;
	margin-bottom: 2rem;
	color: var(--er-results-text);
	font-family: var(--er-results-font);
	container-type: inline-size;
}

.er-results[data-er-instance] {
	background-color: var(--er-results-surface);
	color: var(--er-results-text);
	font-family: var(--er-results-font);
	max-width: var(--er-results-max-width);
}

.er-results *,
.er-results *::before,
.er-results *::after {
	box-sizing: border-box;
}

/* Região acessível WCAG para leitores de tela */
.er-results .er-sr-only,
.er-results .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Selo de status e última atualização */
.er-results__status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
	margin: 1rem 0;
	font-size: 0.875rem;
}

.er-status {
	display: inline-flex;
	align-items: center;
	padding: 0.35rem 0.75rem;
	border-radius: 9999px;
	font-weight: 600;
	font-size: 0.8125rem;
	line-height: 1.2;
	letter-spacing: 0.01em;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.er-status--waiting {
	background-color: var(--er-results-warning-light);
	color: var(--er-results-warning);
	border: 1px solid rgba(180, 83, 9, 0.25);
}

.er-status--partial {
	background-color: var(--er-results-brand-light);
	color: var(--er-results-brand);
	border: 1px solid rgba(29, 78, 216, 0.25);
}

.er-status--defined {
	background-color: var(--er-results-defined-light);
	color: var(--er-results-defined);
	border: 1px solid rgba(4, 120, 87, 0.3);
}

.er-status--final {
	background-color: var(--er-results-success-light);
	color: var(--er-results-success);
	border: 1px solid rgba(21, 128, 61, 0.3);
}

.er-status--unavailable,
.er-status--neutral {
	background-color: #f1f5f9;
	color: #475569;
	border: 1px solid #cbd5e1;
}

.er-results__updated {
	color: var(--er-results-muted);
	font-size: 0.8125rem;
}

/* Progresso das seções apuradas */
.er-progress-area {
	margin: 1.25rem 0 1.5rem 0;
	padding: 1.25rem;
	background: #f8fafc;
	border: 1px solid var(--er-results-border);
	border-radius: var(--er-results-radius);
}

.er-progress {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.er-progress__meta {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 0.9375rem;
	color: var(--er-results-ink);
}

.er-progress__meta strong {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--er-results-brand);
}

.er-progress__bar {
	position: relative;
	width: 100%;
	height: 10px;
	background-color: var(--er-results-bar-bg);
	border-radius: 9999px;
	overflow: hidden;
}

.er-progress__fill {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--er-results-brand) 0%, #2563eb 100%);
	border-radius: 9999px;
	transition: width 0.4s ease-out;
}

/* Bloco de Resumo (Totais e Participação) */
.er-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.875rem;
	margin: 1.25rem 0 1.5rem 0;
	padding: 1.25rem;
	background-color: #ffffff;
	border: 1px solid var(--er-results-border);
	border-radius: var(--er-results-radius);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.er-summary__item {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.er-summary__label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--er-results-muted);
	font-weight: 600;
}

.er-summary__value {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--er-results-ink);
	font-variant-numeric: tabular-nums;
}

.er-summary__of {
	font-size: 0.875rem;
	color: var(--er-results-muted);
	font-weight: 500;
}

/* Lista de votos de candidatos (Ranking) */
.er-votes {
	list-style: none;
	margin: 1.5rem 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.er-votes__item {
	position: relative;
	display: grid;
	grid-template-columns: minmax(180px, 2fr) minmax(140px, 1.2fr) minmax(100px, 1.5fr) auto;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.25rem;
	background-color: #ffffff;
	border: 1px solid var(--er-results-border);
	border-radius: var(--er-results-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.er-votes__item:hover {
	border-color: #cbd5e1;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.er-votes__id {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	min-width: 0;
}

.er-votes__photo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	min-width: 56px;
	min-height: 56px;
	border-radius: 50%;
	overflow: hidden;
	background-color: #f1f5f9;
	flex-shrink: 0;
	border: 1px solid var(--er-results-border);
}

.er-votes__avatar {
	width: 56px;
	height: 56px;
	min-width: 56px;
	min-height: 56px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	aspect-ratio: 1 / 1;
}

.er-votes__name--link {
	color: var(--er-results-brand);
	text-decoration: none;
}

.er-votes__name--link:hover,
.er-votes__name--link:focus-visible {
	text-decoration: underline;
}

.er-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.2rem 0.5rem;
	border-radius: 6px;
	line-height: 1.2;
}

.er-badge--number {
	background-color: #f1f5f9;
	color: #334155;
	border: 1px solid #e2e8f0;
	font-variant-numeric: tabular-nums;
}

.er-badge--party {
	background-color: var(--er-results-brand-light);
	color: var(--er-results-brand);
	font-weight: 700;
}

.er-votes__name {
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--er-results-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.er-votes__numbers {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.125rem;
	font-variant-numeric: tabular-nums;
}

.er-votes__pct {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--er-results-ink);
}

.er-votes__count {
	font-size: 0.8125rem;
	color: var(--er-results-muted);
}

.er-votes__bar {
	position: relative;
	width: 100%;
	height: 8px;
	background-color: var(--er-results-bar-bg);
	border-radius: 9999px;
	overflow: hidden;
}

.er-votes__fill {
	display: block;
	height: 100%;
	background-color: var(--er-results-bar-fill);
	border-radius: 9999px;
	transition: width 0.35s ease;
}

.er-votes__flags {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.er-votes__situation {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.25rem 0.5rem;
	background-color: #f8fafc;
	color: #334155;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	white-space: nowrap;
}

.er-votes__status--flag {
	font-size: 0.75rem;
	color: #dc2626;
	background-color: #fef2f2;
	border: 1px solid #fecaca;
	padding: 0.2rem 0.4rem;
	border-radius: 4px;
}

/* ==========================================================================
   Publicidade Integrada e Slots Estáveis (Zero CLS)
   ========================================================================== */

.er-adslot {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin: 1.5rem auto;
	text-align: center;
	clear: both;
	box-sizing: border-box;
	width: 100%;
	contain-intrinsic-size: auto 90px;
}

.er-adslot__label {
	display: block;
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--er-results-muted, #64748b);
	margin-bottom: 0.375rem;
}

.er-adslot .er-ad {
	margin: 0;
	max-width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.er-adslot img,
.er-adslot iframe {
	max-width: 100%;
	height: auto;
}

/* Reserva dinâmica de proporção quando variáveis inline estiverem presentes */
.er-adslot[style*="--er-ad-w"] {
	aspect-ratio: var(--er-ad-w) / var(--er-ad-h);
	max-width: calc(var(--er-ad-w) * 1px);
}

@supports not (aspect-ratio: 1 / 1) {
	.er-adslot[style*="--er-ad-w"] {
		max-height: calc(var(--er-ad-h) * 1px);
	}
}

/* Slot Topo (Leaderboard / Billboard) */
.er-adslot--results-top,
.er-adslot--top,
.er-adslot--results-before-section {
	min-height: 90px;
	aspect-ratio: 728 / 90;
	max-width: 728px;
}

@media (max-width: 767px) {
	.er-adslot--results-top,
	.er-adslot--top,
	.er-adslot--results-before-section {
		min-height: 50px;
		aspect-ratio: 320 / 50;
		max-width: 320px;
	}
}

/* Slot Entre Candidatos (In-feed / MREC) */
.er-adslot--in-feed,
.er-adslot--results-between-candidates,
.er-adslot--between-candidates {
	min-height: 250px;
	aspect-ratio: 300 / 250;
	max-width: 300px;
	padding: 0.75rem 0;
	list-style: none;
	grid-column: 1 / -1;
}

/* Slot Rodapé (Bottom Leaderboard / Banner) */
.er-adslot--results-bottom,
.er-adslot--bottom,
.er-adslot--results-after-candidates,
.er-adslot--results-after-section {
	min-height: 90px;
	aspect-ratio: 728 / 90;
	max-width: 728px;
}

@media (max-width: 767px) {
	.er-adslot--results-bottom,
	.er-adslot--bottom,
	.er-adslot--results-after-candidates,
	.er-adslot--results-after-section {
		min-height: 50px;
		aspect-ratio: 320 / 50;
		max-width: 320px;
	}
}

/* Slot Barra Lateral (Sidebar Skyscraper / MREC) */
.er-adslot--results-sidebar,
.er-adslot--sidebar {
	min-height: 250px;
	aspect-ratio: 300 / 250;
	max-width: 300px;
	margin: 0 auto;
}

/* Layout Responsivo de Apuração com Barra Lateral */
@media (min-width: 1024px) {
	.er-results__layout--with-sidebar {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: 2rem;
		align-items: start;
	}

	.er-results__sidebar {
		position: sticky;
		top: 1.5rem;
	}
}

@media (max-width: 1023px) {
	.er-results__sidebar {
		margin-top: 2rem;
		padding-top: 1.5rem;
		border-top: 1px dashed var(--er-results-border, #cbd5e1);
	}
}

/* Estados vazios e indisponibilidade */
.er-empty {
	padding: 2rem 1.5rem;
	text-align: center;
	background-color: #f8fafc;
	border: 1px dashed var(--er-results-border);
	border-radius: var(--er-results-radius);
	margin: 1.5rem 0;
}

.er-empty p {
	margin: 0.5rem 0;
	font-size: 0.9375rem;
}

.er-empty--unavailable p {
	color: #64748b;
}

/* Paginação */
.er-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin: 2rem 0 1rem 0;
	font-size: 0.875rem;
}

.er-pagination a {
	padding: 0.5rem 1rem;
	border: 1px solid var(--er-results-border);
	border-radius: 6px;
	text-decoration: none;
	color: var(--er-results-ink);
	background: #ffffff;
	font-weight: 500;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.er-pagination a:hover,
.er-pagination a:focus {
	background-color: #f8fafc;
	border-color: #94a3b8;
}

.er-pagination__status {
	color: var(--er-results-muted);
	font-variant-numeric: tabular-nums;
}

/* Botão 'Trocar local' e alternância de filtros */
.er-results .er-filters__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 44px;
	min-width: 44px;
	padding: 0.625rem 1.25rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--er-results-brand, #1d4ed8);
	background-color: #ffffff;
	border: 1.5px solid var(--er-results-border, #cbd5e1);
	border-radius: 8px;
	cursor: pointer;
	margin-bottom: 1rem;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.er-results .er-filters__toggle:hover {
	background-color: var(--er-results-brand-light, #eff6ff);
	border-color: var(--er-results-brand, #1d4ed8);
}

.er-results .er-filters__toggle:focus-visible {
	outline: 2px solid var(--er-results-focus, #2563eb);
	outline-offset: 2px;
}

/* Filtros em dispositivos móveis e em modo compacto */
.er-results .er-filters__toggle {
	display: none;
}

@media (max-width: 768px) {
	.er-results .er-filters__toggle {
		display: inline-flex;
		width: 100%;
	}
	.er-results .er-filters--compact .er-filters__body:not(.is-open) {
		display: none !important;
	}
	.er-results .er-filters--compact .er-filters__body.is-open {
		display: grid !important;
	}
}

/* Container queries para coluna estreita / shortcode embed */
@container (max-width: 600px) {
	.er-results .er-filters__toggle {
		display: inline-flex;
		width: 100%;
	}
	.er-votes__item {
		grid-template-columns: 1fr;
		gap: 0.75rem;
		padding: 1rem;
	}
	.er-votes__numbers {
		flex-direction: row;
		justify-content: space-between;
		align-items: baseline;
	}
	.er-summary {
		grid-template-columns: 1fr;
	}
}

/* Responsividade de 320px a 1440px */
@media (max-width: 900px) {
	.er-votes__item {
		grid-template-columns: minmax(160px, 1.5fr) minmax(120px, 1fr) 1fr;
	}
	.er-votes__flags {
		grid-column: 1 / -1;
		justify-content: flex-start;
		padding-top: 0.5rem;
		border-top: 1px dashed #f1f5f9;
	}
}

@media (max-width: 600px) {
	.er-results__status {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}
	.er-summary {
		grid-template-columns: repeat(2, 1fr);
	}
	.er-votes__item {
		grid-template-columns: 1fr;
		gap: 0.75rem;
		padding: 1rem;
	}
	.er-votes__numbers {
		flex-direction: row;
		justify-content: space-between;
		align-items: baseline;
	}
	.er-votes__pct {
		font-size: 1.125rem;
	}
	.er-votes__flags {
		grid-column: 1;
		padding-top: 0.375rem;
	}
}

@media (max-width: 360px) {
	.er-summary {
		grid-template-columns: 1fr;
	}
	.er-progress__meta {
		flex-direction: column;
		gap: 0.25rem;
	}
}

/* Respeito a usuários com preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
	.er-status,
	.er-progress__fill,
	.er-votes__fill,
	.er-votes__item,
	.er-pagination a {
		transition: none !important;
		animation: none !important;
	}
}

/* ==========================================================================
   TEMA: MODELO 01 (Duelo em Destaque)
   ========================================================================== */
.er-results--layout-modelo01 .er-duel-cards {
	display: flex;
	align-items: stretch;
	gap: 1.25rem;
	margin-bottom: 2rem;
	width: 100%;
	box-sizing: border-box;
}

.er-duel-card {
	flex: 1 1 0;
	min-width: 0;
	background: #ffffff;
	border: 2px solid var(--er-results-border, #e2e8f0);
	border-radius: 12px;
	padding: 1.25rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
	position: relative;
	box-sizing: border-box;
}

.er-duel-card--lead {
	border-color: var(--er-results-brand, #12507b);
	background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.er-duel-card--second {
	border-color: #cbd5e1;
}

.er-duel-divider {
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 900;
	font-size: 1.25rem;
	color: #94a3b8;
	text-transform: uppercase;
	padding: 0 0.5rem;
	user-select: none;
}

.er-duel-card__header {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1rem;
	min-width: 0;
}

.er-duel-card__photo {
	width: var(--er-duel-avatar, 80px);
	height: var(--er-duel-avatar, 80px);
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 3px solid #ffffff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.er-duel-card__photo--placeholder {
	width: var(--er-duel-avatar, 80px);
	height: var(--er-duel-avatar, 80px);
	border-radius: 50%;
	background: #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #64748b;
	font-size: 1.75rem;
	flex-shrink: 0;
}

.er-duel-card__info {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.er-duel-badge {
	display: inline-block;
	padding: 0.2rem 0.5rem;
	border-radius: 9999px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	margin-bottom: 0.35rem;
}

.er-duel-badge--lead {
	background: var(--er-badge-lead-bg, #fef3c7);
	color: var(--er-badge-lead-ink, #92400e);
}

.er-duel-badge--second {
	background: var(--er-badge-second-bg, #f1f5f9);
	color: var(--er-badge-second-ink, #334155);
}

.er-duel-card__name {
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.25;
	margin: 0 0 0.35rem 0;
	overflow-wrap: break-word;
	word-break: break-word;
	color: var(--er-results-ink, #0f172a);
}

.er-duel-card__party {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	color: #64748b;
	font-weight: 600;
	flex-wrap: wrap;
}

.er-duel-card__metrics,
.er-duel-card__score {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	margin-top: auto;
	padding-top: 1rem;
	border-top: 1px solid #f1f5f9;
}

.er-duel-card__pct {
	font-size: 2.25rem;
	font-weight: 900;
	color: var(--er-results-ink, #0f172a);
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.er-duel-card__votes {
	font-size: 0.9375rem;
	color: #64748b;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.er-results[data-er-layout="modelo03"] .er-votes__avatar {
	width: 72px;
	height: 72px;
	min-width: 72px;
	flex-shrink: 0;
}

.er-duel-card .er-votes__bar {
	margin-top: 0.75rem;
	height: 8px;
	background: #e2e8f0;
	border-radius: 4px;
	overflow: hidden;
}

@media (max-width: 640px) {
	.er-results--layout-modelo01 .er-duel-cards {
		flex-direction: column;
		gap: 0.75rem;
	}

	.er-duel-divider {
		padding: 0.25rem 0;
	}

	.er-duel-card__photo,
	.er-duel-card__photo--placeholder {
		width: var(--er-duel-avatar-sm, 64px);
		height: var(--er-duel-avatar-sm, 64px);
	}

	.er-duel-card__pct {
		font-size: 1.75rem;
	}
}

/* ==========================================================================
   TEMA: MODELO 02 (Linhas com Busca e Favoritos)
   ========================================================================== */
.er2-toolbar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
	flex-wrap: wrap;
	box-sizing: border-box;
	width: 100%;
}

.er2-search-box {
	flex: 1 1 220px;
	min-width: 0;
	display: flex;
	align-items: center;
	background: #ffffff;
	border: 1.5px solid var(--er-results-border, #cbd5e1);
	border-radius: 8px;
	padding: 0.25rem 0.75rem;
	box-sizing: border-box;
}

.er2-search-icon {
	color: #94a3b8;
	font-size: 1rem;
	margin-right: 0.5rem;
	user-select: none;
}

.er2-search-input {
	width: 100%;
	border: none;
	background: transparent;
	padding: 0.5rem 0;
	font-size: 0.9375rem;
	outline: none;
	color: var(--er-results-ink, #0f172a);
}

.er2-fav-toggle-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	padding: 0.5rem 1rem;
	border: 1.5px solid var(--er-results-border, #cbd5e1);
	border-radius: 8px;
	background: #ffffff;
	font-size: 0.875rem;
	font-weight: 700;
	cursor: pointer;
	color: #334155;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}

.er2-fav-toggle-btn:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}

.er2-fav-toggle-btn.is-active {
	background: #fef08a;
	border-color: #eab308;
	color: #854d0e;
}

.er2-fav-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #e2e8f0;
	color: #334155;
	border-radius: 9999px;
	padding: 0.1rem 0.45rem;
	font-size: 0.75rem;
	font-weight: 800;
}

.er2-fav-toggle-btn.is-active .er2-fav-count {
	background: #ca8a04;
	color: #ffffff;
}

.er2-actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	justify-content: flex-end;
}

.er2-star-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: none;
	background: transparent;
	cursor: pointer;
	color: var(--er-star-inactive, #cbd5e1);
	font-size: 1.35rem;
	transition: color 0.15s ease, transform 0.15s ease;
	line-height: 1;
	padding: 0;
}

.er2-star-btn:hover {
	transform: scale(1.15);
	color: var(--er-star-active, #eab308);
}

.er2-star-btn.is-favorited {
	color: var(--er-star-active, #eab308);
}

.er2-details-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
	padding: 0.35rem 0.65rem;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	background: #ffffff;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #475569;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}

.er2-details-btn:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #1e293b;
}

.er-votes__item.is-filtered-out {
	display: none !important;
}

/* ==========================================================================
   TEMA: MODELO 03 (Acessível, Abas, Letras Maiores e Sênior-Friendly)
   ========================================================================== */
.er3-access-bar {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin-bottom: 0.75rem;
	width: 100%;
	box-sizing: border-box;
}

.er3-font-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	padding: 0.5rem 1.125rem;
	border: 1.5px solid #cbd5e1;
	border-radius: 8px;
	background: #ffffff;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	color: #334155;
	transition: all 0.15s ease;
}

.er3-font-toggle:hover,
.er3-font-toggle.is-active {
	background: var(--er-results-brand-light, #eff6ff);
	border-color: var(--er-results-brand, #12507b);
	color: var(--er-results-brand, #12507b);
}

.er3-subnav {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
	border-bottom: 2px solid #e2e8f0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	width: 100%;
	box-sizing: border-box;
}

.er3-subnav__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0.75rem 1.5rem;
	border: none;
	background: transparent;
	font-size: 1.125rem;
	font-weight: 700;
	color: #64748b;
	cursor: pointer;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: color 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}

.er3-subnav__btn:hover {
	color: #1e293b;
}

.er3-subnav__btn.is-active {
	color: var(--er-results-brand, #12507b);
	border-bottom-color: var(--er-results-brand, #12507b);
}

.er3-tabpanel {
	display: block;
	width: 100%;
	box-sizing: border-box;
}

.er3-tabpanel[hidden] {
	display: none !important;
}

.er3-photo {
	width: var(--er-access-avatar, 72px);
	height: var(--er-access-avatar, 72px);
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 2px solid #e2e8f0;
}

.er3-photo-placeholder {
	width: var(--er-access-avatar, 72px);
	height: var(--er-access-avatar, 72px);
	border-radius: 50%;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #64748b;
	font-size: 1.5rem;
	flex-shrink: 0;
	border: 2px solid #e2e8f0;
}

.er3-faq {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 1.5rem;
	margin-top: 1rem;
	box-sizing: border-box;
	width: 100%;
}

.er3-faq__title {
	font-size: 1.25rem;
	font-weight: 800;
	margin: 0 0 1rem 0;
	color: var(--er-results-ink, #0f172a);
}

.er3-faq__item {
	margin-bottom: 0.75rem;
	border-bottom: 1px solid #e2e8f0;
	padding-bottom: 0.75rem;
}

.er3-faq__item:last-child {
	margin-bottom: 0;
	border-bottom: none;
	padding-bottom: 0;
}

.er3-faq__question {
	cursor: pointer;
	font-size: 1.0625rem;
	font-weight: 700;
	min-height: 44px;
	display: flex;
	align-items: center;
	color: #1e293b;
	outline-offset: 4px;
}

.er3-faq__answer {
	padding-top: 0.5rem;
	font-size: 1rem;
	line-height: 1.6;
	color: #334155;
}

/* Modificador de acessibilidade: Letras Maiores */
.er-results--large-font {
	font-size: 1.1875rem !important;
}

.er-results--large-font .er-votes__name {
	font-size: 1.5rem !important;
}

.er-results--large-font .er-votes__pct {
	font-size: 2.25rem !important;
}

.er-results--large-font .er-votes__count {
	font-size: 1.125rem !important;
}

.er-results--large-font .er-badge {
	font-size: 1rem !important;
	min-height: 36px;
	padding: 0.35rem 0.75rem;
}

/* ==========================================================================
   TEMA: MODELO 04 (Central Editorial e Botões Rápidos de Cargos)
   ========================================================================== */
.er4-office-shortcuts {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0.25rem;
	width: 100%;
	box-sizing: border-box;
}

.er4-shortcut-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.5rem 1.125rem;
	border: 1.5px solid #cbd5e1;
	border-radius: 8px;
	background: #ffffff;
	font-size: 0.875rem;
	font-weight: 700;
	color: #334155;
	text-decoration: none;
	white-space: nowrap;
	transition: all 0.15s ease;
	flex-shrink: 0;
}

.er4-shortcut-btn:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
	color: #0f172a;
}

.er4-shortcut-btn.is-active {
	background: var(--er-results-brand, #12507b);
	color: #ffffff;
	border-color: var(--er-results-brand, #12507b);
}

.er-votes--grid-2col {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	list-style: none;
	padding: 0;
	margin: 0;
	width: 100%;
	box-sizing: border-box;
}

.er4-card {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	padding: 1.125rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	min-width: 0;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.er4-card:hover {
	border-color: #cbd5e1;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.er4-card__top {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
	min-width: 0;
}

.er4-card__photo {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 2px solid #e2e8f0;
}

.er4-card__photo-placeholder {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #64748b;
	font-size: 1.25rem;
	flex-shrink: 0;
	border: 2px solid #e2e8f0;
}

.er4-card__info {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.er4-card__name {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 0.25rem 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--er-results-ink, #0f172a);
}

.er4-card__party {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.75rem;
	color: #64748b;
	flex-wrap: wrap;
}

.er4-card__numbers,
.er4-card .er-votes__numbers {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.5rem;
}

.er4-card__pct {
	font-size: 1.625rem;
	font-weight: 800;
	color: var(--er-results-ink, #0f172a);
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.er4-card__count {
	font-size: 0.8125rem;
	color: #64748b;
	font-variant-numeric: tabular-nums;
}

.er4-card .er-votes__bar {
	height: 6px;
	background: #e2e8f0;
	border-radius: 3px;
	overflow: hidden;
	margin-bottom: 0.5rem;
}

.er4-card__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: auto;
	padding-top: 0.5rem;
	border-top: 1px solid #f1f5f9;
}

@media (max-width: 768px) {
	.er-votes--grid-2col {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   CONTRATO DE NÃO-TRANSBORDAMENTO (Anti-Overflow <= 2px a 390px)
   ========================================================================== */
.er-results,
.er-results * {
	box-sizing: border-box;
}

.er-results {
	max-width: 100% !important;
	overflow-x: hidden !important;
}

.er-duel-cards,
.er2-toolbar,
.er3-access-bar,
.er3-subnav,
.er4-office-shortcuts,
.er-votes--grid-2col,
.er-votes {
	max-width: 100%;
}

/* ==========================================================================
   REPLAY HISTÓRICO 2022 & RODAPÉ CUSTOMIZADO
   ========================================================================== */
.er-notice--replay,
.er-replay-badge {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.75rem 1.25rem;
	margin: 0.75rem 0 1.25rem;
	background-color: var(--er-results-warning-light, #fffbeb);
	border: 1px solid rgba(180, 83, 9, 0.35);
	border-radius: var(--er-results-radius, 8px);
	color: var(--er-results-warning, #92400e);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
}

.er-replay-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: var(--er-results-warning, #b45309);
	flex-shrink: 0;
	display: inline-block;
}

.er-results__custom-footer {
	margin-top: 1.75rem;
	padding-top: 1rem;
	border-top: 1px solid var(--er-results-border, #e2e8f0);
	font-size: 0.8125rem;
	color: var(--er-results-muted, #64748b);
	line-height: 1.5;
}

/* ==========================================================================
   ACESSIBILIDADE WCAG 2.1 AA (ALVOS DE TOQUE & FOCUS-VISIBLE & MOTION)
   ========================================================================== */
.er-results button,
.er-results select,
.er-results input,
.er-results a.er-button,
.er-results [role="button"],
.er-results [role="tab"] {
	min-height: 44px;
	min-width: 44px;
	touch-action: manipulation;
}

.er-results button:focus-visible,
.er-results select:focus-visible,
.er-results input:focus-visible,
.er-results a:focus-visible,
.er-results [role="button"]:focus-visible,
.er-results [role="tab"]:focus-visible {
	outline: 2px solid var(--er-results-focus, #2563eb) !important;
	outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
	.er-results,
	.er-results * {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ==========================================================================
   RESILIÊNCIA DE DADOS: SUSPENSÃO ADMINISTRATIVA E RETENÇÃO DE SNAPSHOT
   ========================================================================== */
.er-results--stale {
	border-left: 4px solid var(--er-results-warning, #f59e0b);
}

.er-results--suspended {
	border-left: 4px solid var(--er-results-danger, #ef4444);
	filter: grayscale(0.15);
}

.er-results__suspended-badge {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.875rem 1.25rem;
	margin: 0.75rem 0 1.25rem;
	background-color: #fef2f2;
	border: 1px solid rgba(239, 68, 68, 0.4);
	border-radius: var(--er-results-radius, 8px);
	color: #991b1b;
	font-size: 0.875rem;
	line-height: 1.45;
}

.er-results__suspended-badge strong {
	font-weight: 700;
}

.er-results__suspended-reason {
	margin: 0;
	font-size: 0.8125rem;
	color: #7f1d1d;
}

.er-results__stale-badge {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.25rem;
	margin: 0.75rem 0 1.25rem;
	background-color: #f0fdf4;
	border: 1px solid rgba(34, 197, 94, 0.3);
	border-radius: var(--er-results-radius, 8px);
	color: #166534;
	font-size: 0.875rem;
	line-height: 1.4;
}
