/* Money — iOS-style design system.
   Tokens follow Apple's Human Interface Guidelines (system colors, grouped backgrounds, type ramp). */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* backgrounds */
  --bg: #f2f2f7;                 /* systemGroupedBackground */
  --bg-2: #ffffff;               /* secondarySystemGroupedBackground */
  --bg-3: #f2f2f7;               /* tertiarySystemGroupedBackground */
  --bg-elevated: #ffffff;
  --label: #000000;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --label-4: rgba(60, 60, 67, .18);
  --separator: rgba(60, 60, 67, .29);
  --fill: rgba(120, 120, 128, .2);
  --fill-2: rgba(120, 120, 128, .16);
  --fill-3: rgba(118, 118, 128, .12);
  --fill-4: rgba(116, 116, 128, .08);
  --glass: rgba(255, 255, 255, .72);
  --glass-solid: rgb(250, 250, 252);   /* the glass, without the live blur (under a sheet) */
  --bar-solid: rgb(244, 244, 248);
  --glass-edge: rgba(255, 255, 255, .7);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .06);
  --bar: rgba(242, 242, 247, .78);
  --scrim: rgba(0, 0, 0, .22);
  --sheet-bg: #f2f2f7;
  --sheet-row: #ffffff;

  /* system colors */
  --red: #ff3b30; --orange: #ff9500; --yellow: #ffcc00; --green: #34c759; --mint: #00c7be;
  --teal: #30b0c7; --cyan: #32ade6; --blue: #007aff; --indigo: #5856d6; --purple: #af52de;
  --pink: #ff2d55; --brown: #a2845e; --gray: #8e8e93;
  --tint: var(--blue);
  --positive: #248a3d;           /* accessible green for text on white */
  --negative: #d70015;

  /* Fitness ring colors (same in both modes — the ring card is always black) */
  --ring-move: #fa114f; --ring-move-2: #ff4f7e;
  --ring-exercise: #92e82a; --ring-exercise-2: #c2ff5a;
  --ring-stand: #1eeaef; --ring-stand-2: #5ef6ff;

  --radius-card: 22px;
  --radius-row: 12px;
  --radius-sheet: 34px;
  --gutter: 16px;
  --nav-h: 52px;
  --tab-h: 64px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  --ease: cubic-bezier(.2, .9, .25, 1);
  --spring: cubic-bezier(.2, .9, .25, 1.05);
  --spring-bounce: cubic-bezier(.3, 1.4, .5, 1);
  --dur: 520ms;
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.0317, 0.1091, 0.2113, 0.3233, 0.4351, 0.54, 0.6344, 0.7165, 0.7858, 0.8429, 0.8888, 0.9247, 0.9522, 0.9727, 0.9874, 0.9976, 1.0042, 1.0082, 1.0103, 1.0111, 1.0109, 1.0101, 1.009, 1.0078, 1.0066, 1.0054, 1.0043, 1.0034, 1.0026, 1.0019, 1.0013, 1);
    --spring-bounce: linear(0, 0.0461, 0.1592, 0.3074, 0.4662, 0.6184, 0.753, 0.8642, 0.9503, 1.012, 1.0523, 1.0746, 1.0831, 1.0816, 1.0735, 1.0618, 1.0486, 1.0356, 1.0239, 1.014, 1.0061, 1.0004, 0.9965, 0.9942, 0.9932, 0.9931, 0.9936, 0.9945, 0.9956, 0.9967, 0.9977, 0.9986, 1);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-2: #1c1c1e;
    --bg-3: #2c2c2e;
    --bg-elevated: #1c1c1e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --label-4: rgba(235, 235, 245, .16);
    --separator: rgba(84, 84, 88, .6);
    --fill: rgba(120, 120, 128, .36);
    --fill-2: rgba(120, 120, 128, .32);
    --fill-3: rgba(118, 118, 128, .24);
    --fill-4: rgba(118, 118, 128, .18);
    --glass: rgba(37, 37, 40, .66);
    --glass-solid: rgb(38, 38, 41);
    --bar-solid: rgb(12, 12, 13);
    --glass-edge: rgba(255, 255, 255, .12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .4);
    --bar: rgba(0, 0, 0, .7);
    --scrim: rgba(0, 0, 0, .5);
    --sheet-bg: #1c1c1e;
    --sheet-row: #2c2c2e;
    --red: #ff453a; --orange: #ff9f0a; --yellow: #ffd60a; --green: #30d158; --mint: #63e6e2;
    --teal: #40c8e0; --cyan: #64d2ff; --blue: #0a84ff; --indigo: #5e5ce6; --purple: #bf5af2;
    --pink: #ff375f; --brown: #ac8e68; --gray: #8e8e93;
    --positive: #30d158;
    --negative: #ff453a;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { touch-action: manipulation; } /* no double-tap zoom: it's an app, not a page */
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--label);
  font: 400 17px/1.29 var(--font); letter-spacing: -.41px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow: hidden; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
a { color: var(--tint); text-decoration: none; }
svg { display: block; }
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; border-radius: 10px; }

/* type ramp */
.t-large { font: 700 34px/41px var(--font-display); letter-spacing: .37px; }
.t-title1 { font: 700 28px/34px var(--font-display); letter-spacing: .36px; }
.t-title2 { font: 700 22px/28px var(--font-display); letter-spacing: .35px; }
.t-title3 { font: 600 20px/25px var(--font-display); letter-spacing: .38px; }
.t-headline { font: 600 17px/22px var(--font); letter-spacing: -.41px; }
.t-sub { font: 400 15px/20px var(--font); letter-spacing: -.24px; }
.t-foot { font: 400 13px/18px var(--font); letter-spacing: -.08px; }
.t-cap { font: 400 12px/16px var(--font); letter-spacing: 0; }
.t-cap2 { font: 500 11px/13px var(--font); letter-spacing: .06px; }
.muted { color: var(--label-2); }
.faint { color: var(--label-3); }
.pos { color: var(--positive); }
.neg { color: var(--negative); }

/* ---------- app frame ---------- */
#app { position: fixed; inset: 0; }
.pages { position: absolute; inset: 0; }
.page { position: absolute; inset: 0; visibility: hidden; }
.page.active { visibility: visible; z-index: 1; }
/* Switching tabs swaps instantly, like iOS; the new page just fades up its content (one GPU layer). */
.page.entering .scroller { animation: pageIn 160ms ease-out both; }
@keyframes pageIn { from { opacity: 0; } }
.scroller {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain; scroll-padding-top: calc(var(--sat) + var(--nav-h));
  padding: calc(var(--sat) + var(--nav-h)) calc(var(--sar) + var(--gutter)) calc(var(--sab) + var(--tab-h) + 40px) calc(var(--sal) + var(--gutter));
}
.content { max-width: 760px; margin: 0 auto; }

