/* helocinterestcalculator.com — shared styles (mobile-first, polished) */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #556274;
  --line: #e5e9f0;
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --brand-soft: #eff4ff;
  --accent: #0f766e;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-ink: #92400e;
  --ok: #047857;
  --danger: #b91c1c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 28px rgba(15,23,42,.06);
  --max: 1040px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff;
  padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }
.wrap { width: min(100% - 1.5rem, var(--max)); margin-inline: auto; }

/* Header */
.site-header {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1rem; padding: .7rem 0;
}
.logo {
  font-weight: 700; color: var(--ink); text-decoration: none;
  font-size: .98rem; letter-spacing: -.02em;
}
.logo span { color: var(--brand); }
.nav-links {
  display: flex; flex-wrap: wrap; gap: .15rem .85rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: .9rem;
  padding: .35rem .15rem; min-height: 40px;
  display: inline-flex; align-items: center;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--brand); font-weight: 600; }

/* Hero — tighter first screen */
.hero {
  padding: 1.1rem 0 .55rem;
}
.hero h1 {
  margin: 0 0 .4rem;
  font-size: clamp(1.45rem, 4.2vw, 1.95rem);
  line-height: 1.22; letter-spacing: -.025em;
}
.lede {
  color: var(--muted); margin: 0 0 .65rem; max-width: 64ch;
  font-size: 1rem; line-height: 1.5;
}
.badge-row {
  display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .55rem;
}
.badge {
  display: inline-block; font-size: .7rem; font-weight: 650; letter-spacing: .01em;
  padding: .2rem .5rem; border-radius: 999px;
  background: var(--brand-soft); color: #1e3a8a; border: 1px solid #dbe4ff;
}
.badge.warn {
  background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-border);
}
.example-note {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d;
  border-radius: var(--radius-sm); padding: .55rem .75rem;
  font-size: .86rem; margin: 0; line-height: 1.45;
}

/* Calculator layout — pull tool up */
.layout {
  display: grid; gap: 1rem; padding: .35rem 0 1.5rem;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 1.05fr .95fr; align-items: start; gap: 1.15rem; }
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.05rem 1.1rem;
}
.card h2 { margin: 0 0 .75rem; font-size: 1.08rem; letter-spacing: -.01em; }
.form-grid { display: grid; gap: .75rem; }
@media (min-width: 560px) {
  .form-grid.two { grid-template-columns: 1fr 1fr; }
}
label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: .3rem; }
.hint { display: block; font-size: .76rem; color: var(--muted); font-weight: 400; margin-top: .18rem; }
input[type="number"], input[type="text"], select {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: 9px; font: inherit; background: #fff; color: var(--ink);
  min-height: 44px; font-size: 16px;
}
input:focus, select:focus {
  outline: 2px solid rgba(29,78,216,.28); border-color: var(--brand);
}
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 9px;
  padding: .7rem 1.05rem; font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem; min-height: 44px;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: #cbd5e1; background: #f8fafc; }

/* Results */
.results { display: grid; gap: .65rem; }
.metric {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem .85rem; background: #f8fafc;
}
.metric .label { font-size: .78rem; color: var(--muted); margin: 0 0 .12rem; }
.metric .value {
  font-size: 1.28rem; font-weight: 700; letter-spacing: -.02em; margin: 0;
}
.metric .sub { font-size: .8rem; color: var(--muted); margin: .15rem 0 0; }
.metric.highlight {
  background: var(--brand-soft); border-color: #c7d7fe;
}
.metric.highlight .value { color: var(--brand-dark); }

/* YMYL disclaimer — refined */
.disclaimer {
  background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid var(--warn-border); border-left: 3px solid #f59e0b;
  border-radius: var(--radius-sm); padding: .7rem .9rem;
  font-size: .86rem; margin: .75rem 0 0; line-height: 1.45;
}
.disclaimer strong {
  display: inline; margin: 0; font-weight: 700; margin-right: .25rem;
}

/* Content / FAQ */
.content-block { padding: .25rem 0 1.75rem; }
.content-block h2 { font-size: 1.2rem; margin: 1.35rem 0 .5rem; letter-spacing: -.01em; }
.content-block h3 { font-size: 1.02rem; margin: 1rem 0 .4rem; }
.content-block p, .content-block li { color: var(--ink); }
.content-block p { max-width: 68ch; }
.content-block ul { padding-left: 1.15rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .7rem .9rem; margin: .45rem 0;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { margin-bottom: .35rem; }
.related { display: grid; gap: .65rem; margin: .85rem 0 0; }
@media (min-width: 640px) { .related { grid-template-columns: 1fr 1fr; } }
.related a.card {
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.related a.card:hover { border-color: #93c5fd; box-shadow: var(--shadow); }
.related .title { font-weight: 700; color: var(--brand); margin: 0 0 .2rem; }
.related p { margin: 0; color: var(--muted); font-size: .9rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: .65rem 0; }
table.amort {
  width: 100%; border-collapse: collapse; font-size: .84rem; background: #fff;
}
table.amort th, table.amort td {
  border: 1px solid var(--line); padding: .4rem .5rem; text-align: right; white-space: nowrap;
}
table.amort th:first-child, table.amort td:first-child { text-align: left; }
table.amort thead { background: #f1f5f9; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 1.35rem 0 1.75rem; margin-top: .5rem;
}
.footer-grid { display: grid; gap: .9rem; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h3 { margin: 0 0 .35rem; font-size: .92rem; }
.site-footer p, .site-footer li { color: var(--muted); font-size: .86rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.legal { max-width: 72ch; }
.legal h1 { font-size: 1.65rem; }
.error { color: var(--danger); font-size: .85rem; margin: .25rem 0 0; min-height: 1.1em; }
.toast {
  position: fixed; bottom: 1rem; right: 1rem; background: var(--ink); color: #fff;
  padding: .65rem .95rem; border-radius: 9px; font-size: .88rem;
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 50;
}
.toast.show { opacity: 1; }

@media (max-width: 599px) {
  .wrap { width: min(100% - 1.15rem, var(--max)); }
  .card { padding: .95rem; }
  .metric .value { font-size: 1.18rem; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; justify-content: center; }
  .hero { padding: .9rem 0 .4rem; }
  .lede { font-size: .95rem; }
}
@media print {
  .site-header, .site-footer, .actions, .skip-link, .badge-row { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .layout { display: block; }
}
