:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #52606d;
  --line: #d9e2ec;
  --accent: #1f6feb;
  --assistant: #eef6ff;
  --user: #eef9f0;
  --error: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top right, #edf4ff 0%, var(--bg) 50%);
  color: var(--ink);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #ffffffcc;
  backdrop-filter: blur(4px);
}

.site-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.panel h2 {
  margin-top: 0;
}

.narrow {
  max-width: 560px;
}

.meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
}

.scenario .markdown-body {
  max-height: 72vh;
  overflow: auto;
  line-height: 1.45;
}

.messages {
  min-height: 340px;
  max-height: 56vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  background: #fbfcfd;
}

.message {
  margin-bottom: 0.75rem;
  display: flex;
}

.message .bubble {
  max-width: 92%;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  white-space: pre-wrap;
}

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

.message.user .bubble {
  background: var(--user);
}

.message.assistant .bubble {
  background: var(--assistant);
}

.chat-form textarea,
textarea,
input,
select {
  width: 100%;
  padding: 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  font: inherit;
}

.row {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stack > * + * {
  margin-top: 0.6rem;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 0.95rem;
  font: inherit;
  cursor: pointer;
}

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

.status {
  color: var(--muted);
  font-size: 0.92rem;
}

.error {
  color: var(--error);
}

.citations {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .scenario .markdown-body,
  .messages {
    max-height: none;
  }
}

