/* ─── ZOLT V2 — LAYOUT ───────────────────────────────────────────────── */

/* App shell */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr auto;
  grid-template-rows: 1fr 92px;
  /* Extra height to fit the floating dock comfortably */
  grid-template-areas:
    "sidebar main nowplaying"
    "player  player player";
  height: 100dvh;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* ── Sidebar ── */
#sidebar {
  grid-area: sidebar;
  background: var(--sidebar-bg, var(--glass-bg, rgba(18, 18, 22, 0.65)));
  -webkit-backdrop-filter: blur(var(--sidebar-blur, var(--glass-blur, 24px))) saturate(180%);
  backdrop-filter: blur(var(--sidebar-blur, var(--glass-blur, 24px))) saturate(180%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--sp-5) 0 0;
  position: relative;
  z-index: 100;
  /* For absolutely positioned resize handle */
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
}

#sidebar.resizing {
  transition: none !important;
  /* Disable transition during drag resize */
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5) var(--sp-6);
  flex-shrink: 0;
}

.sidebar-logo {
  position: relative;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1.5px;

  color: var(--text-1);
  cursor: pointer;

  display: flex;
  align-items: center;
  gap: var(--sp-2);

  transition: all 0.3s ease;
  user-select: none;
}

.logo-svg-wrap {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#sidebar:not(.collapsed) .sidebar-logo .logo-svg-wrap {
  display: none;
}

#sidebar.collapsed .sidebar-logo .logo-svg-wrap {
  display: flex;
}

.logo-svg-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Custom logo branding colors customizable via settings */
.zolt-logo-bg {
  transition: fill 0.3s ease, stroke 0.3s ease;
}

.zolt-logo-fg {
  fill: var(--logo-fg, #ffffff) !important;
  transition: fill 0.3s ease;
}

.sidebar-logo span {
  background: linear-gradient(135deg, var(--accent), #ffffff);

  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  transition: all 0.3s ease;
}

.sidebar-logo:hover {
  transform: translateX(4px);
}

.sidebar-logo:hover .logo-svg-wrap {
  transform: scale(1.12) rotate(12deg);
}

.sidebar-logo:hover span {
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.3),
    0 0 20px rgba(255, 255, 255, 0.15);
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  /* Smooth-edged square instead of circle */
  background: transparent;
  /* Matches sidebar background */
  color: var(--text-2);
  border: none;
  /* Remove borders and shadows to eliminate button-like feel */
  box-shadow: none;
  cursor: pointer;
  opacity: 0;
  /* Only visible when sidebar is hovered */
  pointer-events: none;
  transition: color var(--t-fast), background var(--t-fast), opacity var(--t-fast) ease, transform var(--t-fast) ease;
}

.sidebar-toggle-btn:hover {
  color: var(--text-1);
  background: var(--bg-3);
  /* Subtle matching accent backdrop on hover */
  transform: scale(1.08);
}

.sidebar-toggle-btn:active {
  transform: scale(0.92);
}

.sidebar-toggle-btn svg {
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Expanded state: show toggle button when sidebar is hovered */
#sidebar:not(.collapsed):hover .sidebar-toggle-btn {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  z-index: 1000;
  transition: background var(--t-fast);
}

.sidebar-resize-handle:hover,
#sidebar.resizing .sidebar-resize-handle {
  background: var(--border-hover);
}

/* Collapsed Sidebar Styles */
#sidebar.collapsed {
  width: 72px !important;
  align-items: center;
}

#sidebar.collapsed .sidebar-header {
  position: relative;
  padding: 0 0 var(--sp-6) !important;
  justify-content: center !important;
  width: 100%;
  height: 48px;
  /* Consistent height for overlapping centering */
  display: flex;
  align-items: center;
}

#sidebar.collapsed .sidebar-logo {
  opacity: 1;
  justify-content: center;
  width: 100%;
  transition: opacity var(--t-fast) ease;
}

#sidebar.collapsed .sidebar-logo .logo-full {
  display: none;
}

#sidebar.collapsed .sidebar-toggle-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Centered inside header overlapping Z logo */
  opacity: 0;
  pointer-events: none;
  background: transparent;
  /* Seamless transparent flat design */
  border: none;
  /* No button-like border */
  box-shadow: none;
  /* No shadow */
  transition: opacity var(--t-fast) ease, transform var(--t-fast) ease, color var(--t-fast) ease, background var(--t-fast) ease;
  z-index: 1001;
  border-radius: 6px;
  /* Smooth-edged square */
}

