:root {
  color-scheme: dark;
  --bg: #0b0c0c; --surface: #101212; --surface-raised: #151817; --surface-soft: #191c1b;
  --line: #292d2b; --line-bright: #3a403d; --text: #f0eee6; --muted: #9a9f9b; --faint: #858a86;
  --green: #83c79f; --green-soft: #16271e; --accent: #b7c8d2; --amber: #d9ab67; --amber-soft: #2b2318; --red: #df8580; --red-soft: #2d1a1a;
  --money: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, Avenir, "Segoe UI", system-ui, sans-serif;
  font-family: var(--sans); font-synthesis: none;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .16; background-image: linear-gradient(rgb(255 255 255 / .025) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .018) 1px, transparent 1px); background-size: 40px 40px; mask-image: linear-gradient(to bottom, black, transparent 72%); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 100; background: var(--text); color: var(--bg); padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute!important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 .55rem; color: var(--accent); font: 600 .64rem/1.2 var(--money); letter-spacing: .15em; text-transform: uppercase; }
.money { font-family: var(--money); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.045em; }
.positive { color: var(--green)!important; } .warning { color: var(--amber)!important; } .risk { color: var(--red)!important; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 88px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.25rem .65rem; border-right: 1px solid var(--line); background: rgb(11 12 12 / .94); display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; gap: .7rem; align-items: center; }
.sidebar .brand { justify-content: center; padding: .1rem 0 1.5rem; }
.brand-mark, .topbar-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-bright); color: var(--text); font: 600 .9rem var(--money); }
.brand strong { display: block; font-size: .88rem; }
.brand span { color: var(--muted); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.sidebar .brand-copy { display: none; }
.nav { display: grid; gap: .25rem; }
.nav button { min-height: 55px; padding: .4rem .2rem; border-left: 2px solid transparent; background: transparent; color: var(--faint); text-align: center; cursor: pointer; display: grid; place-items: center; gap: .15rem; font-size: .58rem; }
.nav button:hover { color: var(--text); background: var(--surface); }
.nav button.active { border-left-color: var(--accent); color: var(--text); background: var(--surface-raised); }
.nav-icon { font: 1rem var(--money); }
.side-foot { margin-top: auto; color: var(--faint); text-align: center; font-size: .56rem; line-height: 1.5; }
.side-foot > span { display: none; }
.local-pill { color: var(--green); display: grid; justify-items: center; gap: .4rem; text-transform: uppercase; letter-spacing: .08em; }
.local-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.workspace { min-width: 0; padding: 0 clamp(1.25rem, 3.2vw, 3.75rem) 5rem; }
.topbar { min-height: 70px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; background: rgb(11 12 12 / .9); backdrop-filter: blur(18px); z-index: 20; }
.topbar-title { display: flex; align-items: center; gap: .75rem; }
.topbar-mark { display: none; }
.topbar h1 { margin: 0; font: 500 .76rem var(--money); letter-spacing: .09em; text-transform: uppercase; }
.top-actions { display: flex; gap: .5rem; }
.content { max-width: 1540px; margin: 0 auto; padding-top: clamp(1.75rem, 4vw, 3.5rem); animation: content-in .35s ease both; }
.page-head { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: clamp(1.8rem, 4vw, 3.5rem); }
.page-head h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 4.5rem); font-weight: 400; line-height: .98; letter-spacing: -.055em; margin: 0; }
.page-head p:last-child { margin: .8rem 0 0; color: var(--muted); max-width: 46rem; line-height: 1.55; font-size: .82rem; }
.button { min-height: 40px; padding: .58rem .9rem; border-radius: 3px; background: var(--text); color: #111312; font-weight: 650; font-size: .76rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-decoration: none; transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease; }
.button:hover { background: #fff; transform: translateY(-1px); }
.button.secondary { background: var(--surface-soft); color: var(--text); border: 1px solid var(--line-bright); }
.button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.button.ghost:hover, .button.secondary:hover { color: var(--text); border-color: var(--faint); }
.button.danger { background: var(--red-soft); color: var(--red); border: 1px solid #613634; }
.button.small { min-height: 32px; padding: .3rem .6rem; font-size: .69rem; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--text); cursor: pointer; }

.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { min-width: 0; background: var(--surface); padding: clamp(1.15rem, 2vw, 1.65rem); }
.card-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.card-head h3, .card h3, .ledger-section h3, .ledger-flow h3 { margin: 0; font-size: 1rem; font-weight: 550; letter-spacing: -.015em; }
.card-head p { margin: .3rem 0 0; color: var(--muted); font-size: .73rem; }
.metric { min-height: 128px; }
.metric .label { color: var(--muted); font-size: .69rem; letter-spacing: .03em; }
.metric .value { font-size: clamp(1.15rem, 2.1vw, 1.8rem); margin: 1rem 0 .55rem; overflow-wrap: anywhere; animation: number-in .5s ease both; }
.metric .sub { color: var(--faint); font-size: .67rem; }
.section-gap { margin-top: 1.25rem; }

.position-panel { min-height: 410px; display: grid; grid-template-columns: minmax(300px, 1.12fr) minmax(340px, .88fr); border: 1px solid var(--line-bright); background: linear-gradient(115deg, #111615 0 56%, #0f1111 56%); position: relative; overflow: hidden; }
.position-panel::after { content: ""; position: absolute; width: 360px; height: 360px; left: -220px; bottom: -280px; border: 1px solid rgb(131 199 159 / .24); border-radius: 50%; box-shadow: 0 0 0 45px rgb(131 199 159 / .025), 0 0 0 90px rgb(131 199 159 / .018); }
.position-panel.has-risk { border-color: #593533; }
.position-main, .position-context { padding: clamp(1.5rem, 4vw, 4rem); position: relative; z-index: 1; }
.position-main { display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); }
.safe-value { margin: .2rem 0 1.2rem; color: var(--text); font-size: clamp(3.2rem, 7.4vw, 7.5rem); font-weight: 430; line-height: .88; letter-spacing: -.09em; overflow-wrap: anywhere; animation: number-in .55s ease both; }
.safe-daily { margin: 0 0 1.35rem; color: var(--muted); font-size: .8rem; }
.safe-daily strong { color: var(--green); font-size: 1rem; }
.status-line { font: 600 .65rem var(--money); letter-spacing: .06em; text-transform: uppercase; }
.position-context { align-self: center; }
.position-context > p:first-child { margin: 0 0 1rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 2.5vw, 2.2rem); line-height: 1.15; }
.hero-summary { color: var(--muted); line-height: 1.7; font-size: .78rem; }
.safe-breakdown, .recent-disclosure { margin-top: 1.5rem; border-top: 1px solid var(--line); }
summary { cursor: pointer; color: var(--accent); padding: .9rem 0; font-size: .72rem; font-weight: 600; }
summary::marker { color: var(--faint); }
.safe-breakdown .formula { margin-bottom: 1rem; }

.ledger-flow { margin-top: 1.25rem; padding: clamp(1.4rem, 2.8vw, 2.25rem); border: 1px solid var(--line); background: #0e1010; }
.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem; }
.flow-track { display: grid; grid-template-columns: repeat(6, minmax(105px, 1fr)); overflow-x: auto; scrollbar-color: var(--line-bright) transparent; }
.flow-step { min-width: 105px; padding: .5rem 1.2rem 1rem; border-bottom: 2px solid var(--line-bright); position: relative; display: grid; gap: .45rem; color: var(--muted); font-size: .67rem; }
.flow-step::after { content: ""; position: absolute; width: 7px; height: 7px; right: -4px; bottom: -4px; border: 1px solid var(--accent); border-radius: 50%; background: var(--bg); z-index: 2; }
.flow-step:last-child::after { right: 0; background: var(--green); border-color: var(--green); }
.flow-step strong { color: var(--text); font-size: clamp(.83rem, 1.25vw, 1.05rem); }
.flow-step.out { border-color: var(--green); }
.flow-step.out strong { color: var(--green); }
.flow-index { color: var(--faint); font: .58rem var(--money); }
.flow-note { margin: 1rem 0 0; color: var(--faint); font-size: .64rem; }
.status-strip { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.status-strip .metric { background: transparent; border-right: 1px solid var(--line); padding: 1.2rem; }
.status-strip .metric:last-child { border-right: 0; }

.overview-grid { margin-top: 1.25rem; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); grid-template-areas: "bills status" "goals goals" "spending forecast" "investments forecast"; gap: 1.25rem; align-items: start; }
.ledger-section { min-width: 0; border-top: 1px solid var(--line-bright); background: var(--surface); padding: clamp(1.2rem, 2.5vw, 2rem); }
.bills-section { grid-area: bills; } .status-section { grid-area: status; } .goals-section { grid-area: goals; } .spending-section { grid-area: spending; } .forecast-section { grid-area: forecast; } .investments-section { grid-area: investments; }
.bill-timeline { position: relative; }
.bill-timeline::before { content: ""; position: absolute; top: 1rem; bottom: 1rem; left: 62px; width: 1px; background: var(--line); }
.bill-row { display: grid; grid-template-columns: 47px 10px minmax(0,1fr) auto; align-items: center; gap: .75rem; min-height: 76px; border-bottom: 1px solid var(--line); }
.bill-row:last-child { border-bottom: 0; }
.bill-row time { text-align: center; display: grid; line-height: 1; }
.bill-row time strong { font: 500 1.2rem var(--money); }
.bill-row time span { color: var(--faint); font: .58rem var(--money); text-transform: uppercase; margin-top: .25rem; }
.timeline-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); z-index: 1; }
.bill-copy { display: grid; gap: .3rem; }
.bill-copy > strong { font-size: .8rem; }
.bill-copy small, .goal-row small, .list-item small { display: block; color: var(--faint); font-size: .65rem; }
.bill-action { display: grid; justify-items: end; gap: .4rem; }
.bill-action > strong { font-size: .8rem; }
.insight { display: grid; grid-template-columns: 8px 1fr; gap: .8rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.insight:last-child { border-bottom: 0; }
.insight-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: .4rem; background: var(--green); }
.insight-dot.amber { background: var(--amber); } .insight-dot.red { background: var(--red); }
.insight strong { font-size: .76rem; }
.insight p { margin: .3rem 0 0; color: var(--muted); font-size: .68rem; line-height: 1.55; }
.goal-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1.5rem; align-items: center; padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.goal-row:last-child { border-bottom: 0; }
.goal-main { padding: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.goal-name, .goal-distance { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.goal-name strong { font-size: .82rem; }
.goal-distance { margin: .65rem 0 .5rem; color: var(--faint); font-size: .66rem; }
.goal-distance b { color: var(--text); font-weight: 500; }
.goal-meta { min-width: 82px; display: grid; justify-items: end; gap: .35rem; }
.goal-meta > strong { font: 500 1.1rem var(--money); }
.progress { height: 3px; background: #292d2b; overflow: hidden; margin-top: .6rem; }
.progress > span { display: block; height: 100%; width: var(--progress); max-width: 100%; background: var(--green); transition: width .45s ease; }
.category-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1.5rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.category-row strong { font-size: .74rem; font-weight: 500; }
.category-row > span { font-size: .75rem; }
.investment-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.investment-summary > div { min-width: 0; padding: 1rem; background: var(--surface-raised); display: grid; gap: .65rem; }
.investment-summary span { color: var(--faint); font-size: .63rem; }
.investment-summary strong { font-size: .88rem; overflow-wrap: anywhere; }

.list { display: grid; }
.list-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item strong { display: block; font-size: .8rem; }
.list-value { text-align: right; font: .76rem var(--money); }
.tag { display: inline-flex; align-items: center; padding: .22rem .42rem; border-radius: 2px; background: var(--surface-soft); color: var(--muted); font-size: .6rem; border: 1px solid var(--line); }
.tag.green { color: var(--green); background: var(--green-soft); border-color: #31533e; }
.tag.amber { color: var(--amber); background: var(--amber-soft); border-color: #5c472c; }
.tag.red { color: var(--red); background: var(--red-soft); border-color: #653a37; }
.empty { padding: 2.4rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-bright); font-size: .75rem; }
.empty strong { display: block; color: var(--text); margin-bottom: .4rem; }

.bar-chart { min-height: 225px; display: flex; align-items: end; gap: clamp(.28rem, .8vw, .65rem); padding: 1rem 0 0; border-bottom: 1px solid var(--line-bright); }
.bar-wrap { flex: 1; min-width: 0; height: 205px; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: .55rem; }
.bar { appearance: none; border: 0; padding: 0; width: 100%; max-width: 28px; min-height: 2px; height: var(--height); border-radius: 0; background: linear-gradient(90deg, #53635a, var(--green)); opacity: .68; position: relative; cursor: help; transition: opacity .18s ease, background .18s ease; }
.bar:hover, .bar:focus-visible { opacity: 1; background: var(--green); }
.bar.negative { background: var(--red); }
.bar::after { content: attr(data-value); position: absolute; left: 50%; top: -2rem; transform: translateX(-50%); width: max-content; max-width: 130px; padding: .3rem .4rem; background: var(--text); color: var(--bg); font: .58rem var(--money); pointer-events: none; opacity: 0; transition: opacity .15s ease; z-index: 4; }
.bar:hover::after, .bar:focus-visible::after { opacity: 1; }
.bar-label { width: 100%; text-align: center; color: var(--faint); font: .55rem var(--money); overflow: hidden; }
.donut-row { display: grid; grid-template-columns: 150px 1fr; gap: 1.5rem; align-items: center; }
.donut { width: 140px; height: 140px; border-radius: 50%; background: conic-gradient(var(--green) 0 var(--portion), #84927a var(--portion) calc(var(--portion) + var(--portion2)), #56615a calc(var(--portion) + var(--portion2)) 100%); display: grid; place-items: center; }
.donut::after { content: ""; width: 82px; height: 82px; background: var(--surface); border-radius: 50%; }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .75rem; }
th { color: var(--faint); text-align: left; font-weight: 500; padding: .75rem; border-bottom: 1px solid var(--line-bright); white-space: nowrap; font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; }
td { padding: .9rem .75rem; border-bottom: 1px solid var(--line); }
td.money { text-align: right; }
.row-actions { display: flex; justify-content: end; gap: .35rem; }
label { display: grid; gap: .45rem; color: #c8cbc7; font-size: .73rem; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--line-bright); border-radius: 2px; background: #0d0f0e; color: var(--text); padding: .68rem .75rem; }
textarea { min-height: 80px; resize: vertical; }
input::placeholder { color: var(--faint); }
.checkbox { display: flex; align-items: start; gap: .65rem; line-height: 1.4; }
.checkbox input { width: 18px; min-height: 18px; margin-top: .05rem; accent-color: var(--green); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.field-hint { color: var(--muted); font-size: .68rem; line-height: 1.5; }
.error-text { color: var(--red); font-size: .75rem; min-height: 1.2em; }
.formula { background: #0d0f0e; border: 1px solid var(--line); padding: 1rem; font: .68rem/1.8 var(--money); color: #b9beb9; }
.formula .line { display: flex; justify-content: space-between; gap: 1rem; }
.formula .total { border-top: 1px solid var(--line-bright); margin-top: .45rem; padding-top: .45rem; color: var(--green); }
.notice { padding: 1rem; border-left: 2px solid var(--amber); background: var(--amber-soft); color: #dfc9a8; font-size: .75rem; line-height: 1.6; }
.notice.risk { border-color: var(--red); background: var(--red-soft); color: #edb4b0; }

dialog { width: min(680px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; border: 1px solid var(--line-bright); border-radius: 0; background: var(--surface-raised); color: var(--text); padding: 0; box-shadow: 0 35px 100px #000d; }
dialog[open] { animation: dialog-in .22s ease both; }
dialog::backdrop { background: rgb(0 0 0 / .74); backdrop-filter: blur(4px); }
.dialog-head { position: sticky; top: 0; z-index: 2; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line); background: var(--surface-raised); display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 0; font: 400 1.45rem Georgia, serif; }
.dialog-body { padding: 1.4rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; padding-top: 1.2rem; }
.welcome { min-height: 100vh; padding: 2rem; display: grid; place-items: center; }
.welcome-wrap { width: min(1080px, 100%); }
.welcome-brand { margin-bottom: 3rem; }
.welcome-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.welcome-card { padding: clamp(1.5rem, 4vw, 3.5rem); background: var(--surface); }
.welcome-card.featured { background: linear-gradient(145deg, #151b18, #111312); }
.welcome h1 { font: 400 clamp(2.8rem, 7vw, 6.5rem)/.9 Georgia, serif; letter-spacing: -.06em; margin: 0 0 1.5rem; max-width: 11ch; }
.welcome-card h2 { margin: 0 0 .8rem; font-weight: 500; }
.welcome-card p { color: var(--muted); line-height: 1.65; }
.privacy-line { margin-top: 3rem; color: var(--faint); font-size: .68rem; text-align: center; }
.onboarding-progress { display: flex; gap: .4rem; margin: 1rem 0 2rem; }
.onboarding-progress span { height: 2px; flex: 1; background: var(--line); }
.onboarding-progress span.done { background: var(--green); }
.mobile-nav { display: none; }
.toast { position: fixed; z-index: 100; right: 1.5rem; bottom: 1.5rem; max-width: min(380px, calc(100% - 2rem)); padding: .9rem 1rem; border-radius: 2px; background: var(--text); color: #111411; box-shadow: 0 20px 50px #0008; font-size: .75rem; animation: toast-in .25s ease both; }
.toast.error { background: #f0c2bf; color: #3b1111; }
@keyframes content-in { from { transform: translateY(7px); opacity: 0; } }
@keyframes number-in { from { transform: translateY(6px); opacity: 0; } }
@keyframes dialog-in { from { transform: translateX(12px); opacity: 0; } }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

@media (min-width: 1280px) {
  .shell { grid-template-columns: 180px minmax(0,1fr); }
  .sidebar { padding-inline: .85rem; }
  .sidebar .brand { justify-content: start; padding-inline: .45rem; }
  .sidebar .brand-copy { display: block; }
  .nav button { min-height: 48px; padding: 0 .65rem; grid-template-columns: 1.4rem 1fr; place-items: center start; gap: .6rem; text-align: left; font-size: .66rem; }
  .side-foot { text-align: left; padding: .5rem; }
  .side-foot > span { display: block; margin-top: .3rem; }
  .local-pill { display: flex; justify-items: initial; }
}
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-col { grid-template-columns: 1fr 1fr; }
  .position-panel { grid-template-columns: 1fr 1fr; }
  .overview-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "bills status" "goals goals" "spending forecast" "investments forecast"; }
}
@media (max-width: 820px) {
  .shell { display: block; padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .workspace { padding: 0 1rem 3rem; }
  .topbar { min-height: 62px; }
  .topbar-mark { display: grid; width: 29px; height: 29px; }
  .mobile-nav { position: fixed; z-index: 50; display: grid; grid-template-columns: repeat(6, 1fr); bottom: 0; left: 0; right: 0; padding: .35rem max(.3rem, env(safe-area-inset-right)) calc(.35rem + env(safe-area-inset-bottom)) max(.3rem, env(safe-area-inset-left)); background: rgb(11 12 12 / .96); backdrop-filter: blur(18px); border-top: 1px solid var(--line-bright); }
  .mobile-nav button { background: transparent; color: var(--faint); min-height: 48px; padding: .2rem; font-size: .6rem; }
  .mobile-nav button span { display: block; font-size: .95rem; margin-bottom: .12rem; }
  .mobile-nav button.active { color: var(--text); border-top: 1px solid var(--accent); }
  .two-col, .hero-grid { grid-template-columns: 1fr; }
  .position-panel { min-height: 0; grid-template-columns: 1fr; background: #111514; }
  .position-main { border-right: 0; border-bottom: 1px solid var(--line); padding-block: 2.2rem; }
  .position-context { padding-block: 1.5rem; }
  .overview-page { display: flex; flex-direction: column; }
  .overview-page .page-head { order: 0; }
  .position-panel { order: 1; }
  .status-strip { order: 2; }
  .ledger-flow { order: 3; }
  .overview-grid { order: 4; }
  .overview-grid { grid-template-columns: 1fr; grid-template-areas: "status" "bills" "goals" "spending" "forecast" "investments"; }
  .welcome { padding: 1rem; align-items: start; }
  .welcome-grid { grid-template-columns: 1fr; }
  .welcome-brand { margin: 1rem 0 2rem; }
}
@media (max-width: 560px) {
  body::before { display: none; }
  .content { padding-top: 1.35rem; }
  .page-head { align-items: start; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
  .page-head h2 { font-size: clamp(2rem, 11vw, 3.1rem); }
  .page-head .button { width: 100%; }
  .metrics, .three-col, .form-grid, .status-strip { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .status-strip { border: 1px solid var(--line); }
  .status-strip .metric { min-height: 94px; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .25rem 1rem; }
  .status-strip .metric:last-child { border-bottom: 0; }
  .status-strip .value { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-size: 1rem; }
  .safe-value { font-size: clamp(2.8rem, 16vw, 4.5rem); }
  .position-context > p:first-child { font-size: 1.35rem; }
  .flow-track { margin-inline: -1.4rem; padding-inline: 1.4rem; }
  .ledger-section { padding: 1.15rem; }
  .bill-row { grid-template-columns: 40px 8px minmax(0,1fr) auto; gap: .55rem; }
  .bill-timeline::before { left: 52px; }
  .bill-action .button { font-size: 0; width: 30px; min-height: 28px; padding: 0; }
  .bill-action .button::after { content: "✓"; font-size: .7rem; }
  .goal-row { gap: .75rem; }
  .goal-distance { align-items: start; flex-direction: column; gap: .25rem; }
  .investment-summary { grid-template-columns: 1fr; }
  .top-actions .button span { display: none; }
  .donut-row { grid-template-columns: 1fr; justify-items: center; }
  .toolbar > * { flex: 1 1 140px; }
  .dialog-body { padding: 1rem; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .bar-chart { min-height: 195px; }
  .bar-wrap { height: 175px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; }
}
@media print {
  .sidebar, .topbar, .mobile-nav, .button, .toolbar { display: none!important; }
  .shell { display: block; } .workspace { padding: 0; } .card, .ledger-section { break-inside: avoid; }
  body::before { display: none; }
}
