/*
 * Views [F]: Recorrido (tour), Planos, Galería + lightbox, Ubicación + Cesium
 * context, Áreas comunes, Proyecto, and the "Notas y fuentes" drawer content.
 *
 * Colours only through tokens.css (no raw values here). Semantic tokens
 * (--surface, --ink, --border…) adapt inside [data-surface="dark"|"green"].
 * Full-screen views pad below the floating chrome with --chrome-top.
 * Motion collapses under prefers-reduced-motion (base.css + [data-motion]).
 */

/* ========================================================================
   0. Host, shared pieces
   ======================================================================== */
.vw-host {
  position: absolute;
  inset: 0;
  outline: none;
  animation: vw-enter var(--dur-slow) var(--ease);
}

@keyframes vw-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes vw-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.vw-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
}

.vw-empty-view {
  display: grid;
  place-items: center;
  padding: var(--chrome-top) var(--sp-4) var(--sp-6);
  background: var(--surface);
}

.vw-pick {
  max-width: 440px;
  padding: var(--sp-6);
  text-align: center;
}

.vw-pick .btn {
  margin-top: var(--sp-4);
}

.vw-eyebrow {
  color: var(--ink-muted);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.vw-section-title {
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-3);
  color: var(--ink-muted);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* Status chips: approved still, r16 candidate, official render, plan. */
.vw-chip {
  --chip-bg: var(--hover);
  --chip-ink: var(--ink);
  --chip-dot: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 10px 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  font-variant-numeric: var(--numeric);
  line-height: 1.2;
  white-space: nowrap;
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}

.vw-chip::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--chip-dot);
}

.vw-chip--approved {
  --chip-dot: var(--st-available);
}

.vw-chip--candidate {
  --chip-bg: var(--st-reserved-tint);
  --chip-dot: var(--st-reserved);
  border-color: var(--st-reserved);
}

.vw-chip--official {
  --chip-dot: var(--timber);
}

.vw-chip--plan {
  --chip-dot: var(--olive);
}

.vw-chip--sm {
  min-height: 22px;
  padding: 2px 8px 2px 7px;
  font-size: var(--fs-12);
}

[data-surface="dark"] .vw-chip--candidate {
  --chip-ink: var(--mist);
}

/* Neutral PB-3BR notice (a button that opens the notes). */
.vw-issue {
  cursor: pointer;
  min-height: 28px;
  border: 1px solid var(--border);
}

.vw-issue::before {
  display: none;
}

.vw-issue .icon {
  width: 14px;
  height: 14px;
}

[data-surface="dark"] .vw-issue {
  --badge-bg: var(--surface-glass);
  --badge-ink: var(--mist);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}

/* ⓘ provenance popover */
.vw-pop-host {
  position: relative;
  display: inline-flex;
}

.vw-info-btn {
  width: 36px;
  height: 36px;
  color: var(--ink);
}

.vw-pop {
  position: absolute;
  z-index: var(--z-popover);
  left: 0;
  top: calc(100% + 8px);
  width: min(340px, calc(100vw - 32px));
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--surface-glass-strong);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--elev-2);
  color: var(--ink);
  text-align: left;
  animation: vw-fade-in var(--dur) var(--ease);
}

.vw-pop[data-placement="top"] {
  top: auto;
  bottom: calc(100% + 8px);
  left: auto;
  right: 0;
}

.vw-pop__title {
  margin-bottom: var(--sp-3);
  font-size: var(--fs-14);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}

.vw-pop__note {
  margin-top: var(--sp-3);
  color: var(--ink-muted);
  font-size: var(--fs-12);
  line-height: 1.5;
}

.vw-prov {
  display: grid;
  gap: 6px;
}

.vw-prov__row {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: var(--sp-3);
  font-size: var(--fs-12);
  line-height: 1.45;
}

.vw-prov__row dt {
  color: var(--ink-muted);
}

.vw-prov__row dd {
  overflow-wrap: anywhere;
}

.vw-soon {
  margin-left: 2px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--hover);
  font-size: var(--fs-12);
  font-weight: var(--fw-medium);
}

.vw-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface-raised);
}

.vw-notice__text {
  flex: 1 1 320px;
  color: var(--ink-muted);
  font-size: var(--fs-14);
  line-height: var(--lh-body);
}

/* Spec rows (plan panel) and key facts (location) */
.vw-specs,
.vw-facts {
  display: grid;
}

.vw-specs__row,
.vw-facts__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-14);
}

.vw-specs__row dt,
.vw-facts__row dt {
  color: var(--ink-muted);
  font-size: var(--fs-13);
}

.vw-specs__row dd {
  font-weight: var(--fw-semibold);
  text-align: right;
}

.vw-facts__row {
  display: grid;
  grid-template-columns: 110px 1fr;
}

/* Feature lists (project, common areas) */
.vw-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--sp-3);
  list-style: none;
}

.vw-features__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface-raised);
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

.vw-features__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--pine-soft);
  color: var(--pine);
}

.vw-features--compact {
  grid-template-columns: 1fr;
  gap: 2px;
}

.vw-features--compact .vw-features__item {
  padding: 6px 0;
  border: 0;
  background: none;
  font-weight: var(--fw-regular);
}

.vw-features--compact .icon {
  color: var(--pine);
}

.vw-places {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  list-style: none;
}

.vw-places__item .icon {
  color: var(--olive);
}

/* ========================================================================
   1. Pages (gallery, location, project)
   ======================================================================== */
.vw-page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: var(--chrome-top) 0 calc(var(--safe-bottom) + var(--sp-8));
  background:
    radial-gradient(120% 60% at 50% 0%, var(--mist) 0%, var(--fog) 100%);
  color: var(--ink);
}

.vw-page--flush {
  padding-top: 0;
}

.vw-page__inner {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

.vw-page__head {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-5) 0 var(--sp-5);
}

.vw-page__title {
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.vw-page__title--xl {
  font-size: var(--fs-44);
}

.vw-page__lead {
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
}

.vw-page__footnote {
  margin-top: var(--sp-6);
  color: var(--ink-muted);
  font-size: var(--fs-12);
  line-height: 1.5;
}

/* Tabs (gallery) */
.vw-tabs {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.vw-tabs::-webkit-scrollbar {
  display: none;
}

.vw-tabs__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--touch);
  padding: 0 var(--sp-4);
  color: var(--ink-muted);
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease);
}

