/* ===== Botão ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--e-3); min-height: var(--ctl); padding: 0 var(--e-4);
  border: 1px solid transparent; border-radius: var(--r-md); background: var(--ambar); color: var(--ambar-tx); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; filter: none; }
.btn--fantasma { background: transparent; color: var(--tx); border-color: var(--linha-2); }
.btn--fantasma:hover { background: var(--hover); filter: none; }
.btn--perigo { background: var(--perigo); color: #2A0B08; }
.btn--mini { min-height: 28px; padding: 0 var(--e-3); font-size: var(--t-xs); }
.btn--link { background: none; border: 0; color: var(--ambar); padding: 0; min-height: 0; font-weight: 400; }
.btn--bloco { width: 100%; }

/* ===== Campo ===== */
.campo { display: grid; gap: var(--e-1); align-content: start; }   /* numa grade, o campo nunca estica a caixa para acompanhar o vizinho mais alto */
.campo__rotulo { font-size: var(--t-xs); color: var(--tx-2); font-weight: 500; }
.campo input:not([type=checkbox]):not([type=radio]), .campo select, .campo textarea {
  width: 100%; min-height: var(--ctl); padding: 0 var(--e-4); background: var(--campo); border: 1px solid var(--linha-2); border-radius: var(--r-md); color: var(--tx); font-size: var(--t-base); }
.campo textarea { padding: var(--e-3) var(--e-4); min-height: 88px; resize: vertical; }
.campo select { appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23B0B4BA' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; text-overflow: ellipsis; }
.campo select option { background: var(--surf-2); color: var(--tx); }
.campo input::placeholder, .campo textarea::placeholder { color: var(--tx-3); opacity: 1; }
.campo input:focus-visible, .campo select:focus-visible, .campo textarea:focus-visible { box-shadow: none; border-color: var(--ambar); outline: 2px solid var(--ambar); outline-offset: 0; }
.campo--erro input, .campo--erro select, .campo--erro textarea { border-color: var(--perigo); }
.campo__ajuda { font-size: var(--t-xs); color: var(--tx-3); }
.campo__erro { font-size: var(--t-xs); color: var(--perigo); }
.campo--marca { display: flex; align-items: center; gap: var(--e-3); }
input[type=checkbox], input[type=radio] { appearance: none; flex: none; width: 16px; height: 16px; margin: 0; background: var(--campo); border: 1px solid var(--linha-2); border-radius: 4px; display: inline-grid; place-content: center; cursor: pointer; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--ambar); border-color: var(--ambar); }
input[type=checkbox]:checked::after { content: ""; width: 8px; height: 4px; border-left: 2px solid var(--ambar-tx); border-bottom: 2px solid var(--ambar-tx); transform: rotate(-45deg) translate(1px, -1px); }
input[type=radio]:checked::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ambar-tx); }
input:focus-visible { box-shadow: var(--foco); }
@media (max-width: 960px) { .campo input:not([type=checkbox]):not([type=radio]), .campo select, .campo textarea { font-size: 16px; } }

/* Formulário: grupos com título e divisória fina (nunca borda dentro de borda) */
.form { display: grid; gap: var(--e-4); }
.form__grupo { display: grid; gap: var(--e-4); border: 0; padding: 0; margin: 0; min-width: 0; }
.form__grupo + .form__grupo { border-top: 1px solid var(--linha); padding-top: var(--e-5); margin-top: var(--e-1); }
.form__grupo > legend { font-weight: 600; padding: 0; margin-bottom: var(--e-3); }
.form__acoes { display: flex; gap: var(--e-3); flex-wrap: wrap; justify-content: flex-end; }
.form__erro { padding: var(--e-3) var(--e-4); border-radius: var(--r-md); background: var(--perigo-bg); color: var(--perigo); font-size: var(--t-sm); }
.form__ok { padding: var(--e-3) var(--e-4); border-radius: var(--r-md); background: var(--ok-bg); color: var(--ok); font-size: var(--t-sm); }

