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

:root {
  --verde: #1a3d2e;
  --verde-mid: #2d6e4e;
  --verde-light: #6ec99a;
  --lago: #4a9abb;
  /* canvas claro estilo Apple: cinza quase-branco neutro, cards brancos */
  --areia: #f2f2f5;
  --areia-dark: #e4e4e9;
  --hairline: rgba(0,0,0,0.07);
  --fill: rgba(120,120,128,0.10);
  --texto: #1d1d1f;
  --texto-muted: #86868b;
  --branco: #ffffff;
  --radius: 16px;
  --radius-sm: 11px;
  /* sombras neutras, suaves e difusas (nada de tom verde carregado) */
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.05), 0 16px 48px rgba(0,0,0,0.10);
  /* assinatura de marca: gradientes com profundidade (verde-floresta + água do lago) */
  --grad-verde: linear-gradient(135deg, #2d6e4e 0%, #17402f 100%);
  --grad-agua: linear-gradient(135deg, #5bb8d4 0%, #2d6e4e 100%);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #0e2419;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--texto);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── APP WRAPPER ── */
#app {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--areia);
  position: relative;
  box-shadow: 0 0 80px rgba(0,0,0,0.5);
}

/* ── HIDDEN UTILITY ── */
.hidden { display: none !important; }

/* ── OVERLAYS (modais em baixo) ── */
#denuncia-overlay,
#login-overlay,
#detail-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.32);
  align-items: flex-end;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#denuncia-overlay.open,
#login-overlay.open,
#detail-overlay.open {
  display: flex;
}

.modal-sheet {
  background: var(--branco);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 88%;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* ── DRAWER OVERLAY ── */
#drawer-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 400;
  background: rgba(10,20,15,0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
#drawer-overlay.open { display: block; }

/* ── SIDE DRAWER ── */
#side-drawer {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 78%;
  max-width: 300px;
  z-index: 450;
  background: rgba(26,61,46,0.94);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 24px;
}
#side-drawer.open { transform: translateX(0); }

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.drawer-logo {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  color: var(--branco);
  display: flex; align-items: center; gap: 6px;
}
.drawer-logo span { font-style: italic; color: var(--verde-light); }

.drawer-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 6px;
  transition: color 0.15s;
}
.drawer-close-btn:hover { color: var(--branco); }

.drawer-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
  padding: 18px 16px 6px;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 400;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  margin: 0 8px;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}
.drawer-item:hover { background: rgba(255,255,255,0.08); color: var(--branco); }
.drawer-item.active { background: rgba(110,201,154,0.18); color: var(--verde-light); }
.drawer-item.drawer-denuncia.active { background: rgba(220,38,38,0.18); color: #FCA5A5; }
.drawer-icon { display: flex; align-items: center; flex-shrink: 0; }

.drawer-divider {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 12px 16px;
}

/* ── HEADER ── */
header {
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--hairline);
  padding: 14px 16px 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.logo {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  color: var(--texto);
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 6px;
}
.logo .lago-word { font-style: italic; color: var(--verde-mid); }
.logo svg { width: 20px; height: 20px; fill: var(--verde-mid); }

.hamburger-btn {
  background: var(--fill);
  border: none;
  border-radius: 10px;
  color: var(--verde);
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hamburger-btn:hover { background: rgba(120,120,128,0.18); }

.search-bar {
  background: var(--fill);
  border: none;
  border-radius: 24px;
  padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
}
.search-bar svg { width: 16px; height: 16px; color: var(--texto-muted); flex-shrink: 0; }
.search-bar input {
  background: none; border: none; outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--texto);
  width: 100%;
}
.search-bar input::placeholder { color: var(--texto-muted); }

/* ── INSTALL BANNER ── */
.install-banner {
  background: #E8F5EE;
  border-bottom: 1.5px solid #A7F3C8;
  padding: 9px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--verde);
  flex-shrink: 0;
}
.install-banner.visible { display: flex; }
.install-btn {
  background: var(--verde);
  color: var(--branco);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.install-btn:hover { background: var(--verde-mid); }
.install-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--texto-muted);
  padding: 2px 4px;
  font-size: 1rem;
  line-height: 1;
}

