/* Produto 1: o empreendimento a rodar. Telemóvel primeiro; computador a partir de 860 px. */

.emp {
  --espreita: 136px;
  --folha-espreita: var(--espreita);
  --folha-a: min(62vh, 580px);
  --folha-l: 432px;
  --nota-fundo: calc(var(--espreita) + 12px);
  --aviso-fundo: calc(var(--espreita) + 20px);
}

@supports (height: 1dvh) {
  .emp {
    --folha-a: min(62dvh, 580px);
  }
}

.emp[data-vista="ficha"] {
  --espreita: 98px;
}

/* ---------- palco ---------- */

.palco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--tinta);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
}

.palco.a-arrastar {
  cursor: grabbing;
}

.palco__tela {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s var(--suave);
}

.palco::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(to top, var(--fumo) 0%, transparent 34%),
    linear-gradient(to bottom, var(--fumo-leve) 0%, transparent 22%);
  pointer-events: none;
}

.palco__telhados,
.palco__pinos {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.palco__telhados {
  z-index: 2;
  transition: opacity 0.8s var(--suave) 0.3s;
}

.palco__pinos {
  z-index: 3;
  transition: opacity 0.8s var(--suave) 0.45s;
}

.palco.pronto .palco__tela,
.palco.pronto .palco__telhados,
.palco.pronto .palco__pinos {
  opacity: 1;
}

/* ---------- telhados pintados com o estado ---------- */

.telhado {
  fill: var(--cor-estado, var(--areia));
  fill-opacity: 0.4;
  stroke: var(--cor-estado, var(--areia));
  stroke-opacity: 0.95;
  stroke-width: 1.5;
  stroke-linejoin: round;
  pointer-events: auto;
  cursor: pointer;
  transition:
    fill-opacity 0.35s var(--suave),
    stroke-opacity 0.35s var(--suave),
    stroke-width 0.25s var(--suave),
    stroke 0.25s var(--suave);
}

.telhado.realce {
  fill-opacity: 0.62;
  stroke-width: 2.5;
}

.telhado.escolhido {
  fill-opacity: 0.7;
  stroke: var(--branco);
  stroke-opacity: 1;
  stroke-width: 2.5;
}

.telhado.apagado {
  fill-opacity: 0.07;
  stroke-opacity: 0.22;
}

.haste {
  stroke: var(--branco);
  stroke-opacity: 0.5;
  stroke-width: 1;
  pointer-events: none;
  transition: stroke-opacity 0.3s var(--suave);
}

.haste.realce,
.haste.escolhido {
  stroke-opacity: 0.95;
}

.haste.apagado {
  stroke-opacity: 0.12;
}

/* ---------- pinos ---------- */

.pino {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
  will-change: transform;
  transition: opacity 0.35s var(--suave);
}

.pino__n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--vidro-forte);
  color: var(--branco);
  font: 700 11px/1 var(--texto);
  letter-spacing: 0.03em;
  box-shadow:
    0 0 0 1.5px var(--cor-estado, var(--areia)),
    var(--sombra-p);
  transition:
    transform 0.35s var(--mola),
    background-color 0.25s var(--suave),
    color 0.25s var(--suave),
    box-shadow 0.25s var(--suave);
}

.pino.realce .pino__n {
  transform: scale(1.16);
}

.pino.escolhido .pino__n {
  transform: scale(1.24);
  background: var(--cor-estado, var(--areia));
  color: var(--tinta);
  box-shadow:
    0 0 0 2px var(--branco),
    var(--sombra-p);
}

.pino.apagado {
  opacity: 0.3;
}

.pino__etiqueta {
  position: absolute;
  left: calc(100% - 4px);
  top: 50%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--linha);
  border-radius: 8px;
  background: var(--vidro-forte);
  color: var(--areia);
  font: 500 12px/1.2 var(--texto);
  white-space: nowrap;
  box-shadow: var(--sombra-p);
  opacity: 0;
  transform: translate(-6px, -50%);
  pointer-events: none;
  transition: opacity 0.2s var(--suave), transform 0.3s var(--suave);
}

