/* bankownedhouse.com — theme_01: Editorial Split-Column Reference */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #18181b;
  --accent: #1d4ed8;
  --muted: #52525b;
  --line: #e4e0d8;
  --ok: #166534;
  --warn: #92400e;
  --bad: #991b1b;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.2;
}

h1 { font-size: 2rem; margin: 0 0 .5rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; border-bottom: 2px solid var(--accent); padding-bottom: .25rem; display: inline-block; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
h4 { font-size: 1rem; margin: 1rem 0 .4rem; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .6rem;
  padding-bottom: .6rem;
  flex-wrap: wrap;
}
.brand { font-family: var(--serif); font-size: 1.3rem; font-weight: bold; margin: 0; }
.brand-sub { color: var(--muted); font-size: .9rem; font-weight: normal; }
.topnav a { margin-left: 1rem; text-decoration: none; font-size: .95rem; }
.topnav a:hover { text-decoration: underline; }

.disclosure-banner {
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  color: #7c2d12;
  font-size: .9rem;
  padding: .55rem 1rem;
  text-align: center;
}
.disclosure-banner a { color: #9a3412; }

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.toc-rail {
  position: sticky;
  top: 4.2rem;
  align-self: start;
  max-height: calc(100vh - 5rem);
  overflow: auto;
  font-size: .9rem;
  border-right: 1px solid var(--line);
  padding-right: 1rem;
}
.toc-title {
  font-family: var(--serif);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .75rem;
  color: var(--muted);
  margin: 0 0 .5rem;
}
.toc-rail ol { margin: 0; padding-left: 1.2rem; }
.toc-rail li { margin: .15rem 0; }
.toc-rail a { color: var(--ink); text-decoration: none; }
.toc-rail a:hover { color: var(--accent); text-decoration: underline; }
.toc-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: .8rem;
  border-top: 1px solid var(--line);
  padding-top: .75rem;
}

.section { margin-bottom: 2rem; }
.lede { font-size: 1.08rem; max-width: 62ch; }
.meta-line { color: var(--muted); font-size: .88rem; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; padding: 0; list-style: none; }
.fact-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; font-size: .92rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .9rem 1.25rem;
}
.grid-2 .span-2 { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: .25rem; }
.field label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit;
  padding: .5rem .6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
}
.field textarea { resize: vertical; }
.field .hint { font-size: .75rem; color: var(--muted); font-weight: normal; }

.error-line { color: var(--bad); font-weight: 600; min-height: 1.2em; margin: .5rem 0 0; }

.results {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .6rem;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .6rem .8rem;
}
.stat .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat .v { font-family: var(--serif); font-size: 1.25rem; font-weight: bold; }
.stat .v.good { color: var(--ok); }
.stat .v.bad { color: var(--bad); }
.stat .s { font-size: .78rem; color: var(--muted); }

.chart-wrap { margin-top: 1rem; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap figcaption { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .zero { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .dot { fill: var(--accent); }
.chart .legend { fill: var(--ink); font-size: 11px; font-family: var(--sans); }

.ref-table, .sens-table, .rubric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin-top: .75rem;
}
.ref-table th, .ref-table td,
.sens-table th, .sens-table td,
.rubric-table th, .rubric-table td {
  text-align: left;
  padding: .45rem .5rem;
  border-bottom: 1px solid var(--line);
}
.ref-table th, .sens-table th, .rubric-table th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.sens-table td.num, .rubric-table td.num { font-variant-numeric: tabular-nums; }
.delta-pos { color: var(--ok); font-weight: 600; }
.delta-neg { color: var(--bad); font-weight: 600; }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge.pass { background: #dcfce7; color: var(--ok); }
.badge.warn { background: #fef3c7; color: var(--warn); }
.badge.fail { background: #fee2e2; color: var(--bad); }
.badge.flip-strong { background: #dcfce7; color: var(--ok); }
.badge.flip-marginal { background: #fef3c7; color: var(--warn); }
.badge.rental-candidate { background: #dbeafe; color: var(--accent); }
.badge.underwater { background: #fee2e2; color: var(--bad); }

.score-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin-top: .5rem; max-width: 420px; }
.score-bar > div { height: 100%; background: var(--accent); }

.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.btn {
  font: inherit;
  font-weight: 600;
  padding: .55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.btn:hover { background: #1e40af; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: #eff6ff; }

.receipt {
  margin-top: 1rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: .9rem 1rem;
  font-size: .78rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.receipt:empty { display: none; }

.preset-row { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.preset-row select { font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 1.25rem 0 2.5rem;
  font-size: .85rem;
  color: var(--muted);
}
.site-footer nav a { margin-right: 1.25rem; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .toc-rail {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0 0 1rem;
    margin-bottom: 1rem;
  }
  .toc-rail ol { columns: 2; }
}

@media print {
  .site-header, .disclosure-banner, .toc-rail, .btn-row, .field { display: none !important; }
  .layout { display: block; }
  .panel { border: none; }
  body { background: #fff; }
}