/* ── FILTROS ── */
.filters-wrap {
  background: var(--branco);
  border-bottom: 1px solid var(--areia-dark);
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters-wrap::-webkit-scrollbar { display: none; }
.filters {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  width: max-content;
}
.pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 400;
  white-space: nowrap;
  border: 1px solid var(--areia-dark);
  color: var(--texto-muted);
  cursor: pointer;
  transition: all 0.18s;
  display: flex; align-items: center; gap: 5px;
  background: var(--branco);
  user-select: none;
}
.pill:hover { border-color: var(--verde-mid); color: var(--verde); }
.pill.active { background: var(--grad-agua); color: var(--branco); border-color: transparent; }
.pill-ativos { border-color: #4ebe8b; color: #1a7a4a; }
.pill-ativos.active { background: #1a7a4a; border-color: #1a7a4a; color: #fff; }

/* ── MAIN ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

/* ── MAPA VIEW (full-bleed) ── */
#map-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; position: relative; }

/* Na aba do mapa o header global some — a UI flutua sobre o mapa */
#app.map-mode > header { display: none; }

.glass {
  background: rgba(255,255,255,0.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  backdrop-filter: blur(22px) saturate(1.8);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.7);
}

.map-topbar {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 12px; right: 12px;
  display: flex;
  gap: 8px;
  z-index: 30;
}
.map-search {
  flex: 1;
  min-width: 0;
  border-radius: 24px;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 8px;
}
.map-search svg { width: 17px; height: 17px; color: var(--texto-muted); flex-shrink: 0; }
.map-search input {
  background: none; border: none; outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--texto);
  width: 100%;
}
.map-search input::placeholder { color: var(--texto-muted); }
.map-menu-btn {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 16px;
  color: var(--verde);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.map-menu-btn:active { transform: scale(0.92); }

/* Chips de filtro flutuando sobre o mapa */
#map-view .filters-wrap {
  position: absolute;
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: 0; right: 0;
  background: transparent;
  border-bottom: none;
  z-index: 29;
}
#map-view .pill {
  background: rgba(255,255,255,0.55);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 2px 10px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.6);
  color: var(--texto);
}
#map-view .pill.active { background: var(--grad-agua); color: var(--branco); border-color: transparent; }
#map-view .pill-ativos { color: #1a7a4a; }
#map-view .pill-ativos.active { background: #1a7a4a; border-color: #1a7a4a; color: #fff; }

/* ── BOTTOM SHEET DO MAPA ── */
.map-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 82%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.84);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255,255,255,0.75);
  box-shadow: 0 -6px 28px rgba(0,0,0,0.09);
  transform: translateY(calc(100% - 94px));
  transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.map-sheet[data-state="half"] { transform: translateY(46%); }
.map-sheet[data-state="full"] { transform: translateY(0); }
.map-sheet.dragging { transition: none; }

.sheet-grip {
  padding: 10px 0 6px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
}
.sheet-handle {
  width: 40px; height: 4px;
  border-radius: 3px;
  background: #cfc9ba;
}
.map-sheet .panel-header {
  position: static;
  background: transparent;
  border-bottom: 1px solid rgba(232,224,208,0.6);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.map-sheet .loc-list { flex: 1; overflow-y: auto; }
.map-sheet:not([data-state="full"]) .loc-list { overflow: hidden; }

/* FAB acima do sheet recolhido; some quando o sheet sobe */
#map-view .fab-atividade { bottom: 110px; transition: opacity 0.25s, transform 0.25s, background 0.2s, box-shadow 0.2s; }
#map-view.sheet-open .fab-atividade { opacity: 0; pointer-events: none; transform: translateY(10px); }

/* Título flutuante (denúncias, água) */
.map-title {
  flex: 1;
  min-width: 0;
  border-radius: 24px;
  padding: 11px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--verde);
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Faixa de ações flutuante abaixo do topbar */
.map-actions {
  position: absolute;
  top: calc(66px + env(safe-area-inset-top, 0px));
  left: 12px; right: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 29;
}

/* Controles do Leaflet fora das áreas flutuantes (todas as views de mapa) */
#map-view .leaflet-top.leaflet-right,
#eventos-view .leaflet-top.leaflet-right,
#denuncias-view .leaflet-top.leaflet-right,
#agua-view .leaflet-top.leaflet-right { top: calc(112px + env(safe-area-inset-top, 0px)); }
#map-view .leaflet-bottom,
#eventos-view .leaflet-bottom,
#denuncias-view .leaflet-bottom,
#agua-view .leaflet-bottom { bottom: 100px; }

/* ── ANIMAÇÕES DE ENTRADA ── */
@keyframes overlay-fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }

#denuncia-overlay.open, #login-overlay.open, #detail-overlay.open,
#novo-post-overlay.open, #agua-overlay.open, #atividade-overlay.open,
#post-detail-overlay.open,
#drawer-overlay.open { animation: overlay-fade 0.25s ease; }

#denuncia-overlay.open .modal-sheet,
#login-overlay.open .modal-sheet,
#detail-overlay.open .modal-sheet,
#novo-post-overlay.open .modal-sheet,
#agua-overlay.open .modal-sheet,
#post-detail-overlay.open .modal-sheet,
#atividade-overlay.open .modal-sheet { animation: sheet-up 0.45s cubic-bezier(0.32, 0.72, 0, 1); }

#feed-view.active, #eventos-view.active, #denuncias-view.active, #agua-view.active,
#seguranca-view.active, #educacional-view.active, #comunidades-view.active { animation: view-in 0.28s ease; }
#map-view:not(.hidden) { animation: view-in 0.28s ease; }

