/* ============================================================
   WAKASTREAM PLAYER — Global Styles
   Brand: #39FF14 neon green / #0a0a0a bg / #1a1a1a cards
   ============================================================ */

:root {
  --bg:            #0a0a0a;
  --bg-card:       #111111;
  --bg-hover:      #1a1a1a;
  --bg-muted:      #111111;
  --bg-input:      #141414;
  --card:          #111111;
  --accent:        #39FF14;
  --accent-dim:    rgba(57, 255, 20, 0.12);
  --accent-glow:   rgba(57, 255, 20, 0.35);
  --text:          #ffffff;
  --text-muted:    #aaaaaa;
  --border:        #222222;
  --border-accent: rgba(57, 255, 20, 0.2);
  --border-ui:     #222222;
  --danger:        #ff4444;
  --warning:       #f59e0b;
  --radius:        12px;
  --sidebar-w:     280px;
  --topbar-h:      52px;
  --transition:    0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* prevent body scroll — each pane scrolls independently */
}

#app { height: 100%; }

/* ============================================================
   SHARED UTILITIES
   ============================================================ */

.hidden { display: none !important; }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */

.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
  overflow-y: auto;
}

/* --- Subscription banners --- */
.sub-banner {
  width: 100%; max-width: 420px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
  animation: fadeDown 0.4s ease;
}
.sub-banner a {
  color: inherit; font-weight: 700;
  margin-left: auto; white-space: nowrap;
  text-decoration: underline; opacity: 0.9;
}
.sub-banner a:hover { opacity: 1; }
.sub-banner--warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35); color: #fbbf24; }
.sub-banner--expired { background: rgba(255,68,68,0.12);  border: 1px solid rgba(255,68,68,0.35);  color: #f87171; }

/* --- Card --- */
.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px 36px;
  box-shadow: 0 0 40px rgba(57,255,20,0.06), 0 8px 32px rgba(0,0,0,0.6);
}

/* --- Logo --- */
.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo-text {
  font-size: 28px; font-weight: 800; letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(57,255,20,0.5), 0 0 40px rgba(57,255,20,0.2);
  display: inline-block;
}
.login-subtitle { text-align: center; color: var(--text-muted); font-size: 13.5px; margin-bottom: 32px; }

/* --- Form fields --- */
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-field  { display: flex; flex-direction: column; gap: 6px; }
.form-label  { font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-input-wrap { position: relative; }
.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius);
  color: var(--text); font-size: 15px;
  padding: 12px 14px; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-input::placeholder { color: #555; }
.form-input:focus { border-color: rgba(57,255,20,0.5); box-shadow: 0 0 0 3px rgba(57,255,20,0.08); }
.form-input--password { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition); line-height: 0;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle svg  { width: 18px; height: 18px; }

/* --- Error message --- */
.login-error {
  background: rgba(255,68,68,0.1); border: 1px solid rgba(255,68,68,0.3);
  border-radius: var(--radius); color: #f87171; font-size: 13px;
  padding: 11px 14px; display: none; align-items: flex-start; gap: 8px;
  animation: fadeIn 0.25s ease;
}
.login-error.visible { display: flex; }
.login-error svg     { flex-shrink: 0; margin-top: 1px; }

/* --- Submit button --- */
.login-btn {
  width: 100%; background: var(--accent); color: #000;
  font-size: 15px; font-weight: 700; border: none;
  border-radius: var(--radius); padding: 14px;
  cursor: pointer; letter-spacing: 0.5px;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 4px; min-height: 48px;
}
.login-btn:hover:not(:disabled) { background: #4dff2a; box-shadow: 0 0 20px rgba(57,255,20,0.4); }
.login-btn:active:not(:disabled) { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(0,0,0,0.3); border-top-color: #000;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  display: none; flex-shrink: 0;
}
.login-btn.loading .spinner  { display: block; }
.login-btn.loading .btn-text { opacity: 0.7; }
.login-btn.success { background: var(--accent); box-shadow: 0 0 30px rgba(57,255,20,0.5); pointer-events: none; }
.login-btn.success .btn-text { display: none; }
.login-btn.success .btn-check { display: block; }
.btn-check { display: none; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  15%     { transform: translateX(-8px); }
  30%     { transform: translateX(8px); }
  45%     { transform: translateX(-6px); }
  60%     { transform: translateX(6px); }
  75%     { transform: translateX(-3px); }
  90%     { transform: translateX(3px); }
}
.login-card.shake { animation: shake 0.5s ease; }

/* ============================================================
   CHANNELS SCREEN
   ============================================================ */

.channels-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ── Top bar ──────────────────────────────────────────────── */
.ch-topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-ui);
  z-index: 100;
}

.ch-topbar-logo {
  font-size: 16px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(57,255,20,0.35);
  white-space: nowrap;
}
.ch-topbar-title {
  font-size: 15px; font-weight: 600;
  color: var(--text); white-space: nowrap;
}

.ch-topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
}

.ch-user-label {
  font-size: 12.5px; color: var(--text-muted);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ch-logout-btn {
  background: transparent; border: 1.5px solid #ff4444;
  color: #ff4444; font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}
.ch-logout-btn:hover { background: rgba(255,68,68,0.08); }

/* Hamburger — visible on mobile only */
.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  padding: 6px; display: none;
  flex-direction: column; gap: 4px; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

/* ── Body ─────────────────────────────────────────────────── */
.ch-body { display: flex; flex: 1; overflow: hidden; position: relative; }

/* ── Sidebar ──────────────────────────────────────────────── */
.ch-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg-muted);
  border-right: 1px solid var(--border-ui);
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-ui);
  flex-shrink: 0;
}
.sidebar-brand {
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--text); display: flex; align-items: center; gap: 7px;
}
.sidebar-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); display: none; padding: 4px;
  line-height: 0; transition: color var(--transition);
}
.sidebar-close:hover { color: var(--text); }
.sidebar-close svg   { width: 18px; height: 18px; }

.sidebar-search-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-ui);
  flex-shrink: 0;
}
.sidebar-search {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-ui);
  border-radius: 8px;
  color: var(--text); font-size: 13px;
  padding: 8px 12px 8px 32px;
  outline: none;
  transition: border-color var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 24 24' stroke='%23666' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}
.sidebar-search::placeholder { color: #555; }
.sidebar-search:focus { border-color: rgba(57,255,20,0.4); }

.cat-list { list-style: none; overflow-y: auto; flex: 1; padding: 6px 0; }

.cat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px 9px 13px;
  border-left: 3px solid transparent;
  cursor: pointer; font-size: 13.5px; color: var(--text-muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap; overflow: hidden;
  user-select: none;
  outline: none;
}
.cat-item:hover         { background: rgba(255,255,255,0.04); color: var(--text); }
.cat-item.active        { background: var(--accent-dim); color: var(--accent); font-weight: 600; border-left-color: var(--accent); }
.cat-item:focus-visible { background: rgba(255,255,255,0.06); color: var(--text); box-shadow: inset 0 0 0 1px rgba(57,255,20,0.4); }

.cat-label { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.cat-count { margin-left: auto; font-size: 11px; color: #444; flex-shrink: 0; }
.cat-item.active .cat-count { color: rgba(57,255,20,0.45); }

.cat-divider { height: 1px; background: var(--border-ui); margin: 6px 12px; }

/* Mobile overlay */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 200;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ── Main content ─────────────────────────────────────────── */
.ch-main {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column;
}

/* Results count */
.ch-results-label {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 12px; flex-shrink: 0;
}

/* ── Loading progress bar ─────────────────────────────────── */
.ch-load-bar {
  height: 3px; background: var(--border-ui); border-radius: 2px;
  overflow: hidden; margin-bottom: 10px; flex-shrink: 0;
}
.ch-load-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(57,255,20,0.5);
}

/* ── Channel Grid ─────────────────────────────────────────── */
.ch-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-content: start;
}

/* ── Channel Card ─────────────────────────────────────────── */
.ch-card {
  background: var(--bg-card);
  border: 1px solid var(--border-ui);
  border-radius: 12px;
  padding: 16px 12px 12px;
  cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-height: 140px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  user-select: none;
}
.ch-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(57,255,20,0.1);
  transform: translateY(-2px);
}
.ch-card:active { transform: translateY(0); }
.ch-card:focus-visible {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px rgba(57,255,20,0.25);
  transform: translateY(-1px);
}

/* Search highlight */
.ch-hl { color: var(--accent); font-weight: 700; }

