/* Courtney Loans site styles */
:root {
  --pine: #1e4a3b;
  --pine-deep: #143329;
  --ink: #17231e;
  --muted: #4a5a52;
  --paper: #f6f8f4;
  --white: #ffffff;
  --fern: #e2ebe4;
  --fern-deep: #9fbcaa;
  --brass: #d89a1f;
  --brass-soft: #f6e6c2;
  --line: #c7d3ca;
  --focus: #d89a1f;

  --font-body: "Public Sans", "Segoe UI", Arial, sans-serif;
  --font-head: "Zilla Slab", Georgia, "Times New Roman", serif;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --measure: 68ch;
  --radius: 8px;
  --radius-lg: 14px;
  --band-y: clamp(56px, 8vw, 104px);
  --band-y-sm: clamp(40px, 5vw, 64px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--header-h) + 20px); }
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pine-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.12; color: var(--ink); margin: 0; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.25rem, 4.4vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); }
h3 { font-size: 1.3rem; line-height: 1.25; }
p, ul, ol, dl, table, figure, blockquote { margin: 0; }
.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; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--brass); color: var(--ink); padding: 10px 16px; border-radius: var(--radius); z-index: 100; font-weight: 600; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: var(--radius);
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  border: 2px solid var(--pine); background: var(--pine); color: var(--white);
}
.btn:hover { background: var(--pine-deep); border-color: var(--pine-deep); color: var(--white); text-decoration: none; }
.btn--brass { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.btn--brass:hover { background: #c38a16; border-color: #c38a16; color: var(--ink); }
.btn--ghost { background: transparent; color: var(--pine); }
.btn--ghost:hover { background: var(--pine); color: var(--white); }
.btn--light { background: transparent; border-color: rgba(255,255,255,.7); color: var(--white); }
.btn--light:hover { background: var(--white); color: var(--pine); border-color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand svg { width: 42px; height: 42px; flex-shrink: 0; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.45rem; line-height: 1; letter-spacing: -0.01em; }
.brand-name small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .74rem; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.main-nav { margin-left: auto; }
.menu { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; gap: 2px; }
.menu > li { position: relative; display: flex; align-items: center; }
.menu a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--ink); font-weight: 500; font-size: .98rem; text-decoration: none; white-space: nowrap; }
.menu a:hover { background: var(--fern); color: var(--ink); }
.menu a[aria-current="page"], .menu > li.is-current > a { color: var(--pine); box-shadow: inset 0 -3px 0 var(--brass); border-radius: 6px 6px 0 0; }
.sub-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 36px; margin-left: -8px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; }
.sub-toggle svg { width: 14px; height: 14px; transition: transform .15s; }
.sub { list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: 0; min-width: 240px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(23,35,30,.12); display: none; }
.sub a { padding: 9px 12px; font-size: .95rem; }
.sub a[aria-current="page"] { background: var(--fern); box-shadow: none; border-radius: 6px; }
.menu > li:last-child .sub { left: auto; right: 0; }
@media (min-width: 1101px) {
  .has-sub:hover > .sub, .has-sub:focus-within > .sub { display: block; }
  .has-sub:hover .sub-toggle svg { transform: rotate(180deg); }
}
.header-call { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--pine); text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.header-call svg { width: 18px; height: 18px; }
.nav-toggle { display: none; margin-left: auto; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 22px; height: 2px; background: var(--ink); position: relative; transition: transform .2s; }
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle .bars::before { top: -7px; }
.nav-toggle .bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; }
  .header-call { margin-left: auto; }
  .header-call + .nav-toggle { margin-left: 0; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(23,35,30,.14);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    display: none;
  }
  .main-nav.is-open { display: block; }
  .menu { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; }
  .menu > li { flex-wrap: wrap; border-bottom: 1px solid var(--fern); }
  .menu > li > a { flex: 1; padding: 14px 4px; font-size: 1.05rem; }
  .menu a[aria-current="page"], .menu > li.is-current > a { box-shadow: none; color: var(--pine); font-weight: 700; }
  .sub-toggle { width: 48px; height: 48px; margin: 0; }
  .sub-toggle svg { width: 18px; height: 18px; }
  .sub { position: static; display: none; box-shadow: none; border: 0; padding: 0 0 10px 12px; min-width: 0; width: 100%; }
  .has-sub.is-open > .sub { display: block; }
  .has-sub.is-open .sub-toggle svg { transform: rotate(180deg); }
}
@media (max-width: 560px) {
  .header-call span { display: none; }
  .header-call { width: 48px; height: 48px; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); }
  .brand-name small { display: none; }
  .brand-name { font-size: 1.3rem; }
  .brand svg { width: 38px; height: 38px; }
  .header-row { gap: 12px; }
}

