:root {
  color-scheme: dark;
  --bg: #0f0f0f;
  --surface: #181818;
  --surface-2: #242424;
  --hover: #303030;
  --border: #303030;
  --text: #f1f1f1;
  --muted: #aaa;
  --red: #ff0033;
  --green: #34d399;
  --blue: #60a5fa;
  --shadow: 0 24px 70px rgba(0, 0, 0, .48);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #fff;
  --surface: #f6f6f6;
  --surface-2: #ededed;
  --hover: #e4e4e4;
  --border: #ddd;
  --text: #111;
  --muted: #606060;
  --green: #059669;
  --blue: #2563eb;
  --shadow: 0 24px 70px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(205px, 1fr) minmax(300px, 640px) minmax(220px, 1fr);
  align-items: center;
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
}
.topbar-start, .topbar-actions, .brand, .video-meta, .author-row {
  display: flex;
  align-items: center;
}
.topbar-start { gap: 12px; }
.topbar-actions { justify-content: flex-end; gap: 7px; }
.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  cursor: pointer;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 21px;
}
.icon-button:hover { background: var(--hover); }
.brand {
  gap: 8px;
  padding: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}
.brand sup { margin: -11px 0 0 -4px; color: var(--muted); font-size: 8px; font-weight: 700; }
.brand-mark {
  display: grid;
  width: 33px;
  height: 23px;
  place-items: center;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
}
.search-form { display: flex; height: 42px; }
.search-form input {
  min-width: 0;
  flex: 1;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 22px 0 0 22px;
  outline: none;
  background: var(--bg);
  color: var(--text);
}
.search-form input:focus { border-color: var(--blue); box-shadow: inset 2px 0 var(--blue); }
.search-form button {
  width: 64px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 0 22px 22px 0;
  background: var(--surface-2);
  font-size: 24px;
}
.updated-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.updated-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 14%, transparent);
}
.profile-avatar, .avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #663ad4, #dc2f56);
  color: #fff;
  font-weight: 800;
}
.profile-avatar { width: 34px; height: 34px; font-size: 11px; }

.sidebar {
  position: fixed;
  z-index: 40;
  top: 64px;
  bottom: 0;
  left: 0;
  display: flex;
  width: 236px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 12px 22px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  transition: transform .18s ease;
}
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .content { margin-left: 0; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}
.sidebar nav button:hover, .sidebar nav button.active { background: var(--surface-2); }
.sidebar nav button.active { font-weight: 750; }
.sidebar nav button.active > span { color: var(--red); }
.sidebar nav b {
  min-width: 22px;
  padding: 4px 6px;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  text-align: center;
}
.monitor-card {
  display: flex;
  gap: 12px;
  margin: 18px 4px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}
