:root {
  --bg: #0a0b0d;
  --bg2: #101216;
  --panel: #14171c;
  --panel2: #181c22;
  --line: #21262e;
  --line2: #2e343d;
  --txt: #eef1f5;
  --dim: #79828f;
  --faint: #4c545e;
  --amber: #ffb23e;
  --cyan: #3ad8d0;
  --rose: #ff5a78;
  --green: #62d98a;
  --gold: #ffd24d;
  --r: 13px;
  --side: 258px;
  --pbh: 96px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(58, 216, 208, 0.06), transparent 60%),
    radial-gradient(900px 500px at -5% 110%, rgba(255, 178, 62, 0.05), transparent 55%), var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
}
.mono {
  font-family: "Space Mono", monospace;
}
.hidden {
  display: none !important;
}
::selection {
  background: rgba(58, 216, 208, 0.25);
}

/* generic icon button */
.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: none;
  color: var(--dim);
  cursor: pointer;
  transition: all 0.14s;
  text-decoration: none;
}
.iconbtn:hover {
  background: var(--panel);
  color: var(--txt);
}
.iconbtn svg {
  width: 17px;
  height: 17px;
}
.iconbtn.on {
  color: var(--rose);
}

/* ============ EQ MARK ============ */
.eqmark {
  width: 100%;
  height: 100%;
}
.eqmark .eqb {
  fill: currentColor;
  transform-origin: center bottom;
  animation: eq 1.1s ease-in-out infinite;
}
.eqmark .eqb:nth-child(1) {
  animation-delay: 0s;
}
.eqmark .eqb:nth-child(2) {
  animation-delay: 0.18s;
}
.eqmark .eqb:nth-child(3) {
  animation-delay: 0.36s;
}
.eqmark .eqb:nth-child(4) {
  animation-delay: 0.12s;
}
@keyframes eq {
  0%,
  100% {
    transform: scaleY(0.5);
  }
  50% {
    transform: scaleY(1.05);
  }
}

/* ============ APP LAYOUT ============ */
.app {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  min-height: 100vh;
}

/* ============ SIDEBAR ============ */
#sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border-right: 1px solid var(--line);
  padding: 18px 14px calc(var(--pbh) + 18px);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#sidebar::-webkit-scrollbar {
  width: 8px;
}
#sidebar::-webkit-scrollbar-thumb {
  background: var(--line2);
  border-radius: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
}
.brandmark {
  width: 34px;
  height: 34px;
  color: var(--cyan);
  background: rgba(58, 216, 208, 0.1);
  border: 1px solid rgba(58, 216, 208, 0.25);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 0 18px rgba(58, 216, 208, 0.18);
}
.brandname {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.brandsub {
  font-size: 9px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 4px;
}

.navsec {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 18px 10px 7px;
}
.navgroup {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.navrow {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 9px 11px;
  border: none;
  background: none;
  color: var(--dim);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.13s,
    color 0.13s;
}
.navrow:hover {
  background: var(--panel);
  color: var(--txt);
}
.navrow.on {
  background: linear-gradient(90deg, rgba(58, 216, 208, 0.16), rgba(58, 216, 208, 0.04));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--cyan);
}
/* mono sidebar — plain white glyph icons, no per-category color */
.navico {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: inherit;
  opacity: 0.7;
  flex: 0 0 auto;
}
.navico svg {
  width: 19px;
  height: 19px;
}
.navrow:hover .navico {
  opacity: 0.95;
}
.navrow.on .navico {
  color: var(--cyan);
  opacity: 1;
}
.navlbl {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.navc {
  font-size: 11.5px;
  color: var(--dim);
  background: var(--panel);
  padding: 2px 9px;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}
.navrow.on .navc {
  color: var(--cyan);
  background: rgba(58, 216, 208, 0.14);
}

.newcoll {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px;
  border: 1px dashed var(--line2);
  border-radius: 12px;
  background: none;
  color: var(--dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.newcoll svg {
  width: 16px;
  height: 16px;
}
.newcoll:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(58, 216, 208, 0.05);
}

/* ============ CONTENT COLUMN ============ */
.content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---- HEADER ---- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(10, 11, 13, 0.98), rgba(10, 11, 13, 0.9));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 16px 26px 12px;
}
.hrow {
  display: flex;
  align-items: center;
  gap: 18px;
}
.search {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search > svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--faint);
}
input[type="search"] {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line2);
  color: var(--txt);
  padding: 13px 56px 13px 46px;
  border-radius: 13px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input[type="search"]:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(58, 216, 208, 0.12);
}
input[type="search"]::placeholder {
  color: var(--faint);
}
.kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Space Mono", monospace;
  font-size: 10.5px;
  color: var(--faint);
  border: 1px solid var(--line2);
  background: var(--bg2);
  padding: 2px 7px;
  border-radius: 6px;
}