.vw-tabs__tab:hover {
  color: var(--ink);
}

.vw-tabs__tab[aria-selected="true"] {
  color: var(--ink);
}

.vw-tabs__tab[aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: var(--sp-3);
  right: var(--sp-3);
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--timber);
}

.vw-tabs__tab:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -4px;
  border-radius: var(--r-xs);
}

.vw-tabs__count {
  color: var(--ink-muted);
  font-size: var(--fs-12);
  font-weight: var(--fw-medium);
}

/* Masonry grid */
.vw-gallery__panel {
  outline: none;
}

.vw-grid {
  column-count: 3;
  column-gap: var(--sp-4);
  list-style: none;
}

.vw-grid__item {
  break-inside: avoid;
  margin-bottom: var(--sp-4);
}

.vw-tile {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface-raised);
  box-shadow: var(--elev-1);
  color: var(--ink);
  text-align: left;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.vw-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--elev-2);
}

.vw-tile:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.vw-tile__media {
  display: block;
  overflow: hidden;
  background: var(--fog);
}

.vw-tile[data-paper="true"] .vw-tile__media {
  background: var(--paper);
}

.vw-tile__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}

.vw-tile[data-paper="true"] .vw-tile__img {
  object-fit: contain;
  padding: var(--sp-2);
}

.vw-tile:hover .vw-tile__img {
  transform: scale(1.03);
}

.vw-tile__text {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: var(--sp-3) 14px 14px;
}

.vw-tile__caption {
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

.vw-tile__meta {
  color: var(--ink-muted);
  font-size: var(--fs-12);
}

/* ========================================================================
   2. Lightbox
   ======================================================================== */
.vw-lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--basalt);
  color: var(--ink);
  overflow: hidden;
}

.vw-lightbox[open] {
  animation: vw-fade-in var(--dur) var(--ease);
}

.vw-lightbox::backdrop {
  background: var(--basalt-a86);
}

.vw-lightbox__viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  outline: none;
  cursor: zoom-in;
}

.vw-lightbox__viewport[data-zoomed="true"] {
  cursor: grab;
}

.vw-lightbox__viewport[data-dragging] {
  cursor: grabbing;
}

.vw-lightbox__viewport:focus-visible {
  box-shadow: inset 0 0 0 2px var(--mist);
}

.vw-lightbox__content,
.vw-plan__content {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.zp-animating {
  transition: transform var(--dur-slow) var(--ease);
}

.vw-lightbox__content[data-paper="true"] {
  border-radius: var(--r-panel);
  background: var(--paper);
}

.vw-lightbox__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--dur-fade) var(--ease);
  user-select: none;
  -webkit-user-drag: none;
}

.vw-lightbox__img[data-active] {
  opacity: 1;
}

.vw-lightbox__img[data-instant] {
  transition: none;
}

.vw-lightbox__top {
  position: absolute;
  top: calc(var(--safe-top) + var(--sp-3));
  left: calc(var(--safe-left) + var(--sp-4));
  right: calc(var(--safe-right) + var(--sp-3));
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  pointer-events: none;
}

.vw-lightbox__top > * {
  pointer-events: auto;
}

.vw-lightbox__spacer {
  flex: 1;
}

.vw-lightbox__counter {
  color: var(--ink-muted);
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
}

.vw-lightbox__nav {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translateY(-50%);
}

.vw-lightbox__nav--prev {
  left: calc(var(--safe-left) + var(--sp-4));
}

.vw-lightbox__nav--next {
  right: calc(var(--safe-right) + var(--sp-4));
}

.vw-lightbox__bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-8) calc(var(--safe-right) + var(--sp-5)) calc(var(--safe-bottom) + var(--sp-5)) calc(var(--safe-left) + var(--sp-5));
  background: linear-gradient(to top, var(--basalt-a86) 0%, var(--basalt-a0) 100%);
  pointer-events: none;
}

.vw-lightbox__bottom > * {
  pointer-events: auto;
}

.vw-lightbox__text {
  flex: 1;
  display: grid;
  gap: 6px;
  max-width: 760px;
}

.vw-lightbox__chips {
  display: flex;
  gap: var(--sp-2);
}

.vw-lightbox__caption {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  line-height: var(--lh-snug);
}

.vw-lightbox__meta {
  color: var(--ink-muted);
  font-size: var(--fs-13);
}

/* ========================================================================
   3. Recorrido (tour)
   ======================================================================== */
.vw-tour {
  position: absolute;
  inset: 0;
  color: var(--ink);
}

.vw-tour[data-mode="photos"] {
  background: var(--basalt);
}

#views .vw-tour[data-mode="3d"] .vw-tour__photo,
#views .vw-tour[data-mode="360"] .vw-tour__photo {
  pointer-events: none;
}

.vw-tour__photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--basalt);
  transition: opacity var(--dur-fade) var(--ease);
  animation: vw-fade-in var(--dur-fade) var(--ease);
  touch-action: pan-y;
}

.vw-tour__photo[data-fading="true"] {
  opacity: 0;
}

.vw-tour__backimg {
  position: absolute;
  inset: -48px;
  width: calc(100% + 96px);
  height: calc(100% + 96px);
  object-fit: cover;
  filter: blur(36px) saturate(1.1) brightness(.5);
  transform: scale(1.06);
}

.vw-tour__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--dur-fade) var(--ease), transform var(--dur-fast) var(--ease);
  user-select: none;
  -webkit-user-drag: none;
}

.vw-tour__img[data-active] {
  opacity: 1;
}

.vw-tour__img[data-instant] {
  transition: none;
}

.vw-tour__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, var(--basalt-a58) 0%, var(--basalt-a0) 30%),
    linear-gradient(to top, var(--basalt-a72) 0%, var(--basalt-a0) 36%);
}

/* Header (room, caption, chips, actions) */
.vw-tour__head {
  position: absolute;
  top: calc(var(--chrome-top) + var(--sp-2));
  left: calc(var(--safe-left) + var(--gutter) + var(--sp-3));
  display: grid;
  justify-items: start;
  gap: var(--sp-2);
  width: max-content;
  max-width: min(560px, calc(100vw - 2 * var(--gutter) - 24px));
}

