/* SPDX-FileCopyrightText: 2026 S.F. Cyris
   SPDX-License-Identifier: AGPL-3.0-or-later */

/* ══════════════════════════════════════════════════════════════════════════════
   The open playlist — js/playlist.js + js/playlist/hero.js + js/playlist/waves.js
   Two looks, the shared UI style (js/ui_style.js; the equalizer and Settings
   switch it): #playlist-panel[data-pl-style="modern" | "retro"].
     Modern     — a glass header tinted by the covers, waveform rows.
     Retro hi-fi — a cassette J-card (handwritten-style name, a tape-counter
                   total) on a brushed-metal plate; a turning reel by the
                   playing row.
   Light / dark follow :root[data-theme].  Every label ≥ 4.5:1 on its surface.
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Tokens (modern, dark) ──────────────────────────────────────────────────── */
#playlist-panel {
  --plx-wave: rgba(168, 173, 182, 0.80);
  --plx-wave-played: #f0722a;
  --plx-wave-rest: rgba(168, 173, 182, 0.38);
  --plx-wave-ph: rgba(181, 188, 203, 0.12);   /* no stored waveform: a faint flat bar */
  --plx-wave-head: #ffffff;
  --plx-f-lossless: #6fcf8c;
  --plx-f-lossy: #9fc8f6;
  --plx-f-sid: #40d0d0;
  --plx-f-tracker: #f0722a;
  --plx-f-chip: #c8b4ec;
  --plx-f-midi: #ec8bc6;
  --plx-f-other: #b5bccb;
  --plx-on-accent: #1a1208;
}
:root[data-theme="light"] #playlist-panel {
  --plx-wave: rgba(58, 64, 80, 0.62);
  --plx-wave-played: #c4520f;
  --plx-wave-rest: rgba(58, 64, 80, 0.28);
  --plx-wave-ph: rgba(58, 64, 80, 0.10);
  --plx-wave-head: #1a1d22;
  --plx-f-lossless: #1d6b3a;
  --plx-f-lossy: #1f4f8f;
  --plx-f-sid: #0b6767;
  --plx-f-tracker: #8a3a08;
  --plx-f-chip: #5b2d8a;
  --plx-f-midi: #8a1d5a;
  --plx-f-other: #3d4250;
}

/* A wider drawer while a playlist is open (the rows carry a waveform) */
#playlist-panel.plx-open { width: min(480px, 100vw); }
#playlist-panel.plx-open #pl-active-name,
#playlist-panel.plx-open #pl-active-count { display: none; }
#playlist-panel.plx-open #pl-hdr-tracks { padding-top: 10px; padding-bottom: 8px; border-bottom: none; }
#playlist-panel.plx-open #pl-hdr-tracks .pl-back-btn { margin-right: auto; }
#playlist-tracks:focus { outline: none; }

/* Phone-width desktop page: the player bar is in the page flow there
   (--player-h: auto), so the drawer runs to the bottom and its list scrolls. */
@media (max-width: 600px) {
  #playlist-panel { bottom: 0; }
}

