:root {
  --fundo: #f4f5f7; --superficie: #ffffff; --texto: #1c2430; --texto-2: #5a6472; --borda: #dde1e6;
  --acento: #1f5fbf; --acento-texto: #ffffff; --barra: #3b76d6;
  --ok: #1d7a3e; --ok-fundo: #e6f4ea; --aviso: #8a5a00; --aviso-fundo: #fff4d6; --erro: #b3261e; --erro-fundo: #fde8e6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #12161c; --superficie: #1b2129; --texto: #e6e9ee; --texto-2: #9aa4b2; --borda: #2d3540;
    --acento: #5b9bff; --acento-texto: #0b1220; --barra: #5b9bff;
    --ok: #6fd28f; --ok-fundo: #173323; --aviso: #f2c14e; --aviso-fundo: #3a2f12; --erro: #ff8a80; --erro-fundo: #3d1b19;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* o atributo hidden sempre esconde, mesmo com display definido no CSS */
body { margin: 0; background: var(--fundo); color: var(--texto); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--acento); }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.35rem; margin: 8px 0 16px; }
h1 small, h2 small { font-weight: 400; color: var(--texto-2); font-size: .8em; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }

.topo { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 16px; background: var(--superficie); border-bottom: 1px solid var(--borda); }
.topo nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.topo nav a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--texto); }
.topo nav a[aria-current] { background: var(--acento); color: var(--acento-texto); }
.topo .quem { color: var(--texto-2); font-size: .9em; }

.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.estreito { max-width: 420px; margin: 40px auto; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 16px; }

