:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #15191e;
  --ink-2: #4a525c;
  --muted: #6b7480;
  --line: #e3e6ea;
  --brand: #e4002b;
  --brand-ink: #ffffff;
  --brand-soft: #fff0f2;
  --gold: #f5a623;
  --gold-soft: #fff6e5;
  --link: #0b63ce;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
  --panel-w: 420px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* ---------- Top bar & filters ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand); color: var(--brand-ink);
}
.brand-name { font-size: 18px; letter-spacing: -.01em; }
.brand-name strong { color: var(--brand); font-weight: 800; }

.filters { display: flex; align-items: flex-end; gap: 10px; flex: 1; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.field-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.field select, .field input[type=search] {
  height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  outline: none;
}
.field select:focus, .field input[type=search]:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 25, 30, .08); }
.field-suburb { min-width: 230px; flex: 1 1 230px; max-width: 320px; }
.field-keyword { min-width: 160px; }
.field-range { min-width: 180px; }
.field-range input { width: 100%; height: 40px; accent-color: var(--brand); }
.field-range output { color: var(--ink); text-transform: none; letter-spacing: 0; }
.field-range.is-disabled { opacity: .45; }

.btn-ghost, .btn-primary {
  height: 40px; padding: 0 16px; border-radius: 10px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn-ghost { border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-primary { border: 0; background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(.94); }

/* ---------- Layout ---------- */
.layout { display: flex; flex: 1; min-height: 0; }
.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: #e9edf0; }
.map-status {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  z-index: 500; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); font-size: 13px; font-weight: 500;
  pointer-events: none;
}
.map-status:empty { display: none; }

/* ---------- Results panel / carousel ---------- */
.panel {
  width: var(--panel-w); flex: none;
  display: flex; flex-direction: column;
  background: var(--bg); border-left: 1px solid var(--line);
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.panel-head h1 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
.panel-head p { margin: 2px 0 0; font-size: 13px; }
.carousel-nav { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.carousel-nav button {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.carousel-nav button:hover { border-color: var(--ink); }

.carousel {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-snap-type: y proximity; scroll-padding: 12px;
  outline: none;
}
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }

.card {
  position: relative; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 12px 60px; box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: #c5cbd2; }
.card.is-active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.card.is-featured { background: linear-gradient(180deg, var(--gold-soft), var(--surface) 70%); border-color: #f2d49b; }
.rank {
  position: absolute; left: 14px; top: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: #eef0f3; color: var(--ink-2);
}
.is-featured .rank { background: var(--gold); color: #fff; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card h2 { font-size: 15.5px; line-height: 1.3; margin: 0; letter-spacing: -.005em; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-featured { background: var(--gold); color: #fff; }
.badge-service { background: #e7f1ff; color: #0b4fa3; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0 8px; font-size: 13px; color: var(--ink-2); }
.chip { padding: 1px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 12px; }
.licensed { color: #1a7f45; font-weight: 600; font-size: 12px; }
.desc { margin: 0 0 10px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.contact { display: flex; flex-wrap: wrap; gap: 6px; }
.contact a {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none;
  font-size: 13px; font-weight: 500;
}
.contact a:hover { border-color: var(--ink); }
.contact a.call { background: var(--ink); border-color: var(--ink); color: #fff; }
.contact svg { width: 14px; height: 14px; flex: none; }
.no-contact { font-size: 12.5px; color: var(--muted); }
.fine { margin-top: 8px; font-size: 11.5px; color: var(--muted); font-family: ui-monospace, 'SF Mono', Consolas, monospace; }
.more { align-self: center; }

/* ---------- Map markers ---------- */
.pin {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--brand); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
  display: grid; place-items: center;
}
.pin span { transform: rotate(45deg); color: #fff; font-size: 11px; font-weight: 800; }
.pin.featured { background: var(--gold); width: 30px; height: 30px; }
.pin.active { background: var(--ink); }
.leaflet-popup-content { margin: 12px 14px; font-family: 'Inter', system-ui, sans-serif; }
.popup h3 { margin: 0 0 2px; font-size: 14px; }
.popup p { margin: 0; color: var(--ink-2); font-size: 12.5px; }
.popup a { color: var(--link); font-weight: 600; }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(228, 0, 43, .18); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: var(--brand); color: #fff; font-weight: 700; }

/* ---------- Dialog ---------- */
.dialog { border: 0; border-radius: 16px; padding: 24px; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(15, 18, 22, .45); }
.dialog { position: relative; width: min(560px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); }
.dialog h2 { margin: 0 32px 8px 0; }
.dialog > p { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.dialog-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); font-size: 20px; line-height: 1; cursor: pointer;
}
.dialog-close:hover { border-color: var(--ink); }
.enquiry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.enquiry-wide { grid-column: 1 / -1; }
.enquiry .field { min-width: 0; }
.enquiry input, .enquiry select, .enquiry textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); outline: none;
}
.enquiry textarea { resize: vertical; }
.enquiry input:focus, .enquiry select:focus, .enquiry textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 25, 30, .08); }
.enquiry [aria-invalid="true"] { border-color: var(--brand); }
.enquiry .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.enquiry-error { min-height: 1.2em; margin: 10px 0 0; color: var(--brand); font-size: 13px; }
.enquiry-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.enquiry-done p { font-size: 15px; line-height: 1.5; }
.enquiry [hidden] { display: none !important; }
.request-type { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 14px; padding: 0; border: 0; }
.request-type legend { width: 100%; margin-bottom: 6px; padding: 0; }
.request-type label {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px; cursor: pointer;
}
.request-type label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.request-type input, .confirm input { width: auto; min-height: 0; accent-color: var(--brand); }
.request-type[aria-invalid="true"] label { border-color: var(--brand); }
.confirm { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.confirm input { margin-top: 2px; }
.confirm[aria-invalid="true"] { color: var(--brand); }

/* ---------- About page ---------- */
body.page-body { height: auto; min-height: 100vh; display: block; }
a.brand { color: inherit; text-decoration: none; }
.topnav a.nav-btn { display: inline-flex; align-items: center; text-decoration: none; padding: 0 16px; }
.page { padding: 40px 20px 56px; }
.prose { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 40px 44px; box-shadow: var(--shadow); }
.prose .eyebrow { margin: 0 0 6px; color: var(--brand); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.prose h1 { margin: 0 0 14px; font-size: clamp(26px, 4vw, 36px); line-height: 1.15; letter-spacing: -.02em; }
.prose h2 { margin: 32px 0 10px; font-size: 20px; letter-spacing: -.01em; }
.prose p, .prose li { font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.prose .lede { font-size: 18px; color: var(--ink); }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose a:not(.btn-primary) { color: var(--link); }
.page-cta { display: inline-flex; align-items: center; text-decoration: none; }
.page-footer { max-width: 720px; margin: 0 auto; padding: 0 20px 40px; }
.page-footer p { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.page-footer .page-footer-business { color: var(--ink-2); font-weight: 600; }
.site-legal {
  margin: 0; padding: 8px 16px; border-top: 1px solid var(--line); background: var(--surface);
  font-size: 11.5px; color: var(--muted); text-align: center;
}
.site-legal a { color: var(--muted); }
@media (max-width: 760px) {
  .page { padding: 16px; }
  .prose { padding: 24px 20px; border-radius: 12px; }
}

/* ---------- Header nav & card "claim" link ---------- */
.topnav { display: flex; align-items: center; gap: 10px; }
.topnav a { color: var(--ink); font-weight: 600; text-decoration: none; padding: 0 6px; white-space: nowrap; }
.topnav a:hover { text-decoration: underline; }
.claim {
  display: block; margin-top: 8px; padding: 0; border: 0; background: none;
  color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer;
}
.claim:hover { color: var(--ink); }
@media (max-width: 520px) { .enquiry-grid { grid-template-columns: 1fr; } }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  :root { --panel-w: 360px; }
  .topbar { flex-wrap: wrap; }
  .filters { order: 3; flex-basis: 100%; }
  .topnav { margin-left: auto; }
}
@media (max-width: 760px) {
  body { height: auto; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .brand-name { font-size: 16px; }
  .topnav { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .topnav .btn-ghost, .topnav .btn-primary { height: 34px; padding: 0 12px; font-size: 13px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .field { min-width: 0; }
  .field-suburb { grid-column: 1 / -1; max-width: none; }
  .layout { flex-direction: column; height: auto; }
  .map-wrap { height: 52vh; flex: none; }
  .panel { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
  .carousel {
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; padding: 12px 16px;
  }
  .card { flex: 0 0 86%; }
  .more { flex: 0 0 auto; align-self: center; }
  .carousel-nav button:first-child { transform: rotate(-90deg); }
  .carousel-nav button:last-child { transform: rotate(-90deg); }
}
