:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #14213d;
  --muted: #5b6b86;
  --line: #e3e9f2;
  --brand: #1f6feb;
  --brand-ink: #0b4fc0;
  --good: #16a34a;
  --warn: #d97706;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,33,61,.05), 0 8px 24px rgba(20,33,61,.06);
  --maxw: 980px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; color: var(--ink); }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); margin: 0 0 .4em; }
h2 { font-size: 1.3rem; margin: 1.8em 0 .6em; }
small, .muted { color: var(--muted); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--ink); }
.logo span { color: var(--brand); }
.nav a { color: var(--muted); font-weight: 600; font-size: .92rem; margin-left: 18px; }
.nav a:hover { color: var(--ink); text-decoration: none; }

/* Breadcrumb */
.crumb { font-size: .85rem; color: var(--muted); padding: 14px 0 0; }
.crumb a { color: var(--muted); }

/* Hero */
.hero { padding: 28px 0 8px; }
.hero p.lead { font-size: 1.05rem; color: var(--muted); max-width: 60ch; margin: .2em 0 0; }

/* Cards / layout */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
@media (max-width: 760px) { .calc-grid { grid-template-columns: 1fr; } }

/* Form */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .adorn {
  position: absolute; color: var(--muted); font-size: .95rem; pointer-events: none;
}
.input-wrap .adorn.left { left: 12px; }
.input-wrap .adorn.right { right: 12px; }
input[type="number"], input[type="date"], select {
  width: 100%; padding: 11px 12px; font-size: 1rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  -moz-appearance: textfield;
}
.input-wrap.has-left input { padding-left: 26px; }
.input-wrap.has-right input { padding-right: 42px; }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Results */
.headline {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.headline .big { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; color: var(--brand-ink); }
.headline .per { color: var(--muted); font-weight: 600; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { padding: 12px 14px; background: var(--bg); border-radius: 10px; }
.stat .k { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
.stat .v.interest { color: var(--warn); }

/* Donut + chart */
.viz { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: center; margin-top: 18px; }
@media (max-width: 420px) { .viz { grid-template-columns: 1fr; justify-items: center; } }
.legend { font-size: .88rem; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: middle; }
.legend .item { margin-bottom: 6px; }
.legend .dot.p { background: var(--brand); }
.legend .dot.i { background: var(--warn); }

.chart { margin-top: 22px; }
.chart svg { width: 100%; height: auto; display: block; }

/* Schedule table */
.sched-tools { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 10px; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: .9rem;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn:hover { text-decoration: none; filter: brightness(.98); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.sched { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 520px; }
table.sched th, table.sched td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); }
table.sched th:first-child, table.sched td:first-child { text-align: left; }
table.sched thead th { background: var(--bg); color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; }
table.sched tbody tr:hover { background: #fafcff; }
table.sched tr.year-sep td { border-top: 2px solid var(--line); }

/* Prose / FAQ */
.prose { max-width: 70ch; }
.prose p, .prose li { color: #2b3a55; }
.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; margin-bottom: 10px; background: #fff; }
.faq summary { font-weight: 600; cursor: pointer; padding: 10px 0; }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }

/* Tool grid (home) */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 8px; }
.tool-card { display: block; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); }
.tool-card:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-1px); transition: .15s; }
.tool-card .t { font-weight: 700; font-size: 1.05rem; }
.tool-card .d { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* Ad slots */
.ad-slot { margin: 26px 0; min-height: 90px; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg,#fff,#fff 10px,#f4f6fa 10px,#f4f6fa 20px);
  border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: .8rem; }

/* Related calculators */
.related { margin-top: 40px; }
.related h2 { margin: 0 0 12px; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.rel-grid a {
  display: block; padding: 12px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink); font-weight: 600; font-size: .92rem;
}
.rel-grid a:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-ink); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 50px; padding: 32px 0 26px; background: var(--card); }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 26px; }
@media (max-width: 760px) { .foot-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .foot-cols { grid-template-columns: 1fr; } }
.foot-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); margin: 0 0 10px; }
.foot-col a { display: block; color: var(--muted); font-size: .88rem; padding: 3px 0; }
.foot-col a:hover { color: var(--brand-ink); }
.foot-base { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); }

.disclaimer { font-size: .8rem; color: var(--muted); margin-top: 12px; }

/* ===== Home page enhancements ===== */
.hero--home { padding: 44px 0 8px; }
.hero--home h1 { max-width: 18ch; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 20px; color: var(--muted); font-size: .92rem; font-weight: 600; }
.trust span { display: inline-flex; align-items: center; gap: 7px; }
.trust svg { width: 16px; height: 16px; color: var(--good); flex: none; }

.section { margin-top: 44px; }
.section > h2 { margin: 0 0 4px; }
.section > .sub { color: var(--muted); margin: 0 0 18px; }

/* icon chips */
.ico { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: #eaf1fe; color: var(--brand); margin-bottom: 12px; }
.ico svg { width: 22px; height: 22px; }
.ico.amber { background: #fdf0dd; color: var(--warn); }
.ico.green { background: #e7f6ec; color: var(--good); }

.tool-card { display: flex; flex-direction: column; }

/* feature grid */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 18px; }
.feature { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.feature h3 { margin: 0 0 6px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; }
