/* ==========================================================================
   Gulf States Living — mobile-first map deck.
   Design language: clean light surface, deep gulf-green accent (overridable
   via /api/portal/config -> --accent), soft depth, 44px+ touch targets,
   safe-area aware. No framework — every rule earns its bytes.
   ========================================================================== */

:root {
  --accent: #0f6e5f;
  --accent-ink: #ffffff;
  --ink: #17211e;
  --ink-2: #5b6763;
  --line: #e4e9e7;
  --surface: #ffffff;
  --surface-2: #f4f6f5;
  --danger: #b4483c;
  --gold: #c99b3f;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(23, 33, 30, 0.12);
  --shadow-lg: 0 -8px 32px rgba(23, 33, 30, 0.18);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
.icon { width: 20px; height: 20px; fill: currentColor; flex: none; }
[hidden] { display: none !important; }

#shell { display: flex; flex-direction: column; height: 100dvh; }

/* ======== top bar ======== */
#topbar {
  background: var(--surface);
  padding: calc(8px + var(--sat)) 12px 8px;
  box-shadow: 0 1px 0 var(--line);
  z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 2px 2px 8px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: 0.01em; }
.demo-chip {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--gold); border: 1px solid currentColor;
  padding: 2px 6px; border-radius: 999px; margin-left: auto;
}
.search-row { display: flex; gap: 8px; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border-radius: 12px; padding: 0 12px;
  color: var(--ink-2);
}
.search-box input {
  flex: 1; border: 0; background: none; padding: 12px 0; outline: none;
  font-size: 16px; color: var(--ink); min-width: 0;
}
.ghost-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; border-radius: 12px;
  background: var(--surface-2); color: var(--ink);
  padding: 0 12px; font-weight: 600;
}
.ghost-btn:active { background: var(--line); }

/* chips */
#chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
#chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink);
  min-height: 36px; white-space: nowrap;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-clear { color: var(--danger); }

/* ======== stage / map ======== */
#stage { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; z-index: 1; background: #dfe8e5; }
.leaflet-control-attribution { font-size: 9px; opacity: 0.75; }

