/* =========================================================================
   Encalma — кликабельный прототип мобильного приложения личных финансов
   Стили: токены тем, каркас устройства, компоненты, экраны
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
svg.ic { display: block; flex: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Tokens ---------- */
:root {
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-sys: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --spring: cubic-bezier(.34, 1.36, .5, 1);
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-bottom: max(8px, env(safe-area-inset-bottom));
  --tabbar-h: 60px;
  --gutter: 16px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #05070A;
  --bg: #0A0D12;
  --bg-elev: #0F1318;
  --card: #141920;
  --card-2: #1B212A;
  --card-3: #262D38;
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.13);
  --text: #F2F4F7;
  --text-2: #AEB6C1;
  --text-3: #858E9A;
  --accent: #3DDC97;
  --accent-2: #2BC282;
  --accent-ink: #03200F;
  --accent-text: #4BE3A2;
  --accent-soft: rgba(61,220,151,.13);
  --warn: #F5BE55;
  --warn-soft: rgba(245,190,85,.13);
  --warn-text: #F7C868;
  --info: #72B6FF;
  --info-soft: rgba(114,182,255,.13);
  --info-text: #8CC4FF;
  --danger: #FF8F80;
  --danger-soft: rgba(255,143,128,.12);
  --scrim: rgba(0,0,0,.58);
  --shadow-2: 0 18px 44px rgba(0,0,0,.5);
  --shadow-soft: 0 10px 22px -10px rgba(0,0,0,.7);
  --toast-bg: #EEF1F5; --toast-text: #0D1218; --toast-accent: #08784F; --toast-sub: #4A5363;
  --banner-bg: rgba(40,45,54,.88); --banner-text: #F2F4F7; --banner-sub: #C3CAD3;
  --tabbar-bg: rgba(10,13,18,.84);
  --sb-color: #FFFFFF;
  --c-life: #3DDC97; --c-cushion: #43B8F7; --c-bills: #8F97FF; --c-taxes: #C38BFA; --c-goals: #F47AB8; --c-sinking: #F7C54A; --c-buffer: #A8E05A;
  --k-housing: #8F97FF; --k-groceries: #3DDC97; --k-cafe: #FF9F5A; --k-transport: #43B8F7; --k-shopping: #F47AB8; --k-health: #FF8A9A;
  --k-fun: #C38BFA; --k-subs: #35D0E0; --k-kids: #F7C54A; --k-travel: #2FD3B8; --k-taxes: #A7B0BD; --k-other: #98A1AE; --k-income: #3DDC97; --k-transfer: #A7B0BD;
}
html[data-theme="light"] {
  color-scheme: light;
  --page-bg: #E4E9EF;
  --bg: #F3F5F8;
  --bg-elev: #FFFFFF;
  --card: #FFFFFF;
  --card-2: #EFF2F5;
  --card-3: #E1E6EC;
  --line: rgba(16,24,40,.08);
  --line-2: rgba(16,24,40,.15);
  --text: #0E141C;
  --text-2: #465163;
  --text-3: #5E6776;
  --accent: #34D391;
  --accent-2: #20B478;
  --accent-ink: #03200F;
  --accent-text: #08784F;
  --accent-soft: rgba(16,170,110,.11);
  --warn: #E9A93A;
  --warn-soft: rgba(233,169,58,.15);
  --warn-text: #8F5A00;
  --info: #2F7FD8;
  --info-soft: rgba(47,127,216,.1);
  --info-text: #1F66B8;
  --danger: #C8392F;
  --danger-soft: rgba(200,57,47,.08);
  --scrim: rgba(10,14,20,.4);
  --shadow-2: 0 18px 44px rgba(16,24,40,.18);
  --shadow-soft: 0 10px 22px -10px rgba(16,24,40,.28);
  --toast-bg: #1A2029; --toast-text: #F2F4F7; --toast-accent: #4BE3A2; --toast-sub: #B6BEC9;
  --banner-bg: rgba(252,253,254,.92); --banner-text: #0E141C; --banner-sub: #465163;
  --tabbar-bg: rgba(255,255,255,.88);
  --sb-color: #0E141C;
  --c-life: #0F9E63; --c-cushion: #0B84C6; --c-bills: #5159E0; --c-taxes: #8D3FD6; --c-goals: #D23A86; --c-sinking: #A87400; --c-buffer: #4F8A0E;
  --k-housing: #5159E0; --k-groceries: #0F9E63; --k-cafe: #D2600E; --k-transport: #0B84C6; --k-shopping: #D23A86; --k-health: #D93A55;
  --k-fun: #8D3FD6; --k-subs: #0A8C9C; --k-kids: #A87400; --k-travel: #0B8F7A; --k-taxes: #5B6576; --k-other: #6B7482; --k-income: #0F9E63; --k-transfer: #5B6576;
}