/* ===== Selo, aba, cartão ===== */
.selo { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--r-sm); font-size: var(--t-xs); background: var(--surf-2); color: var(--tx-2); border: 1px solid var(--linha); white-space: nowrap; }
.selo--ambar { background: var(--ambar-suave); color: var(--ambar); border-color: transparent; }
.selo--ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.selo--perigo { background: var(--perigo-bg); color: var(--perigo); border-color: transparent; }
.abas { display: flex; gap: var(--e-1); border-bottom: 1px solid var(--linha); overflow-x: auto; }
.abas__item { min-height: var(--ctl); padding: 0 var(--e-4); background: none; border: 0; border-bottom: 2px solid transparent; color: var(--tx-2); cursor: pointer; border-radius: var(--r-md) var(--r-md) 0 0; }
.abas__item[aria-selected=true] { color: var(--tx); background: var(--hover); border-bottom-color: var(--ambar); }
.abas[data-cor] .abas__item[aria-selected=true] { border-bottom-color: var(--grp); }
/* tira de abas do grupo do menu (telas/_grupos.js): quebra de linha em vez de rolar de lado */
.abas--grupo { margin-bottom: var(--e-5); flex-wrap: wrap; overflow-x: visible; }
.abas--grupo .abas__item { display: inline-flex; align-items: center; text-decoration: none; }
/* atalhos para outras telas, com o nome do grupo de destino (ex.: Próximos passos do Resultado) */
.atalhos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--e-4); }
.atalho { display: grid; gap: var(--e-1); align-content: start; padding: var(--e-4); border: 1px solid var(--linha); border-radius: var(--r-md); background: var(--surf); color: var(--tx); min-width: 0; overflow-wrap: anywhere; }
.atalho:hover { background: var(--hover); text-decoration: none; }
.atalho__grupo { font-size: var(--t-xs); color: var(--grp, var(--tx-3)); }
.atalho__t { font-weight: 500; }
.atalho__tx { font-size: var(--t-sm); color: var(--tx-2); }
.bloco { background: var(--surf); border: 1px solid var(--linha); border-radius: var(--r-lg); padding: var(--e-5); }
.bloco > h3 { font-size: var(--t-base); font-weight: 600; margin-bottom: var(--e-4); }
.pilha { display: grid; gap: var(--e-4); }
.linha { display: flex; gap: var(--e-3); align-items: center; flex-wrap: wrap; }
.linha--lista { justify-content: space-between; padding: var(--e-3) 0; border-bottom: 1px solid var(--linha); min-width: 0; }
.linha--lista:last-child { border-bottom: 0; }
.linha__corpo { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 960px) { .bloco { padding: var(--e-4); } }

/* ===== Tela: cabeçalho e estados ===== */
.tela-cab { display: flex; align-items: center; justify-content: space-between; gap: var(--e-4); flex-wrap: wrap; margin-bottom: var(--e-5); }
.tela-cab__t { font-size: var(--t-lg); font-weight: 600; }
.tela-cab__s { color: var(--tx-3); font-size: var(--t-sm); margin-top: 2px; }
.estado { display: grid; justify-items: center; gap: var(--e-3); text-align: center; padding: var(--e-8) var(--e-5); color: var(--tx-2); }
.estado__t { font-weight: 600; color: var(--tx); font-size: var(--t-lg); }
.estado__tx { max-width: 44ch; }
.giro { width: 20px; height: 20px; border: 2px solid var(--linha-2); border-top-color: var(--ambar); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ===== Janela única (<dialog>) ===== */
.janela { border: 1px solid var(--linha-2); border-radius: var(--r-lg); background: var(--surf); color: var(--tx); padding: 0; width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden; }
.janela[open] { display: flex; flex-direction: column; }
.janela::backdrop { background: rgba(0, 0, 0, .6); }
.janela--larga { width: min(720px, calc(100vw - 32px)); }
.janela__cab { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); padding: var(--e-4) var(--e-5); border-bottom: 1px solid var(--linha); }
.janela__t { font-size: var(--t-lg); font-weight: 600; }
.janela__x { width: var(--ctl); height: var(--ctl); border: 0; border-radius: var(--r-md); background: none; color: var(--tx-2); cursor: pointer; font-size: 18px; line-height: 1; }
.janela__x:hover { background: var(--hover); }
.janela__corpo { padding: var(--e-5); overflow: auto; display: grid; gap: var(--e-4); }
.janela__rodape { display: flex; gap: var(--e-3); justify-content: flex-end; flex-wrap: wrap; padding: var(--e-4) var(--e-5); border-top: 1px solid var(--linha); }

