/* ============================================================
   STREAM // SPCTRM panel — djanything.com-native styling for the
   third-party stream-source browser. Original neon visual
   identity; data source happens to be Spotify.
   ============================================================ */

/* ----- Source badge in queue rows ----- */
.src-badge.sp {
  background: linear-gradient(135deg,
    oklch(0.3 0.18 200 / 0.5),
    oklch(0.3 0.2 320 / 0.5));
  color: oklch(0.92 0.12 250);
  border: 1px solid oklch(0.55 0.18 260 / 0.55);
  text-shadow: 0 0 6px oklch(0.7 0.2 260 / 0.5);
}

/* ----- Sidebar wrapper with tabs ----- */
.sidebar {
  grid-area: queue;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 14px 14px 0;
  gap: 8px;
}
.sidebar-tabs {
  display: flex;
  gap: 4px;
  background:
    linear-gradient(180deg, oklch(0.13 0.03 280 / 0.85), oklch(0.08 0.02 280 / 0.85));
  border: 1px solid oklch(0.3 0.06 280 / 0.6);
  border-radius: 10px;
  padding: 4px;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.05),
    0 1px 0 oklch(0 0 0 / 0.4);
}
.sidebar-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: oklch(0.7 0.04 280);
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  position: relative;
}
.sidebar-tab:hover:not(.active) {
  color: oklch(0.95 0.06 200);
  background: oklch(0.18 0.04 280 / 0.5);
}
.sidebar-tab.active {
  background: linear-gradient(180deg,
    oklch(0.28 0.1 280),
    oklch(0.18 0.06 280));
  color: oklch(0.97 0.05 220);
  box-shadow:
    inset 0 1px 0 oklch(0.6 0.18 220 / 0.4),
    inset 0 -1px 0 oklch(0 0 0 / 0.5),
    0 0 12px oklch(0.6 0.2 280 / 0.25);
}
.sidebar-tab-count {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 7px;
  background: oklch(0.32 0.1 290);
  color: oklch(0.97 0.04 220);
  letter-spacing: 0;
  font-family: var(--font-crt, var(--font-mono, monospace));
}
.sidebar-tab-dot {
  width: 6px;
  height: 6px;
  background: oklch(0.78 0.2 200);
  border-radius: 50%;
  box-shadow: 0 0 8px oklch(0.78 0.22 200);
  animation: spctrm-pulse 1.6s ease-in-out infinite;
}
@keyframes spctrm-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ----- Original SPCTRM equalizer-bars mark (replaces 3rd-party logo) ----- */
.sidebar-sp-logo,
.sp-logo {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5px;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.sp-logo { width: 18px; height: 18px; gap: 2px; }
.sidebar-sp-logo::before,
.sidebar-sp-logo::after,
.sp-logo::before,
.sp-logo::after {
  content: '';
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(180deg,
    oklch(0.92 0.18 200),
    oklch(0.78 0.22 320));
  box-shadow: 0 0 4px oklch(0.7 0.2 260 / 0.6);
  animation: spctrm-bars 1.1s ease-in-out infinite alternate;
}
.sp-logo::before,
.sidebar-sp-logo::before { height: 60%; animation-delay: -0.4s; }
.sp-logo::after,
.sidebar-sp-logo::after { height: 90%; animation-delay: -0.1s; }
/* third bar via background trick on host */
.sp-logo,
.sidebar-sp-logo {
  background-image: linear-gradient(180deg,
    oklch(0.92 0.18 200),
    oklch(0.78 0.22 320));
  background-size: 2px 75%;
  background-position: center bottom;
  background-repeat: no-repeat;
}
@keyframes spctrm-bars {
  0% { transform: scaleY(0.55); }
  100% { transform: scaleY(1); }
}

.sidebar-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-body > .panel.queue {
  flex: 1;
  padding: 14px;
  grid-area: unset;
}

/* ============ STREAM PANEL ============ */
.spotify-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px;
  min-height: 0;
  background:
    linear-gradient(180deg,
      oklch(0.14 0.06 270 / 0.7),
      oklch(0.07 0.02 280 / 0.92));
  border: 1px solid oklch(0.35 0.08 270 / 0.55);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.06),
    0 8px 32px oklch(0 0 0 / 0.5),
    0 0 60px oklch(0.5 0.2 290 / 0.1);
}
/* aurora glow */
.spotify-panel::before {
  content: '';
  position: absolute; inset: -1px -1px auto -1px;
  height: 110px;
  background:
    radial-gradient(ellipse 60% 100% at 20% 0%,
      oklch(0.6 0.25 200 / 0.32), transparent 70%),
    radial-gradient(ellipse 60% 100% at 80% 0%,
      oklch(0.6 0.25 320 / 0.3), transparent 70%);
  pointer-events: none;
}
/* faint scanlines for CRT feel */
.spotify-panel::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg,
    oklch(1 0 0 / 0.018) 0 1px,
    transparent 1px 3px);
  pointer-events: none;
  mix-blend-mode: overlay;
}

