/* ============ Padster mobile app ============ */
:root {
  --orange: #f4551f;
  --orange-deep: #d94512;
  --orange-glow: #ff7a45;
  --orange-soft: #fff1ea;
  --ink: #17171b;
  --ink-2: #3c3c44;
  --muted: #8a8a93;
  --line: #ececf1;
  --bg: #fafafc;
  --white: #ffffff;
  --green: #2fae63;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --nav-h: 76px;
  --shadow-card: 0 18px 44px rgba(23, 23, 27, 0.16);
  --shadow-soft: 0 8px 24px rgba(23, 23, 27, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  /* Belt-and-suspenders against sideways panning/rubber-banding on real
     phones: restrict native touch gestures to vertical scrolling only,
     regardless of any element's computed width. */
  touch-action: pan-y;
}
body {
  font-family: "Poppins", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior: none;
  user-select: none;
}
img { display: block; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }

#phone {
  position: relative;
  max-width: 460px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- logo wordmark ---------- */
.wordmark-img { display: inline-block; vertical-align: middle; }

/* ---------- signup ---------- */
#signup {
  position: absolute; inset: 0; z-index: 60;
  background: linear-gradient(168deg, var(--orange-glow) -18%, var(--orange) 42%, var(--orange-deep) 110%);
  color: var(--white);
  display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 26px 34px;
  transition: transform 0.55s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.5s ease;
}
#signup.dismissed { transform: translateY(-104%); opacity: 0.4; pointer-events: none; }
.signup-logo { font-size: 34px; }
.orbit {
  position: relative; flex: 0 0 auto;
  height: 240px; margin: 8px 0 4px;
}
.orbit .ring {
  position: absolute; left: 50%; top: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 50%;
  transform: translate(-50%, -50%);
}
.orbit .avatar {
  position: absolute; border-radius: 50%; overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  animation: bob 5s ease-in-out infinite;
}
.orbit .avatar img { width: 100%; height: 100%; object-fit: cover; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.signup-copy h1 {
  font-size: 40px; line-height: 1.08; font-weight: 700; letter-spacing: -0.02em;
}
.signup-copy h1 .hl { background: var(--white); color: var(--orange); border-radius: 10px; padding: 0 10px; display: inline-block; }
.signup-copy p { margin-top: 14px; font-size: 14px; opacity: 0.86; font-weight: 400; max-width: 30ch; }

.signup-actions { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.signup-input {
  width: 100%; border: 0; outline: 0; border-radius: 16px;
  background: rgba(255, 255, 255, 0.16); color: var(--white);
  padding: 16px 18px; font: inherit; font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.signup-input::placeholder { color: rgba(255, 255, 255, 0.75); }
.btn-start {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--white); color: var(--ink);
  border-radius: 16px; padding: 17px 20px;
  font-weight: 600; font-size: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease;
}
.btn-start:active { transform: scale(0.97); }
.signin-link {
  display: block; width: 100%; text-align: center; margin-top: 16px;
  font-size: 12.5px; color: rgba(255, 255, 255, 0.8);
}
.signin-link b { color: #fff; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.legal-note {
  margin-top: 14px; text-align: center; font-size: 10.5px; line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
}
.legal-note a { color: rgba(255, 255, 255, 0.9); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- onboarding (intro + setup) ---------- */
.onboard {
  position: absolute; inset: 0; z-index: 61;
  background: var(--white);
  display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.6, 0, 0.3, 1);
  overflow: hidden;
}
.onboard.ob-open { transform: translateX(0); }
#setup { z-index: 62; }

.ob-head { display: flex; align-items: center; justify-content: space-between; height: 40px; margin-bottom: 6px; }
.ob-logo { font-size: 24px; }
.ob-back {
  width: 40px; height: 40px; border-radius: 50%; margin-left: -6px;
  display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line);
}
.ob-back svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.ob-steps { display: flex; gap: 6px; }
.ob-steps i { width: 22px; height: 5px; border-radius: 999px; background: var(--line); transition: background 0.2s; }
.ob-steps i.on { background: var(--orange); width: 28px; }

.ob-cta {
  margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--orange); color: #fff; font-weight: 600; font-size: 16px;
  border-radius: 16px; padding: 17px; box-shadow: 0 12px 28px rgba(244, 85, 31, 0.4);
  transition: transform 0.15s ease;
}
.ob-cta:active { transform: scale(0.98); }
.ob-cta svg { width: 18px; height: 18px; }

