:root {
  color-scheme: dark;
  --bg: #10131a;
  --panel: #171c26;
  --panel-2: #202738;
  --text: #f4f7fb;
  --muted: #b8c1d1;
  --line: #2e374a;
  --accent: #8bd3ff;
  --danger: #ff8b8b;
  --ok: #8bffca;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: radial-gradient(circle at top left, #1f2a44, var(--bg) 42rem); color: var(--text); }
a { color: var(--accent); }
.page-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.card { width: min(980px, 100%); background: color-mix(in srgb, var(--panel), transparent 4%); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 24px 80px rgba(0,0,0,.35); padding: clamp(1.25rem, 3vw, 2.4rem); }
.card.narrow { width: min(520px, 100%); }
h1, h2, h3 { line-height: 1.05; margin: 0 0 .8rem; }
h1 { font-size: clamp(2rem, 5vw, 4rem); }
p { color: var(--muted); line-height: 1.55; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: .8rem; margin: 0 0 .8rem; }
.small { font-size: .92rem; color: var(--muted); }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.button, button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; border: 0; border-radius: 999px; background: var(--accent); color: #08111c; padding: .75rem 1.1rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.button.secondary { background: #e7ecff; }
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: .55; cursor: progress; }
.stack { display: grid; gap: 1rem; }
.grid-form { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
label { display: grid; gap: .4rem; color: var(--text); font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1rem; background: #0d1118; color: var(--text); font: inherit; }
textarea { min-height: 8rem; resize: vertical; }
.checkline { display: flex; gap: .55rem; align-items: center; }
.checkline input { width: auto; }
.message { min-height: 1.5rem; font-weight: 700; }
.message.error { color: var(--danger); }
.message.ok { color: var(--ok); }
.topbar { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.layout { width: min(1300px, 100%); margin: 0 auto; padding: 1.25rem; }
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.tab { background: var(--panel-2); color: var(--text); }
.tab.active { background: var(--accent); color: #07111c; }
.panel { background: rgba(23,28,38,.92); border: 1px solid var(--line); border-radius: 20px; padding: 1rem; margin: 1rem 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--line); text-align: left; padding: .7rem; vertical-align: top; }
.table th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill { display: inline-block; padding: .25rem .55rem; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: .85rem; }
.builder-item { border: 1px solid var(--line); border-radius: 16px; padding: 1rem; margin: .8rem 0; background: rgba(255,255,255,.03); }
.nested-fieldset { border: 1px solid var(--line); border-radius: 14px; margin: 1rem 0 0; padding: 1rem; }
.nested-fieldset legend { color: var(--accent); font-weight: 900; padding: 0 .4rem; }
.hidden { display: none !important; }
.player-body { background: #000; overflow: hidden; }
.player-stage { position: fixed; inset: 0; display: grid; place-items: center; background: #000; color: white; }
.player-notice { width: min(90vw, 1600px); text-align: center; font-weight: 900; font-size: clamp(2.5rem, 8vw, 8rem); line-height: 1.05; padding: 4vw; }
.player-media { width: 100vw; height: 100vh; object-fit: contain; background: #000; }
.player-media.cover { object-fit: cover; }
.player-frame { width: 100vw; height: 100vh; border: 0; background: #fff; }
.player-status { position: fixed; right: 1rem; bottom: 1rem; z-index: 10; color: rgba(255,255,255,.72); font-size: .85rem; background: rgba(0,0,0,.42); padding: .4rem .6rem; border-radius: 999px; }
.player-error { font-size: clamp(1.2rem, 3vw, 2.5rem); color: #fff; text-align: center; padding: 2rem; }
@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .table { display: block; overflow-x: auto; }
}
.player-error-detail { color: rgba(255,255,255,.72); font-size: clamp(.95rem, 1.5vw, 1.25rem); max-width: min(90vw, 1100px); margin: 1rem auto 0; }
.player-error-detail code { color: #fff; word-break: break-all; }
.player-webshot { image-rendering: auto; }
