/* ================================================
   GITTUBE — GitHub Dark Theme · Full Responsive
   ================================================ */

:root {
  --bg:        #0d1117;
  --bg2:       #161b22;
  --bg3:       #21262d;
  --bg4:       #2d333b;
  --bg5:       #373e47;
  --border:    #30363d;
  --border2:   #444c56;
  --text:      #e6edf3;
  --text2:     #8b949e;
  --text3:     #6e7681;
  --accent:    #2f81f7;
  --accent2:   #388bfd;
  --aglow:     rgba(47,129,247,0.18);
  --green:     #3fb950;
  --red:       #f85149;
  --orange:    #e3b341;
  --purple:    #bc8cff;
  --sidebar-w: 230px;
  --topbar-h:  58px;
  --r:         8px;
  --rlg:       12px;
  --tr:        0.18s cubic-bezier(.4,0,.2,1);
  --font:      'Outfit', system-ui, sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --display:   'Syne', var(--font);
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ── Loading Screen ───────────────────────── */
.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}
.loading-screen.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-content { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.loader-logo {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--display); font-size: 32px; font-weight: 800;
}
.loader-logo span { color: var(--accent); }
.loader-mark {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  animation: pulse-mark 1.4s ease infinite;
}
@keyframes pulse-mark { 0%,100%{box-shadow:0 0 0 0 var(--aglow)} 50%{box-shadow:0 0 0 16px transparent} }
.loader-bar {
  width: 240px; height: 3px;
  background: var(--bg3); border-radius: 2px; overflow: hidden;
}
.loader-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 2px;
  transition: width 0.4s ease;
}
.loader-status { font-size: 13px; color: var(--text3); font-family: var(--mono); }

/* ── Sidebar ──────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100dvh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0;
  transition: width var(--tr), transform var(--tr);
  position: relative; z-index: 100;
}
.sidebar-logo {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; flex-shrink: 0;
  transition: background var(--tr);
}
.sidebar-logo:hover { background: var(--bg3); }
.logo-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: box-shadow var(--tr);
}
.logo-mark:hover { box-shadow: 0 0 14px var(--aglow); }
.logo-mark.small { width: 27px; height: 27px; border-radius: 7px; }
.logo-text { font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--text); white-space: nowrap; }
.logo-text.small { font-size: 16px; }
.logo-accent { color: var(--accent); }

.sidebar-nav { flex: 1; padding: 10px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: var(--r);
  color: var(--text2); font-size: 14px; font-weight: 500;
  transition: all var(--tr); white-space: nowrap; cursor: pointer;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--bg3); color: var(--text); border-color: var(--border); }
.nav-item svg { flex-shrink: 0; }
.nav-divider { height: 1px; background: var(--border); margin: 8px 4px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; color: var(--text3);
  letter-spacing: .1em; padding: 4px 10px 2px;
  font-family: var(--mono);
}
.repo-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 12px; margin: 6px 2px;
  font-size: 12px;
}
.repo-card-header { display: flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.repo-stats-row { display: flex; justify-content: space-between; color: var(--text3); font-size: 11px; font-family: var(--mono); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-bottom: 6px; }
.footer-links a { font-size: 11px; color: var(--text3); transition: color var(--tr); }
.footer-links a:hover { color: var(--text2); }
.footer-copy { font-size: 10px; color: var(--text3); font-family: var(--mono); }

/* ── Main Wrapper ─────────────────────────── */
.main-wrapper {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  height: 100dvh;
  transition: margin-left var(--tr);
  overflow: hidden;
}

