:root {
  --paper: #eef2ef;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #56655f;
  --rule: #cbd5cf;
  --rule-soft: #e1e7e3;
  --ledger: #1f6f4a;
  --ledger-tint: #e3efe8;
  --deficit: #b3412e;
  --deficit-tint: #f6e6e2;
  --permit: #2b5ba8;
  --ochre: #a8781f;
  --slate-blue: #3d6c86;
  --accent: var(--ledger);
  --accent-ink: #ffffff;
  --radius: 6px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); font-feature-settings: "tnum" 1; }
a { color: var(--permit); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--permit); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ledger); }
.neg { color: var(--deficit); }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1440px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.brand svg { flex: none; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--ink); text-decoration: none; white-space: nowrap; padding: 8px 12px; border-radius: var(--radius); font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--paper); }
.acct { display: flex; gap: 10px; align-items: center; }
@media (max-width: 860px) {
  .top-in { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px 16px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
  .acct { margin-left: auto; }
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 20px 64px; }
.wrap-wide { max-width: 1440px; margin: 0 auto; padding: 20px; }

/* Buttons and inputs */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 600 .95rem var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { background: #2a3744; color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.go:hover { filter: brightness(.9); color: var(--accent-ink); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { font-weight: 600; font-size: .85rem; display: block; margin-bottom: 4px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 10px; min-height: 40px; width: 100%; }
textarea { min-height: 140px; font-size: .85rem; }
input:focus, select:focus, textarea:focus { border-color: var(--permit); outline: 2px solid var(--permit); outline-offset: 1px; }
.field { margin-bottom: 14px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; min-height: 0; }

/* Grade mark: square seal with an inner rule, like a stamped approval */
.grade { flex: none; width: 42px; height: 42px; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; border: 2px solid currentColor;
  border-radius: 4px; box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3px currentColor; background: var(--surface); }
.grade.lg { width: 64px; height: 64px; font-size: 2rem; }
.grade.A { color: var(--ledger); } .grade.B { color: var(--slate-blue); } .grade.C { color: var(--ochre); } .grade.D { color: var(--deficit); }
.grade.none { color: var(--muted); font-size: .8rem; }

/* Board */
.filters { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(6, minmax(110px, 1fr)) auto; gap: 10px; align-items: end; }
.filters label { font-size: .75rem; color: var(--muted); }
@media (max-width: 1100px) { .filters { grid-template-columns: repeat(2, 1fr); } .filters .q { grid-column: 1 / -1; } }
.board { display: grid; grid-template-columns: minmax(420px, 560px) 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 960px) { .board { grid-template-columns: 1fr; } }
.listhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.rows { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; padding: 14px; border-top: 1px solid var(--rule-soft); text-decoration: none; color: var(--ink); align-items: center; }
.row:first-child { border-top: 0; }
.row:hover, .row.hl { background: #f6f9f7; }
.row .addr { font-weight: 700; line-height: 1.25; }
.row .facts { font-size: .85rem; color: var(--muted); }
.row .money { text-align: right; }
.row .cf { font-weight: 800; font-size: 1.15rem; }
.row .sub { font-size: .8rem; color: var(--muted); }
.row.locked .cf, .row.locked .price { filter: blur(0); color: var(--muted); }
.mapcol { position: sticky; top: 76px; height: calc(100vh - 96px); min-height: 360px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); background: #dfe6e1; }
@media (max-width: 960px) { .mapcol { position: relative; top: 0; height: 320px; } }
#map { width: 100%; height: 100%; }
.pin { text-decoration: none; background: var(--ink); color: #fff; font: 700 12px var(--font); padding: 3px 7px; border-radius: 12px; border: 2px solid #fff; cursor: pointer; white-space: nowrap; }
.pin.pos { background: var(--ledger); } .pin.neg { background: var(--deficit); } .pin.hl { transform: scale(1.18); }
.pager { display: flex; gap: 8px; justify-content: space-between; margin-top: 12px; }
.empty { padding: 32px 20px; text-align: left; }
.gate { padding: 16px 14px; background: var(--ledger-tint); border-top: 1px solid var(--rule-soft); }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 16px; }

/* Property */
.deal-head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.deal-head h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-bottom: 4px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); margin: 20px 0; }
.kpis > div { padding: 14px 16px; border-left: 1px solid var(--rule-soft); }
.kpis > div:first-child { border-left: 0; }
.kpis .k { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpis .v { font-size: 1.5rem; font-weight: 800; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpis > div { border-left: 0; border-top: 1px solid var(--rule-soft); } }
.deal-body { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 960px) { .deal-body { grid-template-columns: 1fr; } }
.minimap { height: 220px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); }

/* Rent stack: the signature element. A ledger that walks HUD rent down to the rent we underwrite. */
.rentstack { display: grid; gap: 6px; }
.rs-row { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr auto; gap: 12px; align-items: center; font-size: .92rem; }
.rs-bar { position: relative; height: 22px; background: var(--rule); border-radius: 3px; }
.rs-bar span { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--slate-blue); }
.rs-row.minus .rs-bar span { background: repeating-linear-gradient(135deg, var(--deficit) 0 5px, #c9634f 5px 10px); }
.rs-row.final { font-weight: 800; border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 2px; }
.rs-row.final .rs-bar span { background: var(--ledger); }
.rs-row .lbl small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.naive { margin-top: 12px; padding: 10px 12px; background: var(--paper); border-radius: var(--radius); font-size: .88rem; }

table.ledger { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.ledger td, table.ledger th { padding: 7px 0; border-bottom: 1px solid var(--rule-soft); text-align: left; }
table.ledger td:last-child, table.ledger th:last-child { text-align: right; }
table.ledger tr.total td { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; }
.assump { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; }
.assump .field { margin-bottom: 10px; }
.assump input, .assump select { min-height: 36px; padding: 6px 8px; }
.bar { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); }
.notice { padding: 12px 14px; border-radius: var(--radius); background: var(--paper); font-size: .9rem; }
.notice.warn { background: #fbf3e3; }
.notice.err { background: var(--deficit-tint); }
.notice.ok { background: var(--ledger-tint); }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--paper); color: var(--muted); }
.tag.hi { background: var(--ledger-tint); color: var(--ledger); } .tag.me { background: #e6eef4; color: var(--slate-blue); } .tag.lo { background: #fbf3e3; color: #7d5810; }

/* Home */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 24px 0 40px; }
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; } }
.hero p.lead { font-size: 1.15rem; color: var(--muted); }
.zipform { display: flex; gap: 8px; max-width: 460px; }
.zipform input { font-size: 1.05rem; }
.foot { border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }
.foot .wrap { padding-top: 24px; padding-bottom: 40px; }

