/* MortgageCalculator.me. Colors come from the original logo: charcoal gray and orange, with the old site's green kept for good-news numbers. */
:root {
    --bg: #f7f5f2;
    --surface: #ffffff;
    --surface-2: #fbfaf8;
    --text: #26282b;
    --muted: #63666b;
    --border: #e6e1da;
    --brand-gray: #4a4c50;
    --accent: #c4560f;        /* orange dark enough for white text and links */
    --accent-hover: #a84809;
    --accent-ink: #ffffff;
    --accent-soft: #fdf0e5;
    --accent-line: #f4a668;
    --good: #3f7d0c;
    --error-bg: #fdecec;
    --error: #9b1c1c;
    --series-1: #c4560f;
    --series-2: #3d6fb6;
    --series-3: #3f7d0c;
    --series-4: #7a5aa6;
    --series-5: #8d8a84;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgb(38 40 43 / .05), 0 4px 16px rgb(38 40 43 / .06);
    --shadow-lift: 0 2px 4px rgb(38 40 43 / .06), 0 10px 28px rgb(38 40 43 / .10);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Archivo", "Inter", system-ui, sans-serif;
    font-family: var(--font);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16171a;
        --surface: #1f2125;
        --surface-2: #24262b;
        --text: #ecebe8;
        --muted: #aaa8a3;
        --border: #34363b;
        --brand-gray: #d8d6d2;
        --accent: #f2924a;
        --accent-hover: #f6a96d;
        --accent-ink: #1a1009;
        --accent-soft: #3a2616;
        --accent-line: #8a4a1d;
        --good: #8fcf5a;
        --error-bg: #3a1d1d;
        --error: #f3a6a6;
        --series-1: #f2924a;
        --series-2: #86aee8;
        --series-3: #8fcf5a;
        --series-4: #b9a0dc;
        --series-5: #9b9892;
        --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
        --shadow-lift: 0 2px 4px rgb(0 0 0 / .35), 0 10px 28px rgb(0 0 0 / .35);
        color-scheme: dark;
    }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); margin: 0 0 8px; line-height: 1.15; font-weight: 800; }
