/* PayoffPilot — one stylesheet, no external fonts, no framework. */
:root {
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --bg: #ffffff;
  --surface: #f9fafb;
  --surface-2: #f2f4f7;
  --accent: #0f766e;
  --accent-ink: #0b5a54;
  --accent-soft: #ecfdf5;
  --warn: #b42318;
  --warn-soft: #fef3f2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f4f7;
    --ink-2: #d0d5dd;
    --muted: #98a2b3;
    --line: #1f2937;
    --bg: #0b1115;
    --surface: #121a20;
    --surface-2: #172027;
    --accent: #2dd4bf;
    --accent-ink: #5eead4;
    --accent-soft: #0d2b28;
    --warn: #fda29b;
    --warn-soft: #2a1310;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin-top: 2.2em; }
h3 { font-size: 1.14rem; margin-top: 1.8em; }
p, ul, ol, table { margin: 0 0 1.1em; }
small { font-size: .86rem; color: var(--muted); }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* header */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-head .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.03em; font-size: 1.12rem; color: var(--ink); text-decoration: none; }
.brand .mark { width: 26px; height: 26px; flex: 0 0 auto; }
.site-nav { margin-left: auto; display: flex; gap: 18px; font-size: .93rem; }
.site-nav a { color: var(--ink-2); text-decoration: none; }
.site-nav a:hover { color: var(--accent-ink); }
@media (max-width: 620px) { .site-nav { gap: 12px; font-size: .85rem; } .site-nav a.hide-sm { display: none; } }

/* hero */
.hero { padding: 46px 0 30px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
.hero h1 { max-width: 18ch; }
.hero .sub { font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; }
.kicker { display: inline-block; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid rgba(15, 118, 110, .18); padding: 3px 9px; border-radius: 999px; margin-bottom: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 1px solid transparent; background: var(--accent); color: #fff; cursor: pointer; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 8px 13px; font-size: .88rem; }

/* cards & grids */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--bg); box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card .more { font-size: .9rem; font-weight: 600; }
a.card { color: var(--ink); text-decoration: none; display: block; transition: border-color .15s ease, transform .15s ease; }
a.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card .tag { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

/* sections */
section { padding: 34px 0; }
section.tight { padding: 22px 0; }
.lead { font-size: 1.06rem; color: var(--ink-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }

/* calculator */
.calc { border: 1px solid var(--line); border-radius: 16px; background: var(--bg); box-shadow: var(--shadow); padding: 20px; margin: 22px 0 26px; }
.calc-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.calc-form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: .74rem; color: var(--muted); }
input, select { font: inherit; font-size: .98rem; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); width: 100%; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="number"] { font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { font: inherit; font-size: .86rem; padding: 8px 12px; background: var(--bg); color: var(--ink-2); border: 0; border-right: 1px solid var(--line); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.debt-row { display: grid; grid-template-columns: 1.4fr .9fr .9fr .9fr auto; gap: 8px; align-items: end; padding: 8px 0; border-top: 1px dashed var(--line); }
.debt-row:first-child { border-top: 0; }
.debt-head { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.debt-row button.rm { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
@media (max-width: 700px) { .debt-row { grid-template-columns: 1fr 1fr; } .debt-head { display: none; } }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 18px 0; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); }
.stat .k { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .v { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .s { font-size: .8rem; color: var(--muted); }
.stat.accent { background: var(--accent-soft); border-color: rgba(15, 118, 110, .25); }
.stat.accent .v { color: var(--accent-ink); }
.note { border-left: 3px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: 0 10px 10px 0; font-size: .95rem; }
.note.warn { border-color: var(--warn); background: var(--warn-soft); }
.calc-out { margin-top: 8px; }
.calc-out .hint { font-size: .86rem; color: var(--muted); }
.chart { margin: 16px 0 4px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.chart .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

/* tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--bg); }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.total td { font-weight: 700; background: var(--surface); }
td.pos { color: var(--accent-ink); font-weight: 600; }

/* prose */
.prose > * { max-width: 72ch; }
.prose h2 { max-width: none; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 3px solid var(--line); color: var(--ink-2); }

/* breadcrumbs */
.crumbs { font-size: .84rem; color: var(--muted); padding: 14px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs span { margin: 0 6px; }

/* faq */
details.faq { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: var(--bg); }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { margin: 10px 0 0; color: var(--ink-2); }

/* related */
.related { display: flex; flex-wrap: wrap; gap: 10px; }
.related a { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: .9rem; text-decoration: none; color: var(--ink-2); }
.related a:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ads */
.ad-slot { border: 1px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); font-size: .78rem; min-height: 96px; display: flex; align-items: center; justify-content: center; background: var(--surface); margin: 24px 0; }
.ad-slot[data-filled="1"] { border: 0; padding: 0; min-height: 0; }

/* footer */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; padding: 34px 0 40px; font-size: .9rem; color: var(--muted); }
.foot-cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.site-foot h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-2); margin-bottom: 8px; }
.site-foot a { color: var(--ink-2); text-decoration: none; display: block; padding: 2px 0; }
.site-foot a:hover { color: var(--accent-ink); }
.foot-bottom { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.disclaimer { font-size: .82rem; color: var(--muted); }

/* misc */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.pill { font-size: .82rem; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; color: var(--ink-2); background: var(--bg); text-decoration: none; }
.pill:hover { border-color: var(--accent); }
.toc { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; background: var(--surface); font-size: .92rem; }
.toc ol { margin: 6px 0 0; padding-left: 1.1em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--bg); padding: 8px 12px; border: 1px solid var(--accent); border-radius: 8px; z-index: 10; }
@media print {
  .site-head, .site-foot, .hero-actions, .ad-slot, .related, .calc-form { display: none !important; }
  body { font-size: 12pt; }
}
