:root {
  --g: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --ink: #1f2430;
  --muted: #6b7280;
  --card: #ffffff;
  --line: #e5e7eb;
  --tab: 72px;
  --bg: #f4f5fb;
}

* { 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: 24px 16px;
  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: 16px 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) */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  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;
}

.tabbar button {
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 99px;
  font-size: 11px;
}

.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 antes de Início, com o nome abaixo */
.tabbar button.brand { color: #f3f4f8; padding: 6px 8px; gap: 4px; min-width: 76px; }
.tabbar button.brand img { width: 40px; height: 40px; object-fit: contain; display: block; }
.tabbar button.brand span { font-size: 10px; letter-spacing: .02em; white-space: nowrap; }
.tabbar button.on { color: #5b5fc7; background: rgba(118, 75, 162, .12); }

.toast {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  background: #1f2430;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 50;
  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:none;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; flex-direction: column; min-width: 0; }
.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; }
.home-feed { padding: calc(118px + env(safe-area-inset-top)) 14px 0; }

/* 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; }

/* Feed de avisos (estilo post) */
.publicar-btn { width: 100%; margin: 0 0 14px; }
.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: 14px; }
.post-autor small { font-size: 12px; color: var(--muted); }
.post-titulo { margin: 0 14px 6px; font-size: 15px; }
.post-foto { display: block; width: 100%; max-height: 420px; object-fit: cover; background: #232838; }
.post-texto { margin: 10px 14px 4px; font-size: 14px; line-height: 1.45; white-space: pre-line; }
.post-acoes { display: flex; gap: 6px; padding: 6px 10px 12px; }
.post-acoes .acao { background: transparent; color: var(--muted); padding: 6px 10px; border-radius: 99px; font-size: 14px; }
.post-acoes .acao.on { color: #f43f5e; }
.post-acoes .acao:active { background: rgba(255, 255, 255, .06); }

/* 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; }

/* 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 (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --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; }
}