/* ===== Tabela que vira cartão (pela largura do próprio bloco) ===== */
.tabela { container-type: inline-size; container-name: tabela; width: 100%; }
.tabela__t { width: 100%; border-collapse: collapse; }
.tabela__t th { text-align: left; font-size: var(--t-xs); font-weight: 500; color: var(--tx-3); padding: 0 var(--e-4); height: 32px; background: var(--surf-2); border-bottom: 1px solid var(--linha); white-space: nowrap; }
.tabela__t td { padding: 0 var(--e-4); height: var(--linha-tab); border-bottom: 1px solid var(--linha); vertical-align: middle; overflow-wrap: anywhere; }
.tabela__t tbody tr:hover { background: var(--hover); }
.tabela__t tr[data-clicavel] { cursor: pointer; }
.tabela__t td.num, .tabela__t th.num { text-align: right; }
.tabela__t td.num { white-space: nowrap; }   /* número nunca quebra em duas linhas (9.135.407) */
.tabela__vazio { padding: var(--e-6); text-align: center; color: var(--tx-3); }
.pagina__mais { display: flex; align-items: center; justify-content: center; gap: var(--e-3, 12px); padding: var(--e-3, 12px) 0; flex-wrap: wrap; }
@container tabela (width <= 700px) {
  .tabela__t, .tabela__t tbody { display: block; }
  .tabela__t thead { display: none; }
  .tabela__t tr { display: block; margin-bottom: var(--e-3); padding: var(--e-3) var(--e-4); background: var(--surf); border: 1px solid var(--linha); border-radius: var(--r-lg); }
  .tabela__t td { display: flex; justify-content: space-between; gap: var(--e-4); height: auto; min-height: 32px; padding: var(--e-1) 0; border: 0; text-align: right; align-items: center; }
  .tabela__t td::before { content: attr(data-rotulo); color: var(--tx-3); font-size: var(--t-xs); text-align: left; flex: none; }
  .tabela__t td.principal { font-weight: 600; text-align: left; justify-content: flex-start; }
  .tabela__t td.principal::before { display: none; }
}

/* ===== Avisos rápidos ===== */
.avisos { position: fixed; z-index: 90; right: var(--e-5); bottom: 64px; display: grid; gap: var(--e-3); max-width: min(360px, calc(100vw - 32px)); }
.avisos__item { padding: var(--e-3) var(--e-4); border-radius: var(--r-md); background: var(--surf-2); border: 1px solid var(--linha-2); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.avisos__item--ok { border-color: var(--ok); }
.avisos__item--erro { border-color: var(--perigo); }

/* ===== Casca da área logada ===== */
.casca { display: grid; grid-template-columns: var(--menu-l) minmax(0, 1fr); min-height: 100dvh; }
.casca__menu { position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--surf); border-right: 1px solid var(--linha); padding: var(--e-4) var(--e-3); display: flex; flex-direction: column; gap: var(--e-4); }
.casca__marca { display: flex; align-items: center; padding: 0 var(--e-3); height: 32px; }
.casca__marca img { height: 22px; width: auto; }
.casca__principal { min-width: 0; display: flex; flex-direction: column; }
.casca__cab { position: sticky; top: 0; z-index: 20; height: var(--cab-a); display: flex; align-items: center; gap: var(--e-3); padding: 0 var(--e-6); background: var(--bg); border-bottom: 1px solid var(--linha); }
.casca__cab-espaco { flex: 1; }
.casca__tela { padding: var(--e-6); min-width: 0; }
.casca__tela:focus { outline: none; }
.casca__burger { display: none; width: var(--ctl); height: var(--ctl); border: 1px solid var(--linha-2); border-radius: var(--r-md); background: none; cursor: pointer; }
.casca__fundo { display: none; }

.menu { display: grid; gap: var(--e-1); }
.menu__grupo { font-size: var(--t-xs); color: var(--tx-3); padding: var(--e-4) var(--e-3) var(--e-1); }
.menu__item { display: flex; align-items: center; gap: var(--e-3); min-height: 32px; padding: 0 var(--e-3); border-radius: var(--r-md); color: var(--tx-2); font-size: var(--t-base); }
.menu__item:hover { background: var(--hover); color: var(--tx); text-decoration: none; }
.menu__item[aria-current=page] { background: var(--hover); color: var(--tx); font-weight: 500; }
.menu__item svg { width: 16px; height: 16px; flex: none; }
/* cor do grupo (Política): ícone e traço de 2 px no rótulo; o fundo do item não muda */
[data-cor="rede"] { --grp: var(--grp-rede); }
[data-cor="parcerias"] { --grp: var(--grp-parcerias); }
[data-cor="chat"] { --grp: var(--grp-chat); }
[data-cor="votacao"] { --grp: var(--grp-votacao); }
[data-cor="territorio"] { --grp: var(--grp-territorio); }
[data-cor="planejar"] { --grp: var(--grp-planejar); }
[data-cor="gabinete"] { --grp: var(--grp-gabinete); }
[data-cor="relac"] { --grp: var(--grp-relac); }
[data-cor="adm"] { --grp: var(--grp-adm); }
[data-cor="vendas"] { --grp: var(--grp-vendas); }
[data-cor="conversas"] { --grp: var(--grp-conversas); }
[data-cor="auto"] { --grp: var(--grp-auto); }
[data-cor="canais"] { --grp: var(--grp-canais); }
[data-cor="config"] { --grp: var(--grp-config); }
.menu__grupo[data-cor] { position: relative; }
.menu__grupo[data-cor]::before { content: ""; position: absolute; left: 0; bottom: 3px; width: 2px; height: 12px; border-radius: 1px; background: var(--grp); }
.menu__item[data-cor] svg { color: var(--grp); }
.menu__soon { margin-left: auto; font-size: var(--t-xs); color: var(--tx-3); }