.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid oklch(0.3 0.08 280 / 0.4);
  position: relative;
  z-index: 1;
}
.sp-title {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: oklch(0.95 0.08 220);
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 10px oklch(0.7 0.2 260 / 0.5);
}
.sp-title-slash {
  color: oklch(0.5 0.18 320);
  margin: 0 2px;
  font-weight: 400;
}
.sp-title-sub {
  color: oklch(0.55 0.05 280);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.sp-close, .sp-logout {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1px solid oklch(0.3 0.06 280 / 0.7);
  background: oklch(0.13 0.03 280);
  color: oklch(0.65 0.05 280);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-family: inherit;
}
.sp-close:hover, .sp-logout:hover {
  color: oklch(0.92 0.2 25);
  border-color: oklch(0.55 0.2 25 / 0.7);
  background: oklch(0.18 0.08 25 / 0.4);
}

.sp-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: oklch(0.85 0.05 280);
}
.sp-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid oklch(0.55 0.18 260 / 0.7);
  box-shadow: 0 0 8px oklch(0.55 0.2 260 / 0.4);
}
.sp-user-name {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 10px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
  color: oklch(0.92 0.06 220);
}

/* ============ CONNECT CARD ============ */
.sp-connect-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 20px;
  gap: 14px;
  position: relative;
  z-index: 1;
}

/* original glyph: stacked equalizer + ring (NOT a brand mark) */
.sp-connect-glyph {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 30%,
      oklch(0.4 0.2 200 / 0.6), transparent 60%),
    radial-gradient(circle at 70% 70%,
      oklch(0.4 0.22 320 / 0.6), transparent 60%),
    linear-gradient(180deg,
      oklch(0.18 0.05 280),
      oklch(0.1 0.03 280));
  border: 1px solid oklch(0.5 0.18 260 / 0.6);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.1),
    0 0 30px oklch(0.55 0.22 280 / 0.45),
    0 0 80px oklch(0.55 0.22 320 / 0.2);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding: 16px 14px;
  overflow: hidden;
}
.sp-connect-glyph::before,
.sp-connect-glyph::after {
  content: '';
  position: absolute;
  inset: auto 14px 16px 14px;
  height: 70%;
  background-image: linear-gradient(180deg,
    oklch(0.92 0.18 200),
    oklch(0.78 0.22 320));
  background-repeat: no-repeat;
  background-size: 5px 100%;
}
.sp-connect-glyph::before {
  background-position: 0% 100%, 25% 70%, 50% 100%, 75% 60%, 100% 90%;
  background-size: 5px 70%, 5px 50%, 5px 90%, 5px 40%, 5px 80%;
  background-image:
    linear-gradient(180deg, oklch(0.92 0.18 200), oklch(0.85 0.22 230)),
    linear-gradient(180deg, oklch(0.88 0.2 250), oklch(0.78 0.24 280)),
    linear-gradient(180deg, oklch(0.85 0.22 280), oklch(0.78 0.24 310)),
    linear-gradient(180deg, oklch(0.85 0.22 310), oklch(0.78 0.24 340)),
    linear-gradient(180deg, oklch(0.85 0.22 340), oklch(0.78 0.22 20));
  filter: drop-shadow(0 0 6px oklch(0.7 0.22 280 / 0.6));
  animation: sp-glyph-bars 1.3s ease-in-out infinite alternate;
}
.sp-connect-glyph::after {
  display: none;
}
@keyframes sp-glyph-bars {
  0%   { background-size: 5px 70%, 5px 50%, 5px 90%, 5px 40%, 5px 80%; }
  100% { background-size: 5px 40%, 5px 90%, 5px 30%, 5px 80%, 5px 50%; }
}

