:root {
  --brand: #4f46e5;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --ok: #15803d;
  --err: #b91c1c;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111827;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #1f2937;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--brand); }
header.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--surface); border-bottom: 3px solid var(--brand);
}
header.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); }
header.top img { height: 36px; width: auto; border-radius: 6px; }
header.top nav { display: flex; gap: 14px; margin-left: auto; flex-wrap: wrap; }
header.top nav a { text-decoration: none; color: var(--text); }
header.top nav a:hover { color: var(--brand); }
main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.side { display: flex; flex-direction: column; gap: 4px; }
.side a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.side a.active, .side a:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } .side { flex-direction: row; flex-wrap: wrap; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.narrow { max-width: 440px; margin: 40px auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.hero { padding: 40px 24px; border-radius: var(--radius); background: var(--brand); color: #fff; margin-bottom: 24px; }
.hero h1 { margin: 0 0 8px; font-size: 2rem; }
h1, h2, h3 { line-height: 1.2; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
input, textarea, select {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
input[type="checkbox"] { width: auto; margin-top: 4px; }
input[type="color"] { padding: 2px; height: 42px; width: 80px; }
.help { font-size: 0.875rem; color: var(--muted); margin-top: 4px; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.accent { background: var(--accent); color: #111; }
.btn.danger { background: var(--err); }
.btn.small { padding: 6px 12px; font-size: 0.875rem; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--border); }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.live { background: var(--err); color: #fff; }
.progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.steps li::before {
  counter-increment: step; content: counter(step);
  flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--border); font-weight: 700;
}
.steps li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.steps li .grow { flex: 1; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.error { color: var(--err); margin-top: 8px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 8px; z-index: 10;
}
.lesson { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.player { aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.player video, .player mux-player { width: 100%; height: 100%; display: block; }
.room { width: 100%; height: 70vh; min-height: 420px; border: 0; border-radius: var(--radius); background: #000; }
.preview-swatch { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); display: inline-block; }
code, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.875rem; overflow-wrap: anywhere; }
