:root {
  --bg: #0b0b12;
  --bg-elevated: #14141f;
  --panel: #171724;
  --panel-2: #1d1d2d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f1fa;
  --muted: #9b96b3;
  --accent: #ff2d6a;
  --accent-2: #8b5cf6;
  --accent-3: #22d3ee;
  --success: #34d399;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --header-h: 64px;
  --sidebar-w: 240px;
}

body.light-mode {
  --bg: #f7f6fb;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1effa;
  --line: rgba(20, 15, 40, 0.08);
  --line-strong: rgba(20, 15, 40, 0.14);
  --text: #19152c;
  --muted: #6d6786;
  --shadow: 0 24px 60px rgba(40, 20, 70, 0.1);
  --shadow-soft: 0 10px 30px rgba(40, 20, 70, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ────────────────────────── top bar ────────────────────────── */

.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
}

.top-bar-left { display: flex; align-items: center; gap: 14px; }
.top-bar-right { display: flex; align-items: center; gap: 8px; }
.top-bar-center { flex: 1; display: flex; justify-content: center; max-width: 640px; margin: 0 auto; }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  color: var(--text);
  transition: background 0.18s ease;
}

.icon-btn:hover { background: var(--panel-2); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 8px 20px rgba(255, 45, 106, 0.35);
}

.search-form {
  width: 100%;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--panel);
}

.search-form input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text);
  padding: 11px 18px;
  font-size: 0.95rem;
  outline: none;
}

.search-btn {
  width: 48px;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: var(--text);
  border-left: 1px solid var(--line);
}

.search-btn:hover { background: var(--line-strong); }

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

.points-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel-2);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text);
}

.points-pill i { color: #f5b942; }
.points-pill:hover { background: var(--line-strong); }

.auth-menu-wrap { position: relative; }

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--panel-2);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}

.auth-pill:hover { background: var(--line-strong); }

.auth-pill-caret { font-size: 0.7rem; color: var(--muted); margin-left: 2px; }

.auth-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  z-index: 60;
}

.auth-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.auth-menu-item:hover { background: var(--panel-2); }
.auth-menu-item i { width: 16px; color: var(--muted); }
.auth-menu-item-danger { color: var(--accent); }
.auth-menu-item-danger i { color: var(--accent); }

.avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 900;
  font-size: 0.8rem;
  overflow: hidden;
  flex: none;
}

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

.sign-in-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent-3);
}

.sign-in-btn:hover { background: var(--panel-2); }

/* ────────────────────────── layout ────────────────────────── */

.layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  padding: 16px 12px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--bg);
  transition: transform 0.25s ease;
  z-index: 40;
}

.sidebar.collapsed { transform: translateX(-100%); }

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

.side-link {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.side-link i { width: 20px; text-align: center; color: var(--muted); }
.side-link:hover { background: var(--panel-2); }
.side-link.active { background: var(--panel-2); }
.side-link.active i { color: var(--accent); }

.side-divider { height: 1px; background: var(--line); margin: 14px 4px; }
.side-section-label { padding: 0 14px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.side-tags { display: flex; flex-direction: column; gap: 2px; }

/* Channels listed in the sidebar instead of tags. */
.side-user { gap: 12px; padding-block: 8px; text-decoration: none; }
.side-user-avatar { width: 26px; height: 26px; font-size: 0.66rem; }
.side-user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .side-user .verified-check { margin: 0; }
.side-user .verified-check i { width: auto; color: inherit; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 24px 28px 60px;
  transition: margin-left 0.25s ease;
  min-width: 0;
}

.main-content.full-width { margin-left: 0; }

.view[hidden] { display: none; }

/* ────────────────────────── chips ────────────────────────── */

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

.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.chip:hover { background: var(--line-strong); }
.chip.active { background: var(--text); color: var(--bg); }

/* ────────────────────────── video grid ────────────────────────── */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px 16px;
}

.video-card { cursor: pointer; }

/* ────────────────────────── playlists ────────────────────────── */

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px 16px;
  margin-top: 16px;
}

.playlist-card { cursor: pointer; }

.playlist-card .thumb-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.6rem;
}

.playlist-card-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
}

.playlist-card-title {
  margin: 10px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.playlist-pick-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.playlist-pick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.playlist-pick-item:hover { background: var(--panel-2); }

.playlist-pick-item i { color: var(--muted); }
.playlist-pick-item.in-playlist i { color: var(--accent); }

.new-playlist-form {
  display: flex;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.new-playlist-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.88rem;
}

.thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--panel-2);
}

.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.video-card:hover .thumb-wrap img { transform: scale(1.04); }

.thumb-wrap .thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: var(--muted);
  background: linear-gradient(145deg, var(--panel-2), var(--panel));
}

.duration-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.video-meta-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.video-meta-row .avatar-circle { margin-top: 2px; }

.video-meta-text { flex: 1; min-width: 0; }

.video-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-channel { font-size: 0.82rem; color: var(--muted); margin: 0; }
.video-stats { font-size: 0.8rem; color: var(--muted); margin: 2px 0 0; }

.load-more-wrap { display: flex; justify-content: center; margin-top: 32px; }

.load-more-btn {
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-weight: 700;
  font-size: 0.88rem;
}

.load-more-btn:hover { background: var(--panel-2); }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted); }

/* ────────────────────────── watch page ────────────────────────── */

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

#watchVideo { width: 100%; height: 100%; display: block; background: #000; }

.quality-menu-wrap { position: absolute; top: 12px; right: 12px; z-index: 5; }

.quality-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(2px);
}

.quality-btn:hover { background: rgba(0, 0, 0, 0.72); }

.quality-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.quality-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
  text-align: left;
}

.quality-menu-item:hover { background: rgba(255, 255, 255, 0.12); }
.quality-menu-item.active { color: var(--accent-3); }
.quality-menu-item.active i { color: var(--accent-3); }

.watch-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 16px 0 8px;
}

.watch-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.watch-meta { color: var(--muted); font-size: 0.88rem; }
.watch-actions { display: flex; gap: 8px; }

.pill-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--panel-2);
  font-weight: 700;
  font-size: 0.85rem;
}

.pill-action:hover { background: var(--line-strong); }

/* Like and dislike share one pill, with the like ratio underneath. */
.reaction-wrap { display: flex; flex-direction: column; gap: 5px; }
.reaction-pill { display: inline-flex; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.reaction-pill .pill-action { border-radius: 0; background: transparent; }
.reaction-pill .pill-action:hover { background: var(--line-strong); }
.reaction-pill .pill-action + .pill-action { border-inline-start: 1px solid var(--line-strong); }
.reaction-pill span[hidden] { display: none; }
.reaction-bar { height: 3px; border-radius: 999px; background: var(--line-strong); overflow: hidden; }
.reaction-bar[hidden] { display: none; }
#reactionBarFill { height: 100%; background: var(--accent); }
.pill-action.active { color: var(--accent); }

.share-menu-wrap { position: relative; }

.share-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 190px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  z-index: 60;
}

.share-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.share-menu-item:hover { background: var(--panel-2); }
.share-menu-item i { width: 16px; color: var(--muted); }

.channel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.channel-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 900;
  overflow: hidden;
  flex: none;
}

