:root{--bg: #f5f5f4;--surface: #ffffff;--border: #e2e2e0;--border-focus: #a8a8a6;--text-primary: #1a1a18;--text-secondary: #6b6b68;--text-muted: #9e9e9b;--user-bg: #1a1a18;--user-text: #ffffff;--bot-bg: #ffffff;--bot-text: #1a1a18;--accent: #3b5bdb;--accent-hover: #2f4ec4;--error-bg: #fff5f5;--error-border: #fca5a5;--error-text: #b91c1c;--radius-sm: 6px;--radius-md: 12px;--radius-lg: 16px;font-family:Inter,system-ui,-apple-system,sans-serif;font-size:15px;line-height:1.6;color:var(--text-primary)}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}button{cursor:pointer;font-family:inherit}input,textarea{font-family:inherit}a{color:inherit}html,body,#root{height:100%}body{background:var(--bg);color:var(--text-primary);-webkit-font-smoothing:antialiased}.setup-wrapper{min-height:100%;display:flex;align-items:center;justify-content:center;padding:32px 16px;background:var(--bg)}.setup-card{width:100%;max-width:480px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:36px 32px}.setup-logo{display:flex;justify-content:center;margin-bottom:20px}.logo-ring{width:52px;height:52px;background:var(--user-bg);border-radius:14px;display:flex;align-items:center;justify-content:center;color:#fff}.setup-header{text-align:center;margin-bottom:20px}.setup-title{font-size:22px;font-weight:700;color:var(--text-primary);margin-bottom:6px}.setup-subtitle{font-size:14px;color:var(--text-secondary)}.setup-badges{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-bottom:28px}.badge{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--text-secondary);background:var(--bg);border:1px solid var(--border);border-radius:20px;padding:4px 11px}.badge-dot{width:7px;height:7px;border-radius:50%}.badge-dot.g{background:#16a34a}.badge-dot.b{background:#2563eb}.badge-dot.p{background:#7c3aed}.setup-form{display:flex;flex-direction:column;gap:18px}.form-field{display:flex;flex-direction:column;gap:6px}.form-label{font-size:13px;font-weight:500;color:var(--text-secondary);display:flex;align-items:center;gap:6px;text-transform:uppercase;letter-spacing:.04em}.input-group{position:relative}.api-key-input{width:100%;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm);padding:9px 12px;font-size:14px;color:var(--text-primary);outline:none;transition:border-color .15s}.api-key-input::placeholder{color:var(--text-muted)}.api-key-input:focus{border-color:var(--border-focus);background:#fff}.input-group .api-key-input{padding-right:44px}.toggle-btn{position:absolute;right:10px;top:50%;transform:translateY(-50%);background:none;border:none;color:var(--text-muted);padding:4px;display:flex;align-items:center;transition:color .15s}.toggle-btn:hover{color:var(--text-secondary)}.system-prompt-textarea{resize:vertical;min-height:80px;line-height:1.5}.setup-error{display:flex;align-items:center;gap:8px;background:var(--error-bg);border:1px solid var(--error-border);border-radius:var(--radius-sm);color:var(--error-text);font-size:13.5px;padding:10px 12px}.connect-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;background:var(--user-bg);color:#fff;border:none;border-radius:var(--radius-sm);padding:11px 20px;font-size:14.5px;font-weight:500;transition:background .15s,opacity .15s;margin-top:4px}.connect-btn:hover:not(:disabled){background:#333330}.connect-btn:disabled{opacity:.6;cursor:not-allowed}.spinner{width:15px;height:15px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.setup-note{text-align:center;font-size:12.5px;color:var(--text-muted);margin-top:20px;line-height:1.5}.setup-grid{display:none}.chat-header{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;background:var(--surface);border-bottom:1px solid var(--border);flex-shrink:0}.header-left{display:flex;align-items:center;gap:12px}.bot-avatar{width:36px;height:36px;background:var(--user-bg);border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff;flex-shrink:0;position:relative}.avatar-online{position:absolute;bottom:-2px;right:-2px;width:10px;height:10px;background:#16a34a;border-radius:50%;border:2px solid var(--surface)}.header-info{display:flex;flex-direction:column;gap:1px}.header-name{font-size:14.5px;font-weight:600;color:var(--text-primary)}.header-meta{font-size:12px;color:var(--text-muted);display:flex;align-items:center;gap:5px}.meta-dot{width:6px;height:6px;border-radius:50%;background:#16a34a}.header-right{display:flex;align-items:center;gap:6px}.hdr-btn{display:inline-flex;align-items:center;gap:5px;background:transparent;border:1px solid var(--border);border-radius:var(--radius-sm);padding:6px 12px;font-size:12.5px;font-family:inherit;font-weight:500;color:var(--text-secondary);cursor:pointer;transition:background .15s,border-color .15s;white-space:nowrap}.hdr-btn:hover{background:var(--bg);border-color:var(--border-focus);color:var(--text-primary)}.hdr-btn.danger{color:#b91c1c;border-color:#fca5a5}.hdr-btn.danger:hover{background:var(--error-bg)}.hdr-divider{width:1px;height:20px;background:var(--border);margin:0 2px}.bubble-row{display:flex;align-items:flex-end;gap:8px;margin-bottom:2px}.bubble-row.user{flex-direction:row-reverse}.msg-avatar{width:30px;height:30px;border-radius:8px;background:var(--user-bg);display:flex;align-items:center;justify-content:center;flex-shrink:0}.bubble-body{display:flex;flex-direction:column;gap:4px;max-width:72%;min-width:0}.bubble-row.user .bubble-body{align-items:flex-end}.bubble{padding:10px 14px;border-radius:14px;font-size:14px;line-height:1.65;word-break:break-word}.user-bubble{background:var(--user-bg);color:var(--user-text);border-bottom-right-radius:4px}.bot-bubble{background:var(--bot-bg);color:var(--bot-text);border:1px solid var(--border);border-bottom-left-radius:4px}.md p{margin:0 0 8px}.md p:last-child{margin-bottom:0}.md ul,.md ol{padding-left:18px;margin:6px 0}.md li{margin:3px 0}.md code{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-size:13px}.md pre{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:10px 14px;overflow-x:auto;margin:8px 0}.md pre code{background:none;border:none;padding:0}.md strong{font-weight:600}.md a{color:var(--accent);text-decoration:underline}.md h1,.md h2,.md h3{font-weight:600;margin:10px 0 4px}.bubble-error{font-size:13px;color:var(--error-text);font-style:italic}.bubble-time{font-size:11px;color:var(--text-muted);padding:0 4px}.copy-btn{display:inline-flex;align-items:center;gap:4px;background:none;border:1px solid var(--border);border-radius:5px;padding:3px 8px;font-size:11.5px;color:var(--text-muted);transition:background .15s,color .15s}.copy-btn:hover{background:var(--bg);color:var(--text-secondary)}.copy-btn.copied{color:#16a34a;border-color:#86efac}.cursor{display:inline-block;width:2px;height:14px;background:currentColor;border-radius:2px;opacity:.7;animation:blink-cursor .9s step-end infinite;vertical-align:text-bottom;margin-left:2px}@keyframes blink-cursor{50%{opacity:0}}.typing-row{display:flex;align-items:flex-end;gap:8px;margin-bottom:2px}.typing-avatar{width:30px;height:30px;border-radius:8px;background:var(--user-bg);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;flex-shrink:0}.typing-bubble{background:var(--bot-bg);border:1px solid var(--border);border-radius:14px 14px 14px 4px;padding:12px 16px;display:flex;gap:5px;align-items:center}.t-dot{width:6px;height:6px;border-radius:50%;background:var(--text-muted);animation:blink 1.2s ease-in-out infinite}.t-dot:nth-child(2){animation-delay:.2s}.t-dot:nth-child(3){animation-delay:.4s}@keyframes blink{0%,80%,to{opacity:.25}40%{opacity:1}}.input-bar{padding:12px 16px 14px;background:var(--surface);border-top:1px solid var(--border);flex-shrink:0}.input-shell{display:flex;align-items:flex-end;gap:8px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);padding:8px 8px 8px 14px;transition:border-color .15s}.input-shell:focus-within{border-color:var(--border-focus);background:#fff}.input-shell.disabled{opacity:.5;pointer-events:none}.msg-textarea{flex:1;background:transparent;border:none;outline:none;resize:none;color:var(--text-primary);font-size:14px;line-height:1.6;max-height:140px;overflow-y:auto;padding:4px 0}.msg-textarea::placeholder{color:var(--text-muted)}.input-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.stop-btn{display:flex;align-items:center;gap:5px;background:none;border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text-secondary);font-size:12.5px;font-family:inherit;padding:6px 12px;transition:background .15s}.stop-btn:hover{background:var(--bg)}.send-btn{width:36px;height:36px;border-radius:8px;border:none;background:var(--bg);color:var(--text-muted);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,color .15s;flex-shrink:0}.send-btn.ready{background:var(--user-bg);color:#fff}.send-btn.ready:hover{background:#333330}.send-btn:disabled{cursor:not-allowed;opacity:.4}.input-hint{font-size:11px;color:var(--text-muted);text-align:center;margin-top:7px}.app-root{height:100%;background:var(--bg);display:flex;flex-direction:column;align-items:center}.chat-shell{display:flex;flex-direction:column;flex:1;min-height:0;width:100%;max-width:760px;background:var(--surface);border-left:1px solid var(--border);border-right:1px solid var(--border)}.messages-list{flex:1;min-height:0;overflow-y:auto;padding:24px 20px 16px;display:flex;flex-direction:column;gap:4px}.empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;text-align:center;padding:40px 20px;color:var(--text-secondary)}.empty-icon{color:var(--text-muted)}.empty-state h3{font-size:18px;font-weight:600;color:var(--text-primary)}.empty-state p{font-size:14px;color:var(--text-secondary)}.chips{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:8px}.chip{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:7px 14px;font-size:13.5px;color:var(--text-primary);transition:border-color .15s,background .15s}.chip:hover{border-color:var(--border-focus);background:var(--bg)}.err-banner{display:flex;align-items:center;gap:8px;background:var(--error-bg);border:1px solid var(--error-border);border-radius:var(--radius-sm);color:var(--error-text);font-size:13.5px;padding:10px 14px;margin-top:8px}