/* Photos: the header gets its own dark glass (the top scrim alone leaves mist text at
   ~1.2–1.9:1 over the bright r15 walls and ceilings); basalt 86% gives ≥ 7:1. */
.vw-tour[data-mode="photos"] .vw-tour__head {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--surface-glass-strong);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--elev-1);
}

.vw-tour[data-mode="photos"][data-photo="false"] .vw-tour__head {
  display: none;
}

.vw-tour:not([data-mode="photos"]) .vw-tour__head {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--surface-glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--elev-1);
}

.vw-tour__eyebrow {
  color: var(--ink-muted);
}

.vw-tour__title {
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.vw-tour:not([data-mode="photos"]) .vw-tour__title {
  font-size: var(--fs-24);
}

.vw-tour__caption {
  max-width: 46ch;
  font-size: var(--fs-16);
  line-height: var(--lh-snug);
}

.vw-tour__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  text-shadow: none;
}

.vw-tour__chips:empty {
  display: none;
}

.vw-tour__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
  text-shadow: none;
}

.vw-tour__review {
  padding: 6px 12px;
  border: 1px solid var(--st-reserved);
  border-radius: var(--r-card);
  background: var(--st-reserved-tint);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  text-shadow: none;
}

/* Mode switch */
.vw-tour__modes {
  position: absolute;
  top: calc(var(--chrome-top) + var(--sp-2));
  right: calc(var(--safe-right) + var(--gutter));
  box-shadow: var(--elev-1);
}

.vw-tour__mode[aria-disabled="true"] {
  opacity: .62;
  cursor: not-allowed;
}

.vw-tour__mode .icon {
  width: 18px;
  height: 18px;
}

/* Photo navigation */
.vw-tour__nav {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translateY(-50%);
}

.vw-tour__nav--prev {
  left: calc(var(--safe-left) + var(--gutter) + var(--sp-2));
}

.vw-tour__nav--next {
  right: calc(var(--safe-right) + var(--gutter) + var(--sp-2));
}

.vw-tour__counter {
  position: absolute;
  right: calc(var(--safe-right) + var(--gutter) + 236px);
  bottom: calc(var(--safe-bottom) + var(--gutter) + 136px);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-glass);
  color: var(--ink);
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
}

/* Room carousel */
.vw-tour__rooms {
  position: absolute;
  left: calc(var(--safe-left) + var(--gutter));
  right: calc(var(--safe-right) + var(--gutter) * 2 + 220px);
  bottom: calc(var(--safe-bottom) + var(--gutter));
  display: flex;
}

.vw-tour__rail {
  display: flex;
  gap: 10px;
  max-width: 100%;
  padding: 6px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--white-a28) var(--basalt-a0);
  border-radius: var(--r-panel);
}

.vw-tour:not([data-mode="photos"]) .vw-tour__rail {
  scrollbar-color: var(--basalt-a20) var(--basalt-a0);
}

.vw-tour__rail > li {
  flex: none;
  scroll-snap-align: center;
}

.vw-room {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 148px;
  padding: 6px 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface-glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--elev-1);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.vw-room:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.vw-room[aria-current="true"] {
  border-color: var(--timber);
  box-shadow: 0 0 0 1px var(--timber), var(--elev-1);
}

.vw-room__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: var(--basalt-a20);
}

.vw-room__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vw-room__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--ink-muted);
}

.vw-room__text {
  display: grid;
  gap: 2px;
  padding: 0 2px;
}

.vw-room__name {
  overflow: hidden;
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vw-room__sub {
  color: var(--ink-muted);
  font-size: var(--fs-12);
}

.vw-room[data-photos="false"] .vw-room__sub {
  color: var(--ink);
}

/* Minimap (always light, even over photographs) */
.vw-map {
  --surface: var(--mist);
  --surface-raised: var(--paper);
  --surface-glass: var(--mist-glass);
  --surface-glass-text: var(--mist-a92);
  --ink: var(--basalt);
  --ink-muted: var(--muted);
  --border: var(--line);
  --hover: var(--basalt-a06);
  --focus-ring: var(--pine);
  position: absolute;
  right: calc(var(--safe-right) + var(--gutter));
  bottom: calc(var(--safe-bottom) + var(--gutter));
  width: 220px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  box-shadow: var(--elev-2);
  color: var(--ink);
}

.vw-map__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 0 var(--sp-3);
  color: var(--ink);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.vw-map__toggle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur-fast) var(--ease);
}

.vw-map[data-collapsed="true"] .vw-map__toggle::after {
  transform: rotate(-135deg) translateY(-2px);
}

.vw-map__body {
  padding: 0 var(--sp-2) var(--sp-2);
}

.vw-map__plane {
  position: relative;
  width: 100%;
  max-height: 44vh;
  margin: 0 auto;
}

.vw-map__frame,
.vw-map__dots {
  position: absolute;
  inset: 0;
}

.vw-map__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vw-map__dot {
  position: absolute;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.vw-map__dot::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--pine);
  box-shadow: 0 1px 4px var(--shadow-a28);
  transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.vw-map__dot[data-photos="false"]::before {
  background: var(--olive);
}

.vw-map__dot:hover::before,
.vw-map__dot[aria-current="true"]::before {
  transform: translate(-50%, -50%) scale(1.3);
  background: var(--timber);
}

.vw-map__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2px);
  padding: 3px 8px;
  transform: translateX(-50%);
  border-radius: var(--r-pill);
  background: var(--basalt);
  color: var(--mist);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease);
}

.vw-map__dot:hover .vw-map__label,
.vw-map__dot:focus-visible .vw-map__label {
  opacity: 1;
}

.vw-map__marker {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.vw-map__pin {
  position: absolute;
  left: -7px;
  top: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--timber);
  box-shadow: 0 0 0 0 var(--timber);
  animation: vw-pulse 2.2s var(--ease) infinite;
}

.vw-map__cone {
  position: absolute;
  left: 0;
  top: -22px;
  width: 46px;
  height: 44px;
  transform-origin: 0 50%;
  clip-path: polygon(0 50%, 100% 8%, 100% 92%);
  background: linear-gradient(to right, var(--timber) 0%, var(--st-reserved-tint) 100%);
  opacity: .72;
}