/* ---------- Desktop stage ---------- */
.stage {
  min-height: 100vh; min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(260px, 360px) auto minmax(280px, 360px);
  justify-content: center; align-items: start;
  gap: clamp(24px, 4vw, 64px);
  padding: 24px 32px;
  background:
    radial-gradient(900px 600px at 50% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--page-bg);
}
.intro, .demo { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; }
.intro { padding-top: 24px; }
.device { position: relative; display: flex; justify-content: center; }
.device-frame {
  --dw: 390px; --dh: 844px;
  width: calc(var(--dw) + 22px); height: calc(var(--dh) + 22px);
  padding: 11px; border-radius: 62px; background: #0B0C0F;
  box-shadow: 0 0 0 1.5px #3A3E46, 0 0 0 6px #141519, 0 0 0 7.5px #2A2D33, 0 50px 90px rgba(0,0,0,.45);
  transform-origin: top center; transform: scale(var(--scale, 1));
  flex: none;
}
.device-screen { position: relative; width: var(--dw); height: var(--dh); border-radius: 51px; overflow: hidden; background: var(--bg); isolation: isolate; }
.island { position: absolute; z-index: 1001; top: 11px; left: 50%; width: 122px; height: 35px; margin-left: -61px; border-radius: 20px; background: #000; pointer-events: none; }
.statusbar {
  position: absolute; z-index: 1000; top: 0; left: 0; right: 0; height: 52px;
  display: flex; align-items: center; justify-content: space-between; padding: 4px 30px 0 46px;
  color: var(--sb-color); font: 600 16px/1 var(--font-sys); letter-spacing: -.01em; pointer-events: none; transition: color .3s;
}
.statusbar .sb-icons { display: flex; gap: 6px; align-items: center; }
.device-screen[data-sb="light"] .statusbar, .device-screen[data-sb="light"] .home-ind { --sb-color: #fff; }
.device-screen[data-sb="dark"] .statusbar, .device-screen[data-sb="dark"] .home-ind { --sb-color: #0E141C; }
.home-ind { position: absolute; z-index: 1000; bottom: 8px; left: 50%; width: 136px; height: 5px; margin-left: -68px; border-radius: 3px; background: var(--sb-color); opacity: .92; pointer-events: none; }

/* in-frame safe areas */
.is-framed .app { --safe-top: 54px; --safe-bottom: 26px; }

/* Mobile: full screen app, no frame */
body.is-mobile .stage { display: block; padding: 0; min-height: 0; background: var(--bg); }
body.is-mobile .intro, body.is-mobile .demo { display: none; }
body.is-mobile .device, body.is-mobile .device-frame, body.is-mobile .device-screen {
  position: fixed; inset: 0; width: 100%; height: 100%; padding: 0; border-radius: 0; box-shadow: none; transform: none; background: var(--bg);
}
body.is-mobile .island, body.is-mobile .statusbar, body.is-mobile .home-ind { display: none; }

@media (max-width: 1180px) {
  .stage { grid-template-columns: auto minmax(280px, 340px); }
  .intro { display: none; }
}

/* ---------- Intro & demo panels (desktop) ---------- */
.intro-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.intro-logo b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.intro-logo span.tag { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: var(--card-2); color: var(--text-2); }
.intro h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.025em; font-weight: 800; margin-bottom: 14px; }
.intro p { color: var(--text-2); font-size: 15.5px; line-height: 1.55; margin-bottom: 14px; }
.intro h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 26px 0 10px; font-weight: 800; }
.intro .howto li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; color: var(--text-2); margin-bottom: 10px; }
.intro .howto li svg { color: var(--accent-text); margin-top: 1px; }
.intro .qr { display: flex; gap: 14px; align-items: center; margin-top: 8px; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.intro .qr-box { width: 92px; height: 92px; border-radius: 10px; background: #fff; padding: 6px; flex: none; display: grid; place-items: center; }
.intro .qr-box svg, .intro .qr-box img { width: 100%; height: 100%; display: block; }
.intro .qr small { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.intro .qr b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.intro .foot { font-size: 12.5px; color: var(--text-3); margin-top: 22px; line-height: 1.5; }

.demo { padding: 20px 18px 18px; border-radius: 26px; background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); margin-top: 8px; }
.demo-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.demo-h b { font-size: 17px; font-weight: 800; }
.demo-h span { font-size: 12px; font-weight: 700; color: var(--text-3); }
.demo-note { font-size: 13px; color: var(--text-3); line-height: 1.45; margin-bottom: 8px; }
.demo-sec { margin-top: 16px; }
.demo-sec > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 800; margin-bottom: 8px; }
.demo-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.dbtn { font-size: 13px; font-weight: 700; padding: 8px 11px; border-radius: 11px; background: var(--card-2); color: var(--text); border: 1px solid var(--line); line-height: 1.2; transition: background .15s, transform .1s; }
.dbtn:hover { background: var(--card-3); }
.dbtn:active { transform: scale(.97); }
.dbtn.on { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.dbtn .st { font-size: 10.5px; font-weight: 800; margin-left: 4px; opacity: .7; }
.demo-list { display: flex; flex-direction: column; gap: 6px; }
.demo-list .dbtn { text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- App shell ---------- */
.app { position: absolute; inset: 0; overflow: hidden; background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.35; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.app input, .app textarea { user-select: text; -webkit-user-select: text; }
.tabviews { position: absolute; inset: 0; }
.tabview { position: absolute; inset: 0; display: none; }
.tabview.active { display: block; }
.screen { position: absolute; inset: 0; background: var(--bg); transition: transform .38s var(--ease), opacity .38s var(--ease), filter .38s; will-change: transform; }
.screen.enter { transform: translateX(100%); }
.screen.behind { transform: translateX(-28%); filter: brightness(.7); pointer-events: none; }
.screen.leave { transform: translateX(100%); transition-duration: .3s; }
.scr-body { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: calc(var(--safe-top) + 6px) 0 calc(var(--tabbar-h) + var(--safe-bottom) + 34px); scrollbar-width: none; }
.scr-body::-webkit-scrollbar { display: none; }
.screen.has-nav .scr-body { padding-top: calc(var(--safe-top) + 52px); }
.navbar { position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: calc(var(--safe-top) + 48px); padding: var(--safe-top) 8px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.navbar.scrolled { border-bottom-color: var(--line); }
.nav-back { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 10px 0 4px; color: var(--accent-text); font-weight: 600; font-size: 17px; justify-self: start; border-radius: 12px; }
.nav-title { font-size: 17px; font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.nav-right { justify-self: end; display: flex; gap: 4px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--text-2); }
.icon-btn:active { background: var(--card-2); }

/* ---------- Tab bar ---------- */
.tabbar { position: absolute; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 4px 4px var(--safe-bottom); display: grid; grid-template-columns: repeat(5, 1fr); align-items: start;
  background: var(--tabbar-bg); backdrop-filter: saturate(1.6) blur(22px); -webkit-backdrop-filter: saturate(1.6) blur(22px); border-top: 1px solid var(--line);
  transition: transform .35s var(--ease); }
.tabbar.hide { transform: translateY(110%); }
.tab { position: relative; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: .005em; border-radius: 14px; }
.tab.on { color: var(--accent-text); }
.tab .dot { position: absolute; top: 7px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.tab-plus-wrap { display: flex; justify-content: center; }
.tab-plus { width: 60px; height: 60px; margin-top: -16px; border-radius: 50%; display: grid; place-items: center; color: var(--accent-ink);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 80%, #fff) 0%, var(--accent) 45%, var(--accent-2) 100%);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 38%, transparent), 0 0 0 5px var(--bg); transition: transform .18s var(--ease); touch-action: none; -webkit-touch-callout: none; }
.tab-plus:active, .tab-plus.pressing { transform: scale(.92); }
.tab-plus.rec { animation: recPulse 1.3s ease-in-out infinite; }
@keyframes recPulse { 0%, 100% { box-shadow: 0 0 0 5px var(--bg), 0 0 0 5px color-mix(in srgb, var(--accent) 40%, transparent); } 50% { box-shadow: 0 0 0 5px var(--bg), 0 0 0 16px color-mix(in srgb, var(--accent) 0%, transparent); } }

/* ---------- Typography helpers ---------- */
.lt { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; padding: 8px var(--gutter) 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lt small { display: block; font-size: 15px; letter-spacing: 0; font-weight: 600; color: var(--text-2); margin-top: 4px; }
.h2 { font-size: 20px; font-weight: 800; letter-spacing: -.015em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; }
.tnum { font-variant-numeric: tabular-nums; }
.pos { color: var(--accent-text); }
.warnc { color: var(--warn-text); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.link { color: var(--accent-text); font-weight: 700; font-size: 15px; padding: 8px 4px; border-radius: 10px; }
.p { font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
.p b { color: var(--text); }
.pad { padding: 0 var(--gutter); }
.gap-8 > * + * { margin-top: 8px; }
.gap-12 > * + * { margin-top: 12px; }
.hint { font-size: 13.5px; color: var(--text-3); padding: 10px var(--gutter) 0; line-height: 1.45; display: flex; gap: 6px; align-items: center; }
.hint svg { flex: none; }

/* ---------- Sections, cards, lists ---------- */
.sec { margin-top: 22px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter) 8px; min-height: 36px; }
.sec-h h2 { font-size: 20px; font-weight: 800; letter-spacing: -.015em; }
.sec-h .sub { font-size: 14px; color: var(--text-3); font-weight: 600; }
.card { background: var(--card); border-radius: 22px; margin: 0 var(--gutter); border: 1px solid var(--line); }
.card.p16 { padding: 16px; }
.card.p20 { padding: 20px; }
.card + .card { margin-top: 10px; }
.list { overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; text-align: left; background: var(--card); transition: background .12s; }
button.row:active, .row.tap:active { background: var(--card-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-t { font-size: 16.5px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-t.wrap { white-space: normal; }
.row-s { font-size: 14px; color: var(--text-3); font-weight: 600; line-height: 1.3; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-s.wrap { white-space: normal; }
.row-end { flex: none; text-align: right; display: flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.row-end .chev { color: var(--text-3); }
.row-end .sub { display: block; font-size: 13px; color: var(--text-3); font-weight: 600; }
.row-col { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.inc { color: var(--accent-text); }
.amt.trf { color: var(--text-3); }
.src-ic { color: var(--text-3); display: inline-flex; }

/* tiles */
.tile { --cc: var(--k-other); width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; color: var(--cc); background: color-mix(in srgb, var(--cc) 15%, transparent); }
.tile.sm { width: 34px; height: 34px; border-radius: 11px; }
.tile.lg { width: 52px; height: 52px; border-radius: 17px; }
.tile.solid { color: var(--bg); background: var(--cc); }
.k-housing { --cc: var(--k-housing); } .k-groceries { --cc: var(--k-groceries); } .k-cafe { --cc: var(--k-cafe); } .k-transport { --cc: var(--k-transport); }
.k-shopping { --cc: var(--k-shopping); } .k-health { --cc: var(--k-health); } .k-fun { --cc: var(--k-fun); } .k-subs { --cc: var(--k-subs); }
.k-kids { --cc: var(--k-kids); } .k-travel { --cc: var(--k-travel); } .k-taxes { --cc: var(--k-taxes); } .k-other { --cc: var(--k-other); }
.k-income { --cc: var(--k-income); } .k-transfer { --cc: var(--k-transfer); }
.e-life { --cc: var(--c-life); } .e-cushion { --cc: var(--c-cushion); } .e-bills { --cc: var(--c-bills); } .e-taxes { --cc: var(--c-taxes); }
.e-goals { --cc: var(--c-goals); } .e-sinking { --cc: var(--c-sinking); } .e-buffer { --cc: var(--c-buffer); }
.k-accent { --cc: var(--accent); } .k-info { --cc: var(--info); } .k-warn { --cc: var(--warn); }

/* progress */
.bar { position: relative; display: block; height: 8px; border-radius: 99px; background: var(--card-3); overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--cc, var(--accent)); transition: width .6s var(--ease); min-width: 3px; }
.bar.thin { height: 6px; }
.bar.thick { height: 12px; }
.bar > i.ghost { background: color-mix(in srgb, var(--cc, var(--accent)) 38%, transparent); }
.stackbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--card-3); }
.stackbar > i { display: block; height: 100%; background: var(--cc); min-width: 3px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 16px; font-size: 16px; font-weight: 800; letter-spacing: -.005em; white-space: nowrap; transition: transform .12s var(--ease), background .15s, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.secondary { background: var(--card-2); color: var(--text); }
.btn.tonal { background: var(--accent-soft); color: var(--accent-text); }
.btn.ghost { color: var(--accent-text); padding: 0 12px; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.lg { height: 56px; border-radius: 18px; font-size: 17px; }
.btn.sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14.5px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn.disabled { opacity: .42; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding: 6px var(--edge, var(--gutter)); margin: -6px calc(-1 * var(--edge, var(--gutter))); scrollbar-width: none; scroll-padding: 0 var(--edge, var(--gutter));
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 calc(var(--edge, var(--gutter)) - 4px), #000 calc(100% - var(--edge, var(--gutter)) + 4px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 calc(var(--edge, var(--gutter)) - 4px), #000 calc(100% - var(--edge, var(--gutter)) + 4px), transparent 100%); }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 99px; background: var(--card-2); color: var(--text); font-size: 15px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; transition: background .15s, border-color .15s; flex: none; }
.chip.on { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.chip.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.chip .ic { width: 16px; height: 16px; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12.5px; font-weight: 800; background: var(--card-2); color: var(--text-2); white-space: nowrap; }
.pill.acc { background: var(--accent-soft); color: var(--accent-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn-text); }
.pill.info { background: var(--info-soft); color: var(--info-text); }
.pill.plus { background: linear-gradient(90deg, color-mix(in srgb, var(--c-taxes) 22%, transparent), color-mix(in srgb, var(--accent) 22%, transparent)); color: var(--text); }
.stage-b { display: none; font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: var(--info-soft); color: var(--info-text); letter-spacing: .02em; margin-left: 6px; vertical-align: 2px; }
.show-stages .stage-b { display: inline-block; }

/* segmented */
.seg { display: flex; padding: 3px; gap: 3px; border-radius: 14px; background: var(--card-2); }
.seg button { flex: 1; height: 38px; border-radius: 11px; font-size: 15px; font-weight: 700; color: var(--text-2); transition: background .15s, color .15s; white-space: nowrap; padding: 0 8px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
html[data-theme="dark"] .seg button.on { background: var(--card-3); }

/* switch */
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--card-3); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .22s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* range */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; cursor: pointer; margin: 0; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--cc, var(--accent)) 0 var(--p, 50%), var(--card-3) var(--p, 50%) 100%); }
.range::-moz-range-track { height: 8px; border-radius: 99px; background: var(--card-3); }
.range::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--cc, var(--accent)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3), 0 0 0 4px color-mix(in srgb, var(--cc, var(--accent)) 30%, transparent); }
.range::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* inputs */
.field { display: block; }
.field > span { display: block; font-size: 14px; font-weight: 700; color: var(--text-2); margin: 0 2px 6px; }
.input { width: 100%; height: 52px; border-radius: 16px; border: 1.5px solid var(--line-2); background: var(--card-2); padding: 0 14px; font-size: 17px; font-weight: 600; color: var(--text); transition: border-color .15s; }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-3); font-weight: 500; }
.field .help { font-size: 13px; color: var(--text-3); margin: 6px 2px 0; }

/* key-value */
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; font-size: 15.5px; }
.kv > span:first-child { color: var(--text-2); }
.kv > b { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.kv.total { border-top: 1px dashed var(--line-2); margin-top: 4px; padding-top: 10px; }
.kv.total > span:first-child { color: var(--text); font-weight: 700; }

/* empty state */
.empty { margin: 0 var(--gutter); padding: 24px 20px; border-radius: 22px; border: 1.5px dashed var(--line-2); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .tile { margin-bottom: 4px; }
.empty b { font-size: 17px; }
.empty p { font-size: 15px; color: var(--text-2); line-height: 1.45; max-width: 290px; }

/* notes */
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--card-2); font-size: 14px; line-height: 1.45; color: var(--text-2); }
.note svg { flex: none; color: var(--text-3); margin-top: 1px; }
.note.info { background: var(--info-soft); color: var(--text); }
.note.info svg { color: var(--info-text); }
.note.acc { background: var(--accent-soft); color: var(--text); }
.note.acc svg { color: var(--accent-text); }
.note.warn { background: var(--warn-soft); color: var(--text); }
.note.warn svg { color: var(--warn-text); }

/* ---------- Today ---------- */
.today-top { display: flex; align-items: center; justify-content: flex-end; padding: 0 12px 6px; min-height: 44px; }
.ask-btn { width: 42px; height: 42px; border-radius: 14px; color: var(--text-2); background: var(--card); border: 1px solid var(--line); }
.ask-btn:active { background: var(--card-2); }
.today-date { font-size: 15px; font-weight: 700; color: var(--text-2); }
.today-date b { display: block; font-size: 22px; color: var(--text); font-weight: 800; letter-spacing: -.02em; }
.hero { position: relative; display: block; width: calc(100% - 2 * var(--gutter)); margin: 0 var(--gutter); padding: 20px 20px 16px; border-radius: 28px; text-align: left; overflow: hidden;
  background: radial-gradient(130% 110% at 0% 0%, color-mix(in srgb, var(--accent) 20%, transparent) 0%, transparent 58%), radial-gradient(90% 90% at 100% 100%, color-mix(in srgb, var(--c-cushion) 10%, transparent) 0%, transparent 60%), var(--card);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line)); transition: transform .15s var(--ease); }
.hero:active { transform: scale(.99); }
.hero-label { font-size: 16px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; }
.hero-num { display: flex; align-items: flex-start; margin: 8px 0 6px; font-weight: 800; letter-spacing: -.045em; line-height: .95; font-variant-numeric: tabular-nums; color: var(--text); }
.hero-num .cur { font-size: 42px; margin: 7px 3px 0 0; color: var(--text-2); letter-spacing: 0; }
.hero-num .post { font-size: 42px; margin: 7px 0 0 8px; color: var(--text-2); letter-spacing: 0; }
.hero-num .int { font-size: 80px; }
.hero-num .dec { font-size: 38px; margin-top: 7px; color: var(--text-2); letter-spacing: -.02em; }
.hero-num.zero .int { color: var(--text-2); }
.hero-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 15px; font-weight: 700; color: var(--text-2); }
.hero-sub .how { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); }
.hero-sub .how svg { transition: transform .3s var(--ease); }
.hero.open .hero-sub .how svg { transform: rotate(180deg); }
.hero-day { margin-top: 14px; }
.hero-day .bar { height: 6px; }
.hero-day .row-s { margin-top: 6px; justify-content: space-between; }
.hero-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.hero.open .hero-more { grid-template-rows: 1fr; }
.hero-more > div { overflow: hidden; }
.formula { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.formula .eq { font-size: 13.5px; color: var(--text-3); font-weight: 700; margin-bottom: 6px; line-height: 1.4; }
.formula .kv { padding: 5px 0; font-size: 15px; }
.formula .kv small { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-top: 1px; }
.formula .res { display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); font-weight: 800; }
.formula .res b { font-size: 20px; color: var(--accent-text); }
.formula p { font-size: 13.5px; color: var(--text-3); line-height: 1.45; margin-top: 8px; }
.hero-sub .how.pulse { padding: 3px 9px; margin: -3px -9px; border-radius: 99px; animation: howPulse 2.2s ease-in-out infinite; }
@keyframes howPulse { 0%, 100% { background: transparent; } 50% { background: var(--accent-soft); } }
.tipbub { position: absolute; z-index: 3; right: 16px; top: -6px; transform: translateY(-100%); background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700; padding: 8px 11px; border-radius: 12px; animation: bob 2.4s ease-in-out infinite; pointer-events: none; }

/* action card */
.acard { position: relative; margin: 12px var(--gutter) 0; padding: 16px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); animation: cardIn .45s var(--ease) both; }
.acard.t-accent { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, var(--card)) 0%, var(--card) 100%); border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.acard.t-warn { background: linear-gradient(180deg, color-mix(in srgb, var(--warn) 9%, var(--card)) 0%, var(--card) 100%); border-color: color-mix(in srgb, var(--warn) 22%, var(--line)); }
.acard.t-info { background: linear-gradient(180deg, color-mix(in srgb, var(--info) 8%, var(--card)) 0%, var(--card) 100%); }
.acard-top { display: flex; gap: 12px; align-items: flex-start; padding-right: 30px; }
.acard h3 { font-size: 18px; font-weight: 800; letter-spacing: -.012em; line-height: 1.28; }
.acard p { font-size: 14.5px; color: var(--text-2); margin-top: 4px; line-height: 1.4; font-weight: 600; }
.acard-x { position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--text-3); }
.acard-x:active { background: var(--card-2); }
.acard-chips { display: flex; flex-wrap: wrap; gap: 8px 6px; margin-top: 12px; }
.acard-chips .pill { height: 28px; font-size: 13px; background: var(--card-2); color: var(--text); }
.acard-chips .pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--cc); display: inline-block; }
.acard-actions { display: flex; gap: 8px; margin-top: 14px; }
.acard-actions .btn { flex: 1; height: 46px; }
.acard-actions .btn.primary { flex: 1.6; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.acard.out { animation: cardOut .25s var(--ease-in) both; }
@keyframes cardOut { to { opacity: 0; transform: translateX(-30px) scale(.97); } }

/* goal progress (today) */
.goalbar { display: block; width: calc(100% - 2 * var(--gutter)); margin: 12px var(--gutter) 0; padding: 14px 16px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.goalbar-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.goalbar-top .t { flex: 1; font-size: 15.5px; font-weight: 800; }
.goalbar-top .t small { display: block; font-size: 13px; color: var(--text-3); font-weight: 700; margin-bottom: 1px; }
.goalbar-top b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.goalbar-sub { font-size: 13.5px; font-weight: 600; color: var(--text-3); margin-top: 8px; }

/* swipe rows */
.swipe-row { position: relative; overflow: hidden; background: var(--card); }
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.swipe-actions button { width: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 800; color: #fff; }
.swipe-actions .sa-cat { background: #5B63E6; }
.swipe-actions .sa-del { background: #D8574A; }
.swipe-fg { position: relative; z-index: 1; transition: transform .28s var(--ease); touch-action: pan-y; }
.swipe-fg.dragging { transition: none; }
.swipe-row.flash .swipe-fg { animation: rowFlash 1.4s var(--ease); }
@keyframes rowFlash { 0% { background: color-mix(in srgb, var(--accent) 28%, var(--card)); } 100% { background: var(--card); } }
.lowconf { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--warn-text); background: var(--warn-soft); padding: 2px 7px; border-radius: 8px; }

/* day groups */
.dayh { display: flex; justify-content: space-between; padding: 16px calc(var(--gutter) + 4px) 8px; font-size: 14px; font-weight: 800; color: var(--text-2); }
.dayh span:last-child { color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- Envelopes ---------- */
.env-sum { padding: 18px; }
.env-sum .top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.env-sum .top small { display: block; font-size: 14px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.env-sum .top b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.env-sum .ok { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--accent-text); margin-top: 12px; }
.env-sum .ok.warn { color: var(--warn-text); }
.envcard { width: calc(100% - 2 * var(--gutter)); margin: 10px var(--gutter) 0; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; border-radius: 22px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.envcard:active { background: var(--card-2); }
.envcard .main { flex: 1; min-width: 0; display: block; }
.envcard .top { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 8px; }
.envcard .top b { font-size: 17px; font-weight: 800; }
.envcard .top .amt { font-size: 17px; }
.envcard .s { display: block; font-size: 14px; color: var(--text-3); font-weight: 600; margin-top: 3px; line-height: 1.35; }
.envcard .s.w { color: var(--warn-text); }
.envcard .bar { margin-top: 10px; }
.limitrow { padding: 12px 14px; }
.limitrow .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.limitrow .top b { font-size: 15.5px; font-weight: 800; }
.limitrow .top span { font-size: 14px; font-weight: 700; color: var(--text-2); white-space: nowrap; }

/* big figure on detail screens */
.figure { padding: 6px var(--gutter) 18px; }
.figure small { display: block; font-size: 15px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.figure b { display: block; font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.figure .s { font-size: 15px; font-weight: 600; color: var(--text-2); margin-top: 8px; line-height: 1.45; }
.figure .bar { margin-top: 14px; }

/* calendar rows */
.cal-d { width: 46px; flex: none; text-align: center; border-radius: 12px; background: var(--card-2); padding: 6px 0; }
.cal-d b { display: block; font-size: 18px; font-weight: 800; line-height: 1.1; }
.cal-d span { display: block; font-size: 11.5px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.row.paid .row-t, .row.paid .amt { color: var(--text-3); }

/* ---------- Goals ---------- */
.ladder { padding: 16px 16px 6px; }
.lad-step { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.lad-step:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line-2); border-radius: 2px; }
.lad-step.done:not(:last-child)::before { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.lad-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--text-3); font-size: 13px; font-weight: 800; border: 2px solid var(--line-2); }
.lad-step.done .lad-dot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lad-step.cur .lad-dot { background: var(--card); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 5px var(--accent-soft); }
.lad-main { flex: 1; min-width: 0; padding-top: 3px; }
.lad-main b { display: block; font-size: 15.5px; font-weight: 800; }
.lad-main span { display: block; font-size: 13.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; line-height: 1.35; }
.lad-step.cur .lad-main b { color: var(--accent-text); }
.lad-step.later .lad-main b { color: var(--text-2); }
.lad-main .bar { margin-top: 8px; }
.ring { --p: 50; --cc: var(--accent); width: 112px; height: 112px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--cc) calc(var(--p) * 1%), var(--card-3) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--card); }
.ring > * { position: relative; text-align: center; }
.ring b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ring span { display: block; font-size: 12px; font-weight: 700; color: var(--text-3); margin-top: 3px; }
.cushion-card { padding: 18px; display: flex; gap: 16px; align-items: center; }
.cushion-card .t { flex: 1; min-width: 0; }
.cushion-card .t b { display: block; font-size: 18px; font-weight: 800; }
.cushion-card .t .s { display: block; font-size: 14px; color: var(--text-2); font-weight: 600; margin-top: 5px; line-height: 1.4; }
.cushion-card .t .calm { display: block; margin-top: 8px; font-size: 14px; font-weight: 800; color: var(--accent-text); }
.goalrow { padding: 14px; }
.goalrow .top { display: flex; gap: 12px; align-items: center; }
.goalrow .top .main { flex: 1; min-width: 0; }
.goalrow .bar { margin-top: 12px; }
.goalrow .foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13.5px; font-weight: 700; color: var(--text-3); }
.status { font-size: 12.5px; font-weight: 800; padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
.status.ok { background: var(--accent-soft); color: var(--accent-text); }
.status.wait { background: var(--card-2); color: var(--text-2); }
.status.warn { background: var(--warn-soft); color: var(--warn-text); }

/* ---------- More ---------- */
.plancard { padding: 16px; display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--c-taxes) 16%, var(--card)) 0%, color-mix(in srgb, var(--accent) 12%, var(--card)) 100%); }
.plancard b { display: block; font-size: 17px; font-weight: 800; }
.plancard b + span { display: block; font-size: 14px; color: var(--text-2); font-weight: 600; margin-top: 2px; }
.grp-h { font-size: 13px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; padding: 22px calc(var(--gutter) + 4px) 8px; }
.row .tile.sm svg { width: 18px; height: 18px; }

/* ---------- Sheets ---------- */
.layer-sheets { position: absolute; inset: 0; z-index: 100; pointer-events: none; }
.sheet-wrap { position: absolute; inset: 0; pointer-events: auto; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .32s var(--ease); }
.sheet-wrap.open .sheet-scrim { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--safe-top) - 10px); display: flex; flex-direction: column;
  background: var(--bg-elev); border-radius: 30px 30px 0 0; box-shadow: var(--shadow-2); transform: translateY(105%); transition: transform .42s var(--ease); will-change: transform; }
