@import url('tokens.css');

* { box-sizing: border-box; }
html { font-size: calc(16px * var(--scale)); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1rem; font-weight: 500; line-height: 1.4;
  font-variant-numeric: tabular-nums; min-width: 1280px;
}
h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 var(--s4); letter-spacing: -.01em; }
h2 { font-size: 1.125rem; font-weight: 700; margin: 0; }
h3 { font-size: .875rem; font-weight: 600; margin: 0 0 var(--s2); color: var(--text-2); }
p { margin: 0 0 var(--s3); }
a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.muted { color: var(--text-2); }
.label { font-size: .875rem; font-weight: 600; color: var(--text-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.25; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Buttons: look like buttons (R183). One main per area. */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--input); padding: 0 var(--s4);
  border-radius: var(--r-button); border: 2px solid var(--primary); background: var(--card); color: var(--primary);
  font: inherit; font-weight: 600; font-size: .9375rem; cursor: pointer; box-shadow: var(--shadow); white-space: nowrap;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(0); box-shadow: none; }
/* Pressed: everything you can press darkens while held, so a click always shows. */
.btn:active:not([disabled]), .icon-btn:active:not([disabled]), .seg button:active, .tab:active, .subtab:active, .caret:active { filter: brightness(.82); }
.btn:focus-visible, .icon-btn:focus-visible, .seg button:focus-visible, .tab:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.big { min-height: 56px; padding: 0 var(--s5); font-size: 1rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.small { min-height: 28px; padding: 0 var(--s3); font-size: .875rem; }
.icon-btn {
  width: var(--icon-btn); height: var(--icon-btn); display: inline-grid; place-items: center; flex: none;
  border: 2px solid var(--text); border-radius: var(--r-button); background: var(--card); color: var(--text);
  cursor: pointer; padding: 0; box-shadow: var(--shadow); position: relative;
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.icon-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn.tiny { width: 28px; height: 28px; box-shadow: none; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--primary-dark); color: #fff; padding: 4px 8px; border-radius: 4px; font-size: .8125rem;
  font-weight: 600; white-space: nowrap; z-index: 50; pointer-events: none;
}

/* Segmented toggles */
.seg { display: inline-flex; border: 2px solid var(--border-input); border-radius: var(--r-button); overflow: hidden; background: var(--card); flex: none; }
.seg button { border: 0; background: transparent; color: var(--text); font: inherit; font-size: .875rem; font-weight: 600; padding: 0 var(--s3); min-height: calc(var(--input) - 4px); cursor: pointer; }
.seg button + button { border-left: 1.5px solid var(--border-row); }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }

/* Inputs (R163): empty = strong 2px with a hint; filled = softer 1.5px; focus = 2px sapphire. */
.field { display: inline-flex; align-items: center; height: var(--input); border: 2px solid var(--border-input); border-radius: var(--r-input); background: var(--card); padding: 0 var(--s2); gap: 2px; }
.field.filled { border: 1.5px solid var(--border-filled); padding: 0 calc(var(--s2) + .5px); }
.field:focus-within { border: 2px solid var(--primary); padding: 0 var(--s2); }
.field input, .field select { border: 0; background: transparent; color: var(--text); font: inherit; outline: none; min-width: 0; width: 100%; height: 100%; }
.field input::placeholder { color: var(--text-2); opacity: .75; font-weight: 500; }
.field .pre, .field .post { color: var(--text-2); font-weight: 600; }
.field.money input, .field.pct input { text-align: right; }
.computed { display: inline-flex; align-items: center; justify-content: flex-end; height: var(--input); padding: 0 var(--s2); background: var(--computed); border-radius: var(--r-input); font-weight: 600; white-space: nowrap; }
select.plain { height: var(--input); border: 2px solid var(--border-input); border-radius: var(--r-input); background: var(--card); color: var(--text); font: inherit; padding: 0 var(--s2); }

