/* ===== Mysticle Archives â€” Modern Flat Theme ===============================
   Inspired by modern video platforms. Accent: #8b5cf6 (violet)
   ========================================================================== */

:root {
  --bg-base:       #0f0f0f;
  --bg-surface:    #212121;
  --bg-card:       transparent;
  --bg-input:      #121212;
  --bg-hover:      #3d3d3d;
  --border:        #3f3f3f;
  --border-subtle: #2a2a2a;
  --accent:        #8b5cf6;
  --accent-hover:  #7c3aed;
  --accent-dim:    rgba(139, 92, 246, 0.15);
  --text-primary:  #f1f1f1;
  --text-secondary:#aaaaaa;
  --text-muted:    #71717a;
  --danger:        #ff4e45;
  --success:       #22c55e;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 4px 12px rgba(0, 0, 0, 0.5);
  --transition:    0.2s ease;
  --font:          'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-width-expanded: 240px;
  --sidebar-width-collapsed: 72px;
}

.video-ui-overlay.show {
  pointer-events: auto;
}

/* â”€â”€ Reset & Utility â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; outline: none; }
input, textarea, select { font-family: inherit; outline: none; }

.is-hidden { display: none !important; }

/* â”€â”€ Scrollbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #71717a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* â”€â”€ Typography â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }

/* â”€â”€ Layout: App Shell â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.app-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  padding-top: 64px; /* Space for fixed header */
}

/* â”€â”€ Header â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.dp-full { display: inline; }
.dp-short { display: none; }

.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1001;
  background: var(--bg-base); padding: 0 16px; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.header-left { display: flex; align-items: center; gap: 16px; min-width: 200px; }
.header-center { flex: 1; max-width: 600px; display: flex; align-items: center; }
.header-right { display: flex; align-items: center; gap: 4px; min-width: 200px; justify-content: flex-end; }

.icon-btn {
  background: transparent; border: none; color: var(--text-primary);
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: background var(--transition);
}
.icon-btn:hover { background-color: var(--bg-surface); }

.header-logo { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.header-logo .logo-icon { width: 24px; height: 24px; color: var(--accent); }
.header-logo .logo-text { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }

/* Search Bar (Pill) */
.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 40px;
  height: 40px;
  overflow: hidden;
  margin: 0 32px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-bar-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 0 80px 0 20px;
  font-size: 0.95rem;
  height: 100%;
  width: 100%;
}

.search-clear-btn {
  position: absolute;
  right: 60px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.search-clear-btn.show { opacity: 1; pointer-events: auto; }

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.search-btn {
  width: 52px;
  height: 100%;
  background: var(--bg-surface);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.search-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Avatar */
.avatar {
  width: 32px; height: 32px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
  font-weight: 600; color: #fff; cursor: pointer; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* â”€â”€ Sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.main-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width-expanded) 1fr;
  flex: 1;
  transition: grid-template-columns 0.2s ease;
}
.main-layout.collapsed { grid-template-columns: var(--sidebar-width-collapsed) 1fr; }
.sidebar-overlay { display: none; }
.sidebar {
  background: var(--bg-base);
  padding: 12px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-section { display: flex; flex-direction: column; gap: 4px; }
.sidebar-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); padding: 8px 12px; margin-top: 8px; }
.nav-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 20px;
  width: 100%; padding: 10px 12px; border: none; background: transparent;
  color: var(--text-primary); border-radius: 10px; font-size: 0.9rem; font-weight: 400;
  cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.nav-item:hover { background: var(--bg-surface); }
.nav-item.active { background: var(--bg-surface); font-weight: 600; }

.collapsed .nav-item { flex-direction: column; justify-content: center; gap: 4px; padding: 16px 0; font-size: 0.65rem; text-align: center; }
.collapsed .nav-item svg { width: 22px; height: 22px; }
.collapsed .nav-item span[data-collapsed-label] { font-size: 0; }
.collapsed .nav-item span[data-collapsed-label]::after { content: attr(data-collapsed-label); font-size: 0.65rem; }
.collapsed .sidebar-title, .collapsed .sidebar-divider { display: none; }

/* FIX: Sidebar dividers visible */
.sidebar-divider { display: block; height: 1px; background: var(--border); width: 100%; margin: 12px 0; flex-shrink: 0; }

/* â”€â”€ Notifications & Dropdowns â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.notif-container { position: relative; }

.notif-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: -10px;
  width: 320px;
  background: rgba(25, 25, 25, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 1100;
  overflow: hidden;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-dropdown.show { display: block; }

.notif-header {
  padding: 16px 0;
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
}

.notif-list { max-height: 400px; overflow-y: auto; }

.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  align-items: flex-start;
  position: relative;
}

.notif-item:hover { background: rgba(255, 255, 255, 0.05); }
.notif-item.unread { background: rgba(255, 255, 255, 0.03); }
.notif-item.unread.is-reply { background: rgba(139, 92, 246, 0.06); }

.notif-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--bg-hover);
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.notif-type.reply {
  background: var(--accent);
  color: #fff;
}

.notif-type-row {
  margin-bottom: 6px;
}

.notif-item.unread .notif-time {
  color: var(--accent);
  font-weight: 600;
}

.notif-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.notif-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notif-content { flex: 1; min-width: 0; }
.notif-content p {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-primary);
  margin: 0;
}

.notif-message {
  margin-top: 2px;
}

.notif-content strong { color: #fff; }

.notif-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.unread-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: 6px;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-base);
}

/* â”€â”€ User Dropdown â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.user-menu-container { position: relative; margin-left: 8px; }
.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 260px;
  background: rgba(25, 25, 25, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  padding: 8px;
  display: none;
  z-index: 1000;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown.show { display: block; }

.dropdown-user-info {
  padding: 16px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.dropdown-role {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-role.role-admin {
  color: var(--accent);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, transform 0.1s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.dropdown-item#logout-btn {
  color: var(--danger);
}

.dropdown-item#logout-btn:hover {
  background: rgba(255, 78, 69, 0.1);
}

/* â”€â”€ Main Content â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.main-content {
  padding: 0 24px 40px 24px;
  background: var(--bg-base);
}

/* Chips Bar */
.chip-bar {
  display: flex; gap: 12px; padding: 16px 0;
  background-color: rgba(15, 15, 15, 0.95); backdrop-filter: blur(10px);
  z-index: 10; border-bottom: 1px solid transparent; overflow-x: auto;
  -ms-overflow-style: none; scrollbar-width: none;
}
.chip-bar::-webkit-scrollbar { display: none; }
.chip {
  background-color: var(--bg-surface); color: var(--text-primary); border: none;
  padding: 8px 16px; border-radius: 8px; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background 0.2s, color 0.2s;
}
.chip:hover { background-color: var(--bg-hover); }
.chip.active { background-color: var(--text-primary); color: var(--bg-base); }

/* Toolbar / Section Header */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 16px 0; }
.toolbar h2 { font-size: 1.25rem; font-weight: 700; }
.toolbar p { display: none; } 

.sort-menu-container {
  position: relative;
  display: inline-block;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}

.sort-btn svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.sort-btn:hover {
  background-color: var(--bg-surface);
}

.sort-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: var(--bg-surface);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1200;
  padding: 6px 0;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.sort-menu.show {
  display: block;
  animation: sortFadeIn 0.15s ease-out;
}

@keyframes sortFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.sort-option {
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: left;
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s;
}

.sort-option:hover {
  background: var(--bg-hover);
}

.sort-option.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.section-count { display: none; }

