:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0c111d;
  color: #e6edf6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(65, 88, 208, 0.22), transparent 32rem),
    #0c111d;
}

button,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 1rem;
  max-width: 980px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.25rem;
}

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

.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
}

.topbar p {
  margin: 0.2rem 0 0;
  color: #9aa8bd;
}

button {
  border: 1px solid #334155;
  border-radius: 0.75rem;
  background: #1d4ed8;
  color: white;
  cursor: pointer;
  padding: 0.7rem 1rem;
}

button:hover {
  background: #2563eb;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status {
  border: 1px solid #233044;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.72);
  color: #9aa8bd;
  padding: 0.65rem 0.8rem;
}

.transcript {
  overflow-y: auto;
  border: 1px solid #233044;
  border-radius: 1rem;
  background: rgba(2, 6, 23, 0.62);
  padding: 1rem;
}

.message {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.message .role {
  color: #9aa8bd;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.message .text {
  white-space: pre-wrap;
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
}

.message.user .text {
  margin-left: auto;
  max-width: 80%;
  background: #1d4ed8;
}

.message.assistant .text {
  background: #111827;
}

.message.stderr .text,
.message.status .text {
  background: #3f1d1d;
  color: #fecaca;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #334155;
  border-radius: 0.9rem;
  background: #0f172a;
  color: #e6edf6;
  padding: 0.85rem 1rem;
}

@media (max-width: 720px) {
  .topbar,
  .composer {
    grid-template-columns: 1fr;
    display: grid;
  }

  .message.user .text {
    max-width: 100%;
  }
}
