:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --text: #e8e9ec;
  --muted: #8b909c;
  --accent: #6ea8ff;
  --danger: #ff6b6b;
  --ok: #52c988;
  --border: #2a2f3a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; gap: 20px;
  text-align: center;
}

h1 {
  font-size: 20px; font-weight: 600; margin: 0;
  display: flex; align-items: center; gap: 8px;
}

.status {
  color: var(--muted); font-size: 14px; min-height: 20px; max-width: 320px;
}

.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

#mic-btn {
  width: 120px; height: 120px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--panel);
  color: var(--text); font-size: 40px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

#mic-btn:active { transform: scale(0.96); }
#mic-btn[data-state="idle"] { border-color: var(--border); }
#mic-btn[data-state="connecting"] { border-color: var(--accent); animation: pulse 1.2s infinite; }
#mic-btn[data-state="listening"] { border-color: var(--ok); background: #1a2a20; }
#mic-btn[data-state="speaking"] { border-color: var(--accent); background: #16233a; }
#mic-btn[data-state="error"] { border-color: var(--danger); }

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

#transcript {
  max-width: 420px; width: 100%; max-height: 40vh; overflow-y: auto;
  text-align: left; font-size: 14px; line-height: 1.5; padding: 0 4px;
}

#transcript .line { padding: 6px 10px; margin-bottom: 6px; border-radius: 8px; }
#transcript .line.bremo { background: var(--panel); }
#transcript .line.progress,
#transcript .line.bremo_narration { background: transparent; color: var(--muted); font-style: italic; font-size: 13px; }
#transcript .line.user { background: var(--panel-2); text-align: right; }

.hint { color: var(--muted); font-size: 12px; max-width: 300px; }

a.back { color: var(--accent); font-size: 13px; text-decoration: none; }
