/* Visita por estancias del chalet de Santa Úrsula. Mecánica heredada de la visita realista de Brisas de Ferrera. */
    /* Paneles de vidrio, tipografía de serif del sistema y un solo acento arena.
       La mecánica es la del interior de Los Faros: una foto por estancia y puntos que llevan a las contiguas. */
    * { box-sizing: border-box; }
    [hidden] { display: none !important; }
    /* En el teléfono: sin letra inflada al girar, sin rebote de página ni destello gris al tocar. */
    html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
    :root {
      color-scheme: dark;
      --ink: #F7F6F3;
      --ink-soft: rgb(247 246 243 / 0.74);
      --ink-faint: rgb(247 246 243 / 0.5);
      --glass: rgb(26 26 26 / 0.72);
      --glass-strong: rgb(26 26 26 / 0.82);
      --hairline: rgb(247 246 243 / 0.2);
      --lift: rgb(247 246 243 / 0.09);
      --accent: #E50006;
      --accent-text: #FF3B40;
      --accent-ink: #FFFFFF;
      --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
      --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      --ease: cubic-bezier(0.22, 1, 0.36, 1);
      --gap: clamp(12px, 2.2vw, 24px);
      --shadow: 0 18px 50px rgb(0 0 0 / 0.32), 0 2px 8px rgb(0 0 0 / 0.2);
    }
    body {
      margin: 0;
      min-width: 280px;
      height: 100dvh;
      overflow: hidden;
      overscroll-behavior: none;
      color: var(--ink);
      background: #1A1A1A;
      font: 14px/1.4 var(--sans);
      -webkit-font-smoothing: antialiased;
    }
    button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
    a { color: inherit; }
    /* Mandos: sin espera de doble toque, sin selección de texto ni menú al mantener pulsado. */
    button, a { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
    :is(button, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

    #stage { position: fixed; inset: 0; overflow: hidden; background: #1A1A1A; }
    #scenes { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
    #scenes[data-pan] { cursor: grab; }
    #scenes[data-pan]:active { cursor: grabbing; }
    /* Una capa por estancia: la foto cubre la pantalla y los puntos van en coordenadas de la foto. */
    .scene { position: absolute; inset: 0; overflow: hidden; will-change: transform, opacity; }
    .cover { position: absolute; left: 0; top: 0; will-change: transform; }
    .cover img { display: block; width: 100%; height: 100%; -webkit-user-drag: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
    /* Foto que no llena su hueco: detrás va ella misma, muy desenfocada y oscura, en vez de franjas negras.
       Se pinta a un octavo de tamaño y se amplía: desenfocar una capa pequeña casi no cuesta. */
    .glow { display: none; position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; transform-origin: 0 0; transform: scale(8.8) translate(-4.5%, -4.5%); background: center / cover no-repeat; filter: blur(5px) brightness(0.45) saturate(1.15); }
    .scene[data-bars] .glow { display: block; }
    /* Velos arriba y abajo para que el texto se lea sobre cualquier foto. */
    #stage::before, #stage::after { content: ""; position: absolute; inset-inline: 0; z-index: 1; pointer-events: none; }
    #stage::before { top: 0; height: 170px; background: linear-gradient(rgb(18 18 18 / 0.62), transparent); }
    #stage::after { bottom: 0; height: 400px; background: linear-gradient(transparent, rgb(18 18 18 / 0.74)); }

    /* Puntos: etiqueta y punto sobre una puerta, un vano o una zona. Nacen ocultos y entran escalonados. */
    .point {
      position: absolute;
      left: 0;
      top: 0;
      z-index: 1;
      will-change: transform;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-height: 38px;
      padding: 0 13px 0 16px;
      border: 1px solid var(--hairline);
      border-radius: 0;
      /* Fondo opaco, sin desenfoque: con el desenfoque, el empuje de cámara iba a tirones. */
      background: rgb(26 26 26 / 0.8);
      color: var(--ink);
      font-size: 0.93rem;
      font-weight: 500;
      white-space: nowrap;
      box-shadow: 0 6px 22px rgb(0 0 0 / 0.3);
      opacity: 0;
      visibility: hidden;
      transition: opacity 300ms ease, background-color 160ms ease, visibility 0s linear 300ms;
    }
    .point::after { content: ""; position: absolute; inset: -5px; }
    .scene[data-points] .point { opacity: 1; visibility: visible; transition-delay: calc(var(--i, 0) * 140ms), 0s, 0s; }
    .point i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transition: transform 160ms ease; }
    .point i::before { content: ""; position: absolute; inset: -5px; border: 1px solid var(--accent); border-radius: 50%; opacity: 0; animation: ring 2.6s ease-out infinite; animation-delay: calc(var(--i, 0) * 300ms); }
    @keyframes ring { 0% { transform: scale(0.5); opacity: 0.9; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
    .point b { display: none; font-weight: 600; }
    .point:active { scale: 0.97; }
    @media (hover: hover) and (pointer: fine) {
      .point:hover { background: rgb(26 26 26 / 0.92); }
      .point:hover i { transform: scale(1.3); }
    }

    .glass {
      border: 1px solid var(--hairline);
      background: var(--glass);
      -webkit-backdrop-filter: blur(20px) saturate(1.35);
      backdrop-filter: blur(20px) saturate(1.35);
      box-shadow: var(--shadow);
    }
    @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
      .glass { background: var(--glass-strong); }
    }

    .top, .bottom { position: absolute; inset-inline: 0; z-index: 2; pointer-events: none; }
    .top > *, .bottom :is(.nav, .strip, .th, .sale-bar) { pointer-events: auto; }
    .top {
      top: 0;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: max(var(--gap), env(safe-area-inset-top)) max(var(--gap), env(safe-area-inset-right)) 0 max(var(--gap), env(safe-area-inset-left));
    }
    h1 { margin: 0; font: 500 clamp(1.3rem, 2.6vw, 1.95rem)/1.04 var(--serif); letter-spacing: -0.03em; text-shadow: 0 1px 18px rgb(0 0 0 / 0.35); }
    .switches { display: flex; align-items: center; gap: 8px; }
    .bottom {
      bottom: 0;
      display: grid;
      gap: 12px;
      padding: 0 max(var(--gap), env(safe-area-inset-right)) max(var(--gap), env(safe-area-inset-bottom)) max(var(--gap), env(safe-area-inset-left));
    }
    .legend { margin: 0; min-width: 0; text-shadow: 0 1px 16px rgb(0 0 0 / 0.55); transition: opacity 220ms ease; }
    .legend[data-out] { opacity: 0; }
    .legend em { margin-bottom: 6px; color: var(--accent-text); font-style: normal; }
    .legend strong { display: block; font: 500 clamp(1.35rem, 2.8vw, 2rem)/1.08 var(--serif); letter-spacing: -0.025em; }
    .legend span { display: block; max-width: 54ch; margin-top: 5px; color: var(--ink-soft); font-size: 0.9rem; }
    .info { display: contents; }
    #turn { display: none; }
    /* Sonda de los bordes seguros del teléfono (muesca, esquinas): el guion lee de aquí cuánto ocupan. */
    #safe { position: fixed; visibility: hidden; pointer-events: none; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
    .caption { display: block; color: var(--ink-faint); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }

    .foot { display: flex; flex-direction: column; gap: 8px; }
    .bottom > *, .foot > * { min-width: 0; }

    /* Tira de estancias: una miniatura por escena, con rótulo de planta delante de cada grupo. */
    .strip { display: flex; align-items: flex-start; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--hairline) transparent; padding: 2px 2px 6px; }
    .th-level { flex: none; align-self: flex-start; display: flex; align-items: center; height: 70px; padding: 0 6px 0 10px; color: var(--accent-text); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 1px 8px rgb(0 0 0 / 0.7); }
    .th-level:first-child { padding-left: 0; }
    .th { flex: none; display: grid; gap: 4px; width: 104px; padding: 0; border: 0; background: none; text-align: left; color: var(--ink-soft); }
    .th img { display: block; width: 104px; height: 70px; object-fit: cover; border: 2px solid transparent; background: #2a2a2a; }
    .th span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 0.7rem; line-height: 1.2; text-shadow: 0 1px 8px rgb(0 0 0 / 0.8); }
    .th[aria-current="true"] img { border-color: var(--accent); }
    .th[aria-current="true"] span { color: var(--ink); font-weight: 600; }
    .th:focus-visible { outline: none; }
    .th:focus-visible img { outline: 2px solid #FFFFFF; outline-offset: 1px; }
    @media (hover: hover) and (pointer: fine) { .th:hover img { border-color: rgb(247 246 243 / 0.6); } .th[aria-current="true"]:hover img { border-color: var(--accent); } }

    /* Barra de abajo: anterior, botón principal, avance y automático. */
    .nav { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 0; }
    .nav button, .nav a { border-radius: 0; }
    .btn-prev { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; min-width: 48px; min-height: 52px; padding: 0 16px; border: 1px solid var(--hairline); background: var(--lift); color: var(--ink); font-weight: 500; }
    .btn-main { display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: 0 1 380px; min-width: 0; min-height: 52px; padding: 0 22px; border: 0; background: var(--accent); color: #FFFFFF; font-size: 1.02rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color 140ms ease, transform 140ms ease; }
    .btn-main span { overflow: hidden; text-overflow: ellipsis; }
    #nextkicker { font-size: inherit; }
    #nextkicker::after { content: ": "; }
    .btn-main:focus-visible { outline-color: #FFFFFF; }
    .btn-side { flex: none; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--ink-soft); font-size: 0.8rem; font-weight: 500; white-space: nowrap; }
    .btn-rooms { display: none; }
    .btn-prev:disabled { opacity: 0.35; cursor: default; }
    .meter { display: grid; align-content: center; gap: 7px; flex: 1 1 110px; min-width: 70px; padding: 0 6px; }
    .line { height: 2px; overflow: hidden; background: var(--hairline); }
    .line i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--ease); }
    .note { margin: 0; color: var(--ink-faint); font-size: 0.72rem; text-align: right; text-shadow: 0 1px 10px rgb(0 0 0 / 0.6); }
    .nav :is(button, a):not(:disabled):active { transform: scale(0.98); }
    @media (hover: hover) and (pointer: fine) {
      .btn-main:hover { background: #B80005; }
      .btn-prev:not(:disabled):hover, .btn-side:hover { background: rgb(247 246 243 / 0.16); color: var(--ink); }
    }
    #stage::before { top: 0; }

    @keyframes arrive { from { opacity: 0; transform: translateY(10px); } }
    .top > *, .foot { animation: arrive 520ms var(--ease) backwards; }
    .foot { animation-delay: 160ms; }

    @media (pointer: coarse), (max-width: 760px) {
      .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-strong); }
      .point i::before { animation: none; opacity: 0.55; transform: scale(1.15); }
    }
    .logo { display: block; width: auto; height: 28px; margin-bottom: 8px; }
    .sub { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 0.82rem; text-shadow: 0 1px 12px rgb(0 0 0 / 0.5); }
    .logo-link { display: inline-block; }

    /* Venta: precio y contacto siempre a la vista. */
    .sale { display: flex; align-items: center; gap: 14px; padding: 6px 6px 6px 16px; }
    .sale-txt, .sale-bar p { display: grid; gap: 3px; margin: 0; }
    .price { color: var(--ink); font: 600 1.3rem/1 var(--serif); letter-spacing: -0.01em; white-space: nowrap; }
    .price small { margin-left: 6px; color: var(--ink-soft); font: 500 0.68rem var(--sans); letter-spacing: 0; }
    .sale-txt span, .sale-bar span { color: var(--ink-soft); font-size: 0.74rem; }
    .cta { display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 44px; padding: 0 22px; background: var(--accent); color: #FFFFFF; font-size: 0.92rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color 140ms ease, transform 140ms ease; }
    .cta:active { transform: scale(0.97); }
    .cta:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
    @media (hover: hover) and (pointer: fine) { .cta:hover { background: #B80005; } }
    .sale-bar { display: none; }
    @media (max-width: 1100px) { .sale-txt span { display: none; } }

    /* Pantalla alta (teléfono en vertical): foto entera arriba; debajo, texto, tira, venta y barra. Sin puntos. */
    @media (max-aspect-ratio: 4/5) {
      #stage { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
      #stage::before, #stage::after { content: none; }
      .top, .bottom { position: relative; inset: auto; grid-column: 1; pointer-events: auto; }
      .top { grid-row: 1; align-items: center; padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
      h1 { font-size: 1.3rem; text-shadow: none; }
      .logo { height: 22px; margin-bottom: 5px; }
      .sub { margin-top: 3px; font-size: 0.74rem; }
      #scenes { position: relative; inset: auto; grid-row: 2; grid-column: 1; width: 100%; aspect-ratio: 3 / 2; max-height: 50dvh; touch-action: pan-y; }
      .bottom { grid-row: 3; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; padding: 10px max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
      .info { display: block; min-height: 0; overflow: hidden; }
      .legend { text-shadow: none; }
      .legend strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 1.4rem; }
      .legend span { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 0.9rem; }
      .point { display: none; }
      .foot { gap: 8px; }
      .strip { margin-inline: calc(-1 * max(16px, env(safe-area-inset-left))); padding-inline: max(16px, env(safe-area-inset-left)); }
      .sale-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 14px; border: 1px solid var(--hairline); background: var(--glass-strong); }
      .sale-bar .cta { min-height: 44px; padding: 0 18px; }
      .sale-bar .price { font-size: 1.2rem; }
      .nav { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 0; padding: 6px; }
      .btn-prev { grid-column: 1; min-width: 52px; padding: 0 14px; }
      .btn-main { grid-column: 2 / 4; margin-left: 8px; min-height: 52px; padding: 0 14px; font-size: 0.98rem; }
      .nav:has(#restart:not([hidden])) .btn-main { grid-column: 2; }
      #restart { grid-column: 3; margin-left: 8px; min-height: 52px; border: 1px solid var(--hairline); }
      .meter { grid-column: 1 / 3; grid-row: 2; padding: 0 4px; }
      #auto { grid-column: 3; grid-row: 2; min-height: 32px; margin-left: 8px; }
      .note { display: none; }
    }
    @media (max-aspect-ratio: 4/5) and (max-width: 520px) { .btn-prev span { display: none; } }
    /* Teléfonos más bajos: miniaturas algo menores. */
    @media (max-aspect-ratio: 4/5) and (max-height: 760px) {
      .th { width: 88px; } .th img { width: 88px; height: 58px; } .th-level { height: 58px; }
      .legend span { -webkit-line-clamp: 1; }
    }
    @media (max-aspect-ratio: 4/5) and (max-height: 640px) { .legend span { display: none; } }
    @media (max-aspect-ratio: 4/5) and (pointer: coarse) {
      #turn { display: block; grid-row: 2; grid-column: 1; align-self: start; justify-self: start; z-index: 3; margin: 10px 0 0 10px; padding: 7px 13px; background: rgb(26 26 26 / 0.84); color: var(--ink-soft); font-size: 0.74rem; pointer-events: none; opacity: 0; animation: hint 4.5s ease 1.2s; }
    }
    @keyframes hint { 0%, 100% { opacity: 0; } 10%, 85% { opacity: 1; } }

    /* Teléfono en horizontal: foto a pantalla completa, una fila de mandos y la tira oculta tras «Estancias». */
    @media (max-height: 520px) and (min-aspect-ratio: 4/5) {
      :root { --gap: 12px; }
      #stage::before { height: 110px; background: linear-gradient(rgb(18 18 18 / 0.76), transparent); }
      #stage::after { height: 120px; }
      #scenes { touch-action: pan-y; }
      .top { justify-content: flex-end; padding-top: max(10px, env(safe-area-inset-top)); }
      .top > div:first-child { display: none; }
      .legend { position: fixed; z-index: 2; top: max(10px, env(safe-area-inset-top)); left: max(var(--gap), env(safe-area-inset-left)); max-width: min(56vw, 52ch); }
      .legend em { margin-bottom: 3px; }
      .legend em::before { content: "Chalet en Santa Úrsula · "; }
      .legend strong { font-size: 1.3rem; text-shadow: 0 1px 14px rgb(0 0 0 / 0.7); }
      .legend span { display: none; }
      .bottom { display: block; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
      .foot { width: calc(100% - 200px); }
      .note { display: none; }
      .btn-prev span { display: none; }
      .btn-prev { min-height: 44px; padding: 0 12px; }
      .btn-main { min-height: 48px; padding: 0 16px; font-size: 0.94rem; }
      .nav { gap: 6px; }
      .meter { flex: 0 0 64px; min-width: 0; }
      .btn-rooms { display: block; }
      .strip { display: none; }
      .bottom[data-strip] .strip { display: flex; position: fixed; z-index: 4; left: max(var(--gap), env(safe-area-inset-left)); right: max(var(--gap), env(safe-area-inset-right)); bottom: calc(76px + env(safe-area-inset-bottom)); padding: 10px; border: 1px solid var(--hairline); background: var(--glass-strong); }
      .point { gap: 8px; min-height: 32px; padding: 0 10px 0 13px; font-size: 0.84rem; }
      .sale-bar { position: fixed; z-index: 3; right: max(12px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 4px 4px 4px 12px; border: 1px solid var(--hairline); background: var(--glass-strong); }
      .sale-bar span { display: none; }
      .sale-bar .price { font-size: 1.05rem; }
      .switches .sale { display: none; }
    }
    @media (max-aspect-ratio: 4/5) { .switches .sale { display: none; } }

    /* Pantallas táctiles: todo botón al menos 44 px de alto. */
    @media (pointer: coarse) {
      .btn-prev, .btn-side, .cta, .th { min-height: 44px; }
      .btn-main { min-height: 48px; }
      .point { min-height: 44px; }
    }
    @media (pointer: coarse) and (max-aspect-ratio: 4/5) { #auto { min-height: 44px; } }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
    }

/* Móvil (vertical y horizontal): «SIGUIENTE» pequeño encima y el nombre de la estancia debajo, entero (13-nov). */
@media (max-aspect-ratio: 4/5), (max-height: 520px) and (min-aspect-ratio: 4/5) {
  #nextlabel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; text-align: left; line-height: 1.1; }
  #nextkicker { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
  #nextkicker::after { content: none; }
  #nextname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Volver a la web del chalet: siempre a la vista arriba a la derecha (13-nov). */
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; color: var(--ink); font-size: 0.86rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.back span[aria-hidden] { font-size: 1.05rem; line-height: 1; }
.back:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .back:hover { border-color: rgb(247 246 243 / 0.5); } }
@media (pointer: coarse) { .back { min-height: 44px; } }
@media (max-width: 520px) { .back-long { display: none; } }

/* Móvil vertical en teléfonos reales (con las barras de Safari quedan ~550-750 px de alto):
   la foto cede unos píxeles y el nombre de la estancia se ve siempre entero (13-nov). */
@media (max-aspect-ratio: 4/5) {
  #stage { grid-template-rows: auto minmax(150px, min(66.667vw, 50dvh)) minmax(max-content, 1fr); }
  #scenes { aspect-ratio: auto; height: auto; max-height: none; align-self: stretch; }
}
@media (max-aspect-ratio: 4/5) and (max-height: 760px) {
  .sub { display: none; }
  .btn-main, .btn-prev, #restart { min-height: 48px; }
}
@media (max-aspect-ratio: 4/5) and (max-height: 620px) {
  #stage { grid-template-rows: auto minmax(120px, min(66.667vw, 50dvh)) minmax(max-content, 1fr); }
  .top h1 { display: none; }
  .th { width: 76px; } .th img { width: 76px; height: 50px; } .th-level { height: 50px; }
  .sale-bar span { display: none; }
}
@media (max-aspect-ratio: 4/5) and (max-width: 480px) { .sale-bar .sb-more { display: none; } }

/* Mapas del entorno (14-nov): rótulos fijos sobre la foto. «.l» es el texto largo; «.s», el corto de la
   franja del teléfono; «--wide», rótulos que solo caben en pantallas anchas. */
.mark { --dot: 10px; position: absolute; display: flex; align-items: center; gap: 6px; transform: translate(calc(var(--dot) / -2), -50%); white-space: nowrap; pointer-events: none; font-size: 0.78rem; font-weight: 500; line-height: 1; color: #fff; opacity: 0; transition: opacity 300ms ease; }
.scene[data-points] .mark { opacity: 1; }
.mark i { flex: none; width: var(--dot); height: var(--dot); background: #fff; box-shadow: 0 0 0 2px rgb(26 26 26 / 0.8); }
.mark .t { padding: 6px 8px; background: rgb(26 26 26 / 0.86); }
.mark .t b { font-weight: 600; color: var(--accent-text); }
.mark .s { display: none; }
.mark--l { flex-direction: row-reverse; transform: translate(calc(-100% + var(--dot) / 2), -50%); }
.mark--casa { transform: translate(-50%, calc(-100% - 10px)); }
.mark--casa .t { background: var(--accent); color: var(--accent-ink); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.mark--casa::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 10px; margin-left: -1px; background: var(--accent); }
.mark--badge { left: auto; top: auto; right: 10px; bottom: 10px; transform: none; }
.mark--casa i, .mark--badge i { display: none; }
@media (max-aspect-ratio: 4/5) and (max-width: 699px), (max-height: 520px) and (min-aspect-ratio: 4/5) {
  .mark { --dot: 8px; gap: 4px; font-size: 0.66rem; }
  .mark .t { padding: 3px 5px; }
  .mark .l, .mark--wide { display: none; }
  .mark .s { display: inline; }
  .mark--casa { transform: translate(-50%, calc(-100% - 8px)); }
  .mark--casa .t { font-size: 0.6rem; }
  .mark--casa::after { height: 8px; }
  .mark--badge { right: 6px; bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) { .mark { transition: none; } }
/* Sitio de cada rótulo (lo decide «tidy» en visita.js): a la derecha (r) o a la izquierda (l) del punto, a su
   altura, algo más abajo (d) o arriba (u), o justo debajo o encima; la caja de Madrid, en una esquina del mapa. */
.mark.at-r, .mark.at-rd, .mark.at-ru { flex-direction: row; }
.mark.at-l, .mark.at-ld, .mark.at-lu { flex-direction: row-reverse; }
.mark.at-rd, .mark.at-ld { align-items: flex-start; }
.mark.at-ru, .mark.at-lu { align-items: flex-end; }
.mark.at-r { transform: translate(calc(var(--dot) / -2), -50%); }
.mark.at-l { transform: translate(calc(-100% + var(--dot) / 2), -50%); }
.mark.at-rd { transform: translate(calc(var(--dot) / -2), calc(var(--dot) / -2)); }
.mark.at-ld { transform: translate(calc(-100% + var(--dot) / 2), calc(var(--dot) / -2)); }
.mark.at-ru { transform: translate(calc(var(--dot) / -2), calc(-100% + var(--dot) / 2)); }
.mark.at-lu { transform: translate(calc(-100% + var(--dot) / 2), calc(-100% + var(--dot) / 2)); }
.mark.at-d { flex-direction: column; transform: translate(-50%, calc(var(--dot) / -2)); }
.mark.at-u { flex-direction: column-reverse; transform: translate(-50%, calc(-100% + var(--dot) / 2)); }
.mark--badge.at-br { left: auto; top: auto; right: 8px; bottom: 8px; }
.mark--badge.at-tl { right: auto; bottom: auto; left: 8px; top: 8px; }
.mark--badge.at-bl { right: auto; top: auto; left: 8px; bottom: 8px; }
.mark--badge.at-tr { left: auto; bottom: auto; right: 8px; top: 8px; }
.mark.is-off { display: none; }

/* Enlaces legales (14-nov-2026): discretos, abajo a la derecha en los tres modos. */
.legal-links { margin: 0; color: var(--ink-soft); font-size: 0.68rem; line-height: 1.4; text-align: right; text-shadow: 0 1px 10px rgb(0 0 0 / 0.75); }
.legal-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; pointer-events: auto; }
@media (hover: hover) and (pointer: fine) { .legal-links a:hover { color: #FFFFFF; } }
/* Móvil vertical: sobre la esquina inferior derecha de la foto, sin quitar alto a la ficha. */
@media (max-aspect-ratio: 4/5) {
  .legal-links { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: calc(100% + 6px); }
}
/* Móvil apaisado: justo encima de la barra de precio. */
@media (max-height: 520px) and (min-aspect-ratio: 4/5) {
  .legal-links { position: fixed; z-index: 3; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(10px, env(safe-area-inset-bottom)) + 62px); }
}

/* Móvil apaisado (16-nov-2026): la barra de precio va en la misma fila que los mandos, a su derecha,
   y ya no tapa «Estancias» ni «Automático». Queda en la misma esquina, así que los enlaces legales
   siguen justo encima. Para que quepa en 667 px: «+ impuestos» bajo el precio y botones laterales
   más estrechos; al final del recorrido sobran el contador y «Automático». */
@media (max-height: 520px) and (min-aspect-ratio: 4/5) {
  .foot { width: auto; flex-direction: row; align-items: flex-end; gap: 10px; }
  .foot > .nav { flex: 1; }
  .sale-bar { position: static; order: 1; flex: none; gap: 10px; padding-left: 10px; }
  .sale-bar .price small { display: block; margin: 3px 0 0; }
  .sale-bar .cta { padding: 0 14px; }
  .btn-side { padding: 0 6px; }
  .nav:has(#restart:not([hidden])) :is(.meter, #auto) { display: none; }
}
@media (max-height: 520px) and (min-aspect-ratio: 4/5) and (max-width: 640px) { .meter { display: none; } }