#sidebar.collapsed .sidebar-toggle-btn svg {
  transform: translate(0, 0) rotate(180deg);
}

/* Hover: Hide Z logo and show the decollapse icon in its place when the sidebar is hovered */
#sidebar.collapsed:hover .sidebar-logo {
  opacity: 0;
}

#sidebar.collapsed:hover .sidebar-toggle-btn {
  opacity: 1;
  pointer-events: auto;
}

/* Collapsed Sidebar Floating Glass Tooltip Popouts */
#sidebar.collapsed {
  z-index: 9000 !important;
  overflow: visible !important;
}

#sidebar.collapsed .sidebar-nav,
#sidebar.collapsed .sidebar-playlists {
  overflow: visible !important;
}

#sidebar.collapsed .nav-item,
#sidebar.collapsed .sidebar-playlist-item {
  justify-content: center;
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  position: relative;
  overflow: visible !important;
}

#sidebar.collapsed .nav-label {
  display: flex !important;
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) scale(0.9) translateX(-8px);
  opacity: 0;
  pointer-events: none;
  background: rgba(14, 14, 18, 0.95);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-md);
  padding: 7px 14px;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-1);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, box-shadow 0.35s ease;
  z-index: 99999 !important;
}

#sidebar.collapsed .nav-label::before,
#sidebar.collapsed .sidebar-playlist-item .pl-info::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: rgba(14, 14, 18, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#sidebar.collapsed .nav-item:hover .nav-label {
  opacity: 1;
  transform: translateY(-50%) scale(1) translateX(0);
}

#sidebar.collapsed .sidebar-section-label {
  display: none !important;
}

#sidebar.collapsed .sidebar-playlists {
  padding: 0 var(--sp-2) var(--sp-3);
  align-items: center;
}

#sidebar.collapsed .sidebar-playlist-item img,
#sidebar.collapsed .sidebar-playlist-item div[style*="width:32px"] {
  width: 32px !important;
  height: 32px !important;
  border-radius: 6px;
}

#sidebar.collapsed .sidebar-playlist-item .pl-info {
  display: flex !important;
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) scale(0.9) translateX(-8px);
  opacity: 0;
  pointer-events: none;
  background: rgba(14, 14, 18, 0.95);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-md);
  padding: 8px 14px;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, box-shadow 0.35s ease;
  z-index: 99999 !important;
}

#sidebar.collapsed .sidebar-playlist-item .pl-info .pl-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}

#sidebar.collapsed .sidebar-playlist-item .pl-info .pl-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

#sidebar.collapsed .sidebar-playlist-item:hover .pl-info {
  opacity: 1;
  transform: translateY(-50%) scale(1) translateX(0);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: 0 var(--sp-3);
}

#developers {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition:
    color var(--t-fast),
    background var(--t-fast);
  cursor: pointer;
  user-select: none;
}

#developers:hover {
  color: var(--text-1);
  background: var(--bg-3);
}

.developers.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.developers svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  transition:
    color var(--t-fast),
    background var(--t-fast);
  cursor: pointer;
  user-select: none;
}

.nav-item:hover {
  color: var(--text-1);
  background: var(--bg-3);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-item svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.sidebar-section-label {
  position: relative;
  overflow: visible;
  z-index: 10;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: var(--sp-6) var(--sp-5) var(--sp-2);
}

/* Playlist list in sidebar */
.sidebar-playlists {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--sp-3) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-playlist-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
}

.sidebar-playlist-item:hover {
  background: var(--bg-3);
}

.sidebar-playlist-item img {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--bg-4);
}

.sidebar-playlist-item .pl-info {
  overflow: hidden;
}

.sidebar-playlist-item .pl-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

.sidebar-playlist-item .pl-count {
  font-size: 11px;
  color: var(--text-3);
}

/* ── Main Content ── */
#main {
  grid-area: main;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-6);
  position: relative;
  -webkit-overflow-scrolling: touch;
  over-scroll-behavior-y: contain;
  contain: layout style;
}

/* ── Extreme Ultra 4K & Virtualization Optimization Hooks ── */
html.perf-ultra {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

html.perf-ultra * {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.is-offscreen {
  content-visibility: auto !important;
  contain-intrinsic-size: 240px !important;
}

/* Page views — hidden/shown via JS */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* ── Now Playing Panel (right) ── */
#now-playing {
  grid-area: nowplaying;
  background: var(--sidebar-bg, var(--glass-bg, rgba(18, 18, 22, 0.65)));
  -webkit-backdrop-filter: blur(var(--sidebar-blur, var(--glass-blur, 24px))) saturate(180%);
  backdrop-filter: blur(var(--sidebar-blur, var(--glass-blur, 24px))) saturate(180%);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: var(--now-playing-w);
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-left 0.35s ease, opacity 0.35s ease, background 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
  flex-shrink: 0;
}

@media (min-width: 769px) {
  #now-playing.collapsed {
    width: 0px !important;
    border-left: 0 solid transparent !important;
    opacity: 0;
    pointer-events: none;
  }
}

