/* Manrope, served from this site (SIL Open Font License, fonts/OFL.txt): no font requests to Google. */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('fonts/manrope-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('fonts/manrope-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  color-scheme: dark;
  --ink: #0B0F14;
  --surface: #151B23;
  --surface-2: #1A212B;
  --line: #1F2730;
  --line-2: #2A3440;
  --text: #F3F1EA;
  --body: #C9CED6;
  --muted: #8A94A3;
  --mint: #5EE6A8;
  --mint-wash: rgba(94, 230, 168, 0.10);
  --amber: #F5B548;
  --rose: #FF7A6B;
  --sky: #7DD3FC;
  --lav: #C4B5FD;
  --radius: 18px;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--ink); color: var(--body); font-family: var(--font); font-size: 15px; line-height: 1.45; }
body { min-height: 100vh; }
a { color: var(--mint); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; background: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: -0.3px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--mint); display: grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; }
.nav-btn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--body); font-weight: 600; text-align: left; }
.nav-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; }
.nav-btn:hover { background: var(--surface); color: var(--text); }
.nav-btn[aria-current="page"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-btn[aria-current="page"] svg { stroke: var(--mint); }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; }
.privacy-pill { display: flex; gap: 8px; align-items: flex-start; }
.privacy-pill svg { width: 15px; height: 15px; stroke: var(--mint); fill: none; stroke-width: 2; flex: none; margin-top: 2px; }

.main { padding: 28px 36px 60px; max-width: 1320px; width: 100%; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.greeting { font-size: 13px; color: var(--muted); font-weight: 600; }
.page-title { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -0.6px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--body); }
.chip.mint { color: var(--mint); border-color: rgba(94,230,168,.25); background: var(--mint-wash); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-weight: 700; font-size: 13.5px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--mint); color: var(--ink); border-color: var(--mint); }

