/* ============================================================================
   The Budget Worksheet — /budget/ · v1 2026-10-21
   Brand Kit v1.1 tokens (tfsc-site.css :root) + the v2 recipe in tfsc-ds.css
   (radius 10/16, Manrope 15/700 buttons, soft card shadow). Phone-first.
   Brass discipline: kickers, the largest spending bar (the chart's argument),
   the Saving slice, and the "Left over" tile hairline. No traffic lights:
   a shortfall is shown in 60% Ink plus words, never red.
   ========================================================================== */
.bw{ --r:10px; --r-lg:16px; --sh:0 1px 2px rgba(14,22,38,.05), 0 2px 8px rgba(14,22,38,.04);
  --line2:rgba(14,22,38,.16); max-width:720px; margin:0 auto; color:var(--ink); }
.bw [hidden]{ display:none !important; }
.bw-print-head, .bw-print-only{ display:none; }

.bw-kicker, .bw-step-k, .bw-tips-k, .bw-tile-k, .bw-source{
  font-family:var(--f-mono); font-size:11.5px; font-weight:500; letter-spacing:.18em; text-transform:uppercase; }
.bw-kicker{ color:var(--brass); margin:0 0 14px; display:flex; align-items:center; gap:10px; }
.bw-kicker::before{ content:""; width:22px; height:1px; background:var(--brass); }
.bw h1, .bw h2, .bw h3{ font-family:var(--f-display); font-weight:500; color:var(--ink); }
.bw h1{ font-size:clamp(32px,5vw,46px); line-height:1.12; margin:0 0 18px; }
.bw-lede{ font-size:19px; line-height:1.6; margin:0 0 20px; }
.bw-note{ font-size:14px; line-height:1.55; color:var(--steel); margin:12px 0 0; }

.bw-meta{ list-style:none; padding:0; margin:0 0 26px; display:flex; flex-wrap:wrap; gap:8px 22px; font-size:15px; color:var(--steel); }
.bw-meta li{ position:relative; padding-left:16px; }
.bw-meta li::before{ content:""; position:absolute; left:0; top:.62em; width:6px; height:6px; border-radius:50%; background:var(--ink); opacity:.35; }

/* ---- buttons ---- */
.bw-btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:50px; padding:0 26px;
  border:1px solid var(--ink); border-radius:var(--r); background:var(--ink); color:var(--bone);
  font-family:var(--f-body); font-size:16px; font-weight:700; text-decoration:none; cursor:pointer;
  box-shadow:0 1px 2px rgba(14,22,38,.14), 0 10px 22px -12px rgba(14,22,38,.6); transition:background .18s, transform .18s; }