.np-close-btn-pc {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: var(--sp-1);
  transition: color var(--t-fast), transform var(--t-fast);
}

@media (min-width: 769px) {
  .np-close-btn-pc {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.np-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
}

.np-close-btn,
.np-options-btn,
.np-pip-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: var(--sp-1);
}

.np-header-title {
  flex: 1;
  text-align: center;
}

.np-art-wrap {
  padding: 0 var(--sp-5);
}

.np-art-wrap img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  object-fit: cover;
  background: var(--bg-4);
}

.np-info {
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
}

.np-info-text {
  flex: 1;
  min-width: 0;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px;
  overflow: hidden;
}

.np-title-wrap,
.np-artist-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  display: block;
}

.np-title {
  font-family: var(--font-display);
  font-size: 19.5px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-1);
  margin-bottom: 2px;
  display: inline-block;
  white-space: nowrap;
}

.np-artist {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  display: inline-block;
  white-space: nowrap;
}

/* Progress bar */
.np-progress {
  padding: 0 var(--sp-5);
}

.progress-bar-wrap {
  position: relative;
  height: 3px;
  background: var(--bg-4);
  border-radius: var(--r-full);
  cursor: pointer;
  margin-bottom: var(--sp-2);
}

.progress-bar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.75) 0%, #ffffff 100%);
  border-radius: var(--r-full);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.1s linear, box-shadow var(--t-fast);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

.progress-thumb {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--t-fast);
}

.progress-bar-wrap:hover .progress-thumb {
  opacity: 1;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
}

/* Controls */
.np-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
}

/* Hide redundant controls in Right Panel for PC */
@media (min-width: 769px) {

  .np-progress,
  .np-controls {
    display: none;
  }
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  /* Muted by default */
  transition:
    color var(--t-fast),
    filter var(--t-fast),
    transform var(--t-fast);
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
}

.ctrl-btn svg {
  width: 22px;
  height: 22px;
  transition: transform var(--t-fast);
}

.ctrl-btn:hover {
  color: var(--text-1);
  /* Bright white on hover */
}

.ctrl-btn:hover svg {
  transform: scale(1.08);
}

.ctrl-btn:active {
  transform: scale(0.9);
}

.ctrl-btn.active {
  color: var(--accent) !important;
  /* Premium brand accent for active state */
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.ctrl-btn.active::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.ctrl-btn.active:hover {
  color: var(--accent) !important;
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

.ctrl-btn-play {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text-1);
  color: var(--bg-2);
  border-radius: 50%;
  transition:
    transform var(--t-base),
    background var(--t-fast);
}

.ctrl-btn-play svg {
  width: 24px;
  height: 24px;
  margin-left: 2px;
}

.ctrl-btn-play.playing svg {
  margin-left: 0;
}

.ctrl-btn-play:hover {
  transform: scale(1.06);
}

.ctrl-btn-play:active {
  transform: scale(0.94);
}

/* Queue list */
.np-queue {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--sp-3) var(--sp-4);
  mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 94%, transparent 100%);
}

.queue-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
}

.queue-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
}

.queue-item:hover {
  background: var(--bg-3);
}

.queue-item.active {
  background: var(--accent-dim);
}

.queue-item img {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--bg-4);
  flex-shrink: 0;
}

.queue-item .qi-info {
  overflow: hidden;
  flex: 1;
}

.queue-item .qi-title {
  font-size: 13px;
  font-weight: 500;
}

.queue-item .qi-artist {
  font-size: 11px;
  color: var(--text-3);
}

.queue-item .qi-dur {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}

#player-bar {
  grid-area: player;
  position: absolute;
  display: flex;
  bottom: var(--sp-3);
  left: var(--sp-4);
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 82px;
  padding: 0 var(--sp-6);
  background: var(--playerbar-bg, var(--glass-bg, rgba(10, 10, 10, 0.65)));
  -webkit-backdrop-filter: blur(var(--playerbar-blur, var(--glass-blur, 32px))) saturate(190%);
  backdrop-filter: blur(var(--playerbar-blur, var(--glass-blur, 32px))) saturate(190%);
  border-radius: var(--r-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100;
  width: calc(100% - 32px);
}

