/* ===== Viagem Bahia — Mapa (visual profissional, responsivo cel/tablet/PC/carro) ===== */
:root {
  --card: #ffffff; --card2: #f1f5f9; --txt: #0f172a; --sub: #6b7a90; --borda: #e6eaf1;
  --pri: #2a6df5; --pri2: #1b4fd1; --pri-suave: #eaf1ff; --ok: #12a150; --off: #94a3b8; --perigo: #e23b3b; --amar: #f5b100;
  --grad: linear-gradient(135deg, #2a6df5, #5b8cff 55%, #19b8c7);
  --sombra: 0 2px 10px rgba(16,24,40,.12); --sombra-g: 0 10px 40px rgba(16,24,40,.22);
  --barra-h: 64px; --raio: 16px;
}
@media (prefers-color-scheme: dark) {
  :root { --card: #141c2b; --card2: #0f1726; --txt: #eef2f8; --sub: #93a3bb; --borda: #26324a; --pri-suave: #16233f; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1220; color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: var(--txt); background: var(--card); border: 1.5px solid var(--borda); border-radius: 12px; padding: 12px 13px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--pri); box-shadow: 0 0 0 4px var(--pri-suave); }
a { color: var(--pri); }
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 16px; border-radius: 12px; background: var(--pri);
  color: #fff; font-weight: 650; text-decoration: none; box-shadow: 0 2px 10px rgba(42,109,245,.3); transition: transform .08s, filter .15s; }
.botao:active { transform: translateY(1px); } .botao:hover { filter: brightness(1.05); }
.botao.cinza { background: var(--card2); color: var(--txt); border: 1.5px solid var(--borda); box-shadow: none; }
.botao.verm { background: var(--perigo); } .botao.verde { background: var(--ok); }
.botao.peq { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.botao.grande { padding: 15px; font-size: 16px; width: 100%; }

#mapa { position: fixed; inset: 0; bottom: calc(var(--barra-h) + env(safe-area-inset-bottom)); background: #e8edf3; }
.leaflet-container { background: #e8edf3; font: inherit; }
@media (prefers-color-scheme: dark) { #mapa, .leaflet-container { background: #0f1726; } }

/* ===== Topo ===== */
#topo { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 13px; padding-top: calc(9px + env(safe-area-inset-top)); color: #fff;
  background: linear-gradient(180deg, rgba(11,18,32,.96), rgba(11,18,32,.62) 75%, transparent); pointer-events: none; }
#topo > * { pointer-events: auto; }
.topo-esq { display: flex; align-items: center; gap: 10px; min-width: 0; background: rgba(16,24,42,.55); padding: 5px 12px 5px 5px; border-radius: 99px; backdrop-filter: blur(8px); }
.topo-txt { display: flex; flex-direction: column; min-width: 0; }
.topo-txt b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
.topo-txt small { color: #b9c6dd; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
.topo-dir { display: flex; gap: 6px; flex-shrink: 0; }
.pilula { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 6px 11px; border-radius: 99px; background: rgba(16,24,42,.6); color: #fff;
  backdrop-filter: blur(8px); white-space: nowrap; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: transform .1s, filter .15s; }
.pilula:active { transform: scale(.95); }
.pilula.ok { background: linear-gradient(135deg, #16a34a, #12a150); } .pilula.ruim { background: var(--perigo); } .pilula.medio { background: #d9820a; }
.pilula .pt { width: 8px; height: 8px; border-radius: 50%; background: #fff; flex-shrink: 0; }
.pilula.ok .pt { box-shadow: 0 0 0 0 rgba(255,255,255,.8); animation: ptpulso 1.8s ease-out infinite; }
@keyframes ptpulso { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.85); } 100% { box-shadow: 0 0 0 7px rgba(255,255,255,0); } }
.mini-foto { width: 40px; height: 40px; border-radius: 50%; background: #334155 center/cover; border: 2.5px solid #fff; display: grid; place-items: center;
  font-weight: 800; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.35); overflow: hidden; }
.av-emoji { font-size: 1.55em; line-height: 1; }

/* ===== Avisos e SOS ===== */
#avisos { position: fixed; top: calc(62px + env(safe-area-inset-top)); left: 12px; right: 70px; z-index: 990; display: flex; flex-direction: column; gap: 7px; }
.aviso { background: linear-gradient(135deg, #ffd54a, #f5b100); color: #3a2a00; font-weight: 700; padding: 9px 14px; border-radius: 14px; box-shadow: var(--sombra-g); font-size: 14px; display: flex; align-items: center; gap: 8px; animation: desce .25s ease; }
@keyframes desce { from { transform: translateY(-8px); } }
#sos-faixa { position: fixed; top: calc(58px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 1005; background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff;
  padding: 11px 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; box-shadow: var(--sombra-g); animation: piscar 1.1s infinite alternate; }
#sos-faixa button { background: #fff; color: var(--perigo); border-radius: 9px; padding: 5px 11px; margin-left: auto; font-weight: 700; }
@keyframes piscar { from { filter: brightness(1); } to { filter: brightness(.86); } }

/* ===== Botões flutuantes ===== */
#botoes-dir { position: fixed; right: 12px; bottom: calc(var(--barra-h) + 18px + env(safe-area-inset-bottom)); z-index: 990; display: flex; flex-direction: column; gap: 9px; }
.flutua { width: 48px; height: 48px; border-radius: 50%; background: var(--card); color: var(--txt); box-shadow: var(--sombra-g); font-size: 20px; display: grid; place-items: center; transition: transform .08s; border: 1px solid var(--borda); }
.flutua:active { transform: scale(.92); }
.flutua.ativo { background: var(--pri); color: #fff; border-color: var(--pri); }
.flutua.azul { background: var(--grad); color: #fff; border: 0; }

/* ===== Barra inferior ===== */
#barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; height: calc(var(--barra-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: var(--card); border-top: 1px solid var(--borda); box-shadow: 0 -4px 20px rgba(0,0,0,.08); }
#barra button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--sub); position: relative; transition: color .15s; }
#barra button b { font-size: 21px; font-weight: 400; line-height: 1; }
#barra button span { font-size: 11px; font-weight: 600; }
#barra button.ativo { color: var(--pri); }
#barra button.destaque b { background: var(--grad); color: #fff; border-radius: 50%; width: 52px; height: 52px; display: grid; place-items: center; margin-top: -26px; box-shadow: 0 6px 16px rgba(42,109,245,.5); font-size: 24px; }
#nao-lidas { position: absolute; top: 5px; left: 56%; background: var(--perigo); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 1px 6px; min-width: 17px; text-align: center; }

/* ===== Folha (sobe de baixo) ===== */
#folha { position: fixed; left: 0; right: 0; bottom: calc(var(--barra-h) + env(safe-area-inset-bottom)); z-index: 1100; max-height: 74vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 22px 22px 0 0; box-shadow: var(--sombra-g); animation: sobe .25s ease; }
@keyframes sobe { from { transform: translateY(16px); } }
.folha-puxador { width: 42px; height: 5px; border-radius: 99px; background: var(--borda); margin: 8px auto 0; flex-shrink: 0; }
.folha-cab { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px 12px; border-bottom: 1px solid var(--borda); }
.folha-cab b { font-size: 16.5px; }
.folha-cab button { font-size: 17px; width: 36px; height: 36px; border-radius: 50%; background: var(--card2); }
#folha-corpo { overflow: auto; padding: 12px 16px calc(18px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sub { color: var(--sub); font-size: 13px; }
.titulo-sec { font-size: 12px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 7px; }

/* ===== Pessoas ===== */
.pessoa { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--borda); }
.pessoa:last-child { border-bottom: 0; }
.pessoa .foto { width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--c); background: var(--card2) center/cover; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; color: var(--c); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.pessoa .foto.off { filter: grayscale(.9); opacity: .7; }
.pessoa .foto.on { box-shadow: 0 0 0 3px rgba(34,197,94,.35), 0 2px 8px rgba(0,0,0,.12); }
.resumo-on { display: flex; gap: 8px; margin: 2px 0 6px; }
.resumo-on .ro { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 99px; background: var(--card2); }
.resumo-on .ro i { width: 9px; height: 9px; border-radius: 50%; }
.resumo-on .ro.on { color: #15803d; } .resumo-on .ro.on i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.resumo-on .ro.off { color: var(--sub); } .resumo-on .ro.off i { background: var(--off); }
.pessoa .info { flex: 1; min-width: 0; }
.pessoa .info b { display: block; font-size: 15px; }
.pessoa .info small { display: block; color: var(--sub); font-size: 12.5px; line-height: 1.4; }
.pessoa .acoes { display: flex; gap: 6px; }
.pessoa .acoes button, .pessoa .acoes a { width: 40px; height: 40px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; text-decoration: none; font-size: 16px; }
.bolinha { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--off); margin-right: 5px; vertical-align: middle; }
.bolinha.online, .bolinha.voando { background: var(--ok); box-shadow: 0 0 0 3px rgba(18,161,80,.2); } .bolinha.pausado { background: #d9820a; }

/* ===== Chat ===== */
.chat-lista { display: flex; flex-direction: column; gap: 9px; min-height: 30vh; max-height: 46vh; overflow: auto; padding: 6px 2px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg .foto { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--card2) center/cover; border: 2px solid var(--c); flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--c); }
.msg .foto.on::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid var(--card); }
.msg .balao { background: var(--card2); border-radius: 16px; padding: 8px 12px; max-width: 78%; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.msg .balao small { display: block; font-size: 11px; color: var(--sub); margin-bottom: 1px; }
.msg.minha { flex-direction: row-reverse; }
.msg.minha .balao { background: var(--grad); color: #fff; border-bottom-right-radius: 5px; }
.msg.minha .balao small { color: #dbe7ff; }
.msg.pendente .balao { opacity: .6; }
.msg.sistema { justify-content: center; }
.msg.sistema .balao { background: transparent; color: var(--sub); font-size: 12.5px; text-align: center; box-shadow: none; }
.msg.sos .balao { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; font-weight: 700; }
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { white-space: nowrap; background: var(--card2); border: 1.5px solid var(--borda); border-radius: 99px; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.chips button.sel { background: var(--pri); color: #fff; border-color: var(--pri); }
.linha-envio { display: flex; gap: 8px; align-items: center; }
.linha-envio button { flex-shrink: 0; }

/* ===== Reportar ===== */
.grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.grade button { background: var(--card2); border: 1.5px solid var(--borda); border-radius: 16px; padding: 14px 4px; display: flex; flex-direction: column; align-items: center; gap: 5px; transition: transform .08s, border-color .15s; }
.grade button:active { transform: scale(.95); border-color: var(--pri); }
.grade button b { font-size: 30px; font-weight: 400; }
.grade button span { font-size: 12px; text-align: center; font-weight: 600; }

/* ===== Perto / itens ===== */
.item { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--borda); align-items: center; }
.item .info { flex: 1; min-width: 0; }
.item .info b { display: block; }
.item .info small { color: var(--sub); display: block; font-size: 12.5px; }
.item .preco { color: var(--ok); font-weight: 700; }
.item .acoes { display: flex; gap: 6px; flex-shrink: 0; }
.selo { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--pri-suave); color: var(--pri2); }

/* ===== Menu ===== */
.menu-btn { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 4px; border-bottom: 1px solid var(--borda); text-align: left; }
.menu-btn b { font-size: 22px; font-weight: 400; width: 32px; text-align: center; }
.menu-btn span { flex: 1; font-weight: 600; }
.menu-btn span small { display: block; color: var(--sub); font-size: 12.5px; font-weight: 400; }
.credito-menu { text-align: center; color: var(--sub); font-size: 12.5px; margin: 16px 0 4px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.credito-menu b { color: var(--txt); }
.emerg { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.emerg a { display: flex; flex-direction: column; align-items: center; padding: 14px; border-radius: 14px; background: var(--card2); text-decoration: none; color: var(--txt); border: 1.5px solid var(--borda); }
.emerg a b { font-size: 24px; color: var(--perigo); }
.clima { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-top: 6px; scrollbar-width: none; }
.clima::-webkit-scrollbar { display: none; }
.clima div { background: var(--card2); border-radius: 12px; padding: 8px 10px; text-align: center; font-size: 12px; min-width: 66px; }

/* ===== Toast ===== */
#toast { position: fixed; left: 50%; top: calc(68px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 7px; align-items: center; pointer-events: none; width: 92%; max-width: 440px; }
#toast div { background: #0f172a; color: #fff; padding: 11px 15px; border-radius: 13px; box-shadow: var(--sombra-g); font-size: 14px; animation: desce .2s ease; }

/* ===== Ativar GPS + Bloqueio ===== */
#ativar, #bloqueio { position: fixed; inset: 0; z-index: 3000; background: linear-gradient(160deg, #0b1220, #101a30 60%, #0b1220); display: grid; place-items: center; padding: 22px; }
.ativar-caixa, .bloq-caixa { background: var(--card); border-radius: 24px; padding: 30px 24px; max-width: 390px; width: 100%; text-align: center; box-shadow: var(--sombra-g); animation: sobe .3s ease; }
.ativar-ico, .bloq-ico { font-size: 56px; margin-bottom: 6px; }
.ativar-caixa h2, .bloq-caixa h2 { margin: 6px 0 8px; font-size: 21px; }
.ativar-caixa p, .bloq-caixa p { color: var(--sub); margin: 0 0 20px; }
.ativar-depois { display: block; margin: 12px auto 0; color: var(--sub); font-size: 14px; font-weight: 600; background: none; }
.ativar-ajuda { text-align: left; background: var(--card2); border-radius: 14px; padding: 13px 15px; margin-top: 16px; font-size: 13.5px; color: var(--txt); line-height: 1.5; }
.ativar-ajuda b { color: var(--pri2); }

/* Tela de abertura do viajante */
#intro { position: fixed; inset: 0; z-index: 3100; overflow: auto; padding: 22px 18px; display: flex; flex-direction: column; align-items: center; background: #1572a0; }
.intro-card { position: relative; z-index: 1; margin-top: auto; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-radius: 24px; padding: 26px 22px; max-width: 400px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(8,30,60,.35); animation: sobe .35s ease; }
@media (prefers-color-scheme: dark) { .intro-card { background: rgba(20,28,43,.94); } }
.intro-logo { border-radius: 15px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.intro-card h2 { margin: 10px 0 4px; font-size: 21px; }
.intro-sub { color: var(--sub); margin: 0 0 16px; font-size: 14px; }
.intro-passos { text-align: left; display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.intro-passos > div { display: flex; gap: 11px; align-items: flex-start; background: var(--card2); border-radius: 13px; padding: 11px 13px; font-size: 13.5px; line-height: 1.4; }
.intro-passos b:first-child { font-size: 20px; line-height: 1.2; }
.intro-mascote { margin-top: 14px; font-size: 13px; color: var(--sub); display: flex; align-items: center; justify-content: center; gap: 8px; }
.intro-mascote .caramelo { font-size: 30px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.intro-rodape { position: relative; z-index: 1; margin: 16px 0 auto; text-align: center; color: #fff; font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 7px; text-shadow: 0 1px 4px rgba(0,0,0,.55); }
.intro-rodape b { color: #fff; }

/* Página inicial (praia) */
#bloqueio { overflow: hidden; background: #1572a0; }
.bloq-dica { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--sub); }

/* Cena de fundo: praia animada (mar, nuvens, gaivotas, coqueiros) ou foto de capa com zoom lento */
.cena { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.cena svg { width: 100%; height: 100%; display: block; }
.cena-foto .cena-img { position: absolute; inset: -4%; background: #0b1220 center/cover no-repeat; animation: kenburns 28s ease-in-out infinite alternate; }
.cena-foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,20,40,.15), rgba(8,20,40,.05) 40%, rgba(8,20,40,.55)); }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.12) translate(-2%, -1%); } }
@media (prefers-reduced-motion: reduce) { .cena-foto .cena-img { animation: none; } }
.bloq-caixa { position: relative; z-index: 1; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); }
@media (prefers-color-scheme: dark) { .bloq-caixa { background: rgba(20,28,43,.95); } }
.bloq-logo { display: block; margin: 0 auto 10px; border-radius: 16px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.bloq-rodape { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 1; text-align: center; color: #fff; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center; gap: 7px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.bloq-rodape b { color: #fff; letter-spacing: .02em; }
.dev-ava { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--grad); font-size: 13px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

/* ===== Marcadores ===== */
.mk { position: relative; width: 52px; height: 52px; }
.mk .foto { position: absolute; left: 4px; top: 4px; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--c); background: #fff center/cover;
  box-shadow: 0 3px 10px rgba(0,0,0,.45); display: grid; place-items: center; font-weight: 800; color: var(--c); font-size: 16px; }
.mk.off .foto { filter: grayscale(1); opacity: .78; }
.mk .foto.emoji { background: #fff; }
.mk.on .foto { box-shadow: 0 0 0 3px #22c55e, 0 3px 10px rgba(0,0,0,.45); }
.mk .pulso { position: absolute; left: 4px; top: 4px; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #22c55e; pointer-events: none; animation: mkpulso 2s ease-out infinite; }
@keyframes mkpulso { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mk .pulso, .pilula.ok .pt { animation: none; } }
.mk .nome { position: absolute; top: 51px; left: 50%; transform: translateX(-50%); background: var(--c); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.mk.off .nome { background: #64748b; }
.mk .vel { position: absolute; top: -7px; right: -12px; background: #0f172a; color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 99px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.mk .st { position: absolute; bottom: 3px; right: 2px; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; background: var(--ok); }
.mk.off .st { background: var(--off); }
.mk .seta { position: absolute; inset: -8px; transform: rotate(var(--r)); pointer-events: none; }
.mk .seta::before { content: ""; position: absolute; top: -2px; left: 50%; margin-left: -7px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 11px solid var(--c); filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.mk.eu .foto { box-shadow: 0 0 0 5px rgba(42,109,245,.35), 0 3px 10px rgba(0,0,0,.45); }
.mk .tipo { position: absolute; bottom: -2px; left: -6px; font-size: 16px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.av { width: 44px; height: 44px; display: grid; place-items: center; }
.av svg { width: 40px; height: 40px; fill: var(--c); filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.av-nome { position: absolute; top: 42px; left: 50%; transform: translateX(-50%); background: var(--c); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pr, .al, .lc { display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.pr { width: 36px; height: 36px; font-size: 19px; border: 2.5px solid; border-image: var(--grad) 1; background: #fff; }
.al { width: 38px; height: 38px; font-size: 21px; border: 2.5px solid var(--amar); }
.lc { width: 32px; height: 32px; font-size: 17px; border: 2px solid var(--ok); }
.lc-preco { position: absolute; top: 31px; left: 50%; transform: translateX(-50%); background: var(--ok); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.eu-ponto { width: 20px; height: 20px; border-radius: 50%; background: var(--pri); border: 3px solid #fff; box-shadow: 0 0 0 7px rgba(42,109,245,.22), 0 2px 6px rgba(0,0,0,.3); }
.leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: var(--sombra-g); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13.5px; line-height: 1.45; color: var(--txt); }
.leaflet-popup-content b { font-size: 14.5px; }
.leaflet-popup-tip, .leaflet-popup-content-wrapper { background: var(--card); color: var(--txt); }
.pop-acoes { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.pop-acoes a, .pop-acoes button { font-size: 12.5px; padding: 6px 11px; border-radius: 10px; background: var(--pri-suave); color: var(--pri2); text-decoration: none; font-weight: 650; }

/* ===== Quem está online (abre ao tocar na pílula do topo) ===== */
#quem { position: fixed; top: calc(56px + env(safe-area-inset-top)); right: 10px; z-index: 1200; width: min(340px, calc(100vw - 20px)); max-height: 70vh;
  display: flex; flex-direction: column; background: var(--card); border-radius: 18px; box-shadow: var(--sombra-g); border: 1px solid var(--borda); overflow: hidden; animation: desce .2s ease; }
.quem-cab { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--borda); }
.quem-cab b { font-size: 15px; }
.quem-x { width: 30px; height: 30px; border-radius: 50%; background: var(--card2); font-size: 14px; }
.quem-corpo { overflow: auto; padding: 4px 8px 10px; }
.quem-sec { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--sub); padding: 10px 6px 4px; }
.quem-sec i { width: 8px; height: 8px; border-radius: 50%; background: var(--off); }
.quem-sec.on i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.quem-sec span { margin-left: auto; background: var(--card2); border-radius: 99px; padding: 1px 8px; font-size: 11px; }
.quem-p { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 6px; border-radius: 12px; text-align: left; }
.quem-p:hover, .quem-p:active { background: var(--card2); }
.qf { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--c); background: var(--card2) center/cover; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--c); }
.qf:not(.on) { filter: grayscale(.85); opacity: .75; }
.qf i { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--off); border: 2px solid var(--card); }
.qf.on i { background: #22c55e; }
.qf.on { box-shadow: 0 0 0 3px rgba(34,197,94,.3); }
.qi { flex: 1; min-width: 0; }
.qi b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi small { display: block; color: var(--sub); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qv { color: var(--sub); font-size: 20px; }
.quem-vazio { color: var(--sub); font-size: 13px; padding: 4px 8px 8px; margin: 0; }

/* ===== Chat: faixa de quem está online ===== */
.chat-online { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 14px; background: var(--card2); }
.co-rostos { display: flex; flex-shrink: 0; }
.co-rostos:empty { display: none; }
.co-p { position: relative; margin-left: -8px; }
.co-p:first-child { margin-left: 0; }
.co-f { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--c); background: #fff center/cover; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--c); box-shadow: 0 0 0 2px var(--card2); }
.co-p i { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; border: 2px solid var(--card2); }
.co-txt { font-size: 12.5px; color: var(--sub); line-height: 1.3; }
.co-txt b { color: #15803d; }

/* ===== Perto de mim ===== */
.perto-grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.pg { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px; border-radius: 14px; background: var(--card2); border: 2px solid transparent; transition: transform .08s, border-color .15s; }
.pg:active { transform: scale(.95); }
.pg-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--c) 14%, transparent); }
.pg-nome { font-size: 11.5px; font-weight: 650; text-align: center; line-height: 1.15; }
.pg.sel { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, var(--card)); }
.pg-on { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.perto-ativos { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; font-size: 12.5px; color: var(--sub); }
.chip-on { padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; background: var(--c); }
.chip-limpar { padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--card2); border: 1.5px solid var(--borda); }
.perto-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--c) 9%, var(--card)); border: 1.5px solid color-mix(in srgb, var(--c) 30%, transparent); margin-top: 4px; }
.perto-barra b { font-size: 15px; }
.chave { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 700; }
.chave input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chave-trilho { position: relative; width: 44px; height: 26px; border-radius: 99px; background: #cbd5e1; transition: background .2s; flex-shrink: 0; }
.chave-trilho::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.chave input:checked + .chave-trilho { background: #22c55e; }
.chave input:checked + .chave-trilho::after { transform: translateX(18px); }
.chave input:focus-visible + .chave-trilho { outline: 3px solid var(--pri-suave); }
.raio { display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; font-size: 12.5px; color: var(--sub); }
.raio button { padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: var(--card2); border: 1.5px solid var(--borda); }
.raio button.sel { background: var(--pri); color: #fff; border-color: var(--pri); }
.item-dist { flex-shrink: 0; min-width: 58px; text-align: center; font-size: 12px; font-weight: 800; padding: 6px 6px; border-radius: 10px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.carregando-mini { display: flex; align-items: center; gap: 10px; color: var(--sub); padding: 18px 4px; font-size: 13.5px; line-height: 1.35; }
.carregando-mini small { font-size: 12px; opacity: .85; }
.carregando-mini .spin { flex-shrink: 0; }
.aviso-perto { background: #fff7e0; color: #7a5200; border: 1px solid #fde68a; border-radius: 12px; padding: 9px 12px; font-size: 13px; margin: 10px 0 4px; }
@media (prefers-color-scheme: dark) { .aviso-perto { background: #2a2410; color: #f0c96a; border-color: #4a3f16; } }
.link-btn { color: var(--pri); font-weight: 700; text-decoration: underline; padding: 0; }
.carregando-mini .spin { width: 18px; height: 18px; border: 3px solid var(--borda); border-top-color: var(--pri); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.pin-perto { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-size: 16px; background: #fff; border: 3px solid var(--c); box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.pin-perto.destaque { font-size: 20px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 30%, transparent), 0 4px 10px rgba(0,0,0,.4); animation: sobe .3s ease; }

/* ===== Tablet / PC: folha vira painel lateral ===== */
@media (min-width: 760px) {
  #folha { left: auto; right: 14px; width: 420px; bottom: calc(var(--barra-h) + 14px); border-radius: 22px; max-height: 78vh; }
  .folha-puxador { display: none; }
  #avisos { right: 90px; max-width: 520px; left: auto; width: 60vw; }
  #botoes-dir { transition: right .25s ease; }
  body.folha-aberta #botoes-dir { right: 448px; }
}

/* ===== Central do carro / paisagem baixa: navegação vira trilho lateral ===== */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --barra-h: 0px; }
  #mapa { bottom: 0; left: 76px; }
  #topo { left: 76px; }
  #barra { top: 0; bottom: 0; left: 0; right: auto; width: 76px; height: 100%; flex-direction: column; justify-content: center; gap: 6px;
    border-top: 0; border-right: 1px solid var(--borda); padding: 8px 0; }
  #barra button b { font-size: 22px; }
  #barra button.destaque b { margin-top: 0; width: 46px; height: 46px; font-size: 22px; }
  #botoes-dir, body.folha-aberta #botoes-dir { bottom: 14px; right: 14px; flex-direction: row; }
  #folha { left: 76px; right: auto; width: 380px; bottom: 12px; top: 64px; max-height: none; }
  #avisos { left: 86px; right: auto; width: 50vw; top: 10px; }
  #sos-faixa { left: 76px; }
}