.lede, .hero p { color: var(--muted); margin-top: 0; font-size: 1.05rem; max-width: 62ch; }
.crumbs { font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

/* Header: always light, so the original logo artwork reads well in both themes. */
.site-header { background: #fff; border-bottom: 3px solid #f08a3c; position: relative; z-index: 2; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px 28px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: block; line-height: 0; }
.brand img { height: 52px; width: auto; }
header nav { display: flex; gap: 2px; flex-wrap: wrap; }
header nav a { text-decoration: none; color: #4a4c50; font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 999px; }
header nav a:hover, header nav a[aria-current=page] { background: #fdf0e5; color: #a84809; }
@media (max-width: 720px) {
    .site-header .wrap { justify-content: center; padding-bottom: 6px; }
    .brand img { height: 42px; }
    header nav { width: 100%; justify-content: center; gap: 0; }
    header nav a { white-space: nowrap; padding: 5px 9px; font-size: .88rem; }
}

main.wrap { padding-top: 28px; padding-bottom: 56px; }

/* Home */
.home-hero { background: radial-gradient(1200px 400px at 85% -10%, #fde3cc 0%, transparent 60%), linear-gradient(180deg, #fff7f0 0%, var(--bg) 100%); border-bottom: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { .home-hero { background: radial-gradient(1200px 400px at 85% -10%, #3a2616 0%, transparent 60%), var(--bg); } }
.home-hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 36px; align-items: center; padding-top: 44px; padding-bottom: 44px; }
@media (max-width: 900px) { .home-hero .wrap { grid-template-columns: 1fr; padding-top: 28px; padding-bottom: 28px; gap: 24px; } }
.home-hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
.home-hero h1 em { font-style: normal; color: var(--accent); }
.home-hero .lede { font-size: 1.12rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.chips a { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 500; }
.chips a:hover { border-color: var(--accent-line); color: var(--accent); }
.rate-strip { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; color: var(--muted); font-size: .92rem; align-items: baseline; }
.rate-strip strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--text); margin-right: 4px; font-variant-numeric: tabular-nums; }
.quick { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 22px; }
.quick h2 { margin: 0 0 4px; font-size: 1.2rem; }
.quick > p { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }
.quick .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick button { width: 100%; margin-top: 6px; }
.quick-out { margin-top: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--accent-soft); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.quick-out span { color: var(--muted); font-size: .9rem; }
.quick-out strong { font-family: var(--font-display); font-size: 1.7rem; font-variant-numeric: tabular-nums; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 14px; flex-wrap: wrap; }
.section-head:first-child { margin-top: 8px; }
.section-head h2 { margin: 0; font-size: 1.4rem; }
.section-head p { margin: 0; color: var(--muted); }
.calc-grid { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.section-head + .calc-grid { margin-top: 0; }
.calc-grid a { display: flex; gap: 14px; height: 100%; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.calc-grid a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--accent-line); color: var(--text); }
.calc-grid .ico { flex: 0 0 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.calc-grid .ico svg { width: 22px; height: 22px; }
.calc-grid strong { display: block; margin-bottom: 3px; font-size: 1rem; line-height: 1.3; }
.calc-grid span { color: var(--muted); font-size: .92rem; }
.calc-grid a > div > span { display: block; }

.promo { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 40px; }
.promo a { display: block; padding: 22px; border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.promo a:hover { border-color: var(--accent-line); color: var(--text); }
.promo strong { display: block; font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 4px; }
.promo span { color: var(--muted); }
.promo em { display: block; margin-top: 10px; font-style: normal; font-weight: 600; color: var(--accent); }

/* Calculator pages */
.calc-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 22px; }
@media (max-width: 860px) { .calc-layout { grid-template-columns: 1fr; } }
.calc-form, .results { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-width: 0; box-shadow: var(--shadow); }
.calc-form { position: sticky; top: 14px; border-top: 4px solid #f08a3c; }
@media (max-width: 860px) { .calc-form { position: static; } }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset + fieldset { border-top: 1px solid var(--border); padding-top: 14px; }
legend { font-weight: 700; padding: 0; margin-bottom: 10px; color: var(--text); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.field { margin-bottom: 13px; }
.field > label { display: block; font-size: .92rem; font-weight: 600; margin-bottom: 5px; }
.field > label small { display: inline; font-weight: 400; color: var(--muted); }
.field > small, .field .input-row + small { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.input-row { display: flex; gap: 6px; }
.affix { position: relative; flex: 1; display: flex; }
.affix input { width: 100%; }
.affix .prefix, .affix .suffix { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.affix .prefix { left: 12px; }
.affix .suffix { right: 12px; }
.affix.has-prefix input { padding-left: 25px; }
.affix.has-suffix input { padding-right: 40px; }
input, select { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: #cfc7bc; }
select { flex: 1; }
.input-row select + select, .affix + select { flex: 0 0 auto; max-width: 48%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(240 138 60 / .25); }
.toggle { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; }
.toggle input { accent-color: var(--accent); width: 18px; height: 18px; }
.toggle small { grid-column: 2; }
.actions { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
button { font: inherit; font-weight: 700; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 11px 26px; cursor: pointer; box-shadow: 0 2px 0 rgb(0 0 0 / .08); transition: background .15s, transform .1s; }
button:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }
.reset { color: var(--muted); font-size: .92rem; }

.headline { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; line-height: 1.35; background: var(--accent-soft); border-left: 5px solid #f08a3c; border-radius: var(--radius-sm); padding: 16px 18px; margin-top: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; margin: 0 0 22px; padding: 18px 20px; border-radius: var(--radius-sm); background: linear-gradient(135deg, #fdf0e5, #fff8f2); border-left: 5px solid #f08a3c; }
@media (prefers-color-scheme: dark) { .stat { background: var(--accent-soft); } }
.stat span { color: var(--muted); font-weight: 600; font-size: .92rem; }
.stat strong { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 14px; }
.tools .sample { margin: 0; }
.tool-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); box-shadow: none; padding: 6px 14px; font-size: .86rem; font-weight: 600; }
button.ghost:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hover); }
.results.busy { opacity: .6; transition: opacity .15s .1s; }
input[type=month] { width: 100%; }
.live-total { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 5; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--accent-line); border-left: 5px solid #f08a3c; box-shadow: var(--shadow-lift); color: var(--text); text-decoration: none; font-weight: 600; }
.live-total[hidden] { display: none; }
.live-total span { color: var(--muted); font-size: .9rem; }
.live-total strong { font-family: var(--font-display); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.sample { color: var(--muted); font-size: .88rem; margin-top: 0; display: inline-block; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 999px; padding: 3px 12px; }
.errors { background: var(--error-bg); color: var(--error); border-radius: var(--radius-sm); padding: 12px 14px; }
.errors ul { margin: 6px 0 0; padding-left: 20px; }
table.report { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-variant-numeric: tabular-nums; }
table.report caption { text-align: left; font-weight: 700; padding-bottom: 8px; font-family: var(--font-display); font-size: 1.02rem; }
table.report th, table.report td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: right; }
table.report th[scope=row], table.report td:first-child { text-align: left; }
table.report thead th { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
table.report th[scope=row] { font-weight: 400; }
table.report tbody tr:hover { background: var(--surface-2); }
table.report tr.em th, table.report tr.em td { font-weight: 700; background: var(--accent-soft); border-bottom-color: transparent; }
table.report tr.em td { color: var(--accent); }
@media (prefers-color-scheme: dark) { table.report tr.em td { color: var(--text); } }
.results { overflow-x: auto; }
.chart { margin: 0 0 22px; }
.chart figcaption { font-weight: 700; margin-bottom: 8px; font-family: var(--font-display); }
.chart canvas { width: 100%; max-height: 320px; }
.note { color: var(--muted); font-size: .9rem; border-left: 3px solid var(--accent-line); padding-left: 12px; }
details.schedule { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); }
details.schedule > summary { cursor: pointer; font-weight: 700; }
details.schedule table { margin-top: 10px; font-size: .88rem; }
details.monthly > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.related { margin-top: 36px; }
.related h2 { font-size: 1.2rem; margin: 0 0 12px; }

/* Footer */
.site-footer { background: #2b2d30; color: #c9c7c2; font-size: .9rem; padding: 40px 0 26px; margin-top: 20px; }
.site-footer a { color: #f6f4f0; text-decoration: none; }
.site-footer a:hover { color: #f4a668; text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid h3 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; font-family: var(--font); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 0 0 7px; }
.foot-brand img { height: 40px; width: auto; background: #fff; border-radius: 8px; padding: 6px 10px; }
.foot-brand p { margin: 12px 0 0; max-width: 34ch; }
.foot-legal { border-top: 1px solid #404247; margin-top: 30px; padding-top: 16px; display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; font-size: .82rem; color: #9e9c97; }
.foot-legal p { margin: 0; }

/* Shared bits */
textarea { width: 100%; font: .85rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; resize: vertical; }
.contact-form textarea { font: inherit; }
input[type=color] { padding: 2px; width: 56px; height: 40px; }
.prose { max-width: 760px; }
.prose h2 { font-size: 1.3rem; margin: 30px 0 8px; }
.prose h3 { font-size: 1.08rem; margin: 22px 0 6px; }
div.prose.legacy { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 30px; box-shadow: var(--shadow); }
@media (max-width: 600px) { div.prose.legacy { padding: 18px; } }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; font-size: .85rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.endpoint { font-weight: 700; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form { position: static; max-width: 560px; }
.contact-form .input-row input, .contact-form .input-row select { flex: 1; width: 100%; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; margin-top: 14px; }
@media (max-width: 860px) { .article-layout { grid-template-columns: 1fr; } }
.legacy { overflow-wrap: anywhere; }
.legacy img { max-width: 100%; height: auto; }
.legacy table { border-collapse: collapse; width: 100%; }
.legacy td:empty { display: none; }
.legacy td, .legacy th { vertical-align: top; }
.legacy h1 { margin-top: 0; }
article.legacy { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; min-width: 0; box-shadow: var(--shadow); }
@media (max-width: 600px) { article.legacy { padding: 18px; } }
aside.side > * { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 14px; box-shadow: var(--shadow); }
aside.side h2, aside.side h4, .loc-list h2 { font-size: 1.05rem; margin: 0 0 10px; font-family: var(--font-display); }
aside.side ul { margin: 0; padding-left: 18px; }
aside.side ul.side-calcs, aside.side .side-calcs ul { list-style: none; padding: 0; }
aside.side .side-calcs li, aside.side ul.side-calcs li { border-top: 1px solid var(--border); }
aside.side .side-calcs li:first-child, aside.side ul.side-calcs li:first-child { border-top: 0; }
aside.side .side-calcs a { display: block; padding: 7px 0; text-decoration: none; font-weight: 500; }
aside.side .side-calcs a:hover { text-decoration: underline; }
.loc-list { margin: 22px 0 0; }
.loc-list ul { list-style: none; padding: 0; margin: 0; columns: 3 160px; column-gap: 18px; }
aside .loc-list ul { columns: 2 120px; }
.loc-list li { margin: 0 0 5px; break-inside: avoid; }
.loc-list a { text-decoration: none; }
.loc-list a:hover { text-decoration: underline; }
.rates table.report { margin-bottom: 8px; }
.rates .chg.up { color: var(--error); }
.rates .chg.down { color: var(--good); }
.spark { margin: 0 0 6px; }
.spark svg { width: 100%; height: auto; }
.spark polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark .s1 { stroke: var(--series-1); } .spark .s2 { stroke: var(--series-2); }
.spark figcaption { font-size: .8rem; color: var(--muted); }
.spark .k1 { color: var(--series-1); font-weight: 700; } .spark .k2 { color: var(--series-2); font-weight: 700; }
.share { font-size: .9rem; color: var(--muted); }
.share a { margin-left: 8px; }
.rates td { white-space: nowrap; }
.rates table.report th, .rates table.report td { padding: 6px 5px; }
aside.side > *:empty { display: none; }

/* Printing a calculation: the inputs and results only, on white, with the yearly schedule. */
@media print {
    :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #444; --border: #bbb; --accent-soft: #f3f3f3; color-scheme: light; }
    body { background: #fff; font-size: 11pt; }
    .site-header nav, .site-footer, .related, .live-total, .crumbs, .actions, .tool-buttons, .sample, .field > small, .field .input-row + small { display: none !important; }
    .site-header { border-bottom: 1px solid #999; }
    main.wrap { padding: 12px 0 0; max-width: none; }
    .calc-layout { display: block; margin-top: 10px; }
    .calc-form, .results { box-shadow: none; border: 0; padding: 0; position: static; overflow: visible; }
    .calc-form { border-top: 0; columns: 2; column-gap: 28px; margin-bottom: 14px; }
    .calc-form fieldset { break-inside: avoid; border-top: 0; padding-top: 0; margin-bottom: 6px; }
    .field { margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; break-inside: avoid; }
    .field > label { margin: 0; flex: 0 0 48%; font-weight: 600; }
    input, select { border: 0; padding: 0; background: none; appearance: none; -webkit-appearance: none; }
    .affix .prefix { position: static; transform: none; color: inherit; font-size: inherit; }
    .affix.has-prefix input { padding-left: 0; }
    input::placeholder { color: transparent; }
    .affix .suffix { display: none; }
    .stat, .headline { background: #f3f3f3 !important; }
    .chart { break-inside: avoid; }
    .chart canvas { max-width: 100%; }
    details.schedule { border: 0; padding: 0; background: none; }
    details.schedule > summary { list-style: none; font-family: var(--font-display); }
    details.monthly:not([open]) { display: none; }
    table.report { page-break-inside: auto; }
    table.report tr { break-inside: avoid; }
    table.report thead { display: table-header-group; }
    a { color: inherit; text-decoration: none; }
}