/* ---------- bands ---------- */
.band { padding: var(--band-y) 0; }
.band--tight { padding: var(--band-y-sm) 0; }
.band--white { background: var(--white); }
.band--fern { background: var(--fern); }
.band--pine { background: var(--pine); color: #e9f0eb; }
.band--pine h2, .band--pine h3 { color: var(--white); }
.band--pine a { color: var(--white); }
.band--line { border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 1.1rem; }
.band--pine .section-head p { color: #cfe0d5; }

/* ---------- home hero ---------- */
.hero { position: relative; background: var(--paper); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: clamp(28px, 4vw, 56px); align-items: center; padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(48px, 7vw, 96px); position: relative; }
.hero-copy { position: relative; z-index: 2; }
.hero-copy h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.04; max-width: 13ch; }
.hero-copy .lede { margin-top: 22px; font-size: 1.2rem; line-height: 1.55; color: var(--muted); max-width: 46ch; }
.hero-copy .btn-row { margin-top: 30px; }
.hero-photo { position: absolute; top: 0; bottom: 0; right: 0; width: 46%; z-index: 0; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--paper) 0%, rgba(246,248,244,.55) 22%, rgba(246,248,244,0) 48%); }
.hero-tool { position: relative; z-index: 2; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 34px; padding: 0; list-style: none; color: var(--ink); font-weight: 500; font-size: .98rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts svg { width: 20px; height: 20px; color: var(--pine); }
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
  .hero-copy h1 { max-width: 16ch; }
  .hero-photo { position: relative; width: 100%; height: clamp(220px, 42vw, 340px); }
  .hero-photo::after { background: linear-gradient(0deg, var(--paper) 0%, rgba(246,248,244,0) 45%); }
}


/* ---------- estimator / calculators ---------- */
.estimator { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 24px 48px -20px rgba(20,51,41,.35); padding: clamp(20px, 3vw, 30px); }
.estimator-title { font-size: 1.45rem; }
.estimator .calc-fields { margin-top: 18px; }
.calc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.calc-fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calc-fields .span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: .9rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: .82rem; color: var(--muted); line-height: 1.4; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .affix { position: absolute; color: var(--muted); font-weight: 500; pointer-events: none; font-size: .98rem; }
.input-wrap .affix--pre { left: 12px; }
.input-wrap .affix--post { right: 12px; }

input[type="number"], input[type="text"], input[type="date"], select {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #aebdb3; border-radius: var(--radius);
  font: 500 1rem/1.2 var(--font-body); color: var(--ink); background: var(--white); font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: none;
}
select { padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2317231e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-wrap input[type] { padding-left: 28px; }
.input-wrap.has-post input[type] { padding-left: 12px; padding-right: 44px; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, select:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--pine); }
.estimate-result { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.estimate-label { font-weight: 600; color: var(--muted); font-size: .95rem; }
.estimate-figure { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.4rem, 5vw, 3.1rem); line-height: 1; color: var(--pine); font-variant-numeric: tabular-nums; }
.estimate-figure small { font-family: var(--font-body); font-size: .95rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.paybar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--fern); margin-top: 16px; }
.paybar span { display: block; height: 100%; transition: width .25s ease; }
.seg-pi, .sw-pi { background: var(--pine); }
.seg-tax, .sw-tax { background: var(--brass); }
.seg-ins, .sw-ins { background: var(--fern-deep); }
.seg-pmi, .sw-pmi { background: #6f8f7d; }
.paylegend { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; font-size: .95rem; }
.paylegend li { display: flex; align-items: center; gap: 10px; }
.paylegend b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.sw { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.calc-note { margin-top: 14px; font-size: .86rem; color: var(--muted); line-height: 1.5; }
.calc-link { display: inline-block; margin-top: 16px; font-weight: 600; }

/* ---------- inner page head ---------- */
.page-head { background: var(--fern); border-bottom: 1px solid var(--line); }
.page-head-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(28px, 4vw, 48px); }
.crumbs { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--fern-deep); }
.crumbs a { color: var(--muted); }
.page-head h1 { max-width: 18ch; }
.page-head .lede { margin-top: 18px; font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.page-head .btn-row { margin-top: 26px; }
.page-head-media { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--white); }
.page-head-media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .page-head-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head-media { aspect-ratio: 16 / 9; }
}

