/* ============================================================
   Nid — Lausanne rental search
   Warm editorial system: Fraunces display, Inter UI, paper canvas.
   ============================================================ */

:root {
  --header-h: 72px;
  --paper: #fff7f2;
  --paper-2: #ffefe6;
  --surface: #ffffff;
  --surface-2: #fff2eb;
  --ink: #2a1714;
  --ink-soft: #4a332d;
  --muted: #8b6f66;
  --line: rgba(42, 23, 20, .10);
  --line-strong: rgba(42, 23, 20, .2);
  --green: #f2644c;
  --green-2: #e14b39;
  --green-soft: #ffe3da;
  --clay: #c2412f;
  --clay-soft: #ffe7e0;
  --gold: #c97b63;
  --pink: #ff5d8f;
  --peach: #ffb59e;
  --blush: #ffd9ce;
  --grad: linear-gradient(120deg, #ff8a6b 0%, #ff5d8f 100%);
  --shadow-sm: 0 1px 2px rgba(74, 30, 22, .04), 0 10px 24px -14px rgba(74, 30, 22, .28);
  --shadow-md: 0 2px 8px rgba(74, 30, 22, .05), 0 22px 50px -24px rgba(74, 30, 22, .35);
  --shadow-lg: 0 34px 90px -32px rgba(74, 30, 22, .45);
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 32px;
  --ff-display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ff-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .8, .28, 1);
}

[data-theme="dark"] {
  --paper: #1b1110;
  --paper-2: #241615;
  --surface: #281816;
  --surface-2: #32201d;
  --ink: #fff3ed;
  --ink-soft: #ecd2c8;
  --muted: #c7a79d;
  --line: rgba(255, 243, 237, .12);
  --line-strong: rgba(255, 243, 237, .24);
  --green: #ff8a72;
  --green-2: #ffa08b;
  --green-soft: #3b211d;
  --clay: #ff9a82;
  --clay-soft: #3f241f;
  --gold: #e0a187;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 26px -14px rgba(0, 0, 0, .75);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .4), 0 26px 60px -26px rgba(0, 0, 0, .85);
  --shadow-lg: 0 40px 100px -32px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--ff-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--ff-display); font-weight: 500; letter-spacing: -.015em; }
p { margin: 0; }
::selection { background: var(--green); color: #fff; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.fill { fill: currentColor; }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(14px, 2.2vw, 30px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 9px; flex: none; }
.brand-mark { width: 30px; height: 30px; color: var(--green); align-self: center; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-word { font-family: var(--ff-display); font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.brand-word .dot { color: var(--clay); }
.brand-city { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.search-shell {
  position: relative; display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 560px;
  height: 44px; padding: 0 6px 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.search-shell:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent); }
.search-shell .ic { color: var(--muted); }
.search-shell input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 14px; padding: 10px 0;
}
.search-shell input::-webkit-search-cancel-button { display: none; }
.search-go {
  flex: none; height: 34px; padding: 0 16px; border-radius: 999px;
  background: var(--green); color: #f8f5ec; font-size: 13px; font-weight: 500;
  transition: transform .15s var(--ease), background .2s;
}
.search-go:hover { background: var(--green-2); transform: translateY(-1px); }
.search-clear { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); }
.search-clear:hover { background: var(--paper-2); }

.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-md); overflow: hidden; z-index: 70;
}
.suggest button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line);
}
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover { background: var(--surface-2); }
.suggest .ic { width: 15px; height: 15px; color: var(--muted); }
.suggest small { margin-left: auto; color: var(--muted); font-size: 11.5px; }

.mainnav { display: flex; align-items: center; gap: 2px; }
.mainnav a {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px; border-radius: 999px; font-size: 13.5px; color: var(--ink-soft);
  transition: background .18s, color .18s;
}
.mainnav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.mainnav a.active { color: var(--green); background: var(--green-soft); font-weight: 500; }
.navcount {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; background: var(--green); color: #fff; font-size: 10.5px; font-weight: 600;
}
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.iconbtn {
  position: relative; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%; color: var(--ink-soft);
  border: 1px solid transparent; transition: background .18s, border-color .18s;
}
.iconbtn:hover { background: var(--surface); border-color: var(--line); }
.iconbtn .ping { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 2px var(--paper); }
.mobile-filter { display: none; }

