/* Saude da Cidade: estilo comum dos 5 apps e da pagina inicial.
   Sem fonte externa: usa a fonte do proprio celular. Base 18px, botoes >= 48px. */
:root {
  --cor: #0B5CAD;          /* cor do app (o motor troca pela do conteudo.json) */
  --cor-clara: #E8F0FA;    /* fundo suave derivado da cor (o motor recalcula) */
  --texto: #1A1A1A;
  --texto-2: #4A4A4A;      /* contraste 8.9:1 no branco */
  --borda: #D0D5DB;
  --fundo: #FFFFFF;
  --fundo-2: #F4F6F8;
  --perigo: #B71C1C;       /* vermelho de emergencia, 6.6:1 no branco */
  --perigo-claro: #FDECEA;
  --ok: #1B5E20;
  --raio: 12px;
  --barra-h: 0px;
}
* { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  line-height: 1.5; padding-bottom: calc(var(--barra-h) + env(safe-area-inset-bottom, 0px));
}
img, svg { max-width: 100%; }
a { color: var(--cor); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #111; outline-offset: 2px; border-radius: 4px; }
/* titulo focado pelo motor ao abrir secao: sem anel no toque/clique, com anel no teclado */
[tabindex="-1"]:focus:not(:focus-visible), [tabindex="-1"].sem-anel:focus { outline: none; }
.visivel-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pular { position: absolute; left: -9999px; top: 0; background: #111; color: #fff; padding: 12px 16px; z-index: 50; }
.pular:focus { left: 8px; top: 8px; }

/* Cabecalho */
.topo { background: var(--cor); color: #fff; }
.topo-int { max-width: 720px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.topo img.icone-app { width: 48px; height: 48px; border-radius: 12px; border: 2px solid rgba(255,255,255,.6); flex: none; }
.topo h1, .topo .titulo-app { margin: 0; font-size: 1.3rem; line-height: 1.2; }
.topo p { margin: 2px 0 0; font-size: .9rem; opacity: .95; }
.topo a { color: #fff; }
.cidade-linha { max-width: 720px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--texto-2); border-bottom: 1px solid var(--borda); }
.cidade-linha img { width: 32px; height: 32px; flex: none; }

main { max-width: 720px; margin: 0 auto; padding: 16px; }
h2 { font-size: 1.35rem; line-height: 1.25; margin: 8px 0 12px; }
h3 { font-size: 1.1rem; margin: 18px 0 8px; }
p { margin: 0 0 12px; }
.descricao { color: var(--texto-2); }

/* Botoes */
.botao, button.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; min-width: 48px; padding: 10px 18px; border-radius: var(--raio);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 2px solid var(--cor); background: var(--cor); color: #fff;
}
.botao.secundario { background: #fff; color: var(--cor); }
.botao.perigo { background: var(--perigo); border-color: var(--perigo); color: #fff; }
.botao.ligar-grande { width: 100%; font-size: 1.25rem; min-height: 64px; margin: 8px 0 16px; }
.botao.largo { width: 100%; }
.botao[disabled] { opacity: .55; cursor: not-allowed; }
.botao svg { width: 22px; height: 22px; flex: none; }
.voltar { margin-bottom: 12px; }
.linha-botoes { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

/* Cartoes (pagina inicial e lista de secoes) */
.cartoes { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.cartao {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 14px;
  border: 2px solid var(--borda); border-radius: var(--raio); background: #fff; color: var(--texto);
  text-decoration: none; font: inherit; text-align: left; cursor: pointer;
}
.cartao:hover { border-color: var(--cor); }
.cartao img { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.cartao .cartao-txt { flex: 1; min-width: 0; }
.cartao strong { display: block; font-size: 1.15rem; }
.cartao span.sub { display: block; color: var(--texto-2); font-size: .95rem; }
.cartao .seta { flex: none; width: 24px; height: 24px; color: var(--cor); }
.cartao.urgente { border-color: var(--perigo); }
.selo { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--fundo-2); color: var(--texto-2); border: 1px solid var(--borda); }
.selo.urgente { background: var(--perigo); color: #fff; border-color: var(--perigo); }
.selo.exemplo { background: #FFF4D6; color: #6B4E00; border-color: #E0C060; }
.selo.ok { background: #E3F1E4; color: var(--ok); border-color: #9CCB9F; }

/* Blocos */
.bloco { border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px; margin: 0 0 14px; background: #fff; }
.bloco.suave { background: var(--cor-clara); border-color: transparent; }
.bloco.alerta { background: var(--perigo-claro); border: 2px solid var(--perigo); }
.bloco.alerta h3, .bloco.alerta h2 { color: var(--perigo); margin-top: 0; }
.bloco.atual { border: 3px solid var(--cor); }
.lista-simples { margin: 0; padding-left: 1.2em; }
.lista-simples li { margin: 6px 0; }

/* Passos numerados grandes (guia) */
.passos { list-style: none; counter-reset: passo; margin: 0; padding: 0; }
.passos li { counter-increment: passo; position: relative; padding: 10px 0 10px 64px; min-height: 56px; font-size: 1.1rem; border-bottom: 1px solid var(--borda); }
.passos li::before {
  content: counter(passo); position: absolute; left: 0; top: 8px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--cor); color: #fff; font-weight: 700; font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
}
.nao-faca { list-style: none; padding: 0; margin: 0; }
.nao-faca li { padding: 8px 0 8px 36px; position: relative; }
.nao-faca li::before { content: "X"; position: absolute; left: 4px; top: 8px; font-weight: 800; color: var(--perigo); }
.alertas-lista { list-style: none; padding: 0; margin: 0 0 12px; }
.alertas-lista li { padding: 10px 12px 10px 40px; position: relative; border-bottom: 1px solid #F3B9B5; font-weight: 600; }
.alertas-lista li::before { content: "!"; position: absolute; left: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--perigo); color: #fff; font-weight: 800; text-align: center; line-height: 22px; font-size: .9rem; }

/* Marcar (plano / checklist) */
.marcavel { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--borda); border-radius: var(--raio); margin-bottom: 10px; background: #fff; }
.marcavel.feito { background: #F1F8F1; border-color: #9CCB9F; }
.marcavel input[type=checkbox] { width: 32px; height: 32px; margin: 4px 0 0; flex: none; accent-color: var(--cor); cursor: pointer; }
.marcavel label { flex: 1; cursor: pointer; }
.marcavel .dica { display: block; color: var(--texto-2); font-size: .95rem; margin-top: 4px; }
.marcavel-corpo { flex: 1; min-width: 0; }
.marcavel-corpo label { display: block; }
.marcavel .fonte-item { margin: 4px 0 0; font-size: .85rem; }
.fonte { overflow-wrap: anywhere; margin: 0 0 14px; line-height: 1.5; }
.lista-fontes { margin: 4px 0 0; padding-left: 20px; }
.lista-fontes li { margin: 0 0 6px; }
.placar { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.placar div { flex: 1 1 140px; background: var(--cor-clara); border-radius: var(--raio); padding: 12px; }
.placar strong { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--texto); }
.placar span { font-size: .9rem; color: var(--texto-2); }
.progresso { height: 14px; background: var(--fundo-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--borda); margin: 6px 0 14px; }
.progresso > div { height: 100%; background: var(--cor); width: 0; }

/* Formularios */
.campo { margin: 0 0 14px; }
.campo label, .campo legend { display: block; font-weight: 600; margin-bottom: 6px; }
.campo input[type=date], .campo input[type=datetime-local], .campo input[type=number], .campo input[type=time], .campo input[type=text], .campo textarea {
  width: 100%; min-height: 48px; font: inherit; padding: 10px 12px; border: 2px solid #8A9099; border-radius: 10px; background: #fff; color: var(--texto);
}
.campo textarea { min-height: 96px; }
.campo fieldset { border: 0; margin: 0; padding: 0; }
.opcoes { display: flex; flex-wrap: wrap; gap: 8px; }
.opcoes label { display: inline-flex; align-items: center; justify-content: center; min-width: 56px; min-height: 48px; padding: 6px 12px; border: 2px solid #8A9099; border-radius: 10px; font-weight: 600; cursor: pointer; margin: 0; }
.opcoes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* Classe posta pelo JS (celular antigo nao entende :has). */
.opcoes label.marcado { background: var(--cor); border-color: var(--cor); color: #fff; }
.opcoes label.foco { outline: 3px solid #111; outline-offset: 2px; }
.ajuda { font-size: .9rem; color: var(--texto-2); }

/* Linha do tempo */
.linha-tempo { list-style: none; padding: 0; margin: 0; border-left: 4px solid var(--cor-clara); }
.linha-tempo > li { position: relative; padding: 0 0 4px 18px; }
.linha-tempo > li::before { content: ""; position: absolute; left: -12px; top: 18px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--cor); }
.linha-tempo .rotulo { font-weight: 800; color: var(--cor); }
.vacinas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Respiracao */
.respiro { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 12px 0 20px; }
.respiro-palco { width: 260px; height: 260px; display: flex; align-items: center; justify-content: center; position: relative; }
.respiro-circulo {
  position: absolute; inset: 0; margin: auto; width: 260px; height: 260px; border-radius: 50%;
  background: var(--cor-clara); border: 6px solid var(--cor); transform: scale(.45);
  transition-property: transform; transition-timing-function: ease-in-out;
}
.respiro-texto { position: relative; text-align: center; }
.respiro-texto strong { display: block; font-size: 1.6rem; }
.respiro-texto span { font-size: 2.2rem; font-weight: 800; color: var(--cor); }
@media (prefers-reduced-motion: reduce) {
  .respiro-circulo { transition: none !important; transform: none !important; }
}

/* Unidades */
.unidade h3 { margin-top: 0; }
.unidade .meta { color: var(--texto-2); font-size: .95rem; margin: 0 0 6px; }

/* Barra fixa de telefones */
/* Uma linha so (48px de botao), rolavel na horizontal se nao couber. O body tem padding-bottom
   = altura medida da barra (--barra-h), entao nada do conteudo fica escondido atras dela. */
.barra-fixa {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 2px solid var(--borda);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.barra-fixa::-webkit-scrollbar { display: none; }
.barra-fixa { gap: 6px; padding-left: 6px; padding-right: 6px; justify-content: center; }
.barra-fixa a { flex: 1 0 0; min-width: 88px; max-width: 200px; min-height: 48px; height: 48px; padding: 0 6px; white-space: nowrap; border-radius: 10px;
  flex-direction: column; gap: 2px; line-height: 1; }
.barra-fixa .barra-rot { font-size: .72rem; font-weight: 600; }
.barra-fixa .barra-num { font-size: 1.05rem; font-weight: 800; }

/* Rodape */
.rodape { max-width: 720px; margin: 24px auto 0; padding: 16px; border-top: 1px solid var(--borda); font-size: .95rem; color: var(--texto-2); }
.rodape .aviso { background: var(--fundo-2); border-radius: var(--raio); padding: 12px; color: var(--texto); }
.rodape ol { padding-left: 1.2em; }
.rodape li { margin: 4px 0; overflow-wrap: anywhere; }
.privacidade { font-size: .9rem; }
/* telefones no rodape (Disque Saude 136 etc.): alvo de toque >= 44px */
a.tel-rodape { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; margin: 0 -6px; font-weight: 600; }
.faixa-demo { max-width: 720px; margin: 0 auto; padding: 6px 16px; font-size: .85rem; color: #6B4E00; background: #FFF4D6; border-bottom: 1px solid #E0C060; }

.erro-carga { border: 2px solid var(--perigo); background: var(--perigo-claro); padding: 14px; border-radius: var(--raio); }
.aviso-dev { background: #FFF4D6; color: #6B4E00; text-align: center; padding: 6px; font-weight: 700; font-size: .9rem; }
.oculto { display: none !important; }
