:root {
  --bg: #0f1115;
  --panel: #181b22;
  --line: #2a2f3a;
  --text: #eef0f4;
  --muted: #9aa3b2;
  --accent: #3d7eff;
  --live: #e5484d;
  --ok: #30a46c;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
[hidden] { display: none !important; }
.card { width: 100%; max-width: 560px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px; }
h1 { margin: 0 0 6px; font-size: 24px; }
.lede, .hint { color: var(--muted); margin: 0 0 16px; }
.hint { font-size: 14px; margin-top: 4px; }
.preview { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 16px; color: var(--muted); }
.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 16px; }
#meterBar { height: 100%; width: 0; background: var(--ok); transition: width 80ms linear; }
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); padding: 10px 16px; }
button:disabled { opacity: 0.5; cursor: default; }
.primary { width: 100%; background: var(--accent); border-color: var(--accent); font-weight: 600; padding: 12px; }
.danger { background: var(--live); border-color: var(--live); }
.error { color: #ff8f8f; min-height: 1.2em; margin: 10px 0 0; }
#call { width: 100%; max-width: 1280px; }
.stage { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
#program { width: 100%; height: 100%; object-fit: contain; }
#selfView { position: absolute; right: 12px; bottom: 12px; width: 22%; min-width: 120px; aspect-ratio: 16 / 9;
  object-fit: cover; border-radius: 8px; border: 2px solid rgba(255,255,255,0.25); transform: scaleX(-1); background: #111; }
.bar { display: flex; align-items: center; gap: 8px; padding: 12px 0; flex-wrap: wrap; }
.spacer { flex: 1; }
.status { padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.status.on { color: #fff; background: var(--live); border-color: var(--live); }
.status.ready { color: #fff; background: var(--ok); border-color: var(--ok); }
.round.off { background: #3a2a2a; border-color: #5a3a3a; }