.count-pill {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 500; background: var(--surface); color: var(--ink-2);
  font-size: 12px; font-weight: 600; padding: 6px 12px;
  border-radius: 999px; box-shadow: var(--shadow); pointer-events: none;
}
.float-btn {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 600; background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 600; padding: 10px 16px;
  border-radius: 999px; box-shadow: var(--shadow);
}
.locate-btn {
  position: absolute; top: 10px; right: 12px; z-index: 600;
  width: 44px; height: 44px; border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.locate-btn .icon { width: 22px; height: 22px; }
.locate-btn:active { background: var(--surface-2); }
.locate-btn.loading { opacity: 0.55; }

/* price-pill markers */
.price-marker { background: none; border: none; }
.price-marker span {
  display: inline-block; transform: translate(-50%, -100%);
  background: var(--surface); color: var(--ink);
  font: 600 12px/1 system-ui, sans-serif; padding: 7px 10px;
  border-radius: 999px; border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(23, 33, 30, 0.25); white-space: nowrap;
  transition: transform 0.12s ease, background 0.12s ease;
}
.price-marker span::after {
  content: ""; position: absolute; left: 50%; bottom: -4px;
  width: 8px; height: 8px; background: inherit;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}
.price-marker.active span,
.price-marker span:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.price-marker.pending span { background: var(--gold); color: #fff; border-color: var(--gold); }
.price-marker.visited:not(.active) span { color: var(--ink-2); }

/* ======== bottom card rail (map view) ======== */
#card-rail {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 700;
  display: flex; gap: 10px; overflow-x: auto; padding: 8px 12px calc(12px + var(--sab));
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
#card-rail::-webkit-scrollbar { display: none; }
.rail-card {
  flex: none; width: min(78vw, 320px); scroll-snap-align: center;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; text-align: left;
  padding: 0;
}
.rail-card img { width: 118px; height: 118px; object-fit: cover; flex: none; }
.rail-card .rc-body { padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; }
.rc-price { font-weight: 700; font-size: 16px; }
.rc-facts { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.rc-addr {
  font-size: 12px; color: var(--ink-2); margin-top: auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-badges { margin-top: 4px; }

.badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; margin-right: 4px; letter-spacing: 0.03em;
}
.badge-new { background: #e7f3ef; color: var(--accent); }
.badge-drop { background: #fdf0e3; color: #a4692a; }
.badge-pending { background: #f6ecd8; color: #8a6a1f; }
.badge-sold { background: #f3e4e2; color: var(--danger); }
.badge-tour { background: var(--accent); color: var(--accent-ink); }

/* ======== list view ======== */
#list-view {
  position: absolute; inset: 0; z-index: 800; overflow-y: auto;
  background: var(--surface-2); padding: 12px 12px calc(24px + var(--sab));
  -webkit-overflow-scrolling: touch;
}
#list-cards { display: grid; gap: 14px; max-width: 640px; margin: 0 auto; }
.list-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; text-align: left; padding: 0;
  position: relative; width: 100%;
}
.list-card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }
.list-card .lc-body { padding: 12px 14px 14px; }
.lc-price { font-weight: 800; font-size: 20px; }
.lc-facts { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.lc-addr { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.lc-fav { position: absolute; top: 10px; right: 10px; }

/* the streamlined-showings CTA on list cards — a first-class button, not a link */
.lc-book {
  display: block; width: 100%; margin-top: 12px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 14px; border-radius: 12px;
  padding: 12px; min-height: 46px;
}
.lc-book:active { filter: brightness(0.92); }

.fav-btn {
  width: 40px; height: 40px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); color: #b9c4c0;
  font-size: 20px; line-height: 1; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.fav-btn.on { color: var(--danger); }

.skeleton {
  background: linear-gradient(90deg, var(--line) 25%, #eef1f0 45%, var(--line) 65%);
  background-size: 300% 100%; animation: shimmer 1.2s infinite linear;
  border-radius: var(--radius); height: 118px;
}
@keyframes shimmer { to { background-position: -300% 0; } }

.empty-state { text-align: center; color: var(--ink-2); padding: 48px 24px; font-size: 14px; }
.empty-state b { color: var(--ink); }

/* ======== detail sheet ======== */
#sheet-backdrop, #modal-backdrop {
  position: fixed; inset: 0; z-index: 1500; background: rgba(15, 23, 21, 0.45);
  opacity: 0; transition: opacity 0.22s ease;
}
#sheet-backdrop.show, #modal-backdrop.show { opacity: 1; }

#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1600;
  height: calc(100dvh - 40px - var(--sat));
  background: var(--surface); border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateY(102%); transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-width: 720px; margin: 0 auto;
}
#sheet.show { transform: translateY(0); }
#sheet-grab { padding: 8px 0 2px; display: flex; justify-content: center; flex: none; }
#sheet-grab span { width: 40px; height: 4px; border-radius: 4px; background: var(--line); }
#sheet-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }

.photos { position: relative; }
.photo-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  aspect-ratio: 3/2; background: var(--line);
}
.photo-track::-webkit-scrollbar { display: none; }
.photo-track img {
  width: 100%; flex: none; object-fit: cover; scroll-snap-align: center;
}
.photo-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px;
}
.photo-dots i {
  width: 6px; height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.55); transition: background 0.15s;
}
.photo-dots i.on { background: #fff; }
.sheet-close {
  position: absolute; top: 10px; left: 10px; width: 36px; height: 36px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: var(--ink);
  font-size: 15px; box-shadow: var(--shadow); z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
#sheet .fav-btn { position: absolute; top: 10px; right: 10px; z-index: 2; }
#sheet #sheet-share { right: 58px; color: var(--ink-2); }
#sheet #sheet-share .icon { width: 18px; height: 18px; }

.sheet-body { padding: 16px 16px 0; max-width: 720px; }
.price-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.price-row h2 { margin: 0; font-size: 26px; letter-spacing: -0.01em; }
#sheet-address { margin: 4px 0 12px; color: var(--ink-2); font-size: 14px; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.fact {
  background: var(--surface-2); border-radius: 10px; padding: 8px 12px;
  font-size: 13px; font-weight: 600;
}
.fact small { display: block; font-weight: 500; color: var(--ink-2); font-size: 11px; }

/* ---- payment estimator ---- */
.estimate {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 0 0 16px;
}
.est-head { display: flex; align-items: baseline; justify-content: space-between; }
.est-amt b { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.est-amt span { font-size: 13px; color: var(--ink-2); margin-left: 4px; }
.est-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--accent); background: #e7f3ef; border-radius: 999px; padding: 4px 9px;
}
.est-controls { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 4px; }
.est-ctl { flex: 1; min-width: 148px; }
.est-ctl > label { display: block; font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.est-down button { padding: 8px 12px; min-height: 38px; font-size: 13px; }
.est-rate { display: flex; align-items: center; gap: 4px; }
.est-rate .est-step {
  width: 40px; height: 40px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 20px; font-weight: 600; color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.est-rate .est-step:active { background: var(--line); }
#est-rate-val { flex: 1; text-align: center; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.est-break {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.est-break span {
  flex: 1; min-width: 84px; display: flex; flex-direction: column;
  font-size: 11px; color: var(--ink-2);
}
.est-break b { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.est-fine { font-size: 11px; color: var(--ink-2); line-height: 1.45; margin: 12px 0 0; }

#sheet-desc { font-size: 14px; line-height: 1.55; color: var(--ink); }
.feature-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.feature-chips span {
  font-size: 12px; background: var(--surface-2); border-radius: 999px; padding: 6px 10px;
}
#sheet-history { font-size: 13px; color: var(--ink-2); margin: 8px 0; }
#sheet-history .drop { color: #a4692a; font-weight: 700; }

/* ---- price-history sparkline ---- */
.pricechart { margin: 12px 0 8px; }
.spark { width: 100%; height: 60px; display: block; }
.spark-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.spark-ends b { display: block; font-size: 14px; color: var(--ink); font-weight: 700; }
.spark-ends .spark-now { text-align: right; }
.spark-ends .spark-now.down b { color: #a4692a; }

/* ---- similar homes rail ---- */
.similar { margin: 18px 0 4px; }
.similar-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.similar-rail {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -16px; padding: 0 16px 4px; -webkit-overflow-scrolling: touch;
}
.similar-rail::-webkit-scrollbar { display: none; }
.sim-card {
  flex: 0 0 140px; scroll-snap-align: start; text-align: left;
  display: flex; flex-direction: column; gap: 2px;
}
.sim-card img {
  width: 140px; height: 96px; object-fit: cover; border-radius: 12px;
  background: var(--line); margin-bottom: 4px;
}
.sim-price { font-size: 14px; font-weight: 700; }
.sim-facts, .sim-city { font-size: 12px; color: var(--ink-2); }

/* ---- recently viewed (list view) ---- */
.recent-strip { padding: 12px 14px 6px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.recent-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.recent-rail { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.recent-rail::-webkit-scrollbar { display: none; }
.recent-rail .sim-card { scroll-snap-align: start; }

/* ---- full-screen photo lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(8, 12, 11, 0.95); display: flex; }
.lb-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 8px; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-close {
  position: absolute; top: calc(12px + var(--sat)); right: 14px; z-index: 2;
  width: 42px; height: 42px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 20px;
}
.lb-counter {
  position: absolute; bottom: calc(18px + var(--sab)); left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; font-weight: 600; background: rgba(0, 0, 0, 0.45); padding: 5px 12px; border-radius: 999px;
}

/* ---- compare homes overlay ---- */
.chip-compare { border-color: var(--accent); color: var(--accent); }
.compare-overlay {
  position: fixed; inset: 0; z-index: 2000; background: var(--surface);
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.compare-overlay.show { transform: translateY(0); }
.compare-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--sat)) 16px 10px; box-shadow: 0 1px 0 var(--line);
}
.compare-head h3 { margin: 0; font-size: 18px; }
.compare-head .sheet-close { position: static; }
.compare-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 8px 12px calc(16px + var(--sab)); }
.cmp-table { border-collapse: collapse; }
.cmp-table th, .cmp-table td {
  padding: 10px 8px; text-align: center; font-size: 14px;
  border-bottom: 1px solid var(--line); vertical-align: middle; min-width: 116px;
}
.cmp-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.cmp-label {
  text-align: left !important; color: var(--ink-2); font-size: 12px; font-weight: 600;
  position: sticky; left: 0; background: var(--surface); min-width: 78px !important; z-index: 1;
}
.cmp-photo { width: 120px; aspect-ratio: 3/2; object-fit: cover; border-radius: 10px; display: block; margin: 0 auto 6px; background: var(--line); }
.cmp-view { font-size: 12px; font-weight: 700; color: var(--accent); }
.cmp-table b { font-size: 16px; }
.courtesy { font-size: 12px; color: var(--ink-2); margin: 12px 0 4px; }
.idx-footer {
  font-size: 11px; color: var(--ink-2); line-height: 1.5;
  border-top: 1px solid var(--line); padding: 12px 2px; margin-top: 8px;
}
.sheet-spacer { height: 96px; }

/* sticky CTA bar */
#cta-bar {
  flex: none; display: flex; gap: 8px; align-items: stretch;
  padding: 10px 12px calc(10px + var(--sab));
  background: var(--surface); border-top: 1px solid var(--line);
}
.cta-slots { display: flex; gap: 6px; flex: 1; min-width: 0; }
.cta-slot {
  flex: 1; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 12px; font-weight: 600; padding: 6px 4px; color: var(--ink);
  display: flex; flex-direction: column; gap: 1px; align-items: center; justify-content: center;
  min-height: 48px;
}
.cta-slot small { color: var(--ink-2); font-weight: 500; font-size: 10px; }
.cta-slot.picked { border-color: var(--accent); background: #e7f3ef; }
.primary-btn {
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  border-radius: 12px; padding: 12px 18px; min-height: 48px; font-size: 15px;
  flex: none;
}
.primary-btn:active { filter: brightness(0.92); }
.primary-btn[disabled] { opacity: 0.6; }

/* ======== booking + filters modals ======== */
#booking, #filters, #inquiry {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1700;
  background: var(--surface); border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg); padding: 6px 16px calc(16px + var(--sab));
  transform: translateY(102%); transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-width: 560px; margin: 0 auto; max-height: calc(100dvh - 60px); overflow-y: auto;
}
#booking.show, #filters.show, #inquiry.show { transform: translateY(0); }

/* secondary "ask a question" affordance on the listing sheet */
.ask-btn {
  display: block; width: 100%; margin: 14px 0 4px; padding: 12px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 14px; font-weight: 700; color: var(--accent); background: var(--surface);
}
.ask-btn:active { background: var(--surface-2); }
.contact-row { display: flex; gap: 8px; margin: 8px 0 4px; }
.contact-btn {
  flex: 1; text-align: center; padding: 11px; border: 1.5px solid var(--line);
  border-radius: 12px; font-size: 14px; font-weight: 700; color: var(--ink);
  background: var(--surface); text-decoration: none;
}
.contact-btn:active { background: var(--surface-2); }

/* flood zone & insurance note */
.flood-note { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 14px 0 4px; }
.flood-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.flood-title .icon { width: 16px; height: 16px; fill: var(--accent); }
.flood-note p { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin: 0 0 8px; }
.flood-link { font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; }
.booking-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.booking-head h3 { margin: 0; font-size: 18px; }
.booking-head .sheet-close { position: static; }
.booking-sub { color: var(--ink-2); font-size: 13px; margin: 0 0 12px; }
#slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot-btn {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 8px;
  font-weight: 700; font-size: 14px; display: flex; flex-direction: column; gap: 2px;
}
.slot-btn small { color: var(--ink-2); font-weight: 500; font-size: 11px; }
.slot-btn:active, .slot-btn.picked { border-color: var(--accent); background: #e7f3ef; }

#booking-step-form label, #inquiry-form label {
  display: block; font-size: 13px; font-weight: 600; margin: 12px 0 0;
}
#booking-step-form .opt, #inquiry-form .opt { color: var(--ink-2); font-weight: 400; }
#booking-step-form input, #inquiry-form input, #inquiry-form textarea {
  display: block; width: 100%; margin-top: 6px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px;
  font-size: 16px; outline: none; background: var(--surface);
}
#booking-step-form input:focus, #inquiry-form input:focus, #inquiry-form textarea:focus { border-color: var(--accent); }
#inquiry-form textarea { resize: vertical; font-family: inherit; }
#inquiry-form .primary-btn { width: 100%; margin-top: 14px; }
#inquiry-done { text-align: center; padding: 12px 0 8px; }
#inquiry-done h3 { margin: 0 0 6px; }
#inquiry-done .primary-btn { width: 100%; margin-top: 14px; }
.fineprint { font-size: 11px; color: var(--ink-2); line-height: 1.5; margin: 12px 0; }
#booking-step-form .primary-btn { width: 100%; margin-top: 4px; }