html[data-theme="dark"] .sheet { background: #12161C; }
.sheet-wrap.open .sheet { transform: translateY(0); }
.sheet-wrap.closing .sheet { transform: translateY(105%); transition: transform .26s var(--ease-in); }
.sheet-wrap.closing .sheet-scrim { opacity: 0; transition-duration: .26s; }
.sheet.dragging { transition: none; }
.sheet-grab { flex: none; height: 26px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grab span { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); }
.sheet-body { --edge: 20px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px calc(var(--safe-bottom) + 18px); margin-top: -6px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 10px); mask-image: linear-gradient(180deg, transparent 0, #000 10px); }
.sheet-body::-webkit-scrollbar { display: none; }
.sheet.tall { height: calc(100% - var(--safe-top) - 10px); }
.sheet.full { top: 0; max-height: none; height: 100%; border-radius: 0; background: var(--bg); }
.sheet.full .sheet-body { padding: 0; margin-top: 0; -webkit-mask-image: none; mask-image: none; }
.sheet.fade { transform: none; opacity: 0; transition: opacity .35s var(--ease); }
.sheet-wrap.open .sheet.fade { opacity: 1; }
.sheet-wrap.closing .sheet.fade { opacity: 0; transform: none; }
.sheet-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.sheet-h h2 { font-size: 24px; font-weight: 800; letter-spacing: -.025em; line-height: 1.18; }
.sheet-h p { font-size: 15px; color: var(--text-2); font-weight: 600; margin-top: 5px; line-height: 1.4; }
.sheet-x { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--text-2); }
.sheet-foot { position: sticky; bottom: calc(-1 * (var(--safe-bottom) + 18px)); margin: 16px -20px calc(-1 * (var(--safe-bottom) + 18px)); padding: 12px 20px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(180deg, transparent 0, var(--bg-elev) 18px); }
html[data-theme="dark"] .sheet-foot { background: linear-gradient(180deg, rgba(18,22,28,0) 0, #12161C 18px); }
.sheet-foot .cap { font-size: 13px; color: var(--text-3); text-align: center; margin-top: 10px; font-weight: 600; line-height: 1.4; }

/* add sheet */
.addgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.addopt { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); min-height: 128px; text-align: left; transition: transform .12s var(--ease), background .15s; }
html[data-theme="dark"] .addopt { background: var(--card-2); }
.addopt:active { transform: scale(.97); }
.addopt b { font-size: 17px; font-weight: 800; }
.addopt b + span { font-size: 13.5px; color: var(--text-3); font-weight: 600; line-height: 1.35; }
.addopt .lim { position: absolute; top: 12px; right: 12px; }
.addopt.main { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--card)) 0%, var(--card) 100%); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.repeat { margin-top: 18px; }
.repeat h3 { font-size: 14px; font-weight: 800; color: var(--text-3); margin-bottom: 8px; }