.channel-avatar.large { width: 88px; height: 88px; font-size: 1.6rem; }
.channel-avatar img { width: 100%; height: 100%; object-fit: cover; }

.channel-info { flex: 1; min-width: 0; }
.channel-info strong { display: block; font-size: 0.98rem; }
.channel-info span { color: var(--muted); font-size: 0.82rem; }

.follow-btn {
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  font-size: 0.85rem;
  flex: none;
}

.follow-btn.following { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong); }

.description-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--panel-2);
  font-size: 0.9rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.description-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

.tag-link {
  color: var(--accent-3);
  font-weight: 700;
  font-size: 0.86rem;
}

.tag-link:hover { text-decoration: underline; }

.comments-section { margin-top: 28px; }
.comments-section h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 16px; }

.comment-form { display: flex; gap: 10px; margin-bottom: 20px; }

.comment-form input {
  flex: 1;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  background: none;
  color: var(--text);
  padding: 8px 2px;
  font-size: 0.92rem;
  outline: none;
}

.comment-form input:focus { border-color: var(--accent); }

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}

.primary-btn:hover { filter: brightness(1.08); }

.comment-list { display: grid; gap: 16px; }

.comment-item { display: flex; gap: 12px; }
.comment-item .avatar-circle { margin-top: 2px; }
.comment-body { flex: 1; min-width: 0; }
.comment-author-link { font-size: 0.86rem; font-weight: 700; color: var(--text); }
.comment-author-link:hover { text-decoration: underline; }
.comment-body p { margin: 3px 0 0; font-size: 0.9rem; color: var(--text); }
.comment-body small { color: var(--muted); font-size: 0.76rem; }

.watch-sidebar { display: flex; flex-direction: column; gap: 10px; }
.section-label { font-weight: 800; font-size: 0.92rem; margin-bottom: 6px; }

/* "Up next" with the autoplay switch beside it. */
.up-next-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.up-next-head .section-label { margin-bottom: 0; }

.autoplay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.autoplay-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.autoplay-switch {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.18s ease;
}

.autoplay-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: inset-inline-start 0.18s ease;
}

.autoplay-toggle input:checked + .autoplay-switch { background: var(--accent); }
.autoplay-toggle input:checked + .autoplay-switch::after { inset-inline-start: 18px; }
.autoplay-toggle input:focus-visible + .autoplay-switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Previous / next on the player. They appear while the pointer is over
   the video (always on touch screens) and keep their sides in every
   language, like the transport buttons of any player. */
.player-skip {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(10, 10, 16, 0.62);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 1.05rem;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.18s ease, background 0.18s ease;
}

.player-skip[hidden] { display: none; }
.player-skip-prev { left: 14px; }
.player-skip-next { right: 14px; }
.player-shell:hover .player-skip, .player-skip:focus-visible { opacity: 1; }
.player-skip:hover { background: var(--accent); }

.player-next-preview {
  position: absolute;
  top: 50%;
  right: 72px;
  z-index: 4;
  width: 210px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(16, 16, 24, 0.94);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.18s ease;
}

.player-skip-next:hover + .player-next-preview,
.player-skip-next:focus-visible + .player-next-preview { opacity: 1; }
.player-next-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.74rem; color: rgba(255, 255, 255, 0.7); }
.player-next-label kbd { padding: 1px 6px; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 5px; font: inherit; font-weight: 700; color: #fff; }
.player-next-preview img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #000; }
.player-next-preview strong { font-size: 0.82rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (hover: none) {
  .player-skip { opacity: 0.85; }
  .player-next-preview { display: none; }
}

/* Shown over the finished video while the countdown runs. */
.autoplay-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  color: #fff;
  background: rgba(5, 5, 10, 0.82);
}

.autoplay-overlay[hidden] { display: none; }
.autoplay-overlay-label { font-size: 0.82rem; font-weight: 700; color: rgba(255, 255, 255, 0.7); }

.autoplay-overlay-title {
  max-width: min(520px, 100%);
  font-size: 1.05rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.autoplay-count {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 4px 0;
  border-radius: 50%;
  border: 3px solid var(--accent);
  font-size: 1.4rem;
  font-weight: 800;
}

.autoplay-overlay-actions { display: flex; gap: 10px; }
.autoplay-overlay .secondary-btn { color: #fff; border-color: rgba(255, 255, 255, 0.35); background: transparent; }

.suggested-item {
  display: flex;
  gap: 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 6px;
  transition: background 0.18s ease;
}

.suggested-item:hover { background: var(--panel-2); }

.suggested-thumb {
  width: 160px;
  flex: none;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-2);
}

.suggested-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.suggested-info { flex: 1; min-width: 0; }
.suggested-info .video-title { font-size: 0.86rem; }
.suggested-info .video-channel { font-size: 0.78rem; }
.suggested-info .video-stats { font-size: 0.76rem; }

/* ────────────────────────── channel page ────────────────────────── */

.channel-banner {
  position: relative;
  height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: -56px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent), var(--accent-3));
}

.channel-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18) 0, transparent 40%),
                     radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.14) 0, transparent 45%);
}

.channel-banner img.banner-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-edit-btn {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  backdrop-filter: blur(6px);
}

.banner-edit-btn:hover { background: rgba(0, 0, 0, 0.68); }
.banner-edit-btn[hidden] { display: none; }

.channel-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 0 12px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.channel-avatar-wrap { position: relative; flex: none; }

.avatar-edit-btn {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--bg);
  border: 3px solid var(--bg);
  font-size: 0.8rem;
}

.avatar-edit-btn:hover { filter: brightness(1.1); }
.avatar-edit-btn[hidden] { display: none; }

.edit-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  flex: none;
}

.edit-profile-btn:hover { background: var(--panel-2); }
.edit-profile-btn[hidden] { display: none; }

.channel-avatar.xlarge {
  width: 112px;
  height: 112px;
  font-size: 2.1rem;
  border: 4px solid var(--bg);
  box-shadow: var(--shadow-soft);
  flex: none;
}

.channel-header-info { flex: 1; min-width: 0; padding-bottom: 8px; }

.channel-name-row { display: flex; align-items: center; gap: 8px; }
.channel-name-row h1 { font-size: 1.55rem; margin: 0; letter-spacing: -0.01em; }

.verified-badge,
.verified-check {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  color: #fff;
  box-shadow: 0 0 0 2px var(--bg), 0 2px 8px rgba(34, 211, 238, 0.35);
}

.verified-badge { width: 22px; height: 22px; font-size: 0.72rem; }
.verified-badge[hidden] { display: none; }

.channel-live-badge {
  width: auto;
  height: auto;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: none;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  gap: 5px;
}

.channel-live-badge i { font-size: 0.5rem; }
.channel-live-badge[hidden] { display: none; }
.channel-live-badge:hover { filter: brightness(1.1); }

.verified-check {
  width: 15px;
  height: 15px;
  font-size: 0.56rem;
  margin-left: 4px;
  vertical-align: middle;
}

.verified-check.lg { width: 20px; height: 20px; font-size: 0.68rem; margin-left: 6px; }

.channel-stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.stats-dot { opacity: 0.5; }

.handle-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.74rem;
  flex: none;
}