/* A smart playlist (a saved search) has its search's order and tracks */
#playlist-panel.pl-smart .queue-drag-handle,
#playlist-panel.pl-smart .queue-remove-btn,
#playlist-panel.pl-smart #pl-sel-bar,
#playlist-panel.pl-smart #playlist-drop-zone { display: none !important; }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.plx-hero[hidden] { display: none; }
.plx-hero {
  flex-shrink: 0;
  position: relative;
  padding: 4px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--plx-tint, transparent) 18%, transparent) 0%,
    transparent 100%);
}
.plx-card { display: flex; gap: 14px; align-items: flex-end; min-width: 0; }
.plx-hero { --plx-mosaic: 112px; }
.plx-mosaic {
  width: var(--plx-mosaic); height: var(--plx-mosaic);
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.plx-mosaic[data-tiles="1"], .plx-mosaic[data-tiles="0"] { grid-template: 1fr / 1fr; }
.plx-tile { position: relative; min-width: 0; min-height: 0; }
.plx-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plx-tile-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; line-height: 1;
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
}
.plx-head { flex: 1; min-width: 0; }
.plx-kicker {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plx-name {
  margin: 2px 0 6px;
  font-size: 22px; line-height: 1.15; font-weight: 700;
  color: var(--text0);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.plx-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0;
  font-size: 12px; color: var(--text1);
  font-variant-numeric: tabular-nums;
}
.plx-meta [hidden] { display: none !important; }
.plx-len::before { content: "\00b7"; margin: 0 6px; color: var(--text2); }
/* the format mix on its own line (a wrapped "·" would start a line) */
.plx-mixtext { flex-basis: 100%; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plx-counter { display: none; }
.plx-mixbar {
  display: flex; gap: 2px;
  height: 6px; margin-top: 8px; max-width: 280px;
  border-radius: 3px; overflow: hidden;
}
.plx-mixbar[hidden] { display: none; }
.plx-seg { flex-basis: 0; min-width: 3px; }

/* Format families: the mix bar and the row chips */
.plx-seg.plx-fam-lossless { background: var(--plx-f-lossless); }
.plx-seg.plx-fam-lossy    { background: var(--plx-f-lossy); }
.plx-seg.plx-fam-sid      { background: var(--plx-f-sid); }
.plx-seg.plx-fam-tracker  { background: var(--plx-f-tracker); }
.plx-seg.plx-fam-chip     { background: var(--plx-f-chip); }
.plx-seg.plx-fam-midi     { background: var(--plx-f-midi); }
.plx-seg.plx-fam-other    { background: var(--plx-f-other); }

/* Actions */
.plx-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 12px;
}
.plx-slot { display: contents; }
.plx-play, .plx-shuffle, .plx-menu-btn,
.plx-hero .pl-share-btn, .plx-hero .pl-unsub-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: 999px;
  font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-bright);
  background: transparent;
  color: var(--text0);
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.plx-play {
  padding: 0 16px 0 12px;
  background: var(--accent); border-color: var(--accent);
  color: var(--plx-on-accent);
}
.plx-play:hover:not(:disabled) { background: #ff8440; }
.plx-play:active:not(:disabled) { transform: scale(0.97); }
.plx-play-ico {
  width: 11px; height: 12px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.plx-play.is-playing .plx-play-ico { clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0); }
.plx-shuffle:hover:not(:disabled), .plx-menu-btn:hover,
.plx-hero .pl-share-btn:hover, .plx-hero .pl-unsub-btn:hover { background: var(--row-hover); }
.plx-play:disabled, .plx-shuffle:disabled { opacity: 0.55; cursor: default; }
.plx-hero .pl-share-btn.active { color: var(--accent); border-color: rgba(240, 114, 42, 0.55); }
:root[data-theme="light"] .plx-hero .pl-share-btn.active { color: #8a3a08; border-color: rgba(138, 58, 8, 0.55); }
.plx-hero .pl-share-btn[hidden], .plx-hero .pl-unsub-btn[hidden] { display: none; }
.plx-menu-btn { width: 32px; padding: 0; justify-content: center; font-size: 18px; line-height: 1; }
.plx-menu-wrap { position: relative; }
.plx-menu[hidden] { display: none; }
.plx-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  min-width: 180px; padding: 4px;
  background: var(--panel-bg);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  box-shadow: var(--glass-shadow);
  display: flex; flex-direction: column;
}
.plx-menu-item {
  text-align: left; font: inherit; font-size: 13px;
  padding: 7px 10px; border: none; border-radius: 5px;
  background: none; color: var(--text0); cursor: pointer;
}
.plx-menu-item:hover, .plx-menu-item:focus-visible { background: var(--row-hover); }
.plx-menu-item.danger { color: #ff8a80; }
:root[data-theme="light"] .plx-menu-item.danger { color: #a3190f; }

/* ── Rows ──────────────────────────────────────────────────────────────────── */
#playlist-tracks .plx-row { padding: 6px 8px 6px 4px; gap: 8px; }
/* the handle the rows are dragged by: ≥ 3:1 at rest too */
#playlist-tracks .plx-row .queue-drag-handle { opacity: 0.8; }
:root[data-theme="light"] #playlist-tracks .plx-row .queue-drag-handle { opacity: 1; }
/* Duplicate markers readable on the light surfaces (≥ 4.5:1) */
:root[data-theme="light"] #playlist-tracks .dup-id-badge {
  color: #5e3900; background: rgba(240, 180, 42, 0.22); border-color: rgba(94, 57, 0, 0.45);
}
:root[data-theme="light"] #playlist-tracks .dup-loc-badge {
  color: #164b66; background: rgba(22, 75, 102, 0.10); border-color: rgba(22, 75, 102, 0.40);
}
#playlist-tracks .plx-row .queue-row-art { width: 36px; height: 36px; border-radius: 5px; }
.plx-fmt {
  flex: none;
  max-width: 46px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; line-height: 14px;
  padding: 1px 5px; border-radius: 4px;
  color: var(--plx-f, var(--plx-f-other));
  background: color-mix(in srgb, var(--plx-f, var(--plx-f-other)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--plx-f, var(--plx-f-other)) 30%, transparent);
}
.plx-fmt.plx-fam-lossless { --plx-f: var(--plx-f-lossless); }
.plx-fmt.plx-fam-lossy    { --plx-f: var(--plx-f-lossy); }
.plx-fmt.plx-fam-sid      { --plx-f: var(--plx-f-sid); }
.plx-fmt.plx-fam-tracker  { --plx-f: var(--plx-f-tracker); }
.plx-fmt.plx-fam-chip     { --plx-f: var(--plx-f-chip); }
.plx-fmt.plx-fam-midi     { --plx-f: var(--plx-f-midi); }
.plx-fmt.plx-fam-other    { --plx-f: var(--plx-f-other); }
.plx-wave-wrap {
  flex: none; position: relative;
  width: 76px; height: 24px;
  overflow: hidden; border-radius: 3px;
}
.plx-wave { display: block; width: 100%; height: 100%; }
#playlist-tracks .plx-row .queue-track-dur { min-width: 34px; text-align: right; }

/* The playing row's waveform: a slow sheen while it plays (visualizations on,
   motion welcome — playlist.js sets .plx-anim / .plx-is-playing). */
#playlist-panel.plx-anim.plx-is-playing .queue-row.playing .plx-wave-wrap::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.22) 50%, transparent 100%) no-repeat;
  background-size: 35% 100%;
  animation: plx-sheen 2.6s linear infinite;
  pointer-events: none;
}
@keyframes plx-sheen { from { background-position: -60% 0; } to { background-position: 160% 0; } }

