/* ==========================================================================
   LoanMath — design system
   Light, high-contrast, finance-grade. No frameworks, no web fonts.
   ========================================================================== */

:root {
  --ink: #0b1f33;
  --ink-2: #22384f;
  --muted: #5b7189;
  --muted-2: #7e91a6;
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-2: #f8fbfe;
  --line: #e2e9f2;
  --line-strong: #cdd9e7;

  --brand: #0e5e8f;
  --brand-600: #0b4c75;
  --brand-700: #093c5d;
  --brand-50: #eaf3fa;
  --brand-ring: rgba(14, 94, 143, .16);

  --accent: #0b8a68;
  --accent-50: #e7f7f1;
  --amber: #b45309;
  --amber-50: #fdf6ec;
  --danger: #c0392b;

  --chart-principal: #2e6fdb;
  --chart-interest: #f08a4b;
  --chart-tax: #8b5cf6;
  --chart-ins: #14a89a;
  --chart-hoa: #e3a008;
  --chart-pmi: #d9534f;
  --chart-balance: #0e5e8f;

  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 51, .05);
  --shadow: 0 1px 2px rgba(11, 31, 51, .05), 0 14px 34px -24px rgba(11, 31, 51, .45);
  --shadow-lg: 0 2px 6px rgba(11, 31, 51, .06), 0 30px 60px -34px rgba(11, 31, 51, .5);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* Keep [hidden] authoritative over component display rules */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.18;
  letter-spacing: -.022em;
  font-weight: 700;
  color: var(--ink);
}
h1 { font-size: clamp(1.85rem, 3.4vw, 2.7rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.72rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; }

ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: .4em; }

img, svg, canvas { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 66px; }

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 750; font-size: 1.16rem; letter-spacing: -.03em; }
.logo:hover { text-decoration: none; color: var(--ink); }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(140deg, #0b3555, #12729f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  color: #fff; flex: none;
}
.logo-mark svg { width: 18px; height: 18px; }
.logo small { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); line-height: 1; margin-top: -2px; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  padding: 8px 11px; border-radius: 8px; font-size: .875rem; font-weight: 550;
  color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--brand-50); color: var(--brand-700); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--brand-50); color: var(--brand-700); font-weight: 650; }

.nav-toggle {
  display: none; margin-left: auto; width: 42px; height: 42px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
  align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 1080px) {
  .nav {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px; box-shadow: 0 18px 30px -22px rgba(11, 31, 51, .5);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 11px 8px; font-size: .95rem; border-radius: 8px; }
  .nav-toggle { display: inline-flex; }
}

/* ---------------------------------------------------------------- hero */
.page-hero { padding: 40px 0 4px; }
.page-hero h1 { max-width: 22ch; }
.lede { font-size: 1.075rem; color: var(--muted); max-width: 68ch; margin: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; font-size: .8rem; color: var(--muted); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 14px; height: 14px; color: var(--accent); flex: none; }

.crumbs { font-size: .78rem; color: var(--muted-2); margin-bottom: 14px; display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { color: var(--line-strong); }

/* ---------------------------------------------------------------- layout */
.calc {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: 22px; align-items: start; margin-top: 26px;
}
@media (max-width: 940px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .result-col { order: -1; }
  .result { position: static !important; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: .98rem; letter-spacing: -.01em; }
.panel-head .meta { font-size: .78rem; color: var(--muted-2); }
.panel-body { padding: 20px; }

/* --------------------------------------------------- example scenario bar */
.scenario-bar {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: .76rem; line-height: 1.4; color: var(--muted);
}
.scenario-bar .scenario-dot {
  flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}
.scenario-bar b { font-weight: 640; color: var(--ink-2); }
.reset-btn {
  margin-left: auto; flex: none;
  font: inherit; font-size: .74rem; font-weight: 640; line-height: 1;
  color: var(--brand); background: none; border: 0; padding: 5px 9px;
  border-radius: 6px; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.reset-btn:hover { background: var(--brand-50); color: var(--brand-700); }
.reset-btn:active { transform: translateY(1px); }
.scenario-warn {
  margin: 0; padding: 9px 20px;
  font-size: .75rem; line-height: 1.5;
  color: var(--amber); background: var(--amber-50);
  border-bottom: 1px solid #f0e0c6;
}
@media (max-width: 560px) {
  .scenario-bar { flex-wrap: wrap; gap: 4px 9px; padding: 10px 16px; }
  .reset-btn { margin-left: 0; padding-left: 0; }
}

/* ---------------------------------------------------------------- fields */
.field { margin-bottom: 17px; }
.field:last-child { margin-bottom: 0; }
.field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.field label { font-size: .82rem; font-weight: 620; color: var(--ink-2); letter-spacing: -.005em; }
.field .hint { font-size: .74rem; color: var(--muted-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; gap: 0; } }
.field-row.asym { grid-template-columns: 1.45fr .55fr; }
@media (max-width: 480px) { .field-row.asym { grid-template-columns: 1fr 1fr; } }
.group-label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; margin: 0 0 12px; }
.input-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(164px, 1fr)); gap: 14px 16px; }