.pino__etiqueta strong {
  color: var(--branco);
  font-weight: 600;
}

.pino--esq .pino__etiqueta {
  left: auto;
  right: calc(100% - 4px);
  transform: translate(6px, -50%);
}

.pino.realce .pino__etiqueta,
.pino.escolhido .pino__etiqueta {
  opacity: 1;
  transform: translate(0, -50%);
}

/* ---------- abertura: o título sobre a imagem, até ao primeiro toque ---------- */

.abertura {
  position: fixed;
  z-index: 10;
  left: max(16px, var(--seg-esq));
  right: 76px;
  bottom: calc(var(--espreita) + 66px + var(--seg-baixo));
  max-width: 440px;
  pointer-events: none;
  transition: opacity 0.7s var(--suave), transform 0.7s var(--suave), bottom 0.5s var(--suave);
}

.abertura::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -80px -70px -110px -60px;
  background: radial-gradient(ellipse 62% 58% at 42% 52%, var(--vidro-forte) 0%, var(--fumo) 46%, transparent 100%);
  opacity: 0;
  transition: opacity 1.2s var(--suave) 0.2s;
}

.pronto .abertura::before {
  opacity: 0.9;
}

.abertura > * {
  opacity: 0;
  transform: translateY(14px);
}

.pronto .abertura > * {
  animation: abertura-sobe 1s var(--suave) both;
}

.pronto .abertura__local {
  animation-delay: 0.35s;
}

.pronto .abertura__titulo {
  animation-delay: 0.5s;
}

.pronto .abertura__dica {
  animation-delay: 0.9s;
}

.abertura.sumiu {
  opacity: 0;
  transform: translateY(10px);
}

.abertura__local {
  margin-bottom: 10px;
  color: var(--pedra);
  text-shadow: var(--sombra-texto);
}

.abertura__titulo {
  font-size: clamp(28px, 8.4vw, 36px);
  text-shadow: var(--sombra-titulo);
}

.abertura__dica {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  color: var(--pedra);
  font: 600 11px/1 var(--texto);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: var(--sombra-texto);
}

.abertura__dica svg {
  width: 20px;
  height: 20px;
  animation: balanco 2.6s var(--suave) infinite;
}

/* ---------- luz: dia e fim de dia (usa .seletor) ---------- */

.luz {
  position: fixed;
  z-index: 25;
  right: max(12px, var(--seg-dir));
  bottom: calc(var(--espreita) + 14px + var(--seg-baixo));
  flex-direction: column;
  transition: opacity 0.35s var(--suave), bottom 0.5s var(--suave);
}

.luz .seletor__op {
  width: 44px;
  padding: 0;
}

.luz .seletor__op span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- folha das villas ---------- */

.emp__folha {
  overflow: hidden;
}

.vista {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.vista.a-entrar {
  animation: vista-entra 0.5s var(--suave) both;
}

.folha__cabeca {
  touch-action: none;
}

.lista__cabeca {
  padding-bottom: 8px;
}

.lista__titulo {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.filtros {
  display: flex;
  gap: 8px;
  margin: 0 -20px;
  padding: 0 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 18px, black calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, black 18px, black calc(100% - 26px), transparent 100%);
}

.filtros::-webkit-scrollbar {
  display: none;
}

.filtros .chip {
  flex: none;
}

.lista__linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.lista__contagem {
  color: var(--areia);
  font: 500 14px/1.2 var(--texto);
  font-variant-numeric: tabular-nums;
}

.lista__contagem strong {
  color: var(--branco);
  font-weight: 600;
}

.lista__abrir {
  margin-right: -12px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--pedra);
}

.lista__abrir svg {
  transition: transform 0.45s var(--suave);
}