/* nav bar: transparent at rest, frosted once the large title scrolls under it */
.navbar {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  height: calc(var(--sat) + var(--nav-h)); padding: var(--sat) calc(var(--sar) + 12px) 0 calc(var(--sal) + 12px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; pointer-events: none;
}
.navbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 200ms ease;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-bottom: .5px solid var(--separator);
}
.navbar.scrolled::before { opacity: 1; }
.navbar .nav-title { grid-column: 2; font: 600 17px/22px var(--font); letter-spacing: -.41px; opacity: 0; transform: translateY(6px); transition: opacity 200ms ease, transform 300ms var(--spring); white-space: nowrap; }
.navbar.scrolled .nav-title { opacity: 1; transform: none; }
.navbar .nav-left { grid-column: 1; justify-self: start; display: flex; gap: 8px; pointer-events: auto; }
.navbar .nav-right { grid-column: 3; justify-self: end; display: flex; gap: 8px; pointer-events: auto; }

.large-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 2px 4px 14px; transform-origin: left center; }
.large-title h1 { margin: 0; }
.large-title .sub { color: var(--label-2); font: 400 15px/20px var(--font); margin-bottom: 6px; }

/* circular glass buttons (iOS 26 nav bar style) */
.glass-btn {
  pointer-events: auto; width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 0 0 .5px var(--glass-edge), 0 2px 10px rgba(0, 0, 0, .06); color: var(--label); font-size: 19px;
  transition: transform 300ms var(--spring-bounce), background 200ms;
}
.glass-btn:active { transform: scale(.88); }
.glass-btn.tint { color: var(--tint); }
.glass-btn.wide { width: auto; padding: 0 16px; font: 600 16px/1 var(--font); gap: 6px; display: inline-flex; align-items: center; }
.glass-btn .badge-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 9px; background: var(--orange); box-shadow: 0 0 0 2px var(--bg); }
.glass-btn { position: relative; }

/* ---------- floating tab bar ---------- */
.tabbar {
  position: fixed; z-index: 20; left: 50%; bottom: max(10px, calc(var(--sab) - 8px)); transform: translateX(-50%);
  width: min(336px, calc(100% - 32px - var(--sal) - var(--sar))); height: var(--tab-h); padding: 5px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: saturate(190%) blur(28px); backdrop-filter: saturate(190%) blur(28px);
  box-shadow: inset 0 0 0 .5px var(--glass-edge), var(--glass-shadow);
}
.tab {
  position: relative; border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--label); font: 600 10.5px/1 var(--font); letter-spacing: .1px; transition: color 200ms;
}
.tab .icon { font-size: 25px; stroke-width: 1.9; }
.tab[aria-selected="true"] { color: var(--tint); }
.tab-lens { position: absolute; z-index: -1; top: 5px; bottom: 5px; left: 5px; border-radius: 999px; background: var(--fill-3); transition: transform 480ms var(--spring-bounce), width 480ms var(--spring); }
.tab:active .icon { transform: scale(.88); }
.tab .icon { transition: transform 300ms var(--spring-bounce); }

