/* ============================================
   VideoHub - Custom Styles
   Modern Dark UI Design System
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg-base:    #0a0a0f;
  --bg-surface: #111118;
  --bg-card:    #16161f;
  --bg-hover:   #1e1e2a;
  --bg-input:   #1a1a24;
  --border:     rgba(255,255,255,0.07);
  --border-md:  rgba(255,255,255,0.12);
  --text-1:     #f0f0f5;
  --text-2:     rgba(240,240,245,0.65);
  --text-3:     rgba(240,240,245,0.35);
  --brand:      #6c63ff;
  --brand-2:    #ff4d6d;
  --brand-glow: rgba(108,99,255,0.25);
  --red:        #ff4d6d;
  --green:      #22c55e;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-full:9999px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-1);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
* { scrollbar-width: thin; scrollbar-color: #2a2a38 transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a38; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a50; }

/* ── Utilities ── */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Navbar ── */
#topNav {
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

/* Search bar */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input {
  background: var(--bg-input);
  border: 1.5px solid var(--border-md);
  color: var(--text-1);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  padding: 9px 18px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.search-input::placeholder { color: var(--text-3); }
.search-btn {
  background: var(--bg-hover);
  border: 1.5px solid var(--border-md);
  border-left: none;
  color: var(--text-2);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  padding: 9px 18px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.search-btn:hover { background: var(--bg-card); color: var(--text-1); }

/* ── Sidebar ── */
#sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  width: 220px;
  min-width: 220px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(255,77,109,0.08));
  color: var(--text-1);
  border: 1px solid rgba(108,99,255,0.2);
}
.sidebar-link.active .sidebar-icon { color: var(--brand); }
.sidebar-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
  color: var(--text-3);
  transition: color var(--transition);
}
.sidebar-link:hover .sidebar-icon { color: var(--text-2); }

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 12px;
  margin: 4px 0 6px;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 8px;
}

/* ── Video Card ── */
.video-card {
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: transform var(--transition);
}
.video-card:hover { transform: translateY(-2px); }

.video-thumb-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 16/9;
  box-shadow: var(--shadow-sm);
}
.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), filter 0.35s ease;
}
.video-card:hover .video-thumb {
  transform: scale(1.05);
  filter: brightness(1.05);
}
.video-duration {
  position: absolute;
  bottom: 7px;
  right: 7px;
  background: rgba(0,0,0,0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

/* Hover overlay on thumb */
.video-thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
}
.video-card:hover .video-thumb-wrap::after { opacity: 1; }

.video-info { padding: 10px 2px 4px; display: flex; gap: 10px; }
.video-avatar { flex-shrink: 0; }
.video-avatar img,
.video-avatar .avatar-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, #6c63ff, #ff4d6d);
  color: #fff;
}
.video-meta { flex: 1; min-width: 0; }
.video-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  margin-bottom: 3px;
  text-decoration: none;
  display: block;
}
.video-title:hover { color: var(--text-1); }
.video-channel {
  font-size: 12px;
  color: var(--text-2);
  text-decoration: none;
  display: block;
  margin-bottom: 2px;
}
.video-channel:hover { color: var(--text-1); }
.video-stats {
  font-size: 11.5px;
  color: var(--text-3);
}

/* ── Category Pills ── */
.cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: 1.5px solid transparent;
}
.cat-pill-default {
  background: var(--bg-card);
  color: var(--text-2);
  border-color: var(--border);
}
.cat-pill-default:hover {
  background: var(--bg-hover);
  color: var(--text-1);
  border-color: var(--border-md);
}
.cat-pill-active {
  background: var(--text-1);
  color: var(--bg-base);
  font-weight: 600;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 15px rgba(108,99,255,0.35);
}
.btn-primary:hover {
  background: #7c74ff;
  box-shadow: 0 4px 20px rgba(108,99,255,0.5);
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255,77,109,0.3);
}
.btn-danger:hover {
  background: #ff6b85;
  box-shadow: 0 4px 20px rgba(255,77,109,0.45);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--bg-hover);
  color: var(--text-2);
  border: 1.5px solid var(--border-md);
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-1);
  border-color: rgba(255,255,255,0.2);
}
.btn-outline-brand {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
.btn-outline-brand:hover {
  background: var(--brand-glow);
}

/* ── Form Inputs ── */
.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-md);
  color: var(--text-1);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-input::placeholder { color: var(--text-3); }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* ── Cards / Panels ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
}