@keyframes vw-pulse {
  0% { box-shadow: 0 0 0 0 var(--timber); }
  70% { box-shadow: 0 0 0 10px var(--mist-a0); }
  100% { box-shadow: 0 0 0 0 var(--mist-a0); }
}

/* 3D status (loading, error, unavailable) and hint */
.vw-tour__status {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  width: min(420px, calc(100vw - 32px));
  padding: var(--sp-5);
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--mist-glass);
  box-shadow: var(--elev-2);
  color: var(--basalt);
}

.vw-tour__status:not([data-kind="loading"]) .spinner {
  display: none;
}

.vw-tour__status-body {
  display: grid;
  flex: 1;
  gap: var(--sp-2);
}

.vw-tour__status-title {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: var(--fw-bold);
}

.vw-tour__status-text {
  color: var(--muted);
  font-size: var(--fs-14);
}

.vw-tour__status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.vw-tour__hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + var(--gutter) + 148px);
  padding: 8px 16px;
  transform: translateX(-50%);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: var(--fs-13);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  animation: vw-fade-in var(--dur-slow) var(--ease);
}

/* Empty state (no approved photos for this type) */
.vw-tour__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: calc(var(--chrome-top) + var(--sp-8)) var(--sp-4) var(--sp-6);
  background: var(--basalt);
}

.vw-tour__empty-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px) brightness(.42) saturate(1.05);
  transform: scale(1.08);
}

.vw-tour__empty-card {
  position: relative;
  display: grid;
  justify-items: start;
  gap: var(--sp-3);
  width: min(780px, 100%);
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--surface-glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--elev-3);
}

.vw-tour__empty-title {
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.vw-tour__empty-body {
  max-width: 58ch;
  color: var(--ink-muted);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
}

.vw-tour__empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.vw-tour__empty-refs-title {
  margin-top: var(--sp-4);
  color: var(--ink-muted);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.vw-tour__refs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: var(--sp-3);
  width: 100%;
  list-style: none;
}

.vw-ref {
  display: grid;
  gap: 6px;
  width: 100%;
  color: var(--ink);
  text-align: left;
}

.vw-ref__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--r-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.vw-ref:hover .vw-ref__img {
  transform: translateY(-2px);
  box-shadow: var(--elev-2);
}

.vw-ref__label {
  color: var(--ink-muted);
  font-size: var(--fs-12);
}

.vw-tour__empty-note {
  color: var(--ink-muted);
  font-size: var(--fs-12);
  line-height: 1.5;
}

.vw-tour[data-mode="photos"][data-photo="false"] .vw-tour__counter,
.vw-tour[data-mode="photos"][data-photo="false"] .vw-tour__nav {
  display: none;
}

/* ========================================================================
   4. Planos
   ======================================================================== */
.vw-plan {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 30% 20%, var(--mist) 0%, var(--fog) 100%);
}

.vw-plan__layout {
  position: absolute;
  top: var(--chrome-top);
  left: calc(var(--safe-left) + var(--gutter));
  right: calc(var(--safe-right) + var(--gutter));
  bottom: calc(var(--safe-bottom) + var(--gutter));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: var(--gutter);
}

.vw-plan__stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--paper);
  box-shadow: var(--elev-1);
}

.vw-plan__toolbar {
  position: absolute;
  z-index: 2;
  top: var(--sp-3);
  left: var(--sp-3);
  right: var(--sp-3);
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}

.vw-plan__toolbar > * {
  pointer-events: auto;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.vw-plan__viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  outline: none;
  cursor: grab;
}

.vw-plan__viewport[data-dragging] {
  cursor: grabbing;
}

.vw-plan__viewport:focus-visible {
  box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.vw-plan__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.vw-plan__img--full {
  opacity: 0;
  transition: opacity var(--dur-fade) var(--ease);
}

.vw-plan__img--full[data-loaded="true"] {
  opacity: 1;
}

.vw-plan__hotspots {
  position: absolute;
  inset: 0;
}

.vw-spot {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px 4px 8px;
  transform: translate(-50%, -50%) scale(var(--zp-inv, 1));
  transform-origin: 50% 50%;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-glass-strong);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--elev-1);
  color: var(--ink);
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.vw-spot::before {
  content: '';
  position: absolute;
  inset: -6px;
}

.vw-spot:hover,
.vw-spot:focus-visible {
  border-color: var(--pine);
  background: var(--pine);
  color: var(--pine-ink);
}

.vw-spot[aria-current="true"] {
  border-color: var(--timber);
  box-shadow: 0 0 0 1px var(--timber), var(--elev-1);
}

.vw-spot__dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--olive);
}

.vw-spot[data-photos="true"] .vw-spot__dot {
  background: var(--pine);
}

.vw-spot:hover .vw-spot__dot,
.vw-spot:focus-visible .vw-spot__dot {
  background: var(--pine-ink);
}

.vw-plan[data-plan-mode="top"] .vw-plan__stage,
.vw-plan__stage {
  background: var(--paper);
}

.vw-plan__zoom {
  position: absolute;
  z-index: 2;
  right: var(--sp-3);
  bottom: var(--sp-3);
  display: grid;
  gap: var(--sp-2);
}

.vw-plan__note {
  position: absolute;
  z-index: 2;
  left: var(--sp-3);
  bottom: var(--sp-3);
  max-width: calc(100% - 96px);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  color: var(--ink-muted);
  font-size: var(--fs-12);
  line-height: 1.4;
}

.vw-plan__info {
  min-height: 0;
  overflow: hidden;
}

.vw-plan__info-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  height: 100%;
  padding: var(--sp-5);
  overflow-y: auto;
}

.vw-plan__title {
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.vw-plan__meta {
  margin-top: calc(var(--sp-2) * -1);
  color: var(--ink-muted);
  font-size: var(--fs-14);
}

.vw-plan__issue:empty {
  display: none;
}

.vw-plan__legend-box {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.vw-plan__legend-title {
  color: var(--ink-muted);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.vw-plan__legend-hint {
  color: var(--ink-muted);
  font-size: var(--fs-13);
}

.vw-plan__legend {
  display: grid;
  gap: 2px;
  list-style: none;
}

.vw-legend__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: var(--touch);
  padding: 0 var(--sp-2) 0 var(--sp-3);
  border-radius: var(--r-card);
  color: var(--ink);
  font-size: var(--fs-14);
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease);
}

.vw-legend__item:hover {
  background: var(--hover);
}

.vw-legend__name {
  flex: 1;
  font-weight: var(--fw-semibold);
}

.vw-legend__tag {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--pine-soft);
  color: var(--pine);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
}

