/* ============================================================
 * MediaNet · Music / Radio / TV — YT Music-inspired dedicated pages
 * Uses design-tokens.css. Reverse-engineered layout from YT Music
 * Web (Dec 2024 build), adapted to MediaNet "Cinematic" palette.
 * ============================================================ */

.ytm-body {
  margin: 0;
  background: var(--mn-bg);
  color: var(--mn-on-surface);
  font-family: var(--mn-font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============ TOP BAR ============ */
.ytm-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: var(--mn-bg);
  border-bottom: 1px solid var(--mn-outline-faint);
  display: grid;
  grid-template-columns: 240px 1fr 200px;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
}

.ytm-topbar-left { display: flex; align-items: center; gap: 16px; }
.ytm-topbar-center { display: flex; justify-content: center; max-width: 720px; margin: 0 auto; width: 100%; }
.ytm-topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.ytm-burger {
  background: transparent;
  border: 0;
  color: var(--mn-on-surface);
  width: 40px;
  height: 40px;
  border-radius: var(--mn-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--mn-dur-fast) var(--mn-ease-out);
}
.ytm-burger:hover { background: var(--mn-surface-container); }

.ytm-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--mn-on-surface);
  font-family: var(--mn-font-headline);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}
.ytm-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--mn-primary);
  color: var(--mn-on-primary);
  border-radius: var(--mn-radius-full);
  font-size: 18px;
  line-height: 1;
  padding-left: 2px;
}

/* Search bar (YT Music capsule) */
.ytm-search {
  display: flex;
  align-items: center;
  background: var(--mn-surface-container);
  border: 1px solid var(--mn-outline-faint);
  border-radius: var(--mn-radius-full);
  height: 48px;
  width: 100%;
  max-width: 720px;
  padding: 0 16px 0 20px;
  gap: 12px;
  transition: border-color var(--mn-dur-fast) var(--mn-ease-out),
              background var(--mn-dur-fast) var(--mn-ease-out);
}
.ytm-search:focus-within {
  border-color: var(--mn-secondary);
  background: var(--mn-surface-container-hi);
}
.ytm-search-icon { color: var(--mn-on-surface-variant); flex-shrink: 0; }
.ytm-search-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--mn-on-surface);
  font-family: var(--mn-font-body);
  font-size: 1rem;
  height: 100%;
  padding: 0;
}
.ytm-search-input::placeholder {
  color: var(--mn-on-surface-faint);
}

.ytm-icon-btn {
  background: transparent;
  border: 0;
  color: var(--mn-on-surface);
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--mn-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--mn-dur-fast) var(--mn-ease-out),
              color var(--mn-dur-fast) var(--mn-ease-out);
}
.ytm-icon-btn:hover { background: var(--mn-surface-container); }
.ytm-icon-btn[aria-pressed="true"] { color: var(--mn-secondary); }

.ytm-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--mn-radius-full);
  background: var(--mn-success);
  color: var(--mn-on-success);
  border: 0;
  font-family: var(--mn-font-headline);
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ============ SHELL ============ */
.ytm-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
  position: relative;
}

/* ============ SIDEBAR ============ */
.ytm-sidebar {
  background: var(--mn-bg);
  border-right: 1px solid var(--mn-outline-faint);
  padding: 12px 8px 96px;
  overflow-y: auto;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
}

.ytm-nav-primary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ytm-nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--mn-radius);
  color: var(--mn-on-surface);
  text-decoration: none;
  font-family: var(--mn-font-headline);
  font-weight: 500;
  font-size: 0.875rem;
  transition: background var(--mn-dur-fast) var(--mn-ease-out);
}
.ytm-nav-item:hover { background: var(--mn-surface-container); }
.ytm-nav-item.is-active {
  background: var(--mn-surface-container-hi);
  font-weight: 700;
}
.ytm-nav-item.is-active svg { color: var(--mn-primary); }
.ytm-nav-item svg { color: var(--mn-on-surface-variant); }

.ytm-sidebar-divider {
  height: 1px;
  background: var(--mn-outline-faint);
  margin: 16px 12px;
}

