:root {
  --navy: #0f2a44;
  --navy-2: #173a5c;
  --teal: #1b7a8c;
  --teal-light: #e3f1f3;
  --gold: #c9a24b;
  --sand: #f7f3ec;
  --ink: #1d2733;
  --muted: #5d6b7a;
  --line: #e4e0d8;
  --white: #fff;
  --up: #1f8a4c;
  --down: #c0392b;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 42, 68, .08);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--sand); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); }
h3 { font-size: 1.25rem; }
main { min-height: 70vh; outline: none; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.2rem; background: rgba(15, 42, 68, .97); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--gold);
  color: var(--navy); font-family: var(--serif); font-weight: 700; font-size: 1.25rem; }
.brand-text { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; letter-spacing: .01em; }
.brand-text em { color: var(--gold); font-style: normal; }
.nav { display: flex; gap: 1.4rem; align-items: center; }
.nav a { color: #dfe7ef; text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a.active { color: #fff; }
.nav a.active:not(.nav-cta) { box-shadow: inset 0 -2px 0 var(--gold); }
.nav-cta { background: var(--gold); color: var(--navy) !important; padding: .5rem 1rem; border-radius: 999px; font-weight: 600 !important; }
.menu-btn { display: none; background: none; border: 0; padding: .4rem; cursor: pointer; }
.menu-btn span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; transition: .2s; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { position: fixed; inset: 60px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--navy);
    padding: .5rem 1.2rem 1.2rem; transform: translateY(-120%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .nav.open { transform: none; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 1.05rem; }
  .nav a.active:not(.nav-cta) { box-shadow: none; color: var(--gold); }
  .nav-cta { margin-top: .8rem; text-align: center; border-bottom: 0 !important; }
}

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.2rem; }
.section { padding: 3.5rem 0; }
.section.tight { padding: 2rem 0; }
.section.white { background: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; color: var(--teal); margin-bottom: .6rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 680px; }
.grid { display: grid; gap: 1.2rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; border: 1px solid var(--line); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .8rem 1.4rem; border-radius: 999px;
  font-weight: 600; font-size: .98rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit; transition: .15s; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
input, select, textarea { width: 100%; padding: .75rem .85rem; border: 1px solid #cfd6de; border-radius: 10px; font: inherit; font-size: 16px;
  background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); border-color: transparent; }
textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.hp { position: absolute; left: -9999px; }
.notice { padding: .9rem 1.1rem; border-radius: 10px; font-size: .92rem; }
.notice.ok { background: #e6f4ec; color: #17603a; }
.notice.err { background: #fbeaea; color: #8e2a20; }
.notice.info { background: #fff7e2; color: #6b5313; border: 1px solid #f0dfae; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(160deg, rgba(15,42,68,.92) 0%, rgba(27,122,140,.85) 100%),
    radial-gradient(circle at 80% 20%, #2a9db0 0, transparent 50%), var(--navy); }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 80px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath fill='%23f7f3ec' d='M0 40c120-30 240-30 360 0s240 30 360 0 240-30 360 0 240 30 360 0v40H0z'/%3E%3C/svg%3E") bottom/100% 100% no-repeat; }
.hero-inner { position: relative; z-index: 1; padding-top: 4.5rem; padding-bottom: 6.5rem; }
.hero h1 { color: #fff; max-width: 760px; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p { font-size: 1.15rem; color: #d7e6ee; max-width: 600px; }
.hero-search { margin-top: 1.8rem; display: flex; gap: .5rem; background: #fff; padding: .45rem; border-radius: 999px; max-width: 620px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.hero-search input { border: 0; border-radius: 999px; padding-left: 1.1rem; }
.hero-search input:focus { outline: none; }
.hero-search .btn { white-space: nowrap; }
.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chip { display: inline-block; padding: .35rem .85rem; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; font-size: .85rem;
  text-decoration: none; border: 1px solid rgba(255,255,255,.25); cursor: pointer; font-family: inherit; }
.chip:hover { background: rgba(255,255,255,.25); }
.chip.light { background: #fff; color: var(--navy); border-color: var(--line); }
.chip.light.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Feature cards ---------- */
.feature { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: inherit; transition: transform .15s; }
.feature:hover { transform: translateY(-3px); }
.icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-light); color: var(--teal); font-size: 1.4rem; }
.steps { counter-reset: s; display: grid; gap: 1rem; }
.step { position: relative; padding-left: 3.2rem; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; }
.step h3 { margin-bottom: .25rem; font-family: var(--sans); font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); }

/* ---------- Stats ---------- */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat .k { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 1.5rem; font-weight: 700; color: var(--navy); margin-top: .2rem; }
.stat .d { font-size: .82rem; margin-top: .15rem; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }

/* ---------- Search page ---------- */
.search-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.filters { display: grid; gap: .7rem; grid-template-columns: repeat(2, 1fr); }
.filters .q { grid-column: 1 / -1; }
@media (min-width: 760px) { .filters { grid-template-columns: 2fr repeat(5, 1fr) auto; align-items: end; } .filters .q { grid-column: auto; } }
.view-toggle { display: flex; gap: .4rem; margin: .4rem 0 1rem; }
#map { height: 420px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; }
.results { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.listing { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.listing .ph { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #cfe5e9, #f1e6cf); position: relative; display: grid; place-items: center; color: var(--navy); font-size: 2.6rem; }
.listing .ph img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.badge { position: absolute; top: .6rem; left: .6rem; background: var(--navy); color: #fff; font-size: .72rem; font-weight: 700;
  padding: .25rem .55rem; border-radius: 6px; letter-spacing: .04em; text-transform: uppercase; }
.badge.sample { background: var(--gold); color: var(--navy); }
.listing .body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.price { font-size: 1.35rem; font-weight: 700; color: var(--navy); }
.facts { color: var(--muted); font-size: .9rem; }
.addr { font-weight: 500; }
.listing .btn { margin-top: auto; padding: .55rem 1rem; font-size: .88rem; align-self: flex-start; }
.office { font-size: .75rem; color: var(--muted); }

/* ---------- Market table ---------- */
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: .92rem; }
th, td { padding: .7rem .85rem; text-align: right; border-bottom: 1px solid #eee9df; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: inherit; }
thead th { background: var(--navy); color: #fff; font-weight: 600; cursor: pointer; user-select: none; position: sticky; top: 0; }
thead th:first-child { background: var(--navy); }
tbody tr { background: #fff; }
tbody tr:nth-child(even) { background: #fbf9f5; }
tbody tr:hover { background: var(--teal-light); }
td a { font-weight: 600; text-decoration: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.toolbar input { max-width: 320px; }

/* ---------- Areas ---------- */
.area-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .35rem; transition: transform .15s; }
.area-card:hover { transform: translateY(-3px); }
.area-card .region { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--teal); font-weight: 700; }
.area-card h3 { margin: 0; }
.area-card .cities { font-size: .88rem; color: var(--muted); }
.area-card .mini { display: flex; justify-content: space-between; margin-top: .5rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .88rem; }
.area-card .mini b { display: block; color: var(--navy); font-size: 1.02rem; }
.chart { width: 100%; height: auto; }
.chart text { font-family: var(--sans); font-size: 11px; fill: var(--muted); }
.crumbs { font-size: .88rem; margin-bottom: 1rem; }
.crumbs a { text-decoration: none; }

/* ---------- Calculator ---------- */
.calc-out { font-size: 2rem; font-weight: 700; color: var(--navy); }
.split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: .8rem 0 .5rem; }
.split span { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: middle; }

/* ---------- CTA band & footer ---------- */
.band { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 2.2rem; display: flex; flex-wrap: wrap; gap: 1.2rem;
  align-items: center; justify-content: space-between; }
.band h2 { color: #fff; margin: 0; }
.band p { margin: .3rem 0 0; color: #c9d7e3; }
.footer { background: var(--navy); color: #c9d7e3; padding: 3rem 1.2rem 1.5rem; margin-top: 3rem; }
.footer-grid { max-width: 1180px; margin: 0 auto; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer h4 { color: #fff; margin: 0 0 .6rem; font-size: .95rem; }
.footer a { display: block; color: #c9d7e3; text-decoration: none; padding: .2rem 0; }
.footer a:hover { color: #fff; }
.footer-brand { margin-bottom: .6rem; }
.fine { max-width: 1180px; margin: 2rem auto 0; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .78rem; color: #93a8bb; }
.eho { font-size: 1rem; }
.loading { padding: 2rem; text-align: center; color: var(--muted); }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); background: #fff; border-radius: var(--radius); border: 1px dashed var(--line); }