.vw-legend__item[data-photos="false"] .vw-legend__tag {
  background: var(--hover);
  color: var(--ink-muted);
}

.vw-plan__actions {
  display: grid;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-4);
}

/* ========================================================================
   5. Ubicación and the Cesium context
   ======================================================================== */
.vw-location__head {
  padding-bottom: var(--sp-6);
}

.vw-location__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: var(--sp-6);
  align-items: start;
}

.vw-location__figure {
  position: sticky;
  top: var(--sp-4);
}

.vw-location__map {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--r-panel);
  box-shadow: var(--elev-2);
  cursor: zoom-in;
}

.vw-location__map-frame {
  display: block;
  width: 100%;
  background: var(--fog);
}

.vw-location__map-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
  transition: transform var(--dur-slow) var(--ease);
}

.vw-location__map:hover .vw-location__map-img {
  transform: scale(1.015);
}

.vw-location__map:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.vw-location__map-hint {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--mist-glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  color: var(--basalt);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
}

.vw-location__caption {
  margin-top: var(--sp-2);
  color: var(--ink-muted);
  font-size: var(--fs-12);
}

.vw-location__side {
  display: grid;
  gap: var(--sp-3);
}

.vw-location__pitch {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  line-height: 1.45;
}

.vw-location__pitch--muted {
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: var(--fs-16);
}

.vw-location__cta {
  display: grid;
  justify-items: start;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding: var(--sp-5);
  background: var(--pine);
}

.vw-location__cta-title {
  font-family: var(--font-display);
  font-size: var(--fs-24);
  font-weight: var(--fw-bold);
}

.vw-location__cta-text {
  color: var(--ink-muted);
  font-size: var(--fs-14);
  line-height: var(--lh-body);
}

.vw-location__cta .btn {
  margin-top: var(--sp-2);
}

.vw-location__note {
  color: var(--ink-muted);
  font-size: var(--fs-12);
  line-height: 1.5;
}

.vw-location__side > .btn {
  justify-self: start;
  margin-top: var(--sp-2);
}

.vw-context {
  position: absolute;
  inset: 0;
  background: var(--fog);
}

.vw-context__host {
  position: absolute;
  inset: 0;
}

.vw-context__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-3);
  color: var(--ink-muted);
  font-size: var(--fs-14);
}

.vw-context__error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--chrome-top) var(--sp-4) var(--sp-5);
}

.vw-context__error-card {
  display: grid;
  justify-items: center;
  gap: var(--sp-3);
  max-width: 440px;
  padding: var(--sp-6);
  text-align: center;
}

.vw-context__error-title {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: var(--fw-bold);
}

.vw-context__error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
}

/* geography.js chrome (restyled; the engine is unchanged) */
.geography-canvas {
  position: absolute;
  inset: 0;
}

.geography-heading {
  position: absolute;
  top: calc(var(--chrome-top) + var(--sp-2));
  left: calc(var(--safe-left) + var(--gutter));
  display: grid;
  gap: 4px;
  max-width: min(380px, calc(100vw - 2 * var(--gutter)));
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--mist-glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--elev-1);
  pointer-events: none;
}

.geography-eyebrow {
  color: var(--muted);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.geography-title {
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.geography-subtitle {
  color: var(--muted);
  font-size: var(--fs-14);
}

.geography-controls {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + var(--gutter) + var(--sp-2));
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  transform: translateX(-50%);
  max-width: calc(100vw - 2 * var(--gutter));
}

.geography-toolbar {
  box-shadow: var(--elev-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.geography-preset {
  min-height: var(--touch);
  padding: 0 var(--sp-4);
}

.geography-return {
  flex: none;
}

.geography-information {
  position: absolute;
  left: calc(var(--safe-left) + var(--gutter));
  bottom: calc(var(--safe-bottom) + var(--gutter) + var(--sp-2));
  max-width: 380px;
}

.geography-source-toggle {
  min-height: 36px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--mist-glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  color: var(--basalt);
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  box-shadow: var(--elev-1);
}

.geography-source-detail {
  position: absolute;
  bottom: calc(100% + var(--sp-2));
  left: 0;
  display: grid;
  gap: var(--sp-2);
  width: min(360px, calc(100vw - 2 * var(--gutter)));
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--mist-a92);
  box-shadow: var(--elev-2);
  color: var(--basalt);
  font-size: var(--fs-13);
  line-height: 1.55;
}

.geography-source-detail a {
  color: var(--pine);
  font-weight: var(--fw-semibold);
}

.geography-hint {
  position: absolute;
  top: calc(var(--chrome-top) + var(--sp-2));
  right: calc(var(--safe-right) + var(--gutter));
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--mist-glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  color: var(--basalt);
  font-size: var(--fs-12);
  font-weight: var(--fw-medium);
  pointer-events: none;
}

.geography-credits {
  position: absolute;
  right: calc(var(--safe-right) + var(--gutter));
  /* Above the preset row, so the (now on-screen) credits never sit under the buttons. */
  bottom: calc(var(--safe-bottom) + var(--gutter) + var(--sp-2) + 62px);
  max-width: min(30vw, 420px);
  color: var(--mist);
  font-size: var(--fs-12);
  text-align: right;
}

.geography-credits .cesium-credit-textContainer {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: var(--basalt-a58);
  font-size: var(--fs-12);
  line-height: 1.5;
}

.geography-credits a {
  color: var(--mist);
}

/*
 * Cesium's own credit box is absolutely positioned (CesiumWidget.css), which collapsed this
 * container to zero width and pushed every credit off the right edge. In flow, the required
 * "Powered by Esri | sources" and "© OpenStreetMap contributors" credits stay on screen.
 */
.geography-credits .cesium-widget-credits {
  position: static;
  padding: 4px 8px;
  border-radius: var(--r-xs);
  background: var(--basalt-a58);
  line-height: 1.5;
  text-shadow: none;
}

.geography-credits .cesium-widget-credits .cesium-credit-textContainer {
  padding: 0;
  background: none;
}

.geography-status {
  position: absolute;
  left: 50%;
  top: calc(var(--chrome-top) + var(--sp-8));
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 16px;
  transform: translateX(-50%);
  border-radius: var(--r-pill);
  background: var(--mist-a92);
  box-shadow: var(--elev-1);
  color: var(--basalt);
  font-size: var(--fs-13);
  font-weight: var(--fw-medium);
}

.geography-status[hidden] {
  display: none;
}

/* ========================================================================
   6. Áreas comunes (panel over the live stage)
   ======================================================================== */
body[data-view="common"] {
  --stage-inset-left: calc(var(--safe-left) + var(--gutter) * 2 + min(400px, 38vw));
}

.vw-areas {
  position: absolute;
  inset: 0;
}

.vw-areas__backdrop {
  position: absolute;
  inset: 0;
  background: var(--basalt);
}

.vw-areas__backdrop-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: vw-fade-in var(--dur-fade) var(--ease);
}

.vw-areas__backdrop-caption {
  position: absolute;
  right: calc(var(--safe-right) + var(--gutter));
  bottom: calc(var(--safe-bottom) + var(--gutter));
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--mist-glass);
  color: var(--basalt);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
}