/* intro visual */
.intro-demo {
  position: relative; flex: 0 0 auto;
  height: 312px; margin: 10px 0 4px;
  display: grid; place-items: center;
}
.demo-card {
  width: 194px; height: 268px; border-radius: 24px;
  background: #ccc center/cover no-repeat; position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: demoWobble 4.5s ease-in-out infinite;
}
@keyframes demoWobble {
  0%, 100% { transform: rotate(-3deg) translateX(-4px); }
  50% { transform: rotate(3deg) translateX(4px); }
}
.demo-card .scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,8,8,0.8), rgba(10,8,8,0) 55%); }
.demo-tag {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,0.92); color: var(--ink);
  font-size: 10px; font-weight: 600; padding: 5px 9px; border-radius: 999px;
  display: flex; align-items: center; gap: 5px;
}
.demo-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.demo-info { position: absolute; left: 14px; right: 14px; bottom: 14px; color: #fff; }
.demo-price { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.demo-price small { font-size: 12px; font-weight: 500; opacity: 0.85; }
.demo-sub { font-size: 12px; opacity: 0.9; margin-top: 2px; }
.demo-cue {
  position: absolute; z-index: 3;
  font-size: 12.5px; font-weight: 600; padding: 8px 13px; border-radius: 999px;
  background: var(--white); box-shadow: var(--shadow-soft); white-space: nowrap;
}
.cue-left { left: 2px; top: 44%; color: #ff4d5e; border: 1px solid #ffd9dd; }
.cue-right { right: 2px; top: 30%; color: var(--orange); border: 1px solid #ffd8c8; }
.cue-up { top: -10px; left: 50%; transform: translateX(-50%); color: #3596ff; border: 1px solid #cfe6ff; }

.intro-copy { margin-top: 4px; }
.intro-copy h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.intro-copy p { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.intro-copy p b { color: var(--ink); font-weight: 600; }

.swap-callout {
  margin-top: 18px; display: flex; align-items: stretch; gap: 10px;
  background: var(--orange-soft); border-radius: 18px; padding: 14px 16px;
}
.swap-side { flex: 1; }
.swap-side span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.swap-side b { display: block; font-size: 19px; font-weight: 700; margin-top: 3px; color: var(--ink); letter-spacing: -0.01em; }
.swap-side b i { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); }
.swap-side.own b { color: var(--orange-deep); }
.swap-arrow { display: grid; place-items: center; align-self: center; }
.swap-arrow svg { width: 22px; height: 22px; stroke: var(--orange); fill: none; stroke-width: 2; }
.swap-note { margin-top: 12px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.intro-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
}
.intro-scroll::-webkit-scrollbar { display: none; }

/* setup form */
.setup-intro { margin: 8px 0 4px; }
.setup-intro h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.setup-intro p { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.setup-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; margin: 14px -4px 12px; padding: 0 4px; }
.setup-scroll::-webkit-scrollbar { display: none; }
.field { margin-bottom: 22px; }
.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.field-label em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 4px; }
.field-hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.rent-input {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 16px; padding: 4px 18px;
  transition: border-color 0.15s;
}
.rent-input:focus-within { border-color: var(--orange); }
.rent-input .cur { font-size: 24px; font-weight: 700; color: var(--ink); }
.rent-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 26px; font-weight: 700; padding: 12px 0; color: var(--ink); letter-spacing: -0.02em; }
.rent-input input::placeholder { color: #c9c9d0; }
.rent-input .per { font-size: 14px; color: var(--muted); font-weight: 500; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.p-chip {
  padding: 10px 14px; border-radius: 999px; background: var(--bg);
  border: 1.5px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: all 0.15s;
}
.p-chip.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; padding: 13px 0; border-radius: 14px; background: var(--bg);
  border: 1.5px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: all 0.15s;
}
.seg button.on { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ---------- app header ---------- */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 22px 10px;
}
.greeting { font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.greeting small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.header-tools { display: flex; gap: 10px; align-items: center; }
.icon-pill {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--line);
  display: grid; place-items: center; box-shadow: var(--shadow-soft);
  position: relative;
}
.icon-pill svg { width: 19px; height: 19px; stroke: var(--ink); fill: none; stroke-width: 1.8; }
.icon-pill .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); border: 2px solid var(--white); }
.avatar-pill { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; border: 2px solid var(--orange); }
.avatar-pill img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- views ---------- */
.view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.view.active { display: flex; }
.view-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 4px 22px calc(var(--nav-h) + 22px); }

/* ---------- swipe deck ---------- */
#deck-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 6px 20px calc(var(--nav-h) + 30px); }
#deck { position: relative; flex: 1; min-height: 0; }
.card {
  position: absolute; inset: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #ddd center/cover no-repeat;
  box-shadow: var(--shadow-card);
  touch-action: none;
  will-change: transform;
}
.card .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 8, 8, 0.82) 0%, rgba(10, 8, 8, 0.24) 42%, rgba(10, 8, 8, 0) 62%);
}
.card .tag-row {
  position: absolute; top: 18px; left: 18px; right: 64px; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.card .tag {
  background: rgba(255, 255, 255, 0.92); color: var(--ink);
  backdrop-filter: blur(6px);
  font-size: 11.5px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.card .tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.card .swipe-up-hint {
  position: absolute; top: 18px; right: 18px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(40, 40, 46, 0.78); backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: grid; place-items: center;
}
.card .swipe-up-hint svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 2.4; fill: none; }
.card-info { position: absolute; left: 22px; right: 22px; bottom: 20px; color: var(--white); }
.card-price { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.card-price small { font-size: 13px; font-weight: 500; opacity: 0.82; margin-left: 6px; }
.card-list-price { font-size: 12.5px; font-weight: 400; opacity: 0.78; margin-top: 5px; }
.rent-match {
  display: inline-flex; align-items: center; margin-top: 9px;
  font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.rent-match::before { content: "🔥"; margin-right: 6px; font-size: 11px; }
.rent-match.under { background: rgba(47, 174, 99, 0.9); border-color: transparent; }
.rent-match.under::before { content: "✓"; }
.rent-match.near { background: rgba(244, 85, 31, 0.92); border-color: transparent; }
.rent-match.over { background: rgba(255, 255, 255, 0.16); }
.rent-match.over::before { content: "↑"; }
.card-hood { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14.5px; font-weight: 500; }
.card-hood svg { width: 14px; height: 14px; fill: var(--orange-glow); }
.card-specs { display: flex; gap: 8px; margin-top: 12px; }
.spec-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px; padding: 7px 11px;
  font-size: 12px; font-weight: 500;
}
.spec-chip svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 1.7; }

.stamp {
  position: absolute; top: 34px;
  font-size: 30px; font-weight: 800; letter-spacing: 0.08em;
  padding: 6px 16px; border-radius: 10px; border: 4px solid;
  opacity: 0; text-transform: uppercase;
}
.stamp.like { left: 22px; color: #3ddc84; border-color: #3ddc84; transform: rotate(-14deg); }
.stamp.nope { right: 22px; color: #ff4d5e; border-color: #ff4d5e; transform: rotate(14deg); }
.stamp.details {
  left: 50%; top: auto; bottom: 120px; transform: translateX(-50%) rotate(-4deg);
  color: #4db2ff; border-color: #4db2ff; font-size: 24px;
}

.deck-empty {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center; color: var(--muted); padding: 0 30px;
}
.deck-empty.show { display: flex; }
.deck-empty .big { font-size: 46px; }
.deck-empty h3 { color: var(--ink); font-size: 19px; }
.btn-reset { margin-top: 6px; background: var(--orange); color: #fff; font-weight: 600; padding: 12px 26px; border-radius: 999px; box-shadow: 0 10px 24px rgba(244, 85, 31, 0.4); }

/* ---------- bottom nav ---------- */
#nav {
  position: absolute; left: 14px; right: 14px; bottom: max(14px, env(safe-area-inset-bottom));
  height: var(--nav-h); z-index: 40;
  background: var(--ink); border-radius: 999px;
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
  box-shadow: 0 18px 40px rgba(23, 23, 27, 0.35);
}
.nav-btn {
  position: relative; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; color: #9a9aa2;
  transition: color 0.2s ease;
}
.nav-btn svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.nav-btn.active { color: var(--white); }
.nav-btn.active::after {
  content: ""; position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--orange);
}
.nav-btn .badge {
  position: absolute; top: 8px; right: 8px; min-width: 17px; height: 17px;
  border-radius: 999px; background: var(--orange); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px;
}
.nav-btn .badge:empty { display: none; }

/* ---------- section headers in views ---------- */
.view-title { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; padding: 14px 22px 4px; }
.view-sub { font-size: 12.5px; color: var(--muted); padding: 0 22px 10px; }
.msgs-top { display: flex; align-items: flex-start; justify-content: space-between; padding: 6px 22px 0; }
.msgs-top .view-title, .msgs-top .view-sub { padding-left: 0; padding-right: 0; }
.empty-note .btn-compose {
  display: inline-flex; margin-top: 16px; background: var(--orange); color: #fff;
  font-weight: 600; font-size: 14px; padding: 12px 22px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(244, 85, 31, 0.35);
}

/* ---------- search ---------- */
.search-note {
  margin: 8px 22px 2px; font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
.search-note a { color: var(--orange); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.search-box {
  margin: 10px 22px 4px; display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 16px; box-shadow: var(--shadow-soft);
}
.search-box svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; }
.search-box input { border: 0; outline: 0; flex: 1; font: inherit; font-size: 14px; background: none; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 12px 22px 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.f-chip {
  flex: 0 0 auto; padding: 9px 16px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
}
.f-chip.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.result-card {
  display: flex; gap: 14px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 10px; margin-bottom: 12px;
  box-shadow: var(--shadow-soft); align-items: center;
}
.result-card img { width: 96px; height: 96px; border-radius: var(--radius-md); object-fit: cover; }
.result-info { flex: 1; min-width: 0; }
.result-price { font-size: 16.5px; font-weight: 700; color: var(--orange); }
.result-price small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.result-addr { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.result-meta { display: flex; gap: 10px; font-size: 11.5px; color: var(--ink-2); margin-top: 7px; font-weight: 500; }
.result-meta span { white-space: nowrap; }
.result-fav { width: 38px; height: 38px; border-radius: 50%; background: var(--orange-soft); display: grid; place-items: center; flex: 0 0 auto; }
.result-fav svg { width: 17px; height: 17px; stroke: var(--orange); fill: none; stroke-width: 2; }
.result-fav.on svg { fill: var(--orange); }

/* ---------- favourites ---------- */
.fav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fav-card {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 3 / 4; background: #ddd center/cover; box-shadow: var(--shadow-soft);
}
.fav-card .scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 8, 8, 0.78), transparent 55%); }
.fav-card .fav-info { position: absolute; left: 12px; right: 12px; bottom: 12px; color: #fff; }
.fav-card .fav-price { font-size: 16px; font-weight: 700; }
.fav-card .fav-hood { font-size: 11px; opacity: 0.85; margin-top: 2px; }
.fav-card .unfav {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); display: grid; place-items: center;
}
.fav-card .unfav svg { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.empty-note { text-align: center; color: var(--muted); padding: 60px 30px; font-size: 14px; }
.empty-note .big { font-size: 42px; display: block; margin-bottom: 10px; }

/* ---------- messages ---------- */
.msg-row {
  display: flex; gap: 13px; align-items: center; padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.msg-row img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.msg-body { flex: 1; min-width: 0; }
.msg-name { font-weight: 600; font-size: 14.5px; display: flex; justify-content: space-between; }
.msg-name time { font-size: 11px; color: var(--muted); font-weight: 400; }
.msg-prev { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.msg-row .unread { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); flex: 0 0 auto; }

/* chat thread */
#chat { position: absolute; inset: 0; z-index: 50; background: var(--bg); display: none; flex-direction: column; }
#chat.open { display: flex; }
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 18px 12px;
  background: var(--white); border-bottom: 1px solid var(--line);
}
.chat-head img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.chat-head .who { flex: 1; }
.chat-head .who b { font-size: 15px; display: block; }
.chat-head .who span { font-size: 11.5px; color: var(--green); }
.back-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); }
.back-btn svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 76%; padding: 11px 15px; border-radius: 18px; font-size: 13.5px; line-height: 1.45; }
.bubble.them { background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble.me { background: var(--orange); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.chat-input-row {
  display: flex; gap: 10px; padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  background: var(--white); border-top: 1px solid var(--line);
}
.chat-input-row input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px;
  padding: 12px 18px; font: inherit; font-size: 14px; outline: 0; background: var(--bg);
}
.chat-send { width: 46px; height: 46px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; flex: 0 0 auto; }
.chat-send svg { width: 19px; height: 19px; stroke: #fff; fill: none; stroke-width: 2.2; }

/* ---------- details sheet ---------- */
#sheet {
  position: absolute; inset: 0; z-index: 55;
  background: var(--bg);
  transform: translateY(104%);
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0.22, 1);
  display: flex; flex-direction: column;
}
#sheet.open { transform: translateY(0); }
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding-bottom: 110px; }
.gallery { position: relative; }
.gallery-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-strip::-webkit-scrollbar { display: none; }
.gallery-strip img { width: 100%; flex: 0 0 100%; height: 320px; object-fit: cover; scroll-snap-align: center; }
.gallery .close-sheet {
  position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
}
.gallery .close-sheet svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.gallery .fav-toggle {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px;
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.92);
  display: grid; place-items: center; box-shadow: var(--shadow-soft);
}
.gallery .fav-toggle svg { width: 19px; height: 19px; stroke: var(--orange); fill: none; stroke-width: 2; }
.gallery .fav-toggle.on svg { fill: var(--orange); }
.gallery-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.gallery-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
.gallery-dots i.on { background: #fff; }
.photo-count {
  position: absolute; bottom: 12px; right: 14px;
  background: rgba(10, 8, 8, 0.6); color: #fff; font-size: 11px; font-weight: 500;
  padding: 5px 10px; border-radius: 999px;
}

.sheet-body { padding: 20px 22px 0; }
.sheet-body > section { margin-bottom: 26px; }
.d-price { font-size: 32px; font-weight: 700; color: var(--orange); letter-spacing: -0.02em; }
.d-price small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.d-list-price { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.d-addr { font-size: 14px; color: var(--muted); margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.d-addr svg { width: 14px; height: 14px; fill: var(--orange); flex: 0 0 auto; }
.d-mls { font-size: 11px; color: var(--muted); margin-top: 5px; letter-spacing: 0.04em; }
.quick-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.qf {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 12px 10px; text-align: center;
}
.qf b { font-size: 15px; display: block; }
.qf span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.s-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.d-remarks { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.info-rows { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.info-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row b { font-weight: 500; text-align: right; }
.room-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.room-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 0; }
.room-table td { padding: 9px 0; border-top: 1px solid var(--line); }
.agent-card {
  display: flex; align-items: center; gap: 13px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: var(--shadow-soft);
}
.agent-card img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.agent-card .a-info { flex: 1; }
.agent-card .a-info b { font-size: 14.5px; display: block; }
.agent-card .a-info span { font-size: 12px; color: var(--muted); }
.agent-call { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; }
.agent-call svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 1.9; }
.market-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.market-strip .qf b { color: var(--orange); }
.mortgage-calc-link {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--orange-soft); color: var(--orange-deep); font-weight: 600; font-size: 13.5px;
  padding: 13px; border-radius: 14px; margin: 4px 0 14px;
}
.mortgage-calc-link svg { width: 17px; height: 17px; stroke: var(--orange-deep); fill: none; stroke-width: 1.8; }
.legal-footer { padding-bottom: 8px; }
.legal-footer p { font-size: 10.5px; line-height: 1.5; color: var(--muted); margin-bottom: 8px; }
.legal-footer p:last-child { margin-bottom: 0; }
.sheet-cta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 22px max(20px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 68%, transparent);
  display: flex; gap: 12px;
}
.btn-book {
  flex: 1; background: var(--orange); color: #fff; font-weight: 600; font-size: 15.5px;
  border-radius: 16px; padding: 16px; box-shadow: 0 12px 28px rgba(244, 85, 31, 0.4);
  transition: transform 0.15s ease;
}
.btn-book:active { transform: scale(0.97); }
.btn-pass-sheet {
  width: 54px; border-radius: 16px; background: var(--white); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.btn-pass-sheet svg { width: 20px; height: 20px; stroke: #ff4d5e; fill: none; stroke-width: 2.2; }
.btn-info {
  flex: 1; background: var(--white); color: var(--ink); font-weight: 600; font-size: 15.5px;
  border-radius: 16px; padding: 16px; border: 1.5px solid var(--line); box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease;
}
.btn-info:active { transform: scale(0.97); }

/* ---------- book a showing ---------- */
#booking {
  position: absolute; inset: 0; z-index: 59;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0.22, 1);
}
#booking.open { transform: translateX(0); }
.booking-listing {
  display: flex; gap: 12px; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 12px; margin-bottom: 22px; box-shadow: var(--shadow-soft);
}
.booking-listing img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; }
.booking-listing .bl-price { font-size: 16px; font-weight: 700; }
.booking-listing .bl-addr { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
/* Booking time is a <select> now (was a wrapping grid of hour buttons, which
   made the form look busier than it is). Native selects ignore most of
   .text-input's look, so restate it here with a proper chevron. */
select.text-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px 18px;
  cursor: pointer;
}
.booking-done {
  text-align: center; padding: 40px 24px;
}
.booking-done .big { font-size: 48px; display: block; margin-bottom: 14px; }
.booking-done h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.booking-done p { font-size: 14px; color: var(--ink-2); line-height: 1.6; }