.pb-track {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 180px;
  flex: 1;
}

.pb-art-container {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  /* Fix Webkit/Blink hardware accelerated transform clipping overflow bug */
  isolation: isolate;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.pb-art-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: linear-gradient(135deg, var(--bg-4), var(--bg-2));
}

.pb-art {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: opacity 0.3s ease;
}

/* Now playing panel placeholder */
.np-art-container {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  /* Fix Webkit/Blink hardware accelerated transform clipping overflow bug */
  isolation: isolate;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.np-art-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: linear-gradient(135deg, var(--bg-4), var(--bg-2));
}

#np-art {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: opacity 0.3s ease;
}

.pb-title {
  font-size: 14px;
  font-weight: 700;
  max-width: 320px;
  color: var(--text-1);
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

.pb-artist {
  font-size: 12px;
  color: var(--text-2);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes heart-bounce {
  0% {
    transform: scale(1);
  }

  14% {
    transform: scale(1.3);
  }

  28% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.2);
  }

  70% {
    transform: scale(1);
  }
}

.pb-like {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast), transform var(--t-fast);
}

.pb-like:hover {
  color: var(--text-1);
  transform: scale(1.1);
}

.pb-like.liked {
  color: var(--danger);
}

.pb-like.liked svg {
  fill: var(--danger);
  stroke: var(--danger);
  animation: heart-bounce 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pb-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  flex: 2;
  max-width: 500px;
}

.pb-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.pb-controls .ctrl-btn {
  width: 36px;
  height: 36px;
}

.pb-controls .ctrl-btn svg {
  width: 18px;
  height: 18px;
}

.pb-controls .ctrl-btn.active::after {
  bottom: 0px;
}

.pb-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text-1);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--t-fast) cubic-bezier(0.25, 1, 0.5, 1);
}

.pb-play svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  margin-left: 2px;
}

.pb-play.playing svg {
  margin-left: 0;
}

.pb-play:hover {
  transform: scale(1.08);
}

.pb-play:active {
  transform: scale(0.92);
}

.pb-progress {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 11px;
  color: var(--text-3);
}

.pb-prog-wrap {
  flex: 1;
  height: 4px;
  background: var(--bg-4);
  border-radius: var(--r-full);
  cursor: pointer;
  position: relative;
  transition: height var(--t-fast);
}

.pb-prog-wrap:hover {
  height: 6px;
}

.pb-prog-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.75) 0%, #ffffff 100%);
  border-radius: var(--r-full);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.1s linear, background var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

.pb-prog-wrap:hover .pb-prog-fill {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, #ffffff 100%);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.55);
}

.pb-prog-wrap .progress-thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-1);
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
}

.pb-prog-wrap:hover .progress-thumb {
  opacity: 1;
}

/* Timeline hover tooltips */
.prog-tooltip {
  position: absolute;
  top: -28px;
  transform: translateX(-50%);
  background: rgba(16, 16, 16, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-1);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.pb-prog-wrap:hover .prog-tooltip,
.progress-bar-wrap:hover .prog-tooltip {
  opacity: 1;
}

.pb-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  justify-content: flex-end;
  min-width: 180px;
}

.pb-vol-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.pb-vol-wrap svg {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--t-fast);
  display: block;
}

.pb-vol-wrap:hover svg {
  color: var(--text-1);
}

.pb-vol-slider {
  width: 90px;
  height: 4px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, var(--text-1) var(--volume-percent, 100%), var(--bg-4) var(--volume-percent, 100%));
  border-radius: var(--r-full);
  cursor: pointer;
  outline: none;
  transition: background var(--t-fast);
}

.pb-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
}

.pb-vol-wrap:hover .pb-vol-slider::-webkit-slider-thumb {
  opacity: 1;
}

.pb-vol-wrap:hover .pb-vol-slider {
  background: linear-gradient(to right, var(--text-1) var(--volume-percent, 100%), var(--bg-4) var(--volume-percent, 100%));
}

.pb-vol-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: calc(var(--sp-4) + 76px + var(--sp-4));
  /* Aligned nicely above the floating player bar */
  right: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: flex-end;
  z-index: 10000;
  /* Stay above everything */
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--glass-bg, rgba(18, 18, 18, 0.85));
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(180%);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--text-1);
  padding: 10px 16px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition:
    opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.is-swiping {
  cursor: grabbing !important;
}

.toast-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
}

