:root {
  color-scheme: dark;
  --bg: #0f131a;
  --panel: #181d25;
  --panel2: #202630;
  --border: #2c3441;
  --text: #f3f5f8;
  --muted: #9ca8ba;
  --accent: #8ba8ff;
  --accent2: #6e8ee8;
  --danger: #ff8585;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
button, input { font: inherit; }
.hidden { display: none !important; }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.login-card { width: min(420px, 100%); padding: 28px; display: grid; gap: 14px; }
.login-card h1 { margin: 2px 0 0; }
.login-card label { color: var(--muted); font-size: 14px; }
.login-card input, .search { background: #121720; border: 1px solid #394454; color: var(--text); border-radius: 10px; padding: 12px 14px; outline: none; }
.login-card input:focus, .search:focus { border-color: var(--accent); }
.brand { font-weight: 800; font-size: 22px; letter-spacing: .1px; }
.subtitle, .muted { color: var(--muted); }
.error { min-height: 20px; margin: 0; color: var(--danger); }
button { border: 1px solid #3a4555; color: var(--text); background: #252d39; border-radius: 10px; padding: 10px 14px; cursor: pointer; }
button:hover { background: #303a49; }
button.primary { background: var(--accent2); border-color: var(--accent2); font-weight: 700; }
button.ghost { background: transparent; }
.app { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px max(18px, calc((100vw - 1200px)/2)); background: rgba(15,19,26,.94); backdrop-filter: blur(14px); border-bottom: 1px solid #222936; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { background: #1b2330; border: 1px solid #303a49; color: var(--muted); padding: 8px 10px; border-radius: 999px; font-size: 13px; }
.container { width: min(1200px, calc(100% - 32px)); margin: 22px auto 60px; display: grid; gap: 28px; }
.player-panel { padding: 16px; }
.player-head, .player-foot, .section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.player-head h2, .section-head h2 { margin: 0 0 4px; }
.video-shell { margin-top: 14px; background: #000; border-radius: 12px; overflow: hidden; display: grid; place-items: center; max-height: 72vh; }
video { width: 100%; max-height: 72vh; background: #000; }
.player-foot { margin-top: 10px; font-size: 13px; }
.section-head { margin-bottom: 12px; }
.section-head p { margin: 4px 0 0; }
.search { width: min(320px, 46vw); }
.grid { display: grid; gap: 10px; }
.card { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; min-height: 94px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
.card:hover { border-color: #3b4758; background: #1b212b; }
.card-title { font-weight: 700; overflow-wrap: anywhere; }
.card-meta { margin-top: 6px; color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.progress-line { height: 4px; background: #2b3441; border-radius: 10px; overflow: hidden; margin-top: 10px; }
.progress-line > span { display: block; height: 100%; background: var(--accent); width: 0; }
.empty { padding: 20px; color: var(--muted); border: 1px dashed #313a48; border-radius: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #252d39; border: 1px solid #3c4858; border-radius: 10px; padding: 10px 14px; z-index: 100; box-shadow: 0 12px 40px #0008; }
@media (max-width: 720px) {
  .topbar { align-items: flex-start; padding: 12px 14px; }
  .brand { font-size: 19px; }
  .top-actions .pill { display: none; }
  .top-actions button { padding: 8px 10px; font-size: 13px; }
  .container { width: min(100% - 20px, 1200px); margin-top: 12px; gap: 22px; }
  .section-head { align-items: flex-end; }
  .search { width: 44vw; min-width: 130px; }
  .card { grid-template-columns: 1fr; gap: 10px; }
  .card-actions { justify-content: flex-end; }
  .video-shell, video { max-height: 70vh; }
}
