/* Design tokens lifted from thezadegangroup.com/home-search */
:root {
  --black: #000;
  --white: #fff;
  --text: #000;
  --muted: #6b6b6b;
  --subtle: #8e8e8e;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --surface: #f7f7f7;
  --surface-2: #efefef;
  --skeleton: #ececec;
  --radius: 8px;
  --radius-lg: 12px;
  --header-h: 72px;
  --toolbar-h: 72px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.12);
  --green: #1f8a4c;
  --amber: #b26a00;
  --blue: #1f5fbf;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--white); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); display: flex; align-items: center; gap: 36px; padding: 0 24px; background: var(--white); border-bottom: 1px solid var(--line); }
.logo img { height: 34px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 14px; font-size: 14px; letter-spacing: 0.02em; white-space: nowrap; }
.main-nav a:hover { opacity: .65; }
.nav-sep { width: 1px; height: 16px; background: var(--line-strong); }
.header-right { margin-left: auto; display: flex; gap: 16px; }
.link-btn { font-size: 14px; }
.link-btn:hover { opacity: .65; }
.header-right .btn { height: 38px; padding: 0 18px; }

/* ---------- Buttons / pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); font-size: 14px; white-space: nowrap; transition: border-color .15s, background .15s; }
.pill:hover { border-color: var(--line-strong); }
.pill.active { border-color: var(--black); }
.pill .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--black); color: var(--white); font-size: 11px; font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--radius); font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn-black { background: var(--black); color: var(--white); border: 1px solid #efefef; }
.btn-black:hover { background: #222; }
.btn-grey { background: var(--surface-2); color: var(--black); }
.btn-grey:hover { background: #e4e4e4; }
.btn-outline { border: 1px solid var(--line-strong); background: var(--white); }
.btn-outline:hover { border-color: var(--black); }
.btn-block { width: 100%; height: 44px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; }
.icon-btn:hover { background: var(--surface-2); }
.icon-circle { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(4px); transition: background .15s; }
.icon-circle:hover { background: rgba(0,0,0,.7); }
.icon-circle.on svg { fill: #fff; }
svg { flex-shrink: 0; }

/* ---------- Search toolbar ---------- */
.toolbar { position: sticky; top: var(--header-h); z-index: 40; display: flex; align-items: center; gap: 8px; height: var(--toolbar-h); padding: 0 16px; background: var(--white); border-bottom: 1px solid var(--line); }
.search-box { position: relative; flex: 0 1 520px; min-width: 200px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #333; pointer-events: none; }
.search-box input { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: 14px; outline: none; background: var(--white); }
.search-box input:focus { border-color: var(--black); }
.search-box input::placeholder { color: var(--subtle); }
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 6px; display: none; max-height: 360px; overflow: auto; z-index: 60; }
.suggest.open { display: block; }
.suggest-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); }
.suggest-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border-radius: var(--radius); text-align: left; }
.suggest-item:hover, .suggest-item.hl { background: var(--surface); }
.suggest-item small { color: var(--muted); display: block; }
.filter-pills { display: flex; gap: 8px; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; padding: 3px; border-radius: 20px; background: var(--white); gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 16px; font-size: 13px; }
.seg button.on { background: var(--surface-2); font-weight: 500; }