/* ---------- mortgage calculator ---------- */
#mortgage-calc {
  position: absolute; inset: 0; z-index: 59;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0.22, 1);
}
#mortgage-calc.open { transform: translateX(0); }
.calc-slider-label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.calc-slider-label b { color: var(--orange); font-size: 15px; font-weight: 700; }
.calc-slider {
  width: 100%; height: 6px; border-radius: 999px; background: var(--line);
  appearance: none; -webkit-appearance: none; outline: 0;
}
.calc-slider::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%; background: var(--orange);
  border: 3px solid var(--white); box-shadow: var(--shadow-soft); cursor: pointer;
}
.calc-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--orange);
  border: 3px solid var(--white); box-shadow: var(--shadow-soft); cursor: pointer;
}
.calc-result {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; text-align: center; box-shadow: var(--shadow-soft); margin: 22px 0 14px;
}
.calc-result > span { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.calc-result > b { display: block; font-size: 34px; font-weight: 700; color: var(--orange); letter-spacing: -0.02em; margin: 6px 0 18px; }
.calc-breakdown { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.calc-breakdown div { flex: 1; }
.calc-breakdown span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.calc-breakdown b { font-size: 14px; font-weight: 700; color: var(--ink); }
.preapproval-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; margin-top: 18px; box-shadow: var(--shadow-soft); text-align: center;
}
.preapproval-card .s-title { margin-bottom: 8px; }
.preapproval-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin-bottom: 16px; }
.preapproval-card .btn-book { width: 100%; }

