html,
body {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

/* ============================================================
   DESIGN TOKENS — Exact match: naveedgol/music-web-player
   ============================================================ */
:root {
  /* Core Palette (Modern HSL) */
  --h-primary: 168;
  /* Mint/Teal base */
  --h-secondary: 260;
  /* Purple/Blue base */

  --bg-deep: hsl(220, 20%, 2%);
  --bg-main: hsl(220, 18%, 4%);
  --bg-card: hsla(0, 0%, 100%, 0.05);
  --bg-hover: hsla(0, 0%, 100%, 0.08);
  --bg-active: hsla(0, 0%, 100%, 0.12);

  --sidebar-bg: hsl(var(--h-secondary), 30%, 5%);
  --player-bg: hsla(var(--h-secondary), 30%, 9%, 0.92);
  /* More vibrant purple-blackish */

  --accent: hsl(var(--h-primary), 100%, 42%);
  --accent-light: hsl(var(--h-primary), 100%, 65%);
  --accent-glow: hsla(var(--h-primary), 100%, 42%, 0.3);

  --text-main: hsl(0, 0%, 100%);
  --text-muted: hsl(220, 10%, 70%);
  --text-dim: hsl(220, 10%, 45%);

  --border-thin: hsla(0, 0%, 100%, 0.08);
  --border-bold: hsla(0, 0%, 100%, 0.15);

  /* Glassmorphism */
  --glass-bg: hsla(0, 0%, 100%, 0.03);
  --glass-border: hsla(0, 0%, 100%, 0.08);
  --blur: 12px;

  /* Spacing & Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 32px;
  --r-full: 9999px;

  --p-xs: 4px;
  --p-sm: 8px;
  --p-md: 16px;
  --p-lg: 24px;
  --p-xl: 40px;

  /* Shadows */
  --shadow-glow: 0 0 20px 4px var(--accent-glow);
  --shadow-flat: 0 12px 40px -12px rgba(0, 0, 0, 0.5);

  /* Legacy Compat Aliases */
  --bg: var(--bg-deep);
  --content-bg: var(--bg-main);
  --card-bg: var(--bg-card);
  --input-bg: hsl(220, 20%, 6%);
  --queue-bg: hsl(220, 20%, 5%);
  --accent-dark: hsl(var(--h-primary), 100%, 35%);
  --accent-dim: var(--accent-glow);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --subtle: var(--text-dim);
  --shadow-lg: var(--shadow-flat);
  --border: var(--border-thin);
}


/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


@keyframes fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

/* ============================================================
   FLASH / TOAST
   ============================================================ */
.flash {
  position: fixed;
  right: 20px;
  top: 20px;
  max-width: min(400px, calc(100vw - 24px));
  z-index: 10100;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--queue-bg);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  max-width: 400px;
  font-size: 14px;
  animation: slideIn 0.2s ease;
  color: var(--text);
}

.flash.error {
  color: var(--danger);
}

/* ============================================================
   LOGIN SCREEN — same palette as .main + sidebar (purple base, accent)
   ============================================================ */
.center-wrap {
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px;
  background: linear-gradient(to bottom, hsl(var(--h-secondary), 30%, 15%), var(--bg-main) 42%), var(--bg-deep);
  color: var(--text);
  overflow-y: auto;
}

.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.login-hero {
  border-radius: var(--r-xl);
  padding: 34px;
  border: 1px solid var(--glass-border);
  background: hsla(var(--h-secondary), 30%, 9%, 0.94);
  box-shadow: var(--shadow-flat);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  text-align: center;
  animation: fadein 0.45s ease;
}

.login-card {
  width: 100%;
  border-radius: var(--r-xl);
  border: 1px solid var(--glass-border);
  background: hsla(var(--h-secondary), 28%, 7%, 0.96);
  box-shadow: var(--shadow-flat);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  padding: 30px 28px;
  display: grid;
  gap: 18px;
  animation: fadein 0.45s ease;
}

.login-card-title {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.login-card-subtitle {
  margin: -6px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-logo {
  flex-shrink: 0;
  width: 180px;
  height: auto;
  filter: drop-shadow(0 8px 24px var(--accent-glow));
}

.login-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.login-tagline {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
  font-weight: 400;
}

.login-hero-copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 38ch;
  text-align: center;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}

.auth-mode-tabs .btn.ghost {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 13px;
  padding: 9px 8px;
  color: var(--muted);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  font-family: inherit;
  font-weight: 500;
}

.auth-mode-tabs .btn.ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border-thin);
  color: var(--text);
}

.auth-mode-tabs .btn.ghost:focus-visible {
  outline: 2px solid hsla(var(--h-primary), 100%, 42%, 0.45);
  outline-offset: 1px;
}

.auth-mode-tabs .btn.ghost.active {
  background: hsla(var(--h-primary), 100%, 42%, 0.16);
  border-color: hsla(var(--h-primary), 100%, 42%, 0.35);
  color: var(--accent);
  font-weight: 700;
}

.auth-mode-form {
  display: grid;
  gap: 14px;
}

.auth-inline-actions {
  display: flex;
  justify-content: flex-end;
}

.auth-forgot-link {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-forgot-link:hover {
  color: var(--text);
}

.auth-forgot-link:focus-visible {
  outline: 2px solid hsla(var(--h-primary), 100%, 42%, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.login-forms {
  display: grid;
  gap: 8px;
}

.login-advanced {
  border-top: 1px solid var(--glass-border);
  padding-top: 14px;
}

.login-advanced summary {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: color 0.2s;
}

.login-advanced summary:hover {
  color: var(--text);
}

.login-advanced summary::marker,
.login-advanced summary::-webkit-details-marker {
  display: none;
}

.login-advanced summary::before {
  content: '+ ';
  color: var(--accent);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

input,
select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  transition: border-color 0.2s;
  outline: none;
}

input::placeholder {
  color: var(--subtle);
}

input:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

input:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.08);
}

select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23b3b3b3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ============================================================
   SEARCH BAR — modern unified pill
   ============================================================ */
#searchForm {
  display: flex;
  gap: 0;
  margin-top: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
  align-items: center;
  padding: 0 0 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#searchForm:focus-within {
  border-color: rgba(0, 212, 170, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.08);
}

.search-form-icon {
  font-size: 20px;
  color: var(--muted);
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
}

#searchQuery {
  height: 50px;
  font-size: 15px;
  padding: 0 12px;
  flex: 1;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#searchForm .btn-primary {
  height: 50px;
  border-radius: 0 12px 12px 0 !important;
  padding: 0 22px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  align-self: stretch;
  margin: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
}

.btn:hover {
  opacity: 0.8;
}

.btn:active {
  opacity: 0.6;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Primary */
.btn.btn-primary,
.btn.primary,
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

.btn.btn-primary:hover,
.btn.primary:hover,
.btn-primary:hover {
  opacity: 0.9;
}

/* Ghost */
.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.btn.ghost:hover {
  background: var(--hover-bg);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

/* Active nav/chip state */
.btn.active {
  background: var(--accent-dim) !important;
  border-color: rgba(0, 212, 170, 0.3) !important;
  color: var(--accent) !important;
}

/* Icon-only */
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.icon-btn .material-icons {
  font-size: 20px;
}

/* ============================================================
   APP LAYOUT — calc(100% - 100px) matches reference exactly
   ============================================================ */
.layout {
  height: calc(100% - 100px);
  display: grid;
  grid-template-columns: 240px 1fr;
  /* Matches sidebar width */
  overflow: hidden;
  transition: height 0.2s ease;
  gap: 0;
}


/* When player bar is hidden, expand to fill full viewport */
.layout.player-bar-hidden {
  height: 100%;
}

.layout.sidebar-collapsed {
  grid-template-columns: 1fr;
}

.layout.sidebar-collapsed .sidebar {
  display: none !important;
}

/* ============================================================
   SIDEBAR — black bg, 220px, matches sidebar.component.scss
   ============================================================ */
.sidebar {
  width: 240px;
  height: 100%;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-thin);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.brand {
  padding: 12px 24px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 110px;
  filter: drop-shadow(0 0 15px var(--accent-glow));
}

.brand h2 {
  display: none;
  /* Logo contains the text usually */
}


.sidebar-toggle-btn {
  padding: 4px 8px !important;
  width: 30px;
  height: 30px;
  border-radius: var(--r-xs) !important;
  background: transparent !important;
  border-color: transparent !important;
  color: var(--muted) !important;
}

/* Sidebar section divider & label */
.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 8px 16px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 4px 16px 2px;
  cursor: default;
  user-select: none;
}

/* Nav menu */
.menu {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}

/* Nav item — 48px height, material icon aligned */
.menu-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  text-align: left;
  border: none;
  border-radius: 0;
  padding: 0 16px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-btn:hover {
  background: var(--hover-bg);
}

/* Active: green text like reference .active-link */
.menu-btn.active {
  color: var(--accent);
  font-weight: 500;
  background: transparent;
}

/* Material icon in nav */
.nav-icon-mat {
  font-size: 20px;
  opacity: 0.7;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.menu-btn.active .nav-icon-mat {
  opacity: 1;
  color: var(--accent);
}

.menu-btn:hover .nav-icon-mat {
  opacity: 1;
}

/* Legacy SVG nav icon */
.nav-icon {
  opacity: 0.7;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-right: 0;
}

.menu-btn.active .nav-icon {
  opacity: 1;
  color: var(--accent);
}

.menu-btn:hover .nav-icon {
  opacity: 1;
}

/* Sidebar playlists list */
.sidebar-playlists {
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.sidebar-playlist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-playlist-item:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.sidebar-playlist-item .material-icons {
  font-size: 16px;
  opacity: 0.5;
}

/* ============================================================
   MAIN CONTENT — gradient matches .content in reference
   ============================================================ */
.main {
  background: linear-gradient(to bottom, hsl(var(--h-secondary), 30%, 15%), var(--bg-main) 40%);
  position: relative;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-gutter: stable;
  padding-left: 20px;
  /* Increased base gutter from sidebar */
  min-width: 0;
  max-width: 100%;
}



.main::-webkit-scrollbar {
  width: 8px;
}

.main::-webkit-scrollbar-track {
  background: transparent;
}

.main::-webkit-scrollbar-thumb {
  background: hsla(0, 0%, 100%, 0.1);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}


/* ============================================================
   CARDS — section containers
   ============================================================ */
.card {
  background: transparent;
  border: none;
  padding: 24px 40px 32px;
  /* Increased horizontal padding for breathability */
  min-width: 0;
  max-width: 100%;
}


/* Section title — 24px, 500 weight — matches .section-title in browse */
.card h3 {
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  padding-bottom: 10px;
  padding-top: 5px;
  cursor: default;
  line-height: normal;
  margin-bottom: 0;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 16px 40px;
  /* Increased padding to match cards */
  background: transparent;
  border: none;
}


.topbar h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  padding: 0;
}

.topbar p {
  margin: 0;
}

.topbar-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-icon-actions {
  width: 100%;
  justify-content: flex-end;
}

/* ============================================================
   VIEWS
   ============================================================ */
.view {
  display: none;
  gap: 0;
  min-width: 0;
  padding-top: 15px;
  padding-bottom: 20px;
  animation: fadein 0.7s;
}

.view.active {
  display: block;
}

#searchView {
  min-width: 0;
}

/* ============================================================
   INLINE FORM
   ============================================================ */
.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-1);
  margin-top: var(--sp-2);
  align-items: end;
}

.inline-form>.btn {
  justify-self: start;
}

.inline-form label {
  margin: 0;
}

/* Create playlist — collapsible card */
.create-playlist-card {
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
}

.create-playlist-summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--r-full);
  transition: background 0.2s, color 0.2s;
}

.create-playlist-summary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.create-playlist-summary::-webkit-details-marker {
  display: none;
}

.create-playlist-summary .material-icons {
  font-size: 20px;
  color: var(--accent);
}

.create-playlist-card[open] .create-playlist-summary {
  border-bottom: none;
  background: var(--accent);
  color: #000;
}

.create-playlist-card[open] .create-playlist-summary .material-icons {
  color: #000;
}

.create-playlist-card .create-playlist-row {
  padding: 16px 0;
}

/* Create Playlist — inputs + button in row below */
.create-playlist-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.create-playlist-row h3 {
  padding: 0;
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.create-playlist-row .create-playlist-fields {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.create-playlist-row input {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  font-size: 13px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}

.create-playlist-row input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  outline: none;
}

.create-playlist-row .btn {
  flex-shrink: 0;
  padding: 0 20px !important;
  font-size: 13px;
  box-sizing: border-box;
  border-radius: var(--r-full);
  background: var(--accent) !important;
  color: #000 !important;
  font-weight: 600;
  border: none !important;
  transition: opacity 0.2s;
}

.create-playlist-row .btn:hover {
  opacity: 0.85;
}

/* ============================================================
   ROW UTILITY
   ============================================================ */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ============================================================
   LISTS — song/track lists matching song.component.scss
   ============================================================ */
.list {
  display: grid;
  gap: 0;
}

/* Song item row */
.list-item {
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 10px;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  height: auto;
  cursor: pointer;
  transition: background 0.2s;
}

.list-item:hover {
  background: var(--hover-bg);
}

/* Song items — matches song.component.scss */
.song-item-main {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.song-content {
  flex: 1 1 0%;
  width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.song-item-main .item-actions {
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
  /* Default visible: overflow:auto on this strip steals taps on iOS/WebKit (buttons feel dead). */
  overflow: visible;
  touch-action: manipulation;
}

/*
 * Do NOT use overflow-x: auto + overflow-y: hidden here: the playlist menu is
 * position:absolute and opens *below* the strip — any non-visible overflow-y
 * clips the whole menu (looks like “dropdown never opens”).
 * Wide rows rely on parent scroll / horizontal page pan instead.
 */
.song-item-main .item-actions:has(.playlist-picker-inline) {
  overflow: visible;
}

/* Beat .item-actions .btn padding — keep icon buttons a fixed 36×36, no flex shrink */
.song-item-main .item-actions > .btn.icon-btn {
  flex-shrink: 0;
  flex-grow: 0;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0 !important;
  touch-action: manipulation;
  position: relative;
  z-index: 1;
}

/* ⋮ trigger lives inside details — same padding fix as Play/Queue */
.song-item-main .item-actions > .row-actions-dropdown {
  flex-shrink: 0;
  flex-grow: 0;
  position: relative;
  z-index: 1;
}

.song-item-main .item-actions .row-actions-dropdown-trigger.btn.icon-btn {
  flex-shrink: 0;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0 !important;
  box-sizing: border-box;
  touch-action: manipulation;
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .song-item-main .item-actions > .btn.icon-btn,
  .song-item-main .item-actions .row-actions-dropdown-trigger.btn.icon-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }
}

/* Album artwork — 40×40 like reference .album-cover */
.song-artwork {
  width: 40px;
  height: 40px;
  border-radius: 2px;
  background: var(--card-bg);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-right: 10px;
  margin-left: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

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

.song-artwork-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--muted);
  background: var(--card-bg);
}

.profile-row-main {
  gap: 10px;
}

.profile-row-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  margin-right: 2px;
}