/* Status tags (R160): symbol plus color. Solid pills. */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: .8125rem; font-weight: 700; white-space: nowrap; color: #fff; background: var(--warn); }
.tag.roughly { background: var(--roughly); }
.tag.guess { background: var(--guess); }
.tag.warn { background: var(--warn); }
.tag.plain { background: var(--chip); color: var(--chip-text); }
.tag.good { background: var(--good); color: #fff; }
.status-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; height: 28px; border: 1.5px solid var(--border-input); border-radius: 999px; background: var(--card); color: var(--text-2); font: inherit; font-size: .8125rem; font-weight: 600; padding: 0 10px; cursor: pointer; }
.status-btn .tag { margin: -2px -9px; }
.status-btn.quiet { border-color: transparent; background: transparent; font-weight: 500; }
.status-btn.quiet:hover { border-color: var(--border-filled); }

/* Time chip (R155) */
.time-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--chip); color: var(--chip-text); font-size: .75rem; font-weight: 600; margin-left: 6px; white-space: nowrap; vertical-align: middle; }

/* Cards and sections; area color as a 6px stripe on the section title (R161). */
.card { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: var(--s4) var(--s5); }
.section { margin-bottom: var(--s5); }
.section-title { display: flex; align-items: center; gap: var(--s3); padding-left: var(--s3); border-left: 6px solid var(--area, var(--primary)); margin-bottom: var(--s3); min-height: 32px; }
.section-title .spacer { flex: 1; }
.area-income { --area: var(--income); } .area-debt { --area: var(--debt); } .area-assets { --area: var(--assets); }
.area-taxes { --area: var(--taxes); } .area-needs { --area: var(--needs); } .area-goals { --area: var(--goals); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--area, var(--primary)); display: inline-block; flex: none; }

/* Summary strip (R157) */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin-bottom: var(--s4); }
.metric { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: var(--s3) var(--s4); min-height: 96px; display: flex; flex-direction: column; gap: 2px; }
.metric .big { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.metric .big .when { font-size: 1rem; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.metric .change { font-size: .8125rem; font-weight: 600; color: var(--text-2); }
.metric .change.good { color: var(--good); }
.metric .change.up::before { content: '\25B2 '; } .metric .change.down::before { content: '\25BC '; }
.metric.locked .big { font-size: 1rem; color: var(--text-2); }
button.math { all: unset; cursor: pointer; border-bottom: 2px dotted var(--border-filled); border-radius: 2px; }
button.math:hover { border-bottom-color: var(--primary); }
button.math:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Lists: rows share one center line; headers and totals stick (R165). */
.list { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); position: relative; }
.list-scroll { overflow: visible; border-radius: var(--r-card); } /* item 23: the page scrolls, not the table */
table.rows { width: 100%; border-collapse: separate; border-spacing: 0; }
table.rows th { position: sticky; top: 104px; z-index: 2; background: var(--card); font-size: .875rem; font-weight: 600; color: var(--text-2); text-align: left; padding: var(--s2) var(--s2); border-bottom: 2px solid var(--border-row); white-space: nowrap; }
table.rows th.num { text-align: right; }
table.rows td { height: var(--row); padding: 0 var(--s2); border-bottom: 1px solid var(--border-row); vertical-align: middle; }
table.rows tr.row:hover td { background: color-mix(in srgb, var(--primary-light) 22%, transparent); }
table.rows tr.row.selected td { background: color-mix(in srgb, var(--primary-light) 55%, transparent); }
table.rows tr.row.flash td { animation: flash .9s ease-out; }
@keyframes flash { from { background: var(--saved); } to { background: transparent; } }
table.rows tr.group td { background: var(--bg); height: 36px; font-weight: 700; }
table.rows tr.group .fold { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: var(--s2); min-height: 36px; width: 100%; cursor: pointer; }
table.rows tr.group .fold:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
table.rows tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--card); border-top: 2px solid var(--border-row); border-bottom: 0; font-weight: 700; height: 44px; }
table.rows tr.more td { background: var(--bg); }
table.rows tr.more > td { padding: var(--s3) var(--s4); } /* batch 33: the padding is the open row's own, not every cell of a list inside it (the Budget's lines kept 16px a side and could not fit beside the side panel) */
/* Batch 7, item 10: a Details panel is a grid, not a free wrap. Every box starts on the same line as its neighbours
   (label above, box below, park buttons under), so the eye reads rows, not a cloud. A wide box (a pair, a long text)
   says so with .wide and takes two cells. */