/* ── Dropdown ── */
.dropdown-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-1); }
.dropdown-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  color: var(--text-2);
}

/* ── Notification Badge ── */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--red);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-base);
}

/* ── Notification Row ── */
.notif-row {
  transition: background var(--transition);
}
.notif-row:hover {
  background: var(--bg-hover);
}
.notif-unread {
  background: rgba(108,99,255,0.06);
}
.notif-unread:hover {
  background: rgba(108,99,255,0.12);
}

/* ── Toast ── */
#toastContainer {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
#toastContainer .toast-item { pointer-events: all; }

.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 340px;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  transition: opacity 0.3s ease;
}

@keyframes toastIn {
  from { transform: translateX(110%) scale(0.9); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}

/* ── Progress Bar ── */
.progress-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--brand-glow);
}

/* ── Auth Pages ── */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

/* ── Tooltip ── */
.tooltip { position: relative; }
.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-hover);
  border: 1px solid var(--border-md);
  color: var(--text-1);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
}

/* ── Icon Button ── */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-1); }

/* ── Upload Button (navbar) ── */
.upload-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  border: 1.5px solid var(--border-md);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}
.upload-btn:hover {
  background: var(--bg-card);
  color: var(--text-1);
  border-color: rgba(255,255,255,0.2);
}

/* ── Login Button (navbar) ── */
.login-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 2px 12px rgba(108,99,255,0.3);
}
.login-btn:hover {
  background: #7c74ff;
  box-shadow: 0 4px 18px rgba(108,99,255,0.45);
  transform: translateY(-1px);
}

/* ── Mobile Bottom Nav ── */
#mobileNav {
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  color: var(--text-3);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  transition: color var(--transition);
}
.mobile-nav-item.active { color: var(--text-1); }
.mobile-nav-item:hover { color: var(--text-2); }
.mobile-nav-upload {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(108,99,255,0.4);
  margin-top: -8px;
}

/* ── Sidebar width ── */
.sidebar { width: 220px; min-width: 220px; }
@media (max-width: 1024px) { .sidebar { display: none; } }

/* ── Responsive ── */
@media (max-width: 640px) {
  .auth-card { padding: 24px 20px; }

  /* Navbar: ลด padding บนมือถือ */
  #topNav {
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Notification dropdown: ไม่ให้ล้นจอ */
  #notifDropdown {
    width: calc(100vw - 16px) !important;
    right: -8px !important;
    left: auto !important;
  }

  /* User menu: ไม่ให้ล้นจอ */
  #userMenu {
    width: calc(100vw - 32px) !important;
    right: 0 !important;
  }

  /* Toast: ขยับขึ้นเหนือ bottom nav */
  #toastContainer {
    bottom: 76px;
    right: 8px;
    left: 8px;
  }
  .toast-item {
    min-width: unset;
    max-width: 100%;
    width: 100%;
  }

  /* Mobile search bar */
  #mobileSearchBar .search-input {
    font-size: 16px; /* ป้องกัน iOS zoom */
  }
}

/* ── Gradient text ── */
.gradient-text {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Skeleton loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Error/Success alerts ── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
}
.alert-error {
  background: rgba(255,77,109,0.1);
  border: 1px solid rgba(255,77,109,0.25);
  color: #ff8fa3;
}
.alert-success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  color: #4ade80;
}
.alert-info {
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.25);
  color: #a5b4fc;
}

