/* Página do mapa (/mapa; antes a página inicial): porta de apps/web/src/components/home-map/home-map.module.css, com
   as classes do module em global e o prefixo hm-. Sem o véu de entrada desde 26 nov. 2026 */
.hm-page {
  /* Barras e botões quase opacos e com borda (5 dez. 2026): com 84 % de branco sumiam no mapa claro */
  --glass: rgba(255, 255, 255, 0.97);
  --edge: rgba(23, 33, 58, 0.18);
  --shadow: 0 6px 20px rgba(23, 33, 58, 0.18);
  --ctl-text: #17213a;
  --ctl-muted: #3e475c;
  --ctl-on-bg: #17213a;
  --ctl-on-text: #fff;
  --violet: #6d3ae0;
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* Sem imagem: o azul da marca com brilhos (como o HeroGlows); o canvas do mapa tapa-o quando está desenhado */
  background:
    radial-gradient(60% 55% at 18% 22%, rgba(198, 242, 56, 0.22), transparent 70%),
    radial-gradient(55% 60% at 85% 78%, rgba(109, 58, 224, 0.4), transparent 70%),
    radial-gradient(80% 70% at 60% 10%, rgba(64, 120, 255, 0.55), transparent 70%),
    linear-gradient(160deg, #173bce 0%, #1430a8 55%, #0f2275 100%);
}

/* Com o mapa desenhado, o fundo volta à cor do mapa: onde o canvas ainda não pintou (mosaicos a chegar, a meio de
   um voo) vê-se cinzento como o mapa, e não o azul da entrada */
.hm-page[data-mapa='pronto'] {
  background: #e9ecef;
}
html[data-mapa-tema='escuro'] .hm-page[data-mapa='pronto'] {
  background: #1c1f26;
}
/* Mapa escuro: os controlos passam a escuros com letra clara (antes ficava letra clara em fundo branco) */
html[data-mapa-tema='escuro'] .hm-page {
  --glass: rgba(28, 34, 48, 0.96);
  --edge: rgba(255, 255, 255, 0.16);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  --ctl-text: #f1f4fb;
  --ctl-muted: #c3cbe0;
  --ctl-on-bg: #fff;
  --ctl-on-text: #17213a;
}
/* A legenda e o painel ficam claros nos dois temas */
html[data-mapa-tema='escuro'] .hm-legend {
  --glass: rgba(255, 255, 255, 0.97);
  --edge: rgba(23, 33, 58, 0.18);
}

/* «Voltar»: em cima à esquerda, no lugar do menu */
.hm-back {
  position: absolute;
  z-index: 11;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  padding: 0 16px 0 10px;
  border-radius: 14px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 14px;
  color: var(--ctl-text);
  text-decoration: none;
}
.hm-back:hover {
  border-color: #173bce;
}
.hm-back:focus-visible,
.hm-seg button:focus-visible,
.hm-where-btn:focus-visible,
.hm-icon-btn:focus-visible {
  outline: 3px solid #c6f238;
  outline-offset: 2px;
}

/* O mapa (cliente) e o que vai por cima dele */
.hm-behind {
  display: contents;
}

.hm-page .hm-map {
  /* Mais específico do que o .maplibregl-map { position: relative } do MapLibre (sem isto, o mapa fica com 0 px) */
  position: absolute;
  inset: 0;
}

/* Vidro: barras e botões por cima do mapa. Sempre o -webkit-backdrop-filter antes do backdrop-filter: pela ordem
   inversa o Lightning CSS ficava só com o -webkit- e o Chrome não desfocava nada (speed.test.ts) */
.hm-seg,
.hm-where-btn,
.hm-regions,
.hm-icon-btn,
.hm-legend {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
}

/* Em cima, por baixo do menu e ao centro: o que se vê (Tudo, Comprar, Arrendar) e onde (região). Uma só barra, para
   não haver controlos espalhados pelos cantos (27 nov. 2026) */
.hm-controls {
  position: absolute;
  z-index: 10;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

/* Região: botão com o nome de onde está o mapa; a lista abre por baixo */
.hm-where {
  position: relative;
}
.hm-where-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 12px 0 10px;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--ctl-text);
  cursor: pointer;
  white-space: nowrap;
}
.hm-where-btn svg {
  flex: none;
  color: #173bce;
}
.hm-where-btn svg:last-child {
  color: var(--ctl-muted);
  transition: transform 0.2s;
}
.hm-where-btn[aria-expanded='true'] svg:last-child {
  transform: rotate(180deg);
}
.hm-regions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 100%;
  display: grid;
  gap: 2px;
  border-radius: 14px;
  padding: 4px;
  animation: hm-regionsIn 0.18s ease-out;
}
.hm-regions[hidden] {
  display: none;
}
@keyframes hm-regionsIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
.hm-regions button {
  border: 0;
  background: transparent;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  text-align: left;
  color: var(--ctl-muted);
  cursor: pointer;
}
.hm-regions button:hover {
  background: rgba(23, 59, 206, 0.08);
}
.hm-regions button[aria-pressed='true'] {
  background: #173bce;
  color: #fff;
}
html[data-mapa-tema='escuro'] .hm-where-btn svg:first-child {
  color: #8fa6ff;
}