/* ---------- cards & lists ---------- */
.card { background: var(--bg-2); border-radius: var(--radius-card); padding: 16px; margin-bottom: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 10px; }
.section-head h2 { margin: 0; font: 700 22px/28px var(--font-display); letter-spacing: .35px; }
.section-head .more { color: var(--label-2); font: 400 15px/20px var(--font); }
.list-head { margin: 22px 20px 7px; font: 400 13px/18px var(--font); color: var(--label-2); text-transform: uppercase; letter-spacing: -.08px; display: flex; justify-content: space-between; }
.list-foot { margin: 7px 20px 0; font: 400 13px/18px var(--font); color: var(--label-2); }
.list { background: var(--bg-2); border-radius: var(--radius-card); overflow: hidden; margin-bottom: 4px; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 16px; text-align: left;
  transition: background 150ms;
}
button.row:active, a.row:active, .row.tap:active { background: var(--fill-3); }
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: var(--sep-left, 16px); border-top: .5px solid var(--separator); }
.row.with-icon { --sep-left: 62px; }
.row .main { flex: 1; min-width: 0; display: block; }
.row .title, .row .subtitle, .row .value, .row .value-sub, .row .pctbar { display: block; }
.row .title { font: 400 17px/22px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .subtitle { font: 400 15px/20px var(--font); color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .value { font: 400 17px/22px var(--font); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row .value-sub { font: 400 13px/18px var(--font); color: var(--label-2); text-align: right; font-variant-numeric: tabular-nums; }
.row .detail { color: var(--label-2); white-space: nowrap; }
.row .chev { color: var(--label-3); font-size: 14px; stroke-width: 2.6; }
.row.destructive .title { color: var(--red); }
.row.action .title { color: var(--tint); }
.row.disabled { opacity: .45; pointer-events: none; }

/* iOS-Settings-style category icon */
.cat-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; font-size: 19px; background: var(--c, var(--gray)); }
.cat-icon .icon { stroke-width: 2.1; }
.cat-icon.lg { width: 64px; height: 64px; border-radius: 17px; font-size: 34px; }
.cat-icon.sm { width: 28px; height: 28px; border-radius: 7px; font-size: 16px; }

/* segmented control */
.segmented {
  position: relative; display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; padding: 2px; border-radius: 10px; background: var(--fill-3); margin-bottom: 14px; isolation: isolate;
}
.segmented button { position: relative; z-index: 1; height: 32px; font: 500 13px/1 var(--font); letter-spacing: -.08px; border-radius: 8px; transition: transform 200ms var(--spring-bounce); }
.segmented button[aria-pressed="true"] { font-weight: 600; }
.segmented button:active { transform: scale(.96); }
.segmented .thumb { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; border-radius: 8px; background: var(--bg-elevated); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); transition: transform 420ms var(--spring); }
@media (prefers-color-scheme: dark) { .segmented .thumb { background: #636366; } }
.segmented.capsule { border-radius: 999px; }
.segmented.capsule button, .segmented.capsule .thumb { border-radius: 999px; }

/* Stocks-style range picker */
.ranges { display: flex; justify-content: space-between; gap: 4px; margin-top: 10px; }
.ranges button { flex: 1; height: 30px; border-radius: 8px; font: 600 13px/1 var(--font); color: var(--label-2); transition: background 200ms, color 200ms, transform 200ms var(--spring-bounce); }
.ranges button[aria-pressed="true"] { background: var(--fill-3); color: var(--label); }
.ranges button:active { transform: scale(.94); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: 999px;
  font: 600 17px/1 var(--font); letter-spacing: -.41px; background: var(--tint); color: #fff; width: 100%;
  transition: transform 300ms var(--spring-bounce), opacity 200ms, background 200ms;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.secondary { background: var(--fill-3); color: var(--tint); }
.btn.plain { background: none; color: var(--tint); height: 44px; }
.btn.destructive { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.btn.small { height: 34px; padding: 0 16px; font-size: 15px; width: auto; }
.btn-row { display: grid; gap: 10px; margin-top: 16px; }

/* inputs */
.field { display: block; width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--fill-3); font: 400 17px/1 var(--font); outline: none; -webkit-appearance: none; appearance: none; }
.field:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 35%, transparent); }
.field::placeholder { color: var(--label-3); }
.row input.inline { border: 0; background: none; outline: none; text-align: right; font: inherit; color: var(--label-2); width: 8em; min-width: 0; flex: none; }
.row input.inline:focus { color: var(--label); }
.search { position: relative; margin: 0 0 14px; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--label-2); font-size: 17px; }
.search input { width: 100%; height: 38px; border: 0; border-radius: 12px; background: var(--fill-3); padding: 0 32px 0 34px; font: 400 17px/1 var(--font); outline: none; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--label-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 20px; background: var(--label-3); color: var(--bg); display: grid; place-items: center; }
.search .clear .icon { position: static; transform: none; font-size: 10px; color: inherit; stroke-width: 3.4; }

/* iOS switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 31px; background: var(--fill); transition: background 250ms; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 27px; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); transition: transform 350ms var(--spring-bounce), width 200ms; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:active + span::after { width: 33px; }
.switch input:checked:active + span::after { transform: translateX(14px); }

/* ---------- overview ---------- */
.hero { padding: 4px 4px 0; }
.hero .eyebrow { font: 600 15px/20px var(--font); color: var(--label-2); }
.hero .big { font: 700 44px/1.1 var(--font-display); letter-spacing: -.5px; margin: 2px 0 4px; }
.hero .change { font: 600 15px/20px var(--font); font-variant-numeric: tabular-nums; min-height: 20px; display: flex; gap: 6px; align-items: center; }
.hero .change .when { color: var(--label-2); font-weight: 400; }
.chart-wrap { position: relative; margin: 10px -4px 0; touch-action: pan-y; -webkit-user-select: none; user-select: none; cursor: crosshair; }
.chart-wrap svg { width: 100%; overflow: visible; }
.chart-axis { font: 500 11px/1 var(--font); fill: var(--label-2); font-variant-numeric: tabular-nums; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: 14px 14px 13px; position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; border-left: .5px solid var(--separator); }
.stat .k { font: 400 13px/18px var(--font); color: var(--label-2); display: flex; align-items: center; gap: 5px; }
.stat .v { font: 600 20px/25px var(--font-display); letter-spacing: .1px; margin-top: 2px; white-space: nowrap; }
.stat .dot { width: 8px; height: 8px; border-radius: 8px; background: var(--c); }

.insights { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scrollbar-width: none; scroll-padding: 0 var(--gutter); }
.insights::-webkit-scrollbar { display: none; }
.insight {
  flex: 0 0 min(84%, 340px); scroll-snap-align: start; background: var(--bg-2); border-radius: var(--radius-card); padding: 16px 16px 18px; min-height: 172px;
  display: flex; flex-direction: column; gap: 6px; transition: transform 300ms var(--spring-bounce);
}
.insight { border: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.insight:active { transform: scale(.97); }
.insight .kicker .chev { margin-left: auto; color: var(--label-3); font-size: 14px; stroke-width: 2.6; }
@media (hover: hover) { .insight:hover { box-shadow: 0 0 0 1px var(--separator); } }
/* insight detail */
.ins-hero { padding: 4px 4px 16px; }
.ins-hero .kicker { display: flex; align-items: center; gap: 8px; font: 600 13px/18px var(--font); color: color-mix(in srgb, var(--c) 72%, var(--label)); text-transform: uppercase; letter-spacing: .2px; }
.ins-hero .kicker .icon { font-size: 16px; stroke-width: 2.4; }
.ins-hero h1 { margin: 6px 0 6px; font: 700 28px/34px var(--font-display); letter-spacing: .36px; }
.ins-hero p { margin: 0; color: var(--label-2); font: 400 17px/22px var(--font); }
.card-title { font: 600 15px/20px var(--font); margin-bottom: 4px; }
.ins-card .chart-wrap { margin: 0; cursor: default; }
.chart-readout { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 30px; margin: 2px 0 6px; }
.chart-readout .k { font: 400 13px/18px var(--font); color: var(--label-2); }
.chart-readout .v { font: 700 22px/28px var(--font-display); letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-grid .tile { background: var(--sheet-row, var(--bg-2)); border-radius: 16px; padding: 12px 12px 11px; min-width: 0; }
.stat-grid .k { font: 400 13px/17px var(--font); color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-grid .v { font: 600 19px/24px var(--font-display); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stat-grid .s { font: 400 12px/16px var(--font); color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insight .kicker { display: flex; align-items: center; gap: 8px; font: 600 13px/18px var(--font); color: color-mix(in srgb, var(--c) 72%, var(--label)); text-transform: uppercase; letter-spacing: .2px; }
.insight .kicker .icon, .ins-hero .kicker .icon { font-size: 16px; stroke-width: 2.4; color: var(--c); }
.insight .kicker .chev { color: var(--label-3); }
.insight h3 { margin: 4px 0 0; font: 700 22px/27px var(--font-display); letter-spacing: .3px; }
.insight p { margin: 0; color: var(--label-2); font: 400 15px/20px var(--font); }
.insight-list { display: grid; gap: 12px; padding-top: 4px; }
.insight-list .insight { flex: none; min-height: 0; background: var(--sheet-row, var(--bg-2)); }
.section-head .more.link { border: 0; background: none; padding: 0; color: var(--tint); font: 400 17px/22px var(--font); cursor: pointer; }
.dots { display: flex; justify-content: center; gap: 7px; margin: 10px 0 0; }
.dots i { width: 7px; height: 7px; border-radius: 7px; background: var(--label-4); transition: background 200ms, width 300ms var(--spring); }
.dots i.on { background: var(--label-2); }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-card); background: var(--bg-2); margin-bottom: 14px; }
.banner .ic { width: 36px; height: 36px; border-radius: 36px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--orange)) 16%, transparent); color: var(--c, var(--orange)); font-size: 18px; flex: none; }
.banner .txt { flex: 1; min-width: 0; }
.banner .txt b { display: block; font: 600 15px/20px var(--font); }
.banner .txt span { font: 400 13px/18px var(--font); color: var(--label-2); }

/* ---------- spending ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.pager .lbl { flex: 1; text-align: center; font: 600 17px/22px var(--font); padding: 8px; border-radius: 12px; }
.pager .lbl:active { background: var(--fill-3); }
.pager .lbl small { display: block; font: 400 13px/16px var(--font); color: var(--label-2); }
.pager .arrow { width: 40px; height: 40px; border-radius: 40px; display: grid; place-items: center; color: var(--tint); background: var(--bg-2); font-size: 16px; transition: transform 250ms var(--spring-bounce), opacity 200ms; }
.pager .arrow .icon { stroke-width: 2.6; }
.pager .arrow:active { transform: scale(.88); }
.pager .arrow:disabled { opacity: .3; }
.spent-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.spent-head .big { font: 700 34px/1.1 var(--font-display); letter-spacing: .2px; }
.spent-head .k { font: 400 15px/20px var(--font); color: var(--label-2); }
.spent-head .cmp { text-align: right; font: 400 13px/18px var(--font); color: var(--label-2); }
.spent-head .cmp b { display: block; font: 600 15px/20px var(--font); color: var(--label); }
.spent-head .cmp b.neg { color: var(--negative); }
.spent-head .cmp b.pos { color: var(--positive); }
.stackbar { display: flex; gap: 2px; height: 14px; border-radius: 8px; overflow: hidden; margin: 2px 0 6px; background: var(--fill-4); }
.stackbar i { display: block; height: 100%; background: var(--c); transform-origin: left; animation: grow 700ms var(--spring) both; min-width: 3px; }
@keyframes grow { from { transform: scaleX(0); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font: 400 13px/18px var(--font); color: var(--label-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.pctbar { height: 4px; border-radius: 4px; background: var(--fill-3); margin-top: 6px; overflow: hidden; }
.pctbar i { display: block; height: 100%; border-radius: 4px; background: var(--c); transform-origin: left; animation: grow 700ms var(--spring) both; }
.rank { width: 22px; text-align: center; color: var(--label-2); font: 600 15px/1 var(--font); font-variant-numeric: tabular-nums; flex: none; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 22px; background: var(--fill-3); font: 600 12px/1 var(--font); color: var(--label-2); font-variant-numeric: tabular-nums; }
.chip.warn { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.chip.ok { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--positive); }
.chip.bad { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--negative); }

/* ---------- activity ---------- */
.day { content-visibility: auto; contain-intrinsic-size: auto 260px; }
.day .list-head { text-transform: none; font: 600 15px/20px var(--font); color: var(--label); margin: 20px 4px 8px; }
.day .list-head span:last-child { color: var(--label-2); font-weight: 400; font-variant-numeric: tabular-nums; }
.txn .title { font-weight: 400; }
.txn .value.in { color: var(--positive); }
.txn.netted .title, .txn.netted .value { color: var(--label-3); text-decoration: line-through; }
.filters { display: flex; gap: 8px; margin: -4px 0 6px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { height: 32px; padding: 0 14px; border-radius: 32px; background: var(--bg-2); font: 500 15px/1 var(--font); white-space: nowrap; transition: transform 250ms var(--spring-bounce), background 200ms, color 200ms; }
.filters button[aria-pressed="true"] { background: var(--label); color: var(--bg-2); }
.filters button:active { transform: scale(.94); }
.empty { text-align: center; padding: 48px 24px; color: var(--label-2); }
.empty .ic { font-size: 44px; color: var(--label-3); margin: 0 auto 12px; width: 44px; }
.empty h3 { color: var(--label); margin: 0 0 6px; font: 600 20px/25px var(--font-display); }
.empty p { margin: 0 auto 18px; max-width: 320px; font: 400 15px/20px var(--font); }

/* ---------- plan ---------- */
.rings-card { background: #000; color: #fff; border-radius: var(--radius-card); padding: 18px; margin-bottom: 14px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
@media (prefers-color-scheme: dark) { .rings-card { background: #1c1c1e; } }
.rings-card svg { width: 148px; height: 148px; }
.ring-legend { display: grid; gap: 10px; }
.ring-legend .k { font: 600 13px/16px var(--font-rounded); letter-spacing: .4px; text-transform: uppercase; color: var(--c); }
.ring-legend .v { font: 600 22px/26px var(--font-rounded); font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.ring-legend .v small { font: 600 15px/1 var(--font-rounded); color: rgba(235, 235, 245, .6); }
.ring-arc { transition: stroke-dashoffset 1.1s var(--spring); }
.plan-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.plan-pills .card { margin: 0; padding: 12px 14px; }
.plan-pills .k { font: 400 13px/18px var(--font); color: var(--label-2); }
.plan-pills .v { font: 600 20px/25px var(--font-display); }
.budget-row .bar { height: 8px; border-radius: 8px; background: var(--fill-3); overflow: hidden; margin-top: 8px; position: relative; }
.budget-row .bar i { display: block; height: 100%; border-radius: 8px; background: var(--c, var(--green)); transform-origin: left; animation: grow 800ms var(--spring) both; }
.budget-row .row-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.budget-row .left { font: 400 13px/18px var(--font); color: var(--label-2); font-variant-numeric: tabular-nums; text-align: right; }
.budget-row { display: block; width: 100%; text-align: left; }
.budget-row .bar, .budget-row .left { display: block; }
.budget-row .left { margin-top: 6px; }
.budget-row .row-top .title { white-space: normal; }
/* month-by-month table */
.month-table .row { gap: 8px; }
.month-table .mt-c { flex: none; width: 84px; text-align: right; font: 400 17px/22px var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.month-table .mt-c small { display: block; font: 400 12px/15px var(--font); color: var(--label-3); }
.month-table .mt-head { min-height: 0; padding-top: 12px; padding-bottom: 8px; }
.month-table .mt-head, .month-table .mt-head .mt-c { font: 600 13px/16px var(--font); color: var(--label-2); text-transform: uppercase; letter-spacing: -.08px; }
.month-table .mt-head .mt-c small { text-transform: none; font-weight: 400; }
.month-table .mt-foot .mt-c, .month-table .mt-foot .title { font-weight: 600; }
.mt-sel { background: color-mix(in srgb, var(--tint) 10%, transparent); }
@media (max-width: 370px) { .month-table .mt-c { width: 72px; font-size: 15px; } }
.note { font: 400 13px/18px var(--font); color: var(--label-2); margin: 8px 4px 0; }
.preview-tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 26px; background: color-mix(in srgb, var(--indigo) 16%, transparent); color: var(--indigo); font: 600 13px/1 var(--font); }

/* ---------- sheets ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; transition: opacity 380ms ease; }
.sheet-scrim.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 41; left: 8px; right: 8px; bottom: max(8px, var(--sab)); max-height: calc(100% - var(--sat) - 24px);
  background: var(--sheet-bg); border-radius: var(--radius-sheet); display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 -2px 40px rgba(0, 0, 0, .18); transform: translateY(calc(100% + 40px)); transition: transform var(--dur) var(--spring); will-change: transform;
}
.sheet .list, .sheet .card { background: var(--sheet-row); }
.sheet .field, .sheet .sheet-head .glass-btn { background: var(--fill-3); }
.sheet.full { height: calc(100% - var(--sat) - 24px); }
.sheet.open { transform: none; }
.sheet.dragging { transition: none; }
.sheet .grabber { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 36px; height: 5px; border-radius: 5px; background: var(--label-3); z-index: 2; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 16px 14px 8px; min-height: 60px; flex: none; touch-action: none; }
.sheet-head h2 { grid-column: 2; margin: 0; font: 600 17px/22px var(--font); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62vw; }
.sheet-head .l { grid-column: 1; justify-self: start; }
.sheet-head .r { grid-column: 3; justify-self: end; }
.sheet-head .glass-btn { background: var(--fill-3); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; width: 36px; height: 36px; font-size: 15px; color: var(--label-2); }
.sheet-head .glass-btn .icon { stroke-width: 2.6; }
.sheet-head .text-btn { color: var(--tint); font: 600 17px/1 var(--font); padding: 8px 6px; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 16px calc(24px + var(--sab)); }
.sheet-hero { text-align: center; padding: 6px 8px 18px; }
.sheet-hero .cat-icon { margin: 0 auto 12px; }
.sheet-hero .amt { font: 700 40px/1.1 var(--font-display); letter-spacing: -.3px; margin: 2px 0 4px; }
.sheet-hero .name { font: 600 20px/25px var(--font-display); }
.sheet-hero .when { color: var(--label-2); font: 400 15px/20px var(--font); }
#app.behind { transition: transform var(--dur) var(--spring); transform-origin: 50% 0; }
/* While a sheet is up the app behind sits still, dimmed: one GPU layer, rounded once, no live blur. */
body.sheet-open #app { will-change: transform; overflow: hidden; }
#app.receded { border-radius: 24px; }
body.sheet-open #app .navbar::before, body.sheet-open #app .glass-btn, body.sheet-open #app .tabbar {
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.sheet-open #app .tabbar, body.sheet-open #app .glass-btn { background: var(--glass-solid); }
body.sheet-open #app .navbar::before { background: var(--bar-solid); }

/* alert (centered) */
.alert-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: var(--scrim); opacity: 0; transition: opacity 200ms ease; }
.alert-wrap.open { opacity: 1; }
.alert { width: min(300px, 100%); background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-radius: 30px; box-shadow: var(--glass-shadow), inset 0 0 0 .5px var(--glass-edge); padding: 20px 16px 16px; text-align: center; transform: scale(1.12); opacity: 0; transition: transform 400ms var(--spring), opacity 200ms; }
.alert-wrap.open .alert { transform: none; opacity: 1; }
.alert h3 { margin: 0 4px 6px; font: 600 17px/22px var(--font); }
.alert p { margin: 0 4px 16px; font: 400 15px/20px var(--font); color: var(--label-2); }
.alert .btn { height: 46px; font-size: 17px; }
.alert .btn + .btn { margin-top: 8px; }

/* toast / HUD */
.toast { position: fixed; z-index: 70; left: 50%; top: calc(var(--sat) + 10px); transform: translate(-50%, -140%); display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--glass-shadow), inset 0 0 0 .5px var(--glass-edge); font: 600 15px/20px var(--font); transition: transform 520ms var(--spring-bounce), visibility 0s 520ms; max-width: calc(100% - 32px); visibility: hidden; }
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform 520ms var(--spring-bounce); }
.toast .ic { width: 26px; height: 26px; border-radius: 26px; display: grid; place-items: center; color: #fff; background: var(--c, var(--green)); font-size: 15px; flex: none; }
.toast .ic .icon { stroke-width: 3; }

/* ---------- lock screen ---------- */
#lock { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: calc(var(--sat) + 24px) 24px calc(var(--sab) + 24px); overflow-y: auto; transition: opacity 400ms ease, transform 500ms var(--spring); }
#lock.leaving { opacity: 0; transform: scale(1.06); pointer-events: none; }
.lock-inner { width: min(380px, 100%); text-align: center; }
.app-icon { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); display: block; }
.lock-inner h1 { margin: 0 0 6px; }
.lock-inner p.lead { margin: 0 auto 26px; color: var(--label-2); font: 400 17px/22px var(--font); max-width: 300px; }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-weight: 600; font-family: var(--font-rounded);
  background: linear-gradient(135deg, hsl(var(--h) 75% 62%), hsl(calc(var(--h) + 35) 70% 46%)); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.25); }
.lock-avatar { display: block; width: max-content; margin: 0 auto 10px; }
.lock-avatar .avatar { box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.lock-user { display: block; color: var(--label); font: 600 20px/25px var(--font-display); margin-bottom: 4px; }
.account-list { text-align: left; margin-bottom: 4px; }
.account-list .row { --sep-left: 68px; }
.lock-form { display: grid; gap: 12px; text-align: left; }
.lock-form .err { color: var(--red); font: 400 13px/18px var(--font); min-height: 18px; text-align: center; }
.lock-links { margin-top: 26px; display: grid; gap: 4px; }
.lock-links button { color: var(--tint); font: 400 15px/20px var(--font); padding: 8px; }
.shake { animation: shake 420ms var(--ease); }
@keyframes shake { 15%, 55% { transform: translateX(-10px); } 35%, 75% { transform: translateX(10px); } 90% { transform: translateX(-3px); } }
.meter { height: 4px; border-radius: 4px; background: var(--fill-3); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--c, var(--red)); transition: width 300ms var(--spring), background 200ms; }
.hint { font: 400 13px/18px var(--font); color: var(--label-2); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
.spinner.dark { border-color: var(--fill); border-top-color: var(--label-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* entrance */
.fade-up { animation: fadeUp 600ms var(--spring) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

/* ---------- desktop: sidebar + centered column ---------- */
@media (min-width: 1000px) {
  :root { --gutter: 32px; }
  .tabbar {
    left: 16px; top: 16px; bottom: 16px; transform: none; width: 232px; height: auto; border-radius: 28px;
    grid-template-columns: 1fr; grid-auto-rows: 46px; align-content: start; padding: 64px 10px 10px; gap: 4px;
  }
  .tabbar::before { content: "Money"; position: absolute; top: 20px; left: 22px; font: 700 22px/28px var(--font-display); color: var(--label); }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; font: 500 15px/1 var(--font); border-radius: 14px; }
  .tab .icon { font-size: 21px; }
  .tab-lens { border-radius: 14px; top: 0; left: 0; height: 46px; bottom: auto; }
  .pages { left: 264px; }
  .navbar { padding-left: max(12px, calc((100% - 760px) / 2 + var(--gutter) - 8px)); padding-right: max(12px, calc((100% - 760px) / 2 + var(--gutter) - 8px)); }
  .scroller { padding-bottom: 60px; }
  .sheet { left: 50%; right: auto; width: 600px; bottom: 50%; transform: translate(-50%, 60%) scale(.96); opacity: 0; max-height: min(820px, calc(100% - 64px)); transition: transform 420ms var(--spring), opacity 220ms ease; }
  .sheet.full { height: min(820px, calc(100% - 64px)); }
  .sheet.open { transform: translate(-50%, 50%); opacity: 1; }
  .sheet .grabber { display: none; }
  .row:hover { background: var(--fill-4); }
}

@media (max-width: 370px) {
  .hero .big { font-size: 38px; }
  .rings-card { grid-template-columns: 1fr; justify-items: center; }
  .stat .v { font-size: 17px; }
}

/* ---------- reduced motion: no springs, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 120ms !important; transition-timing-function: ease !important; }
  .sheet { transform: none; opacity: 0; }
  .sheet.open { opacity: 1; }
  .toast { transform: translate(-50%, 0); opacity: 0; transition: opacity 150ms !important; }
  .toast.show { opacity: 1; }
  .spinner { animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
  #lock.leaving { transform: none; }
}
@media (prefers-reduced-motion: reduce) and (min-width: 1000px) {
  .sheet, .sheet.open { transform: translate(-50%, 50%); }
}

@media (forced-colors: active) {
  .stackbar i, .pctbar i, .budget-row .bar i { forced-color-adjust: none; }
}

/* Recovery key */
.recovery-code { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 8px 14px; margin: 6px auto 14px; padding: 18px 16px; max-width: 360px; border-radius: 16px; background: var(--bg-2); box-shadow: 0 0 0 0.5px var(--separator) inset; font: 600 22px/1.2 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.06em; color: var(--label); user-select: all; -webkit-user-select: all; }
.recovery-actions { display: flex; gap: 8px; }
.recovery-actions .btn { flex: 1; min-width: 0; padding-left: 8px; padding-right: 8px; }
.field.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.04em; text-transform: uppercase; }
.field.mono::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font); }

/* Needs a category */
.teach-card { background: var(--bg-2); border-radius: 16px; padding: 14px 0 12px; margin-bottom: 12px; transition: opacity .2s, transform .2s; }
.teach-card.done { opacity: 0; transform: scale(.97); }
.teach-head { padding: 0 16px 10px; }
.teach-head .title { display: block; font: 600 17px/1.25 var(--font); }
.teach-head .subtitle { display: block; margin-top: 2px; font: 400 14px/1.3 var(--font); color: var(--label-2); }
.teach-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 14px 2px; }
.teach-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 11px; border: 0; border-radius: 17px; background: color-mix(in srgb, var(--c, var(--gray)) 14%, transparent); color: var(--label); font: 500 14px/1 var(--font); cursor: pointer; }
.teach-chip .icon { width: 16px; height: 16px; color: var(--c, var(--gray)); }
.teach-chip.plain { background: var(--fill-3); color: var(--label-2); }
.teach-chip:active { transform: scale(.96); }