.profile-row-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#searchResults .song-artwork {
  margin-left: 0;
}

/* Song name — 16px like reference */
.song-title {
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

/* Secondary info — 14px, #b3b3b3 like reference */
.song-meta {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  gap: 4px;
}

/* Currently playing state */
.list-item.playing .song-title {
  color: var(--accent);
}

/* Pills */
.source-pill {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  vertical-align: middle;
}

.source-local {
  color: var(--accent);
  border-color: rgba(105, 240, 174, 0.3);
}

.source-itunes {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.25);
}

.source-remote {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.25);
}

.meta-pill {
  display: inline-block;
  margin-left: 6px;
  margin-right: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-full);
  padding: 1px 7px;
  font-size: 11px;
  color: var(--muted);
  vertical-align: middle;
  line-height: 1.4;
}

.meta-pill.good {
  color: var(--accent);
  border-color: rgba(105, 240, 174, 0.3);
}

.meta-pill.reason {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.25);
}

/* Item actions */
.item-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.item-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
}

.list-item .item-actions .btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.1);
}

.playlist-inline-action-select {
  min-width: 108px;
  max-width: 130px;
  height: 30px;
  border-radius: var(--r-xs);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--input-bg);
  color: var(--text);
  font-size: 12px;
  padding: 4px 8px;
}

.playlist-inline-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.playlist-inline-actions .btn {
  border-radius: var(--r-full);
  padding: 6px 12px;
  font-size: 12px;
}

.playlist-inline-actions .btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.playlist-inline-actions .playlist-action-danger {
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #f8b4b4 !important;
}

.playlist-inline-actions .playlist-action-danger:hover {
  background: rgba(239, 68, 68, 0.14) !important;
}

/* Share Button Premium Styles */
.btn-share {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-share:hover {
  color: hsl(var(--h-secondary), 100%, 75%) !important;
  background: hsla(var(--h-secondary), 100%, 75%, 0.1) !important;
  transform: translateY(-1px);
}

.btn-share.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
}

.btn-share .material-icons {
  font-size: 18px;
}

.player-round.btn-share:hover {
  background: hsla(var(--h-secondary), 100%, 75%, 0.15) !important;
  box-shadow: 0 0 15px hsla(var(--h-secondary), 100%, 75%, 0.1);
}


/* Empty state */
.empty {
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--r-sm);
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ============================================================
   SEARCH SHELL
   ============================================================ */
.search-rail-wrap {
  margin-top: var(--sp-1);
  display: grid;
  gap: 8px;
}

.search-rail-wrap .muted {
  margin: 0;
  font-size: 13px;
}

.ytm-search-shell {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 24px 40px 20px;
  /* Increased padding to 40px to match global cards */
}


.ytm-search-head {
  display: grid;
  gap: 6px;
}

.ytm-search-top-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

/* Filter chips row */
.ytm-search-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.ytm-search-chips::-webkit-scrollbar {
  display: none;
}

.ytm-search-chips .btn.ghost {
  border-radius: var(--r-full);
  padding: 6px 18px;
  font-size: 14px;
  white-space: nowrap;
}

.ytm-search-chips .btn:disabled,
.ytm-search-chips .btn:disabled:hover,
.ytm-search-chips .btn:disabled:active {
  opacity: 0.45 !important;
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.45) !important;
  cursor: default !important;
  pointer-events: none;
}

.search-filter-section {
  min-width: 0;
}

/* Featured artist + quick picks grid */
.ytm-featured-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-height: 180px;
}

.ytm-featured-artist {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);
  background: rgba(30, 50, 100, 0.3);
  padding: 16px;
  min-height: 170px;
}

.ytm-featured-main {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 100%;
}

.ytm-featured-artwork {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card-bg);
  display: grid;
  place-items: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.ytm-featured-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ytm-featured-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.ytm-featured-title {
  font-size: 20px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ytm-featured-meta {
  color: var(--muted);
  font-size: 14px;
}

.ytm-featured-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.ytm-featured-actions .btn {
  padding: 6px 16px;
  border-radius: var(--r-full);
  font-size: 14px;
}

.ytm-quick-picks {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  display: grid;
  gap: 2px;
  min-height: 170px;
}

.ytm-quick-pick-title {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 4px;
}

.ytm-quick-item {
  border: none;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
  height: 52px;
}

.ytm-quick-item:hover {
  background: var(--hover-bg);
}

.ytm-quick-artwork {
  width: 40px;
  height: 40px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--card-bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.ytm-quick-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ytm-quick-copy {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.ytm-quick-song {
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.ytm-quick-meta {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   ARTIST & RECOMMENDATION RAILS — grid like browse.component
   minmax(186px, 1fr) matches reference exactly
   ============================================================ */
.search-artist-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 0;
  padding-left: 12px;
  padding-right: 12px;
}

@media screen and (max-width: 960px) {
  .search-artist-rail {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }
}

.search-artist-rail .empty {
  grid-column: 1 / -1;
  margin: 10px;
}

/* Album/artist preview card — matches album-preview.component.scss exactly */
.artist-rail-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 190px;
  padding-left: 8px;
  padding-right: 8px;
  padding-bottom: 20px;
  cursor: pointer;
}

@media screen and (max-width: 960px) {
  .artist-rail-card {
    max-width: none;
  }
}

.artist-rail-artwork {
  background: rgb(33, 33, 33);
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin-bottom: 10px;
  border-radius: 5px;
  background-size: cover;
  overflow: hidden;
  display: grid;
  place-items: center;
}

@media screen and (max-width: 960px) {
  .artist-rail-artwork {
    width: 100%;
    height: auto;
  }
}

.artist-rail-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 5px;
  transition: opacity 0.3s;
}

.artist-rail-card:hover .artist-rail-artwork img {
  opacity: 0.7;
}

.artist-rail-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.artist-rail-meta {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-rail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.artist-rail-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
}


/* Recommendation rail — same grid */
.search-recommendation-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 0;
  padding-left: 12px;
  padding-right: 12px;
}

@media screen and (max-width: 960px) {
  .search-recommendation-rail {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }
}

.search-recommendation-rail .empty {
  grid-column: 1 / -1;
  margin: 10px;
}

.recommendation-rail-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 190px;
  padding-left: 8px;
  padding-right: 8px;
  padding-bottom: 20px;
  cursor: pointer;
}

@media screen and (max-width: 960px) {
  .recommendation-rail-card {
    max-width: none;
  }
}

.recommendation-rail-artwork {
  background: rgb(33, 33, 33);
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin-bottom: 10px;
  border-radius: 5px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

@media screen and (max-width: 960px) {
  .recommendation-rail-artwork {
    width: 100%;
    height: auto;
  }
}

.recommendation-rail-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 5px;
  transition: opacity 0.3s;
}

.recommendation-rail-card:hover .recommendation-rail-artwork img {
  opacity: 0.7;
}

.recommendation-rail-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommendation-rail-artist {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommendation-rail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.recommendation-rail-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
}


/* Analytics */
.search-analytics {
  display: grid;
  gap: var(--sp-2);
  padding: 0 20px 20px;
}

.search-analytics-rail {
  display: flex;
  gap: var(--sp-2);
  overflow: hidden;
}

.search-analytics-rail .card {
  flex: 1 1 0;
  min-width: 0;
  min-height: 220px;
  padding: 15px 20px;
}

.search-analytics .card .list {
  gap: 0;
}

/* ============================================================
   BROWSE VIEW — redesigned layout
   ============================================================ */
.browse-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}

.browse-charts .card {
  min-height: 200px;
}

/* Hero Banner — carousel (dots live outside the scroll track) */
.hero-banner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 0;
}

.hero-banner-track {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  touch-action: pan-x;
  scroll-padding-inline: 0;
  position: relative;
}

.hero-banner-track::-webkit-scrollbar {
  display: none;
}

.hero-banner-card {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  height: clamp(160px, 26vw, 260px);
  cursor: pointer;
  background: linear-gradient(135deg, rgba(30, 50, 100, 0.6), rgba(4, 6, 12, 0.9));
  box-sizing: border-box;
}

.hero-banner-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.55;
  transition: opacity 0.4s;
}

.hero-banner-card:hover img {
  opacity: 0.7;
}

.hero-banner-track .hero-banner-card {
  touch-action: pan-x;
}

.hero-banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 24px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-banner-title {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hero-banner-meta {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.hero-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--r-full);
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-banner-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Hero dots indicator */
.hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 12px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.2s;
}

.hero-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* Horizontal Rail — shared scroll container */
.horizontal-rail {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 4px 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  touch-action: pan-x;
  min-width: 0;
}

.horizontal-rail::-webkit-scrollbar {
  display: none;
}

/* Browse — Trending: edge-to-edge feel + clearer horizontal scroll on desktop */
#browseTopTracks.horizontal-rail {
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
}

@media (min-width: 769px) {
  #browseTopTracks.horizontal-rail {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
    padding-right: 8px;
  }

  #browseTopTracks.horizontal-rail::-webkit-scrollbar {
    display: block;
    height: 5px;
  }

  #browseTopTracks.horizontal-rail::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
  }

  #browseTopTracks.horizontal-rail::-webkit-scrollbar-track {
    background: transparent;
  }
}

@media (max-width: 768px) {
  #browseView .browse-trending-block {
    padding-left: 12px;
    padding-right: 12px;
  }

  #browseTopTracks.horizontal-rail {
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 12px;
    padding-right: 20px;
    scroll-padding-inline: 12px;
  }

  #browseTopTracks.horizontal-rail .media-card {
    scroll-snap-align: start;
  }
}

/* Media Card — used in horizontal rails */
.media-card {
  flex: 0 0 170px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.2s;
}

.media-card:hover {
  transform: translateY(-4px);
}

/* Let horizontal rails capture sideways swipes on cards (iOS / nested scroll) */
.horizontal-rail .media-card {
  touch-action: pan-x;
}

.media-card-artwork {
  width: 170px;
  height: 170px;
  border-radius: 6px;
  overflow: hidden;
  background: rgb(33, 33, 33);
  position: relative;
}

.media-card-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}

.media-card:hover .media-card-artwork img {
  opacity: 0.75;
}

.media-card-play {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
  border: none;
  cursor: pointer;
  font-size: 20px;
}

.media-card:hover .media-card-play {
  opacity: 1;
  transform: translateY(0);
}

.media-card-title {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card-meta {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Moods & Activities Grid */
.moods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 4px;
}

.mood-card {
  position: relative;
  border-radius: var(--r-md);
  padding: 18px 16px;
  min-height: 100px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mood-card:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.mood-card-icon {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 28px;
  opacity: 0.5;
}

.mood-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   FOR YOU VIEW — redesigned
   ============================================================ */
#forYouView .card {
  padding-bottom: 10px;
}

.foryou-recommendation-rail .recommendation-rail-card {
  touch-action: pan-x;
}

/* Greeting */
.foryou-greeting {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  padding: 8px 0;
}

/* Jump Back In — wide horizontal cards */
.jumpback-rail {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 4px 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  touch-action: pan-x;
  min-width: 0;
}

.jumpback-rail::-webkit-scrollbar {
  display: none;
}

.jumpback-card {
  flex: 0 0 320px;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-md);
  padding: 12px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background 0.2s, transform 0.2s;
}

.jumpback-card:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.jumpback-rail .jumpback-card {
  touch-action: pan-x;
}

.jumpback-artwork {
  width: 90px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  background: rgb(33, 33, 33);
}

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