.ytm-new-playlist {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 16px);
  margin: 0 8px 12px;
  padding: 0 20px;
  height: 48px;
  background: var(--mn-surface-container);
  color: var(--mn-on-surface);
  border: 1px solid var(--mn-outline);
  border-radius: var(--mn-radius-full);
  font-family: var(--mn-font-headline);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--mn-dur-fast) var(--mn-ease-out),
              border-color var(--mn-dur-fast) var(--mn-ease-out);
}
.ytm-new-playlist:hover {
  background: var(--mn-surface-container-hi);
  border-color: var(--mn-secondary);
}
.ytm-plus {
  font-size: 22px;
  line-height: 1;
}

.ytm-playlists {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ytm-playlist-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 20px;
  border-radius: var(--mn-radius-sm);
  text-decoration: none;
  color: var(--mn-on-surface);
  transition: background var(--mn-dur-fast) var(--mn-ease-out);
}
.ytm-playlist-item:hover { background: var(--mn-surface-container); }
.ytm-playlist-item.is-active { background: var(--mn-surface-container); }
.ytm-playlist-name {
  font-family: var(--mn-font-headline);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--mn-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ytm-playlist-sub {
  font-family: var(--mn-font-body);
  font-size: 0.75rem;
  color: var(--mn-on-surface-variant);
}

/* ============ MAIN ============ */
.ytm-main {
  padding: 32px clamp(16px, 4vw, 48px) 120px;
  overflow-x: hidden;
}

/* Hero: big square cover + info column */
.ytm-hero {
  display: grid;
  grid-template-columns: clamp(220px, 24vw, 320px) 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: end;
  margin-bottom: 40px;
}
.ytm-hero-cover {
  aspect-ratio: 1 / 1;
  background: var(--mn-surface-container-hi);
  border-radius: var(--mn-radius-md);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  position: relative;
}
.ytm-hero-cover-art {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #a86bff 0%, #ff3b9a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ytm-hero-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ytm-hero-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.ytm-hero-tag {
  font-family: var(--mn-font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mn-on-surface-variant);
}
.ytm-hero-title {
  font-family: var(--mn-font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--mn-on-surface);
  margin: 0;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.ytm-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-family: var(--mn-font-body);
  font-size: 0.875rem;
  color: var(--mn-on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.ytm-hero-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--mn-on-surface);
}
.ytm-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--mn-radius-full);
  background: var(--mn-success);
  color: var(--mn-on-success);
  font-family: var(--mn-font-headline);
  font-weight: 700;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ytm-hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ytm-dot { opacity: 0.6; }
.ytm-hero-desc {
  max-width: 60ch;
  margin: 0;
  font-family: var(--mn-font-body);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--mn-on-surface-variant);
}
.ytm-hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}
.ytm-shuffle-btn,
.ytm-more-btn {
  background: var(--mn-surface-container);
  border: 1px solid var(--mn-outline);
  color: var(--mn-on-surface);
  width: 56px;
  height: 56px;
  border-radius: var(--mn-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--mn-dur-fast) var(--mn-ease-out),
              border-color var(--mn-dur-fast) var(--mn-ease-out);
}
.ytm-shuffle-btn:hover, .ytm-more-btn:hover {
  background: var(--mn-surface-container-hi);
  border-color: var(--mn-secondary);
}
.ytm-play-btn-lg {
  width: 72px;
  height: 72px;
  background: var(--mn-on-surface);
  color: var(--mn-bg);
  border: 0;
  border-radius: var(--mn-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--mn-dur-fast) var(--mn-ease-out),
              background var(--mn-dur-fast) var(--mn-ease-out);
}
.ytm-play-btn-lg:hover {
  background: #fff;
  transform: scale(1.06);
}
.ytm-play-btn-lg svg { margin-left: 4px; }

/* ============ TRACK LIST ============ */
.ytm-tracks {
  margin-top: 8px;
}
.ytm-track-list {
  display: flex;
  flex-direction: column;
}
.ytm-track {
  display: grid;
  grid-template-columns: 56px 1fr 48px 80px;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-radius: var(--mn-radius-sm);
  cursor: pointer;
  transition: background var(--mn-dur-fast) var(--mn-ease-out);
  position: relative;
}
.ytm-track:hover {
  background: var(--mn-surface-container);
}
.ytm-track.is-playing {
  background: var(--mn-surface-container);
}
.ytm-track.is-playing .ytm-track-title {
  color: var(--mn-primary);
}

