:root {
  --bg: #0b0d10;
  --panel: #141820;
  --border: #243041;
  --text: #e8eef7;
  --muted: #8b9bb0;
  --accent: #6ee7b7;
  --accent-dim: #34d399;
  --danger: #f87171;
  --user: #93c5fd;
  --assistant: #6ee7b7;
  --font: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.brand { display: flex; gap: 0.85rem; align-items: center; }
.mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, #a7f3d0, #059669 55%, #064e3b);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.35);
}
h1 { margin: 0; font-size: 1.35rem; letter-spacing: 0.02em; }
.tag { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }

.status {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.85rem;
  color: var(--muted);
}
.status.live { color: var(--accent); border-color: rgba(110, 231, 183, 0.4); }
.status.error { color: var(--danger); border-color: rgba(248, 113, 113, 0.45); }

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

#viz {
  width: 100%;
  height: 120px;
  display: block;
  background: #0a0c0f;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.controls { display: flex; flex-wrap: wrap; gap: 0.6rem; }
button {
  appearance: none;
  border: 1px solid var(--border);
  background: #1a2230;
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent-dim); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
#btnStart {
  background: linear-gradient(180deg, #10b981, #047857);
  border-color: #059669;
  font-weight: 600;
}
#btnStop { border-color: rgba(248, 113, 113, 0.5); }

.hint { color: var(--muted); font-size: 0.85rem; margin: 0.85rem 0 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.panel h2 {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.transcript, .log {
  max-height: 260px;
  overflow: auto;
  font-size: 0.92rem;
  line-height: 1.45;
}
.transcript .line { margin: 0.35rem 0; }
.transcript .user { color: var(--user); }
.transcript .assistant { color: var(--assistant); }
.transcript .system { color: var(--muted); font-style: italic; }

.log {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
}
.log div { margin: 0.2rem 0; white-space: pre-wrap; word-break: break-word; }

footer {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.sip .muted, .workers .muted { color: var(--muted); font-size: 0.85rem; }
.sip .err { color: var(--danger); font-size: 0.85rem; margin-top: 0.35rem; }
.sip .row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.65rem; }
.sip input {
  flex: 1;
  min-width: 160px;
  background: #0a0c0f;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
.job { font-size: 0.85rem; margin: 0.25rem 0; font-family: ui-monospace, Consolas, monospace; }
.job code { color: var(--accent); }