.stats {
  display: flex;
  gap: 20px;
  align-items: center;
  flex: 0 0 auto;
}
.stat {
  text-align: right;
}
.stat b {
  display: block;
  font-size: 24px;
  font-weight: 700;
  font-family: "Space Mono", monospace;
  color: var(--txt);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat.cy b {
  color: var(--cyan);
}
.stat span {
  display: block;
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-top: 5px;
}

/* ---- single filter row: tabs | divider | chips ........ List/Grid ⛕ ---- */
.filtrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
  flex-wrap: nowrap;
}
.vdiv {
  width: 1px;
  height: 26px;
  background: var(--line2);
  flex: 0 0 auto;
}
.viewtog {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 11px;
  overflow: hidden;
  flex: 0 0 auto;
}
.viewtog button {
  background: none;
  border: none;
  color: var(--dim);
  padding: 9px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.13s;
}
.viewtog button svg {
  width: 15px;
  height: 15px;
}
.viewtog button.on {
  color: var(--txt);
}
.viewtog.vmain {
  margin-left: auto;
}
/* type pills variant */
#typetog {
  background: none;
  border: none;
  gap: 8px;
  flex: 0 0 auto;
}
#typetog button {
  border: 1px solid var(--line2);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 15px;
  color: var(--dim);
  font-size: 13.5px;
}
#typetog button svg {
  width: 15px;
  height: 15px;
}
#typetog button .tc {
  font-size: 11px;
  color: var(--faint);
  background: var(--bg2);
  padding: 1px 7px;
  border-radius: 999px;
}
#typetog button.on {
  background: rgba(58, 216, 208, 0.14);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow:
    0 0 0 1px rgba(58, 216, 208, 0.25),
    0 0 16px rgba(58, 216, 208, 0.18);
}
#typetog button.on .tc {
  color: var(--cyan);
  background: rgba(58, 216, 208, 0.16);
}
/* list/grid toggle (icon-based) */
#vtable.on,
#vgrid.on {
  background: var(--line2);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1px;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent);
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
  user-select: none;
  font-family: inherit;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip:hover {
  border-color: var(--cc, var(--line2));
  color: var(--txt);
}
.chip .c {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  color: var(--faint);
  background: var(--bg2);
  padding: 1px 7px;
  border-radius: 999px;
}
.chip.on {
  box-shadow: 0 0 0 1px currentColor inset;
}
.chip[data-cat="ALL"].on {
  background: var(--txt);
  border-color: var(--txt);
  color: #0a0b0d;
}
.chip[data-cat="ALL"].on .c {
  background: rgba(0, 0, 0, 0.16);
  color: #0a0b0d;
}
.chip.more {
  color: var(--dim);
}
.chip.more svg {
  width: 14px;
  height: 14px;
}

