:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #0a0a0a;
  --ink-muted: #737373;
  --ink-faint: #a3a3a3;
  --rule: #e7e5e4;
  --rule-strong: #292524;
  --live: #15803d;
  --live-bg: #dcfce7;
  --eval: #1d4ed8;
  --eval-bg: #dbeafe;
  --dormant: #78716c;
  --dormant-bg: #f5f5f4;
  --highlight: #fef3c7;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* HEADER */
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 48px;
}

.brand {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand a { color: inherit; text-decoration: none; }
.brand a:hover { color: var(--ink-muted); }
.brand .slash { color: var(--ink-faint); margin: 0 4px; }

.timestamp {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* HERO EQUITY */
.hero { margin-bottom: 56px; }
.hero-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  margin-bottom: 56px;
}
.hero-split .hero { margin-bottom: 0; }
@media (max-width: 720px) {
  .hero-split { grid-template-columns: 1fr; gap: 28px; }
}
.hero-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin: 0 0 8px;
}
.hero-value {
  font-family: var(--font-mono);
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0 0 12px;
}
.hero-value .dollar {
  color: var(--ink-faint);
  font-weight: 400;
}
.hero-sub {
  color: var(--ink-muted);
  margin: 0;
  max-width: 500px;
}

/* STATS ROW */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 56px;
}
.stat {
  padding: 20px 0;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: 0; }
.stat:not(:first-child) { padding-left: 20px; }
.stat-val {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  margin: 0 0 6px;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}
.stat.live .stat-val { color: var(--live); }
.stat.eval .stat-val { color: var(--eval); }
.stat.dormant .stat-val { color: var(--dormant); }

/* SECTION HEADER */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--rule-strong);
}
.sec-head h2 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}
.sec-head .sec-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

section { margin-bottom: 56px; }

/* CALCULATOR */
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.sliders { display: flex; flex-direction: column; gap: 22px; }
.slider { display: flex; flex-direction: column; gap: 8px; }
.slider-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 12px;
}
.slider-row .k {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.slider-row .v {
  font-weight: 600;
  font-size: 15px;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--rule);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: var(--ink);
  cursor: pointer;
  transition: transform 120ms;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  cursor: pointer;
}

.outputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--surface);
}
.out-cell {
  padding: 18px 20px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.out-cell:nth-child(2n) { border-right: 0; }
.out-cell.span-2 {
  grid-column: span 2;
  border-right: 0;
  background: var(--ink);
  color: var(--bg);
}
.out-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  margin: 0 0 8px;
}
.out-cell.span-2 .out-label { color: var(--ink-faint); }
.out-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  line-height: 1;
}
.out-cell.span-2 .out-val { font-size: 36px; }
.note {
  padding: 14px 20px;
  font-size: 11px;
  color: var(--ink-muted);
  grid-column: span 2;
  line-height: 1.6;
}

/* RECOMMENDATION CALLOUT */
.reco {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  background: var(--surface);
  margin-top: 16px;
  align-items: flex-start;
}
.reco-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 2px;
  flex-shrink: 0;
  white-space: nowrap;
}
.reco-label.good { background: var(--live-bg); color: var(--live); }
.reco-label.warn { background: #fef3c7; color: #a16207; }
.reco-body {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.55;
  flex: 1;
}
.reco-body strong { color: var(--ink); font-weight: 500; }

/* FILTERS */
.filters {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 18px 10px 0;
  margin-right: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.tab .ct {
  margin-left: 6px;
  color: var(--ink-faint);
  font-weight: 400;
}
.tab.active .ct { color: var(--ink-muted); }

/* TABLES */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl thead th {
  text-align: left;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule);
  background: transparent;
}
.tbl tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.tbl tbody tr:hover { background: var(--surface); }
.tbl tbody tr:last-child td { border-bottom: 0; }

.col-num { width: 32px; color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; }
.col-status { width: 90px; }
.col-split { width: 60px; text-align: right; }
.col-bal { text-align: right; font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.col-acct { font-family: var(--font-mono); color: var(--ink-muted); font-size: 11px; }
.col-prog { width: 180px; }
.col-prog-wrap { display: flex; flex-direction: column; gap: 4px; }
.col-prog-nums { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); display: flex; justify-content: space-between; }
.col-prog-bar { height: 3px; background: var(--rule); position: relative; }
.col-prog-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--w, 0%);
  background: var(--ink);
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 2px;
}
.badge.Live { color: var(--live); background: var(--live-bg); }
.badge.Eval { color: var(--eval); background: var(--eval-bg); }
.badge.Dormant { color: var(--dormant); background: var(--dormant-bg); }

.firm-name { font-weight: 600; }
.acct-note { font-size: 11px; color: var(--ink-muted); font-style: italic; margin-top: 2px; }

/* FIRMS TOOLBAR */
.firms-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
}
.picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.picker-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}
.picker select {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23737373' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 120ms;
}
.picker select:hover { border-color: var(--rule-strong); }
.picker select:focus { outline: 0; border-color: var(--ink); }

/* FIRMS TABLE */
.firms-tbl td { font-family: var(--font-mono); font-size: 12px; }
.firms-tbl td.firm-col {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
}
.firms-tbl td.notes-col {
  font-family: var(--font-sans);
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.5;
}
.firms-tbl td.notes-col strong { color: var(--ink); font-weight: 500; }

.tbl tfoot .total-row td {
  border-top: 2px solid var(--rule-strong);
  border-bottom: 0;
  padding: 14px 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
}
.tbl tfoot .total-row td.firm-col {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
}

/* FOOTER */
footer.foot {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
footer.foot code {
  font-family: var(--font-mono);
  color: var(--ink);
}

/* RESPONSIVE */
@media (max-width: 780px) {
  .calc-grid { grid-template-columns: 1fr; gap: 28px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3), .stat:nth-child(4) {
    border-top: 1px solid var(--rule);
  }
  .tbl .col-prog { display: none; }
  .tbl thead th:nth-child(4) { display: none; }
  .firms-tbl .notes-col { display: none; }
  .firms-tbl thead th:last-child { display: none; }
}
@media (max-width: 520px) {
  .wrap { padding: 20px 16px 48px; }
  .col-acct { display: none; }
  .tbl thead th:nth-child(3) { display: none; }
}
