:root{--text:#1f2430;--text-muted:#6b7280;--bg:#f8fafc;--surface:#fff;--border:#e2e8f0;--accent:#2563eb;--accent-hover:#1d4ed8;--accent-contrast:#fff;--danger:#dc2626;--success:#16a34a;--radius:10px;--radius-sm:8px;--shadow-sm:0 1px 2px #0f172a0f, 0 1px 1px #0f172a0a;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;color:var(--text);background:var(--bg);font:15px/1.45 system-ui,Segoe UI,Roboto,sans-serif}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial;--text:#e5e7eb;--text-muted:#9ca3af;--bg:#0f172a;--surface:#1a2233;--border:#2a3247;--accent:#60a5fa;--accent-hover:#7fb4fb;--accent-contrast:#0f172a;--shadow-sm:0 1px 2px #0000004d, 0 1px 1px #0003}}*{box-sizing:border-box}body{margin:0}h1,h2{margin:0;font-weight:600}.page-header h2{letter-spacing:-.01em;font-size:24px}button{cursor:pointer;font:inherit;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--surface);color:var(--text);padding:6px 12px}button[type=submit],.button-link{background:var(--accent);color:var(--accent-contrast);border-color:var(--accent);text-decoration:none;display:inline-block}button:hover:not(:disabled){border-color:var(--accent)}button[type=submit]:hover:not(:disabled),.button-link:hover{background:var(--accent-hover);border-color:var(--accent-hover)}button:disabled{opacity:.5;cursor:not-allowed}input,select{font:inherit;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--text);padding:6px 8px}.app-shell{min-height:100svh;display:flex}.sidebar{background:var(--surface);border-right:1px solid var(--border);flex-direction:column;flex-shrink:0;width:240px;height:100svh;display:flex;position:sticky;top:0}.sidebar-brand{border-bottom:1px solid var(--border);text-overflow:ellipsis;white-space:nowrap;padding:20px;font-size:17px;font-weight:700;overflow:hidden}.sidebar-nav{flex:1;padding:16px 12px;overflow-y:auto}.sidebar-section{margin-bottom:22px}.sidebar-section-title{text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);margin:0 0 6px;padding:0 10px;font-size:11px;font-weight:700}.sidebar-link{border-radius:var(--radius-sm);color:var(--text-muted);margin-bottom:2px;padding:8px 10px;font-size:14px;text-decoration:none;display:block}.sidebar-link:hover{background:var(--bg);color:var(--text)}.sidebar-link.active{background:var(--accent);color:var(--accent-contrast);font-weight:500}.sidebar-footer{border-top:1px solid var(--border);justify-content:space-between;align-items:center;gap:8px;padding:14px 20px;display:flex}.sidebar-user{color:var(--text-muted);text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.app-main-column{flex-direction:column;flex:1;min-width:0;display:flex}.mobile-topbar{display:none}.nav-toggle{flex-direction:column;flex-shrink:0;justify-content:center;align-items:center;gap:4px;width:36px;height:36px;padding:0;display:flex}.nav-toggle span{background:var(--text);border-radius:2px;width:18px;height:2px;display:block}.mobile-topbar-title{text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:600;overflow:hidden}.sidebar-backdrop{display:none}main{flex:1;width:100%;max-width:1100px;margin:0 auto;padding:24px 28px}.offline-banner{color:#92400e;background:#fef3c7;padding:8px 20px;font-size:13px}@media (prefers-color-scheme:dark){.offline-banner{color:#fcd34d;background:#451a03}}.offline-banner p{margin:0}.offline-failed-list{flex-direction:column;gap:4px;margin:6px 0 0;padding:0;list-style:none;display:flex}.offline-failed-list li{justify-content:space-between;align-items:center;gap:8px;display:flex}.page-header{justify-content:space-between;align-items:center;margin-bottom:16px;display:flex}.page-header-actions{align-items:center;gap:12px;display:flex}.default-view-badge{color:var(--text-muted);font-size:13px}.inline-form{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);flex-wrap:wrap;gap:8px;margin-bottom:20px;padding:12px;display:flex}.list{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}.list li{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);align-items:center;gap:12px;padding:10px 12px;transition:border-color .15s;display:flex}.list li:hover{border-color:var(--accent)}.list li.dragging{opacity:.5}.drag-handle{cursor:grab;color:var(--text-muted);-webkit-user-select:none;user-select:none;touch-action:none;font-size:16px;line-height:1}.list .name{flex:1;font-weight:500}.tag{color:var(--text-muted);background:var(--bg);text-transform:capitalize;border-radius:999px;padding:2px 8px;font-size:12px}.category-tree{padding-left:16px;list-style:none}.category-tree>li{margin-bottom:6px}.balances-row{flex-wrap:wrap;gap:12px;margin-bottom:20px;display:flex}.balance-badge{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);min-width:140px;padding:10px 16px;transition:transform .15s,border-color .15s}.balance-badge:hover{border-color:var(--accent);transform:translateY(-2px)}.balance-badge .name{color:var(--text-muted);font-size:12px;display:block}.balance-badge .value{font-size:18px;font-weight:600;display:block}.budget-list{flex-direction:column;gap:12px;display:flex}li.budget-row{flex-direction:column;align-items:stretch;gap:6px;display:flex}.budget-row-header{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;display:flex}.budget-edit-controls{color:var(--text-muted);align-items:center;gap:8px;font-size:13px;display:flex}.budget-edit-controls input{width:100px}.budget-bar-track{background:var(--bg);border:1px solid var(--border);border-radius:999px;width:100%;height:10px;overflow:hidden}.budget-bar-fill{background:#22c55e;height:100%;transition:width .2s}.budget-bar-fill.near{background:#f59e0b}.budget-bar-fill.over{background:#ef4444}.bookmark-chips{flex-wrap:wrap;gap:8px;margin-bottom:20px;display:flex}.bookmark-chip{background:var(--surface);border:1px solid var(--border);cursor:pointer;border-radius:999px;padding:6px 14px;font-size:13px}.bookmark-chip:hover{background:var(--border)}.bookmark-chip:disabled{opacity:.6;cursor:default}.bookmark-chip-prompt{background:var(--surface);border:1px solid var(--border);border-radius:999px;align-items:center;gap:6px;padding:4px 10px;display:flex}.bookmark-chip-prompt input{background:0 0;border:none;width:90px;font-size:13px}.bookmark-chip-prompt input:focus{outline:none}.calendar-nav{align-items:center;gap:12px;margin-bottom:16px;display:flex}.calendar-month-label{text-align:center;min-width:160px;font-weight:600}.calendar-grid{grid-template-columns:repeat(7,1fr);gap:4px;margin-bottom:20px;display:grid}.calendar-weekday{text-align:center;color:var(--text-muted);padding:4px 0;font-size:12px}.calendar-cell{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);cursor:pointer;min-height:64px;font:inherit;color:inherit;flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:4px;padding:6px 8px;display:flex}.calendar-cell.empty{cursor:default;background:0 0;border:none}.calendar-cell.today{border-color:var(--accent)}.calendar-cell.selected{background:var(--accent);color:var(--accent-contrast)}.calendar-date{font-size:13px;font-weight:600}.calendar-total{color:var(--danger);font-size:12px;font-weight:600}.calendar-total.positive{color:var(--success)}.calendar-cell.selected .calendar-total{color:inherit}.calendar-day-panel{margin-top:12px}.ledger-table{border-collapse:collapse;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);width:100%;box-shadow:var(--shadow-sm);overflow:hidden}.ledger-table thead tr{background:var(--bg)}.ledger-table tbody tr:nth-child(2n){background:color-mix(in srgb, var(--border) 25%, transparent)}.ledger-table tbody tr:hover{background:var(--bg)}.ledger-table th,.ledger-table td{text-align:left;border-bottom:1px solid var(--border);padding:10px 12px;font-size:14px}.ledger-table .amount{color:var(--danger);font-weight:600}.ledger-table .amount.positive{color:var(--success)}.link-button{color:var(--text-muted);background:0 0;border:none;padding:0;text-decoration:underline}.transaction-form{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);max-width:480px;box-shadow:var(--shadow-sm);flex-direction:column;gap:14px;padding:20px;display:flex}.transaction-form label{color:var(--text-muted);flex-direction:column;gap:4px;font-size:13px;display:flex}.checkbox-label{align-items:center;flex-direction:row!important;gap:8px!important}.splits{flex-direction:column;gap:8px;display:flex}.split-row{gap:8px;display:flex}.split-row select,.split-row input{flex:1}.split-sum{color:var(--text-muted);font-size:13px}.split-sum.ok{color:var(--success)}.split-sum.error{color:var(--danger)}.error{color:var(--danger);font-size:13px}.auth-page{justify-content:center;align-items:center;min-height:100svh;display:flex}.auth-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;flex-direction:column;gap:14px;width:340px;padding:28px;display:flex;box-shadow:0 4px 16px #0f172a14,0 1px 2px #0f172a0f}.auth-card h1{text-align:center;margin-bottom:4px;font-size:20px}.auth-tabs{background:var(--bg);border-radius:var(--radius);gap:4px;padding:4px;display:flex}.auth-tabs button{background:0 0;border:none;flex:1}.auth-tabs button.active{background:var(--surface);box-shadow:0 1px 2px #0000001a}.auth-card label{color:var(--text-muted);flex-direction:column;gap:4px;font-size:13px;display:flex}.loading-screen{min-height:100svh;color:var(--text-muted);justify-content:center;align-items:center;display:flex}.hint{color:var(--text-muted);margin-bottom:16px;font-size:13px}.upload-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);min-width:240px;box-shadow:var(--shadow-sm);flex-direction:column;flex:1;gap:10px;padding:16px;display:flex}.upload-card h3{margin:0;font-size:14px}.upload-card textarea{font:inherit;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--text);resize:vertical;padding:8px}.smart-mode-inputs{flex-wrap:wrap;gap:16px;margin-bottom:24px;display:flex}.capture-list{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.capture-row{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);padding:12px 14px}.capture-summary{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.capture-summary .merchant{flex:1;font-weight:500}.capture-summary .amount{font-weight:600}.capture-actions{gap:8px;display:flex}.tag.status-ready_for_review{color:var(--accent);background:#2563eb1f}.tag.status-confirmed{color:var(--success);background:#16a34a1f}.tag.status-failed,.tag.status-rejected{color:var(--danger);background:#dc26261f}.capture-confirm-form{border-top:1px solid var(--border);flex-direction:column;gap:10px;max-width:420px;margin-top:12px;padding-top:12px;display:flex}.capture-confirm-form label{color:var(--text-muted);flex-direction:column;gap:4px;font-size:13px;display:flex}.capture-confirm-more{font-size:13px}.capture-confirm-more summary{cursor:pointer;color:var(--text-muted);padding:4px 0}.capture-confirm-more label{flex-direction:column;gap:4px;margin-top:8px;display:flex}.chat-page{flex-direction:column;height:calc(100svh - 160px);min-height:420px;display:flex}.chat-messages{flex-direction:column;flex:1;gap:12px;padding:4px 4px 12px;display:flex;overflow-y:auto}.chat-bubble-row{display:flex}.chat-bubble-row.user{justify-content:flex-end}.chat-bubble-row.assistant{justify-content:flex-start}.chat-bubble{background:var(--surface);border:1px solid var(--border);border-radius:14px;max-width:78%;padding:10px 14px}.chat-bubble-row.user .chat-bubble{background:var(--accent);color:var(--accent-contrast);border-color:var(--accent)}.chat-bubble-text{white-space:pre-wrap;margin:0}.chat-image-thumb{cursor:zoom-in;border-radius:10px;max-width:220px;max-height:220px;margin-bottom:6px;display:block}.capture-image-thumb{border-radius:var(--radius);cursor:zoom-in;max-width:120px;max-height:120px}.lightbox-backdrop{z-index:1000;cursor:zoom-out;background:#000000d9;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.lightbox-image{border-radius:var(--radius);cursor:default;max-width:90vw;max-height:90vh}.lightbox-close{color:#fff;cursor:pointer;background:0 0;border:none;font-size:32px;line-height:1;position:absolute;top:16px;right:20px}.chat-capture-card{border-top:1px solid #7f7f7f4d;margin-top:10px;padding-top:10px}.chat-capture-summary{flex-wrap:wrap;gap:6px;margin-bottom:8px;display:flex}.chat-capture-actions{gap:8px;display:flex}.chat-capture-status{opacity:.85;margin:8px 0 0;font-size:13px;font-style:italic}.chat-typing{color:var(--text-muted);margin:0;font-style:italic}.chat-input-bar{border:1px solid var(--border);background:var(--surface);border-radius:14px;flex-shrink:0;align-items:flex-end;gap:8px;margin-top:12px;padding:10px;display:flex}.chat-attach-button{border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:36px;height:36px;padding:0;font-size:16px;display:flex}.chat-textarea{resize:none;font:inherit;color:inherit;background:0 0;border:none;flex:1;max-height:140px;padding:8px 0}.chat-textarea:focus{outline:none}.chat-send-button{border-radius:999px;flex-shrink:0}.chat-attachment-preview{flex-shrink:0;display:inline-block;position:relative}.chat-attachment-preview img{border-radius:var(--radius);max-width:56px;max-height:56px;display:block}.chat-attachment-preview button{border-radius:50%;width:20px;height:20px;padding:0;font-size:12px;line-height:1;position:absolute;top:-6px;right:-6px}.inline-number{color:var(--text-muted);flex-direction:column;gap:2px;font-size:12px;display:flex}.inline-number input{width:70px}.cc-summary{color:var(--text-muted);gap:10px;margin-left:auto;font-size:12px;display:flex}.net-worth-badge{border-color:var(--accent);background:color-mix(in srgb, var(--accent) 10%, var(--surface))}.net-worth-badge .value{font-size:22px}.net-worth-badge .sub{color:var(--text-muted);margin-top:2px;font-size:11px;display:block}.money-moves-tabs{max-width:420px;margin-bottom:20px}.color-dot{vertical-align:middle;border-radius:50%;width:10px;height:10px;margin-right:6px;display:inline-block}.search-filters{align-items:flex-end}input[type=color]{cursor:pointer;width:44px;height:32px;padding:2px}.table-scroll{overflow-x:auto}@media (width<=900px){.app-shell{flex-direction:column}.inline-form button[type=submit]{margin-top:8px}.mobile-topbar{border-bottom:1px solid var(--border);background:var(--surface);z-index:20;align-items:center;gap:12px;padding:10px 14px;display:flex;position:sticky;top:0}.sidebar{z-index:40;width:260px;height:100svh;transition:transform .2s;position:fixed;top:0;left:0;transform:translate(-100%);box-shadow:4px 0 16px #00000026}.sidebar.open{transform:translate(0)}.sidebar-backdrop{z-index:30;background:#0006;display:block;position:fixed;inset:0}}.insights-section{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);margin-bottom:20px;padding:20px}.insights-section h3{margin-bottom:12px;font-size:15px}.insights-category-list{flex-direction:column;gap:10px;margin:0;padding:0;list-style:none;display:flex}.insights-category-row{flex-direction:column;gap:4px;display:flex}.insights-category-header{justify-content:space-between;font-size:13px;display:flex}.insights-category-name{font-weight:500}.insights-category-value{color:var(--text-muted)}.insights-bar-fill{background:var(--accent)}.insights-category-total{border-top:1px solid var(--border);justify-content:space-between;margin-top:4px;padding-top:10px;font-size:13px;font-weight:600;display:flex}.chart-card{position:relative}.chart-svg{width:100%;height:auto;overflow:visible}.chart-gridline{stroke:var(--border);stroke-width:1px}.chart-axis-label{fill:var(--text-muted);font-size:10px}.chart-line{stroke:var(--accent);stroke-width:2px;stroke-linejoin:round;stroke-linecap:round}.chart-dot{fill:var(--accent);stroke:var(--surface);stroke-width:2px}.chart-crosshair{stroke:var(--text-muted);stroke-width:1px;opacity:.5}.chart-tooltip{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-sm);pointer-events:none;white-space:nowrap;flex-direction:column;gap:2px;padding:6px 10px;font-size:12px;display:flex;position:absolute;top:8px;transform:translate(-50%)}.chart-tooltip strong{font-size:14px}.chart-tooltip-row{align-items:center;gap:6px;display:flex}.chart-legend{color:var(--text-muted);gap:16px;margin-bottom:8px;font-size:13px;display:flex}.chart-legend-item{align-items:center;gap:6px;display:flex}.chart-legend-swatch{border-radius:2px;width:10px;height:10px;display:inline-block}.chart-legend-swatch.income{background:var(--success)}.chart-legend-swatch.expense{background:var(--danger)}.chart-bar.income{fill:var(--success)}.chart-bar.expense{fill:var(--danger)}.chart-bar.hover{opacity:.8}@media (width<=640px){main{padding:12px}.auth-card{width:100%}.chat-page{height:calc(100svh - 210px)}.chat-bubble{max-width:90%}.balance-badge{flex:calc(50% - 6px);min-width:0}.calendar-cell{min-height:48px;padding:4px 5px}.calendar-date{font-size:12px}.calendar-total{font-size:10px}.calendar-month-label{min-width:0}.transaction-form,.capture-confirm-form{max-width:none}.list li,.split-row{flex-wrap:wrap}.split-row select,.split-row input,.split-row button{flex:100%}}
