:root { color-scheme: dark; --bg: #0b0e13; --panel: #151a22; --line: #29313d; --text: #edf2f7; --muted: #9aa7b8; --accent: #0f766e; --red: #d92d3a; --green: #1f9d55; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
button { border: 1px solid #384354; border-radius: 9px; background: #202936; padding: 10px 14px; cursor: pointer; }
button:hover { background: #2b3747; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
button.danger { background: #6f2631; border-color: #873442; }
button.on { background: #6f2631; border-color: #873442; }
select, input:not([type=range]) { width: 100%; background: #0f141b; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
a { color: #5eead4; }

.plain, .notice { display: grid; place-items: center; min-height: 100%; padding: 24px; text-align: center; }
.notice h1 { font-size: 22px; margin: 0 0 8px; }
.notice p { color: var(--muted); margin: 0 0 16px; }

.setup { max-width: 960px; margin: 0 auto; padding: 20px 16px; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .setup { grid-template-columns: 3fr 2fr; align-items: start; padding-top: 48px; } .brand { grid-column: 1 / -1; } }
.brand { font-size: 18px; } .brand b { letter-spacing: .02em; }
.brand span:not(:empty)::before { content: " · "; color: var(--muted); }
.preview { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; }
.preview video, .stage video#studio { width: 100%; height: 100%; object-fit: contain; display: block; }
#self, #pip { transform: scaleX(-1); }
.blocked { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); background: #000c; }
.form { display: grid; gap: 12px; }
.hint { font-size: 12px; color: var(--muted); margin: 0; }
.meter { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 5px; background: #ffffff22; border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: #22c55e; transition: width 80ms linear; }
.meter.small { position: static; width: 60px; flex: none; }

.call { position: fixed; inset: 0; display: flex; flex-direction: column; }
.stage { position: relative; flex: 1; background: #000; min-height: 0; border: 4px solid transparent; transition: border-color .2s; }
body.tally-program .stage { border-color: var(--red); }
body.tally-preview .stage { border-color: var(--green); }
.wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 20px; text-align: center; }
#pip { position: absolute; right: 12px; bottom: 12px; width: min(28%, 240px); aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid #ffffff33; background: #111; }
.tally { position: absolute; left: 12px; top: 12px; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.tally:empty { display: none; }
body.tally-program .tally { background: var(--red); }
body.tally-preview .tally { background: var(--green); }
.bar { display: flex; gap: 8px; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
.status { flex: 1; min-width: 120px; font-size: 13px; color: var(--muted); }
.drawer { position: absolute; right: 12px; bottom: 70px; width: min(320px, calc(100% - 24px)); display: grid; gap: 10px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 50px #0009; }