/* ── Status Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge-public {
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.25);
}
.badge-unlisted {
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.25);
}
.badge-private {
  background: rgba(148,163,184,0.12);
  color: #94a3b8;
  border: 1px solid rgba(148,163,184,0.25);
}


/* ============================================
   Channel Page — Mobile-first
   ============================================ */

/* ── Banner ── */
.ch-banner {
  position: relative;
  width: 100%;
  height: 110px;
  background: linear-gradient(135deg,#0d0d1a 0%,#1a1025 40%,#0f1a2e 100%);
  overflow: hidden;
}
@media(min-width:480px){.ch-banner{height:150px;}}
@media(min-width:640px){.ch-banner{height:190px;}}
@media(min-width:768px){.ch-banner{height:220px;}}

.ch-banner-img{width:100%;height:100%;object-fit:cover;opacity:.85;}
.ch-banner::after{content:'';position:absolute;inset:0;background:linear-gradient(to bottom,transparent 40%,rgba(10,10,15,.7) 100%);pointer-events:none;}

/* ── Header ── */
.ch-header{background:var(--bg-surface);border-bottom:1px solid var(--border);}
.ch-header-inner{max-width:1200px;margin:0 auto;padding:0 14px;}
@media(min-width:640px){.ch-header-inner{padding:0 20px;}}

/* ── Profile Row — grid on mobile, flex on desktop ── */
.ch-profile-row{
  display:grid;
  grid-template-areas:"avatar info" "actions actions";
  grid-template-columns:auto 1fr;
  gap:10px 12px;
  padding:10px 0 14px;
}
@media(min-width:640px){
  .ch-profile-row{display:flex;align-items:flex-start;gap:16px;padding:16px 0 20px;flex-wrap:wrap;}
}

/* Avatar */
.ch-avatar-wrap{grid-area:avatar;flex-shrink:0;position:relative;z-index:2;margin-top:-36px;align-self:start;}
@media(min-width:480px){.ch-avatar-wrap{margin-top:-44px;}}
@media(min-width:640px){.ch-avatar-wrap{margin-top:-52px;}}
@media(min-width:768px){.ch-avatar-wrap{margin-top:-60px;}}

.ch-avatar,.ch-avatar-placeholder{
  width:68px;height:68px;border-radius:50%;
  border:3px solid var(--bg-surface);
  box-shadow:0 4px 16px rgba(0,0,0,.5);display:block;
}
.ch-avatar{object-fit:cover;}
.ch-avatar-placeholder{
  background:linear-gradient(135deg,#6c63ff,#ff4d6d);
  display:flex;align-items:center;justify-content:center;
  font-size:24px;font-weight:700;color:#fff;
}
@media(min-width:480px){.ch-avatar,.ch-avatar-placeholder{width:80px;height:80px;font-size:28px;}}
@media(min-width:640px){.ch-avatar,.ch-avatar-placeholder{width:96px;height:96px;font-size:34px;border-width:4px;}}
@media(min-width:768px){.ch-avatar,.ch-avatar-placeholder{width:112px;height:112px;font-size:40px;}}

/* Info */
.ch-info{grid-area:info;min-width:0;padding-top:4px;}
@media(min-width:640px){.ch-info{flex:1;padding-top:6px;}}

.ch-name{font-size:17px;font-weight:800;color:var(--text-1);margin:0 0 2px;line-height:1.2;letter-spacing:-.3px;}
@media(min-width:480px){.ch-name{font-size:20px;}}
@media(min-width:640px){.ch-name{font-size:22px;}}
@media(min-width:768px){.ch-name{font-size:26px;}}

.ch-handle{font-size:11px;color:var(--text-3);margin:0 0 5px;}
@media(min-width:640px){.ch-handle{font-size:13px;}}

.ch-stats-line{
  display:flex;align-items:center;flex-wrap:wrap;
  gap:3px 5px;font-size:11px;color:var(--text-2);margin:0 0 4px;
}
@media(min-width:640px){.ch-stats-line{font-size:13px;gap:4px 6px;}}

.ch-dot{color:var(--text-3);font-size:9px;}

.ch-bio{
  font-size:11px;color:var(--text-2);margin:0;line-height:1.5;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
@media(min-width:640px){.ch-bio{font-size:13px;max-width:480px;}}

/* Actions */
.ch-actions{grid-area:actions;display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
@media(min-width:640px){.ch-actions{margin-left:auto;padding-top:4px;}}

.ch-sub-group{display:flex;align-items:center;border-radius:var(--radius-full);overflow:hidden;border:1.5px solid var(--border-md);}
.ch-sub-btn{border-radius:0;border:none;border-right:1px solid var(--border-md);}
.ch-sub-arrow{border-radius:0;border:none;padding:8px 10px;min-width:unset;}
.ch-notify-menu{position:absolute;right:0;top:calc(100% + 8px);min-width:220px;z-index:50;}

/* ── Tabs ── */
.ch-tabs{
  display:flex;gap:0;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none;
  border-top:1px solid var(--border);margin:0 -14px;padding:0 14px;
}
.ch-tabs::-webkit-scrollbar{display:none;}
@media(min-width:640px){.ch-tabs{margin:0 -20px;padding:0 20px;}}

.ch-tab{
  flex-shrink:0;padding:11px 12px;font-size:12.5px;font-weight:600;
  color:var(--text-3);background:none;border:none;cursor:pointer;
  position:relative;transition:color var(--transition);white-space:nowrap;
}
@media(min-width:640px){.ch-tab{padding:14px 18px;font-size:13.5px;}}
.ch-tab:hover{color:var(--text-2);}
.ch-tab-active{color:var(--text-1);}
.ch-tab-active::after{content:'';position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--brand);border-radius:2px 2px 0 0;}

/* ── Content ── */
.ch-content{max-width:1200px;margin:0 auto;padding:16px 14px;}
@media(min-width:640px){.ch-content{padding:24px 20px;}}

.ch-tabpanel{animation:fadeIn .2s ease;}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}

/* ── Section ── */
.ch-section{margin-bottom:28px;}
.ch-section-title{font-size:14px;font-weight:700;color:var(--text-1);margin:0 0 12px;display:flex;align-items:center;gap:7px;}
.ch-section-title i{color:var(--brand);font-size:12px;}
@media(min-width:640px){.ch-section-title{font-size:16px;margin-bottom:16px;}}

/* ── Horizontal Row ── */
.ch-row-wrap{position:relative;}
.ch-row{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none;padding-bottom:4px;}
.ch-row::-webkit-scrollbar{display:none;}
.ch-row-item{flex:0 0 160px;scroll-snap-align:start;}
@media(min-width:480px){.ch-row-item{flex:0 0 200px;}}
@media(min-width:640px){.ch-row-item{flex:0 0 250px;gap:14px;}}
@media(min-width:768px){.ch-row-item{flex:0 0 270px;}}

.ch-row-btn{display:none;position:absolute;top:50%;transform:translateY(-50%);z-index:5;width:34px;height:34px;border-radius:50%;background:var(--bg-card);border:1px solid var(--border-md);color:var(--text-1);cursor:pointer;align-items:center;justify-content:center;transition:all var(--transition);box-shadow:var(--shadow-md);}
.ch-row-btn:hover{background:var(--bg-hover);transform:translateY(-50%) scale(1.05);}
.ch-row-wrap:hover .ch-row-btn{display:flex;}
.ch-row-prev{left:-17px;}.ch-row-next{right:-17px;}

/* ── Featured ── */
.ch-featured{display:flex;flex-direction:column;text-decoration:none;border-radius:var(--radius-xl);overflow:hidden;background:var(--bg-card);border:1px solid var(--border);transition:all var(--transition);}
.ch-featured:hover{border-color:var(--border-md);transform:translateY(-2px);box-shadow:var(--shadow-md);}
@media(min-width:640px){.ch-featured{flex-direction:row;max-width:680px;}}
.ch-featured-thumb{width:100%;aspect-ratio:16/9;position:relative;overflow:hidden;background:var(--bg-hover);flex-shrink:0;}
@media(min-width:640px){.ch-featured-thumb{width:260px;}}
.ch-featured-info{padding:12px 14px;display:flex;flex-direction:column;justify-content:center;gap:5px;}
@media(min-width:640px){.ch-featured-info{padding:16px 20px 16px 0;}}
.ch-featured-title{font-size:14px;font-weight:700;color:var(--text-1);margin:0;line-height:1.4;}
@media(min-width:640px){.ch-featured-title{font-size:16px;}}
.ch-featured-meta{font-size:11px;color:var(--text-3);margin:0;}

/* ── Grid ── */
.ch-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;}
@media(min-width:480px){.ch-grid{gap:12px;}}
@media(min-width:640px){.ch-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px;}}
@media(min-width:768px){.ch-grid{grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:20px;}}

