:root {
  --brand-04: rgba(var(--brand-rgb), 0.04);
  --brand-08: rgba(var(--brand-rgb), 0.08);
  --brand-14: rgba(var(--brand-rgb), 0.14);
  --brand-22: rgba(var(--brand-rgb), 0.22);
  --brand-40: rgba(var(--brand-rgb), 0.40);
  --brand-70: rgba(var(--brand-rgb), 0.70);
  --brand-solid: rgba(var(--brand-rgb), 1);

  --bg: #F8F7F5;
  --surface: #FFFFFF;
  --line: #E9E7E3;
  --text: #1C1A17;
  --muted: #6F6B64;
  --muted-2: #9B968D;

  --status-eleito-bg: #E4F5EA;
  --status-eleito-text: #1B7A44;
  --status-segundo-bg: #E7EEFB;
  --status-segundo-text: #2E52A6;

  --content-max: 1240px;
  --font: "Archivo", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
.env-ads{
    float: left;
    width: 100%;
    padding: 30px 0;
    background: rgba(0,0,0,0.01);
}
.tt-publicidade{
    float: left;
    width: 100%;
    margin-bottom: 5px;
    text-align: center;
    letter-spacing: 2px;
    font-size: 10px;
    color: #000;
    font-weight: 300;
    text-transform: uppercase;
}
.conteudo-ads{
    float: left;
    width: 100%;
    text-align: center;
    margin-top: 10px;
}
.topbar {
  float: left;
  width: 100%;
  z-index: 20;
  background: rgba(var(--brand-rgb), 0.5);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.topbar__logo {
  height: 44px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  flex-shrink: 0;
}

.topbar__cta {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-on-brand);
  background: var(--brand-solid);
  padding: 9px 18px;
  border-radius: 999px;
  white-space: nowrap;
  transition: filter 0.15s ease;
}

.topbar__cta:hover {
  filter: brightness(1.05);
}

.hero__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 32px) clamp(16px, 4vw, 32px) clamp(16px, 2.5vw, 22px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.hero__main {
  flex: 1;
  min-width: 240px;
}

.hero__busca {
  width: 300px;
  max-width: 100%;
  flex-shrink: 0;
  padding-top: clamp(4px, 1vw, 10px);
}

.hero__busca-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.hero__title {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.hero__subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  font-weight: 500;
}

.hero__live {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
}

.hero__live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
}

.hero__live.is-live .hero__live-dot {
  background: var(--status-eleito-text);
  position: relative;
}

.hero__live.is-live .hero__live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--status-eleito-text);
  animation: pulso-ao-vivo 1.8s ease-out infinite;
}

@keyframes pulso-ao-vivo {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    opacity: 0.6;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(3.2);
  }
}

.tabs-row {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tabs-row__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.86rem;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
  border-color: var(--brand-40);
  color: var(--text);
}

.tab:focus-visible {
  outline: 2px solid var(--brand-solid);
  outline-offset: 1px;
}

.tab.is-active {
  color: var(--text-on-brand);
  background: var(--brand-solid);
  border-color: transparent;
  font-weight: 700;
}

.estado-select {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.estado-select__label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.estado-select__control {
  appearance: none;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 32px 8px 14px;
  cursor: pointer;
  max-width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236F6B64' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.estado-select__control:hover {
  border-color: var(--brand-40);
}

.estado-select__control:focus-visible {
  outline: 2px solid var(--brand-solid);
  outline-offset: 1px;
}

.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 36px) clamp(16px, 4vw, 32px) 64px;
}

.loading {
  color: var(--muted);
  font-size: 0.9rem;
}

.error {
  color: #B3401F;
  font-size: 0.92rem;
}

.aviso-md {
  background: var(--brand-14);
  border: 1px solid var(--brand-40);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 24px;
}

.stats-strip {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px clamp(16px, 3vw, 26px) 20px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: start;
  gap: 18px;
  box-shadow: 0 1px 2px rgba(20, 16, 8, 0.03);
}

.stats-strip__item {
  min-width: 0;
}

.stats-strip__value {
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.stats-strip__label {
  margin-top: 3px;
  font-size: 0.74rem;
  color: var(--muted);
}

.stats-strip__bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 3px;
  background: var(--brand-08);
  overflow: hidden;
  margin-top: 4px;
}

.stats-strip__bar-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-solid);
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.stats-strip__updated {
  grid-column: 1 / -1;
  font-size: 0.74rem;
  color: var(--muted-2);
}

.cargo-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(20, 16, 8, 0.03);
  display: flex;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(20, 16, 8, 0.08);
  border-color: var(--brand-40);
}

.card:focus-visible {
  outline: 2px solid var(--brand-solid);
  outline-offset: 2px;
}

.card.situacao-eleito,
.card.situacao-eleito_qp,
.card.situacao-eleito_media {
  border-color: #B9E3C6;
}

.card.situacao-segundo_turno {
  border-color: #C3D3F2;
}

.card.situacao-suplente {
  border-color: var(--brand-40);
}

.card.situacao-nao_eleito {
  opacity: 0.65;
}

.card.candidatura-anulado,
.card.candidatura-anulado_sub_judice {
  border-color: #F5C9C0;
}

