:root {
  --azul: #0d2247;
  --azul-claro: #16386f;
  --dourado: #c9a227;
  --verde-zap: #1eb955;
  --fundo: #f4f5f7;
  --cartao: #ffffff;
  --texto: #1c1e21;
  --texto-suave: #5b6470;
  --borda: #e3e6ea;
  --verde-status: #1a7f4e;
  --verde-status-fundo: #e2f4ea;
  --ambar-status: #8a5b00;
  --ambar-status-fundo: #fdf0d2;
  --azul-status: #185fa5;
  --azul-status-fundo: #e6f1fb;
  --cinza-status: #5b6470;
  --cinza-status-fundo: #eceef1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  padding-bottom: 70px;
}

/* Cabeçalho */
.topo {
  background: var(--azul);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 10;
}
.topo-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--dourado);
  color: var(--azul);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.35);
}
.topo-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 72% 28%;
}
.topo-textos { display: flex; flex-direction: column; line-height: 1.25; }
.topo-nome { font-weight: 600; font-size: 16px; }
.topo-cargo { font-size: 12.5px; opacity: .85; }
.topo-sino {
  margin-left: auto;
  background: none; border: none; color: #fff; cursor: pointer;
  padding: 8px;
}

/* Telas */
main { max-width: 640px; margin: 0 auto; padding: 16px; }
.tela h2 { font-size: 16px; margin: 20px 0 10px; color: var(--azul); }
.tela h2:first-child { margin-top: 4px; }