/* Narrow (phone-width) drawer: the chip goes (the header's mix says it), the
   waveform shrinks. */
@media (max-width: 520px) {
  .plx-fmt { display: none; }
  .plx-wave-wrap { width: 52px; }
  .plx-hero { --plx-mosaic: 92px; }
  .plx-name { font-size: 19px; }
  .plx-btn-lbl { display: none; }
  .plx-shuffle { width: 32px; padding: 0; justify-content: center; }
}
/* A short window keeps room for the rows */
@media (max-height: 640px) {
  .plx-hero { --plx-mosaic: 72px; }
  .plx-name { font-size: 18px; -webkit-line-clamp: 1; }
  .plx-actions { margin-top: 8px; }
}

/* ── Drag to reorder: the drop line ────────────────────────────────────────── */
.plx-dropline[hidden] { display: none; }
.plx-dropline {
  position: absolute; top: 0; left: 0;
  height: 2px; z-index: 6;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(240, 114, 42, 0.65);
  pointer-events: none;
  transition: transform 70ms ease-out;
}
.plx-dropline::before, .plx-dropline::after {
  content: ""; position: absolute; top: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.plx-dropline::before { left: -4px; }
.plx-dropline::after { right: -4px; }
#playlist-tracks .plx-row.dragging { opacity: 0.35; }

/* ══════════════════════════════════════════════════════════════════════════════
   Retro hi-fi — a cassette J-card on a brushed-metal plate
   ══════════════════════════════════════════════════════════════════════════════ */
#playlist-panel[data-pl-style="retro"] {
  --plx-face: "DIN Alternate", "DIN Condensed", Bahnschrift, "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --plx-hand: "Marker Felt", "Noteworthy", "Bradley Hand", "Segoe Print", "Chalkboard SE", "Comic Sans MS", cursive;
  --plx-print: #cfd3d9;                 /* printed legends */
  --plx-print-2: #a3a9b2;               /* secondary (≥ 4.5:1 on the plate) */
  --plx-plate: #1d1f22;
  --plx-surface:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(180deg, rgba(0,0,0,0.07) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #2a2c30 0%, #1d1f22 45%, #17181b 100%);
  --plx-card: #2b2620;                  /* a charcoal kraft J-card */
  --plx-ink: #f1e7cf;
  --plx-ink-2: #cbbf9f;
  --plx-rule: rgba(241, 231, 207, 0.07);
  --plx-margin: rgba(226, 104, 82, 0.42);
  --plx-key-bg: linear-gradient(180deg, #3b3e43, #26282c 55%, #1e2023);
  --plx-key-edge: #050506;
  --plx-lamp: #ffb12b;                  /* amber: a function engaged */
  --plx-lamp-dot: #ffb12b;              /* … as a lamp */
  --plx-lamp-ring: 0 0 0 0 transparent;
  --plx-lamp-glow: 0 0 5px #ffb12b;
  --plx-playing: #3be16c;               /* green: the playing track (as in the queue) */
  --plx-wave: rgba(207, 211, 217, 0.62);
  --plx-wave-played: #ffb12b;
  --plx-wave-rest: rgba(207, 211, 217, 0.30);
  --plx-wave-ph: rgba(255, 177, 43, 0.13);     /* no stored waveform: unlit amber LCD cells */
  --plx-wave-ph-cells: 48;                      /* (waves.js WAVE_POINTS: the bars' pitch) */
  --plx-wave-head: #fff3d6;
  --plx-on-accent: #1a1208;
  background: var(--plx-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-left-color: #000;
  color: var(--plx-print);
}
:root[data-theme="light"] #playlist-panel[data-pl-style="retro"] {
  --plx-print: #23262b;
  --plx-print-2: #3f444c;
  --plx-plate: #c9ccd1;
  --plx-surface:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.30) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(180deg, rgba(0,0,0,0.035) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #dfe1e4 0%, #c9ccd1 50%, #bfc2c7 100%);
  --plx-card: #f4ecd6;                  /* a cream J-card, blue ballpoint */
  --plx-ink: #1f2f6b;
  --plx-ink-2: #4a4537;
  --plx-rule: rgba(31, 47, 107, 0.10);
  --plx-margin: rgba(200, 60, 50, 0.40);
  --plx-key-bg: linear-gradient(180deg, #f4f5f7, #d9dce0 55%, #c8cbd0);
  --plx-key-edge: #8c9096;
  --plx-lamp: #a34a00;
  --plx-lamp-dot: #d27a00;
  --plx-lamp-ring: 0 0 0 1px rgba(0, 0, 0, 0.45);
  --plx-lamp-glow: 0 0 0 0 transparent;
  --plx-playing: #12a04a;
  --plx-wave: rgba(35, 38, 43, 0.55);
  --plx-wave-played: #8a3a00;
  --plx-wave-rest: rgba(35, 38, 43, 0.26);
  --plx-wave-ph: rgba(110, 62, 0, 0.18);
  --plx-wave-head: #23262b;
  --plx-f-lossless: #14532c;
  --plx-f-lossy: #173d70;
  --plx-f-sid: #0a4f4f;
  --plx-f-tracker: #6e2e05;
  --plx-f-chip: #4a2272;
  --plx-f-midi: #6e1747;
  --plx-f-other: #2f333c;
  border-left-color: #8c9096;
}

/* Panel chrome on the plate: printed legends */
#playlist-panel[data-pl-style="retro"] .playlist-header { border-bottom-color: rgba(0, 0, 0, 0.35); }
#playlist-panel[data-pl-style="retro"] .playlist-title,
#playlist-panel[data-pl-style="retro"] .playlist-row-name {
  font-family: var(--plx-face);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--plx-print);
}
#playlist-panel[data-pl-style="retro"] .playlist-row-count,
#playlist-panel[data-pl-style="retro"] .pl-track-count { font-family: var(--plx-face); color: var(--plx-print-2); }

#playlist-panel[data-pl-style="retro"] :is(.pl-back-btn, .playlist-close-btn, #btn-playlist-close) { color: var(--plx-print); }

/* The J-card */
#playlist-panel[data-pl-style="retro"] .plx-hero {
  background: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 4px 14px 12px;
}
#playlist-panel[data-pl-style="retro"] .plx-card {
  position: relative;
  align-items: stretch;
  padding: 10px 12px 10px 10px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(180deg, transparent 0 21px, var(--plx-rule) 21px 22px),
    var(--plx-card);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
