:root{color-scheme:dark;--bg:#131719;--sidebar:#181d20;--panel:#1e2529;--hover:#242d31;--text:#eef1ef;--muted:#a7b3b5;--line:#303a3f;--accent:#b9dbcb;--accent-text:#14261e;--focus:#b9dbcb;--bubble:#293630;--shadow:0 24px 90px #0005}
:root[data-theme="light"]{color-scheme:light;--bg:#fbfcfa;--sidebar:#f1f4f0;--panel:#fff;--hover:#e5ece5;--text:#202b26;--muted:#5c6b64;--line:#d3ddd5;--accent:#254f3d;--accent-text:#fff;--focus:#254f3d;--bubble:#e4eee5;--shadow:0 24px 90px #20352a22}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.45}button,select,input{min-height:44px}button{border:0;background:transparent;border-radius:12px;padding:10px 14px}button:hover:not(:disabled){background:var(--hover)}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid var(--focus);outline-offset:3px}button svg{width:20px;height:20px;flex:none}svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.icon{width:44px;height:44px;display:inline-grid;place-items:center;padding:0;flex:none}.primary{background:var(--accent);color:var(--accent-text);font-weight:650}.primary:hover:not(:disabled){background:var(--accent);filter:brightness(.94)}.quiet{color:var(--muted)}.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}[hidden]{display:none!important}
.app{height:100dvh;min-height:480px;display:grid;grid-template-columns:304px minmax(0,1fr)}.sidebar{background:var(--sidebar);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0;padding:20px 16px 12px;gap:16px}.sidebar .menu-trigger{display:none}.brand-row{display:flex;align-items:center;justify-content:space-between;padding-left:8px}.brand{font-size:20px;letter-spacing:-.8px;font-weight:700}.sample{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-left:10px;font-weight:500}.tools{display:grid;gap:10px}.new-chat{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;border:1px solid var(--line)}.search-row{display:flex;gap:6px}.search{min-width:0;position:relative;flex:1}.search svg{position:absolute;left:12px;top:13px;width:18px;height:18px;color:var(--muted);pointer-events:none}.search input{width:100%;padding:10px 12px 10px 38px;border-radius:12px;border:1px solid var(--line);background:var(--bg)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}.filter-button{border:1px solid var(--line);position:relative}.filter-button.active::after{content:"";position:absolute;right:5px;top:5px;width:7px;height:7px;border-radius:50%;background:var(--accent)}.filter-summary{display:flex;align-items:center;gap:4px;justify-content:space-between;font-size:12px;padding-left:8px;color:var(--muted)}.filter-summary button{font-size:12px;padding:8px}.chat-nav{overflow-y:auto;flex:1;min-height:0}.group-title{margin:20px 12px 6px;font-size:12px;color:var(--muted);font-weight:600}.group-title:first-child{margin-top:0}.chat-item{display:block;text-align:left;width:100%;padding:12px;margin:0 0 4px;border:1px solid transparent}.chat-item[aria-current="true"]{background:var(--hover);border-color:var(--line)}.chat-title{display:block;font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-meta{display:block;font-size:12px;color:var(--muted);margin-top:3px}.empty-list{text-align:center;padding:34px 14px;color:var(--muted)}.empty-list strong{display:block;color:var(--text);font-size:16px;margin-bottom:6px}.empty-list p{margin:0 0 16px}.sidebar-foot{font-size:11px;color:var(--muted);padding:0 8px}.conversation{display:flex;flex-direction:column;min-width:0;min-height:0}.chat-header{display:flex;align-items:center;gap:12px;padding:18px 32px;min-height:88px;border-bottom:1px solid var(--line)}.chat-heading{flex:1;min-width:0}.chat-heading h1{font-size:17px;font-weight:600;line-height:1.4;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-heading p{font-size:12px;color:var(--muted);margin:2px 0 0}.back{display:none}.messages{overflow-y:auto;flex:1;padding:36px 32px 20px;scroll-behavior:smooth}.message-inner{max-width:730px;margin:0 auto}.message{margin:0 0 28px;max-width:92%;white-space:pre-wrap;overflow-wrap:anywhere}.message.user{background:var(--bubble);border-radius:18px 18px 4px 18px;padding:13px 18px;margin-left:auto;width:fit-content}.message.assistant{padding:0 2px}.message-label{display:block;font-size:12px;font-weight:650;color:var(--muted);margin-bottom:8px}.message p{margin:0}.welcome{padding:clamp(36px,8vh,100px) 0;max-width:440px;margin:auto}.welcome .eyebrow{font-size:12px;color:var(--muted);margin:0 0 16px}.welcome h2{font-size:30px;line-height:1.2;letter-spacing:-1px;font-weight:550;margin:0 0 12px}.welcome p{color:var(--muted);margin:0}.composer-zone{padding:12px 32px 20px}.composer-wrap{max-width:730px;margin:auto}.composer{display:flex;align-items:flex-end;gap:10px;padding:8px;border:1px solid var(--line);border-radius:20px;background:var(--panel)}.composer:focus-within{border-color:var(--muted)}textarea{flex:1;resize:none;max-height:180px;min-height:44px;border:0;background:transparent;padding:10px 10px;line-height:24px;outline-offset:0!important;min-width:0}.send{width:44px;height:44px;padding:0;display:grid;place-items:center;border-radius:14px}.demo-note{margin:9px 0 0;text-align:center;font-size:11px;color:var(--muted)}.no-selection{display:grid;place-content:center;text-align:center;height:100%;padding:30px}.no-selection h2{font-size:24px;margin:0 0 8px;font-weight:550}.no-selection p{color:var(--muted);margin:0 0 20px}
dialog{width:min(440px,calc(100% - 32px));padding:24px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);max-height:calc(100dvh - 32px);overflow-y:auto}dialog::backdrop{background:#0008;backdrop-filter:blur(3px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.dialog-head h2{font-size:20px;font-weight:600;margin:0;letter-spacing:-.4px}.field{display:grid;gap:8px;margin:20px 0}.field label{font-weight:550;font-size:14px}select{width:100%;border:1px solid var(--line);border-radius:12px;background:var(--bg);padding:10px 12px}.dialog-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:24px}.dialog-copy{color:var(--muted);font-size:14px;margin:0 0 16px}.check{display:flex;align-items:center;min-height:44px;gap:10px;font-size:14px}.check input{width:20px;min-height:20px;height:20px;accent-color:var(--accent)}summary{cursor:pointer;min-height:44px;padding:10px 0;color:var(--muted);font-size:14px}.menu-option{display:block;text-align:left;width:100%;min-height:50px}.theme-choices{display:flex;gap:10px}.theme-choices button{flex:1;border:1px solid var(--line)}.theme-choices button[aria-pressed="true"]{border-color:var(--accent);background:var(--hover)}.settings-note{margin:24px 0 0;font-size:12px;color:var(--muted)}.menu-footer{font-size:12px;color:var(--muted);margin:16px 14px 0}.status{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);background:var(--text);color:var(--bg);padding:10px 18px;border-radius:12px;box-shadow:var(--shadow);z-index:5;max-width:calc(100vw - 32px);font-size:13px;pointer-events:none}
@media(min-width:1450px){.app{grid-template-columns:328px minmax(0,1fr)}.sidebar{padding:24px}.chat-header{padding-left:48px;padding-right:48px}}
@media(max-width:720px){.sidebar .menu-trigger{display:inline-grid}.app{display:block;min-height:0}.sidebar{height:100dvh;border:0;padding:16px 16px 12px}.brand{font-size:23px}.sidebar-foot{padding-bottom:env(safe-area-inset-bottom)}.conversation{display:none;height:100dvh}.app[data-view="chat"] .sidebar{display:none}.app[data-view="chat"] .conversation{display:flex}.back{display:inline-grid}.chat-header{padding:10px 12px;min-height:76px;gap:8px}.chat-heading h1{font-size:16px}.messages{padding:24px 20px 12px}.message{max-width:94%;margin-bottom:24px}.composer-zone{padding:10px 12px max(12px,env(safe-area-inset-bottom))}.demo-note{font-size:10px}.welcome h2{font-size:28px}.welcome{padding-top:48px}.chat-item{padding:14px 12px}.search input{min-height:48px}.dialog-actions button{flex:1}dialog{padding:20px}.status{bottom:24px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Optional project organization extends the approved chats-first shell. */
.start-actions{display:flex;gap:8px}.start-actions .new-chat{flex:1}.projects-button{border:1px solid var(--line);white-space:nowrap}.crumb{display:block;text-align:left;padding:6px 0;color:var(--muted);font-size:12px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crumb:hover{background:transparent!important;color:var(--text)}.project-panel{flex:1;min-height:0;overflow:auto;padding:24px 32px}.project-inner{max-width:800px;margin:auto}.project-tabs{display:flex;border-bottom:1px solid var(--line);gap:16px;margin-bottom:24px}.project-tabs button{border-radius:0;padding:12px 6px;border-bottom:2px solid transparent;color:var(--muted)}.project-tabs button[aria-pressed="true"]{color:var(--text);border-bottom-color:var(--accent)}.section-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px}.section-toolbar h2{font-size:17px;margin:0;font-weight:550}.outline{border:1px solid var(--line)}.file-list{display:grid;gap:8px}.file-row{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:14px;padding:6px;background:var(--bg)}.file-main{flex:1;min-width:0;text-align:left}.file-main strong{display:block;overflow-wrap:anywhere;font-size:14px;font-weight:550}.file-main span{display:block;color:var(--muted);font-size:12px;margin-top:4px}.files-search{margin-bottom:18px}.files-search input,.text-input{min-width:0;width:100%;background:var(--bg);border:1px solid var(--line);padding:10px 12px;border-radius:12px}.helper{color:var(--muted);font-size:12px;margin:12px 0 18px}.project-chat-list .chat-item{border-color:var(--line);margin-bottom:8px;padding:16px}.chooser-list{max-height:40dvh;overflow:auto;margin:12px 0}.chooser-list button{width:100%;text-align:left}.chooser-list small{display:block;color:var(--muted);font-size:12px}.chooser-heading{font-size:12px;color:var(--muted);padding:12px 12px 4px;margin:0}.pending-files{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.ref-chip{display:inline-flex;max-width:100%;border:1px solid var(--line);border-radius:12px;background:var(--bg);overflow:hidden}.ref-chip .reference{display:block;min-width:0;text-align:left;font-size:12px;border-radius:0;overflow-wrap:anywhere}.ref-chip small{display:block;color:var(--muted);font-size:11px}.message-files{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.message-files .ref-chip{white-space:normal}.add-attachment{color:var(--muted)}.preview-copy{padding:20px;background:var(--bg);border:1px solid var(--line);border-radius:14px;font-size:14px;white-space:pre-wrap}.preview-copy p{margin:0 0 12px}.preview-copy p:last-child{margin:0}.file-preview-dialog{width:min(580px,calc(100% - 32px))}.preview-back{color:var(--muted);font-size:12px;text-align:left;padding-left:0;max-width:100%;overflow-wrap:anywhere}.sample-chart{display:block;width:100%;height:auto;margin:10px 0 16px;color:var(--accent)}.preview-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.empty-project{text-align:center;padding:44px 12px;color:var(--muted)}.empty-project h3{font-size:20px;color:var(--text);font-weight:550;margin:0 0 8px}.empty-project p{margin:0 0 20px}.project-dialog-inputs input{font:inherit}.project-dialog-inputs label{font-size:14px}.chat-meta{white-space:normal}.message .reference{max-width:100%}.dialog-actions{flex-wrap:wrap}.project-choice-title{font-weight:550}.chooser-empty{padding:18px 12px;color:var(--muted);font-size:14px}
@media(max-width:720px){.project-panel{padding:18px 16px}.section-toolbar{align-items:flex-start;flex-wrap:wrap}.section-toolbar h2{padding-top:10px}.composer{gap:2px}.composer textarea{padding-left:4px}.file-row{align-items:stretch}.file-row .use-file{padding:8px;font-size:12px;max-width:110px}.chat-header:has(.crumb:not([hidden])){min-height:108px}.crumb{max-width:calc(100vw - 144px)}.preview-actions{flex-direction:column}.preview-actions button{width:100%}}

/* Secondary choices stay inside Menu → Settings, never beside the composer. */
.full-settings{width:min(540px,calc(100% - 32px))}.settings-section{border-top:1px solid var(--line);padding:8px 0;margin-top:12px}.settings-section>summary{font-size:15px;font-weight:550;color:var(--text);padding:12px 0}.settings-section .helper{font-size:12px;margin:8px 0 16px}.settings-section .field{margin:16px 0}.settings-status{font-size:12px;color:var(--accent);min-height:0}.settings-status:not(:empty){padding:10px 0}.connection-card{padding:16px;border:1px solid var(--line);border-radius:14px;margin:12px 0}.connection-card h3{margin:0;font-size:16px;font-weight:550}.connection-card summary,.planned-providers summary{font-size:13px}.connection-preview label{font-size:13px}.connection-preview input{display:block;width:100%;padding:12px;margin:8px 0;border:1px solid var(--line);border-radius:10px;background:var(--bg);opacity:.65}.connection-preview input:disabled{cursor:not-allowed}.full-settings .dialog-actions{position:sticky;bottom:-24px;background:var(--panel);padding:12px 0 4px;margin-bottom:0}.settings-section summary span{font-size:12px;font-weight:400}
@media(max-width:720px){.full-settings .dialog-actions{bottom:-20px}}