.toast-text {
  letter-spacing: -0.1px;
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(24, 15, 15, 0.88);
}

.toast-error .toast-icon-wrap {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(14, 24, 18, 0.88);
}

.toast-success .toast-icon-wrap {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

/* ── Context Menu ── */
#context-menu {
  position: fixed;
  background: var(--glass-bg, rgba(18, 18, 18, 0.75));
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(180%);

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);

  padding: var(--sp-2);
  min-width: 220px;
  max-width: 260px;
  max-height: calc(100dvh - 40px);

  overflow-y: auto;
  overflow-x: hidden !important;
  scrollbar-width: thin;

  z-index: 9999;

  opacity: 0;
  transform: scale(0.95);
  transform-origin: top left;
  pointer-events: none;

  transition:
    opacity var(--t-fast),
    transform var(--t-fast);

  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#context-menu::-webkit-scrollbar {
  width: 4px;
}

#context-menu::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: var(--r-full);
}

#context-menu.open {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  cursor: pointer;
  transition: background var(--t-fast);
  position: relative;
  min-width: 0;
  /* allows text truncation */
}

.ctx-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctx-item:hover {
  background: var(--bg-4);
}

.ctx-item.danger {
  color: var(--danger);
}

.ctx-item-img {
  width: 20px;
  height: 20px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-4);
}

.ctx-item-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-3);
}

.ctx-sep {
  height: 1px;
  background: var(--border);
  margin: var(--sp-2) 0;
}

.ctx-submenu {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2);
  min-width: 220px;
  max-width: 260px;
  max-height: 260px;
  /* limits long playlist submenu lists */
  overflow-y: auto;
  overflow-x: hidden !important;
  scrollbar-width: thin;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 10000;
}

.ctx-submenu::-webkit-scrollbar {
  width: 4px;
}

.ctx-submenu::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: var(--r-full);
}

/* Queue item remove buttons */
.qi-right-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.qi-remove-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
  opacity: 0;
  /* Hidden by default on PC, visible on hover! */
}

.queue-item:hover .qi-remove-btn {
  opacity: 1;
}

.qi-remove-btn:hover {
  background: var(--bg-4);
  color: var(--danger);
  transform: scale(1.15);
}

.qi-remove-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.np-mobile-queue {
  display: none;
}

.np-mobile-vol-row {
  display: none;
}

.np-mobile-vol-wrap {
  display: none;
}

.np-info-actions {
  display: none;
}

#np-mobile-queue-list {
  mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 94%, transparent 100%);
}

/* PC specific styles for Now Playing sidebar */
@media (min-width: 769px) {
  .np-info {
    text-align: center !important;
  }

  .np-info-text {
    text-align: center !important;
  }

  .np-info-actions {
    display: none !important;
  }

  .np-mobile-vol-wrap {
    display: none !important;
  }
}