.faixas { display: grid; }
.faixa { display: flex; align-items: center; gap: var(--e-3); flex-wrap: wrap; padding: var(--e-2) var(--e-6); font-size: var(--t-sm); background: var(--aviso-bg); border-bottom: 1px solid var(--linha); }
.faixa--perigo { background: var(--perigo-bg); }
.faixa--info { background: var(--hover); }
.faixa a { font-weight: 500; }

.seletor { position: relative; min-width: 0; flex: 0 1 auto; }
.usuario { flex: 0 1 auto; }
.usuario__botao { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.casca__cab > * { flex-shrink: 0; }
.casca__cab > .seletor { flex-shrink: 1; }
.seletor__botao { display: inline-flex; align-items: center; gap: var(--e-3); min-height: var(--ctl); max-width: 280px; padding: 0 var(--e-4); background: var(--campo); border: 1px solid var(--linha-2); border-radius: var(--r-md); cursor: pointer; }
.seletor__botao svg { width: 12px; height: 12px; flex: none; color: var(--tx-2); }
.seletor__botao:disabled svg { display: none; }
.seletor__botao:disabled { cursor: default; }
.seletor__nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.popover { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: min(320px, calc(100vw - 32px)); max-height: min(420px, 70dvh); overflow: auto; background: var(--surf-2); border: 1px solid var(--linha-2); border-radius: var(--r-lg); padding: var(--e-3); display: grid; gap: var(--e-1); box-shadow: 0 10px 28px rgba(0, 0, 0, .4); align-content: start; }
.popover--direita { left: auto; right: 0; }
.seletor__lista { display: grid; gap: var(--e-1); }
.popover__item { display: grid; gap: 1px; text-align: left; width: 100%; min-height: 40px; padding: var(--e-2) var(--e-3); background: none; border: 0; border-radius: var(--r-md); color: var(--tx); cursor: pointer; }
.popover__item:hover, .popover__item[aria-current=true] { background: var(--hover); }
.popover__sub { font-size: var(--t-xs); color: var(--tx-3); }
.popover__vazio { padding: var(--e-3); color: var(--tx-3); }
.sino { position: relative; }
.sino__botao { position: relative; width: var(--ctl); height: var(--ctl); display: grid; place-items: center; background: none; border: 1px solid var(--linha-2); border-radius: var(--r-md); cursor: pointer; }
.sino__botao svg { width: 16px; height: 16px; }
.sino__n { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--ambar); color: var(--ambar-tx); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.sino .popover { width: min(340px, calc(100vw - 32px)); }
.aviso-item--nova .popover__t { font-weight: 600; }

@media (max-width: 960px) {
  .casca { grid-template-columns: minmax(0, 1fr); }
  .casca__menu { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s; }
  .casca--aberto .casca__menu { transform: none; }
  .casca--aberto .casca__fundo { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); }
  .casca__burger { display: inline-grid; place-items: center; }
  .casca__cab { padding: 0 var(--e-4); }
  .casca__tela { padding: var(--e-4); }
  .faixa { padding: var(--e-2) var(--e-4); }
  .menu__item { min-height: 40px; }
  .seletor__botao { max-width: 130px; }
  .seletor__botao:has(.seletor__rotulo:not([hidden])) { max-width: 150px; }
  .seletor .seletor__rotulo { font-size: 11px; }
  .usuario__botao { max-width: 84px; padding: 0 var(--e-3); }
  .seletor { position: static; }
  .popover { left: var(--e-4); right: var(--e-4); width: auto; position: fixed; top: calc(var(--cab-a) + 4px); }
  .sino { position: static; }
  .sino .popover { width: auto; }
}