/* ---------------- Buttons & chips ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13.5px; font-weight: 500; transition: all .18s var(--ease);
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn.primary { background: var(--green); border-color: var(--green); color: #f8f5ec; }
.btn.primary:hover { background: var(--green-2); }
.btn.ghost { background: transparent; }
.btn.sm { height: 34px; padding: 0 13px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; color: var(--ink-soft); transition: all .15s;
}
.chip:hover { border-color: var(--line-strong); }
.chip.on { background: var(--green); border-color: var(--green); color: #f8f5ec; }
.chip .ic { width: 15px; height: 15px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 23px; padding: 0 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--ink-soft); backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.badge.new { background: var(--green); color: #fff; border-color: transparent; }
.badge.verify { background: var(--clay-soft); color: var(--clay); border-color: transparent; }
.badge.charges { background: #fff6e6; color: #8a6420; border-color: transparent; }
.badge.pricevar { background: var(--clay-soft); color: var(--clay); border-color: transparent; }
[data-theme="dark"] .badge.charges { background: #3a2f1b; color: #e3c07c; }

/* ---------------- Hero ---------------- */
.hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 40px;
  padding: clamp(28px, 4.4vw, 58px) clamp(16px, 3vw, 34px) clamp(20px, 3vw, 32px);
  max-width: 1680px; margin: 0 auto;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--green);
  font-weight: 600; margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.hero h1 {
  font-size: clamp(34px, 5.1vw, 64px); line-height: .98; letter-spacing: -.035em; max-width: 13ch;
}
.hero h1 em { font-style: italic; color: var(--green); }
.hero p.sub { max-width: 52ch; margin-top: 16px; color: var(--muted); font-size: 15px; }
.hero-stats { display: flex; gap: clamp(18px, 3vw, 44px); flex-wrap: wrap; }
.hero-stat { min-width: 92px; }
.hero-stat b { display: block; font-family: var(--ff-display); font-size: clamp(24px, 2.6vw, 34px); font-weight: 500; letter-spacing: -.02em; }
.hero-stat span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------------- Explorer layout ---------------- */
.explorer {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  gap: 0;
  max-width: 1680px; margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 34px) 60px;
  align-items: start;
}
.explorer.with-map { grid-template-columns: 282px minmax(0, 1fr) minmax(340px, 35%); }
.filters-col { position: sticky; top: calc(var(--header-h) + 14px); max-height: calc(100vh - var(--header-h) - 28px); overflow: auto; padding-right: 18px; scrollbar-width: thin; }
.results-col { min-width: 0; padding: 0 22px; }
.map-col { position: sticky; top: calc(var(--header-h) + 14px); height: calc(100vh - var(--header-h) - 28px); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: var(--surface-2); }

/* ---------------- Filters ---------------- */
.filter-block { border-top: 1px solid var(--line); padding: 18px 0; }
.filter-mobile-head { display: none; align-items: center; justify-content: space-between; padding: 0 0 14px; }
.filter-mobile-head strong { font-family: var(--ff-display); font-size: 22px; font-weight: 500; }
.mobile-apply { display: none; }
.filter-block:first-child, .filter-mobile-head + .filter-block { border-top: 0; padding-top: 4px; }
.filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.filter-head h4 { font-family: var(--ff-ui); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.filter-head .reset { font-size: 11.5px; color: var(--green); font-weight: 500; }
.filter-block .hint { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

.price-reads { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.price-reads input {
  width: 100%; height: 38px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-variant-numeric: tabular-nums;
}
.price-reads span { color: var(--muted); font-size: 12px; }
.dual { position: relative; height: 28px; }
.dual input[type=range] {
  position: absolute; left: 0; right: 0; top: 8px; width: 100%; height: 4px;
  -webkit-appearance: none; appearance: none; background: transparent; pointer-events: none; margin: 0;
}
.dual::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 3px; border-radius: 3px; background: var(--line); }
.dual .fill { position: absolute; top: 10px; height: 3px; border-radius: 3px; background: var(--green); }
.dual input::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer;
}
.dual input::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--green); }

.checklist { display: grid; gap: 2px; }
.checkrow { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.checkrow input { width: 15px; height: 15px; accent-color: var(--green); }
.checkrow .n { margin-left: auto; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13px; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line); transition: background .18s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s var(--ease); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(16px); }
.filter-actions { display: grid; gap: 8px; padding-top: 16px; }