/* â”€â”€ Video Grid & Flat Video Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.view-shell { display: block; }
.people-view, .series-view { display: none; }
.people-view:not(.is-hidden), .series-view:not(.is-hidden) { display: block; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  row-gap: 24px;
  grid-auto-rows: auto;
}
.video-grid > .series-selected-layout,
.video-grid > .history-date-section { 
  grid-column: 1 / -1; 
  width: 100%;
}

.history-date-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.history-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.history-date-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.history-date-header span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.history-date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  row-gap: 20px;
  grid-auto-rows: auto;
}

@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  .history-date-grid {
    grid-template-columns: 1fr;
  }
}

.video-card {
  display: flex; flex-direction: column; gap: 12px; background: transparent;
  border: none; border-radius: 0; cursor: pointer; text-decoration: none; color: inherit;
  height: 100%;
  transition: background 0.2s;
}
.card-thumb {
  position: relative; width: 100%; aspect-ratio: 16/9; background: var(--bg-surface);
  border-radius: 12px; overflow: hidden; transition: box-shadow 0.2s ease;
}
.video-card.selected .card-thumb {
  box-shadow: 0 0 0 2px rgba(186, 85, 255, 0.98), 0 0 18px rgba(186, 85, 255, 0.5);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.video-card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb .hover-preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
  opacity: 0; animation: hover-preview-fadein 0.4s ease forwards;
  pointer-events: none;
}
@keyframes hover-preview-fadein { to { opacity: 1; } }

.card-duration, .card-views-badge {
  position: absolute; bottom: 8px; right: 8px; background: rgba(0, 0, 0, 0.8);
  color: #fff; padding: 3px 6px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.5px;
}
.card-views-badge { left: 8px; right: auto; background: var(--danger); display: none; }

.card-favorite-btn, .card-admin-btn {
  position: absolute; top: 8px; width: 32px; height: 32px; background: rgba(0, 0, 0, 0.6);
  color: #fff; border: none; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; z-index: 10; opacity: 0; transition: opacity 0.2s; cursor: pointer;
}
.card-favorite-btn { left: 8px; }
.card-admin-btn { right: 8px; }
.video-card:hover .card-favorite-btn, .video-card:hover .card-admin-btn { opacity: 1; }
.card-favorite-btn.active { opacity: 1; color: var(--danger); background: var(--bg-surface); }

/* Card Body / Meta (Horizontal YT Layout) */
.card-body {
  padding: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

.card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-hover);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}

.card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.card-channel {
  display: none;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta .meta-dot {
  font-size: 0.8rem;
  line-height: 1;
}

.card-category { display: none; }
.card-progress-container { position: absolute; bottom: 0; left: 0; width: 100%; height: 4px; background: rgba(255,255,255,0.2); }
.card-progress-bar { height: 100%; background: var(--danger); }

/* â”€â”€ People / Series Views (Flat Modern UI) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }

.person-chip {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  text-align: left;
}

.person-chip:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.5);
  border-color: var(--border);
}

.person-chip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

.person-chip-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.person-chip-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.person-chip:hover .person-chip-bg img {
  transform: scale(1.05);
}

.person-chip-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-hover);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.person-chip:hover .person-chip-fallback {
  transform: scale(1.05);
  color: var(--text-secondary);
}

.person-chip-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  z-index: 2;
}

.person-chip-copy {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.person-chip-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.person-chip-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

/* FIX: Series Grid Stacking Logic */
.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px 24px; }
/* Modern Series (Playlist) Cards */
.series-card-modern {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: none;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  text-align: left;
}

.series-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.scm-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-hover);
  overflow: hidden;
}

.scm-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.series-card-modern:hover .scm-thumb {
  transform: scale(1.05);
}

.scm-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.scm-admin-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
  pointer-events: none;
}

.series-card-modern:hover .scm-admin-btn {
  opacity: 1;
  pointer-events: auto;
}

.scm-admin-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.05);
}

.scm-body {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 4px;
}

.scm-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scm-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* â”€â”€ Selected Series (Playlist Layout) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.series-selected-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-areas:
    "hero hero"
    "feature playlist";
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}
@media (max-width: 1024px) {
  .series-selected-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "feature"
      "playlist";
  }
}

.series-selected-hero { display: flex; flex-direction: column; gap: 8px; }
.series-selected-layout > .series-selected-hero { grid-area: hero; }
.series-selected-eyebrow { font-size: 0.8rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.series-selected-hero h3 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.series-selected-hero p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; margin: 0; }

.series-feature-card { display: flex; flex-direction: column; gap: 16px; cursor: pointer; border: none; background: transparent; text-align: left; }
.series-selected-layout > .series-feature-card { grid-area: feature; }
.series-feature-media { width: 100%; border-radius: 20px; overflow: hidden; background: var(--bg-surface); aspect-ratio: 16/9; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); transition: transform 0.2s, box-shadow 0.2s; }
.series-feature-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.series-feature-card:hover .series-feature-media { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2); }
.series-feature-card:hover .series-feature-media img { transform: scale(1.03); }
.series-feature-copy { padding: 8px 0; }
.series-feature-copy h4 { font-size: 1.1rem; font-weight: 600; margin: 0 0 4px 0; color: var(--text-primary); }
.series-feature-copy p { font-size: 0.9rem; color: var(--text-secondary); margin: 0; }

