/* Neatly Planned Tools: sage + blush, with one brighter coral accent. */
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/lato-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/lato-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --sage-dark: #56664F;
  --sage: #8FA382;
  --sage-light: #DCE4D3;
  --sage-xlight: #EEF2EA;
  --blush: #D79A8C;
  --blush-mid: #E3BDB4;
  --blush-light: #F6E8E3;
  --pop: #EE8B78;          /* the brighter accent */
  --pop-soft: #FCE3DC;
  --cream: #FBF8F2;
  --white: #FFFFFF;
  --text: #3F3F3F;
  --ink: #2B2B2B;
  --muted: #646464;        /* hints: 5.5:1 on cream */
  --line: #E4DDD2;
  --warn-bg: #F6D5CF; --warn: #8E2F25;
  --good-bg: #E2EBDA; --good: #3F5932;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(86, 102, 79, .10);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6;
  color: var(--text); background: var(--cream);
  background-image:
    radial-gradient(520px 320px at 105% -5%, rgba(238,139,120,.16), transparent 70%),
    radial-gradient(480px 300px at -10% 20%, rgba(220,228,211,.7), transparent 70%);
  background-repeat: no-repeat;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sage-dark); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--pop); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; top: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2rem, 980px); margin-inline: auto; }

/* Header */
.site-header { padding: .9rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--sage-dark); }
.brand img { width: 44px; height: 44px; }
.brand span { white-space: nowrap; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.1; }
.brand small { display: block; font-family: var(--sans); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-dark); font-weight: 700; opacity: .85; }
.nav { display: flex; gap: .4rem; align-items: center; }
.nav a { white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
@media (max-width: 420px) { .nav a[aria-current], .nav a.home-link { display: none; } .brand span { font-size: 1.15rem; } }
.nav a { text-decoration: none; font-weight: 700; font-size: .95rem; padding: .45rem .8rem; border-radius: 999px; }
.nav a:hover { background: var(--sage-xlight); }
.nav .shop { background: var(--sage-dark); color: var(--white); }
.nav .shop:hover { background: #46553f; color: var(--white); }

/* Hero */
.hero { padding: 1.4rem 0 .6rem; }
.eyebrow { display: inline-block; background: var(--pop-soft); color: var(--ink); font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; padding: .3rem .75rem; border-radius: 999px; }
h1, h2, h3 { font-family: var(--serif); color: var(--sage-dark); line-height: 1.2; margin: .6rem 0 .5rem; }
h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 700; }
h1 .pop { background: linear-gradient(transparent 62%, rgba(238,139,120,.45) 62%); padding: 0 .1em; }
h2 { font-size: clamp(1.4rem, 4vw, 1.8rem); }
h3 { font-size: 1.2rem; }
.lead { font-size: 1.15rem; max-width: 60ch; margin: 0 0 1rem; }

/* Cards & layout */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.calc { display: grid; gap: 1.25rem; margin: 1rem 0 1.5rem; }
@media (min-width: 860px) { .calc { grid-template-columns: 1.05fr 1fr; align-items: start; } .calc .results { position: sticky; top: 1rem; } }
.card h2 { margin-top: 0; font-size: 1.35rem; }

/* Form */
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-family: var(--serif); color: var(--sage-dark); font-size: 1.1rem; font-weight: 600; margin-bottom: .4rem; padding: 0; }
.field { margin-bottom: .85rem; }
.grid2 { display: grid; gap: 0 .9rem; grid-template-columns: 1fr 1fr; }
.grid3 { display: grid; gap: 0 .9rem; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 420px) { .grid3 { grid-template-columns: 1fr 1fr; } }
label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: .25rem; color: var(--ink); }
.hint { display: block; font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.input { position: relative; }
.input .pre, .input .post { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.input .pre { left: .8rem; } .input .post { right: .8rem; }
input[type="text"], input[type="number"], input[type="date"], input[type="month"], input[inputmode], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--blush-light);
  border: 1px solid transparent; border-bottom: 2px solid var(--blush-mid); border-radius: 10px;
  padding: .6rem .8rem; min-height: 46px; transition: border-color .15s, background .15s;
}
.input.has-pre input { padding-left: 1.7rem; }
.input.has-post input { padding-right: 2rem; }
input:hover, select:hover { border-bottom-color: var(--blush); }
input:focus, select:focus { background: var(--white); border-color: var(--pop); outline: none; box-shadow: 0 0 0 3px rgba(238,139,120,.3); }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.choice { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; background: var(--sage-xlight); border: 2px solid transparent; padding: .5rem .85rem; border-radius: 999px; cursor: pointer; margin: 0; min-height: 44px; }
.choice input { accent-color: var(--sage-dark); width: 1.1rem; height: 1.1rem; margin: 0; }
.choice label:has(input:checked) { border-color: var(--sage-dark); background: var(--white); }
.choice label:has(input:focus-visible) { outline: 3px solid var(--pop); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 700; border-radius: 999px; padding: .6rem 1.1rem; min-height: 44px; cursor: pointer; text-decoration: none; border: 2px solid var(--sage-dark); background: var(--white); color: var(--sage-dark); }
.btn:hover { background: var(--sage-xlight); color: var(--sage-dark); }
.btn-pop { background: var(--pop); border-color: var(--pop); color: var(--ink); box-shadow: 0 4px 14px rgba(238,139,120,.35); }
.btn-pop:hover { background: #F29F8E; border-color: #F29F8E; color: var(--ink); }
.btn-small { padding: .35rem .85rem; min-height: 44px; font-size: .9rem; }
.btn-ghost { border-color: var(--line); color: var(--muted); }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* Debt rows */
.debt-row { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .8rem .2rem; margin-bottom: .7rem; background: var(--cream); }
.debt-row .row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.debt-row .row-head strong { color: var(--sage-dark); font-family: var(--serif); }
.remove { background: none; border: 0; color: var(--warn); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; padding: .4rem .6rem; min-height: 44px; border-radius: 8px; }
.remove:hover { background: var(--warn-bg); }

/* Results */
.results { background: var(--white); }
.big { font-family: var(--serif); font-size: clamp(2rem, 7vw, 2.6rem); font-weight: 700; color: var(--sage-dark); line-height: 1.1; }
.big-label { font-weight: 700; color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1rem 0; }
.stat { background: var(--sage-xlight); border-radius: 12px; padding: .75rem .85rem; }
.stat .v { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--sage-dark); display: block; line-height: 1.2; }
.stat .k { font-size: .85rem; color: var(--muted); font-weight: 700; }
.stat.pop { background: var(--pop-soft); }
.headline-box { background: linear-gradient(135deg, var(--sage-xlight), var(--blush-light)); border-radius: 14px; padding: 1rem 1.1rem; }
.compare { display: grid; gap: .7rem; grid-template-columns: 1fr 1fr; margin: .9rem 0; }
@media (max-width: 400px) { .compare { grid-template-columns: 1fr; } }
.method { border: 2px solid var(--line); border-radius: 14px; padding: .8rem; position: relative; }
.method.best { border-color: var(--pop); background: #FFFBF9; }
.method h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.method dl { margin: 0; display: grid; gap: .35rem; }
.method dt { font-size: .82rem; color: var(--muted); font-weight: 700; }
.method dd { margin: 0 0 .2rem; font-weight: 700; color: var(--ink); }
.badge { display: inline-block; background: var(--pop); color: var(--ink); font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; letter-spacing: .03em; }
.note { border-radius: 12px; padding: .75rem .9rem; margin: .7rem 0; font-size: .97rem; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.good { background: var(--good-bg); color: var(--good); }
.note.info { background: var(--sage-xlight); color: var(--ink); }
.note p { margin: 0; } .note p + p { margin-top: .35rem; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th, .tbl td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; color: var(--sage-dark); }
.tbl input { min-height: 40px; padding: .4rem .5rem; text-align: right; }
.pct-input { width: 5.2rem; }
.bars { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .45rem; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: .15rem .6rem; font-size: .93rem; }
.bars .bar { grid-column: 1 / -1; height: 9px; border-radius: 999px; background: var(--sage-xlight); overflow: hidden; }
.bars .bar span { display: block; height: 100%; border-radius: 999px; background: var(--sage); }
.bars li:first-child .bar span { background: var(--pop); }
.progress { height: 14px; background: var(--sage-xlight); border-radius: 999px; overflow: hidden; margin: .4rem 0 .2rem; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--pop)); border-radius: 999px; }
ol.order { margin: .4rem 0 0; padding-left: 1.3rem; }
ol.order li { margin-bottom: .2rem; }

