/* Zipworthy: a blueprint-blue world where only the window lights are warm.
   Layout: one centered column (max 1120px); feature pages open with a
   blueprint "stage" panel, and everything else sits quietly on paper. */
:root {
  --paper: #f3f6fd;
  --surface: #ffffff;
  --ink: #0c1e3c;
  --ink-2: #4b5c7a;
  --line: #d9e2f2;
  --blue: #1d5bff;
  --blue-deep: #0d3ab3;
  --blue-soft: #e5edff;
  --sky: #b9cfff;
  --lamp: #ffc23d;
  --up: #0b8f5e;
  --down: #d63c45;
  --print: #e9f0ff;
  --grid: #cfdcf7;
  --on-blue: #ffffff;

  --h-line: #3b6cf0;
  --h-wall-a: #ffffff;
  --h-wall-b: #eef3ff;
  --h-wall-c: #dce7ff;
  --h-roof-a: #1b3f94;
  --h-roof-b: #2f5fd6;
  --h-window: #c6d8ff;
  --h-door: #1d5bff;
  --h-ground: #d3e1fb;
  --h-walk: #f5f8ff;
  --h-tree: #8fb2f5;
  --h-tree2: #6f97ec;
  --h-trunk: #4467b8;
  --h-pool: #63b5ff;
  --h-ghost: #a9bfec;

  /* Map colors by year built: oldest is darkest (validated sequential ramp) */
  --age-1: #0f3487; --age-2: #1f52c2; --age-3: #3a6fe3; --age-4: #6290f0; --age-5: #8eb0f6;

  --font-display: "Bricolage Grotesque", "Avenir Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5625rem;
  --t-2xl: 1.95rem;
  --t-3xl: 2.45rem;

  --r-stage: 28px;
  --r-card: 20px;
  --r-ctl: 14px;
  --r-chip: 9px;
  --lift: 0 1px 2px rgba(12, 30, 60, 0.06), 0 14px 32px -18px rgba(29, 91, 255, 0.45);
  --max: 1120px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #071430; --surface: #0e1f42; --ink: #e9efff; --ink-2: #9fb2d8; --line: #1d3361;
    --blue: #5f8dff; --blue-deep: #a9c2ff; --blue-soft: #14295c; --sky: #2b4b94; --lamp: #ffc94f;
    --up: #3ccf8e; --down: #ff6b72; --print: #0b2766; --grid: #183a85; --on-blue: #06132e;
    --h-line: #8fb0ff; --h-wall-a: #1d3b80; --h-wall-b: #234591; --h-wall-c: #2a4fa3;
    --h-roof-a: #6c93ff; --h-roof-b: #4b76ec; --h-window: #0d2257; --h-door: #9bb8ff;
    --h-ground: #13306d; --h-walk: #1f3e82; --h-tree: #2f5cc4; --h-tree2: #3e6fe0; --h-trunk: #6c8fe6;
    --h-pool: #3aa0ff; --h-ghost: #2b4f9c;
    --age-1: #c6d7ff; --age-2: #93b3ff; --age-3: #6590f2; --age-4: #4570d8; --age-5: #2b55b0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #071430; --surface: #0e1f42; --ink: #e9efff; --ink-2: #9fb2d8; --line: #1d3361;
  --blue: #5f8dff; --blue-deep: #a9c2ff; --blue-soft: #14295c; --sky: #2b4b94; --lamp: #ffc94f;
  --up: #3ccf8e; --down: #ff6b72; --print: #0b2766; --grid: #183a85; --on-blue: #06132e;
  --h-line: #8fb0ff; --h-wall-a: #1d3b80; --h-wall-b: #234591; --h-wall-c: #2a4fa3;
  --h-roof-a: #6c93ff; --h-roof-b: #4b76ec; --h-window: #0d2257; --h-door: #9bb8ff;
  --h-ground: #13306d; --h-walk: #1f3e82; --h-tree: #2f5cc4; --h-tree2: #3e6fe0; --h-trunk: #6c8fe6;
  --h-pool: #3aa0ff; --h-ghost: #2b4f9c;
  --age-1: #c6d7ff; --age-2: #93b3ff; --age-3: #6590f2; --age-4: #4570d8; --age-5: #2b55b0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--surface);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: var(--t-3xl); font-weight: 800; }
h2 { font-size: var(--t-xl); font-weight: 700; }
h3 { font-size: var(--t-lg); font-weight: 700; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }
img, svg { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.wrap { max-width: calc(var(--max) + 32px); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 9;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 20px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-word { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; letter-spacing: -0.03em; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; padding: 7px 12px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--blue-soft); }
.nav a[aria-current="page"] { color: var(--blue-deep); background: var(--blue-soft); }
@media (max-width: 860px) {
  .bar { flex-wrap: wrap; gap: 0; padding-top: 6px; }
  .nav { order: 3; width: 100%; margin: 0 -4px; padding: 2px 0 8px; }
}
.demo-banner {
  background: var(--blue-soft); color: var(--blue-deep); font-size: var(--t-sm);
  border-bottom: 1px solid var(--line);
}
.demo-banner .wrap { padding-block: 8px; }
main { padding-block: 28px 64px; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: var(--t-sm); color: var(--ink-2); }
.site-footer .wrap { padding-block: 28px; display: grid; gap: 10px; }
.site-footer p { max-width: 72ch; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--blue); color: var(--on-blue); font-weight: 650; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, transform .1s ease;
}
.btn:hover { background: var(--blue-deep); color: var(--on-blue); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-quiet { background: var(--blue-soft); color: var(--blue-deep); }
.btn-quiet:hover { background: var(--sky); color: var(--blue-deep); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-line:hover { background: var(--blue-soft); color: var(--ink); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: var(--t-sm); }

.search { position: relative; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: 520px; }
.search input {
  flex: 1 1 180px; min-width: 0; height: 48px; padding: 0 18px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 1.05rem; font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.search input::placeholder { color: var(--ink-2); letter-spacing: 0; }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.search-big { padding: 6px; background: var(--surface); border-radius: 999px; box-shadow: var(--lift); border: 1.5px solid var(--line); flex-wrap: nowrap; }
.search-big input { border: 0; height: 52px; font-size: 1.15rem; background: transparent; }
.search-big input:focus { box-shadow: none; }
.search-big .btn { min-height: 52px; padding: 0 24px; }
.search-error { width: 100%; color: var(--down); font-size: var(--t-sm); padding-left: 18px; }
.search-big .search-error { position: absolute; top: calc(100% + 8px); left: 0; }

.tabs { display: inline-flex; padding: 4px; gap: 2px; background: var(--blue-soft); border-radius: 999px; }
.tabs button {
  border: 0; background: transparent; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font-weight: 650; font-size: var(--t-sm); color: var(--ink-2);
}
.tabs button[aria-selected="true"], .tabs button[aria-pressed="true"] { background: var(--surface); color: var(--blue-deep); box-shadow: 0 1px 3px rgba(12, 30, 60, .12); }

input[type="range"] { width: 100%; accent-color: var(--blue); height: 32px; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--r-chip);
  background: var(--blue-soft); color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; font-variant-numeric: tabular-nums;
}
.chip b { color: var(--ink); font-weight: 700; }
.chip.up b { color: var(--up); }
.chip.down b { color: var(--down); }
button.chip { border: 0; cursor: pointer; }
button.chip:hover { background: var(--sky); color: var(--ink); }

.notice { padding: 22px; border-radius: var(--r-card); border: 1.5px dashed var(--sky); background: var(--surface); display: grid; gap: 8px; justify-items: start; }
.notice-title { font-family: var(--font-display); font-weight: 700; font-size: var(--t-lg); }
.notice p { max-width: 60ch; color: var(--ink-2); }

.copy-fallback { display: block; width: 100%; margin-top: 8px; min-height: 90px; border-radius: 12px; border: 1px solid var(--line); padding: 10px; background: var(--surface); }

/* ---------- blueprint stage ---------- */
.print {
  position: relative;
  background-color: var(--print);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
  border-radius: var(--r-stage);
  overflow: hidden;
}

/* ---------- house illustrations ---------- */
.house { display: block; width: 100%; height: auto; overflow: visible; }
.house path { stroke-linejoin: round; stroke-linecap: round; }
.house .h-l { stroke: var(--h-line); stroke-width: 1.6; }
.h-wall-a { fill: var(--h-wall-a); } .h-wall-b { fill: var(--h-wall-b); } .h-wall-c { fill: var(--h-wall-c); }
.h-roof-a { fill: var(--h-roof-a); } .h-roof-b { fill: var(--h-roof-b); }
.h-chim { fill: var(--h-roof-a); }
.h-window { fill: var(--h-window); }
.h-lit { fill: var(--lamp); }
.h-door { fill: var(--h-door); }
.h-knob { fill: var(--lamp); }
.h-step, .h-col, .h-gdoor { fill: var(--h-wall-b); }
.h-sign { fill: var(--h-wall-a); }
.h-ground { fill: var(--h-ground); }
.h-walk { fill: var(--h-walk); }
.h-tree { fill: var(--h-tree); } .h-tree2 { fill: var(--h-tree2); } .h-trunk { fill: var(--h-trunk); }
.h-pool { fill: var(--h-pool); }
.house .h-trim { fill: none; stroke-width: 1.2; opacity: .75; }
.house .h-ripple { fill: none; stroke: #ffffff; stroke-width: 1.4; opacity: .8; }
.h-ghost { fill: none; stroke: var(--h-ghost); stroke-width: 1.4; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.house.draw .h-l {
  stroke-dasharray: 1 1;
  animation:
    h-draw .8s cubic-bezier(.6, 0, .2, 1) calc(var(--d, 0ms) + var(--i) * 34ms) both,
    h-fill .5s ease calc(var(--d, 0ms) + var(--i) * 34ms + 520ms) both;
}
.house.draw .h-lit {
  animation:
    h-draw .8s cubic-bezier(.6, 0, .2, 1) calc(var(--d, 0ms) + var(--i) * 34ms) both,
    h-fill .5s ease calc(var(--d, 0ms) + var(--i) * 34ms + 520ms) both,
    h-lamp .6s ease calc(var(--d, 0ms) + var(--i) * 34ms + 1300ms) both;
}
@keyframes h-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes h-fill { from { fill-opacity: 0; } to { fill-opacity: 1; } }
@keyframes h-lamp { from { fill: var(--h-window); } to { fill: var(--lamp); } }
@media (prefers-reduced-motion: reduce) {
  .house.draw .h-l, .house.draw .h-lit { animation: none; }
}

/* ---------- chart ---------- */
.chart { display: block; touch-action: pan-y; font-family: var(--font-body); }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-label { fill: var(--ink-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.c-line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; }
.c-fill-top { stop-color: var(--blue); stop-opacity: .22; }
.c-fill-bottom { stop-color: var(--blue); stop-opacity: 0; }
.c-dot { fill: var(--surface); stroke: var(--blue); stroke-width: 3; }
.c-focus { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.c-tip { fill: var(--ink); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- page grids never grow wider than the screen ---------- */
.hero, .hero-copy, .groups, .group, .homes, .tm, .hl, .gp, .dy, .page-head, .result, .gp-panel, .value-panel, .gp-info { grid-template-columns: minmax(0, 1fr); }
.search input { width: 100%; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 8px; }
.hero h1 { font-size: clamp(2.6rem, 7.4vw, 5.1rem); line-height: .98; letter-spacing: -0.022em; max-width: 12ch; font-variation-settings: "opsz" 96; }
.hero .lede { font-size: var(--t-lg); color: var(--ink-2); max-width: 46ch; }
.hero-copy { display: grid; gap: 22px; }
.try { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--ink-2); font-size: var(--t-sm); padding-top: 6px; }
.hero-street { margin-top: 6px; }
.hero-street .street { height: clamp(150px, 22vw, 230px); width: 100%; }
.hero-street.print { padding-top: 26px; }
.groups { display: grid; gap: 36px; margin-top: 48px; }
.group { display: grid; gap: 16px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.tiles[data-count="4"] { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.tile {
  display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center;
  padding: 14px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, transform .15s ease;
}
.tile:hover { border-color: var(--blue); color: var(--ink); transform: translateY(-2px); }
.tile-art { border-radius: 14px; aspect-ratio: 1; display: grid; place-items: center; padding: 6px; max-width: 100%; }
.tile-art .house { width: 100%; }
.tile h3 { font-size: 1.15rem; }
.tile p { color: var(--ink-2); font-size: var(--t-sm); margin-top: 3px; }

/* ---------- page heads ---------- */
.page-head { display: grid; gap: 10px; margin-bottom: 22px; }
.page-head p { color: var(--ink-2); max-width: 60ch; font-size: 1.05rem; }

/* ---------- ZIP report ---------- */
.zip-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.zip-title { display: grid; gap: 4px; }
.zip-place { font-weight: 650; color: var(--ink-2); }
.zip-code { font-size: clamp(3.2rem, 11vw, 6rem); line-height: .9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.zip-head .search { flex: 0 1 340px; }
.report { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .report { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.value-panel { padding: 24px; display: grid; gap: 18px; align-content: start; }
.value-label { font-weight: 650; color: var(--ink-2); }
.value-big { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 8vw, 3.6rem); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.value-panel .house { max-width: 300px; margin: 0 auto; }
.tier { display: grid; gap: 8px; }
.tier-bar { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--sky), var(--blue)); margin: 14px 6px 4px; }
.tier-mark { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--surface); border: 3px solid var(--blue-deep); }
.tier-legend { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-xs); color: var(--ink-2); }
.tier-legend b { display: block; color: var(--ink); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.tier-legend span:nth-child(2) { text-align: center; }
.tier-legend span:last-child { text-align: right; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0; }
.facts div { padding: 12px 14px; border-radius: 14px; background: var(--surface); }
.facts dt { font-size: var(--t-xs); color: var(--ink-2); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.trend { padding: 22px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; min-width: 0; }
.trend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }

.homes { margin-top: 44px; display: grid; gap: 16px; }
.homes-head { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; }
.homes-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sorts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: var(--t-sm); color: var(--ink-2); }
.sorts button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: var(--t-sm); color: var(--ink-2); }
.sorts button[aria-pressed="true"] { border-color: var(--blue); color: var(--blue-deep); background: var(--blue-soft); }
.slides {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(86%, 380px); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 2px;
  padding: 4px 2px 18px; scrollbar-width: thin;
}
.slide {
  scroll-snap-align: start; display: grid; grid-template-rows: auto 1fr;
  border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  box-shadow: var(--lift); min-width: 0;
}
.slide-art { border-radius: 0; padding: 22px 12px 0; position: relative; }
.slide-rank {
  position: absolute; top: 12px; left: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface); font-weight: 700; font-size: var(--t-xs); color: var(--blue-deep); font-variant-numeric: tabular-nums;
}
.slide-tag { position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px; background: var(--lamp); color: #3a2a00; font-weight: 700; font-size: var(--t-xs); }
.slide-body { padding: 16px 18px 18px; display: grid; gap: 6px; align-content: start; }
.slide-price { font-family: var(--font-display); font-weight: 800; font-size: 1.85rem; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.slide-addr { font-weight: 650; overflow-wrap: anywhere; }
.slide-spec { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slide-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.slide-link { font-weight: 650; font-size: var(--t-sm); margin-top: 4px; justify-self: start; }
.slide-nav { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.slide-count { color: var(--ink-2); font-size: var(--t-sm); font-variant-numeric: tabular-nums; min-width: 6ch; text-align: right; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { border-color: var(--blue); color: var(--blue-deep); }
.icon-btn svg { width: 18px; height: 18px; }
.skeleton { background: linear-gradient(90deg, var(--blue-soft), var(--surface), var(--blue-soft)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; min-height: 360px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.source-note { font-size: var(--t-xs); color: var(--ink-2); }

/* ---------- Time Machine ---------- */
.tm { display: grid; gap: 18px; }
.tm-stage { padding: 22px 22px 18px; display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .tm-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; padding: 30px; } }
.tm-year {
  font-family: var(--font-display); font-weight: 800; line-height: .82; letter-spacing: -0.06em;
  font-size: clamp(5.5rem, 24vw, 12rem); color: var(--blue); font-variant-numeric: tabular-nums;
  font-variation-settings: "opsz" 96;
}
.tm-value { font-family: var(--font-display); font-weight: 750; font-size: clamp(1.8rem, 6vw, 2.6rem); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tm-house { max-width: 440px; width: 100%; justify-self: center; }
.tm-house .house { transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); transform-origin: 50% 84%; }
.tm-house.bump .house { transform: scale(1.04); }
.tm-controls { display: flex; gap: 12px; align-items: center; }
.tm-controls input { flex: 1; }
.tm-summary { font-size: 1.15rem; max-width: 60ch; }
.tm-summary select { border: 1.5px solid var(--line); border-radius: 10px; padding: 2px 6px; background: var(--surface); font-weight: 700; }
.tm-summary b { font-variant-numeric: tabular-nums; }

/* ---------- Showdown ---------- */
.sd-form { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; max-width: 640px; }
.sd-form label { display: grid; gap: 4px; font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); }
.sd-form input { height: 48px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 1.05rem; width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.sd-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.sd-vs { font-family: var(--font-display); font-weight: 800; color: var(--blue); padding-bottom: 12px; }
.sd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sd-board { margin-top: 24px; padding: 20px; display: grid; gap: 14px; }
.sd-houses { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.sd-side { display: grid; gap: 6px; text-align: center; justify-items: center; }
.sd-side .house { width: 100%; max-width: 260px; transform-origin: 50% 84%; }
.sd-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 6vw, 2.4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.sd-score { text-align: center; font-weight: 650; }
.sd-rows { display: grid; gap: 6px; background: var(--surface); border-radius: var(--r-card); padding: 10px; }
.sd-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(84px, auto) minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 4px; }
.sd-row + .sd-row { border-top: 1px solid var(--line); }
.sd-metric { text-align: center; font-size: var(--t-xs); font-weight: 650; color: var(--ink-2); line-height: 1.25; }
.sd-cell { display: grid; gap: 4px; font-variant-numeric: tabular-nums; font-weight: 650; }
.sd-cell.left { justify-items: end; text-align: right; }
.sd-bar { height: 8px; border-radius: 99px; background: var(--sky); min-width: 4px; max-width: 100%; }
.sd-cell.left .sd-bar { justify-self: end; }
.sd-cell.win { color: var(--blue-deep); font-weight: 800; }
.sd-cell.win .sd-bar { background: var(--blue); }

/* ---------- Higher or Lower ---------- */
.hl { display: grid; gap: 18px; }
.hl-score { display: flex; gap: 8px; flex-wrap: wrap; }
.hl-board { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: stretch; position: relative; }
@media (min-width: 760px) { .hl-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; } }
.hl-card { padding: 20px; display: grid; gap: 8px; align-content: start; transition: transform .4s ease, opacity .3s ease; }
.hl-card .house { max-width: 300px; margin: 0 auto; }
.hl-place { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.05; }
.hl-zip { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.hl-value { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 7vw, 2.8rem); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hl-hidden { color: var(--blue); }
.hl-q { font-weight: 600; color: var(--ink-2); }
.hl-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.hl-actions .btn { min-height: 52px; font-size: 1.05rem; }
.hl-mystery { aspect-ratio: 320 / 220; display: grid; place-items: center; max-width: 300px; width: 100%; margin: 0 auto; }
.hl-mystery svg { width: 100%; height: auto; }
.hl-qmark { font-family: var(--font-display); font-weight: 800; font-size: 64px; fill: var(--blue); }
.hl-card.right { box-shadow: inset 0 0 0 3px var(--up); }
.hl-card.wrong { box-shadow: inset 0 0 0 3px var(--down); }
.hl-card.leaving { transform: translateY(-12px); opacity: 0; }
.verdict { font-weight: 800; }
.verdict.right { color: var(--up); } .verdict.wrong { color: var(--down); }
.result { padding: 22px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; justify-items: start; }
.result-big { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 8vw, 3.4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Guess the Price ---------- */
.gp { display: grid; gap: 16px; }
.gp-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.gp-dots { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.gp-dots li { width: 28px; height: 8px; border-radius: 99px; background: var(--line); }
.gp-dots li.done { background: var(--blue); }
.gp-dots li.now { background: var(--sky); }
.gp-stage { padding: 20px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .gp-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; padding: 28px; } }
.gp-stage .house { max-width: 420px; margin: 0 auto; }
.gp-info { display: grid; gap: 10px; }
.gp-where { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 5vw, 2.1rem); line-height: 1.05; }
.gp-panel { padding: 20px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; }
.gp-readout { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 9vw, 3.4rem); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.gp-scale { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gp-nudge { display: flex; gap: 6px; flex-wrap: wrap; }
.gp-reveal { display: grid; gap: 6px; }
.gp-points { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--blue); font-variant-numeric: tabular-nums; }
.gp-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; width: 100%; }
.gp-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }

/* ---------- Neighborhood Daily ---------- */
.dy { display: grid; gap: 18px; max-width: 760px; }
.dy-top { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.dy-region { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: var(--t-sm); color: var(--ink-2); }
.dy-region select { border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 12px; background: var(--surface); font-weight: 650; color: var(--ink); max-width: 230px; }
.dy-clues { padding: 18px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.dy-clue { background: var(--surface); border-radius: 14px; padding: 10px 14px; display: grid; gap: 2px; min-height: 64px; }
.dy-clue dt { font-size: var(--t-xs); font-weight: 650; color: var(--ink-2); }
.dy-clue dd { margin: 0; font-family: var(--font-display); font-weight: 750; font-size: 1.2rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dy-clue.locked { background: transparent; border: 1.5px dashed var(--sky); }
.dy-clue.locked dd { color: var(--ink-2); font-family: var(--font-body); font-size: var(--t-sm); font-weight: 600; }
.dy-entry { position: relative; display: flex; gap: 8px; }
.dy-entry input { flex: 1; min-width: 0; height: 50px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 1.05rem; }
.dy-entry input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.dy-suggest {
  position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--lift); max-height: 300px; overflow-y: auto;
}
.dy-suggest li { padding: 9px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.dy-suggest li span { color: var(--ink-2); font-size: var(--t-sm); text-align: right; }
.dy-suggest li[aria-selected="true"], .dy-suggest li:hover { background: var(--blue-soft); }
.dy-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dy-row { display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.dy-row-name { font-weight: 700; overflow-wrap: anywhere; }
.dy-row-name span { color: var(--ink-2); font-weight: 500; }
.dy-tiles { display: flex; gap: 6px; flex-wrap: wrap; }
.mark { display: inline-flex; gap: 5px; align-items: center; padding: 4px 10px; border-radius: var(--r-chip); font-size: var(--t-sm); font-weight: 650; font-variant-numeric: tabular-nums; }
.mark.hit { background: var(--blue); color: var(--on-blue); }
.mark.close { background: var(--lamp); color: #3a2a00; }
.mark.miss { background: var(--blue-soft); color: var(--ink-2); }
.dy-row.solved { border-color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.dy-left { color: var(--ink-2); font-size: var(--t-sm); }

/* ---------- Your Block ---------- */
.block-form { display: grid; gap: 10px; margin-bottom: 24px; max-width: 640px; }
.block-search { max-width: none; flex-wrap: nowrap; }
.block-search input { letter-spacing: 0; }
.block-options { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--t-sm); }
.block-intro { padding: 26px 0 0; }
.row-wrap { overflow-x: auto; overscroll-behavior-x: contain; padding: 0 12px; scrollbar-width: thin; }
.row-wrap .row.house { display: block; margin: 0 auto; max-width: none; height: auto; width: 1300px; }
.block-intro .row-wrap .row.house { width: 760px; }
@media (min-width: 1000px) { .row-wrap .row.house, .block-intro .row-wrap .row.house { width: 100%; } }
.row-label { fill: var(--ink-2); font-family: var(--font-body); font-size: 17px; font-weight: 650; }
.row-label.is-here { fill: #3a2a00; }
.row-here { fill: var(--lamp); }
.block-head { display: grid; gap: 4px; margin-bottom: 14px; }
.block-head h2 { font-size: var(--t-2xl); }
.block-street { padding-top: 24px; margin-bottom: 16px; }
.block-facts { margin-bottom: 24px; }
.block-facts div { background: var(--surface); border: 1px solid var(--line); }
.block-facts dd small { font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.block-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 940px) { .block-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.map-card, .records { display: grid; gap: 12px; min-width: 0; }
.map-card { padding: 20px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.map-wrap { position: relative; max-width: 440px; width: 100%; margin: 0 auto; }
.map { display: block; width: 100%; height: auto; touch-action: manipulation; }
.map-ring { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 5 5; }
.map-ring-label { fill: var(--ink-2); font-size: 12px; font-weight: 600; font-family: var(--font-body); }
.map .dot { stroke: var(--surface); stroke-width: 2; }
.age-0 { fill: var(--surface); stroke: var(--ink-2) !important; }
.age-1 { fill: var(--age-1); } .age-2 { fill: var(--age-2); } .age-3 { fill: var(--age-3); } .age-4 { fill: var(--age-4); } .age-5 { fill: var(--age-5); }
.dot-here { fill: var(--lamp); stroke: var(--ink); stroke-width: 2; }
.dot-here-core { fill: var(--ink); }
.map-tip {
  position: absolute; z-index: 2; pointer-events: none; display: grid; gap: 2px; max-width: 240px;
  padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--lift); font-size: var(--t-sm); line-height: 1.35;
}
.map-tip span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--t-xs); color: var(--ink-2); font-weight: 600; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.era-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; background: currentColor; }
.legend .era-dot { margin-right: 0; }
.era-dot.age-1 { background: var(--age-1); } .era-dot.age-2 { background: var(--age-2); } .era-dot.age-3 { background: var(--age-3); }
.era-dot.age-4 { background: var(--age-4); } .era-dot.age-5 { background: var(--age-5); }
.era-dot.age-0 { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.here-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--lamp); box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 5px var(--lamp), inset 0 0 0 7px var(--ink); }
.tag-here { display: inline-block; white-space: nowrap; padding: 1px 8px; border-radius: 999px; background: var(--lamp); color: #3a2a00; font-size: var(--t-xs); font-weight: 700; vertical-align: 1px; }
.rec-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.rec { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.rec-art { border-radius: 12px; aspect-ratio: 1; display: grid; place-items: center; padding: 4px; max-width: 100%; }
.rec-title { font-size: var(--t-xs); font-weight: 650; color: var(--ink-2); }
.rec-value { font-family: var(--font-display); font-weight: 750; font-size: 1.15rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rec-addr { font-size: var(--t-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.block-list { margin-top: 32px; display: grid; gap: 12px; }
.table-wrap { overflow-x: auto; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); }
.homes-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); min-width: 860px; }
.homes-table th, .homes-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.homes-table tbody tr:last-child > * { border-bottom: 0; }
.homes-table thead th { position: sticky; top: 0; background: var(--surface); padding: 6px 8px; }
.homes-table thead button { border: 0; background: none; padding: 6px 6px; border-radius: 8px; font-weight: 700; font-size: var(--t-xs); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.homes-table thead button:hover { background: var(--blue-soft); color: var(--ink); }
.homes-table th[aria-sort="ascending"] button, .homes-table th[aria-sort="descending"] button { color: var(--blue-deep); background: var(--blue-soft); }
.homes-table th[aria-sort="ascending"] button::after { content: " ↑"; }
.homes-table th[aria-sort="descending"] button::after { content: " ↓"; }
.homes-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.homes-table thead .n { text-align: right; }
.homes-table tbody th { font-weight: 650; min-width: 190px; }
.homes-table tr.is-here > * { background: color-mix(in srgb, var(--lamp) 14%, var(--surface)); }
.cell-sub { display: block; color: var(--ink-2); font-weight: 500; font-size: var(--t-xs); }
#block-more { justify-self: start; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }

/* Value estimate for the searched home */
.est-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px; margin-bottom: 24px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); align-items: start; }
@media (min-width: 640px) { .est-card { grid-template-columns: 150px minmax(0, 1fr); gap: 22px; padding: 22px 24px; } }
.est-art { display: block; width: 116px; }
@media (min-width: 640px) { .est-art { width: 100%; } }
.est-body, #est-out { display: grid; gap: 10px; min-width: 0; justify-items: start; }
#est-out { width: 100%; }
.est-body h3 { font-size: var(--t-xl); }
.est-body p { max-width: 62ch; }
.est-note { font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); }
.est-label { font-size: var(--t-xs); font-weight: 650; color: var(--ink-2); }
.est-big { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 7vw, 3rem); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; margin-top: -4px; }
.est-range { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.est-range b { color: var(--ink); }
.est-comps-h { font-size: var(--t-sm); margin-top: 6px; }
.est-comps { list-style: none; margin: 0; padding: 0; width: 100%; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.est-comps li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: var(--t-sm); }
.est-comps li + li { border-top: 1px solid var(--line); }
.est-comps li > div { min-width: 0; }
.est-comps .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