/* Ferramentas do mapa (perto de mim, €/m², tema): em coluna, em baixo à direita, por cima do zoom do MapLibre */
.hm-tools {
  position: absolute;
  z-index: 10;
  right: 10px;
  bottom: 118px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
/* Com o mapa pronto, as ferramentas passam a controlo do MapLibre (static/mapa.js): ficam por cima do zoom */
.hm-page .hm-tools.maplibregl-ctrl {
  position: static;
  margin: 0 10px 8px 0;
}
.hm-tools .hm-icon-btn {
  width: 46px;
}
.hm-seg {
  display: flex;
  border-radius: 14px;
  padding: 4px;
}
.hm-seg button {
  border: 0;
  background: transparent;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ctl-muted);
  cursor: pointer;
}
.hm-seg button:not([aria-pressed='true']):hover {
  color: var(--ctl-text);
}
.hm-seg button[aria-pressed='true'] {
  background: var(--ctl-on-bg);
  color: var(--ctl-on-text);
}
.hm-icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--ctl-text);
  cursor: pointer;
}
.hm-icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Legenda */
.hm-legend {
  position: absolute;
  z-index: 6;
  left: 14px;
  bottom: 24px;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
  color: #17213a;
}
.hm-legend b {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}
.hm-bar {
  width: 170px;
  height: 8px;
  border-radius: 99px;
  margin: 4px 0;
}
.hm-legend-row {
  display: flex;
  justify-content: space-between;
  color: #5b6478;
}
.hm-legend label {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  cursor: pointer;
  font-weight: 600;
}
.hm-page[data-panel='open'] .hm-legend {
  display: none;
}

/* Pílulas de preço e grupos */
.hm-pin {
  border: 2px solid #17213a;
  background: #fff;
  color: #17213a;
  border-radius: 999px;
  padding: 3px 9px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(23, 33, 58, 0.25);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.25s, background 0.15s;
}
.hm-pin:hover,
.hm-pin:focus-visible,
.hm-pin[data-active='true'] {
  background: #17213a;
  color: #fff;
  transform: scale(1.08);
}
.hm-pin[data-rent='true'] {
  border-color: #173bce;
  color: #173bce;
}
.hm-pin[data-rent='true']:hover,
.hm-pin[data-rent='true'][data-active='true'] {
  background: #173bce;
  color: #fff;
}
.hm-pin[data-featured='true'] {
  border-color: #17213a;
  box-shadow: 0 0 0 3px #c6f238, 0 6px 18px rgba(23, 33, 58, 0.25);
}
.hm-pin[data-dim='true'] {
  opacity: 0.25;
  transform: scale(0.85);
}
.hm-pin[data-hit='true'] {
  background: #c6f238;
  border-color: #17213a;
  color: #17213a;
  animation: hm-pop 0.6s ease;
}
@keyframes hm-pop {
  0% {
    transform: scale(0.6);
  }
  60% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}
.hm-group {
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #17213a;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 0 0 4px rgba(23, 33, 58, 0.22), 0 6px 18px rgba(23, 33, 58, 0.25);
  cursor: pointer;
}