.jumpback-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jumpback-title {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jumpback-meta {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jumpback-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 22px;
  margin-top: 6px;
  transition: transform 0.2s;
}

.jumpback-play:hover {
  transform: scale(1.1);
}

/* Daily Mix Cards */
.mix-card {
  flex: 0 0 170px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.2s;
}

.mix-card:hover {
  transform: translateY(-4px);
}

.mix-card-artwork {
  width: 170px;
  height: 170px;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  background: rgb(33, 33, 33);
}

.mix-card-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mix-card-title {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mix-card-meta {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Recently Played — round avatar style in horizontal rail */
.recent-circle-card {
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.2s;
}

.recent-circle-card:hover {
  transform: translateY(-3px);
}

.horizontal-rail .recent-circle-card {
  touch-action: pan-x;
}

.recent-circle-artwork {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  background: rgb(33, 33, 33);
}

.recent-circle-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recent-circle-title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.recent-circle-meta {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

/* Skeleton loading for rails */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.2; }
}

.skeleton-card {
  flex: 0 0 170px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-rect {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-artwork {
  width: 170px;
  height: 170px;
}

.skeleton-text {
  height: 14px;
  width: 80%;
}

.skeleton-text-sm {
  height: 12px;
  width: 60%;
}

.skeleton-jumpback {
  flex: 0 0 320px;
  height: 114px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--r-md);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-circle {
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.skeleton-circle-artwork {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

/* ============================================================
   BROWSE & FOR YOU — RESPONSIVE (tablet ≤ 768px)
   ============================================================ */
@media screen and (max-width: 768px) {
  /* Hero — shorter on phones/tablets so it does not dominate the screen */
  .hero-banner {
    gap: 8px;
  }

  .hero-banner-track {
    gap: 10px;
  }

  .hero-banner-card {
    height: clamp(118px, 34vmin, 200px);
  }

  .hero-banner-title {
    font-size: 17px;
  }
  .hero-banner-overlay {
    padding: 14px 12px 10px;
    gap: 5px;
  }
  .hero-banner-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Media cards in rails — shrink */
  .media-card {
    flex: 0 0 140px;
  }
  .media-card-artwork {
    width: 140px;
    height: 140px;
  }
  .skeleton-card {
    flex: 0 0 140px;
  }
  .skeleton-artwork {
    width: 140px;
    height: 140px;
  }

  /* Mix cards */
  .mix-card {
    flex: 0 0 140px;
  }
  .mix-card-artwork {
    width: 140px;
    height: 140px;
  }

  /* Jump Back In */
  .jumpback-card {
    flex: 0 0 260px;
    gap: 10px;
  }
  .jumpback-artwork {
    width: 74px;
    height: 74px;
  }
  .skeleton-jumpback {
    flex: 0 0 260px;
    height: 98px;
  }

  /* Artist / recommendation — grid'den çıkar, horizontal scroll rail'e dönüştür */
  .search-artist-rail,
  .search-recommendation-rail {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 12px;
    padding: 4px 4px 8px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    touch-action: pan-x;
  }

  .search-artist-rail::-webkit-scrollbar,
  .search-recommendation-rail::-webkit-scrollbar {
    display: none;
  }

  .artist-rail-card,
  .recommendation-rail-card {
    flex: 0 0 140px;
    width: 140px;
    max-width: 140px;
    padding: 0;
    padding-bottom: 4px;
    scroll-snap-align: start;
    touch-action: pan-x;
  }

  .artist-rail-artwork,
  .recommendation-rail-artwork {
    width: 140px;
    height: 140px;
    border-radius: 6px;
  }

  .artist-rail-name,
  .recommendation-rail-title {
    font-size: 13px;
    margin-top: 6px;
  }

  .artist-rail-meta,
  .recommendation-rail-artist {
    font-size: 12px;
  }
}

/* ============================================================
   BROWSE & FOR YOU — RESPONSIVE (small mobile ≤ 480px)
   ============================================================ */
@media screen and (max-width: 480px) {
  /* Hero — compact on small phones */
  .hero-banner-card {
    height: clamp(100px, 28vmin, 152px);
  }
  .hero-banner-title {
    font-size: 15px;
  }
  .hero-banner-meta {
    font-size: 11px;
  }
  .hero-banner-overlay {
    padding: 10px 10px 8px;
    gap: 4px;
  }
  .hero-banner-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  .hero-banner-btn .material-icons {
    font-size: 16px !important;
  }

  /* Greeting */
  .foryou-greeting {
    font-size: 20px;
    padding: 4px 0;
  }

  /* Media cards — even smaller */
  .media-card {
    flex: 0 0 120px;
  }
  .media-card-artwork {
    width: 120px;
    height: 120px;
  }
  .media-card-title {
    font-size: 12px;
  }
  .media-card-meta {
    font-size: 11px;
  }
  .media-card-play {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .skeleton-card {
    flex: 0 0 120px;
  }
  .skeleton-artwork {
    width: 120px;
    height: 120px;
  }

  /* Mix cards */
  .mix-card {
    flex: 0 0 120px;
  }
  .mix-card-artwork {
    width: 120px;
    height: 120px;
  }
  .mix-card-title,
  .mix-card-meta {
    font-size: 12px;
  }

  /* Jump Back In — stack vertically on very small screens */
  .jumpback-card {
    flex: 0 0 calc(100vw - 80px);
    grid-template-columns: 64px 1fr;
    gap: 10px;
    padding: 10px;
  }
  .jumpback-artwork {
    width: 64px;
    height: 64px;
  }
  .jumpback-title {
    font-size: 13px;
  }
  .jumpback-meta {
    font-size: 11px;
  }
  .jumpback-play {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
  .skeleton-jumpback {
    flex: 0 0 calc(100vw - 80px);
    height: 84px;
  }

  /* Recently Played circles */
  .recent-circle-card {
    flex: 0 0 90px;
  }
  .recent-circle-artwork {
    width: 76px;
    height: 76px;
  }
  .recent-circle-title,
  .recent-circle-meta {
    max-width: 86px;
    font-size: 11px;
  }
  .skeleton-circle {
    flex: 0 0 90px;
  }
  .skeleton-circle-artwork {
    width: 76px;
    height: 76px;
  }

  /* Horizontal rail gap küçülsün */
  .horizontal-rail,
  .jumpback-rail {
    gap: 10px;
    padding: 4px 2px 8px;
  }

  /* Artist / recommendation — 120px sabit kart (Trending ile aynı boyut) */
  .artist-rail-card,
  .recommendation-rail-card {
    flex: 0 0 120px;
    width: 120px;
    max-width: 120px;
  }

  .artist-rail-artwork,
  .recommendation-rail-artwork {
    width: 120px;
    height: 120px;
  }

  .artist-rail-name,
  .recommendation-rail-title {
    font-size: 12px;
  }

  .artist-rail-meta,
  .recommendation-rail-artist {
    font-size: 11px;
  }
}

/* ============================================================
   FOR YOU — Jump Back In + Because You Listen (horizontal scroll)
   ============================================================ */
@media screen and (max-width: 980px) {
  #forYouView .foryou-jumpback-block,
  #forYouView .foryou-because-block {
    padding-left: 12px;
    padding-right: 12px;
  }

  #forYouView #forYouJumpBackIn.jumpback-rail {
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 12px;
    padding-right: 20px;
    scroll-padding-inline: 12px;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
  }

  #forYouView #forYouJumpBackIn .jumpback-card {
    scroll-snap-align: start;
  }

  /* Because You Listen: use a horizontal scroller instead of a wrapping grid */
  #forYouView #forYouRecommendations.foryou-recommendation-rail {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    margin-left: -8px;
    margin-right: -8px;
    padding: 4px 20px 12px 12px;
    scroll-padding-inline: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    touch-action: pan-x;
    min-width: 0;
    grid-template-columns: none;
  }

  #forYouView #forYouRecommendations .recommendation-rail-card {
    flex: 0 0 156px;
    width: 156px;
    max-width: 156px;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 8px;
    scroll-snap-align: start;
  }

  #forYouView #forYouRecommendations .recommendation-rail-artwork {
    width: 156px;
    height: 156px;
    flex-shrink: 0;
  }

  /* Browse — Popular Artists: horizontal scroll on phones/tablets (grid only on wide desktop) */
  #browseView #browseArtistRail.search-artist-rail {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    margin-left: -8px;
    margin-right: -8px;
    padding: 4px 20px 12px 12px;
    scroll-padding-inline: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    touch-action: pan-x;
    grid-template-columns: none;
  }

  #browseView #browseArtistRail .artist-rail-card {
    flex: 0 0 156px;
    width: 156px;
    max-width: 156px;
    padding-left: 0;
    padding-right: 0;
    scroll-snap-align: start;
  }

  #browseView #browseArtistRail .artist-rail-artwork {
    width: 156px;
    height: 156px;
    flex-shrink: 0;
  }
}

@media screen and (max-width: 768px) {
  #forYouView #forYouRecommendations .recommendation-rail-card {
    flex: 0 0 140px;
    width: 140px;
    max-width: 140px;
  }

  #forYouView #forYouRecommendations .recommendation-rail-artwork {
    width: 140px;
    height: 140px;
  }

  #browseView #browseArtistRail .artist-rail-card {
    flex: 0 0 140px;
    width: 140px;
    max-width: 140px;
  }

  #browseView #browseArtistRail .artist-rail-artwork {
    width: 140px;
    height: 140px;
  }
}

@media screen and (max-width: 480px) {
  #forYouView #forYouRecommendations .recommendation-rail-card {
    flex: 0 0 120px;
    width: 120px;
    max-width: 120px;
  }

  #forYouView #forYouRecommendations .recommendation-rail-artwork {
    width: 120px;
    height: 120px;
  }

  #browseView #browseArtistRail .artist-rail-card {
    flex: 0 0 120px;
    width: 120px;
    max-width: 120px;
  }

  #browseView #browseArtistRail .artist-rail-artwork {
    width: 120px;
    height: 120px;
  }
}

/* ============================================================
   LIBRARY GRID — album/artist cards
   ============================================================ */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 0;
  padding: 0 20px 20px;
}

.library-grid .empty {
  grid-column: 1 / -1;
  margin: 10px;
}

.library-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 186px;
  padding: 8px;
  padding-bottom: 20px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.library-card:hover {
  opacity: 0.75;
}

.library-card-artwork {
  background: var(--card-bg);
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin-bottom: 10px;
  border-radius: 5px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.library-card-artwork.round {
  border-radius: 50%;
}

.library-card-artwork .material-icons {
  font-size: 48px;
  color: var(--muted);
  opacity: 0.5;
}

.library-card-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.library-card-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.library-card-meta {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   ARTIST DETAIL
   ============================================================ */
.artist-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
}

.artist-detail-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.artist-detail-photo-frame {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--card-bg);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.artist-detail-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.artist-detail-photo-frame .song-artwork-fallback {
  font-size: 24px;
  font-weight: 500;
}

.artist-detail-heading {
  min-width: 0;
  display: grid;
  gap: 5px;
}

/* Artist title — 38px like album name in reference */
.artist-detail-heading h3 {
  font-size: 38px;
  font-weight: 500;
  margin: 0;
  padding: 0;
  letter-spacing: 0;
  cursor: default;
  line-height: normal;
}

.artist-detail-filter-input {
  width: min(320px, 100%);
  margin-top: 4px;
  height: auto;
  font-size: 14px;
}

/* ---------- Artist detail: single-column stacked layout ---------- */
.artist-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 20px;
}

.artist-detail-section {
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 0 8px;
  border-right: none;
  border-bottom: none;
}

.artist-detail-section:last-child {
  border-right: none;
}

.artist-detail-section .song-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.artist-detail-section .song-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.artist-detail-section .song-item-main {
  overflow: hidden;
  align-items: center;
}

.artist-detail-section .song-content {
  overflow: hidden;
}

.artist-detail-section>h3,
.artist-section-header h3 {
  font-size: 22px;
  font-weight: 600;
  padding: 10px 12px 10px;
  cursor: default;
}

/* ---- Songs rail: 4 rows, horizontal scroll columns ---- */
/* ---- Songs rail: 4 rows, horizontal scroll columns ---- */
#artistDetailResults {
  display: flex;
  flex-flow: column wrap;
  overflow-x: auto;
  overflow-y: hidden;
  /* 4 rows × 72px per row + 3×4px gap = 300px */
  max-height: 300px;
  gap: 4px 16px;
  padding: 4px 12px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

#artistDetailResults::-webkit-scrollbar {
  height: 4px;
}

#artistDetailResults::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

#artistDetailResults .list-item {
  flex: 0 0 auto;
  width: calc((100% - 32px) / 3);
  min-width: 300px;
  max-width: 440px;
  height: 72px;
  scroll-snap-align: start;
  overflow: visible;
  flex-direction: row;
  align-items: center;
  padding: 6px 10px;
  position: relative;
}

/* Inside the rail, put actions inline to the right */
#artistDetailResults .list-item .song-item-main {
  flex: 1;
  min-width: 0;
}

#artistDetailResults .list-item .song-item-main .item-actions {
  margin-top: 0;
  flex-shrink: 0;
}

/* Let dropdown menus escape the scroll container via fixed positioning */
#artistDetailResults .row-actions-dropdown-panel {
  position: fixed;
  z-index: 200;
}

/* ---- Albums rail (horizontal card grid like screenshot) ---- */
#artistAlbumsList {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 16px;
  padding: 4px 12px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

#artistAlbumsList::-webkit-scrollbar {
  height: 4px;
}

#artistAlbumsList::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

/* Album card style — large artwork, title, year */
.artist-album-card {
  flex: 0 0 180px;
  min-width: 150px;
  max-width: 200px;
  scroll-snap-align: start;
  cursor: pointer;
  border-radius: var(--r-md);
  padding: 0;
  transition: opacity 0.15s;
}

.artist-album-card:hover {
  opacity: 0.78;
}

