/* Sample estate map. Phone first: the page fills the screen and never scrolls sideways;
   the map takes the middle, the plot card sits under it. From 900 px wide the controls move
   into a sidebar on the left and the map fills the rest. DEET look: ink, bone and paper,
   Bricolage for headlines, Geist for reading. The only other colours are the plot statuses,
   and each status also has its own pattern and its name. */
@font-face { font-family: "Bricolage Grotesque"; src: url("brand/fonts/Bricolage-Grotesque.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Geist"; src: url("brand/fonts/Geist.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #0b0b0e;
  --bone: #f3f1ea;
  --paper: #ece8df;
  --paper2: #e2ddd2;
  --mute: #6b675f;
  --line: rgba(11, 11, 14, .17);
  --line-soft: rgba(11, 11, 14, .1);
  --land: #e4dfd3;
  --road: #fbfaf6;
  --green: #cfdcba;
  --tree: #b3c79b;
  --tree-edge: #95ad7c;
  --available: #bfdca6;
  --available-edge: #5f8c46;
  --reserved-edge: #a77c17;
  --sold-edge: #6f6a61;
  --f-head: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gl: max(16px, env(safe-area-inset-left, 0px));
  --gr: max(16px, env(safe-area-inset-right, 0px));
  --gb: max(14px, env(safe-area-inset-bottom, 0px));
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--bone); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
h1, h2 { font-family: var(--f-head); font-weight: 700; letter-spacing: -.04em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Buttons */
.cta, .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 16px; font-weight: 600; font-size: 15.5px; white-space: nowrap; transition: background .15s, transform .15s; }
.cta { background: var(--ink); color: var(--bone); }
.cta:hover { background: #26262c; }
.ghost { background: var(--paper2); }
.ghost:hover { background: #d6d0c3; }
.cta:active, .ghost:active { transform: scale(.98); }
.ghost[aria-pressed="true"], .ghost.on { background: var(--ink); color: var(--bone); }
.icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--paper2); }
.icon:hover { background: #d6d0c3; }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.link { min-height: 44px; padding: 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.wide-btn { width: 100%; }

/* Layout: phone */
.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; }
.side { display: contents; }
.desk-only { display: none; }
.top { grid-row: 1; display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top, 0px)) var(--gr) 8px var(--gl); }
.mark { width: 64px; height: auto; display: block; flex: none; }
.title { font-family: var(--f-head); font-weight: 700; font-size: 20px; letter-spacing: -.04em; line-height: 1; white-space: nowrap; flex: 1; min-width: 0; }
.top .ghost { min-height: 44px; padding: 0 16px; font-size: 15px; }

.legend { grid-row: 2; display: flex; gap: 6px; padding: 2px var(--gr) 10px var(--gl); }
.chip { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 8px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line-soft); font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: background .15s, opacity .15s; }
.chip .n { color: var(--mute); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="false"] { background: transparent; color: var(--mute); border-style: dashed; }
.chip[aria-pressed="false"] .sw { opacity: .35; }
.chip[aria-pressed="false"] span:not(.n) { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.sw { width: 18px; height: 18px; flex: none; display: block; }

.mapwrap { grid-row: 3; position: relative; overflow: hidden; background: var(--bone); border-top: 1px solid var(--line-soft); }
.map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.map.dragging { cursor: grabbing; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--mute); }

.card { grid-row: 4; background: var(--paper); border-top: 1px solid var(--line); padding: 16px var(--gr) var(--gb) var(--gl); max-height: 58dvh; overflow-y: auto; overscroll-behavior: contain; }
.idle h2 { font-size: 24px; line-height: 1.08; margin-bottom: 6px; }
.idle p { font-size: 15.5px; }
.idle .note { margin-top: 10px; font-size: 14px; color: var(--mute); }
.legal { margin-top: 4px; font-size: 12px; color: var(--mute); }
.dhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dhead h2 { font-size: 26px; line-height: 1.05; }
.dhead h2:focus { outline: none; }
.dhead .icon { margin-left: auto; }
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 11px 0 8px; border-radius: 999px; background: var(--bone); border: 1px solid var(--line-soft); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.status .sw { width: 16px; height: 16px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0 0 14px; }
.facts div { min-width: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: 14px; color: var(--mute); }
.facts dd { margin: 0; font-size: 16.5px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.35; }
.facts dd small { display: block; font-size: 14px; font-weight: 400; color: var(--mute); }
.dnote { margin: -4px 0 14px; font-size: 15px; }
.detail .wide-btn + .wide-btn { margin-top: 8px; }

