/* Dense, fast, neutral. No affiliate styling. */
:root {
  --ink: #1a1d21; --muted: #6a7178; --line: #e2e5e8; --bg: #ffffff; --alt: #f6f7f8;
  --accent: #0a5c9e; --up: #b3261e; --down: #1a7d3c; --gap: #d7dade;
  --gA: #1a7d3c; --gB: #5c9e0a; --gC: #b8860b; --gD: #c05717; --gE: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 1180px; padding: 0 16px 40px; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
header { padding: 18px 0 6px; }
h1 { font-size: 20px; margin: 0; }
#catnav { display: flex; gap: 2px; margin: 8px 0 0; flex-wrap: wrap; }
#catnav a { padding: 4px 10px; border-radius: 5px; text-decoration: none; color: var(--muted); font-size: 13px; }
#catnav a:hover { background: var(--alt); color: var(--ink); }
#catnav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.tagline { color: var(--muted); font-size: 13px; margin: 4px 0 0; max-width: 860px; }

#timeline { margin: 14px 0 4px; }
#rba-canvas { width: 100%; display: block; }
#date-slider { width: 100%; margin: 2px 0 0; accent-color: var(--accent); }
#timeline-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
#timeline-labels .current { font-weight: 600; color: var(--ink); font-size: 13px; }

#upcoming { background: var(--alt); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 12.5px; margin: 10px 0; overflow-x: auto; white-space: nowrap; }
.strip-label { color: var(--muted); font-weight: 600; margin-right: 6px; }
#upcoming-items .chip { display: inline-block; margin-right: 12px; }
#upcoming-items .chip b { color: var(--accent); }

#controls { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; align-items: center; }
#controls select, #controls input[type=search] { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); }
#q { width: 200px; }
#count { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.hidden { display: none !important; }

table#rates { width: 100%; border-collapse: collapse; font-size: 13px; }
#rates th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid var(--line); padding: 6px 8px; cursor: pointer; white-space: nowrap; }
#rates th.sorted { color: var(--ink); }
#rates td { padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
#rates tbody tr:nth-child(even) { background: var(--alt); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.rate { font-weight: 600; }
.variant { color: var(--muted); font-size: 12px; }
.delta-up { color: var(--up); }
.delta-down { color: var(--down); }
tr.atypical td { color: var(--muted); }
tr.atypical .rate { font-weight: 400; }
.tag { display: inline-block; font-size: 10.5px; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.badge { display: inline-block; width: 20px; text-align: center; border-radius: 4px; color: #fff; font-weight: 700; font-size: 12px; cursor: pointer; }
.badge.gA { background: var(--gA); } .badge.gB { background: var(--gB); } .badge.gC { background: var(--gC); }
.badge.gD { background: var(--gD); } .badge.gE { background: var(--gE); } .badge.gU { background: var(--muted); }

#scorecard-modal { position: fixed; inset: 0; background: rgba(20,22,25,.45); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal-box { background: var(--bg); border-radius: 8px; padding: 18px 20px; max-width: 520px; width: 92%; max-height: 84vh; overflow-y: auto; position: relative; }
#modal-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
#sc-metrics { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
#sc-metrics td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
#sc-metrics td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.fineprint { color: var(--muted); font-size: 11.5px; }

#lender-view h2 { font-size: 18px; margin: 14px 0 4px; }
#lender-view h3 { font-size: 14px; margin: 18px 0 6px; }
.lender-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 14px; }
.lender-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid var(--line); padding: 5px 8px; }
.lender-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
.lender-table tbody tr:nth-child(even) { background: var(--alt); }
.lender-table.sc { max-width: 560px; }
.lender-table a { color: var(--accent); text-decoration: none; }
.lender-table a:hover { text-decoration: underline; }

footer { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 12px; }
#loading { color: var(--muted); padding: 24px 0; }