/* ── Topbar ───────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(13,17,23,0.95);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  position: sticky; top: 0; z-index: 90; flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.topbar-logo { display: none; align-items: center; gap: 8px; cursor: pointer; }
.icon-btn {
  background: none; border: none; color: var(--text2);
  width: 36px; height: 36px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--tr); flex-shrink: 0; position: relative;
}
.icon-btn:hover { background: var(--bg3); color: var(--text); }

.search-wrapper { flex: 1; max-width: 560px; margin: 0 auto; display: flex; gap: 0; }
.search-bar {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: var(--bg2); border: 1px solid var(--border);
  border-right: none; border-radius: var(--r) 0 0 var(--r);
  padding: 0 12px; transition: border-color var(--tr);
}
.search-bar:focus-within { border-color: var(--accent); }
.search-icon { color: var(--text3); flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font); font-size: 14px; padding: 9px 0;
}
.search-bar input::placeholder { color: var(--text3); }
.search-clear-btn {
  background: none; border: none; color: var(--text3);
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all var(--tr);
}
.search-clear-btn:hover { background: var(--bg4); color: var(--text); }
.search-submit-btn {
  background: var(--bg3); border: 1px solid var(--border); border-left: none;
  border-radius: 0 var(--r) var(--r) 0; color: var(--text2);
  padding: 0 16px; height: 38px; display: flex; align-items: center;
  transition: all var(--tr);
}
.search-submit-btn:hover { background: var(--bg4); color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.mobile-search-btn { display: none; }

.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--red); color: white;
  font-size: 9px; font-weight: 700; font-family: var(--mono);
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg); padding: 0 3px;
}
.avatar-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); cursor: pointer; transition: all var(--tr);
}
.avatar-btn:hover { border-color: var(--accent); color: var(--text); }

/* ── Notification Panel ───────────────────── */
.notif-panel {
  position: fixed; top: var(--topbar-h); right: 8px;
  width: 360px; max-height: 480px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rlg); z-index: 800;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  overflow: hidden; display: flex; flex-direction: column;
  transform: translateY(-10px) scale(0.96); opacity: 0; pointer-events: none;
  transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
}
.notif-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }
.notif-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 15px;
}
.mark-read-btn {
  background: none; border: none; color: var(--accent);
  font-size: 12px; font-weight: 600; padding: 4px 8px;
  border-radius: 4px; transition: background var(--tr);
}
.mark-read-btn:hover { background: var(--aglow); }
.notif-list { overflow-y: auto; flex: 1; padding: 8px 0; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px; cursor: pointer; transition: background var(--tr);
  border-left: 3px solid transparent;
}
.notif-item:hover { background: var(--bg3); }
.notif-item.unread { border-left-color: var(--accent); background: rgba(47,129,247,.04); }
.notif-item-icon {
  width: 36px; height: 36px; border-radius: var(--r);
  background: var(--aglow); display: flex; align-items: center;
  justify-content: center; color: var(--accent); flex-shrink: 0;
}
.notif-item-body { flex: 1; }
.notif-item-title { font-size: 13px; font-weight: 600; line-height: 1.4; }
.notif-item-meta { font-size: 11px; color: var(--text3); margin-top: 2px; font-family: var(--mono); }
.notif-empty { text-align: center; padding: 32px 16px; color: var(--text3); font-size: 14px; }

/* ── Mobile Search ────────────────────────── */
.mobile-search-overlay {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0 12px; height: var(--topbar-h);
  display: flex; align-items: center; gap: 8px;
  transform: translateY(-100%); transition: transform var(--tr);
  z-index: 200;
}
.mobile-search-overlay.open { transform: translateY(0); }
.mobile-search-inner { display: flex; align-items: center; gap: 8px; width: 100%; }
.mobile-search-inner input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 12px; color: var(--text);
  font-family: var(--font); font-size: 14px; outline: none;
}
.mobile-search-inner button { background: none; border: none; color: var(--text2); padding: 8px; }

/* ── Mobile Overlay ───────────────────────── */
.mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 150;
}

/* ── Page Views ───────────────────────────── */
.page-view { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.hidden { display: none !important; }

/* ── Chips Bar ────────────────────────────── */
.chips-bar {
  display: flex; gap: 8px; padding: 12px 16px 10px;
  overflow-x: auto; scrollbar-width: none;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
  border-bottom: 1px solid var(--border);
}
.chips-bar::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); padding: 6px 14px; border-radius: 20px;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  transition: all var(--tr); white-space: nowrap;
}
.chip:hover { background: var(--bg4); color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }

/* ── Home Content ─────────────────────────── */
.home-content { padding: 20px 16px 40px; max-width: 1900px; margin: 0 auto; }
.section-title {
  font-family: var(--display); font-size: 17px; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.section-icon { font-size: 18px; }
.section-count { font-size: 13px; color: var(--text3); font-weight: 400; font-family: var(--mono); margin-left: 4px; }

.featured-section { margin-bottom: 32px; }
.featured-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.featured-row::-webkit-scrollbar { display: none; }
.featured-card {
  flex: 0 0 280px; cursor: pointer;
  transition: transform var(--tr);
}
.featured-card:hover { transform: translateY(-3px); }
.featured-thumb {
  width: 100%; aspect-ratio: 16/9; background: var(--bg2);
  border-radius: var(--rlg); overflow: hidden; position: relative;
  border: 1px solid var(--border); transition: border-color var(--tr);
}
.featured-card:hover .featured-thumb { border-color: var(--accent); }
.featured-thumb video { width: 100%; height: 100%; object-fit: cover; }
.featured-thumb .play-count-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,.8); backdrop-filter: blur(4px);
  color: var(--orange); font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; font-family: var(--mono);
}
.featured-info { padding: 8px 4px 0; }
.featured-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.featured-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── Video Grid ───────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.video-card { cursor: pointer; animation: fadeUp .3s ease both; }
.video-card:nth-child(2){animation-delay:.04s} .video-card:nth-child(3){animation-delay:.08s}
.video-card:nth-child(4){animation-delay:.12s} .video-card:nth-child(5){animation-delay:.16s}
.video-card:nth-child(6){animation-delay:.20s} .video-card:nth-child(7){animation-delay:.24s}
@keyframes fadeUp { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }

.video-card:hover { transform: translateY(-3px); }
.card-thumb {
  width: 100%; aspect-ratio: 16/9; background: var(--bg2);
  border-radius: var(--rlg); overflow: hidden; border: 1px solid var(--border);
  position: relative; transition: border-color var(--tr);
}
.video-card:hover .card-thumb { border-color: var(--border2); }
.card-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.video-card:hover .card-thumb video { transform: scale(1.04); }
.card-thumb-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--tr);
}
.video-card:hover .card-thumb-overlay { background: rgba(0,0,0,.28); }
.card-play-circle {
  width: 44px; height: 44px; background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.7); transition: all var(--tr);
}
.video-card:hover .card-play-circle { opacity: 1; transform: scale(1); }
.card-duration {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,.85); backdrop-filter: blur(4px);
  color: white; font-size: 11px; font-weight: 700; font-family: var(--mono);
  padding: 2px 6px; border-radius: 4px;
}
.card-new-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent); color: white; font-size: 9px;
  font-weight: 700; font-family: var(--mono); letter-spacing: .05em;
  padding: 2px 6px; border-radius: 4px;
}
.card-info { display: flex; gap: 10px; padding: 10px 2px 0; }
.card-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.card-body { flex: 1; min-width: 0; }
.card-title {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 3px; transition: color var(--tr);
}
.video-card:hover .card-title { color: var(--accent); }
.card-channel { font-size: 12px; color: var(--text2); margin-bottom: 1px; }
.card-meta { font-size: 11px; color: var(--text3); font-family: var(--mono); display: flex; gap: 6px; flex-wrap: wrap; }
.card-play-count { color: var(--orange); font-weight: 600; }

.no-results { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 40vh; gap: 10px; color: var(--text3); text-align: center; }
.no-results p { font-size: 17px; font-weight: 600; color: var(--text2); }

/* ── Player Layout ────────────────────────── */
.player-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  padding: 20px 16px;
  max-width: 1800px;
  margin: 0 auto;
  align-items: start;
}
.video-col { min-width: 0; }

