:root{--teal: #EFEFEF;--teal-dim: #C7C7C7;--bg: #1A1A1A;--bg-card: #2A2A2A;--bg-input: #3A3A3A;--stroke: rgba(255,255,255,.12);--text: #E8E8E8;--text-muted: #8A8A8A;--red: #EF4444;--amber: #F59E0B;--green: #22C55E;--radius: 14px;--safe-top: env(safe-area-inset-top, 0px);--safe-bottom:env(safe-area-inset-bottom, 0px)}@font-face{font-family:Inter;src:url(/fonts/Inter-Regular.woff2) format("woff2");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:Inter;src:url(/fonts/Inter-Medium.woff2) format("woff2");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:Inter;src:url(/fonts/Inter-SemiBold.woff2) format("woff2");font-weight:600;font-style:normal;font-display:swap}@font-face{font-family:Inter;src:url(/fonts/Inter-Bold.woff2) format("woff2");font-weight:700;font-style:normal;font-display:swap}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html{height:100%;font-size:16px}body{height:100%;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;overflow:hidden}#app{height:100%;display:flex;flex-direction:column}.nav-bar{display:flex;align-items:center;justify-content:space-around;padding:8px 0 calc(8px + var(--safe-bottom));background:var(--bg-card);border-top:1px solid var(--stroke);flex-shrink:0}.nav-tab{display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 16px;border-radius:10px;cursor:pointer;background:none;border:none;color:var(--text-muted);font-size:11px;font-family:inherit;transition:color .15s}.nav-tab svg{width:22px;height:22px}.nav-tab.active{color:var(--teal)}.screen{flex:1;overflow:hidden;display:none;flex-direction:column}.screen.active{display:flex}.auth-wrap{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 24px;gap:24px}.auth-logo{width:72px;height:72px;object-fit:contain}.auth-title{font-size:26px;font-weight:700;text-align:center}.auth-sub{font-size:14px;color:var(--text-muted);text-align:center;line-height:1.5}.auth-card{width:100%;max-width:380px;background:var(--bg-card);border:1px solid var(--stroke);border-radius:var(--radius);padding:24px;display:flex;flex-direction:column;gap:16px}.field-label{font-size:12px;color:var(--text-muted);font-weight:600;text-transform:uppercase;letter-spacing:.05em;margin-bottom:6px}.field-input{width:100%;background:var(--bg-input);border:1px solid var(--stroke);border-radius:10px;padding:12px 14px;color:var(--text);font-size:15px;font-family:inherit;outline:none;transition:border-color .15s}.field-input:focus{border-color:var(--teal)}.btn{width:100%;padding:14px;border-radius:12px;border:none;font-size:15px;font-weight:700;font-family:inherit;cursor:pointer;transition:opacity .15s}.btn:active{opacity:.8}.btn-primary{background:var(--teal);color:var(--bg)}.btn-ghost{background:transparent;color:var(--teal);border:1px solid var(--teal)}.auth-error{color:var(--red);font-size:13px;text-align:center;min-height:18px}.chat-header{display:flex;align-items:center;gap:12px;padding:calc(12px + var(--safe-top)) 16px 12px;background:var(--bg-card);border-bottom:1px solid var(--stroke);flex-shrink:0}.chat-avatar{width:36px;height:36px;object-fit:contain;flex-shrink:0}.chat-name{font-weight:600;font-size:15px}.chat-sub{font-size:11px;color:var(--text-muted)}.model-badge{margin-left:auto;font-size:11px;padding:3px 9px;border-radius:10px;font-weight:600;cursor:default;white-space:nowrap}.model-badge--trained{background:#22c55e26;color:var(--green);border:1px solid rgba(34,197,94,.3)}.model-badge--rules{background:#f59e0b26;color:var(--amber);border:1px solid rgba(245,158,11,.3)}.chat-list{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.msg{display:flex;flex-direction:column;max-width:75%}.msg.user{align-self:flex-end}.msg.grace{align-self:flex-start}.bubble{padding:10px 14px;border-radius:14px;font-size:14px;line-height:1.5}.msg.user .bubble{background:var(--bg-input);color:var(--text);border-bottom-right-radius:4px}.msg.grace .bubble{background:var(--bg-card);border:1px solid var(--stroke);border-bottom-left-radius:4px}.msg-time{font-size:11px;color:var(--text-muted);margin-top:3px;padding:0 4px}.msg.user .msg-time{text-align:right}.msg-status{display:inline-flex;align-items:center;gap:3px}.msg-status.understood{color:var(--green)}.msg-status.misunderstood{color:var(--red)}.msg-status.flagged{color:var(--amber)}.msg-amount{color:var(--text-muted)}.card-bubble{background:var(--bg-card);border:1px solid var(--stroke);border-radius:var(--radius);padding:14px;display:flex;flex-direction:column;gap:8px;border-bottom-left-radius:4px}.card-tag{display:inline-flex;align-items:center;font-size:11px;font-weight:700;padding:3px 8px;border-radius:20px;width:fit-content}.tag-confirmed{background:#22c55e26;color:var(--green)}.tag-warning{background:#f59e0b26;color:var(--amber)}.card-num{color:var(--teal);font-weight:700}.card-bold{font-weight:700}.card-chips{display:flex;flex-direction:column;gap:6px;margin-top:2px}.card-chip{border:1px solid var(--stroke);border-radius:10px;padding:9px 12px;font-size:13px;color:var(--text);cursor:pointer;transition:opacity .15s;background:var(--bg-input)}.card-chip:active{opacity:.6}.chat-input-row{display:flex;align-items:flex-end;gap:10px;padding:12px 16px calc(12px + var(--safe-bottom));background:var(--bg-card);border-top:1px solid var(--stroke);flex-shrink:0}.chat-input{flex:1;background:var(--bg-input);border:1px solid var(--stroke);border-radius:22px;padding:10px 16px;color:var(--text);font-size:15px;font-family:inherit;outline:none;resize:none;max-height:120px;transition:border-color .15s;line-height:1.4}.chat-input:focus{border-color:var(--teal)}.chat-send{width:44px;height:44px;border-radius:50%;background:var(--teal);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity .15s;flex-shrink:0}.chat-send:active{opacity:.8}.chat-send svg{width:20px;height:20px;fill:var(--bg)}.typing-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--text-muted);animation:dot .9s infinite}.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}@keyframes dot{0%,80%,to{opacity:.2;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}.screen-header{display:flex;align-items:center;justify-content:space-between;padding:calc(16px + var(--safe-top)) 16px 12px;background:var(--bg);border-bottom:1px solid var(--stroke);flex-shrink:0}.screen-title{font-size:20px;font-weight:700}.tx-list{flex:1;overflow-y:auto}.tx-day-header{padding:10px 16px 4px;font-size:12px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em;background:var(--bg);position:sticky;top:0}.tx-row{display:flex;align-items:center;padding:12px 16px;gap:12px;border-bottom:1px solid var(--stroke)}.tx-icon{width:38px;height:38px;border-radius:10px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:18px}.tx-icon.sale{background:#e8e8e81f}.tx-icon.purchase{background:#ef44441f}.tx-icon.expense{background:#f59e0b1f}.tx-icon.income{background:#22c55e1f}.tx-body{flex:1;min-width:0}.tx-desc{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tx-meta{font-size:12px;color:var(--text-muted);margin-top:2px}.tx-amt{font-size:15px;font-weight:700;flex-shrink:0}.tx-amt.pos{color:var(--teal)}.tx-amt.neg{color:var(--red)}.empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:var(--text-muted);padding:32px}.empty-icon{width:72px;height:72px;border-radius:20px;background:var(--bg-input);display:flex;align-items:center;justify-content:center;font-size:32px;opacity:1}.empty-text{font-size:15px;text-align:center;line-height:1.5;white-space:pre-line}.reports-scroll{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:16px}.summary-card{background:var(--bg-card);border:1px solid var(--stroke);border-radius:var(--radius);padding:16px;display:flex;flex-direction:column;gap:6px}.summary-label{font-size:12px;color:var(--text-muted);font-weight:600;text-transform:uppercase;letter-spacing:.05em}.summary-value{font-size:28px;font-weight:800;color:var(--teal)}.summary-sub{font-size:13px;color:var(--text-muted)}.period-tabs{display:flex;background:var(--bg-card);border:1px solid var(--stroke);border-radius:12px;padding:4px;gap:4px}.period-tab{flex:1;padding:8px 0;border-radius:8px;border:none;background:transparent;color:var(--text-muted);font-family:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:all .15s}.period-tab.active{background:var(--teal);color:var(--bg)}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.metric-card{background:var(--bg-card);border:1px solid var(--stroke);border-radius:var(--radius);padding:14px}.metric-label{font-size:12px;color:var(--text-muted);margin-bottom:6px}.metric-val{font-size:20px;font-weight:800}.metric-val.green{color:var(--green)}.metric-val.red{color:var(--red)}.settings-scroll{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:8px}.settings-section-header{font-size:12px;color:var(--text-muted);font-weight:700;text-transform:uppercase;letter-spacing:.06em;padding:12px 0 4px}.settings-row{display:flex;align-items:center;gap:14px;background:var(--bg-card);border:1px solid var(--stroke);border-radius:var(--radius);padding:14px 16px}.settings-icon{font-size:20px;flex-shrink:0}.settings-body{flex:1}.settings-row-title{font-size:15px;font-weight:600}.settings-row-sub{font-size:13px;color:var(--text-muted);margin-top:2px}.settings-arrow{color:var(--text-muted);font-size:18px}.danger{color:var(--red)}.spinner{width:20px;height:20px;border:2px solid rgba(255,255,255,.2);border-top-color:#fff;border-radius:50%;animation:spin .6s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.toast{position:fixed;bottom:80px;left:50%;transform:translate(-50%);background:var(--bg-card);border:1px solid var(--stroke);border-radius:24px;padding:10px 20px;font-size:14px;font-weight:600;z-index:999;white-space:nowrap;animation:toastIn .25s ease}@keyframes toastIn{0%{opacity:0;transform:translate(-50%) translateY(8px)}}.sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;z-index:1000;display:flex;align-items:flex-end;animation:sheetFadeIn .15s ease}@keyframes sheetFadeIn{0%{opacity:0}}.sheet{width:100%;max-height:88vh;overflow-y:auto;background:var(--bg-card);border-radius:20px 20px 0 0;padding:12px 20px calc(24px + var(--safe-bottom));animation:sheetSlideUp .2s ease}@keyframes sheetSlideUp{0%{transform:translateY(24px);opacity:0}}.sheet-handle{width:36px;height:4px;border-radius:2px;background:var(--stroke);margin:4px auto 16px}.sheet-title{font-size:17px;font-weight:600}.sheet-sub{font-size:12px;color:var(--text-muted);margin-top:4px;margin-bottom:18px}.sheet-hint{background:#f59e0b1f;border-radius:10px;padding:12px;margin-bottom:16px}.sheet-hint-title{font-size:13px;font-weight:600;color:var(--amber)}.sheet-hint-body{font-size:12px;color:var(--text);opacity:.85;margin-top:2px}.sheet-field{margin-bottom:12px}.sheet-field-label{font-size:11px;color:var(--text-muted);margin-bottom:4px;display:block}.sheet-field-row{display:flex;gap:12px}.sheet-input{width:100%;background:var(--bg-input);border:1px solid var(--stroke);border-radius:10px;padding:12px;font-size:16px;color:var(--text);font-family:inherit}.sheet-input.highlight{border-color:#f59e0b80}.sheet-input:focus{outline:none;border-color:var(--teal)}.sheet-actions{display:flex;gap:10px;margin-top:8px}.sheet-btn{flex:1;text-align:center;border-radius:10px;padding:13px;font-size:14px;font-weight:600;cursor:pointer}.sheet-btn-cancel{border:1px solid var(--stroke);color:var(--text-muted)}.sheet-btn-save{background:var(--text);color:var(--bg)}.sheet-btn-save:disabled{background:var(--stroke);color:var(--text-muted);cursor:not-allowed}.sheet-realloc-pills{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}.sheet-pill{border:1px solid var(--stroke);border-radius:16px;padding:7px 14px;font-size:13px;color:var(--text);cursor:pointer;transition:opacity .15s}.sheet-pill:active{opacity:.6}.sheet-pill.disabled{opacity:.4;pointer-events:none}.sheet-pill.selected{background:var(--text);color:var(--bg);border-color:var(--text)}.sheet-pill-more{color:var(--text-muted);border-style:dashed}.sheet-realloc-status{font-size:12px;color:var(--text-muted);margin-top:8px;min-height:16px}.tx-row{cursor:pointer}select.sheet-input{-moz-appearance:none;appearance:none;-webkit-appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--text-muted) 50%),linear-gradient(135deg,var(--text-muted) 50%,transparent 50%);background-position:calc(100% - 18px) calc(50% - 3px),calc(100% - 13px) calc(50% - 3px);background-size:5px 5px,5px 5px;background-repeat:no-repeat}.rule-row{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--bg-card);border:1px solid var(--stroke);border-radius:10px;padding:12px;margin-bottom:8px}.rule-row-text{font-size:14px;color:var(--text)}.rule-row-text b{font-weight:600}.rule-row-sub{font-size:12px;color:var(--text-muted);margin-top:2px}.rule-row-delete{color:var(--text-muted);font-size:18px;cursor:pointer;padding:4px 8px}.rule-row-delete:active{opacity:.5}.rule-empty{color:var(--text-muted);font-size:13px;text-align:center;padding:24px 0}.sheet-checkbox-row{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text);margin-top:8px;margin-bottom:4px;cursor:pointer}.sheet-checkbox-row input[type=checkbox]{width:16px;height:16px;accent-color:var(--text)}@media (min-width: 768px){#app{flex-direction:row;max-width:1400px;margin:0 auto;height:100%}.nav-bar{order:-1;flex-direction:column;justify-content:flex-start;align-items:stretch;width:88px;height:100%;padding:calc(20px + var(--safe-top)) 8px 20px;gap:6px;border-top:none;border-right:1px solid var(--stroke);flex-shrink:0}.nav-tab{flex-direction:column;padding:10px 4px;border-radius:12px}.nav-tab.active{background:var(--bg-input)}.screen{overflow-y:auto}.chat-header,.chat-input-row{padding-left:max(16px,calc((100% - 720px)/2));padding-right:max(16px,calc((100% - 720px)/2))}.chat-list{max-width:720px;margin:0 auto;width:100%}.screen-header,.tx-list,.reports-scroll,.settings-scroll{max-width:720px;margin-left:auto;margin-right:auto;width:100%}}