.bw-btn:hover{ background:#1d2a42; }
.bw-btn:active{ transform:translateY(1px); }
.bw-btn:disabled{ opacity:.5; cursor:wait; }
.bw-btn-lg{ font-size:17px; min-height:56px; padding:0 34px; }
.bw-btn-ghost{ background:transparent; color:var(--ink); box-shadow:none; }
.bw-btn-ghost:hover{ background:var(--paper); }
.bw-btn-light{ background:var(--bone); color:var(--ink); border-color:var(--bone); }
.bw-btn-light:hover{ background:#fff; }
.bw-link{ background:none; border:0; padding:8px 0; min-height:44px; color:var(--ink); font:inherit; font-size:15px;
  text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.bw :focus-visible{ outline:2px solid var(--brass); outline-offset:3px; }

.bw-returning{ background:var(--paper); padding:16px 18px; margin:0 0 22px; font-size:16px; border-radius:var(--r);
  display:flex; flex-direction:column; gap:12px; }
.bw-returning-acts{ display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; }

.bw-tips{ margin:40px 0 0; padding:24px 0 0; border-top:1px solid var(--line); }
.bw-tips-k{ color:var(--steel); margin:0 0 12px; }
.bw-tips ul{ margin:0; padding-left:20px; font-size:16px; line-height:1.55; color:#3b4454; }
.bw-tips li{ margin:0 0 6px; }

/* ---- steps ---- */
.bw-chips{ display:flex; gap:8px; overflow-x:auto; padding:2px 2px 10px; margin:0 -2px 6px; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.bw-chips::-webkit-scrollbar{ display:none; }
.bw-chip{ flex:0 0 auto; min-height:38px; padding:0 14px; border:1px solid var(--line2); border-radius:999px; background:var(--white);
  color:var(--ink); font-family:var(--f-body); font-size:14px; font-weight:600; cursor:pointer; white-space:nowrap; }
.bw-chip.is-done::before{ content:""; display:inline-block; width:6px; height:6px; margin-right:7px; border-radius:50%; background:var(--ink); vertical-align:middle; }
.bw-chip[aria-current]{ background:var(--ink); color:var(--bone); border-color:var(--ink); }
.bw-chip[aria-current].is-done::before{ background:var(--bone); }
.bw-chip-end{ border-style:dashed; }
.bw-progress{ height:3px; background:var(--paper); margin:0 0 26px; border-radius:2px; overflow:hidden; }
.bw-fill{ height:100%; width:0; background:var(--ink); transition:width .3s ease; }
.bw-step-k{ color:var(--steel); margin:0 0 8px; }
.bw-step-h{ font-size:clamp(28px,4vw,36px); line-height:1.2; margin:0 0 8px; outline:none; }
.bw-step-why{ font-size:16px; line-height:1.55; color:#3b4454; margin:0 0 22px; }

.bw-rows{ display:grid; gap:10px; }
.bw-row{ display:grid; grid-template-columns:1fr auto; align-items:center; gap:10px 16px; padding:14px 16px;
  background:var(--white); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--sh); transition:border-color .15s; }
.bw-row.has-val{ border-color:var(--line2); }
.bw-row-l{ font-size:17px; font-weight:600; line-height:1.35; cursor:pointer; }
.bw-row-h{ display:block; font-size:14px; font-weight:400; color:var(--steel); margin-top:2px; }
.bw-cname{ width:100%; min-height:44px; padding:8px 12px; font:inherit; font-size:17px; font-weight:600; color:var(--ink);
  border:1px dashed var(--line2); border-radius:8px; background:var(--bone); }
.bw-row-in{ display:flex; align-items:center; gap:8px; }
.bw-amt{ position:relative; display:block; }
.bw-cur{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--steel); font-size:17px; pointer-events:none; }
.bw-a{ width:132px; min-height:48px; padding:0 12px 0 26px; font-family:var(--f-body); font-size:18px; font-weight:600; color:var(--ink);
  text-align:right; background:var(--bone); border:1px solid var(--line2); border-radius:8px; font-variant-numeric:tabular-nums; }
.bw-a:focus{ background:#fff; border-color:var(--ink); outline:none; box-shadow:0 0 0 3px rgba(176,141,87,.25); }
.bw-f{ min-height:48px; padding:0 8px; font-family:var(--f-body); font-size:15px; color:var(--ink); background:var(--white);
  border:1px solid var(--line2); border-radius:8px; }
.bw-del{ width:40px; height:40px; border:0; background:none; font-size:24px; line-height:1; color:var(--steel); cursor:pointer; border-radius:8px; }
.bw-del:hover{ background:var(--paper); color:var(--ink); }
.bw-sectotal{ margin:6px 2px 0; font-size:15px; color:var(--steel); min-height:1.5em; }
.bw-sectotal strong{ color:var(--ink); }
.bw-add{ display:flex; align-items:center; justify-content:center; width:100%; margin:12px 0 0; min-height:48px; padding:0 16px;
  border:1px dashed var(--line2); border-radius:var(--r); background:transparent; color:var(--ink); font-family:var(--f-body); font-size:15px; font-weight:600; cursor:pointer; }
.bw-add:hover{ background:var(--paper); border-color:var(--ink); }
.bw-nav{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin:24px 0 0; }
.bw-back{ background:none; border:0; min-height:44px; padding:0 4px; font:inherit; font-size:15px; color:var(--steel); cursor:pointer; }
.bw-back:hover{ color:var(--ink); }
.bw-nav .bw-btn{ min-width:150px; }

/* running tally, pinned to the bottom of the screen while filling in */
.bw-tally{ position:sticky; bottom:0; z-index:20; margin:96px -4px 0;   /* the gap lets Add + Next scroll clear of the bar */ padding:12px 16px calc(12px + env(safe-area-inset-bottom));
  display:flex; justify-content:space-between; gap:10px; background:var(--ink); color:var(--bone); border-radius:var(--r) var(--r) 0 0;
  font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; box-shadow:0 -8px 24px -12px rgba(14,22,38,.5); }
.bw-tally em{ display:block; font-style:normal; font-family:var(--f-mono); font-size:10.5px; font-weight:500; letter-spacing:.16em; text-transform:uppercase; opacity:.7; }
.bw-tally span{ flex:1; }
.bw-tally .bw-tally-left{ text-align:right; color:var(--brass-pale,#F0D7AD); }
.bw-tally .bw-tally-left.is-neg{ color:var(--bone); }

/* ---- summary ---- */
.bw-headline{ font-size:clamp(27px,4vw,36px); line-height:1.2; margin:0 0 12px; }
.bw-sub{ font-size:17px; line-height:1.55; color:#3b4454; margin:0 0 24px; }
.bw-view{ display:inline-flex; padding:3px; background:var(--paper); border-radius:999px; margin:0 0 18px; }
.bw-seg{ min-height:38px; padding:0 18px; border:0; border-radius:999px; background:none; font-family:var(--f-body); font-size:14px; font-weight:700; color:var(--steel); cursor:pointer; }
.bw-seg[aria-pressed="true"]{ background:var(--white); color:var(--ink); box-shadow:var(--sh); }

.bw-tiles{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin:0 0 28px; }
.bw-tile{ display:flex; flex-direction:column; gap:4px; padding:16px; background:var(--white); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh); }
.bw-tile-k{ color:var(--steel); font-size:10.5px; }
.bw-tile-v{ font-family:var(--f-display); font-size:clamp(22px,3vw,28px); line-height:1.1; font-variant-numeric:tabular-nums; }
.bw-tile-p{ font-size:13px; color:var(--steel); }
.bw-tile-key{ border-top:3px solid var(--brass); }
.bw-tile-key.is-neg .bw-tile-v{ color:rgba(14,22,38,.6); }

.bw-block{ margin:0 0 28px; padding:22px 20px; background:var(--white); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--sh); }
.bw-block-h{ font-size:22px; margin:0 0 16px; }
.bw-bars{ display:grid; gap:14px; }
.bw-bar-l{ display:flex; justify-content:space-between; gap:12px; font-size:15.5px; font-weight:600; margin:0 0 6px; }
.bw-bar-v{ font-variant-numeric:tabular-nums; white-space:nowrap; }
.bw-bar-v em{ font-style:normal; font-weight:400; color:var(--steel); margin-left:4px; }
.bw-bar-track{ height:12px; }
.bw-bar-fill{ height:100%; background:var(--ink); border-radius:0 3px 3px 0; transition:width .4s ease; }
.bw-bar.is-top .bw-bar-fill{ background:var(--brass); }
.bw-source{ margin:16px 0 0; font-size:9.5px; letter-spacing:.16em; color:var(--steel); }

.bw-split{ display:flex; height:22px; border-radius:4px; overflow:hidden; background:var(--paper); }
.bw-split span{ display:block; height:100%; }
.bw-split-n{ background:var(--ink); }
.bw-split-w{ background:#7E8898; }
.bw-split-s{ background:var(--brass); }
.bw-legend{ list-style:none; padding:0; margin:14px 0 0; display:flex; flex-wrap:wrap; gap:8px 22px; font-size:15px; }
.bw-legend strong{ font-variant-numeric:tabular-nums; }
.bw-legend em{ font-style:normal; color:var(--steel); }
.bw-sw{ display:inline-block; width:11px; height:11px; border-radius:2px; margin-right:7px; vertical-align:-1px; }

.bw-keep{ display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin:0 0 20px; }
.bw-send{ margin:0 0 24px; padding:22px 20px; background:var(--paper); border-radius:var(--r-lg); display:grid; gap:14px; }
.bw-send .bw-block-h{ margin:0; }
.bw-field{ display:grid; gap:6px; font-size:15px; font-weight:600; }
.bw-field input{ min-height:50px; padding:0 14px; font-family:var(--f-body); font-size:17px; color:var(--ink); background:#fff;
  border:1px solid var(--line2); border-radius:var(--r); }
.bw-field input:focus{ border-color:var(--ink); outline:none; box-shadow:0 0 0 3px rgba(176,141,87,.25); }
.bw-check{ display:flex; align-items:flex-start; gap:10px; font-size:15.5px; line-height:1.45; cursor:pointer; }
.bw-check input{ width:22px; height:22px; margin:0; flex:0 0 auto; accent-color:var(--ink); }
.bw-err{ margin:0; font-size:15px; font-weight:600; color:var(--ink); border-left:3px solid var(--ink); padding-left:10px; }
.bw-send-acts{ display:flex; align-items:center; gap:18px; }
.bw-sent{ margin:0 0 24px; padding:16px 18px; background:var(--paper); border-left:3px solid var(--brass); border-radius:0 var(--r) var(--r) 0; font-size:16px; }

.bw-dsec{ margin:0 0 16px; }
.bw-dsec:last-child{ margin-bottom:0; }
.bw-drow{ display:flex; justify-content:space-between; gap:14px; padding:7px 0; border-bottom:1px solid var(--line); font-size:15.5px; font-variant-numeric:tabular-nums; }
.bw-drow em{ font-style:normal; color:var(--steel); font-size:13.5px; margin-left:4px; }
.bw-dhead{ font-weight:700; border-bottom:1px solid var(--line2); }

.bw-close{ margin:8px 0 24px; padding:32px 28px 28px; color:var(--bone); border-radius:var(--r-lg);
  background:radial-gradient(circle at 80% 20%,rgba(176,141,87,.16),rgba(176,141,87,0) 62%), linear-gradient(135deg,#08101D 0%,#0E1626 54%,#173156 100%); }
.bw-close h3{ color:var(--bone); font-size:26px; margin:0 0 10px; }
.bw-close p{ font-size:16.5px; line-height:1.6; margin:0 0 18px; color:rgba(250,248,244,.86); }
.bw-close-alt{ margin:14px 0 0 !important; font-size:15px !important; }
.bw-close a:not(.bw-btn){ color:var(--bone); }
.bw-disclosure{ font-size:13px; }

/* ---- phone ---- */
@media (max-width:640px){
  .bw-lede{ font-size:17.5px; }
  .bw-row{ grid-template-columns:1fr; padding:14px; }
  .bw-row-in{ width:100%; }
  .bw-amt{ flex:1; }
  .bw-a{ width:100%; }
  .bw-f{ flex:0 0 auto; }
  .bw-tiles{ grid-template-columns:1fr 1fr; }
  .bw-block{ padding:20px 16px; }
  .bw-nav .bw-btn{ flex:1; }
  .bw-keep .bw-btn{ width:100%; }
  .bw-close{ padding:26px 20px 22px; }
}
body.bw-stepping .tfsc-footer{ display:none; }   /* the tally bar is the footer while filling in */

@media (prefers-reduced-motion:reduce){
  .bw-fill, .bw-bar-fill, .bw-btn{ transition:none; }
}

@media print{
  .tfsc-masthead, .tfh, .tfsc-footer, .tfsc-skip, #tfsc-consent, .bw-keep, .bw-send, .bw-sent, .bw-view,
  #bw-intro, #bw-steps, .bw-close .bw-btn, .bw-close-alt{ display:none !important; }
  body{ background:#fff; font-size:11pt; }
  .tfsc-card{ padding:0 !important; margin:0 !important; border:0; box-shadow:none; }
  .bw{ max-width:none; }
  .bw-print-head{ display:block; font-family:var(--f-mono); font-size:8pt; letter-spacing:.14em; text-transform:uppercase;
    color:var(--steel); border-bottom:1px solid #ccc; padding-bottom:6pt; margin:0 0 12pt; }
  .bw-print-only{ display:block; font-weight:600; }
  .bw-tile, .bw-block{ box-shadow:none; border:1px solid #ccc; break-inside:avoid; }
  .bw-dsec{ break-inside:avoid; }
  .bw-close{ background:#fff !important; color:var(--ink); border:1px solid #ccc; padding:12pt; }
  .bw-close h3, .bw-close p{ color:var(--ink) !important; }
  .bw-bar-fill, .bw-split span, .bw-sw, .bw-tile-key{ -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}
