:root {
  --bg: #f7f7fb;
  --text: #1f2937;
  --card: #ffffff;
  --border: #e5e7eb;
  --accent: #2563eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 16px 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

h1 { margin: 0 0 8px; }

.subtitle { margin: 0 0 16px; color: #6b7280; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}

.composer {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 10;
  padding-top: 12px;
}

.clear-form {
  margin-top: 10px;
}

label { display: block; margin: 8px 0; font-weight: 600; }

input, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

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

.hidden { display: none; }

.alert {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.status { color: #6b7280; font-size: 14px; }

.citation-id {
  color: #9ca3af;
  font-size: 12px;
}

.debug-toggle {
  cursor: pointer;
  font-size: 0.9em;
  color: #007bff;
  margin-bottom: 8px;
  display: inline-block;
  background: transparent;
  border: none;
  padding: 0;
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exchange {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message .meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}

.message .bubble {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f9fafb;
  white-space: pre-wrap;
}

.message.user .bubble {
  background: #e0f2fe;
  border-color: #bae6fd;
}

.message.assistant .bubble {
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.empty {
  color: #6b7280;
}

pre {
  background: #f3f4f6;
  padding: 12px;
  border-radius: 8px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
