*{box-sizing:border-box;margin:0;padding:0}body{color:#222;background:#eef0f4;font-family:sans-serif;font-size:14px}#root{justify-content:center;align-items:center;min-height:100vh;padding:20px;display:flex}h1{margin-bottom:4px;font-size:22px}h2{font-size:16px}h3{text-transform:uppercase;color:#888;margin:16px 0 6px;font-size:12px}a{color:#4f46e5}button{cursor:pointer;background:#fff;border:1px solid #ccc;border-radius:6px;padding:8px 14px;font-size:14px}button:hover{background:#f0f0f0}button:disabled{opacity:.6;cursor:not-allowed}button.primary{color:#fff;background:#4f46e5;border-color:#4f46e5}button.primary:hover{background:#4338ca}input{border:1px solid #ccc;border-radius:6px;width:100%;padding:10px 12px;font-size:14px}.muted{color:#888}.error{color:#dc2626}.loading{color:#888}.auth-card{text-align:center;background:#fff;border-radius:12px;width:100%;max-width:360px;padding:32px;box-shadow:0 4px 20px #00000014}.auth-card form{flex-direction:column;gap:12px;margin:24px 0 16px;display:flex}.chat-card{background:#fff;border-radius:12px;width:100%;max-width:960px;height:80vh;display:flex;overflow:hidden;box-shadow:0 4px 20px #00000014}.sidebar{background:#fafafa;border-right:1px solid #eee;flex-direction:column;gap:8px;width:240px;padding:16px;display:flex;overflow-y:auto}.list{list-style:none}.list li{cursor:pointer;border-radius:6px;justify-content:space-between;align-items:center;gap:6px;padding:6px 8px;display:flex}.list li span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.list li:hover,.list li.active{background:#e8e8f8}button.icon{color:#999;background:0 0;border:none;padding:0 4px}.user{border-top:1px solid #eee;justify-content:space-between;align-items:center;margin-top:auto;padding-top:12px;display:flex}.chat{flex-direction:column;flex:1;min-width:0;display:flex}.chat-header{border-bottom:1px solid #eee;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;display:flex}.chat-header h2{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}.mode-switch{flex-shrink:0;display:flex}.mode-switch button:first-child{border-radius:6px 0 0 6px}.mode-switch button:last-child{border-left:none;border-radius:0 6px 6px 0}.mode-switch button.active{color:#fff;background:#4f46e5;border-color:#4f46e5}.messages{flex-direction:column;flex:1;gap:12px;padding:16px;display:flex;overflow-y:auto}.empty{color:#888;margin:auto}.message{border-radius:10px;flex-direction:column;gap:6px;max-width:75%;padding:10px 14px;display:flex}.message p{white-space:pre-wrap;line-height:1.5}.message.user{color:#fff;background:#4f46e5;align-self:flex-end}.message.assistant{background:#f3f4f6;align-self:flex-start}.message.error{color:#dc2626;background:#fee2e2}.badge{color:#4f46e5;background:#e0e7ff;border-radius:4px;align-self:flex-start;padding:2px 6px;font-size:11px}.chat-input{border-top:1px solid #eee;gap:8px;padding:12px 16px;display:flex}@media (width<=700px){.chat-card{flex-direction:column;height:90vh}.sidebar{border-bottom:1px solid #eee;border-right:none;width:100%;max-height:40%}}