/* ── SKELETON LOADERS ── */
.sk {
  background: #ebe5d7;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  animation: sk-shimmer 1.3s infinite;
}
@keyframes sk-shimmer { 100% { transform: translateX(100%); } }
.sk-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.sk-icon { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
.sk-line { height: 12px; }

/* ── MICRO-INTERAÇÕES (feedback de toque) ── */
.btn-action, .btn-denuncia-new, .btn-join, .fab-post, .btn-google,
.popup-btn, .agua-chip, .install-btn, .btn-heat-toggle, .pill {
  transition: transform 0.12s ease, background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s, opacity 0.18s;
}
.btn-action:active, .btn-denuncia-new:active, .btn-join:active, .fab-post:active,
.fab-atividade:active, .btn-google:active, .popup-btn:active, .agua-chip:active,
.install-btn:active, .btn-heat-toggle:active, .pill:active { transform: scale(0.95); }

/* ── ÍCONES NOS TÍTULOS ── */
.info-header h2 { display: flex; align-items: center; gap: 8px; }
.info-header h2 svg { width: 20px; height: 20px; flex-shrink: 0; }
.map-title { gap: 8px; }
.map-title svg { width: 18px; height: 18px; flex-shrink: 0; }
.fab-atividade { display: flex; align-items: center; gap: 6px; }

/* ── COMUNIDADES ── */
#comunidades-view { flex: 1; display: none; flex-direction: column; overflow: hidden; min-height: 0; }
#comunidades-view.active { display: flex; }
#comunidades-grid-view { flex: 1; overflow-y: auto; }

.comunidade-card {
  background: var(--branco);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--areia-dark);
  cursor: pointer;
  transition: background 0.12s;
}
.comunidade-card:active { background: var(--areia); }
.comunidade-emoji-icon {
  font-size: 1.6rem;
  width: 46px; height: 46px;
  background: var(--areia);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.comunidade-info { flex: 1; min-width: 0; }
.comunidade-nome { font-weight: 600; font-size: 0.95rem; }
.comunidade-desc { font-size: 0.78rem; color: var(--texto-muted); margin-top: 2px; }
.comunidade-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.comunidade-membros { font-size: 0.72rem; color: var(--texto-muted); }
.comunidade-badge-membro {
  font-size: 0.68rem; background: #e6f9ef; color: #1a7a4a;
  border-radius: 8px; padding: 2px 7px; font-weight: 500;
}

/* Feed */
#comunidade-feed-view { flex: 1; overflow: hidden; min-height: 0; position: relative; }
.feed-topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--branco);
  border-bottom: 1px solid var(--areia-dark);
  flex-shrink: 0;
}
.feed-back-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.88rem; color: var(--verde-mid); font-weight: 500;
  padding: 4px 0; flex-shrink: 0; font-family: 'DM Sans', sans-serif;
}
.feed-titulo { flex: 1; font-weight: 600; font-size: 0.92rem; text-align: center; }
.btn-join {
  background: var(--verde-mid); color: #fff; border: none;
  border-radius: 16px; padding: 5px 12px;
  font-size: 0.76rem; font-weight: 600; cursor: pointer;
  flex-shrink: 0; font-family: 'DM Sans', sans-serif; transition: background 0.2s;
}
.btn-join.membro { background: #e6f9ef; color: #1a7a4a; }

.posts-list { flex: 1; overflow-y: auto; padding: 8px 0 80px; }

.post-card {
  background: var(--branco);
  margin: 6px 12px;
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--verde-light); color: var(--verde);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.9rem; flex-shrink: 0; overflow: hidden;
}
.post-meta { flex: 1; min-width: 0; }
.post-autor { font-weight: 600; font-size: 0.88rem; }
.post-tempo { font-size: 0.72rem; color: var(--texto-muted); }
.post-local { font-size: 0.78rem; color: var(--lago); margin-bottom: 6px; font-weight: 500; }
.post-conteudo { font-size: 0.88rem; line-height: 1.55; color: var(--texto); word-break: break-word; }
.post-foto { width: 100%; border-radius: 8px; margin-top: 10px; max-height: 260px; object-fit: cover; cursor: pointer; }
.post-menu-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: var(--texto-muted); padding: 2px 6px;
  border-radius: 6px; line-height: 1; flex-shrink: 0;
}
.post-menu-btn:hover { background: var(--areia); }
.post-menu-dropdown {
  margin: -4px 0 8px;
  background: var(--areia);
  border-radius: 8px;
  overflow: hidden;
}
.post-actions { display: flex; gap: 4px; padding: 4px; }
.post-action-btn {
  flex: 1; background: none; border: none; border-radius: 6px;
  padding: 7px 10px; font-size: 0.8rem; font-family: 'DM Sans', sans-serif;
  cursor: pointer; color: var(--texto); transition: background 0.15s;
}
.post-action-btn:hover { background: var(--areia-dark); }
.post-action-btn.danger { color: #c0392b; }
.post-action-btn.danger:hover { background: #fdecea; }

.fab-post {
  position: absolute; bottom: 16px; right: 16px; z-index: 10;
  background: var(--grad-verde); color: #fff; border: none;
  border-radius: 24px; padding: 10px 18px;
  font-size: 0.84rem; font-weight: 500; font-family: 'DM Sans', sans-serif;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 10px 28px rgba(0,0,0,0.14);
}

/* Novo post overlay */
#novo-post-overlay {
  display: none; position: absolute; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.32); align-items: flex-end; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#novo-post-overlay.open { display: flex; }

/* ── PRESENÇA EM TEMPO REAL ── */
#presenca-counter {
  position: absolute;
  top: calc(116px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  background: rgba(26,61,46,0.88);
  color: #fff;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.fab-atividade {
  position: absolute;
  bottom: 236px;
  right: 14px;
  z-index: 400;
  background: var(--grad-verde);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 10px 28px rgba(0,0,0,0.14);
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.fab-atividade.ativo {
  background: #DC2626;
  box-shadow: 0 4px 16px rgba(220,38,38,0.4);
}

.presenca-pin {
  width: 44px; height: 44px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.presenca-pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(78,190,139,0.35);
  animation: presenca-pulse 2s ease-in-out infinite;
}
.presenca-emoji-pin {
  position: relative; z-index: 1;
  color: var(--verde-mid);
  width: 36px; height: 36px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  border: 2px solid #4ebe8b;
}
@keyframes presenca-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  50%  { transform: scale(1.5); opacity: 0.2; }
  100% { transform: scale(1);   opacity: 0.7; }
}

/* ── ATIVIDADE PICKER ── */
#atividade-overlay {
  display: none;
  position: absolute; inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.32);
  align-items: flex-end;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#atividade-overlay.open { display: flex; }