.input {
  display: flex; align-items: center; gap: 2px;
  height: 46px; padding: 0 13px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: #b9c9db; }
.input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-ring); }
.input .affix { font-size: .9rem; color: var(--muted); font-weight: 550; flex: none; }
.input input, .input select {
  flex: 1 1 auto; min-width: 0; width: 100%;
  border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: .97rem; font-weight: 620;
  font-variant-numeric: tabular-nums; padding: 2px 4px;
}
.input input::placeholder { color: #b3c1d1; font-weight: 500; }
.input .suffix { font-size: .82rem; color: var(--muted-2); flex: none; padding-right: 2px; }
.input select { cursor: pointer; font-weight: 600; -webkit-appearance: none; appearance: none; padding-right: 18px; }
.input.has-select { position: relative; }
.input.has-select::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; margin: 6px 0 0; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(to right, var(--brand) 0 var(--p, 50%), #e4ebf4 var(--p, 50%) 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px;
  border-radius: 50%; background: #fff; border: 2px solid var(--brand);
  box-shadow: 0 1px 3px rgba(11, 31, 51, .22);
  transition: transform .12s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: #e4ebf4; }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--brand); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 2px solid var(--brand); box-shadow: 0 1px 3px rgba(11, 31, 51, .22);
}

/* segmented control */
.seg { display: inline-flex; gap: 3px; padding: 3px; background: #eef3f9; border-radius: 9px; }
.seg button {
  font: inherit; font-size: .78rem; font-weight: 600; color: var(--muted);
  border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: #dbe4ee; position: relative; transition: background .18s; flex: none; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11, 31, 51, .25);
  transition: transform .18s;
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--brand-ring); }

.advanced { border-top: 1px dashed var(--line-strong); margin-top: 16px; padding-top: 14px; }
.advanced summary {
  cursor: pointer; font-size: .82rem; font-weight: 620; color: var(--brand);
  list-style: none; display: flex; align-items: center; gap: 7px; padding: 4px 0;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after {
  content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor; transform: rotate(45deg); margin-left: 2px;
  transition: transform .18s; position: relative; top: -2px;
}
.advanced[open] summary::after { transform: rotate(-135deg); top: 2px; }
.advanced .adv-body { padding-top: 14px; }

/* ---------------------------------------------------------------- results */
.result {
  position: sticky; top: 84px;
  background: linear-gradient(158deg, #0c2743 0%, #123f61 52%, #0e3452 100%);
  color: #fff; border-radius: var(--radius-lg); padding: 22px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.result::after {
  content: ""; position: absolute; width: 320px; height: 320px; right: -160px; top: -170px;
  background: radial-gradient(circle, rgba(56, 189, 248, .22), transparent 68%);
  pointer-events: none;
}
.result-label { font-size: .7rem; letter-spacing: .11em; text-transform: uppercase; color: #9fbcd4; font-weight: 650; }
.result-value {
  font-size: clamp(2.15rem, 4.2vw, 2.85rem); font-weight: 750; letter-spacing: -.035em;
  line-height: 1.05; margin: 4px 0 2px; font-variant-numeric: tabular-nums;
}
.result-sub { font-size: .8rem; color: #a8c4da; }
.result-sub b { color: #dceaf5; font-weight: 650; }

.split-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .14); margin: 18px 0 12px; }
.split-bar i { display: block; height: 100%; transition: width .25s ease; }
.split-bar i + i { border-left: 2px solid rgba(12, 39, 67, .55); }

.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; margin: 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 7px; font-size: .76rem; color: #c3d7e6; margin: 0; }
.legend .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend .amt { margin-left: auto; font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); }
.stat { padding: 12px 0 0; }
.stat + .stat, .stat:nth-child(even) { padding-left: 14px; }
.stat:nth-child(even) { border-left: 1px solid rgba(255, 255, 255, .1); }
.stat:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 12px; padding-top: 12px; }
.stat dt { font-size: .7rem; color: #9fbcd4; letter-spacing: .02em; margin-bottom: 1px; }
.stat dd { margin: 0; font-size: .98rem; font-weight: 680; font-variant-numeric: tabular-nums; color: #fff; letter-spacing: -.01em; }
.stat dd.pos { color: #6ee7b7; }

.result-actions { display: flex; gap: 8px; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: .82rem; font-weight: 640; padding: 9px 14px;
  border-radius: 9px; border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); text-decoration: none; color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .22); }
.btn-ghost:hover { background: rgba(255, 255, 255, .17); text-decoration: none; color: #fff; }
.btn-outline { background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- charts */
.chart-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 22px; margin-top: 22px; }
@media (max-width: 1120px) { .chart-grid { grid-template-columns: 1fr; } }

.donut-stack { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.donut-stack .donut { width: 200px; }
.legend-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; width: 100%; text-align: left; font-size: .8rem; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0 0 4px; padding: 0; font-size: .76rem; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 3px; }

.donut-wrap { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: center; }
@media (max-width: 520px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }
.donut svg { display: block; width: 100%; height: auto; max-width: 190px; }
.donut-center { font-size: 15px; font-weight: 750; fill: var(--ink); }
.donut-center.sub { font-size: 10px; font-weight: 500; fill: var(--muted-2); letter-spacing: .04em; }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { font-size: 10px; fill: var(--muted-2); font-family: var(--font); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .bar { transition: opacity .15s; }
.chart .bar:hover { opacity: .82; }
.chart .bal-line { fill: none; stroke: var(--chart-balance); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .bal-dot { fill: #fff; stroke: var(--chart-balance); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: pointer; }

.chart-tip {
  position: fixed; z-index: 200; pointer-events: none; opacity: 0;
  transform: translate(-50%, -120%); transition: opacity .1s;
  background: #0b1f33; color: #fff; font-size: .74rem; line-height: 1.45;
  padding: 7px 10px; border-radius: 8px; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .5);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip b { color: #93c5fd; font-weight: 650; }

/* ---------------------------------------------------------------- table */
.table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.table-toolbar .spacer { flex: 1 1 auto; }
.table-scroll { max-height: 640px; overflow: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
table.amort { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
table.amort thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f4f8fc; color: var(--muted); font-weight: 620; font-size: .71rem;
  letter-spacing: .04em; text-transform: uppercase; text-align: right;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.amort thead th:first-child { text-align: left; }
table.amort td { padding: 9px 12px; text-align: right; border-bottom: 1px solid #f0f4f9; white-space: nowrap; color: var(--ink-2); }
table.amort td:first-child { text-align: left; font-weight: 600; color: var(--ink); }
table.amort tbody tr:hover td { background: #fbfdff; }
table.amort tr.year-row td {
  background: #eef5fb; font-weight: 700; color: var(--brand-700);
  font-size: .78rem; letter-spacing: .01em; border-bottom: 1px solid #dbe8f4;
  padding: 8px 12px; cursor: pointer;
}
table.amort tr.year-row:hover td { background: #e5eff8; }
table.amort tr.year-row .caret { display: inline-block; width: 7px; height: 7px; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(45deg); margin-right: 9px; transition: transform .15s; position: relative; top: -3px; }
table.amort tr.year-row.is-closed .caret { transform: rotate(-45deg); top: -2px; }
table.amort tfoot td { background: #f7fafd; font-weight: 700; color: var(--ink); border-top: 2px solid var(--line); position: sticky; bottom: 0; }
.num-pos { color: var(--accent) !important; font-weight: 620; }

/* ---------------------------------------------------------------- content */
.section { margin-top: 40px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); font-size: .88rem; }

.prose { max-width: 72ch; margin-inline: auto; }
.prose h2 { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose p, .prose li { color: #33495f; }
.prose strong { color: var(--ink); }
.prose a { font-weight: 550; }

.callout {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px;
  background: var(--brand-50); border: 1px solid #cfe3f2; margin: 18px 0; font-size: .88rem; color: #17405f;
}
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--brand); }
.callout p:last-child { margin-bottom: 0; }
.callout.warn { background: var(--amber-50); border-color: #f0dcbb; color: #7c4a12; }
.callout.warn svg { color: var(--amber); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 14px; }
.card-link {
  display: block; padding: 16px 18px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); transition: border-color .15s, box-shadow .15s, transform .15s;
  color: var(--ink);
}
.card-link:hover { text-decoration: none; border-color: #bcd4e8; box-shadow: var(--shadow); transform: translateY(-1px); color: var(--ink); }
.card-link h3 { font-size: .96rem; margin-bottom: 3px; }
.card-link p { font-size: .8rem; color: var(--muted); margin: 0; line-height: 1.5; }
.card-link .arrow { font-size: .78rem; color: var(--brand); font-weight: 620; display: inline-block; margin-top: 9px; }

/* FAQ */
.faq { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 20px; cursor: pointer; font-weight: 620; font-size: .92rem;
  list-style: none; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--surface-2); }
.faq summary::after {
  content: ""; width: 9px; height: 9px; flex: none;
  border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg); transition: transform .18s; position: relative; top: -3px;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 2px; }
.faq .faq-body { padding: 0 20px 16px; font-size: .88rem; color: #33495f; max-width: 80ch; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ads */
.ad {
  display: grid; place-items: center; min-height: 96px; margin: 22px 0;
  border: 1px dashed #d6e0ec; border-radius: 12px; background: #fbfcfe;
  color: #a3b2c4; font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
}
.ad-tall { min-height: 250px; }

/* disclosure */
.disclosure { font-size: .76rem; color: var(--muted-2); max-width: 80ch; margin-top: 24px; }

/* ---------------------------------------------------------------- footer */
.site-footer { margin-top: 56px; background: #0b2135; color: #b7c9d9; font-size: .84rem; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding: 44px 0 34px; }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; gap: 26px; } }
@media (max-width: 520px) { .footer-top { grid-template-columns: 1fr; } }
.site-footer h3 { color: #fff; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; font-weight: 700; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #b7c9d9; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.site-footer .brand-line { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.05rem; margin-bottom: 12px; letter-spacing: -.02em; }
.site-footer .brand-line .logo-mark { background: linear-gradient(140deg, #1c6f9e, #0e4c72); }
.site-footer p { color: #8fa7bb; font-size: .8rem; line-height: 1.6; max-width: 34ch; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 16px 0 26px; display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; font-size: .76rem; color: #7e97ac; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------------------------------------------------------------- misc */
.stack-sm > * + * { margin-top: 10px; }
.muted { color: var(--muted); }
.tiny { font-size: .76rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 99px; background: var(--accent-50); color: #08664e;
  font-size: .72rem; font-weight: 650; border: 1px solid #c8e9dd;
}

.summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.summary-strip > div { background: #fff; padding: 14px 16px; }
.summary-strip dt { font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
.summary-strip dd { margin: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.compare-table { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
.compare-table th, .compare-table td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--line); }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; font-weight: 600; color: var(--ink-2); }
.compare-table thead th { background: #f4f8fc; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.compare-table tr.best td { background: #f2fbf7; }
.compare-table tr.best td:nth-child(2) { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------------------------------------------------------------- print */
@media print {
  @page { margin: 12mm; }
  .site-header, .site-footer, .ad, .result-actions, .table-toolbar, .chart-grid,
  .related, .faq, .nav-toggle, .crumbs, .scenario-bar, .scenario-warn { display: none !important; }
  .result { background: #fff !important; color: #000 !important; box-shadow: none !important; border: 1px solid #c8d3df; }
  .result::after { display: none !important; }
  .result-label, .result-sub, .stat dt, .legend li, .result-sub b { color: #3d4f62 !important; }
  .result-value, .stat dd, .legend .amt { color: #0b1f33 !important; }
  .stat-grid, .stat { border-color: #dbe3ec !important; }
  .split-bar { border: 1px solid #dbe3ec; }
  body { background: #fff; font-size: 11pt; }
  .calc { display: block; }
  .table-scroll { max-height: none; overflow: visible; }
  table.amort thead th { position: static; }
  table.amort { font-size: 9pt; }
  .panel { box-shadow: none; border-color: #ccc; }
  a[href]::after { content: ""; }
}
