/* New Homes WA skin (colours from newhomeswa.com.au). Swap the tokens below (or SITE.theme in config.js) to rebrand. */
:root {
  --ink: #080808;
  --ink-2: #3b4652;
  --muted: #6a7480;
  --line: #e2e0cf;
  --line-2: #eeedde;
  --paper: #f6f6e7;
  --card: #ffffff;
  --brand: #080808;
  --brand-ink: #ffffff;
  --accent: #137f5c;
  --accent-soft: #e2efe7;
  --gold: #f8c314;
  --ok: #23774a;
  --ok-soft: #e3f3e8;
  --hold: #a8650c;
  --hold-soft: #fbefdc;
  --check: #5d6672;
  --check-soft: #eceef1;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22,33,43,.05), 0 6px 20px rgba(22,33,43,.06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --top-h: 0px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 var(--font); color: var(--ink); background: var(--paper); font-feature-settings: 'tnum' 1, 'cv11' 1; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }

/* Header */
.top { position: relative; z-index: 900; background: var(--brand); color: var(--brand-ink); }
.site-name { white-space: nowrap; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; max-width: 1600px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: -.01em; font-size: 17px; }
.logo-img { height: 20px; width: auto; display: block; }
.site-name { font-weight: 500; font-size: 14px; opacity: .85; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); }
h2 { font-family: ui-serif, Georgia, 'Times New Roman', serif; font-weight: 600; }
.brand-pick { display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.1); border-radius: 999px; padding: 3px; }
.bp-label { font-size: 12px; opacity: .7; padding: 0 6px 0 8px; display: none; }
.brand-pick button { border: 0; background: none; color: inherit; padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; opacity: .8; }
.brand-pick button[aria-pressed="true"] { background: var(--card); color: var(--ink); opacity: 1; }

