/* Free tools: Money Plan and the single-purpose calculators share these styles */
.mp-line.mpv-debt { stroke: #2a78d6; }
.mp-line.mpv-giving { stroke: #eb6834; }
.mp-line.mpv-bills { stroke: #9aa5b1; }
.mp-line.mpv-education { stroke: #6250d6; }
.mpv-bad { --c: #b3261e; }
.mp-panel-solo { border-top: 1px solid var(--line); border-radius: var(--radius); }
.tool-results-h { margin: 28px 0 12px; font-size: 1.5rem; }
.tool-results .mp-summary { margin-bottom: 14px; }
.tool-results > .mp-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-top: 14px; }
.mp-radio-group { display: grid; gap: 6px; align-content: start; }
.mp-radio-group .mp-radio-sm { display: flex; gap: 8px; align-items: center; }
.mp-radio-group input[type=radio] { width: 18px; height: 18px; padding: 0; margin: 0; flex: 0 0 auto; accent-color: var(--navy); }
.mp-tips { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.tool-about { margin-top: 40px; }
.tool-about h2 { font-size: 1.4rem; }
.tool-about h3 { font-size: 1.1rem; margin-top: 22px; }
.mp-page { padding-bottom: 48px; }
.mp-head .lead { max-width: 760px; }
.mp-private { display: inline-flex; gap: 8px; align-items: center; background: var(--gold-soft); color: var(--navy); border-radius: 999px; padding: 6px 14px; font-size: .92rem; font-weight: 600; margin: 4px 0 0; }
.mp-app { margin-top: 8px; }
.mp-hidden, .mp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* toolbar + buttons */
.mp-toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mp-toolbar-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-status { font-size: .88rem; color: var(--muted); }
.mp-btn { font: 600 .95rem/1 var(--sans); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; }
.mp-btn:hover { border-color: var(--gold); }
.mp-btn-primary { background: var(--gold); border-color: var(--gold); }
.mp-btn-primary:hover { background: var(--gold-light); }
.mp-btn-quiet { background: transparent; }
.mp-link { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; margin-top: 10px; }
.mp-add { background: none; border: 1px dashed var(--slate); color: var(--navy); border-radius: 10px; padding: 9px 14px; font: 600 .95rem var(--sans); cursor: pointer; margin-top: 10px; }
.mp-add:hover { border-color: var(--gold); background: var(--gold-soft); }
.mp-remove { background: none; border: 0; color: #9a3a2c; font: 600 .85rem var(--sans); cursor: pointer; text-decoration: underline; padding: 4px; margin-left: auto; }
.mp-icon { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; }
.mp-icon:disabled { opacity: .35; cursor: default; }
.mp-btn:focus-visible, .mp-add:focus-visible, .mp-icon:focus-visible, .mp-tab:focus-visible, .mp-chip:focus-visible, .mp-remove:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* summary strip */
.mp-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.mp-stat { background: var(--navy); color: #fff; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.mp-stat-v { font: 700 1.3rem/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.mp-stat-k { font-size: .82rem; opacity: .8; }
.mp-stat.mp-good { color: #fff; }
.mp-stat.mp-good .mp-stat-v { color: var(--gold-light); }
.mp-next-month { margin-top: 6px; }
.mp-stat.mp-bad { background: #8a2b1f; }

/* tabs */
/* tabs scroll sideways on small screens only; the underline is drawn inside each tab so nothing overflows vertically */
.mp-tabs { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; box-shadow: inset 0 -2px 0 var(--line); margin-bottom: 0; scrollbar-width: none; }
.mp-tabs::-webkit-scrollbar { display: none; }
.mp-tab { flex: 0 0 auto; display: inline-flex; gap: 8px; align-items: center; background: none; border: 0; padding: 12px 12px 14px; font: 600 .98rem var(--sans); color: var(--muted); cursor: pointer; }
.mp-tab[aria-current] { color: var(--navy); box-shadow: inset 0 -3px 0 var(--gold); }
.mp-tab-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--tint); font-size: .8rem; color: var(--navy); }
.mp-tab[aria-current] .mp-tab-n { background: var(--gold); }
.mp-tab-plan { color: var(--navy); }

/* panels + sections */
.mp-panel { background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 8px 22px 22px; box-shadow: var(--shadow); }
.mp-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.mp-section:last-of-type { border-bottom: 0; }
.mp-section h2 { font-size: 1.3rem; margin: 0 0 6px; }
.mp-section h3 { font-size: 1.05rem; margin: 18px 0 8px; }
.mp-intro { color: var(--muted); margin: 0 0 14px; max-width: 760px; }
.mp-hint { display: block; color: var(--muted); font-size: .84rem; font-weight: 400; line-height: 1.4; }
.mp-muted { color: var(--muted); font-size: .9rem; }
.mp-empty { color: var(--muted); font-style: italic; }
.mp-next { display: flex; justify-content: flex-end; padding-top: 14px; }

/* fields */
.mp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; align-items: start; }
.mp-wide { grid-column: 1 / -1; }
.mp-field { display: grid; gap: 5px; }
.mp-label { font-weight: 600; font-size: .93rem; color: var(--navy); }
.mp-field input, .mp-field select { font: 400 1rem/1.4 var(--sans); padding: 9px 11px; border: 1px solid #cfc9bb; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; box-sizing: border-box; min-width: 0; }
.mp-field input:focus, .mp-field select:focus, .mp-prio-w input:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--gold); }
.mp-affix { display: flex; align-items: stretch; }
.mp-affix > span { display: grid; place-items: center; padding: 0 10px; background: var(--tint); border: 1px solid #cfc9bb; color: var(--muted); font-weight: 600; }
.mp-affix-pre > span { border-right: 0; border-radius: 8px 0 0 8px; }
.mp-affix-pre input { border-radius: 0 8px 8px 0 !important; }
.mp-affix-post > span { border-left: 0; border-radius: 0 8px 8px 0; }
.mp-affix-post input { border-radius: 8px 0 0 8px !important; }
.mp-check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; margin: 10px 0 2px; cursor: pointer; }
.mp-check input { width: 18px; height: 18px; margin-top: 3px; flex: 0 0 auto; accent-color: var(--navy); }

/* lists */
.mp-rows { display: grid; gap: 8px; }
.mp-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; align-items: end; }
.mp-cards { display: grid; gap: 14px; }
.mp-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fffefb; }
.mp-card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.mp-tag { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--tint); color: var(--muted); }
.mp-tag-on { background: var(--navy); color: #fff; }
.mp-balances { display: grid; gap: 10px; margin-top: 12px; }
.mp-balance { border-left: 3px solid var(--gold-soft); padding: 6px 0 6px 14px; }
.mp-balance-head { display: flex; gap: 10px; align-items: end; margin-bottom: 8px; }
.mp-balance-head .mp-field { flex: 1; }
.mp-promo { background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.mp-chip { border: 1px solid var(--line); background: var(--tint); color: var(--navy); border-radius: 999px; padding: 7px 12px; font: 600 .88rem var(--sans); cursor: pointer; }
.mp-chip:hover { border-color: var(--gold); background: var(--gold-soft); }
.mp-chips .mp-add { margin-top: 0; }

/* choices */
.mp-radios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mp-radio { display: flex; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: #fff; }
.mp-radio.is-on { border-color: var(--gold); background: var(--gold-soft); }
.mp-radio input { accent-color: var(--navy); margin-top: 4px; }
.mp-radio span { display: grid; gap: 2px; }
.mp-radio small { color: var(--muted); font-size: .85rem; line-height: 1.35; }
.mp-radios-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; align-items: center; }
.mp-radio-sm { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.mp-radio-sm input { accent-color: var(--navy); }

/* priorities */
.mp-prios { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mp-prio { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.mp-prio-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; }
.mp-prio-label { font-weight: 600; }
.mp-prio-w { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.mp-prio-w input { width: 56px; text-align: right; font: 600 1rem var(--sans); padding: 6px 8px; border: 1px solid #cfc9bb; border-radius: 8px; }
.mp-prio-btns { display: inline-flex; gap: 4px; }
.mp-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }

/* results */
.mp-warnings { display: grid; gap: 8px; margin: 14px 0 4px; }
.mp-warn { margin: 0; padding: 10px 14px; border-radius: 10px; border-left: 4px solid var(--gold); background: var(--gold-soft); font-size: .95rem; }
.mp-warn-danger { border-left-color: #b3261e; background: #fbe9e6; }
.mp-table { width: 100%; max-width: 520px; border-collapse: collapse; }
.mp-table td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.mp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-total td { font-weight: 700; border-bottom: 0; font-size: 1.1rem; }
.mp-allocs { display: grid; gap: 8px; }
.mp-alloc { border: 1px solid var(--line); border-left: 5px solid var(--slate); border-radius: 10px; padding: 10px 14px; background: #fff; }
.mp-alloc p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.mp-alloc-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.mp-alloc-top .mp-num { margin-left: auto; font-weight: 700; font-size: 1.1rem; }
.mp-pill { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mp-b-debt { border-left-color: var(--navy); }
.mp-b-emergency { border-left-color: var(--gold); }
.mp-b-retirement { border-left-color: #3f7d6b; }
.mp-b-education { border-left-color: #7a5aa6; }
.mp-b-goals { border-left-color: #b5546a; }
.mp-b-giving { border-left-color: #c47a2c; }
.mp-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.mp-timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 0 8px 14px; border-left: 3px solid var(--line); position: relative; }
.mp-timeline li::before { content: ''; position: absolute; left: -7px; top: 14px; width: 11px; height: 11px; border-radius: 50%; background: var(--slate); }
.mp-timeline .mp-m-debtfree::before, .mp-timeline .mp-m-alldebt::before { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.mp-timeline .mp-m-debtfree span:last-child, .mp-timeline .mp-m-alldebt span:last-child { font-weight: 700; }
.mp-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-chart { width: 100%; height: auto; display: block; }
.mp-grid-line { stroke: var(--line); stroke-width: 1; }
.mp-axis { fill: var(--muted); font: 12px var(--sans); }
.mp-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.mp-line-all { stroke: var(--slate); stroke-dasharray: 5 5; }
.mp-line-scope { stroke: #2a78d6; stroke-width: 3; }
.mp-line-save { stroke: var(--gold); stroke-width: 3; }
.mp-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; color: var(--muted); margin-top: 6px; }
.mp-legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 6px; }
.mp-legend i.mp-line-all { border-top: 3px dashed var(--slate); }
.mp-legend i.mp-line-scope { border-color: #2a78d6; }
.mp-legend i.mp-line-save { border-color: var(--gold); }
.mp-compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mp-compare > div { background: var(--tint); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.mp-compare .mp-stat-k { opacity: 1; color: var(--muted); }
.mp-good { color: #2f6b4f; }
.mp-good-note { background: #e7f3ec; border-radius: 10px; padding: 10px 14px; margin: 12px 0 0; }
.mp-options { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mp-options li { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.mp-options span { color: var(--muted); }
.mp-windfall-in { max-width: 280px; }
.mp-disclaimer { font-size: .85rem; color: var(--muted); margin: 18px 0 0; }
.mp-print-head { display: none; }

/* ---------- visuals ---------- */
/* bucket colors, fixed order validated for color-blind separation: debt, emergency, retirement, education, goals, giving */
.mpv-debt { --c: #2a78d6; }
.mpv-emergency { --c: #eda100; }
.mpv-retirement { --c: #1baf7a; }
.mpv-education { --c: #6250d6; }
.mpv-goals { --c: #c2307a; }
.mpv-giving { --c: #eb6834; }
.mpv-free { --c: #b9c2cc; }
.mpv-bills { --c: #9aa5b1; }
.mpv-left { --c: #1B2A41; }
.mpv-sched { --c: #b9c2cc; }
.mp-glance { margin-top: 18px; }
.mp-glance[hidden] { display: none; }
.mp-glance-h { font-size: 1.1rem; margin: 0 0 10px; }
.mpv-grid { display: grid; gap: 14px; }
.mpv-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.mpv-card { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.mpv-card figcaption { display: grid; gap: 2px; margin-bottom: 12px; }
.mpv-card figcaption strong { font-size: 1.02rem; color: var(--navy); }
.mpv-card figcaption span { font-size: .88rem; color: var(--muted); }
.mpv-stack { display: flex; gap: 2px; height: 22px; border-radius: 4px; overflow: hidden; background: #fff; }
.mpv-seg { background: var(--c); min-width: 3px; flex-basis: 0; }
.mpv-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: .92rem; }
.mpv-legend li { display: grid; grid-template-columns: 14px 1fr auto 44px; gap: 8px; align-items: center; }
.mpv-legend-inline { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.mpv-legend-inline li { display: inline-flex; gap: 6px; color: var(--muted); }
.mpv-sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); display: inline-block; }
.mpv-sw-promo { width: 10px; height: 10px; background: var(--ink); transform: rotate(45deg); display: inline-block; margin: 0 2px; }
.mpv-v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.mpv-p { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.mpv-rows { display: grid; gap: 12px; }
.mpv-trow { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 12px; align-items: center; }
.mpv-tlabel { display: grid; line-height: 1.25; }
.mpv-tlabel span { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mpv-track { position: relative; height: 14px; background: var(--tint); border-radius: 4px; }
.mpv-tbar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); border-radius: 0 4px 4px 0; }
.mpv-tbar.mpv-open { border-radius: 0; background: repeating-linear-gradient(135deg, var(--c) 0 6px, #d5dbe1 6px 9px); }
.mpv-promo { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--ink); transform: rotate(45deg); box-shadow: 0 0 0 2px #fff; }
.mpv-axis { position: relative; height: 18px; margin: 6px 0 4px calc(min(34%, 100%) + 12px); font-size: .78rem; color: var(--muted); }
.mpv-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.mpv-axis span:first-child { transform: none; }
.mpv-prow { display: grid; gap: 4px; }
.mpv-ptop { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; font-size: .95rem; }
.mpv-ptrack { height: 12px; border-radius: 4px; background: var(--tint); overflow: hidden; }
.mpv-ptrack-plain { background: transparent; }
.mpv-fill { display: block; height: 100%; background: var(--c); border-radius: 0 4px 4px 0; }
.mpv-pnote { font-size: .85rem; color: var(--muted); }
.mpv-flag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; background: #fbe9e6; color: #8a2b1f; }
.mpv-flag-ok { background: #e7f3ec; color: #2f6b4f; }
@media (max-width: 560px) {
  .mpv-trow { grid-template-columns: 1fr; gap: 4px; }
  .mpv-axis { margin-left: 0; }
}
@media print { .mpv-card { break-inside: avoid; } .mpv-seg, .mpv-fill, .mpv-tbar, .mpv-sw { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }

/* password dialog */
.mp-dialog { border: 0; border-radius: 14px; padding: 22px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.mp-dialog::backdrop { background: rgba(27, 42, 65, .5); }
.mp-dialog h2 { font-size: 1.2rem; margin: 0 0 8px; }
.mp-dialog p { color: var(--muted); font-size: .95rem; }
.mp-dialog-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .mp-summary { grid-template-columns: 1fr 1fr; }
  .mp-radios { grid-template-columns: 1fr; }
  .mp-compare { grid-template-columns: 1fr; }
  .mp-panel { padding: 4px 14px 16px; }
  .mp-row { grid-template-columns: 1fr 1fr; }
  .mp-row .mp-remove { grid-column: 1 / -1; justify-self: end; }
  .mp-prio { grid-template-columns: 30px 1fr; }
  .mp-prio-w, .mp-prio-btns { grid-column: 2; }
  .mp-timeline li { grid-template-columns: 1fr; gap: 0; }
}

@media print {
  .site-header, .site-footer, .mp-head, .mp-toolbar, .mp-tabs, .mp-next, .skip { display: none !important; }
  .mp-panel { border: 0; box-shadow: none; padding: 0; }
  .mp-print-head { display: block; }
  .mp-summary { grid-template-columns: repeat(4, 1fr); }
  .mp-stat { background: #fff !important; color: var(--navy) !important; border: 1px solid #999; }
  .mp-alloc, .mp-timeline li, .mp-section { break-inside: avoid; }
  body { background: #fff; }
}