.handle-copy-btn:hover { background: var(--panel-2); color: var(--text); }

.channel-bio {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  max-width: 560px;
  line-height: 1.5;
}

.channel-bio[hidden] { display: none; }

/* ────────────────────────── channel tabs ────────────────────────── */

.channel-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.channel-tab {
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

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

.channel-tab-panel[hidden] { display: none; }

.about-card {
  max-width: 640px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
}

.about-card h3 { margin: 0 0 10px; font-size: 1rem; }
.about-card > p { margin: 0 0 20px; color: var(--muted); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }

.about-stats {
  display: flex;
  gap: 28px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.about-stat { display: flex; flex-direction: column; gap: 2px; }
.about-stat strong { font-size: 1.15rem; font-weight: 800; }
.about-stat span { color: var(--muted); font-size: 0.78rem; }

.about-joined { margin-top: 14px; color: var(--muted); font-size: 0.84rem; }

/* ────────────────────────── settings ────────────────────────── */

.settings-page { max-width: 640px; }

/* ────────────────────────── following list ────────────────────────── */

.people-list { max-width: 640px; display: grid; gap: 10px; }

.person-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
}

.person-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.person-info .avatar-circle { width: 44px; height: 44px; font-size: 1rem; }

.person-text { min-width: 0; }
.person-text strong { display: block; font-size: 0.94rem; }
.person-text span { color: var(--muted); font-size: 0.82rem; }

.unfollow-btn {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: #ff8fa8;
  border: 1px solid var(--line-strong);
}

.unfollow-btn:hover { background: rgba(255, 45, 106, 0.12); }
.settings-title { font-size: 1.5rem; margin: 0 0 20px; letter-spacing: -0.01em; }

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.history-head .settings-title { margin-bottom: 0; }

.history-group { margin-bottom: 36px; }

/* Rows of people on Trending: Top creators, Add friends. */
.people-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.people-head .history-date-label { margin-bottom: 0; }
.people-hide-btn { width: 32px; height: 32px; color: var(--muted); }

.people-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}

.creator-card {
  flex: none;
  width: 156px;
  padding: 16px 10px 14px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.creator-card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.creator-card-avatar { width: 68px; height: 68px; font-size: 1.4rem; margin-bottom: 6px; }

.creator-card-link strong {
  max-width: 100%;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creator-card-handle, .creator-card-meta {
  max-width: 100%;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creator-follow-btn { padding: 7px 18px; font-size: 0.8rem; margin-top: auto; }

.history-date-label {
  font-size: 1.02rem;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--text);
}

.settings-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.settings-row + .settings-row { border-top: 1px solid var(--line); }
/* Rows only some viewers get (signed-in settings) carry the hidden attribute. */
.settings-row[hidden] { display: none; }

.settings-row-text { display: flex; flex-direction: column; gap: 2px; }
.settings-row-text strong { font-size: 0.94rem; }
.settings-row-text span { color: var(--muted); font-size: 0.82rem; }

.settings-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.settings-card-head i { font-size: 1.3rem; color: var(--accent-3); margin-top: 2px; }
.settings-card-head strong { display: block; font-size: 0.96rem; }
.settings-card-head span { color: var(--muted); font-size: 0.82rem; }

.account-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.account-id-value {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  word-break: break-all;
}

.verified-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--panel-2);
}

.verified-status-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 1.1rem;
}

.verified-status.is-verified .verified-status-icon {
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  color: #fff;
}

.verified-status.not-verified .verified-status-icon {
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line-strong);
}

.verified-status-text { flex: 1; min-width: 0; }
.verified-status-text strong { display: block; font-size: 0.92rem; }
.verified-status-text span { color: var(--muted); font-size: 0.8rem; }

/* ────────────────────────── modal ────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 5, 10, 0.72); backdrop-filter: blur(4px); }

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 26px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-head h3 { font-size: 1.15rem; margin: 0; }
.modal-hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 16px; }

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--panel);
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  padding: 9px 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--muted);
}

.auth-tab.active { background: var(--text); color: var(--bg); }

.auth-form { display: grid; gap: 12px; }
.auth-form[hidden] { display: none; }

.auth-form input {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.92rem;
  outline: none;
  width: 100%;
}

.auth-form input:focus { border-color: var(--accent); }

.auth-form textarea {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.92rem;
  outline: none;
  width: 100%;
  resize: vertical;
  font-family: inherit;
}

.auth-form textarea:focus { border-color: var(--accent); }

.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.field-hint { font-weight: 500; font-size: 0.76rem; color: var(--muted); min-height: 1em; }
.field-hint.locked { color: #ff8fa8; }

.auth-form input:disabled { opacity: 0.55; cursor: not-allowed; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.phone-row { display: flex; gap: 8px; }
.phone-row input { flex: 1; min-width: 0; }

.country-picker { position: relative; flex: none; }

.country-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 10px;
  min-width: 96px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 700;
  font-size: 0.86rem;
}

.country-btn i { font-size: 0.7rem; opacity: 0.6; margin-left: 2px; }

.country-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 10;
  width: 260px;
  max-height: 240px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.country-dropdown[hidden] { display: none; }

.country-dropdown input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.86rem;
  outline: none;
}

.country-list { max-height: 190px; overflow-y: auto; padding: 4px; }

.country-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--text);
}

.country-option:hover { background: var(--panel-2); }
.country-option span.name { flex: 1; text-align: left; }
.country-option span.code { color: var(--muted); font-weight: 700; font-size: 0.8rem; }

.phone-code-row { display: flex; gap: 8px; }
.phone-code-row input { flex: 1; min-width: 0; }

.secondary-btn-sm {
  flex: none;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.secondary-btn-sm:hover { background: var(--panel-2); }
.secondary-btn-sm:disabled { opacity: 0.5; cursor: default; }

.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  font-size: 0.86rem;
}

.secondary-btn:hover { background: var(--panel-2); }

.hint-text { margin: -4px 0 0; font-size: 0.78rem; color: var(--muted); min-height: 1em; }

/* ────────────────────────── upload ────────────────────────── */

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  font-size: 0.86rem;
  transition: border-color 0.15s, background 0.15s;
}

.upload-btn i { color: var(--accent); font-size: 0.9rem; }
.upload-btn:hover { border-color: var(--accent); background: var(--panel); }

.go-live-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  font-weight: 800;
  font-size: 0.86rem;
}

.go-live-btn:hover { background: rgba(239, 68, 68, 0.2); }

/* ────────────────────────── live ────────────────────────── */

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px 16px;
  margin-top: 16px;
}

.live-card { cursor: pointer; }

.live-card .thumb-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2rem;
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
}

.live-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.live-card-badge i { font-size: 0.5rem; }

.live-card-viewers {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
}

.live-player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

#livePlayerVideo { width: 100%; height: 100%; display: block; background: #000; object-fit: cover; }

.live-player-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  background: #0b0b12;
}

.live-player-empty i { font-size: 2rem; }
.live-player-empty[hidden] { display: none; }

.live-badge-row {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.live-badge i { font-size: 0.5rem; }

.live-viewer-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(2px);
}

.live-end-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.live-end-btn:hover { background: rgba(0, 0, 0, 0.72); }

.live-room-description { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }

.live-chat-panel {
  display: flex;
  flex-direction: column;
  height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}

.live-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-chat-item { font-size: 0.85rem; line-height: 1.4; }
.live-chat-item strong { font-weight: 700; margin-right: 4px; }
.live-chat-item.kind-join { color: var(--muted); font-style: italic; }

.live-gift-ticker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px;
  max-height: 110px;
  overflow-y: auto;
}

.live-gift-ticker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(245, 185, 66, 0.18), transparent);
  font-size: 0.8rem;
  font-weight: 600;
}

.live-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.live-chat-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.86rem;
}

.live-chat-form button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
}

.gift-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.gift-pick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.gift-pick-item:hover { background: var(--line-strong); }
.gift-pick-item .gift-pick-emoji { font-size: 1.8rem; }
.gift-pick-item .gift-pick-name { font-size: 0.74rem; font-weight: 700; text-align: center; }
.gift-pick-item .gift-pick-price { font-size: 0.72rem; color: #f5b942; font-weight: 800; }

.upload-panel { width: min(500px, 100%); padding: 22px 24px 24px; }
.upload-panel .modal-head { margin-bottom: 16px; }
.upload-panel .auth-form { gap: 14px; }
.upload-panel .auth-form textarea { resize: none; }

.upload-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--panel);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.upload-drop:hover { border-color: var(--accent); background: var(--panel-2); }

.upload-drop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.upload-drop-empty[hidden] { display: none; }

.upload-drop-empty i {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  font-size: 1.15rem;
  color: var(--accent);
}

.upload-drop-empty span { font-weight: 700; color: var(--text); font-size: 0.92rem; }
.upload-drop-empty small { font-size: 0.78rem; }

.upload-preview {
  width: 100%;
  max-height: 220px;
  display: block;
  background: #000;
  object-fit: contain;
}

.upload-preview[hidden] { display: none; }

/* The chosen file: name and size under the preview. */
.upload-file {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.upload-file[hidden] { display: none; }
.upload-file i { color: var(--accent); }
.upload-file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.upload-file small { flex: none; }

.upload-panel .primary-btn {
  justify-content: center;
  height: 46px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.upload-panel .primary-btn:disabled { opacity: 0.6; cursor: default; }

.upload-progress-wrap { display: flex; align-items: center; gap: 10px; }
.upload-progress-wrap[hidden] { display: none; }

.upload-progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

#uploadProgressLabel { font-size: 0.8rem; color: var(--muted); flex: none; }

/* ────────────────────────── image cropper ────────────────────────── */

.crop-panel { width: min(480px, 100%); }

.crop-stage {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
  cursor: grab;
  touch-action: none;
}

.crop-stage:active { cursor: grabbing; }

.crop-stage img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  user-select: none;
  pointer-events: none;
}

.crop-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
}

.crop-frame.circle { border-radius: 50%; }

.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
}

.crop-zoom-row input[type="range"] { flex: 1; }

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.oauth-divider::before, .oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.google-btn-wrap { display: flex; justify-content: center; }

.form-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 45, 106, 0.12);
  border: 1px solid rgba(255, 45, 106, 0.28);
  color: #ff8fa8;
  font-size: 0.84rem;
}

/* ────────────────────────── toast ────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 120;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 0.88rem;
}

/* ────────────────────────── responsive ────────────────────────── */

@media (max-width: 1080px) {
  .watch-layout { grid-template-columns: 1fr; }
  .watch-sidebar { order: 2; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .main-content { margin-left: 0; }
  .top-bar-center { display: none; }
}

@media (max-width: 560px) {
  .video-grid { grid-template-columns: 1fr; }
  .suggested-thumb { width: 120px; }
}

/* ────────────────────────── stories ────────────────────────── */

/* A ring on an avatar: a story to watch (light blue), already watched
   (grey) or live right now (red). Clicking it opens that. */
:root {
  --story-ring: #38bdf8;
  --story-ring-light: #e0f2fe;
}

.channel-avatar.story-ring,
.channel-avatar.live-ring {
  padding: 2px;
  background: var(--story-ring);
  cursor: pointer;
}

.channel-avatar.live-ring { background: #ef4444; }
.channel-avatar.story-ring.seen { background: var(--line-strong); }

.channel-avatar.story-ring > *,
.channel-avatar.live-ring > * {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--bg);
  object-fit: cover;
  display: grid;
  place-items: center;
}

.channel-avatar.story-ring > span,
.channel-avatar.live-ring > span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.channel-avatar.xlarge.story-ring,
.channel-avatar.xlarge.live-ring { padding: 3px; }

.channel-avatar.xlarge.story-ring > *,
.channel-avatar.xlarge.live-ring > * { border-width: 3px; }

.avatar-live-tag {
  position: absolute;
  left: 50%;
  bottom: -4px;
  z-index: 2;
  transform: translateX(-50%);
  padding: 2px 9px;
  border-radius: 999px;
  border: 2px solid var(--bg);
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.avatar-live-tag[hidden] { display: none; }

/* The row of stories on Trending. */
.story-strip-wrap[hidden] { display: none; }

.story-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.story-card {
  position: relative;
  flex: none;
  width: 112px;
  aspect-ratio: 9 / 16;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  isolation: isolate;
  background: var(--panel-2);
  color: #fff;
  text-align: start;
  cursor: pointer;
}

.story-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 32%, transparent 55%, rgba(0, 0, 0, 0.72));
}

.story-card-cover {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.story-card:hover .story-card-cover { transform: scale(1.05); }

.story-card-avatar {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  width: 38px;
  height: 38px;
  font-size: 0.8rem;
}

.story-card .story-card-avatar > * { border-color: rgba(0, 0, 0, 0.55); }

.story-card-name {
  position: absolute;
  inset-inline: 8px;
  bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.story-card-create { background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.story-card-create::after { display: none; }

.story-card-create-photo {
  position: absolute;
  inset: 0 0 32% 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
}

.story-card-create-photo img { width: 100%; height: 100%; object-fit: cover; }

.story-card-create-plus {
  position: absolute;
  top: 68%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border: 3px solid var(--panel);
  font-size: 0.8rem;
}

.story-card-create .story-card-name { text-align: center; color: var(--text); text-shadow: none; }

/* The story viewer. */
body.story-open { overflow: hidden; }

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 10, 0.94);
  backdrop-filter: blur(6px);
}

.story-viewer[hidden] { display: none; }

.story-stage {
  position: relative;
  height: min(92vh, 860px);
  aspect-ratio: 9 / 16;
  max-width: 100vw;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  color: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  user-select: none;
  touch-action: manipulation;
}

@media (max-width: 600px) {
  .story-stage { width: 100vw; height: 100dvh; aspect-ratio: auto; border-radius: 0; }
}

.story-media { position: absolute; inset: 0; display: grid; place-items: center; }
.story-media img, .story-media video { width: 100%; height: 100%; object-fit: contain; display: block; }

.story-stage::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 130px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, 0.6), transparent);
}

