:root {
  --bg: #0f1216;
  --panel: #191d24;
  --text: #e8ebf0;
  --muted: #9aa4b2;
  --accent: #3b82f6;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  text-align: center;
}
h1 { font-size: 1.5rem; margin: 12px 0 2px; }
.sub { color: var(--muted); margin: 0 0 20px; }

.statusline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 1.05rem;
}
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
.dot.idle { background: var(--muted); }
.dot.connecting { background: var(--amber); animation: pulse 1s infinite; }
.dot.live { background: var(--green); }
.dot.error { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.35; } }

button.big {
  width: 100%;
  padding: 26px;
  font-size: 1.6rem;
  font-weight: 600;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  margin-bottom: 12px;
}
button.big.stop { background: #374151; }
button.big:disabled { opacity: 0.4; cursor: not-allowed; }

.meter {
  height: 16px;
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}
#meter-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--amber));
  transition: width 60ms linear;
}
.hint { color: var(--muted); font-size: 0.85rem; margin: 6px 0 24px; }
#debug { font-family: ui-monospace, monospace; font-size: 0.75rem; color: var(--amber); min-height: 1.2em; margin: -14px 0 20px; word-break: break-word; }

.controls {
  background: var(--panel);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  margin-bottom: 20px;
}
.controls label { display: block; color: var(--muted); font-size: 0.9rem; }
.controls label.spaced { margin-top: 12px; }
.controls select {
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid #2b313b;
}
.row { display: flex; gap: 10px; margin-top: 14px; }
.row button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #2b313b;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.row button:disabled { opacity: 0.4; cursor: not-allowed; }

.panel { background: var(--panel); border-radius: 12px; padding: 16px; text-align: left; }
.panel h2 { font-size: 0.9rem; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
#transcript {
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 1.05rem;
  white-space: pre-wrap;
  word-break: break-word;
}