.layer { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s3) var(--s4); align-items: start; }
.layer > .stack { min-width: 0; }
.layer > .stack > .row-line { flex-wrap: nowrap; }
.layer > .stack.wide, .layer > .stack:has(> .row-line > .field + .field + .field), .layer > .stack:has(> label.field[style*="width: 3"]), .layer > .stack:has(> textarea) { grid-column: span 2; }
.layer > .stack:has(> .seg) .seg { flex-wrap: wrap; }
.layer > .stack .later-btn { min-height: 28px; }
@media (max-width: 760px) { .layer { grid-template-columns: 1fr; } .layer > .stack.wide, .layer > .stack:has(> .row-line > .field + .field + .field) { grid-column: auto; } }
.layer + .layer { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px dashed var(--border-row); }
.stack { display: flex; flex-direction: column; gap: 4px; }
.actions { display: inline-flex; gap: var(--s2); align-items: center; white-space: nowrap; }
.caret { display: inline-flex; align-items: center; gap: 4px; height: 28px; border: 1.5px solid var(--border-input); border-radius: var(--r-button); background: var(--card); color: var(--text); font: inherit; font-size: .875rem; font-weight: 600; padding: 0 10px; cursor: pointer; }
.caret:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; margin: 0; }
.check-cell { width: 44px; text-align: center; }
.payoff { display: flex; flex-direction: column; gap: 4px; min-width: 190px; white-space: nowrap; }
.payoff .computed { justify-content: flex-start; }
.payoff .bar { height: 6px; border-radius: 3px; background: var(--computed); overflow: hidden; }
.payoff .bar span { display: block; height: 100%; background: var(--area); border-radius: 3px; }
.bulk-host { position: absolute; top: 0; left: 0; right: 0; z-index: 4; }
/* Lies over the header row (same height), so the table never moves when it appears. */
.bulk-bar { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3); min-height: 44px; background: var(--primary-light); border-radius: var(--r-card) var(--r-card) 0 0; box-shadow: var(--shadow); }
.bulk-bar .count { font-weight: 700; margin-right: var(--s2); }
.footer { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4); }
.footer .spacer { flex: 1; }
.progress { width: 140px; height: 8px; border-radius: 4px; background: var(--computed); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--area, var(--primary)); }
.hint-line { font-size: .8125rem; color: var(--text-2); padding: 0 var(--s4) var(--s3); }
kbd { font: inherit; font-size: .75rem; font-weight: 700; border: 1.5px solid var(--border-row); border-bottom-width: 2.5px; border-radius: 4px; padding: 0 5px; background: var(--card); }

/* Popovers, pickers, panels */
.pop { position: absolute; z-index: 60; background: var(--card); border: 2px solid var(--border-input); border-radius: var(--r-card); box-shadow: var(--shadow-lift); padding: var(--s4); min-width: 280px; }
.picker-top { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); margin-bottom: var(--s3); }
.picker-top .btn { justify-content: center; min-height: 52px; }
.picker-other { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); max-height: 200px; overflow: auto; }
.math-pop { max-width: 420px; font-size: .9375rem; line-height: 1.5; }
.math-pop .head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: var(--primary-dark); color: #fff; border-radius: var(--r-card); padding: var(--s3) var(--s4); display: flex; align-items: center; gap: var(--s4); box-shadow: var(--shadow-lift); font-weight: 600; }
.toast .btn { border-color: #fff; color: #fff; background: transparent; box-shadow: none; min-height: 30px; }
.saved-note { display: inline-flex; align-items: center; gap: 4px; color: var(--good); font-weight: 700; font-size: .875rem; opacity: 0; transition: opacity .2s; }
.saved-note.on { opacity: 1; }

/* Empty states */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); padding: var(--s5); }
.empty.center { align-items: center; text-align: center; padding: 64px var(--s5); }
.empty .title { font-size: 1.125rem; font-weight: 700; }
.chart-empty { border: 2px dashed var(--border-row); border-radius: var(--r-card); display: grid; place-items: center; text-align: center; padding: var(--s5); min-height: 220px; color: var(--text-2); }
.chart-empty svg.ghost { width: 160px; height: 90px; stroke: var(--border-row); stroke-width: 3; fill: none; margin-bottom: var(--s3); }

