/* CloseSum — editorial financial-tool styles. System fonts only. */
:root {
  --ink: #10233f;
  --ink-2: #33435c;
  --muted: #5d6a7c;
  --paper: #fbfaf6;
  --card: #ffffff;
  --rule: #e2ddd2;
  --rule-2: #efebe2;
  --accent: #1f7a5c;
  --accent-soft: #e6f3ed;
  --neg: #a23b2a;
  --warn-bg: #fdf3e2;
  --warn-ink: #7a4b06;
  --radius: 12px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid #7cc4a6; outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: rgba(251,250,246,.94); position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(1.2) blur(6px); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 32px; width: auto; display: block; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font-size: 14px; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Hero */
.hero { padding: 44px 0 20px; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 10px; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 4.2vw, 46px); margin: 0 0 14px; font-weight: 700; max-width: 24ch; }
h2 { font-size: clamp(22px, 2.6vw, 28px); margin: 0 0 12px; }
h3 { font-size: 19px; margin: 0 0 8px; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 70ch; margin: 0; }
.verified { display: inline-flex; gap: 8px; align-items: center; margin-top: 16px; font-size: 13px; color: var(--ink-2); background: var(--accent-soft); border: 1px solid #cfe7dc; padding: 6px 12px; border-radius: 999px; }
.verified::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

section.block { padding: 28px 0; border-top: 1px solid var(--rule); }
section.block:first-of-type { border-top: 0; }

/* Calculator layout */
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; padding: 12px 0 32px; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 0 rgba(16,35,63,.03); }
.inputs { position: sticky; top: 84px; }
.inputs h2, .results h2 { font-size: 20px; margin-bottom: 4px; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.field small { font-size: 12px; color: var(--muted); }
.control { position: relative; display: flex; align-items: center; }
.control .affix { position: absolute; font-size: 14px; color: var(--muted); pointer-events: none; }
.control .pre { left: 11px; }
.control .post { right: 11px; }
input[type="number"], input[type="text"], input[type="email"], select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1px solid #cfc8b9; border-radius: 8px; padding: 9px 11px; min-height: 42px;
  font-variant-numeric: tabular-nums;
}
.control.has-pre input { padding-left: 24px; }
.control.has-post input { padding-right: 30px; }
input:hover, select:hover { border-color: #a9a191; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(31,122,92,.18); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
[hidden] { display: none !important; }

/* Results */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 14px 0 18px; }
.tile { border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; background: #fff; }
.tile.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.tile .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.tile.primary .k { color: #b9c4d4; }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.15; overflow-wrap: anywhere; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tile.primary .s { color: #b9c4d4; }
.neg { color: var(--neg); }
.tile.primary .neg { color: #ffb4a6; }
.warnings { margin: 0 0 14px; padding: 0; list-style: none; }
.warnings li { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #f0d9ad; border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 8px; }
.tables { display: grid; gap: 16px; }
table.breakdown { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.breakdown caption { text-align: left; font-family: var(--serif); font-weight: 700; font-size: 17px; padding: 0 0 6px; color: var(--ink); }
table.breakdown th, table.breakdown td { padding: 8px 0; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
table.breakdown th { text-align: left; font-weight: 500; color: var(--ink-2); padding-right: 12px; }
table.breakdown td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.breakdown td.mid { color: var(--muted); padding-right: 14px; }
table.breakdown tfoot th, table.breakdown tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 700; color: var(--ink); padding-top: 10px; }
.ratio-list { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: 14.5px; margin: 0; }
.ratio-list dt { color: var(--ink-2); }
.ratio-list dd { margin: 0; text-align: right; font-weight: 600; }

.disclaimer { border-left: 4px solid var(--accent); background: #fff; border-radius: 0 10px 10px 0; padding: 14px 16px; font-size: 14px; color: var(--ink-2); margin-top: 18px; border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.disclaimer p { margin: 0 0 6px; }
.disclaimer p:last-child { margin: 0; }
.disclaimer strong { color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: 15px; border-radius: 8px; padding: 11px 18px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { background: #1b3760; color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); }
.btn.secondary:hover { background: var(--rule-2); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.actions small { color: var(--muted); font-size: 13px; max-width: 46ch; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 14px; }
.card { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; flex: 1; }
.card a.cta { font-weight: 700; text-decoration: none; }
.card a.cta::after { content: " \2192"; }
.card .tag { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.list-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); }
.list-check li { padding-left: 26px; position: relative; color: var(--ink-2); }
.list-check li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 12px; height: 7px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }

.prose { max-width: 74ch; color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.sources { font-size: 14px; color: var(--ink-2); padding-left: 18px; margin: 8px 0 0; }
.sources li { margin-bottom: 6px; overflow-wrap: anywhere; }
.faq details { border-bottom: 1px solid var(--rule); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 8px 0 0; color: var(--ink-2); max-width: 78ch; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 14px; margin-top: 14px; }
.tool { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 16px; font-size: 14.5px; color: var(--ink-2); }
.tool h3 { font-family: var(--sans); font-size: 16px; margin-bottom: 6px; }
.tool p { margin: 0 0 8px; }
.waitlist { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; max-width: 760px; }
.waitlist .closed { background: var(--rule-2); border-radius: 8px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); margin: 12px 0 0; }
.fine { font-size: 13px; color: var(--muted); }
.related { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; list-style: none; margin: 8px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: 32px; padding: 28px 0 40px; font-size: 13.5px; color: var(--muted); background: #f6f3ec; }
.site-footer p { margin: 0 0 10px; max-width: 92ch; }
.site-footer .lead { color: var(--ink); font-weight: 600; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 14px; }
.site-footer nav a { color: var(--ink-2); }

#print-summary { display: none; }

@media (max-width: 900px) {
  .calc { grid-template-columns: 1fr; }
  .inputs { position: static; }
  .cards { grid-template-columns: 1fr; }
}
/* v1.1: eight nav links wrap to two rows below ~820px, so the header stops being sticky there. */
@media (max-width: 820px) {
  .site-header { position: static; }
}
@media (max-width: 520px) {
  .fields { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .tile .v { font-size: 22px; }
  .site-header { position: static; }
  .nav { font-size: 13px; gap: 2px 12px; }
}

/* Print / Save Deal Summary PDF */
@media print {
  @page { size: letter; margin: 10mm 12mm 10mm; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  body.has-print-summary .site-header,
  body.has-print-summary .site-footer,
  body.has-print-summary main .wrap > :not(#print-summary) { display: none !important; }
  body.has-print-summary #print-summary { display: block; }
  body:not(.has-print-summary) .site-header nav, body:not(.has-print-summary) .actions,
  body:not(.has-print-summary) .waitlist, body:not(.has-print-summary) .tools { display: none !important; }
  .inputs { position: static; }
  .calc { grid-template-columns: 1fr; }
  #print-summary .ps-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #10233f; padding-bottom: 8px; margin-bottom: 10px; }
  #print-summary .ps-head img { height: 26px; }
  #print-summary h1 { font-size: 20pt; margin: 0; max-width: none; }
  #print-summary .ps-meta { font-size: 9pt; color: #333; text-align: right; }
  #print-summary .ps-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 10px; }
  #print-summary .ps-tile { border: 1px solid #999; border-radius: 6px; padding: 6px 8px; }
  #print-summary .ps-tile .k { font-size: 7.5pt; text-transform: uppercase; letter-spacing: .04em; color: #444; font-weight: 700; }
  #print-summary .ps-tile .v { font-size: 13pt; font-weight: 700; }
  #print-summary .ps-cols { columns: 2; column-gap: 18px; }
  #print-summary table.breakdown { font-size: 8pt; break-inside: avoid; margin-bottom: 5px; }
  #print-summary table.breakdown caption { font-size: 9pt; padding-bottom: 2px; }
  #print-summary table.breakdown th, #print-summary table.breakdown td { padding: 1.5px 0; line-height: 1.3; }
  #print-summary table.breakdown tfoot th, #print-summary table.breakdown tfoot td { padding-top: 3px; }
  #print-summary .disclaimer { font-size: 7.5pt; line-height: 1.4; padding: 6px 9px; margin-top: 6px; break-inside: avoid; border-color: #999; }
  #print-summary .fine { font-size: 7.5pt; color: #333; margin: 4px 0; }
  #print-summary .disclaimer p { margin: 0 0 3px; }
  a { color: #000; text-decoration: none; }
  .neg { color: #000; }
}