.sp-connect-title {
  font-family: var(--font-display, var(--font-ui));
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: oklch(0.97 0.03 220);
  text-shadow: 0 0 12px oklch(0.6 0.2 260 / 0.5);
}
.sp-connect-sub {
  font-size: 12px;
  line-height: 1.55;
  color: oklch(0.7 0.05 280);
  max-width: 290px;
  text-wrap: pretty;
}
.sp-connect-btn {
  padding: 12px 22px;
  border-radius: 999px;
  background:
    linear-gradient(135deg,
      oklch(0.65 0.22 200),
      oklch(0.6 0.25 290),
      oklch(0.62 0.24 330));
  color: oklch(0.99 0.02 220);
  border: 1px solid oklch(0.7 0.2 260 / 0.6);
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.18s ease;
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.25),
    0 4px 14px oklch(0.55 0.22 290 / 0.4),
    0 0 30px oklch(0.55 0.22 290 / 0.25);
}
.sp-connect-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.3),
    0 6px 20px oklch(0.55 0.22 290 / 0.5),
    0 0 40px oklch(0.55 0.22 290 / 0.4);
}
.sp-connect-btn .sp-logo { width: 14px; height: 14px; }

.sp-connect-note {
  font-size: 10px;
  color: oklch(0.55 0.04 280);
  max-width: 280px;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.sp-connect-via {
  font-size: 9px;
  color: oklch(0.5 0.04 280);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: -8px;
}
.sp-connect-via b {
  color: oklch(0.75 0.1 220);
  font-weight: 600;
}

/* ============ TABS ============ */
.sp-tabs {
  display: flex;
  gap: 2px;
  margin: 10px 0 8px;
  padding: 3px;
  background: oklch(0.07 0.02 280 / 0.8);
  border: 1px solid oklch(0.25 0.05 280 / 0.6);
  border-radius: 8px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px oklch(0 0 0 / 0.4);
}
.sp-tab {
  flex: 1;
  padding: 7px 4px;
  border: none;
  background: transparent;
  color: oklch(0.6 0.04 280);
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.sp-tab:hover:not(.active) {
  color: oklch(0.92 0.06 220);
  background: oklch(0.15 0.05 280 / 0.6);
}
.sp-tab.active {
  background: linear-gradient(180deg,
    oklch(0.65 0.22 200),
    oklch(0.55 0.25 290));
  color: oklch(0.99 0.02 220);
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.3),
    0 0 14px oklch(0.55 0.22 280 / 0.45);
  text-shadow: 0 1px 0 oklch(0 0 0 / 0.3);
}

/* ============ SEARCH ============ */
.sp-search-box {
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.sp-search-input {
  width: 100%;
  padding: 10px 12px 10px 32px;
  border-radius: 8px;
  border: 1px solid oklch(0.3 0.06 280 / 0.7);
  background:
    oklch(0.06 0.02 280 / 0.9);
  color: oklch(0.96 0.03 220);
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  letter-spacing: 0.02em;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: inset 0 1px 2px oklch(0 0 0 / 0.4);
}
.sp-search-input:focus {
  border-color: oklch(0.7 0.2 260 / 0.8);
  box-shadow:
    inset 0 1px 2px oklch(0 0 0 / 0.4),
    0 0 0 2px oklch(0.6 0.22 260 / 0.2),
    0 0 16px oklch(0.6 0.22 260 / 0.25);
}
.sp-search-input::placeholder {
  color: oklch(0.45 0.04 280);
  letter-spacing: 0.04em;
}
.sp-search-box::before {
  content: '⌕';
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: oklch(0.6 0.15 260);
  font-size: 14px;
  pointer-events: none;
  font-weight: 600;
  text-shadow: 0 0 6px oklch(0.6 0.2 260 / 0.5);
}

/* ============ ERROR + EMPTY ============ */
.sp-error {
  padding: 8px 10px;
  background: oklch(0.22 0.16 25 / 0.35);
  border: 1px solid oklch(0.5 0.2 25 / 0.55);
  color: oklch(0.93 0.08 25);
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.sp-empty {
  text-align: center;
  color: oklch(0.5 0.04 280);
  font-size: 12px;
  padding: 40px 20px;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
}

/* ============ TRACK LIST ============ */
.sp-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  position: relative;
  z-index: 1;
  scrollbar-width: thin;
  scrollbar-color: oklch(0.4 0.15 280) transparent;
}
.sp-list::-webkit-scrollbar { width: 6px; }
.sp-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,
    oklch(0.5 0.2 220),
    oklch(0.45 0.22 320));
  border-radius: 3px;
}

