:root {
  color-scheme: dark;
  --background: #071611;
  --surface: #10231b;
  --surface-raised: #142c21;
  --line: #2d4a3a;
  --text: #fbf8ed;
  --muted: #bbc9c0;
  --gold: #e5c578;
  --mint: #a5dfb8;
  --danger: #ffb8aa;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); line-height: 1.55; }
a { color: var(--gold); }
button, input, a, summary { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; text-wrap: balance; letter-spacing: -0.035em; }
p { color: var(--muted); }
.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.skip { position: absolute; top: 12px; left: 16px; z-index: 3; padding: 10px 14px; background: var(--surface); transform: translateY(-200%); }
.skip:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 760; letter-spacing: -0.025em; text-decoration: none; min-height: 44px; }
.brand:hover { color: var(--gold); }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #766840; border-radius: 50%; color: var(--gold); font: 700 19px Georgia, serif; }
.masthead-note { color: var(--muted); font-size: 0.8rem; }
.intro { padding: clamp(26px, 5vw, 64px) 0 clamp(26px, 4vw, 46px); }
.eyebrow { color: var(--gold); font-size: 0.73rem; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }
.intro h1 { font-size: clamp(2.55rem, 6vw, 4.8rem); margin: 0 0 10px; }
.intro > p:not(.eyebrow) { max-width: 555px; font-size: clamp(1rem, 2vw, 1.13rem); }
.steps { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.steps a { display: flex; gap: 8px; align-items: center; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); text-decoration: none; font-weight: 670; font-size: 0.9rem; }
.steps a:hover { border-color: var(--gold); }
.steps span { color: var(--gold); }
.planner-section { scroll-margin-top: 16px; margin-bottom: clamp(34px, 6vw, 66px); }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 15px; }
.section-heading h2 { font-size: clamp(1.65rem, 4vw, 2.7rem); margin-top: 4px; }
.planner-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: clamp(15px, 3vw, 25px); min-width: 0; }
.panel-heading { margin-bottom: 15px; }
.panel-heading h3 { font-size: clamp(1.16rem, 2.5vw, 1.47rem); }
.panel-heading p { margin-top: 5px; font-size: 0.91rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; align-content: start; font-size: 0.86rem; font-weight: 650; }
.field small { color: var(--muted); font-size: 0.81rem; font-weight: 400; }
.field.wide { grid-column: 1 / -1; }
.opening-field { margin-bottom: 13px; max-width: 250px; }
input { min-width: 0; width: 100%; min-height: 44px; border: 1px solid #496755; border-radius: 6px; background: #0a1b14; color: var(--text); font: inherit; font-size: 1rem; padding: 7px 9px; }
input:user-invalid, input[aria-invalid="true"] { border-color: var(--danger); }
.activities { display: grid; gap: 8px; }
.activity { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(52px, .65fr) minmax(80px, 1fr) auto; gap: 7px; align-items: end; }
.activity .remove { padding-inline: 8px; }
.activity label:first-child span { color: var(--mint); }
.activity[data-kind="bill"] label:first-child span { color: var(--muted); }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: 6px; font: inherit; font-weight: 690; font-size: 0.86rem; line-height: 1.25; cursor: pointer; text-decoration: none; }
.secondary { background: #142c21; border-color: #4a6956; color: var(--text); }
.secondary:hover { background: #1c3b2c; border-color: var(--mint); }
.primary { background: var(--gold); color: #132019; }
.primary:hover { background: #f3d994; }
.cash-metrics { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin: 0; }
.cash-metrics > div { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-wrap: anywhere; }
.cash-metrics dt { color: var(--muted); font-size: 0.78rem; font-weight: 640; }
.cash-metrics dd { margin: 2px 0 0; font-size: clamp(1.17rem, 3vw, 1.85rem); font-weight: 770; letter-spacing: -0.03em; }
.cash-metrics .primary-metric dd { color: var(--mint); }
.cash-metrics .primary-metric dd.deficit { color: var(--danger); }
.message { margin-top: 12px; background: #172f24; padding: 9px 11px; border-radius: 6px; color: var(--text); font-size: 0.88rem; overflow-wrap: anywhere; }
.message.error { color: var(--danger); background: #332620; }
.timeline-details, .assumptions { border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; margin-top: 12px; }
summary { color: var(--text); cursor: pointer; padding: 10px 0; min-height: 44px; font-size: 0.89rem; font-weight: 675; }
summary:hover { color: var(--gold); }
.timeline { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
.timeline th, .timeline td { padding: 6px 5px; text-align: left; border-top: 1px solid var(--line); }
.timeline :is(th, td):last-child { text-align: right; }
.timeline td { overflow-wrap: anywhere; }
.timeline .shortfall { color: var(--danger); }
.cash-panel > .button { margin-top: 13px; }
.extra-field { background: var(--surface-raised); border-radius: 7px; padding: 10px; }
.assumptions p { font-size: 0.84rem; margin: 0 0 10px; }
.result-row { padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.result-row > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 10px; }
.result-row strong { font-size: 0.89rem; }
.result-row span { font-size: clamp(1.1rem, 2.7vw, 1.55rem); font-weight: 760; overflow-wrap: anywhere; }
.result-compare span { color: var(--mint); }
.result-row p { font-size: 0.84rem; margin-top: 5px; }
.track { background: #0a1b14; border-radius: 4px; height: 6px; margin-top: 5px; overflow: hidden; }
.bar { width: 0; height: 100%; background: var(--gold); }
.result-compare .bar { background: var(--mint); }
.result-note { color: var(--mint); font-weight: 660; }
.model-note { font-size: 0.82rem; margin-top: 12px; }
.next-step { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface-raised); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 8px; padding: clamp(15px, 3vw, 24px); }
.next-step h2 { font-size: clamp(1.45rem, 3vw, 2rem); margin: 3px 0; }
.next-step p:not(.eyebrow) { font-size: 0.91rem; }
.footer { padding: 18px 0 22px; display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: space-between; font-size: 0.83rem; }
.footer div { display: flex; flex-wrap: wrap; gap: 6px 14px; }
@media (max-width: 790px) {
  .planner-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .wrap { width: calc(100% - 28px); }
  .masthead-inner { min-height: 54px; }
  .activity { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) auto; }
  .activity label:first-child { grid-column: 1 / -1; }
  .activity + .activity { border-top: 1px solid var(--line); padding-top: 8px; }
  .button-row .button { flex: 1 1 auto; }
}
.budget-entries { border-top: 1px solid var(--line); }
.budget-entries .button-row { margin-bottom: 4px; }