/* ── Shorts Grid (Portrait) ── */
.ch-shorts-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;}
@media(min-width:480px){.ch-shorts-grid{grid-template-columns:repeat(3,1fr);gap:12px;}}
@media(min-width:640px){.ch-shorts-grid{grid-template-columns:repeat(4,1fr);gap:14px;}}
@media(min-width:768px){.ch-shorts-grid{grid-template-columns:repeat(5,1fr);gap:16px;}}
@media(min-width:1024px){.ch-shorts-grid{grid-template-columns:repeat(6,1fr);gap:16px;}}

/* ── Shorts Card (Portrait) ── */
.shorts-card {
  cursor: pointer;
  border-radius: var(--radius-lg);
  transition: transform var(--transition);
  position: relative;
}
.shorts-card:hover { transform: translateY(-2px); }

.shorts-thumb-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 9/16;
  box-shadow: var(--shadow-sm);
}
.shorts-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), filter 0.35s ease;
}
.shorts-card:hover .shorts-thumb {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* Shorts Badge */
.shorts-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255,77,109,0.95);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
  z-index: 2;
  letter-spacing: 0.02em;
}
.shorts-badge i {
  font-size: 9px;
}

.shorts-duration {
  position: absolute;
  bottom: 7px;
  right: 7px;
  background: rgba(0,0,0,0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

/* Hover overlay on thumb */
.shorts-thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
}
.shorts-card:hover .shorts-thumb-wrap::after { opacity: 1; }

.shorts-info { padding: 8px 2px 4px; }
.shorts-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  margin-bottom: 3px;
  text-decoration: none;
  display: block;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shorts-title:hover { color: var(--text-1); }
.shorts-channel {
  font-size: 11px;
  color: var(--text-2);
  text-decoration: none;
  display: block;
  margin-bottom: 2px;
}
.shorts-channel:hover { color: var(--text-1); }
.shorts-stats {
  font-size: 11px;
  color: var(--text-3);
}

/* ── Sort Bar ── */
.ch-sort-bar{display:flex;gap:7px;margin-bottom:14px;flex-wrap:wrap;}
.ch-sort-btn{padding:6px 14px;border-radius:var(--radius-full);font-size:12px;font-weight:600;background:var(--bg-card);border:1.5px solid var(--border);color:var(--text-2);cursor:pointer;transition:all var(--transition);}
.ch-sort-btn:hover{background:var(--bg-hover);color:var(--text-1);border-color:var(--border-md);}
.ch-sort-btn-active{background:var(--text-1)!important;color:var(--bg-base)!important;border-color:var(--text-1)!important;}

/* ── Empty ── */
.ch-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 20px;gap:10px;text-align:center;}
.ch-empty-icon{width:60px;height:60px;border-radius:50%;background:var(--bg-card);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:22px;color:var(--text-3);margin-bottom:4px;}
.ch-empty-icon-sm{font-size:28px;color:var(--text-3);}
.ch-empty-text{font-size:13px;color:var(--text-3);}

