:root {
  --bg: #080a0f;
  --surface: rgba(18, 21, 29, 0.78);
  --surface-strong: #151923;
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text: #f5f7fb;
  --muted: #969eae;
  --accent: #8b7cff;
  --accent-2: #5e9cff;
  --user: #252a37;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(108, 93, 255, 0.13), transparent 35%),
    var(--bg);
  overflow-x: hidden;
}

button, textarea {
  font: inherit;
}

.background-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.09;
  pointer-events: none;
}

.glow-one {
  background: #7a5cff;
  top: 20%;
  left: -220px;
}

.glow-two {
  background: #408cff;
  right: -220px;
  bottom: 5%;
}

.app-shell {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

.brand-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.045);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  color: #c8c1ff;
  font-size: 19px;
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: #b9c1ce;
  background: rgba(255,255,255,0.025);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55d98b;
  box-shadow: 0 0 12px rgba(85, 217, 139, 0.8);
}

.hero {
  text-align: center;
  padding: clamp(65px, 10vh, 110px) 20px 42px;
}

.hero-badge {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(139, 124, 255, 0.08);
  border: 1px solid rgba(139, 124, 255, 0.18);
  color: #b8afff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.hero h1 {
  margin: 18px 0 14px;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero h1 span {
  background: linear-gradient(100deg, #a89eff, #78aaff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 570px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.chat-card {
  width: min(900px, 100%);
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.messages {
  min-height: 390px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 30px;
  scroll-behavior: smooth;
}

.welcome-message {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.welcome-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(139,124,255,0.11);
  border: 1px solid rgba(139,124,255,0.2);
  color: #bcb4ff;
  font-size: 21px;
  margin-bottom: 18px;
}

.welcome-message h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.welcome-message p {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 650px;
}

.suggestion {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
  color: #c7ccd6;
  padding: 10px 13px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 12px;
  transition: 0.2s ease;
}

.suggestion:hover {
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.055);
  transform: translateY(-1px);
}

.message {
  display: flex;
  margin-bottom: 24px;
  animation: appear 0.25s ease-out;
}

.message.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 78%;
  padding: 14px 16px;
  border-radius: 17px;
  font-size: 14px;
  line-height: 1.65;
}

.message.user .message-bubble {
  background: var(--user);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom-right-radius: 5px;
}

.message.ai {
  justify-content: flex-start;
}

.message.ai .message-bubble {
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}

.source {
  margin-top: 11px;
  color: #aaa2ff;
  font-size: 11px;
}

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 5px 2px;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9da5b6;
  animation: bounce 1s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.12s; }
.typing span:nth-child(3) { animation-delay: 0.24s; }

.composer {
  margin: 0 18px 0;
  padding: 8px;
  display: flex;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  border-radius: 17px;
}

textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 130px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 12px 10px;
  line-height: 20px;
}

textarea::placeholder {
  color: #6f7786;
}

#send-button {
  align-self: stretch;
  min-width: 82px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #8778ff, #648fff);
  color: white;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: 0.2s ease;
}

#send-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

#send-button:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.send-arrow {
  font-size: 16px;
}

.composer-hint {
  display: flex;
  justify-content: space-between;
  padding: 11px 24px 17px;
  color: #606878;
  font-size: 10px;
}

footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: #4f5664;
  font-size: 10px;
  padding: 20px;
  margin-top: auto;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 650px) {
  .app-shell {
    width: min(100% - 22px, 1080px);
    padding-top: 17px;
  }

  .brand-subtitle {
    display: none;
  }

  .hero {
    padding-top: 55px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .messages {
    padding: 20px;
  }

  .message-bubble {
    max-width: 88%;
  }

  .composer-hint span:first-child {
    max-width: 70%;
  }
}