/* ─── MOBILE ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    grid-template-areas:
      "main";
  }

  #sidebar {
    display: none;
  }

  /* Redesign #now-playing for full screen mobile display */
  #now-playing {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    z-index: 2000;
    background: linear-gradient(to bottom, var(--dynamic-bg, var(--bg)), var(--bg));
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-left: none;
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
  }

  #now-playing.open {
    transform: translateY(0);
  }

  .np-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 40px;
  }

  .np-body::-webkit-scrollbar {
    display: none;
  }

  .np-main-player {
    min-height: calc(100dvh - 64px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--sp-2) 0 var(--sp-4);
    flex-shrink: 0;
  }

  .np-close-btn,
  .np-options-btn,
  .np-pip-btn {
    display: block;
    color: var(--text-1);
    background: transparent;
    padding: 8px;
    border-radius: 50%;
    transition: background var(--t-fast);
  }

  .np-close-btn:active,
  .np-options-btn:active,
  .np-pip-btn:active {
    background: rgba(255, 255, 255, 0.1);
  }

  .np-close-btn svg,
  .np-options-btn svg,
  .np-pip-btn svg {
    width: 24px !important;
    height: 24px !important;
  }

  .np-header {
    padding: var(--sp-4) var(--sp-5);
    font-size: 14px;
    color: var(--text-1);
    letter-spacing: normal;
    text-transform: none;
    font-weight: 700;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
  }

  .np-art-wrap {
    padding: var(--sp-4) var(--sp-8) var(--sp-4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .np-art-container {
    width: 74vw !important;
    max-width: 280px !important;
    aspect-ratio: 1 !important;
    margin: 0 auto;
    border-radius: var(--r-xl);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
  }

  .np-info {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-6) !important;
    margin-bottom: var(--sp-4);
    flex-shrink: 0;
  }

  .np-info-text {
    flex: 1;
    min-width: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
  }

  .np-info-actions {
    display: flex !important;
    align-items: center;
    gap: var(--sp-3);
    flex-shrink: 0;
    padding-left: var(--sp-3);
  }

  .np-action-btn {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    transition: color var(--t-fast), transform var(--t-fast);
  }

  .np-action-btn svg {
    color: currentColor;
  }

  .np-action-btn:hover {
    color: var(--text-1);
  }

  .np-action-btn:active {
    transform: scale(0.9);
  }

  .np-mobile-vol-row {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: var(--sp-4);
    margin: var(--sp-5) auto 0 auto;
    width: fit-content;
  }

  .np-mobile-vol-wrap {
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: 200px;
    margin: 0 !important;
    padding: var(--sp-2) 0;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    opacity: 0.55;
    transform: scale(0.92);
    transition: opacity var(--t-fast) ease, transform var(--t-fast) ease;
  }

  .np-mobile-vol-wrap.active,
  .np-mobile-vol-wrap:active,
  .np-mobile-vol-wrap:focus-within,
  .np-mobile-vol-wrap:hover {
    opacity: 1;
    transform: scale(1);
  }

  .np-mobile-vol-wrap svg {
    color: var(--text-2) !important;
    opacity: 0.85 !important;
    transition: color var(--t-fast) ease, opacity var(--t-fast) ease;
  }

  .np-mobile-vol-wrap.active svg,
  .np-mobile-vol-wrap:active svg,
  .np-mobile-vol-wrap:focus-within svg,
  .np-mobile-vol-wrap:hover svg {
    color: var(--text-1) !important;
    opacity: 1 !important;
  }

  .np-mobile-vol-wrap .pb-vol-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: var(--r-full);
    background: linear-gradient(to right, var(--accent) var(--volume-percent, 100%), rgba(255, 255, 255, 0.08) var(--volume-percent, 100%)) !important;
    outline: none;
    cursor: pointer;
  }

  .np-mobile-vol-wrap .pb-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-1) !important;
    border: 2px solid var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    cursor: pointer;
    opacity: 1 !important;
  }

  .np-mobile-vol-wrap .pb-vol-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-1) !important;
    border: 2px solid var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    cursor: pointer;
    opacity: 1 !important;
  }

  .np-title {
    font-size: 22px;
    margin-bottom: var(--sp-1);
  }

  .np-artist {
    font-size: 14px;
  }

  /* Make controls larger */
  .np-progress {
    padding: 0 var(--sp-8);
    margin-bottom: var(--sp-4);
    flex-shrink: 0;
  }

  .progress-times {
    font-size: 12px;
    font-weight: 600;
  }

  .np-controls {
    padding: 0 var(--sp-4);
    margin-bottom: var(--sp-6);
    justify-content: space-evenly;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    width: 100%;
  }

  .np-controls .ctrl-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
  }

  .np-controls .ctrl-btn svg {
    width: 26px;
    height: 26px;
  }

  .np-controls .ctrl-btn-play svg {
    width: 34px;
    height: 34px;
    margin-left: 2px;
    /* optical center fix for play icon */
  }

  .np-controls .ctrl-btn-play.playing svg {
    margin-left: 0;
    /* pause icon is symmetric */
  }

  .np-controls .ctrl-btn-play {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-1);
    color: var(--bg-2);
    border-radius: 50%;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    transition: transform var(--t-base) cubic-bezier(0.25, 1, 0.5, 1), box-shadow var(--t-base);
  }

  .np-controls .ctrl-btn-play:active {
    transform: scale(0.92);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  /* Up Next Queue styling below controls */
  .np-mobile-queue {
    display: block;
    padding: var(--sp-5) var(--sp-6) var(--sp-8);
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: var(--sp-5);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }

  .np-mobile-queue .queue-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--sp-4);
    padding: 0;
  }

  .qi-remove-btn {
    opacity: 1 !important;
    padding: 8px;
  }

  .np-queue {
    display: none;
    /* hide PC queue on mobile view */
  }

  #main {
    padding: var(--sp-4);
    padding-bottom: 168px !important;
  }

  #mobile-dock {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    /* width: calc(100% - 32px); */
    max-width: 100%;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    isolation: isolate;

    /* Glass variables matching your configuration, customized for ZOLT dark music app theme */
    --shadow-offset: 0;
    --shadow-blur: 20px;
    --shadow-spread: -5px;
    --shadow-color: rgba(255, 255, 255, 0.15);
    --tint-color: 12, 12, 12;
    --tint-opacity: 0.55;
    --frost-blur: 8px;
  }

  #mobile-dock::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    box-shadow: inset var(--shadow-offset) var(--shadow-offset) var(--shadow-blur) var(--shadow-spread) var(--shadow-color);
    background-color: rgba(var(--tint-color), var(--tint-opacity));
    pointer-events: none;
  }

  #mobile-dock::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    border-radius: inherit;
    backdrop-filter: blur(var(--frost-blur));
    -webkit-backdrop-filter: blur(var(--frost-blur));
    filter: url(#glass-distortion);
    -webkit-filter: url("#glass-distortion");
    pointer-events: none;
  }

  #mobile-dock #player-bar {
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    top: auto !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    transform: none !important;
  }

  #player-bar {
    height: 0;
    opacity: 0;
    pointer-events: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: rgb(from var(--dynamic-bg) r g b / 0.45);
    position: relative;
    overflow: hidden;
    width: 100%;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    cursor: pointer;
    transition: height 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), padding 0.4s ease;
  }

  #mobile-dock.player-active #player-bar {
    height: 64px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }

  .pb-center {
    display: flex !important;
    flex: unset;
    position: static !important;
    gap: 0;
    flex-direction: row;
    margin-right: 0 !important;
    align-items: center;
    flex-shrink: 0;
  }

  .pb-center .pb-controls {
    display: flex;
    align-items: center;
  }

  .pb-center .pb-controls .ctrl-btn {
    display: none;
  }

  .pb-center .pb-controls .pb-play {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 50% !important;
    color: var(--text-1);
    cursor: pointer;
    box-sizing: border-box;
  }

  .pb-center .pb-controls .pb-play svg {
    width: 22px !important;
    height: 22px !important;
  }

  .pb-center .pb-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    z-index: 10;
  }

  .pb-prog-wrap {
    height: 2px;
    margin: 0;
    border-radius: 0;
  }

  .pb-progress span {
    display: none;
  }

  .pb-right {
    display: none;
  }

  .pb-track {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    margin-left: 0 !important;
    margin-right: 2px !important;
    min-width: 0;
  }

  .pb-track .pb-art-container {
    width: 42px !important;
    height: 42px !important;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
  }

  .pb-track>div:nth-child(2) {
    padding-right: 0 !important;
    flex: 1;
    min-width: 0;
    margin-right: 8px;
  }

  .pb-track .pb-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.25;
  }

  .pb-track .pb-artist {
    font-size: 11.5px;
    color: var(--text-3);
    line-height: 1.2;
  }

  .pb-track-actions {
    position: static !important;
    transform: none !important;
    z-index: 2;
    display: flex !important;
    align-items: center;
    gap: 0 !important;
    margin-left: 0 !important;
    margin-right: -20px !important;
    flex-shrink: 0;
  }

  .pb-track .pb-like {
    position: static !important;
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color var(--t-fast), transform var(--t-fast);
  }

  .pb-track .pb-like:active {
    transform: scale(0.9);
  }

  /* Disable hover tooltips on mobile devices */
  [data-tooltip]::before,
  [data-tooltip]::after,
  .tooltip,
  .zolt-tooltip {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .pb-track .pb-add-playlist {
    display: none !important;
  }

  .pb-track .pb-like:active {
    transform: scale(0.9);
  }

  #mobile-nav {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    height: 54px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 var(--sp-2);
    box-sizing: border-box;
    z-index: 1000;
  }

  .liquidGlass-effect {
    position: absolute;
    z-index: 0;
    inset: 0;

    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    filter: url(#glass-distortion);
    overflow: hidden;
  }

  .liquidGlass-tint {
    z-index: 1;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
  }

  .liquidGlass-shine {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    box-shadow: inset 2px 2px 1px 0 rgba(0, 0, 0, 0.5),
      inset -1px -1px 1px 1px rgba(0, 0, 0, 0.5);
  }

  .mob-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    height: 38px;
    padding: 0 10px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    vertical-align: middle;
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .mob-nav-btn svg,
  .mob-nav-btn>div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .mob-nav-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-1);
    margin-left: 0;
    transition: max-width 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.15s ease, margin 0.22s ease;
  }

  .mob-nav-btn:active svg,
  .mob-nav-btn:active>div {
    transform: scale(0.9);
  }

  .mob-nav-btn.active {
    color: var(--text-1);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    padding: 0 14px;
    gap: var(--sp-2);
  }

  .mob-nav-btn.active svg,
  .mob-nav-btn.active>div {
    transform: scale(1.05);
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.15));
    color: var(--text-1);
  }

  .mob-nav-btn.active .mob-nav-label {
    max-width: 90px;
    opacity: 1;
    margin-left: 4px;
  }
}