#booking-step-done { text-align: center; padding: 12px 0 8px; }
.done-check {
  width: 64px; height: 64px; margin: 8px auto 12px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
#booking-step-done h3 { margin: 0 0 6px; }
#booking-step-done .primary-btn { width: 100%; margin-top: 14px; }

/* filters body */
/* ---- saved searches (in the filters sheet) ---- */
.saved-wrap { padding: 4px 0 6px; }
.saved-head { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.saved-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.saved-pill { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.saved-apply { padding: 8px 4px 8px 13px; font-size: 13px; font-weight: 600; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-del { padding: 8px 11px 8px 6px; color: var(--ink-2); font-size: 14px; }
.saved-save { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent); padding: 8px 0; min-height: 40px; }
.saved-save:disabled { color: var(--ink-2); opacity: 0.55; }

.filters-body fieldset { border: 0; padding: 12px 0; margin: 0; border-bottom: 1px solid var(--line); }
.filters-body legend { font-weight: 700; font-size: 14px; padding: 0 0 8px; }
.range-row { display: flex; align-items: center; gap: 8px; }
.range-row input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px;
  font-size: 16px; outline: none; min-width: 0;
}
.range-row input:focus { border-color: var(--accent); }
.range-row .pay-mo { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.filters-body legend .opt { color: var(--ink-2); font-weight: 400; font-size: 12px; }
.pay-note { font-size: 12px; color: var(--ink-2); margin: 8px 0 0; line-height: 1.4; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 15px;
  font-size: 13px; font-weight: 600; min-height: 40px;
}
.seg button.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-grid label {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.type-grid input { width: 18px; height: 18px; accent-color: var(--accent); }
.filters-actions { display: flex; gap: 10px; padding-top: 14px; }
.filters-actions .primary-btn { flex: 1; }

/* toast */
#toast {
  position: fixed; bottom: calc(24px + var(--sab)); left: 50%; transform: translateX(-50%);
  z-index: 2000; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  max-width: 88vw; text-align: center;
}

/* booking CTA carries the sheet — give it the visual weight */
#cta-book { flex: 1 1 42%; font-size: 16px; }

/* small phones: tighter chrome, same touch targets */
@media (max-width: 380px) {
  .rail-card { width: 84vw; }
  .rail-card img { width: 104px; height: 104px; }
  .brand-name { font-size: 14px; }
  .facts { gap: 6px; }
  .fact { padding: 7px 10px; font-size: 12px; }
  .price-row h2 { font-size: 23px; }
  .cta-slot { font-size: 11px; }
}

/* wider screens: give the rail cards a fixed pleasant width */
@media (min-width: 720px) {
  .rail-card { width: 340px; }
  #list-cards { grid-template-columns: 1fr 1fr; }
}
