:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #7d8590;
  --accent: #1f6feb;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --blue: #58a6ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Status bar ──────────────────────────────────────────────────────────── */
#status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

#status-bar h1 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

#status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

#status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s;
}

#status-dot.connecting { background: var(--yellow); animation: pulse 1s infinite; }
#status-dot.ready      { background: var(--green); }
#status-dot.translating { background: var(--blue); animation: pulse 0.7s infinite; }
#status-dot.error      { background: var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

#latency-display {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── Transcript panel ─────────────────────────────────────────────────────── */
#transcript-panel {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
}

.transcript-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
.transcript-col:last-child { border-right: none; }

.col-header {
  padding: 12px 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.col-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  scroll-behavior: smooth;
}

.utterance {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
  animation: fadein 0.2s ease;
}
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.utterance time {
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.utterance p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
}

.utterance p.error { color: var(--red); font-style: italic; }
.utterance p.fallback { color: var(--yellow); }

/* ── Controls bar ─────────────────────────────────────────────────────────── */
#controls-bar {
  padding: 16px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
}

#session-btn {
  padding: 10px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: opacity 0.2s, background 0.2s;
  min-width: 160px;
}

#session-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#session-btn.active { background: var(--red); }

/* VU meter */
#vu-meter {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
}

.vu-bar {
  width: 4px;
  border-radius: 2px;
  background: var(--green);
  transition: height 0.05s linear;
  min-height: 2px;
}

#error-banner {
  display: none;
  background: #3d1a1a;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 8px 16px;
  font-size: 0.82rem;
  border-radius: 4px;
  flex: 1;
}