/* the fold between the cover and the label, and a red margin line */
#playlist-panel[data-pl-style="retro"] .plx-card::before {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: calc(10px + var(--plx-mosaic) + 7px);
  border-left: 1px dashed rgba(0, 0, 0, 0.28);
  box-shadow: 4px 0 0 -3px var(--plx-margin);
  pointer-events: none;
}
/* a strip of tape over the cover */
#playlist-panel[data-pl-style="retro"] .plx-card::after {
  content: ""; position: absolute; top: 3px; left: 46px;
  width: 44px; height: 13px;
  background: rgba(255, 238, 170, 0.45);
  transform: rotate(-7deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}
#playlist-panel[data-pl-style="retro"] .plx-mosaic {
  border-radius: 1px;
  border: 3px solid #f2efe8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transform: rotate(-1.5deg);
}
#playlist-panel[data-pl-style="retro"] .plx-head { padding-left: 6px; }
#playlist-panel[data-pl-style="retro"] .plx-kicker {
  font-family: var(--plx-face); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; color: var(--plx-ink-2);
}
#playlist-panel[data-pl-style="retro"] .plx-name {
  font-family: var(--plx-hand);
  font-size: 25px; font-weight: 400; line-height: 1.12;
  color: var(--plx-ink);
  transform: rotate(-0.6deg);
  transform-origin: left center;
}
#playlist-panel[data-pl-style="retro"] .plx-meta {
  font-family: var(--plx-face); font-size: 12px; letter-spacing: 0.05em;
  color: var(--plx-ink-2);
}
#playlist-panel[data-pl-style="retro"] .plx-len::before { color: var(--plx-ink-2); }
/* Retro shows the total on a tape counter; the words stay for screen readers */
#playlist-panel[data-pl-style="retro"] .plx-len {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
#playlist-panel[data-pl-style="retro"] .plx-counter {
  display: inline-flex; align-items: center; gap: 1px;
  margin: 0 2px 0 8px; padding: 2px 3px;
  background: #0b0b0c;
  border-radius: 3px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.10);
}
#playlist-panel[data-pl-style="retro"] .plx-counter[hidden] { display: none; }
.plx-cnt-dig {
  display: inline-block; min-width: 10px; text-align: center;
  font-family: var(--plx-face); font-size: 12px; font-weight: 700; line-height: 16px;
  color: #f4f4f2;
  background: linear-gradient(180deg, #34343a 0%, #111113 48%, #111113 52%, #34343a 100%);
  border-radius: 2px; padding: 0 1px;
}
.plx-cnt-sep { color: #c9ccd1; font-size: 11px; font-weight: 700; padding: 0 1px; }
#playlist-panel[data-pl-style="retro"] .plx-mixbar { border-radius: 1px; gap: 1px; height: 5px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }

/* Hardware keys */
#playlist-panel[data-pl-style="retro"] :is(.plx-play, .plx-shuffle, .plx-menu-btn, .pl-share-btn, .pl-unsub-btn) {
  border-radius: 4px;
  border: 1px solid var(--plx-key-edge);
  background: var(--plx-key-bg);
  color: var(--plx-print);
  font-family: var(--plx-face); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 1px 2px rgba(0, 0, 0, 0.6);
}
#playlist-panel[data-pl-style="retro"] :is(.plx-play, .plx-shuffle, .plx-menu-btn, .pl-share-btn, .pl-unsub-btn):active:not(:disabled) {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
  transform: translateY(1px);
}
#playlist-panel[data-pl-style="retro"] .plx-play .plx-play-ico { color: var(--plx-lamp); filter: drop-shadow(0 0 3px color-mix(in srgb, var(--plx-lamp) 70%, transparent)); }
#playlist-panel[data-pl-style="retro"] .pl-share-btn.active { color: var(--plx-print); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55); }
#playlist-panel[data-pl-style="retro"] .pl-share-btn.active::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--plx-lamp-dot); box-shadow: var(--plx-lamp-ring), var(--plx-lamp-glow);
}
#playlist-panel[data-pl-style="retro"] .plx-menu { background: var(--plx-plate); border-color: var(--plx-key-edge); border-radius: 4px; }
#playlist-panel[data-pl-style="retro"] .plx-menu-item { font-family: var(--plx-face); letter-spacing: 0.04em; color: var(--plx-print); }
#playlist-panel[data-pl-style="retro"] .plx-menu-item.danger { color: #ff9a8f; }
:root[data-theme="light"] #playlist-panel[data-pl-style="retro"] .plx-menu-item.danger { color: #8c0f08; }
/* Rows on the plate */
#playlist-panel[data-pl-style="retro"] #playlist-tracks .plx-row {
  border-bottom-color: rgba(0, 0, 0, 0.30);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035);
}
:root[data-theme="light"] #playlist-panel[data-pl-style="retro"] #playlist-tracks .plx-row {
  border-bottom-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