/* Painel da casa e da zona */
.hm-panel {
  position: absolute;
  z-index: 12;
  background: #fff;
  box-shadow: var(--shadow);
  overflow-y: auto;
  color: #17213a;
  overscroll-behavior: contain;
}
@media (min-width: 761px) {
  .hm-panel {
    /* À esquerda: o menu e os controlos ficam livres à direita e em cima */
    top: 74px; /* abaixo de «Voltar» e dos filtros */
    left: 14px;
    width: 400px;
    max-height: calc(100dvh - 98px);
    border-radius: 24px;
  }
}
@media (max-width: 760px) {
  .hm-panel {
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 72dvh;
    border-radius: 22px 22px 0 0;
    padding-bottom: 24px;
  }
}
.hm-panel-in {
  animation: hm-panelIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes hm-panelIn {
  from {
    opacity: 0;
    transform: translateX(-28px) scale(0.98);
  }
}
@media (max-width: 760px) {
  @keyframes hm-panelIn {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
  }
}

/* Galeria da ficha (PanelGallery): deslizar com scroll-snap, stories em cima, contador e setas */
.hm-gallery {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #dfe3ea;
  overflow: hidden;
}
.hm-strip {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  outline: none;
}
.hm-strip::-webkit-scrollbar {
  display: none;
}
.hm-strip:focus-visible {
  box-shadow: inset 0 0 0 3px #c6f238;
}
.hm-slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  overflow: hidden;
  -webkit-user-drag: none;
}
.hm-slide img {
  object-fit: cover;
  user-select: none;
}
/* Profundidade: a foto que sai encolhe e escurece um pouco (só onde há scroll-driven animations) */
@supports (animation-timeline: view()) {
  .hm-slide img {
    animation: hm-slideDepth linear both;
    animation-timeline: view(inline);
  }
  @keyframes hm-slideDepth {
    0% {
      transform: scale(1.12);
      filter: brightness(0.75);
    }
    50% {
      transform: scale(1);
      filter: none;
    }
    100% {
      transform: scale(1.12);
      filter: brightness(0.75);
    }
  }
}
.hm-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 16, 40, 0.42) 0%, transparent 26%),
    linear-gradient(0deg, rgba(10, 16, 40, 0.5) 0%, transparent 32%);
}
.hm-stories {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 62px;
  display: flex;
  gap: 4px;
  pointer-events: none;
}
.hm-stories span {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.38);
  transition: background 0.3s;
}
.hm-stories span[data-on='true'] {
  background: #fff;
}
.hm-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 16, 40, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.hm-gallery-chip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  pointer-events: none;
}
.hm-gallery-chip .hm-chip {
  background: rgba(255, 255, 255, 0.94);
}
.hm-arrow {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #17213a;
  box-shadow: 0 6px 18px rgba(10, 16, 40, 0.25);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.hm-arrow svg {
  width: 20px;
  height: 20px;
}
.hm-prev {
  left: 10px;
}
.hm-next {
  right: 10px;
}
.hm-gallery:hover .hm-arrow:not(:disabled),
.hm-arrow:focus-visible {
  opacity: 1;
}
.hm-arrow:hover {
  transform: scale(1.08);
}
.hm-arrow:disabled {
  pointer-events: none;
}
@media (hover: none) {
  .hm-arrow {
    display: none;
  }
}
.hm-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  font-size: 18px;
  cursor: pointer;
  color: #17213a;
}
.hm-body {
  padding: 18px;
}
.hm-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef1ff;
  color: #173bce;
}
.hm-panel h2 {
  margin: 4px 0 6px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  outline: none;
}
.hm-price {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hm-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: #5b6478;
  font-size: 14px;
  margin: 8px 0 14px;
}
.hm-cta {
  display: flex;
  gap: 8px;
}
.hm-cta a,
.hm-cta button {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 46px;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid var(--edge);
  background: #fff;
  color: #17213a;
  cursor: pointer;
  font-size: 15px;
}
.hm-cta .hm-primary {
  background: #173bce;
  color: #fff;
  border-color: #173bce;
}
.hm-note {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f4efff, #eef3ff);
  font-size: 14px;
  line-height: 1.45;
}
.hm-note b {
  color: var(--violet);
}
.hm-source {
  margin-top: 6px;
  font-size: 12px;
  color: #5b6478;
}
.hm-zone-big {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hm-contact {
  margin-top: 16px;
}
.hm-skeleton {
  height: 18px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef0f4 0%, #f7f8fb 50%, #eef0f4 100%) 0 0 / 200% 100%;
  margin: 10px 0;
  animation: hm-shimmer 1.4s linear infinite;
}
.hm-skeleton-photo {
  height: 200px;
  border-radius: 16px;
}
.hm-skeleton-grid {
  height: 96px;
  margin-top: 18px;
  border-radius: 14px;
}
@keyframes hm-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Mais informação (chega da API logo a seguir) */
.hm-more {
  animation: hm-moreIn 0.4s ease both;
}
@keyframes hm-moreIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.hm-details {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--edge);
}
.hm-details div {
  padding: 9px 10px;
  /* Linhas só entre células (a última linha incompleta não fica com um buraco cinzento) */
  box-shadow: 1px 1px 0 var(--edge);
}
.hm-details dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b6478;
}
.hm-details dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
  hyphens: none;
  overflow-wrap: normal;
}
.hm-highlights {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hm-highlights li {
  padding: 5px 10px;
  border-radius: 999px;
  background: #f4f9e3;
  color: #3d4a10;
  font-size: 13px;
  font-weight: 600;
}
.hm-description {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: #3a4357;
}
.hm-description a {
  color: #173bce;
  font-weight: 700;
}
.hm-byline {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: #5b6478;
}
.hm-cta button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.hm-page .maplibregl-ctrl-bottom-right {
  bottom: 14px;
}
/* Antes de o estilo chegar, a atribuição está vazia (display: none no MapLibre). Ocupa já o lugar do botão «i»
   (as mesmas medidas do .maplibregl-compact fechado) para as ferramentas por cima não saltarem quando ele aparece */
.hm-page .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib.maplibregl-attrib-empty {
  display: block;
  visibility: hidden;
  min-height: 20px;
  padding: 2px 24px 2px 0;
  margin: 10px;
  box-sizing: content-box;
}
/* O zoom do MapLibre com o mesmo vidro e a mesma largura das ferramentas por cima: uma só coluna à direita */
.hm-page .maplibregl-ctrl-group:not(:empty) {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--edge);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hm-page .maplibregl-ctrl-group button {
  width: 44px;
  height: 40px;
}
html[data-mapa-tema='escuro'] .hm-page .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(1);
}
@media (min-width: 761px) {
  /* A ficha ocupa a esquerda (14 + 400 px): os controlos centram-se no que sobra à direita */
  .hm-page[data-panel='open'] .hm-controls {
    left: calc(414px + (100vw - 414px) / 2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm-pin,
  .hm-panel-in,
  .hm-more,
  .hm-skeleton,
  .hm-slide img,
  .hm-pin[data-hit='true'] {
    animation: none;
    transition: none;
  }
}

/* «Ver casas perto de si» (NearCard, 19 nov. 2026): cartão de vidro em baixo, ao centro; no telemóvel, folha em baixo */
.hm-near {
  position: absolute;
  z-index: 11;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 28px));
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  color: #17213a;
  animation: hm-nearIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes hm-nearIn {
  from {
    opacity: 0;
    transform: translate(-50%, 24px);
  }
}
.hm-near h2 {
  margin: 0;
  padding-right: 36px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.hm-near p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: #5b6478;
}
.hm-near-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: #eef1ff;
  color: #173bce;
}
.hm-near-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5b6478;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.hm-near-close:hover {
  background: #eef0f4;
}
.hm-near-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.hm-near-actions a,
.hm-near-actions button {
  flex: 1 1 auto;
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: #fff;
  color: #17213a;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.hm-near-actions .hm-near-primary {
  flex-grow: 2;
  background: #173bce;
  border-color: #173bce;
  color: #fff;
}
.hm-near-actions .hm-near-primary:hover {
  background: #1430a8;
}
.hm-near-actions button:disabled {
  opacity: 0.7;
  cursor: progress;
}
/* No computador o cartão fica à direita: Portugal enche o centro do mapa (26 nov. 2026) e a legenda fica por baixo */
@media (min-width: 761px) {
  .hm-near {
    left: auto;
    right: 70px; /* à esquerda da coluna das ferramentas */
    transform: none;
  }
  @keyframes hm-nearIn {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
  }
}
@media (max-width: 760px) {
  .hm-near {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    transform: none;
    border-radius: 22px 22px 0 0;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  @keyframes hm-nearIn {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
  }
}

/* «Está aqui»: ponto azul com halo; o halo pulsa só sem «reduzir movimento» */
.hm-here {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #173bce;
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(23, 59, 206, 0.22), 0 4px 12px rgba(23, 33, 58, 0.3);
  animation: hm-herePulse 2s ease-out infinite;
}
@keyframes hm-herePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(23, 59, 206, 0.45), 0 4px 12px rgba(23, 33, 58, 0.3);
  }
  100% {
    box-shadow: 0 0 0 18px rgba(23, 59, 206, 0), 0 4px 12px rgba(23, 33, 58, 0.3);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hm-near,
  .hm-here {
    animation: none;
  }
}
@media (max-width: 760px) {
  .hm-page[data-near='open'] .hm-legend {
    display: none;
  }
}