.search { background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line); }
.search-in { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 8px; max-width: 1600px; margin: 0 auto; }
.field { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; height: 44px; min-width: 0; }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input { border: 0; background: none; outline: none; width: 100%; min-width: 0; height: 100%; font-size: 16px; }
.field .ico { color: var(--muted); }
.field .pre { color: var(--muted); font-weight: 500; }
.grow { flex: 1 1 100%; }
.budget { flex: 1 1 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #cfcac0; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: var(--card); }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; }
.chips { display: flex; gap: 6px; padding: 0 16px 12px; max-width: 1600px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips.small { padding: 0; flex-wrap: wrap; }
.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }

.test-banner { background: #fff4cc; color: #6b4e00; text-align: center; font-size: 13px; padding: 6px 16px; border-bottom: 1px solid #f0dc9a; }

/* Layout */
.layout { max-width: 1600px; margin: 0 auto; }
.map-pane { display: none; }
.layout[data-view="map"] .list-pane { display: none; }
.layout[data-view="map"] .map-pane { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 1; }
#map { width: 100%; height: 100%; background: #e9e7e1; }
.leaflet-tile-pane { filter: saturate(.45) contrast(.98); }

.list-pane { padding: 12px 16px 96px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.summary { margin: 0; color: var(--ink-2); font-size: 14px; }
.summary b { color: var(--ink); }
.list-tools { display: flex; align-items: center; gap: 10px; }
.sort select { border: 1px solid var(--line); background: var(--card); border-radius: 10px; height: 36px; padding: 0 8px; font-size: 14px; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; user-select: none; }
.switch input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Estate card */
.estate { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.est-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line-2); }
.est-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.est-title h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.est-range { font-weight: 600; white-space: nowrap; font-size: 14px; }
.est-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.est-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.est-links a { text-decoration: none; font-weight: 500; }
.est-links a:hover { text-decoration: underline; }
.note { margin-top: 8px; font-size: 13px; padding: 7px 10px; border-radius: 9px; }
.note.warn { background: var(--bad-soft); color: var(--bad); }
.note.check { background: var(--check-soft); color: var(--ink-2); }
.note.promo { background: var(--accent-soft); color: #164e41; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 16px; background: #faf9f6; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.stage-head b { font-size: 13px; }
.stage-head .t { color: var(--ink-2); }
.stage-head details { position: relative; }
.stage-head summary { cursor: pointer; color: var(--accent); font-weight: 500; list-style: none; white-space: nowrap; }
.stage-head summary::-webkit-details-marker { display: none; }
.stage-docs { padding: 8px 16px 10px; background: #faf9f6; border-bottom: 1px solid var(--line-2); display: grid; gap: 4px; font-size: 13px; }

/* Lot row */
.lot { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; text-align: left; padding: 11px 16px; border: 0; border-bottom: 1px solid var(--line-2); background: var(--card); cursor: pointer; }
.lot:last-child { border-bottom: 0; }
.lot:hover { background: #fbfaf7; }
.lot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lot .l1 { font-weight: 600; }
.lot .l1 small { font-weight: 400; color: var(--muted); }
.lot .price { font-weight: 700; text-align: right; }
.lot .l2 { color: var(--ink-2); font-size: 13px; }
.lot .pk { text-align: right; font-size: 12.5px; color: var(--muted); }
.lot .pk b { color: var(--accent); }
.lot .l3 { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; }
.lot.flat .est-line { color: var(--muted); font-size: 12.5px; grid-column: 1 / -1; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.hold { background: var(--hold-soft); color: var(--hold); }
.badge.check { background: var(--check-soft); color: var(--check); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.tag { font-size: 12px; color: var(--ink-2); background: var(--line-2); border-radius: 6px; padding: 1px 6px; }
.tag.down { background: var(--ok-soft); color: var(--ok); }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px 20px; text-align: center; color: var(--ink-2); }
.flat-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.disclaimer { margin: 0 0 8px; max-width: 70ch; }
.foot-links { margin: 0; }

/* View toggle (phone) */
.view-toggle { position: fixed; z-index: 950; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; background: var(--ink); border-radius: 999px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.view-toggle button { border: 0; background: none; color: #fff; padding: 9px 20px; border-radius: 999px; font-weight: 600; cursor: pointer; opacity: .75; }
.view-toggle button[aria-pressed="true"] { background: #fff; color: var(--ink); opacity: 1; }

/* Map markers */
.est-pin { background: var(--brand); color: #fff; border: 2px solid #fff; border-radius: 999px; font-weight: 700; font-size: 12px; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.est-pin.none { background: #8a929b; }
.leaflet-tooltip.est-tip { font: 600 12px var(--font); border-radius: 8px; padding: 4px 8px; }
.leaflet-popup-content { font: 13px/1.4 var(--font); margin: 10px 12px; }
.leaflet-container { font-family: var(--font); }

/* Sheets */
dialog.sheet { border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; background: var(--card); color: var(--ink); box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
dialog.sheet::backdrop { background: rgba(14,20,26,.45); }
.sheet-in { display: flex; flex-direction: column; max-height: 92dvh; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; border-bottom: 1px solid var(--line-2); }
.sheet-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.sheet-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.x { border: 0; background: var(--line-2); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; flex: none; }
.sheet-body { overflow-y: auto; padding: 14px 16px 18px; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 8px; justify-content: space-between; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); }
.filters-body fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.filters-body legend, .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; display: block; }
.lbl input, .lbl select { display: block; width: 100%; margin-top: 6px; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--card); font-weight: 400; font-size: 16px; color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.filters-body > .lbl { margin-bottom: 16px; }
.check { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 15px; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }
.seg { display: flex; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 8px; border-radius: 9px; font-size: 14px; font-weight: 500; cursor: pointer; }
.seg input:checked + span { background: var(--card); box-shadow: var(--shadow); font-weight: 600; }
.seg input:disabled + span { opacity: .45; cursor: not-allowed; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* Lot sheet */
.lot-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.big-price { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.was { color: var(--muted); font-size: 13px; text-decoration: line-through; margin-left: 6px; font-weight: 500; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.facts div { background: var(--card); padding: 9px 10px; box-shadow: inset -1px -1px 0 var(--line-2); }
.facts dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 14.5px; }
.sec { margin: 18px 0 0; }
.sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; }
.docs { display: grid; gap: 2px; }
.docs a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); background: var(--paper); font-size: 14px; }
.docs a:hover { background: var(--accent-soft); }
.docs a span:last-child { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.agent { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--paper); border-radius: 12px; margin-bottom: 8px; }
.agent .who { font-weight: 600; }
.agent .who small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.agent .acts { display: flex; gap: 6px; }
.actions { display: grid; gap: 8px; }
.actions .row { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .row .btn { flex: 1 1 auto; }
.fit-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.fit-tools select { height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; background: var(--card); }
.designs { display: grid; gap: 4px; max-height: 320px; overflow-y: auto; }
.design { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--paper); border: 1px solid transparent; cursor: pointer; text-align: left; width: 100%; }
.design[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.design b { font-size: 14px; }
.design small { color: var(--muted); font-size: 12.5px; }
.design .pp { text-align: right; font-weight: 700; }
.coming { padding: 12px; border-radius: 12px; background: var(--paper); color: var(--ink-2); font-size: 14px; }
.src { color: var(--muted); font-size: 12.5px; margin-top: 18px; }
.sheet .disclaimer { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* Status table */
.tbl-wrap { overflow-x: auto; }
table.status { border-collapse: collapse; width: 100%; font-size: 13px; }
table.status th, table.status td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.status th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.status td.n { text-align: right; font-variant-numeric: tabular-nums; }
.alerts { display: grid; gap: 6px; margin-bottom: 16px; }

.toast { position: fixed; z-index: 2000; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); display: flex; gap: 14px; align-items: center; font-size: 14px; max-width: calc(100% - 32px); }
.toast button { background: none; border: 0; color: var(--gold); font-weight: 700; cursor: pointer; }

@media (min-width: 640px) {
  .grow { flex: 1 1 280px; }
  .budget { flex: 0 0 180px; }
  .bp-label { display: inline; }
  dialog.sheet { margin: auto; width: min(560px, calc(100% - 32px)); border-radius: 18px; max-height: 88dvh; }
  dialog.sheet.wide { width: min(760px, calc(100% - 32px)); }
  .sheet-in { max-height: 88dvh; }
}
@media (min-width: 1080px) {
  .top { position: sticky; top: 0; }
  .layout { display: grid; grid-template-columns: minmax(520px, 46%) 1fr; max-width: none; }
  .list-pane { padding: 14px 20px 40px; }
  .map-pane, .layout[data-view] .map-pane { display: block; position: sticky; top: var(--top-h); height: calc(100dvh - var(--top-h)); inset: auto; }
  .layout[data-view] .list-pane { display: block; }
  .view-toggle { display: none; }
  .search-in, .chips, .top-in { max-width: none; padding-left: 20px; padding-right: 20px; }
}
.short { display: none; }
@media (max-width: 420px) {
  .brand-pick .long { display: none; }
  .brand-pick .short { display: inline; }
  .brand-pick button { padding: 6px 9px; font-size: 12.5px; }
  .logo { font-size: 15.5px; gap: 8px; }
  .top-in { padding: 10px 12px 10px 16px; }
}
@media (max-width: 380px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
}