/* ---------------- Results header ---------------- */
.results-head { display: flex; align-items: center; gap: 12px; padding: 2px 0 14px; flex-wrap: wrap; }
.results-head h2 { font-size: 20px; letter-spacing: -.02em; }
.results-head .count { color: var(--muted); font-size: 13px; }
.results-head .spacer { flex: 1; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.seg button { display: grid; place-items: center; width: 32px; height: 28px; border-radius: 999px; color: var(--muted); }
.seg button.on { background: var(--paper-2); color: var(--ink); }
.seg .ic { width: 16px; height: 16px; }
.select {
  height: 36px; padding: 0 30px 0 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23736d60' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none; font-size: 12.5px;
}
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.active-chips .chip { height: 28px; font-size: 11.5px; background: var(--green-soft); border-color: transparent; color: var(--green); }

/* ---------------- Cards ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px 16px; }
.cards.list { grid-template-columns: 1fr; gap: 12px; }
.card {
  position: relative; background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--line); overflow: hidden;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .2s;
  animation: rise .45s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card .media { position: relative; aspect-ratio: 4 / 3; background: var(--paper-2); overflow: hidden; }
.card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .3s; }
.card:hover .media img { transform: scale(1.035); }
.card .media .ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--paper-2), color-mix(in srgb, var(--paper-2) 60%, var(--green-soft))); color: var(--muted); }
.card .media .ph svg { width: 46px; height: 46px; opacity: .5; }
.badge-row { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 5px; max-width: 74%; }
.heart {
  position: absolute; top: 9px; right: 9px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(6px); color: var(--ink-soft); box-shadow: var(--shadow-sm); transition: transform .18s var(--ease), color .18s;
}
.heart .ic { width: 17px; height: 17px; }
.heart:hover { transform: scale(1.08); }
.heart.on { color: var(--clay); }
.heart.on .ic { fill: currentColor; }
.heart.pop { animation: pop .35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.28); } }
.compare-check {
  position: absolute; bottom: 9px; right: 9px; display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 8px; border-radius: 6px; font-size: 10.5px; font-weight: 500;
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(6px);
  color: var(--ink-soft); opacity: 0; transition: opacity .2s;
}
.card:hover .compare-check, .compare-check.on { opacity: 1; }
.compare-check.on { background: var(--green); color: #fff; }
.card .price-float {
  position: absolute; left: 10px; bottom: 9px;
  display: flex; align-items: baseline; gap: 4px;
  padding: 5px 9px; border-radius: 7px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.price-float small { font-size: 9.5px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 2px rgba(0,0,0,.3); transition: width .2s; }
.dots i.on { width: 12px; border-radius: 3px; background: #fff; }
.arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.82); color: #222; opacity: 0; transition: opacity .2s; }
.card:hover .arrow { opacity: 1; }
.arrow.prev { left: 8px; } .arrow.next { right: 8px; }
.arrow .ic { width: 15px; height: 15px; }

.card .body { padding: 13px 15px 15px; }
.card .kicker { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.card h3 { font-family: var(--ff-ui); font-size: 14.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.card .addr { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .addr .ic { width: 13px; height: 13px; flex: none; }
.card .facts { display: flex; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); }
.card .facts span { display: inline-flex; align-items: center; gap: 5px; }
.card .facts .ic { width: 14px; height: 14px; color: var(--muted); }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.card .foot .avail { display: inline-flex; align-items: center; gap: 4px; }
.card .foot .ic { width: 12px; height: 12px; }
.card .src { text-transform: uppercase; letter-spacing: .08em; font-size: 9.5px; }

.cards.list .card { display: grid; grid-template-columns: 260px 1fr; }
.cards.list .card .media { aspect-ratio: auto; height: 100%; min-height: 190px; }
.cards.list .card h3 { min-height: 0; font-size: 16px; }
.cards.list .card .body { display: flex; flex-direction: column; }
.cards.list .card .facts { margin-top: auto; }

.skeleton { border-radius: var(--r-lg); background: linear-gradient(100deg, var(--paper-2) 30%, var(--surface-2) 50%, var(--paper-2) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; height: 330px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty .ic { width: 38px; height: 38px; color: var(--muted); margin-bottom: 14px; }
.empty h3 { font-size: 22px; margin-bottom: 8px; }
.empty p { color: var(--muted); font-size: 13.5px; max-width: 42ch; margin: 0 auto 18px; }

.loadmore { display: flex; justify-content: center; padding: 30px 0 0; }

/* ---------------- Map ---------------- */
#map, .map-full { width: 100%; height: 100%; background: var(--paper-2); }
.leaflet-container { font-family: var(--ff-ui); background: var(--paper-2); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-sm) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent) !important; font-size: 9px !important; border-radius: 4px 0 0 0; }
.pin {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 5px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 10px rgba(0,0,0,.18); transition: transform .15s, background .15s, color .15s;
  cursor: pointer;
}
.pin:hover, .pin.active { background: var(--green); color: #fff; border-color: var(--green); transform: scale(1.06) translateY(-2px); z-index: 500; }
.pin.low { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.pin.high { border-color: color-mix(in srgb, var(--clay) 50%, var(--line)); }
.pin.verify { border-style: dashed; opacity: .82; }
.pin-wrap { background: none; border: 0; }
.map-price-note { position: absolute; z-index: 500; left: 12px; bottom: 12px; display: flex; gap: 10px; padding: 7px 11px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); font-size: 10.5px; color: var(--muted); box-shadow: var(--shadow-sm); }
.map-price-note b { color: var(--ink); font-weight: 600; }
.map-toolbar { position: absolute; z-index: 500; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.map-toolbar > * { pointer-events: auto; }
.map-toolbar .btn { height: 36px; font-size: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.map-badge { padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 11px; box-shadow: var(--shadow-sm); }

/* Full map view */
.maplayout { display: grid; grid-template-columns: 380px 1fr; height: calc(100vh - var(--header-h) - 40px); max-width: 1680px; margin: 0 auto; padding: 0 clamp(12px, 2vw, 26px) 20px; gap: 16px; }
.maplist { overflow: auto; padding-right: 4px; height: 100%; }
.maplist .card.mini { display: grid; grid-template-columns: 118px 1fr; margin-bottom: 10px; border-radius: var(--r-md); }
.maplist .card.mini .media { aspect-ratio: auto; height: 100%; min-height: 118px; }
.maplist .card.mini .body { padding: 10px 12px; }
.maplist .card.mini h3 { font-size: 12.8px; line-height: 1.3; min-height: 0; -webkit-line-clamp: 2; }
.maplist .card.mini .addr { font-size: 11px; }
.maplist .card.mini .facts { font-size: 11px; gap: 8px; margin-top: 7px; padding-top: 7px; }
.maplist .card.mini .price-float { position: static; background: none; padding: 0; backdrop-filter: none; font-size: 13.5px; margin-bottom: 3px; }
.maplist .card.mini .badge-row, .maplist .card.mini .heart, .maplist .card.mini .compare-check, .maplist .card.mini .dots, .maplist .card.mini .arrow { display: none; }
.maplist-head { position: sticky; top: 0; background: var(--paper); padding: 4px 0 10px; z-index: 2; }
.map-canvas { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); height: 100%; }

/* ---------------- Detail ---------------- */
.detail { max-width: 1320px; margin: 0 auto; padding: 22px clamp(16px, 3vw, 34px) 80px; }
.backlink { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.backlink:hover { color: var(--ink); }
.backlink .ic { width: 15px; height: 15px; }
.gallery { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: clamp(320px, 46vh, 500px); border-radius: var(--r-lg); overflow: hidden; }
.gallery .shot { position: relative; overflow: hidden; background: var(--paper-2); cursor: zoom-in; }
.gallery .shot:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gallery .shot:hover img { transform: scale(1.03); }
.gallery .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(17,17,12,.52); color: #fff; font-size: 13px; font-weight: 500; gap: 6px; }
.gallery .ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--paper-2), var(--green-soft)); color: var(--muted); }
.detail-head { display: flex; justify-content: space-between; gap: 26px; margin: 24px 0 8px; align-items: flex-start; }
.detail-head h1 { font-size: clamp(27px, 3.4vw, 40px); line-height: 1.05; max-width: 20ch; }
.detail-head .addr { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 10px; font-size: 13.5px; }
.detail-head .addr .ic { width: 15px; height: 15px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 34px; margin-top: 24px; align-items: start; }
.detail-main > section { border-top: 1px solid var(--line); padding: 26px 0; }
.detail-main > section:first-child { border-top: 0; padding-top: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-title h2 { font-size: 22px; }
.section-title span { font-size: 11.5px; color: var(--muted); }
.factgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.fact { background: var(--surface); padding: 14px 15px; }
.fact span { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.fact b { font-size: 15px; font-weight: 500; }
.desc { color: var(--ink-soft); font-size: 14px; line-height: 1.7; white-space: pre-line; max-width: 68ch; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.morelink { margin-top: 10px; font-size: 12.5px; color: var(--green); font-weight: 500; }
.amenities { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.amenity { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: var(--surface); }
.amenity .ic { width: 17px; height: 17px; color: var(--green); }
.amenity.off { opacity: .45; }
.amenity.off .ic { color: var(--muted); }

.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--header-h) + 16px); }
.side-card + .side-card { margin-top: 14px; }
.price-big { font-family: var(--ff-display); font-size: 38px; letter-spacing: -.03em; line-height: 1; }
.price-big small { font-family: var(--ff-ui); font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.price-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.cost-table { margin-top: 16px; border-top: 1px solid var(--line); }
.cost-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line); }
.cost-row.total { font-weight: 600; border-bottom: 0; padding-top: 10px; }
.cost-row span:last-child { font-variant-numeric: tabular-nums; }
.cta-stack { display: grid; gap: 8px; margin-top: 18px; }
.agent { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.agent .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.agent b { display: block; font-size: 12.5px; font-weight: 600; }
.agent span { font-size: 11px; color: var(--muted); }
.mini-map { height: 220px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.commute { display: grid; gap: 8px; margin-top: 12px; }
.commute-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.commute-row .ic { width: 16px; height: 16px; color: var(--muted); }
.commute-row b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.commute-row small { color: var(--muted); font-size: 10.5px; }

.calc { display: grid; gap: 10px; margin-top: 6px; }
.calc label { display: grid; gap: 4px; font-size: 11px; color: var(--muted); }
.calc input { height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.calc-out { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 12.5px; }
.calc-out b { font-size: 18px; font-family: var(--ff-display); }

.flags { display: grid; gap: 7px; }
.flag { display: flex; gap: 8px; font-size: 12px; color: var(--clay); background: var(--clay-soft); padding: 9px 11px; border-radius: 8px; }
.flag.info { color: var(--muted); background: var(--surface-2); }
.flag .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }

.history { display: grid; gap: 0; margin-top: 6px; }
.hrow { display: grid; grid-template-columns: 100px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12px; align-items: center; }
.hrow .bar { height: 5px; background: var(--green-soft); border-radius: 3px; overflow: hidden; }
.hrow .bar i { display: block; height: 100%; background: var(--green); }
.hrow time { color: var(--muted); }

.similar { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 26px; }
.similar h2 { font-size: 24px; margin-bottom: 16px; }
.similar .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------------- Favorites ---------------- */
.page { max-width: 1440px; margin: 0 auto; padding: clamp(26px, 4vw, 50px) clamp(16px, 3vw, 34px) 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1; }
.page-head p { color: var(--muted); margin-top: 10px; max-width: 60ch; font-size: 13.5px; }
.pipeline-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.fav-note { margin-top: 10px; }
.fav-note textarea { width: 100%; min-height: 44px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: 8px 10px; font-size: 12px; }
.fav-status { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.fav-status button { font-size: 10.5px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.fav-status button.on { background: var(--green); color: #fff; border-color: var(--green); }
.fav-meta { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* ---------------- Compare ---------------- */
.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.compare-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.compare-table th, .compare-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12.5px; vertical-align: top; }
.compare-table thead th { background: var(--surface-2); position: relative; min-width: 200px; }
.compare-table tbody th { width: 160px; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.compare-table .best { color: var(--green); font-weight: 600; }
.compare-head img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.compare-head h3 { font-family: var(--ff-ui); font-size: 13px; font-weight: 600; line-height: 1.3; }
.compare-head .rm { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.compare-head .rm .ic { width: 13px; height: 13px; }

/* ---------------- Insights ---------------- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 26px; }
.statcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; }
.statcard span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.statcard b { display: block; font-family: var(--ff-display); font-size: 30px; letter-spacing: -.02em; margin-top: 4px; }
.statcard small { color: var(--muted); font-size: 11px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 16px; }
.panel h2 { font-size: 20px; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: 12px; margin-bottom: 18px; }
.barchart { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 76px; gap: 10px; align-items: center; font-size: 12px; }
.bar-row .track { height: 22px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--green-2)); border-radius: 5px; min-width: 2px; transition: width .6s var(--ease); }
.bar-row b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hist { display: flex; align-items: flex-end; gap: 5px; height: 160px; padding-top: 10px; }
.hist .hcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; align-items: center; height: 100%; }
.hist .hcol i { width: 100%; background: var(--green-soft); border-top: 2px solid var(--green); border-radius: 3px 3px 0 0; min-height: 2px; transition: height .6s var(--ease); }
.hist .hcol span { font-size: 9.5px; color: var(--muted); white-space: nowrap; }

/* ---------------- Footer ---------------- */
.sitefoot {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  max-width: 1680px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 34px) 40px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.6;
}
.sitefoot strong { color: var(--ink); font-family: var(--ff-display); font-size: 14px; }

/* ---------------- Toast / lightbox / sheet ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 200;
  padding: 11px 16px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-size: 12.5px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s var(--ease);
  max-width: min(92vw, 480px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(10,10,8,.94); display: grid; place-items: center; padding: 5vh 6vw; }
.lightbox img { max-width: 100%; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lb-close, .lb-nav { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(6px); }
.lb-close { top: 18px; right: 18px; }
.lb-nav.prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-nav.next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-nav .ic { width: 22px; height: 22px; }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.75); font-size: 12px; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10,10,8,.45); z-index: 90; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1280px) {
  .explorer.with-map { grid-template-columns: 260px minmax(0, 1fr); }
  .explorer.with-map .map-col { display: none; }
  .mainnav a { padding: 9px 9px; }
  .search-shell { max-width: 420px; }
}
@media (max-width: 1080px) {
  .mainnav { display: none; }
  .hero { flex-direction: column; align-items: flex-start; gap: 26px; }
  .hero-stats { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .gallery { height: 340px; }
  .maplayout { grid-template-columns: 1fr; height: auto; }
  .maplist { display: none; }
  .map-canvas { height: calc(100vh - var(--header-h) - 60px); }
}
@media (max-width: 860px) {
  :root { --header-h: 64px; }
  .brand-city { display: none; }
  .brand-word { font-size: 22px; }
  .search-shell { height: 40px; }
  .search-go { display: none; }
  .topbar { gap: 10px; padding: 0 12px; }
  .explorer, .explorer.with-map { grid-template-columns: 1fr; padding: 0 14px 50px; }
  .filters-col {
    position: fixed; z-index: 100; top: 0; left: 0; bottom: 0; width: min(88vw, 360px);
    background: var(--paper); padding: 18px 18px 90px; max-height: none;
    transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); overflow: auto;
  }
  .filters-col.open { transform: none; }
  .filters-col .filter-close { display: grid; }
  .filter-mobile-head { display: flex; }
  .mobile-apply { display: inline-flex; }
  .filters-col { padding-bottom: 110px; }
  .results-col { padding: 0; }
  .mobile-filter { display: grid; }
  .cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cards.list .card { grid-template-columns: 1fr; }
  .cards.list .card .media { height: 220px; }
  .hero { padding: 26px 14px 18px; }
  .hero h1 { max-width: 100%; }
  .detail { padding: 14px 14px 60px; }
  .detail-head { flex-direction: column; }
  .detail-actions { justify-content: flex-start; }
  .gallery { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 300px; }
  .gallery .shot:first-child { grid-row: auto; }
  .gallery .shot:not(:first-child) { display: none; }
  .factgrid { grid-template-columns: 1fr 1fr; }
  .page { padding: 22px 14px 60px; }
  .sitefoot { padding: 20px 14px 30px; }
  .compare-table tbody th { width: 120px; }
}
@media (max-width: 520px) {
  .brand-word { display: none; }
  .topbar-actions { gap: 2px; }
  .iconbtn { width: 34px; height: 34px; }
  #themeToggle { display: none; }
  .search-shell { padding-left: 10px; }
  .search-shell input { font-size: 12.5px; }
  .hero { padding: 20px 14px 14px; }
  .hero h1 { font-size: 33px; }
  .hero p.sub { font-size: 13.5px; margin-top: 10px; }
  .hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
  .hero-stat { min-width: 0; }
  .hero-stat b { font-size: 20px; }
  .hero-stat span { font-size: 8px; letter-spacing: .05em; }
  .cards { grid-template-columns: 1fr; }
  .results-head h2 { font-size: 17px; }
  .detail-head h1 { font-size: 26px; }
  .price-big { font-size: 32px; }
  .gallery { height: 250px; }
  .section-title h2 { font-size: 19px; }
  .toast { bottom: 16px; }
}

/* Hide map toggle when no map */
.explorer:not(.with-map) .map-col { display: none; }

/* Print exposé */
@media print {
  .topbar, .sitefoot, .detail-actions, .similar, .side-card.calc-card, .filters-col, .toast, .lightbox { display: none !important; }
  body { background: #fff; color: #000; }
  .detail { max-width: none; padding: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .gallery { height: 240px; }
  .side-card { border: 0; box-shadow: none; padding: 0; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9px; color: #555; }
}

/* Scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