/* ---------- prose ---------- */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose > h2 { margin-top: 1.6em; }
.prose > h3 { margin-top: 1.4em; }
.prose > h2 + *, .prose > h3 + * { margin-top: .6em; }
.prose > :first-child { margin-top: 0; }
.prose ul:not([class]), .prose ol:not([class]) { padding-left: 1.3em; }
.prose ul:not([class]) > li + li, .prose ol:not([class]) > li + li { margin-top: .45em; }
.prose li::marker { color: var(--pine); }
.lead-p { font-size: 1.15rem; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* ---------- layouts ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.split--top { align-items: start; }
.split--wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); }
.split--wide-right { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.split-media { border-radius: var(--radius-lg); overflow: hidden; }
.split-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; }
.split-media--wide img { aspect-ratio: 3 / 2; }
@media (max-width: 860px) {
  .split, .split--wide-left, .split--wide-right { grid-template-columns: minmax(0, 1fr); }
  .split-media img { aspect-ratio: 16 / 10; }
}
.with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.rail { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 18px; }
@media (max-width: 960px) { .with-rail { grid-template-columns: minmax(0, 1fr); } .rail { position: static; } }

/* rail cards */
.rail-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.rail-box h2, .rail-box h3 { font-size: 1.2rem; }
.rail-box p { margin-top: 8px; color: var(--muted); font-size: .95rem; }
.rail-box .btn { margin-top: 16px; width: 100%; }
.rail-links { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 2px; }
.rail-links a { display: block; padding: 8px 0; border-bottom: 1px solid var(--fern); text-decoration: none; font-weight: 500; }
.rail-links a:hover { text-decoration: underline; }
.rail-links li:last-child a { border-bottom: 0; }