.series-playlist-panel { background: var(--bg-surface); border-radius: 20px; padding: 24px 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; max-height: calc(100vh - 100px); overflow: hidden; border: none; }
.series-selected-layout > .series-playlist-panel { grid-area: playlist; }
.series-playlist-head { display: flex; justify-content: space-between; align-items: center; padding: 0 24px; }
.series-playlist-head h4 { font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--text-primary); }
.series-playlist-head span { font-size: 0.85rem; color: var(--text-secondary); }
.series-playlist-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; padding: 0 16px 16px 16px; }
.series-playlist-item { display: grid; grid-template-columns: 24px 120px 1fr; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; cursor: pointer; transition: background 0.2s, transform 0.2s; border: none; background: transparent; text-align: left; }
.series-playlist-item:hover { background: var(--bg-hover); transform: translateX(4px); }
.series-playlist-item.selected { background: rgba(139, 92, 246, 0.15); }
.series-playlist-index { font-size: 0.85rem; color: var(--text-secondary); text-align: center; font-weight: 500; }
.series-playlist-thumb-wrap { width: 100%; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #000; position: relative; }
.series-playlist-thumb { width: 100%; height: 100%; object-fit: cover; }
.series-playlist-duration { position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,0.8); color: #fff; font-size: 0.7rem; padding: 2px 4px; border-radius: 4px; font-weight: 600; }
.series-playlist-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.series-playlist-copy h4 { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.series-playlist-copy p { font-size: 0.8rem; color: var(--text-secondary); margin: 0; }

/* â”€â”€ Generic App Components â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.mobile-icon { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: 20px; border: none; font-size: 0.875rem;
  font-weight: 500; transition: background var(--transition), color var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-surface); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger-dim); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.form-group { margin-bottom: 16px; text-align: left; width: 100%; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input { width: 100%; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 0.95rem; transition: all 0.2s; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15); outline: none; }

/* Modern Select Dropdowns */
select.form-input {
  cursor: pointer;
}

select.form-input:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

select.form-input:not([multiple]):hover {
  border-color: var(--text-muted);
}

/* Modern Multi-Select */
select.form-input[multiple] {
  padding: 8px;
  background: var(--bg-input);
  scrollbar-width: thin;
}

select.form-input[multiple] option {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 2px;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

select.form-input[multiple] option:hover {
  background: rgba(255, 255, 255, 0.05);
}

select.form-input[multiple] option:checked {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}

/* â”€â”€ Glass Custom Drop-up â”€â”€ */
.glass-select {
  position: relative;
  display: inline-block;
}

.glass-select-trigger {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 36px 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  height: 36px;
  min-width: 160px;
  text-align: left;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
}

.glass-select-trigger::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  opacity: 0.6;
}

.glass-select-trigger:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.glass-select-menu {
  position: absolute;
  left: 0;
  width: 220px;
  background: rgba(25, 25, 25, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 8px;
  display: none;
  z-index: 1600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.glass-select-menu.drop-up {
  bottom: calc(100% + 12px);
  animation: dropUpIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropUpIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.glass-select-menu.show {
  display: flex;
  flex-direction: column;
}

.glass-menu-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px 4px;
  letter-spacing: 1px;
}

.glass-option {
  background: transparent;
  border: none;
  color: #fff;
  padding: 10px 12px;
  font-size: 0.88rem;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.glass-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

/* â”€â”€ People Picker Flyout (2026 UX) â”€â”€ */
.people-picker-wrap { position: relative; }

.people-flyout {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 320px;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 16px 0;
  display: none;
  z-index: 1600;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  flex-direction: column;
  gap: 12px;
}

.people-flyout.show {
  display: flex;
  animation: dropUpIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.flyout-header {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 1px;
}

.flyout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.flyout-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.flyout-item:hover { background: rgba(255, 255, 255, 0.05); }

.flyout-item.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.flyout-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-hover);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}

.flyout-avatar img { width: 100%; height: 100%; object-fit: cover; }

.flyout-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.flyout-item.active .flyout-name { color: #fff; }

.flyout-empty {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin: 0;
}

.glass-select-trigger.has-selection {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* â”€â”€ Contextual Floating Action Bar (2026 UX) â”€â”€ */
.bulk-action-bar {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  min-width: 0;
  max-width: 90vw;
  background: rgba(25, 25, 25, 0.9);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  z-index: 1500;
  animation: slideUpIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpIn {
  from { opacity: 0; transform: translate(-50%, 40px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.bulk-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.bulk-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s;
}
.bulk-close-btn:hover { background: rgba(255, 78, 69, 0.1); color: var(--danger); }

.bulk-count {
  font-weight: 700;
  color: #fff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.bulk-bar-center {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 10px;
}

.bulk-action-bar.has-target .bulk-bar-center {
  gap: 12px;
}

.bulk-select-mini,
.bulk-input-mini {
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  height: 36px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  color: #fff !important;
  width: auto !important;
  min-width: 140px;
  cursor: pointer;
}

/* Fix visibility for the options list */
.bulk-select-mini option,
.bulk-select-mini optgroup {
  background-color: #1a1a1a;
  color: #fff;
  padding: 8px;
}

.bulk-select-mini optgroup {
  font-weight: 700;
  color: var(--accent);
  font-style: normal;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Modern Multi-select Specific Fix for Bulk Bar */
select.bulk-select-mini[multiple] {
  height: auto !important;
  min-height: 36px;
  border-radius: 12px !important;
  padding: 4px !important;
}

.bulk-target-area { display: flex; align-items: center; gap: 8px; }

.bulk-bar-right {
  padding-left: 10px;
}

@media (max-width: 768px) {
  .bulk-action-bar {
    bottom: 16px;
    width: calc(100% - 32px);
    min-width: 0;
    flex-direction: column;
    border-radius: 20px;
    padding: 16px 0;
    gap: 16px;
  }
  .bulk-bar-left {
    border-right: none;
    padding: 0;
    width: 100%;
    justify-content: space-between;
  }
  .bulk-bar-center {
    flex-direction: column;
    width: 100%;
    padding: 0;
  }
  .glass-select,
  .glass-select-trigger,
  .bulk-select-mini,
  .bulk-input-mini { width: 100% !important; }
  .bulk-target-area { width: 100%; }
  .people-flyout {
    width: min(320px, calc(100vw - 48px));
  }
}

/* Watch Page Specific */
/* FIX: Watch Page Layout (YT Style) */
.watch-layout { 
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; 
  align-items: start; max-width: 1600px; margin: 0 auto; 
}
@media (max-width: 1100px) { .watch-layout { grid-template-columns: 1fr; } }

.watch-main-col { display: flex; flex-direction: column; }

.player-container {
  width: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  aspect-ratio: 16 / 9;
}

.player-container .video-js {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: inherit;
}

.player-container .video-js video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.watch-sidebar-col {
  display: flex; flex-direction: column; gap: 24px; 
  position: sticky; top: 0;
}

@media (max-width: 1100px) {
  .watch-sidebar-col { position: static; top: auto; }
}

/* Video Info & Meta */
.video-info { margin-top: 0; display: flex; flex-direction: column; gap: 12px; }

.video-info-title {
  font-size: 1.3rem; font-weight: 700; margin: 0; line-height: 1.4; color: var(--text-primary);
  display: inline;
}

/* Live Status Badges */
.badge-live, .badge-live-archive {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; line-height: 1; height: 20px; vertical-align: middle;
}
.badge-live { background: #ff0000; color: #fff; }
.badge-live::before {
  content: ''; width: 6px; height: 6px;
  background: #fff; border-radius: 50%;
  animation: live-pulse 1.5s infinite;
}
.badge-live-archive {
  background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent);
}
@keyframes live-pulse {
  0%   { opacity: 1; transform: scale(1); }
  50%  { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* Author / Owner Row */
.video-owner-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}

.owner-left { display: flex; align-items: center; gap: 10px; }

.owner-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0; overflow: hidden;
}
.owner-avatar img { width: 100%; height: 100%; object-fit: cover; }

.owner-meta { display: flex; flex-direction: column; }
.owner-name { font-weight: 600; font-size: 0.95rem; color: var(--text-primary); }
.owner-sub-count { font-size: 0.78rem; color: var(--text-secondary); }

/* Action Buttons */
.video-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.btn-action {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-surface); border: none; color: var(--text-primary);
  padding: 8px 16px; border-radius: 20px; font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
}
.btn-action:hover { background: var(--bg-hover); }

.btn-action.icon-only {
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  justify-content: center;
}

.btn-action.favorite-active { color: var(--danger); background: var(--danger-dim); }

.watch-admin-dropdown-wrap { position: relative; }
.watch-admin-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 220px;
  background: rgba(25, 25, 25, 0.95); backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); padding: 8px; display: none; z-index: 1105;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: min(220px, calc(100vw - 32px));
}
.watch-admin-menu.show { display: block; }

@media (max-width: 1280px) {
  .watch-admin-menu {
    right: 0;
    left: auto;
  }
}

@media (max-width: 768px) {
  .notif-dropdown {
    right: 0;
    width: min(320px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
  }

  .user-dropdown {
    right: 0;
    left: auto;
    width: min(260px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
  }

  .watch-admin-menu {
    right: 0;
    left: auto;
    max-width: calc(100vw - 16px);
  }
}

/* Description Box */
.description-box {
  background: var(--bg-surface); border-radius: 12px; padding: 14px 16px;
  font-size: 0.9rem; line-height: 1.5;
}

.description-meta {
  font-weight: 700; color: var(--text-primary);
  margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}

.meta-tag {
  background: rgba(255,255,255,0.08); padding: 2px 8px; border-radius: 4px;
  font-size: 0.75rem; color: var(--text-secondary); font-weight: 500;
}

.description-text { color: var(--text-secondary); white-space: pre-line; }

@media (max-width: 600px) {
  .video-owner-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .video-actions {
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 6px;
  }
}

/* ==========================================================================
   PEOPLE SPOTLIGHT (WATCH PAGE)
   ========================================================================== */
.video-people-tags {
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.people-tags-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.people-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.person-tag-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  padding: 6px 14px 6px 6px;
  border-radius: 30px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.person-tag-chip:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.person-tag-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.person-tag-chip .chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-base);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.person-tag-chip .chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-tag-chip .chip-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.person-spotlight-card {
  margin-top: 12px;
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 12px 14px;
  display: none;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border-subtle);
  animation: slideInUp 0.2s ease-out;
}

.person-spotlight-card.show {
  display: flex;
}

.spotlight-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--accent-dim);
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.spotlight-avatar img { width: 100%; height: 100%; object-fit: cover; }

.spotlight-info { flex: 1; min-width: 0; }

.spotlight-name {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.spotlight-bio {
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spotlight-actions { margin-top: 8px; }

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#spotlight-view-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  line-height: 1;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

#spotlight-view-btn:hover {
  background: var(--accent-hover);
}

@media (max-width: 600px) {
  .person-spotlight-card.show { flex-direction: column; gap: 12px; }
  .spotlight-avatar { width: 40px; height: 40px; font-size: 0.95rem; }
}

/* ==========================================================================
   COMMENTS & THREADS (MODERN FLAT)
   ========================================================================== */
.comments-panel { margin-top: 32px; border-top: 1px solid var(--border-subtle); padding-top: 24px; }

.comment-form { display: flex; gap: 16px; margin-bottom: 32px; align-items: flex-start; }
.comment-form .avatar { width: 40px; height: 40px; flex-shrink: 0; }
.comment-form-group { flex: 1; display: flex; flex-direction: column; gap: 8px; }

.comment-form textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 0;
  width: 100%;
  color: #fff;
  resize: none;
  font-size: 0.95rem;
  transition: border-bottom 0.2s;
}
.comment-form textarea:focus { border-bottom: 2px solid var(--text-primary); outline: none; }

.comment-item {
  --comment-avatar-size: 40px;
  --comment-avatar-gap: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--comment-avatar-gap);
  margin-bottom: 24px;
  position: relative;
}

.comment-item.has-replies-toggle {
  padding-bottom: 2px;
}

.comment-avatar {
  width: var(--comment-avatar-size);
  height: var(--comment-avatar-size);
  border-radius: 50%;
  background: var(--bg-hover);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }

.comment-content-wrap { flex: 1 1 0; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-author { font-weight: 700; font-size: 0.85rem; color: var(--text-primary); }
.comment-date { font-size: 0.75rem; color: var(--text-secondary); }
.comment-edited { font-style: italic; opacity: 0.6; }

.comment-text { font-size: 0.95rem; color: var(--text-primary); line-height: 1.4; white-space: pre-line; word-wrap: break-word; }

.comment-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.comment-actions > .comment-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  gap: 4px;
  flex: 0 0 auto;
}

.comment-actions > .comment-btn.comment-btn-icon {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0;
}

.comment-actions > .comment-btn.reaction-btn,
.comment-actions > .comment-btn.heart-btn {
  min-width: 32px;
  padding: 0 6px;
}

#comment-form-actions {
  align-items: center;
}

#comment-form-actions .btn,
#comment-form-actions .comment-btn {
  min-height: 32px;
}

#comment-gif-btn {
  transform: translate(-5px, 4px);
}

#comment-form-actions .comment-btn svg {
  flex-shrink: 0;
}

.comment-btn,
.comment-btn-sm {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 18px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
}

.comment-btn:hover { background: var(--bg-surface); }

.comment-btn-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.comment-actions > .comment-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.comment-actions > .comment-btn span:empty {
  display: none;
  width: 0;
  padding: 0;
  margin: 0;
}

.comment-btn-icon.danger:hover {
  color: var(--danger);
  background: rgba(255, 78, 69, 0.1);
}

.comment-btn.active.reaction-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.comment-btn.active.heart-btn {
  color: #ff4e45;
  background: rgba(255, 78, 69, 0.1);
}

.comment-btn-sm {
  padding: 4px 8px;
  font-weight: 500;
  opacity: 0.5;
}

.comment-btn-sm:hover {
  opacity: 1;
  background: var(--bg-hover);
}

.comment-btn-sm.danger:hover {
  color: var(--danger);
  background: rgba(255, 78, 69, 0.1);
}

.comment-replies {
  margin-left: 18px;
  position: relative;
  margin-top: 2px;
}

.comment-replies.is-collapsed {
  display: none;
}

.comment-replies-branch {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  margin-top: 4px;
  padding-left: 18px;
  min-height: 32px;
  position: relative;
  z-index: 1;
}

.comment-item.has-replies-toggle > .comment-replies-connector {
  position: absolute;
  left: calc(var(--comment-avatar-size) / 2 - 1px);
  top: var(--comment-avatar-size);
  width: 16px;
  height: 0;
  color: rgba(255, 255, 255, 0.32);
  pointer-events: none;
  z-index: 0;
}

.comment-item.has-replies-toggle > .comment-avatar,
.comment-item.has-replies-toggle > .comment-content-wrap,
.comment-item.has-replies-toggle > .comment-replies-branch {
  position: relative;
  z-index: 1;
}

.comment-replies-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 18px;
  transition: background 0.2s, color 0.2s;
  line-height: 1.2;
  margin-left: 8px;
}

.comment-replies-toggle:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.comment-reply-target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.comment-reply-target #comment-reply-label {
  flex: 1 1 auto;
  min-width: 0;
}