#playlist-panel[data-pl-style="retro"] #playlist-tracks .queue-track-title {
  font-family: var(--plx-face); font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--plx-print);
}
#playlist-panel[data-pl-style="retro"] #playlist-tracks :is(.queue-track-artist, .queue-track-dur) {
  font-family: var(--plx-face); letter-spacing: 0.03em; color: var(--plx-print-2);
}
#playlist-panel[data-pl-style="retro"] #playlist-tracks .queue-row-art { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); }
#playlist-panel[data-pl-style="retro"] .plx-fmt {
  font-family: var(--plx-face); letter-spacing: 0.08em;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.30);
  border-color: rgba(0, 0, 0, 0.45);
}
:root[data-theme="light"] #playlist-panel[data-pl-style="retro"] .plx-fmt {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(0, 0, 0, 0.25);
}
#playlist-panel[data-pl-style="retro"] .plx-wave-wrap {
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
:root[data-theme="light"] #playlist-panel[data-pl-style="retro"] .plx-wave-wrap {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}
#playlist-panel[data-pl-style="retro"] #playlist-tracks .queue-row.playing {
  background: color-mix(in srgb, var(--plx-playing) 7%, transparent);
  border-left-color: var(--plx-playing);
}
:root[data-theme="light"] #playlist-panel[data-pl-style="retro"] #playlist-tracks .queue-row.playing {
  background: rgba(255, 255, 255, 0.35);
  border-left-color: #0b7a36;           /* the edge a darker green than the lamp: ≥ 3:1 */
}