.cartao {
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.cartao h2 { margin: 0 0 8px; }
.cartao p { font-size: 14.5px; line-height: 1.6; color: var(--texto); }
.cartao-sub { font-size: 13px !important; color: var(--texto-suave) !important; margin: -2px 0 12px; }

/* Meus grupos e canais (página Quem sou) - grade 2 colunas com imagem */
.canais-lista {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.canal {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  background: var(--azul);
}
.canal-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.canal-rotulo {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 80px 10px 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  background: linear-gradient(to top, rgba(9,20,41,.92) 0%, rgba(9,20,41,.6) 55%, rgba(9,20,41,0) 100%);
}
.canal-botao {
  position: absolute;
  right: 8px; bottom: 8px;
  width: 68px; height: 48px;
  border-radius: 10px;
  background: var(--verde-status);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  display: flex; align-items: center; justify-content: center;
}
.canal:active { transform: scale(.98); }

/* Feed */
.post {
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.post-topo { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.post-rede {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 10px;
  background: var(--azul-status-fundo); color: var(--azul-status);
  text-transform: uppercase; letter-spacing: .3px;
}
.post-fixado {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 10px;
  background: #f6ecd0; color: #7a5c05;
}
.post-data { margin-left: auto; font-size: 12px; color: var(--texto-suave); }
.post-texto { font-size: 14.5px; line-height: 1.55; margin-bottom: 10px; }
.post-botao {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  text-decoration: none;
  background: var(--azul);
}
.post-botao:active { transform: scale(.97); }
.post-botao.rede-facebook { background: #1877F2; }
.post-botao.rede-instagram { background: #C13584; }
.post-botao.rede-tiktok { background: #010101; }

/* Cores das etiquetas por rede */
.post-rede.rede-youtube { background: #fde8e8; color: #c00; }
.post-rede.rede-instagram { background: #fce4ee; color: #b1245e; }
.post-rede.rede-facebook { background: #e3eefd; color: #1456b0; }
.post-rede.rede-tiktok { background: #e9e9ec; color: #111; }

/* Vídeo no feed */
.post-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}
.post-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.post-play svg {
  background: rgba(200,0,0,.92);
  border-radius: 50%;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.post-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.post-video-frame iframe { width: 100%; height: 100%; border: 0; }

/* Grade de discursos (3 por linha) */
.discursos-grade {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.discurso-item { display: flex; flex-direction: column; gap: 4px; }
.discurso-video.post-video .post-play svg { padding: 7px; }
.discurso-video-doc {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: var(--azul-status-fundo);
  color: var(--azul-status);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.discurso-legenda {
  font-size: 10.5px;
  color: var(--texto-suave);
  line-height: 1.3;
  margin: 0;
}

.vazio { text-align: center; padding: 40px 20px; color: var(--texto-suave); }
.vazio p { margin-bottom: 12px; font-size: 14.5px; }

/* Título das seções da tela de Início */
.secao-titulo {
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--texto);
  margin: 18px 0 10px;
}
#tela-inicio .secao-titulo:first-child { margin-top: 4px; }

/* Redes sociais - uma linha só com logo */
.redes-botoes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.rede-item {
  display: flex; align-items: center; justify-content: center;
  height: 50px;
  border-radius: 12px;
  text-decoration: none;
}
.rede-item svg { width: 26px; height: 26px; }
.rede-item:active { transform: scale(.95); }

/* Banner de enquete na Início */
.banner-enquete {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--azul);
  border-radius: 18px;
  padding: 14px;
  margin: 18px 0;
}
.banner-enquete-foto {
  width: 68px; height: 68px;
  border-radius: 12px;
  object-fit: cover;
  object-position: 50% 15%;
  flex-shrink: 0;
}
.banner-enquete-titulo {
  flex: 1;
  min-width: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.banner-enquete-botao {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--dourado);
  color: var(--azul);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  padding: 18px 14px;
  border-radius: 10px;
  line-height: 1.2;
}
.banner-enquete-botao:active { transform: scale(.97); }

/* Quem sou */
.lista-simples { list-style: none; }
.lista-simples li {
  font-size: 14.5px; line-height: 1.5;
  padding: 8px 0 8px 22px;
  position: relative;
  border-bottom: 1px solid var(--borda);
}
.lista-simples li:last-child { border-bottom: none; }
.lista-simples li::before {
  content: "";
  position: absolute; left: 4px; top: 15px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dourado);
}
.comissao-periodo { color: var(--texto-suave); font-size: 13px; }

.botao-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--verde-zap); color: #fff;
  font-size: 19px; font-weight: 600;
  padding: 18px; border-radius: 14px;
  text-decoration: none;
  margin: 16px 0;
}
.botao-whatsapp svg { width: 28px; height: 28px; }
.botao-whatsapp:active { transform: scale(.98); }

/* Painel de resultados */
.painel-titulo {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--azul);
  margin: 6px 0 2px;
  line-height: 1.3;
}
.painel-subtitulo {
  text-align: center;
  font-size: 12.5px;
  color: var(--texto-suave);
  margin: 0 0 14px;
}
.painel-destaque {
  background: var(--azul);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  margin-bottom: 10px;
}
.painel-destaque .num {
  font-size: 44px;
  font-weight: 700;
  color: var(--dourado);
  line-height: 1;
}
.painel-destaque .rotulo {
  font-size: 13px;
  color: #fff;
  margin-top: 4px;
  opacity: .9;
}
.painel-grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.painel-card {
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.painel-card .num { font-size: 28px; font-weight: 700; color: var(--azul); line-height: 1; }
.painel-card .rotulo { font-size: 12.5px; color: var(--texto-suave); margin-top: 5px; line-height: 1.25; }

/* Discursos e sessões */
.item-lista {
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.item-topo { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.item-tema {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 10px;
  background: var(--azul-status-fundo); color: var(--azul-status);
}
.item-data { margin-left: auto; font-size: 12px; color: var(--texto-suave); }
.item-titulo { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.item-resumo { font-size: 13.5px; line-height: 1.5; color: var(--texto-suave); margin-bottom: 8px; }
.item-links { display: flex; gap: 14px; }
.item-links a { font-size: 13px; color: var(--azul-status); text-decoration: none; font-weight: 500; }

.botao-mais {
  display: block; width: 100%;
  padding: 11px;
  background: none;
  border: 1px solid var(--borda);
  border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  color: var(--azul);
  cursor: pointer;
  margin-bottom: 8px;
}

/* Serviços - utilidade pública */
.servicos-desc { font-size: 13px; color: var(--texto-suave); margin: -4px 0 10px; }

.botoes-linha4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.botao-servico {
  font-family: inherit;
  cursor: pointer;
  border-radius: 16px;
  padding: 16px 8px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  border: none;
  text-decoration: none;
}
.botao-servico-icone {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.botao-servico-icone svg { width: 19px; height: 19px; }
.botao-ouvidoria { background: var(--azul); }
.botao-ouvidoria .botao-servico-icone { color: var(--azul); }
.botao-zap-servico { background: #4a5d23; }
.botao-zap-servico .botao-servico-icone { color: #4a5d23; }
.botao-emergencia { background: #a32d2d; }
.botao-emergencia .botao-servico-icone { color: #a32d2d; }
.botao-transparencia { background: #534AB7; }
.botao-transparencia .botao-servico-icone { color: #534AB7; }
.botao-servico:active { transform: scale(.96); }

/* Aviso */
.aviso {
  text-align: center;
  font-size: 13px;
  color: var(--texto-suave);
  padding: 16px;
}

/* Menu inferior */
.menu-inferior {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--cartao);
  border-top: 1px solid var(--borda);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.menu-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 7px;
  background: none; border: none;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--texto-suave);
  cursor: pointer;
}
.menu-item.ativo { color: var(--azul); font-weight: 600; }
.menu-item.ativo svg { color: var(--dourado); }

.carregando { text-align: center; padding: 30px; color: var(--texto-suave); font-size: 14px; }