.banner { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid rgba(245,181,72,.28); margin-bottom: 20px; flex-wrap: wrap; }
.banner p { color: var(--body); font-size: 14px; }
.banner strong { color: var(--amber); }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; }
.grid.kpis { grid-template-columns: 1.35fr repeat(3, 1fr); margin-bottom: 18px; }
.grid.two { grid-template-columns: 1.4fr 1fr; margin-bottom: 18px; }
.grid.halves { grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.card h2 { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.9px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card h2 .link { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--mint); font-weight: 700; }
.hero-num { font-size: 52px; font-weight: 800; color: var(--mint); letter-spacing: -1.6px; line-height: 1.05; }
.hero-num.over { color: var(--rose); }
.kpi-val { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -0.6px; line-height: 1.15; }
.kpi-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi-sub b { color: var(--body); font-weight: 700; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 14px 0 10px; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--mint); }
.bar.amber > span { background: var(--amber); }
.bar.rose > span { background: var(--rose); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.status-good { color: var(--mint); }
.status-warn { color: var(--amber); }
.status-bad { color: var(--rose); }

/* upcoming strip */
.strip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; }
.strip-day { border-radius: 12px; padding: 10px 8px; background: var(--surface-2); border: 1px solid var(--line); min-height: 104px; display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.strip-day.today { border-color: rgba(94,230,168,.45); }
.strip-dow { font-size: 11px; color: var(--muted); font-weight: 700; text-align: center; text-transform: uppercase; }
.strip-date { font-size: 16px; color: var(--text); font-weight: 800; text-align: center; }
.strip-day.today .strip-date { color: var(--mint); }
.tag { font-size: 11px; font-weight: 800; border-radius: 7px; padding: 3px 4px; text-align: center; background: var(--line); color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag .compact { display: none; }
.tag.pay { background: var(--mint-wash); color: var(--mint); box-shadow: inset 0 0 0 1px rgba(94,230,168,.3); }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head .title { color: var(--text); font-weight: 800; font-size: 16px; }
.icon-btn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 11px; color: var(--muted); font-weight: 800; text-align: center; padding-bottom: 2px; }
.cal-cell { aspect-ratio: 1.25 / 1; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); padding: 6px 7px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; position: relative; }
.cal-cell .d { font-size: 12px; font-weight: 800; color: var(--text); }
.cal-cell .v { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-cell.under { background: rgba(94,230,168,.09); border-color: rgba(94,230,168,.28); }
.cal-cell.close { background: rgba(245,181,72,.10); border-color: rgba(245,181,72,.32); }
.cal-cell.over { background: rgba(255,122,107,.12); border-color: rgba(255,122,107,.38); }
.cal-cell.under .v { color: var(--mint); } .cal-cell.close .v { color: var(--amber); } .cal-cell.over .v { color: var(--rose); }
.cal-cell.future { opacity: .45; }
.cal-cell.today { box-shadow: 0 0 0 2px var(--mint); }
.cal-cell.empty { background: transparent; border-color: transparent; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* lists */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.row:first-child { border-top: 0; }
.row .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.row .ic svg { width: 16px; height: 16px; stroke: var(--body); fill: none; stroke-width: 1.8; }
.row .grow { flex: 1; min-width: 0; }
.row .t { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { font-weight: 800; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .amt.in { color: var(--mint); }
/* Moved to savings or investing: leaves checking, still yours. */
.row .amt.move { color: var(--sky); }
.tag.move { color: var(--sky); box-shadow: inset 0 0 0 1px rgba(125,211,252,.3); }
.note { font-size: 12.5px; color: var(--amber); margin-top: 3px; white-space: normal; }

/* category bars */
.cat-row { display: grid; grid-template-columns: 110px 1fr 84px; gap: 12px; align-items: center; padding: 7px 0; }
.cat-row .name { color: var(--body); font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-track { height: 14px; position: relative; }
.cat-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--mint); min-width: 3px; }
.cat-row .val { text-align: right; color: var(--text); font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* sankey */
.flow svg { width: 100%; height: auto; display: block; }
.flow text { font-family: var(--font); }

/* table */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.input, select.input { background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 11px; padding: 9px 12px; font: inherit; font-size: 14px; }
.input:focus { outline: 2px solid rgba(94,230,168,.5); outline-offset: 1px; }
.search { flex: 1; min-width: 200px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 800; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; cursor: pointer; user-select: none; }
th.r, td.r { text-align: right; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--body); white-space: nowrap; }
td.t { color: var(--text); font-weight: 700; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
td.amt { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
td.amt.in { color: var(--mint); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 800; background: var(--line); color: var(--body); }
.pill.mint { background: var(--mint-wash); color: var(--mint); }
.totals { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.totals b { color: var(--text); }

/* paycheck columns */
.cols { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; border-bottom: 1px solid var(--line-2); }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.col .colbar { width: min(24px, 80%); border-radius: 4px 4px 0 0; background: var(--mint); min-height: 3px; }
.col.projected .colbar { background: transparent; box-shadow: inset 0 0 0 2px rgba(94,230,168,.55); }
.col-labels { display: flex; gap: 6px; margin-top: 6px; }
.col-labels span { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.kv:first-child { border-top: 0; }
.kv .k { color: var(--body); font-weight: 700; }
.kv .v { color: var(--text); font-weight: 800; text-align: right; }

.progress-row { padding: 12px 0; border-top: 1px solid var(--line); }
.progress-row:first-child { border-top: 0; }
.progress-row .top { display: flex; justify-content: space-between; gap: 10px; }
.progress-row .top b { color: var(--text); }

/* tooltip */
.tip { position: fixed; z-index: 50; pointer-events: none; background: #0F141B; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; color: var(--body); box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 260px; opacity: 0; transition: opacity .1s; }
.tip b { color: var(--text); }
.tip.on { opacity: 1; }

/* sign-in */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { max-width: 520px; width: 100%; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 38px 32px; }
.gate-card h1 { color: var(--text); font-size: 30px; font-weight: 800; letter-spacing: -0.8px; margin: 18px 0 10px; }
.gate-card p { color: var(--body); margin-bottom: 18px; }
.gate-points { text-align: left; display: grid; gap: 10px; margin: 18px 0 24px; }
.gate-points div { display: flex; gap: 10px; color: var(--body); font-size: 14px; }
.gate-points svg { width: 18px; height: 18px; stroke: var(--mint); fill: none; stroke-width: 2; flex: none; margin-top: 1px; }
#apple-sign-in-button { display: flex; justify-content: center; min-height: 44px; }
.loading { color: var(--muted); font-weight: 700; }
.error { color: var(--rose); font-weight: 700; margin-top: 10px; }

.empty-state { padding: 30px 10px; text-align: center; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid.kpis { grid-template-columns: 1fr 1fr; }
  .strip { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .strip-day:nth-child(n+8) { display: none; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; z-index: 20; flex-direction: row; align-items: center; padding: 10px 12px; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 10px 0 4px; font-size: 16px; }
  .brand span { display: none; }
  .nav-btn { padding: 8px 10px; white-space: nowrap; font-size: 13.5px; }
  .sidebar-foot { display: none; }
  .grid.two, .grid.halves { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 48px; }
}
@media (max-width: 560px) {
  .grid.kpis { grid-template-columns: 1fr; }
  .hero-num { font-size: 44px; }
  .strip { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .strip-day { min-height: 92px; padding: 6px 3px; }
  .tag { font-size: 10px; padding: 2px; }
  .tag .full { display: none; } .tag .compact { display: inline; }
  .cal { gap: 4px; }
  .cal-cell { padding: 4px; border-radius: 8px; }
  .cal-cell .v { font-size: 10px; }
  .cat-row { grid-template-columns: 84px 1fr 72px; }
  .nav-btn svg { display: none; }
}
@media (forced-colors: active) {
  .cal-cell.under, .cal-cell.close, .cal-cell.over { border-width: 2px; }
}

/* ---------- goals & net worth ---------- */
.grid.thirds { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.habit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.habit .progress-row { border-top: 0; padding-top: 0; }
.inline-ic { width: 15px; height: 15px; stroke: var(--mint); fill: none; stroke-width: 1.9; vertical-align: -2px; margin-right: 4px; }
.streak { color: var(--amber); font-weight: 800; white-space: nowrap; }
.streak .inline-ic { stroke: var(--amber); margin-right: 3px; }
.cols.short { height: 96px; }
.col .colbar.amber { background: var(--amber); }
.col .colbar.none { background: var(--line-2); }
.num.status-good, .num.status-bad { font-weight: 800; }
.nw-chart { width: 100%; display: block; margin-top: 10px; overflow: visible; }
.nw-chart .grid-line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.nw-chart .axis { fill: var(--muted); font-size: 11px; font-weight: 700; font-family: inherit; }
@media (max-width: 1180px) { .grid.thirds { grid-template-columns: 1fr 1fr; } }
@media (max-width: 980px) { .grid.thirds { grid-template-columns: 1fr; } .habit-grid { grid-template-columns: 1fr; } }
.grid.kpis.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid.kpis.three { grid-template-columns: 1fr; } }
.error { font-weight: 600; line-height: 1.45; }
.error-code { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.tag.budget { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 700; }
.row .amt.muted { color: var(--muted); font-weight: 700; }
.pill.amber { background: rgba(245,181,72,.12); color: var(--amber); }
.card.clickable { cursor: pointer; transition: border-color .15s; }
.card.clickable:hover { border-color: var(--line-2); }
.row.subtotal { background: rgba(11,15,20,.45); margin: 4px -12px; padding: 11px 12px; border-radius: 10px; border-top: 0; }
.row.subtotal .t { color: var(--text); }
.row.subtotal.hi { background: var(--mint-wash); }
.row.subtotal.hi .t, .row.subtotal.hi .amt { color: var(--mint); }

/* How your pay splits */
.split-card { margin-bottom: 18px; }
.split-bar { display: flex; gap: 2px; height: 12px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 6px 0 16px; }
.split-bar > span { display: block; height: 100%; border-radius: 3px; }
.split-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.split-row { display: flex; gap: 10px; align-items: flex-start; }
.split-row .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.split-row .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--text); }
.split-row .t .amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.split-row .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 720px) { .split-rows { grid-template-columns: 1fr; } }

/* Spending plan */
.card h2 .head-amt { margin-left: auto; text-transform: none; letter-spacing: 0; color: var(--text); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.card h2 .head-amt + .link { margin-left: 4px; }
.target-bar { position: relative; height: 12px; border-radius: 99px; background: var(--ink); margin: 2px 0 8px; overflow: hidden; }
.target-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.target-bar .band { position: absolute; top: 0; bottom: 0; border: 1.5px solid rgba(243,241,234,.75); border-radius: 4px; }
.rows.wrap .s { white-space: normal; overflow: visible; }
.row .amt small { display: block; text-align: right; font-size: 12px; font-weight: 700; color: var(--muted); }
.rows.jobs { margin-top: 12px; padding-top: 4px; border-top: 1px dashed var(--line-2); }
.sub-h { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin: 14px 0 2px; }
.plan-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.plan-cell { display: flex; gap: 8px; align-items: flex-start; }
.plan-cell .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.plan-cell .s { font-size: 12.5px; color: var(--muted); }
.plan-cell .v { font-size: 22px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.plan-cell .v.status-warn { color: var(--amber); } .plan-cell .v.status-bad { color: var(--rose); }
@media (max-width: 720px) { .plan-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