.story-progress { position: absolute; top: 10px; inset-inline: 10px; z-index: 4; display: flex; gap: 4px; }
.story-bar { flex: 1; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.35); overflow: hidden; }
.story-bar-fill { display: block; width: 0; height: 100%; background: #fff; }

.story-head {
  position: absolute;
  top: 22px;
  inset-inline: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.story-author { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; text-decoration: none; }
.story-author .avatar-circle { width: 34px; height: 34px; }
.story-author strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.story-time { flex: none; font-size: 0.78rem; color: rgba(255, 255, 255, 0.75); }
.story-head-actions { display: flex; gap: 6px; flex: none; }

.story-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
}

.story-icon-btn:hover { background: rgba(255, 255, 255, 0.2); }
.story-icon-btn[hidden] { display: none; }

.story-nav { position: absolute; top: 70px; bottom: 80px; z-index: 3; padding: 0; border: 0; background: transparent; cursor: pointer; }
.story-nav-prev { inset-inline-start: 0; width: 35%; }
.story-nav-next { inset-inline-end: 0; width: 65%; }

.story-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 3;
  margin: 0;
  padding: 48px 18px 22px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
}

.story-caption[hidden] { display: none; }

/* Sharing a story. */
.story-preview { width: 100%; max-height: 260px; display: block; object-fit: contain; background: #000; }
.story-preview[hidden] { display: none; }
.story-duration { display: flex; flex-wrap: wrap; gap: 8px; }

.story-duration-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
}

.story-duration-btn.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.story-upload-label { flex: none; font-size: 0.8rem; color: var(--muted); }

/* The same story / live ring on the small avatars of video cards. */
.avatar-circle.story-ring,
.avatar-circle.live-ring {
  padding: 1.5px;
  background: var(--story-ring);
  cursor: pointer;
}

.avatar-circle.live-ring { background: #ef4444; }
.avatar-circle.story-ring.seen { background: var(--line-strong); }

.avatar-circle.story-ring > *,
.avatar-circle.live-ring > * {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid var(--bg);
  object-fit: cover;
  display: grid;
  place-items: center;
}

.avatar-circle.story-ring > span,
.avatar-circle.live-ring > span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* Messages stay readable while a story is open. */
body.story-open .toast { z-index: 320; }

/* Under a story: likes for everyone, views for the owner. */
.story-foot {
  position: absolute;
  inset-inline: 12px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.story-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}

.story-pill[hidden] { display: none; }
.story-pill:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.story-pill:disabled { cursor: default; }
.story-like-btn i { font-size: 1.05rem; transition: transform 0.15s ease; }
.story-like-btn.liked i, .story-like-btn:disabled i { color: #ff2d6a; }
.story-like-btn.liked i { transform: scale(1.12); }

.story-caption { padding-bottom: 66px; }

/* Who watched: a sheet over the lower part of the story. */
.story-viewers {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 6;
  max-height: 62%;
  display: flex;
  flex-direction: column;
  border-radius: 18px 18px 0 0;
  background: #12121a;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.4);
}

.story-viewers[hidden] { display: none; }

.story-viewers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.story-viewers-list { overflow-y: auto; padding: 6px 8px 12px; }
.story-viewers-empty { padding: 26px 12px; text-align: center; color: rgba(255, 255, 255, 0.6); font-size: 0.9rem; }

.story-viewer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
}

.story-viewer-row:hover { background: rgba(255, 255, 255, 0.07); }
.story-viewer-row .avatar-circle { width: 38px; height: 38px; }
.story-viewer-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.story-viewer-text strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-viewer-text small { font-size: 0.76rem; color: rgba(255, 255, 255, 0.6); }
.story-viewer-liked { color: #ff2d6a; flex: none; }

/* The story ring is light blue with a soft light travelling around it;
   a live ring pulses. Watched stories (a grey ring) stay still. */
@property --story-ring-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 210deg;
}

.channel-avatar.story-ring:not(.seen),
.avatar-circle.story-ring:not(.seen) {
  background: conic-gradient(
    from var(--story-ring-angle, 210deg),
    var(--story-ring) 0deg,
    var(--story-ring) 200deg,
    var(--story-ring-light) 290deg,
    var(--story-ring) 360deg
  );
  animation: story-ring-turn 2.8s linear infinite;
}

@keyframes story-ring-turn {
  from { --story-ring-angle: 210deg; }
  to { --story-ring-angle: 570deg; }
}

.channel-avatar.live-ring,
.avatar-circle.live-ring { animation: live-ring-pulse 1.4s ease-in-out infinite; }

@keyframes live-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .channel-avatar.story-ring,
  .avatar-circle.story-ring,
  .channel-avatar.live-ring,
  .avatar-circle.live-ring { animation: none; }
}

/* ---- Replies to comments ---- */
.comment-thread { display: flex; flex-direction: column; gap: 8px; }
.comment-meta { display: flex; align-items: center; gap: 14px; margin-top: 3px; }
.comment-reply-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.comment-reply-btn:hover { color: var(--text); }
.comment-reply-to { color: var(--accent); font-weight: 700; }
.comment-replies { display: grid; gap: 12px; margin-inline-start: 42px; }
.comment-replies[hidden] { display: none; }
.comment-item.comment-reply .avatar-circle { width: 24px; height: 24px; font-size: 0.68rem; }
.comment-toggle-replies {
  align-self: flex-start;
  margin-inline-start: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.comment-toggle-replies:hover { background: var(--line); }
.reply-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-block: 4px;
  padding-inline: 12px 4px;
  border-radius: 999px;
  background: var(--line);
  font-size: 0.82rem;
  font-weight: 700;
}
.reply-chip[hidden] { display: none; }
.reply-chip-close {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.reply-chip-close:hover { background: var(--line-strong); color: var(--text); }

/* ---- Reporting a video ---- */
#watchReportBtn[hidden] { display: none; }
.card-report-btn, .card-delete-btn {
  align-self: flex-start;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}
.card-report-btn:hover { background: var(--line); color: var(--accent); }
.report-form { display: grid; gap: 10px; }
.report-question { margin: 0 0 4px; color: var(--muted); }
.report-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  background: var(--line);
  cursor: pointer;
}
.report-option:hover { border-color: var(--line-strong); }
.report-option:has(input:checked) { border-color: var(--accent); background: rgba(255, 45, 106, 0.1); }
.report-option input { position: absolute; opacity: 0; pointer-events: none; }
.report-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 45, 106, 0.14);
  color: var(--accent);
}
.report-text { display: flex; flex-direction: column; gap: 2px; }
.report-text small { color: var(--muted); font-size: 0.8rem; }
.report-note { margin: 2px 0 4px; color: var(--muted); font-size: 0.8rem; }
.report-form .primary-btn { justify-content: center; padding-block: 11px; }
.report-form .primary-btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.removal-panel { text-align: center; display: grid; gap: 10px; justify-items: center; }
.removal-panel h3 { margin: 0; }
.removal-panel p { margin: 0; }
.removal-icon { font-size: 2.6rem; color: #ef4444; }
.removal-panel .primary-btn { min-width: 140px; justify-content: center; margin-top: 6px; }
.removal-reason {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--line);
  font-weight: 800;
}