/* profile → map search launcher */
.map-launch {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--white); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 15px; font-weight: 600; font-size: 14.5px; color: var(--ink); box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease;
}
.map-launch:active { transform: scale(0.98); }
.map-launch svg { width: 18px; height: 18px; stroke: var(--orange); fill: none; stroke-width: 1.8; }

/* ---------- auth modal (phone/SMS login) ---------- */
.sheet-modal {
  position: absolute; inset: 0; z-index: 80;
  background: rgba(23, 23, 27, 0.5);
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.sheet-modal.open { opacity: 1; pointer-events: auto; }
.auth-sheet {
  position: relative; width: 100%;
  background: var(--white); border-radius: 28px 28px 0 0;
  padding: 18px 24px max(26px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0.22, 1);
  max-height: 88%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
}
.sheet-modal.open .auth-sheet { transform: translateY(0); }
.auth-close {
  position: absolute; top: 14px; right: 18px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg); display: grid; place-items: center;
}
.auth-close svg { width: 15px; height: 15px; stroke: var(--ink); fill: none; stroke-width: 2.2; }
.auth-logo { font-size: 26px; margin: 6px 0 16px; }
.auth-step h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.auth-step p { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-bottom: 18px; }
.auth-step p b { color: var(--ink); font-weight: 600; }
.auth-step .field-label { display: block; margin-bottom: 8px; }
.auth-step .ob-cta { width: 100%; }
.auth-step .text-input { margin-bottom: 14px; }
.auth-skip {
  display: block; width: 100%; text-align: center; margin-top: 14px;
  font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 8px;
}
.auth-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 16px; margin-bottom: 4px;
  background: var(--white); border: 1.5px solid var(--line); border-radius: 14px;
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.auth-google-btn:active { transform: scale(0.98); }
.auth-google-btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 14px 0;
  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.auth-links { text-align: center; margin-top: 12px; }