/* Visuals panel */
.visuals { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-items: start; }
@media (min-width: 1600px) { .visuals:not(.below):not(.hidden) { grid-template-columns: minmax(0, 1fr) 340px; } }
.visuals.side { grid-template-columns: minmax(0, 1fr) 340px; }
.visuals.below { grid-template-columns: minmax(0, 1fr); }
.visuals.hidden { grid-template-columns: minmax(0, 1fr); }
.visuals.hidden .vis-panel .chart { display: none; }
.vis-panel .bar-top { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; }
.vis-panel .chart { height: 260px; }

.page { max-width: none; margin: 0 auto; padding: var(--s5) var(--s5) 96px; } /* B6.12: the full screen width */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.row-line { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }

@media print { /* R173 */
  :root { --bg: #fff; --card: #fff; --text: #000; --text-2: #000; --computed: #fff; --border-row: #000; }
  body { min-width: 0; background: #fff; color: #000; }
  .btn, .icon-btn, .caret, .seg, .topbar, .subtabs, .bulk-bar, .toast, .hint-line, input[type="checkbox"], .no-print { display: none !important; }
  .card, .list, .metric { box-shadow: none; border: 1px solid #000; }
  table.rows td, table.rows th { border-color: #000; border-style: solid; }
}

/* Smooth: soft motion on everything you can press, rounder segments. */
.btn, .icon-btn, .seg button, .tab, .subtab, .field, .status-btn, button.math { transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease; }
.seg button { white-space: nowrap; }
.seg button:first-child { border-radius: calc(var(--r-button) - 2px) 0 0 calc(var(--r-button) - 2px); }
.seg button:last-child { border-radius: 0 calc(var(--r-button) - 2px) calc(var(--r-button) - 2px) 0; }
html { -webkit-tap-highlight-color: transparent; } /* no global smooth scroll: redraws must not glide */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.btn.small.nfm { color: var(--text-2); border-color: var(--border-filled); }

/* My Money (build phase 5): forms, the gates hub, counts, More blocks, completion bars. */
.small { font-size: .8125rem; }
.form-grid { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s5); align-items: flex-start; }
.form-grid > .metric { min-width: 200px; box-shadow: none; border: 1.5px solid var(--border-row); }
.profile-card .more-wrap, .card > .more-wrap { margin-top: var(--s4); }
.more-wrap .more-body { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px dashed var(--border-row); }
.gates { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s3); }
.gate { display: flex; flex-direction: column; gap: 6px; padding: var(--s3); border: 1.5px solid var(--border-row); border-radius: var(--r-input); background: var(--bg); }
.gate-label { font-weight: 700; }
label.check { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; font-weight: 600; cursor: pointer; }
.type-counts { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s4); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s2); }
.type-count { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 4px 4px 4px var(--s3); border: 1.5px solid var(--border-row); border-radius: var(--r-input); }
.type-count.on { border-color: var(--area, var(--primary)); background: color-mix(in srgb, var(--area, var(--primary)) 10%, transparent); font-weight: 700; }
.completion { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: calc(-1 * var(--s2)) 0 var(--s4); }
.off-areas, .banner-inline { margin-bottom: var(--s3); }
.banner-inline { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; background: var(--card); border: 2px solid var(--warn); border-radius: var(--r-card); padding: var(--s2) var(--s4); font-weight: 600; }
.one-page-part { scroll-margin-top: 120px; margin-bottom: var(--s6); }
.one-page-part + .one-page-part { padding-top: var(--s5); border-top: 2px solid var(--border-row); }
.part-title { font-size: 1.25rem; }

