:root {
  --ink: #0f2433; --muted: #5d6c7b; --faint: #8a97a5; --line: #e2e8ee; --bg: #f5f7f9; --card: #fff;
  --brand: #0e7c66; --brand-dark: #0a5e4d; --brand-soft: #e6f4f0; --good: #16865d; --bad: #c4413b; --warn: #b7791f;
  --radius: 14px; --shadow: 0 1px 2px rgba(15, 36, 51, .06), 0 4px 16px rgba(15, 36, 51, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }   /* clear the sticky header */
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* header */
.top { position: sticky; top: 0; z-index: 1100; background: var(--ink); color: #fff; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #c9d4de; text-decoration: none; padding: 7px 11px; border-radius: 8px; font-weight: 600; font-size: .92rem; }
.nav a:hover, .nav a.on { color: #fff; background: rgba(255, 255, 255, .1); }
.top .pill { margin-left: auto; font-size: .78rem; color: #c9d4de; border: 1px solid rgba(255, 255, 255, .2); padding: 4px 10px; border-radius: 99px; }
main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; }
.foot { max-width: 1240px; margin: 0 auto; padding: 0 20px 30px; color: var(--faint); font-size: .78rem; }

/* building blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
label { display: block; font-size: .78rem; font-weight: 650; color: var(--muted); margin: 0 0 4px; }
input, select, textarea { width: 100%; min-width: 0; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cdd6df; border-radius: 9px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(14, 124, 102, .35); border-color: var(--brand); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: .92rem; border: 1px solid #cdd6df; background: #fff; color: var(--ink); padding: 9px 15px; border-radius: 10px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.small { padding: 6px 11px; font-size: .84rem; }
.btn[disabled] { opacity: .55; cursor: default; }
.error { background: #fdecea; color: #8c2c26; border: 1px solid #f5c6c2; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; }
.note { background: var(--brand-soft); border: 1px solid #c3e5dc; padding: 11px 14px; border-radius: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #eef2f5; color: #34485a; border-radius: 99px; padding: 3px 10px; font-size: .8rem; font-weight: 650; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 650; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.total td { font-weight: 800; border-top: 2px solid var(--ink); }
.table-wrap { overflow-x: auto; }

/* home */
.hero { text-align: center; padding: 26px 0 22px; }
.hero h1 { font-size: 2.3rem; }
.hero p { color: var(--muted); max-width: 720px; margin: 0 auto; font-size: 1.05rem; }
.forms { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 20px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 22px; }
.features .card h3 { color: var(--brand); }

/* search */
.filters { display: grid; grid-template-columns: 1.4fr .6fr .8fr 1fr .8fr .8fr .6fr auto; gap: 8px; align-items: end; margin-bottom: 16px; }
.results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.result-list { display: grid; gap: 10px; }
.listing { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; box-shadow: var(--shadow); display: grid; gap: 4px; }
.listing.hl { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(14, 124, 102, .25); }
.listing .price { font-size: 1.25rem; font-weight: 800; }
.listing .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.listing .by { color: var(--faint); font-size: .78rem; }
.map { height: calc(100vh - 150px); min-height: 380px; border-radius: var(--radius); border: 1px solid var(--line); position: sticky; top: 76px; }

/* analysis */
.prop-head { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; margin-bottom: 16px; }
.prop-head .map { position: relative; top: 0; height: 100%; min-height: 210px; }
.prop-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.tile .v { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.good { color: var(--good); } .bad { color: var(--bad); }
.workspace { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.assumptions { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.assumptions fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.assumptions legend { font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin-bottom: 6px; }
.field { margin-bottom: 9px; }
.field .src { color: var(--faint); font-size: .72rem; line-height: 1.3; margin-top: 2px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.insights { margin: 0; padding-left: 18px; }
.insights li { margin-bottom: 6px; }
.sens td.num.mid { outline: 2px solid var(--brand); outline-offset: -2px; font-weight: 800; }
.sens td.num { color: #fff; }
.offer { display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 8px; }
.offer .price { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 700; font-size: .84rem; border: 1px solid var(--line); background: #fff; padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.disclaimer { color: var(--faint); font-size: .74rem; margin-top: 18px; }
.facts td:first-child { width: 34%; color: var(--muted); font-weight: 650; }
.facts .warn { color: #6b4a10; background: #fbf0dc; border-radius: 8px; padding: 6px 9px; margin-top: 5px; font-size: .86rem; }
body:not([data-strategy="house_hack"]) .only-hh, body:not([data-strategy="brrrr"]) .only-brrrr,
body[data-strategy="brrrr"] .not-brrrr { display: none; }
.tabs.strat { margin: 4px 0 6px; }
.strat-block { background: var(--brand-soft); border: 1px solid #c3e5dc; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.strat-block h3 { margin: 0 0 4px; color: var(--brand-dark); }
.strat-block td { border-bottom-color: #cfe7df; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  border: 2px dashed #b9c6d2; border-radius: 12px; padding: 26px 14px; cursor: pointer; color: var(--ink); font-size: .95rem; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 150px minmax(0, 1fr) 48px; gap: 10px; align-items: center; font-size: .86rem; }
.bar .track { background: #eef2f5; border-radius: 99px; height: 12px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar .amt { text-align: right; }
.chip.v0 { background: #e3f4ec; color: var(--good); } .chip.v1 { background: #fbf0dc; color: #8a5a12; }
.ask-row { display: flex; gap: 8px; }
.ask-chips { margin: 10px 0 4px; } .ask-chips .chip { border: 0; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 650; }
.ask-chips .chip:hover { background: var(--brand-soft); color: var(--brand-dark); }
.answer { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.answer .q { font-weight: 700; margin: 0 0 4px; }
.answer table { margin-top: 6px; font-size: .82rem; }
.brand-card { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.brand-card img { max-height: 56px; max-width: 160px; }
.brand-preview { max-height: 56px; max-width: 200px; margin-top: 8px; }
.memo { margin-bottom: 16px; border-left: 4px solid var(--brand); }
.memo-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.memo-head h2 { margin: 0; }
.memo .chip.v0 { background: #e3f4ec; color: var(--good); } .memo .chip.v1 { background: #fbf0dc; color: #8a5a12; }
.memo .chip.v2 { background: #fdecea; color: var(--bad); }
.memo .summary { font-size: 1rem; margin: 4px 0 12px; }
.memo-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.memo-cols ul { margin: 0; padding-left: 18px; } .memo-cols li { margin-bottom: 5px; font-size: .9rem; }
.memo-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.memo .stale { background: #fbf0dc; border: 1px solid #f0d9a8; color: #6b4a10; padding: 7px 11px; border-radius: 9px; font-size: .84rem; margin-bottom: 10px; }

/* dialogs and toasts */
dialog { border: 0; border-radius: 16px; padding: 22px; width: min(440px, 92vw); box-shadow: 0 20px 60px rgba(15, 36, 51, .3); }
dialog::backdrop { background: rgba(15, 36, 51, .45); }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 650; transition: .2s; z-index: 2000; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* owners: what should it rent for */
.owner-cta { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.owner-cta h2 { margin: 0 0 4px; } .owner-cta p { margin: 0; } .owner-cta input { flex: 1; min-width: 0; }
.eyebrow { color: var(--brand); font-weight: 800; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 4px; }
.price-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.opt { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.opt.on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(14, 124, 102, .2); }
.opt .l { color: var(--muted); font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.opt .v { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.opt .v span { font-size: .9rem; color: var(--muted); font-weight: 650; }
.opt p { margin: 0; } .opt .btn { justify-self: start; }
.tile .v.small-v { font-size: 1.1rem; padding-top: .3rem; }
.ledger tr.total td { font-weight: 800; border-top: 2px solid var(--ink); }
.worth dt { font-weight: 800; margin-top: 10px; } .worth dd { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
details.fix summary { cursor: pointer; font-weight: 650; color: var(--brand-dark); font-size: .9rem; }
details.fix .fields { margin: 10px 0 0; align-items: end; }
details.fix form { margin-top: 10px; }
.mix td, .mix th { padding: 4px 6px 4px 0; border-bottom: 0; }
.mix input, .mix select { min-width: 64px; padding: 6px 8px; }
.mix input[name="name"] { min-width: 110px; }
.mix select { min-width: 130px; }
.warn-note { color: #6b4a10; background: #fbf0dc; border-radius: 8px; padding: 7px 10px; font-size: .88rem; margin: 0 0 8px; }
.opts td { vertical-align: top; } .opts tfoot td { border-top: 2px solid var(--ink); vertical-align: top; }
.opts .btn { margin-top: 4px; }
@media (max-width: 1000px) { .price-opts, .owner-cta { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 1000px) {
  .forms, .results, .workspace, .prop-head, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memo-cols { grid-template-columns: minmax(0, 1fr); }
  .assumptions { position: static; max-height: none; }
  .map { position: static; height: 340px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  main { padding: 16px 14px 40px; }
  .hero h1 { font-size: 1.7rem; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top .pill { display: none; }
  .bar { grid-template-columns: 96px minmax(0, 1fr) 40px; }
}
@media print {
  .top, .prop-actions, .foot, .assumptions .src, #toast, .no-print { display: none !important; }
  body { background: #fff; }
  .workspace { grid-template-columns: 1fr; }
  .card, .tile { box-shadow: none; }
}