.auth-link {
  display: block; width: 100%; padding: 6px; font-size: 13.5px; color: var(--muted);
}
.auth-link b { color: var(--orange); font-weight: 600; }
.auth-demo-note {
  display: block; font-size: 12px; color: var(--orange-deep); background: var(--orange-soft);
  border-radius: 10px; padding: 9px 12px; margin: -6px 0 16px; line-height: 1.5;
}

/* account status row in profile */
.account-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 12px 16px; margin-bottom: 22px; box-shadow: var(--shadow-soft);
}
.account-row span { font-size: 13px; color: var(--muted); }
.account-row span.signed-in { color: var(--green); font-weight: 600; }
.account-row button { font-size: 13px; font-weight: 600; color: var(--orange); }

/* toast */
#toast {
  position: absolute; left: 50%; bottom: calc(var(--nav-h) + 34px); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500;
  padding: 12px 20px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease; z-index: 70; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- profile / settings ---------- */
#profile {
  position: absolute; inset: 0; z-index: 58;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0.22, 1);
}
#profile.open { transform: translateX(0); }
.profile-head {
  display: flex; align-items: center; gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 18px 12px;
  background: var(--white); border-bottom: 1px solid var(--line);
}
.profile-head b { font-size: 16px; font-weight: 600; }
.profile-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 18px 22px 110px; }
.profile-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px; margin-bottom: 24px; box-shadow: var(--shadow-soft);
}
.profile-card img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 2px solid var(--orange); }
.profile-card b { font-size: 17px; display: block; }
.profile-card span { font-size: 12.5px; color: var(--muted); }
.text-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 16px;
  padding: 14px 18px; font: inherit; font-size: 15px; background: var(--bg); outline: 0;
}
.text-input:focus { border-color: var(--orange); }
.profile-cta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 22px max(20px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, transparent);
}
.profile-cta .btn-book { width: 100%; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-md); margin-bottom: 10px;
}
.toggle-row b { font-size: 14px; font-weight: 600; display: block; }
.toggle-row span { font-size: 12px; color: var(--muted); }