/* ---- MAIN ---- */
main {
  padding: 14px 26px calc(var(--pbh) + 40px);
  flex: 1;
}
.catlabel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 8px;
  cursor: pointer;
  user-select: none;
}
.catlabel:first-child {
  margin-top: 4px;
}
.catlabel .catchev {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    color 0.15s;
}
.catlabel:hover .catchev {
  color: var(--txt);
}
.catlabel.collapsed .catchev {
  transform: rotate(-90deg);
}
.catlabel .catchev svg {
  width: 14px;
  height: 14px;
}
.catlabel .dotc {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  box-shadow: 0 0 8px currentColor;
}
.catlabel h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.catlabel.collapsed h2 {
  opacity: 0.62;
}
.catlabel .n {
  font-size: 12px;
  color: var(--faint);
}
.catlabel .bar {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.catbody.collapsed {
  display: none;
}

/* ---- TABLE ---- */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
thead th {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--line2);
}
thead th.nosort {
  cursor: default;
}
thead th:not(.nosort):hover {
  color: var(--txt);
}
thead th .ar {
  color: var(--cyan);
  font-family: "Space Mono", monospace;
  margin-left: 3px;
}
col.c-sel {
  width: 34px;
}
col.c-fav {
  width: 36px;
}
col.c-play {
  width: 46px;
}
col.c-name {
  width: 21%;
}
col.c-wave {
  width: 38%;
}
col.c-dur {
  width: 78px;
}
col.c-cat {
  width: 120px;
}
col.c-added {
  width: 128px;
}
col.c-menu {
  width: 78px;
}
/* delete button: hidden until row hover, reveals beside the ⋯ menu, reddens on hover */
.delbtn {
  opacity: 0;
  pointer-events: none;
}
tr:hover .delbtn,
.card:hover .delbtn {
  opacity: 1;
  pointer-events: auto;
}
.delbtn:hover {
  color: var(--rose);
  background: color-mix(in srgb, var(--rose) 14%, transparent);
}
/* toast */
#sc-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 12px);
  background: var(--panel);
  color: var(--txt);
  border: 1px solid var(--rose);
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 9999;
}
#sc-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
  cursor: pointer;
}
tbody tr:hover {
  background: var(--panel);
}
tbody tr.playing {
  background: linear-gradient(90deg, rgba(58, 216, 208, 0.1), rgba(58, 216, 208, 0.03));
  box-shadow: inset 2px 0 0 var(--cyan);
}
tbody tr.previewing {
  background: rgba(255, 178, 62, 0.05);
}
tbody tr.selected {
  background: rgba(58, 216, 208, 0.06);
}

