/* Realty San Miguel — mobile-first.
   Tokens and measurements taken from "Realty San Miguel Mobile.dc.html". */

:root {
  --ink: #14322E;
  --ink-90: rgba(20, 50, 46, .9);
  --ink-70: rgba(20, 50, 46, .7);
  --ink-55: rgba(20, 50, 46, .55);
  --ink-45: rgba(20, 50, 46, .45);
  --ink-14: rgba(20, 50, 46, .14);
  --ink-10: rgba(20, 50, 46, .10);
  --ink-06: rgba(20, 50, 46, .06);
  --terracotta: #C1562E;
  --terracotta-dark: #9E401D;
  --marigold: #E0A458;
  --paper: #FAF6F0;
  --paper-60: rgba(250, 246, 240, .6);
  --canvas: #EFEAE1;
  --white: #fff;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: 22px;
  --tap: 44px;
  --radius-card: 18px;
  --radius-field: 16px;
  --radius-chip: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  /* Room for the fixed tab bar plus the home indicator. */
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

img { max-width: 100%; display: block; }

a { color: var(--terracotta); text-decoration: none; }
a:hover { color: var(--terracotta-dark); }

/* Every tappable thing clears 44px without needing a utility class on each one. */
a, button, .chip, .tab { touch-action: manipulation; }

:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Horizontal scrollers hide their bar but keep momentum + snap. */
.scroller {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroller::-webkit-scrollbar { display: none; }

.shell { max-width: 640px; margin: 0 auto; }

/* ---------- Hero ---------- */

.hero { position: relative; height: 400px; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,50,46,.6) 0%, rgba(20,50,46,.12) 40%, rgba(20,50,46,.88) 100%);
}
.hero__inner {
  position: relative; height: 100%;
  padding: 20px var(--gutter) 24px;
  padding-top: calc(20px + env(safe-area-inset-top));
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero__top { display: flex; align-items: flex-start; justify-content: space-between; }
.wordmark { display: flex; flex-direction: column; gap: 2px; }
.wordmark__name { font: 400 22px/1 var(--serif); color: var(--paper); }
.wordmark__sub { font: 600 9.5px/1 var(--sans); color: var(--marigold); letter-spacing: .22em; }
.hero__headline {
  font: 400 35px/1.05 var(--serif); color: var(--paper);
  max-width: 300px; text-wrap: pretty; margin: 0;
}
.hero__bottom { display: flex; flex-direction: column; gap: 18px; }

.langswitch {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 15px;
  border: 1px solid rgba(250,246,240,.42);
  background: rgba(20,50,46,.3); color: var(--paper);
  border-radius: 999px; font: 600 12px/1 var(--sans);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.langswitch:hover { color: var(--paper); }

/* The home search entry point is a link to /search, not a JS-opened overlay. */
.searchentry {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 58px; padding: 0 18px;
  border: none; border-radius: var(--radius-field);
  background: var(--paper);
  box-shadow: 0 12px 32px -10px rgba(20,50,46,.55);
  font: 500 15.5px/1 var(--sans); color: var(--ink-55);
}
.searchentry__dot,
.searchfield__dot { width: 16px; height: 16px; border: 2px solid var(--terracotta); border-radius: 50%; flex: none; }
.searchfield__dot { width: 14px; height: 14px; }

/* ---------- Sections ---------- */

.section-head {
  padding: 24px var(--gutter) 0;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.section-title { font: 400 24px/1.1 var(--serif); color: var(--ink); margin: 0; }
.section-more { font: 600 13px/1 var(--sans); color: var(--terracotta); min-height: var(--tap); display: inline-flex; align-items: center; }

.quickrow { gap: 9px; padding: 18px var(--gutter) 2px; }
.quickrow .chip { flex: none; }

/* ---------- Chips ---------- */

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 16px;
  border-radius: var(--radius-chip);
  border: 1px solid var(--ink-14);
  background: var(--white); color: var(--ink);
  font: 500 14px/1 var(--sans);
  white-space: nowrap;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"], .chip--on {
  background: var(--terracotta); border-color: var(--terracotta); color: var(--white);
}
.chip--sm { min-height: 40px; padding: 0 15px; border-radius: 11px; font-size: 13.5px; }
.chip--ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip--ink:hover { color: var(--paper); }

/* ---------- Cards ---------- */

.railrow { gap: 14px; padding: 12px var(--gutter) 4px; scroll-snap-type: x mandatory; }

.card {
  display: block; background: var(--white);
  border: 1px solid rgba(20,50,46,.08);
  border-radius: var(--radius-card); overflow: hidden;
  box-shadow: 0 8px 20px -14px rgba(20,50,46,.5);
  color: inherit;
}
.card:hover { color: inherit; }
.card--rail { flex: none; width: 244px; scroll-snap-align: start; }

.card__media { position: relative; background: var(--ink-06); aspect-ratio: 4 / 3; }
.card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card--rail .card__media { aspect-ratio: 244 / 174; }

.card__body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 5px; }
.card__price { display: flex; align-items: baseline; gap: 5px; }
.card__price b { font: 600 16px/1 var(--sans); color: var(--ink); }
.card__price--ask { font-weight: 500 !important; color: var(--ink-55) !important; }
.card__price span { font: 600 11px/1 var(--sans); color: var(--ink-55); letter-spacing: .04em; }
.card__name { font: 400 15px/1.15 var(--serif); color: var(--ink-90); }
.card__meta { font: 400 12px/1.3 var(--sans); color: rgba(20,50,46,.5); }

.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 5px 9px; border-radius: 7px;
  font: 600 10px/1 var(--sans); letter-spacing: .08em;
  color: var(--white); background: var(--terracotta);
}
.badge--mls { background: var(--ink); }
.badge--muted { background: rgba(20,50,46,.82); }

