/* DHA Lahore exact plot map — Abdul's Venture house style.
 *
 * Restyled 27 August 2026 to match abdulsventure.com. The map was built on a
 * teal-and-navy palette with no webfont at all, so it read as a generic GIS
 * tool sitting on someone else's domain. Every selector and every layout rule
 * below is unchanged from the original — only colour, type and focus states
 * were touched, so nothing in app.js needs to know this happened.
 *
 * ONE THING DELIBERATELY LEFT ALONE:
 *
 * Error, warning and success colours. Semantic state must not be confusable
 *    with brand: a maroon error message on a maroon-branded page reads as
 *    decoration. They keep their own reds, ambers and greens.
 *
 * The font is pulled with @import rather than a <link> because index.html
 * belongs to the other agent this week and this change is scoped to CSS only.
 * If these two files ever land in the same hands, move it to a <link> in the
 * head — it is one render-blocking round trip faster.
 */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Jost:wght@400;500;600;700&display=swap');

:root {
  /* straight from abdulsventure.com — do not invent near-misses of these */
  --ink: #221E20;
  --muted: #655F63;
  --paper: #FBF8F3;      /* cream */
  --panel: #FFFFFF;
  --line: #ECE6E1;
  --mrn: #7D1128;
  --mrn-d: #4A0D18;
  --mrn-l: #9A2038;
  --gold: #C29A3C;
  --gold-l: #E7C570;
  --rose: #FBF2F4;
  /* semantic, deliberately outside the brand ramp */
  --amber: #f59e0b;
  --red: #dc3645;
  --green: #138a5b;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; }
html, body { margin: 0; width: 100%; max-width: 100%; min-height: 100%; color: var(--ink); background: var(--paper); }
body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-y: visible;
  font: 15px/1.45 Jost, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }

.topbar {
  flex: 0 0 auto;
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(14px, 3vw, 34px);
  color: #fff;
  background: linear-gradient(120deg, var(--mrn-d), var(--mrn));
}
.topbar > div:first-child { min-width: 0; }
.eyebrow { margin: 0 0 2px; color: var(--gold-l); font-size: 12px; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: clamp(22px, 3.2vw, 34px); line-height: 1.12; }
.private-badge { padding: 8px 11px; border: 1px solid var(--gold); border-radius: 999px; color: var(--gold-l); font-size: 12px; font-weight: 600; text-align: center; }
.topbar-actions { display: flex; flex: 0 0 auto; min-width: 0; align-items: center; gap: 9px; }
.topbar .account-button { min-height: 38px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.58); border-radius: 999px; color: #fff; background: rgba(255,255,255,.08); white-space: nowrap; }
.topbar .account-button:hover { background: rgba(255,255,255,.18); }
.account-label-small { display: none; }