/* ---------- multi-select ---------- */
td.sel {
  text-align: center;
}
.selbox {
  appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--line2);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.12s;
}
.selbox:hover {
  border-color: var(--cyan);
}
.selbox:checked {
  background: var(--cyan);
  border-color: var(--cyan);
}
/* checkmark drawn with a rotated box-edge — avoids shipping another icon */
.selbox:checked::after {
  content: "";
  display: block;
  width: 4px;
  height: 8px;
  margin: 0 auto;
  border: solid #0d1013;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
/* card checkbox floats top-left, mirroring .cardacts top-right */
.cardsel {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  opacity: 0;
}
.card:hover .cardsel,
.cardsel:checked,
.card.selected .cardsel {
  opacity: 1;
}
.card.selected {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(58, 216, 208, 0.35);
}

/* floating bulk-action bar — sits above the player bar */
#selbar {
  position: fixed;
  left: 50%;
  bottom: 122px;
  transform: translateX(-50%);
  z-index: 180;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 13px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  animation: collpop-in 0.14s ease;
}
.selbar-n {
  font-size: 12.5px;
  color: var(--cyan);
  font-weight: 700;
}
.selbar-sp {
  width: 6px;
}
.selbar-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: none;
  color: var(--txt);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
}
.selbar-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.selbar-btn.prime {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #0d1013;
}
.selbar-btn.prime:hover {
  filter: brightness(1.08);
  color: #0d1013;
}
.selbar-btn:disabled {
  opacity: 0.65;
  cursor: default;
}
.selbar-btn svg {
  width: 15px;
  height: 15px;
}
td {
  padding: 5px 10px;
  vertical-align: middle;
  font-size: 14px;
}
td.fav {
  text-align: center;
}
.star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--faint);
  transition:
    transform 0.1s,
    color 0.12s;
  opacity: 0.55;
}
tr:hover .star,
.card:hover .star {
  opacity: 1;
}
.star:hover {
  transform: scale(1.25);
  color: var(--gold);
}
.star.on {
  color: var(--gold);
  opacity: 1;
}
.pbtn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  background: var(--bg2);
  color: var(--txt);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.14s;
}
.pbtn svg {
  width: 13px;
  height: 13px;
  margin-left: 1px;
}
.pbtn:hover {
  transform: scale(1.08);
}
tr:hover .pbtn {
  border-color: var(--cyan);
  color: var(--cyan);
}
tr.playing .pbtn {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #062321;
  box-shadow: 0 0 14px rgba(58, 216, 208, 0.4);
}
tr.playing .pbtn svg {
  margin-left: 0;
}
.nm {
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.12s;
  display: inline-block;
  max-width: 100%;
}
tr:hover .nm,
tr.playing .nm,
.card:hover .nm {
  color: var(--cyan);
}
.nm .badge {
  font-family: "Space Mono", monospace;
  font-size: 8.5px;
  font-weight: 700;
  color: #062321;
  background: var(--cyan);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 7px;
  vertical-align: middle;
}
.twave {
  position: relative;
  height: 30px;
  cursor: pointer;
}
.twave canvas {
  height: 100%;
  display: block;
}
td.dur,
td.added {
  font-size: 11px;
  color: var(--dim);
}
td.cat .pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  display: inline-block;
}
td.added .agox {
  color: var(--faint);
  font-size: 10px;
  margin-top: 1px;
}
.menu {
  text-align: center;
}
.mbtn {
  opacity: 0;
}
tr:hover .mbtn {
  opacity: 1;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  left: 0;
  opacity: 0;
  pointer-events: none;
}
.playing .playhead,
.previewing .playhead {
  opacity: 1;
}
.previewing .playhead {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

/* ---- GRID ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 11px;
}
.card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 13px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.16s,
    transform 0.12s,
    box-shadow 0.16s;
}
.card:hover {
  border-color: var(--line2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.card.playing {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 1px var(--cyan),
    0 8px 30px rgba(58, 216, 208, 0.18);
}
.cardtop {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.card .cmeta {
  min-width: 0;
  flex: 1;
}
.card .sub {
  font-size: 10px;
  color: var(--dim);
  margin-top: 2px;
  display: flex;
  gap: 9px;
}
.card .pbtn {
  width: 38px;
  height: 38px;
}
.card .pbtn svg {
  width: 15px;
  height: 15px;
}
.card .twave {
  height: 54px;
}
.card .cstar {
  position: static;
}

.empty {
  text-align: center;
  color: var(--dim);
  padding: 80px 20px;
  font-size: 14px;
}

/* ============ PLAYER BAR ============ */
#playerbar {
  position: fixed;
  bottom: 14px;
  left: 16px;
  right: 16px;
  height: var(--pbh);
  z-index: 30;
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  background: rgba(16, 19, 24, 0.97);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line2);
  border-radius: 18px;
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.3);
}
#playerbar.empty .pb-actions {
  opacity: 0.45;
}
/* hover-scrub works with nothing playing — keep its toggle live on the empty bar */
#playerbar.empty .pb-actions #pbScrub {
  opacity: 1;
}
#playerbar.empty .pb-title {
  color: var(--dim);
}
#playerbar.empty .pb-thumb {
  color: var(--faint);
  background: var(--panel) !important;
}
#playerbar.empty .pb-transport .tp {
  opacity: 0.5;
}

.pb-track {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.pb-thumb {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  padding: 12px;
  flex: 0 0 auto;
  color: #0a0b0d;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.pb-meta {
  min-width: 0;
}
.pb-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pb-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}
.pb-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
}
.pb-time {
  font-size: 12px;
  color: var(--dim);
}

.pb-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
.pb-transport {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tp svg {
  width: 16px;
  height: 16px;
}
.tp.act {
  color: var(--cyan);
}
.tp.act svg {
  filter: drop-shadow(0 0 5px rgba(58, 216, 208, 0.6));
}
.pb-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--cyan);
  color: #062321;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.14s;
  box-shadow: 0 0 18px rgba(58, 216, 208, 0.4);
}
.pb-play svg {
  width: 18px;
  height: 18px;
}
.pb-play:hover {
  transform: scale(1.06);
}
.pb-play.on {
  box-shadow:
    0 0 0 4px rgba(58, 216, 208, 0.18),
    0 0 22px rgba(58, 216, 208, 0.5);
}
.pb-scrub {
  width: 100%;
  max-width: 680px;
}
.pbwave {
  height: 30px;
}

.pb-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}
.pb-vol {
  -webkit-appearance: none;
  appearance: none;
  width: 88px;
  height: 4px;
  border-radius: 999px;
  background: var(--line2);
  outline: none;
  cursor: pointer;
}
.pb-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(58, 216, 208, 0.5);
  cursor: pointer;
}
.pb-vol::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
}