.atividade-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 4px 16px 12px;
}
.atividade-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 13px 6px;
  background: var(--areia);
  border: 1.5px solid var(--areia-dark);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.atividade-card:active {
  background: #d6f5e5;
  border-color: var(--verde-mid);
}
.atividade-emoji { display: flex; align-items: center; justify-content: center; color: var(--verde-mid); }
.atividade-label { font-size: 0.68rem; color: var(--texto); font-weight: 500; }
/* ponto "ao vivo" pulsante (substitui o emoji 🟢 do contador) */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; flex-shrink: 0;
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(74,222,128,0.6);
  animation: livePulse 1.8s ease-out infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.55); }
  70% { box-shadow: 0 0 0 7px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
#map { position: absolute; inset: 0; z-index: 1; }

/* ── EVENTOS VIEW ── */
#eventos-view { flex: 1; display: none; flex-direction: column; overflow: hidden; min-height: 0; }
#eventos-view.active { display: flex; }
#map-view.hidden { display: none; }
#eventos-map { flex: 1; z-index: 1; min-height: 0; }

/* ── BOTTOM PANEL (compartilhado) ── */
.bottom-panel {
  height: 220px;
  background: var(--branco);
  border-top: 1px solid var(--areia-dark);
  overflow-y: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.panel-header {
  padding: 12px 16px 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--texto-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--areia-dark);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--branco); z-index: 1;
  flex-shrink: 0;
}
.panel-count {
  background: var(--areia);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.75rem;
  color: var(--texto-muted);
}

/* ── LISTA ── */
.loc-list { padding: 8px 12px; overflow-y: auto; flex: 1; }
.loc-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--areia);
}
.loc-card:last-child { border-bottom: none; }
.loc-card:hover { background: var(--areia); }
.loc-card.highlighted { background: #e8f5ee; }

/* ── PARCEIRO CARD ── */
.loc-card.parceiro-card {
  background: #FFFDF5;
  border-left: 3px solid #F59E0B;
  border-bottom-color: #FEF3C7;
}
.loc-card.parceiro-card:hover { background: #FFFBEB; }
.parceiro-badge {
  background: #FFFBEB !important;
  color: #B45309 !important;
  border: 1px solid #FCD34D;
  font-weight: 600 !important;
}

/* ── PARCEIRO BANNER (detalhe) ── */
.parceiro-banner {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border-bottom: 1px solid #FCD34D;
  padding: 10px 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #92400E;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── SEJA PARCEIRO CARD ── */
.seja-parceiro-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 8px 0 4px;
  background: linear-gradient(135deg, #1a3d2e 0%, #2d6e4e 100%);
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.seja-parceiro-card:hover { opacity: 0.92; }
.seja-parceiro-icon { font-size: 1.4rem; flex-shrink: 0; }
.seja-parceiro-body { flex: 1; min-width: 0; }
.seja-parceiro-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seja-parceiro-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.65);
  margin-top: 1px;
}
.seja-parceiro-cta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--verde-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.loc-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.loc-info { flex: 1; min-width: 0; }
.loc-name {
  font-size: 0.875rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--texto);
}
.loc-meta {
  font-size: 0.75rem; color: var(--texto-muted);
  display: flex; align-items: center; gap: 6px; margin-top: 2px;
  white-space: nowrap; overflow: hidden;
}
.loc-meta > span:first-child {
  overflow: hidden; text-overflow: ellipsis; flex-shrink: 1;
}
.loc-badge {
  font-size: 0.7rem; padding: 1px 8px;
  border-radius: 10px; font-weight: 400;
  white-space: nowrap; flex-shrink: 0;
}
.star { font-size: 0.8rem; }
.loc-arrow { color: var(--areia-dark); flex-shrink: 0; }
.loc-arrow svg { width: 16px; height: 16px; }

/* ── DETAIL MODAL ── */
.detail-handle {
  width: 36px; height: 4px;
  background: var(--areia-dark);
  border-radius: 2px;
  margin: 12px auto 0;
}
.detail-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--areia);
}
.detail-cat {
  font-size: 0.75rem; color: var(--texto-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 4px; display: flex; align-items: center; gap: 6px;
}
.detail-nome {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem; font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--verde); line-height: 1.2;
}
.detail-body { padding: 16px 20px; }
.detail-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px; font-size: 0.875rem; color: var(--texto-muted);
}
.detail-row svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--verde-mid); }
.detail-desc {
  background: var(--areia);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--texto);
  margin-bottom: 14px;
}
.detail-actions { display: flex; gap: 8px; }
.btn-action {
  flex: 1; padding: 11px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.18s;
  text-decoration: none;
  border: none;
}
.btn-action svg { width: 16px; height: 16px; }
.btn-action.primary { background: var(--verde); color: var(--branco); }
.btn-action.primary:hover { background: var(--verde-mid); }
.btn-action.secondary { background: var(--areia); color: var(--verde); border: 1px solid var(--areia-dark); }
.btn-action.secondary:hover { background: var(--areia-dark); }

