:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --ink: #17231d;
  --muted: #5d6b63;
  --line: #ddd8cb;
  --brand: #0f5c43;
  --brand-ink: #ffffff;
  --accent: #d9542b;
  --good: #0f7a4f;
  --warn: #a8650a;
  --bad: #b3361c;
  --soft: #e9f1ec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 35, 29, .06), 0 8px 24px rgba(23, 35, 29, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101613; --surface: #18211c; --ink: #ecf1ed; --muted: #9aa8a0; --line: #2b3831;
    --brand: #49c796; --brand-ink: #06231a; --accent: #ff8a5c; --good: #5fd3a2; --warn: #e8b04a; --bad: #ff8f76; --soft: #1e2b25;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }

/* header */
.top { display: flex; align-items: center; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.logo { font-family: Georgia, serif; font-weight: 700; font-size: 1.35rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.logo svg { width: 26px; height: 26px; color: var(--brand); }
.top .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; }
.tabs a.on { background: var(--soft); color: var(--brand); }

/* controls */
button, .btn { font: inherit; font-weight: 600; cursor: pointer; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 10px 18px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.ghost { background: transparent; }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--brand); text-decoration: underline; border-radius: 0; }
button:disabled { opacity: .6; cursor: default; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { min-height: 220px; resize: vertical; line-height: 1.5; }
label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; }
.filters .check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.filters .check input { width: 18px; min-height: 18px; height: 18px; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
section { padding: 44px 0; }
.banner { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.error { color: var(--bad); font-weight: 600; }

/* landing */
.hero { padding: 36px 0 20px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; }
.hero p.lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; }
.stats b { display: block; font-family: Georgia, serif; font-size: 1.6rem; }
.price { font-family: Georgia, serif; font-size: 3rem; font-weight: 700; line-height: 1; }
.price small { font-size: 1rem; font-weight: 400; color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; }
ul.ticks { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 8px; }
ul.ticks li { padding-left: 26px; position: relative; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }
footer { padding: 28px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }

/* verdict + range bar */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--ink); }
.pill.great, .pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill.high, .pill.very_high { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.range { position: relative; height: 34px; margin: 10px 0 22px; }
.range .track { position: absolute; left: 0; right: 0; top: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.range .box { position: absolute; top: 9px; height: 16px; border-radius: 4px; background: color-mix(in srgb, var(--brand) 35%, transparent); }
.range .mid { position: absolute; top: 5px; width: 2px; height: 24px; background: var(--brand); }
.range .you { position: absolute; top: 2px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); top: 10px; }
.range .lab { position: absolute; top: 34px; font-size: .72rem; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.range .lab.l { transform: none; left: 0; }
.range .lab.r { transform: none; right: 0; left: auto; }

/* tables / lists */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--soft); position: sticky; top: 0; }
td.r, th.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--soft); }
.listing { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.listing:last-child { border-bottom: 0; }
.listing:hover { background: var(--soft); }
.listing .rent { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; text-align: right; }
.listing .title { font-weight: 700; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 16px 0; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.kv div b { display: block; font-size: 1.15rem; }
.points { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; counter-reset: p; }
.points li { counter-increment: p; padding-left: 40px; position: relative; }
.points li::before { content: counter(p); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
.offer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.offer div { background: var(--soft); border-radius: 10px; padding: 12px 6px; }
.offer b { display: block; font-family: Georgia, serif; font-size: 1.5rem; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 22px; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* lease score */
.dial { --v: 50; --c: var(--brand); width: 168px; height: 168px; border-radius: 50%; margin: 6px auto 0; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--line) 0); }
.dial > div { width: 132px; height: 132px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; }
.dial b { font-family: Georgia, serif; font-size: 3.2rem; line-height: 1; }
.dial span { font-size: .85rem; font-weight: 700; color: var(--c); }
.locked { border: 1px dashed var(--line); border-radius: 10px; padding: 14px; background: var(--soft); }
.locked p { margin: 4px 0 8px; }
#result { padding-top: 8px; }