@media (max-width: 360px) {
  /* Narrow phones: money must never be cut off ("$10,…"); smaller type and tighter tiles instead. */
  .stat-grid { gap: 6px; }
  .stat-grid .tile { padding: 10px 8px 9px; }
  .stat-grid .v { font-size: 15px; line-height: 20px; text-overflow: clip; letter-spacing: -0.2px; }
  .stat .v { font-size: 15px; letter-spacing: -0.2px; }
}

/* split editor */
.split-line { gap: 10px; }
.split-cat { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; color: var(--label); font: 400 17px/22px var(--font); text-align: left; cursor: pointer; }
.split-cat .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split-cat .chev { width: 14px; height: 14px; color: var(--label-3); flex: none; }
.split-amt { width: 104px; flex: none; height: 36px; border: 0; border-radius: 10px; background: var(--fill-3); color: var(--label); font: 500 17px/22px var(--font); text-align: right; padding: 0 10px; }
.split-amt:focus { outline: 2px solid var(--tint); outline-offset: 0; }
.split-del { flex: none; width: 30px; height: 30px; border: 0; border-radius: 15px; background: none; color: var(--label-3); display: grid; place-items: center; cursor: pointer; }
.split-del .icon { width: 14px; height: 14px; }
#split-rest { min-width: 104px; text-align: right; padding-right: 40px; }
.amz-store { border: 0; background: none; color: var(--label-2); font: 400 17px/22px var(--font); text-align: right; max-width: 55%; cursor: pointer; }