.lista__abrir[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.lista__corpo {
  padding-top: 2px;
}

/* preço máximo */

.preco {
  padding: 10px 0 0;
  border-top: 1px solid var(--linha);
}

.preco__topo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.preco__valor {
  color: var(--branco);
  font: 600 14px/1.2 var(--texto);
  font-variant-numeric: tabular-nums;
}

.preco__barra {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}

.preco__barra::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--ambar) 0, var(--ambar) var(--cheio, 100%), var(--linha-forte) var(--cheio, 100%), var(--linha-forte) 100%);
}

.preco__barra::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: var(--linha-forte);
}

.preco__barra::-moz-range-progress {
  height: 2px;
  border-radius: 2px;
  background: var(--ambar);
}

.preco__barra::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -10px;
  border: 0;
  border-radius: 50%;
  background: var(--branco);
  box-shadow: 0 0 0 0 var(--ambar-halo), var(--sombra-pp);
  transition: box-shadow 0.25s var(--suave), transform 0.25s var(--suave);
}

.preco__barra::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--branco);
  box-shadow: var(--sombra-pp);
}

.preco__barra:focus,
.preco__barra:focus-visible {
  outline: none;
}

.preco__barra:focus-visible::-webkit-slider-thumb,
.preco__barra:active::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px var(--ambar-halo), var(--sombra-pp);
  transform: scale(1.08);
}

.preco__barra:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 6px var(--ambar-halo);
}

.lista__ordem {
  display: flex;
  margin: 0 -12px 4px;
}

.lista__ordenar {
  padding: 0 12px;
  font-size: 13.5px;
  color: var(--areia);
}

/* a lista */

.villas {
  margin: 0;
  padding: 0;
  list-style: none;
}

.villa {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  margin: 0 -8px;
  padding: 0 0 0 8px;
  border-top: 1px solid var(--linha);
  border-radius: 2px;
  transition: background-color 0.25s var(--suave);
}

.villa:last-child {
  border-bottom: 1px solid var(--linha);
}

.villa.a-entrar {
  animation: surge 0.45s var(--suave) both;
  animation-delay: calc(var(--i, 0) * 22ms);
}

.villa.realce,
.villa.escolhida {
  background: var(--veu);
}

.villa__abrir {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  grid-template-areas:
    "n nome preco"
    "n sub sub";
  align-items: center;
  column-gap: 12px;
  row-gap: 5px;
  width: 100%;
  min-height: 70px;
  padding: 12px 4px 12px 0;
  color: var(--pedra);
  text-align: left;
  border-radius: 6px;
}

.villa__n {
  grid-area: n;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--branco);
  font: 700 11px/1 var(--texto);
  letter-spacing: 0.03em;
  box-shadow: inset 0 0 0 1.5px var(--cor-estado, var(--areia));
}

.villa__meio {
  display: contents;
}

.villa__nome {
  grid-area: nome;
  min-width: 0;
  color: var(--branco);
  font: 400 19px/1.15 var(--titulo);
}

.villa__sub {
  grid-area: sub;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.villa__sub .estado {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.13em;
}

.villa__sub .estado::before {
  width: 7px;
  height: 7px;
  box-shadow: none;
}

.villa__nota {
  min-width: 0;
  overflow: hidden;
  color: var(--areia);
  font: 400 12.5px/1.25 var(--texto);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.villa__preco {
  grid-area: preco;
  color: var(--branco);
  font: 600 15px/1.1 var(--texto);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.villa__comparar {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--areia);
  touch-action: manipulation;
}

.villa__comparar::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--linha-forte);
  border-radius: 50%;
  transition: background-color 0.25s var(--suave), border-color 0.25s var(--suave), transform 0.3s var(--mola);
}

.villa__comparar svg {
  position: relative;
  grid-area: 1 / 1;
  width: 14px;
  height: 14px;
  transition: transform 0.3s var(--mola), opacity 0.2s var(--suave);
}

.villa__comparar svg:last-child {
  opacity: 0;
  transform: scale(0.4);
}

.villa__comparar[aria-pressed="true"] {
  color: var(--tinta);
}

.villa__comparar[aria-pressed="true"]::before {
  border-color: var(--ambar);
  background: var(--ambar);
}