/* â”€â”€ GIF Picker (2026 Modern) â”€â”€ */
.gif-picker-modal {
  max-width: 480px;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  background: rgba(25, 25, 25, 0.9) !important;
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.gif-picker-modal .modal-header {
  padding: 20px 24px 12px;
  margin-bottom: 0;
}

.gif-picker-search-wrap {
  padding: 0 16px 16px;
}

.gif-picker-search-wrap .search-bar-wrapper {
  margin: 0;
  background: var(--bg-base);
}

.gif-picker-content {
  flex: 1;
  overflow-y: auto;
  min-height: 300px;
  max-height: 450px;
  padding: 0;
  scrollbar-width: thin;
}

.gif-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gif-picker-item {
  position: relative;
  aspect-ratio: 1;
  border: none;
  background: var(--bg-hover);
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gif-picker-item:hover {
  transform: scale(0.96);
  z-index: 2;
}

.gif-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gif-picker-footer {
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
}

.gif-attribution {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gif-attribution strong {
  color: var(--text-secondary);
}

/* Selected Preview in Comment Form */
.comment-gif-preview {
  position: relative;
  margin-top: 12px;
  width: fit-content;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  line-height: 0;
}

.comment-gif-preview img {
  max-height: 160px;
  display: block;
}

@media (max-width: 600px) {
  .comment-item {
    --comment-avatar-size: 32px;
    --comment-avatar-gap: 12px;
  }
  .comment-item.has-replies-toggle > .comment-replies-connector {
    left: calc(var(--comment-avatar-size) / 2 - 1px);
    width: 12px;
  }
  .comment-text { font-size: 0.9rem; }
  .comment-reply-target {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Up Next / Mini Cards */
.up-next-panel { display: flex; flex-direction: column; gap: 12px; }
.mini-card { display: flex; gap: 12px; cursor: pointer; text-decoration: none; color: inherit; padding: 4px; border-radius: 8px; transition: background 0.2s;}
.mini-card:hover { background: var(--bg-surface); }
.mini-thumb { width: 168px; aspect-ratio: 16/9; border-radius: 8px; background: var(--bg-surface); flex-shrink: 0; overflow: hidden; position: relative;}
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.mini-card:hover .mini-thumb img { transform: scale(1.05); }
.mini-title { font-size: 0.9rem; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-primary); margin-bottom: 4px; }
.mini-meta { font-size: 0.8rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 2px; }

/* â”€â”€ Admin People Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.people-management-grid,
.people-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.person-admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.person-admin-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.person-card-cover {
  height: 156px;
  background: linear-gradient(to bottom, var(--accent-dim), transparent);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.person-card-avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 4px solid var(--bg-surface);
  background: var(--bg-hover);
  overflow: hidden;
  margin-bottom: -54px;
  z-index: 2;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.person-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-card-avatar-fallback {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-muted);
}

.person-card-body {
  padding: 66px 16px 16px 16px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.person-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.person-card-link {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.person-card-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 20px;
}

.person-card-footer {
  padding: 10px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.person-card-footer .btn {
  border-radius: 8px;
  font-size: 0.8rem;
}

/* â”€â”€ Admin Tables & Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

.admin-nav {
  padding: 16px 0;
  background: var(--bg-base);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.admin-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.admin-nav-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.admin-nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.admin-content {
  padding: 32px;
  overflow-y: auto;
  background: #0a0a0a;
}

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  padding: 24px 0;
  margin-bottom: 24px;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.table-wrapper {
  overflow-x: auto;
  margin: 0 -24px;
}



.scan-status-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0 24px;
}

.scan-stat {
  background: var(--bg-base);
  padding: 16px 20px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border-subtle);
}

.scan-stat span { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.scan-stat strong { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.scan-stat.danger strong { color: var(--danger); }

.form-input.search-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  width: 220px;
  border-radius: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* User Role Badges */
.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-admin {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-viewer {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.section-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-desc {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.series-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.series-admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.series-admin-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.series-card-cover {
  padding: 16px 16px 0;
  background: linear-gradient(to bottom, rgba(139, 92, 246, 0.1), transparent);
}

.series-card-cover .empty-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-radius: 12px;
}

.series-card-body {
  padding: 16px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.series-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.series-card-meta {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.series-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}

.series-card-footer {
  padding: 10px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.series-card-footer .btn {
  border-radius: 8px;
  font-size: 0.8rem;
  padding: 6px;
}

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 24px; border-bottom: 1px solid var(--border-subtle); color: var(--text-muted); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; background: rgba(255,255,255,0.02); }
td { padding: 14px 24px; border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); font-size: 0.875rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* â”€â”€ Modals & Toasts â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: #1a1a1a;
  padding: 32px;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  transform: scale(0.95);
  transition: transform 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 48px rgba(0,0,0,0.8);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h3 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.modal-footer .btn { border-radius: 10px; padding: 10px 20px; font-weight: 600; }

/* --- 2026 Modern User Dialogues --- */
.dialog-modal {
  max-width: 500px;
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
  animation: dialogPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 600px) {
  .dialog-modal,
  .modal {
    max-width: 98vw;
    padding: 12px;
    border-radius: 12px;
    max-height: 96vh;
  }
  .modal-footer,
  .modal-footer.dialog-footer {
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    margin-top: 16px;
  }
}

@keyframes dialogPop {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

#dialog-title,
#dialog-preview-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(to right, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#dialog-body,
#dialog-preview-body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.dialog-intro {
  font-size: 1.02rem;
  color: var(--text-primary);
  font-weight: 500;
  margin: 0 0 12px 0;
}

.dialog-paragraph {
  margin: 0 0 10px 0;
}

.dialog-paragraph:last-child {
  margin-bottom: 0;
}

.dialog-lang-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.dialog-lang-toggle button {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border: none;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s;
}

.dialog-lang-toggle button.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dialog-lang-toggle button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.modal-footer.dialog-footer {
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
}

.dialog-footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#dialog-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* â”€â”€ Video Admin Popup (Manage Menu) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.vap-modal { max-width: 540px; }
.vap-body { display: flex; flex-direction: column; gap: 24px; max-height: 60vh; overflow-y: auto; margin-bottom: 24px; padding-right: 8px; }
.vap-section { display: flex; flex-direction: column; gap: 12px; }
.vap-section-header-row { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.02); padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-subtle); }
.vap-section-title { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); margin: 0 0 4px 0; }
.vap-hint { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }

.vap-users-section { padding: 16px 0; background: var(--bg-surface); border-radius: 12px; border: 1px solid var(--border-subtle); transition: opacity 0.2s; }
.vap-subsection-label { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin: 0 0 12px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.vap-users-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; padding-right: 8px; }
.vap-user-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; border-radius: 8px; transition: background 0.2s; }
.vap-user-row:hover { background: rgba(255,255,255,0.05); }
.vap-user-row input { cursor: pointer; accent-color: var(--accent); width: 16px; height: 16px; }
.vap-user-row-info { display: flex; flex-direction: column; }
.vap-user-row-name { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }
.vap-user-row-handle { font-size: 0.75rem; color: var(--text-muted); }

.vap-people-list { display: flex; flex-direction: column; gap: 8px; max-height: 250px; overflow-y: auto; padding-right: 8px; margin-bottom: 8px; }
.vap-person-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-surface); border-radius: 10px; border: 1px solid var(--border-subtle); }
.vap-person-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-dim); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.vap-person-img { width: 100%; height: 100%; object-fit: cover; }
.vap-person-initial { font-weight: 700; font-size: 0.9rem; color: var(--accent); }
.vap-person-name { flex: 1; font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }

.vap-person-select { margin-bottom: 4px; font-size: 0.9rem; padding: 10px 14px; }
.vap-divider { height: 1px; background: var(--border-subtle); margin: 4px 0; }
.vap-empty { font-size: 0.85rem; color: var(--text-muted); text-align: center; padding: 16px 0; margin: 0; font-style: italic; }

.btn-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; background: transparent; color: var(--text-primary); cursor: pointer; border-radius: 6px; transition: background 0.2s, color 0.2s; }
.btn-icon:hover { background: var(--bg-hover); }

#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--bg-surface); color: var(--text-primary); padding: 12px 16px; border-radius: 8px; box-shadow: var(--shadow); pointer-events: auto; border-left: 4px solid var(--accent); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

/* â”€â”€ Series Order Editor (Playlist Reordering) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.series-order-modal { max-width: 600px; }
.series-order-list { display: flex; flex-direction: column; gap: 8px; }
.series-order-item {
  display: grid; grid-template-columns: 36px 60px 1fr auto; gap: 12px; align-items: center;
  padding: 12px; background: var(--bg-base); border-radius: 8px; border: 2px solid transparent;
  cursor: move; transition: all 0.2s; user-select: none;
}
.series-order-item:hover { background: var(--bg-surface); border-color: var(--border-subtle); }
.series-order-item.drag-over { background: var(--bg-surface); border-color: var(--accent); }
.series-order-item.is-dragging { opacity: 0.5; cursor: grabbing; }
.series-order-item-index {
  font-weight: 600; font-size: 0.9rem; color: var(--text-secondary);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-hover); border-radius: 6px;
}
.series-order-item-thumb {
  width: 60px; height: 60px; border-radius: 6px; overflow: hidden;
  background: var(--bg-hover); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.series-order-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--bg-hover); color: var(--text-secondary);
}
.series-order-item-title {
  margin: 0; font-size: 0.9rem; font-weight: 500; color: var(--text-primary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.series-order-item-actions {
  display: flex; gap: 6px; align-items: center;
}
.series-order-item-actions .btn { border-radius: 6px; padding: 4px 8px; font-size: 0.75rem; }

/* â”€â”€ Missing states for JS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.history-date-section { grid-column: 1 / -1; margin-bottom: 16px; }
.history-date-header { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 16px; }
.history-date-header h3 { color: var(--text-secondary); font-size: 1rem; }
.history-date-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; row-gap: 40px; }
.state-loading, .state-empty { grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--text-secondary); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; grid-column: 1 / -1; }
.page-btn { background: var(--bg-surface); border: none; color: var(--text-primary); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.page-btn.active { background: var(--text-primary); color: var(--bg-base); font-weight: 600; }
.page-btn:hover:not(.active) { background: var(--bg-hover); }

/* Responsive adjustments */
@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .header-search { display: none; }
  .header-left { min-width: 0; gap: 4px; }
  .header-right { min-width: 0; gap: 2px; }

  /* Mobile: header hides on scroll-down, shows on scroll-up */
  .header {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .header.header--hidden {
    transform: translateY(-100%);
  }

  .header-logo .logo-text { display: none; }
  .search-bar-wrapper { margin: 0 4px; }
  .search-bar-wrapper input { padding-left: 12px; padding-right: 28px; font-size: 0.9rem; }
  .search-clear-btn {
    right: 44px;
    width: 24px;
    height: 24px;
  }
  .search-btn { width: 44px; }
  .dp-full { display: none; }
  .dp-short { display: inline; }
  .video-grid { grid-template-columns: 1fr; }
  .series-grid { grid-template-columns: 1fr; }
  
  .directory-hero { padding: 24px 20px; }
  .series-hero-actions { flex-wrap: wrap; }
  .series-hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .mobile-icon { display: inline-block; }
  .desktop-text { display: none; }
  .series-playlist-item { grid-template-columns: 80px 1fr; gap: 12px; }
  .series-playlist-index { display: none; }
  
  .main-content { padding: 0 16px calc(76px + env(safe-area-inset-bottom, 12px)) 16px; }
  .admin-container { grid-template-columns: 1fr; }
  .admin-nav { position: static; height: auto; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border-subtle); padding: 8px 12px; gap: 4px; }
  .admin-nav-group { flex-direction: row; gap: 2px; }
  .admin-nav-item { white-space: nowrap; padding: 8px 12px; gap: 8px; font-size: 0.85rem; }
  .admin-nav-item span { display: none; }
  .sidebar-divider { display: none; }
  .admin-content { padding: 16px 0; }
  .scan-status-container { grid-template-columns: repeat(2, 1fr); }
  .section-header { align-items: center; }
  .section-title { font-size: 1.1rem; }
  .series-admin-grid { grid-template-columns: 1fr; }
  .chip-bar { padding: 14px; margin: 0 -16px; }
  .toolbar { margin-top: 10px; }


  .people-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }

  .main-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  .sidebar {
      position: fixed;
      top: auto;
      left: 0;
      bottom: 0;
      width: 100%;
      height: calc(60px + env(safe-area-inset-bottom, 12px));
      padding: 0;
      padding-bottom: env(safe-area-inset-bottom, 12px);
    z-index: 1000;
    background: var(--bg-base);
    transform: none;
    transition: none;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--border);
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sidebar::-webkit-scrollbar {
    display: none;
  }
  
  .sidebar-section {
    flex-direction: row;
    gap: 0;
    height: 100%;
  }

  .nav-item {
    flex-direction: column;
    gap: 4px;
    padding: 6px 16px;
    border-radius: 0;
    justify-content: center;
    font-size: 0.65rem;
    height: 100%;
  }

  .nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
  }

  .sidebar-divider, .sidebar-title, #sidebar-toggle {
    display: none !important;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: block;
  }

  .sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }

  .main-content {
    padding: 0 16px calc(76px + env(safe-area-inset-bottom, 12px)) 16px;
    width: 100%;
    flex: 1 1 auto;
  }

  .main-layout.collapsed {
    grid-template-columns: 1fr;
  }

  /* Reset collapsed nav styles â€” sidebar is always full-width drawer on mobile */
  .main-layout.collapsed .nav-item {
    flex-direction: row; justify-content: flex-start; gap: 20px;
    padding: 10px 12px; font-size: 0.9rem; text-align: left;
  }
  .main-layout.collapsed .nav-item svg { width: 22px; height: 22px; }
  .main-layout.collapsed .nav-item span[data-collapsed-label] { font-size: inherit; }
  .main-layout.collapsed .nav-item span[data-collapsed-label]::after { content: none; }
  .main-layout.collapsed .sidebar-title,
  .main-layout.collapsed .sidebar-divider { display: block; }
}