/* ── DENÚNCIAS VIEW ── */
#denuncias-view {
  flex: 1; display: none; flex-direction: column;
  overflow: hidden; min-height: 0;
}
#denuncias-view.active { display: flex; }
#denuncias-map { flex: 1; z-index: 1; min-height: 0; }

.denuncias-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--branco);
  border-bottom: 1px solid var(--areia-dark);
  flex-shrink: 0;
}
.denuncias-header-text h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  color: var(--verde);
  line-height: 1.2;
}
.denuncias-header-text p {
  font-size: 0.72rem;
  color: var(--texto-muted);
  margin-top: 1px;
}
.btn-denuncia-new {
  background: #DC2626;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  box-shadow: 0 2px 8px rgba(220,38,38,0.35);
  transition: all 0.18s;
  flex-shrink: 0;
}
.btn-denuncia-new:hover { background: #B91C1C; }

/* ── DENUNCIA / LOGIN FORM ── */
.denuncia-form-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--areia);
}
.denuncia-form-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  color: #DC2626;
  margin-bottom: 2px;
}
.denuncia-form-header h2.verde { color: var(--verde); }
.denuncia-form-header p { font-size: 0.8rem; color: var(--texto-muted); }

.denuncia-form-body { padding: 16px 20px 24px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--texto-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.form-group select,
.form-group textarea,
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--areia-dark);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--texto);
  background: var(--branco);
  outline: none;
  transition: border-color 0.18s;
  appearance: auto;
}
.form-group select:focus,
.form-group textarea:focus,
.form-input:focus { border-color: var(--verde); }
.form-group textarea { resize: none; }

.btn-gps {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed var(--areia-dark);
  border-radius: var(--radius-sm);
  background: var(--areia);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--texto);
  cursor: pointer;
  transition: all 0.18s;
}
.btn-gps:hover:not(:disabled) { border-color: var(--verde-mid); background: #e8f5ee; }
.btn-gps:disabled { opacity: 0.6; cursor: default; }

.gps-status {
  font-size: 0.75rem;
  margin-top: 5px;
  color: var(--texto-muted);
  min-height: 16px;
}
.gps-status.success { color: #059669; }
.gps-status.error { color: #DC2626; }

/* ── FOTO UPLOAD ── */
.btn-foto {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px dashed var(--areia-dark);
  border-radius: var(--radius-sm);
  background: var(--areia);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--texto);
  cursor: pointer;
  transition: all 0.18s;
  width: 100%;
}
.btn-foto:hover { border-color: var(--verde-mid); background: #e8f5ee; }
.btn-foto.has-foto { border-style: solid; border-color: var(--verde-light); background: #e8f5ee; color: var(--verde); }
.foto-preview {
  display: none;
  margin-top: 8px;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.foto-preview.visible { display: block; }
.foto-preview img {
  width: 100%; height: 120px;
  object-fit: cover; display: block;
  border-radius: var(--radius-sm);
}
.foto-remove {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.55); color: #fff;
  border: none; border-radius: 50%;
  width: 24px; height: 24px;
  cursor: pointer; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.denuncia-thumb {
  background-size: cover !important;
  background-position: center !important;
  border-radius: var(--radius-sm) !important;
  flex-shrink: 0;
}

.login-toggle {
  text-align: center;
  font-size: 0.8rem;
  color: var(--texto-muted);
  margin-top: 14px;
}
.login-toggle span {
  color: var(--verde);
  cursor: pointer;
  font-weight: 500;
  text-decoration: underline;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  color: var(--texto-muted);
  font-size: 0.78rem;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--areia-dark);
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: #fff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--areia);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.user-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--verde);
  color: var(--branco);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 600;
  flex-shrink: 0;
}

/* ── TOAST ── */
#toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(26,61,46,0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  z-index: 700;
  pointer-events: none;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── EMPTY ── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem; text-align: center; gap: 8px;
  color: var(--texto-muted); font-size: 0.875rem;
}

/* ── LEAFLET CUSTOM ── */
.marker-pin {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: pointer;
}
.marker-ev {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: pointer;
}
.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
  overflow: hidden;
}
.leaflet-popup-content { margin: 0 !important; width: auto !important; }
.leaflet-popup-tip-container { display: none; }
.map-popup { padding: 14px 16px; min-width: 200px; }
.popup-cat { font-size: 0.7rem; color: var(--texto-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.popup-nome { font-family: 'Fraunces', serif; font-size: 1rem; color: var(--verde); margin: 2px 0 4px; }
.popup-periodo { font-size: 0.75rem; color: var(--texto-muted); margin-bottom: 8px; }
.popup-btn {
  display: block; width: 100%;
  padding: 7px;
  background: var(--verde); color: var(--branco);
  border: none; border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem; font-weight: 500;
  cursor: pointer; text-align: center;
}

/* ── HEAT TOGGLE ── */
.btn-heat-toggle {
  background: rgba(255,255,255,0.15);
  color: var(--texto-muted);
  border: 1px solid var(--areia-dark);
  border-radius: 20px;
  padding: 6px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
}
.btn-heat-toggle.active {
  background: #FEF3C7;
  color: #B45309;
  border-color: #FCD34D;
}
.btn-heat-toggle:hover { background: var(--areia); }

/* ── INFO VIEWS (Segurança + Educacional) ── */
#seguranca-view,
#educacional-view {
  flex: 1; display: none; flex-direction: column;
  overflow: hidden; min-height: 0;
}
#seguranca-view.active,
#educacional-view.active { display: flex; }

.info-header {
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--hairline);
  padding: 18px 16px 14px;
  flex-shrink: 0;
}
.info-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--verde);
  line-height: 1.15;
}
.info-header p {
  font-size: 0.8rem;
  color: var(--texto-muted);
  margin-top: 3px;
}

