/* ==========================================================================
   APURAÇÃO.ONLINE - COMPONENTES LIQUID GLASS
   ========================================================================== */

/* Layout Principal */
.app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Área do Mapa em Canvas (Fundo dinâmico) */
.map-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: var(--bg-deep);
  cursor: grab;
}
.map-stage:active {
  cursor: grabbing;
}
#map-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Rótulos dos Estados e Callouts Litorâneos (Estilo seuimposto.com) */
.state-labels {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.state-label,
.state-callout {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
}

.state-label b,
.state-callout b {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.state-label span,
.state-callout span {
  font-weight: 600;
  opacity: 0.9;
  font-size: 10px;
}

.state-label {
  flex-direction: column;
  gap: 1px;
  padding: 2px 4px;
  border-radius: 4px;
  background: transparent;
  transform: translate(-50%, -50%);
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.state-label:hover {
  transform: translate(-50%, -50%) scale(1.18);
  z-index: 10;
}

.state-callout {
  justify-content: space-between;
  gap: 5px;
  min-width: 48px;
  height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.state-callout:hover {
  transform: scale(1.12);
  z-index: 10;
}

@media (max-width: 520px) {
  .state-label span,
  .state-callout span {
    display: none;
  }
  .state-callout {
    min-width: 28px;
    height: 19px;
    padding: 0 4px;
    justify-content: center;
  }
}

/* TopBar Suspensa em Vidro Líquido */
.topbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  height: 58px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: flex;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
  color: var(--text-bright);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 40%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Segmented Control para Cargos */
.cargo-tabs {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  padding: 3px;
  border-radius: 999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cargo-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-liquid);
}

.cargo-tab:hover {
  color: var(--text-main);
}

.cargo-tab.active {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-bright);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* TopBar Lado Direito: Status TSE + Busca */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-liquid);
}

.search-trigger:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-bright);
  background: rgba(0, 0, 0, 0.55);
}

.search-kbd {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-main);
}

/* HUD Lateral Esquerdo: Placar & Projeções */
.hud-left {
  position: absolute;
  top: 86px;
  left: 16px;
  bottom: 86px;
  width: min(390px, calc(100vw - 32px));
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

/* Scrollbar fina translúcida */
.hud-left::-webkit-scrollbar {
  width: 4px;
}

.hud-left::-webkit-scrollbar-track {
  background: transparent;
}

.hud-left::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.hud-left::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.scope-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #60a5fa;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.2s;
  width: fit-content;
}

.scope-back-btn:hover {
  background: rgba(96, 165, 250, 0.2);
  color: #ffffff;
}

/* Detalhes do Candidato (Padrão Editorial Imagem 2) */
.candidate-detail-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.candidate-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cand-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}

.cand-back-btn:hover {
  color: #ffffff;
}

.cand-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.cand-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.candidate-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.candidate-detail-photo {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  object-fit: cover;
  object-position: top center;
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.candidate-detail-header-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.candidate-detail-name {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.candidate-detail-party {
  font-size: 13px;
  color: var(--text-muted);
}

.candidate-hero-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.candidate-hero-pct {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.candidate-hero-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.candidate-stats-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.candidate-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}

.candidate-stat-label {
  color: var(--text-muted);
}

.candidate-stat-value {
  color: #ffffff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.candidate-regional-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}

.candidate-regional-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.candidate-regional-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.candidate-uf-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  width: 24px;
  text-align: center;
}

.candidate-uf-name {
  color: var(--text-main);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.candidate-bar-container {
  width: 80px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  flex-shrink: 0;
}

.candidate-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.candidate-uf-pct {
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  width: 44px;
  text-align: right;
}

/* Placar de Apuração */
.score-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.place-title {
  font-size: var(--text-h2);
  font-weight: 600;
  color: var(--text-bright);
}

.place-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.progress-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.progress-pct {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 999px;
  transition: width var(--duration-slow) var(--ease-liquid);
}

/* Lista de Candidatos e Duelo */
.candidate-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background var(--duration-fast) var(--ease-liquid);
}

.candidate-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cand-photo-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-subtle);
  border: 2px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cand-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.cand-photo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  color: var(--text-muted);
  font-size: 19px;
}

