:root {
  --bg: #f7f7f5; --card: #fff; --text: #1c1c1a; --muted: #6b6b66; --line: #e4e4df;
  --accent: #5b3df5; --accent-text: #fff; --danger: #c62828; --ok: #1b7f4b; --warn: #a96500;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131313; --card: #1d1d1c; --text: #ecece8; --muted: #9a9a94; --line: #2e2e2b;
    --accent: #8b74ff; --accent-text: #111; --danger: #ef7676; --ok: #57c88a; --warn: #e8b04a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.wrap { max-width: 920px; margin: 0 auto; padding: 20px 16px 64px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
a { color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 200px; }
.muted { color: var(--muted); font-size: 13px; }
label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
input[type=text], input[type=password], select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; min-width: 0;
}
input[type=text], input[type=password], textarea { width: 100%; }
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 8px 14px; text-decoration: none; display: inline-block;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--danger); }
button.small { padding: 4px 10px; font-size: 13px; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.badge.ready { color: var(--ok); border-color: var(--ok); }
.badge.error { color: var(--danger); border-color: var(--danger); }
.badge.busy { color: var(--warn); border-color: var(--warn); }
.vlist .item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.vlist .item:first-child { border-top: 0; }
.vlist .title { font-weight: 600; text-decoration: none; color: var(--text); }
.err { color: var(--danger); font-size: 14px; }
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cue { display: grid; grid-template-columns: 110px 110px 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.cue.active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cue input.t { width: 100%; font-variant-numeric: tabular-nums; }
.cue textarea { min-height: 40px; resize: vertical; }
.cue .acts { display: flex; flex-direction: column; gap: 4px; }
.cue input.bad { border-color: var(--danger); }
.share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.share.revoked { opacity: .5; text-decoration: line-through; }
.share code { font-size: 12px; word-break: break-all; }
#preview { width: 240px; border-radius: 8px; background: #000; display: none; }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #e53935; margin-right: 6px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (max-width: 640px) {
  .cue { grid-template-columns: 1fr 1fr; }
  .cue textarea { grid-column: 1 / -1; }
  .cue .acts { grid-column: 1 / -1; flex-direction: row; }
}
