/* home-costs.html — page-only composition. Shared: tool layout, estimate panel, fields, table (../system.css).
   Chart series (validated for CVD on the dark panel): home #36A88B, other spending #A87424, savings #5B8FD6. */

.page-hero-media img { object-position: 56% 40%; }

/* ---------- budget form ---------- */
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.budget-layout .field > span:first-child { min-height: 2.6em; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 8px; }
.affix.has-pre.has-post .input { padding-right: 52px; }
.budget-foot { flex-wrap: wrap; align-items: center; gap: 12px; }
.budget-foot .fine { flex: 1 1 260px; margin-right: auto; font-size: var(--t-micro); color: var(--brass-deep); }
.budget-foot .btn:first-of-type { margin-left: auto; }

/* ---------- result panel ---------- */
.tool-result { top: calc(var(--nav-h) + 24px); }
.budget-result { padding-bottom: clamp(20px, 2.2vw, 28px); }
.budget-result > :not(.glow) { position: relative; }
.budget-figure { margin-top: 18px; }
.bf-label { font-size: var(--t-small); color: var(--d-muted); }
.budget-figure .estimate-figure { margin-top: 8px; }
.budget-figure .estimate-figure.is-short { color: var(--brass-hi); }
.bf-sub { margin-top: 10px; font-size: var(--t-small); color: var(--d-muted); max-width: 40ch; }
.bf-sub b { color: var(--d-text); font-weight: 500; }

/* income split: one track per scenario; segments move by transform only */
.split-fig { position: relative; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--d-line); }
.split-row + .split-row { margin-top: 16px; }
.split-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: var(--t-micro); color: var(--d-muted); }
.split-top b { font-weight: 500; color: var(--d-text); font-variant-numeric: tabular-nums; }
.split-track { position: relative; height: 18px; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, .03); }
.split-track .seg { position: absolute; inset: 0; transform-origin: 0 50%; transform: translateX(0) scaleX(0); transition: transform .7s var(--ease-out), opacity .2s; }
.seg-home { background: #36A88B; }
.seg-other { background: #A87424; }
.seg-save { background: #5B8FD6; }
.seg-left { background: rgba(238, 244, 241, .12); }
.seg-short { background: repeating-linear-gradient(135deg, rgba(226, 182, 97, .6) 0 2px, transparent 2px 6px); }
.income-mark { position: absolute; top: -3px; bottom: -3px; left: 0; width: 2px; margin-left: -1px; background: var(--d-text); border-radius: 1px; transform: translateX(0); transition: transform .7s var(--ease-out); opacity: 0; }
.has-result .income-mark { opacity: 1; }
.split-fig:hover .seg:not(:hover), .split-fig.has-active .seg:not(.is-active) { opacity: .5; }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: var(--t-micro); color: var(--d-muted); }
.split-legend span { display: inline-flex; align-items: center; gap: 7px; }
.split-legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.sw-home { background: #36A88B; } .sw-other { background: #A87424; } .sw-save { background: #5B8FD6; }
.sw-left { background: rgba(238, 244, 241, .12); box-shadow: inset 0 0 0 1px rgba(238, 244, 241, .3); }
.split-legend .lg-income::before { content: ""; width: 2px; height: 12px; background: var(--d-text); border-radius: 1px; }
.split-tip { position: absolute; z-index: 6; left: 0; top: 0; min-width: 190px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(5, 15, 12, .95); box-shadow: inset 0 0 0 1px var(--d-line-2), 0 16px 40px -12px rgba(0, 0, 0, .7); font-size: var(--t-micro); color: var(--d-text); pointer-events: none; }
.split-tip strong { display: block; font-weight: 500; margin-bottom: 4px; }
.split-tip span { display: flex; justify-content: space-between; gap: 16px; color: var(--d-muted); }
.split-tip span b { color: var(--d-text); font-weight: 500; font-variant-numeric: tabular-nums; }

/* stress slider (same controls as the payment calculator) */
.stress-control { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--d-line); }
.stress-control .field-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.stress-control label { font-size: var(--t-small); color: var(--d-text); }
.stress-control .num { width: 4.2ch; height: 100%; border: 0; background: transparent; color: #fff; font-size: 16px; font-weight: 500; text-align: right; outline: none; padding: 0; }
.stress-control .help { margin-top: 8px; font-size: var(--t-micro); line-height: 1.45; color: var(--d-faint); }
.budget-rows { margin-top: 18px; }
.budget-result .estimate-error { margin-top: 14px; }

/* ---------- full budget table ---------- */
.budget-table { margin-top: 20px; }
.budget-table-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.budget-table-head h3 { font-size: var(--t-h3); font-weight: 300; letter-spacing: -.035em; line-height: 1.1; }
.budget-table-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.budget-tbl tbody th { font-weight: 400; color: var(--l-text); }
.budget-tbl td { color: var(--l-text); font-weight: 500; }
.budget-tbl thead th { padding-bottom: 12px; }
.budget-tbl tr.is-key th, .budget-tbl tr.is-key td { font-weight: 600; color: var(--ink); }
.budget-tbl tr.is-key { background: rgba(20, 135, 111, .06); }
.budget-tbl tr.is-key th { padding-left: 12px; }
.budget-tbl td.is-neg { color: var(--brass-deep); }
.budget-tbl.is-empty td { color: var(--l-faint); font-weight: 400; }
.budget-note { margin-top: 16px; font-size: var(--t-small); color: var(--l-muted); max-width: 70ch; }
.budget-note.is-warn { color: var(--brass-deep); }
.budget-noscript { margin-top: 20px; }

/* ---------- what the budget includes ---------- */
.includes { isolation: isolate; overflow: clip; }
.includes h2 { max-width: 14ch; }
.includes .lede { margin-top: 24px; color: var(--d-lede); max-width: 36ch; }
.includes-list { display: grid; }
.includes-list article { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 12px 32px; padding: 28px 0; border-top: 1px solid var(--d-line); }
.includes-list article:last-child { border-bottom: 1px solid var(--d-line); }
.includes-list h3 { color: #fff; }
.includes-list p { font-size: var(--t-text); line-height: 1.6; max-width: 60ch; }


@media (max-width: 1180px) {
  .field-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .includes-list article { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .field-grid.three { grid-template-columns: minmax(0, 1fr); }
  .budget-layout .field > span:first-child { min-height: 0; }
  .budget-foot .btn:first-of-type { margin-left: 0; }
  .budget-table-head h3 { font-size: 24px; }
  .budget-tbl.table-stack tr.is-key { padding-left: 12px; padding-right: 12px; }
  .budget-tbl.table-stack tr.is-key th { padding-left: 0; }
  .budget-tbl.table-stack td { display: flex; justify-content: space-between; text-align: left; }
  .budget-tbl.table-stack td::before { font-weight: 400; color: var(--l-faint); }
  .budget-tbl.table-stack td + td { margin-top: 2px; }
}

/* print: the budget, not the chrome */
@media print {
  .page-hero, #includes .mesh-quiet, .link-rows, .cta-band, .budget-foot, .budget-table-actions, .stress-control .range, .split-fig, .footer, .skip-link { display: none !important; }
  .tool-layout { grid-template-columns: 1fr 1fr; }
  .estimate, .estimate * { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .section { padding: 24px 0; }
}