label { display: block; margin-bottom: 12px; color: var(--texto-2); font-size: .9em; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; color: var(--texto); background: var(--fundo); border: 1px solid var(--borda); border-radius: 6px; }
input[type=file] { padding: 8px; }
button, .botao { display: inline-block; padding: 10px 16px; font: inherit; font-weight: 600; border: 0; border-radius: 8px; background: var(--acento); color: var(--acento-texto); cursor: pointer; text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
.secundario { background: transparent; color: var(--acento); border: 1px solid var(--acento); }
.perigo { background: var(--erro); color: #fff; }
.pequeno { padding: 4px 10px; font-size: .85em; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.em-linha { display: flex; gap: 6px; align-items: center; }
.em-linha input { margin: 0; padding: 4px 8px; width: 120px; }

.alerta { padding: 10px 12px; border-radius: 8px; background: var(--fundo); border-left: 4px solid var(--texto-2); margin: 0 0 16px; }
.alerta.ok { background: var(--ok-fundo); border-color: var(--ok); }
.alerta.aviso { background: var(--aviso-fundo); border-color: var(--aviso); }
.alerta.erro { background: var(--erro-fundo); border-color: var(--erro); }
.alerta p { margin: 0 0 6px; }
.dica { color: var(--texto-2); font-size: .9em; }

.selo { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .8em; font-weight: 600; white-space: nowrap; }
.selo.ok { background: var(--ok-fundo); color: var(--ok); }
.selo.aviso { background: var(--aviso-fundo); color: var(--aviso); }
.selo.erro { background: var(--erro-fundo); color: var(--erro); }

/* leitor */
#camera { width: 100%; max-width: 520px; margin: 0 auto; border-radius: 8px; overflow: hidden; }
#camera:empty { display: none; }
.progresso, .historico { list-style: none; padding: 0; margin: 0; }
.progresso li, .historico li { padding: 8px 10px; border-radius: 6px; margin-bottom: 4px; background: var(--fundo); }
.progresso li.ok, .historico li.ok { background: var(--ok-fundo); color: var(--ok); }
.progresso li.falta { color: var(--texto-2); }
.progresso li.info { font-weight: 700; }
.historico li.erro { background: var(--erro-fundo); color: var(--erro); }
.historico li.aviso { background: var(--aviso-fundo); color: var(--aviso); }
.leitor .acoes button, .leitor .acoes .botao { flex: 1; text-align: center; padding: 14px; }

/* painel */
.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
.filtros label { margin: 0; flex: 1 1 130px; }
.filtros input, .filtros select { background: var(--superficie); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--superficie); border: 1px solid var(--borda); border-radius: 10px; padding: 12px 14px; }
.kpi span { display: block; color: var(--texto-2); font-size: .85em; }
.kpi b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.kpi small { margin-left: 6px; color: var(--texto-2); }
.alerta-kpi { border-color: var(--erro); }
.alerta-kpi b { color: var(--erro); }
.cab-secao { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.abas { display: flex; flex-wrap: wrap; gap: 6px; }
.abas a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--borda); text-decoration: none; color: var(--texto); background: var(--superficie); }
.abas a[aria-current] { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }

.cartao:has(> .tabela) { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: .92em; }
.tabela th { text-align: left; color: var(--texto-2); font-weight: 600; border-bottom: 1px solid var(--borda); padding: 6px 8px; white-space: nowrap; }
.tabela td { padding: 6px 8px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tabela tfoot td { font-weight: 700; border-bottom: 0; }
.tabela tbody tr:hover { background: var(--fundo); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela .num { text-align: right; }
.atenuada td { color: var(--texto-2); }
.barra-col { width: 30%; min-width: 80px; }
.barra { display: block; height: 10px; min-width: 2px; background: var(--barra); border-radius: 0 4px 4px 0; }
.atenuada .barra { background: var(--texto-2); opacity: .5; }
@media (max-width: 600px) { .barra-col { display: none; } }

.dados { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; }
.dados dt { color: var(--texto-2); }
.dados dd { margin: 0; }
.hash { font-family: ui-monospace, Consolas, monospace; font-size: .8em; word-break: break-all; }
pre.qr { white-space: pre-wrap; word-break: break-all; font-size: .75em; background: var(--fundo); padding: 8px; border-radius: 6px; }
.lista-secoes { line-height: 1.9; }
.rodape-leitor { text-align: center; }

/* leitor simplificado para o fiscal */
.leitor { max-width: 560px; margin: 0 auto; }
.leitor-titulo { text-align: center; margin: 4px 0 12px; }
.centro { text-align: center; }
.alerta.grande { font-size: 1.05rem; font-weight: 600; padding: 14px; }
.acoes.grandes { flex-direction: column; margin: 12px 0 4px; }
.acoes.grandes button, .acoes.grandes .botao { width: 100%; padding: 18px; font-size: 1.15rem; text-align: center; border-radius: 12px; }
.progresso.grande li { font-size: 1.1rem; padding: 12px 14px; }
#camera { margin-bottom: 8px; }
/* Visor QUADRADO (o QR é quadrado), com lado de no máximo metade da altura da tela. O vídeo não é esticado
   nem recortado por CSS (isso distorceria a área lida): ocupa a largura do visor na proporção original
   e fica centralizado; o que passa do quadrado (em cima e embaixo, com o celular em pé) só não aparece. */
#camera { position: relative; width: min(100%, 520px, 50vh); width: min(100%, 520px, 50svh); aspect-ratio: 1 / 1;
  background: #000; scroll-margin-top: 8px; }
/* O vídeo tem o DOBRO do tamanho do visor e é reduzido à metade só na exibição (transform). A biblioteca analisa
   a área lida no tamanho do vídeo na página: com o dobro, ela enxerga o QR com o dobro de pontos (num celular,
   ~620 px em vez de ~310 px para um QR de 90 módulos), o que torna a leitura bem mais fácil. */
#camera video { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.5); display: block;
  width: 200% !important; height: auto !important; max-width: none; border-radius: 0 !important; }
#camera #qr-shaded-region { display: none !important; }
#camera .moldura { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); aspect-ratio: 1 / 1; border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28); pointer-events: none; z-index: 4; }
.nome-fiscal { margin-top: 12px; color: var(--texto-2); }
.nome-fiscal input { margin-top: 8px; }

/* página de teste: QR na tela para ler com o celular */
.qr-navegacao { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 8px 0 12px; }
.qr-img { max-width: 560px; margin: 0 auto; background: #fff; padding: 8px; border-radius: 8px; }
.qr-img svg { display: block; width: 100%; height: auto; }

/* painel: cartões de candidato com foto */
.painel-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.painel-cab .auto { display: flex; gap: 6px; align-items: center; margin: 0; }
.painel-cab .auto input { width: auto; margin: 0; }
.abas.cargos { margin: 4px 0 12px; }
.resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 0 16px; }
.cands { display: grid; gap: 10px; }
.cands.destaque { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.cand { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--borda); border-radius: 10px; background: var(--superficie); }
.cand img { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--fundo); flex: none; }
.cand.grande img { width: 60px; height: 80px; }
.cand-info { flex: 1; min-width: 0; }
.cand-nome { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-partido { color: var(--texto-2); font-size: .85em; }
.cand-barra { height: 8px; background: var(--fundo); border-radius: 4px; margin: 6px 0 4px; overflow: hidden; }
.cand-barra span { display: block; height: 100%; background: var(--barra); border-radius: 0 4px 4px 0; }
.cand-num { font-variant-numeric: tabular-nums; }
.cand-num b { font-size: 1.15rem; }
.cand-num span { color: var(--texto-2); font-size: .85em; margin-left: 4px; }
.com-foto { white-space: nowrap; }
.com-foto img { width: 24px; height: 32px; object-fit: cover; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.pos { color: var(--texto-2); font-variant-numeric: tabular-nums; }
.progresso-kpi { display: block; height: 6px; background: var(--fundo); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.progresso-kpi span { display: block; height: 100%; background: var(--barra); }
.kpi small { display: block; margin: 2px 0 0; }
.kpi b small { display: inline; font-size: .6em; color: var(--texto-2); }

/* evita que nomes longos alarguem a grade no celular */
.resumo > .cartao, .grade > .cartao, .cands > .cand, .cand-info { min-width: 0; }
.painel-cab h1 { min-width: 0; overflow-wrap: anywhere; }
.faixa-treino { background: repeating-linear-gradient(135deg, var(--aviso-fundo) 0 14px, transparent 14px 28px), var(--aviso-fundo);
  border: 2px solid var(--aviso); color: var(--texto); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; }
.faixa-treino b { color: var(--aviso); }
@media (max-width: 600px) {
  main { padding: 12px; }
  .topo nav a { padding: 6px 8px; }
  .filtros label { flex: 1 1 45%; }
}

/* visão por local de votação */
.mapa { height: 540px; border-radius: 8px; overflow: hidden; z-index: 0; }
.legenda-mapa { color: var(--texto-2); font-size: .85em; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.legenda-mapa .amostra { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--borda); margin-left: 6px; }
td.pendentes { font-size: .85em; color: var(--texto-2); max-width: 260px; }
.filtros label.largo { flex: 2 1 240px; }
.leaflet-popup-content { font: 13px/1.45 system-ui, sans-serif; }
.filtros .botao { white-space: nowrap; }
.acoes.grandes .botao-fotos { font-size: 1rem; padding: 14px; font-weight: 600; }
.limpar-celular { margin-top: 12px; }

/* tabela por local: mais votado de cada cargo com foto */
.tabela-locais td.lider { min-width: 130px; }
.tabela-locais td.lider img { width: 24px; height: 32px; object-fit: cover; border-radius: 3px; float: left; margin-right: 6px; }
.tabela-locais td.lider span { display: block; font-size: .85em; line-height: 1.3; overflow: hidden; }

/* cartão do local no mapa */
.popup-local .leaflet-popup-content { margin: 12px 14px; font: 13px/1.4 system-ui, sans-serif; color: #1c2430; }
.popup-local .leaflet-popup-content-wrapper { border-radius: 12px; }
.pl-cab b { display: block; font-size: 14px; }
.pl-cab small { display: block; color: #5a6472; }
.pl-prog { height: 6px; background: #e3e8ef; border-radius: 3px; margin: 6px 0 4px; overflow: hidden; }
.pl-prog span { display: block; height: 100%; background: #1f5fbf; }
.pl-vazio { color: #5a6472; margin: 10px 0 0; }
.pl-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 8px; margin-top: 10px; }
.pl-bloco { text-align: center; background: #f4f6f9; border-radius: 8px; padding: 8px 4px 6px; min-width: 0; }
.pl-cargo { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: #5a6472; margin-bottom: 5px;
  line-height: 1.15; height: 2.3em; display: flex; align-items: center; justify-content: center; }
.pl-bloco img { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: #e3e8ef; display: block; margin: 0 auto 5px; }
.pl-nome { font-weight: 700; font-size: 11.5px; line-height: 1.2; height: 2.4em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pl-partido { font-size: 10px; color: #5a6472; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-pct { font-weight: 800; font-size: 15px; color: #1f5fbf; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pl-link { display: block; margin-top: 10px; font-weight: 600; }

/* lista de conferência */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--borda); }
.checklist li:last-child { border-bottom: 0; }
.ck-icone { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85em; }
.checklist .ok .ck-icone { background: var(--ok-fundo); color: var(--ok); }
.checklist .erro .ck-icone { background: var(--erro-fundo); color: var(--erro); }
.checklist .aviso .ck-icone { background: var(--aviso-fundo); color: var(--aviso); }
.checklist .info .ck-icone { background: var(--fundo); color: var(--texto-2); }
.checklist span { color: var(--texto-2); }
.ck-acao { color: var(--texto); font-weight: 600; }

/* guia do fiscal */
.guia { max-width: 680px; margin: 0 auto; }
.guia ol, .guia ul { padding-left: 22px; margin: 0; }
.guia li { margin-bottom: 8px; }
.guia-problemas dt { font-weight: 700; margin-top: 10px; }
.guia-problemas dd { margin: 2px 0 0; color: var(--texto-2); }
@media print { .topo, .guia .botao { display: none; } .cartao { border: 1px solid #999; break-inside: avoid; } body { background: #fff; color: #000; } }
@media (max-width: 600px) {
  .mapa { height: 600px; }
  .popup-local .leaflet-popup-content { margin: 10px; }
  .pl-cab b { font-size: 13px; }
  .pl-grade { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pl-bloco img { width: 40px; height: 53px; }
  .pl-pct { font-size: 14px; }
}

/* mapa em tela cheia */
/* !important: o Leaflet põe position: relative direto no elemento do mapa */
.mapa.mapa-cheia { position: fixed !important; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; z-index: 1000; }
body.sem-rolagem { overflow: hidden; }
.mapa-sair { position: absolute; top: 10px; right: 10px; z-index: 1001; background: #fff; color: #1c2430; border: 1px solid #c9ced6;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.cab-secao #btnTelaCheia { order: 2; }

/* quem venceu em mais seções */
.vitorias { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.vit-cargo { border: 1px solid var(--borda); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.vit-titulo { font-weight: 700; font-size: .8em; text-transform: uppercase; letter-spacing: .03em; color: var(--texto-2); margin-bottom: 6px; }
.vit-cand { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.vit-pos { width: 22px; text-align: center; font-weight: 700; color: var(--texto-2); flex: none; }
.vit-cand img { width: 34px; height: 45px; object-fit: cover; border-radius: 5px; background: var(--fundo); flex: none; }
.vit-1 img { width: 44px; height: 58px; }
.vit-1 .vit-pos { color: var(--barra); font-size: 1.1em; }
.vit-info { flex: 1; min-width: 0; }
.vit-nome { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vit-partido { font-size: .8em; color: var(--texto-2); }
.vit-barra { height: 6px; background: var(--fundo); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.vit-barra span { display: block; height: 100%; background: var(--barra); border-radius: 0 3px 3px 0; }
.vit-num { text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.vit-num b { font-size: 1.25rem; display: block; line-height: 1; }
.vit-1 .vit-num b { font-size: 1.5rem; }
.vit-num small { color: var(--texto-2); font-size: .75em; }
.vit-empates { margin: 4px 0 0; font-size: .8em; }

/* mapa: modos (andamento / líder por cargo) */
.mapa-controles { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
#modosMapa button { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--borda); background: var(--superficie); color: var(--texto); font-weight: 600; }
#modosMapa button[aria-pressed="true"] { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }
.legenda-mapa { min-height: 1.6em; }
.marcador-lider { background: none; border: 0; }
.ml-foto { width: 46px; height: 58px; margin: 0 auto; border-radius: 10px; overflow: hidden; border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.45); background: #c9ced6; }
.ml-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ml-vazio { display: flex; align-items: center; justify-content: center; color: #5a6472; font-weight: 700; font-size: 20px; }
.ml-pct { margin: -6px auto 0; width: max-content; position: relative; background: #1f5fbf; color: #fff; font: 700 12px/1 system-ui, sans-serif;
  padding: 3px 6px; border-radius: 99px; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.ml-sem { background: #5a6472; font-weight: 600; font-size: 10px; }
.ml-leg-titulo { font-weight: 700; margin-right: 6px; }
.ml-leg { display: inline-flex; align-items: center; gap: 5px; margin: 2px 12px 2px 0; }
.ml-leg img { width: 22px; height: 28px; object-fit: cover; border-radius: 4px; background: var(--fundo); }
.ml-leg small { color: var(--texto-2); }

/* ---------------- modo telão (sempre escuro, letras grandes) ---------------- */
body.tela {
  --fundo: #0b0f14; --superficie: #151b23; --texto: #f1f4f8; --texto-2: #a3adbb; --borda: #273140; --barra: #5b9bff; --acento: #5b9bff;
  --aviso: #f2c14e; --aviso-fundo: #3a2f12;
  background: var(--fundo); color: var(--texto); margin: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden;
  font-size: clamp(15px, 1.25vw, 26px);
}
.tela-cab { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; justify-content: space-between; padding: 14px 28px;
  border-bottom: 1px solid var(--borda); background: var(--superficie); }
.tela-titulo { font-weight: 800; font-size: 1.4em; }
.tela-ficticio { margin-left: 14px; font-size: .6em; vertical-align: middle; background: var(--aviso-fundo); color: var(--aviso);
  border: 2px solid var(--aviso); border-radius: 8px; padding: 4px 10px; }
.tela-andamento { display: flex; align-items: center; gap: 12px; font-size: 1.15em; }
.tela-andamento b { font-size: 1.3em; }
.tela-prog { display: inline-block; width: 11em; height: .6em; background: var(--borda); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.tela-prog span { display: block; height: 100%; background: var(--barra); }
.tela-hora { color: var(--texto-2); }
.tela-hora b { color: var(--texto); }
.tela-slides { flex: 1; position: relative; overflow: hidden; width: 100%; max-width: none; margin: 0; padding: 0; }
.slide { position: absolute; inset: 0; padding: 20px 28px; opacity: 0; visibility: hidden; transition: opacity .6s; overflow: hidden; }
.slide.ativo { opacity: 1; visibility: visible; }
.slide-titulo { font-size: 1.8em; margin: 0 0 18px; }
.slide-titulo small { font-size: .5em; color: var(--texto-2); font-weight: 400; margin-left: 12px; }
.tela-vazio { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 2em; color: var(--texto-2); }
.tela-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(22em, 1fr)); gap: 16px 24px; }
.tela-cargo h3 { margin: 0 0 8px; font-size: 1.1em; color: var(--texto-2); text-transform: uppercase; letter-spacing: .04em; }
.tela .cand { padding: .5em; gap: .7em; }
.tela .cand img { width: 3.2em; height: 4.2em; }
.tela .cand.grande img { width: 4.6em; height: 6.1em; }
.tela .cand-nome { font-size: 1.05em; }
.tela .cand-num b { font-size: 1.5em; }
.tela .cand.grande .cand-num b { font-size: 2em; }
.tela .cand-barra { height: .55em; }
.tela-cands { grid-template-columns: repeat(auto-fill, minmax(24em, 1fr)) !important; gap: 14px; }
.tela-cands.muitos { grid-template-columns: repeat(auto-fill, minmax(20em, 1fr)) !important; }
.tela-cands.muitos .cand.grande img { width: 3.6em; height: 4.8em; }
.tela-cands.muitos .cand.grande .cand-num b { font-size: 1.5em; }
.tela-mapa-grade { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; height: calc(100% - 3.5em); }
.tela-mapa { height: 100%; border-radius: 12px; }
.tela-locais { list-style: none; margin: 0; padding: 0; overflow: hidden; font-size: .85em; }
.tela-locais li { display: grid; grid-template-columns: 1fr 7em 3.5em; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--borda); }
.tl-nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tela-locais .tela-prog { width: 100%; }
.tela-locais b { text-align: right; font-variant-numeric: tabular-nums; }
.tela-rodape { display: flex; justify-content: space-between; align-items: center; padding: 8px 28px; border-top: 1px solid var(--borda); color: var(--texto-2); font-size: .75em; }
.tela-rodape a { color: var(--texto-2); }
.tela-pontos { display: flex; gap: 8px; }
.tela-pontos button { width: 12px; height: 12px; padding: 0; border-radius: 50%; background: var(--borda); border: 0; }
.tela-pontos button.ativo { background: var(--barra); width: 32px; border-radius: 6px; }
body.tela.pausado .tela-pontos::after { content: 'pausado'; margin-left: 10px; color: var(--aviso); }
@media (max-width: 900px) { .tela-mapa-grade { grid-template-columns: 1fr; } .tela-locais { display: none; } body.tela { overflow: auto; } }
/* telão, slide de resumo: todos os cargos lado a lado */
.tela-resumo { grid-template-columns: repeat(auto-fit, minmax(14.5em, 1fr)); gap: 12px 16px; }
.tela-resumo .cands { gap: 10px; }
.tela-resumo .cand { flex-direction: column; align-items: stretch; text-align: left; }
.tela-resumo .cand img { width: 100%; height: auto; aspect-ratio: 3 / 4; max-height: 5.5em; object-fit: contain; background: transparent; }
.tela-resumo .cand-num b { font-size: 1.35em; }
.tela-resumo .cand-num span { display: block; margin: 0; }
.opcao-reais { display: flex; gap: 6px; align-items: center; flex: 1 1 100%; }
.opcao-reais input { width: auto; margin: 0; }
.opcao-reais small { color: var(--aviso); }


/* foco e zoom da câmera no leitor */
#camera { position: relative; }
.anel-foco { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 2px solid #ffd54a; border-radius: 50%;
  pointer-events: none; z-index: 5; animation: anel-foco .9s ease-out forwards; }
@keyframes anel-foco { from { transform: scale(1.4); opacity: 1; } to { transform: scale(.8); opacity: 0; } }
.ajuste-camera .dica { margin: 4px 0; }
.zoom { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 600; }
.zoom input { flex: 1; max-width: 320px; }

/* quadro para escolher o BU de uma seção com divergência */
.rolagem { overflow-x: auto; }
.alerta.ok { background: var(--ok-fundo); border-left: 4px solid var(--ok); }
.alerta ol { margin: 6px 0; padding-left: 22px; }
.escolha th[scope=row] { color: var(--texto-2); font-weight: 600; white-space: nowrap; }
.escolha thead th { text-align: center; vertical-align: bottom; }
.escolha td { text-align: center; min-width: 150px; }
.escolha .ref { background: var(--ok-fundo); }
.escolha tr.difere-linha td { font-weight: 700; }
.escolha form { margin: 0; }
.escolha-bu h3 { margin: 18px 0 4px; font-size: 1rem; }
.tabela td.difere, .difere-amostra { background: var(--erro-fundo); color: var(--erro); font-weight: 700; }
.difere-amostra { padding: 0 6px; border-radius: 4px; }
.tabela tr.novo-cargo td { border-top: 2px solid var(--borda); }

/* usuários: formulário estreito e lista larga (a lista tem mais colunas) */
.usuarios-grade { display: grid; grid-template-columns: minmax(260px, 1fr) 2.2fr; gap: 0 16px; align-items: start; }
.usuarios-grade > .cartao { min-width: 0; }
@media (max-width: 900px) { .usuarios-grade { grid-template-columns: 1fr; } }

/* moldura do leitor: pisca ao reconhecer um QR */
#camera .moldura { transition: border-color .15s, box-shadow .15s; }
#camera .moldura.lido { border-color: #5ac138; border-width: 5px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28), 0 0 18px 4px rgba(90, 193, 56, .8) inset; }
#camera .moldura.recusado { border-color: #ff5a4e; border-width: 5px; }

/* contador de alertas no menu */
.topo nav .contador { display: inline-block; min-width: 1.5em; padding: 0 6px; margin-left: 4px; border-radius: 99px; font-size: .75em;
  font-weight: 700; line-height: 1.6; text-align: center; background: var(--aviso-fundo); color: var(--aviso); }
.topo nav .contador.grave { background: var(--erro); color: #fff; }