/* Dropdown popovers */
.dd { position: relative; }
.dd-panel { position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px; width: max-content; max-width: calc(100vw - 32px); padding: 16px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); z-index: 70; display: none; }
.dd.open .dd-panel { display: block; }
.dd-panel h4 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.dd-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.dd-actions .clear { font-size: 13px; text-decoration: underline; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; font-size: 14px; }
.check-row input { width: 16px; height: 16px; accent-color: #000; }
.range-row { display: flex; gap: 8px; align-items: center; }
.range-row select, .field select, .field input, .field textarea { flex: 1; height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; background: #fff; outline: none; }
.field > * { flex: none; }
.field textarea { height: auto; padding: 10px; resize: vertical; }
.range-row select:focus, .field select:focus, .field input:focus, .field textarea:focus { border-color: #000; }
.chip-group { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.chip-group { flex-wrap: nowrap; }
.chip-group button { flex: 1 0 auto; height: 40px; min-width: 48px; padding: 0 14px; font-size: 14px; white-space: nowrap; border-right: 1px solid var(--line-strong); }
.chip-group button:last-child { border-right: 0; }
.chip-group button.on { background: #000; color: #fff; }

/* ---------- Results layout ---------- */
.results { display: grid; grid-template-columns: minmax(420px, 46%) 1fr; height: calc(100vh - var(--header-h) - var(--toolbar-h)); }
.results.list-only { grid-template-columns: minmax(0, 1fr); }
.results.list-only .map-pane { display: none; }
.results.map-only { grid-template-columns: minmax(0, 1fr); }
.results.map-only .list-pane { display: none; }
.list-pane { overflow-y: auto; padding: 20px 16px 40px; }
.list-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 12px; }
.list-head h1 { font-size: 20px; font-weight: 700; line-height: 24px; }
.list-head .sub { margin-top: 4px; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.sample-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #fff4e0; color: var(--amber); font-weight: 500; }
.sort { position: relative; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.sort select { appearance: none; border: 0; background: transparent; font: inherit; padding-right: 18px; cursor: pointer; outline: none; }
.sort svg { position: absolute; right: 0; pointer-events: none; }
.chips-active { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.chips-active button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--surface); font-size: 12px; }
.chips-active button:hover { background: var(--surface-2); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
.results.list-only .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ---------- Card ---------- */
.card { position: relative; display: block; }
.card-media { position: relative; aspect-ratio: 3 / 2; border-radius: var(--radius-lg); overflow: hidden; background: var(--skeleton); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-media::after { content: ''; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to top, rgba(0,0,0,.55), transparent); pointer-events: none; }
.badge { position: absolute; top: 12px; left: 12px; z-index: 2; height: 26px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 500; backdrop-filter: blur(4px); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
.badge.s-registration .dot { background: #60a5fa; }
.badge.s-coming .dot { background: #fbbf24; }
.badge.s-sold .dot { background: #f87171; }
.badge.feat { left: auto; position: static; background: #fff; color: #000; }
.badge-row { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; }
.badge-row .badge { position: static; }
.card-actions { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 8px; }
.courtesy { position: absolute; left: 12px; bottom: 10px; right: 12px; z-index: 2; color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body { padding-top: 12px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-size: 16px; font-weight: 700; }
.price small { font-size: 12px; font-weight: 500; color: var(--muted); margin-right: 4px; }
.card-name { font-size: 14px; font-weight: 600; margin-top: 2px; }
.card-meta { font-size: 14px; margin-top: 4px; }
.card-addr { font-size: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card.hl .card-media { outline: 2px solid #000; outline-offset: 2px; }
.more-menu { position: absolute; right: 0; top: 100%; z-index: 20; min-width: 180px; padding: 6px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); display: none; }
.more-menu.open { display: block; }
.more-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; font-size: 13px; }
.more-menu button:hover { background: var(--surface); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h3 { color: #000; font-size: 16px; margin-bottom: 6px; }
.skel { background: var(--skeleton); border-radius: 6px; }

/* ---------- Map ---------- */
.map-pane { position: relative; isolation: isolate; } /* keep Leaflet's z-index 400+ layers below the toolbar dropdowns */
#map, .map { width: 100%; height: 100%; background: #eef0ee; }
.map-ctrl { position: absolute; top: 12px; z-index: 650; /* above pins (600), below popups (700) */ display: flex; gap: 6px; }
.map-ctrl.left { left: 12px; }
.map-ctrl.right { right: 12px; }
.map-ctrl button { height: 36px; padding: 0 12px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.map-ctrl button.on { font-weight: 600; }
.map-ctrl.right { gap: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.map-ctrl.right button { box-shadow: none; border-radius: 0; }
.map-ctrl.right button.on { background: var(--surface-2); }
.search-area { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 650; display: none; }
.search-area.show { display: block; }
.search-area button { height: 36px; padding: 0 14px; border-radius: 18px; background: #000; color: #fff; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-sm); }
.pin { position: relative; display: inline-block; transform: translate(-50%, -100%); padding: 4px 8px; border-radius: 6px; background: #fff; color: #000; font: 600 12px/1.2 var(--font); white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.3); border: 1px solid rgba(0,0,0,.08); transition: transform .12s; }
.pin::after { content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #fff; border-bottom: 0; }
.pin.hl, .pin:hover { background: #000; color: #fff; z-index: 1000; }
.pin.hl::after, .pin:hover::after { border-top-color: #000; }
.pin.sold { color: var(--subtle); }
.pin-wrap { background: none !important; border: 0 !important; }
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content-wrapper { border-radius: var(--radius-lg); padding: 0; overflow: hidden; }
.leaflet-popup-content { margin: 0; width: 260px !important; }
.pop { display: block; color: #000 !important; text-decoration: none; }
.pop img { width: 100%; height: 140px; object-fit: cover; }
.leaflet-container a.leaflet-popup-close-button { top: 8px; right: 8px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #000; font: 400 20px/27px var(--font); text-align: center; box-shadow: var(--shadow-sm); }
.leaflet-container a.leaflet-popup-close-button:hover { background: var(--surface-2); color: #000; }
.pop .pb { padding: 10px 12px 12px; }
.pop .pb b { font-size: 15px; }
.pop .pb div { font-size: 13px; margin-top: 2px; }
.pop .pb .pop-meta { color: var(--muted); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-sm) !important; border-radius: var(--radius) !important; overflow: hidden; }
.leaflet-control-zoom a { width: 36px !important; height: 36px !important; line-height: 36px !important; color: #000 !important; }

/* ---------- Detail page ---------- */
.crumbbar { position: sticky; top: var(--header-h); z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; padding: 0 32px; background: var(--surface); font-size: 13px; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumbs a { color: var(--muted); white-space: nowrap; }
.crumbs a:hover { color: #000; }
.crumbs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-tabs { display: flex; gap: 20px; }
.section-tabs a { color: var(--subtle); white-space: nowrap; }
.section-tabs a.on, .section-tabs a:hover { color: #000; }
.detail { max-width: 1240px; margin: 0 auto; padding: 24px 32px 80px; }
.gallery { position: relative; display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; height: 460px; border-radius: var(--radius-lg); overflow: hidden; }
.gallery button { position: relative; overflow: hidden; background: var(--skeleton); }
.gallery button:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery button:hover img { transform: scale(1.03); }
.gallery .g-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 3; }
.gallery .all-photos { position: absolute; right: 14px; bottom: 14px; z-index: 3; height: 36px; padding: 0 14px; background: #fff; border-radius: var(--radius); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-sm); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; margin-top: 28px; }
.facts { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.detail-price { font-size: 32px; font-weight: 700; margin-top: 12px; letter-spacing: -0.01em; }
.detail-price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.detail-title { font-size: 20px; font-weight: 600; margin-top: 6px; }
.detail-addr { font-size: 15px; margin-top: 4px; color: #222; }
.ptype { margin-top: 18px; font-size: 13px; color: var(--muted); }
.ptype b { display: block; color: #000; font-size: 14px; font-weight: 500; }
.sec { padding-top: 40px; scroll-margin-top: calc(var(--header-h) + 72px); }
.sec > h2 { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.tags .t-strong { color: #000; font-weight: 500; }
.desc { font-size: 15px; line-height: 1.7; color: #222; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.readmore { margin-top: 8px; font-size: 14px; font-weight: 500; text-decoration: underline; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv div:nth-child(odd) { padding-right: 24px; }
.kv div:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--line); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; text-align: right; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
table.plans { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plans th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; background: var(--surface); }
table.plans td { padding: 14px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
table.plans tr:hover td { background: #fafafa; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.st::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.st.limited::before { background: #f59e0b; }
.st.sold { color: var(--subtle); }
.st.sold::before { background: #d4d4d4; }
.plans-filter { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.plans-filter button { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-strong); font-size: 13px; }
.plans-filter button.on { background: #000; color: #fff; border-color: #000; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; justify-content: space-between; padding: 0 0 18px 26px; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #000; }
.timeline li::after { content: ''; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.timeline li b { font-weight: 600; }
.note { margin-top: 6px; font-size: 13px; color: var(--muted); }
.incentives { display: grid; gap: 10px; }
.incentive { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); font-size: 14px; font-weight: 500; }
.amen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; }
.amen span { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.loc-map { height: 340px; border-radius: var(--radius-lg); overflow: hidden; margin-top: 12px; }
.copy-addr { font-size: 13px; text-decoration: underline; margin-left: 10px; color: var(--muted); }
.similar { display: grid; grid-flow: column; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.similar .card { scroll-snap-align: start; }
.agent-card { position: sticky; top: calc(var(--header-h) + 76px); align-self: start; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.agent { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.agent .av { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.agent .av img { width: 28px; height: 28px; object-fit: cover; object-position: left center; }
.agent b { font-size: 14px; font-weight: 600; display: block; }
.agent small { color: var(--muted); font-size: 12px; }
.agent-card .btn + .btn { margin-top: 8px; }
.agent-card .hint { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
.disclaimer { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 16px; padding: 24px; position: relative; animation: pop .18s; }
.modal.wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; font-weight: 500; }
.modal .field input, .modal .field select { flex: none; height: 44px; background: var(--surface); border-color: transparent; }
.modal .field input:focus { border-color: #000; background: #fff; }
.consent { display: flex; gap: 10px; font-size: 11px; color: var(--muted); line-height: 1.5; margin: 6px 0 16px; }
.consent input { margin-top: 2px; accent-color: #000; }
.f-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.f-section:first-of-type { padding-top: 0; }
.f-section h4 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.modal-foot { position: sticky; bottom: -24px; margin: 0 -24px -24px; padding: 16px 24px; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-foot .clear { text-decoration: underline; font-size: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.94); display: flex; flex-direction: column; color: #fff; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; font-size: 14px; }
.lb-stage { flex: 1; position: relative; min-height: 0; }
/* Absolutely sized so tall floor plans / renderings always scale down to fit the viewer */
.lb-stage img { position: absolute; top: 0; bottom: 30px; left: 70px; right: 70px; width: calc(100% - 140px); height: calc(100% - 30px); object-fit: contain; }
.lb-nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }
.lb-nav:hover { background: rgba(255,255,255,.25); }
.lb-prev { left: 16px; } .lb-next { right: 16px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 1200; padding: 12px 18px; border-radius: var(--radius); background: #000; color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.mobile-toggle { display: none; }

/* ---------- Live-data additions ---------- */
.tba { font-size: 15px; font-weight: 600; color: var(--muted); }
.detail-price .tba { font-size: 22px; }
.dd-hint { margin: -6px 0 8px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.suggest-item svg { color: var(--muted); }
.suggest-item .sthumb { width: 44px; height: 32px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 32px; }
.pager button { min-width: 36px; height: 36px; padding: 0 8px; border-radius: var(--radius); border: 1px solid var(--line); font-size: 14px; display: inline-grid; place-items: center; }
.pager button:hover:not(:disabled) { border-color: var(--black); }
.pager button.on { background: #000; color: #fff; border-color: #000; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager span { color: var(--muted); padding: 0 2px; }
.map-note { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 500; display: none; padding: 8px 12px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); font-size: 12px; white-space: nowrap; }
.map-note.show { display: block; }
.map.dots .pin { width: 10px; height: 10px; padding: 0; border-radius: 50%; background: #000; color: transparent; border: 1.5px solid #fff; font-size: 0; transform: translate(-50%, -50%); }
.map.dots .pin::after { display: none; }
.map.dots .pin.hl, .map.dots .pin:hover { width: 14px; height: 14px; }
.gallery.g-1 { grid-template-columns: 1fr; }
.gallery.g-1 button:first-child { grid-row: auto; }
.gallery.g-2 { grid-template-columns: 2fr 1fr; }
.gallery.g-2 button:nth-child(2) { grid-row: span 2; }
.gallery.g-3 { grid-template-columns: 2fr 1fr; }
.dev-logo { margin-top: 16px; }
.dev-logo img { height: 36px; width: auto; max-width: 180px; object-fit: contain; }
.desc p { margin: 0 0 12px; }
.plan-thumb { display: block; width: 64px; height: 48px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.plan-thumb img { width: 100%; height: 100%; object-fit: contain; }
.plans-filter .check-row { font-size: 13px; }
.lead-proj { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.lead-proj img { width: 72px; height: 52px; object-fit: cover; border-radius: 6px; }
.lead-proj div div { font-size: 13px; color: var(--muted); }
.lb-top .icon-btn { color: #fff; }
.lb-top .icon-btn:hover { background: rgba(255,255,255,.15); }
.lightbox.light { background: #fff; color: #000; }
.lightbox.light .lb-top .icon-btn { color: #000; }
.lightbox.light .lb-top .icon-btn:hover { background: var(--surface-2); }
.lightbox.light .lb-nav { background: var(--surface-2); color: #000; }

.prose { font-size: 15px; line-height: 1.7; color: #222; max-width: 72ch; }
.prose p { margin: 0 0 12px; }

.ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--surface); color: var(--muted); font-size: 12px; letter-spacing: .02em; }
.ph img { width: 112px; height: auto; opacity: .55; }
.ph-wrap { position: relative; }
.ph-wrap .ph img { width: 180px; }
.card-media.no-img::after { display: none; }
.card-media.no-img .courtesy { color: var(--muted); }
.card-media.no-img .icon-circle { background: rgba(0,0,0,.28); }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .main-nav { display: none; }
}
@media (max-width: 1180px) {
  .filter-pills .hide-md { display: none; }
}
@media (max-width: 1024px) {
  .results { grid-template-columns: minmax(0, 1fr); }
  .results .map-pane { display: none; }
  .results.map-only .map-pane { display: block; }
  .results.map-only .list-pane { display: none; }
  .seg { display: none; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .agent-card { position: static; margin-top: 32px; }
  .section-tabs { display: none; }
  .mobile-toggle { display: inline-flex; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 600; height: 48px; padding: 0 22px; border-radius: 10px; background: #000; color: #fff; font-size: 16px; font-weight: 600; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
}
@media (max-width: 760px) {
  :root { --header-h: 60px; --toolbar-h: auto; }
  .site-header { gap: 16px; padding: 0 16px; }
  .logo img { height: 28px; }
  .main-nav a:first-child, .nav-sep { display: none; }
  .header-right .link-btn:first-child { display: none; }
  .toolbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .search-box { flex: 1 1 100%; }
  .filter-pills { overflow-x: auto; flex: 1; scrollbar-width: none; }
  .filter-pills .hide-sm { display: none; }
  .toolbar-right { margin-left: 0; }
  .toolbar-right .save-btn { display: none; }
  .results { height: auto; min-height: calc(100vh - 160px); }
  .results.map-only { height: calc(100vh - 160px); }
  .list-pane { overflow: visible; }
  .grid, .results.list-only .grid { grid-template-columns: minmax(0, 1fr); }
  .list-head { flex-wrap: wrap; }
  .list-head > div:first-child { min-width: 0; }
  .list-head h1 { font-size: 18px; }
  .list-head .sort { flex-shrink: 0; }
  .crumbbar { padding: 0 16px; }
  .facts { gap: 10px 16px; }
  .detail { padding: 16px 16px 80px; }
  .gallery { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 280px; }
  .gallery button:not(:first-child) { display: none; }
  .gallery button:first-child { grid-row: auto; }
  .detail-price { font-size: 26px; }
  .kv { grid-template-columns: 1fr; }
  .kv div:nth-child(odd) { padding-right: 0; }
  .kv div:nth-child(even) { padding-left: 0; border-left: 0; }
  .amen { grid-template-columns: 1fr 1fr; }
  .f-grid { grid-template-columns: 1fr; }
  .dd-panel { position: fixed; left: 16px; right: 16px; top: auto; min-width: 0; }
  .lb-stage img { left: 8px; right: 8px; bottom: 20px; width: calc(100% - 16px); height: calc(100% - 20px); }
  .lb-nav { display: none; }
}
