:root{color-scheme:light dark;--bg: #f4f3ef;--surface: #fffefb;--surface-2: #f0efe9;--text: #1b1a17;--muted: #6b6960;--line: #e5e3dc;--accent: #1f6f5c;--on-accent: #ffffff;--danger: #c43434;--status-good: #0ca30c;--status-warning: #fab219;--status-critical: #d03b3b;--radius: 14px;--nav-height: 58px;--safe-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))}@media(prefers-color-scheme:dark){:root{--bg: #141412;--surface: #1e1e1b;--surface-2: #2a2a26;--text: #f0efec;--muted: #a5a399;--line: #33322d;--accent: #4fb89b;--on-accent: #08201a;--danger: #ef6b6b}}html.tma{--bg: var(--tg-theme-secondary-bg-color, var(--tg-theme-bg-color));--surface: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color));--surface-2: var(--tg-theme-secondary-bg-color, var(--tg-theme-bg-color));--text: var(--tg-theme-text-color);--muted: var(--tg-theme-hint-color);--line: var(--tg-theme-section-separator-color, color-mix(in srgb, var(--tg-theme-hint-color) 25%, transparent));--accent: var(--tg-theme-button-color);--on-accent: var(--tg-theme-button-text-color);--danger: var(--tg-theme-destructive-text-color, #d03b3b)}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;background:var(--bg);color:var(--text);font:15px/1.4 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-variant-numeric:tabular-nums}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer;background:none;border:0;padding:0;text-align:inherit}button:disabled{cursor:default;opacity:.45}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}h1,h2,h3{margin:0;font-weight:600}.app{min-height:100dvh;padding-bottom:calc(var(--nav-height) + var(--safe-bottom))}.main{max-width:640px;margin:0 auto;padding:12px 16px 96px}.nav{position:fixed;inset:auto 0 0 0;z-index:10;display:flex;height:calc(var(--nav-height) + var(--safe-bottom));padding-bottom:var(--safe-bottom);background:var(--surface);border-top:1px solid var(--line)}.nav-item{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;color:var(--muted)}.nav-item svg{width:22px;height:22px}.nav-item.active{color:var(--accent);font-weight:600}.nav-brand{display:none}@media(min-width:860px){.app{padding:0 0 0 208px}.nav{inset:0 auto 0 0;flex-direction:column;gap:2px;width:208px;height:auto;padding:20px 12px;border-top:0;border-right:1px solid var(--line)}.nav-brand{display:block;padding:0 12px 16px;font-size:17px;font-weight:700}.nav-item{flex:0 0 44px;flex-direction:row;justify-content:flex-start;gap:10px;padding:0 12px;border-radius:10px;font-size:15px}.nav-item:hover{background:var(--surface-2)}.main{padding:28px 28px 96px}}.fab{position:fixed;right:18px;bottom:calc(var(--nav-height) + var(--safe-bottom) + 16px);z-index:9;display:flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;background:var(--accent);color:var(--on-accent);box-shadow:0 6px 18px #00000038}@media(min-width:860px){.fab{right:32px;bottom:32px}}.card{background:var(--surface);border-radius:var(--radius);padding:14px 16px;margin-bottom:12px}.card-title{font-size:13px;font-weight:600;color:var(--muted);margin-bottom:10px}.section-title{margin:18px 4px 8px;font-size:13px;font-weight:600;color:var(--muted)}.muted{color:var(--muted)}.small{font-size:13px}.row{display:flex;align-items:center;gap:10px}.grow{flex:1;min-width:0}.ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.empty{padding:36px 16px;text-align:center;color:var(--muted)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 16px;border-radius:12px;background:var(--surface-2);font-weight:500}a.btn{color:inherit;text-decoration:none}.btn.primary,a.btn.primary{background:var(--accent);color:var(--on-accent);font-weight:600}.btn.danger{color:var(--danger)}.btn.block{width:100%}.link{color:var(--accent);font-weight:500}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;color:var(--muted);font-size:20px;flex:none}.month{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.month-title{font-size:17px;font-weight:600}.hero{font-size:30px;font-weight:700;line-height:1.15;letter-spacing:-.01em}.hero-rest{margin-top:4px;font-size:15px;font-weight:600}.segments{display:flex;gap:4px;padding:3px;margin-bottom:12px;border-radius:11px;background:var(--surface-2);overflow-x:auto}.segment{flex:1;min-height:34px;padding:0 12px;border-radius:8px;text-align:center;font-size:13px;font-weight:600;color:var(--muted);white-space:nowrap}.segment.active{background:var(--surface);color:var(--text)}.field{display:block;margin-bottom:12px}.field-label{display:block;margin-bottom:4px;font-size:13px;color:var(--muted)}.input{display:block;width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-size:16px}.input.select-like{text-align:left;display:flex;align-items:center;justify-content:space-between;gap:8px}.switch-row{display:flex;align-items:center;justify-content:space-between;min-height:44px;gap:12px}.switch-row input{width:20px;height:20px;accent-color:var(--accent);flex:none}.amount-row{display:flex;align-items:stretch;gap:8px;margin-bottom:10px}.amount-input{flex:1;min-width:0;padding:4px 2px;border:0;border-bottom:2px solid var(--line);background:none;font-size:34px;font-weight:700;outline:none}.amount-input:focus{border-bottom-color:var(--accent)}.currency-select{flex:none;width:92px;min-height:44px;align-self:center;padding:0 8px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-size:16px;font-weight:600}.chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}.chip{max-width:100%;min-height:36px;padding:0 12px;border-radius:18px;background:var(--surface-2);font-size:13px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.chip.active{background:var(--accent);color:var(--on-accent)}.conversion{margin-bottom:12px;padding:10px 12px;border-radius:10px;background:var(--surface-2);font-size:13px}.conversion strong{font-size:15px}.rate-input{width:110px;min-height:36px;padding:4px 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font-size:16px}.sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:20;display:flex;align-items:flex-end;justify-content:center;background:#00000073}.sheet{display:flex;flex-direction:column;width:100%;max-width:520px;max-height:92dvh;border-radius:18px 18px 0 0;background:var(--surface);animation:sheet-in .18s ease-out}.sheet-head{display:flex;align-items:center;gap:4px;padding:6px 6px 6px 16px;flex:none}.sheet-title{flex:1;min-width:0;font-size:17px;font-weight:600}.sheet-body{padding:4px 16px calc(16px + var(--safe-bottom));overflow-y:auto;overscroll-behavior:contain}@keyframes sheet-in{0%{transform:translateY(24px);opacity:0}}@media(min-width:600px){.sheet-backdrop{align-items:center;padding:16px}.sheet{border-radius:18px;max-height:86dvh}}@media(prefers-reduced-motion:reduce){.sheet{animation:none}}.toast{position:fixed;left:50%;bottom:calc(var(--nav-height) + var(--safe-bottom) + 84px);z-index:40;max-width:min(420px,calc(100vw - 32px));transform:translate(-50%);padding:10px 14px;border-radius:10px;background:#1b1a17;color:#fff;font-size:14px;box-shadow:0 6px 20px #0000004d}.day-head{display:flex;justify-content:space-between;margin:16px 4px 6px;font-size:13px;font-weight:600;color:var(--muted)}.list{background:var(--surface);border-radius:var(--radius);overflow:hidden}.list-row{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:9px 14px}.list-row+.list-row{border-top:1px solid var(--line)}.list-row:hover{background:color-mix(in srgb,var(--surface-2) 45%,transparent)}.cat-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:10px;background:var(--surface-2);font-size:18px;flex:none}.row-title{font-weight:500}.row-sub{font-size:13px;color:var(--muted)}.row-amount{flex:none;text-align:right;font-weight:600;white-space:nowrap}.row-amount small{display:block;font-size:12px;font-weight:400;color:var(--muted)}.chevron{color:var(--muted);flex:none}.tree-row{display:flex;align-items:center;min-height:52px;padding-right:4px}.tree-row+.tree-row{border-top:1px solid var(--line)}.tree-toggle{display:flex;align-items:center;justify-content:center;width:32px;height:44px;flex:none;color:var(--muted)}.tree-toggle svg{transition:transform .12s}.tree-toggle.open svg{transform:rotate(90deg)}.tree-main{flex:1;min-width:0;min-height:44px;padding:6px 0}.bar-row{display:block;width:100%;padding:8px 0}.bar-row+.bar-row{border-top:1px solid var(--line)}.bar-label{display:flex;justify-content:space-between;gap:10px;margin-bottom:6px}.bar-track{height:8px;border-radius:4px;background:var(--surface-2);overflow:hidden}.bar-fill{height:100%;border-radius:0 4px 4px 0;background:var(--accent)}.columns{position:relative;display:flex;align-items:stretch;height:160px;padding-left:40px;margin-top:8px}.grid-line{position:absolute;left:40px;right:0;border-top:1px solid var(--line)}.grid-label{position:absolute;left:0;width:34px;transform:translateY(-50%);text-align:right;font-size:11px;color:var(--muted)}.column{position:relative;flex:1;min-width:0;display:flex;align-items:flex-end;justify-content:center;padding:0 1px}.column-bar{width:100%;max-width:24px;min-height:2px;border-radius:4px 4px 0 0;background:var(--accent);opacity:.45}.column.selected .column-bar,.column:hover .column-bar{opacity:1}.column-labels{display:flex;padding:4px 0 0 40px}.column-labels span{flex:1;min-width:0;text-align:center;font-size:10px;color:var(--muted);overflow:hidden}.chart-caption{min-height:20px;font-size:13px}details.table-view{margin-top:10px;font-size:13px}details.table-view summary{cursor:pointer;color:var(--muted);min-height:28px}.data-table{width:100%;border-collapse:collapse}.data-table td{padding:4px 0;border-top:1px solid var(--line)}.data-table td:last-child{text-align:right}.limit{padding:10px 0}.limit+.limit{border-top:1px solid var(--line)}.limit .bar-fill.good{background:var(--status-good)}.limit .bar-fill.warning{background:var(--status-warning)}.limit .bar-fill.critical{background:var(--status-critical)}.crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin-bottom:8px;font-size:13px}.center-screen{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:100dvh;padding:24px;text-align:center}.center-screen p{max-width:340px;margin:0}
