:root {
  --bg-1: #070b18;
  --bg-2: #0d1430;
  --bg-3: #111a3c;
  --text: #eaf0ff;
  --muted: rgba(234, 240, 255, 0.72);
  --panel: rgba(8, 14, 30, 0.72);
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --accent: #2f83ff;
  --accent-soft: rgba(47, 131, 255, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% 5%, rgba(47, 131, 255, 0.24), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(90, 120, 255, 0.2), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
  font-family: "Segoe UI", "Inter", sans-serif;
}

.app-shell {
  max-width: 1080px;
  height: 100vh;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
}

.topbar,
.assistant-switcher,
.chat,
.composer {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #5f66ff);
  box-shadow: 0 10px 22px rgba(47, 131, 255, 0.24);
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
}

.brand-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.assistant-status {
  font-size: 13px;
  color: var(--muted);
}

.assistant-status.is-busy {
  color: var(--text);
}

.assistant-switcher {
  display: flex;
  gap: 10px;
  padding: 10px;
}

.tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
}

.tab.active {
  color: var(--text);
  border-color: rgba(47, 131, 255, 0.6);
  background: var(--accent-soft);
}

.chat {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

.msg .bubble {
  max-width: min(78ch, 82%);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 10px 12px;
  line-height: 1.4;
  font-size: 14px;
}

.msg.user {
  align-items: flex-end;
}

.msg.user .bubble {
  background: rgba(47, 131, 255, 0.2);
  border-color: rgba(47, 131, 255, 0.45);
}

.msg.assistant .bubble {
  background: rgba(255, 255, 255, 0.05);
}

.msg .meta {
  font-size: 12px;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  padding: 8px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
}

#message {
  width: 100%;
  resize: none;
  min-height: 42px;
  max-height: 140px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

#message:focus {
  border-color: rgba(47, 131, 255, 0.7);
}

.composer button {
  height: 42px;
  border: 1px solid rgba(47, 131, 255, 0.7);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(47, 131, 255, 0.65), rgba(95, 102, 255, 0.45));
  cursor: pointer;
  font-size: 14px;
}

.composer button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .app-shell {
    padding: 10px;
    gap: 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .assistant-switcher {
    flex-direction: column;
  }

  .msg .bubble {
    max-width: 100%;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .composer button {
    width: 100%;
  }
}