.artist-album-card-artwork {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.artist-album-card-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.artist-album-card-title {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-album-card-year {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Legacy classes kept for compat but not used in new layout */
.artist-album-row {
  display: none;
}

.artist-album-main {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.artist-album-row .item-actions {
  padding-left: 60px;
  gap: 4px;
  flex-wrap: wrap;
}

.artist-album-artwork {
  width: 50px;
  height: 50px;
  border-radius: 2px;
  background: var(--card-bg);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.artist-album-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.artist-album-content {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

/* ---- Artist section header with nav arrows (reused for both Songs & Albums) ---- */
.artist-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0;
}

.artist-page-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   PLAYLISTS
   ============================================================ */
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.playlist-explorer {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.playlist-tabs-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-lg);
  padding: 8px;
  display: grid;
  gap: 8px;
  align-self: start;
}

.playlist-tabs {
  display: flex;
  gap: 4px;
  background: transparent;
  border-radius: var(--r-full);
  padding: 0;
}

.playlist-tab-btn {
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  background: transparent !important;
  border: none !important;
  color: var(--muted) !important;
  border-radius: var(--r-full) !important;
  padding: 8px 16px !important;
  min-height: 0;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.playlist-tab-btn.active {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--text) !important;
}

.playlist-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text) !important;
}

.playlist-tab-panels {
  min-width: 0;
}

.playlist-tab-panel {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.playlist-inline-search {
  margin-top: 0;
  margin-bottom: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 4px;
}

.playlist-inline-search input {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--r-full) !important;
  padding: 8px 14px !important;
  font-size: 13px;
  color: var(--text);
}

.playlist-inline-search input:focus {
  border-color: var(--accent) !important;
  outline: none;
}

.playlist-inline-search .btn {
  border-radius: var(--r-full) !important;
}

.playlist-detail-pane {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-lg);
  align-self: start;
}

.playlist-detail-head {
  display: grid;
  gap: 8px;
  align-content: start;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.playlist-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.playlist-detail-toolbar.hidden {
  display: none;
}

.playlist-detail-pane h3 {
  font-size: 22px;
  font-weight: 600;
  padding: 0;
  letter-spacing: -0.01em;
}

.playlist-detail-pane .empty {
  border: none;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--r-md);
  padding: 40px 20px;
  color: var(--muted);
  font-size: 13px;
}

.playlist-detail-pane .list .list-item {
  border-radius: var(--r-sm);
}

/* Inline playlist — same row as Play / Queue / ⋮; matches .btn.ghost + .icon-btn rhythm */
.playlist-picker-inline {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  width: auto;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  box-sizing: border-box;
  padding: 3px 6px 3px 4px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: hsla(0, 0%, 100%, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Custom dropdown (no native <select>) — matches app dark UI, fits small screens */
.playlist-picker-dropdown {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 132px;
}

.playlist-picker-trigger {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  padding: 0 8px 0 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  font-family: inherit;
  color: var(--text);
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.playlist-picker-trigger::-webkit-details-marker {
  display: none;
}

.playlist-picker-trigger::after {
  content: "";
  flex-shrink: 0;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform 0.15s ease;
}

.playlist-picker-dropdown[open] > .playlist-picker-trigger::after {
  transform: rotate(180deg);
}

@media (hover: hover) and (pointer: fine) {
  .playlist-picker-trigger:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
  }
}

.playlist-picker-dropdown[open] > .playlist-picker-trigger {
  border-color: hsla(var(--h-primary), 100%, 42%, 0.5);
  box-shadow: 0 0 0 2px hsla(var(--h-primary), 100%, 42%, 0.15);
}

.playlist-picker-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 85;
  min-width: max(100%, 140px);
  max-width: min(240px, calc(100vw - 32px));
  max-height: min(168px, 36vh);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1a1a24;
  box-shadow: var(--shadow-lg);
  -webkit-overflow-scrolling: touch;
}

.playlist-picker-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  margin: 0;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (hover: hover) and (pointer: fine) {
  .playlist-picker-option:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

.playlist-picker-option:active {
  background: rgba(255, 255, 255, 0.12);
}

.playlist-picker-actions {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  width: auto;
  flex: 0 0 auto;
  min-width: 0;
}

/* Same 36px height as .icon-btn; primary Add reads as the main action */
.item-actions .playlist-picker-inline .playlist-picker-add {
  flex: 0 0 auto;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--r-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #000;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

@media (hover: hover) and (pointer: fine) {
  .item-actions .playlist-picker-inline .playlist-picker-add:hover {
    opacity: 0.92;
    filter: brightness(1.03);
  }
}

/* Ghost sibling — same language as other row .btn.ghost */
.item-actions .playlist-picker-inline .playlist-picker-cancel {
  flex: 0 0 auto;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--r-sm);
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .item-actions .playlist-picker-inline .playlist-picker-cancel:hover {
    color: var(--text);
    background: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
  }
}

.song-item-main .item-actions .playlist-picker-inline {
  flex: 0 0 auto;
  max-width: min(100%, calc(100vw - 140px));
}

@media (max-width: 768px) {
  .playlist-picker-inline {
    padding: 4px 8px 4px 6px;
    gap: 8px;
  }

  .playlist-picker-dropdown {
    max-width: min(120px, 28vw);
  }

  .playlist-picker-trigger {
    height: 40px;
    min-height: 40px;
    padding: 0 8px 0 10px;
    font-size: 15px;
  }

  .playlist-picker-menu {
    max-width: min(220px, calc(100vw - 24px));
    max-height: min(152px, 32vh);
  }

  .playlist-picker-option {
    padding: 9px 10px;
    font-size: 15px;
  }

  .item-actions .playlist-picker-inline .playlist-picker-add,
  .item-actions .playlist-picker-inline .playlist-picker-cancel {
    height: 40px;
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  .song-item-main .item-actions .playlist-picker-inline {
    max-width: min(100%, calc(100vw - 96px));
  }
}

.section-secondary .card,
.subtle-card {
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================================
   PLAYER BAR — 100px, matches track-controls.component.scss
   ============================================================ */
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  background: linear-gradient(to bottom, hsl(var(--h-secondary), 25%, 10%), var(--bg-deep));
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-top: 1px solid var(--border-thin);
  z-index: 500;
  overflow: hidden;
}


.player audio {
  display: none;
}

/* Track info — 30% width, matches .track-info */
.player-now-playing {
  width: 30%;
  display: flex;
  align-items: center;
}

/* Album artwork — 60px, matches .album-artwork */
.player-cover-wrap {
  height: 60px;
  min-width: 60px;
  width: 60px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  border-radius: 5%;
  margin-right: 10px;
  background: var(--card-bg);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background-size: cover;
}

.player-cover-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.player-cover-fallback {
  font-size: 20px;
  color: var(--muted);
}

.player-cover-fallback .material-icons {
  font-size: 28px;
}

/* Track text — matches .track-text */
.player-meta {
  width: 100%;
  overflow: hidden;
  line-height: normal;
}

.player-mini-label {
  display: none;
}

/* Title — 14px like .track-title */
.player-meta strong {
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  color: var(--text);
  cursor: default;
}

/* Artist — 14px, #b3b3b3 like .track-artist */
.player-meta .muted {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Playback controls — 40% width, matches .playback-controls */
.player-center {
  flex: 1;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
}


.player-main-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
}


/* Control buttons */
.player-round {
  border-radius: var(--r-full) !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  font-size: 14px !important;
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  transition: opacity 0.2s !important;
}

.player-round .material-icons {
  font-size: 22px;
}

.player-round:hover {
  opacity: 0.7 !important;
}

/* Play/pause — white bg, matches button style */
.player-toggle {
  width: 44px !important;
  height: 44px !important;
  background: var(--text-main) !important;
  color: var(--bg-deep) !important;
  border-radius: var(--r-full) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.2s, background 0.2s !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.player-toggle .material-icons {
  font-size: 26px;
  color: var(--bg-deep);
}


.player-toggle:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  opacity: 1 !important;
}

.player-toggle:hover .material-icons {
  color: #000;
}

/* Progress scrubber — matches .scrubber */
.player-progress-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.player-progress {
  flex: none;
  width: 100%;
  height: 4px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  cursor: pointer;
  transition: height 0.15s;
}

.player-progress:hover {
  height: 6px;
}

.player-progress-buffered,
.player-progress-played {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  border-radius: inherit;
}

.player-progress-buffered {
  background: rgba(255, 255, 255, 0.2);
}

.player-progress-played {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  box-shadow: 0 0 8px var(--accent-glow);
}


/* Time — shows current / duration below the progress bar */
.player-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  width: 100%;
  padding: 0 2px;
}

/* Misc controls — 30% width */
.audio-setting {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.audio-setting-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  white-space: nowrap;
}

.audio-setting-inline input[type="range"] {
  width: 72px;
}

.audio-setting input[type="range"] {
  padding: 0;
  height: 4px;
}

.audio-setting-inline .material-icons {
  color: var(--muted);
  cursor: default;
}

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--r-full);
  cursor: pointer;
  outline: none;
  box-shadow: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: none;
}

/* ============================================================
   PLAYER RIGHT ACTIONS — queue toggle + hide button
   ============================================================ */
.player-right-actions {
  width: 30%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

#queueToggleBtn.active {
  color: var(--accent);
}

/* ============================================================
   QUEUE DRAWER — floating panel, slides in from right
   ============================================================ */
.queue-drawer {
  position: fixed;
  right: -420px;
  bottom: 108px;
  width: 380px;
  max-height: calc(100vh - 140px);
  background: var(--player-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  z-index: 600;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-flat);
}


.queue-drawer.open {
  right: 14px;
}

.queue-drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 16px 16px;
  gap: 14px;
}

.queue-drawer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 4px 0 12px;
  margin-top: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.queue-drawer-header strong {
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  flex: 1;
}

.queue-drawer-header .btn {
  padding: 2px 8px !important;
  font-size: 11px !important;
  height: 22px !important;
  opacity: 0.65;
  transition: opacity 0.15s;
}

@media (hover: hover) and (pointer: fine) {
  .queue-drawer-header .btn:hover {
    opacity: 1;
  }
}

.compact-list .list-item {
  /* Grid: left column = title+meta, right column = action buttons */
  display: grid !important;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "title actions"
    "meta  actions";
  align-items: center;
  height: auto;
  padding: 8px 10px;
  gap: 0 10px;
  border-radius: 6px;
}

/* Avoid sticky :hover on touch (iOS): highlight stayed on wrong row after reorder */
@media (hover: hover) and (pointer: fine) {
  .compact-list .list-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Queue list scrollable area inside drawer */
#queueList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#queueList .queue-row.active {
  background: hsla(var(--h-primary), 100%, 42%, 0.12);
}

#queueList .queue-row.active .song-title {
  color: var(--accent);
}

#queueList .song-title {
  grid-area: title;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  min-width: 0;
}

#queueList .song-meta {
  grid-area: meta;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.3;
}

#queueList .item-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

#queueList .item-actions .btn {
  padding: 3px 9px;
  font-size: 12px;
  min-width: 32px;
  min-height: 32px;
  opacity: 0.75;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

@media (hover: hover) and (pointer: fine) {
  #queueList .item-actions .btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
  }
}

#queueList .meta-pill.good {
  font-size: 11px;
  padding: 2px 6px;
}

#queueList .queue-drag-handle {
  cursor: grab;
  user-select: none;
  font-size: 16px;
  min-width: 18px;
  color: var(--muted);
  opacity: 0.5;
  border: none !important;
  background: transparent !important;
}

#queueList .queue-row.dragging {
  opacity: 0.4;
}

#queueList .queue-row.drag-over {
  border-bottom: 2px solid var(--accent);
}

/* Empty queue state */
#queueList:empty::after {
  content: "Queue is empty";
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.5;
  padding: 4px 0;
  font-style: italic;
}

/* ============================================================
   FLOATING BUTTONS
   ============================================================ */
.player-show-btn {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  z-index: 490;
  border-radius: var(--r-full);
  min-width: 52px;
  height: 36px;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent);
  border: none;
  color: #000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s;
}

.player-show-btn:hover {
  opacity: 0.85;
}

.player-show-btn .material-icons {
  font-size: 22px;
}

.sidebar-show-btn {
  position: fixed;
  left: 12px;
  top: 14px;
  z-index: 490;
  border-radius: var(--r-full);
  min-width: 44px;
  min-height: 44px;
  font-size: 16px;
  background: var(--sidebar-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  transition: opacity 0.2s;
}

.sidebar-show-btn:hover {
  opacity: 0.8;
}

.sidebar-show-btn .material-icons {
  font-size: 22px;
}

body.queue-open {
  overflow: hidden;
}

/* ============================================================
   HISTORY / FAVORITES VIEWS
   ============================================================ */
#historyView,
#favoritesView {
  padding: 0;
}

#historyView.active,
#favoritesView.active {
  display: block;
}

#historyView .card,
#favoritesView .card {
  padding: 15px 20px;
}

#historyList,
#favoriteList {
  padding: 0 20px 20px;
}

#historyStats {
  padding: 10px 20px;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: none;
}

/* Library views */
#libraryAlbumsView,
#libraryArtistsView,
#profilesView {
  padding: 0;
}

#libraryAlbumsView.active,
#libraryArtistsView.active,
#profilesView.active {
  display: block;
}

#libraryAlbumsView .card,
#libraryArtistsView .card,
#profilesView .card {
  padding: 15px 20px;
}

.profile-form {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 20px;
}

.profile-avatar-block {
  display: grid;
  gap: 10px;
  align-content: start;
}

.profile-photo-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.profile-avatar-frame {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
}

.profile-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-form-fields {
  display: grid;
  gap: 12px;
}

.profile-form-fields input {
  height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 15px;
  padding: 0 16px;
}

.profile-form-fields textarea {
  resize: none;
  min-height: 100px;
  height: 100px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}

.profile-form-fields textarea:focus {
  outline: 2px solid rgba(105, 240, 174, 0.45);
  outline-offset: 0;
  border-color: rgba(105, 240, 174, 0.45);
}

/* ============================================================
   SECTION WRAPPERS — outer container padding
   ============================================================ */
.section-primary {
  padding: 15px 20px 5px;
}

.section-secondary .card,
.subtle-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION — hidden on desktop
   ============================================================ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: linear-gradient(to top, #0a0a12 0%, rgba(10, 10, 18, 0.97) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 700;
  justify-content: space-around;
  align-items: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  min-width: 0;
}

.mobile-nav-btn .material-icons {
  font-size: 22px;
  transition: color 0.2s;
}

.mobile-nav-btn span {
  letter-spacing: 0.02em;
  line-height: 1;
}

.mobile-nav-btn.active {
  color: var(--accent);
}

.mobile-nav-btn:active {
  color: var(--text);
}

/* ============================================================
   MOBILE VOLUME BUTTON & POPUP — hidden on desktop
   ============================================================ */
.mobile-volume-wrap {
  position: relative;
  display: none;
}