/* ---------- tool index (calculators) ---------- */
.tool-index { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 40px); }
.tool-index li { border-top: 2px solid var(--pine); padding: 22px 0 30px; display: flex; flex-direction: column; }
.tool-index .icon { width: 44px; height: 44px; border-radius: 10px; background: var(--white); color: var(--pine); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.tool-index .icon svg { width: 24px; height: 24px; }
.tool-index h3 { margin-top: 16px; }
.tool-index p { margin-top: 8px; color: var(--muted); flex: 1; }
.tool-index a.more { margin-top: 14px; font-weight: 600; }
@media (max-width: 900px) { .tool-index { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tool-index { grid-template-columns: minmax(0, 1fr); } }

/* ---------- resource rows ---------- */
.res-list { list-style: none; padding: 0; margin-top: 28px; display: grid; gap: 0; }
.res-list li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.res-list li:last-child { border-bottom: 1px solid var(--line); }
.res-list .icon { width: 48px; height: 48px; border-radius: 50%; background: var(--fern); color: var(--pine); display: inline-flex; align-items: center; justify-content: center; }
.res-list .icon svg { width: 24px; height: 24px; }
.res-list h3 { font-size: 1.2rem; }
.res-list p { margin-top: 6px; color: var(--muted); }
.res-list a.more { display: inline-block; margin-top: 8px; font-weight: 600; }
.ext::after { content: ""; display: inline-block; width: .7em; height: .7em; margin-left: .3em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- reading links (pine band) ---------- */
.read-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); list-style: none; padding: 0; }
.read-grid a { display: flex; flex-direction: column; height: 100%; padding: 24px; border-radius: var(--radius-lg); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); text-decoration: none; color: #e9f0eb; }
.read-grid a:hover { background: rgba(255,255,255,.13); color: var(--white); }
.read-grid strong { font-family: var(--font-head); font-size: 1.35rem; line-height: 1.2; color: var(--white); }
.read-grid span { margin-top: 10px; color: #cfe0d5; flex: 1; }
.read-grid em { margin-top: 18px; font-style: normal; font-weight: 600; color: var(--brass-soft); }
@media (max-width: 860px) { .read-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- loan type table ---------- */
.loan-table { width: 100%; border-collapse: collapse; font-size: 1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.loan-table th, .loan-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--fern); vertical-align: top; }
.loan-table thead th { background: var(--pine); color: var(--white); font-weight: 600; font-size: .92rem; }
.loan-table tbody th { font-weight: 600; white-space: nowrap; }
.loan-table tbody tr:last-child th, .loan-table tbody tr:last-child td { border-bottom: 0; }
.loan-table td { color: var(--muted); }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--fern); color: var(--pine); margin-left: 6px; vertical-align: 2px; }
.tag--arm { background: var(--brass-soft); color: #6b4a07; }
@media (max-width: 700px) {
  .loan-table thead { display: none; }
  .loan-table, .loan-table tbody, .loan-table tr, .loan-table th, .loan-table td { display: block; width: 100%; }
  .loan-table tr { padding: 14px 16px; border-bottom: 1px solid var(--fern); }
  .loan-table tbody th, .loan-table td { padding: 2px 0; border: 0; white-space: normal; }
  .loan-table td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--ink); }
}