@media (min-width: 769px) {
  #mobile-dock {
    display: contents;
  }

  #mobile-nav {
    display: none;
  }
}


/* Let JS manage now-playing collapse/expand states dynamically for a bulletproof experience */

/* Now Playing bottom bar toggle and PiP styles */
.pb-nowplaying,
.pb-pip,
.pb-fullscreen,
.pb-download {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  transition: color var(--t-fast), transform var(--t-fast);
}

.pb-nowplaying svg,
.pb-pip svg,
.pb-fullscreen svg,
.pb-download svg {
  width: 18px;
  height: 18px;
}

.pb-nowplaying:hover,
.pb-pip:hover,
.pb-fullscreen:hover,
.pb-download:hover {
  color: var(--text-1);
  transform: scale(1.1);
}

.pb-nowplaying:active,
.pb-pip:active,
.pb-fullscreen:active {
  transform: scale(0.93);
}

.pb-nowplaying.active,
.pb-pip.active,
.pb-fullscreen.active {
  color: var(--accent) !important;
}

/* Drag and Drop styles for Queue Items */
.queue-item.dragging {
  opacity: 0.45;
  transform: scale(0.98);
  border: 1.5px dashed var(--border);
  background: var(--bg-3) !important;
}

.queue-item.drag-over-top {
  border-top: 2px solid var(--accent);
}