.info-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--texto-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--areia-dark);
  display: flex;
  align-items: center;
  gap: 7px;
}
/* ícone Phosphor inline (unificado) */
.ph-ico { flex-shrink: 0; }
.info-section-label .ph-ico { width: 15px; height: 15px; color: var(--verde-mid); }
i[data-ph] { display: inline-flex; align-items: center; }

/* ── EMERGENCY GRID ── */
.emerg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.emerg-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.emerg-card:hover { opacity: 0.85; }
.emerg-num {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
}
.emerg-name {
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.emerg-name .ph-ico { width: 15px; height: 15px; }

/* ── CONTACT ROWS ── */
.contact-rows {
  background: var(--branco);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--areia-dark);
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--areia);
  text-decoration: none;
  color: var(--texto);
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.contact-row:last-child { border-bottom: none; }
a.contact-row:hover { background: var(--areia); }
.contact-icon { flex-shrink: 0; display: inline-flex; }
.contact-icon .ph-ico { width: 20px; height: 20px; color: var(--verde-mid); }
.contact-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-name { font-size: 0.875rem; font-weight: 500; }
.contact-tel { font-size: 0.78rem; color: var(--texto-muted); }
.contact-chevron {
  font-size: 1.2rem;
  color: var(--areia-dark);
  flex-shrink: 0;
}

/* ── RULES LIST ── */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rule-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--branco);
  border-radius: var(--radius-sm);
  font-size: 0.855rem;
  color: var(--texto);
  line-height: 1.5;
  border: 1px solid var(--areia);
}
.rule-icon { flex-shrink: 0; margin-top: 1px; display: inline-flex; }
.rule-icon .ph-ico { width: 17px; height: 17px; color: var(--verde-mid); }

/* ── TIPS BOX ── */
.tips-box {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tips-box p {
  font-size: 0.855rem;
  color: #166534;
  line-height: 1.5;
  margin: 0;
}
.tips-box p::before { content: '✓ '; font-weight: 700; }

/* ── EDU STATS GRID ── */
.edu-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.edu-stat {
  background: var(--branco);
  border: 1px solid var(--areia-dark);
  border-radius: var(--radius);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.edu-stat-num {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--verde);
  line-height: 1;
}
.edu-stat-label {
  font-size: 0.65rem;
  color: var(--texto-muted);
  text-align: center;
  line-height: 1.2;
}

/* ── EDU TEXT ── */
.edu-text {
  background: var(--branco);
  border: 1px solid var(--areia-dark);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.edu-text p {
  font-size: 0.875rem;
  color: var(--texto);
  line-height: 1.65;
  margin: 0;
}

/* ── QUALITY CARD ── */
.quality-card {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.quality-dot {
  width: 14px; height: 14px;
  background: #22C55E;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.2);
}
.quality-status {
  font-size: 0.875rem;
  font-weight: 500;
  color: #166534;
}
.quality-source {
  font-size: 0.75rem;
  color: #166534;
  opacity: 0.7;
  margin-top: 2px;
}

/* ── AVALIAÇÕES ── */
.aval-section {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--areia);
}
.aval-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--texto-muted);
  margin-bottom: 10px;
}
.aval-summary { margin-bottom: 14px; }
.aval-media-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--texto);
}
.aval-count {
  font-size: 0.78rem;
  color: var(--texto-muted);
}