.sp-track-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sp-track-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 7px;
  transition: all 0.12s ease;
  cursor: default;
  border: 1px solid transparent;
}
.sp-track-row:hover {
  background: oklch(0.16 0.06 280 / 0.55);
  border-color: oklch(0.4 0.15 270 / 0.35);
  box-shadow: 0 0 14px oklch(0.5 0.2 280 / 0.15);
}

.sp-track-thumb {
  width: 40px; height: 40px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  background: oklch(0.12 0.04 280);
  position: relative;
  border: 1px solid oklch(0.25 0.06 280 / 0.6);
}
.sp-track-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.sp-track-thumb-ph {
  width: 100%; height: 100%;
  background:
    linear-gradient(135deg,
      oklch(0.25 0.15 220),
      oklch(0.2 0.18 320));
}
.sp-track-info {
  flex: 1;
  min-width: 0;
}
.sp-track-title {
  font-size: 12.5px;
  font-weight: 600;
  color: oklch(0.97 0.02 220);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  letter-spacing: -0.005em;
}
.sp-track-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: oklch(0.6 0.04 280);
  font-family: var(--font-mono, monospace);
}
.sp-track-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 38%;
  letter-spacing: 0.02em;
}
.sp-track-dur {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  margin-left: auto;
  color: oklch(0.55 0.04 280);
  letter-spacing: 0.04em;
}

/* chips */
.sp-chip {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  text-transform: uppercase;
  line-height: 1.4;
}
.sp-chip.bpm {
  background: oklch(0.22 0.15 200 / 0.5);
  color: oklch(0.9 0.16 200);
  border: 1px solid oklch(0.45 0.18 200 / 0.5);
  box-shadow: 0 0 6px oklch(0.6 0.2 200 / 0.2);
}
.sp-chip.key {
  background: oklch(0.22 0.15 320 / 0.5);
  color: oklch(0.9 0.16 320);
  border: 1px solid oklch(0.45 0.18 320 / 0.5);
  box-shadow: 0 0 6px oklch(0.6 0.2 320 / 0.2);
}
.sp-chip.explicit {
  background: oklch(0.2 0.04 280 / 0.7);
  color: oklch(0.65 0.04 280);
  padding: 1px 4px;
  border: 1px solid oklch(0.3 0.04 280 / 0.5);
}
.sp-chip.best {
  background: linear-gradient(135deg,
    oklch(0.65 0.22 200),
    oklch(0.6 0.24 290));
  color: oklch(0.99 0.02 220);
  margin-left: 4px;
  box-shadow: 0 0 10px oklch(0.55 0.22 260 / 0.4);
  border: 1px solid oklch(0.75 0.2 260 / 0.5);
}

/* add button */
.sp-track-add {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid oklch(0.45 0.18 260 / 0.55);
  background:
    linear-gradient(180deg,
      oklch(0.18 0.06 280),
      oklch(0.12 0.04 280));
  color: oklch(0.85 0.15 220);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.06),
    0 1px 0 oklch(0 0 0 / 0.4);
}
.sp-track-add:hover:not(:disabled) {
  background:
    linear-gradient(180deg,
      oklch(0.65 0.22 200),
      oklch(0.55 0.25 290));
  color: oklch(0.99 0.02 220);
  border-color: oklch(0.75 0.2 260 / 0.7);
  transform: scale(1.06);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.3),
    0 0 16px oklch(0.6 0.22 270 / 0.55);
}
.sp-track-add:disabled {
  opacity: 0.5;
  cursor: wait;
  animation: sp-pulse-wait 1.2s ease-in-out infinite;
}
@keyframes sp-pulse-wait {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

/* ============ LOADING SKELETON ============ */
.sp-loading { display: flex; flex-direction: column; gap: 6px; padding: 4px; }
.sp-skel {
  height: 50px;
  border-radius: 7px;
  background: linear-gradient(90deg,
    oklch(0.11 0.03 280 / 0.5) 0%,
    oklch(0.22 0.1 260 / 0.45) 50%,
    oklch(0.11 0.03 280 / 0.5) 100%);
  background-size: 200% 100%;
  animation: sp-skel-shimmer 1.4s ease-in-out infinite;
  border: 1px solid oklch(0.25 0.06 280 / 0.3);
}
@keyframes sp-skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ PLAYLIST GRID ============ */
.sp-pl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 2px;
}
.sp-pl-card {
  border: 1px solid oklch(0.28 0.05 280 / 0.6);
  background:
    linear-gradient(180deg,
      oklch(0.13 0.04 280 / 0.7),
      oklch(0.08 0.02 280 / 0.7));
  border-radius: 9px;
  padding: 6px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.18s ease;
  font-family: inherit;
  color: inherit;
  min-width: 0;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.04);
}
.sp-pl-card:hover {
  border-color: oklch(0.6 0.2 260 / 0.55);
  transform: translateY(-2px);
  background:
    linear-gradient(180deg,
      oklch(0.18 0.08 280 / 0.7),
      oklch(0.1 0.04 280 / 0.7));
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.08),
    0 6px 18px oklch(0 0 0 / 0.4),
    0 0 20px oklch(0.55 0.22 270 / 0.3);
}
.sp-pl-card.skel {
  min-height: 130px;
  background: linear-gradient(90deg,
    oklch(0.11 0.03 280 / 0.5) 0%,
    oklch(0.22 0.1 260 / 0.45) 50%,
    oklch(0.11 0.03 280 / 0.5) 100%);
  background-size: 200% 100%;
  animation: sp-skel-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}