.ytm-track-cover {
  width: 56px;
  height: 56px;
  border-radius: var(--mn-radius-sm);
  object-fit: cover;
  background: var(--mn-surface-container-hi);
  flex-shrink: 0;
}

.ytm-track-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ytm-track-title {
  font-family: var(--mn-font-headline);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--mn-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ytm-track-artist {
  font-family: var(--mn-font-body);
  font-size: 0.8125rem;
  color: var(--mn-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ytm-track-like {
  background: transparent;
  border: 0;
  color: var(--mn-on-surface-variant);
  width: 40px;
  height: 40px;
  border-radius: var(--mn-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--mn-dur-fast) var(--mn-ease-out),
              color var(--mn-dur-fast) var(--mn-ease-out),
              background var(--mn-dur-fast) var(--mn-ease-out);
}
.ytm-track:hover .ytm-track-like { opacity: 1; }
.ytm-track-like:hover { background: var(--mn-surface-container-hi); color: var(--mn-on-surface); }
.ytm-track-like.is-liked {
  color: var(--mn-secondary);
  opacity: 1;
}

.ytm-track-duration {
  font-family: var(--mn-font-mono);
  font-size: 0.875rem;
  color: var(--mn-on-surface-variant);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ytm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  gap: 16px;
  color: var(--mn-on-surface-variant);
}
.ytm-empty-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--mn-outline);
  border-top-color: var(--mn-primary);
  border-radius: 50%;
  animation: ytm-spin 0.8s linear infinite;
}
@keyframes ytm-spin {
  to { transform: rotate(360deg); }
}

/* ============ STICKY PLAYER BAR ============ */
.ytm-player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--mn-surface);
  border-top: 1px solid var(--mn-outline-faint);
  display: grid;
  grid-template-columns: 280px 1fr 200px;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  z-index: 60;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ytm-player-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ytm-player-cover {
  width: 56px;
  height: 56px;
  border-radius: var(--mn-radius-sm);
  object-fit: cover;
  background: var(--mn-surface-container-hi);
}
.ytm-player-meta {
  min-width: 0;
  flex: 1;
}
.ytm-player-title {
  font-family: var(--mn-font-headline);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--mn-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ytm-player-artist {
  font-family: var(--mn-font-body);
  font-size: 0.75rem;
  color: var(--mn-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ytm-player-center {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.ytm-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ytm-play-btn {
  background: var(--mn-on-surface);
  color: var(--mn-bg);
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--mn-radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--mn-dur-fast) var(--mn-ease-out);
}
.ytm-play-btn:hover { transform: scale(1.08); }
.ytm-play-btn svg { margin-left: 2px; }

.ytm-player-progress {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 12px;
  font-family: var(--mn-font-mono);
  font-size: 0.75rem;
  color: var(--mn-on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.ytm-time { text-align: center; }
.ytm-progress-bar {
  position: relative;
  height: 4px;
  background: var(--mn-surface-container-hh);
  border-radius: var(--mn-radius-full);
  cursor: pointer;
  overflow: hidden;
}
.ytm-progress-bar:hover { height: 6px; }
.ytm-progress-fill {
  height: 100%;
  background: var(--mn-on-surface);
  border-radius: var(--mn-radius-full);
  transition: width 0.12s linear;
  width: 0%;
}

.ytm-player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .ytm-shell { grid-template-columns: 72px 1fr; }
  .ytm-sidebar { padding: 12px 4px; }
  .ytm-nav-item span,
  .ytm-new-playlist span:last-child,
  .ytm-playlists,
  .ytm-sidebar-divider { display: none; }
  .ytm-nav-item { justify-content: center; padding: 0; }
  .ytm-new-playlist {
    width: 56px;
    padding: 0;
    margin: 0 auto 12px;
    justify-content: center;
  }
  .ytm-topbar { grid-template-columns: 100px 1fr 100px; }
  .ytm-brand-text { display: none; }
}

@media (max-width: 768px) {
  /* ===== Mobile layout — full rewrite 2026-05-19 per 5-agent audit =====
     Critical issues addressed:
     - Hero ate 70% of first fold (280px cover); collapsed to 96px horizontal card
     - Player bar grid-template-columns: 1fr stacked controls BELOW viewport
     - Like buttons hidden on track rows (no mobile favorite action)
     - Topbar dense (100/1fr/80 wasted space; Cast+Avatar are already hidden)
     - No env(safe-area-inset-bottom) → overlap iPhone home indicator
     - Icon-btn 40×40 below 44×44 Apple HIG touch target minimum */

  .ytm-shell { grid-template-columns: 1fr; }
  .ytm-sidebar {
    display: none;
    position: fixed;
    inset: 56px 0 0 0;
    z-index: 40;
    grid-template-columns: 1fr;
    width: 100%;
    background: var(--mn-bg);
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ytm-sidebar.is-open { display: block; }
  .ytm-sidebar .ytm-nav-item span,
  .ytm-sidebar .ytm-new-playlist span:last-child,
  .ytm-sidebar .ytm-playlists,
  .ytm-sidebar .ytm-sidebar-divider { display: revert; }
  .ytm-sidebar .ytm-nav-item { justify-content: flex-start; padding: 0 20px; min-height: 48px; }
  .ytm-sidebar .ytm-new-playlist { width: calc(100% - 16px); padding: 0 20px; justify-content: flex-start; min-height: 48px; }

  /* Compact horizontal hero — 96px cover + meta inline */
  .ytm-hero {
    grid-template-columns: 96px 1fr;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    padding: 16px;
    text-align: left;
  }
  .ytm-hero-cover { max-width: 96px; width: 96px; }
  .ytm-hero-cover-art { aspect-ratio: 1; }
  .ytm-hero-cover-art > svg, .ytm-hero-cover-art > span { font-size: 48px !important; }
  .ytm-hero-tag { font-size: 0.625rem; }
  .ytm-hero-title { font-size: clamp(1.5rem, 6vw, 2rem); line-height: 1.1; }
  .ytm-hero-desc { display: none; }
  .ytm-hero-meta { font-size: 0.75rem; }
  .ytm-hero-actions { grid-column: 1 / -1; margin-top: 8px; gap: 12px; }
  .ytm-shuffle-btn, .ytm-more-btn { width: 44px; height: 44px; }
  .ytm-play-btn-lg { width: 56px; height: 56px; }
  .ytm-play-btn-lg svg { width: 28px; height: 28px; }

  /* Compact topbar — Cast+Avatar already hidden, drop right column entirely */
  .ytm-topbar {
    grid-template-columns: auto 1fr;
    height: 56px;
    padding: env(safe-area-inset-top) 8px 0;
    gap: 8px;
  }
  .ytm-topbar-right { display: none; }
  .ytm-brand-mark { width: 32px; height: 32px; font-size: 16px; }
  .ytm-search { height: 40px; padding: 0 12px 0 14px; gap: 8px; min-width: 0; }
  .ytm-search-icon { width: 18px; height: 18px; }
  .ytm-search-input { font-size: 16px; min-width: 0; }   /* ≥16px prevents iOS auto-zoom on focus + flex shrink */
  .ytm-search-input::placeholder { font-size: 14px; }
  /* CRITICAL: min-width:0 lets the grid track shrink below content's
     intrinsic size. Without this, .ytm-topbar-center + .ytm-search forced
     a horizontal scroll of +11px on /music, /radio, /tv, /audiobooks. */
  .ytm-topbar-center { min-width: 0; }

  /* Mini-player — 2-column compact: cover+meta | controls */
  .ytm-player-bar {
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr;
    grid-template-areas: "left controls";
    height: 64px;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
    bottom: 0;
    gap: 8px;
  }
  .ytm-player-bar::before {
    /* Thin progress strip glued to TOP of mini-player */
    content: "";
    position: absolute; left: 0; right: 0; top: 0;
    height: 2px;
    background: var(--mn-on-surface-variant);
    opacity: 0.18;
  }
  .ytm-player-left { grid-area: left; gap: 8px; min-width: 0; }
  .ytm-player-left #ytm-like-btn { display: none; }   /* save space — accessible via long-press queue */
  .ytm-player-cover { width: 40px; height: 40px; flex-shrink: 0; }
  .ytm-player-meta { min-width: 0; }
  .ytm-player-title { font-size: 0.875rem; }
  .ytm-player-artist { font-size: 0.75rem; }
  .ytm-player-center { grid-area: controls; max-width: none; width: auto; flex-direction: row; }
  .ytm-player-controls { gap: 0; }
  .ytm-player-controls #ytm-ctrl-shuffle,
  .ytm-player-controls #ytm-ctrl-prev,
  .ytm-player-controls #ytm-ctrl-repeat { display: none; }
  .ytm-player-progress { display: none; }
  .ytm-player-right { display: none; }

  /* Track rows — keep favorite button accessible on mobile */
  .ytm-track {
    grid-template-columns: 48px 1fr 44px;
    gap: 12px;
    padding: 8px 12px;
    min-height: 64px;
  }
  .ytm-track-cover { width: 48px; height: 48px; flex-shrink: 0; }
  .ytm-track-like { display: inline-flex; width: 44px; height: 44px; opacity: 1; }
  .ytm-track-duration { display: none; }

  /* Icon buttons — meet 44×44 HIG */
  .ytm-icon-btn { min-width: 44px; width: 44px; height: 44px; }
  .ytm-burger { width: 44px; height: 44px; }
  .ytm-ctrl-play, #ytm-ctrl-play { width: 44px; height: 44px; }

  /* Main scroll padding so mini-player + bottom-nav don't hide content */
  .ytm-main { padding-bottom: calc(64px + 56px + env(safe-area-inset-bottom)); }

  /* Channels carousel — hide scrollbar on touch */
  .ytm-channels { padding: 12px 16px 4px; }
  .ytm-channels-scroll { padding-bottom: 4px; }
  .ytm-channels-scroll::-webkit-scrollbar { display: none; }
  .ytm-channel-card { flex: 0 0 128px; padding: 10px 6px; }
  .ytm-channel-avatar { width: 80px; height: 80px; }
}

/* ===== Bottom navigation tab bar — mobile only =====
   Persistent Home/Explore/Library/Upgrade tabs sit above mini-player.
   Burger menu becomes redundant; keep it for sidebar fallback. */
.ytm-bottom-nav { display: none; }
@media (max-width: 768px) {
  .ytm-bottom-nav {
    display: grid;
    position: fixed;
    bottom: 64px;  /* sits above mini-player */
    padding-bottom: env(safe-area-inset-bottom);
    left: 0; right: 0;
    height: 56px;
    background: rgba(15, 15, 17, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 55;
    grid-template-columns: repeat(4, 1fr);
  }
  .ytm-bottom-nav .ytm-bnav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; height: 56px; padding: 0;
    color: var(--mn-on-surface-variant); text-decoration: none;
    font: 600 0.6875rem/1 Inter, system-ui;
    min-height: 44px;
  }
  .ytm-bottom-nav .ytm-bnav-item.is-active { color: var(--mn-on-surface); }
  .ytm-bottom-nav .ytm-bnav-item svg { width: 22px; height: 22px; }
  /* When mini-player is hidden, bottom-nav glues to bottom */
  body:not(.ytm-has-player) .ytm-bottom-nav { bottom: 0; }
}

/* ===== Mobile filter chips (TV / Radio / Music) — horizontal scroll =====
   Sidebar drawer is hidden by default on mobile; chip row gives single-tap
   access to "Toate / RO / Fav / categories" without opening the drawer. */
.ytm-mobile-chips { display: none; }
@media (max-width: 768px) {
  .ytm-mobile-chips {
    display: flex; gap: 8px; overflow-x: auto;
    padding: 4px 16px 12px;
    margin: -8px 0 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .ytm-mobile-chips::-webkit-scrollbar { display: none; }
  .ytm-chip {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--mn-on-surface);
    font: 600 0.8125rem/1 Inter, system-ui;
    cursor: pointer;
    white-space: nowrap;
    scroll-snap-align: start;
    display: inline-flex; align-items: center;
  }
  .ytm-chip.is-active {
    background: var(--mn-on-surface);
    color: var(--mn-bg);
    border-color: transparent;
  }
}

/* ============ PREFERS-REDUCED-MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .ytm-empty-spinner { animation: none; }
  .ytm-progress-fill { transition: none; }
}

/* ============ Hide unimplemented controls ============
 * The original YT-Music layout has slots for Cast, Avatar, New Playlist,
 * 3-dot menus, Queue, Lyrics, Volume slider. These were silent no-ops in
 * our build (5-agent audit, May 2026). Hiding them removes user confusion
 * until we implement the actual behavior. Keep their HTML in place so we
 * can opt-in by adding class `is-implemented`. */
.ytm-icon-btn[aria-label="Cast"]:not(.is-implemented),
#ytm-avatar:not(.is-implemented),
#ytm-new-playlist-btn:not(.is-implemented),
.ytm-more-btn:not(.is-implemented),
#ytm-ctrl-lyrics:not(.is-implemented),
#ytm-ctrl-queue:not(.is-implemented),
#ytm-ctrl-volume:not(.is-implemented) {
  display: none !important;
}

/* ============ Channel results (search) ============ */
.ytm-channels { padding: 16px 24px 8px; max-width: 1400px; margin: 0 auto; }
.ytm-channels-title { font: 600 18px/24px var(--mn-font-display, "Inter Tight", system-ui); margin: 0 0 12px; color: var(--mn-on-surface, #fff); }
.ytm-channels-scroll {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  padding-bottom: 8px; scrollbar-width: thin;
}
.ytm-channels-scroll::-webkit-scrollbar { height: 6px; }
.ytm-channels-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.ytm-channel-card {
  flex: 0 0 152px; display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 12px 8px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06); border-radius: 12px;
  cursor: pointer; color: inherit; transition: background .15s, transform .15s;
  scroll-snap-align: start; text-align: center;
}
.ytm-channel-card:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); }
.ytm-channel-card:focus-visible { outline: 2px solid var(--mn-accent, #e50914); outline-offset: 2px; }
.ytm-channel-avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  background: rgba(255,255,255,.08);
}
.ytm-channel-meta { width: 100%; min-width: 0; }
.ytm-channel-name {
  font: 600 14px/18px var(--mn-font-display, "Inter Tight", system-ui);
  color: var(--mn-on-surface, #fff);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ytm-channel-subs { font: 400 12px/16px Inter, system-ui; color: var(--mn-on-surface-variant, #aaa); margin-top: 2px; }
.ytm-verified { color: #3ea6ff; font-size: 0.85em; vertical-align: 1px; }

/* ============ Channel view (in-channel browsing) ============ */
.ytm-channel-bar {
  display: flex; gap: 12px; align-items: center; padding: 12px 24px;
  max-width: 1400px; margin: 0 auto; flex-wrap: wrap;
}
.ytm-channel-back, .ytm-channel-loadmore {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: var(--mn-on-surface, #fff); padding: 8px 14px; border-radius: 999px;
  font: 500 14px/1 Inter, system-ui; cursor: pointer; transition: background .15s;
}
.ytm-channel-back:hover, .ytm-channel-loadmore:hover { background: rgba(255,255,255,.12); }
.ytm-channel-search {
  flex: 1; min-width: 200px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  color: var(--mn-on-surface, #fff); padding: 10px 16px; border-radius: 999px;
  font: 400 14px/1.2 Inter, system-ui;
}
.ytm-channel-search:focus { outline: 2px solid rgba(62,166,255,.5); outline-offset: 0; }
.ytm-channel-search::placeholder { color: rgba(255,255,255,.4); }

@media (max-width: 640px) {
  .ytm-channels { padding: 12px 16px 4px; }
  .ytm-channel-card { flex: 0 0 128px; padding: 10px 6px; }
  .ytm-channel-avatar { width: 80px; height: 80px; }
  .ytm-channel-bar { padding: 8px 16px; }
}