.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card__avatar-ring {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  padding: 5px;
  flex-shrink: 0;
  background: conic-gradient(var(--brand-solid) calc(var(--pct, 0) * 1%), var(--line) 0);
}

.card__avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--surface);
  background: var(--brand-14);
  box-sizing: border-box;
}

.card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__result {
  text-align: right;
  min-width: 0;
}

.card__percentual {
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.card__votos {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}

.card__partido-line {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 3px;
}

.card__nome {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  overflow-wrap: break-word;
}

.card__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.card__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 7px 12px;
  border-radius: 999px;
}

.card__badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.card__badge--apurando {
  background: #F1EFEC;
  color: var(--muted);
}

.card__badge--eleito,
.card__badge--eleito_qp,
.card__badge--eleito_media {
  background: var(--status-eleito-bg);
  color: var(--status-eleito-text);
}

.card__badge--segundo_turno {
  background: var(--status-segundo-bg);
  color: var(--status-segundo-text);
}

.card__badge--suplente {
  background: var(--brand-14);
  color: var(--text);
}

.card__badge--nao_eleito {
  background: #F1EFEC;
  color: var(--muted);
}

.card__badge--anulado {
  background: #FBE4E1;
  color: #B3401F;
}

.card__badge--anulado_sub_judice {
  background: #FDEFD9;
  color: #8A5A0D;
}

.card__vice {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}

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

.card__bar-row {
  margin-top: auto;
}

.card__bar {
  height: 6px;
  border-radius: 3px;
  background: var(--brand-08);
  overflow: hidden;
}

.card__bar-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-solid);
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 20px clamp(16px, 4vw, 32px) 40px;
  background: var(--surface);
}

.footer p {
  max-width: var(--content-max);
  margin: 0 auto;
  color: var(--muted-2);
  font-size: 0.76rem;
}

.footer code {
  color: var(--muted);
}

#eleitorado-panel {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .stats-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  #eleitorado-panel {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .tabs-row__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .estado-select {
    justify-content: space-between;
    margin-top: 4px;
  }
  .estado-select__control {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  #eleitorado-panel {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .topbar__logo {
    height: 34px;
    max-width: 140px;
  }
}
.municipio-busca__campo {
  position: relative;
  width: 100%;
}

#municipio-input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 18px;
}

#municipio-input:focus-visible {
  outline: 2px solid var(--brand-solid);
  outline-offset: 1px;
}

.municipio-busca__sugestoes {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 16, 8, 0.14);
  z-index: 60;
}

.municipio-busca__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.municipio-busca__item:last-child {
  border-bottom: none;
}

.municipio-busca__item:hover {
  background: var(--brand-04);
}

.municipio-busca__item span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.municipio-busca__vazio {
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Pop-up (modal) do resultado por município */

.municipio-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.municipio-modal[hidden] {
  display: none;
}

.municipio-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 8, 0.5);
}

.municipio-modal__painel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
  padding: 28px clamp(18px, 4vw, 32px) 32px;
  box-shadow: 0 20px 60px rgba(20, 16, 8, 0.25);
}

.municipio-modal__fechar {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.municipio-modal__fechar:hover {
  color: var(--text);
  border-color: var(--brand-40);
}

.municipio-resumo--rodape .stats-strip {
  margin-top: 24px;
  margin-bottom: 0;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.municipio-resumo--rodape .stats-strip__value {
  font-size: 1.05rem;
}

/* Lista (em vez de grade) para os resultados do município */

.lista {
  display: flex;
  flex-direction: column;
}

.legenda-status {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 14px 0 26px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

.legenda-status__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.selo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  color: #FFFFFF;
  flex-shrink: 0;
}

.selo--eleito,
.selo--eleito_qp,
.selo--eleito_media {
  background: var(--status-eleito-text);
}

.selo--segundo_turno {
  background: var(--status-segundo-text);
}

.selo--suplente {
  background: var(--brand-solid);
  color: var(--text-on-brand);
}

.selo--anulado {
  background: #B3401F;
}

.selo--anulado_sub_judice {
  background: #8A5A0D;
}

.linha {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
}

.linha:first-child {
  padding-top: 0;
}

.linha:last-child {
  border-bottom: none;
}

.linha.situacao-nao_eleito {
  opacity: 0.65;
}

.linha__avatar-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 3px;
  flex-shrink: 0;
  box-sizing: border-box;
  background: conic-gradient(var(--brand-solid) calc(var(--pct, 0) * 1%), var(--line) 0);
}

.linha__avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--surface);
  background: var(--brand-14);
  box-sizing: border-box;
}

.linha__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.linha__info {
  flex: 1;
  min-width: 0;
}

.linha__nome-linha {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.linha__nome {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.linha__partido {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.linha__vice {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

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

.linha__resultado {
  text-align: right;
  flex-shrink: 0;
}

.linha__percentual {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.linha__votos {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .linha {
    flex-wrap: wrap;
  }
  .linha__resultado {
    margin-left: 68px;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .hero__inner {
    flex-direction: column;
  }
  .hero__busca {
    width: 100%;
  }
  .municipio-modal {
    padding: 12px;
  }
  .municipio-modal__painel {
    max-height: 92vh;
  }
}