/* RateQuest — dark, playful, confident */
:root {
  --bg: #0a0e1a;
  --bg-2: #0f1526;
  --panel: #131b31;
  --panel-2: #182242;
  --line: #243055;
  --line-soft: #1b2648;
  --ink: #eef2ff;
  --muted: #8b96bd;
  --faint: #5c668a;
  --accent: #63f2b0;
  --accent-2: #38d992;
  --gold: #ffd166;
  --hot: #ff5d7a;
  --cool: #6ea8ff;
  --heat-0: #1fbf75;
  --heat-1: #a4c83c;
  --heat-2: #e0a52e;
  --heat-3: #e0652e;
  --heat-4: #d8364f;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --font: "Avenir Next", Avenir, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(99,242,176,.07), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(110,168,255,.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

#confetti {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 90;
}
#toasts {
  position: fixed; top: 76px; right: 16px; z-index: 95;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1px solid var(--accent-2);
  color: var(--ink);
  padding: 10px 16px; border-radius: 12px;
  font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow);
  animation: toast-in .35s cubic-bezier(.2,1.4,.4,1), toast-out .4s ease 2.6s forwards;
}
.toast .pts { color: var(--gold); }
@keyframes toast-in { from { transform: translateX(120%) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateX(120%); opacity: 0; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,14,26,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  font-size: 26px; width: 46px; height: 46px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--cool));
  border-radius: 14px; box-shadow: 0 4px 18px rgba(99,242,176,.35);
}
.brand-text h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.brand-text p { margin: 0; font-size: 12px; color: var(--muted); }
.header-right { display: flex; align-items: center; gap: 14px; }

.data-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted); white-space: nowrap;
}
.data-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.data-status.live { color: var(--accent); border-color: rgba(99,242,176,.4); }
.data-status.live .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2s infinite; }
.data-status.sample { color: var(--gold); border-color: rgba(255,209,102,.4); }
.data-status.sample .dot { background: var(--gold); }
.data-status.loading .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.xp-meter {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, rgba(255,209,102,.14), rgba(255,93,122,.1));
  border: 1px solid rgba(255,209,102,.35);
  padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; white-space: nowrap;
}
.xp-label { color: var(--muted); font-weight: 600; }
.xp-score { font-family: var(--mono); font-weight: 700; color: var(--gold); font-size: 15px; }
.xp-star { color: var(--gold); }
.xp-bump { animation: xp-bump .5s cubic-bezier(.2,2,.4,1); }
@keyframes xp-bump { 40% { transform: scale(1.5); color: var(--accent); } }

.sample-banner {
  background: linear-gradient(90deg, rgba(255,209,102,.14), rgba(255,209,102,.06));
  border-bottom: 1px solid rgba(255,209,102,.4);
  color: #ffe3a3;
  padding: 10px 20px; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
}
.sample-banner button {
  background: none; border: 1px solid var(--gold); color: var(--gold);
  border-radius: 999px; padding: 4px 14px; font-weight: 700; cursor: pointer; font-size: 12.5px;
}
.sample-banner button:hover { background: rgba(255,209,102,.15); }

/* ---------- layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; display: flex; flex-direction: column; gap: 26px; }
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.section-head h2, .panel > h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.section-sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.step-chip {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cool));
  color: #08131f; font-size: 13px; font-weight: 800; flex: none;
}
.muted { color: var(--muted); font-weight: 400; font-size: .85em; }
.assumption-note { color: var(--faint); font-size: 12.5px; margin: 14px 0 0; }
.constraint-note { color: var(--gold); font-size: 13px; margin: 8px 0; min-height: 1.2em; }

/* ---------- loan controls ---------- */
.loan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 14px; }
.field label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 7px; min-height: 2.4em; }
.money-input {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; margin-bottom: 10px;
}
.money-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,242,176,.15); }
.money-input .cur { color: var(--muted); font-weight: 700; }
.money-input input {
  background: none; border: none; outline: none; color: var(--ink);
  font-family: var(--mono); font-size: 17px; font-weight: 700; width: 100%;
}
input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }
.term-row { display: flex; align-items: center; gap: 12px; }
.term-value { font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--accent); white-space: nowrap; }
.lvr-flag.warn { color: var(--gold); font-weight: 700; }
.lvr-flag.ok { color: var(--accent); }