/* Star selector */
.aval-form {
  background: var(--areia);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aval-form-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--texto-muted);
}
.star-selector {
  display: flex;
  gap: 4px;
}
.star-opt {
  font-size: 1.75rem;
  color: #D1D5DB;
  cursor: pointer;
  transition: color 0.12s, transform 0.1s;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.star-opt:hover,
.star-opt.active { color: #F59E0B; }
.star-opt:active { transform: scale(0.9); }
.aval-input {
  font-size: 0.875rem !important;
  padding: 8px 10px !important;
}

/* Avaliação cards */
.aval-list { display: flex; flex-direction: column; gap: 8px; }
.aval-card {
  background: var(--branco);
  border: 1px solid var(--areia-dark);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.aval-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.aval-nome {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--texto);
  flex: 1;
}
.aval-data {
  font-size: 0.72rem;
  color: var(--texto-muted);
}
.aval-comentario {
  font-size: 0.82rem;
  color: var(--texto);
  line-height: 1.5;
  margin-top: 2px;
}

/* ── FEED VIEW ── */
#feed-view {
  flex: 1; display: none; flex-direction: column;
  overflow: hidden; min-height: 0;
}
#feed-view.active { display: flex; }
#feed-view .posts-list { flex: 1; overflow-y: auto; padding: 8px 0 24px; }

.post-com-badge {
  display: inline-block;
  background: var(--areia);
  color: var(--verde);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── POST FOOTER (likes + comentários) ── */
.post-footer {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--areia);
}
.post-react-btn {
  background: none;
  border: none;
  border-radius: 14px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--texto-muted);
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: background 0.15s;
}
.post-react-btn:hover { background: var(--areia); }
.post-react-btn.liked { color: #D4537E; font-weight: 600; }

/* ── COMENTÁRIOS ── */
.post-comments {
  margin-top: 8px;
  border-top: 1px solid var(--areia);
  padding-top: 8px;
}
.comment-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 5px 2px;
}
.comment-body { flex: 1; min-width: 0; font-size: 0.82rem; line-height: 1.45; }
.comment-autor { font-weight: 600; margin-right: 5px; }
.comment-texto { color: var(--texto); word-break: break-word; }
.comment-tempo { font-size: 0.68rem; color: var(--texto-muted); margin-left: 6px; white-space: nowrap; }
.comment-del {
  background: none; border: none; cursor: pointer;
  color: var(--texto-muted); font-size: 0.75rem; padding: 2px 5px;
  border-radius: 5px; flex-shrink: 0;
}
.comment-del:hover { background: #fdecea; color: #c0392b; }
.comment-form {
  display: flex; gap: 6px; margin-top: 6px;
}
.comment-form input {
  flex: 1;
  border: 1.5px solid var(--areia-dark);
  border-radius: 16px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  background: var(--branco);
}
.comment-form input:focus { border-color: var(--verde-mid); }
.comment-form button {
  background: var(--verde-mid);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── QUALIDADE DA ÁGUA VIEW ── */
#agua-view {
  flex: 1; display: none; flex-direction: column;
  overflow: hidden; min-height: 0;
}
#agua-view.active { display: flex; }
#agua-map { flex: 1; z-index: 1; min-height: 0; }

#agua-overlay {
  display: none; position: absolute; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.32); align-items: flex-end; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#agua-overlay.open { display: flex; }
#agua-overlay .modal-sheet { max-height: 88vh; overflow-y: auto; }

.agua-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.agua-chip {
  background: var(--branco);
  border: 1.5px solid var(--areia-dark);
  border-radius: 16px;
  padding: 7px 13px;
  font-size: 0.8rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--texto);
  cursor: pointer;
  transition: all 0.15s;
}
.agua-chip.sel {
  background: #E6F1FB;
  border-color: #185FA5;
  color: #0C447C;
  font-weight: 600;
}
.agua-medicoes-toggle {
  width: 100%;
  text-align: left;
  background: var(--areia);
  border: 1.5px solid var(--areia-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: var(--texto);
  cursor: pointer;
}
.agua-medicao-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.agua-medicao-row label {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0;
}
.agua-medicao-row input {
  width: 110px;
  flex-shrink: 0;
}

/* ── MAPA VIVO: post com lugar ─────────────────────────────────────────────── */
.fab-map-post {
  position: absolute;
  bottom: 160px;
  right: 14px;
  z-index: 400;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--grad-agua);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 10px 28px rgba(0,0,0,0.14);
  transition: transform 0.15s, opacity 0.25s;
}
.fab-map-post:active { transform: scale(0.92); }
.fab-map-post .ph-ico, .fab-map-post svg { width: 22px; height: 22px; }
#map-view.sheet-open .fab-map-post { opacity: 0; pointer-events: none; }

.btn-local-gps {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px dashed var(--areia-dark);
  border-radius: var(--radius-sm);
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--verde-mid);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-local-gps:hover:not(:disabled) { border-color: var(--verde-mid); background: #e8f5ee; }
.btn-local-gps:disabled { opacity: 0.6; cursor: wait; }

.post-local-status {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px;
  background: #e8f5ee;
  border: 1.5px solid var(--verde-light);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--verde);
}
.post-local-status-nome { display: flex; align-items: center; gap: 6px; min-width: 0; }
.post-local-status-nome svg { flex-shrink: 0; }
.post-local-remove {
  background: none; border: none; cursor: pointer;
  color: var(--verde-mid); display: flex; padding: 2px; flex-shrink: 0;
}

