@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&family=Space+Grotesk:wght@500;700&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
:root {
  --mc-bg-0: #060b12;
  --mc-bg-1: #0a131f;
  --mc-bg-2: #122337;
  --mc-surface: rgba(255, 255, 255, 0.04);
  --mc-surface-border: rgba(255, 255, 255, 0.09);
  --mc-text: #ecf4ff;
  --mc-text-muted: #9ab1c7;
  --mc-accent: #4bc0ff;
  --mc-accent-soft: #1f4f71;
  --mc-highlight: #f8bf4b;
}
body {
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(75, 192, 255, 0.18), transparent 38%),
    radial-gradient(circle at 88% 2%, rgba(248, 191, 75, 0.12), transparent 30%),
    linear-gradient(160deg, var(--mc-bg-0), var(--mc-bg-1) 52%, #050911 100%);
  color: var(--mc-text);
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input, select { font: inherit; }
h2, h3, .topbar-brand, .vod-row-title {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
}
h2 { font-size: 20px; font-weight: 700; letter-spacing: .4px; }
h3 { font-size: 15px; font-weight: 700; color: #b4c5d8; margin-bottom: 12px; }

/* ===== SCREENS ===== */
.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; }

/* ===== LOGIN ===== */
#login-screen {
  align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(75, 192, 255, 0.24), transparent 36%),
    radial-gradient(circle at 84% 12%, rgba(248, 191, 75, 0.2), transparent 28%),
    linear-gradient(135deg, #07101b 0%, #060b12 48%, #0d1626 100%);
}
.login-box {
  display: flex; flex-direction: column; gap: 10px;
  padding: 44px 40px; border-radius: 16px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07);
  width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-logo {
  font-size: 30px; font-weight: 800; text-align: center;
  background: linear-gradient(110deg, var(--mc-highlight), var(--mc-accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.login-sub { text-align: center; font-size: 13px; color: #666; margin-bottom: 8px; }
.login-label { font-size: 12px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.login-box input {
  padding: 12px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05); color: #e8e8ec; font-size: 15px;
  transition: border-color .2s;
}
.login-box input:focus { outline: none; border-color: #5b8cff; box-shadow: 0 0 0 3px rgba(91,140,255,.15); }
.login-box button {
  padding: 13px; border-radius: 8px; font-size: 15px; font-weight: 600;
  background: linear-gradient(135deg, #5b8cff, #7b6cf6); color: #fff;
  transition: opacity .15s; margin-top: 8px;
}
.login-box button:hover { opacity: .9; }
.login-error { color: #ff6b6b; font-size: 13px; text-align: center; min-height: 18px; }

/* ===== TOP BAR ===== */
.topbar {
  display: flex; align-items: center; height: 52px; padding: 0 20px;
  background: rgba(5, 12, 21, .92); border-bottom: 1px solid rgba(124, 177, 219, .22);
  flex-shrink: 0; z-index: 50; backdrop-filter: blur(16px);
}
.topbar-brand {
  font-size: 18px; font-weight: 800; margin-right: 28px; cursor: pointer;
  background: linear-gradient(115deg, var(--mc-highlight), var(--mc-accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar-nav { display: flex; gap: 2px; }
.nav-btn {
  padding: 6px 16px; border-radius: 6px; font-size: 13px; font-weight: 500;
  color: #8da3ba; transition: all .15s;
}
.nav-btn:hover { color: #e6f2ff; background: rgba(75, 192, 255, .13); }
.nav-btn.active {
  color: #ffffff;
  background: linear-gradient(120deg, rgba(75, 192, 255, .28), rgba(248, 191, 75, .24));
  border: 1px solid rgba(123, 177, 219, .28);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.search-input {
  padding: 6px 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,.08);
  background: rgba(8, 20, 33, .82); color: #d2e4f8; font-size: 13px; width: 180px;
  transition: border-color .2s, width .2s;
}
.search-input:focus { outline: none; border-color: var(--mc-accent); width: 240px; }
.topbar-clock { font-size: 13px; color: #9ab1c7; font-variant-numeric: tabular-nums; }

/* ===== APP LAYOUT ===== */
#app-screen { flex-direction: column; }
.view { display: none; flex: 1; overflow-y: auto; padding: 20px 24px; }
.view.active { display: block; }
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.view-header-actions { display: flex; gap: 10px; align-items: center; }
.filter-select {
  padding: 6px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05); color: #ccc; font-size: 13px;
}
.filter-select:focus { outline: none; border-color: #5b8cff; }

/* ===== CHANNEL GRID (Live TV) ===== */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.channel-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05);
  cursor: pointer; transition: all .2s; position: relative; overflow: hidden;
}
.channel-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(135deg, rgba(91,140,255,.08), rgba(139,92,246,.06));
  transition: opacity .2s;
}
.channel-card:hover::before { opacity: 1; }
.channel-card:hover { border-color: rgba(91,140,255,.2); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.channel-card.on-air { border-color: rgba(0,200,120,.25); }

/* Favorite star */
.fav-star {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: rgba(255,255,255,.25); transition: color .2s;
  padding: 2px 4px; line-height: 1;
}
.fav-star:hover { color: rgba(255,200,50,.7); }
.fav-star.active { color: #ffc832; }

/* Pager */
.channel-pager {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 12px 0;
}
.pager-btn {
  background: rgba(91,140,255,.15); color: #a0b8ff; border: 1px solid rgba(91,140,255,.25);
  padding: 8px 18px; border-radius: 6px; cursor: pointer; font-size: 14px; transition: all .2s;
}
.pager-btn:hover { background: rgba(91,140,255,.25); color: #fff; }
.pager-info { color: #666; font-size: 13px; }

.channel-logo {
  width: 48px; height: 48px; border-radius: 8px;
  background: rgba(255,255,255,.06); object-fit: contain; flex-shrink: 0;
  position: relative; z-index: 1;
}
.channel-logo-placeholder {
  width: 48px; height: 48px; border-radius: 8px;
  background: linear-gradient(135deg, #1a1a2e, #16162a);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #5b8cff; flex-shrink: 0;
  position: relative; z-index: 1;
}
.channel-info { min-width: 0; flex: 1; position: relative; z-index: 1; }
.channel-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-group { font-size: 11px; color: #666; margin-top: 2px; }
.channel-now {
  font-size: 12px; color: #6bdfb8; margin-top: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.channel-now-progress {
  width: 100%; height: 3px; background: rgba(255,255,255,.08); border-radius: 2px; margin-top: 4px; overflow: hidden;
}
.channel-now-progress-bar {
  height: 100%; background: linear-gradient(90deg, #5b8cff, #6bdfb8); border-radius: 2px; transition: width .5s;
}
.channel-next {
  font-size: 11px; color: #555; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== EPG GUIDE ===== */
.guide-container { display: flex; flex-direction: column; height: calc(100vh - 92px); }
.guide-header {
  display: flex; align-items: center; gap: 10px; padding: 0 0 14px; flex-shrink: 0;
}
.guide-date-label { font-size: 15px; font-weight: 600; color: #ccc; min-width: 200px; text-align: center; }
.guide-nav-btn {
  width: 36px; height: 32px; border-radius: 6px; font-size: 14px;
  background: rgba(255,255,255,.05); color: #aaa; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.guide-nav-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.guide-today-btn, .guide-jump-btn { width: auto; padding: 0 12px; font-size: 12px; font-weight: 500; }
.guide-scroll-wrap { flex: 1; overflow: auto; position: relative; }
.guide-timeline {
  display: flex; height: 28px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: sticky; top: 0; z-index: 5;
  background: #08080d;
}
.guide-time-slot {
  flex-shrink: 0; width: 200px; font-size: 11px; color: #666; font-weight: 500;
  padding: 0 8px; display: flex; align-items: center;
  border-left: 1px solid rgba(255,255,255,.04);
}
.guide-time-slot.now { color: #ff5b5b; font-weight: 600; }
.guide-body { position: relative; }
.guide-row {
  display: flex; height: 56px; border-bottom: 1px solid rgba(255,255,255,.03);
  width: max-content;
}
.guide-row:hover { background: rgba(255,255,255,.015); }
.guide-channel-label {
  width: 160px; flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; font-size: 12px; font-weight: 500; color: #999;
  border-right: 1px solid rgba(255,255,255,.05);
  cursor: pointer; position: sticky; left: 0; z-index: 3;
  background: #08080d; transition: background .15s;
}
.guide-channel-label:hover { background: rgba(91,140,255,.06); color: #ccc; }
.guide-channel-logo-sm {
  width: 24px; height: 24px; border-radius: 4px; object-fit: contain;
  background: rgba(255,255,255,.05);
}
.guide-channel-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-programs { flex: none; position: relative; overflow: hidden; }
.guide-program {
  position: absolute; top: 3px; bottom: 3px; border-radius: 5px;
  padding: 3px 8px; font-size: 11px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  cursor: pointer; transition: all .15s; border: 1px solid transparent;
  --guide-program-bg: rgba(74, 98, 128, .24);
  --guide-program-border: rgba(112, 138, 170, .46);
  --guide-program-bg-current: rgba(96, 127, 164, .34);
  --guide-program-border-current: rgba(162, 193, 227, .7);
}
.guide-program.past {
  background: rgba(255,255,255,.02);
  color: #5d6477;
  border-color: rgba(255,255,255,.08);
}
.guide-program.current {
  background: var(--guide-program-bg-current);
  color: #f4f9ff;
  border-color: var(--guide-program-border-current);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.guide-program.future {
  background: var(--guide-program-bg);
  color: #c9d8ea;
  border-color: var(--guide-program-border);
}
.guide-program:hover {
  background: var(--guide-program-bg-current);
  color: #fff;
  border-color: var(--guide-program-border-current);
  z-index: 2;
}

.guide-program[data-program-type="sports"] {
  --guide-program-bg: rgba(44, 139, 87, .24);
  --guide-program-border: rgba(81, 201, 130, .46);
  --guide-program-bg-current: rgba(59, 173, 105, .34);
  --guide-program-border-current: rgba(136, 232, 168, .72);
}
.guide-program[data-program-type="movie"] {
  --guide-program-bg: rgba(123, 82, 209, .24);
  --guide-program-border: rgba(164, 122, 247, .48);
  --guide-program-bg-current: rgba(142, 101, 227, .34);
  --guide-program-border-current: rgba(201, 174, 255, .72);
}
.guide-program[data-program-type="news"] {
  --guide-program-bg: rgba(182, 73, 91, .24);
  --guide-program-border: rgba(224, 112, 130, .48);
  --guide-program-bg-current: rgba(203, 88, 108, .35);
  --guide-program-border-current: rgba(247, 162, 176, .72);
}
.guide-program[data-program-type="kids"] {
  --guide-program-bg: rgba(196, 131, 51, .25);
  --guide-program-border: rgba(230, 168, 91, .5);
  --guide-program-bg-current: rgba(216, 147, 63, .36);
  --guide-program-border-current: rgba(246, 205, 145, .74);
}
.guide-program[data-program-type="documentary"] {
  --guide-program-bg: rgba(46, 139, 146, .24);
  --guide-program-border: rgba(95, 197, 205, .47);
  --guide-program-bg-current: rgba(59, 162, 170, .35);
  --guide-program-border-current: rgba(144, 224, 230, .72);
}
.guide-program[data-program-type="music"] {
  --guide-program-bg: rgba(165, 83, 199, .24);
  --guide-program-border: rgba(204, 122, 238, .48);
  --guide-program-bg-current: rgba(184, 96, 216, .34);
  --guide-program-border-current: rgba(227, 166, 248, .72);
}
.guide-program[data-program-type="comedy"] {
  --guide-program-bg: rgba(142, 166, 58, .24);
  --guide-program-border: rgba(179, 205, 94, .48);
  --guide-program-bg-current: rgba(159, 183, 70, .35);
  --guide-program-border-current: rgba(211, 231, 147, .72);
}
.guide-program[data-program-type="crime"] {
  --guide-program-bg: rgba(150, 65, 86, .24);
  --guide-program-border: rgba(194, 105, 130, .48);
  --guide-program-bg-current: rgba(170, 77, 100, .35);
  --guide-program-border-current: rgba(226, 149, 170, .72);
}
.guide-program[data-program-type="anime"] {
  --guide-program-bg: rgba(185, 90, 176, .24);
  --guide-program-border: rgba(222, 124, 212, .48);
  --guide-program-bg-current: rgba(203, 103, 194, .35);
  --guide-program-border-current: rgba(239, 168, 232, .72);
}
.guide-program[data-program-type="series"] {
  --guide-program-bg: rgba(62, 115, 174, .24);
  --guide-program-border: rgba(106, 157, 213, .48);
  --guide-program-bg-current: rgba(76, 131, 193, .35);
  --guide-program-border-current: rgba(156, 198, 241, .72);
}
.guide-program[data-program-type="lifestyle"] {
  --guide-program-bg: rgba(159, 114, 54, .24);
  --guide-program-border: rgba(206, 153, 89, .49);
  --guide-program-bg-current: rgba(180, 131, 66, .35);
  --guide-program-border-current: rgba(236, 194, 141, .74);
}
.guide-program[data-program-type="other"] {
  --guide-program-bg: rgba(74, 98, 128, .24);
  --guide-program-border: rgba(112, 138, 170, .46);
  --guide-program-bg-current: rgba(96, 127, 164, .34);
  --guide-program-border-current: rgba(162, 193, 227, .7);
}
.guide-program-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-program-time { font-size: 10px; color: rgba(226, 236, 247, .78); margin-top: 1px; }
.guide-program.past .guide-program-time { color: #707788; }
.guide-now-line {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #ff5b5b;
  z-index: 4; pointer-events: none; box-shadow: 0 0 8px rgba(255,91,91,.4);
}

/* ===== MEDIA GRID (Movies / Music) ===== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* ===== LOCAL MEDIA EXPERIENCE ===== */
.local-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(120, 173, 220, 0.24);
  border-radius: 12px;
  background: linear-gradient(115deg, rgba(8, 20, 33, 0.86), rgba(15, 34, 52, 0.62));
}
.local-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.local-search-input {
  min-width: 260px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(120, 173, 220, 0.28);
  background: rgba(7, 18, 30, 0.9);
  color: #d5e8fb;
}
.local-search-input:focus {
  outline: none;
  border-color: var(--mc-accent);
  box-shadow: 0 0 0 3px rgba(75, 192, 255, 0.16);
}
.local-sort-select {
  min-width: 190px;
}
.local-stats {
  color: var(--mc-text-muted);
  font-size: 12px;
  letter-spacing: .3px;
}

.local-hero {
  position: relative;
  min-height: 240px;
  margin-bottom: 18px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(120, 173, 220, 0.25);
  background: linear-gradient(150deg, rgba(8, 20, 33, 0.94), rgba(9, 28, 46, 0.88));
}
.local-hero.empty .local-hero-actions {
  opacity: .55;
}
.local-hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 25%;
  filter: saturate(1.15);
}
.local-hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, rgba(6, 12, 20, 0.94) 5%, rgba(8, 21, 35, 0.72) 54%, rgba(8, 16, 29, 0.88) 100%);
}
.local-hero-content {
  position: relative;
  z-index: 2;
  max-width: 64%;
  padding: 24px;
}
.local-hero-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: #86b8db;
  margin-bottom: 8px;
}
.local-hero-title {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 8px;
}
.local-hero-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.local-hero-meta span {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  color: #cae2f7;
  background: rgba(74, 126, 168, 0.26);
}
.local-hero-meta .local-hero-chip-imdb {
  color: #2f2003;
  background: rgba(248, 191, 75, 0.8);
  font-weight: 700;
}
.local-hero-plot {
  color: #bdd4ea;
  line-height: 1.6;
  margin-bottom: 14px;
  max-width: 760px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.local-hero-actions {
  display: flex;
  gap: 10px;
}

.local-media-content {
  min-height: 200px;
}

.local-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 14px;
  padding-bottom: 24px;
}
.local-card {
  border-radius: 12px;
  border: 1px solid rgba(115, 169, 214, 0.22);
  background: linear-gradient(155deg, rgba(10, 24, 37, 0.96), rgba(7, 17, 27, 0.93));
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.local-card:hover,
.local-card:focus {
  transform: translateY(-3px);
  border-color: rgba(149, 197, 236, 0.42);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  outline: none;
}
.local-card-poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  background: linear-gradient(145deg, rgba(20, 44, 63, 0.9), rgba(8, 21, 34, 0.94));
}
.local-card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.local-card-poster-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}
.local-card-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(6, 13, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #f1f7ff;
}
.local-card-body {
  padding: 10px;
}
.local-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #f0f7ff;
  line-height: 1.35;
  margin-bottom: 4px;
  min-height: 35px;
}
.local-card-subtitle {
  color: #8fafcd;
  font-size: 11px;
  margin-bottom: 6px;
}
.local-card-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 24px;
}
.local-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  color: #cae3fa;
  background: rgba(80, 135, 176, 0.28);
  border: 1px solid rgba(122, 171, 210, 0.22);
}

.local-series-content {
  width: min(980px, 94vw);
  max-width: 980px;
  max-height: 88vh;
  padding: 22px;
  border: 1px solid rgba(126, 178, 218, 0.25);
  background: linear-gradient(150deg, rgba(7, 16, 28, 0.98), rgba(8, 22, 35, 0.96));
}
.local-series-header {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.local-series-poster-wrap {
  width: 180px;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(121, 175, 215, 0.22);
}
.local-series-poster,
.local-series-poster-fallback {
  width: 100%;
  height: 100%;
}
.local-series-poster {
  object-fit: cover;
}
.local-series-poster-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  background: linear-gradient(145deg, rgba(22, 44, 65, 0.9), rgba(8, 21, 34, 0.94));
}
.local-series-title {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}
.local-series-subline {
  color: #8fb0cc;
  font-size: 13px;
  margin-bottom: 8px;
}
.local-series-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.local-series-badges span {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(82, 136, 176, 0.3);
  font-size: 11px;
}
.local-series-plot {
  color: #bad0e5;
  font-size: 13px;
  line-height: 1.6;
}

.local-series-episodes {
  display: grid;
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}
.local-episode-card {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(118, 169, 208, 0.24);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(8, 19, 31, 0.92);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease;
}
.local-episode-card:hover {
  border-color: rgba(160, 207, 241, 0.48);
  transform: translateY(-1px);
}
.local-episode-code {
  color: #8ec3ec;
  font-size: 12px;
  font-weight: 700;
}
.local-episode-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.local-episode-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.local-episode-badges span {
  color: #bdd8ef;
  background: rgba(75, 120, 157, 0.28);
  border-radius: 999px;
  font-size: 10px;
  padding: 2px 7px;
}
.local-episode-plot {
  font-size: 12px;
  color: #98b6d1;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.local-episode-play {
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(120deg, rgba(79, 158, 214, 0.86), rgba(72, 111, 177, 0.86));
  color: #ecf7ff;
}

/* ===== NETFLIX-STYLE VOD ===== */

/* Hero Banner */
.vod-hero {
  position: relative; height: 340px; margin: -20px -24px 0; overflow: hidden;
  display: flex; align-items: flex-end;
}
.vod-hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center 20%;
  filter: brightness(0.5); transition: background-image 0.5s ease;
}
.vod-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, #08080d 0%, rgba(8,8,13,.6) 40%, rgba(8,8,13,.2) 100%);
}
.vod-hero-content {
  position: relative; z-index: 2; padding: 32px 40px; max-width: 600px;
}
.vod-hero-title {
  font-size: 32px; font-weight: 800; margin-bottom: 8px; line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0,0,0,.7);
}
.vod-hero-meta {
  font-size: 13px; color: #aaa; margin-bottom: 8px; display: flex; gap: 12px; align-items: center;
}
.vod-hero-meta .vod-rating {
  background: rgba(91,140,255,.2); color: #5b8cff; padding: 2px 8px; border-radius: 4px;
  font-weight: 600; font-size: 12px;
}
.vod-hero-meta .vod-imdb {
  background: rgba(245,197,24,.2); color: #f5c518; padding: 2px 8px; border-radius: 4px;
  font-weight: 700; font-size: 12px;
}
.vod-hero-plot {
  font-size: 14px; color: #bbb; line-height: 1.5; margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.vod-hero-actions { display: flex; gap: 10px; }
.vod-play-btn {
  padding: 10px 28px; border-radius: 6px; font-size: 15px; font-weight: 700;
  background: #fff; color: #111; transition: all .15s; letter-spacing: .5px;
}
.vod-play-btn:hover { background: #ddd; }
.vod-info-btn {
  padding: 10px 22px; border-radius: 6px; font-size: 14px; font-weight: 600;
  background: rgba(255,255,255,.15); color: #fff; backdrop-filter: blur(8px);
  transition: all .15s; border: 1px solid rgba(255,255,255,.2);
}
.vod-info-btn:hover { background: rgba(255,255,255,.25); }

/* Search bar */
.vod-search-bar {
  display: flex; gap: 10px; align-items: center; padding: 16px 0 8px; position: sticky; top: 0;
  z-index: 10; background: #08080d;
}
.vod-search-input {
  padding: 8px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05); color: #ccc; font-size: 14px; width: 260px;
  transition: border-color .2s, width .2s;
}
.vod-search-input:focus { outline: none; border-color: #5b8cff; width: 320px; }

/* Category Rows */
.vod-rows { padding-bottom: 40px; }
.vod-row { margin-bottom: 28px; }
.vod-row-title {
  font-size: 17px; font-weight: 700; color: #e8e8ec; margin-bottom: 10px;
  padding-left: 4px;
}
.vod-row-scroll {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 12px;
  scroll-behavior: smooth; scrollbar-width: none;
}
.vod-row-scroll::-webkit-scrollbar { display: none; }

/* VOD Card */
.vod-card {
  flex-shrink: 0; width: 150px; cursor: pointer; position: relative;
  border-radius: 8px; overflow: hidden; transition: transform .2s, box-shadow .2s;
  background: #111118;
}
.vod-card:hover { transform: scale(1.08); box-shadow: 0 8px 30px rgba(0,0,0,.6); z-index: 5; }
.vod-card-poster {
  width: 150px; height: 225px; object-fit: cover; display: block;
  background: linear-gradient(135deg, #1a1a2e, #16162a);
}
.vod-card-placeholder {
  width: 150px; height: 225px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16162a); font-size: 36px;
}
.vod-card-info {
  padding: 8px; position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.9));
}
.vod-card-title {
  font-size: 12px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vod-card-year { font-size: 10px; color: #888; }
.vod-card-rating {
  position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.7);
  color: #f5c518; font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 4px; backdrop-filter: blur(4px);
}

/* Search results grid */
.vod-search-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
  padding-bottom: 40px;
}

/* VOD Detail Modal */
.vod-detail-content {
  max-width: 640px; display: flex; gap: 24px; padding: 32px;
}
.vod-detail-poster-wrap { flex-shrink: 0; }
.vod-detail-poster {
  width: 180px; height: 270px; border-radius: 8px; object-fit: cover;
  background: #1a1a2e;
}
.vod-detail-info { flex: 1; min-width: 0; }
.vod-detail-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.vod-detail-meta {
  font-size: 13px; color: #aaa; margin-bottom: 12px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.vod-detail-plot { font-size: 14px; color: #bbb; line-height: 1.6; margin-bottom: 12px; }
.vod-detail-cast { font-size: 12px; color: #666; line-height: 1.6; margin-bottom: 16px; }
.media-card {
  padding: 18px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05);
  cursor: pointer; transition: all .2s; position: relative; overflow: hidden;
}
.media-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(135deg, rgba(91,140,255,.06), rgba(139,92,246,.04));
  transition: opacity .2s;
}
.media-card:hover::before { opacity: 1; }
.media-card:hover { border-color: rgba(91,140,255,.2); transform: translateY(-1px); }
.media-card-icon { font-size: 28px; margin-bottom: 10px; position: relative; z-index: 1; }
.media-card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; position: relative; z-index: 1; }
.media-card-meta { font-size: 12px; color: #666; position: relative; z-index: 1; }
.media-empty { color: #555; font-size: 14px; grid-column: 1 / -1; text-align: center; padding: 40px; }

/* ===== SETTINGS ===== */
.settings-panel { max-width: 600px; }
.settings-section {
  padding: 20px; border-radius: 10px; margin-bottom: 14px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05);
}
.settings-copy {
  font-size: 13px;
  line-height: 1.7;
  color: #b8b8c7;
  margin-bottom: 14px;
}
.settings-flow {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.settings-flow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #cfd0dd;
}
.settings-flow-step span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(91,140,255,.9), rgba(107,223,184,.9));
}
.settings-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #8f90a4;
}
.settings-textarea {
  width: 100%;
  resize: vertical;
  min-height: 132px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(7,9,15,.82);
  color: #f2f2f7;
  font-size: 13px;
  line-height: 1.6;
  font-family: "Consolas", "SFMono-Regular", monospace;
}
.settings-textarea:focus {
  outline: none;
  border-color: rgba(91,140,255,.42);
  box-shadow: 0 0 0 3px rgba(91,140,255,.12);
}
.settings-inline-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #80839a;
}
.settings-info { font-size: 13px; color: #aaa; line-height: 1.8; }
.settings-info span { color: #6bdfb8; font-weight: 500; }
.settings-info-compact {
  margin-top: 12px;
  line-height: 1.7;
}
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.settings-btn {
  padding: 9px 18px; border-radius: 6px; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,.06); color: #ccc; border: 1px solid rgba(255,255,255,.08);
  transition: all .15s;
}
.settings-btn:hover { background: rgba(91,140,255,.12); color: #fff; border-color: rgba(91,140,255,.2); }
.settings-btn:disabled { opacity: .4; cursor: not-allowed; }
.settings-btn-primary {
  background: linear-gradient(135deg, rgba(91,140,255,.26), rgba(107,223,184,.2));
  color: #f4f8ff;
  border-color: rgba(91,140,255,.28);
}
.settings-btn-danger { color: #ff6b6b; }
.settings-btn-danger:hover { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.2); }
.settings-status { font-size: 13px; color: #6bdfb8; margin-top: 12px; min-height: 18px; }
.settings-status.error { color: #ff6b6b; }
.settings-folder-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.settings-folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
}
.settings-folder-path {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  color: #e4e5f0;
  font-size: 13px;
}
.settings-folder-meta {
  flex-shrink: 0;
  color: #83859a;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.settings-folder-empty {
  padding: 14px;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,.09);
  color: #8c8d9e;
  font-size: 12px;
  text-align: center;
}

/* ===== PLAYLIST CATEGORIES ===== */
.playlist-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.playlist-search {
  flex: 1 1 200px;
  min-width: 160px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #e4e5f0;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.playlist-search:focus {
  outline: none;
  border-color: rgba(91,140,255,.42);
  box-shadow: 0 0 0 3px rgba(91,140,255,.12);
}
.playlist-filter {
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #ccc;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
.playlist-summary-dirty { color: #ffc46b; }
.playlist-sections {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.playlist-section {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
  overflow: hidden;
}
.playlist-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  cursor: pointer;
  user-select: none;
}
.playlist-section-header:hover { background: rgba(91,140,255,.08); }
.playlist-section-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #e4e5f0;
  word-break: break-word;
}
.playlist-section-meta {
  flex-shrink: 0;
  color: #83859a;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.playlist-section-chevron { color: #83859a; font-size: 12px; }
.playlist-section-body {
  display: grid;
  gap: 2px;
  padding: 4px 10px 10px 32px;
}
.playlist-group-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
}
.playlist-group-item:hover { background: rgba(255,255,255,.05); }
.playlist-group-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #c9cad8;
  word-break: break-word;
}
.playlist-group-count {
  flex-shrink: 0;
  color: #83859a;
  font-size: 11px;
}

/* ===== ADMIN PANEL ===== */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 16px;
}
.admin-stat-card {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
}
.admin-stat-label {
  font-size: 11px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.admin-stat-value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 700;
  color: #f4f4f8;
  line-height: 1;
}
.admin-stat-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #8a8a97;
}
.admin-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.admin-panel {
  padding: 18px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
}
.admin-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.04);
  font-size: 12px;
  color: #d0d0dc;
}
.admin-pill b {
  font-size: 13px;
  color: #fff;
}
.admin-pill.ok { border-color: rgba(107,223,184,.35); background: rgba(107,223,184,.08); }
.admin-pill.fail { border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.08); }
.admin-pill.warn { border-color: rgba(255,205,86,.35); background: rgba(255,205,86,.08); }
.admin-pill.info { border-color: rgba(91,140,255,.35); background: rgba(91,140,255,.08); }
.admin-table-wrap {
  margin-top: 4px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  background: rgba(255,255,255,.02);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #11111a;
  color: #9ea0b7;
  text-align: left;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: #d8d8e3;
  vertical-align: top;
}
.admin-table tbody tr:last-child td {
  border-bottom: none;
}
.admin-table tbody tr:hover {
  background: rgba(255,255,255,.03);
}
.admin-table .admin-muted {
  color: #8c8d9e;
}
.admin-table .admin-bad {
  color: #ff8f8f;
  font-weight: 600;
}
.admin-empty {
  padding: 14px;
  font-size: 12px;
  color: #8c8d9e;
}
.nav-btn[hidden] { display: none; }
.admin-tokens-panel { margin-bottom: 18px; }
.admin-token-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.admin-token-form .search-input, .admin-token-form .search-input:focus { width: 200px; }
.admin-token-created {
  margin-top: 14px; padding: 12px 14px; border-radius: 8px; font-size: 13px; color: #d8d8e3;
  border: 1px solid rgba(107,223,184,.35); background: rgba(107,223,184,.08);
}
.admin-token-created[hidden] { display: none; }
.admin-token-created code {
  display: block; margin: 8px 0; padding: 8px 10px; border-radius: 6px; user-select: all; word-break: break-all;
  background: rgba(7,9,15,.82); font-family: "Consolas", "SFMono-Regular", monospace; font-size: 13px; color: #fff;
}
.admin-token-created .settings-actions { margin-top: 6px; }

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.modal-content {
  position: relative; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;
  background: #14141f; border: 1px solid rgba(255,255,255,.08); border-radius: 14px;
  padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border-radius: 50%; background: rgba(255,255,255,.06); display: flex; align-items: center;
  justify-content: center; font-size: 16px; color: #888; transition: all .15s;
}
.modal-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.modal-time { font-size: 13px; color: #5b8cff; margin-bottom: 10px; }
.modal-channel { font-size: 13px; color: #888; margin-bottom: 12px; }
.modal-desc { font-size: 14px; color: #aaa; line-height: 1.6; }
.modal-actions { margin-top: 18px; display: flex; gap: 10px; }
.modal-play-btn {
  padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, #5b8cff, #7b6cf6); color: #fff;
  transition: opacity .15s;
}
.modal-play-btn:hover { opacity: .85; }

/* ===== PLAYER OVERLAY ===== */
.player-overlay {
  position: fixed; inset: 0; z-index: 100; background: #000;
  display: flex; flex-direction: column;
}
.player-overlay.hidden { display: none; }
#video-player { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.player-chrome {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.player-overlay.show-chrome .player-chrome { opacity: 1; pointer-events: auto; }
.player-top-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(rgba(0,0,0,.8), transparent);
}
.player-channel-badge {
  width: 48px; height: 48px; border-radius: 8px; flex-shrink: 0;
  background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #5b8cff; overflow: hidden;
}
.player-channel-badge img { width: 100%; height: 100%; object-fit: contain; }
.player-info { flex: 1; }
.player-channel-name { font-size: 22px; font-weight: 700; }
.player-program-name { font-size: 14px; color: #aaa; margin-top: 2px; }
.player-program-time { font-size: 12px; color: #666; margin-top: 2px; }
.player-clock { font-size: 18px; color: #888; font-variant-numeric: tabular-nums; }
.player-progress-wrap {
  margin: 0 24px; height: 4px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden;
  display: none;
}
.player-progress-bar { height: 100%; background: linear-gradient(90deg, #5b8cff, #6bdfb8); border-radius: 2px; transition: width 1s linear; }
.player-bottom-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
}
.player-controls-left, .player-controls-center, .player-controls-right { display: flex; gap: 8px; }
.player-btn {
  width: 40px; height: 40px; border-radius: 50%; font-size: 16px;
  background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center;
  transition: background .15s; backdrop-filter: blur(8px);
}
.player-btn:hover { background: rgba(255,255,255,.2); }
.player-btn-wide { width: auto; padding: 0 18px; border-radius: 8px; font-size: 13px; font-weight: 500; }

/* Channel strip inside player */
.player-channel-strip {
  position: absolute; bottom: 80px; left: 24px; right: 24px; z-index: 3;
  background: rgba(10,10,15,.92); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 12px; max-height: 280px; overflow-y: auto;
  backdrop-filter: blur(12px);
}
.player-channel-strip.hidden { display: none; }
.strip-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  transition: background .15s;
}
.strip-item:hover { background: rgba(255,255,255,.06); }
.strip-item.active { background: rgba(91,140,255,.15); }
.strip-item-name { font-size: 13px; font-weight: 500; flex: 1; }
.strip-item-now { font-size: 11px; color: #6bdfb8; }

/* ===== TIMESHIFT CONTROLS ===== */
.player-live-badge {
  padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 700;
  background: #ff3b3b; color: #fff; letter-spacing: .5px; margin-left: 8px;
  transition: opacity .3s;
}
.player-live-badge.behind { background: #555; opacity: .6; }

.player-timeshift-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 24px; padding: 4px 0;
}
.ts-seekbar {
  flex: 1; height: 6px; -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,.12); border-radius: 3px; outline: none;
  cursor: pointer;
}
.ts-seekbar::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #5b8cff; border: 2px solid #fff; cursor: pointer;
  box-shadow: 0 0 6px rgba(91,140,255,.5);
}
.ts-seekbar::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #5b8cff; border: 2px solid #fff; cursor: pointer;
}
.ts-time { font-size: 11px; color: #888; font-variant-numeric: tabular-nums; min-width: 40px; }
#ts-time-behind { text-align: right; }
#ts-time-total { text-align: left; }

.player-btn-play { font-size: 18px; width: 48px; height: 48px; background: rgba(91,140,255,.2); }
.player-btn-play:hover { background: rgba(91,140,255,.35); }

.player-btn-record { font-size: 20px; color: #ff3b3b; }
.player-btn-record.recording { animation: pulse-rec 1s ease-in-out infinite; }
@keyframes pulse-rec { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.ts-golive { font-size: 11px; font-weight: 700; letter-spacing: .5px; background: rgba(255,59,59,.15); color: #ff5b5b; }
.ts-golive:hover { background: rgba(255,59,59,.3); }
.ts-golive.at-live { background: rgba(91,140,255,.1); color: #5b8cff; }

/* ===== RECORDING MODAL ===== */
.record-modal-content { max-width: 440px; }
.record-channel-info { font-size: 14px; color: #aaa; margin-bottom: 16px; }
.record-backtime-section { margin-bottom: 16px; }
.record-backtime-label { font-size: 14px; font-weight: 600; color: #ccc; margin-bottom: 6px; }
.record-backtime-hint { font-size: 12px; color: #6bdfb8; margin-bottom: 10px; }
.record-backtime-options { display: flex; flex-wrap: wrap; gap: 6px; }
.backtime-btn {
  padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,.06); color: #aaa; border: 1px solid rgba(255,255,255,.08);
  cursor: pointer; transition: all .15s;
}
.backtime-btn:hover { background: rgba(91,140,255,.12); color: #fff; border-color: rgba(91,140,255,.2); }
.backtime-btn.active { background: rgba(91,140,255,.2); color: #fff; border-color: rgba(91,140,255,.4); }
.backtime-btn:disabled { opacity: .35; cursor: not-allowed; }
.record-start-btn { background: linear-gradient(135deg, #ff3b3b, #ff6b3b) !important; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.15); }

/* ===== LOADING SPINNER ===== */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.15); border-top-color: #5b8cff; border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
  .channel-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; }
  .topbar-brand { font-size: 15px; margin-right: 12px; }
  .nav-btn { padding: 5px 10px; font-size: 12px; }
  .search-input { width: 120px; }
  .guide-channel-label { width: 100px; font-size: 10px; }
  .view { padding: 14px 16px; }
  .admin-panels { grid-template-columns: 1fr; }
  .local-toolbar { flex-direction: column; align-items: stretch; }
  .local-toolbar-left { width: 100%; }
  .local-search-input, .local-sort-select { width: 100%; min-width: 0; }
  .local-hero-content { max-width: 100%; padding: 16px; }
  .local-hero-title { font-size: 24px; }
  .local-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
  .local-series-content { width: 95vw; padding: 16px; }
  .local-series-header { grid-template-columns: 1fr; }
  .local-series-poster-wrap { width: 140px; }
  .local-episode-card { grid-template-columns: 1fr; gap: 8px; }
  .local-episode-play { width: 100%; }
}

/* ===== Security: AI face / people database ===== */
.faces-filter { font-size: 13px; color: #ccc; display: flex; align-items: center; gap: 6px; margin-right: 10px; }
.faces-people-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 8px;
}
.face-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; overflow: hidden; display: flex; flex-direction: column;
}
.face-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #0d1117; display: block; }
.face-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  color: #667; font-size: 12px; letter-spacing: .5px;
}
.face-card-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.face-name-input {
  width: 100%; padding: 7px 9px; border-radius: 6px; font-size: 13px;
  background: rgba(0,0,0,.35); color: #e6f2ff; border: 1px solid rgba(75,192,255,.25);
}
.face-name-input:focus { outline: none; border-color: #4bc0ff; }
.face-meta { font-size: 12px; color: #b8c4d0; }
.face-meta-dim { font-size: 11px; color: #7a8794; }
.face-unknown { color: #ffb347; font-weight: 600; }
.face-card-actions { display: flex; gap: 6px; margin-top: 2px; }
.face-btn {
  flex: 1; padding: 6px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid rgba(255,255,255,.1); background: rgba(75,192,255,.16); color: #cfeeff;
}
.face-btn:hover { background: rgba(75,192,255,.28); }
.face-delete { background: rgba(255,90,90,.14); color: #ffb3b3; }
.face-delete:hover { background: rgba(255,90,90,.28); }
.faces-sightings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px;
}
.sighting-card {
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px; overflow: hidden;
}
.sighting-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.sighting-meta { padding: 6px 8px; }
.sighting-who { font-size: 12px; font-weight: 600; color: #e6f2ff; }
.sighting-hive { font-size: 11px; color: #cbe8ff; margin-top: 3px; line-height: 1.3; }
.fam-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  padding: 1px 6px; border-radius: 999px; vertical-align: middle; text-transform: uppercase;
}
.fam-common { background: rgba(80,200,120,.18); color: #7ee2a0; }
.fam-stranger { background: rgba(255,179,71,.18); color: #ffb347; }
.fam-unwanted { background: rgba(255,90,90,.22); color: #ff9a9a; }
.face-card-unwanted { border-color: rgba(255,90,90,.6); box-shadow: 0 0 0 1px rgba(255,90,90,.35); }
.face-unwanted-btn.is-unwanted { background: rgba(255,90,90,.22); color: #ffb3b3; }
.faces-alerts-list { display: flex; flex-direction: column; gap: 8px; }
.alert-card {
  display: flex; gap: 10px; align-items: stretch; background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.06); border-left: 3px solid #ffb347;
  border-radius: 8px; overflow: hidden;
}
.alert-card.alert-critical { border-left-color: #ff3d3d; }
.alert-thumb, .alert-thumb.face-thumb-empty { width: 92px; min-width: 92px; height: 92px; object-fit: cover; aspect-ratio: auto; }
.alert-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; justify-content: center; }