.mobile-volume-popup {
  display: none;
  position: fixed;
  bottom: calc(64px + 56px + env(safe-area-inset-bottom, 0px) + 10px);
  right: 10px;
  background: rgba(22, 22, 34, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 10px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 3000;
  min-width: 0;
  animation: fadein 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-volume-popup.open {
  display: flex;
}

.mobile-volume-stepper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mobile-volume-step-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main, #fff);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-volume-step-btn:active {
  background: rgba(255, 255, 255, 0.14);
}

.mobile-volume-step-btn .material-icons {
  font-size: 22px;
  line-height: 1;
}

.mobile-volume-percent {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 3.25rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  user-select: none;
}

/* ============================================================
   MOBILE MENU OVERLAY — full-screen slide-up panel
   ============================================================ */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-overlay.open {
  opacity: 1;
}

.mobile-menu-inner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #121216 0%, #080809 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px 24px 0 0;
  padding: 24px 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.mobile-menu-overlay.open .mobile-menu-inner {
  transform: translateY(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-menu-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.mobile-menu-header .btn {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.mobile-menu-items {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(4px);
  }

  .mobile-menu-item:hover .material-icons {
    color: var(--accent);
    filter: drop-shadow(0 0 8px hsla(var(--h-accent), 100%, 50%, 0.4));
  }
}

.mobile-menu-item:active,
.mobile-menu-item.active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  transform: translateX(4px);
}

.mobile-menu-item.active .material-icons,
.mobile-menu-item:active .material-icons {
  color: var(--accent) !important;
  filter: drop-shadow(0 0 8px hsla(var(--h-accent), 100%, 50%, 0.4)) !important;
}


/* ============================================================
   TOUCH OPTIMIZATIONS — global
   ============================================================ */
@media (pointer: coarse) {

  /* Ensure minimum touch targets */
  .btn,
  .icon-btn,
  .menu-btn,
  .mobile-nav-btn,
  .mobile-menu-item {
    min-height: 44px;
  }

  /* Song action buttons should stay compact — they are small tap targets by design */
  .item-actions .btn {
    min-height: 32px;
  }

  /* Remove hover effects on touch to prevent sticky states */
  .list-item:hover {
    background: transparent;
  }

  .list-item:active {
    background: var(--hover-bg);
  }

  /* Tap highlight */
  a,
  button,
  [role="button"] {
    -webkit-tap-highlight-color: rgba(105, 240, 174, 0.08);
  }

  /* Smooth scrolling for momentum */
  .layout,
  .main,
  .sidebar,
  .menu,
  .ytm-search-chips {
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================================
   RESPONSIVE — TABLET (≤ 980px)
   ============================================================ */
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    height: calc(100% - 100px);
    overflow-y: auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .sidebar {
    width: 100%;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 10px 6px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(8px);
  }

  .layout.sidebar-collapsed .sidebar {
    width: 100%;
    min-width: 0;
    padding: 8px 10px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .sidebar-playlists {
    display: none;
  }

  .sidebar-divider {
    display: none;
  }

  .sidebar-section-label {
    display: none;
  }

  .menu {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    scroll-snap-type: x proximity;
    padding-bottom: 2px;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .menu-btn {
    white-space: nowrap;
    flex-shrink: 0;
    height: 42px;
    gap: 6px;
    padding: 0 12px;
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    scroll-snap-align: start;
  }

  .menu-btn.active {
    background: rgba(105, 240, 174, 0.14);
    border-color: rgba(105, 240, 174, 0.35);
  }

  .brand {
    padding: 0 6px 0 0;
    min-width: fit-content;
    gap: 8px;
  }

  .brand h2 {
    display: none;
  }

  .sidebar-toggle-btn {
    display: none;
  }

  .sidebar-show-btn {
    display: none !important;
  }

  .main {
    overflow-y: visible;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .playlist-explorer {
    grid-template-columns: 1fr;
  }

  .ytm-featured-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .artist-detail-layout {
    flex-direction: column;
  }

  .browse-charts {
    grid-template-columns: 1fr;
  }

  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }

  .profile-form {
    grid-template-columns: 1fr;
  }

  .library-card {
    max-width: none;
  }

  .library-card-artwork {
    width: 100%;
    height: auto;
  }

  .player {
    height: auto;
    min-height: 100px;
    max-height: 52vh;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    overflow: auto;
  }

  .player-now-playing {
    width: 100%;
  }

  .player-center {
    width: 100%;
    padding: 0;
  }

  .queue-drawer {
    width: calc(100vw - 24px);
    right: -110vw;
    border-radius: 12px;
  }

  .queue-drawer.open {
    right: 12px;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE-TABLET (≤ 768px)
   Bottom nav replaces sidebar, layout adapts
   ============================================================ */
@media (max-width: 768px) {

  /* Show mobile bottom nav, hide sidebar */
  .mobile-bottom-nav {
    display: flex;
  }

  /* Ses kontrolü yalnızca geniş ekranda; mobilde donanım ses tuşları kullanılır */
  .mobile-volume-wrap {
    display: none !important;
  }

  .sidebar {
    display: none !important;
  }

  .layout {
    grid-template-columns: 1fr !important;
  }

  .layout.sidebar-collapsed {
    grid-template-columns: 1fr !important;
  }

  /* Adjust layout height for bottom nav + optional player */
  .layout {
    height: calc(100% - 56px - env(safe-area-inset-bottom, 0px));
  }

  .layout.player-bar-hidden {
    height: calc(100% - 56px - env(safe-area-inset-bottom, 0px));
  }

  /* Player bar sits above bottom nav */
  .player {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  /* When player is visible, layout should account for both */
  .layout:not(.player-bar-hidden) {
    height: calc(100% - 64px - 56px - env(safe-area-inset-bottom, 0px));
  }

  /* Topbar – hide welcome panel on mobile to save space */
  #userOverviewPanel {
    display: none !important;
  }

  /* Song items — restructure for mobile so buttons aren't clipped */
  .song-item-main {
    flex-wrap: wrap;
    overflow: visible;
  }

  .song-content {
    display: contents;
  }

  .song-title,
  .song-meta {
    width: calc(100% - 60px);
    flex-shrink: 1;
  }

  .item-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 8px 14px;
    gap: 6px;
  }

  .topbar-icon-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    gap: 6px;
  }

  .topbar-icon-actions::-webkit-scrollbar {
    display: none;
  }

  /* Player bar — compact mobile layout */
  .player {
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    flex-direction: row;
    align-items: center;
    padding: 0 10px;
    overflow: hidden;
    gap: 0;
    position: fixed;
  }

  /* Progress bar on top as thin line */
  .player-progress-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    gap: 0;
  }

  .player-progress {
    height: 3px;
    border-radius: 0;
  }

  .player-progress:hover {
    height: 3px;
  }

  .player-times {
    display: none;
  }

  /* Now playing — takes available space */
  .player-now-playing {
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .player-cover-wrap {
    width: 44px;
    min-width: 44px;
    height: 44px;
    margin-right: 10px;
    border-radius: 6px;
  }

  .player-meta strong {
    font-size: 13px;
  }

  .player-meta .muted {
    font-size: 12px;
  }

  /* Center controls — minimal */
  .player-center {
    flex: 0 0 auto;
    padding: 0;
    gap: 0;
    width: auto;
  }

  .player-main-controls {
    gap: 0;
  }

  /* Hide non-essential controls on mobile */
  #playerRepeatBtn,
  .audio-setting-inline {
    display: none !important;
  }

  .player-round {
    width: 34px !important;
    height: 34px !important;
  }

  .player-round .material-icons {
    font-size: 20px;
  }

  .player-toggle {
    width: 38px !important;
    height: 38px !important;
  }

  .player-toggle .material-icons {
    font-size: 22px;
  }

  /* Right actions — minimal */
  .player-right-actions {
    width: auto;
    gap: 2px;
    flex-shrink: 0;
  }

  #playerHideBtn {
    display: none !important;
  }

  /* Queue drawer — full width above bottom nav */
  .queue-drawer {
    width: calc(100vw - 12px);
    right: -120vw;
    bottom: calc(64px + 56px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px;
    max-height: calc(100vh - 64px - 56px - env(safe-area-inset-bottom, 0px) - 12px);
  }

  .queue-drawer.open {
    right: 6px;
  }

  /* Artist detail section — stacked on mobile */
  .artist-detail-section {
    border-right: none;
    border-bottom: none;
    padding: 0 8px;
  }

  #artistDetailResults {
    max-height: 300px;
  }

  #artistDetailResults .list-item {
    width: 80vw;
    min-width: 240px;
    max-width: none;
  }

  .artist-album-card {
    flex: 0 0 140px;
    min-width: 120px;
  }

  /* Show sidebar-show-btn as it's hidden */
  .sidebar-show-btn {
    display: none !important;
  }

  /* Player show button positioned above bottom nav */
  .player-show-btn {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 12px);
  }

  /* Artist Profile Pagination */
  .artist-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
  }

  .artist-section-header h3 {
    margin: 0;
    padding-bottom: 0;
  }

  .artist-page-nav {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .artist-page-info {
    font-size: 13px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }

  .artist-page-arrow {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
  }

  .artist-page-arrow:disabled {
    opacity: 0.3;
    pointer-events: none;
  }

  .artist-slide-left {
    animation: artistSlideLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .artist-slide-right {
    animation: artistSlideRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes artistSlideLeft {
    0% {
      transform: translateX(-20px);
      opacity: 0;
    }

    100% {
      transform: translateX(0);
      opacity: 1;
    }
  }

  @keyframes artistSlideRight {
    0% {
      transform: translateX(20px);
      opacity: 0;
    }

    100% {
      transform: translateX(0);
      opacity: 1;
    }
  }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {
  .main {
    padding-bottom: 0;
  }

  .card {
    padding: 12px 14px;
  }

  .card h3 {
    font-size: 20px;
    padding-top: 2px;
    padding-bottom: 8px;
  }

  .section-primary {
    padding: 12px 14px 4px;
  }

  /* Only Search still uses fluid artwork in some layouts; For You / Browse rails keep fixed tile sizes for horizontal scroll */
  #searchView .artist-rail-artwork,
  #searchView .recommendation-rail-artwork {
    width: 100%;
    height: auto;
  }

  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .library-card {
    max-width: none;
  }

  .library-card-artwork {
    width: 100%;
    height: auto;
  }

  .artist-detail-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .artist-detail-heading h3 {
    font-size: 24px;
  }

  .artist-detail-photo-frame {
    width: 60px;
    height: 60px;
  }

  .artist-detail-photo-frame .song-artwork-fallback {
    font-size: 18px;
  }

  #searchQuery {
    height: 44px;
    font-size: 14px;
  }

  #searchForm .btn-primary {
    height: 44px;
  }

  #searchForm {
    border-radius: 10px;
  }

  .login-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .login-hero {
    padding: 22px 18px;
    gap: 14px;
  }

  .login-title {
    font-size: 26px;
  }

  .login-hero-copy {
    font-size: 13px;
  }

  .login-card {
    padding: 22px 18px;
    border-radius: 16px;
  }

  .login-card-title {
    font-size: 22px;
  }

  .auth-mode-tabs {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
  }

  .auth-mode-tabs .btn.ghost {
    font-size: 12px;
    padding: 8px 6px;
  }

  .playlist-explorer {
    padding: 0;
    gap: 16px;
  }

  .ytm-search-shell {
    padding: 10px 12px;
    gap: 10px;
  }

  .search-analytics {
    padding: 0 10px 20px;
  }

  /* Profile form */
  .profile-form {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .profile-avatar-frame {
    width: 120px;
    height: 120px;
  }

  .profile-avatar-block {
    justify-items: center;
    text-align: center;
  }

  .profile-photo-actions {
    justify-content: center;
  }
}

/* ============================================================
   RESPONSIVE — COMPACT MOBILE (≤ 430px)
   ============================================================ */
@media (max-width: 430px) {

  html,
  body {
    overflow: auto;
  }

  .flash {
    left: 10px;
    right: 10px;
    top: 10px;
    max-width: none;
    font-size: 13px;
  }

  .main {
    padding-bottom: 0;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .card {
    padding: 10px 12px 12px;
  }

  .card h3 {
    font-size: 18px;
    padding-top: 0;
  }

  .section-primary {
    padding: 10px 12px 4px;
  }

  .ytm-search-shell {
    padding: 10px 10px 10px;
    gap: 8px;
  }

  #searchForm {
    display: flex;
    align-items: center;
    gap: 0;
    padding-left: 10px;
    border-radius: 10px;
  }

  .search-form-icon {
    font-size: 18px;
  }

  #searchQuery {
    width: auto;
    min-width: 0;
    flex: 1;
    height: 42px;
    font-size: 14px;
  }

  #searchForm .btn-primary {
    width: auto;
    height: 42px;
    min-width: 78px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 0 10px 10px 0 !important;
  }

  .ytm-search-chips .btn.ghost {
    font-size: 13px;
    padding: 6px 14px;
  }

  .library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding-left: 6px;
    padding-right: 6px;
    padding-bottom: 12px;
  }

  .library-card {
    max-width: none;
    padding: 6px;
    padding-bottom: 12px;
  }

  .artist-detail-hero {
    padding: 10px 12px;
  }

  .artist-detail-heading h3 {
    font-size: 22px;
  }

  .artist-detail-filter-input {
    width: 100%;
  }

  #artistAlbumTracksTitle,
  #browseGenreTracksTitle {
    scroll-margin-top: 16px;
  }

  .playlist-explorer {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 16px;
  }

  .playlist-tabs {
    flex-wrap: wrap;
  }

  .playlist-inline-search {
    grid-template-columns: 1fr;
  }

  .playlist-detail-pane {
    padding: 16px;
  }

  .row {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .item-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Compact song action buttons so all fit on screen */
  .item-actions .btn {
    padding: 3px 8px;
    font-size: 11px;
    min-height: 28px;
    border-radius: var(--r-xs);
  }

  .playlist-inline-actions .btn {
    padding: 4px 10px;
    font-size: 11px;
  }

  #historyView .card,
  #favoritesView .card,
  #libraryAlbumsView .card,
  #libraryArtistsView .card,
  #profilesView .card {
    padding: 10px 12px;
  }

  #historyList,
  #favoriteList,
  #historyStats {
    padding-left: 12px;
    padding-right: 12px;
  }

  #libraryArtistsGrid.library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding-left: 2px;
    padding-right: 2px;
  }

  #libraryAlbumsGrid.library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding-left: 2px;
    padding-right: 2px;
  }

  #libraryArtistsGrid .library-card {
    padding: 4px;
    padding-bottom: 8px;
  }

  #libraryAlbumsGrid .library-card {
    padding: 4px;
    padding-bottom: 8px;
  }

  #libraryArtistsGrid .library-card-title,
  #libraryAlbumsGrid .library-card-title {
    font-size: 11px;
    line-height: 1.2;
  }

  #libraryArtistsGrid .library-card-meta,
  #libraryAlbumsGrid .library-card-meta {
    font-size: 10px;
  }

  /* Queue drawer compact */
  .queue-drawer {
    width: calc(100vw - 8px);
    right: -120vw;
    bottom: calc(64px + 56px + env(safe-area-inset-bottom, 0px));
    border-radius: 10px;
    max-height: calc(100vh - 64px - 56px - env(safe-area-inset-bottom, 0px) - 8px);
  }

  .queue-drawer.open {
    right: 4px;
  }

  .queue-drawer-inner {
    padding: calc(18px + env(safe-area-inset-top, 0px)) 12px 12px;
    gap: 12px;
  }

  .queue-drawer-header {
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 10px;
  }

  .queue-drawer-header .btn {
    min-height: 30px !important;
  }

  #queueList .item-actions {
    gap: 6px;
  }

  #queueList .item-actions .btn {
    min-width: 34px;
    min-height: 34px;
  }

  /* Login — ultra compact */
  .center-wrap {
    padding: 16px 12px;
  }

  .login-hero {
    padding: 18px 14px;
    border-radius: 16px;
  }

  .login-title {
    font-size: 24px;
  }

  .login-tagline {
    font-size: 12px;
  }

  .login-card {
    padding: 18px 14px;
    border-radius: 14px;
    gap: 14px;
  }

  .login-card-title {
    font-size: 20px;
  }

  .login-card-subtitle {
    font-size: 12px;
  }

  /* Song items — slightly more compact */
  .song-artwork {
    width: 36px;
    height: 36px;
    margin-right: 8px;
    margin-left: 4px;
  }

  .song-title {
    font-size: 14px;
  }

  .song-meta {
    font-size: 12px;
  }

  .list-item {
    min-height: 50px;
    padding: 6px 8px;
  }

  /* Topbar actions scroll hint */
  .topbar {
    padding: 8px 10px;
  }

  .topbar-icon-actions {
    gap: 4px;
  }
}