/* ── About ── */
.ch-about{display:flex;flex-direction:column;gap:14px;}
@media(min-width:768px){.ch-about{display:grid;grid-template-columns:1fr 300px;gap:20px;}}
.ch-about-main,.ch-about-side{display:flex;flex-direction:column;gap:14px;}
.ch-about-heading{font-size:13px;font-weight:700;color:var(--text-1);margin:0 0 10px;padding-bottom:8px;border-bottom:1px solid var(--border);}
@media(min-width:640px){.ch-about-heading{font-size:14px;margin-bottom:12px;padding-bottom:10px;}}
.ch-about-bio{font-size:12px;color:var(--text-2);line-height:1.7;white-space:pre-wrap;margin:0;}
@media(min-width:640px){.ch-about-bio{font-size:13px;}}

/* ── Stats ── */
.ch-stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
@media(min-width:640px){.ch-stats-grid{gap:10px;}}
.ch-stat{background:var(--bg-hover);border-radius:var(--radius-md);padding:10px 12px;border:1px solid var(--border);}
@media(min-width:640px){.ch-stat{padding:12px 14px;}}
.ch-stat-label{font-size:9px;color:var(--text-3);text-transform:uppercase;letter-spacing:.06em;font-weight:600;margin:0 0 3px;}
@media(min-width:640px){.ch-stat-label{font-size:10px;}}
.ch-stat-val{font-size:16px;font-weight:800;color:var(--text-1);margin:0;letter-spacing:-.5px;}
@media(min-width:640px){.ch-stat-val{font-size:18px;}}