/* voice */
.voice { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 0 4px; }
.voice-orb { position: relative; width: 124px; height: 124px; margin: 14px 0 18px; border-radius: 50%; display: grid; place-items: center; color: var(--accent-ink);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 70%, #fff) 0%, var(--accent) 45%, var(--accent-2) 100%); }
.voice-orb::before, .voice-orb::after { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); animation: ripple 1.8s ease-out infinite; }
.voice-orb::after { animation-delay: .9s; }
.voice.idle .voice-orb::before, .voice.idle .voice-orb::after, .voice.done .voice-orb::before, .voice.done .voice-orb::after { animation: none; opacity: 0; }
@keyframes ripple { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.wave { display: flex; align-items: center; gap: 4px; height: 36px; margin-bottom: 10px; }
.wave i { width: 4px; border-radius: 3px; background: var(--accent-text); height: 8px; animation: wave 1s ease-in-out infinite; }
.voice.idle .wave i, .voice.done .wave i { animation: none; height: 4px; opacity: .4; }
@keyframes wave { 0%, 100% { height: 6px; } 50% { height: 30px; } }
.transcript { min-height: 64px; font-size: 21px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; padding: 0 6px; }
.transcript .ph { color: var(--text-3); font-weight: 600; font-size: 17px; }
.transcript .caret { display: inline-block; width: 2px; height: 22px; background: var(--accent); vertical-align: -3px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.samples { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.samples .chip { height: 32px; font-size: 13.5px; font-weight: 600; }
.parsed { width: 100%; margin-top: 10px; text-align: left; }

/* keypad / manual */
.amount-disp { display: flex; align-items: baseline; justify-content: center; gap: 4px; min-height: 76px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.amount-disp .cur { font-size: 36px; color: var(--text-2); }
.amount-disp .v { font-size: 64px; line-height: 1; }
.amount-disp .v.ph { color: var(--text-3); }
.amount-disp .caret { width: 3px; height: 54px; background: var(--accent); align-self: center; animation: blink 1s steps(2) infinite; border-radius: 2px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.key { height: 58px; border-radius: 16px; background: var(--card-2); font-size: 26px; font-weight: 700; display: grid; place-items: center; transition: background .1s, transform .1s; font-variant-numeric: tabular-nums; }
html[data-theme="light"] .key { background: var(--card); border: 1px solid var(--line); }
.key:active { background: var(--card-3); transform: scale(.96); }
.catpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.catpick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px; border-radius: 16px; font-size: 12px; font-weight: 700; color: var(--text-2); line-height: 1.2; text-align: center; border: 1.5px solid transparent; }
.catpick button.on { background: var(--card-2); border-color: var(--cc); color: var(--text); }

/* camera */
.cam { position: absolute; inset: 0; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam-top { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-top) + 6px) 16px 8px; }
.cam-top .icon-btn { color: #fff; background: rgba(255,255,255,.12); width: 40px; height: 40px; border-radius: 50%; }
.cam-top .pill { background: rgba(255,255,255,.14); color: #fff; }
.cam-view { position: relative; flex: 1; margin: 0 12px; border-radius: 26px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(120% 80% at 50% 40%, #3A3530 0%, #1B1916 55%, #0C0B0A 100%); }
.receipt { width: 212px; background: #FBFAF6; color: #2B2B2B; font-family: 'Courier New', ui-monospace, monospace; font-size: 11px; line-height: 1.45; padding: 16px 14px 20px; transform: rotate(-3deg) translateY(6px); box-shadow: 0 18px 40px rgba(0,0,0,.55);
  -webkit-mask: linear-gradient(#000 0 0) top/100% calc(100% - 8px) no-repeat, radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) bottom/12px 9px repeat-x;
  mask: linear-gradient(#000 0 0) top/100% calc(100% - 8px) no-repeat, radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) bottom/12px 9px repeat-x; }
.receipt .rh { text-align: center; font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.receipt .rs { text-align: center; font-size: 9.5px; color: #666; margin-bottom: 8px; }
.receipt .rl { display: flex; justify-content: space-between; gap: 8px; }
.receipt .rl span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt .rt { border-top: 1px dashed #999; margin-top: 6px; padding-top: 6px; font-weight: 700; font-size: 13px; }
.receipt .ri { font-size: 9.5px; color: #666; }
.cam-guides { position: absolute; inset: 24px 30px; pointer-events: none; }
.cam-guides i { position: absolute; width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.9); }
.cam-guides i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.cam-guides i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.cam-guides i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.cam-guides i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.cam-scan { position: absolute; left: 30px; right: 30px; height: 3px; top: 24px; background: linear-gradient(90deg, transparent, var(--accent), transparent); box-shadow: 0 0 18px var(--accent); display: none; }
.cam.scanning .cam-scan { display: block; animation: scan 1.1s ease-in-out infinite alternate; }
@keyframes scan { to { top: calc(100% - 27px); } }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam.flash .cam-flash { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.cam-hint { text-align: center; font-size: 15px; font-weight: 700; padding: 14px 20px 6px; color: rgba(255,255,255,.88); min-height: 44px; }
.cam-bot { display: flex; align-items: center; justify-content: space-around; padding: 10px 24px calc(var(--safe-bottom) + 18px); }
.cam-bot .icon-btn { color: #fff; width: 48px; height: 48px; background: rgba(255,255,255,.12); border-radius: 50%; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; display: grid; place-items: center; }
.shutter i { width: 60px; height: 60px; border-radius: 50%; background: #fff; transition: transform .12s; }
.shutter:active i { transform: scale(.88); }

/* statement */
.dropzone { border: 2px dashed var(--line-2); border-radius: 22px; padding: 22px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dropzone b { font-size: 16px; }
.dropzone span { font-size: 14px; color: var(--text-3); font-weight: 600; }
.filerow .tile { font-size: 11px; font-weight: 800; }
.steps { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 6px; }
.steps li { display: flex; gap: 10px; align-items: center; font-size: 15.5px; font-weight: 700; color: var(--text-3); transition: color .2s; }
.steps li .sdot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; }
.steps li.on { color: var(--text); }
.steps li.on .sdot { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--text); }
.steps li.done .sdot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); animation: none; }

/* income / distribution */
.inc-head { text-align: center; padding: 4px 0 8px; }
.inc-head small { display: block; font-size: 15px; font-weight: 700; color: var(--text-2); }
.inc-head b { display: block; font-size: 48px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.inc-head .from { font-size: 14.5px; color: var(--text-3); font-weight: 600; }
.detect { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0 14px; }
.part { border-radius: 18px; background: var(--card); border: 1px solid var(--line); margin-bottom: 8px; overflow: hidden; }
html[data-theme="dark"] .part { background: var(--card-2); }
.part-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; }
.part-row .main { flex: 1; min-width: 0; }
.part-row .main b { display: block; font-size: 16px; font-weight: 800; }
.part-row .main span { display: block; font-size: 13px; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.part-row .amt { font-size: 17px; }
.part-row .lock { color: var(--text-3); }
.part-edit { padding: 0 14px 14px; }
.part-edit .lbl { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--text-3); margin-top: 2px; }
.part.editing { border-color: color-mix(in srgb, var(--cc) 60%, transparent); }
.who { display: grid; gap: 10px; margin-top: 8px; }
.whobtn { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: var(--card-2); text-align: left; }
.whobtn b { display: block; font-size: 17px; font-weight: 800; }
.whobtn b + span { display: block; font-size: 13.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; }

/* ---------- Toast ---------- */
.layer-toast { position: absolute; z-index: 300; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); pointer-events: none; }
.layer-toast.over-sheet { bottom: calc(var(--safe-bottom) + 12px); }
.toast { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 13px 14px 15px 16px; border-radius: 20px; background: var(--toast-bg); color: var(--toast-text);
  box-shadow: 0 12px 26px -10px rgba(0,0,0,.45); pointer-events: auto; transform: translateY(20px) scale(.97); opacity: 0; transition: transform .35s var(--spring), opacity .25s; }
.toast.show { transform: none; opacity: 1; }
.toast-ic { flex: none; color: var(--toast-accent); }
.toast-text { flex: 1; min-width: 0; }
.toast-text b { display: block; font-size: 15px; font-weight: 800; line-height: 1.3; }
.toast-text span { display: block; font-size: 13.5px; font-weight: 600; color: var(--toast-sub); margin-top: 2px; line-height: 1.35; }
.toast-undo { flex: none; height: 38px; padding: 0 14px; border-radius: 12px; font-size: 15px; font-weight: 800; color: var(--toast-accent); background: color-mix(in srgb, var(--toast-accent) 12%, transparent); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--toast-accent); transform-origin: left; animation: toastbar linear forwards; }
@keyframes toastbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Push banners ---------- */
.layer-banner { position: absolute; z-index: 600; top: calc(var(--safe-top) + 4px); left: 8px; right: 8px; pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
.banner { pointer-events: auto; padding: 12px 14px 13px; border-radius: 24px; background: var(--banner-bg); color: var(--banner-text); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 12px 34px rgba(0,0,0,.3); transform: translateY(-140%); transition: transform .45s var(--spring), opacity .3s; cursor: pointer; touch-action: none; }
.banner.show { transform: none; }
.banner.hide { transform: translateY(-140%); opacity: 0; transition-timing-function: var(--ease-in); transition-duration: .3s; }
.banner-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--banner-sub); font-family: var(--font-sys); }
.banner-top .appic { width: 20px; height: 20px; border-radius: 6px; }
.banner-top .when { margin-left: auto; }
.banner-body { display: flex; gap: 10px; margin-top: 6px; }
.banner-body .appic { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.banner-body b { display: block; font-size: 15px; font-weight: 800; line-height: 1.3; }
.banner-body p { font-size: 14.5px; line-height: 1.38; margin-top: 1px; font-weight: 500; }
.banner-acts { display: flex; gap: 8px; margin-top: 10px; }
.banner-acts button { flex: 1; height: 38px; border-radius: 12px; font-size: 14.5px; font-weight: 800; background: color-mix(in srgb, var(--banner-text) 10%, transparent); }
.banner-acts button.p { background: var(--accent); color: var(--accent-ink); }
.appic { display: grid; place-items: center; overflow: hidden; }
.appic svg { width: 100%; height: 100%; }

/* ---------- Dialog (system alert) ---------- */
.layer-dialog { position: absolute; inset: 0; z-index: 700; pointer-events: none; }
.dialog-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.4); pointer-events: auto; opacity: 0; transition: opacity .2s; }
.dialog-wrap.open { opacity: 1; }
.dialog { width: 272px; border-radius: 16px; overflow: hidden; background: rgba(242,242,247,.96); color: #000; font-family: var(--font-sys); text-align: center; transform: scale(1.12); transition: transform .28s var(--spring); backdrop-filter: blur(20px); }
html[data-theme="dark"] .dialog { background: rgba(44,44,48,.97); color: #fff; }
.dialog-wrap.open .dialog { transform: none; }
.dialog-in { padding: 18px 16px 16px; }
.dialog h3 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.dialog p { font-size: 13px; line-height: 1.38; margin-top: 4px; }
.dialog .acts { display: flex; border-top: .5px solid rgba(128,128,128,.4); }
.dialog .acts.col { flex-direction: column; }
.dialog .acts button { flex: 1; height: 44px; font-size: 17px; color: #0A7AFF; font-family: var(--font-sys); text-align: center; }
html[data-theme="dark"] .dialog .acts button { color: #0A84FF; }
.dialog .acts button + button { border-left: .5px solid rgba(128,128,128,.4); }
.dialog .acts.col button + button { border-left: 0; border-top: .5px solid rgba(128,128,128,.4); }
.dialog .acts button.b { font-weight: 600; }
.dialog .acts button.red { color: #FF3B30; }

/* ---------- Onboarding ---------- */
.ob { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(var(--safe-top) + 4px) 20px calc(var(--safe-bottom) + 16px); background:
  radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--bg); overflow-y: auto; scrollbar-width: none; }
.ob::-webkit-scrollbar { display: none; }
.ob-top { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.ob-top .icon-btn { margin-left: -10px; }
.ob-prog { flex: 1; display: flex; gap: 6px; }
.ob-prog i { flex: 1; height: 5px; border-radius: 3px; background: var(--card-3); }
.ob-prog i.on { background: var(--accent); }
.ob-body { flex: 1; display: flex; flex-direction: column; padding-top: 12px; }
.ob-body.anim { animation: obIn .4s var(--ease) both; }
@keyframes obIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.ob-body.anim.back { animation-name: obBack; }
@keyframes obBack { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.ob h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
.ob .lead { font-size: 16.5px; color: var(--text-2); line-height: 1.5; margin-top: 10px; font-weight: 500; }
.ob-foot { padding-top: 16px; }
.ob-foot .cap { text-align: center; font-size: 13.5px; font-weight: 700; color: var(--text-3); margin-top: 12px; }
.optcard { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; background: var(--card); border: 1.5px solid var(--line); text-align: left; transition: border-color .15s, transform .12s, background .15s; }
.optcard + .optcard { margin-top: 10px; }
.optcard:active { transform: scale(.985); }
.optcard.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.optcard .main { flex: 1; min-width: 0; }
.optcard b { display: block; font-size: 17px; font-weight: 800; }
.optcard .main > span { display: block; font-size: 14px; color: var(--text-3); font-weight: 600; margin-top: 3px; line-height: 1.35; }
.optcard .radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.optcard.on .radio { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.welcome-art { position: relative; height: 304px; margin: 4px -4px 0; }
.wa-phone { position: absolute; left: 50%; top: 12px; width: 220px; margin-left: -110px; padding: 18px; border-radius: 28px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.wa-phone small { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.wa-phone b { display: block; font-size: 50px; font-weight: 800; letter-spacing: -.045em; line-height: 1.05; margin: 4px 0; }
.wa-phone span { font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.wa-phone .bar { margin-top: 12px; height: 6px; }
.wa-chip { position: absolute; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-soft); font-size: 13px; font-weight: 800; animation: bob 4s ease-in-out infinite; }
.wa-chip .tile { width: 28px; height: 28px; border-radius: 9px; }
.wa-chip small { display: block; font-size: 11px; color: var(--text-3); font-weight: 700; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.langs { display: flex; justify-content: center; margin-top: 18px; }
.qa { margin-top: 20px; }
.qa + .qa { margin-top: 18px; }
.qa b { display: block; font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.bank-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.bank-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 15px; font-weight: 800; text-align: left; }
.bank-av { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; flex: none; }
.plan-num { text-align: center; padding: 18px 16px; border-radius: 26px; margin-top: 16px; background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%), var(--card); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.plan-num small { display: block; font-size: 15px; font-weight: 700; color: var(--text-2); }
.plan-num b { display: block; font-size: 56px; font-weight: 800; letter-spacing: -.045em; line-height: 1.1; margin: 2px 0; font-variant-numeric: tabular-nums; }
.plan-num span { font-size: 14px; font-weight: 700; color: var(--text-3); }
.checks li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.checks li + li { border-top: 1px solid var(--line); }
.checks .ck { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.checks b { display: block; font-size: 15.5px; font-weight: 800; line-height: 1.3; }
.checks b + span { display: block; font-size: 13.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; line-height: 1.35; }

/* ---------- Phone home / lock ---------- */
.home { position: absolute; inset: 0; color: #fff; font-family: var(--font-sys); display: flex; flex-direction: column; padding: calc(var(--safe-top) + 14px) 22px calc(var(--safe-bottom) + 14px);
  background: radial-gradient(120% 70% at 20% 10%, #2D6C8C 0%, transparent 60%), radial-gradient(120% 80% at 90% 90%, #7A3F8E 0%, transparent 60%), linear-gradient(160deg, #0F2A3A 0%, #1B1537 55%, #2A1030 100%); }
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.widget { border-radius: 24px; padding: 14px; background: rgba(20,24,30,.55); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); text-align: left; color: #fff; display: flex; flex-direction: column; aspect-ratio: 1; font-family: var(--font); }
.widget.wide { grid-column: span 2; aspect-ratio: auto; height: 158px; flex-direction: row; align-items: stretch; gap: 14px; }
.widget small { font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,.72); }
.widget b { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin-top: 4px; }
.widget .wsub { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.66); margin-top: auto; }
.widget .wmic { width: 64px; height: 64px; border-radius: 50%; background: #3DDC97; color: #03200F; display: grid; place-items: center; margin: auto; }
.widget .wbtn { flex: none; width: 110px; border-radius: 18px; background: #3DDC97; color: #03200F; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 800; }
.widget-cap { text-align: center; font-size: 12px; color: rgba(255,255,255,.85); margin-top: 6px; font-weight: 600; }
.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 16px; margin-top: 26px; }
.appx { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: #fff; }
.appx i { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; }
.appx i svg { width: 28px; height: 28px; }
.appx.me i { background: none; }
.dock { margin-top: auto; padding: 14px; border-radius: 30px; background: rgba(255,255,255,.18); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); display: flex; justify-content: space-around; }
.dock .appx i { width: 58px; height: 58px; }
.home-hint { text-align: center; font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,.8); margin: 14px 0; }
.lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: calc(var(--safe-top) + 60px) 24px calc(var(--safe-bottom) + 24px); background: var(--bg); text-align: center; }
.lock .faceid { width: 88px; height: 88px; margin: 34px 0 16px; color: var(--accent-text); }
.lock .faceid svg { width: 100%; height: 100%; }
.lock.scan .faceid { animation: faceScan 1s ease-in-out; }
@keyframes faceScan { 0% { transform: scale(1); } 40% { transform: scale(.9); opacity: .6; } 100% { transform: scale(1); } }
.pin-dots { display: flex; gap: 16px; justify-content: center; margin: 22px 0 26px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--text-2); }
.pin-dots i.on { background: var(--text); border-color: var(--text); }
.pinpad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 24px; justify-content: center; }
.pinpad button { width: 76px; height: 76px; border-radius: 50%; background: var(--card-2); font-size: 30px; font-weight: 600; display: grid; place-items: center; }
.pinpad button.ghost { background: none; font-size: 15px; font-weight: 700; color: var(--text-2); }
.pinpad button:active { background: var(--card-3); }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding: 8px var(--gutter) 12px; }
.msg { max-width: 84%; padding: 11px 14px; border-radius: 20px; font-size: 15.5px; line-height: 1.45; font-weight: 500; animation: cardIn .35s var(--ease) both; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; font-weight: 600; }
.msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.bot b { font-weight: 800; }
.msg .act { margin-top: 10px; }
.chat-input { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; padding: 10px 12px calc(var(--safe-bottom) + 10px); background: var(--bg); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.chat-input .input { height: 46px; border-radius: 23px; }
.chat-input .send { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.typing i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); margin: 0 2px; animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Reports ---------- */
.trend { padding: 16px; }
.trend-h { display: flex; align-items: center; gap: 12px; }
.trend-h .main { flex: 1; }
.trend-h b { display: block; font-size: 16.5px; font-weight: 800; }
.trend-h .main > span { display: block; font-size: 14px; color: var(--text-2); font-weight: 600; margin-top: 2px; }
.trend-bars { margin-top: 12px; display: grid; gap: 6px; }
.trend-bars .tb { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; font-size: 13px; font-weight: 700; color: var(--text-3); }
.trend-bars .tb b { font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.arrow-up, .arrow-down { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 14px; }
.arrow-good { color: var(--accent-text); }
.arrow-meh { color: var(--warn-text); }

/* ---------- Plus ---------- */
.plus-hero { text-align: center; padding: 8px 8px 18px; }
.plus-hero .logo { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(135deg, var(--c-taxes), var(--accent)); color: #fff; }
.plus-hero h2 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.plus-hero p { font-size: 15.5px; color: var(--text-2); margin-top: 8px; line-height: 1.5; font-weight: 500; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 800; padding: 10px 6px; text-align: center; }
.cmp th:first-child { text-align: left; }
.cmp td { padding: 11px 6px; border-top: 1px solid var(--line); font-weight: 600; color: var(--text-2); vertical-align: middle; text-align: center; }
.cmp td:first-child { text-align: left; color: var(--text); font-weight: 700; }
.cmp td .ic { margin: 0 auto; }
.cmp .yes { color: var(--accent-text); }
.cmp .no { color: var(--text-3); }
.price { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
.price button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px 14px; border-radius: 20px; border: 2px solid var(--line-2); text-align: left; background: var(--card); }
.price button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.price .ptop { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-height: 24px; font-size: 13.5px; font-weight: 800; color: var(--text-2); }
.price .save { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 8px; font-size: 12.5px; font-weight: 800; line-height: 1; background: var(--accent); color: var(--accent-ink); }
.price b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.price b + span { display: block; font-size: 13px; font-weight: 700; color: var(--text-3); line-height: 1.3; }

/* ---------- Misc ---------- */
.spark { animation: spark .6s var(--ease); }
@keyframes spark { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.privacy .money { filter: blur(9px); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.appicon-lg { width: 72px; height: 72px; border-radius: 20px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kbd-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); font-weight: 700; }
.copybox { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--card-2); font-weight: 800; font-size: 15px; word-break: break-all; }
.copybox span { flex: 1; }
.tg { border-radius: 22px; overflow: hidden; background: #17212B; color: #fff; padding: 12px; font-family: var(--font-sys); }
.tg .tgm { max-width: 80%; padding: 8px 11px; border-radius: 14px; font-size: 14px; line-height: 1.4; margin-bottom: 6px; }
.tg .tgm.u { margin-left: auto; background: #2B5278; border-bottom-right-radius: 4px; }
.tg .tgm.b { background: #182533; border: 1px solid #243447; border-bottom-left-radius: 4px; }
.tg .tgm small { display: block; font-size: 11px; opacity: .6; margin-top: 3px; }
.step-list { counter-reset: s; }
.step-list li { position: relative; padding: 0 0 16px 44px; font-size: 15px; line-height: 1.5; color: var(--text-2); font-weight: 500; }
.step-list li b { color: var(--text); font-weight: 800; }
.step-list li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Today: calm top ---------- */
.today-gap { height: 8px; }
.hero-num.l .int { font-size: 62px; } .hero-num.l .cur, .hero-num.l .post { font-size: 32px; } .hero-num.l .dec { font-size: 30px; }
.hero-num.xl .int { font-size: 46px; } .hero-num.xl .cur, .hero-num.xl .post { font-size: 26px; margin-top: 4px; } .hero-num.xl .dec { font-size: 24px; }

/* ---------- Generic bits ---------- */
.kv > span:first-child { min-width: 0; }
.kv small { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; line-height: 1.35; }
.sm-pill { height: 20px; font-size: 11px; padding: 0 7px; margin-left: 2px; }
.search-box { position: relative; }
.search-box .search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-box .input { padding-left: 42px; }
.qa-s { display: block; font-size: 14px; color: var(--text-2); font-weight: 500; line-height: 1.45; margin: -4px 0 10px; }

/* ---------- Currencies ---------- */
.cur-badge { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); font-weight: 800; font-size: 15px; color: var(--text); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; }
.cur-badge.sm { font-size: 11px; letter-spacing: 0; }
.currow { min-height: 58px; }
.curpick-list .card { margin-left: 0; margin-right: 0; }
.curpick-list .grp-h { padding-left: 4px; padding-right: 4px; }
.amount-disp .cur.cur-pick { display: inline-flex; align-items: center; gap: 2px; align-self: center; padding: 4px 6px 4px 10px; margin: 0 4px; border-radius: 14px; background: var(--card-2); font-size: 26px; letter-spacing: 0; }
.amount-disp .cur.cur-pick svg { opacity: .7; }
.amount-disp .v.long { font-size: 50px; }
.conv { text-align: center; font-size: 13.5px; color: var(--text-3); font-weight: 700; margin-top: -2px; }

/* ---------- Own and shared envelopes ---------- */
.envnew { width: calc(100% - 2 * var(--gutter)); margin: 10px var(--gutter) 0; padding: 14px 16px; display: flex; gap: 12px; align-items: center; border-radius: 22px; border: 1.5px dashed var(--line-2); text-align: left; }
.envnew:active { background: var(--card-2); }
.envnew .main { flex: 1; min-width: 0; }
.envnew .main b { display: block; font-size: 16.5px; font-weight: 800; }
.envnew .main span { display: block; font-size: 13.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; line-height: 1.35; }
.shared-ic { display: inline-grid; vertical-align: -2px; color: var(--accent-text); margin-left: 3px; }
.share-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.share-card .main { flex: 1; min-width: 0; }
.share-card b { display: block; font-size: 16px; font-weight: 800; }
.share-card .main span { display: block; font-size: 14px; color: var(--text-2); margin-top: 3px; line-height: 1.4; font-weight: 600; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.share-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); padding: 6px 0; border-radius: 14px; }
.share-grid button:active { background: var(--card-2); }
.share-grid i { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; }

/* ---------- Ask: input above the tab bar ---------- */
.chat-input { position: absolute; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); z-index: 6; padding: 8px 12px; display: flex; gap: 8px; align-items: center;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-top: 1px solid var(--line); }
.chat-input .input { height: 46px; border-radius: 23px; }
.chat-input .mic { width: 46px; height: 46px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.chat-input .send { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.ask-left { text-align: center; font-size: 13px; color: var(--text-3); font-weight: 600; margin-top: 12px; line-height: 1.45; }

/* ---------- WhatsApp bot preview ---------- */
.wa { border-radius: 22px; overflow: hidden; background: #0B141A; color: #E9EDEF; padding: 0 10px 12px; font-family: var(--font-sys); }
.wa-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin: 0 -10px 10px; background: #1F2C34; }
.wa-head b { display: block; font-size: 15px; font-weight: 600; }
.wa-head small { display: block; font-size: 12px; opacity: .7; }
.wam { position: relative; max-width: 84%; padding: 7px 10px 18px; border-radius: 10px; font-size: 14px; line-height: 1.4; margin-bottom: 6px; }
.wam.u { margin-left: auto; background: #005C4B; border-top-right-radius: 3px; }
.wam.b { background: #1F2C34; border-top-left-radius: 3px; }
.wam em { position: absolute; right: 8px; bottom: 4px; font-size: 10.5px; font-style: normal; opacity: .6; }
.wam small { display: block; font-size: 12px; opacity: .78; margin-top: 3px; }
.wa-voice { display: flex; align-items: center; gap: 3px; font-size: 12.5px; }
.wa-voice i { display: block; width: 3px; border-radius: 2px; background: currentColor; opacity: .8; height: 10px; }
.wa-voice i:nth-child(2n) { height: 16px; } .wa-voice i:nth-child(3n) { height: 7px; }
.wa-photo { display: grid; place-items: center; width: 124px; height: 78px; border-radius: 8px; background: rgba(255,255,255,.12); }
.wa-btns { display: flex; gap: 6px; margin: 8px -4px -12px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.1); }
.wa-btns span { flex: 1; text-align: center; padding: 6px 4px 8px; color: #53BDEB; font-weight: 600; font-size: 13.5px; }
html[data-theme="light"] .wa { background: #EFEAE2; color: #111B21; }
html[data-theme="light"] .wa-head { background: #F0F2F5; }
html[data-theme="light"] .wam.u { background: #D9FDD3; }
html[data-theme="light"] .wam.b { background: #FFFFFF; }
html[data-theme="light"] .wa-photo { background: rgba(0,0,0,.08); }
html[data-theme="light"] .wa-btns { border-top-color: rgba(0,0,0,.08); }
html[data-theme="light"] .wa-btns span { color: #027EB5; }

/* ---------- iPhone button ---------- */
.ip-art { position: relative; height: 232px; display: grid; place-items: center; margin: 2px 0 10px; }
.ip-phone { position: relative; width: 134px; height: 216px; border-radius: 30px; background: #0B0C0F; padding: 6px; box-shadow: 0 0 0 2px var(--line-2), var(--shadow-soft); }
.ip-side { position: absolute; left: -5px; top: 50px; width: 4px; height: 24px; border-radius: 3px 0 0 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: ipPress 2.6s ease-in-out infinite; }
.ip-side2 { position: absolute; left: -5px; top: 86px; width: 4px; height: 40px; border-radius: 3px 0 0 3px; background: #3A3E46; }
.ip-scr { position: relative; height: 100%; border-radius: 24px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 10px; }
.ip-isl { position: absolute; top: 7px; left: 50%; width: 46px; height: 14px; margin-left: -23px; border-radius: 8px; background: #000; display: flex; align-items: center; justify-content: flex-end; padding-right: 5px; }
.ip-isl i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: blink 1s steps(2) infinite; }
.ip-orb { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); animation: ipOrb 2.6s ease-in-out infinite; }
.ip-scr b { font-size: 14px; font-weight: 800; }
.ip-scr small { font-size: 11px; color: var(--text-3); font-weight: 600; line-height: 1.3; }
.ip-hint { position: absolute; font-size: 12.5px; font-weight: 800; color: var(--accent-text); white-space: nowrap; }
.ip-hint-a { right: calc(50% + 80px); top: 52px; }
.ip-hint-a::after { content: ''; display: inline-block; width: 16px; height: 2px; margin-left: 6px; vertical-align: 4px; background: currentColor; border-radius: 2px; }
@keyframes ipPress { 0%, 55%, 100% { transform: none; } 62% { transform: translateX(2px); } }
@keyframes ipOrb { 0%, 55% { transform: scale(.94); } 70% { transform: scale(1.06); } 100% { transform: scale(.94); } }

/* side keys on the desktop phone frame, used to show the iPhone button */
.side-key { position: absolute; width: 5px; border-radius: 3px 0 0 3px; background: #2A2D33; left: -10px; transition: background .2s, transform .15s, box-shadow .25s; }
.side-key.act { top: 170px; height: 34px; }
.side-key.v1 { top: 226px; height: 58px; }
.side-key.v2 { top: 294px; height: 58px; }
.side-key.pwr { left: auto; right: -10px; top: 250px; height: 92px; border-radius: 0 3px 3px 0; }
.device-frame.press-side .side-key.act { background: var(--accent); transform: translateX(2px); box-shadow: 0 0 16px var(--accent); }
.device-frame.press-back { animation: backTap .5s ease-in-out; }
@keyframes backTap { 0%, 100% { transform: scale(var(--scale, 1)); } 20%, 60% { transform: scale(var(--scale, 1)) translateY(-3px); } 40%, 80% { transform: scale(var(--scale, 1)); } }
.island { transition: width .35s var(--ease), margin-left .35s var(--ease); }
.island.listening { width: 170px; margin-left: -85px; }
.island .isl-dot { position: absolute; right: 13px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: #3DDC97; opacity: 0; transition: opacity .2s; }
.island.listening .isl-dot { opacity: 1; animation: blink 1s steps(2) infinite; }
body.is-mobile .side-key { display: none; }

/* ---------- Calm home (one number, one short card, three entries) ---------- */
.hero.calm { padding: 22px 22px 22px; }
.hero.calm .hero-label { gap: 10px; }
.hero-q { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); background: color-mix(in srgb, var(--text) 7%, transparent); }
.hero-q.pulse { animation: howPulse 2.2s ease-in-out infinite; }
.hero.calm .hero-num { margin: 12px 0 8px; }
.hero.calm .hero-sub { font-size: 15.5px; }
.acard.short { margin-top: 14px; padding: 14px 14px 14px; border-radius: 22px; }
.acard.short .acard-top { gap: 12px; padding-right: 26px; align-items: center; }
.acard.short h3 { font-size: 16.5px; line-height: 1.3; }
.acard.short p { font-size: 14px; margin-top: 2px; }
.acard.short .acard-x { top: 6px; right: 6px; width: 34px; height: 34px; }
.acard.short .acard-actions { margin-top: 12px; }
.acard.short .acard-actions .btn { height: 42px; font-size: 15px; }
.acard.short .who { margin-top: 12px; }

/* ---------- Envelopes: goals as one quiet line ---------- */
.envline { width: calc(100% - 2 * var(--gutter)); margin: 10px var(--gutter) 0; padding: 10px 14px; display: flex; align-items: center; gap: 12px; border-radius: 18px; background: transparent; border: 1px solid var(--line); color: var(--text-2); text-align: left; }
.envline:active { background: var(--card); }
.envline .main { flex: 1; font-size: 15px; font-weight: 700; }
.envline .amt { color: var(--text); font-size: 15.5px; }

/* ---------- Goals: where savings go ---------- */
.card.split { padding: 16px; }
.split-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.split-h small { display: block; font-size: 14px; font-weight: 700; color: var(--text-2); margin-bottom: 2px; }
.split-h b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.split-bar { margin-top: 14px; height: 14px; }
.split-bar > i { background: var(--cc); }
.split-legend { display: grid; gap: 8px; margin-top: 14px; }
.split-legend .sl { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.split-legend .sl i { width: 10px; height: 10px; border-radius: 50%; background: var(--cc); flex: none; }
.split-legend .sl span { flex: 1; min-width: 0; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split-legend .sl b { font-variant-numeric: tabular-nums; }
.split-note { font-size: 13.5px; color: var(--text-3); font-weight: 600; line-height: 1.45; margin-top: 12px; }
.split-row { padding: 14px; }
.split-row .top { display: flex; align-items: center; gap: 10px; }
.split-row .top .nm { flex: 1; min-width: 0; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split-row .range { margin-top: 6px; }
.split-row.cush { background: color-mix(in srgb, var(--c-cushion) 8%, var(--card)); }
html[data-theme="dark"] .split-row.cush { background: color-mix(in srgb, var(--c-cushion) 10%, var(--card-2)); }
.goalrow .tile.e-goals { color: var(--cc); background: color-mix(in srgb, var(--cc) 15%, transparent); }

/* ---------- Utilities (last, so they win over component margins) ---------- */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.wam.has-btns { padding-bottom: 0; }
.wam.has-btns em { position: static; display: block; text-align: right; margin-top: 2px; }
.wam small { margin-top: 6px; }