/* ==========================================================================
   1. SIDEBAR DIVIDERS & POLISH
   ========================================================================== */
.sidebar-divider { 
  display: block; height: 1px; background: var(--border); 
  width: 100%; margin: 12px 0; flex-shrink: 0; transition: width 0.2s;
}
/* Keep a small divider when collapsed instead of hiding it entirely */
.collapsed .sidebar-divider { width: 32px; margin: 12px auto; }

/* ==========================================================================
   2. YOUTUBE-STYLE VIDEO.JS SKIN
   ========================================================================== */
.video-js {
  font-family: var(--font);
  color: #fff;
  border-radius: 12px;
  overflow: hidden;
  background-color: #000;
}
/* Hide Unnecessary Menus */
.vjs-subs-caps-button, .vjs-chapters-button, .vjs-descriptions-button,
.vjs-audio-button, .vjs-playback-rate, .vjs-volume-vertical {
  display: none !important;
}

/* Control Bar */
.video-js .vjs-control-bar {
  display: flex !important;
  align-items: center !important;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0) 100%) !important;
  height: 50px !important;
  padding: 0 8px !important;
  z-index: 20 !important;
}

/* Remove blue tap highlight and selection on mobile player buttons */
.video-ui-overlay button,
.ui-btn,
.skip-zone,
.vjs-control-bar button {
  -webkit-tap-highlight-color: transparent;
  user-select: none;         /* Prevents text selection during rapid double-tapping */
  -webkit-user-select: none; /* Safari support for user-select */
  outline: none;
}

/* Make the spacer push right-side controls (fullscreen, quality) to the right edge */
.video-js .vjs-custom-control-spacer {
  display: flex !important;
  flex: 1 1 auto !important;
}

.video-js .vjs-quality-btn {
  margin-left: auto !important;
}

.vjs-quality-btn {
  order: 99;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  transform: translateY(-1px);
  margin-right: 4px !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.vjs-fullscreen-control {
  order: 100;
}

/* BIG PLAY BUTTON */
.video-js .vjs-big-play-button {
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 68px !important;
  height: 48px !important;
  top: 50% !important;
  left: 50% !important;
  margin-top: -24px !important;
  margin-left: -34px !important;
  line-height: 48px !important;
  transition: transform 0.2s !important;
}

/* UI Button Disabled State */
.ui-btn:disabled {
  cursor: not-allowed;
  opacity: 0.3 !important;
  filter: grayscale(1);
}

.video-js:hover .vjs-big-play-button {
  background-color: transparent !important;
}

/* PROGRESS BAR (Seekbar) - The YouTube Logic */
.video-js .vjs-progress-control {
  position: absolute !important;
  width: 100% !important;
  height: 16px !important;
  top: -12px !important;
  left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  transition: height 0.1s ease, top 0.1s ease;
}

/* Make it thicker on hover */
.video-js .vjs-progress-control:hover {
  height: 20px !important;
  top: -16px !important;
}

.video-js .vjs-progress-holder {
  margin: 0 !important;
  height: 4px !important;
  margin-top: 6px !important;
  background: rgba(255, 255, 255, 0.2) !important;
}

.video-js .vjs-progress-control:hover .vjs-progress-holder {
  height: 6px !important;
  margin-top: 7px !important;
}

.video-js .vjs-play-progress {
  background-color: #ff0000 !important;
}

/* Small dot on seek */
.video-js .vjs-play-progress:before {
  font-size: 14px !important;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}

.video-js .vjs-progress-control:hover .vjs-play-progress:before {
  display: block;
}

.video-js .vjs-load-progress {
  background: rgba(255, 255, 255, 0.4) !important;
}

.video-js .vjs-load-progress div {
  background: transparent !important;
}

.vjs-button > .vjs-icon-placeholder:before {
  font-size: 22px !important;
  line-height: 48px !important;
}

.vjs-current-time, .vjs-time-divider, .vjs-duration-display, .vjs-duration {
  display: block !important;
  line-height: 48px !important;
  font-size: 13px !important;
  color: #eee !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 0 !important;
}

.vjs-time-divider {
  padding: 0 4px !important;
}

.video-js .vjs-time-control {
  flex: none !important;
}

.video-js .vjs-volume-panel {
  margin-right: 4px;
  display: flex !important;
  align-items: center !important;
  height: 50px !important;
}

.video-js .vjs-volume-panel .vjs-volume-control {
  transition: width 0.2s, opacity 0.2s;
  display: flex !important;
  align-items: center !important;
  height: 50px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.video-js .vjs-volume-panel .vjs-mute-control {
  height: 50px !important;
  line-height: 50px !important;
}

.video-js .vjs-volume-panel .vjs-volume-bar {
  top: auto !important;
  transform: none !important;
  align-self: center;
  margin: 0 !important;
}

.video-js .vjs-volume-level { background: #fff !important; }

/* â”€â”€ Resolution Badge (Direct Play & Transcode) â”€â”€ */
.vjs-quality-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin-right: 8px !important;
  width: auto !important;
  padding: 0 4px !important;
  position: relative;
}

.vjs-quality-label {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: 0.5px;
  color: #fff;
  background: transparent;
  padding: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  pointer-events: none;
}

.vjs-quality-btn.is-interactive {
  cursor: pointer !important;
}

.vjs-quality-btn.is-interactive:hover .vjs-quality-label {
  background: #fff;
  color: #000;
}

.vjs-quality-label.static-badge {
  background: transparent;
  color: #fff;
  border: none;
}

.vjs-quality-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 90px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 50;
}

.vjs-quality-btn.open .vjs-quality-menu {
  display: flex;
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.vjs-quality-item {
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}

.vjs-quality-item:hover { background: rgba(255,255,255,0.1); }
.vjs-quality-item.active { background: var(--accent); color: #fff; }
/* Buffering Spinner */
.video-js .vjs-loading-spinner {
  border: 3px solid rgba(255,255,255,0.2) !important;
  border-top-color: #fff !important;
  width: 50px !important; height: 50px !important;
  border-radius: 50% !important;
}

/* ==========================================================================
   3. MODERN IN-PLAYER OVERLAY CONTROLS
   ========================================================================== */
.player-container {
  position: relative;
  background: #000;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
}

.video-ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
  pointer-events: none;
}

/* Tie visibility natively to Video.js state tracker */

.video-js.vjs-user-active .video-ui-overlay {
  opacity: 1;
  pointer-events: auto;
}

.video-js.vjs-user-inactive .video-ui-overlay {
  opacity: 0;
  pointer-events: none;
}

.video-overlay-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
  z-index: 12;
  pointer-events: none;
}

/* --- Force Bottom Bar to hide on timeout even when paused --- */
.video-js.vjs-paused .vjs-control-bar {
  opacity: 1;
}

.video-js.vjs-user-inactive .vjs-control-bar,
.video-js.vjs-user-inactive .vjs-big-play-button,
.video-js.vjs-user-inactive .video-ui-overlay {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-js.vjs-user-inactive .vjs-progress-control {
  opacity: 0 !important;
}

.vjs-text-track-display,
.vjs-modal-dialog,
.vjs-hidden {
  display: none !important;
}

.overlay-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  font-family: var(--font);
  animation: titleSlideIn 0.3s ease-out;
}

.vjs-title-overlay {
  display: none !important;
}

@keyframes titleSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.central-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 15;
}