.ch-card-logo {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ch-card-logo img {
  width: 100%; height: 100%;
  object-fit: contain; border-radius: 6px;
}
.ch-card-initial {
  width: 64px; height: 64px;
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  border-radius: 8px; color: var(--accent);
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.ch-card-info { width: 100%; text-align: center; }
.ch-card-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.35;
}
.ch-card-prog {
  font-size: 11px; color: #555; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ch-card-fav {
  position: absolute; top: 6px; right: 6px;
  background: none; border: none; cursor: pointer;
  font-size: 15px; color: #444; padding: 4px; line-height: 1;
  transition: color var(--transition), transform var(--transition);
  z-index: 1;
}
.ch-card-fav:hover    { color: #ffd700; transform: scale(1.25); }
.ch-card-fav.fav-on   { color: #ffd700; }

/* ── Skeleton Cards ───────────────────────────────────────── */
.ch-card.skeleton {
  pointer-events: none; cursor: default;
  transform: none !important; border-color: transparent !important; box-shadow: none !important;
}

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

/* ── Generic skeleton cards (pulse variant — used outside channel list) ── */
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 0.8; } }
.skeleton-card {
  background: #111111; border-radius: 8px; padding: 12px;
}
.skeleton-logo {
  width: 40px; height: 40px; border-radius: 50%;
  background: #222; animation: pulse 1.5s infinite;
}
.skeleton-text {
  height: 12px; background: #222; border-radius: 4px;
  margin: 8px 0; animation: pulse 1.5s infinite;
}
.skeleton-text.short { width: 60%; }

.skel-logo, .skel-name, .skel-prog {
  background: linear-gradient(90deg, #1c1c1c 25%, #252525 50%, #1c1c1c 75%);
  background-size: 600px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 6px;
}
.skel-logo { width: 64px; height: 64px; }
.skel-name { height: 12px; width: 80%; margin: 0 auto; }
.skel-prog { height: 10px; width: 60%; margin: 4px auto 0; border-radius: 4px; }

/* ── List Mode (layout = 'list') ──────────────────────────── */
.ch-grid.ch-list-mode {
  grid-template-columns: 1fr;
  gap: 4px;
}
.ch-grid.ch-list-mode .ch-card {
  flex-direction: row;
  min-height: auto;
  padding: 10px 14px;
  gap: 12px;
  align-items: center;
  border-radius: 8px;
}
.ch-grid.ch-list-mode .ch-card-info {
  text-align: left;
  flex: 1;
  min-width: 0;
}
.ch-grid.ch-list-mode .ch-card-name {
  -webkit-line-clamp: 1;
  font-size: 13.5px;
}
.ch-grid.ch-list-mode .ch-card-prog {
  text-align: left;
}
.ch-grid.ch-list-mode .ch-card-logo {
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.ch-grid.ch-list-mode .ch-card-initial {
  width: 44px; height: 44px;
  font-size: 16px;
}
.ch-grid.ch-list-mode .ch-card.skeleton {
  height: 72px;
}

/* Trick 2 — optimistic selection highlight (instant feedback on tap/click) */
.ch-card--selected {
  border-color: var(--accent) !important;
  background: rgba(57, 255, 20, 0.08) !important;
  box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.25) !important;
}
.ch-grid.ch-list-mode .skel-logo {
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.ch-grid.ch-list-mode .skel-name { width: 40%; margin: 0; }
.ch-grid.ch-list-mode .skel-prog { width: 30%; margin: 4px 0 0; }

/* ── Load More ────────────────────────────────────────────── */
.load-more-wrap { text-align: center; padding: 24px 0 8px; flex-shrink: 0; }
.load-more-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--accent); padding: 10px 28px;
  border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  transition: background var(--transition), box-shadow var(--transition);
}
.load-more-btn:hover { background: var(--accent-dim); box-shadow: 0 0 14px rgba(57,255,20,0.15); }

/* ── Error State ──────────────────────────────────────────── */
.ch-error {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px;
  flex: 1; color: var(--text-muted); text-align: center; padding: 40px 20px;
}
.ch-error-icon { font-size: 40px; opacity: 0.5; }
.ch-error-msg  { font-size: 14px; max-width: 300px; line-height: 1.6; }
.ch-error-retry {
  background: var(--accent); color: #000; border: none;
  padding: 10px 26px; border-radius: 8px;
  font-weight: 700; cursor: pointer; font-size: 13.5px;
  transition: box-shadow var(--transition);
}
.ch-error-retry:hover { box-shadow: 0 0 18px rgba(57,255,20,0.4); }

/* ── Auto-retry countdown ─────────────────────────────────── */
.ch-auto-wrap {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-muted);
}
.ch-auto-cancel {
  background: none; border: 1px solid rgba(255,255,255,0.15); color: var(--text-muted);
  padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.ch-auto-cancel:hover { border-color: rgba(255,255,255,0.4); color: #fff; }

/* ── Network banner ───────────────────────────────────────── */
.app-net-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  padding: 10px 20px; text-align: center; font-size: 13px; font-weight: 600;
  display: none;
}
.app-net-banner--success { background: rgba(57,255,20,0.9);  color: #000; }
.app-net-banner--warning { background: rgba(255,160,0,0.92); color: #000; }

/* ── Playlist steps indicator ─────────────────────────────── */
.plm-steps {
  display: flex; align-items: center; gap: 0;
  padding: 14px 0 6px; margin-bottom: 4px;
}
.plm-steps.hidden { display: none; }
.plm-step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.plm-step-line { flex: 1; height: 1px; background: rgba(255,255,255,0.1); margin: 0 8px; min-width: 20px; }
.plm-step-icon {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.plm-step-icon--ok    { background: rgba(57,255,20,0.15); border-color: #39FF14; color: #39FF14; }
.plm-step-icon--error { background: rgba(255,68,68,0.15);  border-color: #f87171; color: #f87171; }
.plm-step-icon--loading { border-color: rgba(255,255,255,0.4); color: var(--text-muted); animation: spin 0.9s linear infinite; }

/* ── Empty State ──────────────────────────────────────────── */
.ch-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  color: var(--text-muted); text-align: center;
  padding: 60px 20px; font-size: 14px;
}
.ch-empty-icon { font-size: 36px; opacity: 0.4; }

/* ============================================================
   SHARED ANIMATIONS
   ============================================================ */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes fadeIn   { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeOut  { from { opacity:1; } to { opacity:0; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* TV (coarse pointer + wide screen — always show sidebar, 4-col grid) */
@media (pointer: coarse) and (min-width: 900px) {
  .sidebar-toggle  { display: none !important; }
  .sidebar-overlay { display: none !important; }
  .ch-sidebar { position: static !important; transform: none !important; transition: none !important; width: var(--sidebar-w) !important; }
  .ch-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Tablet */
@media (max-width: 1024px) {
  :root { --sidebar-w: 240px; }
  .ch-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile */
@media (max-width: 767px) {
  body { overflow: hidden; }

  /* Login */
  .login-card { padding: 32px 20px 28px; border-radius: 14px; }
  .login-logo-text { font-size: 24px; }

  /* Topbar */
  .sidebar-toggle { display: flex; }
  .ch-topbar { padding: 0 12px; gap: 10px; }
  .ch-user-label { display: none; } /* hide username on small screens */

  /* Sidebar slides in from left */
  .ch-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 300;
    width: 270px;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .ch-sidebar.open { transform: translateX(0); }
  .sidebar-close   { display: flex; }

  /* Grid */
  .ch-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ch-card { padding: 12px 10px 10px; min-height: 118px; }
  .ch-card-logo, .ch-card-initial, .skel-logo { width: 52px; height: 52px; }
  .ch-card-initial { font-size: 18px; }
  .ch-main { padding: 12px; }
}

/* Small mobile */
@media (max-width: 375px) {
  .ch-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .login-card { padding: 28px 16px 24px; }
}

/* ============================================================
   PLAYER SCREEN
   ============================================================ */

.player-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  cursor: none; /* hide cursor; shown via JS class */
}
.player-screen.cursor-visible { cursor: default; }

.player-video {
  width: 100%; height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

/* ── Buffering spinner (absolute center) ──────────────────── */
.pl-spinner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px;
  display: none;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(57,255,20,0.45));
}
.pl-spinner.on { display: block; }
.pl-spinner .pl-spinner-arc,
.pl-spinner circle:last-child {
  transform-origin: 24px 24px;
  animation: spin 0.85s linear infinite;
}

/* ── Mini info bar (always visible on TV, fades with controls elsewhere) */
.pl-mini-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex; align-items: center;
  padding: 7px 18px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 5;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
  gap: 12px;
}
.pl-mini-bar.on { opacity: 1; }
.pl-mini-ch   { font-size: 12.5px; font-weight: 700; color: #fff; white-space: nowrap; flex-shrink: 0; }
.pl-mini-prog { font-size: 12px; color: rgba(255,255,255,0.55); text-align: center; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-mini-time { font-size: 12.5px; color: rgba(255,255,255,0.7); font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }

/* ── Controls overlay ─────────────────────────────────────── */
.pl-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.22s ease;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.72) 0%,
    transparent      22%,
    transparent      72%,
    rgba(0,0,0,0.80) 100%
  );
  z-index: 20;
}
.pl-overlay.on { opacity: 1; }

/* ── Top bar ─────────────────────────────────────────────────
   3-column grid: Back | Channel name (CENTERED) | Clock+EPG   */
.pl-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-start;
  padding: 16px 20px 0;
  gap: 10px;
}

/* LEFT: back button */
.pl-top-left { display: flex; align-items: center; }

.pl-back {
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 8px 14px;
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  backdrop-filter: blur(8px);
  transition: background var(--transition), border-color var(--transition);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.pl-back:hover { background: rgba(57,255,20,0.2); border-color: rgba(57,255,20,0.5); color: #39FF14; }

/* CENTER: channel name + logo + LIVE badge */
.pl-top-center {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  justify-self: center;
}

.pl-logo {
  width: 44px; height: 44px;
  object-fit: contain; border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}
.pl-logo.hidden { display: none; }

.pl-channel-name {
  font-size: 20px; font-weight: 800; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 500px; text-align: center;
  text-shadow: 0 2px 12px rgba(0,0,0,0.9), 0 0 30px rgba(0,0,0,0.6);
  letter-spacing: 0.3px;
}

.pl-live-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #e53e3e; color: #fff;
  font-size: 10px; font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 8px; border-radius: 4px;
  box-shadow: 0 0 10px rgba(229,62,62,0.5);
  animation: pl-live-pulse 2s ease-in-out infinite;
}
.pl-live-badge::before {
  content: '';
  width: 5px; height: 5px;
  background: #fff; border-radius: 50%;
  animation: pl-live-dot 2s ease-in-out infinite;
}
@keyframes pl-live-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(229,62,62,0.5); }
  50%       { box-shadow: 0 0 16px rgba(229,62,62,0.85); }
}
@keyframes pl-live-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* RIGHT: clock + EPG */
.pl-top-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.pl-clock {
  font-size: 22px; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums; letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}
.pl-epg { text-align: right; }
.pl-prog-name {
  font-size: 13px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
.pl-prog-time {
  font-size: 11.5px; color: rgba(255,255,255,0.7);
  margin-top: 1px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.pl-next-prog {
  font-size: 11px; color: rgba(255,255,255,0.5);
  margin-top: 1px;
}

/* ── Center (play button) ────────────────────────────────── */
.pl-center {
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; flex: 1;
}

.pl-play-btn {
  width: 72px; height: 72px;
  background: rgba(0,0,0,0.55);
  border: 2px solid rgba(255,255,255,0.45);
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  pointer-events: all;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.pl-play-btn:hover { background: rgba(57,255,20,0.25); border-color: #39FF14; }
.pl-play-btn:active { transform: scale(0.92); }
.pl-play-btn.hidden { display: none; }
.pl-play-btn svg { width: 32px; height: 32px; }

/* ── Live progress bar ────────────────────────────────────── */
.pl-live-bar {
  height: 3px;
  background: rgba(255,255,255,0.1);
  margin: 0 20px 10px;
  border-radius: 2px; overflow: hidden; flex-shrink: 0;
}
.pl-live-fill {
  height: 100%; width: 100%;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(57,255,20,0.6);
}

/* ── Bottom bar ───────────────────────────────────────────── */
.pl-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 18px;
}

/* Volume */
.pl-volume { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.pl-mute-btn {
  background: none; border: none; cursor: pointer;
  color: #fff; padding: 4px; line-height: 0;
  transition: color var(--transition), opacity var(--transition);
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8));
}
.pl-mute-btn:hover { color: #39FF14; }

/* Volume track — styled slider, green fill via JS background */
.pl-vol-track { display: flex; align-items: center; }
.pl-vol-slider {
  -webkit-appearance: none; appearance: none;
  width: 90px; height: 5px;
  background: linear-gradient(to right, #39FF14 100%, rgba(255,255,255,0.15) 100%);
  border-radius: 3px; outline: none; cursor: pointer;
  transition: height 0.15s ease;
  filter: drop-shadow(0 0 4px rgba(57,255,20,0.4));
}
.pl-vol-slider:hover { height: 7px; }
.pl-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: #fff;
  border: 2px solid #39FF14;
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 6px rgba(57,255,20,0.5);
}
.pl-vol-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  background: #fff;
  border: 2px solid #39FF14;
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 6px rgba(57,255,20,0.5);
}

/* Channel nav (auto-centered by flex-grow on surrounding elements) */
.pl-ch-nav {
  display: flex; align-items: center; gap: 10px;
  flex: 1; justify-content: center;
}
.pl-nav-btn {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px; color: #fff;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.pl-nav-btn:hover { background: rgba(57,255,20,0.2); border-color: rgba(57,255,20,0.5); }
.pl-nav-btn svg   { width: 16px; height: 16px; }

.pl-nav-label {
  font-size: 13px; font-weight: 600; color: #fff;
  max-width: 160px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; text-align: center;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}

/* Right controls group */
.pl-controls-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Fullscreen button */
.pl-fs-btn {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  color: #fff; padding: 8px; line-height: 0;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.pl-fs-btn:hover { background: rgba(57,255,20,0.2); border-color: rgba(57,255,20,0.5); color: #39FF14; }
.pl-fs-btn svg   { width: 18px; height: 18px; display: block; }

/* ── Quality button — prominent colored pill ─────────────── */
.pl-quality-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(57,255,20,0.12);
  border: 1.5px solid rgba(57,255,20,0.45);
  border-radius: 20px;
  color: #39FF14;
  padding: 7px 14px;
  cursor: pointer; line-height: 1;
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  flex-shrink: 0; white-space: nowrap;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 12px rgba(57,255,20,0.2);
  text-shadow: 0 0 8px rgba(57,255,20,0.4);
}
.pl-quality-btn:hover,
.pl-quality-btn.panel-open {
  background: rgba(57,255,20,0.25);
  border-color: #39FF14;
  box-shadow: 0 0 20px rgba(57,255,20,0.4);
}
.pl-quality-label { font-size: 13px; font-weight: 800; letter-spacing: 0.5px; }

/* ── Quality panel ───────────────────────────────────────── */
.pl-quality-panel {
  position: absolute;
  right: 80px;
  bottom: 68px;
  width: 220px;
  background: rgba(10,10,18,0.96);
  border: 1px solid rgba(57,255,20,0.25);
  border-radius: 10px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(57,255,20,0.08);
  z-index: 60;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  overflow: hidden;
}
.pl-quality-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.pl-quality-header {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.pl-quality-list { padding: 6px 0 6px; }
.pl-quality-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.12s ease;
  border-left: 2px solid transparent;
}
.pl-quality-item:hover { background: rgba(255,255,255,0.06); }
.pl-quality-item.active {
  background: rgba(57,255,20,0.08);
  border-left-color: #39FF14;
}
.pl-quality-item.active .pl-qi-label { color: #39FF14; }
.pl-quality-item--single { cursor: default; opacity: 0.6; }
.pl-qi-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: #fff;
}
.pl-qi-desc { font-size: 11px; color: rgba(255,255,255,0.4); }
.pl-qi-badge {
  font-style: normal; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px; letter-spacing: 0.5px;
}
.pl-qi-badge--hd  { background: rgba(57,255,20,0.2); color: #39FF14; }
.pl-qi-badge--sd  { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); }
.pl-qi-badge--low { background: rgba(255,100,50,0.2); color: #ff8050; }

/* ── Error state ─────────────────────────────────────────── */
.pl-error {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(0,0,0,0.88);
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 24px;
  z-index: 30;
  backdrop-filter: blur(4px);
}
.pl-error.on { display: flex; }
.pl-error-icon { font-size: 40px; opacity: 0.5; line-height: 1; }
.pl-error-msg  { font-size: 14px; max-width: 280px; line-height: 1.6; }
.pl-error-retry {
  background: #39FF14; color: #000;
  border: none; padding: 10px 26px;
  border-radius: 8px; font-weight: 700;
  cursor: pointer; font-size: 13.5px;
  transition: box-shadow var(--transition);
}
.pl-error-retry:hover { box-shadow: 0 0 18px rgba(57,255,20,0.4); }
.pl-error-next {
  background: none;
  border: 1px solid rgba(57,255,20,0.5);
  color: var(--accent); font-size: 13px; font-weight: 600;
  padding: 9px 22px; border-radius: 8px; cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}
.pl-error-next:hover { background: rgba(57,255,20,0.12); box-shadow: 0 0 14px rgba(57,255,20,0.2); }
.pl-error-back {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4); font-size: 12.5px;
  transition: color var(--transition); margin-top: 4px;
}
.pl-error-back:hover { color: rgba(255,255,255,0.8); }

/* ── TV (coarse pointer + wide) — controls always visible ─── */
@media (pointer: coarse) and (min-width: 900px) {
  /* Controls never fully hide — 40% opacity floor */
  .pl-overlay { opacity: 0.4; transition: opacity 0.3s ease; }
  .pl-overlay.on { opacity: 1; }

  /* Mini bar always visible */
  .pl-mini-bar { opacity: 1; }

  /* Larger spinner on TV */
  .pl-spinner { width: 72px; height: 72px; }

  /* 80px touch targets */
  .pl-nav-btn  { width: 80px; height: 80px; border-radius: 12px; }
  .pl-nav-btn svg { width: 30px; height: 30px; }
  .pl-play-btn { width: 96px; height: 96px; }
  .pl-play-btn svg { width: 42px; height: 42px; }
  .pl-back     { min-height: 56px; padding: 12px 20px; font-size: 14px; }
  .pl-mute-btn { min-width: 56px; min-height: 56px; display: flex; align-items: center; justify-content: center; }
  .pl-mute-btn svg { width: 24px; height: 24px; }
  .pl-fs-btn   { min-width: 56px; min-height: 56px; display: flex; align-items: center; justify-content: center; }
  .pl-fs-btn svg { width: 24px; height: 24px; }
  .pl-quality-btn { min-height: 44px; padding: 8px 12px; font-size: 13px; }
  .pl-quality-panel { right: 12px; bottom: 72px; width: 200px; }
  .pl-vol-slider { width: 120px; height: 6px; }
  .pl-vol-slider::-webkit-slider-thumb { width: 20px; height: 20px; }

  /* Green focus ring on all controls */
  .pl-nav-btn:focus-visible,
  .pl-play-btn:focus-visible,
  .pl-back:focus-visible,
  .pl-mute-btn:focus-visible,
  .pl-fs-btn:focus-visible,
  .pl-error-retry:focus-visible,
  .pl-error-next:focus-visible {
    outline: 3px solid #39FF14;
    outline-offset: 3px;
    border-color: transparent;
  }

  /* Always show cursor on TV */
  .player-screen { cursor: default; }
}

/* ── Channel-switch flash label ───────────────────────────── */
.pl-switch-flash {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(57,255,20,0.4);
  border-radius: 12px;
  padding: 14px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(6px);
}
.pl-switch-flash.on { opacity: 1; }
.pl-switch-name { font-size: 15px; font-weight: 700; color: #fff; }
.pl-switch-idx  { font-size: 11px; color: rgba(255,255,255,0.45); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Top bar: compress on small screens */
  .pl-top { padding: 10px 12px 0; gap: 6px; }
  .pl-channel-name { font-size: 15px; max-width: 160px; }
  .pl-clock { font-size: 16px; }
  .pl-back { padding: 6px 10px; font-size: 12px; }
  .pl-logo { width: 34px; height: 34px; }
  .pl-prog-name { font-size: 11.5px; }
  .pl-prog-time { font-size: 10.5px; }
  .pl-next-prog { display: none; }

  /* Bottom bar */
  .pl-live-bar { margin: 0 12px 8px; }
  .pl-mini-bar { padding: 5px 12px; }
  .pl-mini-ch, .pl-mini-time { font-size: 11.5px; }
  .pl-mini-prog { font-size: 11px; }

  .pl-bottom { padding: 0 12px 14px; gap: 8px; }
  .pl-vol-slider { width: 55px; }
  .pl-nav-label { max-width: 80px; font-size: 11.5px; }
  .pl-quality-btn { padding: 6px 10px; font-size: 12px; }
  .pl-quality-label { font-size: 12px; }
  .pl-quality-panel { right: 10px; bottom: 65px; width: 195px; }

  .pl-play-btn { width: 60px; height: 60px; }
  .pl-play-btn svg { width: 28px; height: 28px; }
}

@media (max-width: 375px) {
  .pl-top { grid-template-columns: auto 1fr auto; }
  .pl-clock { display: none; }
  .pl-epg   { display: none; }
  .pl-vol-slider { display: none; }
  .pl-nav-label  { display: none; }
  .pl-mini-prog  { display: none; }
  .pl-channel-name { font-size: 13px; }
}

/* ============================================================
   EPG — CHANNEL CARD PROGRESS BAR
   ============================================================ */

.ch-card-prog { font-size: 11px; color: #555; margin-top: 2px; min-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: center; }

.ch-prog-bar {
  width: 100%; height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden;
  margin-top: 4px;
}
.ch-prog-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
  min-width: 2px;
}

/* EPG button in channels topbar — compact icon button matching account/settings style */
.ch-epg-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.ch-epg-btn:hover { border-color: var(--accent); color: var(--accent); }
.ch-epg-btn svg  { pointer-events: none; }

/* ============================================================
   EPG SCREEN
   ============================================================ */

:root {
  --epg-ch-w:   180px;
  --epg-time-h:  44px;
  --epg-row-h:   54px;
}

.epg-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  z-index: 400;
}

/* ── Top bar ──────────────────────────────────────────────── */
.epg-topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-ui);
}

.epg-title {
  font-size: 15px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(57,255,20,0.3);
  white-space: nowrap; flex-shrink: 0;
}

.epg-back-btn, .epg-now-btn, .epg-refresh-btn {
  background: var(--bg-muted); border: 1px solid var(--border-ui);
  color: var(--text-muted); border-radius: 6px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  display: flex; align-items: center; gap: 5px;
}
.epg-back-btn:hover, .epg-refresh-btn:hover {
  color: var(--text); border-color: rgba(255,255,255,0.18);
}
.epg-now-btn {
  color: var(--accent); border-color: var(--border);
  background: var(--accent-dim);
  margin-left: auto;
}
.epg-now-btn:hover { background: rgba(57,255,20,0.2); }

.epg-cat-select {
  background: var(--bg-input); border: 1px solid var(--border-ui);
  color: var(--text); border-radius: 6px;
  padding: 5px 10px; font-size: 12.5px; outline: none; cursor: pointer;
  max-width: 160px;
}

/* ── 2×2 grid body ────────────────────────────────────────── */
.epg-body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: var(--epg-ch-w) 1fr;
  grid-template-rows: var(--epg-time-h) 1fr;
  overflow: hidden;
}

.epg-corner {
  background: var(--bg-muted);
  border-right: 1px solid var(--border-ui);
  border-bottom: 1px solid var(--border-ui);
}

/* Time header */
.epg-time-outer {
  overflow: hidden;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-ui);
  position: relative;
}
.epg-time-inner {
  position: relative;
  height: 100%;
}
.epg-time-cell {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text-muted); font-weight: 500;
  padding-left: 6px; white-space: nowrap;
  pointer-events: none;
}
.epg-time-cell::before {
  content: ''; position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 8px;
  background: var(--border-ui);
}
.epg-now-needle {
  position: absolute; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  pointer-events: none; z-index: 5;
}

/* Channel column */
.epg-ch-outer {
  overflow: hidden;
  border-right: 1px solid var(--border-ui);
}
.epg-ch-inner { display: flex; flex-direction: column; }

.epg-ch-cell {
  height: var(--epg-row-h);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background var(--transition);
}
.epg-ch-cell:hover { background: rgba(255,255,255,0.04); }

.epg-ch-logo { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.epg-ch-logo img  { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.epg-ch-initial {
  width: 32px; height: 32px;
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  border-radius: 4px; color: var(--accent);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.epg-ch-name {
  font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.3;
}

/* Main grid */
.epg-main {
  overflow: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.epg-main::-webkit-scrollbar       { width: 6px; height: 6px; }
.epg-main::-webkit-scrollbar-track { background: transparent; }
.epg-main::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

.epg-grid-inner { position: relative; }

/* Now line in main grid */
.epg-now-line {
  position: absolute; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  z-index: 10; pointer-events: none;
}

/* Programme row */
.epg-row {
  height: var(--epg-row-h);
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
}

/* Programme block */
.epg-prog {
  position: absolute;
  top: 5px; bottom: 5px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid transparent;
  border-radius: 5px;
  padding: 3px 8px;
  cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  transition: background var(--transition), border-color var(--transition);
  min-width: 0;
}
.epg-prog:hover        { background: rgba(57,255,20,0.09); border-left-color: rgba(57,255,20,0.35); z-index: 2; }
.epg-prog:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 3; }
.epg-prog.now     { background: rgba(57,255,20,0.08); border-left-color: var(--accent); }
.epg-prog.past    { opacity: 0.38; }
.epg-prog-title {
  font-size: 11.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; width: 100%;
}
.epg-prog-time {
  font-size: 10px; color: rgba(255,255,255,0.38);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; width: 100%; margin-top: 1px;
}
.epg-prog.now .epg-prog-title { color: rgba(57,255,20,0.9); font-weight: 600; }
.epg-prog.now .epg-prog-time  { color: rgba(57,255,20,0.5); }

/* No EPG placeholder */
.epg-no-data {
  height: 100%; display: flex; align-items: center; padding-left: 10px;
  font-size: 11px; color: #333; font-style: italic; pointer-events: none;
}

/* Skeleton rows */
.epg-skel-row {
  height: var(--epg-row-h);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex; align-items: center; padding: 0 8px; gap: 8px;
}
.epg-skel-block {
  height: 34px; border-radius: 5px;
  background: linear-gradient(90deg, #1c1c1c 25%, #242424 50%, #1c1c1c 75%);
  background-size: 600px 100%;
  animation: shimmer 1.5s infinite linear;
}

/* ── Description popup ────────────────────────────────────── */
.epg-popup {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease;
}
.epg-popup-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  max-width: 440px; width: 100%;
  position: relative;
  max-height: 80vh; overflow-y: auto;
}
.epg-popup-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 22px; line-height: 1;
  transition: color var(--transition);
}
.epg-popup-close:hover { color: var(--text); }
.epg-popup-badge {
  display: inline-block;
  background: rgba(57,255,20,0.15); border: 1px solid var(--border-accent);
  color: var(--accent); font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.epg-popup-title {
  font-size: 17px; font-weight: 700; color: var(--text);
  margin-bottom: 5px; padding-right: 28px; line-height: 1.35;
}
.epg-popup-time  { font-size: 12.5px; color: var(--accent); margin-bottom: 10px; }
.epg-popup-dur   { color: rgba(255,255,255,0.4); font-size: 12px; }
.epg-popup-cat   { color: rgba(255,255,255,0.4); font-size: 12px; }
.epg-popup-desc  { font-size: 13.5px; color: var(--text-muted); line-height: 1.65; margin-bottom: 16px; }
.epg-popup-nodesc { font-style: italic; color: #444; font-size: 13px; }

/* Reminder button */
.epg-reminder-btn {
  width: 100%; padding: 10px 16px;
  background: rgba(57,255,20,0.08); border: 1px solid rgba(57,255,20,0.3);
  border-radius: 8px; color: var(--accent); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background var(--transition), border-color var(--transition);
}
.epg-reminder-btn:hover { background: rgba(57,255,20,0.15); }
.epg-reminder-btn--active {
  background: rgba(255,68,68,0.08); border-color: rgba(255,68,68,0.3); color: #f87171;
}
.epg-reminder-btn--active:hover { background: rgba(255,68,68,0.15); }

/* In-app reminder toast */
.epg-reminder-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: #fff; font-size: 13px; font-weight: 500;
  padding: 12px 20px; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 9999; white-space: nowrap;
  animation: fadeIn 0.22s ease, fadeOut 0.4s ease 5.6s forwards;
}

/* Topbar spacer + new controls */
.epg-topbar-spacer { flex: 1; }

.epg-scroll-btn {
  background: var(--bg-muted); border: 1px solid var(--border-ui);
  color: var(--text-muted); border-radius: 6px;
  padding: 5px 10px; font-size: 12px; font-weight: 500;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.epg-scroll-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); }

.epg-date-input {
  background: var(--bg-input); border: 1px solid var(--border-ui);
  color: var(--text); border-radius: 6px;
  padding: 5px 8px; font-size: 12px; outline: none; cursor: pointer;
  flex-shrink: 0;
}
.epg-date-input:focus { border-color: var(--accent); }

/* Remove old margin-left:auto from epg-now-btn since we have the spacer now */
.epg-now-btn { margin-left: 0; }

/* ── Channel card EPG labels ──────────────────────────────── */
.ch-card-now-lbl {
  font-size: 10px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.3px; margin-right: 4px;
}
.ch-card-next {
  display: block; font-size: 10px; color: rgba(255,255,255,0.35);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px; max-height: 0; overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.2s ease;
  opacity: 0;
}
.ch-card:hover .ch-card-next,
.ch-card:focus-visible .ch-card-next {
  max-height: 20px; opacity: 1;
}

/* ── EPG-in-player next programme ────────────────────────── */
.pl-next-prog {
  font-size: 11px; color: rgba(255,255,255,0.4);
  margin-top: 3px;
}

/* ── Responsive ───────────────────────────────────────────── */
/* TV — larger rows + focus ring */
@media (pointer: coarse) and (min-width: 900px) {
  :root { --epg-row-h: 70px; }
  .epg-prog-title { font-size: 13px; }
  .epg-prog-time  { font-size: 11px; }
  .epg-prog:focus-visible { outline: 3px solid var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,0.8); }
}

@media (max-width: 767px) {
  :root { --epg-ch-w: 110px; --epg-row-h: 48px; --epg-time-h: 38px; }
  .epg-ch-logo, .epg-ch-initial { width: 24px; height: 24px; }
  .epg-ch-initial { font-size: 10px; }
  .epg-ch-name    { font-size: 10.5px; }
  .epg-ch-cell    { gap: 5px; padding: 0 6px; }
  .epg-topbar     { padding: 0 10px; gap: 6px; flex-wrap: wrap; height: auto; min-height: var(--topbar-h); padding-top: 6px; padding-bottom: 6px; }
  .epg-title      { font-size: 13px; }
  .epg-cat-select { max-width: 110px; font-size: 11.5px; }
  .epg-date-input { font-size: 11px; padding: 4px 6px; }
  .epg-scroll-btn { padding: 4px 8px; font-size: 11px; }
  .epg-topbar-spacer { display: none; }
}

@media (max-width: 480px) {
  :root { --epg-ch-w: 80px; }
  .epg-ch-name { display: none; }
  .epg-ch-cell { justify-content: center; padding: 0 4px; }
  .epg-scroll-btn span, .epg-date-input { font-size: 10.5px; }
}

/* ════════════════════════════════════════════════════════════
   APP LAYOUT & NAVIGATION
════════════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.nav-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Desktop sidebar ──────────────────────────────────────── */
.app-nav {
  display: flex;
  flex-direction: column;
  width: 196px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  gap: 3px;
  overflow-y: auto;
}

.nav-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 10px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-brand-logo {
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(57,255,20,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-brand-name {
  font-size: 11px; font-weight: 800; letter-spacing: 1.4px;
  color: var(--accent); line-height: 1;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  border: none; background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; width: 100%; text-align: left;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-item svg   { flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active {
  background: rgba(57,255,20,0.1);
  color: var(--accent); font-weight: 600;
}

.nav-spacer { flex: 1; min-height: 8px; }

/* label visibility */
.nav-label-short { display: none; }

/* ── Screen slot (inside nav-content, below trial banner) ── */
.screen-slot {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Fix screens inside screen-slot ─────────────────────── */
.screen-slot > .channels-screen { height: 100%; }

.screen-slot > .epg-screen {
  position: static; inset: auto; z-index: auto;
  height: 100%; overflow: hidden; animation: none;
}

.screen-slot > .settings-screen {
  position: static; inset: auto; z-index: auto;
  height: 100%; overflow: hidden; animation: none;
}

/* ── Mobile bottom nav ─────────────────────────────────── */
@media (max-width: 767px) {
  .app-layout { flex-direction: column; }

  .app-nav {
    order: 2;
    width: 100%; height: 58px; min-height: 58px;
    flex-direction: row; flex-shrink: 0;
    padding: 0; gap: 0;
    border-right: none; border-top: 1px solid var(--border);
    overflow: visible;
  }

  .nav-brand  { display: none; }
  .nav-spacer { display: none; }

  .nav-item {
    flex: 1; flex-direction: column;
    gap: 3px; padding: 6px 2px;
    border-radius: 0; font-size: 9.5px;
    align-items: center; justify-content: center;
    text-align: center;
  }
  .nav-item svg { width: 20px; height: 20px; }

  .nav-label       { display: none; }
  .nav-label-short { display: block; }
  .nav-content     { order: 1; }
}

/* ════════════════════════════════════════════════════════════
   DASHBOARD SCREEN
════════════════════════════════════════════════════════════ */

.dash-screen {
  height: 100%; overflow-y: auto; background: var(--bg);
  scrollbar-width: thin; scrollbar-color: #222 transparent;
}
.screen-slot > .dash-screen { height: 100%; }

.dash-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; gap: 14px; text-align: center; padding: 40px 24px;
}
.dash-empty-title { font-size: 18px; font-weight: 700; color: var(--text); }
.dash-empty-sub   { font-size: 13px; color: var(--text-muted); max-width: 300px; line-height: 1.5; }
.dash-empty-btn {
  padding: 10px 28px; border-radius: 24px;
  background: var(--accent); color: #000; font-size: 13.5px; font-weight: 700;
  border: none; cursor: pointer; transition: opacity 0.15s; margin-top: 4px;
}
.dash-empty-btn:hover { opacity: 0.85; }

.dash-sections {
  padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 28px;
}

.dash-section-hdr {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.dash-section-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 700; color: var(--text);
}
.dash-count-badge {
  font-size: 10.5px; font-weight: 600; color: var(--text-muted);
  background: rgba(255,255,255,0.07); padding: 2px 7px; border-radius: 10px;
}
.dash-see-all {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 12px; font-weight: 600;
  padding: 4px 0; transition: opacity 0.15s;
}
.dash-see-all:hover { opacity: 0.75; }

.dash-row {
  display: flex; gap: 10px; overflow-x: auto;
  scrollbar-width: none; padding-bottom: 6px;
}
.dash-row::-webkit-scrollbar { display: none; }

/* Channel cards */
.dash-ch-card {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  gap: 7px; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 8px; width: 82px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dash-ch-card:hover { border-color: rgba(57,255,20,0.3); background: var(--bg-hover); }
.dash-ch-art {
  width: 46px; height: 46px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.dash-ch-art img { width: 100%; height: 100%; object-fit: contain; }
.dash-ch-initial {
  font-size: 18px; font-weight: 700; color: rgba(57,255,20,0.55);
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
}
.dash-ch-name {
  font-size: 10px; color: var(--text-muted); font-weight: 500;
  text-align: center; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}

/* Movie / Series poster cards */
.dash-movie-card, .dash-ser-card {
  flex-shrink: 0; display: flex; flex-direction: column;
  gap: 6px; background: none; border: none; padding: 0; width: 108px; cursor: pointer;
}
.dash-movie-art {
  width: 108px; height: 156px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s;
}
.dash-movie-card:hover .dash-movie-art,
.dash-ser-card:hover   .dash-movie-art { border-color: rgba(57,255,20,0.3); }
.dash-movie-art img { width: 100%; height: 100%; object-fit: cover; }
.dash-movie-ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.dash-movie-name {
  font-size: 10.5px; color: var(--text-muted); font-weight: 500;
  text-align: center; line-height: 1.3;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* Back buttons for VOD and Series topbars */
.vod-back-btn, .ser-back-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 6px 4px; border-radius: 6px; transition: color 0.15s; flex-shrink: 0;
}
.vod-back-btn:hover, .ser-back-btn:hover { color: var(--text); }
.vod-back-btn svg, .ser-back-btn svg { flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   VOD SCREEN
════════════════════════════════════════════════════════════ */

.vod-screen { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--bg); }
.vod-empty-screen { align-items: center; justify-content: center; }

.vod-empty { text-align: center; padding: 32px 24px; max-width: 340px; }
.vod-empty-icon  { font-size: 52px; margin-bottom: 16px; }
.vod-empty-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.vod-empty-sub   { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 20px; }
.vod-go-btn {
  padding: 11px 24px; border-radius: 24px;
  background: var(--accent); color: #000; font-size: 13.5px; font-weight: 700;
  border: none; cursor: pointer; transition: opacity 0.15s;
}
.vod-go-btn:hover { opacity: 0.85; }

/* ── Topbar ───────────────────────────────────────────────── */
.vod-topbar {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0 16px;
  height: var(--topbar-h); flex-shrink: 0;
  border-bottom: 1px solid var(--border); background: var(--card);
}
.vod-topbar-logo {
  font-size: 11.5px; font-weight: 800; letter-spacing: 1px;
  color: var(--accent); display: flex; align-items: center; gap: 4px;
  text-shadow: 0 0 10px rgba(57,255,20,0.3);
}
.vod-topbar-title { font-size: 15px; font-weight: 700; color: #fff; text-align: center; }
.vod-topbar-right { display: flex; justify-content: flex-end; align-items: center; }
.vod-search-btn {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 6px; line-height: 0; border-radius: 8px;
  transition: color var(--transition), background var(--transition);
}
.vod-search-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

/* ── Search bar ───────────────────────────────────────────── */
.vod-search-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0;
}
.vod-search-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px;
  padding: 9px 14px; outline: none;
  transition: border-color var(--transition);
}
.vod-search-input:focus { border-color: rgba(57,255,20,0.45); }
.vod-search-input::placeholder { color: #555; }
.vod-search-close {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 16px; padding: 6px; line-height: 1; border-radius: 6px;
  transition: color var(--transition);
}
.vod-search-close:hover { color: var(--text); }

/* ── Genre pills ──────────────────────────────────────────── */
.vod-genre-row {
  display: flex; gap: 8px; padding: 10px 16px;
  overflow-x: auto; flex-shrink: 0;
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.vod-genre-row::-webkit-scrollbar { display: none; }
.vod-genre-pill {
  padding: 6px 16px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  border: 1px solid var(--accent); color: var(--accent); background: transparent;
  transition: background 0.15s, color 0.15s;
}
.vod-genre-pill.active { background: var(--accent); color: #000; }
.vod-genre-pill:hover:not(.active) { background: rgba(57,255,20,0.1); }

/* ── Results label ────────────────────────────────────────── */
.vod-results-label { padding: 8px 16px 4px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* ── Movie grid ───────────────────────────────────────────── */
.vod-grid {
  flex: 1; overflow-y: auto; display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px; padding: 12px 16px 24px; align-content: start;
}
.vod-grid::-webkit-scrollbar       { width: 4px; }
.vod-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Movie card ───────────────────────────────────────────── */
.vod-card {
  cursor: pointer; border-radius: 10px; overflow: hidden;
  background: var(--card); border: 2px solid transparent; outline: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.vod-card:hover,
.vod-card:focus-visible {
  transform: scale(1.05); border-color: var(--accent);
  box-shadow: 0 0 20px rgba(57,255,20,0.18);
}

.vod-poster-wrap { position: relative; width: 100%; aspect-ratio: 2/3; background: #111; overflow: hidden; }
.vod-poster { width: 100%; height: 100%; object-fit: cover; display: block; }

.vod-poster-ph {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; padding: 12px;
  background: linear-gradient(135deg, #111 0%, #1a1a2e 100%);
}
.vod-poster-ph-title {
  font-size: 10px; color: rgba(255,255,255,0.35); text-align: center;
  line-height: 1.3; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}

/* Year/rating badge */
.vod-badge { position: absolute; bottom: 5px; left: 5px; display: flex; gap: 3px; pointer-events: none; }
.vod-year-badge,
.vod-rating-badge {
  background: rgba(0,0,0,0.78); backdrop-filter: blur(4px);
  border-radius: 4px; font-size: 9.5px; font-weight: 600; padding: 2px 5px; line-height: 1.3;
}
.vod-year-badge   { color: rgba(255,255,255,0.82); }
.vod-rating-badge { color: #ffd700; }

.vod-name {
  font-size: 12px; color: var(--text); font-weight: 500;
  padding: 6px 8px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Load more ────────────────────────────────────────────── */
.vod-more-wrap { text-align: center; padding: 16px 0 8px; grid-column: 1/-1; }
.vod-more-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--accent); padding: 10px 28px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: background var(--transition), box-shadow var(--transition);
}
.vod-more-btn:hover { background: var(--accent-dim); box-shadow: 0 0 14px rgba(57,255,20,0.15); }

/* ── Detail modal ─────────────────────────────────────────── */
.vod-modal {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.88); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0;
  transition: opacity 0.2s ease; pointer-events: none;
}
.vod-modal.on { opacity: 1; pointer-events: all; }

.vod-modal-inner {
  background: #161616; border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; display: flex; width: 100%; max-width: 820px;
  max-height: calc(100vh - 48px); box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}
.vod-modal-poster-col { width: 240px; flex-shrink: 0; }
.vod-modal-poster     { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 320px; }
.vod-modal-poster-ph  {
  width: 100%; min-height: 320px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px; background: #111; color: rgba(57,255,20,0.2);
}
.vod-modal-info {
  flex: 1; padding: 22px 20px 22px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; position: relative;
}
.vod-modal-close-btn {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted); cursor: pointer;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition); flex-shrink: 0;
}
.vod-modal-close-btn:hover { background: rgba(255,255,255,0.14); color: var(--text); }
.vod-modal-title   { font-size: 20px; font-weight: 800; color: #fff; line-height: 1.2; padding-right: 44px; margin: 0; }
.vod-modal-meta    { display: flex; flex-wrap: wrap; gap: 6px; }
.vod-modal-tag     { background: rgba(255,255,255,0.07); border-radius: 6px; font-size: 12px; color: var(--text-muted); padding: 3px 8px; }
.vod-rating-color  { color: #ffd700 !important; font-weight: 700; }
.vod-modal-overview { font-size: 13.5px; color: rgba(255,255,255,0.65); line-height: 1.7; margin: 0; }
.vod-watch-btn {
  background: var(--accent); color: #000; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 800; padding: 13px 28px; cursor: pointer;
  align-self: flex-start; display: flex; align-items: center; gap: 8px;
  transition: box-shadow var(--transition), transform var(--transition); margin-top: auto;
}
.vod-watch-btn:hover  { box-shadow: 0 0 24px rgba(57,255,20,0.45); transform: translateY(-1px); }
.vod-watch-btn:active { transform: translateY(0); }

/* ── Responsive ───────────────────────────────────────────── */
@media (pointer: coarse) and (min-width: 900px) {
  .vod-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1024px) {
  .vod-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}
@media (max-width: 767px) {
  .vod-topbar { padding: 0 12px; }
  .vod-topbar-logo { display: none; }
  .vod-genre-row { padding: 8px 12px; gap: 6px; }
  .vod-genre-pill { padding: 5px 12px; font-size: 12px; }
  .vod-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; padding: 10px 12px 20px; }
  .vod-results-label { padding: 6px 12px 2px; }
  .vod-modal { padding: 0; align-items: flex-end; }
  .vod-modal-inner { flex-direction: column; border-radius: 16px 16px 0 0; max-height: 90vh; max-width: 100%; }
  .vod-modal-poster-col { width: 100%; height: 180px; flex-shrink: 0; }
  .vod-modal-poster { height: 180px; object-position: top; min-height: unset; }
  .vod-modal-poster-ph { min-height: 120px; height: 180px; }
  .vod-modal-title { font-size: 17px; }
  .vod-modal-info { padding: 16px; gap: 10px; }
  .vod-watch-btn { width: 100%; justify-content: center; font-size: 14px; }
}
@media (max-width: 375px) {
  .vod-grid { gap: 8px; }
  .vod-name { font-size: 11px; padding: 4px 6px 6px; }
}

/* ════════════════════════════════════════════════════════════
   SETTINGS SCREEN
════════════════════════════════════════════════════════════ */

.settings-screen {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: fadeInUp 0.2s ease;
}

/* ── Header ───────────────────────────────────────────────── */
.stg-header {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; height: 56px; padding: 0 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--card);
}
.stg-hdr-back {
  background: none; border: none; padding: 8px;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
}
.stg-hdr-back:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.stg-hdr-title {
  font-size: 12px; font-weight: 700; letter-spacing: 1.8px;
  color: var(--text); text-align: center;
}
.stg-hdr-logo { display: flex; justify-content: flex-end; }

/* ── Scroll body ──────────────────────────────────────────── */
.stg-scroll {
  flex: 1; overflow-y: auto; padding: 16px 16px 24px;
}
.stg-scroll::-webkit-scrollbar       { width: 4px; }
.stg-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Account card ─────────────────────────────────────────── */
.stg-account-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 4px;
}
.stg-account-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(57,255,20,0.12); border: 1.5px solid rgba(57,255,20,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--accent); flex-shrink: 0;
}
.stg-account-info  { flex: 1; min-width: 0; }
.stg-account-name  { font-size: 14px; font-weight: 600; color: var(--text); }
.stg-account-exp   { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ── Section label ────────────────────────────────────────── */
.stg-sec-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-muted); text-transform: uppercase;
  margin: 20px 0 8px; padding-left: 2px;
}

/* ── Tile grid ────────────────────────────────────────────── */
.stg-tiles-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 4px;
}
.stg-tile {
  background: #111111; border: 1px solid #222222;
  border-radius: 12px; padding: 14px 12px;
  display: flex; align-items: center; gap: 10px;
  min-height: 64px; cursor: pointer; width: 100%;
  text-align: left; transition: border-color 0.15s, background 0.15s;
}
.stg-tile:hover  { background: #181818; border-color: #333; }
.stg-tile:active { background: #1a1a1a; }
.stg-tile:focus-visible { border: 3px solid #39FF14; outline: none; }
.stg-tile-icon  { flex-shrink: 0; color: rgba(255,255,255,0.75); display: flex; }
.stg-tile-label { font-size: 12px; font-weight: 500; color: var(--text); flex: 1; line-height: 1.3; }
.stg-tile-badge {
  font-size: 10px; font-weight: 600; color: var(--accent);
  margin-left: auto; flex-shrink: 0;
  background: rgba(57,255,20,0.08); border-radius: 6px; padding: 2px 6px;
}

/* ── Logout button ────────────────────────────────────────── */
.stg-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 24px; padding: 14px; border-radius: 12px;
  background: transparent; border: 1.5px solid #ff4444;
  color: #ff4444; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.stg-logout:hover { background: rgba(255,68,68,0.08); }

/* ── Device bar ───────────────────────────────────────────── */
.stg-device-bar {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 10px 16px; border-top: 1px solid var(--border);
  font-size: 11px; color: #aaaaaa; font-style: italic;
  flex-shrink: 0; background: var(--card);
}

/* ── Shared modal ─────────────────────────────────────────── */
.stg-modal-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.stg-modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; width: 100%; max-width: 400px; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.stg-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.stg-modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
.stg-modal-close {
  background: none; border: none; padding: 4px;
  color: var(--text-muted); cursor: pointer; font-size: 16px;
  line-height: 1; border-radius: 6px;
}
.stg-modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.stg-modal-body       { flex: 1; overflow-y: auto; padding: 20px; }
.stg-modal-body::-webkit-scrollbar       { width: 4px; }
.stg-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── PIN numpad ───────────────────────────────────────────── */
.stg-pin-dots { display: flex; gap: 16px; justify-content: center; margin-bottom: 28px; }
.stg-pin-dot  {
  width: 16px; height: 16px; border-radius: 50%;
  background: #2a2a2a; border: 1.5px solid #444;
  transition: background 0.15s, border-color 0.15s;
}
.stg-pin-dot.filled { background: var(--accent); border-color: var(--accent); }
.stg-numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stg-np-btn {
  background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px;
  min-height: 56px; font-size: 22px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: background 0.12s;
}
.stg-np-btn:hover  { background: #252525; }
.stg-np-btn:active { background: #2d2d2d; }

/* ── Language buttons ─────────────────────────────────────── */
.stg-lang-list { display: flex; flex-direction: column; gap: 10px; }
.stg-lang-btn {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: 10px; background: #1a1a1a; border: 1.5px solid #2a2a2a;
  cursor: pointer; color: var(--text); transition: border-color 0.15s; width: 100%;
}
.stg-lang-btn:hover  { border-color: #444; }
.stg-lang-btn.active { border-color: var(--accent); background: rgba(57,255,20,0.05); }
.stg-lang-name  { flex: 1; font-size: 15px; }
.stg-lang-check { color: var(--accent); font-size: 16px; font-weight: 700; }

/* ── Option list ──────────────────────────────────────────── */
.stg-opt-list { display: flex; flex-direction: column; gap: 8px; }
.stg-opt-row {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-radius: 10px; background: #1a1a1a; border: 1.5px solid #2a2a2a;
  cursor: pointer; color: var(--text); font-size: 14px;
  width: 100%; text-align: left; transition: border-color 0.15s;
}
.stg-opt-row:hover  { border-color: #444; }
.stg-opt-row.active { border-color: var(--accent); background: rgba(57,255,20,0.05); }
.stg-opt-check { color: var(--accent); font-weight: 700; margin-left: auto; }
.stg-opt-save {
  margin-top: 8px; padding: 12px; border: none; border-radius: 10px;
  background: var(--accent); color: #000; font-size: 14px; font-weight: 700;
  cursor: pointer; width: 100%;
}
.stg-opt-save:hover { opacity: 0.9; }

/* ── Category checkboxes ──────────────────────────────────── */
.stg-cat-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  color: var(--text); font-size: 13px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.stg-cat-row input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }

/* ── Legacy section blocks (kept for modal reuse) ─────────── */
.stg-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.stg-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  color: var(--accent); text-transform: uppercase;
  padding: 11px 16px 9px;
  border-bottom: 1px solid var(--border);
}

/* ── Info rows ────────────────────────────────────────────── */
.stg-row {
  display: flex; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  min-height: 50px; gap: 12px;
}
.stg-row:last-of-type { border-bottom: none; }

.stg-label    { font-size: 13.5px; color: var(--text-muted); flex: 1; }
.stg-username { font-size: 14px; font-weight: 600; color: var(--accent); }
.stg-value    { font-size: 13px; color: var(--text-muted); }

/* ── Expiry badge ─────────────────────────────────────────── */
.expiry-badge {
  font-size: 11.5px; font-weight: 700;
  padding: 4px 11px; border-radius: 20px;
}
.expiry-green  { background: rgba(57,255,20,0.1);  color: #39FF14; border: 1px solid rgba(57,255,20,0.25); }
.expiry-yellow { background: rgba(255,215,0,0.1);  color: #FFD700; border: 1px solid rgba(255,215,0,0.25); }
.expiry-red    { background: rgba(255,68,68,0.12); color: #FF5555; border: 1px solid rgba(255,68,68,0.3);  }

/* ── Renew button ─────────────────────────────────────────── */
.stg-renew-btn {
  display: block; padding: 13px 16px;
  background: var(--accent-dim);
  color: var(--accent); font-size: 13.5px; font-weight: 600;
  text-decoration: none; text-align: center;
  border-top: 1px solid #222222;
  transition: background 0.15s; letter-spacing: 0.3px;
}
.stg-renew-btn:hover { background: rgba(57,255,20,0.2); }

/* ── Radio chips ──────────────────────────────────────────── */
.stg-radio-group {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stg-radio-group--last { border-bottom: none; }

.stg-group-label {
  width: 100%; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-muted); padding-bottom: 4px;
}

.s-chip {
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  font-size: 12.5px; cursor: pointer;
  transition: all 0.15s;
}
.s-chip:hover  { border-color: var(--accent); color: var(--text); }
.s-chip.active { background: rgba(57,255,20,0.1); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.stg-text-input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px;
  padding: 8px 12px; outline: none; min-width: 0;
  transition: border-color var(--transition);
}
.stg-text-input:focus { border-color: rgba(57,255,20,0.45); }
.stg-text-input::placeholder { color: #555; }
.stg-row--col { flex-direction: column !important; align-items: flex-start !important; }

/* ── Action rows ──────────────────────────────────────────── */
.stg-action {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 16px; min-height: 54px;
  background: transparent; border: none;
  color: var(--text); font-size: 13.5px;
  cursor: pointer; width: 100%; text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s; text-decoration: none;
}
.stg-action:last-child { border-bottom: none; }
.stg-action:hover      { background: rgba(255,255,255,0.04); }

.stg-action-icon { font-size: 18px; width: 26px; text-align: center; flex-shrink: 0; }
.stg-action-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.stg-action-name { font-size: 13.5px; color: var(--text); }
.stg-action-desc { font-size: 11.5px; color: var(--text-muted); }
.stg-chevron     { color: rgba(255,255,255,0.22); flex-shrink: 0; }

/* ── Version label ────────────────────────────────────────── */
.stg-version {
  font-size: 11.5px; color: #333; text-align: center;
  padding: 12px 16px; letter-spacing: 0.3px;
}

/* ── Legacy logout (kept for compatibility) ───────────────── */
.settings-logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 14px; border-radius: 12px;
  background: transparent; border: 1.5px solid #ff4444;
  color: #ff4444; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.settings-logout-btn:hover { background: rgba(255,68,68,0.08); border-color: #ff4444; }

/* ── Gear icon in channels topbar ─────────────────────────── */
.ch-settings-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.ch-settings-btn:hover { border-color: var(--accent); color: var(--accent); }
.ch-settings-btn svg   { pointer-events: none; }

/* ── Sidebar settings footer ─────────────────────────────── */
.ch-sidebar { display: flex; flex-direction: column; }
.cat-list   { flex: 1; overflow-y: auto; min-height: 0; }

.sidebar-footer {
  padding: 12px 14px; flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.sidebar-stg-btn {
  width: 100%; padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-muted); font-size: 13px;
  cursor: pointer; display: flex; align-items: center;
  gap: 8px; transition: all 0.15s;
}
.sidebar-stg-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sidebar-stg-btn svg   { pointer-events: none; flex-shrink: 0; }

/* ── Confirm dialog ───────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72);
  z-index: 500; display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.confirm-box {
  background: #111111; border: 1px solid #222222;
  border-radius: 14px; padding: 28px 24px 22px;
  max-width: 310px; width: 100%; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
}
.confirm-icon  { font-size: 34px; margin-bottom: 12px; }
.confirm-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.confirm-msg   { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 22px; }
.confirm-btns  { display: flex; gap: 10px; }
.confirm-btns button {
  flex: 1; padding: 13px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.confirm-btns button:hover { opacity: 0.85; }
.confirm-cancel { background: rgba(255,255,255,0.06); border: 1px solid #333; color: var(--text); }
.confirm-ok     { background: transparent; border: 1.5px solid #ff4444; color: #ff4444; }
.confirm-ok:hover { background: rgba(255,68,68,0.08) !important; opacity: 1 !important; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: #111111; border: 1px solid #222222;
  border-radius: 30px; padding: 10px 20px;
  font-size: 13px; color: var(--text);
  z-index: 600; pointer-events: none; opacity: 0;
  white-space: nowrap;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.toast.on        { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.toast--ok { border-color: rgba(57,255,20,0.4); color: var(--accent); }

/* ── Settings responsive ──────────────────────────────────── */
@media (max-width: 767px) {
  .stg-scroll       { padding: 12px 12px 20px; }
  .stg-tiles-row    { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stg-tile         { padding: 12px 10px; min-height: 58px; gap: 8px; }
  .stg-tile-label   { font-size: 11px; }
  .stg-device-bar   { font-size: 10px; }
  .stg-radio-group  { gap: 7px; }
  .s-chip           { font-size: 12px; padding: 6px 12px; }
}
@media (max-width: 380px) {
  .stg-tiles-row    { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   ACCOUNT SCREEN
════════════════════════════════════════════════════════════ */

.acc-screen {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg); display: flex; flex-direction: column; overflow: hidden;
  animation: fadeInUp 0.2s ease;
}

/* ── Header ───────────────────────────────────────────────── */
.acc-header {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; height: 56px; padding: 0 12px;
  border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--card);
}
.acc-back {
  background: none; border: none; padding: 8px; cursor: pointer;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
}
.acc-back:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.acc-title {
  font-size: 12px; font-weight: 700; letter-spacing: 1.8px;
  color: var(--text); text-align: center;
}
.acc-refresh-hdr {
  width: 38px; height: 38px; border-radius: 8px; justify-self: end;
  background: rgba(57,255,20,0.1); border: 1px solid rgba(57,255,20,0.3);
  color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.acc-refresh-hdr:hover  { background: rgba(57,255,20,0.18); }
.acc-refresh-hdr:focus  { outline: 2px solid var(--accent); outline-offset: 2px; }
.acc-refresh-hdr.spinning svg { animation: acc-spin 0.8s linear infinite; }

/* ── Scroll body ──────────────────────────────────────────── */
.acc-scroll {
  flex: 1; overflow-y: auto; padding: 16px 16px 32px;
}
.acc-scroll::-webkit-scrollbar       { width: 4px; }
.acc-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Section label ────────────────────────────────────────── */
.acc-sec-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--text-muted);
  text-transform: uppercase; margin: 20px 0 8px; padding-left: 2px;
}

/* ── Cards ────────────────────────────────────────────────── */
.acc-card {
  background: #111111; border: 1px solid #222222; border-radius: 12px;
  padding: 18px; margin-bottom: 10px;
}
.acc-empty {
  text-align: center; color: var(--text-muted); font-size: 13px;
  line-height: 1.7; padding: 28px 18px;
}

/* ── Subscription card ────────────────────────────────────── */
.acc-sub-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.acc-waka-logo { flex-shrink: 0; }
.acc-sub-info  { flex: 1; min-width: 0; }
.acc-sub-username { font-size: 17px; font-weight: 700; color: var(--text); }
.acc-sub-label    { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.acc-days-badge {
  flex-shrink: 0; font-size: 12px; font-weight: 700;
  border-radius: 20px; padding: 4px 12px; white-space: nowrap;
}
.acc-days-badge.pulse { animation: acc-pulse 1.2s ease-in-out infinite; }

.acc-renew-btn {
  display: block; width: 100%; padding: 12px 16px; box-sizing: border-box;
  background: rgba(57,255,20,0.1); border: 1px solid rgba(57,255,20,0.3);
  border-radius: 10px; color: var(--accent); font-size: 14px; font-weight: 600;
  text-align: center; text-decoration: none; transition: background 0.15s;
}
.acc-renew-btn:hover { background: rgba(57,255,20,0.18); }

.acc-divider { height: 1px; background: #222; margin: 16px 0; }

.acc-copy-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid #1a1a1a;
}
.acc-copy-row:last-child { border-bottom: none; padding-bottom: 0; }
.acc-copy-label { font-size: 12px; color: var(--text-muted); width: 80px; flex-shrink: 0; }
.acc-copy-val   {
  font-size: 13px; color: var(--text); font-family: ui-monospace, monospace;
  flex: 1; letter-spacing: 0.5px; overflow: hidden; text-overflow: ellipsis;
}
.acc-copy-btn {
  background: rgba(255,255,255,0.06); border: 1px solid #333; border-radius: 6px;
  padding: 6px 10px; color: var(--text-muted); cursor: pointer; font-size: 12px;
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s; min-width: 60px; justify-content: center;
}
.acc-copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Playlist cards ───────────────────────────────────────── */
.acc-pl-card   { padding: 16px 18px; }
.acc-pl-top    { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.acc-pl-info   { flex: 1; min-width: 0; }
.acc-pl-name   { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.acc-pl-domain { font-size: 12px; color: #aaaaaa; margin-bottom: 2px; }
.acc-pl-user   { font-size: 11px; color: #555; }

.acc-pl-status {
  flex-shrink: 0; font-size: 11px; font-weight: 700; border-radius: 20px;
  padding: 3px 10px; white-space: nowrap; margin-top: 2px;
}
.acc-pl-status--active    { background: rgba(57,255,20,0.1);   color: #39FF14; border: 1px solid rgba(57,255,20,0.25); }
.acc-pl-status--expired   { background: rgba(255,68,68,0.1);   color: #FF5555; border: 1px solid rgba(255,68,68,0.25); }
.acc-pl-status--suspended { background: rgba(255,165,0,0.1);   color: #FFA500; border: 1px solid rgba(255,165,0,0.25); }
.acc-pl-status--offline   { background: rgba(128,128,128,0.08);color: #777;    border: 1px solid #333; }
.acc-pl-status--info      { background: rgba(74,144,226,0.1);  color: #4A90E2; border: 1px solid rgba(74,144,226,0.25); }
.acc-pl-status--loading   { background: rgba(255,255,255,0.04);color: #555;    border: 1px solid #2a2a2a;
                             animation: acc-pulse 1.2s ease-in-out infinite; }

.acc-pl-details    { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.acc-pl-detail-item{ font-size: 12px; color: var(--text-muted); }
.acc-days-small {
  font-size: 10px; font-weight: 700; border-radius: 10px;
  padding: 1px 6px; vertical-align: middle; margin-left: 4px;
}
.acc-pl-footer       { border-top: 1px solid #1a1a1a; padding-top: 10px; }
.acc-pl-refresh-btn  {
  background: rgba(255,255,255,0.05); border: 1px solid #333; border-radius: 8px;
  padding: 7px 14px; color: var(--text-muted); font-size: 12px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.acc-pl-refresh-btn:hover    { border-color: var(--accent); color: var(--accent); }
.acc-pl-refresh-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Device info card ─────────────────────────────────────── */
.acc-device-card  { padding: 4px 18px; }
.acc-device-row   {
  display: flex; align-items: center; padding: 11px 0;
  border-bottom: 1px solid #1a1a1a;
}
.acc-device-row:last-child { border-bottom: none; }
.acc-device-label { font-size: 12px; color: var(--text-muted); width: 150px; flex-shrink: 0; }
.acc-device-value { font-size: 13px; color: var(--text); flex: 1; }

/* ── Support card ─────────────────────────────────────────── */
.acc-support-card { padding: 0; }
.acc-support-row  {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid #1a1a1a; text-decoration: none; color: var(--text);
  transition: background 0.15s;
}
.acc-support-row:hover      { background: rgba(255,255,255,0.04); }
.acc-support-icon  { font-size: 18px; flex-shrink: 0; }
.acc-support-text  { flex: 1; font-size: 14px; }
.acc-support-arrow { color: #555; font-size: 14px; }

/* ── Danger zone ──────────────────────────────────────────── */
.acc-danger-card { display: flex; flex-direction: column; gap: 10px; }
.acc-danger-btn  {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; border-radius: 10px;
  background: transparent; border: 1.5px solid #ff4444;
  color: #ff4444; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.acc-danger-btn:hover { background: rgba(255,68,68,0.08); }

/* ── Settings account goto ────────────────────────────────── */
.stg-acc-goto {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 16px; margin-top: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid #222;
  border-radius: 10px; color: var(--accent); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s; text-align: left;
}
.stg-acc-goto:hover { background: rgba(57,255,20,0.07); }

/* ── Channel account btn ──────────────────────────────────── */
.ch-account-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.ch-account-btn:hover { border-color: var(--accent); color: var(--accent); }
.ch-account-btn svg   { pointer-events: none; }

/* ── Keyframes ────────────────────────────────────────────── */
@keyframes acc-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes acc-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Account responsive ───────────────────────────────────── */
@media (max-width: 767px) {
  .acc-scroll        { padding: 12px 12px 24px; }
  .acc-card          { padding: 14px; }
  .acc-device-card   { padding: 4px 14px; }
  .acc-device-label  { width: 120px; font-size: 11px; }
  .acc-support-row   { padding: 12px 14px; }
  .acc-sub-username  { font-size: 15px; }
}

/* ════════════════════════════════════════════════════════════
   ACTIVATION SCREEN
════════════════════════════════════════════════════════════ */

.act-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: #0f0f0f;
  font-family: inherit;
}

.act-close-btn {
  position: absolute; top: 16px; right: 20px;
  background: none; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
  color: #ccc; cursor: pointer; padding: 8px; display: flex; align-items: center;
  transition: border-color 0.2s, color 0.2s; z-index: 10;
}
.act-close-btn:hover, .act-close-btn:focus {
  border-color: #39FF14; color: #39FF14; outline: none;
}

/* ── Card ───────────────────────────────────────────────── */
.act-card {
  display: flex; flex-direction: row; align-items: stretch;
  background: #141414; border: 1px solid rgba(57,255,20,0.15);
  border-radius: 16px; overflow: hidden;
  width: min(960px, 96vw); max-height: 92vh;
  box-shadow: 0 0 60px rgba(57,255,20,0.08);
}

/* ── Left panel ─────────────────────────────────────────── */
.act-left {
  flex: 0 0 300px; padding: 36px 28px;
  display: flex; flex-direction: column; align-items: center;
  border-right: 1px solid rgba(57,255,20,0.1);
  background: #0f0f0f;
}
.act-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 24px;
}
.act-wordmark {
  font-size: 18px; font-weight: 800; letter-spacing: 0.05em;
  color: #fff;
}
.act-wordmark span { color: #39FF14; }
.act-title {
  font-size: 17px; font-weight: 700; color: #fff;
  text-align: center; margin: 0 0 8px; line-height: 1.3;
}
.act-sub {
  font-size: 13px; color: #888; text-align: center; margin: 0 0 20px; line-height: 1.5;
}
.act-qr-wrap {
  background: #0f0f0f; border: 1px solid rgba(57,255,20,0.2);
  border-radius: 12px; padding: 10px; margin-bottom: 10px;
}
.act-qr { display: block; border-radius: 6px; }
.act-qr-label {
  font-size: 12px; color: #555; text-align: center; margin: 0;
}

/* ── Dividers ───────────────────────────────────────────── */
.act-vdivider {
  width: 1px; background: rgba(57,255,20,0.1); flex-shrink: 0;
}
.act-hdivider {
  border: none; border-top: 1px solid rgba(255,255,255,0.07);
  margin: 20px 0;
}

/* ── Right panel ────────────────────────────────────────── */
.act-right {
  flex: 1; padding: 32px 32px 28px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.act-right-title {
  font-size: 16px; font-weight: 700; color: #fff; margin: 0 0 6px;
}
.act-right-sub {
  font-size: 13px; color: #888; margin: 0 0 18px; line-height: 1.5;
}

/* ── Device ID block ────────────────────────────────────── */
.act-id-block {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px;
}
.act-id-group { display: flex; flex-direction: column; gap: 4px; }
.act-id-label {
  font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.06em;
}
.act-id-row {
  display: flex; align-items: center; gap: 8px;
  background: #1a1a1a; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 8px 12px;
}
.act-id-value {
  font-family: 'Courier New', monospace; font-size: 15px;
  font-weight: 600; color: #39FF14; letter-spacing: 0.08em; flex: 1;
}
.act-copy-btn {
  background: none; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; color: #aaa; cursor: pointer; padding: 4px 6px;
  display: flex; align-items: center; transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.act-copy-btn:hover, .act-copy-btn:focus {
  border-color: #39FF14; color: #39FF14; outline: none;
}

/* ── Pricing cards ──────────────────────────────────────── */
.act-pricing {
  display: flex; gap: 12px; margin-bottom: 16px;
}
.act-pcard {
  flex: 1; background: #1a1a1a; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px; position: relative;
}
.act-pcard--featured {
  border-color: rgba(57,255,20,0.35);
  background: rgba(57,255,20,0.05);
}
.act-pbadge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: #39FF14; text-transform: uppercase; margin-bottom: 4px;
}
.act-pprice {
  font-size: 22px; font-weight: 800; color: #fff;
}
.act-pper {
  font-size: 13px; font-weight: 400; color: #888;
}
.act-pprice-sub {
  font-size: 12px; color: #666; margin-bottom: 6px;
}
.act-pfeatures {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px;
}
.act-pfeatures li {
  font-size: 12px; color: #999; padding-left: 14px; position: relative;
}
.act-pfeatures li::before {
  content: '✓'; position: absolute; left: 0; color: #39FF14; font-size: 11px;
}

/* ── CTA ────────────────────────────────────────────────── */
.act-cta {
  display: block; text-align: center; background: #39FF14; color: #000;
  font-size: 14px; font-weight: 700; text-decoration: none;
  border-radius: 50px; padding: 12px 20px; margin-bottom: 8px;
  transition: filter 0.2s;
}
.act-cta:hover, .act-cta:focus {
  filter: brightness(1.15); outline: 2px solid #39FF14; outline-offset: 2px;
}
.act-auto-text {
  font-size: 12px; color: #555; text-align: center; margin: 0 0 12px;
}

/* ── Polling indicator ──────────────────────────────────── */
.act-polling {
  font-size: 12px; color: #555; text-align: center; margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.act-polling-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #39FF14;
  animation: act-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes act-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* ── Success overlay ────────────────────────────────────── */
.act-success {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(0,0,0,0.82);
  border-radius: 16px; z-index: 20; flex-direction: column; gap: 16px;
}
.act-success.hidden { display: none; }
.act-success-inner {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.act-success-icon { width: 72px; height: 72px; }
.act-success-msg {
  font-size: 20px; font-weight: 700; color: #39FF14; margin: 0;
}

/* ── Responsive (portrait / small screen) ───────────────── */
@media (max-width: 700px) {
  .act-card { flex-direction: column; max-height: none; width: 100vw; border-radius: 0; }
  .act-left { flex: none; padding: 24px 20px; border-right: none;
               border-bottom: 1px solid rgba(57,255,20,0.1); }
  .act-right { padding: 20px; }
  .act-vdivider { display: none; }
  .act-pricing { flex-direction: column; }
  .act-qr { width: 180px !important; height: 180px !important; }
}


/* ════════════════════════════════════════════════════════════
   PLAYLIST MANAGER SCREEN
════════════════════════════════════════════════════════════ */

.plm-screen {
  display: flex; flex-direction: column;
  height: 100%; background: var(--bg); overflow: hidden;
}

.plm-topbar {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; position: relative;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.plm-topbar-title {
  font-size: 13px; font-weight: 700; letter-spacing: 0.8px; color: var(--text);
  position: absolute; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
}
.plm-add-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent); color: #000; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 0;
  transition: box-shadow 0.15s;
}
.plm-add-btn:hover { box-shadow: 0 0 14px rgba(57,255,20,0.45); }

.plm-body { flex: 1; overflow-y: auto; padding: 16px; }
.plm-body::-webkit-scrollbar       { width: 4px; }
.plm-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Empty state ─────────────────────────────────────────── */
.plm-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px;
  height: 100%; min-height: 300px;
  text-align: center; padding: 40px 20px;
}
.plm-empty-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(57,255,20,0.08); border: 2px solid rgba(57,255,20,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.plm-empty-icon:hover { background: rgba(57,255,20,0.15); box-shadow: 0 0 20px rgba(57,255,20,0.2); }
.plm-empty-title { font-size: 16px; font-weight: 600; color: var(--text); }
.plm-empty-sub   { font-size: 13px; color: var(--text-muted); max-width: 280px; line-height: 1.55; }

/* ── Playlist cards ──────────────────────────────────────── */
.plm-list { display: flex; flex-direction: column; gap: 12px; }

.plm-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
  position: relative;
  transition: border-color 0.15s;
}
.plm-card:hover { border-color: rgba(255,255,255,0.1); }

.plm-card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.plm-card-left  { flex: 1; min-width: 0; }
.plm-card-name  {
  font-size: 15px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.plm-card-domain {
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.plm-card-meta  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plm-meta-item  { font-size: 12px; color: var(--text-muted); }
.plm-meta-sep   { font-size: 11px; color: #333; }
.plm-expiry-label { font-size: 12px; color: var(--text-muted); }

.plm-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  padding: 2px 8px; border-radius: 10px;
}
.plm-status--active   { background: rgba(57,255,20,0.1);  color: #39FF14; border: 1px solid rgba(57,255,20,0.25); }
.plm-status--expiring { background: rgba(255,215,0,0.1);  color: #FFD700; border: 1px solid rgba(255,215,0,0.25); }
.plm-status--expired  { background: rgba(255,68,68,0.1);  color: #ff5555; border: 1px solid rgba(255,68,68,0.25); }
.plm-status--loading  { background: rgba(245,158,11,0.1); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }

/* Three-dot menu button */
.plm-three-dot {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 6px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 0;
  transition: background 0.15s, color 0.15s;
}
.plm-three-dot:hover { background: rgba(255,255,255,0.06); color: var(--text); }

/* Dropdown */
.plm-dropdown {
  position: absolute; right: 14px; top: 50px;
  background: #1a1a1a; border: 1px solid var(--border);
  border-radius: 10px; z-index: 50; min-width: 165px;
  overflow: hidden; box-shadow: 0 8px 28px rgba(0,0,0,0.55);
  animation: fadeIn 0.12s ease;
}
.plm-dropdown button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 14px;
  background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 13.5px; text-align: left;
  transition: background 0.12s;
}
.plm-dropdown button:hover { background: rgba(255,255,255,0.06); }
.plm-dropdown .plm-dd-delete        { color: #ff5555; }
.plm-dropdown .plm-dd-delete:hover  { background: rgba(255,68,68,0.08); }

/* ── Add / Edit form view ────────────────────────────────── */
.plm-add-view { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.plm-tabs {
  display: flex; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.plm-tab {
  flex: 1; padding: 0 16px; height: 48px;
  background: none; border: none; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  position: relative; bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.plm-tab.active          { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.plm-tab:hover:not(.active) { color: var(--text); }

.plm-add-body {
  flex: 1; overflow-y: auto;
  padding: 20px 16px 56px;
  display: flex; flex-direction: column; align-items: center;
}
.plm-add-body::-webkit-scrollbar       { width: 4px; }
.plm-add-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.plm-form-wrap { width: 100%; max-width: 480px; }
.plm-form      { display: flex; flex-direction: column; gap: 12px; }

.plm-field { display: flex; flex-direction: column; gap: 6px; }
.plm-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--text-muted); text-transform: uppercase;
}
.plm-input {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border-ui);
  border-radius: var(--radius); color: var(--text);
  font-size: 16px; padding: 0 16px; outline: none;
  height: 80px;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plm-input::placeholder { color: #555; }
.plm-input:focus { border-color: rgba(57,255,20,0.5); box-shadow: 0 0 0 3px rgba(57,255,20,0.08); }

@media (pointer: fine) {
  .plm-input { height: 48px; font-size: 15px; }
}

.plm-connect-btn {
  width: 100%; background: var(--accent); color: #000;
  font-size: 15px; font-weight: 700; border: none;
  border-radius: var(--radius); height: 80px; cursor: pointer;
  letter-spacing: 0.4px; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.plm-connect-btn:hover:not(:disabled)  { background: #4dff2a; box-shadow: 0 0 20px rgba(57,255,20,0.4); }
.plm-connect-btn:active:not(:disabled) { transform: scale(0.98); }
.plm-connect-btn:disabled { opacity: 0.6; cursor: not-allowed; }

@media (pointer: fine) { .plm-connect-btn { height: 52px; } }

.plm-connect-spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(0,0,0,0.3); border-top-color: #000;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  display: none;
}
.plm-connect-btn.loading .plm-connect-spinner { display: block; }
.plm-connect-btn.loading .plm-connect-text    { opacity: 0.7; }

.plm-result {
  border-radius: var(--radius); padding: 14px 16px;
  font-size: 13.5px; line-height: 1.55; margin-top: 16px;
}
.plm-result--ok    { background: rgba(57,255,20,0.08); border: 1px solid rgba(57,255,20,0.3);  color: var(--accent); }
.plm-result--error { background: rgba(255,68,68,0.08); border: 1px solid rgba(255,68,68,0.3);  color: #f87171; }
.plm-result.hidden { display: none; }

/* Channel playlist source badge */
.ch-pl-badge {
  position: absolute; bottom: 5px; left: 5px;
  background: rgba(57,255,20,0.13); border: 1px solid rgba(57,255,20,0.22);
  color: rgba(57,255,20,0.75); font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; letter-spacing: 0.3px;
  max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════════
   SERIES SCREEN
════════════════════════════════════════════════════════════ */
.ser-screen {
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
  background: var(--bg);
}

/* topbar */
.ser-topbar {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0 16px;
  height: 56px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.ser-topbar-brand {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.5px; color: var(--accent);
}
.ser-topbar-brand span { color: #fff; }
.ser-topbar-title {
  font-size: 15px; font-weight: 700; color: #fff; letter-spacing: 0.3px;
}
.ser-topbar-right {
  display: flex; justify-content: flex-end; gap: 8px;
}
.ser-search-btn {
  background: transparent; border: none; color: var(--text-muted);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.ser-search-btn:hover { color: #fff; background: var(--hover-bg); }

/* search bar */
.ser-search-wrap {
  flex-shrink: 0; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.ser-search-wrap.hidden { display: none; }
.ser-search-inner {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 12px; height: 40px;
  color: var(--text-muted);
}
.ser-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #fff; font-size: 14px;
}
.ser-search-input::placeholder { color: var(--text-muted); }
.ser-search-close {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; display: flex; align-items: center;
}
.ser-search-close:hover { color: #fff; }

/* content scroll area */
.ser-content {
  flex: 1; overflow-y: auto; padding: 20px 16px 32px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}

/* section headers */
.ser-section { margin-bottom: 28px; }
.ser-section-title {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.6px; text-transform: uppercase;
  margin-bottom: 14px;
}
.ser-section-title--pad { padding: 0; margin-bottom: 14px; }
.ser-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(57,255,20,0.12); color: var(--accent);
  font-size: 11px; padding: 1px 7px; border-radius: 20px;
  margin-left: 6px; vertical-align: middle;
}

/* Continue Watching row */
.ser-cw-row {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none;
}
.ser-cw-row::-webkit-scrollbar { display: none; }
.ser-cw-card {
  flex: 0 0 140px; cursor: pointer; border-radius: var(--radius);
  overflow: hidden; border: 2px solid transparent;
  transition: border-color 0.18s, transform 0.18s;
}
.ser-cw-card:hover, .ser-cw-card:focus-visible {
  border-color: var(--accent); transform: scale(1.04); outline: none;
}
.ser-cw-thumb {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: var(--bg-card); overflow: hidden;
}
.ser-cw-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ser-cw-no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
}
.ser-cw-prog-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.12);
}
.ser-cw-prog-fill { height: 100%; background: var(--accent); }
.ser-cw-done {
  position: absolute; top: 5px; right: 5px;
  background: var(--accent); color: #000; font-size: 10px; font-weight: 800;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ser-cw-meta { padding: 6px 8px; background: var(--bg-card); }
.ser-cw-show { font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ser-cw-ep   { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* Shows grid */
.ser-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.ser-card {
  cursor: pointer; border-radius: var(--radius); overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.18s, transform 0.18s;
}
.ser-card:hover, .ser-card:focus-visible {
  border-color: var(--accent); transform: scale(1.04); outline: none;
}
.ser-card:focus-visible { box-shadow: 0 0 0 3px rgba(57,255,20,0.4); }
.ser-card-art {
  position: relative; width: 100%; aspect-ratio: 2/3;
  background: var(--bg-card); overflow: hidden;
}
.ser-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ser-card-img--fallback { object-fit: contain; padding: 8px; opacity: 0.6; }
.ser-card-no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
}
.ser-card-prog-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.12);
}
.ser-card-prog-fill { height: 100%; background: var(--accent); }
.ser-card-done {
  position: absolute; top: 6px; right: 6px;
  background: var(--accent); color: #000; font-size: 10px; font-weight: 800;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ser-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  padding: 16px 6px 6px;
  opacity: 0; transition: opacity 0.18s;
}
.ser-card:hover .ser-card-overlay { opacity: 1; }
.ser-card-meta { font-size: 9px; color: rgba(255,255,255,0.75); }
.ser-card-name {
  padding: 6px 4px 2px; font-size: 12px; font-weight: 600;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ser-card-year { padding: 0 4px 6px; font-size: 10px; color: var(--text-muted); }

/* empty state */
/* Series stub loading state */
.ser-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; min-height: 300px; text-align: center; color: #888; font-size: 14px;
}
.ser-loading strong { color: #fff; }
.ser-loading-spin {
  width: 36px; height: 36px;
  border: 3px solid rgba(57,255,20,0.15);
  border-top-color: #39FF14;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.ser-loading-err { color: #ff6b6b; line-height: 1.6; }
.ser-loading-err small { color: #888; font-size: 12px; }

.ser-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 280px; gap: 10px; text-align: center;
}
.ser-empty-icon { font-size: 48px; }
.ser-empty-title { font-size: 17px; font-weight: 700; color: #fff; }
.ser-empty-sub   { font-size: 13px; color: var(--text-muted); max-width: 340px; line-height: 1.55; }

/* ── Detail view ─────────────────────────────────────────── */
.ser-detail { display: flex; flex-direction: column; gap: 0; }
.ser-detail-top { padding-bottom: 0; }
.ser-detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; color: var(--text-muted);
  font-size: 13px; cursor: pointer; padding: 6px 0 14px;
  transition: color 0.15s;
}
.ser-detail-back:hover { color: #fff; }
.ser-detail-hero {
  display: flex; gap: 20px; align-items: flex-start;
  padding-bottom: 20px;
}
.ser-detail-poster {
  flex-shrink: 0; width: 120px; aspect-ratio: 2/3;
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.ser-detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.ser-detail-no-poster {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.ser-detail-info { flex: 1; min-width: 0; }
.ser-detail-title {
  font-size: 20px; font-weight: 800; color: #fff;
  margin: 0 0 8px; line-height: 1.2;
}
.ser-detail-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ser-detail-year, .ser-detail-rating {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 20px;
}
.ser-detail-stats {
  font-size: 12px; color: var(--text-muted); margin-bottom: 10px;
}
.ser-detail-overview {
  font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.6; margin: 0;
}

/* Season tabs */
.ser-season-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0; margin-bottom: 0;
}
.ser-season-tab {
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  padding: 10px 14px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.ser-season-tab:hover { color: #fff; }
.ser-season-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Episode list */
.ser-ep-list { display: flex; flex-direction: column; margin-top: 0; }
.ser-ep-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.ser-ep-row:hover { background: var(--hover-bg); }
.ser-ep-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ser-ep-num {
  flex-shrink: 0; font-size: 12px; font-weight: 700;
  color: var(--accent); width: 36px; text-align: center;
}
.ser-ep-info { flex: 1; min-width: 0; }
.ser-ep-title {
  font-size: 14px; font-weight: 500; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ser-ep-prog {
  height: 3px; background: rgba(255,255,255,0.1);
  border-radius: 2px; margin-top: 5px;
}
.ser-ep-prog-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.ser-ep-done {
  flex-shrink: 0; background: var(--accent); color: #000;
  font-size: 11px; font-weight: 800;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ser-ep-play {
  flex-shrink: 0; background: transparent; border: 1px solid rgba(255,255,255,0.12);
  color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.ser-ep-play:hover { background: var(--accent); border-color: var(--accent); color: #000; }

/* ── TV ──────────────────────────────────────────────────── */
@media (pointer: coarse) and (min-width: 900px) {
  .ser-grid { grid-template-columns: repeat(4, 1fr); }
  .ser-ep-row { padding: 16px 20px; min-height: 64px; }
  .ser-ep-play { width: 44px; height: 44px; }
  .ser-season-tab { padding: 14px 20px; font-size: 14px; }
}

/* ── Tablet ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .ser-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 767px) {
  .ser-topbar { padding: 0 12px; }
  .ser-topbar-brand span { display: none; }
  .ser-content { padding: 16px 12px 80px; }
  .ser-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .ser-detail-poster { width: 90px; }
  .ser-detail-title  { font-size: 16px; }
  .ser-cw-card { flex: 0 0 120px; }
}

@media (max-width: 480px) {
  .ser-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ser-detail-hero { flex-direction: column; }
  .ser-detail-poster { width: 100%; max-width: 160px; }
}

/* ════════════════════════════════════════════════════════════
   APP LOADING SPLASH
════════════════════════════════════════════════════════════ */
.app-splash {
  position: fixed; inset: 0; z-index: 2000;
  background: #0a0a0a;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px;
}
.app-splash-logo {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.app-splash-mark {
  width: min(40vh, 180px); height: min(40vh, 180px);
  display: flex; align-items: center; justify-content: center;
}
.app-splash-mark svg { width: 100%; height: 100%; }
.app-splash-wordmark {
  font-size: clamp(22px, 5vw, 52px); font-weight: 800; letter-spacing: 4px; color: #fff;
}
.app-splash-wordmark span { color: #39FF14; }
.app-splash-spinner {
  width: 52px; height: 52px;
  filter: drop-shadow(0 0 10px rgba(57,255,20,0.5));
}
.app-splash-spinner circle:last-child {
  transform-origin: 24px 24px;
  animation: spin 0.85s linear infinite;
}
.app-splash-status {
  font-size: 14px; color: #aaaaaa; letter-spacing: 0.3px;
  min-height: 22px; text-align: center;
}

/* Shared mini-logo helpers (used by no-internet + DNR screens) */
.splash-logo-mark { display: flex; align-items: center; justify-content: center; }
.splash-logo-mark svg { width: 100%; height: 100%; }
.splash-wordmark { font-weight: 800; letter-spacing: 2px; color: #fff; }
.splash-wordmark span { color: #39FF14; }

/* ════════════════════════════════════════════════════════════
   NO INTERNET SCREEN
════════════════════════════════════════════════════════════ */
.no-internet-screen {
  position: fixed; inset: 0; z-index: 2000;
  background: #0a0a0a;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 24px;
}
.no-internet-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.no-internet-icon { width: 80px; height: 80px; color: #fff; opacity: 0.7; flex-shrink: 0; }
.no-internet-title {
  font-size: clamp(20px, 3vw, 28px); font-weight: 700; text-align: center;
}
.no-internet-sub {
  font-size: 15px; color: #aaaaaa; text-align: center;
  max-width: 420px; line-height: 1.6;
}
.no-internet-retry {
  background: #39FF14; color: #000; font-size: 16px; font-weight: 700;
  border: none; border-radius: 30px; padding: 14px 40px; cursor: pointer;
  min-height: 50px; margin-top: 8px;
  transition: background 0.15s, transform 0.1s;
}
.no-internet-retry:hover { background: #4dff2a; transform: scale(1.03); }

/* ════════════════════════════════════════════════════════════
   DEVICE NOT REGISTERED SCREEN
════════════════════════════════════════════════════════════ */
.dnr-screen {
  position: fixed; inset: 0; z-index: 2000;
  background: radial-gradient(ellipse at 50% 0%, rgba(57,255,20,0.04) 0%, transparent 55%), #0a0a0a;
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; padding: 24px 16px 40px;
}
.dnr-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-shrink: 0; }
.dnr-card {
  background: #111111; border: 1px solid #222222; border-radius: 16px;
  padding: 32px 28px; width: 100%; max-width: 520px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 0 40px rgba(57,255,20,0.06), 0 8px 32px rgba(0,0,0,0.5);
}
.dnr-title  { font-size: clamp(18px, 2.5vw, 24px); font-weight: 800; text-align: center; }
.dnr-sub    { font-size: 14px; color: #aaaaaa; text-align: center; line-height: 1.55; }
.dnr-qr-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 0 4px;
}
.dnr-qr { border-radius: 12px; display: block; image-rendering: pixelated; }
.dnr-qr-label { font-size: 13px; color: #aaaaaa; }
.dnr-divider { height: 1px; background: #222222; flex-shrink: 0; }
.dnr-ids-title {
  font-size: 12px; color: #aaaaaa; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
}
.dnr-id-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid #222; border-radius: 10px;
  padding: 12px 14px;
}
.dnr-id-label { font-size: 12px; color: #aaaaaa; min-width: 100px; }
.dnr-id-value {
  flex: 1; font-family: ui-monospace, monospace; font-size: 14px; font-weight: 700;
  color: #39FF14; letter-spacing: 1px;
}
.dnr-copy-btn {
  background: transparent; border: 1px solid #333; border-radius: 6px;
  color: #aaaaaa; cursor: pointer; padding: 5px 8px;
  display: flex; align-items: center; transition: color 0.15s, border-color 0.15s;
}
.dnr-copy-btn:hover { color: #fff; border-color: #555; }
.dnr-instructions { font-size: 13px; color: #aaaaaa; line-height: 1.6; text-align: center; }
.dnr-instructions strong { color: #fff; }
.dnr-login-row {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.dnr-login-text { font-size: 14px; color: #aaaaaa; }
.dnr-login-btn {
  background: transparent; border: none; cursor: pointer;
  color: #39FF14; font-size: 14px; font-weight: 700; text-decoration: underline;
}
.dnr-polling {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: #aaaaaa;
  margin-top: 20px; flex-shrink: 0;
  animation: dnrPulse 2s ease-in-out infinite;
}
.dnr-polling-dot { width: 8px; height: 8px; border-radius: 50%; background: #39FF14; flex-shrink: 0; }
@keyframes dnrPulse { 0%, 100% { opacity: 0.8; } 50% { opacity: 0.3; } }

/* ════════════════════════════════════════════════════════════
   HOME SCREEN
════════════════════════════════════════════════════════════ */
.home-screen {
  position: fixed; inset: 0; background: #0a0a0a;
  display: flex; flex-direction: column; overflow: hidden;
}
.home-header {
  display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center;
  height: clamp(52px, 7vh, 72px); padding: 0 20px; flex-shrink: 0;
  background: rgba(17,17,17,0.97); border-bottom: 1px solid #222;
}
.home-hdr-logo   { display: flex; align-items: center; gap: 10px; }
.home-wordmark   { font-size: clamp(14px, 1.5vw, 20px); font-weight: 800; letter-spacing: 2px; color: #fff; }
.home-wordmark span { color: #39FF14; }
.home-clock {
  text-align: center; font-size: clamp(20px, 2.5vw, 34px); font-weight: 600;
  letter-spacing: 3px; color: #fff; font-variant-numeric: tabular-nums;
}
.home-hdr-right  { display: flex; justify-content: flex-end; align-items: center; }
.home-sub-badge {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.06); color: #aaaaaa;
}
.home-sub-badge--ok     { background: rgba(57,255,20,0.12);  color: #39FF14; }
.home-sub-badge--warn   { background: rgba(255,170,0,0.12);  color: #ffaa00; }
.home-sub-badge--danger { background: rgba(255,68,68,0.12);  color: #ff4444; }

.home-tiles { flex: 1; display: flex; gap: 14px; padding: 16px 20px 20px; min-height: 0; }
.home-col-main   { flex: 2.5; display: flex; }
.home-col-center { flex: 3; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; }
.home-col-side   { flex: 1.5; display: flex; flex-direction: column; gap: 12px; }

/* Base tile */
.home-tile {
  background: #111111; border: 1px solid #222222; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; cursor: pointer; padding: 16px;
  width: 100%; flex: 1; position: relative; min-height: 0;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.home-tile:hover,
.home-tile:focus-visible {
  border: 3px solid #39FF14; outline: none;
  transform: scale(1.03);
  box-shadow: 0 0 24px rgba(57,255,20,0.18);
}
.home-tile:hover .home-tile-icon,
.home-tile:focus-visible .home-tile-icon { color: #39FF14; }

/* Live tile accent */
.home-tile--live {
  background: linear-gradient(135deg, rgba(57,255,20,0.06) 0%, #111111 65%);
}
/* Side tiles: horizontal layout */
.home-tile--side { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 12px 16px; }
/* Danger tile (logout) */
.home-tile--danger:hover,
.home-tile--danger:focus-visible {
  border-color: #ff4444;
  box-shadow: 0 0 24px rgba(255,68,68,0.18);
}
.home-tile--danger:hover .home-tile-icon,
.home-tile--danger:focus-visible .home-tile-icon { color: #ff4444; }
/* Refresh spinning state */
.home-tile--spinning .home-tile-icon { animation: homeRefreshSpin 0.8s linear infinite; }
@keyframes homeRefreshSpin { to { transform: rotate(360deg); } }

.home-tile-icon {
  width: 48px; height: 48px; color: #fff; flex-shrink: 0; transition: color 0.15s;
}
.home-tile--live .home-tile-icon { width: 64px; height: 64px; }
.home-tile--side .home-tile-icon { width: 28px !important; height: 28px !important; }
.home-tile-icon--sm { width: 28px !important; height: 28px !important; }

.home-tile-label {
  font-size: clamp(12px, 1.2vw, 16px); font-weight: 600; color: #fff; text-align: center;
}
.home-tile--live .home-tile-label { font-size: clamp(14px, 1.5vw, 20px); }
.home-tile--side .home-tile-label { font-size: clamp(11px, 1.1vw, 14px); text-align: left; }

.home-tile-sub  { font-size: clamp(10px, 0.9vw, 13px); color: #aaaaaa; text-align: center; }
.home-tile-badge {
  background: rgba(57,255,20,0.15); border: 1px solid rgba(57,255,20,0.3);
  color: #39FF14; font-size: 11px; font-weight: 700; border-radius: 12px; padding: 2px 8px;
}

/* Exit overlay */
.home-exit-overlay {
  position: absolute; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
}
.home-exit-box {
  background: #1a1a1a; border: 1px solid #333; border-radius: 16px;
  padding: 36px 48px; text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.home-exit-msg  { font-size: 18px; font-weight: 600; margin-bottom: 24px; }
.home-exit-btns { display: flex; gap: 12px; justify-content: center; }
.home-exit-cancel {
  background: transparent; border: 1px solid #444; color: #aaaaaa;
  border-radius: 10px; padding: 10px 28px; font-size: 15px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.home-exit-cancel:hover { border-color: #888; color: #fff; }
.home-exit-ok {
  background: #ff4444; border: 1px solid #ff4444; color: #fff;
  border-radius: 10px; padding: 10px 28px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.home-exit-ok:hover { background: #ff6060; }

/* ── Home Responsive ─────────────────────────────────────── */
@media (min-width: 1441px) {
  .home-tile-icon { width: 64px; height: 64px; }
  .home-tile--live .home-tile-icon { width: 80px !important; height: 80px !important; }
  .home-tile--side .home-tile-icon { width: 40px !important; height: 40px !important; }
  .home-tile-icon--sm { width: 40px !important; height: 40px !important; }
  .home-tiles { gap: 18px; padding: 20px 28px 28px; }
}
@media (max-width: 1024px) {
  .home-tiles { flex-direction: column; }
  .home-col-main { flex: none; height: 180px; }
  .home-col-center { flex: none; }
  .home-col-side { flex: none; flex-direction: row; }
  .home-tile--side { flex-direction: column; align-items: center; gap: 8px; justify-content: center; }
  .home-tile--side .home-tile-label { text-align: center; }
}
@media (max-width: 767px) {
  .home-header { height: 44px; padding: 0 12px; }
  .home-tiles { gap: 8px; padding: 8px 12px 12px; }
  .home-tile { gap: 6px; padding: 10px; border-radius: 8px; }
  .home-tile-icon { width: 32px; height: 32px; }
  .home-tile--live .home-tile-icon { width: 40px !important; height: 40px !important; }
  .home-col-main { flex: 1.5; }
  .home-col-side { flex: 1; }
}

/* ════════════════════════════════════════════════════════════
   WELCOME QUESTION SCREEN
════════════════════════════════════════════════════════════ */
.wq-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #0A0A0A;
  text-align: center;
}
.wq-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.wq-wordmark {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}
.wq-wordmark span { color: #39FF14; }
.wq-trial-badge {
  background: rgba(57,255,20,0.09);
  border: 1px solid rgba(57,255,20,0.28);
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 14px;
  font-weight: 600;
  color: #39FF14;
  margin-bottom: 24px;
}
.wq-device-card {
  display: flex;
  align-items: center;
  gap: 0;
  background: #111111;
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 36px;
}
.wq-device-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 20px;
  align-items: center;
}
.wq-device-sep {
  width: 1px;
  height: 40px;
  background: #1e1e1e;
  flex-shrink: 0;
}
.wq-device-lbl { font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 0.5px; }
.wq-device-val { font-size: 13px; font-weight: 600; font-family: monospace; color: #aaaaaa; }
.wq-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 10px; }
.wq-sub   { font-size: 16px; color: #888888; margin-bottom: 36px; }
.wq-btns  { display: flex; gap: 14px; }
.wq-btn {
  padding: 16px 36px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  font-family: inherit;
  min-width: 210px;
  outline: none;
}
.wq-btn--yes {
  background: #39FF14;
  color: #000;
  border-color: #39FF14;
}
.wq-btn--yes:hover, .wq-btn--yes:focus {
  background: #2ECC0F;
  box-shadow: 0 0 22px rgba(57,255,20,0.45);
}
.wq-btn--no {
  background: transparent;
  color: #aaaaaa;
  border-color: #2a2a2a;
}
.wq-btn--no:hover, .wq-btn--no:focus {
  border-color: #555;
  color: #ffffff;
}
@media (max-width: 600px) {
  .wq-btns { flex-direction: column; width: 100%; max-width: 320px; }
  .wq-btn  { min-width: auto; width: 100%; }
  .wq-device-card { flex-direction: column; }
  .wq-device-sep  { width: 80%; height: 1px; }
  .wq-title { font-size: 20px; }
}

/* ════════════════════════════════════════════════════════════
   QR ONLY SCREEN — brand-new user, no account
════════════════════════════════════════════════════════════ */
.qro-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 20px;
  background: #0A0A0A;
}
.qro-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.qro-wordmark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}
.qro-wordmark span { color: #39FF14; }
.qro-body {
  display: flex;
  align-items: center;
  gap: 52px;
  max-width: 820px;
  width: 100%;
}
.qro-qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.qro-qr-wrap {
  background: #111111;
  border: 1px solid #1e1e1e;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
}
.qro-qr { display: block; border-radius: 8px; }
.qro-scan-lbl { font-size: 12px; color: #555; margin-bottom: 5px; }
.qro-url { font-size: 13px; color: #39FF14; text-decoration: none; font-weight: 600; }
.qro-url:hover { text-decoration: underline; }
.qro-info-col { flex: 1; min-width: 0; }
.qro-trial-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(57,255,20,0.07);
  border: 1px solid rgba(57,255,20,0.2);
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 22px;
}
.qro-trial-icon   { font-size: 26px; flex-shrink: 0; }
.qro-trial-title  { font-size: 14px; font-weight: 700; color: #39FF14; }
.qro-trial-cd     { font-size: 13px; color: #888; margin-top: 2px; }
.qro-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.qro-title span { color: #39FF14; }
.qro-sub { font-size: 14px; color: #888; line-height: 1.6; margin-bottom: 22px; }
.qro-ids {
  background: #111111;
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.qro-id-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #181818;
}
.qro-id-row:last-child { border-bottom: none; }
.qro-id-lbl { font-size: 12px; color: #555; min-width: 94px; }
.qro-id-val { font-size: 13px; font-family: monospace; font-weight: 600; flex: 1; color: #cccccc; }
.qro-copy {
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 4px 7px;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  outline: none;
}
.qro-copy:hover, .qro-copy:focus { border-color: #39FF14; color: #39FF14; }
.qro-btn-account {
  width: 100%;
  background: #111111;
  border: 1.5px solid #2a2a2a;
  color: #ffffff;
  border-radius: 10px;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  outline: none;
}
.qro-btn-account:hover, .qro-btn-account:focus {
  border-color: #39FF14;
  color: #39FF14;
}
.qro-polling {
  margin-top: 22px;
  font-size: 12px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qro-poll-dot {
  width: 6px; height: 6px;
  background: #39FF14;
  border-radius: 50%;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .qro-body { flex-direction: column; gap: 28px; align-items: flex-start; }
  .qro-qr-col { width: 100%; align-items: center; }
  .qro-info-col { width: 100%; }
  .qro-title { font-size: 20px; }
}

/* ════════════════════════════════════════════════════════════
   SPLIT WELCOME SCREEN — returning user / has account
════════════════════════════════════════════════════════════ */
.sw-screen {
  min-height: 100vh;
  display: flex;
  background: #0A0A0A;
}
.sw-left {
  flex: 1.1;
  padding: 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}
.sw-vdivider {
  width: 1px;
  background: #1a1a1a;
  align-self: stretch;
  flex-shrink: 0;
}
.sw-right {
  flex: 0.9;
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #0d0d0d;
}
.sw-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
}
.sw-wordmark {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}
.sw-wordmark span { color: #39FF14; }
.sw-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.sw-sub   { font-size: 14px; color: #888; line-height: 1.55; margin-bottom: 22px; }
.sw-tabs {
  display: flex;
  background: #111111;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 22px;
  width: fit-content;
  gap: 2px;
}
.sw-tab {
  padding: 8px 22px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  outline: none;
}
.sw-tab--active { background: #222; color: #ffffff; }
.sw-tab:focus   { outline: 2px solid rgba(57,255,20,0.5); outline-offset: 1px; }
.sw-form { display: flex; flex-direction: column; gap: 14px; }
.sw-form--hidden { display: none; }
.sw-field { display: flex; flex-direction: column; gap: 6px; }
.sw-label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.sw-input {
  background: #111111;
  border: 1.5px solid #1e1e1e;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.sw-input:focus { border-color: #39FF14; }
.sw-error {
  display: none;
  background: rgba(255,68,68,0.1);
  border: 1px solid rgba(255,68,68,0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #ff6b6b;
  margin-top: 2px;
}
.sw-btn-connect {
  width: 100%;
  background: #39FF14;
  color: #000000;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
}
.sw-btn-connect:hover, .sw-btn-connect:focus {
  background: #2ECC0F;
  box-shadow: 0 0 22px rgba(57,255,20,0.38);
}
.sw-spinner {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(0,0,0,0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.sw-trial-hint {
  font-size: 12px;
  color: #444;
  text-align: center;
  margin-top: 10px;
}
/* Right panel */
.sw-right-hdr {
  font-size: 15px;
  font-weight: 700;
  color: #888;
  margin-bottom: 16px;
}
.sw-qr-wrap {
  background: #111111;
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.sw-qr { display: block; border-radius: 6px; }
.sw-qr-scan { font-size: 12px; color: #444; margin-bottom: 5px; }
.sw-qr-url  { font-size: 12px; color: #39FF14; text-decoration: none; font-weight: 600; word-break: break-all; }
.sw-qr-url:hover { text-decoration: underline; }
.sw-ids {
  width: 100%;
  background: #111111;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 16px;
}
.sw-id-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #161616;
  gap: 8px;
}
.sw-id-row:last-child { border-bottom: none; }
.sw-id-lbl { font-size: 11px; color: #444; min-width: 80px; text-align: left; }
.sw-id-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}
.sw-id-val { font-size: 11px; font-family: monospace; color: #777; }
.sw-copy {
  background: transparent;
  border: 1px solid #252525;
  border-radius: 5px;
  padding: 3px 5px;
  cursor: pointer;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  outline: none;
  flex-shrink: 0;
}
.sw-copy:hover, .sw-copy:focus { border-color: #39FF14; color: #39FF14; }
.sw-polling {
  font-size: 11px;
  color: #2e2e2e;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}
.sw-poll-dot {
  width: 5px; height: 5px;
  background: #39FF14;
  border-radius: 50%;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .sw-screen { flex-direction: column; }
  .sw-vdivider { width: 100%; height: 1px; align-self: auto; flex-shrink: 0; }
  .sw-left  { padding: 32px 20px; }
  .sw-right { padding: 28px 20px; background: #0A0A0A; border-top: 1px solid #1a1a1a; }
}
@media (max-width: 480px) {
  .sw-left { padding: 24px 16px; }
  .sw-right { padding: 24px 16px; }
  .sw-title { font-size: 19px; }
}