/* «€/m²» (19 nov. 2026): liga as zonas pintadas com o preço do INE; desligado por omissão */
.hm-zones-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hm-zones-btn[aria-pressed='true'] {
  background: var(--ctl-on-bg);
  border-color: var(--ctl-on-bg);
  color: var(--ctl-on-text);
}
/* Telemóvel: a barra de cima ocupa a largura (Tudo/Comprar/Arrendar + região cabem em 360 px); as ferramentas e o
   zoom ficam na coluna da direita */
@media (max-width: 760px) {
  /* «Voltar» só com a seta; os filtros na mesma linha, à direita dele */
  .hm-back {
    top: 10px;
    left: 10px;
    width: 46px;
    padding: 0;
    justify-content: center;
  }
  .hm-back span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .hm-controls {
    top: 10px;
    left: 62px;
    right: 10px;
    transform: none;
    gap: 6px;
  }
  .hm-seg {
    flex: 1 1 auto;
  }
  .hm-seg button {
    flex: 1 1 0;
    padding: 0 6px;
    font-size: 13px;
  }
  .hm-where-btn {
    height: 46px;
    padding: 0 8px;
    gap: 4px;
    font-size: 13px;
  }
}
@media (max-width: 420px) {
  .hm-where-btn svg:first-child {
    display: none;
  }
}