/* ============================================================
   RESPONSIVE — VERY SMALL MOBILE (≤ 360px)
   ============================================================ */
@media (max-width: 360px) {

  /* ≤360px — artist/rec kartları zaten flex/horizontal, sadece biraz daha küçült */
  .artist-rail-card,
  .recommendation-rail-card {
    flex: 0 0 100px;
    width: 100px;
    max-width: 100px;
  }

  .artist-rail-artwork,
  .recommendation-rail-artwork {
    width: 100px;
    height: 100px;
  }

  .artist-rail-name,
  .recommendation-rail-title {
    font-size: 11px;
  }

  .artist-rail-meta,
  .recommendation-rail-artist {
    font-size: 10px;
  }

  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #libraryArtistsGrid.library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #libraryAlbumsGrid.library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-icon-actions {
    gap: 2px;
  }

  .mobile-nav-btn .material-icons {
    font-size: 20px;
  }

  .mobile-nav-btn span {
    font-size: 9px;
  }

  .card h3 {
    font-size: 17px;
  }

  .ytm-search-chips .btn.ghost {
    font-size: 12px;
    padding: 5px 10px;
  }

  .login-shell {
    gap: 10px;
  }

  .login-hero-copy {
    font-size: 12px;
  }

  .auth-mode-tabs .btn.ghost {
    font-size: 11px;
    padding: 7px 4px;
  }

  /* Ultra-compact song action buttons for very small screens */
  .item-actions .btn {
    padding: 2px 6px;
    font-size: 10px;
    min-height: 26px;
    gap: 2px;
  }

  .item-actions {
    gap: 3px;
  }
}

/* ============================================================
   LISTEN TOGETHER / REAL-TIME SYNC
   ============================================================ */
.sync-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  /* Slightly more transparent for better blur contrast */
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlay-fade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes overlay-fade {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }

  to {
    opacity: 1;
    backdrop-filter: blur(20px);
  }
}

.sync-overlay-inner {
  width: min(900px, 98vw);
  max-height: 94vh;
  background: rgba(28, 28, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.sync-overlay-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}


.sync-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sync-overlay-header h3 {
  font-size: 24px !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #fff 0%, #aaa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}


.sync-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

@media (min-width: 800px) {
  .sync-grid-layout {
    grid-template-columns: 320px 1fr;
    overflow: hidden;
    /* Desktop handles overflow internally */
  }
}

.sync-grid-right {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sync-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  /* Align left */
  text-align: left;
  width: 100%;
}


.qrcode-container {
  background: white;
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.qrcode-container:hover {
  transform: scale(1.02);
}


.sync-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.sync-actions .btn {
  flex: 1;
}

.sync-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.sync-tap-to-listen-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  margin-top: 4px;
}

.sync-tap-to-listen-wrap.hidden {
  display: none !important;
}

.sync-tap-to-listen-hint {
  font-size: 13px;
  margin: 0;
  line-height: 1.4;
}

.sync-tap-to-listen-btn .material-icons {
  vertical-align: middle;
}

.sync-icon-pulse {
  font-size: 48px;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  animation: sync-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes sync-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
    filter: drop-shadow(0 0 0px var(--accent));
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
    filter: drop-shadow(0 0 8px var(--accent));
  }

  100% {
    transform: scale(1);
    opacity: 0.8;
    filter: drop-shadow(0 0 0px var(--accent));
  }
}


.btn.danger,
.danger {
  color: #ff8a80 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

.btn.danger:hover,
.danger:hover {
  background: rgba(239, 68, 68, 0.2) !important;
}

.sync-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
}

.sync-divider::before,
.sync-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sync-divider span {
  padding: 0 10px;
}

.sync-join-manual {
  display: flex;
  gap: 8px;
  width: 100%;
}

.sync-join-manual input {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  color: var(--text);
  font-family: inherit;
}

.sync-section {
  width: 100%;
  text-align: left;
  margin-top: 15px;
}

.sync-section h4 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--muted);
}

.sync-participants-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

/* Legacy participant item styles removed - using new chat-integrated styles below */

.sync-participant-kick-btn {
  padding: 2px 6px !important;
  font-size: 11px !important;
  height: auto !important;
}

.sync-session-id-display {
  font-size: 14px;
  margin: 10px 0;
  padding: 4px 12px;
  background: var(--bg-soft);
  border-radius: var(--r-md);
}

.sync-current-song-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  text-align: left;
  width: 100%;
  transition: background 0.2s;
}

.sync-current-song-info:hover {
  background: rgba(255, 255, 255, 0.08);
}


.sync-current-song-info img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}


.sync-song-details {
  flex: 1;
  overflow: hidden;
}

.sync-song-details div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-name.clickable {
  cursor: pointer;
  transition: color 0.2s;
}

.participant-name.clickable:hover {
  color: var(--ytm-brand-color, #1db954);
  text-decoration: underline;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 50px solid rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.scanner-overlay::after {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  margin: -100px;
  border: 2px solid var(--ytm-brand-color, #1db954);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.btn-full {
  width: 100%;
}

.player-controls-restricted .player-control-btn,
.player-controls-restricted #playerProgress {
  opacity: 0.5;
  cursor: not-allowed !important;
}

.player-controls-restricted .player-control-btn {
  filter: grayscale(0.8);
}

/* ============================================================
   SESSION CHAT & SHARED VIEW
   ============================================================ */
.sync-split-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.sync-participants-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  max-height: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sync-chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
}

.sync-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sync-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.sync-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.sync-chat-form {
  flex-shrink: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}


.sync-host-view-compact {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--r-md);
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.sync-host-view-compact .qrcode-container {
  width: 100px;
  height: 100px;
  padding: 6px;
  margin: 0;
}

.sync-host-view-compact .qrcode-container canvas,
.sync-host-view-compact .qrcode-container img {
  width: 100% !important;
  height: 100% !important;
}

.sync-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-full) !important;
  padding: 10px 16px !important;
  height: 48px !important;
  /* Larger for mobile */
  font-size: 16px !important;
  /* Prevent iOS zoom */
}

.sync-section {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--r-md);
  padding: 12px;
  min-height: 0;
}

.sync-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sync-participants-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sync-chat-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.sync-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}


.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: fadein 0.2s ease;
  position: relative;
}

.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.chat-msg-author {
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
}

.chat-msg-time {
  font-size: 10px;
  color: var(--muted);
}

.chat-msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 4px 16px 16px 16px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
  border: 1px solid rgba(255, 255, 255, 0.08);
}


.chat-msg-own {
  align-self: flex-end;
}

.chat-msg-own .chat-msg-bubble {
  background: rgba(34, 197, 94, 0.15);
  border-radius: 16px 4px 16px 16px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #fff;
}


.chat-msg-own .chat-msg-author {
  color: var(--text);
  display: none;
  /* Hide own name to save space */
}

.chat-msg-delete-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: var(--danger) !important;
  color: #000 !important;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.chat-msg:hover .chat-msg-delete-btn {
  opacity: 1;
}



/* Chat Form */
.sync-chat-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sync-chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3) !important;
  border-radius: var(--r-full) !important;
  padding: 8px 16px !important;
  height: 38px !important;
}



.mute-banner {
  background: var(--danger-dim);
  color: var(--danger);
  padding: 6px;
  border-radius: var(--r-sm);
  font-size: 11px;
  text-align: center;
  margin-top: 8px;
}

.sync-participant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--r-sm);
}

.sync-participant-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  object-fit: cover;
}

.sync-participant-info {
  flex: 1;
  overflow: hidden;
}

.sync-participant-name {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-participant-badges {
  display: flex;
  gap: 4px;
}

.badge {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
}

.badge-host {
  background: var(--accent);
  color: #000;
}

.badge-muted {
  background: var(--muted);
  color: #fff;
}

.sync-participant-actions {
  display: flex;
  gap: 4px;
}

@media (max-width: 800px) {
  .sync-chat-messages {
    min-height: 200px !important;
    max-height: 350px;
    flex: 1 1 auto;
    margin-bottom: 12px;
  }

  .sync-grid-layout {
    overflow-y: auto !important;
    padding-bottom: 40px;
    display: block;
    /* Stack naturally on mobile */
  }

  .sync-grid-right,
  .sync-chat-section {
    overflow: visible !important;
    height: auto !important;
  }
}

/* ============================================================
   SHARE FEATURE
   ============================================================ */
.btn-share {
  color: var(--accent) !important;
}

.btn-share:hover {
  background: var(--accent-dim) !important;
}

.playlist-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

/* Compact overflow menu (playlists + playlist track rows) */
.row-actions-dropdown {
  position: relative;
  flex-shrink: 0;
}

.row-actions-dropdown-trigger {
  list-style: none;
}

.row-actions-dropdown-trigger::-webkit-details-marker {
  display: none;
}

/* Anchor panel to trigger's start edge so it opens rightward — avoids clipping off the
   left edge when the ⋮ control sits on the left (mobile song rows with flex-start). */
.row-actions-dropdown-panel {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 4px);
  z-index: 50;
  min-width: 188px;
  max-width: min(288px, calc(100vw - 16px));
  padding: 4px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1a1a24;
  box-shadow: var(--shadow-lg);
}

/* Playlist grid rows: ⋮ sits in the right column — keep menu aligned to that edge. */
.playlist-menu-item .row-actions-dropdown-panel,
.playlist-detail-pane .row-actions-dropdown-panel {
  left: auto;
  right: 0;
}

/* Let the menu paint outside overflow-hidden song text columns while open. */
.list-item:has(.row-actions-dropdown[open]) {
  position: relative;
  z-index: 25;
}

.list-item:has(.row-actions-dropdown[open]) .song-item-main,
.list-item:has(.row-actions-dropdown[open]) .song-content {
  overflow: visible;
}

/* Playlist picker menu is position:absolute — same overflow clip as ⋮ without this */
.list-item:has(.playlist-picker-dropdown[open]) {
  position: relative;
  z-index: 28;
}

.list-item:has(.playlist-picker-dropdown[open]) .song-item-main,
.list-item:has(.playlist-picker-dropdown[open]) .song-content {
  overflow: visible;
}

.row-actions-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.row-actions-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.row-actions-dropdown-item.danger {
  color: var(--danger, #f87171);
}

.playlist-menu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  gap: 1px 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-md);
  transition: background 0.2s;
  position: relative;
}

.playlist-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.playlist-menu-item.active {
  background: rgba(255, 255, 255, 0.08);
}

.playlist-menu-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.playlist-menu-item .song-title {
  grid-column: 1;
  grid-row: 1;
  font-weight: 500;
  font-size: 14px;
}

.playlist-menu-item.active .song-title {
  color: var(--accent);
}

.playlist-menu-item > .song-meta:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
  opacity: 0.6;
}

.playlist-menu-item > .song-meta:nth-child(3) {
  grid-column: 1;
  grid-row: 3;
  font-size: 11px;
  opacity: 0.45;
}

.playlist-menu-item .item-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-top: 0;
  align-self: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.playlist-menu-item:hover .item-actions {
  opacity: 1;
}

.song-item-compact .item-actions {
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .song-item-compact .song-title .muted,
  .song-item-compact .source-pill {
    display: none;
  }
}

/* ============================================================
   RESPONSIVE LAYOUT REFINEMENTS
   ============================================================ */