main {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: min(1500px, 100%);
  min-height: auto;
  min-width: 0;
  margin: 0 auto;
  overflow: visible;
}
.mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; min-width: 0; max-width: 100%; gap: 1px; overflow: hidden; padding: 0 clamp(12px, 2vw, 26px); background: var(--mrn-d); }
.mode-tab { min-width: 0; min-height: 48px; overflow: hidden; border: 0; border-radius: 0; padding: 10px 12px; background: rgba(255,255,255,.08); color: #F7E8EB; font-weight: 600; overflow-wrap: anywhere; }
.mode-tab:hover { background: rgba(255,255,255,.15); }
.mode-tab.active { background: var(--paper); color: var(--mrn-d); box-shadow: inset 0 3px var(--gold); }
.controls {
  position: relative;
  z-index: 800;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  padding: 14px clamp(12px, 2vw, 26px) 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.mode-intro { display: flex; align-items: baseline; gap: 9px; margin-bottom: 10px; }
.mode-intro strong { color: var(--mrn-d); font-family: 'Cormorant Garamond', Georgia, serif; font-size: 20px; }
.mode-intro span { color: var(--muted); font-size: 13px; }
.search-grid { display: grid; grid-template-columns: 120px 145px minmax(120px, 170px) minmax(170px, 1fr) auto; gap: 10px; align-items: end; }
.search-grid > *, .wanted-grid > *, .seller-grid > * { min-width: 0; }
label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
input, select { min-height: 43px; width: 100%; max-width: 100%; border: 1px solid #D8CCC2; border-radius: 9px; padding: 9px 11px; color: var(--ink); background: #fff; text-overflow: ellipsis; }
input:disabled, select:disabled { color: #9A908C; background: #F5F0EA; }
/* gold focus ring: the one place the accent earns its keep, and it clears
   contrast against both the cream ground and the white panels */
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(194, 154, 60, .45); outline-offset: 1px; }
.combobox { position: relative; display: block; width: 100%; min-width: 0; color: var(--ink); font-size: 15px; font-weight: 400; }
.combobox input { padding-right: 38px; }
.combo-toggle { position: absolute; z-index: 2; top: 1px; right: 1px; width: 36px; min-height: 41px; padding: 0; border-radius: 0 8px 8px 0; color: var(--muted); background: transparent; font-size: 22px; line-height: 1; }
.combo-toggle:hover { color: var(--mrn); background: var(--rose); }
.combo-toggle:disabled { cursor: default; opacity: .42; }
.combo-options { position: absolute; z-index: 1200; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; padding: 5px; border: 1px solid #D8CCC2; border-radius: 9px; background: #fff; box-shadow: 0 8px 24px rgba(74, 13, 24, .18); }
.combo-options[hidden] { display: none; }
.combo-option { display: block; width: 100%; min-height: 37px; touch-action: pan-y; padding: 7px 9px; border-radius: 6px; color: var(--ink); background: #fff; text-align: left; font-weight: 500; }
.combo-option:hover, .combo-option.active { color: #fff; background: var(--mrn); }
.combo-empty { display: block; padding: 8px 9px; color: var(--muted); }
.combo-backdrop { position: fixed; z-index: 790; inset: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: rgba(25,15,18,.34); }
.combo-backdrop:hover { background: rgba(25,15,18,.34); }
.combo-backdrop[hidden] { display: none; }
button { min-height: 43px; padding: 9px 18px; border: 0; border-radius: 9px; background: var(--mrn); color: #fff; font-weight: 600; letter-spacing: .01em; cursor: pointer; }
button:hover { background: var(--mrn-l); }
button[disabled] { cursor: wait; opacity: .48; }
button[disabled]:hover { background: var(--mrn); }
.help, .message { margin: 8px 0 0; }
.help { color: var(--muted); font-size: 12px; }
.message { min-height: 22px; }
.message[hidden] { display: none; }
.message.error { color: #a11225; font-weight: 600; }
.message.warning { color: #8a5a00; font-weight: 600; }
.message.success { color: var(--green); font-weight: 600; }
.results { display: grid; gap: 7px; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.results[hidden] { display: none; }
.result-choice { min-height: 38px; padding: 7px 10px; text-align: left; background: var(--rose); color: var(--mrn-d); border: 1px solid #EDD9DE; font-weight: 500; }
.result-choice:hover { background: #F6E4E8; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions a, .actions button { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.actions a { color: #fff; background: var(--mrn-d); }
.actions a:hover { background: var(--mrn); }
.actions .verified { background: var(--green); }
.actions .qa { color: #6b4300; background: #fff3cd; border: 1px solid #e5bd59; }
.actions .marketplace-action { background: var(--mrn); }
.listing-start-panel[hidden], .listing-start-card[hidden] { display: none; }
.listing-start-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #D9C4C9; border-radius: 10px; background: var(--rose); }
.listing-start-copy { display: grid; min-width: 0; gap: 2px; }
.listing-start-copy > span { color: var(--mrn); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.listing-start-copy > strong { overflow: hidden; color: var(--mrn-d); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.listing-start-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.listing-start-actions { display: flex; gap: 8px; }
.listing-start-actions .secondary-button { width: auto; margin: 0; padding-inline: 14px; }
.wanted-panel[hidden] { display: none; }
.wanted-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; align-items: end; }
.money-input { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.currency-prefix { display: flex; align-items: center; min-height: 43px; padding: 9px 10px; border: 1px solid #D8CCC2; border-right: 0; border-radius: 9px 0 0 9px; background: var(--paper); color: var(--mrn-d); font-weight: 700; }
.money-input input { border-radius: 0 9px 9px 0; }
.price-words { display: block; min-height: 18px; color: var(--mrn-d); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.price-words:empty { display: none; }
.rate-card { margin-top: 10px; padding: 11px 12px; border: 1px solid #D9C4C9; border-radius: 10px; background: var(--rose); }
.rate-card[hidden] { display: none; }
.rate-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rate-card-head strong { color: var(--mrn-d); }
.rate-card-head span { color: var(--muted); font-size: 10px; }
.rate-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.rate-values div { padding: 8px; background: #fff; }
.rate-values span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.rate-values strong { display: block; margin-top: 2px; color: var(--ink); font-size: 13px; }
.rate-empty { margin: 0; color: var(--muted); font-size: 12px; }

.map-shell { position: relative; isolation: isolate; flex: 0 0 auto; width: 100%; height: clamp(320px, 58dvh, 640px); min-width: 0; min-height: 320px; }
#map { width: 100%; height: 100%; min-height: 0; background: #E8E0D6; }
.legend { position: absolute; z-index: 700; left: 12px; bottom: 24px; display: grid; gap: 4px; padding: 9px 10px; border-radius: 9px; background: rgba(255,255,255,.94); box-shadow: 0 2px 12px rgba(34,30,32,.22); font-size: 11px; pointer-events: none; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend .selected { background: #e6244f; }
.legend .for-sale-plot { background: #138a5b; }
.legend .for-sale-house { background: #7D1128; }
.legend .buyer-demand { background: #2563eb; }
.popup-grid { display: grid; grid-template-columns: max-content 1fr; gap: 3px 9px; margin-top: 7px; font-size: 12px; }
.popup-grid dt { color: var(--muted); }
.popup-grid dd { margin: 0; font-weight: 600; }
.leaflet-tooltip.plot-label { padding: 1px 4px; border: 0; border-radius: 4px; box-shadow: 0 1px 4px rgba(34,30,32,.25); background: rgba(255,255,255,.88); font-size: 10px; font-weight: 600; }
.leaflet-tooltip.listing-count-label { padding: 2px 5px; border: 0; border-radius: 999px; box-shadow: 0 2px 8px rgba(34,30,32,.28); background: #138a5b; color: #fff; font-size: 10px; font-weight: 800; line-height: 1.15; }
.leaflet-tooltip.wanted-count-label { padding: 2px 5px; border: 0; border-radius: 999px; box-shadow: 0 2px 8px rgba(34,30,32,.28); background: #1f78b4; color: #fff; font-size: 10px; font-weight: 800; line-height: 1.15; }
/* Leaflet paints its own attribution bar; keep it in the family rather than
   letting default link-blue sit under a maroon page. */
.leaflet-control-attribution { background: rgba(251,248,243,.88) !important; color: var(--muted); font-family: Jost, system-ui, sans-serif; }
.leaflet-control-attribution a { color: var(--mrn); }
.market-popup { min-width: 210px; }
.market-popup .market-kind { display: inline-block; margin-bottom: 5px; color: var(--mrn); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.market-popup h3 { margin: 0 0 2px; color: var(--ink); font-family: 'Cormorant Garamond', Georgia, serif; font-size: 20px; }
.market-popup p { margin: 3px 0; color: var(--muted); font-size: 12px; }
.market-popup .market-demand { color: var(--mrn-d); font-size: 15px; font-weight: 700; }
.wanted-popup .market-kind, .wanted-popup .market-demand { color: #1d4ed8; }
.market-popup button { width: 100%; min-height: 36px; margin-top: 7px; padding: 7px 10px; }
.sheet-backdrop { position: fixed; z-index: 1990; inset: 0; background: rgba(25,15,18,.48); backdrop-filter: blur(2px); }
.sheet-backdrop[hidden] { display: none; }
.detail-sheet { position: fixed; z-index: 2000; top: 0; right: 0; width: min(460px, 100%); height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding: 28px 24px max(38px, env(safe-area-inset-bottom)); background: var(--paper); box-shadow: -16px 0 44px rgba(34,30,32,.22); transform: translateX(105%); transition: transform .22s ease; }
.detail-sheet[hidden] { display: none; }
.detail-sheet.open { transform: translateX(0); }
.sheet-close { position: sticky; z-index: 2; top: 0; float: right; width: 40px; min-height: 40px; border-radius: 50%; padding: 0; font-size: 25px; line-height: 1; }
.sheet-heading { padding: 18px 48px 18px 0; border-bottom: 1px solid var(--line); }
.sheet-kicker { color: var(--mrn); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.sheet-heading h2 { margin: 5px 0 4px; color: var(--mrn-d); font-family: 'Cormorant Garamond', Georgia, serif; font-size: 30px; line-height: 1.08; }
.sheet-heading p { margin: 0; color: var(--muted); }
.detail-price { margin: 18px 0 5px; color: var(--mrn-d); font-size: 24px; font-weight: 700; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 18px 0; border: 1px solid var(--line); background: var(--line); }
.detail-meta div { padding: 11px; background: #fff; }
.detail-meta span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.detail-meta strong { display: block; margin-top: 2px; }
.detail-actions { display: grid; gap: 8px; }
.seller-form { display: grid; gap: 13px; padding-top: 18px; }
.seller-form label { font-size: 12px; }
.seller-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dimensions-grid { grid-template-columns: 1fr 1fr 1fr; }
.custom-size-fields[hidden] { display: none; }
.document-confirmation { display: flex; grid-template-columns: none; align-items: center; gap: 8px; min-height: 40px; padding: 9px 10px; border: 1px solid #D9C4C9; border-radius: 10px; color: var(--mrn-d); background: var(--rose); }
.document-confirmation[hidden] { display: none; }
.document-confirmation input { flex: 0 0 auto; width: 18px; min-height: 18px; margin: 0; accent-color: var(--mrn); }
.offer-form { display: grid; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.offer-form[hidden] { display: none; }
.offer-evidence { display: grid; gap: 8px; padding: 10px; border: 1px solid #D9C4C9; border-radius: 9px; background: var(--rose); }
.offer-evidence>span { color: var(--mrn-d); font-size: 12px; font-weight: 700; }
.quick-picks { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
.quick-picks button { min-height: 34px; padding: 6px 4px; font-size: 11px; }
.choice-fieldset { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.choice-fieldset legend { padding: 0 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-chips label { display: inline-flex; grid-template-columns: none; align-items: center; gap: 5px; min-height: 34px; padding: 6px 9px; border: 1px solid #D8CCC2; border-radius: 999px; color: var(--ink); background: var(--paper); cursor: pointer; }
.choice-chips input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--mrn); }
.house-fields { display: grid; gap: 11px; padding-top: 2px; }
.house-fields[hidden] { display: none; }
.house-fields h3 { margin: 5px 0 0; color: var(--mrn-d); font-family: 'Cormorant Garamond', Georgia, serif; font-size: 22px; }
.house-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.verification-note { margin-top: 14px; padding: 13px; border: 1px solid #D9C4C9; border-radius: 10px; background: var(--rose); color: var(--mrn-d); }
.ownership-upload { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ownership-upload input { padding: 7px; background: var(--paper); }
.field-note { color: var(--muted); font-size: 10px; font-weight: 400; }
.listing-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.listing-media img,.listing-media video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #1E191A; }
.account-form { display: grid; gap: 12px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.account-form[hidden], .account-summary[hidden], .account-activity[hidden] { display: none; }
.account-summary { display: grid; gap: 3px; margin-top: 16px; padding: 13px; border: 1px solid #D9C4C9; border-radius: 11px; background: var(--rose); }
.account-summary strong { color: var(--mrn-d); }
.account-summary span { color: var(--muted); font-size: 12px; }
.consent-check { display: flex; grid-template-columns: none; align-items: flex-start; gap: 8px; color: var(--ink); font-weight: 500; }
.consent-check input { flex: 0 0 auto; width: 18px; min-height: 18px; margin-top: 1px; accent-color: var(--mrn); }
.account-activity { display: grid; gap: 9px; margin-top: 16px; }
.activity-counts { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.activity-counts span { display: grid; place-items: center; min-height: 62px; padding: 8px 4px; color: var(--mrn-d); background: #fff; font-size: 18px; font-weight: 700; }
.activity-counts small { display: block; color: var(--muted); font-size: 9px; font-weight: 500; text-align: center; }
.activity-list { display: grid; gap: 10px; margin-top: 4px; }
.activity-card { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.activity-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.activity-card-head strong { color: var(--ink); }
.activity-card-head span { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; color: var(--mrn-d); background: var(--rose); font-size: 10px; font-weight: 700; text-transform: capitalize; }
.activity-card p,.activity-note { margin: 0; color: var(--muted); font-size: 12px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.account-actions button { flex: 1 1 120px; min-height: 36px; margin: 0; padding: 7px 9px; font-size: 11px; }
.account-actions .secondary-button { margin: 0; }
.dashboard-money-form,.counter-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 7px; padding-top: 8px; border-top: 1px solid var(--line); }
.counter-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
.counter-form label:first-child,.counter-form button { grid-column: 1 / -1; }
.dashboard-money-form input,.counter-form input,.counter-form select { min-height: 38px; padding: 7px 9px; }
.dashboard-money-form button,.counter-form button { min-height: 38px; padding: 7px 10px; }
.negotiation-history { display: grid; gap: 5px; max-height: 180px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.negotiation-history li { display: grid; gap: 1px; padding: 7px 8px; border-left: 3px solid var(--gold); background: var(--paper); font-size: 11px; }
.negotiation-history span { color: var(--muted); }
.policy-pending { padding: 9px; border: 1px solid #E6C56F; border-radius: 8px; color: #6b4300; background: #fff8df; font-size: 11px; }
.wanted-detail-list { display: grid; gap: 10px; margin-top: 16px; }
.wanted-detail-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.wanted-detail-card div { display: grid; }
.wanted-detail-card span,.wanted-detail-card p { margin: 0; color: var(--muted); font-size: 11px; }
.wanted-detail-card button { grid-column: 1 / -1; min-height: 38px; }
.secondary-button { width: 100%; margin-top: 14px; color: var(--mrn-d); background: #fff; border: 1px solid #D8CCC2; }
.secondary-button:hover { color: #fff; background: var(--mrn); }

@media (max-width: 960px) {
  .wanted-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wanted-grid button { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 50px;
    padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  }
  .eyebrow { margin: 0; font-size: 9px; }
  h1 { overflow: hidden; font-size: clamp(18px, 5.4vw, 22px); text-overflow: ellipsis; white-space: nowrap; }
  .private-badge { display: none; }
  .topbar-actions { margin-left: auto; }
  .topbar .account-button { min-width: 0; min-height: 40px; max-width: 88px; padding: 6px 11px; font-size: 12px; }
  .account-label-wide { display: none; }
  .account-label-small { display: inline; }
  .mode-tabs { padding: 0; }
  .mode-tab { min-height: 48px; padding: 7px 3px; font-size: 11px; line-height: 1.18; white-space: normal; }
  .controls {
    flex: 0 0 auto;
    min-height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 7px max(8px, env(safe-area-inset-right)) 10px max(8px, env(safe-area-inset-left));
  }
  .map-shell { flex: 0 0 auto; height: clamp(320px, 52dvh, 520px); min-height: 320px; }
  .mode-intro { align-items: center; min-height: 24px; margin-bottom: 5px; }
  .mode-intro strong { font-size: 17px; line-height: 1.1; }
  .mode-intro span { display: none; }
  .search-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .wanted-grid { grid-template-columns: 1fr 1fr; }
  .wanted-grid button { grid-column: 1 / -1; }
  .wanted-grid, .seller-form { gap: 7px; }
  .seller-grid, .house-numbers { grid-template-columns: 1fr 1fr; gap: 7px; }
  .dimensions-grid { grid-template-columns: 1fr 1fr; }
  .dimensions-grid label:last-child { grid-column: 1 / -1; }
  .choice-chips { gap: 5px; }
  .choice-chips label { min-height: 31px; padding: 5px 7px; font-size: 10px; }
  .money-input { grid-template-columns: auto minmax(0, 1fr); }
  .currency-prefix { min-height: 39px; padding-inline: 8px; }
  label { gap: 2px; font-size: 10px; }
  input, select { min-height: 46px; font-size: 16px; }
  button { min-height: 44px; }
  .combobox input { padding-right: 48px; }
  .combobox input[readonly] { cursor: pointer; caret-color: transparent; user-select: none; }
  .combo-toggle { width: 44px; min-height: 44px; }
  .combo-options {
    position: fixed;
    top: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    max-height: min(54dvh, 420px);
    padding: 8px;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(34,30,32,.36);
  }
  .combo-option { min-height: 48px; padding: 11px 12px; font-size: 16px; }
  body.combo-menu-open .controls { overflow: visible; }
  .plot-field { grid-column: auto; }
  #find { grid-column: 1 / -1; padding-inline: 8px; }
  .help { display: none; }
  .message { margin-top: 5px; }
  .results { max-height: 18dvh; overflow-y: auto; margin-top: 6px; padding: 6px; }
  .actions { margin-top: 6px; }
  .actions > * { flex: 1 1 calc(50% - 4px); justify-content: center; min-width: 0; text-align: center; }
  .listing-start-card { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .listing-start-card > button { width: 100%; }
  .listing-start-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .listing-start-actions button, .listing-start-actions .secondary-button { width: 100%; min-width: 0; margin: 0; padding-inline: 7px; }
  .legend { left: 8px; bottom: max(8px, env(safe-area-inset-bottom)); max-width: 160px; padding: 6px 8px; font-size: 10px; }
  .leaflet-top { top: max(0px, env(safe-area-inset-top)); }
  .leaflet-right { right: max(0px, env(safe-area-inset-right)); }
  .leaflet-left { left: max(0px, env(safe-area-inset-left)); }
  .leaflet-bottom { bottom: max(0px, env(safe-area-inset-bottom)); }
  .leaflet-control-zoom { z-index: 900; margin-top: 8px !important; margin-left: 8px !important; }
  .leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 44px !important; font-size: 22px !important; }
  .leaflet-control-layers-toggle { width: 44px !important; height: 44px !important; background-position: center !important; }
  .leaflet-control-attribution { max-width: 72vw; overflow: hidden; white-space: nowrap; }
  .market-popup { min-width: min(210px, 64vw); }
  .detail-sheet {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(88svh, 720px);
    height: min(88dvh, 720px);
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    padding: 14px max(14px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 38px rgba(34,30,32,.24);
    transform: translateY(105%);
  }
  .detail-sheet.open { transform: translateY(0); }
  .sheet-heading { padding-top: 8px; }
  .sheet-heading h2 { font-size: 26px; }
  .detail-price { margin-top: 13px; font-size: 21px; }
  .detail-meta { margin: 12px 0; }
  .activity-counts span { min-height: 54px; font-size: 16px; }
  .quick-picks { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-money-form { grid-template-columns: 1fr; }
  .dashboard-money-form button { width: 100%; }
  .keyboard-open .topbar { display: none; }
  .keyboard-open .mode-tab { min-height: 40px; }
  .keyboard-open .controls { max-height: none; }
  .keyboard-open .map-shell { min-height: 320px; }
}

@media (pointer: coarse) {
  input, select { font-size: 16px; }
  .combobox input { padding-right: 48px; }
  .combobox input[readonly] { cursor: pointer; caret-color: transparent; user-select: none; }
  .combo-toggle { width: 44px; min-height: 44px; }
  .combo-options {
    position: fixed;
    top: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    max-height: min(54dvh, 420px);
    padding: 8px;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(34,30,32,.36);
  }
  .combo-option { min-height: 48px; padding: 11px 12px; font-size: 16px; }
  body.combo-menu-open .controls { overflow: visible; }
}

@media (max-width: 430px) {
  .seller-grid, .house-numbers, .dimensions-grid { grid-template-columns: 1fr; }
  .dimensions-grid label:last-child { grid-column: auto; }
  .rate-values strong { font-size: 12px; }
}

@media (max-height: 700px) and (min-width: 701px) {
  .topbar { padding-top: 8px; padding-bottom: 8px; }
  .eyebrow { display: none; }
  h1 { font-size: 23px; }
  .mode-tab { min-height: 42px; }
  .controls { padding-top: 8px; padding-bottom: 7px; }
  .mode-intro { margin-bottom: 6px; }
  .help { margin-top: 4px; }
}

@media (max-height: 520px) and (max-width: 900px) {
  .topbar { display: none; }
  .mode-tab { min-height: 40px; }
  .controls { flex: 0 0 auto; max-height: none; overflow-x: hidden; overflow-y: visible; }
  .map-shell { flex: 0 0 auto; height: 300px; min-height: 300px; }
  .leaflet-control-zoom a { width: 42px !important; height: 42px !important; line-height: 42px !important; }
  .keyboard-open .mode-tabs { display: none; }
  .keyboard-open .controls { max-height: none; }
  .keyboard-open .map-shell { min-height: 300px; }
}

.admin-page { display: block; min-height: 100dvh; overflow: auto; }
.admin-page .topbar { position: sticky; z-index: 20; top: 0; }
.admin-map-link { padding: 8px 12px; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; color: #fff; text-decoration: none; }
.admin-main { display: block; width: min(1180px,100%); min-height: auto; padding: 24px clamp(14px,3vw,34px) 60px; }
.admin-main h2,.admin-main h3 { color: var(--mrn-d); font-family: 'Cormorant Garamond',Georgia,serif; }
.admin-login { max-width: 520px; margin: 5vh auto; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 40px rgba(74,13,24,.12); }
.admin-login form { display: grid; gap: 12px; }
.admin-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.admin-toolbar h2,.admin-toolbar p { margin: 0; }
.admin-toolbar>div:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-toolbar .secondary-button { width: auto; margin: 0; }
.admin-counts { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin: 22px 0; }
.admin-counts span { display: grid; gap: 2px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.admin-counts strong { color: var(--mrn-d); font-size: 23px; }
.admin-counts small { color: var(--muted); text-transform: capitalize; }
.admin-queue { margin-top: 24px; }
.admin-queue>div { display: grid; gap: 8px; }
.queue-card { display: grid; grid-template-columns: minmax(180px,1fr) minmax(180px,2fr) auto; align-items: center; gap: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.queue-card>div:first-child { display: grid; }
.queue-card span,.queue-card p { color: var(--muted); font-size: 12px; }
.queue-card p { margin: 0; }
.queue-actions { display: flex; gap: 6px; }
.queue-actions .secondary-button { width: auto; margin: 0; }
.queue-state { color: var(--mrn-d)!important; font-weight: 700; text-transform: capitalize; }
.queue-empty { color: var(--muted); }
@media (max-width:700px){.admin-main{padding-top:14px}.admin-toolbar{display:grid}.admin-counts{grid-template-columns:repeat(3,1fr)}.queue-card{grid-template-columns:1fr}.queue-actions button{flex:1}}

/* Public marketplace launch display contract. */
.headline { min-width: 0; }
.head-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 6px 0 0; color: #F3D8DD; font-size: clamp(.72rem, 1.4vw, .9rem); line-height: 1.35; }
.head-tag span { display: inline-flex; align-items: center; }
.head-tag span + span::before { content: "·"; margin: 0 9px; color: var(--gold-l); font-weight: 700; }
.head-tag b { color: #fff; }
.mode-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.08; overflow-wrap: normal; }
.mode-tab strong { font-size: clamp(.84rem, 1.8vw, 1rem); white-space: nowrap; }
.mode-tab span { font-size: clamp(.59rem, 1.1vw, .68rem); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .72; white-space: nowrap; }
.mode-tab.active span { opacity: .84; }

.wanted-block-fieldset { grid-column: span 2; min-width: 0; margin: 0; padding: 9px 10px; border: 1px solid #D8CCC2; border-radius: 10px; background: #fff; }
.wanted-block-fieldset legend, .wanted-preferences legend { padding: 0 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.wanted-block-fieldset legend span, .wanted-preferences legend span { font-weight: 400; }
.wanted-block-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(62px,1fr)); gap: 6px; max-height: 128px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.wanted-block-options > p { grid-column: 1 / -1; margin: 3px; color: var(--muted); font-size: 12px; font-weight: 400; }
.wanted-block-options label { display: flex; align-items: center; gap: 5px; min-height: 34px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--paper); cursor: pointer; }
.wanted-block-options input { flex: 0 0 auto; width: 16px; min-height: 16px; margin: 0; accent-color: #2563eb; }
.wanted-block-summary { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.wanted-preferences { grid-column: 1 / -1; }
.wanted-submit { width: 100%; margin-top: 10px; }
.multi-rate-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.multi-rate-list div { display: grid; grid-template-columns: minmax(80px,.6fr) minmax(0,1.4fr); gap: 8px; padding: 7px 9px; background: #fff; font-size: 11px; }
.multi-rate-list span { color: var(--muted); text-align: right; }

.assessment-prompt { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; padding: 11px 13px; border: 1px solid var(--gold); border-radius: 10px; background: #FFF9EE; }
.assessment-prompt div { min-width: 0; }
.assessment-prompt strong { color: var(--mrn-d); }
.assessment-prompt p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.assessment-prompt button { flex: 0 0 auto; width: auto; margin: 0; }
.assessment-prompt.compact { margin-top: 12px; }
textarea { width: 100%; max-width: 100%; resize: vertical; border: 1px solid #D8CCC2; border-radius: 10px; padding: 10px 11px; color: var(--ink); background: #fff; font: inherit; }
textarea:focus { border-color: var(--gold); outline: 3px solid rgba(194,154,60,.25); outline-offset: 1px; }

.mapping-note { padding: 11px 12px; border: 1px solid #2563eb; border-left-width: 4px; border-radius: 10px; color: #1e3a8a; background: #eff6ff; font-size: 12px; font-weight: 600; }
.mapping-note[hidden] { display: none; }
.seller-form.file-stage .mapped-only { display: none; }
.seller-form.file-stage #seller-house-fields { display: none; }

.wa-login { display: grid; gap: 10px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.wa-login[hidden], .wa-login-wait[hidden] { display: none; }
.wa-login-wait { display: grid; gap: 8px; }
.wa-login-wait p { margin: 0; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 9px 18px; border: 0; border-radius: 9px; color: #fff; background: var(--mrn); font-weight: 700; text-decoration: none; }
.wa-green { background: linear-gradient(160deg,#1FAF5E,#128C7E); text-align: center; }

.agent-call { display: grid; gap: 9px; margin-top: 12px; padding: 13px 14px; border: 1px solid #D6C9BE; border-left: 4px solid var(--gold); border-radius: 12px; background: var(--paper); }
.agent-call h3 { margin: 0; color: #8A6B1F; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; }
.agent-call p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.agent-btn { justify-self: start; }
.agent-called { margin-top: 12px; padding: 11px 13px; border: 1px solid #15803D; border-radius: 10px; color: #0F5F2E; background: #EAF6EE; font-size: .84rem; }
.commission-note { padding: 9px; border: 1px solid var(--gold); border-radius: 8px; color: var(--mrn-d); background: #FFF9EE; font-size: 11px; }
.counter-form .consent-check { grid-column: 1 / -1; }
.consent-check { margin: 8px 0 2px; padding: 10px 11px; border: 1px solid #D6C9BE; border-radius: 10px; background: var(--rose); font-size: .82rem; line-height: 1.45; }
.consent-check a { color: var(--mrn); font-weight: 700; }

.about { padding: clamp(30px,7vw,60px) clamp(14px,3vw,30px); border-top: 3px solid var(--gold); color: #F6DDE2; text-align: center; background: radial-gradient(120% 140% at 85% -20%,rgba(194,154,60,.22),transparent 55%),linear-gradient(160deg,#2E0A12,var(--mrn-d) 55%,#5C0E1F); }
.about-in { width: min(920px,100%); margin-inline: auto; }
.about-kicker { margin: 0 0 12px; color: var(--gold-l); font-size: clamp(.62rem,2vw,.72rem); font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.about-big { margin: 0 0 12px; color: #fff; font-family: 'Cormorant Garamond',Georgia,serif; font-size: clamp(2rem,8vw,3.6rem); line-height: 1.04; }
.about-big em { color: var(--gold-l); }
.about-one { max-width: 44ch; margin: 0 auto clamp(20px,5vw,30px); color: #EBC9D0; font-size: clamp(.92rem,2.8vw,1.08rem); }
.about-tiles { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 0 0 clamp(16px,4vw,22px); }
.tile { display: grid; justify-items: center; gap: 3px; padding: clamp(13px,3vw,18px) 10px; border: 1px solid rgba(231,197,112,.3); border-radius: 14px; background: rgba(255,255,255,.06); }
.tile i { color: var(--gold); font-style: normal; }
.tile b { color: #fff; font-size: clamp(1rem,3.4vw,1.2rem); }
.tile span { color: #E3B9C2; font-size: clamp(.66rem,2.2vw,.74rem); }
.about-scale { margin: 0; color: #D9A5AF; font-size: clamp(.62rem,2vw,.74rem); letter-spacing: .06em; }

.how { padding: clamp(26px,6vw,48px) clamp(14px,3vw,30px); border-top: 1px solid var(--line); background: var(--paper); }
.how-in { width: min(1180px,100%); margin-inline: auto; }
.how h2 { margin: 0 0 6px; color: var(--mrn-d); font-family: 'Cormorant Garamond',Georgia,serif; font-size: clamp(1.5rem,4.4vw,2.1rem); }
.how-lead { max-width: 62ch; margin: 0 0 clamp(20px,4vw,28px); color: var(--muted); }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 12px; margin: 0 0 clamp(22px,5vw,32px); padding: 0; list-style: none; counter-reset: steps; }
.how-steps li { position: relative; padding-left: 40px; counter-increment: steps; }
.how-steps li::before { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--mrn); content: counter(steps); font-weight: 700; }
.how-steps b, .how-steps span { display: block; }
.how-steps span { color: var(--muted); font-size: .87rem; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: 14px; }
.how-card { padding: clamp(14px,3vw,20px); border: 1px solid #D6C9BE; border-radius: 12px; background: #fff; }
.how-card h3 { margin: 0 0 10px; color: var(--mrn); font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; }
.how-card p { margin: 0 0 9px; font-size: .89rem; line-height: 1.55; }
.how-small { color: var(--muted); font-size: .78rem !important; }
.how-fee { border-color: var(--mrn); background: var(--rose); }
.fee-big { display: flex; align-items: baseline; gap: 9px; margin: 0 0 4px !important; color: var(--mrn); font-size: 1.9rem !important; font-weight: 700; line-height: 1.1 !important; }
.fee-big span { color: var(--ink); font-size: .84rem; }
.fee-note { margin-top: 11px !important; color: var(--muted); font-size: .84rem !important; }

.terms-modal { position: fixed; z-index: 3000; inset: 0; display: none; }
.terms-modal:target { display: grid; place-items: center; padding: 16px; }
.terms-backdrop { position: absolute; inset: 0; background: rgba(25,15,18,.58); backdrop-filter: blur(2px); }
.terms-card { position: relative; width: min(680px,100%); max-height: min(84dvh,780px); overflow-y: auto; overscroll-behavior: contain; padding: clamp(18px,4vw,28px); border-top: 4px solid var(--gold); border-radius: 16px; background: var(--paper); box-shadow: 0 24px 70px -20px rgba(34,30,32,.6); }
.terms-card h2 { margin: 0 0 4px; color: var(--mrn-d); font-family: 'Cormorant Garamond',Georgia,serif; font-size: clamp(1.3rem,4vw,1.7rem); }
.terms-v { margin: 0 0 16px; color: var(--muted); font-size: .68rem; letter-spacing: .06em; }
.terms-list { display: grid; gap: 9px; margin: 0; padding-left: 1.4rem; }
.terms-list li { font-size: .87rem; line-height: 1.5; }
.terms-list li::marker { color: var(--mrn); font-weight: 700; }
.terms-x { position: absolute; top: 10px; right: 12px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--mrn-d); background: var(--rose); font-size: 1.3rem; line-height: 1; text-decoration: none; }
.terms-done { display: block; margin-top: 16px; padding: 12px; border-radius: 10px; color: #fff; background: linear-gradient(160deg,var(--mrn),var(--mrn-d)); font-weight: 700; text-align: center; text-decoration: none; }

.site-footer { display: grid; justify-items: center; gap: 10px; padding: clamp(22px,5vw,34px) clamp(14px,3vw,30px); border-top: 3px solid var(--gold); color: #F6DDE2; background: linear-gradient(150deg,var(--mrn-d),var(--mrn)); text-align: center; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.site-footer a, .footer-link { min-height: auto; margin: 0; padding: 0; border: 0; color: var(--gold-l); background: transparent; font-size: .86rem; font-weight: 700; text-decoration: none; }
.site-footer a:hover, .footer-link:hover { color: #fff; background: transparent; text-decoration: underline; }
.commission-line { padding-top: 9px; border-top: 1px solid rgba(246,221,226,.22); color: #E3B9C2; font-size: .76rem; }

@media (max-width: 700px) {
  .topbar { row-gap: 4px; }
  .topbar > .headline { display: contents; }
  .headline .eyebrow, .headline h1 { grid-column: 1; }
  .head-tag { grid-column: 1 / -1; margin-top: 3px; font-size: .7rem; }
  .topbar-actions { grid-column: 2; grid-row: 1 / span 2; }
  .mode-tab { padding: 7px 2px; }
  .controls { padding: 11px max(10px,env(safe-area-inset-right)) 12px max(10px,env(safe-area-inset-left)); }
  .wanted-block-fieldset, .wanted-preferences { grid-column: 1 / -1; }
  .assessment-prompt { display: grid; }
  .assessment-prompt button { width: 100%; }
  .about-tiles { grid-template-columns: 1fr 1fr; }
  .agent-btn { justify-self: stretch; }
  .multi-rate-list div { grid-template-columns: 1fr; gap: 2px; }
  .multi-rate-list span { text-align: left; }
}

@media (max-width: 430px) {
  .head-tag span + span::before { margin: 0 5px; }
  .wanted-grid { grid-template-columns: 1fr; }
  .wanted-block-fieldset, .wanted-preferences { grid-column: 1; }
  .wanted-block-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .about { padding-inline: 12px; }
}
