:root {
  --bg: #07131c;
  --panel: rgba(10, 27, 39, 0.88);
  --line: rgba(123, 236, 206, 0.18);
  --text: #edf7ff;
  --muted: #a5c0cf;
  --accent: #72f0cb;
  --accent-2: #20a4f3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(32, 164, 243, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(114, 240, 203, 0.2), transparent 30%),
    linear-gradient(160deg, #061018, #0b1f2d 55%, #08141f);
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  display: grid;
  gap: 20px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
}

.hero-panel,
.chat-panel,
.auth-card,
.history-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.hero-panel {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.94;
}

.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1rem;
}

.status-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(114, 240, 203, 0.24);
  color: var(--accent);
}

.status-pill.muted {
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.chat-panel {
  padding: 20px;
}

.auth-card {
  padding: 20px;
}

.history-panel {
  padding: 18px;
}

.auth-card h2 {
  margin-top: 0;
  font-size: 1rem;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.history-header h2 {
  margin: 0;
  font-size: 1rem;
}

.conversation-list {
  display: grid;
  gap: 10px;
}

.conversation-item {
  width: 100%;
  text-align: left;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 15, 27, 0.76);
  color: var(--text);
  padding: 14px;
}

.conversation-item.active {
  border-color: rgba(114, 240, 203, 0.4);
}

.conversation-item strong,
.conversation-item span {
  display: block;
}

.conversation-item span,
.empty-text {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 6px;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.top-bar p {
  margin: 6px 0 0;
}

.notice-text {
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 10px;
}

.messages {
  min-height: 420px;
  max-height: 62vh;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 8px;
}

.message {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.message.assistant {
  background: rgba(12, 35, 32, 0.65);
}

.message.user {
  background: rgba(8, 21, 39, 0.75);
}

.label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
}

.composer {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(5, 15, 27, 0.9);
  color: var(--text);
  padding: 16px;
  resize: vertical;
  min-height: 120px;
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(5, 15, 27, 0.9);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 20px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: #07131c;
  background: linear-gradient(135deg, var(--accent), #a5ffec);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

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

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

  .hero-panel,
  .chat-panel,
  .auth-card,
  .history-panel {
    border-radius: 22px;
  }

  .top-bar {
    flex-direction: column;
  }
}
