:root{--bg: #eef0f5;--surface: #ffffff;--surface-2: #f3f4f8;--text: #1e2233;--muted: #6b7186;--line: #e6e8ef;--brand: #4a59d6;--brand-soft: #e9ebfd;--pos: #1f8a5b;--neg: #c4452f;--warn: #b7791f;--shadow: 0 1px 2px rgba(30, 34, 51, .05);--radius: 18px;--c1: #257de0;--c2: #f47230;--c3: #00b894;--c4: #f2a600;--c5: #ee7fac;--c6: #008a17;--c7: #6a4ce2;--c8: #ec4647;--c-other: #9aa0b2;--s-in: #257de0;--s-out: #f47230;color-scheme:light}@media(prefers-color-scheme:dark){:root{--bg: #12141b;--surface: #1b1e28;--surface-2: #242835;--text: #e8eaf2;--muted: #9298ad;--line: #2b3040;--brand: #8b97ff;--brand-soft: #262b4d;--pos: #4cc38a;--neg: #ff8a76;--warn: #f0b429;--shadow: none;--c1: #338ced;--c2: #e76624;--c3: #00a888;--c4: #d28e05;--c5: #e24d8b;--c6: #0aac23;--c7: #9887ef;--c8: #eb6263;--c-other: #6b7186;--s-in: #338ced;--s-out: #e76624;color-scheme:dark}}*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--text)}body{font:15px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer}.app{max-width:760px;margin:0 auto;min-height:100dvh;padding-bottom:calc(76px + env(safe-area-inset-bottom))}.topbar{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:8px;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;background:color-mix(in srgb,var(--bg) 88%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.topbar h1{font-size:17px;margin:0;flex:1;text-align:center;font-weight:600}.topbar .title-left{text-align:left}.icon-btn{width:38px;height:38px;border-radius:12px;border:0;background:var(--surface);box-shadow:var(--shadow);display:grid;place-items:center;font-size:18px;color:var(--text)}.icon-btn:disabled{opacity:.35}.sync{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px;justify-content:center;padding:0 16px 6px}.dot{width:8px;height:8px;border-radius:50%;background:var(--pos)}.dot.offline{background:var(--warn)}.dot.error{background:var(--neg)}.dot.syncing{background:var(--brand);animation:pulse 1s infinite}@keyframes pulse{50%{opacity:.3}}.page{padding:4px 14px 16px;display:flex;flex-direction:column;gap:12px}.card{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 16px}.card h2{font-size:15px;color:var(--text);margin:0 0 8px;font-weight:600}.hero-top{display:flex;gap:14px;align-items:center}.hero .label{color:var(--muted);font-size:13px}.hero .big{font-size:28px;font-weight:650;letter-spacing:-.02em;margin:1px 0 2px;font-variant-numeric:tabular-nums}.hero .big.neg{color:var(--neg)}.hero .sub{font-size:12px;color:var(--muted)}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}.stats div{background:var(--surface-2);border-radius:12px;padding:8px 10px}.stats small{display:block;color:var(--muted);font-size:11px}.stats b{font-size:13.5px;font-weight:600;font-variant-numeric:tabular-nums}.hero-actions{margin-top:10px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;font-size:13px}.hero .link{background:var(--brand-soft);border:0;color:var(--brand);border-radius:10px;padding:6px 12px;font-size:13px;font-weight:600}.donut{flex:none;width:112px;height:112px;cursor:pointer}.donut-center{font-size:3.6px;fill:var(--muted)}.donut-value{font-size:5px;font-weight:650;fill:var(--text)}.donut-legend{display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:10px;font-size:12px;color:var(--muted)}.donut-legend button{background:none;border:0;padding:2px 0;color:inherit;font-size:12px;display:flex;align-items:center;gap:5px}.donut-legend button.sel{color:var(--text);font-weight:600}.donut-legend i{width:9px;height:9px;border-radius:3px;display:inline-block}.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px;gap:8px}.section-head h2{margin:0}.section-head .total{font-weight:650;font-size:14px}.list{list-style:none;margin:0 -16px;padding:0}.row{display:flex;align-items:center;gap:10px;padding:9px 16px;border-top:1px solid var(--line);min-height:52px}.row:first-child{border-top:0}.row .main{flex:1;min-width:0;cursor:pointer}.row .desc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.row .meta{font-size:12px;color:var(--muted);display:flex;gap:6px;flex-wrap:wrap;margin-top:1px}.row .amount{font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap;cursor:pointer}.row.done .desc,.row.done .amount{color:var(--muted)}.amount.pos{color:var(--pos)}.amount.neg{color:var(--neg)}.cat-ico{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;flex-shrink:0}.chip{background:var(--surface-2);border-radius:6px;padding:0 6px;font-size:11px;line-height:18px;display:inline-flex;align-items:center;gap:3px}.chip.person{background:var(--brand-soft);color:var(--brand)}.check{width:24px;height:24px;border-radius:8px;border:1.5px solid var(--c-other);background:transparent;display:grid;place-items:center;flex-shrink:0;padding:0;color:#fff}.check.on{background:var(--pos);border-color:var(--pos)}.empty{color:var(--muted);font-size:14px;padding:6px 0}.toggle-line{display:flex;align-items:center;gap:8px;font-size:14px}.collapse-btn{background:none;border:0;color:var(--brand);padding:4px 0;font-size:14px}.fab{position:fixed;right:max(18px,calc(50% - 362px));bottom:calc(86px + env(safe-area-inset-bottom));width:56px;height:56px;border-radius:18px;border:0;background:var(--brand);color:#fff;display:grid;place-items:center;box-shadow:0 6px 16px #1e223338;z-index:20}.fab-print{position:fixed;right:max(25px,calc(50% - 355px));bottom:calc(156px + env(safe-area-inset-bottom));width:44px;height:44px;border-radius:14px;border:1px solid var(--line);background:var(--surface);color:var(--text);display:grid;place-items:center;box-shadow:0 4px 12px #1e223324;z-index:20}.fab-print:disabled{opacity:.6}.print-note{margin:0 0 12px;padding:8px 10px;border-radius:10px;background:var(--brand-soft);font-size:13px;display:flex;gap:8px;align-items:flex-start}.print-note svg{flex:none;color:var(--brand);margin-top:1px}.tabs{position:fixed;left:0;right:0;bottom:0;z-index:15;display:flex;justify-content:center;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.tabs button{flex:1;max-width:190px;border:0;background:none;padding:8px 0 10px;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:2px;font-size:12px}.tabs button svg{display:block}.tabs button.active{color:var(--brand);font-weight:600}.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;z-index:40;display:flex;align-items:flex-end;justify-content:center}.sheet{background:var(--surface);width:100%;max-width:560px;max-height:94dvh;overflow:auto;border-radius:20px 20px 0 0;padding:14px 16px calc(16px + env(safe-area-inset-bottom));animation:up .18s ease-out}@media(min-width:700px){.backdrop{align-items:center}.sheet{border-radius:20px}}@keyframes up{0%{transform:translateY(30px);opacity:.5}}.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.sheet-head h3{margin:0;font-size:17px}.seg{display:flex;background:var(--surface-2);border-radius:12px;padding:3px;gap:3px}.seg button{flex:1;border:0;background:none;border-radius:9px;padding:8px 4px;font-size:14px;color:var(--muted)}.seg button.on{background:var(--surface);color:var(--text);font-weight:600;box-shadow:var(--shadow)}.field{display:flex;flex-direction:column;gap:4px;margin-top:12px}.field>label,.field-label{font-size:12px;color:var(--muted);font-weight:600}.input{width:100%;border:1px solid var(--line);background:var(--surface-2);border-radius:10px;padding:10px 12px;outline:none;min-height:42px}.input:focus{border-color:var(--brand)}.amount-input{font-size:28px;font-weight:700;text-align:center;padding:8px}.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hint{font-size:12px;color:var(--muted)}.hint b{color:var(--text)}.cats{display:flex;flex-wrap:wrap;gap:6px}.cats button{border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:5px 10px;font-size:13px;display:inline-flex;align-items:center;gap:5px}.cats button.on{border-color:var(--brand);background:var(--brand-soft);color:var(--brand);font-weight:600}.stepper{display:flex;align-items:center;gap:8px}.stepper button{width:36px;height:36px;border-radius:10px;border:1px solid var(--line);background:var(--surface-2)}.stepper .val{flex:1;text-align:center;font-weight:600}.actions{display:flex;gap:10px;margin-top:18px}.btn{border:0;border-radius:12px;padding:12px 16px;font-weight:600;background:var(--surface-2);flex:1}.btn.primary{background:var(--brand);color:#fff}.btn.danger{background:transparent;color:var(--neg);border:1px solid var(--line)}.btn.small{padding:7px 12px;flex:0;white-space:nowrap;font-size:13px}.btn:disabled{opacity:.5}.switch{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px;font-size:14px}.switch input{width:20px;height:20px;accent-color:var(--brand)}.bar-row{display:grid;grid-template-columns:28px 1fr auto;gap:8px;align-items:center;padding:6px 0}.bar-track{height:8px;border-radius:4px;background:var(--surface-2);overflow:hidden;margin-top:4px}.bar-fill{height:100%;border-radius:4px}.bar-name{font-size:14px;display:flex;justify-content:space-between;gap:8px}.bar-name small{color:var(--muted)}.trend{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;align-items:end;height:var(--trend-h, 150px);margin-top:8px;border-bottom:1px solid var(--line)}.trend .col{display:flex;flex-direction:column;align-items:center;gap:4px;height:100%;justify-content:flex-end}.trend .bars{display:flex;gap:2px;align-items:flex-end;height:calc(var(--trend-h, 150px) - 30px)}.trend .b{width:11px;border-radius:4px 4px 0 0;min-height:2px}.trend .col{cursor:pointer;border-radius:8px;padding:2px 0}.trend .col.sel{background:var(--surface-2)}.trend small{font-size:11px;color:var(--muted)}.legend{display:flex;gap:14px;font-size:12px;color:var(--muted);margin-top:8px}.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}.kv{display:flex;justify-content:space-between;padding:6px 0;font-size:14px;gap:10px}.kv span:first-child{color:var(--muted)}.toast{position:fixed;left:50%;transform:translate(-50%);bottom:calc(150px + env(safe-area-inset-bottom));background:var(--text);color:var(--bg);padding:10px 16px;border-radius:12px;z-index:60;font-size:14px;max-width:calc(100% - 32px)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.review-list{display:flex;flex-direction:column;gap:10px}.review-item{border:1px solid var(--line);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:8px}.review-item.off{opacity:.55}.review-top{display:flex;align-items:center;gap:8px}.review-top input[type=checkbox]{width:22px;height:22px;flex:none;accent-color:var(--brand)}.review-desc{flex:1;min-width:0;padding:8px 10px}.review-amount{flex:none;font-weight:700;font-variant-numeric:tabular-nums}.review-amount.neg{color:var(--neg, var(--text))}.review-amount.pos{color:var(--pos, var(--brand))}.review-meta{display:grid;grid-template-columns:1fr 1fr;gap:6px}.review-meta>:last-child{grid-column:1 / -1}.review-meta .input{padding:7px 8px;font-size:14px}.review-hint{margin:0}.review-hint .warn{color:#d9480f}.view-toggle{display:flex;justify-content:flex-end;margin:-4px 2px 0}.view-toggle button{background:var(--surface);border:1px solid var(--line);color:var(--muted);border-radius:999px;padding:5px 12px;font-size:13px}.view-toggle button.on{border-color:var(--brand);color:var(--brand);background:var(--brand-soft);font-weight:600}.hidden-line{color:var(--muted);font-size:13px}.trend-head{display:flex;gap:12px;align-items:center;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}.trend-head span:first-child{color:var(--text);font-weight:600;margin-right:auto}.trend-head i{display:inline-block;width:9px;height:9px;border-radius:3px;margin-right:5px}.trend-head b{font-weight:650}