.monitor-card > i {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 0, 51, .13);
}
.monitor-card strong { font-size: 12px; }
.monitor-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.content {
  min-height: 100vh;
  margin-left: 236px;
  padding: 82px 28px 60px;
}
.toolbar {
  position: sticky;
  z-index: 20;
  top: 64px;
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -18px -28px 22px;
  padding: 8px 28px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
}
.chips { display: flex; gap: 9px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  min-height: 34px;
  padding: 0 14px;
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.chip:hover { background: var(--hover); }
.chip.active { background: var(--text); color: var(--bg); }
.count-chip { border: 1px solid transparent; }
.count-chip.active { background: var(--surface-2); border-color: currentColor; }
.unwatched-count { color: var(--red); }
.ignored-count { color: var(--muted); }
.fresh-count { color: var(--blue); }
.count-chip.active.unwatched-count { color: var(--red); }
.count-chip.active.ignored-count { color: var(--muted); }
.count-chip.active.fresh-count { color: var(--blue); }

.section { max-width: 1680px; margin: 0 auto 42px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-title { display: flex; align-items: center; gap: 12px; }
.section-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: color-mix(in srgb, var(--red) 14%, var(--surface));
  color: var(--red);
  font-size: 20px;
}
.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.section h1 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.section-head > span { color: var(--muted); font-size: 12px; }

.short-carousel {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.shorts-row {
  display: grid;
  grid-auto-columns: clamp(155px, 11.5vw, 205px);
  grid-auto-flow: column;
  gap: 16px;
  padding: 2px 2px 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-padding-inline: 4px;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
}
.shorts-row::-webkit-scrollbar { display: none; }
.short-card { scroll-snap-align: start; }
.carousel-nav {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.carousel-nav:hover { background: var(--hover); }
.carousel-nav.prev { margin-left: -6px; }
.carousel-nav.next { margin-right: -6px; }
.short-card, .video-card, .queue-card {
  position: relative;
  padding: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  text-align: left;
}
.card-open {
  display: block;
  width: 100%;
  padding: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
}
.card-open:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 5px;
  border-radius: 13px;
}
.card-video-actions,
.queue-video-actions {
  position: absolute;
  z-index: 6;
  top: 8px;
  right: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  place-items: center;
  border-color: rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(0,0,0,.66);
  color: #fff;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0,0,0,.28);
}
.card-video-actions:hover,
.queue-video-actions:hover { background: rgba(0,0,0,.84); }
#videoActionMenuRoot {
  position: fixed;
  z-index: 300;
  inset: 0;
  pointer-events: none;
}
#videoActionMenuRoot[hidden] { display: none; }
.video-action-menu {
  position: fixed;
  display: grid;
  width: min(320px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  pointer-events: auto;
  border: 1px solid color-mix(in srgb, var(--border) 76%, #fff 24%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 96%, #050505 4%);
  color: var(--text);
  box-shadow: 0 26px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.video-action-menu-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--border);
}
.video-action-menu-head small { grid-column: 1 / -1; }
.video-action-menu-close {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 18px;
}
.video-action-menu-close:hover, .video-action-menu-close:focus-visible { outline: 2px solid var(--red); color: var(--text); }
.video-action-menu-head strong { font-size: 13px; }
.video-action-menu-head small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-action-group { display: grid; padding: 5px; }
.video-action-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 39px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
}
.video-action-item > span:first-child {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.video-action-item:hover, .video-action-item:focus-visible { outline: 0; background: var(--hover); }
.video-action-item:focus-visible { box-shadow: 0 0 0 2px var(--red) inset; }
.video-action-item:disabled, .video-action-item.disabled { cursor: not-allowed; opacity: .46; }
.video-action-separator { height: 1px; margin: 0 9px; background: var(--border); }
.video-action-menu footer {
  padding: 8px 13px 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.video-actions-button { letter-spacing: .02em; }
.short-thumb, .video-thumb, .queue-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface);
}
.short-thumb { aspect-ratio: 9 / 16; border-radius: 14px; }
.video-thumb { aspect-ratio: 16 / 9; border-radius: 13px; }
.short-thumb img, .video-thumb img, .queue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
  background: linear-gradient(135deg, #15181d, #1c2026);
}
.short-card:hover img, .video-card:hover img { transform: scale(1.035); }
.short-thumb::after {
  position: absolute;
  inset: 46% 0 0;
  content: "";
  background: linear-gradient(transparent, rgba(0, 0, 0, .74));
}
.play-hover {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, -44%) scale(.86);
  transition: .18s ease;
}
.short-card:hover .play-hover, .video-card:hover .play-hover {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.save-button {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(0,0,0,.52);
  color: #fff;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.save-button:hover { transform: scale(1.06); background: rgba(0,0,0,.72); }
.save-button.active {
  border-color: rgba(255,102,133,.55);
  background: rgba(255,102,133,.22);
  color: #ff6685;
}
.card-save {
  position: absolute;
  z-index: 5;
  top: 8px;
  left: 8px;
  width: 34px;
  height: 34px;
  font-size: 17px;
}
.player-save {
  width: 38px;
  height: 38px;
  font-size: 18px;
}
.new-dot {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
}
.fresh-pill {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.unwatched-dot {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,0,0,.24);
}
.duration {
  position: absolute;
  z-index: 2;
  right: 7px;
  bottom: 7px;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(0,0,0,.8);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.watched-pill {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--green) 76%, #000);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.ignored-pill {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, .84);
  color: rgba(255,255,255,.88);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.watched-card { opacity: .63; }
.watched-card:hover { opacity: .92; }
.ignored-card { opacity: .55; filter: grayscale(.28); }
.ignored-card:hover { opacity: .9; filter: grayscale(.08); }
.watch-progress {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255,255,255,.25);
}
.watch-progress i { display: block; height: 100%; background: var(--red); }
.short-title, .video-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.38;
}
.short-title { margin-top: 10px; }
.short-meta, .video-channel, .video-stats { color: var(--muted); font-size: 12px; }
.short-meta { display: block; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 30px 18px;
}
.video-body {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding-top: 11px;
}
.avatar { width: 36px; height: 36px; font-size: 10px; }
.video-title { min-height: 38px; }
.video-channel { display: block; margin-top: 6px; }
.video-stats { display: block; margin-top: 3px; }
.source-badge {
  display: inline-flex;
  margin-top: 7px;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.primary { background: rgba(255,0,51,.13); color: #ff6685; }
.secondary { background: rgba(96,165,250,.14); color: var(--blue); }

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
  gap: 24px;
  width: 100%;
  max-width: none;
  margin: 0;
}
.player-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 15px;
  background: #000;
  box-shadow: var(--shadow);
}
.player-frame > div, .player-frame iframe, .short-player > div, .short-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.wheel-capture-overlay {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: block;
  width: 28px;
  height: min(44%, 280px);
  transform: translateY(-50%);
  cursor: ns-resize;
  border: 0;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
}
.wheel-capture-overlay[data-wheel-side="left"] {
  left: 0;
  border-radius: 0 14px 14px 0;
}
.wheel-capture-overlay[data-wheel-side="right"] {
  right: 0;
  border-radius: 14px 0 0 14px;
}
.wheel-capture-overlay:focus-visible {
  outline: 2px solid rgba(255,255,255,.7);
  outline-offset: -3px;
  background: rgba(0,0,0,.12);
}
.player-frame .wheel-capture-overlay {
  width: 32px;
  height: min(46%, 240px);
}
.short-player .wheel-capture-overlay {
  width: 28px;
  height: min(44%, 420px);
}
.player-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 17px; }
.player-heading h1 { margin: 8px 0 0; font-size: clamp(19px, 2vw, 25px); line-height: 1.3; }
.close-player { background: var(--surface-2); }
.author-row { justify-content: space-between; margin-top: 18px; padding: 14px 0; border-block: 1px solid var(--border); }
.author-info { display: flex; align-items: center; gap: 10px; }
.author-info strong, .author-info small { display: block; }
.author-info small { margin-top: 3px; color: var(--muted); }
.player-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.player-nav-actions { display: inline-flex; align-items: center; gap: 6px; }
.player-nav-button { border-color: rgba(255,255,255,.16); color: var(--text); }
.notebooklm-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: rgba(168,85,247,.42);
  background: linear-gradient(135deg, rgba(168,85,247,.18), rgba(59,130,246,.11));
  color: #efe5ff;
}
.notebooklm-button:hover { border-color: rgba(168,85,247,.68); background: linear-gradient(135deg, rgba(168,85,247,.25), rgba(59,130,246,.17)); }
.notebooklm-icon { display: inline-flex; width: 17px; height: 17px; flex: 0 0 17px; }
.notebooklm-icon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.notebooklm-icon path { fill: rgba(255,255,255,.12); stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.notebooklm-icon .notebooklm-spark { fill: currentColor; stroke: none; }
.gemini-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: rgba(34,197,94,.42);
  background: linear-gradient(135deg, rgba(34,197,94,.18), rgba(59,130,246,.13), rgba(168,85,247,.12));
  color: #edfff7;
}
.gemini-button:hover { border-color: rgba(34,197,94,.68); background: linear-gradient(135deg, rgba(34,197,94,.25), rgba(59,130,246,.19), rgba(168,85,247,.17)); }
.gemini-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #60a5fa 48%, #a78bfa);
  color: #061019;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: -.06em;
}
.float-button { border-color: rgba(96,165,250,.32); color: #dceaff; }
.float-button:hover { border-color: rgba(96,165,250,.55); background: rgba(96,165,250,.13); }
.up-next { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.queue-head { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 0 15px; border-bottom: 1px solid var(--border); }
.queue-head strong, .queue-head small { display: block; }
.queue-head small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.autoplay { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.queue-list { max-height: calc(100vh - 178px); padding: 8px; overflow-y: auto; }
.queue-item { position: relative; }
.queue-card { display: grid; grid-template-columns: 122px 1fr; gap: 9px; width: 100%; padding: 7px 48px 7px 7px; border-radius: 9px; color: inherit; font: inherit; text-decoration: none; }
.queue-card:hover { background: var(--hover); }
.queue-thumb { aspect-ratio: 16 / 9; border-radius: 7px; }
.queue-card strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 11px; line-height: 1.35; }
.queue-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.queue-empty { padding: 28px 16px; color: var(--muted); font-size: 12px; text-align: center; }
.player-error {
  display: grid;
  width: 100%;
  height: 100%;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background: #050505;
  color: #fff;
  text-align: center;
}
.player-error span { color: #aaa; font-size: 13px; }
.player-error a { color: #7db3ff; font-size: 13px; font-weight: 750; }

#floatingRoot { position: fixed; z-index: 140; inset: 0; pointer-events: none; }
.in-page-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(760px, calc(100vw - 44px));
  height: min(470px, calc(100vh - 44px));
  grid-template-rows: 42px minmax(0, 1fr);
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 14px;
  background: #05070c;
  box-shadow: 0 30px 110px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.06) inset;
}
.in-page-float.short-float { width: min(390px, calc(100vw - 36px)); height: min(700px, calc(100vh - 36px)); }
.float-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 12px;
  padding: 0 10px 0 12px;
  cursor: grab;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(135deg, rgba(17,24,39,.96), rgba(8,11,18,.96));
  color: #fff;
}
.float-titlebar:active { cursor: grabbing; }
.float-brand { display: flex; min-width: 0; align-items: center; gap: 9px; font-size: 12px; font-weight: 750; }
.float-dot { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: var(--red); font-size: 9px; }
.float-title { overflow: hidden; color: rgba(255,255,255,.82); text-overflow: ellipsis; white-space: nowrap; }
.float-actions { display: flex; align-items: center; gap: 7px; }
.float-actions button, .float-actions a {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.09);
  color: #fff;
  font-size: 15px;
  text-decoration: none;
}
.float-actions button:hover, .float-actions a:hover { background: rgba(255,255,255,.18); }
.float-frame { overflow: hidden; background: #000; }
.float-frame > div, .float-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.short-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.96);
}
.short-close {
  position: absolute;
  z-index: 3;
  top: 22px;
  right: 24px;
  background: rgba(255,255,255,.12);
  color: #fff;
}
.short-stage {
  display: flex;
  align-items: stretch;
  gap: 18px;
  height: 100vh;
  height: 100svh;
  max-height: 100vh;
  max-height: 100svh;
  max-width: min(100vw, 1600px);
  padding: 0 16px;
}
.short-shell { display: flex; align-items: stretch; gap: 12px; height: 100%; min-width: 0; }
.short-player {
  position: relative;
  overflow: hidden;
  height: 100%;
  aspect-ratio: 9 / 16;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px;
  background: #000;
  box-shadow: 0 35px 100px rgba(0,0,0,.6);
}
.short-action-stack { display: grid; align-content: end; gap: 14px; width: 62px; padding-bottom: 18px; }
.short-action-stack button, .short-action-stack a {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.short-action-stack span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  font-size: 19px;
  font-weight: 800;
}
.short-action-stack button:hover span, .short-action-stack button.active span, .short-action-stack a:hover span { background: rgba(255,255,255,.22); }
.short-action-stack .action-avatar { background: linear-gradient(145deg, #6d3ce0, #db315a); font-size: 12px; font-weight: 900; }
.short-action-stack .gemini-icon { background: linear-gradient(135deg, #34d399, #60a5fa 48%, #a78bfa); color: #07111d; font-size: 12px; letter-spacing: -.08em; }
.short-action-stack .gemini-button:hover .gemini-icon { box-shadow: 0 0 0 4px rgba(52,211,153,.12); }
.short-action-stack button.active span { color: #ff6685; }
.short-action-stack .short-like.active span {
  border-color: rgba(255,102,133,.55);
  background: rgba(255,102,133,.18);
  color: #ff6685;
}
.short-action-stack .short-like.active small { color: #ff9bad; }
.short-action-stack small { color: rgba(255,255,255,.78); font-size: 10px; }
.short-drawer {
  width: 0;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px;
  background: #171717;
  color: #fff;
  transition: width .22s ease, opacity .18s ease;
  pointer-events: none;
}
.short-drawer.open {
  display: flex;
  width: min(480px, 36vw);
  min-width: min(480px, 36vw);
  height: 100%;
  flex-direction: column;
  opacity: 1;
  pointer-events: auto;
}
.short-drawer-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; min-height: 76px; padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.short-drawer-head h2 { margin: 0; font-size: 18px; }
.short-drawer-head h2 small { margin-left: 5px; color: #999; font-size: 12px; font-weight: 500; }
.short-drawer-head button { width: 34px; height: 34px; cursor: pointer; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 20px; }
.short-comments { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
.short-description { max-height: calc(min(88vh, 850px) - 78px); overflow-y: auto; }
.comments-cache-note { padding: 9px 17px; border-bottom: 1px solid rgba(255,255,255,.08); color: #999; font-size: 10px; }
.comments-open-youtube { flex: 0 0 auto; padding: 14px 17px; border-top: 1px solid rgba(255,255,255,.12); color: #7db3ff; font-size: 11px; font-weight: 750; text-decoration: none; }
.short-comment { display: grid; grid-template-columns: 36px 1fr; gap: 11px; padding: 15px 17px; border-bottom: 1px solid rgba(255,255,255,.08); }
.comment-avatar { display: grid; width: 34px; height: 34px; overflow: hidden; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #663ad4, #dc2f56); font-size: 9px; font-weight: 800; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.comment-head strong { font-size: 11px; }
.comment-head span, .short-comment > div > small { color: #aaa; font-size: 9px; }
.short-comment p { margin: 7px 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.pinned-comment { display: inline-block; margin-top: 5px; color: #aaa; }
.short-description { padding: 20px; }
.short-description > strong { display: block; font-size: 15px; line-height: 1.45; }
.short-description > p { color: #ddd; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.short-description dl { display: grid; gap: 8px; margin: 20px 0; }
.short-description dl div { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.short-description dt { color: #999; font-size: 10px; }
.short-description dd { margin: 0; font-size: 11px; text-align: right; }
.short-description a, .drawer-empty a { color: #7db3ff; font-size: 12px; font-weight: 750; }
.drawer-empty { display: grid; min-height: 350px; place-items: center; align-content: center; padding: 30px; text-align: center; }
.drawer-empty > span { font-size: 28px; }
.drawer-empty strong { margin-top: 12px; }
.drawer-empty p { color: #aaa; font-size: 12px; line-height: 1.55; }
.short-controls { display: grid; align-self: center; align-content: center; gap: 12px; height: auto; }
.short-controls button {
  display: grid;
  width: 48px;
  height: 48px;
  cursor: pointer;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 20px;
}
.short-controls button:disabled { opacity: .25; cursor: not-allowed; }

.settings, .empty { max-width: 1100px; margin: 18px auto; }
.settings-hero, .settings-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}
.settings-hero h1 { margin: 0; }
.settings-hero p, .settings-card p { color: var(--muted); line-height: 1.6; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.settings-card strong { display: block; color: var(--red); font-size: 30px; }
.settings-card h2 { margin: 8px 0 0; font-size: 15px; }
.danger {
  padding: 10px 15px;
  cursor: pointer;
  border: 1px solid rgba(255,0,51,.35);
  border-radius: 9px;
  background: rgba(255,0,51,.08);
  color: var(--red);
  font-weight: 750;
}
.history-tools { margin-top: 16px; }
.liked-tools {
  max-width: 1680px;
  margin: 0 auto 28px;
}
.ignored-tools {
  max-width: 1680px;
  margin: 0 auto 28px;
  border-color: color-mix(in srgb, var(--muted) 38%, var(--border));
}
.liked-tools .settings-actions, .ignored-tools .settings-actions { justify-content: flex-start; }
.source-manager, .discovery-manager { margin-top: 16px; }
.manager-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.manager-heading h2 { margin: 0; font-size: 18px; }
.manager-heading small { color: var(--muted); }
.manager-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.channel-search { display: flex; height: 40px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2); }
.channel-search span { color: var(--muted); }
.channel-search input { width: min(210px, 24vw); border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 11px; }
.channel-editor { display: grid; gap: 10px; max-height: 760px; overflow-y: auto; padding-right: 3px; }
.channel-editor-row[hidden] { display: none; }
.channel-editor-row {
  display: grid;
  grid-template-columns: 1.15fr .9fr 1.35fr .8fr 76px 104px 82px auto;
  align-items: end;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg);
}
.channel-editor-row label, .discovery-fields label { display: grid; gap: 6px; min-width: 0; }
.channel-editor-row label > span, .discovery-fields label > span { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.channel-editor-row input, .discovery-fields textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
}
.channel-editor-row input { height: 38px; padding: 0 10px; font-size: 11px; }
.channel-editor-row input:focus, .discovery-fields textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 14%, transparent); }
.channel-editor-row .monitor-toggle { display: flex; min-height: 38px; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; }
.channel-editor-row .monitor-toggle input { width: auto; height: auto; }
.channel-editor-row .monitor-toggle span { font-size: 10px; text-transform: none; }
.remove-channel { min-height: 38px; }
.discovery-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.discovery-fields textarea { resize: vertical; padding: 11px; font: inherit; font-size: 12px; line-height: 1.5; }
.apply-settings-bar { position: sticky; z-index: 8; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 15px; border: 1px solid color-mix(in srgb, var(--green) 35%, var(--border)); border-radius: 13px; background: color-mix(in srgb, var(--green) 7%, var(--bg) 93%); box-shadow: 0 12px 38px rgba(0,0,0,.22); }
.apply-settings-bar strong, .apply-settings-bar span { display: block; }
.apply-settings-bar span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.apply-settings { min-height: 42px; padding: 0 17px; cursor: pointer; border: 0; border-radius: 21px; background: var(--green); color: #06120e; font-size: 11px; font-weight: 850; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.action-button {
  min-height: 40px;
  padding: 0 15px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}
.action-button:hover { background: var(--hover); }
.action-button.compact { min-height: 34px; padding: 0 12px; font-size: 11px; }
.action-button:disabled, .danger:disabled {
  cursor: not-allowed;
  opacity: .46;
}
.health-grid .settings-card strong { overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.empty { display: grid; min-height: 380px; place-items: center; align-content: center; text-align: center; }
.empty span { display: grid; width: 68px; height: 68px; place-items: center; border-radius: 50%; background: rgba(52,211,153,.1); color: var(--green); font-size: 30px; }
.empty h2 { margin: 16px 0 0; }
.empty p { max-width: 450px; color: var(--muted); line-height: 1.6; }
.loading-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.loading-grid i { aspect-ratio: 16/9; border-radius: 13px; background: linear-gradient(110deg,var(--surface) 8%,var(--surface-2) 18%,var(--surface) 33%); background-size: 200% 100%; animation: shine 1.4s linear infinite; }
@keyframes shine { to { background-position-x: -200%; } }
.scrim { display: none; }

@media (max-width: 1100px) {
  .short-drawer.open { width: min(300px, 27vw); min-width: min(300px, 27vw); }
}
@media (max-width: 1040px) {
  .topbar { grid-template-columns: 200px 1fr 170px; }
  .updated-label { display: none; }
  .player-layout { grid-template-columns: 1fr 330px; }
  .channel-editor-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .channel-editor-row .channel-url { grid-column: span 2; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-102%); box-shadow: var(--shadow); transition: transform .2s ease; }
  .sidebar.open, body.sidebar-collapsed .sidebar.open { transform: translateX(0); }
  body.sidebar-collapsed .sidebar { transform: translateX(-102%); }
  .scrim { position: fixed; z-index: 35; inset: 64px 0 0; display: block; pointer-events: none; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .2s; }
  .scrim.open { pointer-events: auto; opacity: 1; }
  .content, body.sidebar-collapsed .content { margin-left: 0; }
  .player-layout { grid-template-columns: 1fr; }
  .queue-list { max-height: 480px; }
}
@media (max-width: 680px) {
  .topbar { grid-template-columns: 1fr auto; height: 58px; padding: 0 10px; }
  .search-form { position: fixed; top: 58px; right: 0; left: 0; height: 50px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--bg); }
  .topbar-actions .icon-button:first-of-type, .profile-avatar { display: none; }
  .sidebar { top: 108px; }
  .scrim { inset: 108px 0 0; }
  .content { padding: 124px 14px 44px; }
  .toolbar { top: 108px; margin: -16px -14px 18px; padding: 7px 14px; }
  .chip { padding: 0 11px; font-size: 11px; }
  .video-grid { grid-template-columns: 1fr; }
  .short-carousel { grid-template-columns: minmax(0, 1fr); }
  .carousel-nav { display: none; }
  .shorts-row { grid-auto-columns: minmax(145px, 45vw); }
  .player-frame { margin-inline: -14px; border-radius: 0; }
  .short-stage { position: relative; width: 100%; max-width: none; height: 100%; gap: 0; padding: 0; }
  .short-shell { position: relative; width: 100%; height: 100%; gap: 0; }
  .short-player { width: 100%; height: 100%; flex: 1 1 auto; aspect-ratio: auto; border: 0; border-radius: 0; }
  .short-action-stack { position: absolute; z-index: 5; right: 10px; bottom: 168px; width: 50px; padding: 0; }
  .short-action-stack span { width: 44px; height: 44px; }
  .short-controls { position: absolute; z-index: 6; top: 68px; right: 10px; bottom: auto; }
  .short-controls button { width: 44px; height: 44px; }
  .short-drawer, .short-drawer.open {
    position: absolute;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-width: 100%;
    height: 0;
    max-height: none;
    border-radius: 18px 18px 0 0;
    transition: height .22s ease, opacity .18s ease;
  }
  .short-drawer.open { height: 68%; }
  .short-comments { max-height: none; }
  .short-description { max-height: calc(68vh - 76px); }
  .channel-editor-row { grid-template-columns: 1fr; }
  .channel-editor-row .channel-url { grid-column: auto; }
  .discovery-fields { grid-template-columns: 1fr; }
  .manager-heading, .apply-settings-bar { align-items: stretch; flex-direction: column; }
  .manager-tools { align-items: stretch; flex-direction: column; }
  .channel-search input { width: 100%; }
  .apply-settings { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .author-row { align-items: flex-start; flex-direction: column; gap: 14px; }
  .player-actions { align-items: flex-start; justify-content: flex-start; width: 100%; }
}

@media (max-width: 680px) and (max-height: 780px) {
  .short-action-stack {
    top: 174px;
    right: 4px;
    bottom: 112px;
    align-content: start;
    gap: 6px;
    width: 44px;
    max-height: calc(100svh - 286px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    touch-action: pan-y;
  }
  .short-action-stack button, .short-action-stack a { gap: 2px; }
  .short-action-stack span { width: 34px; height: 34px; font-size: 14px; }
  .short-action-stack small { font-size: 8px; }
}
