:root {
  --bg: #E6ECF4; --text: #1F2A44; --muted: #5B6680; --ink: #1F2A44; --on-ink: #F2F5FA;
  --glass: rgba(255,255,255,0.5); --glass-2: rgba(255,255,255,0.42); --glass-border: rgba(255,255,255,0.85);
  --track: rgba(31,42,68,0.08); --chip: rgba(31,42,68,0.07);
  --accent: #E8854A; --accent-soft: rgba(232,133,74,0.14); --accent-border: rgba(232,133,74,0.35); --accent-text: #8A4B22;
  --good: #2E7D62; --danger: #B3261E;
  --blob1: #C9D6E8; --blob2: #F6D9C6; --blob3: #D3DEEC;
}
:root[data-theme="dark"] {
  --bg: #0D1322; --text: #E9EEF7; --muted: #9AA6BF; --ink: #E9EEF7; --on-ink: #0D1322;
  --glass: rgba(255,255,255,0.06); --glass-2: rgba(255,255,255,0.05); --glass-border: rgba(255,255,255,0.1);
  --track: rgba(233,238,247,0.12); --chip: rgba(255,255,255,0.07);
  --accent-soft: rgba(232,133,74,0.16); --accent-border: rgba(232,133,74,0.4); --accent-text: #F3A779;
  --good: #7FC4A8; --danger: #F2B8B5;
  --blob1: #1B2742; --blob2: #3A2A26; --blob3: #18223A;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: 'Manrope', system-ui, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.blob { position: fixed; border-radius: 50%; z-index: 0; pointer-events: none; }
.b1 { width: 360px; height: 360px; background: var(--blob1); left: -140px; top: -90px; filter: blur(10px); }
.b2 { width: 300px; height: 300px; background: var(--blob2); right: -120px; top: 260px; filter: blur(40px); opacity: 0.8; }
.b3 { width: 320px; height: 320px; background: var(--blob3); left: -60px; bottom: -120px; filter: blur(20px); }
main { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 16px 120px; display: flex; flex-direction: column; gap: 14px; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1 { font-size: 26px; font-weight: 500; letter-spacing: -0.5px; margin: 0; }
h2 { font-size: 15px; font-weight: 500; margin: 0; }
p { margin: 0; line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.card { border-radius: 28px; padding: 20px; background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); display: flex; flex-direction: column; gap: 14px; }
.card.sm { border-radius: 22px; padding: 16px; gap: 6px; background: var(--glass-2); }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--chip); white-space: nowrap; }
.big { display: flex; align-items: baseline; gap: 6px; }
.big b { font-size: 56px; font-weight: 300; letter-spacing: -2px; line-height: 1; }
.big span { font-size: 28px; font-weight: 300; color: var(--muted); }
.big.neg b { color: var(--accent); }
.value { font-size: 20px; font-weight: 500; }
.good { color: var(--good); }
.track { height: 6px; border-radius: 999px; background: var(--track); position: relative; overflow: hidden; }
.track.thin { height: 5px; }
.track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--ink); }
.track i.warn { background: var(--accent); }
.track .mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--accent); }
.alert { border-radius: 22px; padding: 14px 16px; background: var(--accent-soft); border: 1px solid var(--accent-border); display: flex; align-items: center; gap: 12px; }
.badge { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.alert small { color: var(--accent-text); font-size: 12px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: flex; align-items: center; justify-content: center; font-weight: 500; flex-shrink: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 13px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--chip); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.opt { height: 52px; border-radius: 18px; border: 1px solid var(--glass-border); background: var(--glass); font-size: 13px; }
.opt[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn { height: 54px; border-radius: 27px; border: 1px solid var(--glass-border); background: var(--glass); display: flex; align-items: center; justify-content: center; font-size: 15px; padding: 0 20px; }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 500; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 500; }
.btn.danger { color: var(--danger); }
.field { height: 48px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--glass-border); background: var(--glass); width: 100%; }
textarea.field { height: auto; padding: 14px 16px; resize: vertical; line-height: 1.5; }
select.field { appearance: none; }
label.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
label.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--ink); flex-shrink: 0; }
.error { color: var(--danger); font-size: 13px; }
.key { height: 58px; border-radius: 20px; border: 1px solid var(--glass-border); background: var(--glass); font-size: 24px; }
.amount { text-align: center; padding: 10px 0 0; }
.amount .big { justify-content: center; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--track); }
.list-row:last-child { border-bottom: 0; }
.list-row .t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-row .t span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row input { width: 110px; text-align: right; height: 40px; }
.bars { height: 150px; display: flex; align-items: flex-end; gap: 6px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bars i { width: 100%; border-radius: 8px; background: var(--track); display: block; }
.bars i.cur { background: var(--accent); }
.bars span { font-size: 11px; color: var(--muted); }
.bars em { font-size: 11px; font-style: normal; color: var(--accent-text); white-space: nowrap; }
.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.donut svg { width: 140px; height: 140px; transform: rotate(-90deg); }
.donut .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tabs { position: fixed; z-index: 2; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); width: min(448px, calc(100% - 32px)); height: 68px; border-radius: 34px; background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); display: flex; align-items: center; justify-content: space-around; }
.tabs a { width: 48px; height: 48px; border-radius: 50%; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.tabs a svg { width: 22px; height: 22px; }
.tabs a.active { background: var(--ink); color: var(--on-ink); }
.tabs a.plus { width: 56px; height: 56px; background: var(--accent); color: #fff; }
.tabs a.plus svg { stroke-width: 2.2; }
.toast { position: fixed; z-index: 3; left: 50%; transform: translateX(-50%); top: 20px; padding: 12px 18px; border-radius: 16px; background: var(--ink); color: var(--on-ink); font-size: 14px; }
.legal h2 { margin-top: 8px; }
.legal p, .legal li { font-size: 14px; line-height: 1.6; }