.post-local-picker-toggle {
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  color: var(--texto-muted);
  text-decoration: underline;
  padding: 8px 0 0;
  display: block;
}
.post-local-search { margin: 8px 0 6px; }
.post-local-lista {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--areia-dark);
  border-radius: var(--radius-sm);
}
.post-local-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  width: 100%;
  padding: 9px 12px;
  background: none; border: none;
  border-bottom: 1px solid var(--areia);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  text-align: left;
}
.post-local-item:last-child { border-bottom: none; }
.post-local-item:active { background: var(--areia); }
.post-local-item-nome { font-size: 0.85rem; font-weight: 500; color: var(--texto); }
.post-local-item-cat { font-size: 0.7rem; color: var(--texto-muted); }

.lgpd-hint {
  font-size: 0.7rem;
  color: var(--texto-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* ── MAPA VIVO: pins de foto (stories geolocalizados) ─────────────────────── */
.photo-pin {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--grad-agua);
  padding: 2.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform 0.15s;
}
.photo-pin:active { transform: scale(0.94); }
.photo-pin img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  display: block;
  background: var(--areia-dark);
}
.photo-pin--fresh {
  position: relative;
}
.photo-pin--fresh::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(91,184,212,0.45);
  animation: presenca-pulse 2s ease-out infinite;
  z-index: -1;
}

/* popup do pin de foto */
.photo-popup { padding: 0 !important; min-width: 220px; }
.photo-popup-img {
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.photo-popup-body { padding: 10px 12px 12px; }
.photo-popup-autor { display: flex; align-items: center; gap: 8px; }
.photo-popup-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.photo-popup-avatar--initial {
  background: var(--verde-light);
  color: var(--verde);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.85rem;
}
.photo-popup-autor-info { display: flex; flex-direction: column; min-width: 0; }
.photo-popup-nome { font-weight: 600; font-size: 0.85rem; color: var(--texto); }
.photo-popup-tempo {
  font-size: 0.7rem; color: var(--texto-muted);
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
}
.photo-popup-local { display: inline-flex; align-items: center; gap: 2px; color: var(--lago); }
.photo-popup-texto {
  font-size: 0.82rem; color: var(--texto);
  margin-top: 8px; line-height: 1.4;
}
.photo-popup-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
}
.photo-popup-like {
  display: flex; align-items: center; gap: 5px;
  background: var(--areia);
  border: none;
  border-radius: 18px;
  padding: 7px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--texto);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.photo-popup-like.liked { background: #fdecea; color: #DC2626; }
.photo-popup-abrir { flex: 1; margin-top: 0 !important; }

/* ── MAPA VIVO: overlay de detalhe do post ─────────────────────────────────── */
#post-detail-overlay {
  display: none; position: absolute; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.32); align-items: flex-end;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#post-detail-overlay.open { display: flex; }
#post-detail-body { padding: 8px 14px calc(env(safe-area-inset-bottom, 0px) + 20px); }

/* ── MAPA VIVO: presença com avatar ────────────────────────────────────────── */
.presenca-avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.presenca-atividade-badge {
  position: absolute;
  right: -3px; bottom: -3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--verde-mid);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ── MAPA VIVO: pulso (chip clicável) ──────────────────────────────────────── */
#presenca-counter { cursor: pointer; }
#presenca-counter .ph-ico { flex-shrink: 0; }
.pulse-sep { opacity: 0.5; margin: 0 6px; }

/* ── MAPA VIVO: strip "Agora no lago" ──────────────────────────────────────── */
/* peek maior quando a strip existe (o JS também seta data-peek="168") */
.map-sheet.has-strip { transform: translateY(calc(100% - 168px)); }
.map-sheet.has-strip[data-state="half"] { transform: translateY(46%); }
.map-sheet.has-strip[data-state="full"] { transform: translateY(0); }
#map-view.has-strip .fab-atividade { bottom: 186px; }
#map-view.has-strip .fab-map-post { bottom: 236px; }

#agora-strip {
  flex-shrink: 0;
  padding: 0 0 4px;
}
.agora-titulo {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--texto-muted);
  padding: 0 16px 6px;
}
.agora-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.agora-scroll::-webkit-scrollbar { display: none; }
.agora-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  width: 58px;
  font-family: 'DM Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.agora-item:active { transform: scale(0.95); }
.agora-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  padding: 2.5px;
  display: block;
}
.agora-circle--foto { background: var(--grad-agua); }
.agora-circle--live {
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74,222,128,0.5);
  animation: livePulse 1.8s ease-out infinite;
}
.agora-circle img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  display: block;
  background: var(--areia-dark);
}
.agora-circle-icon {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #fff;
  color: var(--verde-mid);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.agora-label {
  font-size: 0.64rem;
  color: var(--texto-muted);
  font-weight: 500;
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