.vw-areas__panel {
  position: absolute;
  top: var(--chrome-top);
  left: calc(var(--safe-left) + var(--gutter));
  bottom: calc(var(--safe-bottom) + var(--gutter));
  width: min(400px, 38vw);
  overflow: hidden;
}

.vw-areas__scroll {
  flex: 1;
  min-height: 0;
  padding: var(--sp-5);
  overflow-y: auto;
}

.vw-areas__head {
  display: grid;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.vw-areas__title {
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.vw-areas__intro {
  color: var(--ink-muted);
  font-size: var(--fs-14);
  line-height: var(--lh-body);
}

.vw-areas__list {
  display: grid;
  gap: var(--sp-2);
  list-style: none;
}

.vw-area {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface-raised);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.vw-area[data-open="true"] {
  border-color: var(--timber);
  box-shadow: var(--elev-1);
}

.vw-area__head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: 72px;
  padding: var(--sp-2);
  color: var(--ink);
  text-align: left;
}

.vw-area__head:hover {
  background: var(--hover);
}

.vw-area__thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: var(--fog);
  color: var(--ink-muted);
}

.vw-area__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vw-area__text {
  display: grid;
  gap: 2px;
}

.vw-area__name {
  font-size: var(--fs-16);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

.vw-area__body {
  color: var(--ink-muted);
  font-size: var(--fs-13);
  line-height: 1.4;
}

.vw-area__chevron {
  color: var(--ink-muted);
  transition: transform var(--dur-fast) var(--ease);
}

.vw-area__head[aria-expanded="true"] .vw-area__chevron {
  transform: rotate(180deg);
}

.vw-area__detail {
  display: grid;
  gap: var(--sp-3);
  padding: 0 var(--sp-2) var(--sp-3);
  animation: vw-fade-in var(--dur) var(--ease);
}

.vw-area__images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-2);
}

.vw-area__image {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--r-xs);
  cursor: zoom-in;
}

.vw-area__image-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}

.vw-area__image:hover .vw-area__image-img {
  transform: scale(1.04);
}

.vw-area__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--sp-5) var(--sp-2) 6px;
  background: linear-gradient(to top, var(--basalt-a72) 0%, var(--basalt-a0) 100%);
  color: var(--mist);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  text-align: left;
}

.vw-area__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.vw-areas__features {
  margin-top: var(--sp-4);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

/* ========================================================================
   7. Proyecto
   ======================================================================== */
.vw-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(88vh, 780px);
  overflow: hidden;
  background: var(--basalt);
  color: var(--ink);
}

.vw-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
  /* One slow drift that settles (no endless motion, WCAG 2.2.2). */
  animation: vw-kenburns 24s var(--ease-in-out) 1 forwards;
}

@keyframes vw-kenburns {
  from { transform: scale(1.02); }
  to { transform: scale(1.09) translate3d(-1%, -1%, 0); }
}

.vw-hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--basalt-a86) 0%, var(--basalt-a42) 42%, var(--basalt-a0) 70%),
    linear-gradient(to bottom, var(--basalt-a58) 0%, var(--basalt-a0) 32%);
}

.vw-hero__inner {
  position: relative;
  display: grid;
  justify-items: start;
  gap: var(--sp-3);
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: calc(var(--chrome-top) + var(--sp-7)) var(--sp-5) calc(var(--sp-8) + var(--sp-5));
}

.vw-hero__brand {
  margin-bottom: var(--sp-4);
}

.vw-hero__tagline {
  color: var(--ink-muted);
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  letter-spacing: .2em;
  text-transform: uppercase;
}

.vw-hero__title {
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: var(--fs-44);
  font-weight: var(--fw-bold);
  line-height: 1.08;
}

.vw-hero__lead {
  max-width: 46ch;
  color: var(--ink-muted);
  font-size: var(--fs-20);
  font-weight: var(--fw-light);
  line-height: 1.45;
}

.vw-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.vw-hero__credit {
  margin-top: var(--sp-3);
  color: var(--ink-muted);
  font-size: var(--fs-12);
}

.vw-project__inner {
  position: relative;
}

.vw-figures {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: calc(var(--sp-8) * -1);
  padding: var(--sp-5) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--surface-raised);
  box-shadow: var(--elev-2);
}

.vw-figure {
  display: grid;
  gap: 4px;
  padding: var(--sp-2) var(--sp-5);
}

.vw-figure + .vw-figure {
  border-left: 1px solid var(--border);
}

.vw-figure__value {
  font-size: var(--fs-32);
  font-weight: var(--fw-light);
  line-height: 1.1;
  white-space: nowrap;
}