/* Data tables */
table.data { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .9rem; }
table.data th { text-align: left; font-size: .78rem; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--rule); }
table.data td { padding: 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.scroll-x { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
.auth { max-width: 420px; margin: 40px auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.verdict { font-size: 1.15rem; font-weight: 700; margin: 0 0 4px; }
.kpis .h { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.row .sub .tag { margin-top: 4px; }
@media (max-width: 560px) {
  .row { grid-template-columns: auto 1fr; }
  .row .money { grid-column: 2; text-align: left; }
  .row .sub { white-space: normal; }
  .nav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}

/* Creator call to action and lead tools */
.cta { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 20px; }
.cta h3 { margin: 0 0 2px; }
.cta p { margin: 0; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 10px; }
.pill.Hot { background: var(--deficit-tint); color: var(--deficit); }
.pill.Warm { background: #fbf3e3; color: #7d5810; }
.pill.New { background: var(--paper); color: var(--muted); }
.copybox { display: flex; gap: 8px; }
.copybox input { font-size: .9rem; }
.prose h2 { margin-top: 1.6em; }
.prose p, .prose li { max-width: 70ch; }

.cardwrap svg { width: 100%; max-width: 480px; height: auto; border-radius: 8px; border: 1px solid var(--rule); }
table.data td.d { white-space: nowrap; }

/* Field only bots fill in. Kept out of sight and out of the tab order. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ziplist { max-width: none; columns: 3 220px; column-gap: 28px; }
.ziplist span { display: block; break-inside: avoid; margin-bottom: 3px; }