.queue-item.drag-over-bottom {
  border-bottom: 2px solid var(--accent);
}

/* Queue items drag handle, options, and right wrap updates */
.qi-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  color: var(--text-3);
  opacity: 0.3;
  transition: opacity var(--t-fast), color var(--t-fast);
}

.queue-item:hover .qi-drag-handle {
  opacity: 0.8;
  color: var(--accent);
}

.qi-right-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.qi-options-btn {
  opacity: 0;
  border-radius: 50%;
  transition: background var(--t-fast), color var(--t-fast), opacity var(--t-fast), transform var(--t-fast);
}

.queue-item:hover .qi-options-btn {
  opacity: 1;
}

.qi-options-btn:hover {
  background: var(--bg-4);
  color: var(--accent);
  transform: scale(1.1);
}

.qi-options-btn svg {
  fill: currentColor;
}

/* On mobile, buttons and handles are always visible since there is no hover */
@media (max-width: 768px) {

  .qi-remove-btn,
  .qi-options-btn {
    opacity: 1 !important;
  }

  .qi-drag-handle {
    opacity: 0.7 !important;
  }
}

/* Bottom player bar track action buttons */
.pb-track-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-left: var(--sp-3);
}

.pb-like,
.pb-add-playlist,
.pb-download {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-1);
  transition: color var(--t-fast), transform var(--t-fast);
}

.pb-like:hover,
.pb-add-playlist:hover,
.pb-download:hover {
  color: var(--text-1);
}

.pb-like:active,
.pb-add-playlist:active,
.pb-download:active {
  transform: scale(0.9);
}

/* Custom Theme Designer Styling */
.theme-color-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.theme-color-input-group label {
  font-size: 10.5px;
  color: var(--text-2);
  font-weight: 500;
}

.theme-color-input-group input[type="color"] {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}

.theme-preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 11px;
}

.theme-preset-item-actions {
  display: flex;
  gap: 8px;
}

.theme-preset-item-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 10px;
}

.theme-preset-item-btn:hover {
  color: var(--text-1);
}

.theme-preset-item-btn.delete:hover {
  color: var(--danger);
}

#custom-theme-edit-icon {
  transition: opacity var(--t-fast), color var(--t-fast);
}

#custom-theme-edit-icon:hover {
  opacity: 1 !important;
  color: var(--accent) !important;
}

.theme-designer-modal {
  position: fixed !important;
  top: 24px;
  right: 24px;
  left: auto;
  bottom: auto;
  transform: none;
  margin: 0;
  z-index: 10002 !important;
  /* Make sure background is solid enough since we removed the blur overlay */
  background: rgba(16, 16, 16, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

@media (max-width: 768px) {
  .theme-designer-modal {
    top: 10% !important;
    right: 5% !important;
    left: 5% !important;
    width: 90% !important;
    max-width: none !important;
  }
}