.saved-search-row > div:first-child { min-width: 0; }
.saved-search-row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-search-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ss-apply {
  font-size: 12px; font-weight: 600; color: var(--accent, #f4551f);
  background: none; border: 1px solid currentColor; border-radius: 999px;
  padding: 6px 12px;
}
.ss-delete {
  width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: #eee; color: #555; font-size: 16px; line-height: 1;
}
.ss-delete:hover { background: #ddd; }
.switch {
  width: 48px; height: 28px; border-radius: 999px; background: #d7d7de;
  position: relative; flex: 0 0 auto; transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s;
}
.switch.on { background: var(--orange); }
.switch.on::after { transform: translateX(20px); }
.signout-row {
  width: 100%; text-align: center; color: #ff4d5e; font-weight: 600; font-size: 14.5px;
  padding: 15px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-md); margin-top: 4px;
}
.signout-row:active { background: #fff1f2; }

/* avatar upload */
.avatar-edit { position: relative; flex: 0 0 auto; cursor: pointer; display: block; width: 58px; height: 58px; }
.avatar-edit img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 2px solid var(--orange); background: var(--orange-soft); }
.cam-badge {
  position: absolute; bottom: -2px; right: -2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--orange); border: 2px solid var(--white); display: grid; place-items: center;
}
.cam-badge svg { width: 12px; height: 12px; stroke: #fff; fill: none; stroke-width: 2; }

/* bio textarea */
.bio-input { resize: none; line-height: 1.5; font-size: 14px; min-height: 76px; }

/* add-your-own neighbourhood */
.hood-add { display: flex; gap: 8px; margin-bottom: 10px; }
.hood-add input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px;
  font: inherit; font-size: 14px; background: var(--bg); outline: 0;
}
.hood-add input:focus { border-color: var(--orange); }
.hood-add button {
  flex: 0 0 auto; padding: 0 18px; border-radius: 12px; background: var(--orange); color: #fff;
  font-weight: 600; font-size: 14px;
}