/* ===== Botão fixo "Sugestão ou erro" (em toda a área) ===== */
.sugestao-botao { position: fixed; z-index: 30; right: var(--e-5); bottom: var(--e-5); display: inline-flex; align-items: center; gap: var(--e-3); min-height: var(--ctl); padding: 0 var(--e-4);
  background: var(--surf-2); color: var(--tx-2); border: 1px solid var(--linha-2); border-radius: var(--r-md); cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.sugestao-botao:hover { color: var(--tx); background: var(--hover); }
.sugestao-botao svg { width: 16px; height: 16px; flex: none; }
.casca__tela { padding-bottom: 72px; }
@media (max-width: 960px) {
  /* No celular o botão não flutua sobre a tela: fica no fim da página, no espaço reservado (padding-bottom da tela), e nunca cobre botão de ação. */
  body:has(.sugestao-botao) { position: relative; }
  .sugestao-botao { position: absolute; right: var(--e-4); bottom: var(--e-4); width: var(--ctl); padding: 0; justify-content: center; }
  .sugestao-botao__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .avisos { bottom: 72px; right: var(--e-4); }
}

/* janela de aceite dos textos legais (nucleo/aceite.js) */
.aceite__lista { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.aceite__data { color: var(--tx-2, inherit); }

/* celular: alvos de toque de pelo menos 40px (no computador segue compacto) */
@media (max-width: 960px) {
  .btn--mini { min-height: 40px; }
  .btn--link { min-height: 40px; display: inline-flex; align-items: center; }
  .cc-ativ__linha > input[type=checkbox] { margin: 12px; }
  .avisos__item--erro { display: flex; align-items: flex-start; gap: var(--e-3); }
}
.avisos__item--erro { display: flex; align-items: flex-start; gap: var(--e-3); }
.avisos__item--erro span { flex: 1; }
.avisos__x { flex: none; background: none; border: 0; color: var(--tx-2); font-size: 18px; line-height: 1; cursor: pointer; min-width: 24px; min-height: 24px; }
@media (max-width: 960px) { .avisos__x { min-width: 40px; min-height: 40px; margin: -10px -12px -10px 0; } }

/* ===== Aba de teste ("Entrar como"): faixa fixa no topo; a casca desce o tamanho dela. Alt+F esconde (fotos limpas). ===== */
body.aba-teste { --aba-teste-a: 32px; }
body.aba-teste.aba-teste--oculta { --aba-teste-a: 0px; }
.aba-teste-faixa { position: sticky; top: 0; z-index: 80; height: var(--aba-teste-a, 32px); display: flex; align-items: center; justify-content: center; gap: var(--e-3); padding: 0 var(--e-4); background: var(--ambar); color: var(--ambar-tx); font-size: var(--t-sm); font-weight: 500; }
.aba-teste__texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aba-teste__sep, .aba-teste__sair { flex: none; }
.aba-teste__sair { min-height: 24px; padding: 0 var(--e-2); background: none; border: 0; border-radius: var(--r-sm, 4px); color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.aba-teste__dica { flex: none; margin-left: var(--e-4); font-size: var(--t-xs); font-weight: 400; opacity: .75; }
.aba-teste--oculta .aba-teste-faixa { display: none; }
/* fotos limpas do guia: com a faixa âmbar escondida (Alt+F), some também o aviso de implantação (só na aba de teste) */
.aba-teste--oculta [data-faixa=implantacao] { display: none; }
body.aba-teste .casca__menu { top: var(--aba-teste-a); height: calc(100dvh - var(--aba-teste-a)); }
body.aba-teste .casca__cab { top: var(--aba-teste-a); }
@media (max-width: 960px) {
  body.aba-teste { --aba-teste-a: 40px; }
  body.aba-teste.aba-teste--oculta { --aba-teste-a: 0px; }
  .aba-teste__dica { display: none; }
  .aba-teste__sair { min-height: 32px; padding: 0 var(--e-3); }
  body.aba-teste .casca--aberto .casca__fundo { top: var(--aba-teste-a); }
  body.aba-teste .popover { top: calc(var(--aba-teste-a) + var(--cab-a) + 4px); }
}
/* seletor de conta: "Alternar candidato" em cima do nome (Política com segundo candidato, base_85) */
.seletor__textos { display: grid; min-width: 0; line-height: 1.15; text-align: left; }
.seletor__rotulo { font-size: var(--t-xs); color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seletor__rotulo[hidden] { display: none; }
