:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: rgba(17, 24, 39, 0.82);
  --panel-2: rgba(30, 41, 59, 0.72);
  --text: #e5eefb;
  --muted: #91a4bf;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --danger: #f97373;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(124, 58, 237, 0.28), transparent 34rem),
    radial-gradient(circle at 90% 20%, rgba(6, 182, 212, 0.22), transparent 32rem),
    linear-gradient(135deg, #050816, var(--bg));
}
.shell {
  width: min(980px, calc(100vw - 24px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 24px 0;
}
.hero, .composer, .chat {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}
.hero {
  border-radius: 24px;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.eyebrow { margin: 0 0 8px; color: var(--accent-2); letter-spacing: .14em; text-transform: uppercase; font-size: 12px; }
h1 { margin: 0; font-size: clamp(32px, 6vw, 56px); line-height: .95; }
.sub { margin: 10px 0 0; color: var(--muted); }
.status { padding: 8px 12px; border-radius: 999px; background: rgba(6, 182, 212, .12); color: #a5f3fc; font-size: 13px; white-space: nowrap; }
.status.error { background: rgba(249, 115, 115, .12); color: var(--danger); }
.chat {
  border-radius: 24px;
  padding: 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }
.avatar {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800;
}
.user .avatar { background: var(--panel-2); }
.bubble {
  max-width: min(680px, 78vw);
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, .85);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.user .bubble { background: linear-gradient(135deg, rgba(124, 58, 237, .9), rgba(6, 182, 212, .78)); }
.composer {
  border-radius: 22px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}
textarea {
  width: 100%;
  resize: vertical;
  min-height: 52px;
  max-height: 180px;
  border: 0;
  outline: 0;
  border-radius: 16px;
  padding: 14px;
  color: var(--text);
  background: rgba(15, 23, 42, .72);
  font: inherit;
}
button {
  border: 0;
  border-radius: 16px;
  padding: 0 22px;
  color: white;
  font: inherit;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
}
button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 640px) {
  .hero { align-items: flex-start; flex-direction: column; }
  .composer { grid-template-columns: 1fr; }
  button { min-height: 48px; }
}