.cand-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cand-name {
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cand-partido {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.cand-numbers {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cand-pct {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-bright);
}

.cand-votes {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Card "Pode Virar? / Análise Matemática" */
.outlook-card {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.outlook-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
  flex-shrink: 0;
}

.outlook-text {
  font-size: var(--text-sm);
  color: var(--text-main);
  line-height: 1.45;
}

.outlook-text strong {
  color: var(--text-bright);
  font-weight: 600;
}

/* Feed de Últimas Viradas & Eleitos (Editorial News Flash) */
.events-section {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.events-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.events-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.events-pulse-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 10px #3b82f6;
  animation: pulse-dot 2s infinite ease-in-out;
}

.events-count-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.events-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.event-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background var(--duration-fast) var(--ease-liquid), border-color var(--duration-fast) var(--ease-liquid), box-shadow var(--duration-fast) var(--ease-liquid);
  cursor: pointer;
}

.event-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.event-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.event-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-uf-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.event-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-eleito {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.badge-virada {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.badge-concluido {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.event-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.event-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.event-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

.event-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.events-empty {
  color: var(--text-faint);
  font-size: 11.5px;
  padding: 10px 0;
  display: flex;
  align-items: center;
}

/* HUD Lateral Direito: Controles do Mapa e Estatísticas */
.hud-right {
  position: absolute;
  top: 86px;
  right: 18px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.hud-right > * {
  pointer-events: auto;
}

/* Modo de Colorir Mapa (Quem lidera vs % Apurado) */
.map-mode-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(14, 18, 26, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.map-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.map-mode-btn:hover {
  color: #ffffff;
}

.map-mode-btn.active {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Coluna vertical de controles de zoom */
.map-controls {
  width: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: rgba(14, 18, 26, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.map-control-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 13px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.map-control-btn:hover {
  background: rgba(255, 255, 255, 0.20);
  color: #ffffff;
  transform: scale(1.1);
}

/* Legenda Visual Flutuante do Mapa */
.map-legend {
  padding: 7px 12px;
  background: rgba(14, 18, 26, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-bar {
  width: 110px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #1e293b 0%, #065f46 30%, #059669 65%, #10b981 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Barra Inferior: Timeline de Apuração */
.bottom-bar {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  height: 52px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 20px;
}

.timeline-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-track-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  height: 24px;
}

.timeline-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  cursor: grab;
  transition: transform var(--duration-fast);
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Modal de Busca Instantânea */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
}

.search-modal-backdrop.open {
  display: grid;
}

.search-dialog {
  width: min(580px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-bright);
  font-family: var(--font-sans);
  font-size: 18px;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.search-item:hover, .search-item.selected {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.search-item-badge {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.search-item-country {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  margin-bottom: 6px;
}
.search-item-country:hover {
  background: rgba(59, 130, 246, 0.22);
}

/* Banner e Panorama de Eleições Estaduais (Governadores e Senado) */
.state-election-banner {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 6px;
  line-height: 1.4;
}
.state-election-banner i {
  font-size: 16px;
  color: #60a5fa;
  flex-shrink: 0;
}

.party-bancadas-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.party-bancada-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-bright);
}
.party-bancada-pill b {
  color: #60a5fa;
  font-weight: 700;
}

.state-overview-row {
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-liquid), border-color var(--duration-fast) var(--ease-liquid), box-shadow var(--duration-fast) var(--ease-liquid);
  border: 1px solid transparent;
}
.state-overview-row:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.state-badge-pill {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  color: #ffffff;
  flex-shrink: 0;
}

/* Tooltip Popover Flutuante do Mapa (Estilo Card Imagem 4) */
.map-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 50;
  width: 250px;
  padding: 12px 14px;
  background: rgba(14, 18, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--text-bright);
  font-family: var(--font-sans);
  display: none;
}

.muni-hover-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.muni-uf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.muni-hover-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.muni-hover-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.muni-hover-sub {
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.muni-hover-cands {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.muni-hover-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.muni-hover-avatar {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: #1e293b;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.muni-hover-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fallback-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #94a3b8;
}

.muni-hover-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.muni-cand-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.muni-cand-party {
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.muni-cand-pct {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.muni-hover-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 0 8px;
}

.muni-hover-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.muni-hover-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #94a3b8;
}

.muni-meta-label {
  font-weight: 600;
  color: #cbd5e1;
}

.muni-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.muni-meta-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.muni-meta-dot.red {
  background: #dc2626;
}

.muni-meta-dot.blue {
  background: #2563eb;
}

/* Legenda Inferior Direita Fixa */
.hud-legend-bottom {
  position: absolute;
  bottom: 84px;
  right: 18px;
  z-index: 15;
}

/* Cabeçalho de Escopo com Bandeira Circular (Estilo Imagem 4) */
.place-header-scope {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.place-state-sup {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
}

.place-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.place-flag-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.place-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.place-close-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.1);
}

/* 27 State Pills Grid (Estilo Imagem 3) */
.state-pills-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
  margin: 12px 0 16px;
}

.state-pill {
  height: 26px;
  border-radius: 6px;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, filter 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.state-pill:hover {
  transform: translateY(-2px) scale(1.08);
  filter: brightness(1.2);
}

/* Lista de Disputas mais apertadas (Estilo Imagem 3) */
.disputas-section-head {
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.disputas-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 2px;
}

.disputa-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.disputa-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateX(2px);
}

.disputa-badge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.disputa-uf-badge {
  width: 32px;
  height: 24px;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  display: grid;
  place-items: center;
}

.disputa-status {
  font-size: 9.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.disputa-contenders {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.disputa-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.disputa-avatar-wrap {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  background: #1e293b;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.disputa-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.disputa-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #94a3b8;
}

.disputa-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.disputa-pct {
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Faceoff de Governador / Senador em Estado (Estilo Imagem 2) */
.duel-faceoff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 14px 0 10px;
}

.duel-cand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.duel-cand-right {
  justify-content: flex-end;
}

.duel-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.duel-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duel-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.duel-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duel-sub {
  font-size: 11px;
  font-weight: 600;
}

.duel-pct {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Barra Bicolor de Duelo com Needle */
.duel-bar-dual {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: visible;
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.duel-bar-side {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.duel-needle {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 6px #ffffff;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  border-radius: 1px;
}

.duel-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.duel-c3-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.duel-c3-photo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
}

.duel-tag-anulados {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #94a3b8;
}

.duel-tag-anulados strong {
  color: #ffffff;
}

.duel-metrics-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 6px;
}

.duel-metric-label {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}

.duel-metric-val {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.status-pill-eleito {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.status-pill-eleito.runoff {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

.all-cands-sublist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.all-cand-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
}

.all-cand-name {
  color: #ffffff;
  font-weight: 500;
}

.all-cand-pct {
  font-variant-numeric: tabular-nums;
}

.all-cand-votos {
  font-size: 11px;
  color: #94a3b8;
}

.sheet-handle-bar {
  display: none;
}

/* ==========================================================================
   Responsividade Mobile & Tablet (Layout Fluido com Scroll Natural)
   No mobile: Topbar -> Placar 2º Turno no Topo -> Mapa Embaixo -> Projeção -> Feed
   ========================================================================== */
@media (max-width: 860px) {
  html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100% !important;
    -webkit-overflow-scrolling: touch;
  }

  .app-container {
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 12px 36px 12px !important;
    gap: 12px !important;
  }

  /* TopBar Fixa/Sticky no Topo */
  .topbar {
    order: 1 !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: calc(100% + 24px) !important;
    margin: 0 -12px 6px -12px !important;
    height: 50px !important;
    padding: 0 12px !important;
    gap: 8px !important;
    border-radius: 0 0 16px 16px !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    z-index: 40 !important;
    background: rgba(12, 16, 23, 0.94) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
  }

  .brand-title {
    font-size: 19px;
  }

  .brand-badge {
    display: none;
  }

  .live-badge {
    padding: 3px 8px;
    font-size: 10.5px;
  }

  .cargo-tabs {
    padding: 2px;
  }

  .cargo-tab {
    padding: 5px 10px;
    font-size: 12px;
  }

  #last-update-time {
    display: none;
  }

  .search-trigger {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .search-trigger .search-text,
  .search-trigger .search-kbd {
    display: none;
  }

  /* HUD Lateral vira contêiner fluido: Placar no topo, Projeção e Feed abaixo do mapa */
  .hud-left {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    display: contents !important;
  }

  .sheet-handle-bar {
    display: none !important;
  }

  /* 1. PLACAR DOS CANDIDATOS DO 2º TURNO (NO TOPO NO MOBILE) */
  .score-card {
    order: 2 !important;
    width: 100% !important;
    position: relative !important;
    z-index: 10 !important;
    padding: 16px 14px !important;
    border-radius: 16px !important;
    background: rgba(12, 16, 23, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
    margin-bottom: 2px !important;
  }

  /* 2. MAPA INTERATIVO (ABAIXO DOS CANDIDATOS NO MOBILE) */
  .map-stage {
    order: 3 !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 380px !important;
    min-height: 380px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55) !important;
    background-color: var(--bg-deep) !important;
    z-index: 5 !important;
    margin: 4px 0 !important;
  }

  #map-canvas {
    touch-action: pan-y pinch-zoom;
  }

  /* Controles embutidos dentro do contêiner do mapa */
  .hud-right {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 15 !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 6px !important;
  }

  .map-mode-pill {
    padding: 2px;
  }

  .map-mode-btn {
    padding: 4px 9px;
    font-size: 11px;
  }

  .map-controls {
    padding: 2px;
  }

  .map-control-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  /* Legenda do mapa embutida no canto inferior direito do mapa */
  .map-legend.hud-legend-bottom {
    position: absolute !important;
    bottom: 10px !important;
    right: 10px !important;
    left: auto !important;
    top: auto !important;
    z-index: 15 !important;
    padding: 4px 8px !important;
    background: rgba(12, 16, 23, 0.88) !important;
  }

  /* 3. CARD DE PROJEÇÃO MATEMÁTICA / VANTAGEM (ABAIXO DO MAPA) */
  #outlook-card {
    order: 4 !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 14px !important;
    padding: 14px 16px !important;
  }

  /* 4. FEED OFICIAL TSE EM TEMPO REAL (NO FINAL DA PÁGINA COM SCROLL) */
  .events-section {
    order: 5 !important;
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    border-radius: 16px !important;
    padding: 16px 14px !important;
  }

  .events-container {
    max-height: 400px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .bottom-bar {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 0 8px !important;
    height: 48px !important;
  }

  .brand-title {
    font-size: 17px !important;
  }

  .cargo-tab {
    padding: 4px 7px !important;
    font-size: 11px !important;
  }

  .map-stage {
    height: 350px !important;
    min-height: 350px !important;
  }

  .cand-name {
    font-size: 14px;
  }

  .cand-pct {
    font-size: 21px;
  }

  .cand-photo-wrap {
    width: 42px;
    height: 42px;
  }
}

/* Status Pill para Candidatos confirmados no 2º Turno */
.status-pill-2turno {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