/* An archive listing must never read as an available offer. */
.badge--archive { background: rgba(20,50,46,.82); }
.archive-note {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--ink-06); color: var(--ink-70);
  font: 500 12.5px/1.45 var(--sans);
}

/* Favourite toggle — sits over the card image. */
.fav {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  background: rgba(250, 246, 240, .92); color: var(--ink-45);
  font-size: 19px; line-height: 1;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px -2px rgba(20, 50, 46, .35);
}
.fav[aria-pressed="true"] { color: var(--terracotta); background: rgba(250, 246, 240, .96); }
.fav[hidden] { display: none; }
/* The tap target clears 44px without making the visible circle that large. */
.fav::after { content: ""; position: absolute; inset: -4px; }

.page-intro {
  margin: 0; padding: 6px var(--gutter) 0;
  font: 400 14.5px/1.6 var(--sans); color: var(--ink-55);
}
.contact-actions {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px var(--gutter) 20px;
}
.contact-actions + .agentcard { margin: 0 var(--gutter); }

/* ---------- Colonia grid ---------- */

.coloniagrid {
  padding: 12px var(--gutter) 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.colonia {
  min-height: 62px; display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center; gap: 3px;
  padding: 0 15px; border: 1px solid var(--ink-10);
  border-radius: 14px; background: var(--white); color: inherit;
}
.colonia:hover { color: inherit; }
.colonia__name { font: 600 14.5px/1 var(--sans); color: var(--ink); }
.colonia__count { font: 400 11.5px/1 var(--sans); color: var(--ink-45); }

/* ---------- Market pulse ---------- */

.pulse {
  margin: 26px var(--gutter) 0; padding: 20px;
  border-radius: var(--radius-card); background: var(--ink);
  display: flex; flex-direction: column; gap: 15px;
}
.pulse__kicker { font: 600 9.5px/1 var(--sans); letter-spacing: .2em; color: var(--marigold); }
.pulse__row { display: flex; gap: 24px; }
.pulse__stat { display: flex; flex-direction: column; gap: 4px; }
.pulse__stat b { font: 400 27px/1 var(--serif); color: var(--paper); }
.pulse__stat span { font: 400 11.5px/1.25 var(--sans); color: var(--paper-60); }

/* ---------- Search header ---------- */

.searchbar {
  position: sticky; top: 0; z-index: 20;
  padding: 12px 18px 0;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(250,246,240,.95);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(20,50,46,.08);
}
.searchbar__row { display: flex; gap: 10px; align-items: center; }
.searchfield {
  flex: 1; display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 14px; border-radius: 14px;
  background: var(--white); border: 1px solid rgba(20,50,46,.12);
  font: 500 15px/1 var(--sans); color: var(--ink);
}
.searchfield input {
  border: 0; background: none; outline: none; width: 100%;
  font: 500 15px/1 var(--sans); color: var(--ink);
}
.searchbar__lang {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 13px; border-radius: 14px;
  border: 1px solid rgba(20,50,46,.12); background: var(--white);
  color: var(--ink); font: 600 12px/1 var(--sans);
}
/* The filter control is pinned; only the quick chips scroll. A rule between
   them says "these are two different kinds of thing". */
.filterbar { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.filterbar .chiprow { flex: 1; min-width: 0; padding: 0; }
.chiprow { gap: 8px; }
.chiprow .chip { flex: none; }

.filterbtn {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 14px;
  border-radius: 11px;
  background: var(--ink); color: var(--paper);
  font: 600 13.5px/1 var(--sans);
  /* A lift the flat chips do not have — the one control here that opens
     something rather than toggling in place. */
  box-shadow: 0 2px 8px -2px rgba(20, 50, 46, .45);
  white-space: nowrap;
}
.filterbtn:hover { color: var(--paper); background: #0d2320; }
.filterbtn__icon { flex: none; }
.filterbtn__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px;
  background: var(--terracotta); color: #fff;
  font: 700 11.5px/1 var(--sans);
}
/* Separates the pinned control from the scrolling chips. */
.filterbar::after { content: none; }
.filterbar > .chiprow { position: relative; padding-left: 11px; }
.filterbar > .chiprow::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 22px; background: var(--ink-14);
  pointer-events: none; z-index: 1;
}

.resultbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter) 0;
}
.resultbar__count { font: 500 13px/1 var(--sans); color: var(--ink-55); }
.resultbar__sort { font: 600 13px/1 var(--sans); color: var(--terracotta); min-height: var(--tap); display: inline-flex; align-items: center; }