/* ── Player Stage ─────────────────────────── */
.player-stage {
  width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: var(--rlg); overflow: hidden;
  border: 1px solid var(--border); position: relative; cursor: pointer;
  transition: border-radius var(--tr);
}
.player-stage:fullscreen, .player-stage:-webkit-full-screen { border-radius: 0; border: none; }
.player-stage video { width: 100%; height: 100%; display: block; outline: none; }
.player-stage.theatre { aspect-ratio: 21/9; }

/* Controls overlay */
.controls-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent 0, rgba(0,0,0,.8) 100%);
  padding: 40px 12px 10px;
  opacity: 0; transition: opacity .22s ease;
  pointer-events: none;
}
.player-stage:hover .controls-overlay,
.player-stage.force-ctrl .controls-overlay {
  opacity: 1; pointer-events: all;
}

/* Progress bar */
.progress-wrap { padding: 4px 0 8px; }
.prog-bg {
  height: 4px; background: rgba(255,255,255,.2); border-radius: 2px;
  position: relative; cursor: pointer; user-select: none;
  transition: height .15s ease;
}
.prog-bg:hover { height: 6px; }
.prog-bg:hover .prog-thumb { opacity: 1; transform: scale(1); }
.prog-buf { position: absolute; inset: 0; background: rgba(255,255,255,.3); border-radius: 2px; width: 0; }
.prog-fill { position: absolute; inset: 0; background: var(--accent); border-radius: 2px; width: 0; transition: width .1s linear; }
.prog-thumb {
  position: absolute; top: 50%; left: 0; width: 14px; height: 14px;
  background: white; border-radius: 50%; margin: -7px 0 0 -7px;
  opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s;
  box-shadow: 0 0 0 3px rgba(255,255,255,.2);
  pointer-events: none;
}
.prog-tooltip {
  position: absolute; bottom: 18px; left: 0;
  background: var(--bg2); border: 1px solid var(--border);
  color: white; font-size: 11px; font-family: var(--mono);
  padding: 3px 7px; border-radius: 4px;
  transform: translateX(-50%); pointer-events: none;
  opacity: 0; transition: opacity .12s; white-space: nowrap;
}
.prog-bg:hover .prog-tooltip { opacity: 1; }

/* Ctrl bar */
.ctrl-bar { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.ctrl-left, .ctrl-right { display: flex; align-items: center; gap: 2px; }
.ctrl-btn {
  background: none; border: none; color: rgba(255,255,255,.85);
  padding: 6px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  transition: all var(--tr); min-width: 32px;
}
.ctrl-btn:hover { color: white; background: rgba(255,255,255,.12); }
.play-btn { padding: 7px; }
.vol-group { display: flex; align-items: center; gap: 2px; }
.vol-slider {
  -webkit-appearance: none; width: 0; height: 4px;
  background: rgba(255,255,255,.3); border-radius: 2px; outline: none; cursor: pointer;
  transition: width var(--tr);
}
.vol-group:hover .vol-slider { width: 72px; }
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  background: white; border-radius: 50%;
}
.time-text {
  font-family: var(--mono); font-size: 11px;
  color: rgba(255,255,255,.8); white-space: nowrap; padding: 0 6px;
}
.speed-btn { font-size: 11px; font-family: var(--mono); font-weight: 700; min-width: 36px; }
.autoplay-ctrl {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-family: var(--mono); font-weight: 700;
  color: rgba(255,255,255,.7);
}
.toggle {
  width: 28px; height: 16px; background: rgba(255,255,255,.2); border-radius: 8px;
  position: relative; cursor: pointer; transition: background var(--tr);
}
.toggle.on { background: var(--accent); }
.toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; background: white; border-radius: 50%;
  transition: transform var(--tr);
}
.toggle.on .toggle-knob { transform: translateX(12px); }
.toggle.sm { width: 24px; height: 14px; border-radius: 7px; }
.toggle.sm .toggle-knob { width: 10px; height: 10px; }
.toggle.sm.on .toggle-knob { transform: translateX(10px); }