/* ---------- Summary ---------- */
.avatar-btn {
  position: relative; width: 40px; height: 40px; border-radius: 40px; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; font: 600 17px/1 var(--font-display);
  background: linear-gradient(160deg, #8e9bff, #5856d6 55%, #3a33b8); box-shadow: 0 2px 8px rgba(88,86,214,.3);
}
.avatar-btn:active { transform: scale(.94); }
.avatar-btn .badge-dot { top: 0; right: 0; }
.month-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; width: 100%; border: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; padding: 16px; }
/* The rings sit on black, as in the Fitness app, in light and dark mode. */
.month-card:not(.simple) { background: #000; color: #fff; }
@media (prefers-color-scheme: dark) { .month-card:not(.simple) { background: var(--bg-2); } }
.month-card:not(.simple) .mc-l b { color: var(--c); text-transform: uppercase; letter-spacing: .3px; font-size: 12px; }
.month-card:not(.simple) .mc-l small { color: rgba(255,255,255,.55); }
.month-card:not(.simple) .mc-foot { color: rgba(255,255,255,.65); border-top-color: rgba(255,255,255,.16); }
.month-card:not(.simple) .mc-foot b { color: #fff; }
.month-card:active { transform: scale(.985); }
.month-card .mc-rings { grid-row: span 2; width: 104px; height: 104px; display: block; }
.month-card .mc-rings svg { width: 104px; height: 104px; display: block; }
.mc-lines { display: grid; gap: 8px; }
.mc-l { display: grid; }
.mc-l b { font: 600 13px/16px var(--font); color: color-mix(in srgb, var(--c) 78%, var(--label)); }
.mc-l span { font: 600 19px/23px var(--font-display); }
.mc-l small { font: 500 13px/1 var(--font); color: var(--label-2); margin-left: 1px; }
.mc-foot { grid-column: 1 / -1; font: 400 14px/19px var(--font); color: var(--label-2); padding-top: 8px; border-top: .5px solid var(--separator); margin-top: 6px; }
.mc-foot b { color: var(--label); font-weight: 600; }
.month-card.simple { grid-template-columns: 1fr; }
.mc-k { font: 400 14px/18px var(--font); color: var(--label-2); }
.mc-v { font: 700 30px/34px var(--font-display); letter-spacing: .2px; }
.mc-bars { display: grid; gap: 8px; margin-top: 6px; }
.mc-bar { position: relative; display: block; height: 26px; border-radius: 8px; background: var(--fill-3); overflow: hidden; }
.mc-bar i { position: absolute; inset: 0 auto 0 0; background: var(--c); border-radius: 8px; opacity: .9; }
.mc-bar em { position: relative; font: 600 12px/26px var(--font); font-style: normal; padding-left: 10px; color: #fff; mix-blend-mode: normal; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.insight-list { display: grid; gap: 12px; padding-top: 2px; }
.insight-list .insight { flex: none; min-height: 0; width: 100%; background: var(--sheet-row, var(--bg-2)); }
.show-all { display: block; width: 100%; border: 0; padding: 0; margin-top: 12px; cursor: pointer; text-align: left; font: inherit; }
.date-chip { flex: none; width: 42px; height: 44px; border-radius: 10px; background: var(--fill-3); display: grid; place-items: center; align-content: center; margin-right: 12px; font: 700 18px/18px var(--font-display); }
.date-chip small { display: block; font: 600 10px/12px var(--font); color: var(--red); text-transform: uppercase; letter-spacing: .4px; }

/* ---------- Spending ---------- */
.pill-btn { gap: 4px; font: 600 15px/1 var(--font); padding: 0 12px 0 14px; color: var(--tint); }
.pill-btn .icon { font-size: 13px; stroke-width: 2.6; }
.period-seg { margin: 2px 0 14px; }
.period-head { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 4px; margin: 0 0 12px; touch-action: pan-y; }
.period-head .arrow { width: 36px; height: 36px; border-radius: 36px; border: 0; background: var(--fill-3); color: var(--tint); display: grid; place-items: center; cursor: pointer; }
.period-head .arrow:disabled { opacity: .3; cursor: default; }
.period-head .arrow .icon { font-size: 16px; stroke-width: 2.6; }
.period-mid { border: 0; background: none; color: inherit; font: inherit; display: grid; justify-items: center; gap: 2px; cursor: pointer; padding: 2px 0; }
.period-k { font: 600 15px/20px var(--font); color: var(--label-2); }
.period-big { font: 700 40px/46px var(--font-display); letter-spacing: -.3px; }
.period-sub { font: 400 14px/19px var(--font); color: var(--label-2); text-align: center; }
.period-sub .pos, .period-sub .neg { font-weight: 600; }
.chart-card { padding: 12px 12px 10px; touch-action: pan-y; }
.chart-card .chart-wrap { margin: 0; cursor: pointer; }
.chart-foot { display: flex; justify-content: space-between; align-items: center; margin: 6px 4px 0; font: 400 13px/18px var(--font); color: var(--label-2); }
.chart-foot b { color: var(--label); font-weight: 600; }
.mini-legend { display: inline-flex; gap: 4px; }
.mini-legend i { width: 8px; height: 8px; border-radius: 8px; background: var(--c); }
.budget-card, .budget-cta { display: block; width: 100%; border: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.budget-card:active, .budget-cta:active { transform: scale(.985); }
.bc-top { display: flex; align-items: baseline; gap: 8px; }
.bc-k { font: 600 15px/20px var(--font); }
.bc-v { margin-left: auto; font: 700 22px/26px var(--font-display); }
.bc-top .chev { color: var(--label-3); font-size: 14px; stroke-width: 2.6; align-self: center; }
.budget-card .bar { position: relative; display: block; height: 10px; border-radius: 10px; background: var(--fill-3); margin: 10px 0 8px; overflow: visible; }
.budget-card .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 10px; background: var(--c); }
.budget-card .bar .today { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--label); border-radius: 2px; opacity: .55; }
.bc-sub { font: 400 14px/19px var(--font); color: var(--label-2); }
.bc-sub b { color: var(--label); }
.budget-cta { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.budget-cta .main { flex: 1; }
.budget-cta .title { display: block; font: 600 16px/21px var(--font); }
.budget-cta .subtitle { display: block; font: 400 13px/18px var(--font); color: var(--label-2); }
.budget-cta .chev { color: var(--label-3); }
.cat-row .value-sub .pos, .cat-row .value-sub .neg { font-weight: 600; }

/* ---------- Activity calendar ---------- */
.act-seg { margin: 2px 0 12px; }
.cal-card { padding: 12px 10px 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.cal-dow span { text-align: center; font: 600 12px/20px var(--font); color: var(--label-3); padding-bottom: 4px; }
.cal-day { position: relative; height: 48px; border: 0; background: none; color: var(--label); cursor: pointer; display: grid; place-items: center; font: inherit; padding: 0; }
.cal-day:disabled { cursor: default; }
.cal-day.out .cal-n { color: var(--label-4); }
.cal-dot { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: var(--tint); opacity: calc(.12 + var(--o) * .4); transition: transform 220ms var(--spring-bounce); }
.cal-n { position: relative; font: 500 15px/1 var(--font); font-variant-numeric: tabular-nums; }
.cal-day.today .cal-n { color: var(--red); font-weight: 700; }
.cal-day.sel::before { content: ""; position: absolute; width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 0 0 2px var(--label); }
.cal-day.sel .cal-n { font-weight: 700; }
.cal-day:active .cal-dot { transform: scale(.88); }

/* ---------- Spending (v3): one number, one chart, then where it went ---------- */
.sp-nav { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; margin: 0 0 12px; }
.sp-nav .arrow { width: 40px; height: 40px; border-radius: 40px; border: 0; background: var(--bg-2); color: var(--tint); display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.sp-nav .arrow:disabled { opacity: .35; cursor: default; }
.sp-nav .arrow .icon { font-size: 17px; stroke-width: 2.6; }
.sp-when { justify-self: center; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--label); font: 700 20px/26px var(--font-display); letter-spacing: .2px; cursor: pointer; padding: 6px 10px; border-radius: 12px; }
.sp-when .icon { font-size: 14px; stroke-width: 2.8; color: var(--label-3); }
.sp-when:active { background: var(--fill-3); }
.sp-hero { padding: 18px 16px 12px; touch-action: pan-y; }
.sp-k { font: 600 15px/20px var(--font); color: var(--label-2); }
.sp-total { font: 700 44px/50px var(--font-display); letter-spacing: -.5px; margin: 2px 0 8px; }
.sp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font: 600 14px/18px var(--font); }
.sp-pill .icon { font-size: 15px; stroke-width: 2.4; }
.sp-pill.up { background: color-mix(in srgb, var(--orange) 15%, transparent); color: color-mix(in srgb, var(--orange) 80%, var(--label)); }
.sp-pill.down { background: color-mix(in srgb, var(--green) 15%, transparent); color: color-mix(in srgb, var(--green) 75%, var(--label)); }
.sp-pill.same { background: var(--fill-3); color: var(--label-2); }
.sp-chart { margin: 14px -4px 0 !important; cursor: default; }
.cum-read { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; min-height: 22px; margin: 0 4px 4px; }
.cum-read .k { font: 400 13px/18px var(--font); color: var(--label-2); }
.cum-read .v { font: 600 15px/20px var(--font); font-variant-numeric: tabular-nums; }
.cum-read .v small { font: 400 13px/18px var(--font); color: var(--label-2); }
.cum-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 4px 0; font: 400 13px/18px var(--font); color: var(--label-2); }
.cum-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cum-legend i { width: 14px; height: 3px; border-radius: 3px; background: var(--c); }
.cum-legend i.dash { background: repeating-linear-gradient(90deg, var(--label-2) 0 4px, transparent 4px 7px); }
.sp-hint { margin: 6px 4px 0; font: 400 13px/18px var(--font); color: var(--label-2); }
.sp-filter { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 12px; padding: 12px 2px 2px; border: 0; border-top: .5px solid var(--separator); background: none; color: var(--label); font: 400 15px/20px var(--font); cursor: pointer; text-align: left; }
.sp-filter .icon { font-size: 17px; color: var(--label-2); }
.sp-filter span { flex: 1; }
.sp-filter b { color: var(--tint); font-weight: 400; }
.sp-cats { padding: 14px 0 4px; }
.sp-mix { display: flex; gap: 2px; height: 14px; margin: 0 16px 6px; border-radius: 7px; overflow: hidden; }
.sp-mix i { display: block; min-width: 3px; background: var(--c); }
.sp-rows { display: block; }
.sp-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; position: relative; }
.sp-row[hidden] { display: none; }
.sp-row + .sp-row::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; border-top: .5px solid var(--separator); }
.sp-row:active { background: var(--fill-4, var(--fill-3)); }
.sp-row .main { flex: 1; min-width: 0; }
.sp-row .title { display: block; font: 400 17px/22px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-row .subtitle { display: block; font: 400 13px/18px var(--font); color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-row .subtitle .up { color: color-mix(in srgb, var(--orange) 80%, var(--label)); }
.sp-row .subtitle .down { color: color-mix(in srgb, var(--green) 75%, var(--label)); }
.sp-row .amt { text-align: right; flex: none; }
.sp-row .value { display: block; font: 600 17px/22px var(--font); font-variant-numeric: tabular-nums; }
.sp-row .pct { display: block; font: 400 13px/18px var(--font); color: var(--label-2); }
.sp-more { display: block; width: 100%; padding: 12px 16px 10px; border: 0; border-top: .5px solid var(--separator); background: none; color: var(--tint); font: 400 17px/22px var(--font); text-align: left; cursor: pointer; }


/* Bank Emails */
.mail-row .pick { width: 24px; height: 24px; border-radius: 24px; border: 1.5px solid var(--label-3); flex: none; display: grid; place-items: center; transition: background 150ms, border-color 150ms; }
.mail-row .pick .icon { width: 15px; height: 15px; color: #fff; opacity: 0; stroke-width: 3; }
.mail-row[aria-pressed="true"] .pick { background: var(--blue); border-color: var(--blue); }
.mail-row[aria-pressed="true"] .pick .icon { opacity: 1; }
.mail-row[aria-pressed="false"] .title, .mail-row[aria-pressed="false"] .value { opacity: .5; }
.mail-tag { display: inline-block; vertical-align: 2px; margin-left: 6px; padding: 3px 6px; border-radius: 6px; font: 600 11px/1 var(--font); color: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); }
.mail-paste { display: block; width: 100%; min-height: 120px; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--fill-3); font: 400 15px/1.35 var(--font); resize: vertical; outline: none; box-sizing: border-box; }
.mail-paste:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 35%, transparent); }
.badge-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--red); color: #fff; font: 600 13px/22px var(--font); text-align: center; box-sizing: border-box; flex: none; }

/* In sheets, a row's second line wraps (up to two lines) instead of being cut off mid-word. */
.sheet .row .subtitle { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