@media (max-width: 1100px) {
  #playerbar {
    grid-template-columns: 1fr auto 1fr;
  }
  .pb-actions .pb-vol {
    width: 60px;
  }
}
@media (max-width: 820px) {
  :root {
    --side: 0px;
  }
  #sidebar {
    display: none;
  }
  .app {
    grid-template-columns: 1fr;
  }
}

/* ============ COLLECTIONS ============ */
.collhead {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 22px;
}
.collhead .collh {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.collhead.open {
  gap: 12px;
}
.collhead .collh-n {
  font-size: 12px;
  color: var(--dim);
}
.btn-prime {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 10px 16px;
  border: 1px solid rgba(58, 216, 208, 0.3);
  border-radius: 11px;
  background: rgba(58, 216, 208, 0.12);
  color: var(--cyan);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s;
}
.btn-prime:hover {
  background: rgba(58, 216, 208, 0.2);
  box-shadow: 0 0 22px rgba(58, 216, 208, 0.18);
}
.btn-prime svg {
  width: 16px;
  height: 16px;
}
.btn-prime.lg {
  margin: 16px 0 0;
  padding: 12px 20px;
  font-size: 15px;
}
.backbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--panel);
  color: var(--dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.backbtn:hover {
  color: var(--txt);
  border-color: var(--cyan);
}
.backbtn svg {
  width: 16px;
  height: 16px;
  transform: rotate(90deg);
}

.collgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.collcard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  cursor: pointer;
  transition: all 0.16s;
}
.collcard:hover {
  border-color: var(--line2);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.collcard-ic {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(58, 216, 208, 0.12);
  color: var(--cyan);
}
.collcard-ic svg {
  width: 22px;
  height: 22px;
}
.collcard-body {
  flex: 1;
  min-width: 0;
}
.collcard-name {
  font-size: 15.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collcard-n {
  font-size: 12px;
  color: var(--dim);
  margin-top: 3px;
}
.collcard-acts {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.14s;
}
.collcard:hover .collcard-acts {
  opacity: 1;
}
.collcard-acts .iconbtn {
  width: 30px;
  height: 30px;
}
.collcard-acts svg {
  width: 15px;
  height: 15px;
}
.collcard-acts .cc-del:hover {
  color: var(--rose);
}

.collempty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 70px 20px;
  color: var(--dim);
}
.collempty-ic {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--faint);
  margin-bottom: 6px;
}
.collempty-ic svg {
  width: 28px;
  height: 28px;
}
.collempty p {
  margin: 0;
  font-size: 15px;
}

/* grid-card "add to collection" cluster */
.cardacts {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 2px;
  z-index: 3;
}
.cardacts .iconbtn {
  width: 28px;
  height: 28px;
}
.cardacts .caddbtn svg {
  width: 15px;
  height: 15px;
}
.cardacts .caddbtn:hover {
  color: var(--cyan);
}

/* "add to collection" popover */
.collpop {
  position: fixed;
  z-index: 200;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 13px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  padding: 8px;
  animation: collpop-in 0.12s ease;
}
@keyframes collpop-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
/* action row at the top of the popover (Download) */
.collpop-act {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 8px;
  color: var(--txt);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s;
  /* <button> variants otherwise pick up UA defaults (grey fill, system font) */
  width: 100%;
  background: none;
  border: 0;
  font-family: inherit;
  text-align: left;
}
.collpop-act:hover {
  background: var(--panel);
  color: var(--cyan);
}
.collpop-act svg {
  width: 15px;
  height: 15px;
}
.collpop-hd {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 6px 8px 8px;
}
.collpop-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 240px;
  overflow-y: auto;
}
.collpop-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--txt);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}
.collpop-row:hover {
  background: var(--panel);
}
.collpop-check {
  width: 16px;
  flex: 0 0 auto;
  color: var(--cyan);
  font-weight: 700;
}
.collpop-row.on {
  color: #fff;
}
.collpop-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collpop-n {
  font-size: 11px;
  color: var(--faint);
}
.collpop-none {
  padding: 10px 9px;
  font-size: 13px;
  color: var(--faint);
}
.collpop-new {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 9px;
  border: 1px dashed var(--line2);
  border-radius: 9px;
  background: none;
  color: var(--cyan);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
}
.collpop-new:hover {
  background: rgba(58, 216, 208, 0.08);
  border-color: var(--cyan);
}
.collpop-new svg {
  width: 15px;
  height: 15px;
}
