/* terraphim_megahal demo -- minimal, framework-free styling. */

:root {
  --bg: #10141a;
  --panel: #171d26;
  --panel-edge: #232c3a;
  --text: #d7dee9;
  --muted: #8b96a8;
  --accent: #4fb3ff;
  --bot: #9ee6b8;
  --you: #8ab4f8;
}

* {
  box-sizing: border-box;
}

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

.shell {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.masthead h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.attribution code {
  color: var(--accent);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
}

.controls label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

select,
input[type="text"],
textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--panel-edge);
  border-radius: 0.35rem;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

button {
  background: var(--accent);
  color: #08131f;
  border: 0;
  border-radius: 0.35rem;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

.status {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: auto;
}

.chat-log {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 0.5rem;
  min-height: 16rem;
  max-height: 28rem;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-line {
  padding: 0.35rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.chat-you {
  background: rgba(138, 180, 248, 0.12);
  align-self: flex-end;
}

.chat-bot {
  background: rgba(158, 230, 184, 0.1);
  align-self: flex-start;
}

.composer {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.composer input[type="text"] {
  flex: 1;
}

.latency {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  min-width: 5rem;
  text-align: right;
}

.trainer {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
}

.trainer summary {
  cursor: pointer;
  color: var(--muted);
}

.trainer textarea {
  width: 100%;
  margin: 0.6rem 0;
  resize: vertical;
}

.footnote {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Brain Lab: side-by-side comparison of two brains. */

.lab {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 0.5rem;
  padding: 0.9rem;
}

.lab h2 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.lab-intro {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.lab-brain h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.lab-tag {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.78rem;
}

.lab-log {
  min-height: 10rem;
  max-height: 16rem;
}

.lab-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.lab-controls textarea {
  width: 100%;
  resize: vertical;
}

.lab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

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