/* Landed Valuation. Tokens from CONTRACT.md section 11; light theme only. Sage is the tool's
   accent and is used sparingly: the eyebrow dot, the range band, weight bars, "on the market". */
:root {
  --page: #f5f5f7;
  --card: #fff;
  --tile: #f5f5f7;
  --ink: #1d1d1f;
  --ink2: #6e6e73;
  --ink3: #86868b;          /* decoration only: fails contrast for small text */
  --line: #e6e6ea;
  --field: #86868b;         /* control borders: 3.6:1 on white, as on Apple's own forms */
  --soft: #f0f0f3;
  --blue: #0071e3;          /* every button and link */
  --blue-hover: #0077ed;
  --blue-text: #0066cc;
  --blue-soft: rgba(0, 113, 227, .08);
  --focus: rgba(0, 113, 227, .45);
  --sage: #4a6b4f;
  --sage-vivid: #7fa383;
  --sage-soft: rgba(127, 163, 131, .16);
  --good-bg: #e8f5ec; --good-fg: #1d7a3a;
  --mid-bg: #e8f1fc; --mid-fg: #0058b0;
  --early-bg: #efeff2; --early-fg: #4a4a4f;
  --red-bg: #fdecec; --red-fg: #b3261e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 10px 30px rgba(0, 0, 0, .05);
  --radius: 22px;
  --maxw: 880px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-width: 320px; background: var(--page); color: var(--ink);
  font: 17px/1.47 var(--font); letter-spacing: -.016em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
a { color: var(--blue-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3, h4 { margin: 0; }
img { max-width: 100%; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 16px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.skip:focus { top: calc(10px + env(safe-area-inset-top)); }

/* ---------- top bar: sticky and frosted ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(245, 245, 247, .8);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, #3a3a42, #1d1d1f); color: #fff;
  font-weight: 700; font-size: 11px; letter-spacing: .04em; box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 13px; font-weight: 600; }
.brand-text small { font-size: 12px; color: var(--ink2); white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user .who { font-size: 13px; color: var(--ink2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av {
  width: 32px; height: 32px; border-radius: 50%; background: var(--soft) center/cover; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--ink);
}
.signout { min-height: 44px; padding: 0 6px; font-size: 13px; color: var(--blue-text); background: none; border: 0; cursor: pointer; }
.signout:hover { text-decoration: underline; }
.dev-chip { font-size: 12px; font-weight: 600; color: var(--early-fg); padding: 5px 10px; border-radius: 999px; background: var(--early-bg); }

/* ---------- layout ---------- */
main {
  max-width: calc(var(--maxw) + 32px); margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}
.hero { text-align: center; padding: clamp(44px, 9vw, 104px) 0 clamp(30px, 5vw, 52px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; margin: 0 0 14px;
  font-size: 15px; font-weight: 600; color: var(--sage); letter-spacing: -.01em;
}
.eyebrow .dot, .onmarket .dot, .own-listing .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage-vivid); box-shadow: 0 0 0 4px var(--sage-soft); flex: none; }
h1 { font-size: clamp(40px, 8vw, 64px); line-height: 1.05; letter-spacing: -.04em; font-weight: 700; text-wrap: balance; }
.lede { margin: 18px auto 0; max-width: 600px; font-size: clamp(19px, 2.6vw, 23px); line-height: 1.38; color: var(--ink2); letter-spacing: -.02em; text-wrap: pretty; }
.dataline { margin: 18px 0 0; min-height: 20px; font-size: 14px; color: var(--ink2); font-variant-numeric: tabular-nums; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .card + .result-wrap, .result > .card + .card { margin-top: 20px; }
.gate { padding: clamp(28px, 5vw, 44px); text-align: center; }
.gate h2 { font-size: 24px; letter-spacing: -.025em; }
.gate p { margin: 8px auto 22px; color: var(--ink2); max-width: 440px; }
.notice { padding: 20px 22px; margin-bottom: 18px; }
.notice strong { display: block; margin-bottom: 4px; }
.notice p { margin: 0; color: var(--ink2); }
.notice.error { box-shadow: var(--shadow), inset 0 0 0 1px rgba(179, 38, 30, .25); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 980px; border: 0; cursor: pointer;
  font-size: 16px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, transform .15s, box-shadow .2s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:disabled { background: #b8d6f6; cursor: default; transform: none; }
.btn-large { min-height: 54px; padding: 0 34px; font-size: 17px; font-weight: 600; }
.btn-secondary { background: var(--card); color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.btn-secondary:hover { background: var(--blue-soft); }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn.busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkish {
  display: inline-flex; align-items: center; min-height: 44px; margin: 4px 0 0 2px; padding: 0;
  background: none; border: 0; color: var(--blue-text); font-size: 16px; cursor: pointer;
}
.linkish:hover { text-decoration: underline; }

/* ---------- the finder ---------- */
.tool { padding: clamp(22px, 5vw, 40px); }
.card-title { margin: 0 0 20px; font-size: 24px; font-weight: 700; letter-spacing: -.028em; }
.steps { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.step { min-width: 0; }
.step > label, .field > label, .field-label {
  display: flex; align-items: center; gap: 9px; padding: 0; margin: 0 0 8px 2px;
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.step .n {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--tile); color: var(--ink2); font-size: 13px; font-weight: 700; transition: background-color .2s, color .2s;
}
.step.done .n { background: var(--ink); color: #fff; }
.field { min-width: 0; border: 0; margin: 0; padding: 0; }
.field-hint { margin: 7px 2px 0; font-size: 13px; color: var(--ink2); }
.hint { margin: 0 0 16px; color: var(--ink2); font-size: 16px; }
.select { position: relative; }
.select::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; pointer-events: none;
  border-right: 2px solid var(--ink2); border-bottom: 2px solid var(--ink2); transform: translateY(-70%) rotate(45deg);
}
select, .manual input {
  display: block; width: 100%; min-height: 52px; margin: 0;
  padding: 0 38px 0 16px; border-radius: 14px; border: 1px solid var(--field); background: var(--card);
  font-size: 17px; color: var(--ink); -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s; text-overflow: ellipsis;
}
.manual input { padding-right: 16px; }
select:hover:not(:disabled), .manual input:hover { border-color: var(--ink3); }
select:focus-visible, .manual input:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--focus); }
select:disabled { background: #fafafc; color: var(--ink2); cursor: default; }
.select:has(select:disabled)::after { opacity: .4; }
[aria-invalid="true"] { border-color: var(--red-fg) !important; }

.manual { margin: 26px 0 0; padding: 24px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.manual-title { float: left; width: 100%; padding: 0; margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -.022em; }
.manual-title ~ * { clear: both; }
.manual-fields { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }

/* ---------- the house card ---------- */
.house { padding: clamp(24px, 5vw, 44px); }
.h-kicker { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink2); }
.h-title { margin: 4px 0 0; font-size: clamp(28px, 5vw, 40px); font-weight: 700; letter-spacing: -.035em; line-height: 1.1; overflow-wrap: anywhere; }
.h-where { margin: 6px 0 0; color: var(--ink2); font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.chips li { padding: 6px 12px; border-radius: 999px; background: var(--tile); font-size: 14px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.chips.small { margin-top: 14px; }
.chips.small li { font-size: 13px; color: var(--ink2); }
.onmarket, .own-listing { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; font-size: 15px; color: var(--ink2); }
.cond { margin: 30px 0 0; padding: 26px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.cond legend { float: left; width: 100%; font-size: 19px; font-weight: 700; letter-spacing: -.022em; margin-bottom: 12px; }
.cond legend ~ * { clear: both; }
/* The segmented control: four equal segments on one track, two by two on narrow phones. */
.seg4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: var(--tile); }
.seg4 label { position: relative; display: block; cursor: pointer; }
.seg4 input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg4 .opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: 6px 8px;
  border-radius: 12px; text-align: center; line-height: 1.2; transition: background-color .2s, box-shadow .2s;
}
.seg4.seg2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg4 .opt b { font-size: 16px; font-weight: 600; }
.seg4 .opt small { margin-top: 2px; font-size: 13px; color: var(--ink2); }
.seg4 label:hover .opt { background: rgba(255, 255, 255, .6); }
.seg4 input:checked + .opt { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .04); }
.seg4 input:focus-visible + .opt { outline: 3px solid var(--focus); outline-offset: 1px; }
.cat-reason { margin: 12px 2px 0; font-size: 15px; color: var(--ink2); min-height: 22px; }
.cta { margin-top: 28px; }
.cta .btn-primary { width: 100%; }
.form-error { margin: 12px 2px 0; color: var(--red-fg); font-size: 15px; }

.reveal { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- the result ---------- */
.result-wrap { margin-top: 20px; scroll-margin-top: 72px; }
.result-wrap:has(#resultBody:empty) { margin-top: 0; }
.result-wrap:has(#resultMore:empty) { margin-top: 0; }
.result { animation: rise .55s var(--ease) both; }
.result.is-stale > :not(.stale-note) { opacity: .4; transition: opacity .2s; }
.stale-note { display: none; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--mid-bg); color: var(--mid-fg); font-size: 15px; text-align: center; }
.result.is-stale .stale-note { display: block; }

.r-hero { padding: clamp(28px, 6vw, 60px) clamp(20px, 5vw, 48px); text-align: center; }
.r-top { display: grid; gap: 18px; justify-items: center; }
.r-photo { width: min(100%, 420px); }
.r-subject { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.r-meta { margin: 2px 0 0; font-size: 15px; color: var(--ink2); }
.r-kicker { margin: 30px 0 0; font-size: 15px; font-weight: 600; color: var(--ink2); letter-spacing: -.01em; outline: none; }
.r-figure {
  margin: 8px 0 8px; font-size: clamp(44px, 11vw, 88px); font-weight: 700; line-height: 1;
  letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.r-psf { margin: 0; font-size: 17px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.r-range { margin: 26px 0 0; font-size: clamp(17px, 2.4vw, 21px); color: var(--ink2); letter-spacing: -.02em; }
.r-range b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* range bar: the sage band is the likely range, the ring is the estimate, grey dots are comparables */
.rb { position: relative; max-width: 520px; height: 44px; margin: 14px auto 0; }
.rb-line { position: absolute; left: 0; right: 0; top: 29px; height: 4px; border-radius: 2px; background: var(--line); }
.rb-range {
  position: absolute; top: 27px; height: 8px; border-radius: 4px; background: var(--sage-vivid);
  left: var(--lo); width: calc(var(--hi) - var(--lo)); transform-origin: center;
  animation: grow .6s var(--ease) .1s both;
}
.rb-mark {
  position: absolute; top: 31px; left: var(--mid); width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; background: var(--card); box-shadow: 0 0 0 3px var(--ink), 0 2px 8px rgba(0, 0, 0, .25);
  animation: slide .8s var(--ease) .2s both;
}
.rb-dot { position: absolute; top: 8px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--ink3); opacity: .5; }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes slide { from { left: var(--lo); } }
.rb-caption { max-width: 520px; margin: 8px auto 0; font-size: 13px; color: var(--ink2); }
.r-talk { margin: 16px 0 0; text-align: center; font-size: 15px; }
.r-talk a { display: inline-flex; align-items: center; min-height: 44px; }

.conf { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin-top: 20px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.pill.lvl2 { background: var(--good-bg); color: var(--good-fg); }
.pill.lvl1 { background: var(--mid-bg); color: var(--mid-fg); }
.pill.lvl0 { background: var(--early-bg); color: var(--early-fg); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { display: block; width: 3px; border-radius: 1px; background: currentColor; opacity: .25; }
.bars i:nth-child(1) { height: 5px; } .bars i:nth-child(2) { height: 8px; } .bars i:nth-child(3) { height: 12px; }
.bars i.on { opacity: 1; }
.conf-meaning { font-size: 15px; color: var(--ink2); max-width: 420px; }

.disclaimer {
  display: flex; gap: 10px; align-items: flex-start; max-width: 640px; margin: 30px auto 0; padding: 14px 16px;
  border-radius: 14px; background: var(--tile); color: var(--ink2); font-size: 13px; line-height: 1.5; text-align: left;
}
.disclaimer .i { width: 16px; height: 16px; margin-top: 1px; color: var(--ink2); }
.disclaimer b { color: var(--ink); font-weight: 600; }

/* photos: a fixed frame so the page never jumps as images arrive */
.ph { position: relative; margin: 0; aspect-ratio: 5 / 3; border-radius: 14px; overflow: hidden; background: var(--soft); }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 6px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .45)); text-align: left; }
.ph-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink); background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ph-none, .ph-failed { display: grid; place-items: center; color: var(--ink3); }
.ph-none .i { width: 36px; height: 36px; stroke-width: 1.4; }
.ph-failed img, .ph-failed figcaption { display: none; }
.ph-failed::after { content: "Photo unavailable"; font-size: 13px; color: var(--ink2); }

/* ---------- asking prices ---------- */
.asking { padding: clamp(24px, 5vw, 44px); }
.sec-title { font-size: clamp(24px, 3.6vw, 32px); font-weight: 700; letter-spacing: -.03em; }
.sec-sub { margin: 6px 0 0; font-size: 16px; color: var(--ink2); }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.tier { min-width: 0; padding: 20px 18px; border-radius: 18px; background: var(--tile); }
.tier-label { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink2); }
.tier-price { margin: 6px 0 0; font-size: clamp(24px, 3.4vw, 30px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tier-price .muted { font-size: 17px; color: var(--ink2); font-weight: 600; }
.tier-speed { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 15px; font-weight: 500; color: var(--ink); }
.meter { display: inline-flex; gap: 3px; flex: none; }
.meter i { width: 12px; height: 4px; border-radius: 2px; background: var(--ink3); opacity: .25; }
.meter i.on { background: var(--sage); opacity: 1; }
.tier-vs, .tier-weeks { margin: 4px 0 0; font-size: 14px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.basis { margin: 18px 0 0; font-size: 14px; color: var(--ink2); }
.quiet .quiet-msg { margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--tile); color: var(--ink2); font-size: 15px; }

/* Similar homes for sale under the tiers: a plain list, no photos. */
.similar { margin-top: 26px; }
.similar-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.similar-sub { margin: 4px 0 0; font-size: 14px; color: var(--ink2); }
.similar-list { margin: 10px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.sim { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sim-main { min-width: 0; }
.sim-addr { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.sim-facts { margin: 3px 0 0; font-size: 14px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.sim-side { flex: none; text-align: right; }
.sim-price { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sim-price small { font-size: 13px; font-weight: 500; color: var(--ink2); }
.sim-psf { margin: 2px 0 0; font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.sim-link { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; font-size: 14px; font-weight: 500; }
.sim-link .i { width: 14px; height: 14px; }

/* ---------- how we got here ---------- */
.fold summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 60px; padding: 16px 22px; cursor: pointer; list-style: none; border-radius: inherit;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary:hover .fold-title { color: var(--blue); }
.fold-title { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.fold-title.big { font-size: clamp(22px, 3.2vw, 28px); font-weight: 700; letter-spacing: -.03em; }
.fold-sub { display: block; margin-top: 2px; font-size: 15px; color: var(--ink2); }
.chev { flex: none; width: 10px; height: 10px; margin-right: 4px; border-right: 2px solid var(--ink2); border-bottom: 2px solid var(--ink2); transform: rotate(45deg); transition: transform .25s var(--ease); }
.fold[open] > summary .chev { transform: rotate(225deg); }
.how > summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 14px;
  padding: clamp(20px, 4vw, 32px) clamp(20px, 5vw, 44px);
}
.how > summary .fold-title, .how > summary .fold-sub { grid-column: 1; }
.how > summary .chev { grid-column: 2; grid-row: 1 / span 2; }
.how > .fold-body { padding: 0 clamp(20px, 5vw, 44px) clamp(24px, 5vw, 44px); }
.fold[open] > .fold-body, .fold.inner[open] > .working { animation: rise .35s var(--ease) both; }
.how-sec { padding-top: 30px; margin-top: 30px; border-top: 1px solid var(--line); }
.how-sec:first-child { margin-top: 0; }
.how-sec > h3 { font-size: 21px; letter-spacing: -.022em; font-weight: 700; }
.how-sec h4 { margin: 22px 0 0; font-size: 15px; font-weight: 600; color: var(--ink2); }
.lead { margin: 8px 0 0; font-size: 17px; }
.aside, .own-sale-line { margin: 10px 0 0; font-size: 15px; color: var(--ink2); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { min-width: 0; padding: 16px; border-radius: 16px; background: var(--tile); }
.tile-label { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink2); }
.tile-value { margin: 6px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-value small { font-size: 14px; font-weight: 500; color: var(--ink2); }
.tile-value.muted { font-size: 17px; color: var(--ink2); font-weight: 600; }
.tile-sub { margin: 6px 0 0; font-size: 13px; color: var(--ink2); }
.tile-tech { margin: 6px 0 0; font-size: 12px; color: var(--ink2); }

.adj, .notes { margin: 8px 0 0; padding: 0; list-style: none; }
.adj li { display: grid; gap: 2px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.adj li:first-child, .notes li:first-child { border-top: 1px solid var(--line); }
.adj b { font-weight: 600; }
.adj span { color: var(--ink2); }
.notes li { position: relative; padding: 10px 0 10px 20px; border-bottom: 1px solid var(--line); font-size: 15px; }
.notes li::before { content: ""; position: absolute; left: 4px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink3); }
.notes.small { margin-top: 12px; }
.notes.small li { font-size: 14px; color: var(--ink2); }
.fold.inner { margin-top: 18px; border-radius: 16px; background: var(--tile); }
.fold.inner summary { min-height: 52px; padding: 12px 16px; }
.working { margin: 0; padding: 0 16px 14px; }
.working div { padding: 10px 0; border-top: 1px solid var(--line); }
.working dt { font-size: 14px; font-weight: 600; }
.working dd { margin: 2px 0 0; font-size: 15px; color: var(--ink2); }
.working.small dt, .working.small dd { font-size: 13px; }

.comps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.comps.more { margin-top: 14px; }
.comp { min-width: 0; border-radius: 18px; background: var(--tile); overflow: hidden; }
.comp .ph { border-radius: 0; aspect-ratio: 5 / 3; }
.comp-body { padding: 14px 16px 16px; }
.comp-addr { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.015em; overflow-wrap: anywhere; }
.comp-when { margin: 2px 0 0; font-size: 14px; color: var(--ink2); }
.comp-price { margin: 8px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.comp-price small { font-size: 14px; font-weight: 500; color: var(--ink2); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 10px 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--ink2); }
.facts dd { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wbar { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.wbar-track { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.wbar-track i { display: block; height: 100%; min-width: 2px; border-radius: 2px; background: var(--sage-vivid); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--sage-soft); color: var(--sage); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.more-btn { margin-top: 16px; }
.view { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 4px; font-size: 15px; }
.view .i { width: 15px; height: 15px; }

.evmap { position: relative; margin: 16px 0 0; border-radius: 18px; overflow: hidden; background: var(--soft); aspect-ratio: 2 / 1; }
.evmap img { display: block; width: 100%; height: 100%; object-fit: cover; }
.evmap figcaption { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; font-size: 12px; color: var(--ink2); background: rgba(255, 255, 255, .88); }
.evmap.ph-failed { display: grid; place-items: center; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px -4px 0; padding: 0 4px; border-radius: 12px; }
.table-wrap:focus-visible { outline: 3px solid var(--focus); }
table.ev { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ev th, .ev td { padding: 11px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ev thead th { font-size: 12px; font-weight: 600; color: var(--ink2); }
.ev tbody th { font-weight: 600; }
.ev td.num, .ev th.num { text-align: right; }
.ev tr.on { background: var(--sage-soft); }
.ev tr:last-child td, .ev tr:last-child th { border-bottom: 0; }

/* no estimate */
.noest-title { margin: 18px 0 8px; font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -.03em; }
.noest-msg { margin: 0 auto; max-width: 520px; color: var(--ink2); }
.try { max-width: 520px; margin: 22px auto 0; text-align: left; }
.try h3 { font-size: 17px; }
.try ul { margin: 8px 0 0; padding-left: 20px; }
.try li + li { margin-top: 4px; }
.plain { padding: clamp(20px, 5vw, 44px); }
.plain .how-sec { margin: 0; padding: 0; border: 0; }

/* skeletons */
.skeleton { display: grid; gap: 18px; }
.sk { border-radius: 14px; background: linear-gradient(90deg, var(--soft), #f8f8fa, var(--soft)); background-size: 200% 100%; animation: sh 1.4s linear infinite; }
.sk-title { height: 26px; width: 40%; }
.sk-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sk-field { height: 52px; }
.sk-figure { height: 76px; width: 60%; margin: 18px auto; }
.sk-line { height: 18px; width: 40%; margin: 0 auto; }
.sk-line.left { margin: 0; width: 34%; }
.sk-tiles { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 22px; }
.sk-tile { height: 120px; border-radius: 18px; }
.r-hero .sk + .sk, .asking .sk + .sk-tiles { margin-top: 14px; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- footer ---------- */
.foot { margin-top: 48px; border-top: 1px solid var(--line); }
.foot-inner {
  max-width: calc(var(--maxw) + 32px); margin: 0 auto;
  padding: 28px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  font-size: 13px; color: var(--ink2);
}
.foot-disclaimer h2 { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.foot-disclaimer p { margin: 0; line-height: 1.55; }
.foot-disclaimer strong { color: var(--ink); font-weight: 600; }
.foot-sources, .foot-calib { margin: 14px 0 0; }
.foot-calib:empty { display: none; }
.foot-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; }
.foot-meta span:empty { display: none; }
.noscript { max-width: var(--maxw); margin: 20px auto; padding: 0 16px; }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 20;
  max-width: min(92vw, 440px); padding: 12px 18px; border-radius: 14px; background: rgba(29, 29, 31, .92); color: #fff;
  font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); opacity: 0; pointer-events: none;
  transform: translate(-50%, 16px); transition: opacity .2s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red-fg); }

/* ---------- public page (CONTRACT.md section 13) ---------- */
.brand.pub { gap: 12px; }
.brand-home { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.brand-home:hover { text-decoration: none; }
.brand-tool { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.cat-help { list-style: none; margin: 14px 2px 0; padding: 0; display: grid; gap: 6px; font-size: 15px; color: var(--ink2); }
.cat-help b { color: var(--ink); font-weight: 600; }

.consult { margin-top: 20px; padding: clamp(22px, 5vw, 40px); scroll-margin-top: 72px; }
.c-form { display: grid; gap: 18px; margin-top: 18px; }
.c-form .field > label { margin-bottom: 8px; }
.c-form input[type="text"], .c-form input[type="tel"], .c-form input[type="email"], .c-form textarea {
  display: block; width: 100%; min-height: 52px; margin: 0; padding: 12px 16px;
  border-radius: 14px; border: 1px solid var(--field); background: var(--card);
  font: inherit; font-size: 17px; color: var(--ink);
}
.c-form textarea { min-height: 120px; resize: vertical; line-height: 1.4; }
.c-form input:focus-visible, .c-form textarea:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--focus); }
.c-intent { margin: 0; padding: 0; border: 0; min-width: 0; }
.c-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.c-choice {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  border-radius: 14px; background: var(--tile); cursor: pointer; font-size: 16px;
}
.c-choice input, .c-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--blue); }
.c-check { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.c-check label { font-size: 16px; line-height: 1.4; cursor: pointer; }
.c-check .c-what { grid-column: 2; margin: 4px 0 0; font-size: 14px; color: var(--ink2); }
.c-extra { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.c-notice { margin: 16px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--early-bg); color: var(--early-fg); font-size: 15px; }
.c-errors { margin: 16px 0 0; padding: 14px 18px; border-radius: 14px; background: var(--red-bg); color: var(--red-fg); font-size: 15px; }
.c-errors h3 { font-size: 16px; margin: 0 0 4px; }
.c-errors p, .c-errors ul { margin: 4px 0 0; }
.c-errors a { color: var(--red-fg); text-decoration: underline; }
.c-field-error { margin: 0 0 -10px 2px; color: var(--red-fg); font-size: 15px; font-weight: 600; }
.c-status { margin: 0; min-height: 0; font-size: 15px; color: var(--ink2); }
.c-status:empty { display: none; }
.c-status[data-consult-notice="preview"] { margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; background: var(--early-bg); color: var(--early-fg); }
.c-form .btn-primary { justify-self: start; min-height: 52px; padding: 0 30px; }
.c-sent { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--good-bg); color: var(--good-fg); }
.c-sent p { margin: 0; }
.c-sent .c-ref { margin-top: 6px; }
.foot-public p { margin: 0; line-height: 1.55; }
.foot-public p + p { margin-top: 10px; }
.foot-public .pub-disclaimer { color: var(--ink); }
.foot-public strong { color: var(--ink); font-weight: 600; }

/* ---------- wider screens ---------- */
@media (min-width: 720px) {
  .steps { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); }
  .manual-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .cta .btn-primary { width: auto; min-width: 240px; }
  .cta .form-error { margin: 0; }
  .comps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- phones ---------- */
@media (max-width: 719px) {
  body { font-size: 16px; }
  .brand-text strong { display: none; }
  .brand-text small { font-size: 15px; font-weight: 600; color: var(--ink); }
  .user .who { display: none; }
  .tiers, .tiles, .tiles.four, .sk-tiles, .sk-grid, .comps { grid-template-columns: minmax(0, 1fr); }
  /* Stacked asking cards: label and price on one line, the rest below. */
  .tier { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; padding: 16px; }
  .tier-price { grid-column: 2; grid-row: 1; margin: 0; font-size: 24px; text-align: right; }
  .tier-label { grid-column: 1; grid-row: 1; }
  .tier-speed, .tier-vs, .tier-weeks { grid-column: 1 / -1; }
  .tile { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; }
  .tile-value { margin: 0; font-size: 21px; }
  .tile-sub, .tile-tech { flex-basis: 100%; margin-top: 4px; }
  .comp { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
  .comp .ph { aspect-ratio: auto; height: 100%; min-height: 112px; }
  .comp .ph figcaption { display: none; }
  .comp-body { padding: 12px 14px 14px; }
  /* Similar homes: the price and link go under the street and sizes. */
  .sim { flex-direction: column; align-items: stretch; gap: 4px; }
  .sim-side { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; text-align: left; }
  .sim-link { min-height: 40px; margin-left: auto; }
}

/* The narrowest phones (320px to 359px): the segmented control goes two by two and gutters
   tighten. 375px and 390px iPhones keep the phone layout above, with thumbnails beside the facts. */
@media (max-width: 359px) {
  main { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .seg4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comp { grid-template-columns: minmax(0, 1fr); }
  .comp .ph { aspect-ratio: 5 / 3; height: auto; min-height: 0; }
  .tier { grid-template-columns: minmax(0, 1fr); }
  .tier-price { grid-column: 1; grid-row: auto; text-align: left; margin-top: 4px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .chips li { font-size: 13px; }
  .c-choices { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- print: the result, its evidence and the disclaimer only ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; min-width: 0; }
  .topbar, .hero, .gate, .notice, #loading, #finder, #houseCard, #consult, .r-talk, .skip, .toast, .stale-note, .more-btn, noscript { display: none !important; }
  main { max-width: none; padding: 0; }
  .card, .result { box-shadow: none; animation: none; }
  .comps.more[hidden] { display: grid !important; }
  .rb-range, .rb-mark { animation: none; }
  .foot { margin-top: 16px; border: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