/* Fast Track: a mode over the page, one question at a time. */
.ft-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(6, 14, 31, .55); display: flex; justify-content: center; align-items: flex-start; padding: 6vh 16px; overflow: auto; }
.ft-box { width: min(760px, 100%); background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-lift); padding: var(--s5); }
.ft-box h2 { font-size: 1.5rem; margin: var(--s4) 0 var(--s1); }
.ft-head { display: flex; align-items: center; gap: var(--s3); }
.ft-clock { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; font-size: .875rem; }
.ft-progress { height: 6px; border-radius: 3px; background: var(--computed); overflow: hidden; margin-top: var(--s3); }
.ft-progress span { display: block; height: 100%; background: var(--primary); transition: width .2s; }
.ft-grid { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s5); align-items: flex-end; margin-top: var(--s4); }
.ft-debt { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: flex-end; padding: var(--s3); border: 1.5px solid var(--border-row); border-radius: var(--r-input); }
.ft-debt > strong { flex-basis: 100%; }
.ft-foot { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }
@media (max-width: 760px) {
  .ft-overlay { padding: 8px; }
  .ft-box { padding: var(--s4); }
  .form-grid > .stack, .form-grid > .metric { flex: 1 1 100%; }
  .mm-modes { flex: none; }
}
.gate > .seg, .stack > .seg { align-self: flex-start; }
/* Native dropdown lists follow the theme (they were white with pale text in dark mode). */
select option, select optgroup { background-color: var(--card); color: var(--text); }
select { color-scheme: inherit; }
.num-box input { text-align: center; font-weight: 700; }
.completion-wrap { margin: calc(-1 * var(--s2)) 0 var(--s4); }
.completion-wrap .completion { margin: 0 0 var(--s2); }
ul.missing { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .9375rem; }

/* I'll find it later (Brandon B1.2): small, outlined, under the box */
.later-btn { min-height: 22px; font-size: .75rem; font-weight: 500; padding: 0 8px; color: var(--text-2); border-color: var(--border-filled); align-self: flex-start; }
.stack.parked > .field { border-style: dashed; }
.next-step { display: flex; justify-content: flex-end; margin: var(--s4) 0; }

/* Account detail (Brandon section 2) */
.acct-blocks .more-body { padding: var(--s3) 0 var(--s2) var(--s3); border-left: 2px solid var(--border-row); margin-top: var(--s2); }
.alloc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--s3); }
table.rows.mini th, table.rows.mini td { padding: 4px 6px; white-space: nowrap; }
.tag.ok-tag { color: var(--good, #1E7A4C); }
.asset-checks .tag.warn, .acct-blocks .tag.warn { white-space: normal; text-align: left; }
.benefit-list { display: flex; flex-direction: column; gap: var(--s3); }
.benefit-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; padding-bottom: var(--s3); border-bottom: 1px dashed var(--border-row); }
.benefit-row .gate-label { min-width: 260px; align-self: center; font-weight: 600; }
.nudge { flex-basis: 100%; font-size: .875rem; padding: 6px 10px; border-radius: var(--r-button); border: 1.5px solid var(--border-filled); background: var(--card); color: var(--text); }
.year-month { display: grid; grid-template-columns: 180px 1fr; gap: var(--s3); padding-bottom: var(--s3); border-bottom: 1px dashed var(--border-row); }
.year-head { display: flex; flex-direction: column; gap: 2px; }
.year-item { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 700px) { .year-month { grid-template-columns: 1fr; } }
.nw-time { margin: var(--s3) 0; }
.nw-time .more-wrap { flex: 1; }
.group-add { min-height: 24px; font-size: .75rem; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; }
.chip-x { border: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; padding: 0 2px; }
.payday { margin: var(--s3) 0; display: flex; flex-direction: column; gap: 4px; }
/* B8: a term with a plain-language tooltip */
.has-tip { text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: help; }
/* B9: Report this, small, bottom right, on every screen */
.report-this { position: fixed; right: 16px; bottom: 16px; z-index: 40; min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--border-input);
  background: var(--card); color: var(--text); font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-lift); }
.report-this:hover { transform: translateY(-1px); }
@media print { .report-this { display: none; } }

/* Fix pass 3: rows fit. Checkboxes only in Select mode; one "..." menu per row. */
.btn.select-btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.row-menu { display: flex; flex-direction: column; gap: 2px; }
.row-menu hr { border: 0; border-top: 1px solid var(--border-row); margin: 4px 0; width: 100%; }
.menu-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 0 var(--s3); border-radius: var(--r-button); cursor: pointer; font-weight: 600; }
.menu-item:hover, .menu-item:focus-visible { background: var(--primary-light); }
.menu-item.danger { color: var(--danger); }
.pop:has(.row-menu) { min-width: 0; padding: var(--s2); }
.keep-slot { display: inline-flex; min-width: 64px; }
/* Nov 6 (spending lines only; Income's rows carry a label before the box): the Amount column starts every box at the same place, so boxes line up row to row whatever chip follows
   (Use $80, your share, whole bill, $70 your share). Helper text under the box starts with it. */
