/**
 * entorno.css — estilos do "Mapa do Entorno / Qualidade de Vida".
 * Uma responsabilidade: o visual do card inferior e dos elementos do entorno.
 *
 * Convenções: prefixo .ent- em tudo, para isolar do resto da página.
 * Cores reaproveitam as variáveis do tema (:root).
 *
 * Layout: em vez de um drawer lateral, o painel é um CARD ancorado ACIMA do
 * menu inferior (como o "corretor minimizado") — ocupa menos espaço, deixa o
 * mapa livre e funciona bem no mobile.
 */

/* ── Card do entorno (ancorado acima do menu inferior) ─────────────────────── */
.ent-painel {
  position: fixed;
  left: 50%;
  bottom: 92px;                       /* acima do menu inferior (.navdock) */
  width: min(420px, 94vw);
  max-height: 54vh;
  /* Fundo branco sólido (mais legível e limpo, preferência do Alex). */
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1180;                      /* acima do mapa, sem cobrir o menu */
  transform: translateX(-50%) translateY(140%);   /* escondido por baixo */
  opacity: 0;
  transition: transform 0.30s cubic-bezier(0.22, 0.7, 0.25, 1), opacity 0.25s ease;
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  color: var(--escuro, #0b2e1f);
}
.ent-painel.ent-aberto { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Cabeçalho ─────────────────────────────────────────────────────────────── */
.ent-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 14px;
  background: linear-gradient(135deg, #009a4c, #00b862);
  color: #fff;
  flex-shrink: 0;
  cursor: default;                     /* modal fixo: não se arrasta mais */
  user-select: none;
  touch-action: auto;
}
.ent-head .ent-folha { display: flex; opacity: 0.95; }
.ent-head .ent-titulo {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  flex: 1;
  line-height: 1.2;
}
.ent-min-btn,
.ent-exp-btn,
.ent-fechar {
  border: 0;
  background: rgba(255, 255, 255, 0.20);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}
.ent-min-btn svg,
.ent-exp-btn svg,
.ent-fechar svg { width: 15px; height: 15px; }
.ent-min-btn:hover,
.ent-exp-btn:hover,
.ent-fechar:hover { background: rgba(255, 255, 255, 0.34); }
/* Seta de expandir: só no mobile (no desktop o painel já é a aba lateral inteira). */
@media (min-width: 1024px) { .ent-exp-btn { display: none; } }
/* No mobile o compacto já libera a tela, então o "minimizar pra barra" (›) fica
   redundante e polui (duas setas). Mostra só a seta de expandir/recolher (↑/↓). */
@media (max-width: 1023px) { .ent-min-btn { display: none; } }

/* ── Subcabeçalho: o imóvel em análise ─────────────────────────────────────── */
.ent-imovel {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(11, 46, 31, 0.10);
  flex-shrink: 0;
}
.ent-imovel .ent-nome { font-size: 13.5px; font-weight: 800; line-height: 1.2; text-shadow: 0 1px 3px rgba(255, 255, 255, 0.85); }
.ent-imovel .ent-preco { font-size: 12.5px; font-weight: 800; color: #0a7d3f; margin-top: 1px; text-shadow: 0 1px 3px rgba(255, 255, 255, 0.85); }
.ent-imovel .ent-local { font-size: 11px; color: #3c4a43; margin-top: 2px; text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8); }

/* ── Corpo rolável ─────────────────────────────────────────────────────────── */
.ent-corpo {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 14px;
  -webkit-overflow-scrolling: touch;
}

/* ── Rodapé fixo com o botão FECHAR (largura total, não rola) ───────────────── */
.ent-rodape {
  flex-shrink: 0;
  padding: 10px 12px;
  border-top: 1px solid rgba(11, 46, 31, 0.10);
  background: #fff;
}
.ent-fechar-btn {
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, #009a4c, #00b862);
  color: #fff;
  font: 800 13px Montserrat, sans-serif;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.ent-fechar-btn:hover { filter: brightness(1.06); }

/* ── Estado minimizado: só o cabeçalho, como barra sobre o menu ────────────── */
.ent-painel.ent-min { max-height: none; width: min(320px, 88vw); }
.ent-painel.ent-min .ent-imovel,
.ent-painel.ent-min .ent-corpo,
.ent-painel.ent-min .ent-rodape { display: none; }

/* ══ Estado COMPACTO (mobile): TUDO da tela cheia, porém ESPREMIDO ════════════
 * Mostra o mesmo conteúdo do modo cheio (nota + pilares + detalhe + categorias +
 * raio), só que com fontes/paddings reduzidos pra caber numa faixa baixa e deixar
 * o mapa o mais visível possível. Some só o "peso morto": info detalhada, o
 * "Entenda a nota", observações, o título/So-status da seção e a lista longa de
 * pontos (esses ficam pro modo tela cheia). A seta ↑ expande pra cheio.
 * (No desktop o painel é a aba lateral inteira — o compacto não se aplica.)
 * ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .ent-painel.ent-compacto {
    bottom: 12px;                   /* mais embaixo: sem o dock ocupando a base */
    max-height: min(72vh, 580px);  /* cresce pra caber tudo; rola se faltar */
    border-radius: 26px;           /* cantos bem arredondados no compacto */
  }
  .ent-painel.ent-compacto .ent-corpo {
    overflow-y: auto;              /* se não couber, rola dentro do próprio card */
    padding: 8px 12px 8px;
  }
  /* Some só o peso morto (fica pro modo tela cheia). */
  .ent-painel.ent-compacto .ent-info,
  .ent-painel.ent-compacto .ent-score-obs,
  .ent-painel.ent-compacto .ent-score-exp,
  .ent-painel.ent-compacto .ent-sec-perto .ent-sec-tit,
  .ent-painel.ent-compacto .ent-status,
  .ent-painel.ent-compacto [data-ent="lista"] { display: none; }

  /* --- Cabeçalho + imóvel enxutos --- */
  .ent-painel.ent-compacto .ent-head { padding: 8px 8px 8px 14px; }
  .ent-painel.ent-compacto .ent-imovel { padding: 5px 14px; }
  .ent-painel.ent-compacto .ent-imovel .ent-nome { font-size: 12.5px; }
  .ent-painel.ent-compacto .ent-imovel .ent-preco { font-size: 11.5px; }
  .ent-painel.ent-compacto .ent-imovel .ent-local { font-size: 10px; }

  /* --- Score espremido: nota + barras + detalhe, tudo menor --- */
  .ent-painel.ent-compacto .ent-score { margin-bottom: 8px; padding: 9px 10px; }
  .ent-painel.ent-compacto .ent-score-top { gap: 9px; margin-bottom: 7px; }
  .ent-painel.ent-compacto .ent-score-nota { width: 40px; height: 40px; font-size: 16px; border-radius: 11px; }
  .ent-painel.ent-compacto .ent-score-tit { font-size: 9px; }
  .ent-painel.ent-compacto .ent-score-rot { font-size: 13px; }
  .ent-painel.ent-compacto .ent-score-bar { grid-template-columns: 62px 1fr 22px; gap: 6px; margin-bottom: 4px; }
  .ent-painel.ent-compacto .ent-score-bl { font-size: 9.5px; }
  .ent-painel.ent-compacto .ent-score-bt { height: 6px; }
  .ent-painel.ent-compacto .ent-score-bv { font-size: 10.5px; }
  .ent-painel.ent-compacto .ent-score-det { font-size: 9.5px; margin-top: 4px; }

  /* --- Seções coladas --- */
  .ent-painel.ent-compacto .ent-sec { margin-bottom: 8px; }
  .ent-painel.ent-compacto .ent-sec-raio { margin-bottom: 8px; }
  .ent-painel.ent-compacto .ent-sec-perto { margin-bottom: 0; }

  /* --- Raio espremido --- */
  .ent-painel.ent-compacto .ent-raio { gap: 5px; }
  .ent-painel.ent-compacto .ent-raio-lbl { font-size: 9.5px; margin-bottom: 1px; }
  .ent-painel.ent-compacto .ent-raio-btn { padding: 4px 9px; font-size: 11px; }

  /* --- Categorias (chips) espremidas: menores, quebrando linha --- */
  .ent-painel.ent-compacto .ent-chips { gap: 5px; }
  .ent-painel.ent-compacto .ent-chip { padding: 4px 8px; font-size: 10.5px; gap: 4px; }
  .ent-painel.ent-compacto .ent-chip-ic svg { width: 13px; height: 13px; }
  .ent-painel.ent-compacto .ent-chip-n { font-size: 9.5px; }

  /* ── Expandido (seta ↑): ocupa a TELA CHEIA no mobile ────────────────────── */
  .ent-painel:not(.ent-compacto):not(.ent-min) {
    top: 0;
    bottom: 0;
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* ── Loader de carregamento ("Carregando locais…") + congelamento de cliques ─
 * Enquanto busca os locais, o conteúdo do entorno some e fica SÓ um loader
 * (spinner + texto), pra não mostrar painel meio vazio. Liberado em _loadingOff. */
.ent-narra { display: none; }
.ent-painel.ent-carregando .ent-narra {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--verde, #00a652);
}
.ent-painel.ent-carregando .ent-narra::before {
  content: '';
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid rgba(0, 166, 82, 0.22);
  border-top-color: var(--verde, #00a652);
  animation: entRotaSpin 0.8s linear infinite;   /* reusa o spin da rota */
}
@keyframes entPulsa { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
/* Durante o carregamento, esconde TODO o conteúdo do entorno (mostra só o loader):
   score, informações, status, chips, a seção "o que há por perto" e a lista. */
.ent-painel.ent-carregando .ent-score,
.ent-painel.ent-carregando .ent-info,
.ent-painel.ent-carregando .ent-status,
.ent-painel.ent-carregando .ent-chips,
.ent-painel.ent-carregando .ent-sec-perto,
.ent-painel.ent-carregando [data-ent="lista"] { display: none; }

/* Overlay invisível que congela QUALQUER clique (mapa e modal) ao carregar. */
.ent-bloqueio {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  cursor: progress;
}
.ent-bloqueio.ent-on { pointer-events: auto; }

/* ── Seletor de raio configurável ──────────────────────────────────────────── */
.ent-raio {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 11px;
}
.ent-raio-lbl {
  width: 100%;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #37443d;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}
.ent-raio-btn {
  border: 1.5px solid #e2e8e5;
  background: #fff;
  color: var(--cinza, #667);
  border-radius: 8px;
  padding: 5px 11px;
  font: 700 12px Montserrat, sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ent-raio-btn.on { background: var(--verde, #00a652); color: #fff; border-color: transparent; }
.ent-raio-btn:hover { transform: translateY(-1px); }

/* ── Status (carregando / total de pontos) ─────────────────────────────────── */
.ent-status {
  font-size: 12px;
  font-weight: 600;
  color: #37443d;
  margin-bottom: 8px;
  min-height: 16px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}
.ent-status.ent-erro { color: var(--erro, #b3261e); }
.ent-retry {
  display: inline-block;
  margin-top: 4px;
  border: 0;
  background: var(--verde, #00a652);
  color: #fff;
  font: 700 11px Montserrat, sans-serif;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.ent-retry:hover { filter: brightness(1.06); }

/* ── Chips de categoria (ligar/desligar POIs no mapa) ──────────────────────── */
.ent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid #e2e8e5;
  background: #fff;
  color: var(--cinza, #667);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.ent-chip-ic { display: inline-flex; }
.ent-chip-ic svg { width: 15px; height: 15px; display: block; }
.ent-chip-n { font-size: 11px; opacity: 0.75; }
.ent-chip.on { color: #fff; border-color: transparent; }
.ent-chip.off { opacity: 0.6; }
.ent-chip:hover { transform: translateY(-1px); }

/* ── Marcador de POI no mapa: círculo na cor da categoria + ícone SVG branco ── */
.ent-poi {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.ent-poi:hover { transform: translate(-50%, -50%) scale(1.16); }
.ent-poi svg { width: 19px; height: 19px; color: #fff; }

/* ── CLUSTER por categoria em CÁPSULA (ícone da categoria + nº de locais) ─────
 * Uma pílula na cor da categoria, borda branca + sombra (mesma linguagem do POI),
 * mostrando o ÍCONE da categoria e o NÚMERO de locais agrupados lado a lado. Abre
 * ao dar zoom (markercluster). Reduz a poluição de bolinhas sobrepostas. */
.ent-cluster {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 7px;
  border-radius: 999px;                 /* cápsula/pílula */
  border: 2.5px solid #fff;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  color: #fff;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.ent-cluster:hover { transform: translate(-50%, -50%) scale(1.08); }
.ent-cluster-ic { display: inline-flex; }
.ent-cluster-ic svg { width: 16px; height: 16px; color: #fff; }
.ent-cluster-n { font: 800 12px Montserrat, sans-serif; color: #fff; }

/* Mini-modal de informação (popup ao clicar num POI). */
.ent-pop { font-family: Montserrat, sans-serif; padding: 9px 12px; min-width: 130px; }
.ent-pop-nome { font-size: 13px; font-weight: 800; color: var(--escuro, #0b2e1f); line-height: 1.25; }
.ent-pop-cat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cinza, #667);
  margin-top: 4px;
}
.ent-pop-ic { display: inline-flex; }
.ent-pop-ic svg { width: 14px; height: 14px; display: block; }
/* Distância única (discreta) à direita da categoria — vale para todos os modos. */
.ent-pop-dist { margin-left: auto; padding-left: 8px; font-size: 11px; font-weight: 700; color: var(--verde, #00a652); white-space: nowrap; }
.ent-pop-dist:empty { display: none; }

/* ── FASE 2.3b — Mini-modal rico do POI (distâncias + Google + 360°) ────────── */
.ent-pop-rico { min-width: 200px; max-width: 250px; }
.ent-pop-fotos:empty { display: none; }
.ent-foto-wrap { position: relative; margin: 7px 0 5px; }
.ent-foto-img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  border-radius: 9px;
  display: block;
}
.ent-foto-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ent-foto-nav:hover { background: rgba(0, 0, 0, 0.72); }
.ent-foto-prev { left: 6px; }
.ent-foto-next { right: 6px; }
.ent-foto-cont {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font: 700 10px Montserrat, sans-serif;
  padding: 1px 6px;
  border-radius: 8px;
}
.ent-pop-rating {
  font-size: 12px;
  font-weight: 700;
  color: #2a3430;
  margin: 2px 0 4px;
}
.ent-pop-rating:empty { display: none; }
.ent-estrelas { color: #f5a623; letter-spacing: 1px; }
.ent-pop-count { color: #8892a0; font-weight: 600; }
.ent-pop-dists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.ent-pop-d {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #f4f8f6;
  border: 1px solid #e3ece7;
  border-radius: 10px;
  padding: 7px 4px;
  text-align: center;
}
.ent-pop-di { display: inline-flex; color: var(--verde, #00a652); }
.ent-pop-di svg { width: 18px; height: 18px; display: block; }
.ent-pop-dv { font-size: 13px; font-weight: 800; color: #1f2a24; line-height: 1.1; }
.ent-pop-dl {
  font-size: 9px;
  font-weight: 700;
  color: #6b7772;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ent-pop-acoes { margin-top: 9px; display: flex; flex-direction: column; gap: 7px; }
.ent-pop-rota {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  background: linear-gradient(135deg, #009a4c, #00b862);
  color: #fff !important;               /* texto branco sobre o verde (vence o link do Leaflet) */
  font: 800 11.5px Montserrat, sans-serif;
  letter-spacing: 0.3px;
  padding: 10px;
  border-radius: 9px;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0, 150, 82, 0.28);
  transition: filter 0.15s ease;
}
.ent-pop-rota:hover { filter: brightness(1.04); text-decoration: none; }
/* FASE A8 — botão "Ver rota no mapa" (ação primária: desenha no próprio mapa). */
.ent-pop-rotamapa {
  width: 100%;
  border: 0;
  text-align: center;
  background: linear-gradient(135deg, #009a4c, #00b862);
  color: #fff;
  font: 800 12px Montserrat, sans-serif;
  letter-spacing: 0.3px;
  padding: 11px;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 150, 82, 0.28);
  transition: filter 0.15s ease;
}
.ent-pop-rotamapa:hover { filter: brightness(1.06); }
/* O "Abrir no Google Maps" vira ação SECUNDÁRIA (contorno), pra não competir. */
.ent-pop-rota { background: transparent; color: var(--verde, #00a652) !important; border: 1.5px solid var(--verde, #00a652); box-shadow: none; }
.ent-pop-rota:hover { background: rgba(0,166,82,.08); }

/* Faixa flutuante com a rota ativa (tempo/distância + fechar). */
.ent-rota-banner {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 1250;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 92vw;
  padding: 9px 10px 9px 15px;
  /* elevado: fica ACIMA do dock da Comunidade PMI (não sobrepõe). */
  background: linear-gradient(135deg, #009a4c, #00b862);
  color: #fff;
  border-radius: 26px;
  box-shadow: 0 8px 26px rgba(0, 120, 66, 0.45);
  font-family: Montserrat, sans-serif;
  animation: entRotaSobe 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes entRotaSobe { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.ent-rota-nome { font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.ent-rota-info { font-size: 11.5px; font-weight: 700; opacity: 0.92; white-space: nowrap; }
.ent-rota-x { flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.22); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.ent-rota-x:hover { background: rgba(255, 255, 255, 0.34); }
/* Com a comunidade dividindo a tela, a faixa centraliza na METADE do mapa. */
body.feed-split .ent-rota-banner { left: calc((100vw - var(--comu-w, 50vw)) / 2); }
@media (max-width: 640px) { .ent-rota-banner { top: 14px; } }

/* NEON mais nítido: brilho suave em volta do traço verde. */
.ent-rota-neon { filter: drop-shadow(0 0 4px rgba(0,255,123,.9)) drop-shadow(0 0 1px rgba(0,255,123,1)); }

/* Telinha NO MEIO da rota: distância + tempos (a pé/moto/bike/carro). Não bloqueia o
   mapa e SEGUE O TEMA (claro/escuro/translúcido) via tokens --sup-*. */
.ent-rota-mid { pointer-events: none; background: transparent !important; border: 0 !important; }
.ent-rota-mid-card { transform: translate(-50%, -50%); width: max-content; max-width: 62vw;
  background: var(--sup-bg); color: var(--sup-txt); border: 1.5px solid var(--verde); border-radius: 13px;
  padding: 8px 12px 9px; box-shadow: 0 8px 22px rgba(0,0,0,.4);
  backdrop-filter: var(--sup-blur); -webkit-backdrop-filter: var(--sup-blur); font-family: Montserrat, sans-serif; }
.ent-rmc-km { text-align: center; font-size: 12px; font-weight: 800; color: var(--verde); margin-bottom: 6px; letter-spacing: .2px; }
.ent-rmc-modos { display: grid; grid-template-columns: auto auto; gap: 5px 16px; }
.ent-rmc-i { display: flex; align-items: center; gap: 5px; font-size: 10.5px; line-height: 1; white-space: nowrap; color: var(--sup-txt); }
.ent-rmc-i svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--verde); }
.ent-rmc-i b { font-weight: 800; }
.ent-rmc-i i { font-style: normal; opacity: .62; }

/* Marcador de PARTIDA (arrastável) — verde neon, com anel pulsante pra chamar. */
.ent-start-pin { position: relative; width: 32px; height: 32px; border-radius: 50%; background: #00ff7b;
  border: 3px solid #fff; box-shadow: 0 3px 12px rgba(0,0,0,.5); display: flex; align-items: center;
  justify-content: center; color: #063; cursor: grab; }
.ent-start-pin:active { cursor: grabbing; }
.ent-start-pin::before { content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(0,255,123,.6); animation: entStartPulse 1.6s ease-out infinite; }
@keyframes entStartPulse { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }

/* Loader de tela cheia enquanto calcula a rota (com blur). */
.ent-rota-loader { position: fixed; inset: 0; z-index: 3200; display: flex; align-items: center; justify-content: center;
  background: rgba(6,20,14,.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: entRotaFade .18s ease; }
/* Com a Comunidade aberta, o loader cobre e centraliza só na METADE do mapa (não
   passa por baixo do feed) — fica centralizado na área visível do mapa. */
body.feed-split .ent-rota-loader { right: var(--comu-w, 50vw); }
@keyframes entRotaFade { from { opacity: 0; } to { opacity: 1; } }
.ent-rota-loader-box { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 26px 32px;
  border-radius: 18px; background: rgba(10,22,16,.78); box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.ent-rota-spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(0,255,123,.22);
  border-top-color: #00ff7b; animation: entRotaSpin .8s linear infinite; }
@keyframes entRotaSpin { to { transform: rotate(360deg); } }
.ent-rota-loader-tx { color: #fff; font: 800 14px Montserrat, sans-serif; letter-spacing: .3px; }
.ent-pop-360 {
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, #009a4c, #00b862);
  color: #fff;
  font: 800 11px Montserrat, sans-serif;
  letter-spacing: 0.5px;
  padding: 8px;
  border-radius: 9px;
  cursor: pointer;
}
.ent-pop-360:hover { filter: brightness(1.06); }
.ent-pop-glink {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
  text-align: center;
}
.ent-pop-glink:hover { text-decoration: underline; }

/* Visor StreetView 360° em overlay. */
#ent-360 {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ent-360-box {
  width: min(780px, 94vw);
  height: min(520px, 80vh);
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.55);
}
.ent-360-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #0b2e1f;
  color: #fff;
  font: 700 13px Montserrat, sans-serif;
}
.ent-360-x {
  border: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.ent-360-pano { flex: 1; }

/* ── Modo entorno: esconde o carrossel do topo e a faixa de contagem ───────── */
body.ent-modo .carrossel,
body.ent-modo .faixa,
body.rota-ativa .carrossel,
body.rota-ativa .faixa {
  opacity: 0 !important;
  transform: translateX(-50%) translateY(-130%) !important;
  pointer-events: none !important;
}

/* ── Modo entorno: esconde TAMBÉM o menu inferior (navdock) — mobile e desktop.
 * Sem o dock ocupando a base, o card compacto do entorno fica com o mapa livre.
 * Fade sem transladar (o dock some no lugar), pra não brigar com o card. ────── */
body.ent-modo .navdock,
body.ent-modo .cseta,
body.ent-modo #contador {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Mobile: o card ocupa quase toda a largura, ainda acima do menu ────────── */
@media (max-width: 560px) {
  .ent-painel {
    width: 96vw;
    bottom: 88px;
    max-height: 62vh;
    border-radius: 18px;
  }
}

/* ── Score / Índice de Qualidade de Vida (IQV) ─────────────────────────────── */
.ent-score {
  background: #f4f8f6;
  border: 1px solid #e3ece7;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}
.ent-score-load {
  font-size: 12px;
  font-weight: 600;
  color: #5a675f;
  text-align: center;
  padding: 6px 0;
}
.ent-score-top { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.ent-score-nota {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  color: #fff;
  font: 800 21px Montserrat, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}
.ent-score-tit {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5a675f;
}
.ent-score-rot { font-size: 15px; font-weight: 800; color: #16241d; line-height: 1.2; }
.ent-score-bar { display: grid; grid-template-columns: 72px 1fr 26px; align-items: center; gap: 8px; margin-bottom: 7px; }
.ent-score-bl { font-size: 11px; font-weight: 700; color: #37443d; }
.ent-score-bt { height: 8px; background: #e0e8e4; border-radius: 6px; overflow: hidden; }
.ent-score-bf { display: block; height: 100%; border-radius: 6px; transition: width 0.5s ease; }
.ent-score-bv { font-size: 12px; font-weight: 800; color: #16241d; text-align: right; }
.ent-score-det { font-size: 11px; font-weight: 600; color: #4a5751; margin-top: 5px; }
.ent-score-obs { font-size: 10px; color: #8a938e; margin-top: 6px; font-style: italic; line-height: 1.35; }

/* "Entenda a nota" — bloco recolhível com o detalhamento por categoria. */
.ent-score-exp { margin-top: 9px; }
.ent-score-exp summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  color: #0a7d3f;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}
.ent-score-exp summary::-webkit-details-marker { display: none; }
.ent-score-exp summary::before { content: "\24d8"; font-size: 13px; }  /* ⓘ */
.ent-exp-body { margin-top: 8px; }
.ent-exp-h { font-size: 11px; color: #4a5751; margin: 8px 0 5px; line-height: 1.4; }
.ent-exp-lst { list-style: none; margin: 0; padding: 0; }
.ent-exp-lst li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  padding: 4px 0;
  border-bottom: 1px solid #eef2f0;
}
.ent-exp-lst li span:first-child { font-weight: 700; color: #37443d; }
.ent-exp-lst li span:last-child { color: #5a675f; text-align: right; white-space: nowrap; }
.ent-exp-foot { font-size: 10px; color: #8a938e; margin-top: 8px; font-style: italic; line-height: 1.4; }

/* ── Seções do corpo: títulos e agrupamento para leitura fácil ─────────────── */
.ent-sec { margin-bottom: 14px; }
.ent-sec:last-child { margin-bottom: 0; }
.ent-sec-tit {
  margin: 0 0 9px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #37443d;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ent-sec-tit::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(180deg, #00b862, #009a4c);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * DESKTOP / TELAS GRANDES (≥1024px): o painel vira uma ABA LATERAL rolável,
 * colada na borda direita, de altura cheia, com colapso para um trilho fino.
 * (No mobile/telas menores segue o card inferior definido acima.)
 * ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  .ent-painel {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(520px, 40vw);            /* mais larga: distribui melhor os dados */
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.16);
    transform: translateX(100%);              /* escondida à direita */
  }
  .ent-painel.ent-aberto { transform: translateX(0); }

  /* Cabeçalho não é mais "arrastável" no desktop. */
  .ent-head { cursor: default; touch-action: auto; padding: 15px 16px; }
  .ent-head .ent-titulo { font-size: 12.5px; }

  /* Imóvel em análise — maior e mais legível (inclusive p/ idosos). */
  .ent-imovel { padding: 15px 16px; }
  .ent-imovel .ent-nome { font-size: 16px; }
  .ent-imovel .ent-preco { font-size: 15px; margin-top: 3px; }
  .ent-imovel .ent-local { font-size: 13px; margin-top: 3px; }

  /* Corpo rolável com barra de rolagem visível e confortável. */
  .ent-corpo {
    padding: 16px 16px 30px;
    font-size: 13.5px;
    scrollbar-width: thin;
    scrollbar-color: #c6d3cc transparent;
  }
  .ent-corpo::-webkit-scrollbar { width: 11px; }
  .ent-corpo::-webkit-scrollbar-thumb {
    background: #cdd8d2;
    border-radius: 9px;
    border: 3px solid #fff;
  }
  .ent-corpo::-webkit-scrollbar-thumb:hover { background: #b1c0b8; }

  .ent-sec-tit { font-size: 11.5px; }
  .ent-raio-lbl { font-size: 11px; }
  .ent-raio-btn { padding: 7px 15px; font-size: 13px; }
  .ent-chip { padding: 8px 14px; font-size: 13px; }
  .ent-chip-ic svg { width: 16px; height: 16px; }
  .ent-status { font-size: 13px; }

  /* ── Minimizado no desktop: trilho fino colado na borda direita ─────────── */
  .ent-painel.ent-min {
    width: 52px;
    height: 100vh;
    max-height: 100vh;
  }
  .ent-painel.ent-min .ent-head {
    flex-direction: column;
    height: 100%;
    padding: 16px 0;
    gap: 16px;
    justify-content: flex-start;
    align-items: center;
    cursor: pointer;
  }
  /* Título deitado (vertical) ao lado da seta, no trilho minimizado. */
  .ent-painel.ent-min .ent-titulo {
    display: block;
    flex: 0 0 auto;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    margin: 2px 0 0;
    font-size: 11px;
    letter-spacing: 1.2px;
    opacity: 0.95;
  }
  .ent-painel.ent-min .ent-imovel,
  .ent-painel.ent-min .ent-corpo { display: none; }
  .ent-painel.ent-min .ent-folha { display: none; }               /* limpa o trilho */
  .ent-painel.ent-min .ent-fechar { order: -2; }                  /* "×" no TOPO, acima da seta */
  .ent-painel.ent-min .ent-min-btn { order: -1; transform: rotate(-90deg); }  /* seta logo abaixo do × */
}

/* ===== AJUSTES DE TELA — o painel do Entorno segue o tema global (tokens --sup-*
   definidos no index). PADRÃO branco por padrão; VIDRO FOSCO deixa translúcido. ===== */
.ent-painel {
  background: var(--sup-bg, #fff) !important;
  backdrop-filter: var(--sup-blur, none); -webkit-backdrop-filter: var(--sup-blur, none);
  border-color: var(--sup-borda, rgba(0,0,0,.06)) !important;
}
html[data-a11y="acromatopsia"] .ent-painel img,
html[data-a11y="acromatopsia"] .ent-imovel img { filter: grayscale(1) contrast(1.08) !important; }
html[data-contorno="1"] .ent-painel button,
html[data-contorno="1"] .ent-painel { outline: 2.5px solid #06231a !important; outline-offset: 1px; }

/* MODO ESCURO — texto claro no painel do Entorno (o preço fica verde, como marca). */
html[data-tema="escuro"] .ent-painel { color: #e9edeb; }
html[data-tema="escuro"] .ent-painel .ent-local,
html[data-tema="escuro"] .ent-painel .ent-raio-btn,
html[data-tema="escuro"] .ent-painel .ent-score-rot,
html[data-tema="escuro"] .ent-painel .ent-score-bl,
html[data-tema="escuro"] .ent-painel .ent-score-bv,
html[data-tema="escuro"] .ent-painel .ent-score-det,
html[data-tema="escuro"] .ent-painel .ent-score-obs,
html[data-tema="escuro"] .ent-painel .ent-exp-h,
html[data-tema="escuro"] .ent-painel .ent-exp-foot,
html[data-tema="escuro"] .ent-painel .ent-exp-lst li span { color: #cfd8d3 !important; }
html[data-tema="escuro"] .ent-painel .ent-local { text-shadow: none !important; }
/* Chips de categoria mantêm a COR da categoria em QUALQUER tema (a cor vem inline:
   fundo no chip LIGADO, ícone no DESLIGADO). No escuro só ajustamos o chip
   DESLIGADO para casar com o painel, sem tirar a identidade da categoria; o
   LIGADO fica com texto branco sobre o fundo colorido. */
html[data-tema="escuro"] .ent-painel .ent-chip.on { color: #fff !important; }
html[data-tema="escuro"] .ent-painel .ent-chip:not(.on) {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.20) !important;
  color: #cfd8d3;
}
html[data-tema="escuro"] .ent-raio-btn { background: rgba(255,255,255,.06) !important; border-color: rgba(255,255,255,.16) !important; }
html[data-tema="escuro"] .ent-raio-btn.on { background: var(--verde, #00a652) !important; color: #fff !important; }

/* Escuro/Translúcido: mata os text-shadows BRANCOS (viram halo feio) em TODO o
   painel e nos popups de POI; e clareia os textos que ainda ficavam escuros. */
html[data-tema="escuro"] .ent-painel *, html[data-tema="vidro"] .ent-painel *,
html[data-tema="escuro"] .ent-pop *,   html[data-tema="vidro"] .ent-pop * { text-shadow: none !important; }
html[data-tema="escuro"] .ent-imovel .ent-nome,
html[data-tema="escuro"] .ent-head .ent-titulo,
html[data-tema="escuro"] .ent-status,
html[data-tema="escuro"] .ent-raio-lbl,
html[data-tema="escuro"] .ent-pop-nome { color: #e9edeb !important; }
html[data-tema="escuro"] .ent-pop-cat { color: #b9c4bd !important; }
/* POI popup (leaflet) segue o translúcido/escuro no fundo também. */
html[data-tema="escuro"] .ent-pop-d { background: rgba(255,255,255,.08) !important; }
html[data-tema="escuro"] .ent-pop-dv { color: #e9edeb !important; }
html[data-tema="escuro"] .ent-pop-dl { color: #9fb0a8 !important; }

/* ── ESCURO: superfícies internas escuras (senão card e chips ficam com fundo
   claro e o texto — já forçado claro acima — some). Deixa o painel coeso. ─── */
html[data-tema="escuro"] .ent-score { background: rgba(255,255,255,.05) !important; border-color: rgba(255,255,255,.12) !important; }
html[data-tema="escuro"] .ent-score-bt { background: rgba(255,255,255,.13) !important; }
html[data-tema="escuro"] .ent-score-tit,
html[data-tema="escuro"] .ent-score-load { color: #9fb0a8 !important; }
/* Só os chips DESLIGADOS recebem o fundo escuro; os LIGADOS mantêm a COR da
   categoria (background inline) em qualquer tema. */
html[data-tema="escuro"] .ent-chip:not(.on) { background: rgba(255,255,255,.06) !important; border-color: rgba(255,255,255,.16) !important; }
html[data-tema="escuro"] .ent-exp-lst li { border-color: rgba(255,255,255,.10) !important; }
html[data-tema="escuro"] .ent-imovel { border-color: rgba(255,255,255,.10) !important; }
html[data-tema="escuro"] .ent-rodape { background: transparent !important; border-color: rgba(255,255,255,.10) !important; }
html[data-tema="escuro"] .ent-corpo::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-color: transparent; }

/* ── CLARO (padrão gelo): o rodapé e as superfícies seguem o tom de gelo em vez
   do branco puro, pra combinar com o resto do painel. ───────────────────────── */
html[data-tema="padrao"] .ent-rodape { background: var(--sup-bg, #eef2f4) !important; }

/* ── FASE 6 (27/07): chips de PERFIL no card de qualidade de vida ──────────
   Geral·Família·Pet·Idoso — trocar repondera a nota na hora (zero rede).
   Cores pelas variáveis do tema: legível no claro E no escuro. */
.ent-perfil { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 8px 0 6px; }
.ent-perfil-rot { font-size: 10.5px; font-weight: 800; opacity: .6; margin-right: 2px; }
.ent-perfil-chip { border: 1px solid var(--sup-borda, rgba(128,128,128,.35)); background: none;
  color: var(--sup-txt, inherit); border-radius: 999px; padding: 4px 10px; font-size: 11px;
  font-weight: 800; cursor: pointer; font-family: inherit; transition: .15s; }
.ent-perfil-chip.on { background: var(--verde, #1db954); border-color: var(--verde, #1db954); color: #08150e; }