@media screen and (max-width: 980px) {

  /* Tighten paddings for mid-size tablets to phones */
  .card,
  .topbar,
  .ytm-search-shell {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .main {
    padding-left: 0 !important;
  }
}

@media screen and (max-width: 600px) {

  /* Extreme tight for small phones */
  .card,
  .topbar,
  .ytm-search-shell {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .search-artist-rail,
  .search-recommendation-rail {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  /* Keep For You recommendation rail edge padding for swipe scrolling */
  #forYouView #forYouRecommendations.foryou-recommendation-rail {
    padding-left: 12px !important;
    padding-right: 20px !important;
  }
}

/* ============================================================
   SHARED MUSIC AUTOSTART OVERLAY
   ============================================================ */
.share-start-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadein 0.4s ease-out;
}

.share-start-content {
  text-align: center;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.share-start-icon {
  font-size: 80px;
  color: var(--accent);
  filter: drop-shadow(0 0 20px hsla(var(--h-accent), 100%, 50%, 0.3));
  margin-bottom: 8px;
}

.share-start-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.share-start-text {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.share-start-btn {
  margin-top: 20px;
  padding: 16px 32px !important;
  font-size: 16px !important;
  border-radius: 80px !important;
  box-shadow: 0 10px 30px rgba(0, 212, 170, 0.25);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.share-start-btn:active {
  transform: scale(0.95);
}

/* ============================================================
   MOBILE VOLUME FIX
   ============================================================ */
@media screen and (max-width: 768px) {
  .audio-setting.audio-setting-inline {
    display: none !important;
  }
}

/* ============================================================
   FULL SCREEN PLAYER (NOW PLAYING)
   ============================================================ */
/* Full-player: Save to playlist modal + track action sheet (appended to body) */
.fp-playlist-picker-root,
.fp-action-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}

@media screen and (min-width: 640px) {
  .fp-playlist-picker-root,
  .fp-action-sheet-root {
    align-items: center;
    padding: 24px;
  }
}

.fp-playlist-picker-backdrop,
.fp-action-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  touch-action: manipulation;
}

.fp-playlist-sheet {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: 100%;
  max-width: 420px;
  max-height: min(85vh, 640px);
  display: flex;
  flex-direction: column;
  background: #161622;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  touch-action: manipulation;
}

.fp-action-sheet {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: 100%;
  max-width: 420px;
  max-height: min(85vh, 640px);
  display: flex;
  flex-direction: column;
  background: #161622;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: manipulation;
}

@media screen and (min-width: 640px) {
  .fp-playlist-sheet,
  .fp-action-sheet {
    border-radius: 16px;
    max-height: min(80vh, 560px);
  }
}

.fp-playlist-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
  flex-shrink: 0;
}

.fp-playlist-sheet-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main, #fff);
}

.fp-playlist-sheet-close .material-icons {
  font-size: 22px;
}

.fp-playlist-sheet-sub {
  padding: 0 16px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fp-playlist-sheet-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.fp-playlist-sheet-empty {
  padding: 16px;
  text-align: center;
  font-size: 14px;
}

.fp-playlist-sheet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 10px;
  margin: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-main, #fff);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fp-playlist-sheet-row:active {
  background: rgba(255, 255, 255, 0.08);
}

.fp-playlist-sheet-row-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
}

.fp-playlist-sheet-row-icon .material-icons {
  font-size: 22px;
  opacity: 0.9;
}

.fp-playlist-sheet-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fp-playlist-sheet-row-name {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fp-playlist-sheet-row-meta {
  font-size: 12px;
}

.fp-playlist-sheet-footer {
  flex-shrink: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fp-playlist-new-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 600;
  background: #fff;
  color: #111;
  border: none;
}

.fp-playlist-new-btn .material-icons {
  font-size: 20px;
}

.fp-playlist-new-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fp-playlist-new-form .fp-playlist-new-label {
  margin: 0;
}

.fp-playlist-new-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.fp-playlist-new-form-actions .btn {
  min-width: 88px;
}

.fp-action-sheet {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.fp-action-sheet .fp-action-sheet-header {
  padding: 16px 16px 8px;
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fp-action-sheet-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  background: transparent;
  color: var(--text-main, #fff);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fp-action-sheet-row:active {
  background: rgba(255, 255, 255, 0.06);
}

.fp-action-sheet-row .material-icons {
  font-size: 22px;
  opacity: 0.85;
  flex-shrink: 0;
}

.fp-media-mode-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px 16px;
  flex-shrink: 0;
}

.fp-media-seg {
  flex: 1 1 auto;
  min-width: 120px;
  max-width: 200px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.fp-media-seg.active {
  background: rgba(29, 185, 84, 0.25);
  border-color: rgba(29, 185, 84, 0.5);
  color: #fff;
}

.fp-art-main,
.fp-art-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fp-art-video {
  aspect-ratio: 16 / 9;
  max-height: 45vh;
  object-fit: contain;
  background: #000;
}

/* Native play/volume/progress chrome off — İlgili / Song sekmesinde gizli video + alttaki kendi kontrollerimiz */
#fullPlayerVideo::-webkit-media-controls {
  display: none !important;
}
#fullPlayerVideo::-webkit-media-controls-enclosure {
  display: none !important;
}

/* Discover → full player: Song tab shows artwork; same video keeps playing (audio) invisibly */
#fullPlayerVideo.fp-video-behind-artwork {
  position: absolute;
  width: 1px;
  height: 1px;
  max-height: none;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
  overflow: hidden;
}

.fp-video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  line-height: 1.4;
}

.fp-video-placeholder .material-icons {
  font-size: 48px;
  opacity: 0.55;
}

.fp-playing-from {
  padding: 8px 4px 4px;
  font-size: 12px;
  margin: 0;
}

.full-player-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}

.full-player-overlay:not(.hidden) {
  transform: translateY(0);
}

.full-player-bg {
  position: absolute;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(80px) brightness(0.4);
  z-index: 0;
  transition: background-image 0.5s ease;
}

.full-player-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 20px;
}

/* Header */
.full-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  min-height: 80px;
  flex-shrink: 0;
}

.fp-header-center {
  flex: 1;
  text-align: center;
}

.fp-header-context {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

/* Body / Split */
.full-player-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(400px, 1fr) 400px;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 40px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* LEFT SIDE (Art & Controls) */
.full-player-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.full-player-art-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 45vh;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  background: var(--card-bg);
}

.full-player-art-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.full-player-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.full-player-meta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Tam ekran: masaüstünde ikon + range; mobilde (≤768px) stepper — iOS range güvenilir değil */
.fp-volume-stepper-full {
  display: none;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.full-player-volume--inline {
  padding: 0;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.full-player-volume--inline input[type="range"] {
  flex: 0 0 auto;
  width: 88px;
  max-width: 88px;
  min-width: 48px;
}

@media screen and (max-width: 980px) {
  .full-player-volume--inline input[type="range"] {
    width: min(120px, 28vw);
    max-width: min(120px, 28vw);
  }
}

/* Tam ekran mobil: başlık + sanatçı solda, playlist/share/fav sağda aynı satır (üst hizalı) */
@media screen and (max-width: 768px) {
  .full-player-meta {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .full-player-info {
    flex: 1;
    min-width: 0;
    width: auto;
    max-width: none;
  }

  .full-player-info h2 {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: clamp(18px, 4.5vw, 26px);
  }

  .full-player-meta-actions {
    width: auto;
    flex-shrink: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 6px;
    margin-top: 2px;
  }

  /* Tam ekranda ses satırı yalnızca web (geniş ekran); mobilde gizli */
  .full-player-volume.full-player-volume--inline {
    display: none !important;
  }

  .full-player-actions {
    flex-shrink: 0;
  }

  .full-player-actions .icon-btn {
    touch-action: manipulation;
  }
}

.full-player-info {
  min-width: 0;
  flex: 1;
}

.full-player-info h2 {
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.full-player-info p {
  font-size: clamp(14px, 3.5vw, 18px);
  color: rgba(255, 255, 255, 0.7);
  margin: 4px 0 0;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.full-player-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.full-player-volume {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 4px 0;
  min-width: 0;
}

.full-player-volume .material-icons {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.65);
  flex-shrink: 0;
}

.full-player-volume input[type="range"] {
  flex: 1 1 auto;
  width: 100%;
  max-width: 220px;
  min-width: 0;
  height: 4px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--r-full);
  cursor: pointer;
}

.full-player-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent, #1db954);
  cursor: pointer;
}

.full-player-volume input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent, #1db954);
  cursor: pointer;
  border: none;
}

@media (pointer: coarse) {
  .full-player-volume input[type="range"],
  .full-player-volume--inline input[type="range"] {
    touch-action: pan-x;
    min-height: 44px;
    padding: 12px 0;
    box-sizing: border-box;
  }
}

@media screen and (max-width: 980px) {
  .full-player-volume input[type="range"] {
    max-width: min(280px, 85vw);
    height: 5px;
  }

  .full-player-volume .material-icons {
    font-size: 20px;
  }
}

.full-player-actions {
  flex-shrink: 0;
  align-self: center;
}

.full-player-times {
  font-size: 12px;
  opacity: 0.7;
}

#fullPlayerProgress {
  height: 6px;
}

#fullPlayerProgress:hover {
  height: 8px;
}

.full-player-controls-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.full-player-toggle {
  width: 72px !important;
  height: 72px !important;
  background: white !important;
}

.full-player-toggle:hover {
  transform: scale(1.05);
}

/* RIGHT SIDE (Tabs) */
.full-player-right {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 20px;
  overflow: hidden;
}

.fp-tabs-header {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.fp-tab-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0 0 4px;
  cursor: pointer;
  position: relative;
}

.fp-tab-btn.active {
  color: white;
}

.fp-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.fp-tab-content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.fp-tab-content-area::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.fp-panel {
  display: none;
  animation: fadein 0.3s;
}

.fp-panel.active {
  display: block;
}

.fp-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 8px;
}

.fp-lyrics-text {
  font-size: 24px;
  line-height: 1.6;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  padding: 20px 10px;
  white-space: pre-wrap;
}

.fp-related-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 4px;
  flex-wrap: wrap;
}

.fp-related-toolbar.hidden {
  display: none !important;
}

.fp-related-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.fp-related-row .fp-related-row-actions .icon-btn .material-icons {
  font-size: 20px;
}

/* RESPONSIVE FULL PLAYER */
@media screen and (max-width: 980px) {
  .full-player-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-content: start;
    overflow-y: auto;
    padding-bottom: 80px;
  }

  .full-player-left {
    min-height: min-content;
  }

  .full-player-right {
    min-height: 50vh;
    overflow: visible;
    /* Let parent scroll it */
  }

  .full-player-art-wrap {
    max-width: 80vw;
  }

  .fp-media-mode-bar {
    padding-left: 8px;
    padding-right: 8px;
  }

  .fp-media-seg {
    max-width: none;
    min-width: 0;
  }

  .fp-art-video {
    max-height: min(50vh, 360px);
  }
}

/* ============================================================
   DISCOVER (REELS) + ARTIST VIDEOS — Shorts-style fullscreen when .discover-shorts-mode
   ============================================================ */
.discover-view-root {
  padding: 0;
  margin: 0;
  min-height: calc(100vh - 120px);
  box-sizing: border-box;
  max-width: 100%;
}

/* Active discover: column layout (embedded mode; shorts mode overrides below) */
#discoverView.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* YouTube Shorts–style: fixed layer over app (JS adds .discover-shorts-mode on #appShell) */
#appShell.discover-shorts-mode .sidebar {
  display: none !important;
}

#appShell.discover-shorts-mode .topbar {
  display: none !important;
}

#appShell.discover-shorts-mode #playerShowBtn {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

#appShell.discover-shorts-mode #playerBar {
  display: none !important;
  pointer-events: none !important;
}

#appShell.discover-shorts-mode .main {
  overflow: hidden !important;
}

#appShell.discover-shorts-mode #discoverView.active.discover-view-root {
  position: fixed;
  z-index: 690;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  min-height: 0;
  max-height: none;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  box-sizing: border-box;
  overscroll-behavior: none;
  touch-action: pan-y;
  background: linear-gradient(to bottom, hsl(var(--h-secondary), 30%, 15%), var(--bg-main) 50%);
}

@media (max-width: 768px) {
  #appShell.discover-shorts-mode #discoverView.active.discover-view-root {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  #appShell.discover-shorts-mode #discoverView.active .discover-reel-wrap {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
    aspect-ratio: unset;
  }
}

/* Desktop / web: 9:16 dikey (Shorts tam ekran) */
@media (min-width: 769px) {
  #appShell.discover-shorts-mode #discoverView.active.discover-view-root {
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    box-sizing: border-box;
  }

  #appShell.discover-shorts-mode #discoverView.active .discover-reel-wrap {
    flex: 0 0 auto;
    width: min(420px, calc(88dvh * 9 / 16), 96vw);
    max-width: 96vw;
    min-height: unset;
    height: auto;
    aspect-ratio: 9 / 16;
    max-height: min(88dvh, calc(96vw * 16 / 9));
    border-radius: 12px;
  }

  #appShell.discover-shorts-mode .discover-main-video {
    object-fit: cover;
  }
}

#appShell.discover-shorts-mode .discover-side-actions {
  bottom: clamp(100px, 22dvh, 180px);
  right: 10px;
  gap: 12px;
}

#appShell.discover-shorts-mode .discover-bottom-meta {
  padding: 12px 64px max(20px, env(safe-area-inset-bottom)) 14px;
}

.discover-reel-wrap {
  position: relative;
  width: 100%;
  min-height: min(520px, calc(100dvh - 160px));
  max-height: min(92vh, 820px);
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-sizing: border-box;
}

.discover-reel-stage {
  position: absolute;
  inset: 0;
  transform: translate3d(0, 0, 0);
  /* Snappy two-phase slide; total feel ~0.4s */
  transition: transform 0.18s cubic-bezier(0.32, 0.72, 0, 1);
  backface-visibility: hidden;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .discover-reel-stage {
    transition: none;
  }
}

.discover-reel-stage.discover-reel-leave-up {
  transform: translate3d(0, -100%, 0);
}

.discover-reel-stage.discover-reel-leave-down {
  transform: translate3d(0, 100%, 0);
}

.discover-reel-stage.discover-reel-enter-from-below {
  transform: translate3d(0, 100%, 0);
  transition: none !important;
}

.discover-reel-stage.discover-reel-enter-from-above {
  transform: translate3d(0, -100%, 0);
  transition: none !important;
}

/* Embedded discover (fallback if shorts class missing) — mobile */
@media (max-width: 768px) {
  #appShell:not(.discover-shorts-mode) .discover-view-root {
    margin: 0;
    padding: 4px 10px 8px;
    min-height: 0;
    flex: 1 1 auto;
    max-height: calc(100dvh - 128px);
    overflow: hidden;
    width: 100%;
  }

  #appShell:not(.discover-shorts-mode) .discover-reel-wrap {
    width: 100%;
    max-width: min(100%, calc(100vw - 20px));
    min-height: 0;
    max-height: calc(100dvh - 148px);
    aspect-ratio: 9 / 16;
    height: auto;
    border-radius: 12px;
  }

  #appShell:not(.discover-shorts-mode) .discover-side-actions {
    bottom: clamp(56px, 18dvh, 112px);
    right: 4px;
    gap: 8px;
  }

  #appShell:not(.discover-shorts-mode) .discover-action-btn {
    width: 44px;
    height: 44px;
  }

  #appShell:not(.discover-shorts-mode) .discover-action-btn .material-icons {
    font-size: 22px;
  }

  #appShell:not(.discover-shorts-mode) .discover-bottom-meta {
    padding: 10px 54px 12px 10px;
  }

  #appShell:not(.discover-shorts-mode) .discover-top-actions {
    margin: 6px 8px;
  }

  #appShell:not(.discover-shorts-mode) .discover-meta-title {
    font-size: 15px;
  }

  #appShell:not(.discover-shorts-mode) .discover-meta-artist {
    font-size: 13px;
  }
}