.skip-flash {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: white; font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,.45); padding: 12px 16px; border-radius: 50%;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.skip-flash.left { left: 18px; }
.skip-flash.right { right: 18px; }
.skip-flash.show { opacity: 1; }

.video-spinner {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* ── Video Info ───────────────────────────── */
.vinfo { padding: 14px 0 0; }
.vinfo-title {
  font-family: var(--display); font-size: 19px; font-weight: 700;
  color: var(--text); line-height: 1.4; margin-bottom: 12px;
}
.vinfo-meta {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.vinfo-channel { display: flex; align-items: center; gap: 10px; }
.vinfo-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.vinfo-channel-name { font-weight: 700; font-size: 14px; }
.vinfo-channel-sub { font-size: 12px; color: var(--text3); font-family: var(--mono); }
.sub-btn {
  background: var(--text); color: var(--bg); border: none;
  padding: 7px 16px; border-radius: 20px; font-weight: 700; font-size: 13px;
  transition: all var(--tr); white-space: nowrap;
}
.sub-btn:hover { opacity: .88; }
.sub-btn.subbed { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }

.vinfo-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.act-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text2);
  padding: 6px 13px; border-radius: 20px; font-size: 13px; font-weight: 500;
  transition: all var(--tr); white-space: nowrap;
}
.act-btn:hover { background: var(--bg4); color: var(--text); border-color: var(--border2); }
.act-btn.active { background: var(--aglow); color: var(--accent); border-color: var(--accent); }

.desc-box {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--rlg);
  padding: 12px 14px; cursor: pointer; margin-bottom: 20px;
  transition: background var(--tr);
}
.desc-box:hover { background: var(--bg3); }
.desc-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; color: var(--text2); font-weight: 600; }
.desc-tag { background: var(--aglow); color: var(--accent); padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; font-family: var(--mono); }
.desc-body { font-size: 13px; color: var(--text2); line-height: 1.6; overflow: hidden; max-height: 2.8em; transition: max-height .3s ease; }
.desc-body.expanded { max-height: 200px; }
.desc-toggle { background: none; border: none; color: var(--text); font-weight: 700; font-size: 13px; margin-top: 6px; padding: 0; display: block; }

/* ── Comments ─────────────────────────────── */
.comments-wrap { padding-bottom: 40px; }
.comments-hdr { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.comments-title { font-size: 15px; font-weight: 700; font-family: var(--display); }
.comments-sort {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--text2); font-size: 12px; font-weight: 600;
  padding: 5px 8px; border-radius: var(--r); cursor: pointer; transition: background var(--tr);
}
.comments-sort:hover { background: var(--bg3); }

.comment-input-wrap { display: flex; gap: 10px; margin-bottom: 24px; }
.comment-avatar-img { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.comment-input-box { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.comment-name-input {
  background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text2); font-family: var(--mono); font-size: 12px;
  padding: 4px 0; outline: none; width: 160px; transition: border-color var(--tr);
}
.comment-name-input:focus { border-bottom-color: var(--accent); color: var(--text); }
.comment-textarea {
  width: 100%; background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 14px;
  padding: 8px 0; outline: none; resize: none; transition: border-color var(--tr); overflow: hidden;
}
.comment-textarea:focus { border-bottom-color: var(--accent); }
.comment-input-actions { display: flex; justify-content: flex-end; gap: 8px; }
.comment-cancel-btn {
  background: none; border: none; color: var(--text2);
  padding: 6px 14px; border-radius: 20px; font-weight: 600; font-size: 13px;
  transition: background var(--tr);
}
.comment-cancel-btn:hover { background: var(--bg3); }
.comment-submit-btn {
  background: var(--accent); color: white; border: none;
  padding: 6px 16px; border-radius: 20px; font-weight: 700; font-size: 13px;
  transition: all var(--tr);
}
.comment-submit-btn:hover { background: var(--accent2); }

.comment-item { display: flex; gap: 10px; margin-bottom: 18px; }
.comment-item-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: var(--bg3); display: flex; align-items: center; justify-content: center; color: var(--text2); font-size: 13px; font-weight: 700; }
.comment-item-body { flex: 1; }
.comment-item-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.comment-item-name { font-size: 13px; font-weight: 700; }
.comment-item-time { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.comment-item-text { font-size: 14px; color: var(--text2); line-height: 1.55; }
.comment-item-video { font-size: 11px; color: var(--accent); margin-top: 2px; font-family: var(--mono); }
.comment-item-actions { display: flex; gap: 10px; margin-top: 6px; }
.comment-like-btn {
  background: none; border: none; color: var(--text3); font-size: 12px;
  display: flex; align-items: center; gap: 4px; padding: 0; transition: color var(--tr);
}
.comment-like-btn:hover { color: var(--text); }
.comments-loading { display: flex; align-items: center; gap: 8px; color: var(--text3); font-size: 13px; padding: 12px 0; }
.mini-spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }

/* ── Up Next Sidebar ──────────────────────── */
.upnext-sidebar {
  position: sticky; top: 20px; max-height: calc(100dvh - 100px);
  display: flex; flex-direction: column; overflow: hidden;
}
.upnext-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
  margin-bottom: 10px; flex-shrink: 0;
}
.upnext-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.autoplay-mini { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.upnext-list { overflow-y: auto; flex: 1; padding-right: 2px; }

.upnext-item {
  display: flex; gap: 8px; padding: 7px 6px; border-radius: var(--r);
  cursor: pointer; transition: background var(--tr); margin-bottom: 2px;
  border: 1px solid transparent;
}
.upnext-item:hover { background: var(--bg3); }
.upnext-item.active { background: var(--bg3); border-color: var(--accent); }
.upnext-thumb { width: 120px; aspect-ratio: 16/9; border-radius: 5px; overflow: hidden; background: var(--bg2); flex-shrink: 0; position: relative; }
.upnext-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.upnext-thumb .dur { position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,.8); color: white; font-size: 9px; font-family: var(--mono); padding: 1px 4px; border-radius: 2px; }
.upnext-info { flex: 1; min-width: 0; padding-top: 2px; }
.upnext-info-title { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 3px; }
.upnext-info-meta { font-size: 11px; color: var(--text3); font-family: var(--mono); }

/* ── Toast ────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 9999;
  transform: translateX(-50%) translateY(60px);
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); padding: 9px 18px; border-radius: 24px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  backdrop-filter: blur(12px);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Keyboard Modal ───────────────────────── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  z-index: 5000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-bg.open { opacity: 1; pointer-events: all; }
.kb-modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--rlg);
  padding: 24px; width: 540px; max-width: 92vw; max-height: 80dvh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  transform: scale(.94); transition: transform .2s;
}
.modal-bg.open .kb-modal { transform: scale(1); }
.kb-modal-hdr { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.kb-modal-hdr h3 { font-family: var(--display); font-size: 17px; }
.kb-close { background: none; border: none; color: var(--text2); font-size: 22px; line-height: 1; transition: color var(--tr); }
.kb-close:hover { color: var(--text); }
.kb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kb-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg3); border: 1px solid var(--border);
  padding: 9px 12px; border-radius: var(--r); font-size: 13px;
}
.kb-item span { color: var(--text2); }
kbd {
  background: var(--bg4); border: 1px solid var(--border2); border-bottom-width: 2px;
  border-radius: 4px; padding: 2px 6px; font-family: var(--mono); font-size: 11px;
  color: var(--text);
}

/* ── Context Menu ─────────────────────────── */
.ctx-menu {
  position: fixed; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 5px 0; z-index: 9000; min-width: 210px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transform: scale(.94); transform-origin: top left;
  transition: opacity .14s, transform .14s;
}
.ctx-menu.open { opacity: 1; pointer-events: all; transform: scale(1); }
.ctx-item { display: flex; align-items: center; gap: 9px; padding: 8px 14px; font-size: 13px; color: var(--text2); cursor: pointer; transition: all var(--tr); }
.ctx-item:hover { background: var(--bg3); color: var(--text); }
.ctx-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Sidebar Collapsed ────────────────────── */
body.sb-collapsed .sidebar { width: 56px; }
body.sb-collapsed .sidebar .logo-text,
body.sb-collapsed .sidebar .nav-item span,
body.sb-collapsed .sidebar .nav-section-label,
body.sb-collapsed .sidebar .repo-card,
body.sb-collapsed .sidebar .sidebar-footer { display: none; }
body.sb-collapsed .sidebar .sidebar-logo { justify-content: center; padding: 0; }
body.sb-collapsed .sidebar .logo-mark { margin: 0 auto; }
body.sb-collapsed .sidebar .nav-item { justify-content: center; padding: 10px; }
body.sb-collapsed .sidebar .nav-divider { display: none; }

