:root { color-scheme: light dark; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; background: #0f172a; color: #e5e7eb; }
.app { min-height: 100vh; display: grid; place-items: center; }
.hidden { display: none !important; }
.card { width: min(420px, calc(100vw - 32px)); background: #111827; border: 1px solid #334155; border-radius: 18px; padding: 28px; box-shadow: 0 20px 80px #0008; }
h1 { margin: 0 0 6px; }
.muted { color: #94a3b8; }
.error { color: #fca5a5; min-height: 1.4em; }
label { display: block; margin: 16px 0; color: #cbd5e1; }
input, textarea { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid #334155; background: #020617; color: #e5e7eb; font: inherit; }
button { border: 0; border-radius: 12px; padding: 11px 16px; background: #38bdf8; color: #082f49; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.ghost { background: #1e293b; color: #cbd5e1; }
.chat { width: min(980px, 100vw); height: 100vh; display: grid; grid-template-rows: auto 1fr auto auto; background: #020617; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #1e293b; background: #0f172a; }
.actions { display: flex; gap: 8px; }
.messages { overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 78%; padding: 12px 14px; border-radius: 16px; white-space: pre-wrap; line-height: 1.55; }
.msg.user { align-self: flex-end; background: #075985; }
.msg.assistant { align-self: flex-start; background: #1e293b; }
.msg.system { align-self: center; color: #94a3b8; font-size: 13px; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px 18px; border-top: 1px solid #1e293b; }
.composer textarea { resize: none; margin: 0; }
.status { margin: 0; padding: 0 18px 12px; min-height: 1.2em; }
@media (max-width: 640px) { .msg { max-width: 92%; } .topbar { align-items: flex-start; gap: 10px; } .actions { flex-wrap: wrap; justify-content: flex-end; } }
.attachBtn { display: grid; place-items: center; width: 44px; height: 44px; margin: 0; border-radius: 12px; border: 1px solid #e5e7eb; background: #fff; color: #64748b; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.attachBtn:hover { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.attachIcon { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.attachBtn input { display: none; }
.fileList { grid-column: 1 / -1; color: #94a3b8; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.streaming::after { content: '▍'; display: inline-block; margin-left: 2px; color: #38bdf8; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0; } }