/* ---- Notifications: the bell and its panel ---- */
.notif-wrap { position: relative; }
.notif-wrap[hidden] { display: none; }
.notif-btn { position: relative; }
.notif-btn.ringing i { animation: notif-ring 0.9s ease; transform-origin: 50% 10%; }
@keyframes notif-ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(18deg); }
  30% { transform: rotate(-16deg); }
  45% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  75% { transform: rotate(4deg); }
}
.notif-count {
  position: absolute;
  top: 3px;
  inset-inline-end: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  border: 2px solid var(--bg);
}
.notif-count[hidden] { display: none; }
.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: -48px;
  width: 420px;
  max-width: calc(100vw - 24px);
  max-height: min(640px, calc(100vh - 90px));
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 70;
  overflow: hidden;
}
.notif-panel[hidden] { display: none; }
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 6px 18px;
  padding-inline: 18px 10px;
}
.notif-head h3 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.notif-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
}
.notif-mark:hover { background: var(--panel-2); color: var(--text); }
.notif-filters {
  display: flex;
  gap: 8px;
  padding: 6px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.notif-filters::-webkit-scrollbar { display: none; }
.notif-filter {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 0;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.notif-filter i { color: var(--muted); font-size: 0.75rem; }
.notif-filter.active { background: var(--text); color: var(--bg); }
.notif-filter.active i { color: var(--bg); }
.notif-list { overflow-y: auto; padding-bottom: 8px; }
.notif-section { padding: 12px 18px 4px; font-size: 0.86rem; font-weight: 800; }
.notif-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 18px;
  padding-inline: 18px 14px;
  cursor: pointer;
}
.notif-item:hover, .notif-item:focus-visible { background: var(--panel-2); outline: none; }
.notif-item.unread { background: rgba(255, 45, 106, 0.08); }
.notif-item.unread:hover { background: rgba(255, 45, 106, 0.13); }
.notif-faces { position: relative; flex: none; width: 46px; height: 46px; }
.notif-face, .notif-face > .avatar-circle { width: 44px; height: 44px; }
.notif-face > .avatar-circle { font-size: 1rem; }
.notif-face-icon {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--kind);
  background: color-mix(in srgb, var(--kind) 16%, transparent);
  font-size: 1.15rem;
}
.notif-face-pair { position: relative; display: block; }
.notif-face-pair > .avatar-circle { position: absolute; width: 32px; height: 32px; font-size: 0.75rem; }
.notif-face-pair > .avatar-circle:first-child { top: 0; inset-inline-start: 0; }
.notif-face-pair > .avatar-circle:last-child { bottom: 0; inset-inline-end: 0; box-shadow: 0 0 0 2px var(--panel); }
.notif-kind {
  position: absolute;
  bottom: -3px;
  inset-inline-end: -3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--kind);
  color: #fff;
  font-size: 0.58rem;
  border: 2px solid var(--panel);
}
.notif-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.notif-message {
  font-size: 0.88rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.notif-message strong { font-weight: 800; }
.notif-text small { color: var(--muted); font-size: 0.75rem; }
.notif-item.unread .notif-text small { color: var(--accent); font-weight: 700; }
.notif-thumb {
  flex: none;
  width: 72px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: var(--muted);
}
.notif-thumb img { width: 100%; height: 100%; object-fit: cover; }
.notif-follow {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}
.notif-follow.following { background: none; border-color: var(--line-strong); color: var(--text); }
.notif-live {
  flex: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
}
.notif-points {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(245, 185, 66, 0.16);
  font-size: 0.8rem;
  font-weight: 900;
}
.notif-points i { color: #f5b942; font-size: 0.75rem; }
.notif-remove {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.notif-item:hover .notif-remove, .notif-remove:focus-visible { opacity: 1; }
.notif-remove:hover { color: var(--text); background: var(--line-strong); }
.notif-loading { padding: 22px; text-align: center; color: var(--muted); }
.notif-empty { padding: 34px 26px 38px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.notif-empty p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.notif-empty-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 1.8rem;
  box-shadow: 0 12px 30px rgba(255, 45, 106, 0.3);
}
@media (max-width: 600px) {
  .notif-panel {
    position: fixed;
    top: calc(var(--header-h) + 6px);
    inset-inline: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - var(--header-h) - 16px);
  }
  .notif-remove { opacity: 1; }
}

/* ---- Comments: likes, hearts, pins, menu, sorting, emoji ---- */
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.comments-head h2 { margin: 0; }
.comment-sort { display: flex; gap: 6px; }
.comment-sort .chip { padding: 6px 14px; font-size: 0.8rem; }
.emoji-bar { display: flex; gap: 2px; margin: 0 0 6px; overflow-x: auto; scrollbar-width: none; }
.emoji-bar::-webkit-scrollbar { display: none; }
.emoji-bar button {
  flex: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.emoji-bar button:hover { background: var(--panel-2); transform: scale(1.12); }
.comment-form { position: relative; align-items: center; }
.comment-counter { color: var(--muted); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.comment-counter[hidden] { display: none; }
.comment-item { position: relative; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.comment-head small { color: var(--muted); font-size: 0.76rem; }
.comment-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.comment-badge.creator { background: rgba(255, 45, 106, 0.16); color: var(--accent); }
.comment-pinned { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; color: var(--muted); font-size: 0.76rem; font-weight: 700; }
.comment-pinned i { font-size: 0.7rem; }
.comment-text { overflow-wrap: anywhere; }
.comment-text.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.comment-more {
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}
.comment-more[hidden] { display: none; }
.comment-mention { color: var(--accent); font-weight: 700; }
.comment-mention:hover { text-decoration: underline; }
.comment-time {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-3);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.comment-like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  margin-inline-start: -8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}
.comment-like:hover { background: var(--panel-2); }
.comment-like.liked { color: #ff3b5c; }
.comment-like.liked i { animation: comment-pop 0.35s ease; }
@keyframes comment-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.45); }
  100% { transform: scale(1); }
}
.comment-hearted { position: relative; display: inline-flex; width: 26px; height: 22px; align-items: center; }
.comment-hearted .avatar-circle { width: 20px; height: 20px; font-size: 0.6rem; }
.comment-hearted i { position: absolute; bottom: -1px; inset-inline-end: 0; color: #e11d48; font-size: 0.62rem; }
.comment-menu-btn {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.6;
}
.comment-item:hover .comment-menu-btn, .comment-menu-btn:focus-visible { opacity: 1; }
.comment-menu-btn:hover { background: var(--panel-2); color: var(--text); }
.comment-menu {
  position: fixed;
  z-index: 80;
  min-width: 190px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.comment-menu[hidden] { display: none; }
.comment-menu .share-menu-item { text-align: start; }
.comment-menu .share-menu-item.danger { color: #ef4444; }

/* ---- Watch page: the More menu and what it opens ---- */
.watch-actions { flex-wrap: wrap; }
.more-menu-wrap { position: relative; }
.sleep-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
}
.sleep-badge[hidden] { display: none; }
.more-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  width: 290px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  z-index: 60;
}
.more-menu[hidden] { display: none; }
.more-menu .share-menu-item { text-align: start; text-decoration: none; }
.more-check { margin-inline-start: auto; color: var(--accent); visibility: hidden; }
.share-menu-item.on .more-check { visibility: visible; }
.more-menu-group { padding: 8px 12px 10px; }
.more-menu-label { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; font-weight: 600; margin-bottom: 8px; }
.more-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.more-chips button {
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}
.more-chips button:hover { background: var(--line-strong); }
.more-chips button.active { background: var(--accent); color: #fff; }
.watch-layout.theater { grid-template-columns: 1fr; }
.watch-layout.theater .player-shell { max-height: calc(100vh - var(--header-h) - 40px); }
.watch-layout.theater .watch-sidebar { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.resume-chip {
  position: absolute;
  bottom: 64px;
  inset-inline-start: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  padding-inline: 14px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  z-index: 4;
}
.resume-chip[hidden] { display: none; }
.resume-chip button {
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.resume-chip button:hover { background: rgba(255, 255, 255, 0.3); }
.player-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  pointer-events: none;
  z-index: 5;
}
.player-flash[hidden] { display: none; }
.player-flash.show { animation: player-flash 0.7s ease forwards; }
@keyframes player-flash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); }
}
.owner-stats {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 45, 106, 0.3);
  background: linear-gradient(120deg, rgba(255, 45, 106, 0.1), rgba(139, 92, 246, 0.06));
}
.owner-stats[hidden] { display: none; }
.owner-stats-head { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 10px; }
.owner-stats-head i { color: var(--accent); }
.owner-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.owner-stat strong { display: block; font-size: 1.15rem; font-weight: 900; }
.owner-stat span { color: var(--muted); font-size: 0.76rem; }
.video-info-title { margin: 0 0 12px; font-weight: 700; line-height: 1.4; }
.video-info-rows { display: grid; gap: 2px; }
.video-info-row { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.video-info-row:last-child { border-bottom: 0; }
.video-info-row i { width: 18px; color: var(--muted); text-align: center; }
.video-info-row span { flex: 1; color: var(--muted); }
.shortcut-list { display: grid; gap: 4px; }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.shortcut-row:last-child { border-bottom: 0; }
.shortcut-row kbd {
  min-width: 34px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  direction: ltr;
}
@media (max-width: 600px) {
  .owner-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Cards: badges, progress, menu ---- */
.thumb-wrap .card-badges {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.rank-badge {
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
}
.rank-badge.rank-1 { background: linear-gradient(135deg, #ffe08a, #f5b400); color: #1f1300; box-shadow: 0 2px 10px rgba(245, 180, 0, 0.5); }
.rank-badge.rank-2 { background: linear-gradient(135deg, #f1f5f9, #94a3b8); color: #1f1300; box-shadow: 0 2px 10px rgba(148, 163, 184, 0.5); }
.rank-badge.rank-3 { background: linear-gradient(135deg, #ffc9a3, #c2703d); color: #1f1300; box-shadow: 0 2px 10px rgba(194, 112, 61, 0.5); }
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.card-tag.rising { background: #f97316; }
.card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.3); z-index: 2; }
.card-progress span { display: block; height: 100%; background: var(--accent); }
[dir="rtl"] .card-progress span { margin-inline-start: auto; }
.card-menu-btn {
  flex: none;
  align-self: flex-start;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.video-card:hover .card-menu-btn, .card-menu-btn:focus-visible { opacity: 1; }
.card-menu-btn:hover { background: var(--line); color: var(--text); }
@media (hover: none) { .card-menu-btn { opacity: 1; } }
.card-menu {
  position: fixed;
  z-index: 80;
  min-width: 210px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.card-menu[hidden] { display: none; }
.card-menu .share-menu-item { text-align: start; }

/* ---- Home: the greeting, Continue watching, back to the top ---- */
.home-hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 16px; }
.home-hello[hidden] { display: none; }
.home-hello h1 { margin: 0; font-size: 1.45rem; font-weight: 900; }
.home-hello p { margin: 3px 0 0; color: var(--muted); }
.continue-row { margin-bottom: 20px; }
.continue-row[hidden] { display: none; }
.continue-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); gap: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.continue-card { color: var(--text); text-decoration: none; }
.continue-card .video-title { margin: 8px 0 2px; font-size: 0.92rem; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.continue-card .video-channel { margin: 0; color: var(--muted); font-size: 0.8rem; }
.continue-left {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  z-index: 2;
}
.history-date-label i { color: var(--accent); }
.back-to-top {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  z-index: 55;
  transition: transform 0.15s ease;
}
.back-to-top:hover { transform: translateY(-2px); }
.back-to-top[hidden] { display: none; }

/* ---- Trending: periods, order, hashtags, spotlight ---- */
.trend-tools { margin-bottom: 14px; }
.trend-tools[hidden] { display: none; }
.trend-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.trend-periods { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.trend-periods::-webkit-scrollbar { display: none; }
.trend-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.85rem;
}
.trend-sort select, .settings-select {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}
.trend-sort select option, .settings-select option { color: #111; }
.trend-tag-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.trend-tag-row::-webkit-scrollbar { display: none; }
.trend-tag { display: inline-flex; align-items: center; gap: 7px; }
.trend-tag b {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 45, 106, 0.16);
  color: var(--accent);
  font-size: 0.72rem;
}
.chip.trend-tag.active b, .trend-tag:hover b { background: rgba(255, 255, 255, 0.2); }
.spotlight-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(255, 45, 106, 0.2), rgba(139, 92, 246, 0.16));
  color: var(--text);
  text-decoration: none;
}
.spotlight-avatar { padding: 3px; border-radius: 50%; background: linear-gradient(135deg, #ffe08a, #f5b400); }
.spotlight-avatar .avatar-circle { width: 52px; height: 52px; font-size: 1.2rem; }
.spotlight-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.spotlight-text small { color: #f5b400; font-weight: 900; letter-spacing: 0.02em; }
.spotlight-text strong { font-size: 1.1rem; font-weight: 900; }
.spotlight-text > span { color: var(--muted); font-size: 0.84rem; }
.spotlight-go { color: var(--muted); }
[dir="rtl"] .spotlight-go { transform: scaleX(-1); }

/* ---- Channel: milestones, completeness, the most popular, order and search ---- */
.channel-extras { display: grid; gap: 14px; margin-bottom: 16px; }
.channel-badges { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.channel-badges::-webkit-scrollbar { display: none; }
.channel-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 0.8rem;
  font-weight: 800;
  opacity: 0.5;
}
.channel-badge.reached { opacity: 1; border-color: rgba(255, 45, 106, 0.35); background: rgba(255, 45, 106, 0.12); }
.channel-badge i { color: var(--muted); font-size: 0.7rem; }
.channel-complete {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
}
.channel-complete[hidden] { display: none; }
.complete-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.complete-head i { color: var(--accent); }
.complete-bar { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin-bottom: 10px; }
.complete-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.complete-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.complete-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 0.76rem;
  font-weight: 700;
}
.complete-step.done { background: rgba(52, 211, 153, 0.14); }
.complete-step.done i { color: var(--success); }
.channel-popular[hidden] { display: none; }
.channel-popular .video-card {
  max-width: 420px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(255, 45, 106, 0.12), rgba(139, 92, 246, 0.08));
}
.channel-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.channel-sort { display: flex; gap: 8px; }
.channel-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
}
.channel-search input {
  width: 200px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}

/* ---- Settings additions ---- */
.accent-dots { display: flex; gap: 10px; flex-wrap: wrap; }
.accent-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  color: #fff;
  font-size: 0.72rem;
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--panel);
}
.accent-dot i { visibility: hidden; }
.accent-dot.active { border-color: var(--text); }
.accent-dot.active i { visibility: visible; }
.settings-select { padding: 8px 12px; border-radius: 12px; background: var(--panel-2); }
.settings-row-icon { width: 20px; margin-inline-end: 8px; color: var(--accent); }
.settings-count {
  margin-inline-start: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 0.75rem;
}
.danger-btn { color: #ef4444; border-color: rgba(239, 68, 68, 0.4); }
@media (max-width: 600px) {
  .channel-search input { width: 140px; }
  .home-hello h1 { font-size: 1.2rem; }
  .back-to-top { bottom: 16px; inset-inline-end: 16px; }
}
.channel-extras { grid-template-columns: minmax(0, 1fr); }
/* On a phone: the avatar over the banner, the name beside it just under
   the banner, the buttons on their own row. */
@media (max-width: 600px) {
  .channel-header { flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 0 4px 16px; }
  .channel-avatar.xlarge { width: 84px; height: 84px; font-size: 1.6rem; }
  .channel-header-info { flex: 1 1 calc(100% - 110px); padding-bottom: 0; margin-top: 62px; }
  .channel-header > button { flex: 1 1 auto; justify-content: center; }
}
.secondary-btn[hidden] { display: none; }

/* ---- The live's sound: the music line, and the tap for sound ---- */
.live-music-chip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.live-music-chip[hidden] { display: none; }
[dir="rtl"] .live-music-chip { left: auto; right: 12px; }
.live-music-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.live-music-chip .fa-volume-xmark { color: #fca5a5; }
.eq-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq-bars i { width: 3px; height: 40%; border-radius: 1px; background: var(--accent); animation: live-eq 0.9s ease-in-out infinite; }
.eq-bars i:nth-child(2) { animation-delay: -0.3s; }
.eq-bars i:nth-child(3) { animation-delay: -0.6s; }
.live-music-chip.paused .eq-bars i, .live-music-chip.muted .eq-bars i { animation: none; height: 40%; opacity: 0.6; }
@keyframes live-eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .eq-bars i { animation: none; } }
.live-sound-btn {
  position: absolute;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
.live-sound-btn[hidden] { display: none; }

/* ---- A video's sound (watch page) ---- */
.watch-sound {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(255, 45, 106, 0.12), rgba(139, 92, 246, 0.12));
  border: 1px solid var(--line);
}
.watch-sound[hidden] { display: none; }
.watch-sound-disc {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.95rem;
  background:
    radial-gradient(circle, var(--accent) 0 34%, transparent 35%),
    repeating-radial-gradient(circle, #24243a 0 2px, #15151f 2px 4px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.watch-sound-disc i { font-size: 0.78rem; }
.watch-sound.playing .watch-sound-disc { animation: watch-sound-spin 3.2s linear infinite; }
@keyframes watch-sound-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .watch-sound.playing .watch-sound-disc { animation: none; }
}
/* On a phone the link drops to its own line, so the name has the room. */
.watch-sound-body { flex: 1 1 200px; min-width: 0; display: grid; gap: 2px; }
.watch-sound-kind {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.watch-sound[data-kind="used"] .watch-sound-kind { color: var(--accent-3); }
.watch-sound[data-kind="song"] .watch-sound-kind { color: var(--accent-2); }
.watch-sound-name {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.watch-sound-source {
  flex: none;
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}
.watch-sound-source:hover { border-color: var(--accent); }
.watch-sound-source[hidden] { display: none; }
.watch-sound-source i { font-size: 0.7rem; }
[dir="rtl"] .watch-sound-source i { transform: scaleX(-1); }
.description-box[hidden] { display: none; }
.notif-emoji { font-size: 1.05em; }

/* ---- AI accounts ---- */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-inline-start: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.5;
  vertical-align: middle;
  white-space: nowrap;
}
.ai-badge i { font-size: 0.62rem; }
.ai-badge.lg { font-size: 0.78rem; padding: 2px 8px; }
.ai-badge[hidden] { display: none; }
.channel-ai-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  font-size: 0.86rem;
  line-height: 1.45;
}
.channel-ai-note i { color: var(--accent-2); margin-top: 3px; }
.channel-ai-note[hidden] { display: none; }

/* ---- Subscribe card over the video ---- */
.subscribe-nudge {
  position: absolute;
  inset-inline: 12px;
  bottom: 64px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 31, 0.92);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
  color: #fff;
  animation: nudge-in 0.35s ease-out;
  max-width: 460px;
}
.subscribe-nudge[hidden] { display: none; }
.subscribe-nudge-avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex: none; display: grid; }
.subscribe-nudge-text { flex: 1; min-width: 0; display: grid; }
.subscribe-nudge-text small { color: #c9c4dd; font-size: 0.75rem; }
.subscribe-nudge-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subscribe-nudge .primary-btn { padding: 7px 14px; flex: none; }
.subscribe-nudge .icon-btn { color: #fff; flex: none; }
@keyframes nudge-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.subscribe-nudge-avatar > * { width: 100%; height: 100%; font-size: 0.95rem; }
.subscribe-nudge-avatar img { object-fit: cover; }

/* ---- Upload: own cover ---- */
.upload-cover-row { display: flex; align-items: center; gap: 10px; }
.upload-cover-row img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }

/* ---- Guest accounts ---- */
.guest-btn { width: 100%; margin-top: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.guest-code-panel { text-align: center; max-width: 380px; }
.guest-code-icon { width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 45, 106, 0.15); color: var(--accent); font-size: 1.4rem; }
.guest-code-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; padding: 8px 8px 8px 14px; border-radius: var(--radius-md); background: var(--panel-2); border: 1px solid var(--line); text-align: start; }
.guest-code-row span { flex: 1; display: grid; }
.guest-code-row small { color: var(--muted); font-size: 0.75rem; }
.guest-code-row strong { font-size: 1.25rem; letter-spacing: 1.5px; direction: ltr; unicode-bidi: isolate; }
#guestCodeDone { width: 100%; margin-top: 8px; }

/* ---- Deleting one's own video ---- */
.share-menu-item.danger, .share-menu-item.danger i { color: #ef4444; }
.share-menu-item.danger:hover { background: rgba(239, 68, 68, 0.1); }
.card-delete-btn:hover { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.delete-video-panel { width: min(380px, 100%); text-align: center; display: grid; gap: 10px; justify-items: center; }
.delete-video-panel h3 { margin: 4px 0 0; }
.delete-video-panel p { margin: 0; }
.delete-video-thumb {
  position: relative;
  width: 168px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 1.6rem;
  box-shadow: var(--shadow-soft);
}
.delete-video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.delete-video-badge {
  position: absolute;
  inset-inline-end: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ef4444;
  color: #fff;
  font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.delete-video-title {
  max-width: 100%;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delete-video-note { color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.delete-video-panel .form-error { width: 100%; }
.delete-video-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; width: 100%; }
.delete-video-actions button { flex: 1 1 120px; justify-content: center; }
.primary-btn.delete-video-confirm { background: #ef4444; }
.primary-btn.delete-video-confirm:disabled { opacity: 0.6; cursor: default; }