table.rows.amount-left th.col-amount { text-align: left; }
table.rows.amount-left td.col-amount > .row-line { justify-content: flex-start !important; }
table.rows.amount-left td.col-amount .typical-wrap { align-items: flex-start; }
table.rows.amount-left td.col-amount .typical-wrap > .typical-note { left: 0; right: auto; }

/* Fix pass 4: clickable things look clickable. 32px hit area on every button, segment and chip; 36px in rows. */
.btn.small, .icon-btn.tiny, .caret, .status-btn, .seg button, .chip, .more-chips, .deal-opt, a.tag, .day-top .icon-btn, .topbar .seg button { min-height: 32px; }
.icon-btn.tiny, .day-top .icon-btn { width: 32px; height: 32px; }
.chip, .more-chips, .deal-opt, a.tag { display: inline-flex; align-items: center; }
.chip { display: flex; }
table.rows tr.row :is(.btn, .caret, .status-btn, .seg button, .field, select.plain), table.rows tr.row .icon-btn { min-height: 36px; }
table.rows tr.row .field { height: 36px; }
table.rows tr.row .icon-btn { width: 36px; height: 36px; }
/* Status ("Know it" and its arrow) is a button with a border like the rest. */
.status-btn, .status-btn.quiet { border: 2px solid var(--border-input); background: var(--card); color: var(--text); font-weight: 600; }
.status-btn:hover, .status-btn.quiet:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.status-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
/* Show the math: same look, a clear hover and a pointer. */
button.math { cursor: pointer; padding: 0 2px; margin: 0 -2px; }
button.math:hover { background: color-mix(in srgb, var(--primary-light) 45%, transparent); border-bottom: 2px solid var(--primary); }
/* Merge with main: the group header holds the fold and "Add a line"; Report this keeps the 32px minimum. */
table.rows tr.group .group-line .fold { width: auto; flex: 1; }
.report-this { min-height: 32px; }
@media (max-width: 760px) { .section-title { flex-wrap: wrap; row-gap: 8px; } } /* the header buttons (Add the usual list, Select, Clear all) wrap on a phone */