/* ════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════════ */

/* ── Tablet (≤ 1100px) ────────────────────── */
@media (max-width: 1100px) {
  :root { --sidebar-w: 200px; }
  .player-layout { grid-template-columns: 1fr; gap: 16px; }
  .upnext-sidebar { position: static; max-height: none; overflow: visible; }
  .upnext-list { max-height: 400px; overflow-y: auto; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* ── Small Tablet / Large Phone (≤ 860px) ─── */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    transform: translateX(calc(-1 * var(--sidebar-w)));
    transition: transform var(--tr);
    width: 240px !important;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-overlay { display: block; opacity: 0; transition: opacity var(--tr); pointer-events: none; }
  .mobile-overlay.visible { opacity: 1; pointer-events: all; }
  .topbar-logo { display: flex !important; }
  .sidebar-logo { display: flex; }
  .search-wrapper { max-width: none; }
  body.sb-collapsed .sidebar { transform: translateX(-240px); width: 240px !important; }
  .home-content { padding: 12px 12px 32px; }
  .player-layout { padding: 12px; gap: 12px; }
}

/* ── Phone (≤ 600px) ──────────────────────── */
@media (max-width: 600px) {
  :root { --topbar-h: 52px; }
  .search-wrapper { display: none; }
  .mobile-search-btn { display: flex !important; }
  .avatar-btn { display: none; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .home-content { padding: 8px 10px 32px; }
  .chips-bar { padding: 8px 10px; gap: 6px; }
  .chip { padding: 5px 11px; font-size: 12px; }
  .vinfo-title { font-size: 16px; }
  .vinfo-meta { flex-direction: column; align-items: flex-start; }
  .vinfo-actions { gap: 5px; }
  .act-btn { padding: 5px 10px; font-size: 12px; }
  .sub-btn { padding: 6px 13px; font-size: 12px; }
  .player-layout { padding: 0; gap: 0; }
  .player-stage { border-radius: 0; border-left: none; border-right: none; }
  .vinfo { padding: 12px 12px 0; }
  .desc-box { border-radius: var(--r); margin: 0 -1px; }
  .kb-grid { grid-template-columns: 1fr; }
  .notif-panel { width: calc(100vw - 16px); right: 8px; left: 8px; }
  .featured-card { flex: 0 0 200px; }
  .ctrl-bar .time-text { display: none; }
  .autoplay-ctrl { display: none; }
}

/* ── Very Small (≤ 400px) ─────────────────── */
@media (max-width: 400px) {
  .video-grid { grid-template-columns: 1fr; }
  .card-title { font-size: 13px; }
  .ctrl-right .speed-btn,
  .ctrl-right .ctrl-btn:nth-child(3) { display: none; }
}

/* ── TV / Large Screen (≥ 1800px) ─────────── */
@media (min-width: 1800px) {
  :root { --sidebar-w: 260px; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .player-layout { grid-template-columns: 1fr 420px; }
  .vinfo-title { font-size: 22px; }
  .card-title { font-size: 15px; }
}

/* ── 4K / TV (≥ 2400px) ───────────────────── */
@media (min-width: 2400px) {
  :root { --sidebar-w: 300px; font-size: 20px; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 24px; }
  .vinfo-title { font-size: 26px; }
  .topbar { height: 72px; }
}