/* ---------- quote worksheet ---------- */
.seg-tabs { display: inline-flex; padding: 4px; background: var(--fern); border-radius: 999px; gap: 4px; flex-wrap: wrap; }
.seg-tabs button { border: 0; background: transparent; padding: 10px 20px; border-radius: 999px; font: 600 .98rem/1 var(--font-body); color: var(--ink); cursor: pointer; min-height: 42px; }
.seg-tabs button[aria-selected="true"] { background: var(--pine); color: var(--white); }
.worksheet { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 30px); margin-top: 22px; }
.worksheet .calc-fields { margin-top: 0; }
.ws-summary { margin-top: 20px; padding: 14px 16px; background: var(--paper); border-radius: var(--radius); font-weight: 500; }
.ws-summary b { font-variant-numeric: tabular-nums; }
.quote-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.quote-table th, .quote-table td { padding: 12px 10px; border-bottom: 1px solid var(--fern); text-align: left; vertical-align: middle; }
.quote-table thead th { font-size: .86rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--pine); }
.quote-table tbody th { font-weight: 600; }
.quote-table td.num, .quote-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quote-table input { min-height: 42px; }
.quote-table .input-wrap, .quote-table td > input { max-width: 120px; }
.quote-table .out { font-weight: 600; color: var(--pine); }
.quote-table .sub-note { display: block; font-size: .82rem; color: var(--muted); font-weight: 400; }
.quote-table .empty { color: #8a9a91; font-weight: 500; }
@media (max-width: 900px) {
  .quote-table thead { display: none; }
  .quote-table, .quote-table tbody, .quote-table tr { display: block; width: 100%; }
  .quote-table tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: end; }
  .quote-table th, .quote-table td { display: block; padding: 0; border: 0; }
  .quote-table tbody th { grid-column: 1 / -1; }
  .quote-table td[data-label]::before { content: attr(data-label); display: block; font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
  .quote-table td.num { text-align: left; }
  .quote-table .input-wrap, .quote-table td > input { max-width: none; }
}
@media (max-width: 600px) {
  .quote-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- calculator page ---------- */
.calc-tabs { scroll-margin-top: calc(var(--header-h) + 16px); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 26px; }
@media (max-width: 1100px) { .calc-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .calc-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.calc-tabs a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; white-space: nowrap; border-radius: 999px; border: 1px solid var(--line); background: var(--white); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; min-height: 44px; }
.calc-tabs a svg { width: 18px; height: 18px; color: var(--pine); }
.calc-tabs a:hover { border-color: var(--pine); }
.calc-tabs a[aria-selected="true"] { background: var(--pine); border-color: var(--pine); color: var(--white); }
.calc-tabs a[aria-selected="true"] svg { color: var(--brass-soft); }
.calc-panel { scroll-margin-top: calc(var(--header-h) + 20px); }
.js .calc-panel[hidden] { display: none; }
.calc-panel + .calc-panel { margin-top: var(--band-y-sm); }
.js .calc-panel + .calc-panel { margin-top: 0; }
.calc-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.calc-inputs { padding: clamp(20px, 3vw, 32px); }
.calc-inputs h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.calc-inputs > p { margin-top: 10px; color: var(--muted); }
.calc-inputs .calc-fields { margin-top: 22px; }
.calc-output { background: var(--pine); color: #e9f0eb; padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; }
.calc-output .out-label { font-weight: 600; color: #cfe0d5; font-size: .95rem; }
.calc-output .out-big { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.4rem, 5vw, 3.2rem); line-height: 1.05; color: var(--white); margin-top: 6px; font-variant-numeric: tabular-nums; }
.calc-output .out-big small { font-family: var(--font-body); font-size: 1rem; font-weight: 500; color: #cfe0d5; margin-left: 4px; }
.calc-output .paybar { background: rgba(255,255,255,.15); }
.calc-output .seg-pi, .calc-output .sw-pi { background: #8fd0ad; }
.calc-output .seg-ins, .calc-output .sw-ins { background: #cfe0d5; }
.calc-output .seg-pmi, .calc-output .sw-pmi { background: #5f9c7d; }
.out-rows { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 0; }
.out-rows li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.14); font-size: .98rem; }
.out-rows li:last-child { border-bottom: 0; }
.out-rows b { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--white); white-space: nowrap; }
.out-rows .sw { margin-right: 8px; display: inline-block; vertical-align: -1px; }
.calc-output .calc-note { color: #bcd2c4; margin-top: auto; padding-top: 18px; }
.calc-output .alert { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: rgba(216,154,31,.18); border: 1px solid rgba(216,154,31,.5); color: #fbeacb; font-size: .92rem; }
@media (max-width: 900px) { .calc-card { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .calc-fields, .calc-fields--3 { grid-template-columns: minmax(0, 1fr); } .calc-fields .span-2 { grid-column: auto; } }
.calc-explain { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 40px; }
.calc-explain h3 { font-size: 1.12rem; }
.calc-explain p { margin-top: 6px; color: var(--muted); font-size: .98rem; }
@media (max-width: 760px) { .calc-explain { grid-template-columns: minmax(0, 1fr); } }
.schedule { margin-top: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.schedule summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.schedule summary::-webkit-details-marker { display: none; }
.schedule summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--pine); border-bottom: 2px solid var(--pine); transform: rotate(45deg); transition: transform .2s; flex-shrink: 0; }
.schedule[open] summary::after { transform: rotate(-135deg); }
.schedule-body { padding: 0 20px 20px; max-height: 420px; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--fern); text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th { position: sticky; top: 0; background: var(--white); color: var(--muted); font-weight: 600; font-size: .86rem; border-bottom: 2px solid var(--pine); }
.comps { display: grid; gap: 12px; margin-top: 22px; }
.comp-row { display: grid; grid-template-columns: 90px repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.comp-row .comp-name { font-weight: 600; font-size: .92rem; padding-bottom: 12px; }
@media (max-width: 520px) { .comp-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .comp-row .comp-name { grid-column: 1 / -1; padding-bottom: 0; } }
fieldset.group { border: 0; padding: 0; margin: 22px 0 0; }
fieldset.group legend { font-family: var(--font-head); font-weight: 700; font-size: 1.12rem; padding: 0; margin-bottom: 12px; }
fieldset.group + fieldset.group { padding-top: 20px; border-top: 1px solid var(--fern); }

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 0; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; padding: 24px 0; border-top: 1px solid var(--line); }
.steps > li::before { content: counter(step); width: 48px; height: 48px; border-radius: 50%; background: var(--pine); color: var(--white); font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; display: inline-flex; align-items: center; justify-content: center; }
.steps h3 { font-size: 1.25rem; }
.steps p { margin-top: 6px; color: var(--muted); }
.steps p a { font-weight: 600; }

/* ---------- comparison ---------- */
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.compare-col { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.compare-col h3 { font-size: 1.3rem; padding-bottom: 12px; border-bottom: 3px solid var(--fern-deep); }
.compare-col--strong h3 { border-bottom-color: var(--brass); }
.compare-col dl { margin-top: 6px; }
.compare-col dt { font-weight: 600; font-size: .88rem; color: var(--muted); margin-top: 14px; }
.compare-col dd { margin: 4px 0 0; }
@media (max-width: 760px) { .compare { grid-template-columns: minmax(0, 1fr); } }

/* ---------- checklist / chips ---------- */
.checks { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }
.checks li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; }
.checks li::before { content: ""; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; background: var(--fern) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e4a3b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat; }
.checks--one { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) { .checks { grid-template-columns: minmax(0, 1fr); } }

/* ---------- accordion ---------- */
.qa-group + .qa-group { margin-top: clamp(36px, 5vw, 56px); }
.qa-group > h2 { margin-bottom: 16px; }
.qa { border-top: 1px solid var(--line); }
.qa:last-child { border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 0; font-weight: 600; font-size: 1.08rem; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--fern); color: var(--pine); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 500; line-height: 1; }
.qa[open] summary::after { content: "\2212"; background: var(--pine); color: var(--white); }
.qa-body { padding: 0 0 22px; max-width: var(--measure); }
.qa-body > * + * { margin-top: .8em; }
.qa-body ul { padding-left: 1.3em; }
.qa-body li + li { margin-top: .4em; }

/* ---------- glossary ---------- */
.az { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 28px; list-style: none; padding: 0; }
.az a { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-family: var(--font-head); font-size: 1.1rem; }
.az a:hover { border-color: var(--pine); background: var(--fern); }
.gloss-letter { font-size: 2rem; color: var(--pine); padding-bottom: 8px; border-bottom: 2px solid var(--pine); margin-top: 36px; scroll-margin-top: calc(var(--header-h) + 16px); }
.gloss-letter:first-of-type { margin-top: 0; }
.gloss dt { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; margin-top: 20px; scroll-margin-top: calc(var(--header-h) + 16px); }
.gloss dd { margin: 6px 0 0; color: var(--ink); max-width: var(--measure); }
.gloss dd + dd { margin-top: .6em; }

/* ---------- callouts ---------- */
.callout { background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--brass); border-radius: var(--radius); padding: 18px 20px; }
.callout h3 { font-size: 1.15rem; }
.callout p { margin-top: 6px; }
.callout > :first-child { margin-top: 0; }
.figure-strip { border-radius: var(--radius-lg); overflow: hidden; }
.figure-strip img { width: 100%; aspect-ratio: 21 / 8; object-fit: cover; }
@media (max-width: 640px) { .figure-strip img { aspect-ratio: 16 / 9; } }

/* example table (points) */
.example { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.example caption { text-align: left; padding: 16px 18px 0; font-weight: 600; font-family: var(--font-head); font-size: 1.15rem; caption-side: top; background: var(--white); }
.example-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.example-wrap table { width: 100%; min-width: 520px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.example-wrap th, .example-wrap td { padding: 12px 16px; border-bottom: 1px solid var(--fern); text-align: right; }
.example-wrap th:first-child, .example-wrap td:first-child { text-align: left; }
.example-wrap thead th { background: var(--pine); color: var(--white); font-weight: 600; }
.example-wrap tbody th { font-weight: 600; }
.example-wrap tbody tr:last-child th, .example-wrap tbody tr:last-child td { border-bottom: 0; }
.footnote { margin-top: 10px; font-size: .86rem; color: var(--muted); max-width: var(--measure); }

/* mini calc (break-even) */
.mini-calc { background: var(--fern); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 28px); }
.mini-calc h3 { font-size: 1.25rem; }
.mini-calc .calc-fields { margin-top: 16px; }
.mini-result { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; }
.mini-result strong { font-family: var(--font-head); font-size: 2rem; color: var(--pine); font-variant-numeric: tabular-nums; }

/* ---------- CTA ---------- */
.cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; }
.cta h2 { max-width: 22ch; }
.cta p { margin-top: 12px; max-width: 56ch; }
@media (max-width: 760px) { .cta { grid-template-columns: minmax(0, 1fr); } }

/* ---------- contact ---------- */
.contact-list { list-style: none; padding: 0; display: grid; gap: 14px; margin-top: 20px; }
.contact-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center; }
.contact-list .icon { width: 44px; height: 44px; border-radius: 50%; background: var(--fern); color: var(--pine); display: inline-flex; align-items: center; justify-content: center; }
.contact-list .icon svg { width: 20px; height: 20px; }
.contact-list span.k { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }
.contact-list a, .contact-list strong { font-weight: 600; font-size: 1.08rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--pine-deep); color: #c9dacf; padding: clamp(48px, 6vw, 72px) 0 28px; font-size: .97rem; }
.site-footer a { color: #e9f0eb; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-brand .brand { color: var(--white); }
.footer-brand .brand-name small { color: #a9c2b3; }
.footer-brand p { margin-top: 16px; max-width: 34ch; }
.footer-col h2 { font-family: var(--font-body); font-size: .95rem; font-weight: 700; color: var(--white); letter-spacing: .01em; }
.footer-col ul { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 8px; }
.footer-contact li { display: flex; gap: 10px; align-items: center; }
.footer-contact svg { width: 16px; height: 16px; color: var(--brass); flex-shrink: 0; }
.footer-base { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font-size: .86rem; color: #a9c2b3; }
.footer-base p { max-width: 70ch; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }

.to-top { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%; background: var(--pine); color: var(--white); border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 20px rgba(20,51,41,.3); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; z-index: 40; }
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top svg { width: 20px; height: 20px; }

/* spacing utilities */
.mt-0 { margin-top: 0 !important; }
.mt-s { margin-top: 14px; }
.mt-m { margin-top: 24px; }
.mt-l { margin-top: 32px; }
.out-sub { margin-top: 6px; font-weight: 500; }

/* guide columns (resources page) */
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.guide-col { background: var(--white); border-radius: var(--radius-lg); padding: 22px 24px 12px; border: 1px solid var(--line); }
.guide-col h3 { padding-bottom: 10px; border-bottom: 2px solid var(--pine); }
.guide-col .rail-links { margin-top: 6px; }
@media (max-width: 860px) { .guide-grid { grid-template-columns: minmax(0, 1fr); } }
.tool-index--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .tool-index--two { grid-template-columns: minmax(0, 1fr); } }
.h3-size { font-size: clamp(1.4rem, 2.2vw, 1.7rem); }
.topic-grid p a { font-weight: 600; }
.prose--wide { max-width: none; }
.prose--wide > p, .prose--wide > h2, .prose--wide > h3, .prose--wide > ul:not([class]), .prose--wide > ol:not([class]) { max-width: var(--measure); }
.section-head--row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap; }
.section-head--row > div { max-width: 720px; }
.loan-table tbody th { width: 30%; }
.loan-table td[data-label="Rate"] { width: 24%; }
fieldset.group .calc-fields { margin-top: 0; }
@media (max-width: 600px) {
  .example-wrap table { min-width: 440px; font-size: .9rem; }
  .example-wrap th, .example-wrap td { padding: 10px 10px; }
  .example-wrap th:first-child { position: sticky; left: 0; background: var(--white); box-shadow: 1px 0 0 var(--fern); max-width: 120px; }
  .example-wrap thead th:first-child { background: var(--pine); }
}

/* reading measure for body copy */
main p { max-width: var(--measure); }
.ws-summary { max-width: none; }
.checks--one { max-width: var(--measure); }
.prose > .figure-strip { margin-top: 2em; margin-bottom: .5em; }