/* Polish item 1: Know it, Rough, Missing. */
.tag.missing { background: transparent; color: var(--text); border: 2px dashed var(--border-input); }
.sure-menu .btn.small[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.sure-menu hr { border: 0; border-top: 1px solid var(--border-row); margin: 0; }
.metric .so { font-size: .875rem; color: var(--text); line-height: 1.35; margin-top: 4px; } .metric .so a { font-weight: 600; white-space: nowrap; }
/* Comes out of your paycheck */
.pay-job { padding-bottom: var(--s3); border-bottom: 1px dashed var(--border-row); }
.pay-line { display: grid; grid-template-columns: minmax(180px, 280px) auto 1fr; gap: 10px; align-items: center; max-width: 640px; }
.pay-line .num { text-align: right; font-variant-numeric: tabular-nums; }
.pay-total { font-weight: 700; }

/* Open the books: Open in a spreadsheet and Bring a spreadsheet back, each with its one line under it. */
.sheet-actions { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: flex-start; }
.btn-line { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 260px; }
.btn-line > .muted.small { line-height: 1.35; }
.page-head .row-line:has(.sheet-actions) { align-items: flex-start; }
.sheet-changes td { vertical-align: top; }
@media (max-width: 760px) { .btn-line { max-width: none; } }
.review-group { border-top: 1.5px solid var(--border-row); padding: var(--s2) 0; }
.review-group > summary { cursor: pointer; padding: 6px 0; min-height: 32px; }
.review-group h4 { margin: var(--s3) 0 var(--s1); font-size: .875rem; color: var(--text-2); }
.review-line { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 6px 0; border-bottom: 1px solid var(--border-row); flex-wrap: wrap; }
.review-line .seg button { min-height: 32px; }

/* Batch 8 */
body:has(.new-client-pop) .try-demo { visibility: hidden; } /* the New client box sits where this button is */
.card.ft-slim { padding: 8px var(--s4); }
@media (max-width: 760px) { .ft-slim-note { display: none; } }
.ft-msg { color: var(--text); background: var(--warn-bg, var(--primary-light)); border-radius: 6px; padding: 4px 8px; font-size: .875rem; font-weight: 600; max-width: 320px; border-left: 3px solid var(--amber); }
/* Import intake (CSV): the response picker. */
.intake-pick { display: flex; flex-direction: column; gap: var(--s2); }
.intake-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); justify-content: flex-start; text-align: left; width: 100%; min-height: 44px; }
.intake-box .review-line > div:first-child { min-width: 0; flex: 1 1 260px; }
/* Batch 15: the Bills list and the tax-by-row table read like the other row tables, with the money right-aligned. */
table.rows.bills-list td.num, table.rows.tax-rows td.num { text-align: right; white-space: nowrap; }
table.rows.bills-list td, table.rows.tax-rows td { white-space: nowrap; }
.changes-ahead span { color: var(--text-2); }
table.rows.bills-list th, table.rows.tax-rows th { position: static; }
@media (max-width: 600px) {
  table.rows.bills-list .col-often, table.rows.bills-list .col-paid, table.rows.bills-list thead { display: none; }
  table.rows.bills-list, table.rows.bills-list tbody { display: block; }
  table.rows.bills-list tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--border-row); }
  table.rows.bills-list td { height: auto; padding: 0; border: 0; }
}
/* Batch 14: Fast Track's tap step (About you's switches and the Why now chips). */
.ft-taps { gap: var(--s3) var(--s4); align-items: flex-start; }
.ft-why .why-chips { gap: 6px; }
/* Batch 14: Walk me through, a slim bar at the bottom of the window; the page makes room for it. */
.walk-bar { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 90; width: min(920px, calc(100vw - 32px)); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  padding: 8px 12px; background: var(--card); border: 1.5px solid var(--primary); border-radius: var(--r-card); box-shadow: var(--shadow-lift); }
.walk-bar .walk-where { min-width: 0; }
.walk-bar .spacer { flex: 1; }
body.walking { padding-bottom: var(--walk-room, 88px); }
/* Batch 14: a brand-new client's Home, one obvious first action. */
.start-one { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); padding: var(--s5); }
.start-one h2 { margin: 0; }
.start-one + .more-wrap { margin-top: var(--s3); }
/* Batch 46 (M9A): the plan from an age, under Start here and at the top of Fast Track. Slim, no color of its own. */
.age-plan { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s3); padding: var(--s4) var(--s5); }
.age-plan + .more-wrap { margin-top: var(--s3); }
.age-plan-head { gap: var(--s2); flex-wrap: nowrap; align-items: flex-start; }
.age-plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3) var(--s4); }
.age-plan-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.age-plan-num { font-size: 1.0625rem; font-weight: 700; }
.age-plan-foot { gap: var(--s3); justify-content: space-between; }
.age-plan-ask { gap: var(--s4); align-items: flex-start; }
.age-plan-next { gap: var(--s2); }
.age-plan-src { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 760px) { .age-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .age-plan { padding: var(--s4); } }
.ft-plan { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s3); margin-top: var(--s3); padding: var(--s2) var(--s3); border: 1px dashed var(--border-row); border-radius: var(--r-input); }
.ft-plan-title { font-weight: 600; color: var(--text-2); }
.ft-plan-nums { display: flex; flex-wrap: wrap; gap: 2px var(--s3); }
.ft-plan-num { white-space: nowrap; }
.fill-line { margin: 0 0 var(--s2); }
/* Batch 22: Import this month from Rocket Money, Monarch or your bank, and its review. */
.btn-line.import-line { max-width: 460px; margin: 0 0 var(--s3); }
.btn-line.import-line .btn { white-space: normal; text-align: left; height: auto; min-height: 40px; }
.imp-box { width: min(980px, 100%); }
.imp-found { margin: var(--s2) 0; }
.imp-months { gap: var(--s3); margin: var(--s2) 0; flex-wrap: wrap; }
.imp-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); padding: var(--s2) 0; border-bottom: 1.5px solid var(--border-row); }
.imp-row { border-bottom: 1px solid var(--border-row); padding: 6px 0; }
.imp-main { display: grid; grid-template-columns: auto 56px minmax(0, 1fr) auto auto; align-items: center; gap: var(--s3); }
.imp-acc-slot { width: 96px; }
.imp-accept { min-width: 96px; justify-content: center; }
.imp-accept[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.imp-what { display: flex; flex-direction: column; min-width: 0; }
.imp-what > * { overflow-wrap: anywhere; }
.imp-amt { white-space: nowrap; font-weight: 700; }
.imp-right { display: flex; align-items: center; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; }
.imp-target { min-height: 32px; max-width: 240px; white-space: normal; text-align: left; gap: 4px; }
.imp-picker { margin: var(--s2) 0 var(--s2) 108px; padding: var(--s3); border: 1.5px solid var(--border-input); border-radius: var(--r-card); display: flex; flex-direction: column; gap: var(--s2); }
.imp-pick-group { display: flex; flex-direction: column; gap: 4px; }
.imp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-chips .btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.imp-rule { margin: 4px 0 0 108px; }
.imp-map-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 4px 0; flex-wrap: wrap; }
.imp-cols { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s3) 0; }
.imp-none { margin: var(--s2) 0; }
.close-by { margin: 0 0 var(--s2); }
@media (max-width: 760px) {
  .imp-main { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'acc what amt' 'date right right'; row-gap: 6px; }
  .imp-main > .imp-accept, .imp-main > .imp-acc-slot { grid-area: acc; }
  .imp-main > .imp-date { grid-area: date; }
  .imp-main > .imp-what { grid-area: what; }
  .imp-main > .imp-amt { grid-area: amt; }
  .imp-main > .imp-right { grid-area: right; }
  .imp-accept, .imp-acc-slot { min-width: 0; width: auto; }
  .imp-picker, .imp-rule { margin-left: 0; }
}
/* The Export entry (Nov 25 2026): a link that opens another site wears the button look; long labels wrap on a phone. */
a.btn { text-decoration: none; }
.export-panel .btn { white-space: normal; text-align: left; padding-top: 6px; padding-bottom: 6px; }
.fire-blank a.btn::after { content: "\2197"; margin-left: 4px; }