/* The playing row's tape reel (turns slowly while it plays); every row keeps
   the reel's width so the playing one doesn't shift */
#playlist-panel[data-pl-style="retro"] #playlist-tracks .queue-playing-icon { width: 16px; }
#playlist-panel[data-pl-style="retro"] #playlist-tracks .queue-row.playing .queue-playing-icon {
  font-size: 0; height: 16px;
  color: var(--plx-print);
}
#playlist-panel[data-pl-style="retro"] #playlist-tracks .queue-row.playing .queue-playing-icon::before {
  content: "";
  display: block; width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M1 12a11 11 0 1 0 22 0a11 11 0 1 0 -22 0z M9.8 12a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0z M9 5.9a3 3 0 1 0 6 0a3 3 0 1 0 -6 0z M14.46 15.15a3 3 0 1 0 6 0a3 3 0 1 0 -6 0z M3.54 15.15a3 3 0 1 0 6 0a3 3 0 1 0 -6 0z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M1 12a11 11 0 1 0 22 0a11 11 0 1 0 -22 0z M9.8 12a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0z M9 5.9a3 3 0 1 0 6 0a3 3 0 1 0 -6 0z M14.46 15.15a3 3 0 1 0 6 0a3 3 0 1 0 -6 0z M3.54 15.15a3 3 0 1 0 6 0a3 3 0 1 0 -6 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
#playlist-panel.plx-anim.plx-is-playing[data-pl-style="retro"] #playlist-tracks .queue-row.playing .queue-playing-icon::before {
  animation: plx-reel 4s linear infinite;
}
@keyframes plx-reel { to { transform: rotate(360deg); } }

/* Reduced motion: no sheen, no turning reel, no gliding rows or drop line */
@media (prefers-reduced-motion: reduce) {
  #playlist-panel .plx-wave-wrap::after,
  #playlist-panel #playlist-tracks .queue-row.playing .queue-playing-icon::before { animation: none !important; }
  .plx-dropline { transition: none; }
}
