:root {
  --bg: #0b0f17;
  --surface: #141b29;
  --surface-2: #1c2638;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #2f6fd6;
  --accent-2: #5995ed;
  --border: #243047;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: #f87171; font-size: 13px; margin: 4px 0 8px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background-size: cover; background-position: center; }
.login-card { width: 100%; max-width: 380px; background: rgba(20, 27, 41, 0.94); border: 1px solid var(--border); border-radius: 14px; padding: 28px; text-align: center; }
.login-logo { height: 48px; width: auto; margin-bottom: 12px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; text-align: left; margin-top: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.btn-primary { background: var(--accent); color: #fff; border: 0; padding: 11px 16px; border-radius: 8px; font: 600 14px inherit; cursor: pointer; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); padding: 7px 12px; border-radius: 8px; font: inherit; cursor: pointer; }
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.p-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.p-bar-left, .p-bar-right { display: flex; align-items: center; gap: 14px; }
.bar-logo { height: 28px; width: auto; }
.p-nav { display: flex; gap: 6px; }
.p-nav button { background: transparent; color: var(--muted); border: 0; padding: 7px 12px; border-radius: 8px; font: 600 14px inherit; cursor: pointer; }
.p-nav button.active { background: var(--accent); color: #fff; }
.banner-slot { padding: 10px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.banner-slot img { max-height: 110px; width: 100%; object-fit: cover; border-radius: 8px; }
.live-layout { display: grid; grid-template-columns: 320px 1fr; flex: 1; min-height: 0; }
.ch-sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; max-height: calc(100vh - 56px); }
.cat-bar { display: flex; gap: 6px; padding: 10px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.cat-bar button { white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 0; padding: 5px 10px; border-radius: 999px; font-size: 12px; cursor: pointer; }
.cat-bar button.active { background: var(--accent); color: #fff; }
.ch-list { overflow-y: auto; flex: 1; }
.ch-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.ch-row:hover, .ch-row.active { background: var(--surface-2); }
.ch-row img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: #000; }
.stage { display: flex; flex-direction: column; background: #000; }
.stage video { width: 100%; flex: 1; max-height: 76vh; background: #000; }
.now-playing { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--surface); border-top: 1px solid var(--border); }
.now-playing h2 { margin: 0 0 4px; font-size: 18px; }
.panel-view { padding: 20px; }
.guide-grid { display: flex; flex-direction: column; gap: 10px; }
.guide-row { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.media-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; }
.media-card img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; background: #000; }
@media (max-width: 820px) { .live-layout { grid-template-columns: 1fr; } .ch-sidebar { max-height: 40vh; order: 2; } }