.discover-main-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.discover-reel-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    transparent 28%,
    transparent 55%,
    rgba(0, 0, 0, 0.75) 100%
  );
  pointer-events: none;
}

.discover-reel-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.discover-reel-ui button,
.discover-reel-ui .discover-side-actions {
  pointer-events: auto;
}

.discover-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 0;
  pointer-events: auto;
}

.discover-subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.discover-subnav-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.discover-subnav-btn.active {
  background: rgba(255, 255, 255, 0.95);
  color: #111;
  border-color: transparent;
}

.discover-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 2;
}

.discover-empty-state.hidden {
  display: none;
}

.discover-comments-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.discover-comments-overlay.hidden {
  display: none;
}

.discover-comments-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.discover-comments-panel {
  position: relative;
  z-index: 1;
  isolation: isolate;
  width: 100%;
  max-width: min(400px, 100%);
  max-height: min(62vh, 420px);
  background: #1a1a22;
  color: var(--text, #fff);
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  padding: 0 0 max(8px, env(safe-area-inset-bottom, 8px));
  contain: layout style;
}

.discover-comments-panel-grab {
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin: 6px auto 2px;
  flex-shrink: 0;
}

.discover-comments-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.discover-comments-heading {
  min-width: 0;
  flex: 1;
}

.discover-comments-panel-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.discover-comments-clip-meta {
  margin: 3px 0 0;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.discover-comments-clip-meta:empty {
  display: none;
}

.discover-comments-close {
  color: inherit !important;
  flex-shrink: 0;
  border-radius: 8px !important;
  padding: 4px 6px !important;
  min-width: 0;
}

.discover-comments-close .material-icons {
  font-size: 20px;
}

.discover-comments-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 12px 8px;
  min-height: 72px;
  max-height: 32vh;
  -webkit-overflow-scrolling: touch;
}

.discover-comments-status,
.discover-comments-empty {
  text-align: center;
  padding: 16px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.4;
}

.discover-comments-status {
  padding: 12px 10px;
}

.discover-comments-error {
  margin: 4px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 120, 120, 0.2);
  color: #e8a0a0;
  font-size: 12px;
  line-height: 1.35;
}

.discover-comment-row {
  padding: 8px 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.discover-comment-row:last-child {
  border-bottom: none;
}

.discover-comment-user {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 2px;
  color: var(--accent);
}

.discover-comment-body {
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(255, 255, 255, 0.88);
}

.discover-comment-meta {
  font-size: 10px;
  opacity: 0.45;
  margin-top: 4px;
}

.discover-comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.discover-comment-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
  resize: none;
  min-height: 56px;
  max-height: 120px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.discover-comment-input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.discover-comment-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.discover-comment-actions {
  display: flex;
  justify-content: flex-end;
}

.discover-comment-submit {
  min-height: 34px;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  gap: 4px !important;
}

.discover-comment-submit .material-icons {
  font-size: 16px;
}

.discover-comment-reply-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px;
  margin-bottom: 2px;
  border-radius: 8px;
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.18);
  font-size: 12px;
}

.discover-comment-reply-bar.hidden {
  display: none !important;
}

.discover-comment-reply-prefix {
  color: var(--muted);
}

.discover-comment-reply-label {
  font-weight: 600;
  color: var(--accent);
}

.discover-comment-reply-cancel {
  margin-left: auto !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
  min-height: 0 !important;
}

.discover-comment-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.discover-comment-row-head .discover-comment-user {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.discover-comment-reply-btn {
  padding: 2px 8px !important;
  font-size: 11px !important;
  min-height: 0 !important;
  flex-shrink: 0;
  color: var(--muted) !important;
}

.discover-comment-reply-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 4px;
}

.discover-comment-row-reply {
  margin-left: calc(var(--discover-reply-depth, 1) * 10px);
  padding-left: 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.07);
}

.discover-comment-replies-toggle-wrap {
  margin: 0 0 4px;
  padding-bottom: 2px;
}

.discover-comment-show-replies {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 2px 0 !important;
  margin: 0 0 4px;
  font-size: 11px !important;
  font-weight: 600;
  min-height: 0 !important;
  color: rgba(255, 255, 255, 0.55) !important;
  text-align: left;
}

.discover-comment-show-replies:hover {
  color: var(--accent) !important;
}

.discover-comment-replies {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

.rich-msg-sticker-wrap {
  display: inline-block;
  margin: 2px 0;
  vertical-align: middle;
  line-height: 0;
}

.rich-msg-sticker {
  max-height: 88px;
  max-width: min(160px, 72vw);
  border-radius: 8px;
  display: block;
}

.discover-comment-body .rich-msg-sticker {
  max-height: 72px;
  max-width: 120px;
}

.chat-msg-sticker {
  max-height: 120px;
  max-width: min(200px, 70vw);
  border-radius: 8px;
  display: block;
}

/* Comments open: keep bottom nav from stealing focus / visual clash */
body.discover-comments-open .mobile-bottom-nav {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Desktop + Discover shorts: YouTube-style comments column beside the reel (~1100px+ so panel fits) */
@media (min-width: 1100px) {
  #appShell.discover-shorts-mode .discover-comments-overlay {
    align-items: center;
    justify-content: flex-start;
    pointer-events: none;
  }

  #appShell.discover-shorts-mode .discover-comments-overlay .discover-comments-backdrop {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  #appShell.discover-shorts-mode .discover-comments-panel {
    pointer-events: auto;
    position: fixed;
    /* ~half of desktop reel width min(420px, 88dvh*9/16) — align panel flush right of video */
    left: calc(50vw + min(210px, calc(88dvh * 9 / 32), 48vw) + 14px);
    right: max(16px, env(safe-area-inset-right, 0px));
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: auto;
    max-width: min(400px, calc(50vw - min(210px, calc(88dvh * 9 / 32), 48vw) - 32px));
    min-width: 280px;
    height: min(88dvh, 720px);
    max-height: min(88dvh, 720px);
    margin: 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -12px 0 48px rgba(0, 0, 0, 0.45);
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
  }

  #appShell.discover-shorts-mode .discover-comments-panel-grab {
    display: none;
  }

  #appShell.discover-shorts-mode .discover-comments-list {
    max-height: none;
    flex: 1 1 auto;
    min-height: 80px;
  }
}

.discover-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  flex-shrink: 0;
  pointer-events: auto;
}

.discover-top-btn {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

.discover-side-actions {
  position: absolute;
  right: 8px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.discover-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  color: #fff;
  cursor: pointer;
  padding: 0;
  justify-content: center;
}

.discover-action-btn .material-icons {
  font-size: 26px;
}

.discover-action-count {
  font-size: 11px;
  font-weight: 600;
  margin-top: -2px;
}

.discover-action-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.discover-play-full-btn {
  border-radius: 12px;
  width: auto;
  min-width: 52px;
  height: auto;
  padding: 8px 6px;
}

.discover-bottom-meta {
  padding: 16px 72px 20px 16px;
}

.discover-meta-block {
  text-align: left;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  max-width: 100%;
  cursor: pointer;
  color: #fff;
}

.discover-meta-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.discover-meta-artist {
  font-size: 14px;
  opacity: 0.85;
  margin-top: 4px;
}

.discover-full-overlay {
  position: fixed;
  inset: 0;
  z-index: 19950;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discover-full-overlay.hidden {
  display: none !important;
}

.discover-full-video {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  object-fit: contain;
  background: #000;
}

.discover-full-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  color: #fff !important;
}

/* Desktop embedded: narrow column (only when not in Shorts fullscreen) */
@media (min-width: 769px) {
  #appShell:not(.discover-shorts-mode) #discoverView.active {
    margin: 0;
    padding: 16px 24px 24px;
    min-height: calc(100vh - 120px);
    box-sizing: border-box;
  }

  #appShell:not(.discover-shorts-mode) #discoverView.active .discover-reel-wrap {
    width: min(420px, calc(82dvh * 9 / 16), calc(100vw - 80px));
    aspect-ratio: 9 / 16;
    height: auto;
    max-height: min(82dvh, calc((100vw - 80px) * 16 / 9));
    min-height: unset;
    flex-shrink: 0;
  }

  #appShell:not(.discover-shorts-mode) .discover-main-video {
    object-fit: cover;
  }

  .discover-full-video {
    width: auto;
    max-width: min(420px, 90vw);
    height: auto;
    max-height: min(90vh, 820px);
  }

  #appShell.discover-shorts-mode .discover-full-video {
    max-width: min(100vw, 520px);
    max-height: min(92dvh, 900px);
  }
}

/* ============================================================
   ARTIST HERO V2 — Immersive blurred banner
   ============================================================ */
.artist-hero-v2 {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  margin-bottom: 0;
}

.artist-hero-v2-bg {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center 25%;
  filter: blur(40px) brightness(0.45) saturate(1.3);
  transform: scale(1.15);
  pointer-events: none;
  z-index: 0;
}

.artist-hero-v2-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-deep) 0%, transparent 60%, rgba(0,0,0,0.3) 100%);
  z-index: 1;
  pointer-events: none;
}

.artist-hero-v2-back {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0;
  transition: background 0.2s;
}

.artist-hero-v2-back:hover {
  background: rgba(255,255,255,0.15);
}

.artist-hero-v2-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px 28px;
  gap: 8px;
  width: 100%;
}

.artist-hero-v2-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--bg-card);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 3px rgba(255,255,255,0.08);
}

.artist-hero-v2-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.artist-hero-v2-photo .song-artwork-fallback {
  font-size: 52px;
  font-weight: 600;
}

.artist-hero-v2-name {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 8px 0 0;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
}

.artist-hero-v2-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.artist-hero-v2-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.artist-hero-v2-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent);
  color: #000;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
}

.artist-hero-v2-save:hover {
  transform: scale(1.04);
  background: var(--accent-light);
}

.artist-hero-v2-save .material-icons {
  font-size: 18px;
}

.artist-hero-v2-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-main);
  padding: 0;
  transition: background 0.2s;
}

.artist-hero-v2-action-btn:hover {
  background: rgba(255,255,255,0.18);
}

.artist-hero-v2-action-btn .material-icons {
  font-size: 20px;
}

.artist-hero-v2-filter-row {
  padding: 12px 20px 4px;
}

.artist-videos-section .artist-videos-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.artist-videos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.artist-videos-nav {
  display: flex;
  gap: 4px;
}

.artist-video-card {
  flex: 0 0 180px;
  cursor: pointer;
}

.artist-video-thumb-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: #111;
}

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

.artist-video-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  pointer-events: none;
}

.artist-video-play-icon .material-icons {
  font-size: 48px;
}

.artist-video-card-title {
  margin-top: 8px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

.artist-video-card-meta {
  font-size: 12px;
  margin-top: 2px;
}

/* ============================================================
   ALBUM DETAIL VIEW — Spotify-style
   ============================================================ */
#albumDetailView {
  background: linear-gradient(180deg, hsla(220, 40%, 18%, 0.6) 0%, transparent 40%);
}

.album-detail-header {
  padding: 12px 24px 0;
}

.album-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-muted);
}

.album-detail-back:hover {
  color: var(--text-main);
}

.album-detail-container {
  display: flex;
  gap: 48px;
  padding: 24px 32px 40px;
  align-items: flex-start;
}

.album-detail-left {
  flex-shrink: 0;
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 0;
}

.album-detail-cover {
  width: 280px;
  height: 280px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 16px 48px -8px rgba(0, 0, 0, 0.6);
}

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

.album-detail-cover-fallback {
  width: 280px;
  height: 280px;
  font-size: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-detail-title {
  margin-top: 20px;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  color: var(--text-main);
}

.album-detail-meta {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.album-detail-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.album-detail-play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text-main);
  color: #000;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
}

.album-detail-play-btn:hover {
  transform: scale(1.06);
  background: var(--accent);
}

.album-detail-play-btn .material-icons {
  font-size: 28px;
}

.album-detail-right {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.album-detail-track-list {
  display: flex;
  flex-direction: column;
}

.album-track-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.album-track-row:hover {
  background: var(--bg-hover);
}

.album-track-row.playing {
  background: var(--bg-active);
}

.album-track-num {
  width: 28px;
  text-align: right;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.album-track-row:hover .album-track-num {
  color: var(--text-main);
}

.album-track-info {
  flex: 1;
  min-width: 0;
}

.album-track-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-track-row.playing .album-track-title {
  color: var(--accent);
}

.album-track-plays {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.album-track-duration {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.album-track-actions {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.album-track-row:hover .album-track-actions {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .album-detail-container {
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 16px;
  }

  .album-detail-left {
    width: 220px;
    position: static;
  }

  .album-detail-cover {
    width: 220px;
    height: 220px;
  }

  .album-detail-cover-fallback {
    width: 220px;
    height: 220px;
    font-size: 60px;
  }

  .album-detail-title {
    font-size: 1.2rem;
  }

  .album-detail-right {
    width: 100%;
  }

  .album-track-actions {
    opacity: 1;
  }
}

/* ---- Artist Hero V2 responsive ---- */
@media (max-width: 768px) {
  .artist-hero-v2 {
    min-height: 260px;
  }

  .artist-hero-v2-photo {
    width: 120px;
    height: 120px;
  }

  .artist-hero-v2-photo .song-artwork-fallback {
    font-size: 38px;
  }

  .artist-hero-v2-name {
    font-size: 1.8rem;
  }

  .artist-hero-v2-content {
    padding: 30px 16px 22px;
  }
}