/* CTA card */
.cta { display: grid; gap: 1rem; align-items: center; background: linear-gradient(135deg, var(--white) 0%, var(--blush-light) 100%); border: 2px solid var(--pop); border-radius: 20px; padding: 1.25rem; margin: 1.5rem 0; box-shadow: var(--shadow); }
@media (min-width: 640px) { .cta { grid-template-columns: 84px 1fr auto; } }
.cta img { width: 84px; height: 84px; }
.cta h2 { margin: 0 0 .2rem; font-size: 1.35rem; }
.cta p { margin: 0; }
.cta .btn-pop { white-space: nowrap; }
.cta .more { display: block; margin-top: .4rem; font-size: .95rem; }

/* Article */
.article { max-width: 70ch; margin: 2rem 0; }
.article h2 { margin-top: 1.6rem; }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { margin-bottom: .3rem; }
details { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: .7rem 1rem; margin-bottom: .6rem; }
summary { cursor: pointer; font-weight: 700; color: var(--sage-dark); min-height: 30px; }
details p { margin: .5rem 0 .2rem; }

/* Tool grid (home) */
.tools { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 1.2rem 0 2rem; }
.tool { display: flex; flex-direction: column; gap: .4rem; text-decoration: none; color: var(--text); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.tool:hover { transform: translateY(-2px); border-color: var(--pop); color: var(--text); }
.tool .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--blush-light); font-size: 1.5rem; }
.tool h2 { font-size: 1.25rem; margin: .2rem 0 0; }
.tool p { margin: 0; }
.tool .go { margin-top: auto; font-weight: 700; color: var(--sage-dark); }
.related { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.related a { display: inline-block; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; text-decoration: none; font-weight: 700; }
.related a:hover { border-color: var(--pop); }
.trust { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; list-style: none; padding: 0; margin: .5rem 0 0; font-weight: 700; color: var(--sage-dark); font-size: .95rem; }
.trust li::before { content: "✓ "; color: var(--pop); }

/* Footer */
.site-footer { margin-top: 2.5rem; padding: 1.8rem 0 2.2rem; background: var(--sage-dark); color: #F4F1EA; }
.site-footer a { color: #FFFFFF; }
.site-footer .wrap { display: grid; gap: .8rem; }
.site-footer p { margin: 0; font-size: .95rem; }
.site-footer .disclaimer { font-size: .88rem; opacity: .95; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.headline-box p { margin: .3rem 0 0; }
/* Keep side-by-side inputs aligned on phones when one label wraps */
@media (max-width: 520px) { .grid2 > .field > label, .grid3 > .field > label { min-height: 2.7em; display: flex; align-items: flex-end; } }
/* Christmas: compact people list */
.people-head, .person-row { display: grid; grid-template-columns: 1fr 8.5rem 44px; gap: .5rem; align-items: center; }
.people-head { font-weight: 700; font-size: .9rem; margin-bottom: .35rem; color: var(--ink); }
.person-row { margin-bottom: .5rem; }
.person-row .remove { justify-self: center; padding: 0; width: 44px; }
@media (max-width: 420px) { .people-head, .person-row { grid-template-columns: 1fr 7rem 40px; gap: .4rem; } .person-row .remove { width: 40px; } }
/* Seasonal home card */
.tool { position: relative; }
.tool-season { border: 2px solid var(--pop); background: linear-gradient(160deg, var(--white) 55%, var(--blush-light) 100%); }
.tool .season { position: absolute; top: 1rem; right: 1rem; background: var(--pop); color: var(--ink); font-size: .78rem; font-weight: 700; letter-spacing: .02em; padding: .25rem .65rem; border-radius: 999px; }

/* ---- Narrow-phone fixes (Galaxy Z Fold cover screen, iPhone SE: 320–420px) ---- */
.tbl td.num { white-space: nowrap; }
.tbl tbody th { text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); font-weight: 600; }
/* Share inputs: always wide enough for "100" or "12.5" plus the % sign */
.tbl .pct-input { width: calc(4.6ch + 2.4rem); min-width: calc(4.6ch + 2.4rem); padding-left: .4rem; padding-right: 1.5rem; }
.tbl .input.has-post .post { right: .55rem; }
@media (max-width: 420px) {
  .wrap { width: min(100% - 1.5rem, 980px); }
  .card { padding: 1rem .85rem; }
  .tbl th, .tbl td { padding: .45rem .25rem; }
  .tbl tbody th { font-size: .9rem; overflow-wrap: anywhere; }
  .tbl td.num { font-size: .9rem; }
  /* Christmas list: name on its own line, budget underneath */
  .people-head { display: none; }
  .person-row { grid-template-columns: 1fr 40px; grid-template-areas: "name rm" "budget rm"; gap: .35rem .4rem; padding: .5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); }
  .person-row > .input:nth-child(1) { grid-area: name; }
  .person-row > .input:nth-child(2) { grid-area: budget; }
  .person-row > .remove, .person-row > .remove-spacer { grid-area: rm; align-self: center; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
.grid2 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
@media (max-width: 420px) { .grid2, .grid3 { gap: 0 .6rem; } .grid2.stack-narrow { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .debt-row { padding: .65rem .6rem .1rem; } }
@media (max-width: 340px) { .debt-row .grid3 { grid-template-columns: 1fr; } }
/* "Other free calculators" cross-links */
.related-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .6rem; }
.related-cards a { display: grid; gap: .2rem; height: 100%; border-radius: 14px; padding: .7rem .9rem; }
.related-cards .rel-desc { font-weight: 400; color: var(--muted); font-size: .92rem; }
.article .split-table { margin: .6rem 0 1rem; }

/* ---- Keep your numbers: one quiet status line + a small "Save or print" menu ---- */
.keep { position: relative; }
.keep-caret { font-size: .8em; transition: transform .15s; }
.keep-toggle[aria-expanded="true"] .keep-caret { transform: rotate(180deg); }
.keep-menu { position: absolute; z-index: 5; top: calc(100% + .35rem); left: 0; min-width: 13.5rem; max-width: calc(100vw - 2rem); display: grid; padding: .35rem; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(86, 102, 79, .18); }
.keep-menu[hidden] { display: none; }
.keep-menu button { display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; min-height: 44px; padding: .4rem .7rem; border: 0; border-radius: 8px; background: none; font: inherit; font-size: .92rem; font-weight: 700; color: var(--sage-dark); text-align: left; cursor: pointer; white-space: nowrap; }
.keep-menu button:hover, .keep-menu button:focus-visible { background: var(--sage-xlight); }
.keep-sub { font-weight: 400; font-size: .8rem; color: var(--muted); }
.keep-status { margin: .45rem 0 0; font-size: .82rem; color: var(--muted); transition: color .3s; }
.keep-status.is-flash { color: var(--good); }
.keep-status.is-off { color: var(--warn); }
.keep-msg { margin: .4rem 0 0; font-size: .85rem; overflow-wrap: anywhere; }
.keep-msg:empty { display: none; }
.keep-msg.good { color: var(--good); }
.keep-msg.warn { color: var(--warn); }
.keep-msg a { font-weight: 700; color: inherit; }
.print-only { display: none; }

@media print {
  @page { margin: 12mm 12mm 14mm; }
  html, body { background: #fff !important; background-image: none !important; font-size: 10.5pt; line-height: 1.4; color: #222; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none !important; }
  .wrap { width: auto; margin: 0; }
  .skip, .site-header .nav, .hero .eyebrow, .hero .lead, #calc-form, .keep, .keep-status, .keep-msg, .cta, .article, .more-tools, .site-footer, .form-actions, button, .sr-only { display: none !important; }
  .print-only { display: block !important; }
  .site-header { padding: 0 0 .3rem; border-bottom: 2px solid var(--sage); }
  .brand img { width: 34px; height: 34px; }
  .hero { padding: .4rem 0 0; }
  h1 { font-size: 18pt; margin: .2rem 0 .5rem; }
  h1 .pop { background: none; padding: 0; }
  .calc { display: block; margin: 0; }
  .calc .results { position: static; }
  .card { border: 1px solid #ccc; border-radius: 10px; padding: .7rem .9rem; margin: 0 0 .7rem; }
  .card h2 { font-size: 13pt; margin: 0 0 .4rem; }
  h3 { font-size: 11pt; margin: .6rem 0 .3rem; }
  .print-list { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .1rem 1.2rem; }
  .print-list > div { display: flex; justify-content: space-between; gap: .6rem; border-bottom: 1px dotted #ccc; padding: .12rem 0; break-inside: avoid; }
  .print-list dt { font-weight: 400; color: #555; }
  .print-list dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
  .print-sec { break-inside: avoid; }
  .print-sec h3 { margin-top: .4rem; }
  .big { font-size: 20pt; }
  .headline-box { padding: .55rem .8rem; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .5rem 0; }
  .stat { padding: .4rem .55rem; }
  .stat .v { font-size: 12pt; }
  .stat .k { font-size: 8.5pt; }
  .note { padding: .4rem .65rem; margin: .4rem 0; font-size: 9.5pt; }
  .stat, .method, .note, .headline-box, .bars li, .compare { break-inside: avoid; }
  .bars { gap: .25rem; }
  .bars li { font-size: 9.5pt; }
  .print-foot { margin: .8rem 0 0; padding-top: .4rem; border-top: 1px solid #ccc; font-size: 9pt; color: #555; text-align: center; }
  a { color: inherit; text-decoration: none; }
}
