:root { color-scheme: dark; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #0b1020; color: #e7edf8; }
button, input, textarea { font: inherit; }
button { border: 0; border-radius: 12px; padding: 0.75rem 1rem; background: #2d6cdf; color: white; font-weight: 700; cursor: pointer; }
.sso { display: block; text-align: center; text-decoration: none; border-radius: 12px; padding: 0.85rem 1rem; background: #f8fafc; color: #111827; font-weight: 800; margin-top: 1.4rem; }
.divider { text-align: center; color: #94a3b8; margin: 1rem 0; font-size: .9rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.danger { background: #b42318; }
input, textarea { width: 100%; border: 1px solid #334155; border-radius: 12px; background: #111827; color: #e7edf8; padding: .85rem; }
textarea { resize: vertical; max-height: 35vh; }
.hidden { display: none !important; }
.app { min-height: 100vh; display: grid; }
.panel.login { width: min(92vw, 420px); margin: auto; padding: 2rem; border: 1px solid #243047; border-radius: 24px; background: #111827; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.login h1 { margin: 0; font-size: 2.4rem; }
.login form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.error { color: #fca5a5; min-height: 1.4rem; margin-top: 1rem; }
.chat { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto auto; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem max(1rem, env(safe-area-inset-left)); border-bottom: 1px solid #243047; background: rgba(11,16,32,.92); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 1.2rem; }
#status { color: #93c5fd; font-size: .9rem; }
.actions { display: flex; gap: .5rem; }
.actions button { padding: .55rem .75rem; background: #1f2937; }
.messages { padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: .85rem; }
.msg { border: 1px solid #243047; border-radius: 18px; padding: .9rem; background: #111827; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 85%; background: #17345f; }
.msg.assistant { max-width: 95%; }
.msg.events { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #cbd5e1; background: #0f172a; font-size: .86rem; }
.msg .label { display: block; margin-bottom: .35rem; color: #93c5fd; font-weight: 800; }
.approval { margin: .75rem 1rem; padding: 1rem; border: 1px solid #f59e0b; border-radius: 18px; background: #2f2208; }
.approval pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 35vh; overflow: auto; }
.approval div { display: flex; flex-wrap: wrap; gap: .5rem; }
.composer { position: sticky; bottom: 0; display: grid; grid-template-columns: auto 1fr auto auto; gap: .5rem; padding: .75rem max(.75rem, env(safe-area-inset-right)) max(.75rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left)); border-top: 1px solid #243047; background: rgba(11,16,32,.95); }
#micBtn { background: #334155; }
@media (max-width: 640px) { .composer { grid-template-columns: auto 1fr auto; } #stopBtn { grid-column: 1 / span 1; } #sendBtn { grid-column: 3 / span 1; } .actions button { padding: .5rem; } }
