:root{--chat-bg:#fff;--chat-text:#171717;--chat-muted:#737373;--chat-surface:#f4f4f4;--chat-border:#e7e7e7;--chat-button:#ededed;--chat-inverse:#fff;--chat-primary:#171717;color-scheme:light}
:root[data-theme=dark]{--chat-bg:#101010;--chat-text:#f2f2f2;--chat-muted:#aaa;--chat-surface:#242424;--chat-border:#363636;--chat-button:#303030;--chat-inverse:#171717;--chat-primary:#f4f4f4;color-scheme:dark}
[data-theme=dark] body{background:#141414;color:#ededed}[data-theme=dark] body>header{background:#191919}[data-theme=dark] .card,[data-theme=dark] dialog,[data-theme=dark] input,[data-theme=dark] select,[data-theme=dark] textarea,[data-theme=dark] button{background:#242424;border-color:#3b3b3b;color:#ededed}[data-theme=dark] .hero,[data-theme=dark] .ai-settings,[data-theme=dark] .goal-status{background:#202a25;border-color:#34463b}[data-theme=dark] .muted,[data-theme=dark] .action-fields dt{color:#b6bfb8}[data-theme=dark] .good{color:#8ed6af}[data-theme=dark] .bad,[data-theme=dark] .form-error{color:#ffb2a8}[data-theme=dark] .goal-status.bad{background:#3b2321}[data-theme=dark] .bar{background:#323c35}[data-theme=dark] .reminder{background:#302a1e;border-color:#5f5036}[data-theme=dark] .entry,[data-theme=dark] .income-row,[data-theme=dark] .share-row,[data-theme=dark] .account-bar{border-color:#333}[data-theme=dark] button.active,[data-theme=dark] button.primary{background:#35694e;color:#fff}
body.chat-page{background:var(--chat-bg);color:var(--chat-text);overflow:hidden}body.chat-page>header{display:none}body.chat-page main{max-width:none;padding:0;margin:0;height:100dvh}body.chat-page .reminder{display:none}.chat-shell{height:100dvh;display:flex;flex-direction:column;max-width:940px;margin:auto;padding:0 24px}.chat-topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 0 6px;flex-shrink:0}.chat-icon{border:0;border-radius:50%;width:44px;height:44px;min-width:44px;min-height:44px;padding:10px;display:inline-flex;align-items:center;justify-content:center;background:transparent;color:var(--chat-text);flex-shrink:0}.chat-topbar>.chat-icon{background:var(--chat-surface);border:1px solid var(--chat-border)}.chat-switch{display:flex;background:var(--chat-surface);border-radius:28px;padding:4px;gap:2px}.chat-switch button{border:0;border-radius:24px;background:transparent;color:var(--chat-muted);min-height:40px;padding:8px 24px;font-size:15px}.chat-switch button.selected{background:var(--chat-bg);color:var(--chat-text);box-shadow:0 1px 5px #00000009}.chat-model{text-align:center;flex-shrink:0}.chat-model button{border:0;background:transparent;color:var(--chat-muted);font-size:13px;min-height:28px;padding:2px 8px}.chat-model span{margin-left:5px}.chat-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:24px 6px 18px;scrollbar-width:thin;scrollbar-color:var(--chat-border) transparent}.chat-scroll.is-empty{display:flex;flex-direction:column;justify-content:center}.chat-welcome{text-align:center;margin:auto 0 36px}.budget-mark{display:flex;align-items:center;justify-content:center;width:54px;height:54px;background:var(--chat-surface);border-radius:50%;margin:0 auto 22px}.chat-welcome h1{font-size:clamp(27px,4vw,36px);font-weight:600;letter-spacing:-.035em;margin:0 0 12px}.chat-welcome p{font-size:16px;color:var(--chat-muted);line-height:1.6}.chat-messages{display:flex;flex-direction:column;gap:28px}.chat-message{max-width:100%;font-size:16px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}.chat-message.from-user{align-self:flex-end;background:var(--chat-surface);border-radius:24px;max-width:85%;padding:12px 18px}.chat-message.from-ai{align-self:stretch;padding:0 4px}.chat-thinking{color:var(--chat-muted);margin:24px 4px;font-size:14px;display:flex;align-items:center;gap:8px}.chat-thinking span{width:9px;height:9px;background:var(--chat-text);border-radius:50%;animation:thinking 1.2s ease-in-out infinite}@keyframes thinking{50%{opacity:.3}}.chat-bottom{flex-shrink:0;background:var(--chat-bg);padding:8px 0 max(10px,env(safe-area-inset-bottom))}.chat-suggestions{display:grid;gap:8px;margin:0 0 20px}.chat-suggestions button{display:flex;align-items:center;gap:14px;text-align:left;background:transparent;border:0;color:var(--chat-muted);font-size:15px;padding:10px 12px}.chat-suggestions svg{width:21px;min-width:21px}.chat-composer{display:flex;flex-wrap:nowrap;align-items:center;gap:4px;background:var(--chat-surface);border:1px solid var(--chat-border);border-radius:30px;padding:7px 8px;box-shadow:0 2px 6px #00000004}.chat-composer textarea{flex:1;width:0;min-width:0;resize:none;border:0;border-radius:0;box-shadow:none;outline:none;background:transparent!important;color:var(--chat-text);padding:10px 2px;line-height:24px;min-height:44px;max-height:160px}.chat-composer textarea::placeholder{color:var(--chat-muted);opacity:1}.chat-composer .voice-start,.chat-composer .send-message{background:var(--chat-primary);color:var(--chat-inverse);width:42px;height:42px;min-width:42px;min-height:42px}.chat-composer .send-message{display:none}.chat-composer.has-text .send-message{display:inline-flex}.chat-composer.has-text .voice-start{display:none}.chat-notice{font-size:12px;color:var(--chat-muted);text-align:center;margin:5px 0 0;line-height:1.4}.chat-notice:empty{display:none}.chat-save{color:var(--chat-muted);text-align:center;font-size:11px;margin-top:8px;line-height:1.4}.chat-save button{font-size:12px;background:var(--chat-surface);color:var(--chat-text);border-color:var(--chat-border)}.chat-history{display:block;margin:0 auto 24px;background:var(--chat-surface);border-color:var(--chat-border);color:var(--chat-text);font-size:13px}.chat-shell .ai-proposal,.chat-shell .live-panel,.chat-draft{border-color:var(--chat-border);background:var(--chat-surface);border-radius:20px;padding:20px;margin:22px 0}.chat-shell .ai-proposal h2,.chat-shell .live-panel h2,.chat-draft h2{font-size:19px}.chat-shell .primary{background:var(--chat-primary);color:var(--chat-inverse);border-color:var(--chat-primary)}.chat-shell .action-fields dt,.chat-shell .muted{color:var(--chat-muted)}.chat-draft{display:block}.draft-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;border-bottom:1px solid var(--chat-border);padding:14px 0}.draft-row input{width:100%}.chat-draft>.row{margin-top:16px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.chat-settings-modal,.chat-menu-modal{background:var(--chat-bg);color:var(--chat-text);border:1px solid var(--chat-border);border-radius:24px;padding:24px;max-width:560px}.chat-settings-modal button,.chat-settings-modal input,.chat-settings-modal select,.chat-menu-modal button{background:var(--chat-surface);color:var(--chat-text);border-color:var(--chat-border)}.chat-settings-modal .ai-settings{background:transparent;padding:0;margin-top:24px}.theme-options{display:flex;gap:6px;flex-wrap:wrap}.theme-options button{font-size:13px;flex:1;white-space:nowrap;padding:8px 10px}.theme-options button.active{background:var(--chat-primary);color:var(--chat-inverse);border-color:var(--chat-primary)}.theme-section h3{font-size:15px;font-weight:500}.chat-menu-links{display:grid;gap:5px;margin:20px 0}.chat-menu-links button{text-align:left;color:var(--chat-text);background:transparent;border:0;padding:12px 14px;white-space:normal}.chat-menu-links button:hover{background:var(--chat-surface)}
@media(max-width:650px){.chat-shell{padding:0 14px}.chat-topbar{padding-top:max(12px,env(safe-area-inset-top));gap:8px}.chat-switch button{padding:8px 21px}.chat-topbar>.chat-icon{width:43px;height:43px;min-width:43px}.chat-scroll{padding:22px 2px 16px}.chat-bottom{padding-top:8px}.chat-composer{gap:0;padding:6px}.chat-composer>.chat-icon{width:38px;height:40px;min-width:38px;padding:8px}.chat-composer textarea{font-size:16px!important;line-height:24px;padding:8px 2px;min-height:40px}.chat-composer .voice-start,.chat-composer .send-message{width:40px;height:40px;min-width:40px;min-height:40px}.chat-message.from-user{max-width:90%;padding:10px 16px}.chat-welcome{margin:auto 0 28px}.chat-suggestions{margin-bottom:14px}.chat-suggestions button{font-size:14px;padding:8px}.chat-settings-modal,.chat-menu-modal{width:calc(100vw - 20px);padding:20px}.chat-shell .ai-proposal,.chat-shell .live-panel,.chat-draft{padding:14px}.draft-row{grid-template-columns:1fr}.chat-model button{font-size:12px}}@media(prefers-reduced-motion:reduce){.chat-thinking span{animation:none}}

.inline-picker{min-width:0;display:grid;gap:8px}.picker-row{display:flex;gap:8px;align-items:center}.picker-row select{min-width:0;flex:1;width:100%}.picker-row>button{flex:0 0 44px;min-height:44px;font-size:24px;padding:2px}.inline-editor{border:1px solid var(--chat-border);background:var(--chat-surface);color:var(--chat-text);border-radius:12px;padding:12px}.inline-editor .row{flex-wrap:wrap}.inline-editor input{width:100%}.inline-feedback:empty{display:none}