/* ── Links ── */
.ch-links{display:flex;flex-direction:column;gap:6px;}
.ch-link-item{display:flex;align-items:center;gap:8px;padding:9px 10px;border-radius:var(--radius-md);background:var(--bg-hover);border:1px solid var(--border);text-decoration:none;transition:all var(--transition);}
@media(min-width:640px){.ch-link-item{gap:10px;padding:10px 12px;}}
.ch-link-item:hover{background:var(--bg-card);border-color:var(--border-md);transform:translateX(3px);}
.ch-link-favicon{border-radius:4px;flex-shrink:0;width:16px;height:16px;}
@media(min-width:640px){.ch-link-favicon{width:18px;height:18px;}}
.ch-link-name{font-size:12px;font-weight:600;color:var(--text-1);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@media(min-width:640px){.ch-link-name{font-size:13px;}}
.ch-link-host{font-size:10px;color:var(--text-3);display:none;}
@media(min-width:480px){.ch-link-host{display:block;flex-shrink:0;}}
@media(min-width:640px){.ch-link-host{font-size:11px;}}
.ch-link-ext{font-size:9px;color:var(--text-3);flex-shrink:0;}
@media(min-width:640px){.ch-link-ext{font-size:10px;}}

/* ── Misc ── */
.ch-pl-private{position:absolute;top:7px;left:7px;background:rgba(0,0,0,.75);color:#fff;font-size:10px;font-weight:600;padding:2px 8px;border-radius:4px;backdrop-filter:blur(4px);}
.ch-edit-home-link{text-align:center;padding:12px 0 0;}
.ch-edit-home-link a{font-size:12px;color:var(--text-3);text-decoration:none;display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:var(--radius-full);border:1px solid var(--border);transition:all var(--transition);}
.ch-edit-home-link a:hover{color:var(--text-2);border-color:var(--border-md);background:var(--bg-hover);}
.video-privacy-badge{position:absolute;top:7px;left:7px;background:rgba(0,0,0,.75);color:#fff;font-size:10px;font-weight:600;padding:2px 8px;border-radius:4px;backdrop-filter:blur(4px);display:flex;align-items:center;gap:4px;}
.video-privacy-unlisted{background:rgba(251,191,36,.8);color:#000;}