/* Size and price: a sheet on phones */
.filters { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: var(--bone); border-radius: 24px 24px 0 0; padding: 18px var(--gr) var(--gb) var(--gl); box-shadow: 0 -10px 40px rgba(11, 11, 14, .18); transform: translateY(105%); visibility: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s; max-height: 86dvh; overflow-y: auto; }
.filters.open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-head h2 { font-size: 24px; line-height: 1.1; }
.scrim { position: fixed; inset: 0; z-index: 19; background: rgba(11, 11, 14, .32); }
.field { display: block; margin: 0 0 12px; border: 0; padding: 0; min-width: 0; }
.field > span, .field legend { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 5px; padding: 0; }
select, input[type=text], input[type=tel], input[type=email], textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fbfaf6; font-size: 16px; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0b0e' 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 12px center; background-size: 18px; }
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fcount { margin: 2px 0 12px; font-size: 15px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.row > * { flex: 1 1 auto; }

/* Map furniture */
.north { position: absolute; top: 10px; right: var(--gr); width: 44px; height: 44px; border-radius: 50%; background: rgba(243, 241, 234, .92); border: 1px solid var(--line); pointer-events: none; }
.north svg { width: 100%; height: 100%; display: block; transform-origin: 50% 50%; }
.north path { fill: var(--ink); }
.north text { font: 700 10px var(--f-body); fill: var(--ink); }
.scale { position: absolute; left: var(--gl); bottom: 12px; display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; background: rgba(243, 241, 234, .92); border: 1px solid var(--line-soft); font-size: 13px; font-weight: 600; pointer-events: none; font-variant-numeric: tabular-nums; }
.scale #scaleBar { display: block; height: 8px; border: 2px solid var(--ink); border-top: 0; }
.zoom { position: absolute; right: var(--gr); bottom: 12px; display: flex; flex-direction: column; border-radius: 16px; background: rgba(243, 241, 234, .95); border: 1px solid var(--line); overflow: hidden; }
.zoom button { width: 46px; height: 46px; display: grid; place-items: center; }
.zoom button + button { border-top: 1px solid var(--line-soft); }
.zoom button:hover { background: var(--paper2); }
.zoom button:disabled { color: rgba(11, 11, 14, .3); cursor: default; background: none; }
.zoom button:focus-visible { outline-offset: -3px; }
.zoom svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Map drawing (units are metres; strokes stay in screen pixels) */
.map .land { fill: var(--land); }
.map .road { fill: var(--road); stroke: var(--line); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.map .green { fill: var(--green); stroke: rgba(95, 140, 70, .35); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.map .tree { fill: var(--tree); stroke: var(--tree-edge); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.map .building { fill: #cbc5b9; stroke: rgba(11, 11, 14, .4); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.map .fence { fill: none; stroke: var(--ink); stroke-width: 1.5px; stroke-dasharray: 7 4; vector-effect: non-scaling-stroke; }
.map .gate { stroke: var(--ink); stroke-width: 5px; vector-effect: non-scaling-stroke; stroke-linecap: square; }
.map .flabel { font-family: var(--f-body); font-weight: 600; fill: #4d4a43; }
.map .rlabel { font-family: var(--f-body); font-weight: 500; fill: var(--mute); }
.map.far .rlabel { display: none; }
.f-available { fill: var(--available); stroke: var(--available-edge); stroke-width: 1px; }
.f-reserved { fill: url(#pat-reserved); stroke: var(--reserved-edge); stroke-width: 1px; }
.f-sold { fill: url(#pat-sold); stroke: var(--sold-edge); stroke-width: 1px; }
.map .shape { stroke-width: 1px; vector-effect: non-scaling-stroke; transition: opacity .2s; }
.map .plot { cursor: pointer; outline: none; transition: opacity .2s; }
.map .plot text { font-family: var(--f-body); font-weight: 700; fill: var(--ink); paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.map .plot.st-available text { stroke: var(--available); }
.map .plot.st-reserved text { stroke: #f2d68f; }
.map .plot.st-sold text { stroke: #d6d1c7; fill: #3f3c36; }
.map .plot:hover .shape { stroke: var(--ink); }
.map .plot:focus-visible .shape { stroke: var(--ink); stroke-width: 3px; stroke-dasharray: 5 3; }
.map .plot.off { opacity: .16; pointer-events: none; }
.map .sel { fill: none; stroke: var(--ink); stroke-width: 3.5px; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .sel-halo { fill: none; stroke: var(--bone); stroke-width: 8px; vector-effect: non-scaling-stroke; pointer-events: none; }

/* Enquiry */
.enq { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px 20px calc(16px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 24px; background: var(--bone); color: var(--ink); box-shadow: 0 20px 60px rgba(11, 11, 14, .28); overflow-y: auto; overscroll-behavior: contain; }
.enq::backdrop { background: rgba(11, 11, 14, .4); }
.enq .dhead h2 { font-size: 24px; }
.enq .sum { margin: -4px 0 16px; color: var(--mute); font-size: 15px; }
.radio { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; cursor: pointer; }
.radio input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); flex: none; }
.sample { margin: 2px 0 14px; font-size: 14px; color: var(--mute); }
.msg { white-space: pre-wrap; word-break: break-word; -webkit-user-select: text; user-select: text; background: #fbfaf6; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-size: 15.5px; line-height: 1.5; margin-bottom: 8px; cursor: text; }
.copied { min-height: 22px; font-size: 14px; color: var(--mute); margin-bottom: 6px; }
@media (max-width: 600px) {
  .enq { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: 92dvh; }
}

.sheet-note { margin-top: 16px; font-size: 14px; color: var(--mute); }

/* Short phones: give the map the room, keep the idle card to one line of help */
@media (max-width: 899px) and (max-height: 760px) {
  .idle h2, .idle .note, .idle .legal { display: none; }
  .idle p { font-size: 15px; }
  .card { padding-top: 12px; }
}

/* Very narrow phones */
@media (max-width: 370px) {
  .chip .n { display: none; }
  .title { font-size: 18px; }
}

/* Desktop: sidebar and a big map */
@media (min-width: 900px) {
  .app { grid-template-columns: 400px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 18px; grid-row: 1; grid-column: 1; overflow-y: auto; padding: 26px 28px 22px; border-right: 1px solid var(--line); background: var(--bone); }
  .phone-only { display: none !important; }
  .desk-only { display: block; }
  .top { padding: 0; }
  .mark { width: 68px; }
  .title { display: none; }
  .intro h1 { font-size: 44px; line-height: 1.02; margin-bottom: 10px; }
  .intro p { font-size: 16.5px; max-width: 34rem; }
  .legend { padding: 0; }
  .chip { flex: 1 1 auto; padding: 0 9px; font-size: 14px; gap: 6px; }
  .side { scroll-padding: 22px; }
  .count { font-size: 16px; font-weight: 600; }
  .filters { position: static; transform: none; visibility: visible; box-shadow: none; border-radius: 0; padding: 0; background: none; max-height: none; overflow: visible; transition: none; }
  .sheet-head { margin-bottom: 8px; }
  .sheet-head h2 { font-size: 22px; }
  .card { border: 1px solid var(--line-soft); border-radius: 22px; padding: 18px 20px; max-height: none; overflow: visible; }
  .foot { margin-top: auto; padding-top: 6px; }
  .foot .note { font-size: 14px; color: var(--mute); }
  .mapwrap { grid-row: 1; grid-column: 2; border-top: 0; }
  .north { top: 18px; right: 18px; }
  .zoom { right: 18px; bottom: 18px; }
  .scale { left: 18px; bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, .filters, .filters.open { transition: none !important; }
}