.vw-figure__label {
  color: var(--ink-muted);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.vw-section {
  padding-top: var(--sp-8);
}

.vw-section > .vw-eyebrow {
  margin-bottom: var(--sp-2);
}

.vw-section__title {
  margin-bottom: var(--sp-5);
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.vw-pitch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: center;
}

.vw-pitch__text > .vw-eyebrow {
  margin-bottom: var(--sp-2);
}

.vw-pitch__list {
  display: grid;
  gap: var(--sp-4);
  list-style: none;
  counter-reset: pitch;
}

.vw-pitch__item {
  position: relative;
  padding-left: var(--sp-7);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  counter-increment: pitch;
}

.vw-pitch__item::before {
  content: counter(pitch, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -2px;
  color: var(--timber);
  font-size: var(--fs-20);
  font-weight: var(--fw-light);
  font-variant-numeric: var(--numeric);
}

.vw-pitch__figure {
  display: grid;
  gap: var(--sp-2);
}

.vw-pitch__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-panel);
  box-shadow: var(--elev-2);
}

.vw-pitch__figure figcaption {
  color: var(--ink-muted);
  font-size: var(--fs-12);
}

.vw-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
  list-style: none;
}

.vw-step {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--surface-raised);
}

.vw-step__index {
  color: var(--timber);
  font-size: var(--fs-24);
  font-weight: var(--fw-light);
}

.vw-step__title {
  font-size: var(--fs-20);
  font-weight: var(--fw-semibold);
  font-variant-numeric: var(--numeric);
}

.vw-step__text {
  color: var(--ink-muted);
  font-size: var(--fs-14);
  line-height: var(--lh-body);
}

.vw-terms__note,
.vw-terms__unknown {
  margin-top: var(--sp-3);
  color: var(--ink-muted);
  font-size: var(--fs-13);
  line-height: 1.5;
}

.vw-sales {
  margin-top: var(--sp-8);
  background: var(--pine);
  color: var(--ink);
}

.vw-sales__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-6);
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--sp-7) var(--sp-5);
}

.vw-sales__brand {
  padding-right: var(--sp-6);
  border-right: 1px solid var(--border-strong);
}

.vw-sales__text {
  display: grid;
  gap: var(--sp-2);
  color: var(--ink-muted);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
}

.vw-sales__title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-32);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.vw-sales__who {
  color: var(--ink);
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
}

.vw-notes-link {
  padding-top: var(--sp-7);
}

.vw-notes-link__card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-5);
  text-align: left;
}

.vw-notes-link__card > .icon:first-child {
  color: var(--olive);
}

.vw-notes-link__text {
  display: grid;
  flex: 1;
  gap: 4px;
}

.vw-notes-link__title {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: var(--fw-bold);
}

.vw-notes-link__hint {
  color: var(--ink-muted);
  font-size: var(--fs-14);
}

/* ========================================================================
   8. "Notas y fuentes" drawer content
   ======================================================================== */
.vw-notes__intro {
  margin-bottom: var(--sp-4);
  color: var(--ink-muted);
  font-size: var(--fs-14);
  line-height: var(--lh-body);
}

.vw-notes__section.notes__section,
.vw-notes__section + .vw-notes__section {
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid var(--border);
}

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

.vw-notes__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 52px;
  cursor: pointer;
  list-style: none;
}

.vw-notes__summary::-webkit-details-marker {
  display: none;
}

.vw-notes__summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.vw-notes__section .vw-notes__heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: var(--fw-bold);
}

.vw-notes__chevron {
  flex: none;
  color: var(--ink-muted);
  transition: transform var(--dur-fast) var(--ease);
}

.vw-notes__section[open] .vw-notes__chevron {
  transform: rotate(180deg);
}

.vw-notes__content {
  display: grid;
  gap: var(--sp-2);
  padding-bottom: var(--sp-4);
}

.vw-notes__section .vw-notes__content p {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--fs-14);
  line-height: 1.6;
}

.vw-notes__list {
  display: grid;
  gap: 6px;
  padding-left: var(--sp-5);
  color: var(--ink-muted);
  font-size: var(--fs-14);
  line-height: 1.5;
}

.vw-notes__list a,
.vw-notes__content a {
  color: var(--pine);
  font-weight: var(--fw-semibold);
}