.segmented { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg {
  flex: 1; background: none; border: none; color: var(--muted);
  padding: 10px 6px; font-weight: 700; font-size: 13px; cursor: pointer;
  transition: all .18s ease;
}
.seg + .seg { border-left: 1px solid var(--line-soft); }
.seg.active { background: linear-gradient(135deg, rgba(99,242,176,.18), rgba(110,168,255,.14)); color: var(--accent); }
.seg:hover:not(.active) { color: var(--ink); }

/* ---------- best deal ---------- */
.best-deal { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255,209,102,.45); }
.best-deal-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 260px at 15% 0%, rgba(255,209,102,.16), transparent 60%),
    linear-gradient(135deg, #1c2237, #141a30);
  animation: glow-shift 6s ease-in-out infinite alternate;
}
@keyframes glow-shift { to { transform: scale(1.06); opacity: .85; } }
.best-deal-content {
  position: relative; display: flex; justify-content: space-between; gap: 24px;
  padding: 26px 28px; align-items: center; flex-wrap: wrap;
}
.best-deal-kicker { font-size: 13px; font-weight: 700; color: var(--gold); letter-spacing: .04em; text-transform: uppercase; }
.best-deal h2 { margin: 8px 0 4px; font-size: 30px; letter-spacing: -.02em; }
.best-product { color: var(--muted); font-size: 19px; font-weight: 600; }
.best-rate-line { display: flex; align-items: baseline; gap: 8px; }
.best-rate {
  font-family: var(--mono); font-size: 52px; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.best-rate-unit { color: var(--muted); font-weight: 700; }
.best-deal-right { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.best-figure { display: flex; flex-direction: column; }
.best-figure-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.best-figure-value { font-family: var(--mono); font-size: 26px; font-weight: 800; }
.best-savings {
  background: rgba(99,242,176,.12); border: 1px solid rgba(99,242,176,.4);
  color: var(--accent); font-weight: 800; font-size: 14px;
  padding: 10px 16px; border-radius: 12px; max-width: 220px;
}

/* ---------- states ---------- */
.state-panel { text-align: center; }
.skeleton-hero, .skeleton-row {
  border-radius: 12px; margin: 10px auto;
  background: linear-gradient(90deg, var(--panel-2) 25%, #1f2a4e 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-hero { height: 90px; max-width: 620px; }
.skeleton-row { height: 26px; max-width: 720px; }
.skeleton-row.short { max-width: 480px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.state-note { color: var(--muted); font-size: 14px; margin-top: 16px; }
.state-note.error { color: var(--gold); }
code { font-family: var(--mono); font-size: .92em; color: var(--accent); }

/* ---------- chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  border-radius: 999px; padding: 7px 16px; font-weight: 700; font-size: 13px; cursor: pointer;
  transition: all .16s ease;
}
.chip:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08131f; border-color: transparent;
  box-shadow: 0 4px 16px rgba(99,242,176,.35);
}
.condition-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.condition-tag {
  font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: rgba(110,168,255,.12); color: var(--cool); border: 1px solid rgba(110,168,255,.35);
}
.condition-tag.warn { background: rgba(255,209,102,.12); color: var(--gold); border-color: rgba(255,209,102,.4); }

/* ---------- leaderboard ---------- */
.leaderboard { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: grid;
  grid-template-columns: 44px 1.4fr 1fr 110px 130px 130px auto;
  align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 10px 14px;
  transition: transform .35s cubic-bezier(.2,1,.3,1), border-color .2s, box-shadow .2s;
  position: relative;
}
.lb-row:hover { border-color: var(--line); transform: translateY(-1px); }
.lb-row.top1 { border-color: rgba(255,209,102,.6); box-shadow: 0 0 24px rgba(255,209,102,.12); }
.lb-row.top2 { border-color: rgba(192,199,214,.35); }
.lb-row.top3 { border-color: rgba(214,150,90,.35); }
.lb-rank { font-family: var(--mono); font-size: 18px; font-weight: 800; color: var(--muted); text-align: center; }
.lb-row.top1 .lb-rank, .lb-row.top2 .lb-rank, .lb-row.top3 .lb-rank { font-size: 22px; }
.lb-name { font-weight: 800; font-size: 15.5px; }
.lb-product { font-size: 12px; color: var(--muted); font-weight: 600; }
.lb-rate { font-family: var(--mono); font-weight: 800; font-size: 19px; color: var(--accent); }
.lb-rate small { font-size: 11px; color: var(--muted); font-weight: 600; }
.lb-cell-label { display: none; }
.lb-num { font-family: var(--mono); font-weight: 700; font-size: 14.5px; }
.lb-num small { display: block; color: var(--faint); font-size: 10.5px; font-weight: 600; }
.lb-save { color: var(--accent); }
.lb-save.worst { color: var(--hot); }
.lb-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; font-size: 15px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  cursor: pointer; transition: all .15s ease; display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--accent); transform: scale(1.1); }
.icon-btn.in-tray { border-color: var(--accent); background: rgba(99,242,176,.15); }
.lb-row.ineligible { opacity: .45; }
.lb-row .ineligible-reason { font-size: 11.5px; color: var(--gold); }
.lb-bar {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 12px;
  background: linear-gradient(90deg, rgba(99,242,176,.10), rgba(99,242,176,.02));
  pointer-events: none; transition: width .5s cubic-bezier(.2,1,.3,1);
}
.lb-row > :not(.lb-bar) { position: relative; }
.lb-more { text-align: center; margin-top: 10px; }
.lb-more button {
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 8px 20px; border-radius: 999px; font-weight: 700; cursor: pointer;
}
.lb-more button:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- battle ---------- */
.arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.fighter { display: flex; flex-direction: column; }
.fighter-pick {
  border: 2px dashed var(--line); background: var(--bg); color: var(--muted);
  border-radius: 14px; padding: 34px 12px; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: all .2s ease; height: 100%;
}
.fighter-pick:hover { border-color: var(--accent); color: var(--accent); }
.fighter-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px; height: 100%;
  transition: border-color .3s, box-shadow .3s, transform .3s;
}
.fighter-card .fc-name { font-weight: 800; font-size: 16px; }
.fighter-card .fc-product { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.fighter-card .fc-rate { font-family: var(--mono); font-size: 34px; font-weight: 800; color: var(--cool); }
.fighter-card .fc-repay { font-family: var(--mono); font-size: 17px; font-weight: 700; }
.fighter-card .fc-interest { color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.fighter-card .fc-clear { align-self: flex-start; background: none; border: none; color: var(--faint); cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; }
.fighter.winner .fighter-card { border-color: var(--gold); box-shadow: 0 0 30px rgba(255,209,102,.25); transform: scale(1.03); }
.fighter.loser .fighter-card { opacity: .55; transform: scale(.98); }
.fighter.crown .fighter-card::before { content: "👑 Winner"; color: var(--gold); font-weight: 800; font-size: 13px; }
.vs {
  align-self: center; font-size: 26px; font-weight: 900; font-style: italic;
  color: var(--hot); text-shadow: 0 0 18px rgba(255,93,122,.5);
}
.battle-actions { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.btn-primary {
  background: linear-gradient(135deg, var(--hot), #ff9a5d);
  border: none; color: #1c0b12; font-weight: 900; font-size: 16px;
  padding: 12px 34px; border-radius: 12px; cursor: pointer;
  box-shadow: 0 6px 22px rgba(255,93,122,.4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.battle-result {
  margin-top: 18px; text-align: center; font-size: 17px; font-weight: 700;
  background: linear-gradient(90deg, rgba(255,209,102,.12), rgba(99,242,176,.1));
  border: 1px solid rgba(255,209,102,.4); border-radius: 14px; padding: 16px;
  animation: result-pop .5s cubic-bezier(.2,1.6,.4,1);
}
@keyframes result-pop { from { transform: scale(.85); opacity: 0; } }
.battle-result .big { font-family: var(--mono); font-size: 24px; color: var(--gold); }
.arena.shake { animation: arena-shake .5s ease; }
@keyframes arena-shake {
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(3px); }
}

/* ---------- heat map ---------- */
.heat-legend { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 12px; font-weight: 700; }
.heat-scale {
  width: 160px; height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, var(--heat-0), var(--heat-1), var(--heat-2), var(--heat-3), var(--heat-4));
}
.heat-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.heatmap { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 760px; }
.heatmap th { font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 4px 6px; text-align: left; white-space: nowrap; }
.heatmap th.inst-col { position: sticky; left: 0; background: var(--panel); z-index: 2; }
.heatmap td {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  padding: 7px 8px; border-radius: 7px; text-align: center; cursor: pointer;
  color: #08131f; min-width: 64px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.heatmap td:hover { transform: scale(1.12); box-shadow: 0 4px 14px rgba(0,0,0,.4); z-index: 3; position: relative; }
.heatmap td.na { background: var(--bg) !important; color: var(--faint); cursor: default; }
.heatmap td.na:hover { transform: none; box-shadow: none; }
.heatmap td.selected { outline: 2px solid var(--ink); outline-offset: 1px; }
.heat-detail {
  margin-top: 14px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  animation: result-pop .3s ease;
}
.heat-detail .hd-name { font-weight: 800; }
.heat-detail .hd-rate { font-family: var(--mono); font-size: 22px; font-weight: 800; color: var(--accent); }
.heat-detail .hd-num { font-family: var(--mono); font-weight: 700; }

/* ---------- explorer ---------- */
.explorer-controls { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.select-label { font-size: 12.5px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
select {
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-family: var(--font); font-weight: 700; font-size: 14px;
  min-width: 210px; cursor: pointer;
}
select:focus { border-color: var(--accent); outline: none; }
.explorer-chart { display: flex; align-items: flex-end; gap: 10px; margin-top: 18px; min-height: 230px; }
.ex-bar-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; min-width: 0;
}
.ex-bar-outer {
  width: 100%; max-width: 74px; height: 170px;
  display: flex; align-items: flex-end;
  background: var(--bg); border-radius: 10px; border: 1px solid var(--line-soft);
  overflow: hidden; position: relative;
}
.ex-bar {
  width: 100%; border-radius: 9px 9px 0 0;
  background: linear-gradient(180deg, var(--cool), #3f6fd1);
  transition: height .6s cubic-bezier(.2,1,.3,1), background .3s;
}
.ex-bar-wrap.cheapest .ex-bar { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.ex-bar-wrap:hover .ex-bar-outer { border-color: var(--accent); }
.ex-bar-wrap.picked .ex-bar-outer { border-color: var(--gold); box-shadow: 0 0 16px rgba(255,209,102,.25); }
.ex-rate { font-family: var(--mono); font-weight: 800; font-size: 13.5px; }
.ex-bar-wrap.cheapest .ex-rate { color: var(--accent); }
.ex-term { font-size: 11.5px; color: var(--muted); font-weight: 700; text-align: center; }
.ex-repay { font-size: 11px; font-family: var(--mono); color: var(--faint); text-align: center; }
.explorer-verdict { margin-top: 16px; font-size: 14.5px; color: var(--muted); }
.explorer-verdict strong { color: var(--ink); }
.explorer-verdict .save { color: var(--accent); font-weight: 800; }
.explorer-verdict .cost { color: var(--hot); font-weight: 800; }

/* ---------- compare tray ---------- */
.compare-tray { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.compare-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; position: relative;
  animation: result-pop .35s cubic-bezier(.2,1.4,.4,1);
}
.compare-card.best { border-color: rgba(255,209,102,.55); box-shadow: 0 0 22px rgba(255,209,102,.12); }
.compare-card.best::before { content: "👑 Cheapest in shortlist"; position: absolute; top: -11px; left: 14px; background: var(--panel); padding: 0 8px; font-size: 11.5px; font-weight: 800; color: var(--gold); }
.compare-card .cc-name { font-weight: 800; }
.compare-card .cc-product { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.compare-card .cc-rate { font-family: var(--mono); font-size: 26px; font-weight: 800; color: var(--cool); }
.compare-card.best .cc-rate { color: var(--accent); }
.compare-card .cc-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-top: 1px dashed var(--line-soft); }
.compare-card .cc-row b { font-family: var(--mono); }
.compare-card .cc-remove {
  position: absolute; top: 10px; right: 10px; background: none; border: none;
  color: var(--faint); cursor: pointer; font-size: 15px;
}
.compare-card .cc-remove:hover { color: var(--hot); }
.cc-delta { color: var(--hot); font-weight: 700; }
.cc-delta.free { color: var(--accent); }

/* ---------- payoff ---------- */
.payoff-pick { margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.payoff-pick strong { color: var(--ink); }
.payoff-split { margin-bottom: 22px; }
.split-bar { display: flex; height: 26px; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.split-principal { background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .8s cubic-bezier(.2,1,.3,1); }
.split-interest { background: linear-gradient(90deg, var(--hot), #ff9a5d); flex: 1; }
.split-labels { display: flex; gap: 22px; margin-top: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.swatch.principal { background: var(--accent); }
.swatch.interest { background: var(--hot); }
.split-labels strong { font-family: var(--mono); color: var(--ink); }
.payoff-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.po-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; min-width: 0; }
.po-bar {
  background: linear-gradient(180deg, var(--cool), rgba(110,168,255,.25));
  border-radius: 4px 4px 0 0;
  transition: height .6s cubic-bezier(.2,1,.3,1);
}
.po-col:hover .po-bar { background: linear-gradient(180deg, var(--accent), rgba(99,242,176,.3)); }
.po-col .po-tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 9px; font-size: 11px; font-family: var(--mono); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5;
}
.po-col:hover .po-tip { opacity: 1; }
.po-axis { display: flex; gap: 3px; margin-top: 6px; }
.po-axis span { flex: 1; text-align: center; font-size: 10px; color: var(--faint); font-family: var(--mono); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 22px 20px; text-align: center;
  color: var(--faint); font-size: 12.5px;
}
.site-footer a { color: var(--muted); }

/* ---------- number flash on change ---------- */
.money-tween { display: inline-block; }
.flash-up { animation: flash-up .5s ease; }
@keyframes flash-up { 30% { color: var(--accent); transform: translateY(-3px); } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .loan-grid { grid-template-columns: repeat(2, 1fr); }
  .lb-row { grid-template-columns: 34px 1.5fr 1fr 100px auto; }
  .lb-cell.hide-md { display: none; }
}
@media (max-width: 720px) {
  main { padding: 16px 12px 48px; gap: 18px; }
  .panel { padding: 16px 14px; }
  .brand-text p { display: none; }
  .brand-text h1 { font-size: 19px; }
  .xp-label { display: none; }
  .data-status { font-size: 11px; padding: 5px 9px; }
  .header-inner { padding: 10px 12px; gap: 8px; }
  .loan-grid { grid-template-columns: 1fr; gap: 16px; }
  .best-deal-content { padding: 18px; flex-direction: column; align-items: flex-start; }
  .best-rate { font-size: 42px; }
  .best-deal h2 { font-size: 24px; }
  .best-deal-right { gap: 16px; }
  .best-savings { max-width: none; }

  .lb-row {
    grid-template-columns: 30px 1fr auto;
    grid-template-areas:
      "rank name actions"
      "rank rate actions"
      "rank nums nums";
    row-gap: 4px; padding: 12px;
  }
  .lb-rank { grid-area: rank; }
  .lb-name-wrap { grid-area: name; }
  .lb-rate { grid-area: rate; text-align: right; }
  .lb-nums { grid-area: nums; display: flex; gap: 18px; flex-wrap: wrap; }
  .lb-actions { grid-area: actions; flex-direction: column; }
  .lb-cell-label { display: block; }

  .arena { grid-template-columns: 1fr; }
  .vs { text-align: center; padding: 4px 0; }
  .explorer-chart { overflow-x: auto; padding-bottom: 6px; }
  .ex-bar-wrap { min-width: 64px; }
  .payoff-chart { height: 110px; }
  #toasts { top: 60px; right: 10px; left: 10px; align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
