:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #7c3aed 0, transparent 30%),
              radial-gradient(circle at bottom right, #06b6d4 0, transparent 28%),
              #111827;
  color: #f8fafc;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
button, input { font: inherit; }
.app-shell { width: min(900px, 100%); display: grid; gap: 16px; }
.card {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(15, 23, 42, .78);
  backdrop-filter: blur(18px);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.intro { padding: 28px; display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.eyebrow { margin: 0 0 8px; color: #a5b4fc; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; }
h1 { margin: 0; font-size: clamp(34px, 7vw, 62px); line-height: .95; }
p { color: #cbd5e1; }
.status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: #cbd5e1; }
#statusDot { width: 10px; height: 10px; border-radius: 999px; background: #f59e0b; box-shadow: 0 0 18px currentColor; }
.connected #statusDot { background: #22c55e; }
.disconnected #statusDot { background: #ef4444; }
.name-row { padding: 18px; display: grid; gap: 10px; }
.name-row label { color: #cbd5e1; font-weight: 700; }
.inline-form, .composer { display: flex; gap: 10px; }
input {
  flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 16px;
  background: rgba(255,255,255,.08); color: #fff; padding: 14px 16px; outline: none;
}
input:focus { border-color: #818cf8; box-shadow: 0 0 0 4px rgba(129,140,248,.18); }
button {
  border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 800; color: #0f172a;
  background: linear-gradient(135deg, #a5b4fc, #67e8f9); cursor: pointer;
}
button:hover { filter: brightness(1.08); }
.chat-card { overflow: hidden; }
.chat-header { display: flex; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.12); color: #e2e8f0; }
.messages { list-style: none; margin: 0; padding: 18px; height: min(54vh, 520px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.message, .presence { animation: pop .16s ease-out; }
.message { align-self: start; max-width: 78%; padding: 12px 14px; border-radius: 18px; background: rgba(255,255,255,.1); }
.message .meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.message .user { font-weight: 900; color: #bfdbfe; }
.message time { color: #94a3b8; font-size: 12px; }
.message .text { white-space: pre-wrap; word-break: break-word; }
.presence { align-self: center; color: #cbd5e1; font-size: 13px; background: rgba(255,255,255,.07); border-radius: 999px; padding: 6px 10px; }
.composer { padding: 16px; border-top: 1px solid rgba(255,255,255,.12); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 650px) { .intro { flex-direction: column; } .inline-form, .composer { flex-direction: column; } .message { max-width: 100%; } }
