:root {
  --bg: #14181f;
  --panel: #1c2229;
  --panel-raised: #232a33;
  --border: #2c343e;
  --text: #e6e9ef;
  --text-muted: #8b93a3;
  --accent: #4fd1c5;
  --accent-dim: #327a72;
  --waiting: #e8a33d;
  --failed: #e2686b;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
}

.mono { font-family: var(--font-mono); }

.topbar {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.topbar-title .mono {
  color: var(--accent);
  font-weight: 400;
}

.topbar-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px;
}

.intake {
  max-width: 640px;
  margin: 0 auto 24px;
}

.intake-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

#mission-input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 14px;
  resize: vertical;
}

#mission-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-primary {
  margin-top: 12px;
  background: var(--accent);
  color: #0b1210;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
}

.btn-primary:hover { background: #63ddd2; }
.btn-primary:disabled { background: var(--accent-dim); color: #0b1210aa; cursor: default; }

.board {
  display: grid;
  grid-template-columns: 200px 1fr 240px;
  gap: 24px;
  align-items: start;
}

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

.section-heading {
  font-size: 13px;
  text-transform: none;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 0 12px;
}

.roster {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
}

.agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.agent-card.active .agent-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.agent-card.waiting .agent-dot { background: var(--waiting); box-shadow: 0 0 8px var(--waiting); }
.agent-card.done .agent-dot { background: var(--text-muted); opacity: 0.5; }

.agent-name { font-weight: 500; font-size: 14px; }
.agent-role { font-size: 12px; color: var(--text-muted); display: block; }

.task-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.task-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.task-title { font-size: 14px; font-weight: 500; }
.task-agent { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

.swarm-tag {
  margin-left: 8px;
  color: var(--accent);
  opacity: 0.8;
}

.task-status {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.status-pending { color: var(--text-muted); background: #262d36; }
.status-in_progress { color: var(--accent); background: #17332f; }
.status-completed { color: var(--text-muted); background: #22282f; }
.status-waiting_for_user { color: var(--waiting); background: #332a17; }
.status-failed { color: var(--failed); background: #3a2226; }

.task-output {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.decision-card, .report-card {
  background: var(--panel-raised);
  border: 1px solid var(--waiting);
  border-radius: 10px;
  padding: 18px;
  margin-top: 16px;
}

.report-card { border-color: var(--border); }

.decision-card h3, .report-card h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}

.decision-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.option-btn {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-sans);
}

.option-btn:hover { border-color: var(--accent); }

.option-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.option-name { font-weight: 600; font-size: 14px; }
.option-summary { font-size: 13px; color: var(--text-muted); }

.recommendation {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--waiting);
}

#report-text {
  font-size: 14px;
  line-height: 1.6;
}

audio { width: 100%; margin-top: 10px; }

.audio-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

.timeline {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.timeline-list li {
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.timeline-list li:first-child {
  color: var(--text);
  border-left-color: var(--accent);
}

.error-banner {
  max-width: 640px;
  margin: 16px auto 0;
  background: #3a2226;
  border: 1px solid var(--failed);
  color: var(--failed);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}