.villa__comparar[aria-pressed="true"] svg:first-child {
  opacity: 0;
  transform: scale(0.4) rotate(45deg);
}

.villa__comparar[aria-pressed="true"] svg:last-child {
  opacity: 1;
  transform: none;
}

.vazio {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 26px 0 10px;
  color: var(--areia);
  animation: surge 0.4s var(--suave) both;
}

/* barra da comparação, ao fundo da folha */

.cmp {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 20px;
  border-top: 1px solid var(--linha);
  background: var(--veu);
  animation: surge 0.4s var(--suave) both;
}

.cmp__texto {
  min-width: 0;
  color: var(--pedra);
  font: 500 13.5px/1.3 var(--texto);
}

.cmp__botoes {
  display: flex;
  flex: none;
  gap: 4px;
}

.cmp__botoes .btn {
  padding: 0 14px;
  font-size: 14px;
}

/* ---------- ficha da villa ---------- */

.ficha__cabeca {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-areas: "voltar id preco";
  align-items: center;
  column-gap: 6px;
  height: 70px;
  padding: 0 20px 12px 8px;
}

.ficha__voltar {
  grid-area: voltar;
  width: 44px;
  padding: 0;
  color: var(--pedra);
}

.ficha__voltar span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ficha__id {
  grid-area: id;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ficha__nome {
  font-size: 26px;
  outline: none;
}

.ficha__preco {
  grid-area: preco;
  align-self: start;
  padding-top: 3px;
  color: var(--branco);
  font: 400 21px/1.2 var(--titulo);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ficha__corpo {
  display: flex;
  flex-direction: column;
  padding-top: 2px;
}

.ficha__nota {
  margin-bottom: 14px;
  color: var(--areia);
  font-size: 15px;
  line-height: 1.45;
}

.ficha__dados {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--linha);
}

.ficha__dado {
  display: grid;
  gap: 4px;
  padding: 11px 0 12px;
  border-top: 1px solid var(--linha);
}

.ficha__dado dt {
  color: var(--areia);
  font: 600 10.5px/1.3 var(--texto);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ficha__dado dd {
  margin: 0;
  color: var(--branco);
  font: 600 16px/1.25 var(--texto);
  font-variant-numeric: tabular-nums;
}

.ficha__ver {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.ficha__ver .btn {
  min-height: 48px;
  padding: 0 10px;
  font-size: 14.5px;
}

.ficha__corpo .btn--largo {
  min-height: 50px;
}

.ficha__mais {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ficha__mais .btn {
  flex-direction: column;
  gap: 7px;
  min-height: 64px;
  padding: 9px 4px;
  border-color: var(--linha);
  color: var(--pedra);
  font-size: 12.5px;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}

.ficha__mais .btn[aria-pressed="true"] {
  border-color: var(--ambar);
  color: var(--ambar-claro);
}

/* ---------- comparação (diálogo) ---------- */

.cmpd__dica {
  display: none;
  margin: 2px 0 10px;
  color: var(--areia);
  font-size: 13px;
}

.cmpd__rolo {
  margin: 8px -20px 0;
  padding: 0 20px 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--linha-forte) transparent;
}

.cmpd__rolo:focus-visible {
  outline-offset: -2px;
}

.cmpd__tabela {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.cmpd[data-colunas="2"] .cmpd__tabela {
  min-width: 344px;
}

.cmpd[data-colunas="3"] .cmpd__tabela {
  min-width: 474px;
}

.cmpd__tabela th,
.cmpd__tabela td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--linha);
  text-align: left;
  vertical-align: top;
}

.cmpd__tabela tbody th,
.cmpd__canto,
.cmpd__accoes td:first-child {
  position: sticky;
  z-index: 1;
  left: -20px;
  width: 96px;
  padding-left: 0;
  background: var(--tinta);
  box-shadow: -20px 0 0 var(--tinta);
  color: var(--areia);
  font: 600 10.5px/1.35 var(--texto);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cmpd__tabela tbody td {
  color: var(--pedra);
  font: 500 14.5px/1.35 var(--texto);
}

.cmpd__villa {
  font-weight: 400;
}

.cmpd__nome {
  display: block;
  margin-bottom: 8px;
  color: var(--branco);
  font: 400 22px/1.1 var(--titulo);
}

.cmpd__villa .estado {
  font-size: 10px;
  letter-spacing: 0.12em;
}

.cmpd__linha--forte td {
  color: var(--branco) !important;
  font-weight: 600 !important;
  font-size: 15.5px !important;
}

.cmpd__linha--nota td {
  color: var(--areia) !important;
  font-size: 13.5px !important;
}

.cmpd__accoes td {
  padding-top: 14px;
  border-bottom: 0;
}

.cmpd__botoes {
  display: grid;
  gap: 6px;
}

.cmpd__botoes .btn {
  width: 100%;
  padding: 0 8px;
  font-size: 14px;
}

@media (max-width: 599.98px) {
  /* no telemóvel a tabela desliza dentro do painel: o fundo é liso, para a primeira coluna ficar presa sem se notar */
  .cmpd {
    background: var(--tinta);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .cmpd[data-colunas="3"] .cmpd__dica {
    display: block;
  }
}

@media (min-width: 600px) {
  .dialogo--largo {
    width: min(820px, calc(100vw - 40px));
  }

  .cmpd__rolo {
    margin: 12px 0 0;
    padding: 0;
  }

  .cmpd__tabela th,
  .cmpd__tabela td {
    padding: 13px 14px;
  }

  .cmpd__tabela tbody th,
  .cmpd__canto,
  .cmpd__accoes td:first-child {
    position: static;
    width: 150px;
    background: none;
    box-shadow: none;
  }

  .cmpd__nome {
    font-size: 26px;
  }

  .cmpd__botoes {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- a nota de demonstração dentro da folha: no fim da lista e no fim da ficha ----------
   No telemóvel, com a folha aberta, a nota do canto não se vê; esta fica sempre no fim do que se está a ler. */

.emp__nota .nota-demo {
  position: static;
  max-width: none;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--linha);
  font-size: 11.5px;
  text-shadow: none;
  pointer-events: auto;
}

/* ---------- telemóvel: com a folha aberta, a imagem fica limpa ---------- */

.emp[data-folha="aberta"] .luz,
.emp[data-folha="aberta"] > .nota-demo,
.emp[data-folha="aberta"] .abertura {
  opacity: 0;
  pointer-events: none;
}

.emp[data-folha="aberta"] > .nota-demo a {
  pointer-events: none;
}

.emp > .nota-demo {
  max-width: calc(100vw - 92px);
  font-size: 10.5px;
}

@media (max-width: 379.98px) {
  .emp > .nota-demo {
    font-size: 10px;
  }

  .villa__nome {
    font-size: 18px;
  }

  .villa__preco {
    font-size: 14px;
  }
}

/* ---------- computador ---------- */

@media (min-width: 860px), (orientation: landscape) and (min-width: 600px) and (max-height: 540px) {
  .emp {
    --nota-fundo: 20px;
    --aviso-fundo: 28px;
  }

  /* com o painel ao lado, a nota do canto está sempre à vista: a de dentro do painel não é precisa */
  .emp__nota {
    display: none;
  }

  .emp[data-folha="aberta"] .luz,
  .emp[data-folha="aberta"] > .nota-demo {
    opacity: 1;
    pointer-events: auto;
  }

  .emp[data-folha="aberta"] > .nota-demo {
    pointer-events: none;
  }

  .emp[data-folha="aberta"] > .nota-demo a {
    pointer-events: auto;
  }

  .emp[data-folha="aberta"] .abertura:not(.sumiu) {
    opacity: 1;
  }

  .emp > .nota-demo {
    max-width: min(74vw, 440px);
    font-size: 12px;
  }

  .palco::after {
    background:
      linear-gradient(to top, var(--fumo) 0%, transparent 30%),
      linear-gradient(to bottom, var(--fumo-leve) 0%, transparent 20%);
  }

  .abertura {
    left: max(28px, var(--seg-esq));
    right: auto;
    bottom: calc(128px + var(--reuniao-fundo));
    max-width: 560px;
  }

  .abertura::before {
    inset: -130px -200px -190px -120px;
  }

  .abertura__titulo {
    max-width: 13ch;
    font-size: clamp(44px, 4vw, 60px);
  }

  .abertura__local {
    margin-bottom: 14px;
    font-size: 12px;
  }

  .abertura__dica {
    margin-top: 20px;
    font-size: 12px;
  }

  .luz {
    left: max(28px, var(--seg-esq));
    right: auto;
    bottom: calc(56px + var(--reuniao-fundo));
    flex-direction: row;
  }

  .luz .seletor__op {
    width: auto;
    padding: 0 16px 0 13px;
  }

  .luz .seletor__op span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  .emp__folha {
    padding-bottom: 0;
  }

  .folha__cabeca {
    touch-action: auto;
  }

  .lista__cabeca {
    padding-bottom: 14px;
  }

  .lista__titulo {
    position: static;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    width: auto;
    height: auto;
    margin-bottom: 16px;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }

  .lista__titulo h2 {
    font-size: 30px;
    outline: none;
  }

  .lista__linha {
    display: none;
  }

  .filtros {
    gap: 6px;
    margin: 0;
    padding: 0;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .filtros .chip {
    padding: 0 12px;
    font-size: 12.5px;
  }

  .preco {
    padding-top: 14px;
  }

  .villa {
    margin: 0 -10px;
    padding-left: 10px;
    border-radius: 4px;
  }

  .villa__abrir {
    min-height: 72px;
  }

  .villa__nome {
    font-size: 20px;
  }

  .cmp {
    padding: 12px 16px 12px 24px;
  }

  .ficha__cabeca {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "voltar voltar"
      "id preco";
    row-gap: 10px;
    height: auto;
    padding: 14px 24px 18px 24px;
  }

  .ficha__voltar {
    justify-self: start;
    width: auto;
    margin-left: -12px;
    padding: 0 14px 0 8px;
    font-size: 14px;
    color: var(--areia);
  }

  .ficha__voltar span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  .ficha__id {
    gap: 10px;
  }

  .ficha__nome {
    font-size: 40px;
  }

  .ficha__preco {
    align-self: end;
    padding: 0;
    font-size: 26px;
  }

  .ficha__nota {
    font-size: 16px;
  }
}

/* ---------- telemóvel deitado: painel ao lado, mais estreito ---------- */

@media (orientation: landscape) and (min-width: 600px) and (max-width: 859.98px) and (max-height: 540px) {
  .emp {
    --folha-l: min(46vw, 380px);
    --nota-fundo: 10px;
  }

  .emp > .nota-demo {
    left: max(12px, var(--seg-esq));
    max-width: calc(100vw - var(--folha-l) - 96px);
    font-size: 10.5px;
  }

  .abertura {
    left: max(14px, var(--seg-esq));
    bottom: calc(104px + var(--reuniao-fundo));
    max-width: calc(54vw - 40px);
  }

  .abertura__titulo {
    max-width: none;
    font-size: 28px;
  }

  .abertura__local {
    margin-bottom: 8px;
    font-size: 11px;
  }

  .abertura__dica {
    margin-top: 10px;
    font-size: 11px;
  }

  .luz {
    left: auto;
    right: calc(var(--folha-l) + 8px + 10px);
    bottom: calc(10px + var(--reuniao-fundo));
    flex-direction: column;
  }

  .luz .seletor__op {
    width: 44px;
    padding: 0;
  }

  .luz .seletor__op span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .lista__cabeca {
    padding-bottom: 8px;
  }

  .lista__titulo {
    margin-bottom: 10px;
  }

  .lista__titulo h2 {
    font-size: 24px;
  }

  .filtros {
    margin: 0 -16px;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 22px), transparent 100%);
  }

  .filtros .chip {
    min-height: 40px;
  }

  .villa__abrir {
    min-height: 64px;
  }

  .cmp {
    padding: 8px 10px 8px 16px;
  }

  .ficha__cabeca {
    row-gap: 2px;
    padding: 6px 16px 10px;
  }

  .ficha__nome {
    font-size: 28px;
  }

  .ficha__preco {
    font-size: 20px;
  }
}

@media (hover: hover) {
  .villa__abrir:hover .villa__nome {
    color: var(--branco);
  }

  .villa__comparar:hover::before {
    border-color: var(--pedra);
    transform: scale(1.08);
  }

}

/* ---------- modo de reunião (?reuniao=1): sem pedido, partilha nem ficha para guardar ---------- */

html[data-reuniao] .ficha__mais {
  grid-template-columns: 1fr;
}

html[data-reuniao] .ficha__mais .btn {
  flex-direction: row;
  gap: 10px;
  min-height: 48px;
  font-size: 14.5px;
}

/* ---------- sem JavaScript ---------- */

.sem-js {
  position: fixed;
  inset: auto 16px 40% 16px;
  color: var(--pedra);
  text-align: center;
}

/* ---------- animações ---------- */

@keyframes abertura-sobe {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes vista-entra {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes balanco {
  0%,
  100% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
}

/* ---------- folha para guardar ou imprimir: só a ficha ---------- */

.imprimir {
  display: none;
}

@media print {
  @page {
    size: A4;
    margin: 16mm 16mm 14mm;
  }

  :root {
    --papel: #ffffff;
    color-scheme: light;
  }

  html,
  body,
  body.imersivo {
    position: static;
    height: auto;
    min-height: 0;
    overflow: visible;
    background: var(--papel);
    color: var(--tinta);
  }

  body > *:not(.imprimir) {
    display: none !important;
  }

  .imprimir {
    display: block;
    color: var(--tinta);
    font: 400 11pt/1.5 var(--texto);
  }

  .imp__topo {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12mm;
    padding-bottom: 5mm;
    margin-bottom: 7mm;
    border-bottom: 0.3mm solid var(--bronze);
  }

  .imp__marca {
    font: 400 22pt/1.1 var(--titulo);
    color: var(--tinta);
  }

  .imp__local,
  .imp__data,
  .imp__rotulo {
    font: 600 7.5pt/1.4 var(--texto);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bronze);
  }

  .imp__local {
    margin-top: 1.5mm;
  }

  .imp__imagem {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 8mm;
    border-radius: 1.5mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .imp__corpo {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 12mm;
    align-items: start;
  }

  .imp__nome {
    margin: 1.5mm 0 3mm;
    font: 400 30pt/1.05 var(--titulo);
    color: var(--tinta);
  }

  .imp__estado {
    font: 600 8.5pt/1.3 var(--texto);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--tinta);
  }

  .imp__preco {
    margin-top: 4mm;
    font: 400 20pt/1.1 var(--titulo);
    color: var(--tinta);
  }

  .imp__nota {
    margin-top: 4mm;
    color: var(--tinta);
  }

  .imp__dados {
    margin: 0;
    border-top: 0.2mm solid var(--areia);
  }

  .imp__dados div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8mm;
    padding: 2.6mm 0;
    border-bottom: 0.2mm solid var(--areia);
    break-inside: avoid;
  }

  .imp__dados dt {
    font: 600 7.5pt/1.4 var(--texto);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bronze);
  }

  .imp__dados dd {
    margin: 0;
    font: 600 11pt/1.3 var(--texto);
    color: var(--tinta);
    text-align: right;
  }

  .imp__fundo {
    margin-top: 10mm;
    padding-top: 4mm;
    border-top: 0.2mm solid var(--areia);
    font: 400 8pt/1.6 var(--texto);
    color: var(--bronze);
  }

  .imp__lig {
    color: var(--tinta);
    font-weight: 600;
    word-break: break-all;
  }
}