.vw-notes__section .vw-notes__subhead {
  margin-top: var(--sp-2);
  color: var(--ink);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.vw-notes__section .vw-notes__sales {
  color: var(--ink);
  font-weight: var(--fw-semibold);
}

.vw-notes__table {
  gap: var(--sp-2);
}

/* ========================================================================
   9. Responsive
   ======================================================================== */
@media (max-width: 1099px) {
  .vw-grid {
    column-count: 2;
  }

  .vw-location__grid,
  .vw-pitch {
    grid-template-columns: 1fr;
  }

  .vw-location__figure {
    position: static;
  }

  .vw-sales__inner {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: var(--sp-4);
  }

  .vw-sales__brand {
    padding-right: 0;
    border-right: 0;
  }

  .vw-plan__layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .geography-hint {
    display: none;
  }
}

@media (max-width: 759px) {
  .vw-page__inner {
    padding: 0 var(--sp-4);
  }

  .vw-page__title,
  .vw-page__title--xl,
  .vw-section__title,
  .vw-sales__title {
    font-size: var(--fs-24);
  }

  .vw-grid {
    column-gap: var(--sp-2);
  }

  .vw-grid__item {
    margin-bottom: var(--sp-2);
  }

  .vw-tile__text {
    padding: var(--sp-2) var(--sp-3) var(--sp-3);
  }

  .vw-hero {
    min-height: 92dvh;
  }

  .vw-hero__title {
    font-size: var(--fs-32);
  }

  .vw-hero__lead {
    font-size: var(--fs-16);
  }

  .vw-hero__inner {
    padding-bottom: calc(var(--sp-8) + var(--sp-4));
  }

  .vw-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--sp-3);
  }

  .vw-figure {
    padding: var(--sp-2) var(--sp-3);
  }

  .vw-figure + .vw-figure {
    border-left: 0;
  }

  .vw-figure__value {
    font-size: var(--fs-24);
  }

  /* Tour */
  .vw-tour__head {
    left: calc(var(--safe-left) + var(--gutter) + var(--sp-2));
    max-width: calc(100vw - 2 * var(--gutter) - 16px);
  }

  .vw-tour__title {
    font-size: var(--fs-24);
  }

  .vw-tour__caption {
    font-size: var(--fs-14);
  }

  .vw-tour__modes {
    top: auto;
    right: auto;
    left: calc(var(--safe-left) + var(--gutter));
    bottom: calc(var(--safe-bottom) + var(--gutter) + 124px);
  }

  /* Icons only for the modes that are not selected (names stay for screen readers). */
  .vw-tour__mode:not([aria-pressed="true"]) .vw-tour__mode-label,
  .vw-tour__mode .vw-soon {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .vw-tour__nav {
    width: var(--touch);
    height: var(--touch);
  }

  .vw-tour__rooms {
    right: calc(var(--safe-right) + var(--gutter));
  }

  .vw-room {
    width: 124px;
  }

  .vw-tour__counter {
    display: none;
  }

  .vw-map {
    right: calc(var(--safe-right) + var(--gutter));
    bottom: calc(var(--safe-bottom) + var(--gutter) + 124px);
    width: 136px;
  }

  .vw-tour__head {
    right: calc(var(--safe-right) + var(--gutter));
    width: auto;
  }

  .vw-tour__caption {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .vw-tour[data-mode="photos"][data-photo="false"] .vw-map {
    display: none;
  }

  .vw-tour__hint {
    bottom: calc(var(--safe-bottom) + var(--gutter) + 180px);
    white-space: normal;
    width: max-content;
    max-width: calc(100vw - 32px);
    text-align: center;
  }

  .vw-tour__empty-card {
    padding: var(--sp-5);
  }

  .vw-tour__empty-title {
    font-size: var(--fs-24);
  }

  /* Plan */
  .vw-plan__layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .vw-plan__info {
    max-height: 42dvh;
  }

  .vw-plan__info-body {
    padding: var(--sp-4);
  }

  .vw-plan__title {
    font-size: var(--fs-24);
  }

  .vw-plan__note {
    display: none;
  }

  /* Common areas: bottom sheet */
  body[data-view="common"] {
    --stage-inset-left: calc(var(--safe-left) + var(--gutter));
    --stage-inset-bottom: calc(52dvh + var(--gutter));
  }

  .vw-areas__panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 52dvh;
    border-radius: var(--r-panel) var(--r-panel) 0 0;
  }

  .vw-areas__scroll {
    padding: var(--sp-4) var(--sp-4) calc(var(--safe-bottom) + var(--sp-4));
  }

  .vw-areas__title {
    font-size: var(--fs-24);
  }

  /* Cesium chrome */
  .geography-heading {
    padding: var(--sp-3) var(--sp-4);
  }

  .geography-title {
    font-size: var(--fs-24);
  }

  .geography-subtitle {
    display: none;
  }

  .geography-controls {
    left: var(--gutter);
    right: var(--gutter);
    bottom: calc(var(--safe-bottom) + var(--gutter) + 64px);
    flex-direction: column;
    align-items: stretch;
    transform: none;
  }

  .geography-information {
    bottom: calc(var(--safe-bottom) + var(--gutter) + 186px);
  }

  .geography-credits {
    left: var(--gutter);
    right: var(--gutter);
    bottom: calc(var(--safe-bottom) + 4px);
    max-width: none;
    text-align: left;
  }

  .geography-credits .cesium-credit-textContainer {
    font-size: 10px;
    line-height: 1.35;
  }

  .vw-lightbox__nav {
    display: none;
  }

  .vw-lightbox__caption {
    font-size: var(--fs-16);
  }
}

/* Reduced motion: no Ken Burns, no pulses, instant crossfades. */
@media (prefers-reduced-motion: reduce) {
  .vw-hero__img,
  .vw-map__pin {
    animation: none;
  }

  .vw-tour__img,
  .vw-lightbox__img,
  .vw-tour__photo,
  .vw-plan__img--full {
    transition: none;
  }
}

[data-motion="reduced"] .vw-hero__img,
[data-motion="reduced"] .vw-map__pin {
  animation: none;
}

/* Coarse pointers: every control reaches the 44 px touch target. */
@media (pointer: coarse) {
  .vw-tour .btn--sm,
  .vw-area .btn--sm,
  .vw-tour__status .btn--sm,
  .vw-tour__modes .segmented__btn,
  .vw-plan__modes .segmented__btn,
  .vw-info-btn,
  .vw-issue {
    min-height: var(--touch);
    min-width: var(--touch);
  }

  .vw-map__dot {
    width: 40px;
    height: 40px;
  }
}

/* Rooms with an open known issue (PB-3BR bathroom 2): a neutral olive marker with a
   dashed ring, never a status colour (amber means "Reservado" in the availability legend). */
.vw-spot[data-issue="true"] .vw-spot__dot {
  background: var(--olive);
  box-shadow: 0 0 0 2px var(--mist), 0 0 0 3px var(--olive);
}

.vw-legend__item[data-issue="true"] .vw-legend__tag {
  border: 1px dashed var(--border-strong);
  background: var(--hover);
  color: var(--ink-muted);
}

/* Short viewports (landscape phones, 200% zoom): the tour header scrolls inside its own
   box, the room carousel folds away (rooms stay reachable with ‹ › and the minimap) and
   the controls line the bottom edge, so nothing paints over the header (WCAG 1.4.10). */
@media (max-height: 520px) {
  .vw-tour__head {
    max-height: calc(100dvh - var(--chrome-top) - var(--sp-2) - var(--touch) - var(--gutter) * 2);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .vw-tour__title,
  .vw-tour:not([data-mode="photos"]) .vw-tour__title {
    font-size: var(--fs-20);
  }

  .vw-tour__caption:not([hidden]) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .vw-tour__rooms,
  .vw-tour__counter,
  .vw-tour__hint {
    display: none;
  }

  .vw-tour__modes {
    top: auto;
    right: auto;
    left: calc(var(--safe-left) + var(--gutter));
    bottom: calc(var(--safe-bottom) + var(--gutter));
  }

  .vw-tour__nav {
    top: auto;
    bottom: calc(var(--safe-bottom) + var(--gutter));
    width: var(--touch);
    height: var(--touch);
    transform: none;
  }

  .vw-tour__nav--prev {
    left: auto;
    right: calc(var(--safe-right) + var(--gutter) + var(--touch) + var(--sp-2));
  }

  /* Photos use ‹ › for rooms; the 3D modes keep the (collapsible) minimap, low on the right. */
  .vw-tour[data-mode="photos"] .vw-map {
    display: none;
  }

  .vw-tour .vw-map {
    bottom: calc(var(--safe-bottom) + var(--gutter));
  }
}