/* clickable community link on cards / details */
.hood-link { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.hood-link:active { opacity: 0.7; }

/* ---------- search: list / map toggle ---------- */
.hidden { display: none !important; }
.search-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px 4px; }
.search-top .view-title { padding: 0; }
.map-toggle { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.mt-btn { padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mt-btn.on { background: var(--orange); color: #fff; }

#search-list-mode { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#search-map-mode { display: none; flex-direction: column; flex: 1; min-height: 0; }
#view-search.map-on #search-list-mode { display: none; }
#view-search.map-on #search-map-mode { display: flex; }

.map-hoods { display: flex; gap: 8px; overflow-x: auto; padding: 12px 22px 10px; scrollbar-width: none; }
.map-hoods::-webkit-scrollbar { display: none; }
.map-hoods .p-chip { flex: 0 0 auto; }

.map-stage { position: relative; flex: 1; min-height: 0; }
/* z-index (not just position) is required here: without it, Leaflet's
   internal panes (z-index up to ~700) aren't contained to #map's own
   stacking context and instead compare directly against #nav (z-index 40)
   in the shared ancestor context — and win, hiding the nav bar. Giving #map
   its own stacking context keeps all of Leaflet's internals scoped below it. */
#map { position: absolute; inset: 0; z-index: 1; background: #e8ebef; }
.map-hint {
  position: absolute; top: 12px; left: 14px; right: 14px; z-index: 500;
  background: rgba(23, 23, 27, 0.9); color: #fff; font-size: 12.5px; line-height: 1.5;
  padding: 10px 14px; border-radius: 12px; text-align: center; pointer-events: none;
}
.map-hint b { font-weight: 600; }
.map-tools { position: absolute; bottom: calc(var(--nav-h) + 24px); left: 0; right: 0; z-index: 500; display: flex; justify-content: center; gap: 10px; }
.map-tool {
  display: flex; align-items: center; gap: 8px;
  background: var(--orange); color: #fff; font-weight: 600; font-size: 14px;
  padding: 13px 22px; border-radius: 999px; box-shadow: 0 10px 26px rgba(244, 85, 31, 0.45);
}
.map-tool svg { width: 17px; height: 17px; fill: #fff; }
.map-tool.ghost { background: var(--white); color: var(--ink); box-shadow: var(--shadow-soft); border: 1px solid var(--line); }
.map-tool.drawing { background: var(--ink); box-shadow: 0 10px 26px rgba(23, 23, 27, 0.4); }

/* custom price markers */
.price-pin {
  background: var(--white); color: var(--ink); font-weight: 700; font-size: 12px;
  padding: 5px 9px; border-radius: 999px; border: 1.5px solid var(--white);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28); white-space: nowrap;
  transform: translate(-50%, -50%); transition: transform 0.12s;
}
.price-pin.on { background: var(--orange); color: #fff; border-color: #fff; transform: translate(-50%, -50%) scale(1.12); z-index: 400; }
.leaflet-div-icon { background: transparent; border: 0; }
.leaflet-container { font-family: inherit; }

/* zoom control — sits below the hint banner, styled to match */
.leaflet-top.leaflet-right { top: 64px; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-soft); border-radius: 12px; overflow: hidden; margin-right: 14px !important; }
.leaflet-control-zoom a {
  width: 38px; height: 38px; line-height: 38px; font-size: 20px; font-weight: 600;
  color: var(--ink); background: var(--white); border-bottom: 1px solid var(--line);
}
.leaflet-control-zoom a:last-child { border-bottom: 0; }
.leaflet-control-zoom a:hover { background: var(--orange-soft); color: var(--orange); }

/* drawn area */
.draw-path { stroke: var(--orange); stroke-width: 3; fill: rgba(244, 85, 31, 0.12); }

/* results panel */
.map-results {
  position: absolute; left: 10px; right: 10px; bottom: calc(var(--nav-h) + 18px); z-index: 550;
  background: var(--white); border-radius: 20px; padding: 14px 16px 16px;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.18);
}
.mr-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 12px; }
.mr-head b { font-size: 17px; font-weight: 700; }
.mr-head span { font-size: 12.5px; color: var(--muted); }
.mr-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.mr-scroll::-webkit-scrollbar { display: none; }
.mr-mini { flex: 0 0 140px; border-radius: 14px; overflow: hidden; background: #ddd center/cover; height: 96px; position: relative; }
.mr-mini .scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,8,8,0.8), transparent 60%); }
.mr-mini .mm-info { position: absolute; left: 8px; right: 8px; bottom: 7px; color: #fff; }
.mr-mini .mm-price { font-size: 13px; font-weight: 700; }
.mr-mini .mm-hood { font-size: 10px; opacity: 0.9; }
.mr-cta {
  width: 100%; margin-top: 12px; background: var(--orange); color: #fff; font-weight: 600; font-size: 15px;
  padding: 14px; border-radius: 14px; box-shadow: 0 8px 20px rgba(244, 85, 31, 0.38);
}
.mr-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 4px 0 8px; }

