/* propfinder: warm paper, ink type, one fynbos-green accent. */
:root {
  --paper: #f3f0e8;
  --surface: #fbfaf6;
  --ink: #16181a;
  --ink-2: #3b3d3e;
  --muted: #77726a;
  --line: #e2ddd0;
  --line-2: #d3cdbd;
  --accent: #0f5c4c;
  --accent-soft: #dfe9e3;
  --pos: #1e7a4f;
  --neg: #b8432b;
  --seg-bond: #16181a;
  --seg-costs: #8b8577;
  --seg-loss: #c9c2b1;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101211; --surface: #171918; --ink: #ece8df; --ink-2: #c9c5bc; --muted: #8f8a80;
    --line: #262927; --line-2: #343835; --accent: #74c6a8; --accent-soft: #1b2b25;
    --pos: #7bd3a0; --neg: #f08566; --seg-bond: #ece8df; --seg-costs: #8f8a80; --seg-loss: #4a4d4a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.5 var(--sans); font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.mark {
  width: 14px; height: 14px; align-self: center; border-radius: 3px 3px 3px 9px;
  background: var(--accent);
}
.wordmark { font-family: var(--serif); font-size: 21px; letter-spacing: -0.01em; }
.region { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 7px 14px; font-size: 14px;
}
.ghost:hover { border-color: var(--ink); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip { color: var(--muted); font-size: 13px; }
.primary {
  background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 500;
}
.primary:hover { background: var(--accent); }

main { padding: 0 clamp(16px, 4vw, 48px) 80px; max-width: 1320px; margin: 0 auto; }

/* ---------- Intro + stats ---------- */
.intro { padding: clamp(32px, 6vw, 72px) 0 28px; display: grid; gap: 14px; }
.intro h1 {
  font-family: var(--serif); font-weight: 400; margin: 0;
  font-size: clamp(36px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.025em;
}
.intro p { margin: 0; max-width: 46ch; color: var(--ink-2); font-size: 17px; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line);
}
.stat { padding: 18px 20px 20px 0; display: grid; gap: 2px; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat-value { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 13px; }

/* ---------- Controls ---------- */
.controls {
  display: flex; flex-wrap: wrap; align-items: end; gap: 14px 18px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.field { display: grid; gap: 4px; min-width: 130px; }
.field.grow { flex: 1 1 200px; }
.field.narrow { min-width: 0; width: 96px; }
.field span, .sort { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .sort select {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 14px; appearance: none; -webkit-appearance: none;
}
.field select, .sort select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px;
}
.field input:hover, .field select:hover { border-color: var(--line-2); }
.loc { position: relative; }
.loc-list {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px;
  list-style: none; max-height: 320px; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}
.loc-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 10px; border-radius: 6px; font-size: 14px; cursor: pointer;
}
.loc-list li[aria-selected="true"] { background: var(--accent-soft, var(--paper)); }
.loc-list li span { text-transform: none; letter-spacing: normal; color: inherit; font-size: inherit; }
.loc-list li .where { color: var(--muted); font-size: 12px; margin-left: 6px; }
.loc-list li .kind { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.loc-list .group { padding: 10px 10px 4px; cursor: default; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; padding-bottom: 8px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.track { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(14px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- List ---------- */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0 6px; flex-wrap: wrap; }
.list-head p { margin: 0; color: var(--muted); font-size: 14px; }
.sort { display: inline-flex; align-items: center; gap: 8px; }
.sort select { width: auto; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 14px; }

.cols, .deal {
  display: grid; align-items: center; gap: 20px;
  grid-template-columns: minmax(220px, 2.2fr) minmax(150px, 1.2fr) minmax(160px, 1.6fr) 110px 70px 56px;
}
.cols { padding: 10px 12px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.r { text-align: right; }
.deals { list-style: none; margin: 0; padding: 0; counter-reset: deal; }
.deal {
  padding: 16px 12px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative;
  transition: background .12s;
}
.deal:hover { background: var(--surface); }
.deal::before {
  counter-increment: deal; content: counter(deal, decimal-leading-zero);
  position: absolute; left: -34px; top: 18px; font-size: 12px; color: var(--muted);
}
.d-title { font-family: var(--serif); font-size: 18px; line-height: 1.25; letter-spacing: -0.01em; }
.d-area { color: var(--muted); font-size: 13px; margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); }
.tag.accent { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.d-price { display: grid; gap: 1px; }
.d-price .ask { font-size: 16px; }
.d-price .sub { font-size: 12px; color: var(--muted); }
.d-cash { text-align: right; font-size: 17px; font-weight: 500; }
.d-cash small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.d-yield { text-align: right; font-size: 15px; }
.d-room { display: flex; justify-content: flex-end; gap: 3px; }
.d-room i { width: 5px; height: 16px; border-radius: 2px; background: var(--line); }
.d-room i.on { background: var(--accent); }

/* Rent bar: where each rand of rent goes. */
.bar { display: grid; gap: 6px; }
.bar-track { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line); }
.bar-track span { height: 100%; }
.bar-track .bond { background: var(--seg-bond); }
.bar-track .costs { background: var(--seg-costs); }
.bar-track .loss { background: var(--seg-loss); }
.bar-track .surplus { background: var(--pos); }
.bar-label { font-size: 12px; color: var(--muted); }

.empty { padding: 56px 0; text-align: center; color: var(--muted); }
.empty strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 24px; color: var(--ink); margin-bottom: 6px; }
.empty code { background: var(--surface); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; font-size: 13px; }

/* ---------- Side sheets ---------- */
.sheet {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw);
  border: 0; border-left: 1px solid var(--line); padding: 28px 32px 40px;
  background: var(--surface); color: var(--ink); overflow-y: auto;
}
.sheet[open] { animation: slide .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.sheet::backdrop { background: rgb(16 18 17 / 0.35); backdrop-filter: blur(2px); }
.close { position: absolute; top: 18px; right: 20px; border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); }
.close:hover { color: var(--ink); }
.eyebrow { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.sheet h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; margin: 0 40px 8px 0; }
.sheet h3 { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 28px 0 8px; font-weight: 600; }
.muted { color: var(--muted); font-size: 14px; }
.sheet a { color: var(--accent); text-underline-offset: 3px; }

.big {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 22px 0 4px;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line);
}
.big div { padding: 14px 12px 14px 0; display: grid; }
.big div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.big b { font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -0.02em; line-height: 1.15; }
.big span { font-size: 12px; color: var(--muted); }

.lines { margin: 0; display: grid; }
.lines div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.lines dt { color: var(--ink-2); }
.lines dd { margin: 0; text-align: right; }
.lines .total { border-bottom: 0; border-top: 1px solid var(--ink); font-weight: 600; }
.note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.note.warn { color: var(--neg); }
.tag.warn { border-color: transparent; background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.comps { margin-top: 10px; font-size: 13px; }
.comps summary { cursor: pointer; color: var(--accent); }
.comps ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.comps li { margin: 3px 0; }
.comps a { color: inherit; }

.scenario { display: inline-flex; margin-top: 10px; }

#assumptions-form { display: grid; gap: 0; margin: 20px 0; }
.a-row { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.a-row label { font-size: 14px; }
.a-row small { display: block; color: var(--muted); font-size: 12px; }
.a-row input { width: 100%; text-align: right; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.sheet-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; bottom: -40px; background: var(--surface); padding: 14px 0; }

/* ---------- Small screens ---------- */
.filters-btn, .m-only, .filters-head, .filters-foot, .scrim { display: none; }
.count:empty { display: none; }
.count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--surface); font-size: 11px; line-height: 18px; text-align: center; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cols { display: none; }
  .deal { grid-template-columns: 1fr auto; gap: 10px 16px; }
  .deal::before { display: none; }
  .d-main { grid-column: 1 / -1; }
  .bar { grid-column: 1 / -1; order: 5; }
  .d-yield, .d-room { display: none; }
  .m-only { display: inline; }
  .region, .chip { display: none; }
}

/* Phones: filters fold away behind a button, the list header sticks under the top bar,
   sheets take the whole screen, and inputs are 16px so iOS doesn't zoom on focus. */
@media (max-width: 700px) {
  body { -webkit-tap-highlight-color: transparent; }
  .topbar {
    padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 12px;
    padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  }
  .wordmark { font-size: 20px; }
  .ghost { min-height: 40px; }
  main {
    display: flex; flex-direction: column;
    padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
  }
  .intro { padding: 28px 0 22px; gap: 10px; }
  .intro h1 { font-size: 38px; }
  .intro p { font-size: 15px; }
  .stat { padding: 14px 12px 14px 0; }
  .stat + .stat { padding-left: 14px; }
  .stat:nth-child(3) { padding-left: 0; }
  .stat-value { font-size: 28px; }
  .stat-label { font-size: 12px; line-height: 1.35; }

  .list-head {
    order: 1; position: sticky; top: var(--topbar-h, 64px); z-index: 4;
    display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
    margin: 0 calc(-1 * max(16px, env(safe-area-inset-left))); padding: 10px max(16px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
  }
  .list-head p { grid-column: 1 / -1; order: 3; font-size: 12.5px; line-height: 1.4; }
  .filters-btn { display: inline-flex; justify-self: start; }
  .filters-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .filters-btn[aria-expanded="true"] .count { background: var(--paper); color: var(--ink); }
  .sort { grid-column: 3; }
  .sort-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sort select { min-height: 40px; border-radius: 999px; padding-left: 14px; }
  /* Filters: a panel that slides up over the list, with every option in one place. */
  .controls { display: none; }
  .controls.open {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; gap: 16px 12px;
    margin: 0; padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
    background: var(--surface); border-radius: 20px 20px 0 0; border-top: 1px solid var(--line);
    box-shadow: 0 -12px 40px rgb(16 18 17 / 0.14); animation: rise .24s cubic-bezier(.2,.8,.2,1);
  }
  .filters-head {
    display: flex; flex: 1 1 100%; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 18px 0 6px;
  }
  .filters-head::before {
    content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
    border-radius: 2px; background: var(--line-2);
  }
  .filters-head h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -0.02em; margin: 0; }
  .filters-head .close { position: static; float: none; margin: 0 -6px 0 0; box-shadow: none; }
  .filters-foot {
    display: flex; flex: 1 1 100%; gap: 10px; position: sticky; bottom: 0; z-index: 2;
    margin-top: 4px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .filters-foot button { min-height: 48px; border-radius: 999px; }
  .filters-foot .primary { flex: 1; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgb(16 18 17 / 0.35); backdrop-filter: blur(2px); }
  .scrim[hidden] { display: none; }
  body.filters-open { overflow: hidden; }
  .deals { order: 3; }
  .seg { width: 100%; }
  .seg button { flex: 1; min-height: 38px; }
  .field, .field.grow { min-width: 0; flex: 1 1 100%; }
  .field.half, .field.narrow { flex: 1 1 calc(50% - 6px); width: auto; }
  .field input, .field select, .sort select { font-size: 16px; min-height: 44px; }
  .toggle { flex: 1 1 calc(50% - 6px); padding-bottom: 12px; }

  .deal { padding: 16px 0; gap: 8px 14px; }
  .deal:hover { background: transparent; }
  .deal:active { background: var(--surface); }
  .d-title { font-size: 17px; }
  .d-price .ask { font-size: 15px; }

  .sheet {
    width: 100vw; max-width: 100vw; border-left: 0;
    padding: calc(20px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }
  .sheet[open] { animation: rise .24s cubic-bezier(.2,.8,.2,1); }
  @keyframes rise { from { transform: translateY(32px); opacity: 0; } }
  .close {
    position: sticky; top: 0; float: right; z-index: 2; width: 44px; height: 44px; margin: -8px -10px 0 8px;
    border-radius: 50%; background: var(--surface); border: 1px solid var(--line);
    box-shadow: 0 2px 10px rgb(16 18 17 / 0.08);
  }
  .sheet h2 { font-size: 26px; margin-right: 0; }
  .seg.scenario { width: 100%; }
  .seg.scenario button { font-size: 13px; padding: 6px 8px; }
  .big b { font-size: 21px; }
  .big div { padding-right: 8px; }
  .big div + div { padding-left: 10px; }
  .a-row { grid-template-columns: 1fr 96px; gap: 12px; }
  .a-row input { font-size: 16px; min-height: 44px; }
  .sheet-actions { bottom: calc(-32px - env(safe-area-inset-bottom)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .sheet-actions .primary { flex: 1; min-height: 46px; }
  .sheet-actions .ghost { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Sign in ---------- */
.login-page { min-height: 100dvh; display: grid; place-items: center; }
.login {
  width: min(400px, 100%); margin: 0; display: grid; gap: 18px;
  padding: calc(32px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.login h1 {
  font-family: var(--serif); font-weight: 400; margin: 28px 0 0;
  font-size: 44px; line-height: 1.02; letter-spacing: -0.025em;
}
.login .muted { margin: -6px 0 6px; }
.login form { display: grid; gap: 14px; border-top: 1px solid var(--ink); padding-top: 22px; }
.login .field input { font-size: 16px; min-height: 46px; }
.login .primary { min-height: 48px; font-size: 16px; }
.login .primary:disabled { opacity: .6; cursor: progress; }
.login-error { margin: 0; min-height: 1.4em; color: var(--neg); font-size: 14px; }

.account { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.account[hidden] { display: none; }
.linkish { white-space: nowrap; border: 0; background: none; padding: 8px 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }

/* ---------- Detail visuals ---------- */
.viz { margin: 12px 0 4px; }
.headline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.headline b { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing: -0.02em; color: var(--accent); }
.headline span { font-size: 13px; color: var(--muted); }
.gauge { position: relative; height: 78px; margin: 6px 8px 0; }
.g-track { position: absolute; left: 0; right: 0; top: 38px; height: 2px; background: var(--line-2); }
.g-band { position: absolute; top: 33px; height: 12px; border-radius: 3px; background: var(--accent-soft); }
.g-floor {
  position: absolute; top: 33px; height: 12px; border-radius: 3px; opacity: .7;
  background: repeating-linear-gradient(135deg, var(--line-2) 0 2px, transparent 2px 6px);
}
.g-pin, .g-tick { position: absolute; top: 39px; width: 0; }
.g-pin::before { content: ""; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; }
.g-pin.ask::before { background: var(--surface); border: 2px solid var(--ink); box-sizing: border-box; }
.g-pin.offer::before { background: var(--accent); left: -8px; top: -8px; width: 16px; height: 16px; box-shadow: 0 0 0 3px var(--surface); }
.g-tick::before { content: ""; position: absolute; left: -1px; top: -13px; height: 26px; border-left: 2px dashed var(--muted); }
.g-label { position: absolute; white-space: nowrap; font-size: 12px; color: var(--ink-2); transform: translateX(-50%); }
.g-label.up { bottom: 14px; }
.g-label.down { top: 14px; }
.g-label b { font-weight: 600; color: var(--ink); }
.g-label.muted, .muted { color: var(--muted); }
.gauge .g-pin:first-of-type .g-label { transform: translateX(-50%); }
.room-head { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--ink-2); }
.room-head b { font-family: var(--serif); font-weight: 400; font-size: 24px; color: var(--ink); margin-left: auto; }
.room-rows { display: grid; gap: 7px; margin-top: 8px; }
.room-row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.room-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.room-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.room-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.m-row { display: grid; grid-template-columns: 72px 1fr 64px; align-items: center; gap: 10px; margin: 6px 0; font-size: 13px; }
.m-label { color: var(--ink-2); }
.m-total { text-align: right; font-variant-numeric: tabular-nums; }
.m-bar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--line); }
.m-bar i, .legend i { display: block; height: 100%; }
.m-bar i + i { box-shadow: inset 1px 0 0 var(--surface); }
.rent { background: var(--accent); }
.bond { background: var(--seg-bond); }
.levies { background: var(--ink-2); }
.rates { background: var(--seg-costs); }
.ins { background: color-mix(in srgb, var(--seg-costs) 70%, var(--surface)); }
.maint { background: color-mix(in srgb, var(--seg-costs) 45%, var(--surface)); }
.mgmt { background: var(--seg-loss); }
.loss { background: repeating-linear-gradient(135deg, var(--seg-loss) 0 2px, transparent 2px 5px); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 4px; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; }
.strip { position: relative; height: 66px; margin: 10px 12px 0; }
.s-axis { position: absolute; left: 0; right: 0; top: 22px; height: 1px; background: var(--line-2); }
/* 28px tap target around a 12px dot */
.s-dot {
  position: absolute; width: 28px; height: 28px; margin-left: -14px; padding: 0; border: 0;
  background: transparent; cursor: pointer; border-radius: 50%;
}
.s-dot::after {
  content: ""; position: absolute; inset: 8px; border-radius: 50%; box-sizing: border-box;
  border: 1.5px solid var(--accent); background: var(--surface);
}
.s-dot.same::after { background: var(--accent); }
.s-dot[aria-pressed="true"]::after { inset: 5px; box-shadow: 0 0 0 3px var(--accent-soft); }
.s-caption { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); min-height: 1.4em; }
.s-est { position: absolute; top: 2px; height: 46px; border-left: 2px solid var(--ink); }
.s-est span { position: absolute; top: 46px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: var(--ink-2); }
.s-est b { font-weight: 600; color: var(--ink); }
.s-scale { display: flex; justify-content: space-between; margin: 2px 8px 0; font-size: 11px; color: var(--muted); }
@media (max-width: 700px) {
  .headline b { font-size: 28px; }
  .comps summary { padding: 10px 0; }
  .comps li { margin: 0; padding: 8px 0; border-bottom: 1px dashed var(--line); }
  .room-row { grid-template-columns: 118px 1fr 40px; font-size: 12px; }
}

/* ---------- Busy state ---------- */
.loading { position: sticky; top: 0; z-index: 5; height: 3px; margin: 0 0 -3px; overflow: hidden; background: var(--accent-soft); border-radius: 2px; }
.loading::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 35%; border-radius: 2px; background: var(--accent);
  animation: busy-slide 1s ease-in-out infinite;
}
@keyframes busy-slide { from { left: -35%; } to { left: 100%; } }
.deals { transition: opacity .15s; }
.deals.is-busy { opacity: .45; pointer-events: none; }
#show-results.is-busy { opacity: .7; }
#show-results.is-busy::after { content: " …"; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .loading::after { width: 100% !important; left: 0 !important; opacity: .5; } }

/* Offer gauge legend and "how" disclosure */
.g-legend { margin: 4px 0 0; }
.g-legend .sw-gap { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.g-legend .sw-floor { background: repeating-linear-gradient(135deg, var(--line-2) 0 2px, transparent 2px 4px); border: 1px solid var(--line-2); }
.how { margin-top: 6px; font-size: 13px; color: var(--muted); }
.how summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; list-style: none;
}
.how summary::-webkit-details-marker { display: none; }
.how summary::after {
  content: "i"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line-2); font: italic 600 11px/1 var(--serif); color: var(--muted);
}
.how[open] summary::after { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.how p { margin: 2px 0 0; color: var(--ink-2); }
@media (max-width: 700px) { .how summary { min-height: 40px; } }

/* ---------- Property details: summary + accordion ---------- */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 14px 0 4px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.summary-grid > div { background: var(--surface); padding: 12px 14px; display: grid; gap: 2px; }
.summary-grid b { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -0.01em; line-height: 1.15; }
.summary-grid span { font-size: 12px; color: var(--muted); }
.summary-grid .offer b { color: var(--accent); }
.summary-grid .pos { color: var(--pos); }
.summary-grid .neg { color: var(--neg); }
.top-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; font-size: 14px; }
.acc { border-top: 1px solid var(--line); }
.acc:last-of-type { border-bottom: 1px solid var(--line); }
.acc:first-of-type { margin-top: 18px; }
.acc > summary {
  display: grid; grid-template-columns: 1fr auto 20px; align-items: center; gap: 10px;
  min-height: 56px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .acc-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.acc > summary .acc-peek { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.acc > summary .acc-peek.warn { color: var(--neg); }
.acc > summary::after {
  content: ""; justify-self: center; width: 8px; height: 8px; margin-top: -4px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s ease;
}
.acc[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.acc > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.acc-body { padding: 0 0 18px; }
.acc-body > .viz:first-child, .acc-body > .seg:first-child { margin-top: 0; }
.acc-body h3:first-child { margin-top: 4px; }
/* Smooth open/close where the browser supports animating to auto height; instant elsewhere. */
:root { interpolate-size: allow-keywords; }
.acc::details-content { height: 0; overflow: clip; transition: height .22s ease, content-visibility .22s allow-discrete; }
.acc[open]::details-content { height: auto; }
@media (max-width: 700px) {
  .summary-grid b { font-size: 20px; }
  .acc > summary { min-height: 60px; }
}
.headline-note { margin: 0 0 4px; font-size: 14px; color: var(--ink-2); }
.room-rows { margin-top: 0; }

/* ---------- Phone: each listing as its own quiet card ---------- */
@media (max-width: 700px) {
  .deals { display: grid; gap: 12px; padding-top: 4px; }
  .deal {
    padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: 14px;
    background: var(--surface); box-shadow: 0 1px 0 rgb(0 0 0 / 0.03);
    gap: 12px 14px; transition: transform .12s ease, border-color .12s ease;
  }
  .deal:active { background: var(--surface); transform: scale(.99); border-color: var(--line-2); }
  .deal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* Rank sits quietly in the corner so cards are easy to refer to ("number 3"). */
  .deal::before {
    display: block; position: absolute; left: auto; right: 16px; top: 16px;
    font-size: 11px; letter-spacing: 0.06em; color: var(--muted); font-variant-numeric: tabular-nums;
  }
  /* One hairline between who/where and the numbers. */
  .d-main { padding: 0 28px 12px 0; border-bottom: 1px solid var(--line); }
  .bar { gap: 5px; }
}

/* Rental agent switch */
.a-switch { padding: 0; justify-self: end; }
.a-row.off { opacity: .45; }
.a-row.off input { pointer-events: none; }
.inline-switch { display: inline-flex; align-items: center; gap: 10px; }
.inline-switch .a-switch { gap: 0; }
.inline-switch { white-space: nowrap; }
.lines .subtotal { border-bottom: 0; border-top: 1px solid var(--line-2); font-weight: 500; }
.a-flag { border-bottom: 0; padding-bottom: 2px; }
.stats.filtered #s-count-label { color: var(--accent); }
