:root {
  --g: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --ink: #f3f4f8;
  --muted: #a0a6b8;
  --card: #1b1f2b;
  --line: #2d3345;
  --tab: 60px;
  --bg: #0f121a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

.screen { min-height: 100vh; }

#login.screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px 24px;
  background: var(--g);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 20px;
  padding: 28px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
}

.login-card h1 { margin: 0 0 6px; font-size: 26px; }

form { display: grid; gap: 14px; margin-top: 16px; }

label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }

input {
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
}

input:focus { outline: 2px solid #764ba2; border-color: transparent; }

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
}

button.primary {
  background: var(--g);
  color: #fff;
  font-weight: 600;
}

button.primary[disabled] { opacity: .6; cursor: default; }

button.link {
  background: none;
  color: #5b5fc7;
  padding: 10px 0 0;
  margin-top: 6px;
  width: 100%;
  font-size: 14px;
}

.muted { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.45; }

/* Área de conteúdo: espaço para a barra inferior */
.view {
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(var(--tab) + 40px + env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
}

.header {
  background: var(--g);
  color: #fff;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
}
.header h2 { margin: 0 0 4px; font-size: 20px; }
.header p { margin: 0; opacity: .9; font-size: 14px; }

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 22px 4px 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--g);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
}

.card .info { min-width: 0; flex: 1; }
.card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { font-size: 13px; color: var(--muted); }
.card .meta a { color: #5b5fc7; text-decoration: none; }

.card.me { border-color: #764ba2; box-shadow: 0 0 0 2px rgba(118, 75, 162, .18); }

.stack { display: grid; gap: 8px; }

/* Árvore */
ul.tree, ul.tree ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
  border-left: 2px solid var(--line);
}
ul.tree { border-left: 0; padding: 0; }
ul.tree li { margin: 8px 0; }
ul.tree li > .card { margin-bottom: 0; }

.toolbar {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}
.toolbar input { flex: 1; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

/* Barra inferior estilo app (padrão do Correios) */
/* Sem transform para centralizar: no PWA instalado do iPhone a barra com transform acompanhava a rolagem.
   Centraliza com left/right e margem automática, e promove a barra para a própria camada de composição. */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  margin: 0 auto;
  bottom: calc(14px + env(safe-area-inset-bottom));
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  backface-visibility: hidden;
  width: min(420px, calc(100% - 28px));
  height: var(--tab);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 99px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  z-index: 20;
}

/* Só ícones (os nomes ficam em aria-label e title). */
.tabbar button {
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  width: 46px;
  height: 44px;
  padding: 0;
  border-radius: 99px;
}

.tabbar button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Identidade visual na barra: logo da igreja como primeiro ícone */
.tabbar button.brand { color: #f3f4f8; }
.tabbar button.brand img { width: 36px; height: 36px; object-fit: contain; display: block; }
.tabbar button.on { color: #5b5fc7; background: rgba(118, 75, 162, .12); }

/* Barra do chat: fica acima da principal e some dentro de uma conversa (onde fica o campo de digitar). */
.tabbar.tabbar-sub {
  bottom: calc(var(--tab) + 22px + env(safe-area-inset-bottom));
  width: min(240px, calc(100% - 28px));
  height: 52px;
}
#app:has(.view-chat [data-chat-tela="conversa"]:not([hidden])) #tabbar-chat { display: none; }

.chat-favorito.on { color: #f5b301; }
.chat-favorito.on svg { fill: currentColor; }

.toast {
  position: fixed;
  left: 50%;
  /* Abaixo da barra de status do iPhone (notch), para o aviso não ficar escondido. */
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  transform: translateX(-50%);
  background: #1f2430;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  /* Acima das telas cheias (novo-post, z-index 70): o aviso de erro aparece mesmo dentro do formulário. */
  z-index: 100;
  max-width: calc(100% - 32px);
}
.toast.error { background: #b42318; }

/* Controles de modo */
.controls { margin: 0 0 14px; }

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 99px;
}

.segmented button {
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 13px;
}

.segmented button.on { background: var(--g); color: #fff; font-weight: 600; }

/* Expandir / recolher nível a nível */
.expand {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

/* Organograma com conectores */
.org-wrap { overflow-x: auto; padding: 8px 0 28px; }

.org-wrap > .org-box { margin: 0 auto; display: block; width: max-content; }

.org-link { width: 2px; height: 22px; background: var(--line); margin: 0 auto; }

ul.org, .org ul {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  min-width: max-content;
}

.org ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  height: 24px;
  border-left: 2px solid var(--line);
}

.org li {
  position: relative;
  list-style: none;
  padding: 24px 8px 0;
  text-align: center;
}

.org li::before,
.org li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 24px;
  border-top: 2px solid var(--line);
}

.org li::after { right: auto; left: 50%; border-left: 2px solid var(--line); }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:first-child::before { border: 0; }
.org li:last-child::after { border: 0; }
.org li:first-child::after { border-radius: 6px 0 0 0; }
.org li:last-child::before { border-right: 2px solid var(--line); border-radius: 0 6px 0 0; }

.org-box {
  display: inline-block;
  min-width: 150px;
  max-width: 200px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
}

.org-box.me { background: var(--g); border-color: transparent; color: #fff; }
.org-box.me .org-sub { color: #f0f0fa; }
.org-box.cell { border-style: dashed; }
.org-box .expand { display: block; margin: 8px auto 0; }
.org-name { font-weight: 600; font-size: 13px; }
.org-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Organograma: tema escuro do PWA (sem cores claras do MORDOMUS) */
/* organograma: tela grande própria, árvore vertical como no SYS */
.orgjan{display:flex;flex-direction:column;width:100%;height:100%;background:#0f121a;color:#f3f4f8}
.orgbar{display:flex;align-items:center;gap:10px;padding:10px 14px;background:#1b1f2b;border-bottom:1px solid #2d3345;flex-wrap:wrap;position:relative}
.orgbar h2{margin:0;font-size:13px;letter-spacing:.2em;font-family:var(--mono);color:#a5b4fc}
.orgbar .sp{flex:1}
.orgbar .x{position:static;width:36px;height:36px;background:#1b1f2b;border-color:#7aa686;color:#a5b4fc}
.orgabas{display:flex;background:#232838;border-radius:10px;padding:3px}
.orgabas button{border:0;background:transparent;padding:6px 14px;border-radius:8px;color:#a5b4fc;cursor:pointer;font-size:13px}
.orgabas button.on{background:#a5b4fc;color:#ffffff}
.orgbusca,.orgrede{background:#1b1f2b;border:1px solid #2d3345;border-radius:8px;padding:7px 10px;color:#f3f4f8;font-size:13px;min-width:0}
.orgbusca{width:260px}
.orgbtn{background:#1b1f2b;border:1px solid #2d3345;border-radius:8px;padding:6px 12px;color:#a5b4fc;cursor:pointer;font-size:12px}
.orgzoom{display:flex;align-items:center;gap:6px;color:#a5b4fc;font-size:13px}
.orgzoom button{width:28px;height:28px;border-radius:8px;border:1px solid #2d3345;background:#1b1f2b;color:#a5b4fc;cursor:pointer;font-size:16px}
.orgcnt{color:#a0a6b8;font-size:12px}
.orgcanvas{flex:1;min-height:0;overflow:auto;padding:28px;cursor:grab;touch-action:pan-x pan-y;background:radial-gradient(circle at 1px 1px,rgba(255,255,255,.14) 1px,transparent 0) 0 0/22px 22px,#0f121a}
.orgcanvas.movendo{cursor:grabbing;user-select:none}
.orginner{display:inline-block;min-width:100%;transform-origin:0 0}
.otfloresta{display:flex;gap:32px;justify-content:center;align-items:flex-start}
.otarv{display:flex;flex-direction:column;align-items:center}
.otfilhos{display:flex;justify-content:center;padding-top:46px;position:relative}
.otfilhos::before{content:"";position:absolute;top:0;left:50%;width:2px;height:23px;margin-left:-1px;background:#3b4256}
.otramo{position:relative;padding:23px 9px 0}
.otramo::before{content:"";position:absolute;top:0;left:0;right:0;height:2px;background:#3b4256}
.otramo:first-child::before{left:50%}.otramo:last-child::before{right:50%}
.otramo:only-child::before{display:none}
.otramo::after{content:"";position:absolute;top:0;left:50%;width:2px;height:23px;margin-left:-1px;background:#3b4256}
.otnode{display:flex;flex-direction:column;align-items:center;position:relative;cursor:pointer}
.otavatar{width:64px;height:64px;border-radius:999px;border:3px solid;background:#1b1f2b;display:grid;place-items:center;overflow:hidden;
  position:relative;z-index:2;margin-bottom:-26px;box-shadow:0 8px 18px rgba(15,23,42,.18)}
.otavatar .av{width:100%;height:100%;object-fit:cover;border:0;box-shadow:none;border-radius:0;cursor:zoom-in;display:grid;place-items:center;font-weight:600}
.otavatar .av.ini{background:#1b1f2b;color:#a5b4fc}
.otcard{width:216px;border:1px solid;border-radius:20px;background-color:#1b1f2b;padding:32px 12px 11px;text-align:center;
  box-shadow:0 12px 26px rgba(15,23,42,.1)}
.otnome{font-weight:800;font-size:15px;color:#f3f4f8;line-height:1.2;cursor:pointer}
.otnome:hover{text-decoration:underline}
.otnivel{font-size:12.5px;margin-top:2px}
.otselos{display:flex;gap:5px;justify-content:center;flex-wrap:wrap;margin-top:8px}
.otselos span{font-size:11px;background:rgba(255,255,255,.1);border-radius:999px;padding:2px 8px;color:#a0a6b8}
.otselos .otabre{background:#a5b4fc;color:#ffffff}
.otnode.ger .otcard{padding-top:12px;text-align:left}
.otnode.ger .otnome{font-size:14px}
.otlinha{font-size:11.5px;color:#a0a6b8;margin-top:3px}
.otnode.realce .otcard{outline:3px solid #f59e0b;outline-offset:2px}
.orgrodape{padding:6px 14px;background:#1b1f2b;border-top:1px solid #2d3345;font-size:12px;color:#a0a6b8}
@media (max-width:700px){.orgbusca{width:100%}.orgbar{gap:6px}}

/* aba Células */
.otcard.igr{background-image:linear-gradient(rgba(255,255,255,.18),rgba(255,255,255,.18));border-color:rgba(255,255,255,.5);padding-top:14px}
.otcard.redecab{padding-top:12px;min-width:180px}
.otcard.celcard{padding-top:12px;text-align:left;width:236px}
.otcel{padding:5px 0;border-bottom:1px dashed rgba(255,255,255,.25)}
.otcel:last-of-type{border-bottom:0}
.otcel b{display:block;font-size:13.5px;color:#f3f4f8;line-height:1.25}
.otcel span{font-size:11.5px;color:#a0a6b8}
.otcel.hit b{background:#fde68a;border-radius:4px}
.otnode.cel .otcard{cursor:pointer}
.otnode.raizcel .otcard{cursor:default}

.otlider{display:flex;align-items:center;gap:8px;margin-top:8px;padding-top:8px;border-top:1px dashed rgba(255,255,255,.3);cursor:pointer}
.otlider:hover b{text-decoration:underline}
.otlider small{display:block;font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:#a0a6b8;line-height:1.1}
.otlider b{font-size:12.5px;color:#f3f4f8;line-height:1.2}
.otlider .av.pq{width:34px;height:34px;flex:none;border-radius:999px;object-fit:cover;border:2px solid rgba(191,219,254,.9);
  display:grid;place-items:center;font-size:12px;font-weight:600;color:#a5b4fc;background:#1b1f2b;cursor:zoom-in;box-shadow:none}

.orgbtn.orgatualiza{background:#a5b4fc;color:#ffffff;border-color:#a5b4fc}
.orgbtn:disabled{opacity:.6;cursor:wait}

/* PWA: a aba Organograma usa a largura inteira da tela */
#view-org.view { max-width: none; padding: 0; }
#view-org:not([hidden]) {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
#view-org #org-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Tela cheia: o canvas ocupa tudo; a barra de controles e o rodapé flutuam por cima */
#view-org .orgjan {
  flex: 1;
  min-height: 0;
  height: auto;
  position: relative;
  border-radius: 0;
  padding: 0;
}
#view-org .orgbar {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 10px;
  right: 10px;
  z-index: 5;
  padding: 8px 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(27, 31, 43, .78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
#view-org .orgbar > * { flex: none; }
#view-org .orgbusca { width: 170px; }
#view-org .orgbar .sp { display: none; }
#view-org .orgcanvas {
  position: absolute;
  inset: 0;
  padding: calc(70px + env(safe-area-inset-top)) 14px calc(var(--tab) + 40px + env(safe-area-inset-bottom));
}
#view-org .orgrodape {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(var(--tab) + 24px + env(safe-area-inset-bottom));
  z-index: 5;
  padding: 0;
  background: none;
  border: 0;
  text-align: center;
  font-size: 11px;
  opacity: .85;
  pointer-events: none;
}

/* Organograma: seletor de estilo e visualização lateral */
.orgestilo { display: flex; background: #232838; border-radius: 10px; padding: 3px; }
.orgestilo button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; color: #a0a6b8; font-size: 13px; cursor: pointer; }
.orgestilo button.on { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }
#view-org .orgestilo { flex: none; }

.lat-wrap { padding: 8px 0 calc(var(--tab) + 90px); }
.lat-no { display: flex; flex-direction: column; align-items: flex-start; }
.lat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 250px;
  min-height: 66px;
  padding: 12px 30px 12px 12px;
  background: #1b1f2b;
  border: 1px solid #2d3345;
  border-radius: 14px;
  cursor: pointer;
  margin-bottom: 14px;
}
.lat-card.realce { outline: 2px solid #f59e0b; outline-offset: 2px; }
.lat-av {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #232838;
  border: 2px solid #3b4256;
}
.lat-av img { width: 100%; height: 100%; object-fit: cover; }
.lat-av .ini { color: #a5b4fc; font-weight: 700; font-size: 14px; }
.lat-info { min-width: 0; }
.lat-nome { font-weight: 600; font-size: 14px; color: #f3f4f8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lat-sub { font-size: 12px; color: #a0a6b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lat-badge {
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  padding: 1px 9px;
  border-radius: 99px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.lat-kids {
  margin: 0 0 0 26px;
  padding-left: 26px;
}
.lat-item { position: relative; }
/* Linha vertical e conector: a vertical termina no conector do último filho */
.lat-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 34px;
  width: 26px;
  height: 2px;
  background: #3b4256;
}
.lat-item::after {
  content: '';
  position: absolute;
  left: -26px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #3b4256;
}
.lat-item:first-child::after { top: -14px; }
.lat-item:last-child::after { bottom: auto; height: 35px; }
/* No celular, o rodapé flutuante não cobre a árvore */
@media (max-width: 700px) { #view-org .orgrodape { display: none; } }

/* Botão do WhatsApp nos cartões de líder */
.lat-row { display: flex; align-items: center; gap: 8px; }
.lat-row .lat-card { margin-bottom: 14px; }
.wa {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 4px 14px rgba(37, 211, 102, .35);
  text-decoration: none;
}
.wa svg { width: 22px; height: 22px; fill: #fff; }
#view-org .otcard { position: relative; }
#view-org .otwa { position: absolute; top: -16px; right: -16px; width: 36px; height: 36px; z-index: 2; }
.lat-card .wa.lat-wa { position: absolute; top: 50%; right: -18px; transform: translateY(-50%); width: 36px; height: 36px; z-index: 2; }

/* Cartões coloridos pelo degradê da rede: texto branco e selos translúcidos */
.rede-cor, .rede-cor .otnome, .rede-cor .otnivel, .rede-cor .otlinha, .rede-cor .otcel b, .rede-cor .otcel span,
.rede-cor .otlider b, .rede-cor .otlider small, .rede-cor .lat-nome, .rede-cor .lat-sub { color: #fff; }
.rede-cor { text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.rede-cor .otselos span { background: rgba(255, 255, 255, .22); color: #fff; }
.rede-cor .otselos .otabre { background: rgba(0, 0, 0, .35); color: #fff; }
.rede-cor .otcel { border-bottom-color: rgba(255, 255, 255, .25); }
.rede-cor .otlider { border-top-color: rgba(255, 255, 255, .35); }
.rede-cor .lat-av { border-color: rgba(255, 255, 255, .55); }
.rede-cor .lat-badge { background: rgba(0, 0, 0, .45); }

/* Início: cabeçalho flutuante translúcido, com o feed rolando por baixo */
#view-inicio.view { max-width: none; padding: 0 0 calc(var(--tab) + 40px + env(safe-area-inset-bottom)); }
.home-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 12px;
  background: rgba(27, 31, 43, .6);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.home-hello { display: flex; align-items: center; gap: 8px; min-width: 0; }
.home-nome { display: flex; flex-direction: column; min-width: 0; }
.home-perfil {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.home-perfil svg { width: 20px; height: 20px; }
.home-hello span { font-size: 12px; color: var(--muted); }
.home-hello b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-hello small { font-size: 11px; color: #a5b4fc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-stats { display: flex; justify-content: center; gap: 12px; text-align: center; }
.home-stats b { display: block; font-size: 16px; }
.home-stats span { font-size: 10px; color: var(--muted); }
.home-badges { display: flex; gap: 6px; }
.home-badge {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
}
.home-badge.on { color: #fff; background: var(--g); border-color: transparent; }
.hb-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hb-n {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 99px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  place-items: center;
}
.home-badge.on .hb-n { display: grid; }
#view-dashboard.view { padding-top: calc(118px + env(safe-area-inset-top)); }
.home-feed { padding: calc(16px + env(safe-area-inset-top)) 14px 0; }

/* Faixa de avatares (stories) do Início: rola na horizontal e sobe com a página. */
.stories {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin: 0 -2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.stories::-webkit-scrollbar { display: none; }
/* Linha da faixa: avatares com rolagem e, à direita, o botão "..." do filtro por rede (fora da rolagem). */
/* O botão flutua sobre a faixa: os avatares passam por baixo dele e o vidro desfoca o que está atrás. */
.stories-linha { position: relative; }
.stories-linha .stories { padding-right: 56px; }
/* Vidro embaixo do botão: faixa desfocada atrás dele, que some suavemente para a esquerda. */
.stories-linha::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 56px;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(90deg, rgba(15, 18, 26, 0), rgba(15, 18, 26, .25) 40%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%);
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}
/* Com filtro de rede: a área atrás do botão ganha o degradê da rede, transparente e desfocado. */
.stories-linha.com-rede::after {
  background: var(--rede-grad);
  opacity: .6;
}
.rede-filtro {
  position: absolute;
  right: 0;
  top: 20px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  /* Sem casco: só os três pontos. A cor fica na área atrás do botão, não no círculo. */
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0 0 4px;
  cursor: pointer;
}
.rede-filtro.on { color: #fff; }
/* Carregando o feed: três pontinhos que sobem e descem de leve (CSS puro, sem peso). */
.carregando-pontos { display: inline-flex; gap: 4px; align-items: center; margin-right: 8px; vertical-align: middle; }
.carregando-pontos i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .3; animation: pontos-carregando 1s ease-in-out infinite; }
.carregando-pontos i:nth-child(2) { animation-delay: .15s; }
.carregando-pontos i:nth-child(3) { animation-delay: .3s; }
@keyframes pontos-carregando {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .carregando-pontos i { animation: none; opacity: .7; }
}
/* Folha de redes: cada opção com a cor da rede; a ativa destacada. */
.rede-opcao { display: flex; align-items: center; gap: 12px; }
.rede-opcao.on { border-color: #a5b4fc; }
.rede-opcao.on b::after { content: ' ✓'; color: #a5b4fc; }
.rede-opcao-cor { flex: none; width: 26px; height: 26px; border-radius: 50%; }
.rede-opcao-ajuda { font-size: 13px; margin: 12px 4px 0; }
.story {
  flex: none;
  width: 72px;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: 0;
  color: #e8eaf2;
  cursor: pointer;
}
.story-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  padding: 3px;
  display: grid;
  place-items: center;
  background: linear-gradient(45deg, #f9a13b, #e1306c, #c13584);
}
.story.on .story-ring { background: linear-gradient(45deg, #fff, #a5b4fc); }
.story .story-av {
  width: 64px;
  height: 64px;
  border: 3px solid #0b0d14;
  border-radius: 50%;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
}
.story .story-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-wrap, .story-fixo { position: relative; flex: none; width: 72px; display: grid; justify-items: center; }
.story-fixo .story-ring { cursor: default; }
/* Selo de publicar sobre o avatar do usuário logado (como no Instagram). */
.story-mais {
  position: absolute;
  top: 44px;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #0b0d14;
  background: #f5f5f7;
  color: #0b0d14;
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-sizing: border-box;
}
.story-nome {
  max-width: 72px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Folha de lista (células que precisam de atenção) */
.sheet-bg {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, .5);
}
.sheet {
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--card);
  border-radius: 20px 20px 0 0;
}
.sheet h3 { margin: 0 0 10px; font-size: 16px; }
.sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sheet-item { display: grid; gap: 2px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.sheet-item b { font-size: 14px; }
.sheet-item span { font-size: 13px; color: var(--muted); }
.sheet-item small { font-size: 12px; color: #fca5a5; }
.sheet-item.nao-lida { border-color: #764ba2; box-shadow: inset 3px 0 0 #764ba2; }

/* Agendamentos: formulário dentro da folha */
.ag-novo { width: 100%; margin-bottom: 12px; }
.ag-form { display: grid; gap: 12px; }
.ag-form [hidden] { display: none !important; }
.ag-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.ag-form select,
.ag-form input[type="date"],
.ag-form input[type="time"],
.ag-form textarea {
  font: inherit;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ag-tipos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.ag-tipos button { font: inherit; font-size: 14px; padding: 8px; color: var(--muted); background: none; border: 0; border-radius: 9px; cursor: pointer; }
.ag-tipos button.on { color: var(--ink); background: var(--card); font-weight: 700; }
.ag-linha { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.ag-foto { display: grid; gap: 8px; }
.ag-foto-rotulo { font-size: 13px; color: var(--muted); }
.ag-foto-previa { all: unset; box-sizing: border-box; display: grid; justify-items: center; align-content: center; gap: 8px; width: 100%; min-height: 120px; padding: 8px; overflow: hidden; background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; cursor: pointer; }
.ag-foto-previa:focus-visible { outline: 2px solid #667eea; outline-offset: 2px; }
.ag-foto-previa svg { width: 40px; height: 40px; color: var(--muted); }
.ag-foto-previa img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; }
.ag-foto-previa span { font-size: 14px; color: var(--muted); }
.ag-foto-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-foto-botao { font: inherit; font-size: 14px; font-weight: 700; padding: 9px 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.ag-foto-postar { color: #fff; background: #667eea; border-color: transparent; }
.ag-foto-botao[hidden] { display: none; }
.ag-modalidade { display: flex !important; align-items: center; gap: 8px; padding-bottom: 6px; color: var(--ink) !important; font-size: 14px !important; }
.ag-chamada { justify-self: start; margin-top: 6px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 700; color: #fff; background: #34c759; border: 0; border-radius: 999px; cursor: pointer; }

/* Chamada online em tela cheia (Jitsi embutido) */
.chamada-bg { position: fixed; inset: 0; z-index: 90; background: #000; }
.chamada { display: flex; flex-direction: column; width: 100%; height: 100%; }
.chamada-topo { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; color: #fff; font-size: 14px; background: #111; }
.chamada-fechar { font: inherit; font-weight: 700; color: #5b8cff; background: none; border: 0; cursor: pointer; }
.chamada iframe { flex: 1; width: 100%; border: 0; }

/* Feed de avisos (estilo post) */
/* Botão + para publicar: translúcido, no canto superior direito, abaixo da barra */
.publicar-fab {
  position: fixed;
  top: calc(75px + env(safe-area-inset-top));
  right: 14px;
  z-index: 16;
  width: 38px;
  height: 38px;
  padding: 0 0 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(27, 31, 43, .6);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  color: #c4b5fd;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}
.publicar-fab:active { transform: scale(.96); }
.publicar-fab::after {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 9px;
  border-radius: 8px;
  background: #1b1f2b;
  border: 1px solid #2d3345;
  color: #f3f4f8;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.publicar-fab:hover::after,
.publicar-fab:focus-visible::after { opacity: 1; }
.feed-lista { display: grid; gap: 14px; padding-bottom: 12px; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.post-cabeca { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.post-cabeca .avatar { width: 36px; height: 36px; font-size: 13px; }
.post-autor { display: flex; flex-direction: column; min-width: 0; }
.post-autor b { font-size: 16px; }
.post-autor small { font-size: 13px; color: var(--muted); }
.post-titulo { margin: 0 14px 6px; font-size: 18px; }
.post-foto { display: block; width: 100%; max-height: 420px; object-fit: cover; background: #232838; }
.post-texto { margin: 10px 14px 4px; font-size: 17px; line-height: 1.4; white-space: pre-line; }
.post-acoes { display: flex; gap: 6px; padding: 6px 10px 12px; }
.post-acoes .acao { background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 99px; font-size: 26px; line-height: 1; display: inline-flex; align-items: center; gap: 6px; }
.post-acoes .acao span { font-size: 26px; }
.post-acoes .acao.on { color: #f43f5e; }
.texto-mais { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
.post-acoes .acao:active { background: rgba(255, 255, 255, .06); }

/* Comentários no estilo do Instagram */
.ig-bg { align-items: flex-end; }
.ig-sheet {
  width: 100%;
  height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.ig-grab { width: 40px; height: 4px; margin: 8px auto 0; border-radius: 99px; background: var(--line); }
.ig-head { padding: 10px 16px 12px; text-align: center; border-bottom: 1px solid var(--line); font-size: 15px; }
.ig-lista { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 8px 14px; display: grid; gap: 14px; align-content: start; }
.ig-item { display: flex; gap: 12px; align-items: flex-start; }
.avatar.com-foto { padding: 0; overflow: hidden; background: none; }
.avatar.com-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-item .avatar { width: 34px; height: 34px; font-size: 12px; flex: none; }
.ig-corpo { min-width: 0; }
.ig-corpo p { margin: 0; font-size: 14px; line-height: 1.35; }
.ig-corpo small { font-size: 12px; color: var(--muted); }
.ig-vazio { text-align: center; color: var(--muted); font-size: 14px; padding: 28px 0; list-style: none; }
.ig-emojis { display: flex; justify-content: space-around; padding: 10px 8px; border-top: 1px solid var(--line); }
.ig-emojis button { background: none; border: 0; font-size: 22px; padding: 2px 4px; cursor: pointer; }
.ig-form { display: flex; align-items: center; gap: 10px; padding: 10px 14px 14px; }
.ig-form .avatar { width: 32px; height: 32px; font-size: 12px; flex: none; }
.ig-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg);
  color: var(--ink);
}
.ig-form button { background: none; border: 0; color: #5b5fc7; font-weight: 600; font-size: 14px; padding: 6px 2px; cursor: pointer; }
.ig-form button:disabled { opacity: .5; }

/* Busca do organograma: campo com botão ✕ no canto direito, centralizado na vertical */
.orgbusca-wrap { position: relative; display: flex; align-items: center; }
.orgbusca-wrap .orgbusca { width: 260px; padding-right: 36px; }
.orgbusca-x {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 700px) {
  #view-org .orgbusca-wrap { order: 10; flex: 1 1 100%; width: 100%; }
  #view-org .orgbusca-wrap .orgbusca { width: 100%; }
}

/* Botões de zoom: sinal centralizado dentro do botão */
#view-org .orgzoom button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-size: 18px;
  font-weight: 600;
}

/* Organograma no celular: barra de controles em linhas, sem rolagem lateral */
@media (max-width: 700px) {
  #view-org .orgbar {
    flex-wrap: wrap;
    overflow: visible;
    gap: 6px;
    padding: 8px;
    justify-content: center;
  }
  #view-org .orgabas, #view-org .orgestilo { flex: none; }
  #view-org .orgabas button, #view-org .orgestilo button { padding: 6px 10px; font-size: 12px; }
  #view-org .orgbusca { order: 10; flex: 1 1 100%; width: auto; font-size: 16px; }
  #view-org .orgrede { flex: 1 1 auto; min-width: 0; max-width: 46vw; font-size: 16px; padding: 6px 8px; }
  #view-org .orgbtn { padding: 6px 8px; font-size: 11px; }
  #view-org .orgzoom { gap: 4px; }
  #view-org .orgzoom button { width: 26px; height: 26px; }
  #view-org .orgcnt { display: none; }
  #view-org .orgbar { top: env(safe-area-inset-top); }
  #view-org .orgcanvas { padding-top: calc(176px + env(safe-area-inset-top)); }
}

/* Novo post (duas etapas, no estilo do Instagram) */
.novo-post {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: #0f121a;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.novo-post-topo {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.novo-post-topo b { text-align: center; font-size: 16px; }
.np-voltar { justify-self: start; background: none; border: 0; color: var(--ink); font-size: 20px; padding: 4px 6px; cursor: pointer; }
.np-acao { justify-self: end; background: none; border: 0; color: #5b8cff; font-weight: 700; font-size: 16px; padding: 4px 6px; cursor: pointer; }
.np-acao:disabled { opacity: .35; cursor: default; }
.np-corpo { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; }
.np-previa {
  width: min(86vw, 360px);
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--card);
}
.np-previa img { width: 100%; height: 100%; object-fit: contain; }
.np-escolher { display: grid; justify-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-size: 15px; }
.np-icone { font-size: 40px; }
.np-sem-foto { background: none; border: 0; color: #5b8cff; font-size: 14px; cursor: pointer; }
.np-texto { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 14px; overflow-y: auto; }
.np-linha { display: flex; gap: 12px; align-items: flex-start; }
.np-miniatura { width: 64px; height: 80px; object-fit: cover; border-radius: 8px; flex: none; }
.np-texto textarea {
  flex: 1;
  min-height: 46vh;
  font: inherit;
  font-size: 16px;
  padding: 10px 2px;
  border: 0;
  background: none;
  color: var(--ink);
  resize: none;
  outline: none;
}
.np-texto input[name="titulo"] {
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}

/* Post alerta: banner 9:3 no topo, com borda avermelhada e pulsar suave */
@keyframes alerta-pulso {
  0%, 100% { box-shadow: 0 0 6px 0 rgba(239, 68, 68, .45); }
  50% { box-shadow: 0 0 16px 3px rgba(239, 68, 68, .85); }
}
.alerta-banner {
  display: grid;
  grid-template-columns: 34% 1fr;
  aspect-ratio: 9 / 3;
  margin-bottom: 14px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(239, 68, 68, .7);
  animation: alerta-pulso 2.4s ease-in-out infinite;
  cursor: pointer;
}
.alerta-foto { background: #232838; display: grid; place-items: center; font-size: 28px; }
.alerta-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.alerta-texto { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 14px; min-width: 0; }
.alerta-texto b {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.alerta-texto small { font-size: 13px; color: var(--muted); }

/* Barra do organograma no celular: três linhas fixas
   1) Líderes/Células, Central/Lateral e Todas as redes;  2) Expandir, Recolher e zoom;  3) busca */
@media (max-width: 700px) {
  #view-org .orgbar {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    padding: 8px;
  }
  #view-org .orgabas { grid-column: 1; grid-row: 1; }
  #view-org .orgestilo { grid-column: 2; grid-row: 1; }
  #view-org .orgrede { grid-column: 3; grid-row: 1; width: 100%; max-width: none; min-width: 0; font-size: 16px; text-overflow: ellipsis; }
  #view-org .orgbtn[data-acao='expandir'] { grid-column: 1; grid-row: 2; justify-self: start; }
  #view-org .orgbtn[data-acao='recolher'] { grid-column: 2; grid-row: 2; justify-self: start; }
  #view-org .orgzoom { grid-column: 3; grid-row: 2; justify-self: end; }
  #view-org .orgbusca-wrap { grid-column: 1 / -1; grid-row: 3; width: 100%; order: 0; flex: none; }
  #view-org .orgbusca-wrap .orgbusca { width: 100%; }
  #view-org .orgabas button, #view-org .orgestilo button { padding: 6px 8px; font-size: 12px; }
  #view-org .orgbtn { padding: 6px 8px; font-size: 12px; }
}

/* Badges de descendência dos líderes (pessoa, pessoas, rede) */
.lb {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.lb svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lat-badges {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  white-space: nowrap;
}
.lat-badges .lb { font-size: 11px; }
.lat-card:has(.lat-badges) { padding-bottom: 26px; }

/* Menu ⋯ sobre o banner do alerta */
.alerta-banner { position: relative; }
.alerta-menu { position: absolute; top: 4px; right: 6px; z-index: 2; background: rgba(0, 0, 0, .35); border-radius: 99px; padding: 2px 9px; color: #fff; }

/* Público do alerta: lista de níveis */
.np-publico { display: grid; gap: 10px; width: 100%; }
.np-niveis { display: grid; gap: 8px; }
.np-nivel { font-size: 14px; }

/* Menu aberto por cima do post em tela cheia */
.sheet-bg.acima { z-index: 80; }

/* Post em tela cheia */
.post-cheio {
  position: fixed;
  inset: 0;
  z-index: 75;
  overflow-y: auto;
  background: #0f121a;
  padding-bottom: env(safe-area-inset-bottom);
}
.post-cheio-topo {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: #0f121a;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.post-cheio-topo b { text-align: center; font-size: 16px; }
.post-cheio-corpo { padding: 14px; display: grid; gap: 12px; }
.post-cheio-foto { width: 100%; border-radius: 12px; }
.post-cheio-corpo h3 { margin: 0; font-size: 18px; }
.post-cheio-corpo p { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-line; }
.post-cheio-corpo small { color: var(--muted); font-size: 12px; }

/* Campos do post alerta na publicação */
.np-alerta-linha, .np-validade {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 15px;
}
/* Interruptor no padrão iOS (verde quando ligado) */
.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-trilho {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #39393d;
  transition: background .2s;
  pointer-events: none;
}
.switch-trilho::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
  transition: transform .2s;
}
.switch input:checked + .switch-trilho { background: #34c759; }
.switch input:checked + .switch-trilho::after { transform: translateX(20px); }
.np-validade input { font: inherit; font-size: 16px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }

/* Zoom da foto do aviso (tela cheia) */
.zoom-bg {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .94);
  overflow: hidden;
  touch-action: none;
}
.zoom-img {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}
.zoom-fechar {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.post-foto { cursor: zoom-in; }

.feed-sentinela { padding: 18px 0 8px; text-align: center; color: var(--muted); font-size: 13px; min-height: 40px; }

.post-menu { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 8px; cursor: pointer; }
.sheet-opcao { width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.sheet-opcao.perigo { color: #f87171; }

/* Aviso fixado no topo */
.post.fixado { border-color: #764ba2; box-shadow: 0 0 0 1px rgba(118, 75, 162, .35); }
.fixado-tag { padding: 6px 14px; font-size: 12px; font-weight: 600; color: #c4b5fd; background: rgba(118, 75, 162, .18); }
.post-acoes .acao.fixar { margin-left: auto; font-size: 12px; color: #a5b4fc; }

/* Formulários nas folhas */
.publicar-form, .comentario-form { display: grid; gap: 10px; margin-top: 10px; }
.publicar-form input, .publicar-form textarea, .comentario-form input {
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
}
.publicar-form textarea { resize: vertical; }
.comentario-form { grid-template-columns: 1fr auto; align-items: center; }
.foto-campo { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.sheet-item.nao-lida .post-autor { font-weight: 600; }

@media all {
  :root {
    --ink: #f3f4f8;
    --muted: #a0a6b8;
    --card: #1b1f2b;
    --line: #2d3345;
    --bg: #0f121a;
  }
  .tabbar { background: rgba(27, 31, 43, .75); border-color: rgba(255, 255, 255, .08); }
  .login-card { background: var(--card); }
  input { background: #0f121a; }
}

/* Agendamentos: busca de líder/célula, em tela cheia */
.ag-form { flex: 1; overflow-y: auto; padding: 14px; }
.ag-campo { display: grid; gap: 8px; }
.ag-rotulo { font-size: 13px; color: var(--muted); }
.ag-busca {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 16px;
  padding: 10px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ag-dica { margin: 0; font-size: 12px; color: var(--muted); }
.ag-resultados { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ag-opcao {
  width: 100%;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.ag-opcao small { font-size: 12px; color: var(--muted); }
.ag-vazio { font-size: 13px; color: var(--muted); padding: 6px 2px; }
.ag-escolhido {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid #34c759;
  border-radius: 10px;
}
.ag-escolhido[hidden] { display: none; }
/* Botão de data da supervisão: mesmo visual do campo de data nativo. */
.ag-data-botao { font: inherit; font-size: 16px; width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; text-align: center; cursor: pointer; }
.ag-data-botao[hidden], .ag-data-nativa[hidden] { display: none; }
.ag-trocar { font: inherit; font-size: 13px; color: #5b8cff; background: none; border: 0; cursor: pointer; }
.ag-form textarea {
  flex: none;
  min-height: 90px;
  padding: 10px;
  font: inherit;
  font-size: 16px;
  box-sizing: border-box;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* ToolBox */
.tb-grupo { margin: 8px 2px 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tb-lista { display: grid; gap: 8px; }
.tb-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.tb-item b { font-size: 15px; }
.tb-item span { font-size: 13px; color: var(--muted); }
.tb-breve { opacity: .5; cursor: default; }
.tb-busca {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 16px;
  padding: 10px;
  margin-bottom: 6px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* Tela cheia para folhas e opções (todas as telas de agendamento e de menus) */
.sheet-bg.tela-cheia {
  z-index: 70;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  background: #0f121a;
}
.sheet-bg.tela-cheia .sheet {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: none;
  padding: 0;
  border-radius: 0;
  background: #0f121a;
  overflow: hidden;
}
.sheet-bg.tela-cheia .novo-post-topo { min-height: 52px; background: #0f121a; }
.sheet-bg.tela-cheia .sheet-corpo {
  flex: 1;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
}
.sheet-bg.tela-cheia .sheet-corpo .sheet-list { gap: 10px; }

/* Avatares e pessoas nas listas de agendamento */
.ag-av { width: 32px; height: 32px; flex: none; font-size: 12px; }
.ag-av-sm { width: 22px; height: 22px; font-size: 9px; }
.ag-pessoa { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.ag-pessoa span { font-size: 14px; color: var(--ink); }
.ag-lider small { font-size: 12px; color: var(--muted); }
.ag-opcao { display: flex; align-items: center; gap: 10px; }
.ag-opcao-texto { display: grid; gap: 2px; min-width: 0; }
.ag-escolhido .ag-pessoa span { font-size: 15px; }

/* Menu e resumo do agendamento */
.ag-menu { justify-self: end; font-size: 22px; line-height: 1; padding: 0 6px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.ag-resumo { display: grid; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ag-resumo b { font-size: 15px; }
.ag-resumo span { font-size: 13px; color: var(--muted); }

/* Menu suspenso dos botões "⋯" (abre ao lado do botão, como o botão direito do mouse) */
.menu-suspenso-fundo { position: fixed; inset: 0; z-index: 99; background: transparent; }
.menu-suspenso {
  position: fixed;
  z-index: 100;
  min-width: 170px;
  padding: 6px;
  display: grid;
  gap: 2px;
  /* Vidro: translúcido e desfocado, igual ao botão flutuante de filtro. */
  background: rgba(27, 31, 43, .35);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font: inherit;
  font-size: 15px;
  text-align: left;
  padding: 10px 12px;
  color: #fff;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.menu-item-icone { flex: none; display: grid; place-items: center; width: 18px; height: 18px; color: currentColor; }
.menu-item-icone svg { width: 18px; height: 18px; }
.menu-item-icone .rede-opcao-cor { width: 18px; height: 18px; }

/* Esqueleto do feed: blocos cinza com brilho enquanto a abertura carrega. */
.aviso-esqueleto { display: grid; gap: 10px; padding: 14px; margin: 0 0 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.aviso-esqueleto span { display: block; border-radius: 8px; background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(255, 255, 255, .12) 50%, rgba(255, 255, 255, .04) 75%); background-size: 200% 100%; animation: esq-brilho 1.4s infinite; }
.aviso-esqueleto .esq-avatar { width: 40px; height: 40px; border-radius: 50%; }
.aviso-esqueleto .esq-linha { height: 12px; width: 70%; }
.aviso-esqueleto .esq-linha.curta { width: 40%; }
.aviso-esqueleto .esq-foto { height: 180px; }
@keyframes esq-brilho { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .aviso-esqueleto span { animation: none; } }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 255, 255, .08); outline: none; }
.menu-item.perigo { color: #fff; }

/* Ciente nos alertas */
.alerta-ciente { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.alerta-ciente .primary[disabled] { opacity: .6; }
.alerta-ciente .link { font: inherit; font-size: 14px; color: #5b8cff; background: none; border: 0; padding: 0; cursor: pointer; }

/* Comentários: a rolagem não passa para o feed por baixo */
.ig-lista, .ig-sheet { overscroll-behavior: contain; }

/* Chat da rede de cuidado: tema escuro só nesta aba */
.view-chat { max-width: 640px; padding: 0; }
.view-chat #chat-host {
  min-height: 100vh;
  background: #0b0d14;
  color: #e8eaf2;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(var(--tab) + 110px + env(safe-area-inset-bottom));
}
.chat-tela { display: grid; gap: 12px; }
.chat-tela[hidden] { display: none; }
.chat-topo { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-height: 44px; }
.chat-topo h2 { margin: 0; font-size: 20px; color: #f3f4f8; }
.chat-btn { background: #1e2435; color: #c7cdfa; border: 1px solid #2d3345; border-radius: 99px; padding: 8px 14px; font-size: 13px; }
.chat-itens { display: grid; gap: 6px; }
.chat-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #141824; border: 1px solid #1f2535; border-radius: 16px; padding: 12px; color: inherit; }
.chat-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #a855f7); display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.chat-item-corpo { display: grid; gap: 2px; min-width: 0; flex: 1; }
.chat-item-corpo strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-corpo small { color: #8b93a8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-meta { display: grid; justify-items: end; gap: 4px; font-size: 11px; color: #8b93a8; }
.chat-badge { background: #6366f1; color: #fff; border-radius: 99px; min-width: 20px; padding: 1px 6px; font-size: 11px; text-align: center; }
.chat-vazio { color: #8b93a8; text-align: center; padding: 32px 0; font-size: 14px; }
.chat-msgs { display: flex; flex-direction: column; gap: 8px; height: calc(100vh - 260px); min-height: 240px; overflow-y: auto; padding: 4px 2px; }
.chat-bolha { max-width: 78%; background: #1c2131; border-radius: 16px 16px 16px 4px; padding: 8px 12px; align-self: flex-start; }
.chat-bolha.is-eu { align-self: flex-end; background: #4f46e5; border-radius: 16px 16px 4px 16px; }
.chat-bolha p { margin: 0; font-size: 15px; line-height: 1.35; word-break: break-word; }
.chat-bolha time { display: block; font-size: 10px; color: #9aa3b8; text-align: right; margin-top: 2px; }
.chat-bolha a { color: #a5b4fc; }
.chat-autor { display: block; font-size: 12px; font-weight: 700; color: #a5b4fc; margin-bottom: 2px; }
.chat-compor { display: flex; align-items: center; gap: 8px; }
.chat-compor input { flex: 1; min-width: 0; background: #141824; border: 1px solid #2d3345; border-radius: 99px; color: #e8eaf2; padding: 10px 14px; font-size: 16px; }
.chat-compor input:disabled { opacity: .5; }
.chat-emoji-btn, .chat-enviar { display: grid; place-items: center; box-sizing: border-box; width: 44px; height: 44px; margin: 0; padding: 0; border-radius: 50%; border: 0; background: #1e2435; color: #e8eaf2; font-size: 18px; flex: none; }
.chat-enviar { background: #6366f1; color: #fff; }
.chat-emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; background: #141824; border-radius: 10px; padding: 8px; }
.chat-emojis button { background: none; border: 0; font-size: 22px; padding: 4px; }
.chat-linha { display: flex; align-items: flex-end; gap: 8px; }
.chat-linha.is-eu { justify-content: flex-end; }
.chat-linha .chat-bolha { max-width: 78%; }
.chat-av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; overflow: hidden; }
.chat-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-dica { margin: 0; font-size: 13px; color: #8b93a8; }
.chat-form { display: grid; gap: 12px; }
.chat-form input[type="text"] { background: #141824; border: 1px solid #2d3345; border-radius: 14px; color: #e8eaf2; padding: 12px 14px; font-size: 16px; }
.chat-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: #6366f1; flex: none; }
.chat-item:has(input:checked) { border-color: #6366f1; }
.chat-btn--primario { background: #6366f1; color: #fff; border: 0; padding: 12px; border-radius: 14px; font-weight: 600; font-size: 15px; }
.chat-topo .chat-btn { margin-left: auto; }
.chat-item[hidden] { display: none; }
.chat-busca { background: #141824; border: 1px solid #2d3345; border-radius: 14px; color: #e8eaf2; padding: 10px 14px; font-size: 16px; width: 100%; box-sizing: border-box; }
/* Interruptor liga/desliga (estilo iOS, verde ao ligar) */
.chat-switch { position: relative; width: 51px; height: 31px; flex: none; display: inline-block; }
.chat-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.chat-switch-track { position: absolute; inset: 0; border-radius: 99px; background: #39393d; transition: background .2s; }
.chat-switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); transition: transform .2s; }
.chat-switch input:checked + .chat-switch-track { background: #34c759; }
.chat-switch input:checked + .chat-switch-track::after { transform: translateX(20px); }
.chat-switch input:focus-visible + .chat-switch-track { outline: 2px solid #a5b4fc; outline-offset: 2px; }
.chat-item:has(input:checked) { border-color: #1f2535; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.chat-foto-escolher { display: block; background: #141824; border: 1px dashed #3a4160; border-radius: 14px; padding: 12px 14px; color: #a5b4fc; font-size: 14px; text-align: center; cursor: pointer; }
/* Foto do grupo: botão redondo ao lado do nome */
.chat-nome-linha { display: flex; align-items: center; gap: 12px; }
.chat-nome-linha input[type="text"] { flex: 1; min-width: 0; }
.chat-foto-btn { width: 64px; height: 64px; border-radius: 50%; border: 1px dashed #3a4160; background: #141824; color: #a5b4fc; display: grid; place-items: center; padding: 0; overflow: hidden; flex: none; cursor: pointer; }
.chat-foto-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-foto-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Tela de ajuste da foto */
.chat-recorte { position: fixed; inset: 0; background: rgba(0, 0, 0, .8); display: grid; place-items: center; z-index: 60; padding: 16px; }
.chat-recorte[hidden] { display: none; }
.chat-recorte-caixa { background: #141824; border-radius: 20px; padding: 16px; width: min(360px, 100%); display: grid; gap: 12px; box-sizing: border-box; }
.chat-recorte-titulo { margin: 0; font-weight: 700; color: #f3f4f8; }
.chat-recorte-palco { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 50%; background: #000; touch-action: none; cursor: grab; }
.chat-recorte-palco img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.chat-recorte input[type="range"] { width: 100%; accent-color: #6366f1; }
.chat-recorte-acoes { display: flex; gap: 8px; justify-content: flex-end; }
/* Busca de líderes com botão para limpar */
.chat-busca-caixa { position: relative; }
.chat-busca-caixa .chat-busca { padding-right: 44px; }
.chat-busca-limpar { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; background: #2d3345; color: #e8eaf2; font-size: 13px; line-height: 1; display: grid; place-items: center; cursor: pointer; padding: 0; }
.chat-busca-limpar[hidden] { display: none; }
/* Contatos da conversa direta: três grupos separados por uma linha */
.chat-secao { display: grid; gap: 8px; }
.chat-secao + .chat-secao { border-top: 1px solid #1f2535; padding-top: 14px; margin-top: 6px; }
.chat-secao[hidden] { display: none; }
.chat-secao-titulo { margin: 0; font-size: 12px; font-weight: 700; color: #a5b4fc; text-transform: uppercase; letter-spacing: .05em; }
/* Botões redondos do topo de Mensagens */
.chat-acoes { display: flex; gap: 10px; align-items: center; }
.chat-redondo { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #1e2435; color: #c7cdfa; display: grid; place-items: center; padding: 0; cursor: pointer; font-size: 26px; line-height: 1; flex: none; }
.chat-redondo svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-redondo--laranja { background: #f97316; color: #fff; font-weight: 500; }
.chat-busca-caixa[hidden] { display: none; }
/* Mesmo tamanho para os dois botões redondos; o "+" é um ícone, centralizado */
.chat-redondo { box-sizing: border-box; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; margin: 0; flex: 0 0 44px; }
.chat-redondo--laranja { font-size: 0; }
.chat-redondo--laranja svg { width: 20px; height: 20px; stroke-width: 2.4; }
/* Cabeçalho da conversa: avatar da pessoa (ou do grupo) ao lado do nome */
.chat-cab-av { flex: none; display: inline-block; }
.chat-cab-av .chat-avatar { width: 34px; height: 34px; font-size: 13px; }
.chat-topo h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
/* Botão redondo da foto no cabeçalho da conversa */
.chat-redondo { position: relative; overflow: hidden; }
.chat-redondo [hidden] { display: none !important; }
.chat-foto-redonda img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* Ciente: títulos das duas listas */
.ciente-titulo { margin: 4px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted, #8b93a8); text-transform: uppercase; letter-spacing: .04em; }
.ciente-separador { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line, #2d3345); }
/* Ciente dentro do alerta: duas listas logo abaixo do botão */
.alerta-ciente { flex-wrap: wrap; }
.ciente-listas { width: 100%; margin-top: 12px; }
.ciente-listas .sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ciente-listas .sheet-item { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line, #2d3345); border-radius: 14px; background: var(--card, #1b1f2b); }
.ciente-listas .sheet-item small { color: var(--muted, #8b93a8); font-size: 12px; }
.ciente-listas .ag-pessoa { display: flex; align-items: center; gap: 10px; }
.ciente-listas .ciente-titulo { margin: 14px 0 8px; }
.ciente-listas .ciente-titulo:first-child { margin-top: 4px; }

/* Organograma: botões de agenda e badges; WhatsApp no topo direito dos cartões de líder */
.otcard, .lat-card { position: relative; }
.otacoes { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 2; }
.otacoes .wa { position: static; }
.otcel { position: relative; padding-right: 46px; }
.otcel .agbtn { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); }
.lat-acoes { position: absolute; top: 6px; right: 6px; display: flex; gap: 6px; align-items: center; z-index: 2; }
.lat-acoes .lat-wa { position: static; }
.agbtn {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  cursor: pointer;
}
.agbtn svg { width: 18px; height: 18px; }
.agbadge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border-radius: 9px;
}

/* Organograma: WhatsApp no canto superior direito e agenda no canto inferior direito */
.lat-card { padding-right: 56px; min-height: 64px; }
.lat-acoes { top: 6px; bottom: 6px; right: 6px; flex-direction: column; justify-content: space-between; align-items: center; }
.lat-acoes .lat-ag:only-child { margin-top: auto; }
.lat-acoes .lat-ag { width: 28px; height: 28px; }
.otacoes { top: 8px; bottom: 8px; justify-content: space-between; }
.otacoes .agbtn:only-child { margin-top: auto; }

/* Organograma (ajuste final): posição fixa de cada botão, sem depender do fluxo */
.lat-acoes { top: 0; bottom: 0; right: 0; width: 52px; display: block; }
.lat-acoes .lat-wa { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; }
.lat-acoes .lat-ag { position: absolute; bottom: 8px; right: 8px; width: 28px; height: 28px; margin: 0; }
.otacoes { top: 0; bottom: 0; right: 0; display: block; }
.otacoes .wa { position: absolute; top: 8px; right: 8px; }
.otacoes .agbtn { position: absolute; bottom: 8px; right: 8px; margin: 0; }

/* Organograma: sobrescreve as posições antigas do WhatsApp (mais específico) */
.lat-card .lat-acoes .wa.lat-wa { position: absolute; top: 8px; right: 8px; bottom: auto; left: auto; transform: none; width: 30px; height: 30px; }
#view-org .otacoes .wa.otwa { position: absolute; top: 8px; right: 8px; bottom: auto; left: auto; width: 30px; height: 30px; }
#view-org .otacoes .agbtn { position: absolute; bottom: 8px; right: 8px; top: auto; left: auto; }

/* Organograma (posição aprovada): botões saindo pela borda direita do cartão, WhatsApp em cima e agenda embaixo */
.lat-card .lat-acoes .wa.lat-wa { top: 4px; right: -18px; width: 36px; height: 36px; }
.lat-card .lat-acoes .lat-ag { top: auto; bottom: 4px; right: -18px; width: 36px; height: 36px; }
#view-org .otacoes .wa.otwa { top: -16px; right: -16px; width: 36px; height: 36px; }
#view-org .otacoes .agbtn { bottom: -16px; right: -16px; width: 36px; height: 36px; }

/* Organograma (ajuste de tamanho e fundo): botões menores sem sobrepor; agenda com fundo opaco e mais desfoque */
.lat-card { min-height: 84px; }
.lat-card .lat-acoes .wa.lat-wa { top: 6px; right: -16px; width: 32px; height: 32px; }
.lat-card .lat-acoes .lat-ag { top: auto; bottom: 6px; right: -16px; width: 32px; height: 32px; background: rgba(15, 18, 26, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: rgba(255, 255, 255, .3); }
#view-org .otacoes .wa.otwa { top: -14px; right: -14px; width: 32px; height: 32px; }
#view-org .otacoes .agbtn { bottom: -14px; right: -14px; width: 32px; height: 32px; background: rgba(15, 18, 26, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: rgba(255, 255, 255, .3); }

/* Organograma: botão de conversa interna (substitui o WhatsApp) */
.chatbtn { border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; }
.chatbtn svg { width: 16px; height: 16px; }

/* Botões redondos do cabeçalho das telas (+ e lupa) */
.np-acoes { display: flex; gap: 8px; justify-self: end; align-items: center; }
.btn-redondo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.btn-redondo svg { width: 20px; height: 20px; }
.btn-redondo.primary { color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); border-color: transparent; }

/* Botões redondos do cabeçalho: alinhados e centralizados, sem herdar o estilo da faixa larga (.primary) */
.novo-post-topo .np-acoes .btn-redondo {
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  align-self: center;
  box-shadow: none;
  transform: none;
  border-radius: 50%;
}
.novo-post-topo .np-acoes .btn-redondo svg { width: 20px; height: 20px; display: block; }
.novo-post-topo .np-acoes .btn-redondo.primary { color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); border: 0; }

/* ToolBox em abas */
.tb-abas { display: flex; gap: 6px; overflow-x: auto; padding: 0 2px 10px; scrollbar-width: none; }
.tb-abas::-webkit-scrollbar { display: none; }
.tb-aba { flex: none; font: inherit; font-size: 13px; padding: 8px 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.tb-aba.on { color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); border-color: transparent; }
.tb-corpo { display: grid; gap: 10px; }
.tb-segmento { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.tb-segmento button, .tb-status button { font: inherit; font-size: 14px; padding: 8px; color: var(--muted); background: none; border: 0; border-radius: 9px; cursor: pointer; }
.tb-segmento button.on, .tb-status button.on { color: var(--ink); background: var(--card); font-weight: 700; }
.tb-linha { display: flex; justify-content: flex-end; }
.tb-linha .np-acoes { display: flex; gap: 8px; justify-self: auto; }
.tb-status { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.tb-lista-itens { margin-top: 2px; }
.tb-corpo .tb-lista { display: grid; gap: 8px; }
.rot-corpo { display: grid; gap: 14px; }
.rot-semana { margin: 0; font-size: 13px; color: var(--muted); }
.rot-bloco h4 { margin: 0 0 4px; font-size: 14px; }
.rot-bloco p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink); }

/* Dashboard de células (aba do logo IBA Campos): carrossel de páginas com 1 ou 2 cards */
:root {
  --d1: #667eea;
  --d2: #764ba2;
  --d3: #22c1a0;
  --d4: #f6ad55;
  --d5: #f56565;
  --d6: #4fd1c5;
  --d7: #a0aec0;
  --d8: #cbd5e0;
}
.dash-defs { position: absolute; }
.dash-carrossel { display: grid; gap: 10px; }
.dash-trilho-pag {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.dash-trilho-pag::-webkit-scrollbar { display: none; }
.dash-pagina {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 2px 2px 96px;
  min-width: 0;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  min-width: 0;
  box-shadow: 0 6px 24px rgba(102, 126, 234, .08);
}
.dash-card h3 { margin: 0 0 8px; font-size: 15px; }
.dash-titulo-linha { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.dash-titulo-linha h3 { margin: 0; }
.dash-selo { padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg); border-radius: 999px; white-space: nowrap; }
.dash-barra-topo > span b { color: var(--d2); font-weight: 700; margin-right: 4px; }
.dash-nota { display: block; margin: -2px 0 10px; font-size: 12px; color: var(--muted); }
.dash-sub { margin: 12px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dash-vazio { margin: 0; font-size: 14px; color: var(--muted); }

/* Números de destaque, com contagem animada */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.dash-tile { display: grid; gap: 2px; padding: 12px 10px; background: var(--bg); border-radius: 14px; }
.dash-tile b { font-size: 22px; font-variant-numeric: tabular-nums; background: var(--g); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dash-tile span { font-size: 12px; color: var(--muted); }
.dash-tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-tiles-4 .dash-tile { padding: 12px 8px; }
.dash-tiles-4 .dash-tile b { font-size: 20px; }
.dash-tiles-4 .dash-tile span { font-size: 11px; }

/* Anéis e rosca */
.dash-rosca { position: relative; width: 170px; height: 170px; margin: 4px auto 8px; }
.dash-rosca svg { width: 100%; height: 100%; overflow: visible; }
.dash-centro { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dash-centro b { font-size: 24px; font-variant-numeric: tabular-nums; }
.dash-centro small { font-size: 12px; color: var(--muted); }

/* Legenda */
.dash-legenda { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.dash-legenda li { display: flex; align-items: center; gap: 6px; }
.dash-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; }
.dash-legenda b { color: var(--ink); font-weight: 600; }
.dash-legenda li > span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.dash-legenda-qtd { color: var(--muted); font-size: 11px; }
.dash-kids { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* Velocímetro */
.dash-velo { position: relative; width: 220px; margin: 4px auto 0; text-align: center; }
.dash-velo svg { width: 100%; display: block; }
.dash-velo b { display: block; margin-top: 4px; font-size: 26px; font-variant-numeric: tabular-nums; }
.dash-velo small { font-size: 12px; color: var(--muted); }

/* Radar e área */
.dash-radar { display: block; width: 100%; max-width: 280px; margin: 0 auto; }
.dash-radar text { font-size: 11px; fill: var(--muted); }
.dash-radar-area { filter: drop-shadow(0 4px 10px rgba(118, 75, 162, .35)); }
.dash-onda { display: block; width: 100%; height: 130px; }
.dash-eixo { display: grid; margin-top: 6px; font-size: 10px; color: var(--muted); text-align: center; }

/* Barras verticais */
.dash-colunas { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; align-items: end; margin-top: 8px; padding-top: 22px; }
.dash-coluna { display: grid; justify-items: center; gap: 6px; min-width: 0; }
.dash-coluna b { font-size: 13px; font-variant-numeric: tabular-nums; }
.dash-coluna small { font-size: 11px; color: var(--muted); text-align: center; }
.dash-tubo { display: flex; align-items: flex-end; width: 100%; height: 130px; }
.dash-tubo { position: relative; }
.dash-val { position: absolute; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1; }
.dash-tubo span {
  display: block;
  width: 100%;
  height: 0;
  border-radius: 12px 12px 6px 6px;
  background: var(--g);
  transition: height .9s cubic-bezier(.2, .8, .2, 1);
}
.dash-mini .dash-tubo { height: 70px; }
.dash-par { display: flex; gap: 3px; width: 100%; }
.dash-par .dash-tubo { flex: 1; min-width: 0; }
.dash-par-val { display: flex; gap: 3px; width: 100%; }
.dash-par-val b { flex: 1; min-width: 0; font-size: 9px; white-space: nowrap; overflow: visible; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.dash-duplas .dash-tubo { height: 110px; }

/* Barras deslizantes */
.dash-sliders { display: grid; gap: 14px; }
.dash-barra-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.dash-barra-topo b { font-size: 13px; color: var(--muted); font-weight: 500; text-align: right; }
.dash-trilho { height: 10px; margin-top: 6px; background: var(--bg); border-radius: 999px; }
.dash-trilho-grande { height: 14px; }
.dash-trilho span {
  position: relative;
  display: block;
  height: 100%;
  width: 0;
  background: var(--g);
  border-radius: 999px;
  transition: width .9s cubic-bezier(.2, .8, .2, 1);
}
.dash-trilho span i {
  position: absolute;
  right: -7px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(118, 75, 162, .35);
}

/* Pendências e níveis */
.dash-pend { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.dash-pend b { font-size: 34px; font-variant-numeric: tabular-nums; background: var(--g); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dash-pend span { font-size: 13px; color: var(--muted); }
.dash-nivel-resumo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dash-nivel-resumo > div { display: grid; gap: 2px; padding: 10px; background: var(--bg); border-radius: 14px; }
.dash-nivel-resumo b { font-size: 22px; font-variant-numeric: tabular-nums; }
.dash-nivel-resumo small { font-size: 12px; color: var(--muted); }
.dash-det summary { cursor: pointer; margin-top: 12px; font-size: 14px; font-weight: 600; }
.dash-lista { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.dash-lista li { display: grid; gap: 2px; padding: 10px 12px; font-size: 14px; background: var(--bg); border-radius: 12px; }
.dash-lista span, .dash-lista small { font-size: 12px; color: var(--muted); }

/* Controles do carrossel */
.dash-controles {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom) + var(--tab) + 12px);
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(15, 18, 26, .18);
}
.dash-controles[hidden] { display: none; }
.dash-seta {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.dash-seta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dash-pontos { display: flex; gap: 6px; }
.dash-pontos button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  transition: width .3s, background .3s;
  cursor: pointer;
}
.dash-pontos button.on { width: 22px; background: var(--g); }
.dash-contador { min-width: 44px; font-size: 12px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .dash-tubo span, .dash-trilho span { transition: none; }
}

/* Conversa fixa: cabeçalho e campo de mensagem sempre visíveis; só a lista de mensagens rola */
.view-chat #chat-host [data-chat-tela="conversa"]:not([hidden]) {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 100%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  background: #0b0d14;
  padding: calc(10px + env(safe-area-inset-top)) 14px calc(var(--tab) + 22px + env(safe-area-inset-bottom));
}
.view-chat #chat-host [data-chat-tela="conversa"] .chat-topo { flex: none; min-height: 44px; }
.view-chat #chat-host [data-chat-tela="conversa"] .chat-msgs {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
}
.view-chat #chat-host [data-chat-tela="conversa"] .chat-emojis,
.view-chat #chat-host [data-chat-tela="conversa"] .chat-compor { flex: none; }

/* Roteiro da semana: mesmo formato do SIBAC */
.rot-cabecalho { display: grid; gap: 2px; margin-bottom: 4px; }
.rot-semana { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.rot-periodo { margin: 0; font-size: 12px; color: var(--muted); }
.rot-corpo { display: grid; gap: 18px; padding-bottom: 12px; }
.rot-bloco h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: .04em; color: var(--ink); }
.rot-texto { font-size: 15px; line-height: 1.55; color: var(--ink); word-break: break-word; }
.rot-citacao { display: block; margin: 2px 0; padding-left: 10px; border-left: 3px solid #5b8cff; color: var(--muted); }
.rot-musica { display: grid; gap: 6px; margin-top: 10px; }
.rot-musica > b { font-size: 14px; color: var(--ink); }
.rot-link { color: #5b8cff; text-decoration: underline; }
.rot-vazio { margin: 0; font-size: 14px; color: var(--muted); }

/* Roteiro da semana: layout da página pública do SIBAC, com as cores do PWA */
.roteiro-pagina { flex: 1; overflow-y: auto; padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 14px; font-size: calc(15px * var(--roteiro-escala, 1)); color: var(--ink); }
/* Barra superior do roteiro: semana e datas no centro; A- e A+ à direita. */
.roteiro-tela .novo-post-topo { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
.roteiro-topo-titulo { display: grid; justify-items: start; gap: 2px; min-width: 0; }
.roteiro-topo-titulo b { font-size: 16px; text-align: left; }
.roteiro-topo-titulo span { max-width: 100%; font-size: 12px; line-height: 1.3; color: var(--muted); text-align: left; }
.roteiro-fonte { display: flex; gap: 6px; justify-self: end; }
.roteiro-fonte .roteiro-pill { padding: 5px 10px; font-weight: 700; }
.roteiro-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; font: inherit; font-size: 13px; color: var(--ink); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.roteiro-pill-quente { color: #fde68a; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .3); }
.roteiro-hero { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.roteiro-hero-img { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.roteiro-hero-texto { display: grid; gap: 8px; padding: 12px; }
.roteiro-badge { display: inline-block; width: fit-content; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #c7d2fe; background: rgba(91, 140, 255, .14); border: 1px solid rgba(91, 140, 255, .3); padding: 4px 10px; border-radius: 999px; }
.roteiro-aviso-uso { margin: 0; font-size: 12px; line-height: 1.5; color: #fde68a; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .25); border-radius: 12px; padding: 10px; }
.roteiro-card { display: grid; gap: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.roteiro-card-destaque { gap: 10px; }
.roteiro-semana-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.roteiro-eyebrow { font-size: 14px; font-weight: 700; color: var(--ink); }
.roteiro-chip { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: 12px; color: var(--ink); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; }
.roteiro-chip-quente { color: #fde68a; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .3); }
.roteiro-titulo-destaque { margin: 4px 0 0; font-size: 1.1em; line-height: 1.3; font-weight: 800; }
.roteiro-italico { margin: 0; font-style: italic; color: var(--muted); }
.roteiro-muted { margin: 0; font-size: 12px; color: var(--muted); }
.roteiro-grade { display: grid; gap: 14px; }
.roteiro-cabecalho { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.roteiro-cabecalho h3 { margin: 0; font-size: 0.95em; letter-spacing: .03em; }
.roteiro-acoes { display: flex; flex-wrap: wrap; gap: 6px; }
.roteiro-corpo { display: grid; gap: 10px; }
.roteiro-rodape { display: flex; justify-content: flex-end; }
.roteiro-texto { line-height: 1.6; color: var(--ink); word-break: break-word; }
.roteiro-citacao { display: block; margin: 2px 0; padding: 4px 0 4px 10px; border-left: 3px solid #5b8cff; color: var(--muted); }
.roteiro-vazio { margin: 0; font-size: 0.9em; color: var(--muted); }
.roteiro-link { color: #7aa2ff; font-weight: 700; text-decoration: none; }
.roteiro-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.roteiro-musica { display: grid; gap: 8px; padding: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 12px; }
.roteiro-musica-titulo { font-size: 0.95em; }
.roteiro-card-pulso { animation: roteiro-pulso 2.4s ease-in-out infinite; border-color: rgba(91, 140, 255, .5); }
@keyframes roteiro-pulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 140, 255, .0); }
  50% { box-shadow: 0 0 0 6px rgba(91, 140, 255, .18); }
}

/* Localização do supervisor (três momentos da supervisão) e campo de hora na supervisão. */
.ag-modalidade[hidden] { display: none !important; }
.ag-subtitulo { margin: 14px 0 0; font-size: 14px; color: var(--ink); }
.sheet-bg.tela-cheia .sheet-item button.primary { justify-self: start; margin-top: 4px; }

/* Tela que bloqueia o app até os lembretes de supervisão estarem ativos. */
.lembrete-bloqueio { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(8, 10, 18, .94); }
.lembrete-bloqueio-caixa { width: 100%; max-width: 360px; display: grid; gap: 14px; padding: 24px; border: 1px solid rgba(91, 140, 255, .45); border-radius: 18px; background: #1b2030; text-align: center; }
.lembrete-bloqueio-caixa h2 { margin: 0; font-size: 20px; color: var(--ink); }
.lembrete-bloqueio-caixa p { margin: 0; font-size: 15px; line-height: 1.4; color: var(--muted); }
.lembrete-bloqueio-caixa button.primary { justify-self: center; }

/* Card do Discipulado (layout do print): ícones à esquerda, linhas alinhadas com a data, botão de chamada e ações no rodapé.
   Seletores com ".dcard" na frente: a regra global ".sheet-item span" tem mais peso que as classes simples. */
.dcard { display: grid; gap: 10px; }
.dcard .dcard-topo { display: flex; align-items: center; gap: 10px; }
.dcard .dcard-icone { color: var(--ink); display: inline-flex; flex: none; }
.dcard .dcard-icone svg, .dcard .dcard-ico svg { width: 22px; height: 22px; display: block; }
.dcard .dcard-titulo { flex: 1 1 auto; min-width: 0; font-size: 15px; line-height: 1.3; color: var(--ink); }
.dcard .dcard-linha { display: flex; align-items: center; gap: 10px; padding-left: 32px; font-size: 14px; color: var(--ink); }
.dcard .dcard-ico { display: inline-flex; flex: none; width: 22px; }
.dcard .dcard-ico-laranja { color: #f59e0b; }
.dcard .dcard-ico-verde { color: #34c759; }
.dcard .dcard-ico-ciano { color: #22d3ee; }
.dcard .dcard-nome { font-size: 14px; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard .dcard-sub { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard .dcard-obs { font-size: 13px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.dcard .dcard-acoes { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; }
.dcard .dcard-chamada { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.dcard .dcard-chamada svg { width: 16px; height: 16px; display: block; }
.dcard .dcard-chamada, .dcard .dcard-chamada span { color: #fff; font-size: 13px; font-weight: 700; }
.dcard .dcard-acao { background: none; border: 0; padding: 4px; cursor: pointer; display: inline-flex; }
.dcard .dcard-acao svg { width: 20px; height: 20px; display: block; }
.dcard .dcard-editar { color: #34c759; }
.dcard .dcard-excluir { color: #f43f5e; }

/* Card da Supervisão: nome da célula em destaque, com o líder da célula logo abaixo. */
.sheet-item .sv-celula { font-size: 14px; font-weight: 600; color: var(--ink); }

/* Card da Supervisão (mesmo padrão do Discipulado): nome da célula em destaque, cores dos ícones do mockup. */
.dcard .dcard-ico-amarelo { color: #facc15; }
.dcard .dcard-ico-roxo { color: #a78bfa; }
.dcard .dcard-celula { font-size: 14px; font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard .dcard-localizar { color: #60a5fa; }

/* Filtro por pessoa: dica no fim da lista. Puxar para atualizar: indicador fixo no topo. */
.feed-dica {
  width: 100%;
  margin: 12px 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.feed-dica svg { width: 15px; height: 15px; display: block; }
.feed-dica:disabled { cursor: default; opacity: .7; }
#puxar-atualizar {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(27, 31, 43, .9);
  color: #e8eaf2;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  pointer-events: none;
}

/* Registrar presença (menu Células), no modelo da lista de presença do sistema PHP. */
.presenca-form [hidden] { display: none !important; }
.presenca-form h3 { margin: 22px 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.presenca-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink); }
.presenca-lista { list-style: none; margin: 0; padding: 0; }
.presenca-lista li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink); }
.presenca-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.presenca-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.presenca-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; padding: 2px 6px; }
.presenca-foto { position: relative; display: block; margin-top: 4px; border: 1px dashed var(--line); border-radius: 12px; overflow: hidden; min-height: 120px; cursor: pointer; }
.presenca-foto input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.presenca-foto-vazia { display: flex; align-items: center; justify-content: center; min-height: 120px; color: var(--muted); font-size: 14px; }
.presenca-foto img { display: block; width: 100%; height: auto; }
.presenca-busca[hidden] { display: none; }
.presenca-busca { margin-bottom: 12px; }
.presenca-busca input { width: 100%; min-height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; padding: 0 12px; box-sizing: border-box; }
.presenca-filtros { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.presenca-filtros select { flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; padding: 0 10px; }
.presenca-botao { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.presenca-botao.on { background: var(--ink); color: var(--bg); }
.presenca-grupo { list-style: none; padding: 10px 2px 2px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.presenca-sup { margin-top: 12px; }
.presenca-sup input { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; padding: 0 12px; box-sizing: border-box; }
.presenca-rotulo { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.presenca-sugestoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.presenca-sugestoes:empty { display: none; }
.presenca-sugestao { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--line); background: none; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.presenca-chips-sup:empty { display: none; }
.presenca-celula small { display: block; margin-top: 3px; }
.presenca-combo { position: relative; }
.presenca-sugestoes { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; margin-top: 4px; max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.presenca-sugestoes[hidden] { display: none; }
.presenca-sugestao { width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.presenca-sugestao:active { background: var(--line); }
.presenca-cartao { display: flex; width: 100%; min-height: 84px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--ink); font: inherit; text-align: left; overflow: hidden; cursor: pointer; }
.presenca-cartao-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 12px 14px; }
.presenca-cartao-texto > b { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presenca-lider { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.presenca-avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--line); overflow: hidden; }
.presenca-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.presenca-cartao-texto > small { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.presenca-cartao-rede { flex: none; width: 44px; }
.presenca-filtros select { min-width: 0; width: 100%; }
.presenca-filtros { min-width: 0; }
ul.presenca-cartoes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
ul.presenca-cartoes > li { min-width: 0; }
.presenca-cartao { min-width: 0; max-width: 100%; box-sizing: border-box; }
.presenca-cartao-texto > b { display: block; min-width: 0; }
.presenca-corpo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.presenca-avatar { width: 52px; height: 52px; }
.presenca-dados { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.presenca-cartao .presenca-lider { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presenca-form { min-width: 0; max-width: 100%; box-sizing: border-box; overflow-x: hidden; }
.presenca-form input, .presenca-form textarea, .presenca-form select { max-width: 100%; min-width: 0; box-sizing: border-box; }
.presenca-form input[type="date"] { width: 100%; display: block; }
.presenca-form .presenca-lista li { min-width: 0; }
.presenca-membro { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.presenca-membro > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.presenca-avatar-membro { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--line); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; overflow: hidden; cursor: zoom-in; }
.presenca-avatar-membro img { display: block; width: 100%; height: 100%; object-fit: cover; }
.presenca-avatar-membro span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.zoom-foto { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .9); }
.zoom-foto img { max-width: 100%; max-height: 90vh; border-radius: 12px; object-fit: contain; }
.zoom-foto p { color: #fff; text-align: center; font-size: 16px; }
.zoom-foto-fechar { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 18px; cursor: pointer; }
.presenca-form label, .presenca-form .presenca-sup { min-width: 0; max-width: 100%; }
.presenca-form input[type="date"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; margin: 0; }
.presenca-avatar-pequeno { width: 26px; height: 26px; flex: none; }
.presenca-chip .presenca-avatar-pequeno { width: 22px; height: 22px; }
.presenca-sugestao { display: flex; align-items: center; gap: 10px; }
.presenca-sugestao > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confirma-bg { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .6); }
.confirma { width: 100%; max-width: 340px; padding: 20px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; }
.confirma p { margin: 0 0 6px; font-size: 15px; color: var(--ink); line-height: 1.4; }
.confirma button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.confirma button.primary { background: var(--ink); color: var(--bg); border-color: transparent; }
.confirma .confirma-sair { color: #f87171; }
.presenca-data { margin-top: 4px; }
.presenca-data-botao { display: block; width: 100%; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; text-align: center; text-transform: capitalize; cursor: pointer; }
.cal-caixa { max-width: 360px; }
.cal-caixa .cal-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-caixa .cal-topo button { width: 40px; min-height: 40px; border: 0; border-radius: 50%; background: none; color: var(--ink); font-size: 22px; cursor: pointer; }
.cal-caixa .cal-topo b { font-size: 16px; text-transform: capitalize; }
.cal-caixa .cal-dica { margin: 0; font-size: 13px; color: var(--muted); }
.cal-caixa .cal-grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-caixa .cal-sem { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-caixa .cal-dia { min-height: 40px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.cal-caixa .cal-dia:disabled { color: var(--muted); opacity: .3; cursor: default; }
.cal-caixa .cal-dia.sel { background: var(--ink); color: var(--bg); }
.diario-controles { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.diario-controles select { min-height: 40px; min-width: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; padding: 0 8px; }
.diario-controles select[data-diario-mes] { flex: 1 1 0; }
.diario-controles select[data-diario-ano] { flex: 0 0 92px; }
.diario-linha { display: grid; align-items: center; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.diario-cab { padding: 4px 0 8px; }
.diario-sem { text-align: center; font-size: 12px; color: var(--muted); }
.diario-membro { display: flex; align-items: center; gap: 10px; min-width: 0; }
.diario-nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink); }
.diario-check { width: 20px; height: 20px; margin: 0 auto; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: #fff; }
.diario-check.ok { background: #34c759; border-color: transparent; }
.diario-check svg { width: 11px; height: 11px; }
.percentual-presenca { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); display: grid; gap: 14px; }
.percentual-presenca h3 { margin: 0; font-size: 16px; color: var(--ink); }
.percentual-total { display: flex; align-items: baseline; gap: 8px; }
.percentual-total b { font-size: 26px; font-variant-numeric: tabular-nums; color: var(--ink); }
.percentual-total span { font-size: 13px; color: var(--muted); }
.percentual-medidores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.raios { display: grid; justify-items: center; gap: 2px; text-align: center; min-width: 0; }
.raios svg { width: 100%; max-width: 120px; height: auto; }
.raios b { font-size: 13px; color: var(--ink); }
.raios small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.presenca-card { display: grid; gap: 12px; padding: 14px; margin-top: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); min-width: 0; }
.presenca-card > h3 { margin: 0; }
.presenca-card [hidden] { display: none !important; }
.categoria-abas { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.categoria-aba { flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.categoria-aba small { font-size: 11px; opacity: .8; }
.categoria-aba.on { background: var(--ink); color: var(--bg); border-color: transparent; }
.diario-card { display: grid; gap: 12px; padding: 14px; margin-top: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); min-width: 0; }
.diario-card:first-child { margin-top: 0; }
.diario-corpo { min-width: 0; }
.diario-graficos:empty { display: none; }
.percentual-linha { display: grid; gap: 10px; }
.percentual-linha + .percentual-linha { padding-top: 12px; border-top: 1px solid var(--line); }
.presenca-visitantes .presenca-combo input { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; padding: 0 12px; box-sizing: border-box; }

/* Importar planilha (reaproveita as classes do diário e da presença) */
.importacao-arquivo { display: grid; gap: 6px; font-weight: 600; }
.importacao-arquivo input { font: inherit; color: var(--ink); }
.importacao-topo { display: grid; gap: 8px; }
.importacao-topo label { display: grid; gap: 6px; font-weight: 600; }
.importacao-topo select, .importacao-acao select { font: inherit; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 0 10px; }
.importacao-notas { margin: 0; font-size: 13px; color: var(--muted); }
.importacao-acao { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 0 0 10px 40px; font-size: 13px; }
.importacao-acao select { flex: 1 1 100%; }
.importacao-aviso { color: var(--muted); font-size: 12px; }
button.diario-check { padding: 0; cursor: pointer; font: inherit; }
.importacao-busca input[type="search"] { flex: 1 1 100%; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; padding: 0 12px; box-sizing: border-box; }
.importacao-busca .presenca-sugestoes { flex: 1 1 100%; display: grid; gap: 4px; }
.importacao-busca .presenca-sugestoes[hidden] { display: none; }
.importacao-busca .presenca-sugestoes { position: static; max-height: none; box-shadow: none; background: none; border: 0; padding: 0; margin-top: 0; }
.diario-sem small { display: block; font-size: 9px; color: var(--muted); margin-top: 2px; }
.diario-percentual { text-align: center; font-size: 13px; font-weight: 600; color: var(--ink); }

/* Tarja lateral da rede da célula no card de supervisão (mesma cor da presença). */
.dcard.dcard-com-tarja { position: relative; overflow: hidden; padding-left: 20px; }
/* Tarja da rede: faixa fina à esquerda, para não cobrir os botões do cartão. */
.dcard .dcard-tarja { position: absolute; top: 0; left: 0; bottom: 0; width: 5px; border-radius: 14px 0 0 14px; }
.dcard .dcard-realizar { width: 100%; padding: 10px 12px; border: 1px solid #34c759; border-radius: 12px; background: rgba(52, 199, 89, 0.12); color: #34c759; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
/* Supervisão realizada: recolhida mostra título e célula; expandida mostra o cartão inteiro. */
.dcard-recolhivel > .dcard-resumo { display: grid; gap: 10px; list-style: none; cursor: pointer; }
.dcard-recolhivel > .dcard-resumo::-webkit-details-marker { display: none; }
.dcard-recolhivel > .dcard-resumo::after { content: '▾'; justify-self: end; color: var(--muted); transition: transform 0.2s; }
.dcard-recolhivel[open] > .dcard-resumo::after { transform: rotate(180deg); }
.dcard-recolhivel > .dcard-corpo { display: grid; gap: 10px; margin-top: 10px; }
.confirma p { white-space: pre-line; }

/* Membresia nos avatares: anel verde para Membro, azul para Congregado (box-shadow, para não trocar a borda existente) */
.anel-membro { box-shadow: 0 0 0 2px #34c759; }
.anel-congregado { box-shadow: 0 0 0 2px #3b82f6; }
.diario-gesto { touch-action: pan-y; }
.diario-corpo { transition: transform .18s ease-out, opacity .18s ease-out; }
.diario-corpo.diario-carregando { opacity: .5; }

/* Frequência: velocímetro e anel lado a lado, no mesmo card */
.dash-freq-duplo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.dash-freq-duplo .dash-velo { width: 100%; max-width: 170px; margin: 0 auto; }
.dash-freq-duplo .dash-rosca { width: 150px; height: 150px; }
.dash-freq-duplo .dash-legenda { font-size: 11px; gap: 4px 8px; }

/* Cadastrados em célula: três blocos com anel por sexo */
.dash-cad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dash-cad-cartao { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; background: var(--bg); border-radius: 14px; text-align: center; min-width: 0; }
.dash-cad-cartao > b { font-size: 22px; font-variant-numeric: tabular-nums; }
.dash-cad-cartao > span { font-size: 12px; color: var(--muted); }
.dash-cad-anel { width: 84px; height: 84px; }
.dash-cad-leg { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; font-size: 10px; color: var(--muted); }
.dash-cad-leg li { display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.dash-cad-leg i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.dash-cad-leg b { color: var(--ink); font-weight: 700; }

.home-perfil img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

/* Perfil: cartão e botões em vidro fosco (translúcidos, com desfoque) */
#view-perfil .perfil-cartao { padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .07); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
#view-perfil .perfil-cartao .meta { font-size: 13px; color: var(--muted); }
#view-perfil .perfil-cartao .name { margin-top: 2px; font-weight: 600; font-size: 16px; }
#view-perfil .perfil-cartao .name a { color: #a5b4fc; text-decoration: underline; }
#view-perfil button.perfil-acao { width: 100%; min-height: 52px; padding: 0 16px; border-radius: 16px; font: inherit; font-weight: 600; font-size: 15px; color: var(--ink); background: linear-gradient(135deg, rgba(102, 126, 234, .45), rgba(118, 75, 162, .45)); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 8px 22px rgba(0, 0, 0, .25); cursor: pointer; }
#view-perfil button.perfil-acao:active { transform: scale(.985); }
#view-perfil button.perfil-sair { color: #fca5a5; background: rgba(248, 113, 113, .16); }

/* Perfil: fundo com manchas de cor, para o vidro fosco aparecer; medidas dentro da tela */
#view-perfil { position: relative; isolation: isolate; overflow: hidden; }
#view-perfil::before { content: ''; position: absolute; inset: -20% -10% auto -10%; height: 70%; z-index: -1; pointer-events: none; background: radial-gradient(circle at 25% 35%, rgba(56, 189, 248, .55), transparent 55%), radial-gradient(circle at 80% 30%, rgba(99, 102, 241, .6), transparent 55%), radial-gradient(circle at 40% 85%, rgba(236, 72, 153, .45), transparent 60%); filter: blur(10px); }
#view-perfil .perfil-cartao, #view-perfil button.perfil-acao { box-sizing: border-box; max-width: 100%; }
#view-perfil .perfil-principal { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 28px 20px 22px; border-radius: 28px; }
#view-perfil .perfil-foto { width: 128px; height: 128px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .55); box-shadow: 0 10px 28px rgba(0, 0, 0, .3); overflow: hidden; font-size: 36px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); display: grid; place-items: center; margin-bottom: 8px; }
#view-perfil .perfil-foto.com-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
#view-perfil .perfil-nome { margin: 4px 0 0; font-size: 22px; font-weight: 800; color: var(--ink); }
#view-perfil .perfil-cargo { margin: 0; font-size: 15px; color: var(--muted); }
#view-perfil .perfil-contato { margin-top: 10px; font-size: 15px; font-weight: 600; }
#view-perfil .perfil-contato a { color: #a5b4fc; text-decoration: none; }

/* Calendários da igreja no topo do Discipulado (sem escala de servos). */
.cal-disc-bloco { display: grid; gap: 10px; margin: 0 0 16px; }
.cal-disc-legenda { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-disc-chip { font-size: 12px; font-weight: 600; color: var(--ink); padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--cor); }
.cal-disc-destaques { display: grid; gap: 6px; }
.cal-disc-destaque { display: grid; gap: 2px; padding: 8px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--cor); }
.cal-disc-destaque small { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cal-disc-destaque b { font-size: 14px; color: var(--ink); }
.cal-disc-dia { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.cal-disc-evento { box-shadow: inset 3px 0 0 var(--cor); }
.importacao-busca .presenca-sugestoes .presenca-sugestao { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 10px; text-align: left; }
.importacao-busca .presenca-sugestoes .presenca-sugestao span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Botão Agenda no cabeçalho do Discipulado, canto superior direito. */
.header-agenda { position: relative; }
.cal-disc-abrir { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.cal-disc-abrir svg { width: 18px; height: 18px; }

/* Agenda da igreja: navegação de mês fixa no topo e divisão por mês. */
.cal-disc-bloco { margin: 0; }
/* Faixa fixa com a legenda e o controle Lista | Calendário: não rola com a lista. */
.cal-disc-topo { flex: none; display: grid; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #0f121a; }
/* Barra de avatares da Supervisão e do Discipulado: fixa no canto superior (0;0), sempre visível, com altura fixa.
   A view reserva o mesmo espaço desde o primeiro desenho, então a barra nunca empurra o conteúdo. */
.ag-barra { position: fixed; top: 0; left: 0; right: 0; z-index: 5; box-sizing: border-box; height: calc(100px + env(safe-area-inset-top)); padding: calc(6px + env(safe-area-inset-top)) 16px 0; background: #0f121a; border-bottom: 1px solid var(--line); }
.ag-barra .stories { padding-top: 2px; padding-bottom: 4px; }
.ag-barra-vazia { margin: 0; height: 60px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 15px; font-weight: 600; }
#view-supervisao, #view-discipulado { padding-top: calc(100px + env(safe-area-inset-top) + 16px); }
.cal-disc-controles { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-disc-atualizar { width: 34px; height: 34px; flex: none; }
.cal-disc-atualizar svg { width: 17px; height: 17px; }
.cal-disc-mes { display: grid; gap: 10px; margin: 0 0 18px; }
.cal-disc-mes-titulo { margin: 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-disc-legenda { margin-bottom: 10px; }

/* Agenda da igreja: navegação de mês no cabeçalho, busca em painel flutuante. */
.cal-disc-sheet { position: relative; }
.cal-disc-nav { display: inline-flex; align-items: center; gap: 4px; }
.cal-disc-nav b { min-width: 118px; text-align: center; font-size: 14px; font-weight: 800; color: var(--ink); text-transform: capitalize; white-space: nowrap; }
.cal-disc-nav .btn-redondo { width: 32px; height: 32px; }
.cal-disc-nav svg { width: 16px; height: 16px; }
.cal-disc-flutuante { position: absolute; left: 12px; right: 12px; z-index: 10; display: grid; gap: 8px; max-height: 70%; overflow-y: auto; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55); }
.cal-disc-flutuante[hidden] { display: none; }
.cal-disc-resultado { display: grid; gap: 2px; width: 100%; padding: 10px 12px; text-align: left; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: inset 3px 0 0 var(--cor); cursor: pointer; }
.cal-disc-resultado b { font-size: 14px; }
.cal-disc-resultado span { font-size: 12px; color: var(--muted); }
.cal-disc-dica { font-size: 13px; color: var(--muted); padding: 6px 2px; }

/* Agenda da igreja: alternância Lista | Calendário e grade mensal. */
.cal-disc-formato { justify-self: start; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.cal-disc-formato button { padding: 7px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.cal-disc-formato button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.cal-disc-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-disc-semana { font-size: 11px; font-weight: 800; text-align: center; color: var(--muted); padding-bottom: 2px; }
.cal-disc-vazio { min-height: 52px; }
.cal-disc-celula { display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; min-height: 52px; padding: 6px 2px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.cal-disc-celula.is-hoje { border-color: var(--ink); }
.cal-disc-celula.is-sel { background: var(--card); box-shadow: inset 0 0 0 1px var(--muted); }
.cal-disc-num { font-size: 13px; font-weight: 700; }
.cal-disc-bolinhas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; min-height: 8px; }
.cal-disc-bolinhas i { width: 6px; height: 6px; border-radius: 50%; background: var(--cor); }
.cal-disc-bolinhas small { font-size: 10px; color: var(--muted); }
.cal-disc-detalhe { display: grid; gap: 8px; margin-top: 10px; }

/* Filtro de período do card Frequência */
.dash-periodo { display: inline-flex; gap: 4px; padding: 3px; margin-bottom: 10px; border-radius: 999px; background: var(--bg); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.dash-periodo button { flex: none; border: 0; background: none; color: var(--muted); padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.dash-periodo button.on { background: var(--g); color: #fff; font-weight: 700; }


/* Página Acessos (perfil do Pastor Principal): uma seção por nível, uma linha por área. */
.acessos-nivel { margin: 16px 0; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.acessos-nivel h3 { margin: 0 0 8px; font-size: 15px; }
.acessos-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 15px; }

/* Abas da tela Acessos (Acessos e Dashboard). */
.acessos-abas { display: flex; gap: 8px; margin: 8px 0 4px; }
.acessos-aba { flex: 1; padding: 8px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.15); background: transparent; color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.acessos-aba.on { background: rgba(255, 255, 255, 0.14); font-weight: 600; }

/* Seletor de igreja toda ou rede no Dashboard. */
.dash-seletor { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; font-size: 14px; }
.dash-seletor select { flex: 1; max-width: 60%; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.06); color: inherit; font: inherit; font-size: 16px; }

/* Lista de quem curtiu um post. */
.curtidas-folha { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.55); display: flex; align-items: flex-end; justify-content: center; }
.curtidas-caixa { width: 100%; max-width: 480px; max-height: 70vh; overflow-y: auto; padding: 16px; border-radius: 18px 18px 0 0; background: #1b1f2a; color: inherit; box-sizing: border-box; }
.curtidas-caixa header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.curtidas-caixa ul { list-style: none; margin: 0; padding: 0; }
.curtida-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 15px; }

/* Linha "Curtido por fulano e outras N pessoas" abaixo das ações do post. */
.post-acoes { flex-wrap: wrap; }
.curtido-por { flex-basis: 100%; margin: 6px 0 0; padding: 0; background: none; border: 0; color: inherit; font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.curtido-por b { font-weight: 600; }

/* Ícones de curtir e comentar mais discretos. */
.post-acoes .acao { font-size: 20px; padding: 6px 10px; }
.post-acoes .acao span { font-size: 20px; }

/* Raio X: colunas de estado civil clicáveis filtram faixa etária e sexo do próprio card. */
.dash-coluna.is-clicavel { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: opacity .2s; }
.dash-coluna.is-clicavel:active { opacity: .7; }
.dash-card.tem-filtro .dash-coluna.is-clicavel:not(.on) { opacity: .45; }
.dash-coluna.on small { color: var(--ink); font-weight: 700; }
.dash-filtro { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.dash-filtro[hidden] { display: none; }
.dash-filtro button { background: none; border: 0; padding: 4px 0; color: var(--ink); font: inherit; text-decoration: underline; cursor: pointer; }

/* Raio X: duplo toque numa faixa etária abre a lista de pessoas do recorte. */
.dash-coluna.is-faixa { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.dash-coluna.is-faixa:active { opacity: .7; }
.dash-pessoas { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.dash-pessoa { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg); border-radius: 14px; }
.dash-pessoa-foto { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--g); color: #fff; font-weight: 700; font-size: 14px; }
.dash-pessoa-foto img { width: 100%; height: 100%; object-fit: cover; }
.dash-pessoa-dados { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dash-pessoa-dados b { font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-pessoa-dados small { font-size: 12px; color: var(--muted); }
.dash-pessoa-wa { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; background: var(--g); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }

/* Lista de pessoas da faixa etária: campo de busca por nome e idade. */
.dash-busca { width: 100%; box-sizing: border-box; margin: 4px 0 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 16px; }
.dash-busca:focus { outline: none; border-color: var(--d1); }

/* Lista do Em célula: nome da célula abaixo da idade e do telefone. */
.dash-pessoa-celula { color: var(--d1); font-weight: 600; }

/* Dados da célula: resumo, líder/anfitrião com foto ampliável, e abas de membros. */
.dc-resumo { display: grid; gap: 2px; padding: 12px 14px; margin-bottom: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.dc-resumo b { font-size: 16px; color: var(--ink); }
.dc-resumo span { font-size: 13px; color: var(--muted); }
.dc-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.dc-pessoa, .dc-info { display: grid; gap: 6px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.dc-pessoa small, .dc-info small { font-size: 12px; color: var(--muted); }
.dc-pessoa-linha { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dc-pessoa-linha b, .dc-info b { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.dc-zoom { flex: none; padding: 0; background: none; border: 0; border-radius: 50%; cursor: zoom-in; }
.dc-zoom .avatar, .dc-zoom img { display: block; }
.dc-abas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; margin-bottom: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.dc-aba { font: inherit; font-size: 12px; padding: 8px 4px; color: var(--muted); background: none; border: 0; border-radius: 9px; cursor: pointer; }
.dc-aba span { font-weight: 700; }
.dc-aba.on { color: var(--ink); background: var(--card); font-weight: 700; }
.dc-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dc-membro { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.dc-vazio { font-size: 13px; color: var(--muted); padding: 8px 2px; }
@media (max-width: 380px) { .dc-grade { grid-template-columns: 1fr; } .dc-abas { grid-template-columns: repeat(2, 1fr); } }
/* Avatar do líder e do anfitrião: tamanho fixo, como nos membros da lista. */
.dc-pessoa-linha .avatar, .dc-pessoa-linha img { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.dc-pessoa-linha .avatar { display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); }
/* Avatar do líder e do anfitrião: fixa botão, camada do avatar e foto (vence as regras globais de .avatar.com-foto img). */
.dc-pessoa-linha .dc-zoom { width: 44px; height: 44px; flex: none; overflow: hidden; border-radius: 50%; }
.dc-pessoa-linha .dc-zoom .avatar, .dc-pessoa-linha .dc-zoom .avatar.com-foto { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; }
.dc-pessoa-linha .dc-zoom img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: block; }
.perfil-versao { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
/* Cartão de dados da célula com a faixa da rede à direita (mesma cor da lista de células). */
.dc-resumo { display: flex; padding: 0; overflow: hidden; }
.dc-resumo-texto { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 12px 14px; }
.dc-resumo-rede { flex: none; width: 44px; }
/* Dados da célula: cartões do topo não encolhem; só a lista de membros rola. */
.dc-corpo > * { flex-shrink: 0; }
/* Cartão do nome da célula: sem overflow hidden (o navegador encolhia o item a zero em listas longas). A faixa arredonda o canto sozinha. */
.dc-resumo { overflow: visible; min-height: 84px; }
.dc-resumo-rede { border-radius: 0 12px 12px 0; display: flex; align-items: center; justify-content: center; }

/* Botão da galeria, sobre a faixa da rede: degradê do sistema (mesmo de .btn-redondo.primary). */
.dc-galeria { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); border: 0; border-radius: 50%; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); cursor: pointer; }
.dc-galeria svg { width: 20px; height: 20px; }

/* Galeria da célula: cartões de cantos arredondados, avatar redondo e nome embaixo. */
.dc-galeria-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 420px) { .dc-galeria-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dc-galeria-card { min-width: 0; display: grid; justify-items: center; gap: 8px; padding: 16px 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.dc-galeria-nome { max-width: 100%; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-galeria-card .avatar { width: 72px; height: 72px; font-size: 22px; border-radius: 50%; }
.dc-galeria-card .avatar.com-foto { width: 72px; height: 72px; }
.dc-link { text-decoration: none; color: inherit; cursor: pointer; }
.perfil-mapa { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: default; }
.perfil-mapa select { font: inherit; font-size: 16px; padding: 6px 8px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
/* Dados da célula: total de membros e abas com o número na segunda linha (alinhadas). */
.dc-colchete { grid-column: 1 / span 3; grid-row: 1; position: relative; height: 14px; margin: 6px 8px 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; }
.dc-colchete span { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); padding: 0 8px; background: var(--bg); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.dc-colchete b { margin-left: 4px; font-size: 14px; color: var(--ink); }
.dc-aba { grid-row: 2; display: grid; justify-items: center; gap: 2px; line-height: 1.2; }
.dc-aba-rotulo { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.dc-aba-total { font-size: 14px; font-weight: 700; color: inherit; }

/* Busca da lista de pessoas: botão × para apagar o termo digitado. */
.dash-busca-wrap { position: relative; }
.dash-busca-wrap .dash-busca { padding-right: 44px; }
.dash-busca-limpar { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--line); color: var(--ink); display: flex; align-items: center; justify-content: center; line-height: 0; cursor: pointer; }
.dash-busca-limpar svg { display: block; }
.dash-busca-limpar[hidden] { display: none; }
.dash-busca::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* Alerta pastoral: lista com rolagem própria e nível em destaque. */
.dash-lista-alertas { max-height: 420px; overflow-y: auto; margin-top: 4px; }
.dash-pessoa-alerta { color: var(--d5); font-weight: 600; }

/* Alerta pastoral: colunas de nível e motivo clicáveis, com destaque da seleção. */
.dash-coluna[data-alerta-nivel], .dash-coluna[data-alerta-motivo] { cursor: pointer; touch-action: manipulation; }

/* Calendário semanal de células */
.cal-semanal-filtros { display: grid; gap: 8px; margin-bottom: 4px; }
.cal-semanal-filtros select, .cal-semanal-filtros input { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; padding: 0 12px; box-sizing: border-box; }
.cal-dia { margin-top: 14px; }
.cal-dia h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--ink); }
.cal-dia h3 small { font-weight: 500; color: var(--muted); }
.cal-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal-celula { display: flex; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.cal-celula-rede { width: 4px; border-radius: 4px; flex: none; }
.cal-celula-texto { min-width: 0; display: grid; gap: 2px; }
.cal-celula-texto b { font-size: 15px; }
.cal-celula-texto small { font-size: 13px; color: var(--muted); }
.cal-vazio { margin: 0; font-size: 13px; color: var(--muted); }
.cal-dias { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 8px; margin: 0 -2px; }
.cal-dia-botao { flex: none; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.cal-dia-botao.on { background: var(--ink); color: var(--bg); border-color: transparent; font-weight: 600; }
.cal-dia-botao small { font-size: 12px; opacity: .8; }
.cal-titulo { margin: 8px 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.cal-titulo small { font-weight: 500; color: var(--muted); }
.cal-celula-texto { flex: 1; }
.cal-supervisao { flex: none; align-self: center; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 0; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
#view-celulas .cal-dias, .cal-semanal-filtros { flex: none; }
.cal-dias { min-height: 56px; align-items: center; }
.cal-dia-botao { min-height: 40px; }
.cal-pessoa { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-pessoa .cal-av { width: 26px; height: 26px; font-size: 11px; flex: none; }
.cal-pessoa small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-risco-texto { color: #fbbf24; }

/* Formatação do WhatsApp dentro de posts e alertas. */
.post-texto .roteiro-citacao { display: block; border-left: 3px solid #94a3b8; padding-left: 10px; opacity: .85; }
.post-texto .roteiro-link { color: #7c9cff; text-decoration: underline; word-break: break-all; }

/* Selo de mensagens não lidas nos botões Mensagens e Grupos do menu do chat */
#tabbar-chat button { position: relative; }
.chat-menu-selo { position: absolute; top: 2px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-sizing: border-box; }
.chat-menu-selo[hidden] { display: none; }
.post-tarja { padding: 10px 16px; font-size: 15px; }
.post-tarja .curtido-por { margin: 0; color: inherit; font-weight: 600; }

/* Formatação do texto nas mensagens (estilo WhatsApp) */
.chat-bolha strong { font-weight: 700; }
.chat-bolha em { font-style: italic; }
.chat-bolha s { text-decoration: line-through; }
.chat-bolha .chat-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: rgba(255, 255, 255, .12); padding: 1px 4px; border-radius: 4px; }

/* Visto (✓ / ✓✓) e reações nas mensagens, estilo WhatsApp */
.chat-visto { display: inline-block; margin-left: 4px; font-size: 11px; letter-spacing: -1px; color: #9aa3b8; }
.chat-visto.is-lida { color: #53bdeb; }
.chat-visto[data-chat-vistas] { cursor: pointer; }
.chat-reacoes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chat-reacoes:empty { display: none; }
.chat-reacao { background: #252c3f; border: 1px solid #2d3345; border-radius: 99px; color: #e8eaf2; font-size: 12px; padding: 2px 7px; cursor: pointer; }
.chat-reacao.is-minha { border-color: #6366f1; }
.chat-reagir { display: flex; justify-content: center; gap: 6px; align-self: center; background: #1b1f2b; border: 1px solid #2d3345; border-radius: 99px; padding: 6px 10px; }
.chat-reagir[hidden] { display: none; }
.chat-reagir-item { background: none; border: 0; font-size: 24px; padding: 4px 6px; cursor: pointer; }

/* Barra de reações estilo WhatsApp: pílula flutuante logo acima (ou abaixo) da mensagem, com pontinha */
.chat-reagir { position: absolute; z-index: 20; display: grid; gap: 6px; padding: 6px 8px; border-radius: 99px; background: #202c33; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.chat-reagir[hidden] { display: none; }
.chat-reagir::after { content: ''; position: absolute; left: var(--seta-x, 50%); bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 0; border-top-color: #202c33; }
.chat-reagir.is-abaixo::after { bottom: auto; top: -6px; border-top-color: transparent; border-bottom: 6px solid #202c33; }
.chat-reagir-linha { display: flex; align-items: center; gap: 6px; }
.chat-reagir-item { background: none; border: 0; font-size: 26px; line-height: 1; width: 38px; height: 38px; padding: 0; border-radius: 50%; cursor: pointer; }
.chat-reagir-item:active { background: rgba(255, 255, 255, .12); transform: scale(1.15); }
.chat-reagir-mais { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #1e2435; color: #e8eaf2; font-size: 22px; line-height: 1; padding: 0; margin: 0; cursor: pointer; }
.chat-reagir-grade { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; max-height: 180px; overflow-y: auto; }
/* Com a grade de mais emojis aberta, o card deixa de ser pílula e fica com cantos discretos. */
.chat-reagir:has(.chat-reagir-grade:not([hidden])) { border-radius: 10px; }
.chat-reagir-grade[hidden] { display: none; }

/* Botão de emoji no campo de digitar (carinha estilo WhatsApp) */
.chat-emoji-btn svg { width: 24px; height: 24px; display: block; margin: auto; }
.chat-emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; background: #141824; border-radius: 10px; padding: 8px; margin-bottom: 4px; }
.chat-emojis[hidden] { display: none; }

/* Reações penduradas na borda de baixo do balão, como no WhatsApp */
.chat-bolha { position: relative; }
.chat-bolha:has(.chat-reacoes:not(:empty)) { margin-bottom: 14px; }

/* Responder: trecho citado dentro da bolha, faixa acima do campo e botão na barra de reações */
.chat-citacao { display: block; width: 100%; text-align: left; background: rgba(0, 0, 0, .18); border: 0; border-left: 3px solid #a5b4fc; border-radius: 8px; padding: 6px 8px; margin: 0 0 6px; color: inherit; font: inherit; cursor: pointer; }
.chat-citacao strong { display: block; font-size: 12px; font-weight: 700; color: #c7d2fe; }
.chat-citacao span { display: block; font-size: 13px; color: #cbd2e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-citacao.is-vazia { font-size: 13px; font-style: italic; color: #9aa3b8; cursor: default; }
.chat-bolha.is-eu .chat-citacao { border-left-color: #e0e7ff; }
.chat-bolha.is-eu .chat-citacao strong { color: #fff; }
.chat-bolha.is-destaque { box-shadow: 0 0 0 2px #a5b4fc; transition: box-shadow .3s; }
.chat-respondendo { flex: none; display: flex; align-items: center; gap: 8px; background: #1b1f2b; border: 1px solid #2d3345; border-left: 3px solid #a5b4fc; border-radius: 10px; padding: 6px 8px 6px 10px; margin-bottom: 8px; }
.chat-respondendo[hidden] { display: none; }
.chat-respondendo-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; color: #cbd2e1; }
.chat-respondendo-texto strong { font-weight: 700; color: #c7d2fe; }
.chat-respondendo-texto span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-respondendo-cancelar { flex: none; width: 32px; height: 32px; background: none; border: 0; border-radius: 50%; color: #9aa3b8; font-size: 16px; cursor: pointer; }
.chat-reagir-responder { display: grid; place-items: center; flex: none; width: 34px; height: 34px; margin: 0; padding: 0; background: #1e2435; border: 0; border-radius: 50%; color: #e8eaf2; cursor: pointer; }
.chat-reagir-responder[hidden] { display: none; }
.chat-reagir-responder svg { width: 18px; height: 18px; }

/* Fotos do chat: miniatura na bolha, tela cheia ao tocar, sem menu de salvar */
.chat-emoji-btn[hidden] { display: none; }
.chat-arquivo-oculto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chat-foto { display: block; width: min(260px, 100%); padding: 0; margin: 0 0 4px; border: 0; border-radius: 12px; overflow: hidden; background: #1c2131; cursor: pointer; }
.chat-foto img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-touch-callout: none; user-select: none; -webkit-user-drag: none; }
.chat-zoom { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0, 0, 0, .94); padding: 16px; }
.chat-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; -webkit-touch-callout: none; user-select: none; -webkit-user-drag: none; }
.chat-zoom-fechar { display: grid; place-items: center; box-sizing: border-box; width: 40px; height: 40px; margin: 0; padding: 0; line-height: 1; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 18px; cursor: pointer; }
.chat-zoom-acoes { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; display: flex; gap: 10px; }
.chat-zoom-baixar { display: grid; place-items: center; box-sizing: border-box; width: 40px; height: 40px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.chat-zoom-baixar svg { width: 20px; height: 20px; }

/* Editar mensagem e campo de várias linhas */
.chat-editada { font-style: italic; }
.view-chat #chat-host .chat-compor textarea { display: block; box-sizing: border-box; flex: 1; min-width: 0; min-height: 44px; margin: 0; resize: none; overflow-y: auto; max-height: 150px; line-height: 1.35; background: #141824; border: 1px solid #2d3345; border-radius: 22px; color: #e8eaf2; padding: 10px 14px; font: inherit; font-size: 16px; }
.view-chat #chat-host .chat-compor textarea:disabled { opacity: .5; }
.chat-reacoes { position: absolute; bottom: -13px; right: 8px; left: auto; margin: 0; gap: 2px; }
.chat-linha:not(.is-eu) .chat-reacoes { left: 8px; right: auto; }
.chat-reacao { background: #202c33; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); border-color: #202c33; padding: 1px 6px; }
.chat-reacao.is-minha { border-color: #6366f1; }

/* Quadro Mensal das Reuniões: grade do mês com R/C/P/F por dia e lista do dia abaixo. */
.quadro-filtros { grid-template-columns: 1fr 1fr; }
.quadro-filtros select[data-qm-rede] { grid-column: 1 / -1; }
.quadro-legenda { margin: 10px 0 8px; font-size: 12px; color: var(--muted); }
.quadro-legenda span { font-style: normal; font-weight: 700; color: var(--ink); }
.quadro-dia i { font-style: normal; font-weight: 700; color: var(--muted); }
.quadro-semana, .quadro-dias { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.quadro-semana span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.quadro-dia { display: grid; gap: 2px; min-width: 0; padding: 6px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; text-align: center; cursor: pointer; }
.quadro-dia b { font-size: 14px; }
.quadro-dia small { font-size: 10px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; }
.quadro-dia.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
/* Dia da semana sem célula prevista (no total ou no filtro de rede): fundo igual ao dos demais dias; só o número do dia fica esmaecido. */
.quadro-dia.sem-celula b { color: #6b7280; }
/* Sem célula prevista: some com R/C/P/F, mantendo a altura da caixa igual à dos demais dias. */
.quadro-dia.sem-celula small, .quadro-dia.sem-celula i { visibility: hidden; }
/* Dia atual: borda pontilhada vermelha (vale também para o dia em branco). */
.quadro-dia.hoje { border: 2px dotted #dc2626; }
.quadro-vazio { display: block; }
.quadro-detalhe { margin-top: 14px; }

/* Cards do Quadro Mensal: carrossel horizontal (arrastar para os lados), um card por tela. */
.quadro-cards { display: flex; gap: 12px; margin: 16px 0 4px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.quadro-cards > .empty { flex: 1 0 100%; }
.quadro-card { flex: 0 0 82%; display: grid; gap: 6px; scroll-snap-align: start; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.quadro-card-titulo { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.quadro-card b { font-size: 30px; line-height: 1.1; color: var(--ink); }
.quadro-card b span { font-size: 16px; font-weight: 600; color: var(--muted); }
.quadro-card small { font-size: 12px; color: var(--muted); }
.quadro-barra { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.quadro-barra i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }

/* Card de células e membros: dois números lado a lado. */
.quadro-duplo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quadro-duplo > div { display: grid; gap: 2px; }

/* Quadro Mensal: ao abrir um dia, a lista cresce e não pode espremer os cards nem a grade. */
.quadro-filtros, .quadro-legenda, .quadro-mes, .quadro-cards, .quadro-detalhe { flex: none; }

/* Os cards ficam dentro de um grid (.sheet-corpo): altura fixa para não achatar quando a lista do dia cresce. */
.sheet-bg.tela-cheia .sheet-corpo .quadro-cards { height: 200px; min-height: 200px; }
.sheet-bg.tela-cheia .sheet-corpo .quadro-card { height: 100%; }

/* Itens de menu com ícone (círculo no degradê do sistema): menus Células, Presença em Célula e botões do Perfil. */
.tb-item-com-icone { display: flex; align-items: center; gap: 12px; }
.tb-item .tb-item-icone { flex: none; display: grid; place-items: center; width: 40px; height: 40px; color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); border-radius: 50%; }
.tb-item .tb-item-icone svg { width: 20px; height: 20px; }
.tb-item .tb-item-texto { display: grid; gap: 2px; min-width: 0; }
.tb-item .tb-item-texto b { font-size: 15px; }
.tb-item .tb-item-texto span { font-size: 13px; color: var(--muted); }

/* Botões do Perfil com ícone: o ícone fica à esquerda do rótulo, no mesmo círculo dos menus. */
#view-perfil .perfil-com-icone { display: flex; align-items: center; gap: 12px; text-align: left; }
#view-perfil .perfil-com-icone .tb-item-icone { width: 36px; height: 36px; }
#view-perfil .perfil-com-icone .tb-item-icone svg { width: 18px; height: 18px; }
#view-perfil .perfil-rotulo { display: flex; align-items: center; gap: 12px; min-width: 0; }
#view-perfil .perfil-mapa { justify-content: space-between; }

/* Cartão da galeria de todas as células: filete na borda esquerda na cor da rede e nome da célula embaixo. */
.dc-galeria-rede { border-left: 4px solid var(--rede, var(--line)); }
.dc-galeria-card small { max-width: 100%; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Marcador de membro em risco (alerta pastoral aberto): anel no avatar e ⚠️ no canto inferior esquerdo. */
.dc-galeria-foto { position: relative; display: inline-block; flex: none; border-radius: 50%; }
.dc-galeria-foto.risco-alto .avatar { box-shadow: 0 0 0 3px #dc2626; }
.dc-galeria-foto.risco-leve .avatar { box-shadow: 0 0 0 3px #facc15; }
.dc-galeria-foto .marca-risco { position: absolute; left: -4px; bottom: -4px; font-size: 14px; line-height: 1; padding: 2px; background: var(--card); border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }

/* Zoom da Galeria de Fotos Celular: nome, idade, situação, célula e rede embaixo da foto. */
.zoom-foto-info { position: absolute; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 2px; padding: 12px 14px; text-align: center; color: #fff; background: rgba(15, 18, 26, .85); border-radius: 12px; }
.zoom-foto-info b { font-size: 16px; }
.zoom-foto-info span { font-size: 13px; color: #cbd5e1; }

/* Zoom: lista de alertas pastorais (motivo e anotação) de quem está em risco. Rola se for longa. */
.zoom-foto-info { max-height: 45vh; overflow-y: auto; }
.zoom-foto-risco { display: grid; gap: 8px; margin-top: 6px; }
.zoom-foto-alerta { display: grid; gap: 2px; padding: 8px 10px; text-align: left; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.zoom-foto-alerta.risco-alto { box-shadow: inset 3px 0 0 #dc2626; }
.zoom-foto-alerta.risco-leve { box-shadow: inset 3px 0 0 #facc15; }
.zoom-foto-alerta b { font-size: 13px; color: #fff; }
.zoom-foto-alerta span { font-size: 13px; color: #e2e8f0; white-space: pre-wrap; }

/* Botão ⚠️ ligado (somente em risco): mesmo degradê do botão primário. */
.btn-redondo.on { color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); border-color: transparent; }

/* Pílulas de líder (nível) e anfitrião na frente do nome das listas de membros da célula. */
.pilula-lider, .pilula-anfitriao { display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; line-height: 1.4; border-radius: 999px; border: 1px solid; white-space: nowrap; vertical-align: middle; }
.pilula-lider { color: #bfdbfe; background: rgba(59, 130, 246, .18); border-color: rgba(59, 130, 246, .45); }
.pilula-anfitriao { color: #99f6e4; background: rgba(20, 184, 166, .16); border-color: rgba(20, 184, 166, .45); }
.diario-membro .pilula-lider, .diario-membro .pilula-anfitriao { margin-left: 4px; padding: 1px 6px; font-size: 9px; }
/* Nome com as pílulas de líder e anfitrião numa linha abaixo (Dados da célula e Presença). */
.nome-com-pilulas { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.nome-com-pilulas .pilula-lider, .nome-com-pilulas .pilula-anfitriao { margin-left: 0; }

/* Zoom: informações abaixo da foto, alinhadas à esquerda, em linhas rótulo/valor. */
.zoom-foto-info { text-align: left; }
.zoom-foto-info .zoom-foto-nome { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: #fff; }
.zoom-foto-dados { display: grid; gap: 4px; margin: 0; }
.zoom-foto-linha { display: grid; grid-template-columns: 96px 1fr; gap: 8px; font-size: 14px; }
.zoom-foto-linha dt { color: #94a3b8; }
.zoom-foto-linha dd { margin: 0; color: #f1f5f9; }
.zoom-foto-info .zoom-foto-risco { text-align: left; }

/* Lista de Dados da célula: ⚠️ ao lado do nome da célula em risco. */
.celula-titulo { display: flex; align-items: center; gap: 6px; min-width: 0; }
.celula-titulo b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.celula-risco-icone { flex: none; font-size: 14px; line-height: 1; }

/* Botão voltar (seta) no lugar do ✕ nas telas cheias. */
.np-voltar svg { width: 24px; height: 24px; display: block; }

/* Tela cheia oculta (tela de origem enquanto a seguinte está aberta). */
[hidden].sheet-bg, [hidden].novo-post { display: none !important; }

/* Barra flutuante: ao rolar para cima encolhe ~20% e desce um pouco; ao rolar para baixo volta ao normal. */
.tabbar {
  transform-origin: center bottom;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
#app.app-barra-compacta .tabbar {
  transform: translateZ(0) translateY(8px) scale(.8);
}
@media (prefers-reduced-motion: reduce) {
  .tabbar { transition: none; }
}

/* Blog de roteiros: feed em cards (capa do sermão, ações, comentários). */
.rb-topo { padding: 12px 0 4px; }
.rb-semana { width: 100%; }
.rb-busca { padding: 8px 0; }
.rb-busca[hidden] { display: none; }
.rb-lista { display: grid; gap: 14px; padding: 8px 0 16px; }
.rb-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.rb-capa-wrap { position: relative; aspect-ratio: 16 / 9; background: #0b0d13; }
.rb-capa { width: 100%; height: 100%; object-fit: cover; display: block; }
.rb-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; font-size: 20px; pointer-events: none; }
.rb-capa-vazia { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 14px; }
.rb-corpo { padding: 12px 14px 4px; display: grid; gap: 4px; }
.rb-titulo { font-size: 16px; color: var(--ink); }
.rb-corpo small { color: var(--muted); font-size: 12px; }
.rb-trecho { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rb-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px 12px; }
.rb-acao { background: none; border: 0; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 99px; font: inherit; font-size: 14px; cursor: pointer; }
.rb-acao svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rb-acao.on { color: #ef4444; }
.rb-acao.on svg { fill: #ef4444; stroke: #ef4444; }
.rb-abrir { border: 1px solid var(--line); padding: 6px 12px; }
.rb-assistir { margin-left: auto; font-size: 13px; color: #a5b4fc; text-decoration: none; padding: 6px 8px; }
.rb-sentinela { height: 1px; }
.rb-comentarios { list-style: none; margin: 0; padding: 8px 0; display: grid; gap: 10px; }
.rb-comentario { display: grid; gap: 2px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.rb-comentario b { font-size: 13px; }
.rb-comentario span { font-size: 14px; color: var(--ink); white-space: pre-wrap; }
.rb-comentar { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0 4px; }

/* Células: botão redondo do organograma no cabeçalho roxo (canto direito, centralizado na vertical). */
.header.header-com-acao { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-com-acao > div { min-width: 0; }
.header-acao { flex: none; width: 44px; height: 44px; color: #fff; background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .35); }
.header-acao svg { width: 22px; height: 22px; }

/* Ícone do menu flutuante à esquerda do título do cabeçalho (Células, Supervisão, Discipulado, Guardiões), ocupando a altura das duas linhas (h2 + p). */
.header-com-icone { display: flex; align-items: stretch; gap: 12px; min-width: 0; }
.header-com-icone > div { min-width: 0; align-self: center; }
.header-icone { flex: none; display: block; width: 44px; color: #fff; }
.header-icone svg { display: block; width: 100%; height: 100%; }

/* Organograma em tela cheia: ocupa o corpo da tela, abaixo do cabeçalho com a seta de voltar. */
.sheet-bg.tela-cheia .sheet-corpo.org-corpo { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sheet-bg.tela-cheia .org-corpo { position: relative; }
.sheet-bg.tela-cheia .org-corpo #view-org:not([hidden]) { position: absolute; inset: 0; z-index: auto; display: flex; flex-direction: column; }
/* Organograma: a barra de controles fica encostada no topo (0,0) da área, de borda a borda. */
.sheet-bg.tela-cheia .org-corpo #view-org .orgbar { top: 0; left: 0; right: 0; border-radius: 0; border-width: 0 0 1px; }

/* Guardiões: caixa de avatares no topo (0,0, respeitando a barra de status), card de título, filtro e lista de membros. */
#view-guardioes { padding-top: env(safe-area-inset-top); }
#view-guardioes .gd-avatares .stories { margin: 0; padding-top: 0; }
.gd-filtro { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; font-weight: 600; color: var(--ink); }
.gd-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.gd-linha { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; user-select: none; -webkit-user-select: none; }
/* Primeira linha da lista de guardiões: tamanho ajustado no editor visual (2026-11-10). */
#view-guardioes .gd-lista > li.gd-linha:first-child { height: 70.95px; }
.gdp-topo .gdp-icone { width: 1em; height: 1em; vertical-align: -0.125em; margin-right: 0.3em; display: inline-block; }
.gd-foto { flex: none; position: relative; }
.gd-av { width: 44px; height: 44px; }
.gd-texto { display: grid; gap: 2px; min-width: 0; }
.gd-texto b { font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-texto span { font-size: 13px; color: var(--muted); }
.gd-ficha { display: grid; gap: 14px; justify-items: center; }
.gd-ficha-av { width: 96px; height: 96px; }
.gd-ficha dl { width: 100%; margin: 0; display: grid; gap: 8px; }
.gd-ficha dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gd-ficha dt { color: var(--muted); font-size: 13px; }
.gd-ficha dd { margin: 0; color: var(--ink); font-size: 14px; text-align: right; }

/* Ficha do membro (abas): topo com foto, badges, listas de dados e linha do tempo. */
.ficha-abas { margin-bottom: 14px; }
.ficha-painel[hidden] { display: none; }
.ficha-topo { display: flex; align-items: center; gap: 14px; }
.ficha-topo b { display: block; font-size: 17px; color: var(--ink); }
.ficha-topo span { font-size: 13px; color: var(--muted); }
.ficha-topo .gd-ficha-av { width: 72px; height: 72px; flex: none; }
.ficha-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.ficha-badges span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.ficha-titulo { margin: 18px 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ficha-dl { margin: 0; display: grid; gap: 0; }
.ficha-dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ficha-dl dt { color: var(--muted); font-size: 13px; }
.ficha-dl dd { margin: 0; color: var(--ink); font-size: 14px; text-align: right; }
.ficha-item { display: grid; gap: 2px; padding: 10px 12px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ficha-item b { font-size: 14px; color: var(--ink); }
.ficha-item span { font-size: 13px; color: var(--muted); }
.ficha-linha { list-style: none; margin: 0; padding: 0 0 0 4px; border-left: 2px solid var(--line); display: grid; gap: 12px; }
.ficha-linha li { display: grid; gap: 2px; padding-left: 14px; position: relative; }
.ficha-linha li::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #667eea; }
.ficha-linha b { font-size: 14px; color: var(--ink); }
.ficha-linha span { font-size: 13px; color: var(--muted); }
.ficha-data { font-size: 12px; color: var(--muted); }
/* Familiar ligado a um membro: foto à esquerda; o duplo toque abre a ficha dele. */
.ficha-familiar { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.ficha-familiar > div { display: grid; gap: 2px; min-width: 0; }
.ficha-familiar .ficha-zoom { flex: none; }

/* Guardiões: botão de rede à esquerda e o rótulo "Cuidados especiais" com o interruptor à direita. */
.gd-filtro .gd-filtro-rotulo { margin-left: auto; }

/* Ficha: cabeçalho do membro acima das abas, e a barra de abas presa ao topo da folha ao rolar. */
.ficha-cabeca { margin-bottom: 10px; }
.ficha-abas { position: sticky; top: -16px; z-index: 2; background: var(--card); padding: 8px 0 10px; margin-bottom: 4px; }

/* Guardiões: botão de busca do membro à direita do interruptor. */
.gd-filtro .gd-buscar { flex: none; width: 40px; height: 40px; }
.gd-filtro .gd-buscar svg { width: 18px; height: 18px; }

/* Guardiões: campo de busca com o X para apagar o termo. */
.gd-busca { position: relative; margin: 0 0 12px; }
.gd-busca[hidden] { display: none; }
.gd-busca .tb-busca { width: 100%; margin: 0; padding-right: 48px; box-sizing: border-box; }
.gd-busca-limpar { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; box-sizing: border-box; }
.gd-busca-limpar[hidden] { display: none; }

/* Guardiões: o botão de rede fica no fluxo da linha de filtro (o estilo padrão é absoluto, do cabeçalho do Início). */
.gd-filtro .rede-filtro { position: static; top: auto; right: auto; flex: none; }
/* Guardiões: barra de avatares fixa no topo ao rolar a página. */
#view-guardioes .gd-avatares { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-bottom: 6px; }

/* Ficha: a foto do membro amplia ao toque (mesmo zoom das galerias). */
.ficha-zoom { flex: none; padding: 0; background: none; border: 0; border-radius: 50%; cursor: zoom-in; }
.ficha-zoom .avatar { display: block; }

/* Guardiões: barra de avatares fixa no topo, igual à Supervisão e ao Discipulado (.ag-barra). Substitui o sticky anterior. */
#view-guardioes { padding-top: calc(100px + env(safe-area-inset-top) + 16px); }
#view-guardioes .gd-avatares { position: fixed; top: 0; left: 0; right: 0; z-index: 5; box-sizing: border-box; height: calc(100px + env(safe-area-inset-top)); padding: calc(6px + env(safe-area-inset-top)) 16px 0; background: #0f121a; border-bottom: 1px solid var(--line); }
#view-guardioes .gd-avatares .stories { padding-top: 2px; padding-bottom: 4px; }

/* Guardiões: o "⋯" de rede fica no canto direito da barra de avatares (como no Início); os avatares não passam por baixo dele. */
/* Guardiões: a faixa de avatares usa o mesmo vidro desfocado do Início (.stories-linha), com o degradê da rede. */
#view-guardioes .gd-avatares .stories-linha { height: 100%; }

/* Guardiões: botão redondo do contato do guardião, metade para fora do item da lista. */
.gd-lista .gd-linha { position: relative; margin-right: 22px; }
.gd-contato { position: absolute; right: -22px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.gd-contato svg { width: 20px; height: 20px; }
.gd-contato-topo { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.gd-contato-topo b { display: block; font-size: 16px; color: var(--ink); }
.gd-contato-topo span { font-size: 13px; color: var(--muted); }

/* Guardiões: quantidade de membros filtrados, à esquerda do interruptor. */
.gd-contagem { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* Guardiões: a quantidade fica antes do rótulo "Cuidados especiais", em roxo; o grupo fica à direita. */
.gd-filtro .gd-filtro-rotulo { margin-left: 0; }
.gd-contagem { margin-left: auto; color: #8f96ff; }

/* Contato do guardião: avatar com tamanho fixo (não achata no flex) e zoom ao toque. */
.gd-contato-topo .gd-ficha-av { width: 72px; height: 72px; flex: none; }
.gd-contato-topo .ficha-zoom { flex: none; }

/* Roteiro da semana: índice fixo no topo da página, com um botão por seção (rola até o cartão). */
.roteiro-pagina .roteiro-indice { position: sticky; top: 0; z-index: 3; align-self: start; display: flex; gap: 6px; margin: 0 -14px; padding: 8px 14px; min-height: 48px; box-sizing: border-box; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: #0f121a; border-bottom: 1px solid var(--line); }
.roteiro-pagina .roteiro-indice::-webkit-scrollbar { display: none; }
.roteiro-indice-item { flex: none; padding: 6px 12px; font-size: 13px; }

/* Cabeçalho da seção: título à esquerda e Recolher/Expandir sempre à direita, na mesma linha. */
.roteiro-cabecalho { flex-wrap: nowrap; }
.roteiro-cabecalho h3 { flex: 1; min-width: 0; }
.roteiro-cabecalho > .roteiro-pill { flex: none; }
.roteiro-acoes { margin-top: 10px; }

/* Títulos com ícone (Células, Supervisão, Discipulado, Guardiões): ícone à esquerda, preso dentro do card.
   Ao abrir, começa grande (cortado pelo card) e diminui até 200%, em 1,8 s. */
.cabecalho-icone { overflow: hidden; padding-left: 36px; }
.cabecalho-icone .header-com-icone { align-items: center; min-height: 88px; }
.cabecalho-icone .header-icone { width: 44px; height: 44px; margin: 0 22px; align-self: center; overflow: visible; }
.cabecalho-icone .header-icone svg { transform: scale(2) rotate(-8deg); transform-origin: center; animation: cabecalho-icone-entrada 1800ms cubic-bezier(.25, .8, .25, 1) both; }
@keyframes cabecalho-icone-entrada {
  from { transform: scale(4) rotate(-22deg); opacity: 0; }
  to { transform: scale(2) rotate(-8deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cabecalho-icone .header-icone svg { animation: none; }
}

/* Campos de busca nativos (type="search"): o X de limpar fica centralizado no campo, em círculo, e apaga o termo. */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  border-radius: 50%;
  background: #a0a6b8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='%230f121a' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
  cursor: pointer;
}
/* Botões X já existentes (chat e dashboard): centralizados no círculo. */
.chat-busca-limpar, .dash-busca-limpar { display: flex; align-items: center; justify-content: center; }
.chat-busca-limpar { line-height: 0; }

/* Itens excluídos (supervisão, discipulado e reunião): selo discreto que o pastor presidente vê. */
.selo-excluido { display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 999px; background: #b8172a; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle; }

/* OS GUARDIÕES: painel do guardião (guardiao.js). Cores do tema do app (variáveis), sem cores de outros projetos. */
.gdp-host { margin: 0 0 14px; }
.gdp { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.gdp-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gdp-topo b { display: block; color: var(--ink); }
.gdp-topo span { color: var(--muted); font-size: 13px; }
.gdp-botao { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.gdp-botao:disabled { opacity: .6; cursor: default; }
.gdp-principal { background: var(--ink); color: var(--card); border-color: transparent; }
.gdp-resumo { display: flex; gap: 14px; margin: 12px 0 4px; color: var(--muted); font-size: 14px; }
.gdp-resumo b { color: var(--ink); font-size: 18px; }
.gdp-alerta b { color: #b8172a; }
.gdp-titulo { margin: 14px 0 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.gdp-lista { list-style: none; margin: 0; padding: 0; }
.gdp-linha { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 4px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.gdp-linha span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gdp-linha small, .gdp-linha-simples small { color: var(--muted); font-size: 13px; }
.gdp-linha b, .gdp-linha-simples b { font-size: 15px; }
.gdp-linha-simples { padding: 9px 4px; border-top: 1px solid var(--line); }
.gdp-linha-simples p { margin: 4px 0 0; font-size: 14px; }
.gdp-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.gdp-av-inicial { display: inline-flex; align-items: center; justify-content: center; background: var(--line); color: var(--ink); font-weight: 700; }
.gdp-tag { font-style: normal; font-size: 12px; color: #b8172a; font-weight: 600; }
.gdp-vazio, .gdp-aviso { color: var(--muted); font-size: 13px; margin: 6px 0; }
.gdp-ficha-topo { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.gdp-ficha-topo b { display: block; color: var(--ink); font-size: 17px; }
.gdp-ficha-topo span { color: var(--muted); font-size: 13px; }
.gdp-dados { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; font-size: 14px; }
.gdp-dados dt { color: var(--muted); }
.gdp-dados dd { margin: 0; color: var(--ink); }
.gdp-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.gdp-form { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 24px; }
.gdp-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink); }
.gdp-form label small { color: var(--muted); font-weight: 400; }
.gdp-form select, .gdp-form input, .gdp-form textarea { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.gdp-form .gdp-marcar { flex-direction: row; align-items: center; gap: 8px; }
.gdp-form .gdp-marcar input { width: auto; }
.gdp-linha .gdp-av { flex: none; width: 44px; height: 44px; display: block; }
.gdp-linha .gdp-av-inicial { display: flex; align-items: center; justify-content: center; }
.gdp-busca-caixa { position: relative; margin: 8px 0; }
.gdp-busca-caixa .gdp-busca { width: 100%; box-sizing: border-box; min-height: 42px; padding: 0 84px 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
.gdp-busca-x, .gdp-busca-lupa { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 20px; line-height: 1; }
.gdp-busca-x { right: 40px; }
.gdp-busca-x[hidden] { display: none; }
.gdp-busca-lupa { right: 4px; }
.gdp-busca-lupa svg { width: 18px; height: 18px; display: block; flex: none; }
.gdp-busca-caixa .gdp-busca::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.gdp-lupa { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: none; }
.gdp-lupa svg { width: 18px; height: 18px; display: block; }
.gdp-so-x .gdp-busca { padding-right: 44px; }
.gdp-so-x .gdp-busca-x { right: 6px; }


/* Esqueleto de carregamento das listas: blocos com brilho suave (desliga com movimento reduzido). */
.esqueleto-item { display: flex; align-items: center; gap: 12px; padding: 12px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.esqueleto-av { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--line); }
.esqueleto-linhas { display: grid; gap: 8px; flex: 1; min-width: 0; }
.esqueleto-linhas span { display: block; height: 12px; border-radius: 6px; background: var(--line); }
.esqueleto-linhas span:first-child { width: 60%; }
.esqueleto-linhas span:last-child { width: 40%; }
.esqueleto-av, .esqueleto-linhas span { background: linear-gradient(90deg, var(--line) 25%, #3a4157 50%, var(--line) 75%); background-size: 200% 100%; animation: esqueleto-brilho 1.4s ease-in-out infinite; }
@keyframes esqueleto-brilho { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .esqueleto-av, .esqueleto-linhas span { animation: none; } }

/* Linha do tempo da ficha: ícone no lugar do ponto (mesmos ícones da linha do tempo do React). */
.ficha-linha li.tem-ico::before { display: none; }
.ficha-linha .ficha-ico { position: absolute; left: -13px; top: -2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #667eea; border: 1.5px solid #667eea; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.ficha-linha .ficha-ico svg { width: 14px; height: 14px; }
.ficha-linha li.tem-ico { padding-left: 22px; }

/* VemSerIgreja: Home (feed público) */
.vsi-page { padding: 16px; max-width: 640px; margin: 0 auto; }
.vsi-page h2 { margin: 8px 0 12px; }
.vsi-post { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.vsi-post-autor { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.vsi-post-autor img, .vsi-post-inicial { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #1f2937; color: #e5e7eb; font-weight: 700; }
.vsi-post-autor small { display: block; opacity: 0.7; font-size: 0.78rem; }
.vsi-post h3 { margin: 6px 0; font-size: 1.05rem; }
.vsi-post-foto { width: 100%; border-radius: 12px; margin: 6px 0; }
.vsi-post p { white-space: pre-line; margin: 6px 0; }
.vsi-post-rodape { display: flex; gap: 14px; font-size: 0.8rem; opacity: 0.7; margin-top: 8px; }

/* VemSerIgreja: ações do post e folha de comentários */
.vsi-post-acoes { display: flex; gap: 8px; margin-top: 10px; }
.vsi-acao { background: transparent; border: 0; color: #9ca3af; border-radius: 99px; padding: 6px 10px; font-size: 20px; line-height: 1; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.vsi-acao span { font-size: 20px; }
.vsi-acao:active { background: rgba(255,255,255,0.06); }
.vsi-acao.on { color: #f43f5e; }
.vsi-acao:disabled { opacity: 0.6; }
.vsi-folha { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.vsi-folha-caixa { background: #111827; width: 100%; max-width: 640px; max-height: 80vh; border-radius: 18px 18px 0 0; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.vsi-folha-caixa header { display: flex; justify-content: space-between; align-items: center; }
.vsi-folha-fechar { background: none; border: 0; color: inherit; font-size: 1.4rem; cursor: pointer; }
.vsi-folha-lista { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.vsi-comentario { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.vsi-comentario small { opacity: 0.6; }
.vsi-comentario p { margin: 4px 0 0; white-space: pre-line; }
.vsi-comentario.minha b { color: #5eead4; }
.vsi-folha-form { display: flex; gap: 8px; align-items: flex-end; }
.vsi-folha-form textarea { flex: 1; resize: none; border-radius: 12px; padding: 8px; }

/* VemSerIgreja: aba Células (lista pública com busca) */
.vsi-cel-busca { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05); color: inherit; margin-bottom: 12px; }
.vsi-cel-lista { list-style: none; margin: 0; padding: 0; }
.vsi-cel-item { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.vsi-cel-item small { opacity: 0.7; font-size: 1rem; }
.vsi-cel-item > b { font-size: 1.25rem; }
.vsi-cel-whats { display: inline-block; margin-top: 6px; color: #25D366; font-weight: 600; font-size: 1.0625rem; text-decoration: none; }
.vsi-cel-busca-caixa { position: relative; margin-bottom: 12px; }
.vsi-cel-busca-caixa .vsi-cel-busca { margin-bottom: 0; padding-right: 44px; }
.vsi-cel-limpar { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.14); color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.vsi-cel-info { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 1.0625rem; opacity: 0.9; margin-top: 2px; }
.vsi-cel-bairro { color: #5eead4; font-weight: 700; font-size: 1.1875rem; opacity: 1; }
.vsi-cel-item { position: relative; }
.vsi-cel-item.tem-kids > b { padding-right: 90px; }
.vsi-cel-kids { display: inline-block; width: auto; padding: 4px 10px; border-radius: 999px; background: #7c3aed; color: #fff; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.vsi-cel-whats { display: inline-flex; align-items: center; gap: 6px; }
.vsi-cel-whats-icone { width: 1.2em; height: 1.2em; flex: 0 0 auto; }

.vsi-cel-grupo { display: inline-block; width: auto; padding: 4px 10px; border-radius: 999px; background: #fff; color: #4c1d95; font-size: 0.85rem; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; }
.vsi-cel-item.tem-grupo > b { padding-right: 90px; }

.vsi-cel-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.vsi-cel-filtro { padding: 6px 14px; border-radius: 999px; border: 1px solid transparent; font-size: 0.95rem; font-weight: 800; cursor: pointer; opacity: 0.6; }
.vsi-cel-filtro[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 3px #5eead4; }
.vsi-cel-filtro[data-vsi-cel-filtro="kids"] { background: #7c3aed; color: #fff; }
.vsi-cel-filtro[data-vsi-cel-filtro="base"], .vsi-cel-filtro[data-vsi-cel-filtro="beone"] { background: #fff; color: #4c1d95; }

/* Badges do canto superior direito: empilhados quando a célula tem KIDS e grupo (Base/BeOne). */
.vsi-cel-tags { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.vsi-cel-item.tem-badges > b, .vsi-cel-item.tem-badges > small { padding-right: 90px; }

/* Barra principal: ícones maiores e nome embaixo de cada um. */
#tabbar-principal { height: auto; min-height: var(--tab); padding: 8px 10px; }
#tabbar-principal button { width: 72px; height: auto; padding: 6px 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
#tabbar-principal button svg { width: 30px; height: 30px; }
#tabbar-principal .tab-rotulo { font-size: .72rem; font-weight: 600; line-height: 1; white-space: nowrap; }

/* Aba selecionada na barra principal: roxo mais claro. */
#tabbar-principal button.on { color: #a78bfa; }

/* Barra fixa do topo: logo da igreja e nome, sempre na frente do conteúdo.
   A altura mínima de 44px abaixa a barra para fora da barra de status do iPhone, mesmo quando o env() vem zerado. */
:root { --vsi-topo-topo: max(env(safe-area-inset-top, 0px), 60px); }
.vsi-topo {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: calc(var(--vsi-topo-topo) + 68px);
  padding: var(--vsi-topo-topo) 16px 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 18, 26, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #f3f4f8;
  font-size: 1.05rem;
  font-weight: 700;
}
.vsi-topo img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
#app { padding-top: calc(var(--vsi-topo-topo) + 68px); }

/* Botão de conta no topo: placeholder de usuário ou foto do usuário logado. */
.vsi-conta { margin-left: auto; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; padding: 0; border: 1px solid rgba(255, 255, 255, .25); background: #1d2230; color: #c9cde0; display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.vsi-conta svg { width: 26px; height: 26px; }
.vsi-conta img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Com a barra fixa do topo, o conteúdo já começa abaixo dela: tira o recuo extra da área segura das telas. */
#app > .view { padding-top: 4px; }
#app .home-feed { padding-top: 4px; }

/* Cinco abas: botões um pouco mais estreitos para caber em telas de 375 px. */
#tabbar-principal button { width: 64px; }

/* Ao vivo: faixas horizontais de vídeos e playlists do canal do YouTube. */
.vsi-yt-titulo { margin: 22px 0 10px; font-size: 1.15rem; font-weight: 800; }
.vsi-yt-faixa { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.vsi-yt-card { flex: 0 0 230px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; text-align: left; background: none; border: 0; padding: 0; color: inherit; text-decoration: none; cursor: pointer; }
.vsi-yt-capa { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #1d2230; }
.vsi-yt-capa img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vsi-yt-play { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; background: #7c3aed; color: #fff; display: grid; place-items: center; font-size: 14px; }
.vsi-yt-aovivo { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: #dc2626; color: #fff; font-size: .72rem; font-weight: 800; }
.vsi-yt-card b { font-size: 1rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vsi-yt-card small { color: #a78bfa; font-size: .95rem; font-weight: 700; }

/* Todos os vídeos: busca, ordenação, grade e lista. */
.vsi-yt-contagem { font-size: .85rem; color: #9aa3b8; font-weight: 600; margin-left: 6px; }
.vsi-yt-controles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 14px; }
.vsi-yt-busca { flex: 1 1 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid #2d3345; background: #141824; color: #e8eaf2; font: inherit; font-size: 16px; }
.vsi-yt-ordem { flex: 1 1 auto; padding: 8px 10px; border-radius: 10px; border: 1px solid #2d3345; background: #141824; color: #e8eaf2; font: inherit; font-size: 15px; }
.vsi-yt-visoes { display: flex; gap: 6px; }
.vsi-yt-visoes button { padding: 8px 12px; border-radius: 999px; border: 1px solid #2d3345; background: #141824; color: #c9cde0; font-weight: 700; font-size: .9rem; cursor: pointer; }
.vsi-yt-visoes button[aria-pressed="true"] { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.vsi-yt-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.vsi-yt-grade .vsi-yt-card { flex: none; width: auto; }
.vsi-yt-lista-todos { display: flex; flex-direction: column; gap: 12px; }
.vsi-yt-linha { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.vsi-yt-linha .vsi-yt-capa { flex: 0 0 120px; }
.vsi-yt-linha-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vsi-yt-linha-txt b { font-size: .98rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vsi-yt-linha-txt small { color: #9aa3b8; font-size: .85rem; }
@media (min-width: 700px) { .vsi-yt-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Filtro por dia de encontro (SEG a SÁB): chips menores, em grupo próprio abaixo dos de grupo. */
.vsi-cel-dia { padding: 5px 12px; border-radius: 999px; border: 1px solid #2d3345; background: #1d2230; color: #c9cde0; font-size: 0.85rem; font-weight: 800; cursor: pointer; }
.vsi-cel-dia[aria-pressed="true"] { background: #5eead4; border-color: #5eead4; color: #0f121a; }

/* Botões de visualização com ícone: grade e lista. */
.vsi-yt-visoes button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: #6b7280; }
.vsi-yt-visoes button[aria-pressed="true"] { background: rgba(192, 132, 252, .14); border: 0; color: #c084fc; }
.vsi-yt-visoes svg { width: 22px; height: 22px; fill: currentColor; }
.vsi-yt-visoes svg path { fill: none; stroke: currentColor; }

/* Transmissão ao vivo agora: aviso no topo da aba com o vídeo embutido. */
.vsi-yt-aovivo-box { margin: 6px 0 18px; padding: 12px; border-radius: 16px; background: #1a1020; border: 1px solid rgba(220, 38, 38, .45); }
.vsi-yt-aovivo-selo { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #dc2626; color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .03em; }
.vsi-yt-aovivo-titulo { display: block; margin-top: 8px; font-size: 1.05rem; line-height: 1.25; }
.vsi-yt-embed { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; margin: 10px 0; background: #000; }
.vsi-yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vsi-yt-aovivo-link { color: #c084fc; font-weight: 700; text-decoration: none; }

/* Transmissão no ar: o ícone da aba Ao vivo fica vermelho e pulsa. Fora disso, cor padrão da aba. */
#tabbar-principal button[data-go="aovivo"].vsi-aovivo-agora svg { color: #ef4444; animation: vsiPulsoAoVivo 1.4s ease-in-out infinite; }
@keyframes vsiPulsoAoVivo {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(239, 68, 68, 0)); }
  50% { transform: scale(1.18); filter: drop-shadow(0 0 6px rgba(239, 68, 68, .9)); }
}
@media (prefers-reduced-motion: reduce) {
  #tabbar-principal button[data-go="aovivo"].vsi-aovivo-agora svg { animation: none; }
}

/* Aba selecionada: só muda a cor do ícone, sem o fundo oval. */
#tabbar-principal button.on { background: transparent; }

/* Botão Carregar mais da lista de todos os vídeos. */
.vsi-yt-mais-area { display: flex; justify-content: center; margin-top: 16px; }
.vsi-yt-mais { background: none; border: 0; color: #c084fc; font: inherit; font-weight: 700; font-size: 1rem; padding: 10px 14px; cursor: pointer; text-decoration: underline; }

/* Esqueletos de carregamento: blocos cinza que pulsam no lugar do conteúdo. */
.vsi-esq-bloco { display: block; background: linear-gradient(90deg, #1d2230 25%, #2a3144 50%, #1d2230 75%); background-size: 200% 100%; border-radius: 8px; animation: vsiEsq 1.2s ease-in-out infinite; }
@keyframes vsiEsq { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.vsi-esq-capa { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; }
.vsi-esq-linha { height: 14px; width: 100%; margin: 6px 0; }
.vsi-esq-linha.curta { width: 60%; }
.vsi-esq-card { display: flex; flex-direction: column; gap: 6px; flex: 0 0 230px; }
.vsi-yt-grade .vsi-esq-card { flex: none; }
.vsi-esq-faixa { display: flex; gap: 12px; overflow: hidden; }
.vsi-esq-celula { list-style: none; padding: 14px 16px; margin-bottom: 12px; border: 1px solid #2d3345; border-radius: 16px; background: #171b26; display: flex; flex-direction: column; gap: 6px; }
.vsi-esq-celula .vsi-esq-linha { margin: 0; height: 16px; }
.vsi-esq-post { padding: 14px; margin-bottom: 14px; border-radius: 16px; background: #171b26; border: 1px solid #2d3345; display: flex; flex-direction: column; gap: 8px; }
.vsi-esq-avatar { width: 40px; height: 40px; border-radius: 50%; }
.vsi-esq-foto { width: 100%; height: 200px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .vsi-esq-bloco { animation: none; } }

/* Início: saudação, alternador grade/feed, grade de quadros e cartão só com texto */
.vsi-feed-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.vsi-feed-topo h2 { margin: 0; }
.vsi-feed-visoes { display: flex; gap: 6px; flex-shrink: 0; }
.vsi-feed-visoes button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: #6b7280; cursor: pointer; }
.vsi-feed-visoes button svg { width: 26px; height: 26px; fill: currentColor; }
.vsi-feed-visoes button[aria-pressed="true"] { color: #a78bfa; }
[data-vsi-feed-grade][hidden], [data-vsi-feed-lista][hidden] { display: none !important; }
.vsi-feed-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 700px) { .vsi-feed-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vsi-feed-quadro { position: relative; aspect-ratio: 1 / 1; border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: #171b26; cursor: pointer; text-align: left; color: #fff; }
.vsi-feed-quadro img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vsi-feed-legenda { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: .8rem; font-weight: 700; line-height: 1.2; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vsi-feed-texto { display: flex; flex-direction: column; justify-content: space-between; padding: 12px; background: linear-gradient(160deg, #7c3aed, #4c1d95); }
.vsi-feed-texto-corpo { font-size: .95rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.vsi-feed-autor { font-size: .75rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsi-post { scroll-margin-top: calc(max(env(safe-area-inset-top, 0px), 60px) + 84px); }

/* Ícones grade/feed na barra superior, ao lado do avatar */
.vsi-topo-visoes { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.vsi-topo-visoes[hidden] { display: none; }
.vsi-topo-visoes button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: #6b7280; cursor: pointer; }
.vsi-topo-visoes button svg { width: 24px; height: 24px; fill: currentColor; }
.vsi-topo-visoes button[aria-pressed="true"] { color: #a78bfa; }
.vsi-topo .vsi-conta { margin-left: auto; }
.vsi-topo-visoes:not([hidden]) + .vsi-conta { margin-left: 4px; }

/* Agenda da igreja: topo, cards, destaque pulsando e formulário do evento. */
.vsi-ag-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.vsi-ag-topo h2 { margin: 0; }
.vsi-ag-lista, .vsi-ag-destaques { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.vsi-ag-destaques { margin: 0 0 14px; }
.vsi-ag-card { position: relative; background: #181c27; border: 1px solid #2d3345; border-radius: 16px; overflow: hidden; }
.vsi-ag-card img { display: block; width: 100%; max-height: 220px; object-fit: cover; background: #0f121a; }
.vsi-ag-corpo { padding: 12px 14px 14px; display: grid; gap: 6px; }
.vsi-ag-corpo b { font-size: 1.15rem; line-height: 1.25; }
.vsi-ag-corpo small { color: #aab0c4; font-size: 1rem; }
.vsi-ag-corpo p { margin: 0; color: #d6d9e6; white-space: pre-line; }
.vsi-ag-selo { justify-self: start; background: #5eead4; color: #0f121a; font-size: .75rem; font-weight: 800; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; }
.vsi-ag-editar { justify-self: start; margin-top: 4px; background: transparent; color: #a78bfa; border: 1px solid #a78bfa; border-radius: 999px; padding: 6px 14px; font-weight: 700; cursor: pointer; }
.vsi-ag-card.destaque { border-color: #5eead4; animation: vsi-pulsa 1.8s ease-out infinite; }
@keyframes vsi-pulsa {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, .55); }
  50% { box-shadow: 0 0 0 10px rgba(94, 234, 212, 0); }
}
@media (prefers-reduced-motion: reduce) { .vsi-ag-card.destaque { animation: none; } }
.vsi-ag-folha { max-height: 92vh; overflow-y: auto; }
.vsi-ag-form { display: grid; gap: 12px; }
.vsi-ag-form label { display: grid; gap: 6px; font-weight: 600; color: #c9cde0; }
.vsi-ag-form input:not([type="checkbox"]):not([type="file"]), .vsi-ag-form textarea { font: inherit; font-size: 16px; color: #e8eaf2; background: #141824; border: 1px solid #2d3345; border-radius: 12px; padding: 10px 12px; }
.vsi-ag-imagem { display: grid; gap: 8px; }
.vsi-ag-imagem img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; }
.vsi-ag-switch { display: flex !important; align-items: center; gap: 10px; position: relative; cursor: pointer; }
.vsi-ag-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vsi-ag-switch .trilho { position: relative; width: 46px; height: 28px; border-radius: 99px; background: #3a3f4f; flex: 0 0 auto; transition: background .2s; }
.vsi-ag-switch .trilho::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.vsi-ag-switch input:checked + .trilho { background: #34c759; }
.vsi-ag-switch input:checked + .trilho::after { transform: translateX(18px); }
.vsi-ag-erro { margin: 0; color: #fca5a5; font-weight: 600; }
.vsi-ag-acoes { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.vsi-ag-excluir { background: transparent; color: #fca5a5; border: 1px solid #fca5a5; border-radius: 999px; padding: 8px 14px; font-weight: 700; cursor: pointer; }

/* Formulário do evento cabe na folha (sem cortar à direita). */
.vsi-ag-folha { width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; box-sizing: border-box; }
.vsi-ag-form, .vsi-ag-form label, .vsi-ag-imagem { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.vsi-ag-form input:not([type="checkbox"]):not([type="file"]), .vsi-ag-form textarea { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; display: block; }
.vsi-ag-form input[type="date"], .vsi-ag-form input[type="time"], .vsi-ag-form input[type="datetime-local"] { -webkit-appearance: none; appearance: none; min-height: 44px; }
.vsi-ag-form input[type="file"] { width: 100%; max-width: 100%; }
/* Detalhe do evento dentro da Agenda, e cards clicáveis na Home. */
.vsi-ag-clicavel { cursor: pointer; }
.vsi-ag-detalhe img { max-height: 320px; }

/* Folhas do VemSerIgreja: a rolagem fica dentro da folha, sem puxar a página. */
.vsi-folha { overscroll-behavior: contain; touch-action: pan-y; }
.vsi-folha-caixa { overscroll-behavior: contain; }

/* Imagem do evento sempre 2:1: cards, detalhe e prévia do formulário. */
.vsi-ag-card img, .vsi-ag-detalhe img, .vsi-ag-imagem img { max-height: none; width: 100%; aspect-ratio: 2 / 1; height: auto; object-fit: cover; }
/* Tela de recorte 2:1 (por cima do formulário). */
.vsi-recorte-bg { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 16px; box-sizing: border-box; touch-action: none; }
.vsi-recorte-dica { margin: 0 auto; max-width: 560px; color: #c9cde0; text-align: center; }
.vsi-recorte-janela { position: relative; width: 100%; max-width: 560px; aspect-ratio: 2 / 1; margin: 0 auto; overflow: hidden; border-radius: 12px; border: 2px solid #5eead4; background: #000; touch-action: none; cursor: grab; }
.vsi-recorte-janela img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.vsi-recorte-zoom { display: grid; gap: 6px; width: 100%; max-width: 560px; margin: 0 auto; color: #c9cde0; font-weight: 600; }
.vsi-recorte-aviso { margin: 0 auto; max-width: 560px; color: #fbbf24; font-weight: 600; text-align: center; }
.vsi-recorte-acoes { display: flex; justify-content: space-between; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; }
.vsi-recorte-acoes button { flex: 1; min-height: 46px; border-radius: 999px; font-weight: 700; cursor: pointer; }
.vsi-recorte-cancelar { background: transparent; color: #e8eaf2; border: 1px solid #3a3f4f; }

/* Descrição do evento: formatação do WhatsApp (negrito, itálico, riscado, código e citação). */
.vsi-ag-corpo p b { color: #fff; }
.vsi-ag-corpo p code { font-family: ui-monospace, Menlo, monospace; background: #0f121a; border-radius: 6px; padding: 1px 5px; }
.vsi-ag-corpo p blockquote { margin: 6px 0; padding: 2px 0 2px 10px; border-left: 3px solid #5eead4; color: #c9cde0; }

/* Descrição do evento: texto do mesmo tamanho do corpo; citação (>) compacta, com barra à esquerda. */
.vsi-ag-texto { font-size: 1rem; line-height: 1.45; color: #d6d9e6; overflow-wrap: anywhere; }
.vsi-ag-texto blockquote { display: block; margin: 6px 0; padding: 2px 0 2px 10px; border-left: 3px solid #5eead4; color: #c9cde0; font-size: inherit; line-height: inherit; }
.vsi-ag-texto b { color: #fff; }

.vsi-ag-linha { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; background: #181c27; border: 1px solid #2d3345; border-radius: 14px; padding: 8px; cursor: pointer; list-style: none; }
.vsi-ag-linha.destaque { border-color: #5eead4; }
.vsi-ag-linha img, .vsi-ag-linha-sem-foto { width: 96px; aspect-ratio: 2 / 1; height: auto; object-fit: cover; border-radius: 10px; background: #0f121a; display: grid; place-items: center; }
.vsi-ag-linha > div { display: grid; gap: 4px; min-width: 0; }
.vsi-ag-linha b { font-size: 1rem; line-height: 1.25; }
.vsi-ag-linha small { color: #aab0c4; }
.vsi-ag-linha .vsi-ag-selo { justify-self: start; }

/* Agenda: Novo evento, Post e Lista como ícones na mesma linha do título. */
.vsi-ag-icones { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.vsi-ag-icones button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: #6b7280; cursor: pointer; }
.vsi-ag-icones button[hidden] { display: none; }
.vsi-ag-icones button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.vsi-ag-icones button[aria-pressed="true"] { color: #a78bfa; }
.vsi-ag-icones button[data-vsi-evento-novo] { color: #a78bfa; }

/* Botão voltar: seta branca em círculo escuro, igual em todo o app (telas cheias, chat, perfil, agenda). */
.vsi-voltar, .np-voltar, .chat-voltar {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 40px; height: 40px; min-width: 40px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: #4b2a73; color: #fff; cursor: pointer;
  font-size: 0; line-height: 0; text-decoration: none;
}
.vsi-voltar svg, .np-voltar svg, .chat-voltar svg { width: 22px; height: 22px; display: block; }

/* Evento na linha do tempo do feed: selos, data e destaque pulsando (mesmo pulso da Agenda). */
.vsi-evento-feed { border-color: #2d3345; }
.vsi-evento-feed.destaque { border-color: #5eead4; animation: vsi-pulsa 1.8s ease-out infinite; }
.vsi-evento-feed h3 { margin: 6px 0 4px; }
.vsi-evento-selos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.vsi-evento-data { display: block; color: #aab0c4; margin: 4px 0 6px; }
.vsi-feed-evento.destaque { border-color: #5eead4; }
@media (prefers-reduced-motion: reduce) { .vsi-evento-feed.destaque { animation: none; } }

/* Agenda em Post: card recolhido até data e hora; "Expandir" mostra a descrição. */
.vsi-ag-expandir { justify-self: start; background: none; border: 0; padding: 4px 0; color: #a78bfa; font-weight: 700; cursor: pointer; }
.vsi-ag-editar-icone { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid #a78bfa; border-radius: 999px; background: rgba(15, 18, 26, 0.78); color: #a78bfa; cursor: pointer; }
.vsi-ag-editar-icone svg { width: 18px; height: 18px; }

/* Horários de culto: card fixo no topo da Home. */
.vsi-cultos { margin: 4px 0 14px; padding: 14px 16px; background: #181c27; border: 1px solid #2d3345; border-radius: 16px; }
.vsi-cultos-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.vsi-cultos-topo b { font-size: 1rem; }
.vsi-cultos-novo, .vsi-cultos-editar { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 1px solid #a78bfa; border-radius: 999px; background: transparent; color: #a78bfa; cursor: pointer; }
.vsi-cultos-novo svg, .vsi-cultos-editar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vsi-cultos-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.vsi-cultos-linha { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 4px 0; border-top: 1px solid #2d3345; }
.vsi-cultos-linha:first-child { border-top: 0; }
.vsi-cultos-dia { font-weight: 700; }
.vsi-cultos-hora { color: #5eead4; font-weight: 700; font-variant-numeric: tabular-nums; }
.vsi-cultos-desc { color: #a0a6b8; font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsi-cultos-linha .vsi-cultos-editar { justify-self: end; }
.vsi-cultos-vazio { margin: 0; color: #a0a6b8; font-size: .92rem; }

/* Texto do feed da Home: duas linhas, com "mais..." para abrir tudo. */
.vsi-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vsi-clamp.aberto { display: block; overflow: visible; }
.vsi-mais { background: none; border: 0; padding: 2px 0 0; color: #a78bfa; font-weight: 700; cursor: pointer; }

/* Aba Contribuir: passos de CPF, folha, valor e pagamento. */
.vsi-contrib-form { display: grid; gap: 12px; margin: 12px 0; }
.vsi-contrib-form label { display: grid; gap: 6px; font-size: 17px; color: #c9cde0; }
.vsi-contrib-form input { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid #2d3345; background: #1e2435; color: #f3f4f8; font-size: 19px; }
#view-contribuir { overflow-x: hidden; }
#view-contribuir .vsi-page, #view-contribuir .vsi-contrib-copia, #view-contribuir .primary, #view-contribuir a.primary { max-width: 100%; }
.vsi-contrib-linha { display: grid; grid-template-columns: 1fr 130px; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid #2d3345; background: #1e2435; }
.vsi-contrib-linha .vsi-contrib-marca { display: flex; align-items: center; gap: 10px; color: #f3f4f8; font-weight: 600; font-size: 18px; }
.vsi-contrib-marca input[type="checkbox"] { width: 20px; height: 20px; padding: 0; margin: 0; accent-color: #7c3aed; }
.vsi-contrib-linha input[name^="valor_"] { padding: 10px; font-size: 18px; text-align: right; }
.vsi-contrib-cupom { background: #1e2435; border: 1px dashed #3b4256; border-radius: 14px; padding: 12px 14px; margin: 12px 0; display: grid; gap: 8px; }
.vsi-contrib-cupom ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vsi-contrib-cupom li { display: flex; justify-content: space-between; gap: 12px; color: #f3f4f8; font-size: 18px; }
.vsi-contrib-hist-titulo { margin: 22px 0 8px; font-size: 19px; }
.vsi-contrib-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vsi-contrib-hist-item { background: #1e2435; border: 1px solid #2d3345; border-radius: 14px; padding: 10px 12px; display: grid; gap: 4px; font-size: 17px; color: #f3f4f8; }
.vsi-contrib-hist-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vsi-contrib-hist-acoes { display: flex; justify-content: flex-end; }
.vsi-contrib-hist-acoes .link { padding: 4px 0; font-size: 17px; }
.vsi-contrib-extrato { margin: 6px 0 0; }
.vsi-contrib-status { font-size: 14px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #2d3345; color: #c9cde0; white-space: nowrap; }
.vsi-contrib-status-pago { background: rgba(34, 197, 94, .18); color: #86efac; }
.vsi-contrib-status-pendente { background: rgba(250, 204, 21, .16); color: #fde68a; }
.vsi-contrib-status-recusado, .vsi-contrib-status-cancelado { background: rgba(248, 113, 113, .16); color: #fca5a5; }
.vsi-contrib-total { display: flex; justify-content: space-between; border-top: 1px solid #3b4256; padding-top: 8px; color: #f3f4f8; font-size: 19px; }
.vsi-contrib-erro { color: #fca5a5; font-size: 17px; }
.vsi-contrib-topo { display: flex; align-items: center; margin-bottom: 4px; }
.vsi-page .vsi-contrib-topo h2 { margin: 0 0 0 12px; }
.vsi-contrib-avancar-linha { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: 14px 0 8px; }
.vsi-contrib-avancar-texto { background: none; border: 0; padding: 0; font: inherit; font-size: 1.15em; font-weight: 700; color: #c4b5fd; cursor: pointer; }
.vsi-contrib-seta { width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); cursor: pointer; }
.vsi-contrib-seta svg { width: 20px; height: 20px; }
.vsi-contrib-copia { width: 100%; margin: 10px 0; font-size: 14px; border-radius: 12px; border: 1px solid #2d3345; background: #1e2435; color: #f3f4f8; padding: 10px; }
.vsi-contrib-qr { display: block; width: 220px; max-width: 100%; margin: 12px auto; background: #fff; padding: 8px; border-radius: 12px; }


/* Aba Contribuir: tamanho das fontes 20% maior que o padrão. */
#view-contribuir { font-size: 120%; }

/* Carregamento em skeleton (blocos cinza com brilho) enquanto a Contribuir busca os dados. */
.vsi-skel-grupo { display: grid; gap: 8px; margin: 12px 0; }
.vsi-skel { background: linear-gradient(90deg, #1e2435 25%, #2b3347 50%, #1e2435 75%); background-size: 200% 100%; animation: vsi-skel-brilho 1.2s ease-in-out infinite; border-radius: 14px; }
.vsi-skel-titulo { height: 28px; width: 60%; margin: 8px 0 14px; }
.vsi-skel-texto { height: 16px; width: 80%; margin: 8px 0; }
.vsi-skel-texto.curto { width: 45%; }
.vsi-skel-linha { height: 58px; }
.vsi-skel-card { height: 104px; }
@keyframes vsi-skel-brilho { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .vsi-skel { animation: none; } }

/* Dados do contribuinte na confirmação: fonte maior. */
.vsi-contrib-dados { font-size: 1.32em; }
.vsi-contrib-dados b { font-size: 0.73em; }

/* Link "Não sou eu": maior e mais claro. */
#view-contribuir [data-contrib-nao] { font-size: 1.2em; color: #a5b4fc; }

/* Valor da folha bloqueado enquanto a folha não estiver marcada. */
.vsi-contrib-linha input[name^="valor_"]:disabled { opacity: .4; }

/* Botão de editar opções (engrenagem): círculo roxo do mesmo tamanho do botão de voltar, à direita. */
#view-contribuir .vsi-contrib-topo .vsi-contrib-engrenagem {
  margin-left: auto; flex: none; box-sizing: border-box;
  width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; margin-block: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: #4b2a73; color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25); cursor: pointer;
}
#view-contribuir .vsi-contrib-engrenagem svg { width: 20px; height: 20px; display: block; }
#view-contribuir .vsi-contrib-engrenagem:active { transform: scale(.96); }

/* Painel de configuração das contribuições (liderança): cartão por opção. */
.vsi-contrib-cfg-item { background: #1e2435; border: 1px solid #2d3345; border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.vsi-contrib-cfg-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vsi-contrib-cfg-ordem { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #2d3345; color: #c9cde0; font-size: 15px; font-weight: 700; }
.vsi-page .vsi-contrib-cfg-ativo { display: flex; align-items: center; gap: 12px; color: #f3f4f8; font-weight: 600; font-size: 16px; margin: 0; }
.vsi-contrib-cfg-linha { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.vsi-contrib-cfg-linha > label { display: grid; gap: 6px; flex: 1; min-width: 0; }
.vsi-contrib-cfg-setas { display: flex; gap: 8px; flex: none; }
.vsi-contrib-seta-mini { width: 40px; height: 40px; min-width: 40px; min-height: 40px; border-radius: 50%; border: 1px solid #2d3345; padding: 0; display: grid; place-items: center; background: #161b29; color: #c4b5fd; cursor: pointer; }
.vsi-contrib-seta-mini:disabled { opacity: .35; }
.vsi-contrib-seta-mini svg { width: 18px; height: 18px; display: block; }
/* Interruptor estilo iOS (verde quando ligado). */
.vsi-switch { position: relative; display: inline-block; width: 51px; height: 31px; flex: none; }
.vsi-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; z-index: 1; cursor: pointer; }
.vsi-switch i { position: absolute; inset: 0; border-radius: 999px; background: #3a4256; transition: background .2s; }
.vsi-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.vsi-switch input:checked + i { background: #34c759; }
.vsi-switch input:checked + i::after { transform: translateX(20px); }