.ui-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), filter 0.22s ease;
}

.ui-btn:hover {
  background: transparent;
  transform: scale(1.12);
  filter: brightness(1.08);
}

.ui-btn:active { transform: scale(0.96); }

.ui-btn svg {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.ui-btn.main-play {
  width: 60px;
  height: 60px;
  background: transparent;
  position: relative;
}

.ui-btn.main-play svg {
  width: 28px;
  height: 28px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.skip-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  /* z-index above the overlay (z-index: 3) so ripples always render */
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  /* skip zones are direct children of vjs root, not the overlay, so opacity
     is never inherited from the hidden overlay */
}

.skip-zone.left { left: 0; }
.skip-zone.right { right: 0; }

.dt-ripple {
  width: 88px;
  height: 88px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
  /* back-drop blur for a glassy look */
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.dt-ripple-icon {
  width: 28px;
  height: 28px;
  color: #fff;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.dt-ripple-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.dt-ripple.animate {
  animation: skip-ripple 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes skip-ripple {
  0%   { opacity: 0; transform: scale(0.7); }
  20%  { opacity: 1; transform: scale(1.05); }
  60%  { opacity: 1; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(1.2); }
}

/* ==========================================================================
   4. AUTOPLAY SWITCH & TIMER OVERLAY
   ========================================================================== */

/* Autoplay countdown overlay (inside .player-container) */
.autoplay-countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.autoplay-countdown-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.autoplay-modern-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(30, 30, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 0;
  border-radius: 16px;
  max-width: 640px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(15px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.autoplay-modern-thumb {
  position: relative;
  width: 240px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.autoplay-modern-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.autoplay-modern-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
}

.autoplay-modern-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 100%;
  transition: width 0.1s linear;
}

.autoplay-modern-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.autoplay-modern-kicker {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
}

.autoplay-modern-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.autoplay-modern-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.autoplay-modern-actions .btn {
  min-height: 40px;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.autoplay-modern-actions .btn svg {
  display: block;
  flex-shrink: 0;
}

.autoplay-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.6rem;
  font-weight: 700;
}

@media (max-width: 600px) {
  .autoplay-countdown-overlay {
    padding: 8px;
    align-items: center;
    overflow: hidden;
  }

  .autoplay-modern-card {
    flex-direction: column;
    text-align: center;
    padding: 10px;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    overflow: hidden;
  }

  .autoplay-modern-thumb {
    width: 100%;
    max-width: 180px;
  }

  .autoplay-modern-kicker {
    margin: 0 0 4px 0;
    font-size: 0.72rem;
  }

  .autoplay-modern-title {
    font-size: 0.9rem;
    margin: 0 0 8px 0;
    -webkit-line-clamp: 1;
  }

  .autoplay-modern-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .autoplay-modern-actions .btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.78rem;
  }
}

.autoplay-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.autoplay-header h3 { margin: 0; font-size: 1rem; }

/* Debug Panel */
.debug-panel {
  display: none;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
}
.debug-panel.debug-visible { display: flex; }
.debug-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
}
.debug-panel-header h3 { margin: 0; font-size: 0.9rem; color: var(--accent); }
.debug-scroll-area {
  flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 16px;
}
.debug-section label {
  display: block; font-size: 0.7rem; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 6px; letter-spacing: 0.05em;
}
.code-block {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem; background: #0a0a0a; color: #4ade80;
  padding: 12px; border-radius: 8px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-all; min-height: 40px;
  max-height: 280px; overflow-y: auto;
}
.debug-actions {
  padding: 10px 12px; border-top: 1px solid var(--border-subtle);
  display: flex; gap: 8px; flex-shrink: 0;
}

/* iOS/YouTube Style Toggle Switch */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border); transition: .3s; border-radius: 34px;
}
.slider:before {
  position: absolute; content: ""; height: 14px; width: 14px;
  left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--text-primary); }
input:checked + .slider:before { transform: translateX(16px); background-color: var(--bg-base); }

/* End Screen Overlay */
.autoplay-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.8);
  z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.autoplay-overlay.show { opacity: 1; pointer-events: auto; }