/* ============================================================
   DESKTOP FALLBACK — Padster is mobile-only. #phone (the app) is
   what phones render, with zero redirect. This block is hidden by
   default and only swapped in via the media query below, so a
   desktop-width browser gets a lightweight pitch instead of a
   narrow app column stranded in the middle of the screen.
   ============================================================ */
#desktop-gate { display: none; }

@media (min-width: 860px) {
  #phone { display: none; }
  #desktop-gate {
    display: flex; flex-direction: column;
    position: fixed; inset: 0; z-index: 9999;
    color: #fff; overflow-y: auto; user-select: text;
    background: linear-gradient(160deg, var(--orange-glow) -20%, var(--orange) 45%, var(--orange-deep) 115%);
  }
  .gate-head { padding: 34px 56px; }
  .gate-head .wordmark-img { height: 38px; }
  .gate-main {
    flex: 1; display: flex; align-items: center; justify-content: center;
    gap: 90px; padding: 0 56px 40px; max-width: 1200px; margin: 0 auto; width: 100%;
  }
  .gate-pitch { max-width: 480px; }
  .gate-pitch h1 { font-size: 54px; line-height: 1.08; font-weight: 700; letter-spacing: -0.02em; }
  .gate-pitch h1 .hl { background: #fff; color: var(--orange); border-radius: 12px; padding: 0 14px; display: inline-block; }
  .gate-pitch p { margin-top: 22px; font-size: 17px; line-height: 1.6; opacity: 0.9; font-weight: 400; }
  .gate-note {
    margin-top: 34px; display: inline-block; background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.4); border-radius: 18px; padding: 20px 26px;
  }
  .gate-note b { display: block; font-size: 18px; margin-bottom: 6px; }
  .gate-note span { font-size: 14px; line-height: 1.55; opacity: 0.9; }
  .gate-note strong { color: #fff; opacity: 1; }
  .gate-phone {
    width: 384px; height: 800px; flex: 0 0 auto;
    border-radius: 54px; background: #111; padding: 13px;
    box-shadow: 0 50px 110px rgba(0, 0, 0, 0.42), inset 0 0 0 2px #333;
    position: relative;
  }
  .gate-phone::before {
    content: ""; position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
    width: 108px; height: 26px; background: #111; border-radius: 999px; z-index: 5;
  }
  .gate-phone iframe { width: 100%; height: 100%; border: 0; border-radius: 42px; background: var(--bg); }
  .gate-foot { padding: 20px 56px 28px; font-size: 12px; opacity: 0.72; display: flex; justify-content: space-between; }
}
@media (min-width: 860px) and (max-width: 1020px) {
  .gate-main { gap: 44px; }
  .gate-pitch h1 { font-size: 42px; }
  .gate-phone { width: 330px; height: 690px; }
}
