:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

body[data-theme="female"] {
  --bg: #fff8f8;
  --bg-deep: #fff0f3;
  --surface: rgba(255, 255, 255, .84);
  --surface-solid: #fffdfd;
  --surface-soft: #fff1f4;
  --ink: #31232b;
  --ink-soft: #59434e;
  --muted: #99858f;
  --faint: #b9a7b0;
  --primary: #eb718d;
  --primary-dark: #d45b79;
  --primary-soft: #ffe4ea;
  --primary-pale: #fff1f4;
  --accent: #f6b2c2;
  --border: rgba(214, 118, 145, .13);
  --hero-a: #ef8199;
  --hero-b: #d969a1;
  --hero-c: #b962ba;
  --hero-shadow: 0 22px 50px rgba(213, 102, 139, .24);
  --shadow: 0 16px 44px rgba(152, 92, 116, .09);
  --shadow-small: 0 8px 24px rgba(152, 92, 116, .07);
  --nav: rgba(255, 252, 253, .91);
  --glow: rgba(244, 159, 178, .28);
  --chart-1: #ed7b93;
  --chart-2: #f4a77d;
  --chart-3: #b98cdb;
  --chart-4: #75bdb1;
  --chart-5: #93a0cd;
}

body[data-theme="male"] {
  --bg: #f6f9ff;
  --bg-deep: #edf4ff;
  --surface: rgba(255, 255, 255, .86);
  --surface-solid: #fdfefe;
  --surface-soft: #edf4ff;
  --ink: #1d293d;
  --ink-soft: #42526d;
  --muted: #7e8ba1;
  --faint: #a5b0c1;
  --primary: #507ff2;
  --primary-dark: #3967d6;
  --primary-soft: #e1ebff;
  --primary-pale: #f0f5ff;
  --accent: #9ec4fb;
  --border: rgba(76, 119, 209, .13);
  --hero-a: #6791f5;
  --hero-b: #4f75e5;
  --hero-c: #3c9acb;
  --hero-shadow: 0 22px 50px rgba(72, 112, 213, .25);
  --shadow: 0 16px 44px rgba(69, 102, 168, .09);
  --shadow-small: 0 8px 24px rgba(69, 102, 168, .07);
  --nav: rgba(250, 253, 255, .92);
  --glow: rgba(117, 161, 243, .28);
  --chart-1: #5f89ed;
  --chart-2: #65b7dc;
  --chart-3: #827ee0;
  --chart-4: #62bcaf;
  --chart-5: #9aa8c3;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(circle at 10% 6%, var(--glow), transparent 27rem),
    radial-gradient(circle at 94% 92%, rgba(255,255,255,.7), transparent 24rem),
    var(--bg-deep);
  transition: background .45s var(--ease), color .35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-user-select: none; user-select: none; }
button:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent); outline-offset: 2px; }
input { color: var(--ink); }
::selection { background: var(--primary-soft); color: var(--ink); }
.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.onboarding {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden auto;
  padding: calc(24px + var(--safe-top)) 22px calc(28px + var(--safe-bottom));
}
.ambient { position: fixed; border-radius: 999px; filter: blur(2px); pointer-events: none; opacity: .75; transition: background .45s; }
.ambient-one { width: 340px; height: 340px; top: -190px; right: -130px; background: radial-gradient(circle, var(--glow), transparent 68%); }
.ambient-two { width: 320px; height: 320px; left: -210px; bottom: -80px; background: radial-gradient(circle, rgba(255,255,255,.9), transparent 70%); }
.onboarding-shell { width: 100%; max-width: 460px; margin: 0 auto; }
.brand-lockup { display: flex; align-items: center; gap: 9px; min-height: 38px; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(145deg, var(--hero-a), var(--hero-c)); display: grid; place-items: center; box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 25%, transparent); transition: background .35s; }
.brand-mark span { display: block; width: 14px; height: 16px; border: 2px solid #fff; border-bottom: 0; border-radius: 12px 12px 3px 3px; position: relative; }
.brand-mark span::after { content: ""; position: absolute; left: -3px; right: -3px; bottom: -3px; height: 2px; background: #fff; border-radius: 2px; }
.brand-word { font-weight: 800; font-size: 20px; letter-spacing: -.03em; }
.brand-caption { color: var(--muted); font-size: 11px; padding-left: 8px; border-left: 1px solid var(--border); transform: translateY(1px); }
.onboarding-step { padding-top: clamp(54px, 10vh, 100px); animation: rise .55s var(--ease) both; }
.step-auth { position: relative; padding-top: clamp(36px, 7vh, 72px); }
.step-kicker { display: flex; align-items: center; gap: 9px; color: var(--primary-dark); font-weight: 700; font-size: 12px; letter-spacing: .07em; }
.step-kicker span { display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: var(--primary-soft); font-size: 10px; }
.onboarding h1 { margin: 18px 0 14px; font-size: clamp(34px, 9.2vw, 44px); line-height: 1.14; letter-spacing: -.055em; font-weight: 800; }
.onboarding h1 em { color: var(--primary); font-style: normal; }
.lead { margin: 0; max-width: 370px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.gender-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.gender-card { position: relative; border: 1px solid var(--border); border-radius: 25px; padding: 10px 10px 13px; background: var(--surface); box-shadow: var(--shadow-small); text-align: left; cursor: pointer; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s, background .25s; overflow: hidden; }
.gender-card:active { transform: scale(.975); }
.gender-card.selected { border-color: var(--primary); box-shadow: 0 12px 32px color-mix(in srgb, var(--primary) 18%, transparent); }
.gender-preview { display: block; height: 144px; border-radius: 18px; position: relative; overflow: hidden; }
.female-preview { background: linear-gradient(145deg, #ffd9e2, #f9b4cf 55%, #e4adf1); }
.male-preview { background: linear-gradient(145deg, #dbeaff, #a9c7ff 55%, #9edce6); }
.gender-preview::before, .gender-preview::after { content: ""; position: absolute; border-radius: 999px; background: rgba(255,255,255,.22); }
.gender-preview::before { width: 90px; height: 90px; right: -18px; top: -25px; }
.gender-preview::after { width: 70px; height: 70px; left: -24px; bottom: -34px; }
.preview-card { position: absolute; left: 12px; right: 12px; bottom: 13px; padding: 12px; border-radius: 15px; background: rgba(255,255,255,.79); box-shadow: 0 10px 22px rgba(94,70,91,.12); backdrop-filter: blur(7px); display: flex; flex-direction: column; gap: 7px; }
.preview-line { display: block; width: 64%; height: 5px; border-radius: 999px; background: rgba(88,70,82,.13); }
.preview-line.short { width: 38%; }
.preview-amount { font-weight: 800; font-size: 19px; letter-spacing: -.04em; color: #49323e; }
.male .preview-amount { color: #293a58; }
.preview-pill { position: absolute; right: 11px; bottom: 13px; width: 27px; height: 27px; border-radius: 9px; background: #ef8ba3; }
.male .preview-pill { background: #5b83ec; }
.gender-check { position: absolute; z-index: 2; top: 17px; right: 17px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.6); display: grid; place-items: center; color: transparent; box-shadow: 0 4px 10px rgba(80,50,70,.1); transition: .25s; }
.gender-check svg { width: 14px; height: 14px; stroke-width: 2.6; }
.gender-card.selected .gender-check { background: var(--primary); color: #fff; }
.gender-copy { display: flex; flex-direction: column; gap: 4px; padding: 13px 4px 1px; }
.gender-copy strong { font-size: 15px; }
.gender-copy small { color: var(--muted); font-size: 10px; }
.onboarding-actions { margin-top: 26px; }
.primary-button { width: 100%; border: 0; border-radius: 18px; min-height: 56px; padding: 0 19px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; font-weight: 700; display: flex; justify-content: center; align-items: center; gap: 10px; box-shadow: 0 13px 28px color-mix(in srgb, var(--primary) 28%, transparent); cursor: pointer; transition: transform .2s var(--ease), opacity .2s, filter .2s; }
.primary-button:active:not(:disabled) { transform: scale(.98); filter: brightness(.98); }
.primary-button:disabled { opacity: .38; box-shadow: none; cursor: default; }
.primary-button svg { width: 19px; height: 19px; }
.primary-button.compact { min-height: 52px; }
.onboarding-actions p { margin: 12px 0 0; text-align: center; color: var(--faint); font-size: 11px; }
.round-back { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); display: grid; place-items: center; cursor: pointer; margin-bottom: 30px; box-shadow: var(--shadow-small); }
.round-back svg { width: 18px; height: 18px; }
.auth-panel { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.login-method { width: 100%; min-height: 68px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--border); border-radius: 19px; padding: 11px 14px; background: var(--surface); text-align: left; box-shadow: var(--shadow-small); cursor: pointer; transition: transform .2s var(--ease), border-color .2s; }
.login-method:active { transform: scale(.985); border-color: var(--primary); }
.method-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 14px; background: var(--primary-pale); color: var(--primary); display: grid; place-items: center; }
.method-icon svg { width: 21px; height: 21px; }
.login-method.wechat .method-icon { color: #24a562; background: #eaf8ef; }
.method-copy { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.method-copy strong { font-size: 14px; }
.method-copy small { font-size: 10px; color: var(--muted); }
.method-arrow, .row-arrow { width: 17px; height: 17px; color: var(--faint); }
.auth-form { margin-top: 28px; animation: rise .4s var(--ease) both; }
.form-back { border: 0; background: transparent; color: var(--muted); padding: 0 0 21px; display: flex; gap: 4px; align-items: center; cursor: pointer; font-size: 12px; }
.form-back svg { width: 15px; height: 15px; }
.auth-form-title { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.auth-form-title h2 { margin: 0 0 3px; font-size: 20px; }
.auth-form-title p { margin: 0; color: var(--muted); font-size: 11px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.field-label { color: var(--ink-soft); font-weight: 650; font-size: 12px; }
.field input, .years-row { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 15px; min-height: 50px; padding: 0 15px; font-size: 15px; transition: border-color .2s, box-shadow .2s; }
.field input::placeholder { color: var(--faint); font-size: 13px; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 8%, transparent); outline: 0; }
.code-row { display: grid; grid-template-columns: 1fr 116px; gap: 9px; align-items: start; }
.code-row .field { margin-bottom: 0; }
.code-button { height: 50px; border-radius: 15px; border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent); color: var(--primary-dark); background: var(--primary-pale); font-weight: 700; font-size: 12px; cursor: pointer; }
.code-button:disabled { color: var(--faint); border-color: var(--border); background: var(--surface-soft); }
.demo-hint { margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.demo-hint strong { color: var(--primary-dark); letter-spacing: .12em; }
.auth-form .primary-button { margin-top: 18px; }
.protocol { text-align: center; color: var(--faint); font-size: 9px; margin: 12px 0 0; }
.local-note { display: flex; align-items: flex-start; gap: 8px; padding: 12px 13px; border-radius: 13px; background: color-mix(in srgb, var(--primary-pale) 65%, transparent); color: var(--muted); font-size: 10px; line-height: 1.55; margin-top: 17px; }
.local-note svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; color: var(--primary); }
.text-button { border: 0; background: none; color: var(--muted); font-size: 12px; margin: 18px auto 0; padding: 8px; display: block; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.app-shell { width: min(100%, 480px); height: 100dvh; background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%); position: relative; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 0 90px rgba(57, 45, 61, .12); transition: background .35s; }
.app-content { flex: 1; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; padding-bottom: 116px; scrollbar-width: none; }
.app-content::-webkit-scrollbar { display: none; }
.page { display: none; padding: calc(22px + var(--safe-top)) 20px 22px; animation: fadeSlide .3s var(--ease) both; }
.page.active { display: block; }
.home-header, .page-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 2px 2px 21px; }
.greeting, .page-kicker { margin: 0 0 6px; font-size: 10px; letter-spacing: .14em; font-weight: 750; color: var(--primary-dark); text-transform: uppercase; }
.home-header h1, .page-header h1 { margin: 0; font-size: 24px; letter-spacing: -.045em; line-height: 1.18; }
.avatar-button { width: 43px; height: 43px; border-radius: 15px; border: 3px solid var(--surface-solid); background: linear-gradient(145deg, var(--primary-soft), var(--primary)); color: #fff; font-weight: 800; box-shadow: var(--shadow-small); cursor: pointer; }
.avatar-button span { display: grid; place-items: center; width: 100%; height: 100%; }
.hero-card { position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 22px 21px 18px; color: #fff; background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 58%, var(--hero-c) 120%); box-shadow: var(--hero-shadow); isolation: isolate; }
.hero-orb { position: absolute; border-radius: 50%; background: rgba(255,255,255,.11); pointer-events: none; }
.orb-a { width: 190px; height: 190px; right: -84px; top: -100px; }
.orb-b { width: 120px; height: 120px; left: -58px; bottom: -70px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.045); }
.hero-topline { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; font-weight: 650; color: rgba(255,255,255,.82); }
.hero-topline > span:first-child { display: flex; align-items: center; gap: 6px; }
.hero-topline svg { width: 14px; height: 14px; }
.hero-badge { min-width: 40px; text-align: center; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.17); color: #fff; backdrop-filter: blur(8px); font-size: 10px; }
.hero-amount { position: relative; display: flex; align-items: baseline; gap: 5px; margin-top: 23px; letter-spacing: -.06em; }
.hero-amount small { font-size: 21px; font-weight: 700; opacity: .9; }
.hero-amount strong { font-size: clamp(46px, 14vw, 62px); line-height: .92; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-amount span { font-size: 12px; opacity: .75; margin-left: 2px; letter-spacing: 0; }
.hero-caption { position: relative; display: flex; align-items: center; gap: 9px; margin-top: 11px; color: rgba(255,255,255,.74); font-size: 10px; }
.hero-caption i { width: 3px; height: 3px; background: rgba(255,255,255,.48); border-radius: 50%; }
.hero-bottom { position: relative; display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-top: 25px; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.16); }
.hero-bottom div:not(.hero-spark) { display: flex; flex-direction: column; gap: 4px; }
.hero-bottom small { font-size: 9px; color: rgba(255,255,255,.66); }
.hero-bottom strong { font-size: 13px; font-weight: 700; }
.hero-spark { height: 31px; display: flex; align-items: end; gap: 3px; padding-right: 1px; }
.hero-spark i { width: 4px; border-radius: 999px; background: rgba(255,255,255,.4); display: block; animation: barGrow .8s var(--ease) both; }
.hero-spark i:nth-child(1) { height: 9px; animation-delay: .04s; }
.hero-spark i:nth-child(2) { height: 16px; animation-delay: .08s; }
.hero-spark i:nth-child(3) { height: 12px; animation-delay: .12s; }
.hero-spark i:nth-child(4) { height: 23px; animation-delay: .16s; }
.hero-spark i:nth-child(5) { height: 17px; animation-delay: .2s; }
.hero-spark i:nth-child(6) { height: 27px; animation-delay: .24s; }
.hero-spark i:nth-child(7) { height: 22px; animation-delay: .28s; background: rgba(255,255,255,.82); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.mini-stat { display: flex; align-items: center; gap: 11px; padding: 14px 13px; border-radius: 19px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-small); min-width: 0; }
.mini-icon { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-pale); }
.mini-icon svg { width: 17px; height: 17px; }
.mini-stat div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mini-stat small { color: var(--muted); font-size: 9px; }
.mini-stat strong { font-size: 14px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-block { margin-top: 28px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 13px; padding: 0 2px; }
.section-kicker { margin: 0 0 4px; color: var(--faint); font-size: 8px; letter-spacing: .16em; font-weight: 750; }
.section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.04em; }
.text-link { border: 0; background: transparent; padding: 5px 0; color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.text-link svg { width: 14px; height: 14px; }
.item-list { display: flex; flex-direction: column; gap: 9px; }
.item-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 21px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-small); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.item-card:active { transform: scale(.985); }
.item-icon { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 15px; display: grid; place-items: center; position: relative; overflow: hidden; }
.item-icon::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.28), transparent 65%); }
.item-icon svg { width: 23px; height: 23px; position: relative; z-index: 1; }
.item-icon.cat-digital { color: var(--chart-1); background: color-mix(in srgb, var(--chart-1) 12%, white); }
.item-icon.cat-home { color: var(--chart-2); background: color-mix(in srgb, var(--chart-2) 14%, white); }
.item-icon.cat-transport { color: var(--chart-3); background: color-mix(in srgb, var(--chart-3) 13%, white); }
.item-icon.cat-hobby { color: var(--chart-4); background: color-mix(in srgb, var(--chart-4) 13%, white); }
.item-icon.cat-other { color: var(--chart-5); background: color-mix(in srgb, var(--chart-5) 13%, white); }
.item-main { min-width: 0; flex: 1; }
.item-main h3 { margin: 0 0 6px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em; }
.item-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.item-meta i { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.item-cost { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; gap: 4px; }
.item-cost strong { font-size: 15px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.item-cost strong small { font-size: 9px; font-weight: 650; }
.item-cost span { color: var(--muted); font-size: 8px; }
.insight-card { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 4px; padding: 15px; border-radius: 19px; background: linear-gradient(135deg, var(--primary-pale), color-mix(in srgb, var(--primary-soft) 70%, white)); border: 1px solid var(--border); }
.insight-icon { width: 33px; height: 33px; flex: 0 0 auto; border-radius: 11px; background: var(--surface-solid); color: var(--primary); display: grid; place-items: center; box-shadow: var(--shadow-small); }
.insight-icon svg { width: 17px; height: 17px; }
.insight-card div { min-width: 0; }
.insight-card small { color: var(--primary-dark); font-weight: 750; font-size: 9px; }
.insight-card p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.empty-state { border: 1px dashed color-mix(in srgb, var(--primary) 22%, transparent); background: color-mix(in srgb, var(--surface) 75%, transparent); border-radius: 22px; padding: 28px 20px; text-align: center; }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 18px; background: var(--primary-pale); color: var(--primary); display: grid; place-items: center; }
.empty-icon svg { width: 24px; height: 24px; }
.empty-state h3 { margin: 0 0 6px; font-size: 15px; }
.empty-state p { margin: 0 auto; max-width: 250px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.empty-state button { margin-top: 15px; border: 0; background: var(--primary); color: white; border-radius: 13px; padding: 10px 17px; font-size: 11px; font-weight: 700; cursor: pointer; }
.page-header .icon-button { width: 42px; height: 42px; border: 0; border-radius: 14px; display: grid; place-items: center; cursor: pointer; }
.primary-soft { color: var(--primary-dark); background: var(--primary-soft); }
.header-chip { padding: 7px 10px; border-radius: 999px; background: var(--primary-pale); color: var(--primary-dark); font-size: 10px; font-weight: 700; }
.ledger-overview { display: flex; align-items: center; padding: 17px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-small); }
.ledger-overview > div:not(.ledger-divider) { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.ledger-overview small { color: var(--muted); font-size: 9px; }
.ledger-overview strong { font-size: 20px; letter-spacing: -.04em; white-space: nowrap; }
.ledger-overview strong span, .ledger-overview strong em { font-style: normal; font-size: 10px; color: var(--muted); font-weight: 600; }
.ledger-overview strong b { font-weight: 800; }
.ledger-divider { width: 1px; height: 28px; background: var(--border); margin: 0 20px; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; padding: 16px 1px 15px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 8px 14px; font-size: 10px; cursor: pointer; transition: .2s; }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 24%, transparent); }
.ledger-list { gap: 10px; }
.stats-hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 22px; border-radius: 26px; background: linear-gradient(135deg, var(--primary-soft), var(--primary-pale) 65%, var(--surface)); border: 1px solid var(--border); }
.stats-hero::after { content: ""; position: absolute; width: 130px; height: 130px; border-radius: 50%; right: -50px; top: -70px; background: color-mix(in srgb, var(--primary) 8%, transparent); }
.stats-hero > div:first-child { position: relative; z-index: 1; min-width: 0; }
.stats-hero small { color: var(--muted); font-size: 9px; }
.stats-hero strong { display: flex; align-items: baseline; gap: 3px; margin-top: 7px; letter-spacing: -.05em; }
.stats-hero strong span { font-size: 14px; color: var(--primary-dark); }
.stats-hero strong b { font-size: 34px; line-height: 1; }
.stats-hero strong em { font-size: 9px; color: var(--muted); font-style: normal; font-weight: 600; }
.stats-hero p { margin: 8px 0 0; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-orb { position: relative; z-index: 1; flex: 0 0 auto; width: 80px; height: 80px; border-radius: 50%; background: var(--surface); border: 1px solid rgba(255,255,255,.8); box-shadow: var(--shadow-small); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stats-orb span { color: var(--faint); font-size: 9px; }
.stats-orb b { font-size: 19px; letter-spacing: -.04em; }
.stats-orb small { color: var(--faint); font-size: 8px; }
.chart-card { margin-top: 12px; padding: 19px; border-radius: 25px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-small); }
.compact-heading { margin-bottom: 18px; }
.tiny-tag { padding: 5px 8px; color: var(--muted); font-size: 8px; border-radius: 999px; background: var(--surface-soft); }
.donut-wrap { display: flex; align-items: center; gap: 21px; }
.donut { width: 132px; height: 132px; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--primary-soft) 0 100%); position: relative; display: grid; place-items: center; }
.donut::after { content: ""; position: absolute; inset: 14px; background: var(--surface-solid); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--border); }
.donut-hole { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; gap: 3px; }
.donut-hole small { color: var(--muted); font-size: 8px; }
.donut-hole strong { font-size: 14px; letter-spacing: -.04em; }
.legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 9px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.legend-item span:nth-child(2) { color: var(--muted); flex: 1; }
.legend-item strong { font-size: 9px; }
.stats-list-section { margin-top: 25px; }
.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.rank-number { width: 23px; color: var(--faint); text-align: center; font-weight: 800; font-size: 11px; }
.rank-item:nth-child(1) .rank-number { color: var(--primary); }
.rank-main { min-width: 0; flex: 1; }
.rank-main strong { display: block; font-size: 12px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 5px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.rank-cost { text-align: right; font-size: 11px; font-weight: 750; white-space: nowrap; }
.rank-cost small { font-size: 8px; color: var(--muted); font-weight: 500; }
.tip-card { display: flex; align-items: flex-start; gap: 11px; margin-top: 17px; padding: 15px; border-radius: 19px; background: var(--primary-pale); border: 1px solid var(--border); }
.tip-card > span { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; color: var(--primary); background: var(--surface); border-radius: 10px; }
.tip-card svg { width: 16px; height: 16px; }
.tip-card strong { font-size: 10px; }
.tip-card p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.profile-card { display: flex; align-items: center; gap: 13px; padding: 17px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-small); }
.profile-avatar { width: 54px; height: 54px; border-radius: 18px; flex: 0 0 auto; display: grid; place-items: center; background: linear-gradient(145deg, var(--primary-soft), var(--primary)); color: #fff; font-weight: 800; font-size: 20px; box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 22%, transparent); }
.profile-copy { flex: 1; min-width: 0; }
.profile-copy h2 { margin: 0 0 5px; font-size: 17px; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-copy p { margin: 0; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 8px; }
.sync-pill i { width: 5px; height: 5px; border-radius: 50%; background: #e5a65f; }
.settings-card { margin-top: 12px; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-small); }
.settings-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 12px; font-weight: 700; }
.settings-title small { color: var(--muted); font-size: 8px; font-weight: 500; }
.theme-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px; border-radius: 15px; background: var(--surface-soft); }
.theme-switch button { display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; background: transparent; border-radius: 12px; min-height: 38px; color: var(--muted); font-size: 10px; cursor: pointer; transition: .2s; }
.theme-switch button.active { background: var(--surface-solid); color: var(--ink); box-shadow: 0 4px 12px rgba(50,40,50,.07); font-weight: 700; }
.theme-dot { width: 9px; height: 9px; border-radius: 50%; }
.theme-dot.pink { background: #eb718d; }
.theme-dot.blue { background: #507ff2; }
.sync-card { display: flex; align-items: center; gap: 11px; }
.setting-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: var(--primary-pale); color: var(--primary); }
.setting-icon svg { width: 17px; height: 17px; }
.setting-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.setting-copy strong { font-size: 11px; }
.setting-copy small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.small-action { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface-soft); color: var(--primary-dark); border-radius: 10px; padding: 7px 10px; font-size: 9px; font-weight: 700; cursor: pointer; }
.settings-group { margin-top: 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-small); overflow: hidden; }
.setting-row { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; display: flex; align-items: center; gap: 11px; min-height: 63px; padding: 12px 15px; text-align: left; cursor: pointer; }
.setting-row:last-child { border-bottom: 0; }
.setting-row:active { background: var(--surface-soft); }
.profile-actions { margin-top: 15px; display: flex; flex-direction: column; align-items: center; gap: 15px; padding-bottom: 9px; }
.outline-button { width: 100%; min-height: 48px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--ink-soft); display: flex; justify-content: center; align-items: center; gap: 7px; font-size: 11px; cursor: pointer; }
.outline-button svg { width: 15px; height: 15px; }
.danger-text { border: 0; background: none; color: #c87c81; font-size: 9px; padding: 4px; cursor: pointer; }
.floating-add { position: absolute; z-index: 15; right: 20px; bottom: calc(81px + var(--safe-bottom)); width: 51px; height: 51px; border: 4px solid var(--bg); border-radius: 17px; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 35%, transparent); cursor: pointer; transition: transform .2s var(--ease); }
.floating-add:active { transform: scale(.92) rotate(4deg); }
.floating-add svg { width: 23px; height: 23px; stroke-width: 2.1; }
.bottom-nav { position: absolute; z-index: 14; left: 0; right: 0; bottom: 0; height: calc(74px + var(--safe-bottom)); padding: 8px 14px var(--safe-bottom); display: grid; grid-template-columns: 1fr 1fr 57px 1fr 1fr; align-items: center; background: var(--nav); border-top: 1px solid var(--border); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); }
.nav-item { border: 0; background: transparent; color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 0; cursor: pointer; transition: color .2s; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item span { font-size: 8px; }
.nav-item.active { color: var(--primary-dark); }
.nav-item.active svg { stroke-width: 2.1; }
.nav-spacer { width: 57px; }

.sheet-backdrop { position: fixed; z-index: 40; inset: 0; background: rgba(35, 25, 36, .3); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .28s, visibility .28s; }
.sheet-backdrop.open { opacity: 1; visibility: visible; }
.sheet { position: fixed; visibility: hidden; z-index: 50; left: 50%; bottom: 0; width: min(100%, 480px); max-height: 92dvh; overflow-y: auto; transform: translate(-50%, 104%); transition: transform .36s var(--ease), visibility 0s linear .36s; background: var(--bg); border-radius: 31px 31px 0 0; padding: 9px 21px calc(27px + var(--safe-bottom)); box-shadow: 0 -25px 70px rgba(43, 31, 43, .17); scrollbar-width: none; }
.sheet::-webkit-scrollbar { display: none; }
.sheet.open { visibility: visible; transform: translate(-50%, 0); transition: transform .36s var(--ease), visibility 0s linear 0s; }
.sheet-handle { width: 36px; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 25%, transparent); margin: 0 auto 18px; }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 21px; }
.sheet-header h2 { margin: 0; font-size: 23px; letter-spacing: -.045em; }
.circle-close { width: 35px; height: 35px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.circle-close svg { width: 16px; height: 16px; }
.item-sheet form { display: block; }
.category-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.category-picker button { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; min-height: 53px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--muted); font-size: 9px; cursor: pointer; transition: .2s; }
.category-picker button.selected { border-color: var(--primary); background: var(--primary-pale); color: var(--primary-dark); font-weight: 700; }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; }
.cat-dot.digital { background: var(--chart-1); }
.cat-dot.home { background: var(--chart-2); }
.cat-dot.transport { background: var(--chart-3); }
.cat-dot.hobby { background: var(--chart-4); }
.cat-dot.other { background: var(--chart-5); }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input-with-prefix { position: relative; display: block; }
.input-with-prefix b { position: absolute; z-index: 1; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; font-weight: 500; }
.input-with-prefix input { padding-left: 30px; }
.field input[type="date"] { color: var(--ink-soft); font-size: 12px; }
.years-row { display: flex; align-items: center; padding: 0 15px; }
.years-row input { min-height: auto; border: 0; padding: 0; background: transparent; box-shadow: none; }
.years-row span { color: var(--muted); font-size: 12px; }
.field-help { color: var(--faint); font-size: 8px; margin-top: -2px; }
.cost-preview { display: flex; align-items: center; padding: 14px 15px; background: var(--primary-pale); border: 1px solid var(--border); border-radius: 18px; margin: 18px 0; }
.cost-preview > div:not(.preview-divider) { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.cost-preview span { color: var(--muted); font-size: 8px; }
.cost-preview strong { letter-spacing: -.04em; }
.cost-preview strong small { color: var(--primary-dark); font-size: 11px; }
.cost-preview strong b { font-size: 23px; }
.cost-preview strong em { color: var(--muted); font-size: 8px; font-style: normal; font-weight: 500; }
.preview-divider { width: 1px; height: 31px; background: var(--border); margin: 0 15px; }
.sheet-submit { margin-top: 2px; }
.detail-hero { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 21px; background: var(--primary-pale); border: 1px solid var(--border); }
.detail-hero .item-icon { width: 57px; height: 57px; border-radius: 18px; }
.detail-hero .item-icon svg { width: 27px; height: 27px; }
.detail-heading { flex: 1; min-width: 0; }
.detail-heading h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.detail-price { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.detail-price > div { padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.detail-price small { color: var(--muted); font-size: 8px; }
.detail-price strong { font-size: 18px; letter-spacing: -.04em; }
.detail-progress { margin-top: 12px; padding: 15px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.progress-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 9px; }
.progress-label strong { color: var(--ink); font-size: 10px; }
.progress-track { height: 7px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.detail-note { margin: 12px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.detail-actions button { min-height: 48px; border-radius: 15px; border: 1px solid var(--border); display: flex; justify-content: center; align-items: center; gap: 6px; background: var(--surface); font-size: 11px; font-weight: 650; cursor: pointer; }
.detail-actions button svg { width: 15px; height: 15px; }
.detail-actions .delete-btn { color: #c76972; background: #fff6f6; }
.info-body { color: var(--ink-soft); font-size: 12px; line-height: 1.75; }
.info-body p { margin: 0 0 12px; }
.info-callout { padding: 14px; border-radius: 16px; background: var(--primary-pale); border: 1px solid var(--border); color: var(--muted); font-size: 10px; line-height: 1.65; }
.info-body ul { padding-left: 18px; margin: 12px 0; }
.info-body li { margin-bottom: 7px; }
.info-body .primary-button { margin-top: 17px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(104px + var(--safe-bottom)); transform: translate(-50%, 18px); min-width: 120px; max-width: calc(100vw - 50px); padding: 11px 16px; border-radius: 13px; background: rgba(42, 31, 42, .9); color: #fff; text-align: center; font-size: 10px; letter-spacing: .01em; opacity: 0; visibility: hidden; transition: .28s var(--ease); backdrop-filter: blur(12px); pointer-events: none; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes barGrow { from { height: 4px; opacity: .2; } }

@media (min-width: 700px) {
  body { display: flex; align-items: center; justify-content: center; padding: 22px; min-height: 100dvh; }
  .onboarding { width: 460px; min-height: calc(100dvh - 44px); max-height: calc(100dvh - 44px); border-radius: 36px; background: color-mix(in srgb, var(--bg) 91%, transparent); box-shadow: 0 30px 100px rgba(57,45,61,.14); }
  .app-shell { height: min(900px, calc(100dvh - 44px)); border-radius: 36px; }
  .sheet { width: 460px; border-radius: 31px; bottom: 50%; transform: translate(-50%, calc(50% + 110vh)); }
  .sheet.open { transform: translate(-50%, 50%); }
  .sheet-backdrop { background: rgba(35, 25, 36, .22); }
}

@media (max-width: 360px) {
  .page { padding-left: 15px; padding-right: 15px; }
  .onboarding { padding-left: 17px; padding-right: 17px; }
  .hero-card { padding-left: 18px; padding-right: 18px; }
  .hero-amount strong { font-size: 48px; }
  .mini-stat { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .mini-icon { width: 31px; height: 31px; }
  .mini-stat strong { font-size: 12px; }
  .gender-preview { height: 130px; }
  .gender-copy strong { font-size: 13px; }
  .donut-wrap { gap: 14px; }
  .donut { width: 115px; height: 115px; }
}

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