.autoplay-overlay h2 { font-size: 1.5rem; color: #fff; margin-bottom: 8px; }
.autoplay-overlay p { color: var(--text-secondary); margin-bottom: 24px; }
.autoplay-overlay .btn-ghost { border: 1px solid rgba(255,255,255,0.3); color: #fff; }
.autoplay-overlay .btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* â”€â”€ Login Experience â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.login-body {
  background-color: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.login-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(0,0,0,0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  animation: pulseGlow 8s infinite alternate;
}

@keyframes pulseGlow {
  from { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

.login-page {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  animation: loginFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-box {
  background: rgba(20, 20, 20, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 38px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.login-logo svg { width: 28px; height: 28px; }

.login-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.login-box .form-group { margin-bottom: 14px; }

.login-box .form-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.login-box .form-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.2s;
}

.login-box .form-input:focus {
  background: rgba(255,255,255,0.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.login-btn {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}

.login-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.login-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.twofa-panel {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.twofa-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.twofa-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.twofa-copy {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.twofa-input {
  text-align: center;
  letter-spacing: 0.5em;
  font-weight: 700;
  font-size: 1.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

.twofa-setup-box {
  background: #fff;
  padding: 16px 0;
  border-radius: 12px;
  margin-bottom: 16px;
  text-align: center;
}

#twofa-qr {
  width: 180px;
  height: 180px;
}

.twofa-secret-wrap {
  margin-top: 12px;
  font-size: 0.75rem;
  color: #333;
}

.twofa-secret-wrap code {
  display: block;
  background: #f0f0f0;
  padding: 4px;
  margin-top: 4px;
  border-radius: 4px;
  word-break: break-all;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  margin: 12px 0;
  min-height: 1.2rem;
}

.shake {
  animation: shakeAnim 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeAnim {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@media (max-width: 480px) {
  .login-box {
    padding: 24px 0;
    border-radius: 18px;
  }

  .login-logo {
    width: 48px;
    height: 48px;
  }

  .login-logo svg {
    width: 24px;
    height: 24px;
  }
}

/* --- Admin Mobile Responsiveness (Best Practices 2026) --- */
@media (max-width: 850px) {
  .admin-container {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px;
    position: sticky;
    top: 64px;
    z-index: 100;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    scrollbar-width: none;
    height: auto;
  }

  .admin-nav::-webkit-scrollbar { display: none; }

  .admin-nav-item {
    white-space: nowrap;
    padding: 8px 16px;
    gap: 8px;
    font-size: 0.85rem;
  }

  .admin-nav-item span { display: inline; }

  .admin-nav-group {
    display: flex;
    flex-direction: row;
    gap: 4px;
  }

  .admin-nav .sidebar-divider {
    display: block;
    width: 1px;
    height: 20px;
    margin: 0 8px;
  }

  .admin-content {
    padding: 16px 0;
  }

  .admin-card {
    padding: 16px 0;
    border-radius: 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  #panel-videos thead,
  #panel-users thead {
    display: none;
  }

  #panel-videos table,
  #panel-users table,
  #panel-videos tbody,
  #panel-users tbody,
  #panel-videos tr,
  #panel-users tr,
  #panel-videos td,
  #panel-users td {
    display: block;
    width: 100%;
  }

  #panel-videos tr,
  #panel-users tr {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 12px;
  }

  #panel-videos td,
  #panel-users td {
    border-bottom: none;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

  #panel-videos td::before,
  #panel-users td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    flex: 0 0 auto;
  }

  .admin-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .admin-row-actions .btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .admin-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .form-input.search-sm {
    width: 100%;
  }

  .scan-status-container {
    grid-template-columns: 1fr;
  }
}

/* â”€â”€ PWA Standalone mode â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media all and (display-mode: standalone) {
  #pwa-install-btn { display: none !important; }
  .header {
    padding-top: env(safe-area-inset-top);
    height: calc(64px + env(safe-area-inset-top));
  }
}

/* Upload Progress Dialog */
.upload-progress-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10000;
  pointer-events: none; /* Let clicks pass through container */
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px; /* space for scroll */
  -ms-overflow-style: none; /* IE/Edge */
  scrollbar-width: none; /* Firefox */
}
.upload-progress-container::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

.upload-progress-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 0;
  width: 320px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  pointer-events: auto; /* Catch clicks on the card itself */
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: opacity 0.3s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.upload-progress-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
  flex: 1;
}

.upload-progress-actions {
  display: flex;
  gap: 4px;
}

.upload-progress-edit-form {
  margin-top: 12px;
  animation: fadeIn 0.2s ease;
}

.upload-progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s ease;
}

/* Upload Configuration Step */
.upload-config-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.upload-config-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.upload-radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.upload-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.upload-radio-label input[type="radio"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.upload-custom-date {
  display: none;
  margin-left: 26px;
  margin-top: 8px;
}
.upload-custom-date.active {
  display: block;
}
.upload-custom-date input {
  padding: 8px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
}
.upload-config-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

/* â”€â”€ Channels Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  padding: 16px 0;
}
.channel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 0;
  background: var(--bg-card);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  border: 1px solid var(--border);
}
.channel-card:hover {
  transform: translateY(-4px);
  background: var(--bg-hover);
}
.channel-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-hover);
}
.channel-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  word-break: break-word;
}
/* â”€â”€ Channel Page Styles â”€â”€ */
.channel-page-header {
  position: relative;
  margin-bottom: 24px;
}

.channel-page-banner {
  width: 100%;
  aspect-ratio: 6.2 / 1;
  max-height: 250px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-hover);
  position: relative;
  border-radius: 16px;
}

.channel-page-banner-upload {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.channel-page-info-bar {
  display: flex;
  align-items: center;
  padding: 24px 0;
  gap: 24px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.channel-page-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-hover);
}

.channel-page-details {
  flex: 1;
  padding-bottom: 8px;
}

.channel-page-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.channel-page-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.channel-page-handle {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
  word-break: break-word;
}
.channel-page-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.channel-page-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.channel-page-actions .btn {
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 600;
}

.channel-page-tabs {
    display: flex;
    gap: 32px;
    padding: 0;
    border-bottom: none;
  }

.channel-page-tab {
  padding: 16px 0;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.2s;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  font-size: 1rem;
}

.channel-page-tab:hover {
  color: var(--text-primary);
}

.channel-page-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}



.channel-card-modern {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: none;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.channel-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.ccm-banner {
  width: 100%;
  height: 80px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-hover);
}

.ccm-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 20px 16px;
  text-align: center;
}

.ccm-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-surface);
  border: 4px solid var(--bg-surface);
  margin-top: -36px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.ccm-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.ccm-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
}

.ccm-dot {
  font-size: 0.6rem;
  opacity: 0.5;
}

.directory-hero {
  display: flex;
  flex-direction: column;
  padding: 32px 40px;
  background: var(--bg-surface);
  border-radius: 20px;
  margin-bottom: 24px;
}

.directory-hero-title {
  display: flex;
  align-items: baseline;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.directory-hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 600px;
  line-height: 1.5;
}

.vhs-lock-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-top: 24px;
}

.vhs-lock-screen input {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-primary);
  width: 100%;
  max-width: 320px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.vhs-lock-screen p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.vhs-settings-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.vhs-settings-btn:hover {
  background: var(--bg-hover);
}

.cropper-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 10000; display: flex; align-items: center; justify-content: center; } 
.cropper-container { background: var(--bg-card); width: 90%; max-width: 800px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5); } 
.cropper-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); } 
.cropper-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; color: var(--text-primary); } 
.channel-tab-toolbar { background: transparent; border-radius: 0; margin-bottom: 0; box-shadow: none; padding: 16px 0; }

.channel-community-post { background: transparent; padding: 16px 0; margin-bottom: 0; display: flex; flex-direction: column; gap: 12px; }
.channel-community-post + .channel-community-post { border-top: 1px solid var(--border); }
#channel-page-content { padding-bottom: 16px; }
.community-post-header { display: flex; align-items: center; gap: 12px; }
.community-post-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.community-post-header-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.community-post-author { font-weight: 500; font-size: 0.95rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-post-time { font-size: 0.8rem; color: var(--text-secondary); }
.community-post-body { display: flex; flex-direction: column; gap: 12px; }
.community-post-text { font-size: 0.95rem; line-height: 1.5; color: var(--text-primary); white-space: pre-wrap; }
.community-post-image { width: 100%; max-height: 500px; object-fit: cover; border-radius: 12px; }

/* Channel Page Desktop / Global Styles added to override the inline styles we removed */
.channel-page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
}



/* Mobile responsive layout */
@media (max-width: 768px) {
  .channel-page-banner-upload .edit-banner-text {
    display: none;
  }
  .channel-page-banner-upload {
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 12px;
    right: 12px;
  }
  .channel-page-banner {
    border-radius: 16px;
    aspect-ratio: 4 / 1;
  }
  
  .channel-page-info-bar {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    text-align: left;
    padding: 16px 0;
    gap: 16px;
  }
  
  .channel-page-avatar {
    grid-column: 1;
    grid-row: 1;
    width: 72px;
    height: 72px;
  }
  .channel-page-details {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }
  
  .channel-page-title {
    font-size: 1.3rem;
  }

  .channel-page-meta {
    justify-content: flex-start;
  }
  
  .channel-page-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    width: 100%;
    gap: 8px;
  }
  
  .channel-page-actions .btn {
    flex: 1;
    padding: 10px 16px;
  }
  
  .channel-page-nav {
    flex-direction: column;
    align-items: stretch;
  }
  
  .channel-page-tabs {
    overflow-x: auto;
    white-space: nowrap;
    gap: 24px;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .channel-page-tabs::-webkit-scrollbar {
    display: none;
  }
  
    .channel-tab-toolbar {
      padding: 12px 0;
      width: 100%;
      flex-wrap: wrap;
      justify-content: flex-start;
      margin-bottom: 0;
    }
}


@media (max-width: 768px) {
  .channel-page-title {
    font-size: 1.1rem !important;
    word-break: break-word;
  }
  .channel-page-handle {
    font-size: 0.75rem !important;
  }
  .channel-page-stats {
    font-size: 0.75rem !important;
  }
}