/* The plan report (run Finish everything partly built, Part 18): one printout of the one-pager, the next steps, the
   statements and the FOO. On screen, the parts read top to bottom; printed, each part starts a new page. */
.plan-report { display: flex; flex-direction: column; gap: var(--s5); }
.plan-report .recap-wrap, .plan-report .tie-panel { display: none; }
.report-part-title { margin: 0 0 var(--s3); font-size: 1.25rem; }
.report-part > .card + .card, .report-part > .section { margin-top: var(--s3); }
@media print {
  .plan-report .report-part + .report-part { break-before: page; }
  .plan-report .statement, .plan-report .foo-step, .plan-report .metric { break-inside: avoid; }
  .plan-report .foo-card { display: none !important; }
  .plan-report .st-group > .more-wrap > .caret { display: inline-flex !important; border: 0; background: none; box-shadow: none; padding: 0; min-height: 0; font-weight: 600; color: #000; }
  .plan-report .st-group > .more-wrap > .caret svg { display: none; }
  .plan-report textarea:placeholder-shown { display: none; }
}

/* Plan › FIRE (run Finish everything partly built, Part 18): the board's rows are one grid, the name then three cells. */
.fire-pace { display: flex; flex-direction: column; gap: var(--s3); margin: var(--s4) 0; }
.fire-pace h2, .fire-board h2 { margin: 0; font-size: 1.125rem; }
.fire-board { display: flex; flex-direction: column; gap: var(--s3); }
.fire-rows { display: flex; flex-direction: column; gap: var(--s3); }
.fire-row { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(120px, 1fr)); gap: var(--s3); align-items: start; padding: var(--s3) 0; border-top: 1px solid var(--border-row); }
.fire-name { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.fire-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.fire-cell .rung-bar { align-self: stretch; }
.fire-mine { background: var(--primary-light); border-radius: var(--r-input); padding-left: var(--s3); padding-right: var(--s3); }
.fire-explain { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.fire-ex p { margin: 4px 0 0; }
.fire-quiz { margin: var(--s3) 0; }
@media (max-width: 640px) { .fire-row { grid-template-columns: 1fr 1fr; } .fire-name { grid-column: 1 / -1; } }
