:root{--sidebar-width: 292px;--surface-padding: 24px;--message-width: 820px;color:#20231f;background:#f4f2ed;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}html,body,#root{height:100%}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;overflow:hidden}button,input,select,textarea{font:inherit}button{border:0}textarea,input,select{min-width:0;width:100%;border:1px solid #d9d3c6;border-radius:8px;color:#20231f;background:#fffdfa;outline:none}textarea:focus,input:focus,select:focus{border-color:#247c6d;box-shadow:0 0 0 3px #247c6d26}textarea{min-height:48px;max-height:220px;padding:13px 14px;line-height:1.45;resize:vertical}input,select{height:42px;padding:0 12px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.auth-shell{display:grid;min-height:100dvh;place-items:center;padding:24px;background:#f4f2ed}.auth-panel{display:grid;width:min(420px,100%);justify-items:center;gap:14px;border:1px solid #ded8cc;border-radius:8px;padding:30px;color:#20231f;background:#fffdfa;text-align:center;box-shadow:0 18px 45px #3e372a14}.auth-mark{display:grid;width:52px;height:52px;place-items:center;border-radius:8px;color:#f4f2ed;background:#247c6d}.auth-panel h1,.auth-panel p{margin:0}.auth-panel h1{font-size:1.5rem;line-height:1.2}.auth-panel p{color:#5e625a;line-height:1.45}.auth-primary-button{display:inline-flex;min-height:42px;align-items:center;justify-content:center;gap:8px;border-radius:8px;padding:0 16px;color:#f8f5ee;background:#247c6d;cursor:pointer}.auth-primary-button:hover{background:#2f8d7d}.app-shell{display:grid;grid-template-columns:var(--sidebar-width) minmax(0,1fr);height:100dvh;min-height:0;overflow:hidden;background:linear-gradient(90deg,#262925 0,#262925 var(--sidebar-width),transparent var(--sidebar-width)),#f4f2ed}.sidebar{display:flex;height:100dvh;min-height:0;flex-direction:column;gap:18px;padding:20px;color:#faf7ef;background:#262925;overflow:hidden}.brand-row{display:flex;align-items:center;gap:12px}.brand-mark,.starter-icon,.avatar{display:grid;place-items:center;flex:0 0 auto}.brand-mark{width:38px;height:38px;border-radius:8px;color:#f4f2ed;background:#247c6d}.brand-row h1,.brand-row p,.chat-header h2,.chat-header p,.starter-heading h2,.starter-heading p{margin:0}.brand-row h1{font-size:1.12rem;line-height:1.2}.brand-row p,.empty-list,.settings-note{color:#beb9ac;font-size:.84rem}.new-chat-button,.settings-toggle,.clear-key-button,.send-button{display:inline-flex;min-height:42px;align-items:center;justify-content:center;gap:8px;border-radius:8px;color:#f8f5ee;background:#247c6d;cursor:pointer;transition:transform .16s ease,background .16s ease,opacity .16s ease}.new-chat-button:hover,.settings-toggle:hover,.clear-key-button:hover,.send-button:hover{background:#2f8d7d}.new-chat-button:active,.settings-toggle:active,.clear-key-button:active,.send-button:active{transform:translateY(1px)}.conversation-list{display:flex;min-height:150px;flex:1;flex-direction:column;gap:6px;overflow:auto}.empty-list{display:flex;align-items:center;gap:8px;padding:12px 4px}.conversation-row{display:grid;grid-template-columns:minmax(0,1fr) 34px;align-items:center;gap:4px;border-radius:8px}.conversation-row.is-active{background:#353933}.conversation-row>button:first-child{display:flex;min-width:0;height:40px;align-items:center;gap:8px;padding:0 9px;color:#f6f1e9;background:transparent;cursor:pointer}.conversation-row span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-button{display:grid;width:34px;height:34px;place-items:center;border-radius:8px;color:inherit;background:transparent;cursor:pointer}.icon-button:hover{background:#ffffff1a}.ghost{color:#c7c0b2}.settings-section{border-top:1px solid rgba(255,255,255,.12);padding-top:16px}.account-row{display:grid;grid-template-columns:34px minmax(0,1fr) 34px;align-items:center;gap:9px;border-top:1px solid rgba(255,255,255,.12);padding-top:14px}.account-row img,.account-fallback{width:34px;height:34px;border-radius:8px}.account-row img{object-fit:cover}.account-fallback{display:grid;place-items:center;color:#f4f2ed;background:#3a3e38}.account-row div:not(.account-fallback){display:grid;min-width:0;gap:2px}.account-row strong,.account-row span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-row strong{color:#f8f5ee;font-size:.88rem}.account-row span{color:#beb9ac;font-size:.78rem}.settings-toggle,.clear-key-button{width:100%;background:#3a3e38}.settings-panel{display:grid;gap:12px;margin-top:12px;max-height:min(46vh,460px);overflow:auto;padding-right:2px}.settings-panel label,.field-block{display:grid;gap:7px}.settings-panel label span,.field-block span{color:#5e625a;font-size:.84rem;font-weight:700}.settings-panel label span{color:#dfd8cc}.settings-note{margin:0;line-height:1.45}.device-select-row{display:grid;grid-template-columns:minmax(0,1fr) 42px;align-items:center;gap:8px}.device-refresh-button{width:42px;height:42px;border:1px solid rgba(255,255,255,.16);color:#f4f1e9;background:#30342f}.device-refresh-button:hover{background:#ffffff1a}.device-refresh-button:disabled{cursor:not-allowed;opacity:.5}.env-key-status{display:flex;min-height:42px;align-items:center;justify-content:space-between;gap:10px;border:1px solid rgba(255,255,255,.16);border-radius:8px;padding:0 11px;background:#30342f}.env-key-status span{min-width:0;overflow:hidden;color:#f4f1e9;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.78rem;text-overflow:ellipsis;white-space:nowrap}.env-key-status strong{flex:0 0 auto;border-radius:999px;padding:4px 8px;font-size:.74rem}.env-key-status.ready strong{color:#103d34;background:#9ee1ce}.env-key-status.missing strong{color:#65351a;background:#f5c277}.clear-key-button{min-height:38px;color:#27231c;background:#e2b45f}.clear-key-button:hover{background:#efc471}.chat-surface{display:flex;flex-direction:column;min-width:0;height:100dvh;min-height:0;overflow:hidden;padding:var(--surface-padding)}.chat-header{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #ded8cc;padding:0 0 18px}.eyebrow{color:#247c6d;font-size:.76rem;font-weight:800;letter-spacing:0;text-transform:uppercase}.chat-header h2{max-width:min(56vw,720px);overflow:hidden;font-size:1.12rem;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.prompt-status{display:inline-flex;min-height:34px;align-items:center;gap:7px;border:1px solid #d8d1c4;border-radius:999px;padding:0 12px;color:#3c463f;background:#fffdfa;font-size:.88rem;white-space:nowrap}.error-banner{margin-top:14px;border:1px solid #d5937e;border-radius:8px;padding:12px 14px;color:#782e20;background:#fff0ea;line-height:1.45}.starter-panel{align-self:center;width:min(760px,100%);max-height:calc(100dvh - 120px);margin:auto;border:1px solid #ded8cc;border-radius:8px;padding:22px;background:#fffdfa;box-shadow:0 18px 45px #3e372a14;overflow:auto}.starter-heading{display:flex;align-items:center;gap:12px;margin-bottom:18px}.starter-icon{width:44px;height:44px;border-radius:8px;color:#20231f;background:#e2b45f}.starter-heading h2{font-size:1.35rem}.field-block{margin-top:14px}.document-field{display:grid;gap:10px;margin-top:14px}.document-field-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.document-field-header>span{color:#5e625a;font-size:.84rem;font-weight:700}.document-upload{display:inline-flex;min-height:36px;align-items:center;justify-content:center;gap:7px;border:1px solid #d9d3c6;border-radius:8px;padding:0 11px;color:#247c6d;background:#f6f3ec;cursor:pointer;font-size:.88rem;font-weight:700}.document-upload:hover,.upload-icon-button:hover{background:#ebe7dd}.document-upload.is-disabled,.upload-icon-button.is-disabled{cursor:not-allowed;opacity:.55}.voice-textarea{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:end;gap:10px}.document-list{display:flex;flex-wrap:wrap;gap:8px;min-width:0}.document-chip{display:inline-flex;max-width:100%;min-height:34px;align-items:center;gap:7px;border:1px solid #d9d3c6;border-radius:8px;padding:0 9px;color:#343a35;background:#fffdfa;font-size:.84rem}.document-chip.error{border-color:#d5937e;color:#782e20;background:#fff0ea}.document-chip.processing,.document-chip.uploading{color:#5f502c;background:#fff7dc}.document-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.document-meta{flex:0 0 auto;color:#74786f;font-size:.78rem}.starter-send{width:136px;margin-top:16px}.send-button:disabled,.send-icon-button:disabled,.voice-button:disabled{cursor:not-allowed;opacity:.45}.system-strip{display:flex;min-height:42px;align-items:center;gap:9px;margin-top:14px;border:1px solid #ded8cc;border-radius:8px;padding:9px 12px;color:#4b4f49;background:#ebe7dd;font-size:.9rem}.system-strip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.document-toolbar{display:flex;flex:0 0 auto;align-items:center;gap:10px;margin-top:12px;min-width:0}.messages{display:flex;flex:1 1 auto;min-height:0;flex-direction:column;gap:18px;overflow:auto;overflow-anchor:none;overscroll-behavior:contain;padding:22px 4px 22px 0;scroll-behavior:auto}.message-row{display:grid;width:min(var(--message-width),100%);flex:0 0 auto;grid-template-columns:34px minmax(0,1fr);gap:10px;margin-right:auto}.message-row.user{justify-content:end;grid-template-columns:minmax(0,1fr) 34px;margin-right:0;margin-left:auto}.message-row.user .avatar{grid-column:2;grid-row:1}.message-row.user .message-bubble{grid-column:1;grid-row:1;background:#dfeee9}.avatar{width:34px;height:34px;border:1px solid #d9d3c6;border-radius:8px;color:#247c6d;background:#fffdfa}.message-bubble{min-width:0;border:1px solid #ded8cc;border-radius:8px;padding:13px 14px;background:#fffdfa;transition:background-color .16s ease,border-color .16s ease}.message-row.assistant .message-bubble.pending{min-height:76px}.message-bubble.error{border-color:#d5937e;color:#782e20;background:#fff0ea}.message-meta{display:flex;min-height:24px;align-items:center;gap:8px;color:#65685f;font-size:.82rem}.message-meta strong{color:#20231f}.copy-button{width:28px;height:28px;margin-left:auto;color:#676b62}.copy-button:hover{background:#eee9df}.message-content{color:#242722;overflow-wrap:anywhere;padding-top:6px;line-height:1.6}.message-content>:first-child{margin-top:0}.message-content>:last-child{margin-bottom:0}.message-content p{margin:0 0 10px;white-space:pre-wrap}.message-content h1,.message-content h2,.message-content h3,.message-content h4{margin:14px 0 8px;color:#20231f;font-weight:800;line-height:1.25}.message-content h1{font-size:1.18rem}.message-content h2{font-size:1.08rem}.message-content h3,.message-content h4{font-size:1rem}.message-content ul,.message-content ol{margin:8px 0 12px;padding-left:1.35rem}.message-content li{margin:5px 0;padding-left:2px}.message-content li>p{margin:0}.message-content strong{font-weight:800}.message-content a{color:#116b5e;font-weight:700;text-decoration:underline;text-underline-offset:2px}.message-content blockquote{margin:10px 0;border-left:3px solid #c9c1b4;padding:4px 0 4px 12px;color:#4e554f;background:#f4f1ea}.message-content table{display:block;width:100%;overflow-x:auto;border-collapse:collapse;margin:12px 0}.message-content th,.message-content td{border:1px solid #d9d3c6;padding:7px 9px;text-align:left;vertical-align:top}.message-content th{background:#eee9df;font-weight:800}.message-content code{border-radius:5px;padding:2px 5px;color:#1f2625;background:#eee9df;font:.88rem/1.45 SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace}.message-content pre{overflow:auto;margin:12px 0 0;border-radius:8px;padding:13px;color:#f4f1eb;background:#1f2625;font:.9rem/1.5 SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace}.message-content pre code{border-radius:0;padding:0;color:inherit;background:transparent;font:inherit}.message-content.streaming>:last-child:after,.message-content.streaming li:last-child:after,.message-content.streaming code:last-child:after{display:inline-block;width:7px;height:1em;margin-left:3px;border-radius:2px;background:#247c6d;content:"";vertical-align:-.16em;animation:caret-blink .9s steps(1) infinite}.typing-dots{display:inline-flex;height:28px;align-items:center;gap:5px;padding-top:6px}.typing-dots span{width:7px;height:7px;border-radius:50%;background:#247c6d;animation:pulse .9s infinite ease-in-out}.typing-dots span:nth-child(2){animation-delay:.12s}.typing-dots span:nth-child(3){animation-delay:.24s}.composer{display:grid;flex:0 0 auto;grid-template-columns:44px 44px minmax(0,1fr) 44px;align-items:end;gap:10px;border-top:1px solid #ded8cc;padding-top:16px}.composer textarea{height:44px;min-height:44px;max-height:160px;resize:vertical}.send-icon-button{width:44px;height:44px;color:#f8f5ee;background:#247c6d}.upload-icon-button,.voice-button{width:44px;height:44px;border:1px solid #d9d3c6;color:#247c6d;background:#fffdfa}.voice-button:hover{background:#ebe7dd}.voice-button.is-recording{border-color:#bd5b4d;color:#8f271c;background:#fff0ea}.voice-button.is-recording:hover{background:#ffe3da}.send-icon-button:hover{background:#2f8d7d}.spin{animation:spin .9s linear infinite}@keyframes pulse{0%,to{opacity:.35;transform:translateY(0)}50%{opacity:1;transform:translateY(-2px)}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes caret-blink{0%,52%{opacity:1}53%,to{opacity:0}}@media(max-width:860px){body{overflow:auto}#root{height:auto}.app-shell{grid-template-columns:1fr;height:auto;min-height:100dvh;overflow:visible;background:#f4f2ed}.sidebar{height:auto;min-height:auto;overflow:visible}.conversation-list{max-height:210px}.chat-surface{height:100dvh;min-height:620px;padding:18px}.chat-header{align-items:flex-start;flex-direction:column}.prompt-status{white-space:normal}.chat-header h2{max-width:100%;white-space:normal}.message-row,.message-row.user{grid-template-columns:32px minmax(0,1fr);justify-content:stretch}.message-row.user .avatar{grid-column:1}.message-row.user .message-bubble{grid-column:2}}@media(max-width:560px){.sidebar,.chat-surface{padding:14px}.starter-panel{padding:16px}.starter-heading h2{font-size:1.12rem}.system-strip{align-items:flex-start}.system-strip span{white-space:normal}.document-field-header,.document-toolbar{align-items:stretch;flex-direction:column}.document-upload{width:100%}}