.sp-pl-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.sp-pl-card-ph {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background:
    linear-gradient(135deg,
      oklch(0.25 0.18 220),
      oklch(0.2 0.2 320));
}
.sp-pl-card-name {
  font-size: 11.5px;
  font-weight: 600;
  color: oklch(0.96 0.03 220);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-pl-card-meta {
  font-size: 9px;
  color: oklch(0.55 0.05 280);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============ PLAYLIST DETAIL ============ */
.sp-back {
  background: none;
  border: none;
  color: oklch(0.78 0.15 240);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 6px;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sp-back:hover {
  color: oklch(0.92 0.18 240);
  text-shadow: 0 0 8px oklch(0.6 0.22 240 / 0.5);
}
.sp-playlist-header {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid oklch(0.25 0.06 280 / 0.5);
}
.sp-pl-thumb {
  width: 48px; height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid oklch(0.4 0.15 270 / 0.5);
}
.sp-pl-name {
  font-size: 13px;
  font-weight: 700;
  color: oklch(0.97 0.03 220);
  letter-spacing: -0.005em;
}
.sp-pl-meta {
  font-size: 10px;
  color: oklch(0.55 0.05 280);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============ HANDOFF SHEET ============ */
.sp-handoff-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.04 0.02 280 / 0.82);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: sp-fade-in 0.2s ease-out;
}
@keyframes sp-fade-in { from { opacity: 0; } to { opacity: 1; } }
.sp-handoff {
  background:
    linear-gradient(180deg,
      oklch(0.16 0.06 280),
      oklch(0.08 0.02 280));
  border: 1px solid oklch(0.5 0.18 270 / 0.5);
  border-radius: 14px;
  padding: 22px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.08),
    0 20px 60px oklch(0 0 0 / 0.6),
    0 0 100px oklch(0.55 0.22 280 / 0.2);
  animation: sp-slide-up 0.25s ease-out;
  position: relative;
  overflow: hidden;
}
.sp-handoff::before {
  content: '';
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 90px;
  background:
    radial-gradient(ellipse at 30% 0%, oklch(0.55 0.22 200 / 0.3), transparent 70%),
    radial-gradient(ellipse at 70% 0%, oklch(0.55 0.22 320 / 0.3), transparent 70%);
  pointer-events: none;
}
@keyframes sp-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.sp-handoff-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}
.sp-handoff-title {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.16em;
  color: oklch(0.95 0.08 220);
  text-transform: uppercase;
  text-shadow: 0 0 10px oklch(0.6 0.2 260 / 0.5);
}
.sp-handoff-track {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background:
    linear-gradient(135deg,
      oklch(0.12 0.06 220 / 0.5),
      oklch(0.1 0.06 320 / 0.4));
  border: 1px solid oklch(0.35 0.12 270 / 0.4);
  border-radius: 10px;
  position: relative;
  z-index: 1;
}
.sp-handoff-thumb {
  width: 56px; height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid oklch(0.4 0.15 270 / 0.4);
}
.sp-handoff-name {
  font-size: 14px;
  font-weight: 700;
  color: oklch(0.97 0.03 220);
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}
.sp-handoff-artist {
  font-size: 11px;
  color: oklch(0.65 0.05 280);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
}
.sp-handoff-sub {
  font-size: 10px;
  color: oklch(0.6 0.05 280);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sp-handoff-sub::before,
.sp-handoff-sub::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, oklch(0.3 0.08 270 / 0.5), transparent);
}
.sp-handoff-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 280px;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: oklch(0.4 0.15 280) transparent;
  position: relative;
  z-index: 1;
}
.sp-handoff-list::-webkit-scrollbar { width: 6px; }
.sp-handoff-list::-webkit-scrollbar-thumb {
  background: oklch(0.4 0.15 280 / 0.6);
  border-radius: 3px;
}
.sp-yt-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 9px;
  border: 1px solid oklch(0.25 0.06 280 / 0.6);
  background: oklch(0.07 0.02 280 / 0.7);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.sp-yt-option:hover {
  border-color: oklch(0.5 0.18 270 / 0.5);
  background: oklch(0.12 0.06 280 / 0.6);
}
.sp-yt-option.selected {
  border-color: oklch(0.7 0.2 260);
  background:
    linear-gradient(135deg,
      oklch(0.18 0.1 220 / 0.6),
      oklch(0.16 0.1 320 / 0.6));
  box-shadow:
    0 0 0 1px oklch(0.7 0.2 260 / 0.4),
    0 0 18px oklch(0.55 0.22 280 / 0.35);
}
.sp-yt-thumb {
  width: 80px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid oklch(0.25 0.06 280 / 0.5);
}
.sp-yt-info {
  flex: 1;
  min-width: 0;
}
.sp-yt-title {
  font-size: 12px;
  font-weight: 600;
  color: oklch(0.95 0.03 220);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 4px;
  line-height: 1.3;
}
.sp-yt-meta {
  font-size: 10px;
  color: oklch(0.6 0.04 280);
  font-family: var(--font-mono, monospace);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.04em;
}
.sp-handoff-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid oklch(0.25 0.06 280 / 0.5);
  position: relative;
  z-index: 1;
}
.sp-btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.sp-btn.secondary {
  background: oklch(0.13 0.03 280);
  color: oklch(0.7 0.04 280);
  border-color: oklch(0.28 0.05 280);
}
.sp-btn.secondary:hover {
  color: oklch(0.95 0.04 280);
  border-color: oklch(0.45 0.08 280);
  background: oklch(0.18 0.05 280);
}
.sp-btn.primary {
  background:
    linear-gradient(135deg,
      oklch(0.65 0.22 200),
      oklch(0.6 0.25 290),
      oklch(0.62 0.24 330));
  color: oklch(0.99 0.02 220);
  border-color: oklch(0.7 0.2 260 / 0.6);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.25),
    0 0 16px oklch(0.55 0.22 280 / 0.35);
}
.sp-btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.3),
    0 4px 16px oklch(0.55 0.22 280 / 0.5),
    0 0 24px oklch(0.55 0.22 280 / 0.35);
}
.sp-btn.primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ QUEUE SOURCE INDICATOR ============ */
.queue-item[data-source="spotify"] .queue-thumb::after {
  content: '';
  position: absolute;
  bottom: 2px; right: 2px;
  width: 10px; height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg,
    oklch(0.7 0.22 200),
    oklch(0.65 0.24 320));
  border: 1.5px solid oklch(0.08 0.02 280);
  box-shadow: 0 0 8px oklch(0.6 0.22 270 / 0.7);
}

/* ============ TEMPO LANE BAR (new) ============ */
.sp-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.sp-toolbar-label {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: oklch(0.5 0.05 280);
  margin-right: auto;
}
.sp-sort-btn {
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid oklch(0.28 0.06 280 / 0.6);
  background: oklch(0.08 0.02 280 / 0.7);
  color: oklch(0.65 0.05 280);
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sp-sort-btn:hover {
  color: oklch(0.92 0.08 220);
  border-color: oklch(0.45 0.15 260 / 0.5);
}
.sp-sort-btn.active {
  background: linear-gradient(180deg,
    oklch(0.4 0.18 220),
    oklch(0.3 0.18 290));
  color: oklch(0.99 0.02 220);
  border-color: oklch(0.6 0.2 260 / 0.6);
  box-shadow: 0 0 10px oklch(0.55 0.22 270 / 0.35);
}

/* Mobile: hide sidebar */
@media (max-width: 1100px) {
  .sidebar { display: none; }
}