.cardlist { display: flex; flex-direction: column; gap: 14px; padding: 14px var(--gutter) 0; }

.empty { padding: 60px var(--gutter); text-align: center; display: flex; flex-direction: column; gap: 10px; }
.empty__title { font: 400 22px/1.15 var(--serif); color: var(--ink); margin: 0; }
.empty__body { font: 400 14px/1.6 var(--sans); color: var(--ink-55); margin: 0; }

/* ---------- Pagination ---------- */

.pager { display: flex; gap: 10px; justify-content: center; align-items: center; padding: 26px var(--gutter) 0; }
.pager a, .pager span {
  min-height: var(--tap); min-width: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 14px; border-radius: var(--radius-chip);
  border: 1px solid var(--ink-14); background: var(--white);
  font: 600 14px/1 var(--sans); color: var(--ink);
}
.pager__current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pager__gap { border: 0; background: none; color: var(--ink-45); }

/* ---------- Detail ---------- */

.gallery { position: relative; background: var(--ink-06); }
.gallery__track {
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  aspect-ratio: 4 / 3;
}
.gallery__slide { flex: none; width: 100%; scroll-snap-align: center; position: relative; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery__slide--video { background: #000; display: flex; align-items: center; }
.gallery__slide--video video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.gallery__videotag {
  position: absolute; top: 12px; right: 12px;
  padding: 4px 9px; border-radius: 6px;
  background: rgba(20, 50, 46, .72); color: var(--paper);
  font: 600 10px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  pointer-events: none;
}
/* Progress dots. Width is capped so the strip never exceeds the viewport;
   the track slides inside it. .gdot stride (width + gap) must stay 16px —
   gallery.js uses that number to position the window. */
.gallery__dots {
  position: absolute; left: 0; right: 0; bottom: 14px;
  display: flex; justify-content: center;
  pointer-events: none; z-index: 2;
}
.gallery__dots[hidden] { display: none; }
.gallery__dots-inner {
  overflow: hidden;
  max-width: 112px; /* 7 dots at 16px stride */
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(20, 50, 46, .42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.gallery__dots-track {
  display: flex; align-items: center; gap: 6px;
  transition: transform .22s ease;
}
.gdot {
  flex: none; width: 10px; height: 3px; border-radius: 999px;
  background: rgba(250, 246, 240, .45);
  transition: width .22s ease, background-color .22s ease, opacity .22s ease;
}
.gdot.is-active { width: 20px; background: var(--paper); }
.gdot[data-rank="2"] { width: 6px; opacity: .8; }
.gdot[data-rank="3"] { width: 4px; opacity: .45; }

.gallery__count {
  position: absolute; right: 14px; bottom: 14px;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(20,50,46,.62); color: var(--paper);
  font: 600 11.5px/1 var(--sans);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.gallery__back {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  top: calc(14px + env(safe-area-inset-top));
  width: var(--tap); height: var(--tap); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20,50,46,.55); color: var(--paper);
  font: 600 16px/1 var(--sans);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.gallery__back:hover { color: var(--paper); }

.detail { padding: 20px var(--gutter) 0; display: flex; flex-direction: column; gap: 16px; }
.detail__price { display: flex; align-items: baseline; gap: 7px; }
.detail__price b { font: 600 26px/1 var(--sans); color: var(--ink); }
.detail__price span { font: 600 12px/1 var(--sans); color: var(--ink-55); letter-spacing: .04em; }
.detail__name { font: 400 27px/1.15 var(--serif); color: var(--ink); margin: 0; }
.detail__meta { font: 400 13px/1.4 var(--sans); color: var(--ink-55); }

/* Property stats: icon plus a large value. The old 11px caption under each
   number was unreadable at arm's length — the icon carries the meaning and the
   name lives in a tooltip that works on tap as well as hover. */
.stats {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.stat {
  position: relative;
  display: inline-flex; align-items: center; gap: 9px;
  min-height: var(--tap); padding: 0 14px;
  border-radius: 12px; background: var(--white);
  border: 1px solid var(--ink-10);
  cursor: default;
}
/* The icon is what tells you which number this is, so it is sized close to the
   value rather than tucked away. Rooms and areas get different tones — grouped
   by meaning, since four separate colours would just read as decoration. */
.stat__icon { flex: none; }
.stat--rooms .stat__icon { color: var(--ink); }
.stat--area  .stat__icon { color: var(--terracotta); }
.stat__value {
  font: 500 17px/1 var(--sans); color: var(--ink);
  white-space: nowrap;
}
.stat__tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 7px 10px; border-radius: 8px;
  background: var(--ink); color: var(--paper);
  font: 500 12px/1.2 var(--sans); white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 5;
}
.stat__tip::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  margin-left: -5px; border: 5px solid transparent;
  border-top-color: var(--ink);
}
/* :focus as well as :hover — `title` and hover do nothing on a touchscreen,
   and tapping a focusable element focuses it. */
.stat:hover .stat__tip,
.stat:focus .stat__tip,
.stat:focus-visible .stat__tip {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.stat:focus { outline: 2px solid var(--terracotta); outline-offset: 2px; }
/* Area stats are tappable (m² <-> ft²), so they get a pointer and reset the
   button chrome the base .stat class doesn't expect. */
.stat--toggle {
  cursor: pointer; font: inherit; color: inherit;
  -webkit-appearance: none; appearance: none;
}
.stat--toggle:active { background: var(--ink-06); }

.featlist { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.featlist li {
  padding: 8px 12px; border-radius: 10px;
  background: var(--white); border: 1px solid var(--ink-10);
  font: 500 13px/1 var(--sans); color: var(--ink-70);
}

.prose { font: 400 15px/1.7 var(--sans); color: var(--ink-70); margin: 0; }
/* Description HTML comes from the admin's rich-text editor. */
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose div { margin: 0 0 0.9em; }
.prose strong, .prose b { font-weight: 600; color: var(--ink-90); }
.prose em, .prose i { font-style: italic; }
.prose u { text-underline-offset: 2px; }
.prose ul, .prose ol { margin: 0 0 0.9em; padding-left: 1.25em; }
.prose li { margin: 0 0 0.35em; }
.prose h3, .prose h4 {
  font-family: var(--serif); font-weight: 400; color: var(--ink);
  margin: 1.2em 0 0.4em; line-height: 1.2;
}
.prose h3 { font-size: 20px; }
.prose h4 { font-size: 17px; }
.prose a { color: var(--terracotta); text-decoration: underline; }
.prose blockquote {
  margin: 0 0 0.9em; padding-left: 14px;
  border-left: 2px solid var(--ink-14); color: var(--ink-55);
}
/* Read-more with no JS: a checkbox drives the clamp. */
.readmore input { position: absolute; opacity: 0; pointer-events: none; }
.readmore__text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6;
  overflow: hidden;
}
.readmore input:checked ~ .readmore__text { -webkit-line-clamp: unset; overflow: visible; }
.readmore__toggle {
  display: inline-flex; align-items: center; min-height: var(--tap);
  font: 600 13px/1 var(--sans); color: var(--terracotta); cursor: pointer;
}
.readmore input:checked ~ .readmore__toggle .readmore__less { display: inline; }
.readmore input:checked ~ .readmore__toggle .readmore__more { display: none; }
.readmore__less { display: none; }

.agentcard {
  display: flex; align-items: center; gap: 13px;
  padding: 15px; border-radius: var(--radius-card);
  background: var(--white); border: 1px solid var(--ink-10);
}
.agentcard__name { font: 600 15px/1.2 var(--sans); color: var(--ink); }
.agentcard__meta { font: 400 12px/1.35 var(--sans); color: var(--ink-45); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 14px;
  border: 1px solid transparent; font: 600 15px/1 var(--sans);
  background: var(--terracotta); color: var(--white); cursor: pointer;
}
.btn:hover { color: var(--white); background: var(--terracotta-dark); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: #0d2320; color: var(--paper); }
.btn--ghost { background: var(--white); border-color: var(--ink-14); color: var(--ink); }
.btn--ghost:hover { background: var(--white); color: var(--ink); }
/* WhatsApp's own green, so the channel is recognisable at a glance. */
.btn--wa { background: #25D366; color: #0B3B22; border-color: #25D366; }
.btn--wa:hover { background: #1EBE5A; color: #0B3B22; }
.wa__icon { flex: none; }
.btn--block { width: 100%; }

/* Sticky contact bar on the detail page — the two actions that matter. */
.ctabar {
  position: fixed; left: 0; right: 0; z-index: 40;
  bottom: calc(64px + env(safe-area-inset-bottom));
  padding: 10px var(--gutter);
  display: flex; gap: 10px;
  background: rgba(250,246,240,.95);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--ink-10);
}
.ctabar .btn { flex: 1; }
/* The enquiry CTA leads; WhatsApp is a narrower option beside it. */
.ctabar .btn--wa { flex: 0 0 auto; padding: 0 16px; }

/* Detail pages render the CTA bar instead of the tab bar, so it sits flush at
   the bottom and the body reserves exactly its height. */
body.has-cta { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
body.has-cta .ctabar { bottom: 0; }

/* ---------- Tab bar ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(250,246,240,.96);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--ink-10);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-height: 48px; justify-content: center;
  font: 500 11px/1 var(--sans); color: var(--ink-45);
}
.tab:hover { color: var(--ink-45); }
.tab__dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tab[aria-current="page"] .tab__dot { background: var(--terracotta); }

/* ---------- Filter sheet (a real page, not an overlay) ---------- */

/* Bottom padding clears the sticky action bar so no chip hides behind it. */
.sheet { padding: 18px var(--gutter) 24px; display: flex; flex-direction: column; gap: 22px; }
.sheet__group { display: flex; flex-direction: column; gap: 10px; }
.sheet__label { font: 600 10.5px/1 var(--sans); letter-spacing: .16em; color: var(--ink-45); }
.sheet__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet__actions {
  position: sticky; bottom: calc(64px + env(safe-area-inset-bottom));
  display: flex; gap: 10px;
  margin: 8px calc(var(--gutter) * -1) 0;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgba(250, 246, 240, .96);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--ink-10);
}

.sheet__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter) 0;
}
.sheet__title { font: 400 24px/1.1 var(--serif); margin: 0; }

/* Radio/checkbox chips: the input is the state, the label is the pixel. */
.optchip { position: relative; display: inline-flex; }
.optchip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.optchip input:checked + .chip { background: var(--terracotta); border-color: var(--terracotta); color: var(--white); }
.optchip input:focus-visible + .chip { outline: 2px solid var(--terracotta); outline-offset: 2px; }

/* ---------- Slide-up sheet ---------- */

/* Opened by :target — a link to #enquire opens it, a link to # closes it.
   No JavaScript, so it works on the first paint and cannot get stuck open. */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 60;
  visibility: hidden;
  transition: visibility 0s linear .28s;
}
.sheet-overlay:target { visibility: visible; transition-delay: 0s; }

.sheet-overlay__scrim {
  position: absolute; inset: 0;
  background: rgba(20, 50, 46, .55);
  opacity: 0; transition: opacity .28s ease;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.sheet-overlay:target .sheet-overlay__scrim { opacity: 1; }

.sheet-overlay__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 90dvh;
  display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px -12px rgba(20, 50, 46, .5);
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.22, .61, .36, 1);
}
.sheet-overlay:target .sheet-overlay__panel { transform: translateY(0); }

.sheet-overlay__grip {
  width: 38px; height: 4px; border-radius: 999px;
  background: var(--ink-14);
  margin: 10px auto 2px; flex: none;
}
.sheet-overlay__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px var(--gutter) 0; flex: none;
}
.sheet-overlay__title { font: 400 23px/1.15 var(--serif); color: var(--ink); margin: 0; }
.sheet-overlay__close {
  flex: none; width: var(--tap); height: var(--tap); margin-right: -10px;
  display: inline-flex; align-items: center; justify-content: center;
  font: 400 26px/1 var(--sans); color: var(--ink-45);
  border-radius: 50%;
}
.sheet-overlay__close:hover { color: var(--ink); }
.sheet-overlay__sub {
  margin: 2px 0 12px; padding: 0 var(--gutter);
  font: 400 13.5px/1.4 var(--sans); color: var(--ink-45);
}
.sheet-overlay__body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* Stop the page behind the sheet from scrolling. */
body:has(.sheet-overlay:target) { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .sheet-overlay, .sheet-overlay__scrim, .sheet-overlay__panel { transition: none !important; }
}

/* ---------- Contact form ---------- */

.cform { display: flex; flex-direction: column; gap: 14px; padding: 4px var(--gutter) 0; }
.cform__field { display: flex; flex-direction: column; gap: 6px; }
.cform__field label { font: 600 12px/1 var(--sans); color: var(--ink-55); letter-spacing: .02em; }
.cform__optional { font-weight: 400; color: var(--ink-45); }
.cform input[type="text"], .cform input[type="email"], .cform input[type="tel"], .cform textarea {
  width: 100%; min-height: 50px; padding: 13px 14px;
  border: 1px solid var(--ink-14); border-radius: 12px;
  background: var(--white); color: var(--ink);
  font: 400 16px/1.4 var(--sans); /* 16px keeps iOS from zooming on focus */
  -webkit-appearance: none; appearance: none;
}
.cform textarea { min-height: 110px; resize: vertical; }
.cform input:focus-visible, .cform textarea:focus-visible {
  outline: 2px solid var(--terracotta); outline-offset: 1px; border-color: var(--terracotta);
}
.cform__check {
  display: flex; align-items: flex-start; gap: 10px;
  min-height: var(--tap); font: 400 13.5px/1.45 var(--sans); color: var(--ink-70);
}
.cform__check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--terracotta); flex: none; }
.cform__note { margin: 2px 0 0; font: 400 12.5px/1.5 var(--sans); color: var(--ink-45); }
.cform__legal { margin: 0; font: 400 11px/1.5 var(--sans); color: var(--ink-45); }
.cform__legal a { color: var(--ink-45); text-decoration: underline; }
.cform__error {
  margin: 0; padding: 11px 13px; border-radius: 10px;
  background: rgba(193, 86, 46, .10); border: 1px solid rgba(193, 86, 46, .3);
  color: var(--terracotta-dark); font: 500 13.5px/1.45 var(--sans);
}
/* Honeypot: off-screen rather than display:none, which bots skip. */
.cform__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cform__alt {
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px var(--gutter) 0; margin-top: 6px;
}
.cform__alt-label {
  font: 600 10.5px/1 var(--sans); letter-spacing: .16em; color: var(--ink-45);
  text-transform: uppercase;
}
.cform__alt-actions { display: flex; gap: 10px; }
.cform__alt-actions .btn { flex: 1; }
.cform { padding-top: 0; }

/* ---------- Property map ---------- */

.propmap {
  margin: 4px 0 0;
  border-radius: var(--radius-card);
  overflow: hidden;                /* clips the iframe to the rounded corners */
  border: 1px solid var(--ink-10);
  background: var(--ink-06);
  aspect-ratio: 4 / 3;
  /* Safari needs its own nudge to clip a positioned child to a rounded box. */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  isolation: isolate;
}
.propmap iframe { display: block; width: 100%; height: 100%; border: 0; }

@media (min-width: 700px) { .propmap { aspect-ratio: 16 / 9; } }

/* ---------- Wider screens ---------- */

@media (min-width: 700px) {
  :root { --gutter: 32px; }
  .hero { height: 460px; }
  .hero__headline { font-size: 44px; max-width: 460px; }
  .coloniagrid { grid-template-columns: repeat(3, 1fr); }
  .cardlist { display: grid; grid-template-columns: repeat(2, 1fr); }
  .shell { max-width: 900px; }
}

@media (min-width: 1000px) {
  .cardlist { grid-template-columns: repeat(3, 1fr); }
  .shell { max-width: 1120px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery__dots-track, .gdot { transition: none !important; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
