:root {
  --bg: #0b0b0f;
  --bg2: #14141b;
  --bg3: #1d1d26;
  --surface: rgba(255, 255, 255, 0.07);
  --surface2: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f5f5f7;
  --text2: rgba(245, 245, 247, 0.68);
  --text3: rgba(245, 245, 247, 0.4);
  --accent: #fa243c;
  --accent2: #ff5a7a;
  --radius: 18px;
  --radius-sm: 12px;
  --player-h: 74px;
  --font: -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ui-safe-top: 24px;
  --ui-safe-list-top: 24px;
  --dyn1: rgba(250, 36, 60, 0.34);
  --dyn2: rgba(16, 18, 30, 0.94);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7fb;
    --bg2: #f1f1f7;
    --bg3: #e7e7ee;
    --surface: rgba(255, 255, 255, 0.52);
    --surface2: rgba(255, 255, 255, 0.72);
    --border: rgba(15, 19, 35, 0.09);
    --text: #13131a;
    --text2: rgba(19, 19, 26, 0.7);
    --text3: rgba(19, 19, 26, 0.45);
    --dyn1: rgba(250, 36, 60, 0.22);
    --dyn2: rgba(255, 255, 255, 0.78);
    --shadow: 0 24px 65px rgba(48, 58, 72, 0.14);
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;
  inset: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
}

input,
textarea {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#dyn-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 12%, var(--dyn1), transparent 42%),
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(160deg, var(--dyn2), var(--bg));
  transition: background 1.2s ease;
}

#dyn-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 88%, rgba(255, 255, 255, 0.05), transparent 20%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.28));
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  z-index: 1;
}

.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 0.5px solid var(--border);
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
}

#sidebar {
  position: fixed;
  inset: max(14px, var(--safe-t)) auto max(14px, calc(14px + var(--safe-b))) 14px;
  width: 280px;
  padding: 24px 18px 24px;
  border-radius: 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateX(calc(-100% - 22px));
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 40;
}

#sidebar.open {
  transform: translateX(0);
}

.sidebar-top {
  padding: 4px 6px 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: "Avenir Next", var(--font);
  font-size: 28px;
  font-weight: 800;
  color: white;
  background: linear-gradient(145deg, var(--accent), var(--accent2));
  box-shadow: 0 12px 30px rgba(250, 36, 60, 0.38);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text3);
}

#sidebar h1 {
  margin: 0;
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  font-family: "Avenir Next", var(--font);
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-label {
  margin: 0 8px 2px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text3);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 15px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text2);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-btn:active {
  transform: scale(0.97);
}

.nav-btn.active {
  color: #fff;
  background: linear-gradient(145deg, rgba(250, 36, 60, 0.9), rgba(255, 90, 122, 0.7));
}

.playlist-list {
  display: grid;
  gap: 8px;
}

#sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 12, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 32;
}

#sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

#main-pane {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: calc(var(--ui-safe-top) + 8px) 14px calc(var(--safe-b) + 22px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

#page-title,
.view-head h3 {
  margin: 0;
  font-family: "Avenir Next", var(--font);
  font-size: clamp(32px, 5vw, 40px);
  line-height: 1;
  font-weight: 800;
}

.view-head h3 {
  font-size: clamp(26px, 4vw, 34px);
}

.icon-btn,
.pill-btn,
.chip-btn,
.text-btn {
  cursor: pointer;
}

.icon-btn {
  min-width: 42px;
  min-height: 42px;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: var(--surface);
  border: 0.5px solid var(--border);
}

.icon-btn.ghost {
  background: transparent;
}

.icon-btn.frosted {
  background: rgba(255, 255, 255, 0.12);
}

.icon-btn.compact {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 14px;
}

#menu-btn {
  width: 46px;
  height: 46px;
  gap: 4px;
}

#menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.pill-btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--surface);
  color: var(--text);
}

.pill-btn.accent {
  background: linear-gradient(145deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 14px 30px rgba(250, 36, 60, 0.28);
}

.pill-btn.flex-1 {
  flex: 1;
}

.chip-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text2);
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid var(--border);
  font-weight: 600;
}

.chip-btn.active,
.chip-btn[data-state="on"] {
  color: #fff;
  background: linear-gradient(145deg, rgba(250, 36, 60, 0.36), rgba(255, 90, 122, 0.2));
  border-color: rgba(250, 36, 60, 0.4);
}

.chip-btn.danger {
  color: #fff;
  background: rgba(250, 36, 60, 0.18);
  border-color: rgba(250, 36, 60, 0.28);
}

.text-btn {
  min-height: 38px;
  padding: 0;
  color: var(--text2);
  font-weight: 600;
}

#search-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

#search-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px 0 52px;
  border: 0;
  outline: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23ffffff' stroke-opacity='.45' stroke-width='1.75' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E")
      no-repeat 18px center,
    transparent;
  color: var(--text);
}

#search-input::placeholder {
  color: var(--text3);
}

#content-area {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-bottom: calc(var(--player-h) + 24px + var(--safe-b));
}

.view {
  display: none;
  height: 100%;
  overflow: auto;
  padding: 4px 2px 0;
  scrollbar-width: none;
}

.view.active {
  display: block;
}

.view::-webkit-scrollbar,
.detail-list::-webkit-scrollbar,
.queue-list::-webkit-scrollbar {
  display: none;
}

.view-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin: 0 6px 18px;
}

.view-meta {
  margin: 0;
  color: var(--text3);
  font-size: 12px;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 0.5px solid var(--border);
}

.segmented.small {
  gap: 4px;
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 700;
}

.segmented.small button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.segmented button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

@media (min-width: 834px) {
  .albums-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

.album-card,
.cta-card,
.playlist-card {
  position: relative;
  border-radius: 24px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, background 0.18s ease;
}

.album-card:active,
.cta-card:active,
.playlist-card:active {
  transform: scale(0.95);
}

.album-art-card,
.art-tile {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 20px;
  object-fit: cover;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}

.album-meta,
.playlist-copy {
  padding: 10px 4px 2px;
}

.album-meta h4,
.playlist-copy h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}

.album-meta p,
.playlist-copy p,
.song-sub,
.artist-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text2);
}

.drop-zone {
  min-height: 280px;
  border-radius: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 26px;
  background: rgba(255, 255, 255, 0.03);
}

.drop-zone h4 {
  margin: 0 0 8px;
  font-size: 24px;
}

.drop-zone p {
  margin: 0;
  color: var(--text2);
}

.songs-list,
.artists-list,
.playlists-list,
.detail-list,
.picker-list,
.queue-list {
  display: grid;
}

.song-row,
.artist-row,
.playlist-row,
.picker-row,
.detail-track-row,
.queue-row {
  position: relative;
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}

.song-row,
.detail-track-row,
.picker-row {
  grid-template-columns: auto 1fr auto;
}

.song-row.current,
.detail-track-row.current,
.queue-row.current {
  background: rgba(250, 36, 60, 0.08);
}

.song-row.current .song-title,
.detail-track-row.current .song-title,
.queue-row.current .queue-title {
  color: var(--accent);
}

.row-art {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  position: relative;
}

.row-art.small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.row-art img,
.art-fallback img,
.detail-art img,
.player-art img,
.mini-art img,
.queue-current-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-copy {
  min-width: 0;
  text-align: left;
}

.song-title,
.queue-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 600;
}

.song-sub,
.queue-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-side {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text3);
  font-size: 12px;
}

.icon-btn.mini {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 12px;
}

.eq-bars {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(250, 36, 60, 0.5);
}

.song-row.current .eq-bars {
  display: flex;
}

.eq-bars span {
  width: 3px;
  border-radius: 999px;
  background: #fff;
  animation: eq 0.9s infinite ease-in-out;
}

.eq-bars span:nth-child(1) { height: 12px; animation-delay: 0s; }
.eq-bars span:nth-child(2) { height: 18px; animation-delay: 0.12s; }
.eq-bars span:nth-child(3) { height: 10px; animation-delay: 0.24s; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.4); opacity: 0.8; }
  50% { transform: scaleY(1); opacity: 1; }
}

.artist-row,
.playlist-row {
  grid-template-columns: auto 1fr auto;
}

.artist-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.cta-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
}

.cta-card h4 {
  margin: 0;
  font-size: 20px;
}

.cta-card p {
  margin: 0;
  color: var(--text2);
}

#mini-player {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(var(--safe-b) + 14px);
  height: var(--player-h);
  border-radius: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  z-index: 60;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

#mini-player.hidden {
  opacity: 0;
  transform: translateY(120%);
  pointer-events: none;
}

.mini-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mini-art,
.detail-art,
.queue-current-art {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
}

.mini-copy {
  min-width: 0;
}

.mini-copy p {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#mini-title {
  font-size: 14px;
  font-weight: 700;
}

#mini-artist {
  font-size: 12px;
  color: var(--text2);
}

.mini-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn.transport::before,
#player-close::before,
#player-queue-toggle::before,
#love-btn::before,
#mute-btn::before,
.detail-close::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

#mini-prev::before,
#prev-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5f5f7'%3E%3Cpath d='M7 5h2v14H7zM18.5 6.5l-8 5.5 8 5.5z'/%3E%3C/svg%3E");
}

#mini-next::before,
#next-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5f5f7'%3E%3Cpath d='M15 5h2v14h-2zM5.5 17.5l8-5.5-8-5.5z'/%3E%3C/svg%3E");
}

#mini-play::before,
#play-btn::before,
#queue-current-play::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230b0b0f'%3E%3Cpath d='m8 5 11 7-11 7z'/%3E%3C/svg%3E");
}

#mini-play.playing::before,
#play-btn.playing::before,
#queue-current-play.playing::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230b0b0f'%3E%3Cpath d='M8 5h3v14H8zM13 5h3v14h-3z'/%3E%3C/svg%3E");
}

#rewind-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5f5f7'%3E%3Cpath d='M11.9 5.4 4.8 12l7.1 6.6v-4.4c3.4 0 5.9 1.1 7.8 3.8-.4-4.9-2.7-8.5-7.8-9.2z'/%3E%3C/svg%3E");
}

#forward-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5f5f7'%3E%3Cpath d='m12.1 5.4 7.1 6.6-7.1 6.6v-4.4c-3.4 0-5.9 1.1-7.8 3.8.4-4.9 2.7-8.5 7.8-9.2z'/%3E%3C/svg%3E");
}

#player-close::before,
.detail-close::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

#player-queue-toggle::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M5 7h14M5 12h14M5 17h9'/%3E%3C/svg%3E");
}

#love-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 20-1.2-1.1C6 14.5 3 11.8 3 8.5A4.5 4.5 0 0 1 7.5 4C9.2 4 10.8 4.8 12 6c1.2-1.2 2.8-2 4.5-2A4.5 4.5 0 0 1 21 8.5c0 3.3-3 6-7.8 10.4z'/%3E%3C/svg%3E");
}

#love-btn.active::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fa243c'%3E%3Cpath d='m12 21-1.45-1.32C5.4 15.03 2 11.97 2 8.23 2 5.17 4.42 3 7.4 3 9.1 3 10.74 3.81 12 5.09 13.26 3.8 14.9 3 16.6 3 19.58 3 22 5.17 22 8.23c0 3.74-3.4 6.8-8.55 11.46z'/%3E%3C/svg%3E");
}

#mute-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4zM15.5 8.5a5 5 0 0 1 0 7'/%3E%3C/svg%3E");
}

#mute-btn.muted::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4zM16 9l5 5M21 9l-5 5'/%3E%3C/svg%3E");
}

.icon-btn.transport.filled,
.heart-btn.active {
  background: #fff;
  color: var(--bg);
}

.icon-btn.transport.large {
  width: 64px;
  min-width: 64px;
  min-height: 64px;
  border-radius: 50%;
}

#mini-progress,
#queue-progress-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px;
}

.sheet-element {
  position: fixed;
  inset: 0;
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.sheet-element.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#player-sheet {
  z-index: 200;
}

.player-bg,
.player-overlay {
  position: absolute;
  inset: 0;
}

.player-bg {
  background:
    radial-gradient(circle at 18% 15%, var(--dyn1), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    linear-gradient(160deg, var(--dyn2), var(--bg));
}

.player-overlay {
  background: rgba(0, 0, 0, 0.35);
}

.player-shell {
  position: relative;
  height: 100%;
  padding: calc(var(--ui-safe-top) + 4px) 16px calc(var(--safe-b) + 18px);
  display: flex;
  flex-direction: column;
}

.player-handle-wrap {
  display: flex;
  justify-content: center;
  padding-bottom: 8px;
}

.player-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.player-status {
  text-align: center;
}

.player-status strong {
  font-size: 13px;
  font-weight: 700;
}

.player-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 18px;
}

.player-now {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.player-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
  align-self: center;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}

.player-tabs button {
  min-height: 34px;
  min-width: 104px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--text2);
  font-weight: 700;
}

.player-tabs button.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.player-media-stack {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  flex: 1;
  padding: 18px 0 10px;
}

.tab-panel {
  display: none;
  width: 100%;
  height: 100%;
}

.tab-panel.active {
  display: grid;
}

.player-art-shell {
  place-items: center;
}

.player-art {
  width: min(72vw, 300px);
  height: min(72vw, 300px);
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.4s ease;
}

.player-art.playing {
  animation: artPulse 6s ease-in-out infinite;
}

@keyframes artPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.player-art.paused {
  transform: scale(0.9);
}

.lyrics-panel {
  align-items: stretch;
}

#lyrics-editor {
  width: 100%;
  height: 100%;
  min-height: 220px;
  resize: none;
  border-radius: 24px;
  border: 0.5px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  padding: 20px;
  outline: none;
}

.player-info {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.player-info h3 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 800;
}

.player-info p {
  margin: 0;
  color: var(--accent2);
  font-size: 15px;
}

.seek-wrap {
  padding-top: 14px;
}

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent) 0 var(--seek-pct, 0%), rgba(255, 255, 255, 0.14) var(--seek-pct, 0%) 100%);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--text2);
  font-size: 12px;
  margin-top: 6px;
}

.transport-wrap {
  display: grid;
  gap: 14px;
  align-items: center;
  padding-top: 12px;
}

.transport-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.volume-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
}

.player-actions {
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

.player-queue {
  border-radius: 28px;
  padding: 18px 14px 6px;
  min-height: 180px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  overflow: hidden;
}

.queue-current {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.queue-current-art {
  width: 60px;
  height: 60px;
  border-radius: 16px;
}

.queue-current-copy h4,
.queue-head h4 {
  margin: 0 0 4px;
  font-size: 18px;
}

.queue-current-copy p,
.queue-head p,
#queue-meta {
  margin: 0;
  color: var(--text2);
  font-size: 12px;
}

.queue-progress-line {
  grid-column: 1 / -1;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.queue-list {
  overflow: auto;
}

.queue-row {
  grid-template-columns: 28px auto 1fr auto auto;
}

.queue-index,
.queue-duration {
  color: var(--text3);
  font-size: 12px;
}

.drag-handle {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--text3);
}

.drag-handle::before {
  content: "⋮⋮";
  letter-spacing: -2px;
}

.queue-row.drag-over {
  background: rgba(255, 255, 255, 0.08);
}

.queue-drag-clone {
  position: fixed;
  z-index: 420;
  width: min(300px, 70vw);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0.9;
  box-shadow: var(--shadow);
}

[data-stage="0"] .player-queue {
  display: none;
}

[data-stage="1"] .player-queue,
[data-stage="2"] .player-queue {
  display: grid;
}

[data-stage="1"] .player-body {
  grid-template-rows: minmax(0, 58%) minmax(220px, 42%);
}

[data-stage="1"] .player-media-stack {
  padding-top: 8px;
}

[data-stage="2"] .player-body {
  grid-template-rows: auto 1fr;
}

[data-stage="2"] .player-now {
  border-radius: 24px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}

[data-stage="2"] .player-tabs,
[data-stage="2"] .player-actions {
  display: none;
}

[data-stage="2"] .player-media-stack {
  flex: none;
  padding: 0;
}

[data-stage="2"] .player-art {
  width: 82px;
  height: 82px;
  border-radius: 18px;
}

[data-stage="2"] .tab-panel[data-tab-panel="lyrics"] {
  display: none !important;
}

[data-stage="2"] .player-now {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "art info play"
    "seek seek seek";
  align-items: center;
  gap: 14px;
}

[data-stage="2"] .player-media-stack { grid-area: art; }
[data-stage="2"] .player-info { grid-area: info; }
[data-stage="2"] .transport-wrap { grid-area: play; padding-top: 0; }
[data-stage="2"] .seek-wrap { grid-area: seek; padding-top: 0; }
[data-stage="2"] .volume-wrap { display: none; }
[data-stage="2"] .transport-cluster { gap: 8px; }
[data-stage="2"] .transport-cluster .icon-btn:not(.filled.large) { display: none; }
[data-stage="2"] .transport-cluster .filled.large {
  width: 52px;
  min-width: 52px;
  min-height: 52px;
}

[data-layout="landscape"] #main-pane {
  padding-top: calc(var(--ui-safe-top) + 2px);
}

[data-layout="landscape"][data-wide="true"] #sidebar {
  transform: translateX(0);
}

[data-layout="landscape"][data-wide="true"] #sidebar-backdrop,
[data-layout="landscape"][data-wide="true"] #menu-btn {
  display: none;
}

[data-layout="landscape"][data-wide="true"] #main-pane {
  margin-left: 306px;
}

[data-layout="landscape"][data-wide="true"] #mini-player {
  left: calc(280px + 22px);
}

[data-layout="landscape"] #player-sheet[data-stage="0"] .player-body {
  grid-template-rows: 1fr;
}

[data-layout="landscape"] #player-sheet[data-stage="0"] .player-now {
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
}

[data-layout="landscape"] #player-sheet[data-stage="0"] .player-art {
  width: min(46vh, 340px);
  height: min(46vh, 340px);
}

[data-layout="landscape"] #player-sheet[data-stage="1"] .player-body,
[data-layout="landscape"] #player-sheet[data-stage="2"] .player-body {
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  grid-template-rows: 1fr;
  align-items: stretch;
}

[data-layout="landscape"] #player-sheet[data-stage="1"] .player-queue {
  display: none;
}

[data-layout="landscape"] #player-sheet[data-stage="1"] .player-now {
  display: grid;
  grid-template-columns: minmax(220px, 38%) 1fr;
  grid-template-areas:
    "tabs tabs"
    "media info"
    "media seek"
    "media controls"
    "media actions";
  align-items: center;
  gap: 18px;
}

[data-layout="landscape"] #player-sheet[data-stage="1"] .player-tabs { grid-area: tabs; justify-self: start; }
[data-layout="landscape"] #player-sheet[data-stage="1"] .player-media-stack { grid-area: media; padding: 0; }
[data-layout="landscape"] #player-sheet[data-stage="1"] .player-info { grid-area: info; align-self: end; }
[data-layout="landscape"] #player-sheet[data-stage="1"] .seek-wrap { grid-area: seek; }
[data-layout="landscape"] #player-sheet[data-stage="1"] .transport-wrap { grid-area: controls; padding-top: 0; }
[data-layout="landscape"] #player-sheet[data-stage="1"] .player-actions { grid-area: actions; justify-content: flex-start; }
[data-layout="landscape"] #player-sheet[data-stage="1"] .volume-wrap { display: none; }
[data-layout="landscape"] #player-sheet[data-stage="2"] .player-queue { display: grid; }

.detail-sheet {
  z-index: 190;
}

.sheet-surface {
  position: absolute;
  inset: auto 0 0;
  min-height: 60vh;
  max-height: 92vh;
  border-radius: 30px 30px 0 0;
  padding: 12px 18px calc(var(--safe-b) + 18px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-drag {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  align-self: center;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.detail-head.compact {
  align-items: center;
}

.detail-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  flex: 1;
}

.detail-summary h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.detail-summary p {
  margin: 0;
  color: var(--text2);
  font-size: 13px;
}

.detail-art {
  width: 70px;
  height: 70px;
  border-radius: 12px;
}

.detail-art.clickable {
  cursor: pointer;
}

.playlist-meta-edit {
  display: grid;
  gap: 8px;
}

#playlist-name-input {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 0.5px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  padding: 0 12px;
  outline: none;
  font-weight: 700;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-add-row {
  padding-top: 4px;
}

#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#loading-overlay.hidden {
  display: none;
}

.loading-card {
  width: min(360px, calc(100vw - 32px));
  border-radius: 28px;
  padding: 22px;
  text-align: center;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading-file,
#loading-meta {
  color: var(--text2);
}

.loading-progress {
  margin: 14px 0 8px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

#loading-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + 30px + var(--safe-b));
  transform: translateX(-50%) translateY(20px);
  min-width: 180px;
  max-width: calc(100vw - 32px);
  padding: 14px 18px;
  border-radius: 22px;
  background: var(--bg2);
  color: var(--text);
  border: 0.5px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 500;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.art-fallback {
  font-weight: 800;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.84);
  background:
    linear-gradient(145deg, rgba(250, 36, 60, 0.42), rgba(255, 90, 122, 0.16)),
    rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
  #main-header {
    align-items: center;
  }

  .header-right {
    gap: 8px;
  }

  .segmented {
    overflow: auto;
    max-width: 100%;
  }

  .detail-actions {
    overflow: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
}

:root {
  --bg: #05070c;
  --bg2: #0f131b;
  --bg3: #171d28;
  --surface: rgba(255, 255, 255, 0.08);
  --surface2: rgba(255, 255, 255, 0.15);
  --border: rgba(255, 255, 255, 0.14);
  --accent: #ff5f6d;
  --accent2: #ffb36b;
  --dyn1: rgba(255, 108, 102, 0.35);
  --dyn2: rgba(10, 15, 28, 0.96);
  --shadow: 0 36px 100px rgba(3, 7, 18, 0.42);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-fluid: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f7fb;
    --bg2: #ecf1f8;
    --bg3: #e2e8f2;
    --surface: rgba(255, 255, 255, 0.68);
    --surface2: rgba(255, 255, 255, 0.84);
    --border: rgba(32, 44, 68, 0.1);
    --accent: #ff5f6d;
    --accent2: #ff9a56;
    --dyn1: rgba(255, 124, 112, 0.22);
    --dyn2: rgba(250, 251, 255, 0.9);
    --shadow: 0 32px 80px rgba(28, 38, 62, 0.14);
  }
}

#dyn-bg {
  background-size: 135% 135%, 120% 120%, 100% 100%;
  animation: ambientShift 20s ease-in-out infinite;
}

#dyn-bg::before {
  content: "";
  position: absolute;
  inset: -15%;
  background:
    radial-gradient(circle at 24% 72%, rgba(255, 255, 255, 0.16), transparent 18%),
    radial-gradient(circle at 74% 28%, rgba(255, 255, 255, 0.1), transparent 22%);
  filter: blur(32px);
  animation: orbFloat 22s ease-in-out infinite;
}

.glass {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow);
  backdrop-filter: blur(44px) saturate(170%);
  -webkit-backdrop-filter: blur(44px) saturate(170%);
}

#sidebar {
  width: 296px;
  padding: 26px 18px 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    rgba(10, 15, 26, 0.38);
  transition: transform 0.5s var(--ease-spring), opacity 0.35s ease;
}

.brand-mark {
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 95, 109, 0.96), rgba(255, 179, 107, 0.84));
  box-shadow: 0 18px 34px rgba(255, 95, 109, 0.32);
}

.nav-group {
  gap: 10px;
}

.nav-btn {
  position: relative;
  min-height: 50px;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  overflow: hidden;
}

.nav-btn::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
  background: linear-gradient(145deg, rgba(255, 95, 109, 0.9), rgba(255, 179, 107, 0.64));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 32px rgba(255, 95, 109, 0.22);
}

.nav-btn.active::after {
  opacity: 1;
  transform: scale(1);
}

#main-header,
#search-wrap,
.view-head,
.spotlight-hero,
.stat-tile,
.album-card,
.song-row,
.artist-row,
.playlist-row,
.picker-row,
.detail-track-row,
.queue-row {
  animation: riseIn 0.8s var(--ease-fluid) both;
  animation-delay: calc(var(--stagger, 0) * 42ms);
}

#main-header,
#search-wrap,
.view-head {
  animation-delay: 0ms;
}

.header-right {
  gap: 10px;
}

.header-tool {
  width: 46px;
  height: 46px;
}

.pill-btn,
.chip-btn,
.text-btn,
.player-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    transform 0.22s var(--ease-spring),
    background 0.24s ease,
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    color 0.24s ease;
}

.pill-btn:hover,
.chip-btn:hover,
.text-btn:hover,
.icon-btn:hover,
.player-tabs button:hover,
.stat-tile:hover,
.album-card:hover,
.song-row:hover,
.artist-row:hover,
.playlist-row:hover,
.picker-row:hover,
.detail-track-row:hover,
.queue-row:hover {
  transform: translateY(-2px);
}

.pill-btn.accent {
  background: linear-gradient(145deg, rgba(255, 95, 109, 0.96), rgba(255, 179, 107, 0.86));
  box-shadow: 0 16px 38px rgba(255, 95, 109, 0.28);
}

.chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text2);
}

.chip-btn.active,
.chip-btn[data-state="on"] {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.14);
}

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

#search-wrap {
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.04);
}

#search-wrap::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

#search-input {
  min-height: 56px;
  padding-left: 54px;
}

#spotlight-panel {
  margin: 0 6px 20px;
}

#spotlight-panel:empty {
  display: none;
}

.spotlight-grid {
  display: grid;
  gap: 14px;
}

.spotlight-hero {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 30px;
  overflow: hidden;
  position: relative;
}

.spotlight-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -36% 42%;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 62%);
  filter: blur(16px);
  pointer-events: none;
}

.spotlight-copy h4 {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1;
  font-family: "Avenir Next", var(--font);
}

.spotlight-copy p:last-of-type {
  margin: 0;
  color: var(--text2);
  max-width: 42ch;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.spotlight-art-frame {
  display: flex;
  justify-content: flex-end;
}

.spotlight-art {
  width: min(180px, 42vw);
  aspect-ratio: 1;
  border-radius: 28px;
  box-shadow:
    0 22px 60px rgba(4, 7, 18, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  animation: albumFloat 7s ease-in-out infinite;
}

.spotlight-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border-radius: 24px;
  color: var(--text);
  text-align: left;
}

.stat-tile strong {
  font-size: 30px;
  line-height: 1;
}

.stat-tile span {
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
}

.songs-list,
.artists-list,
.playlists-list,
.detail-list,
.picker-list,
.queue-list {
  gap: 10px;
}

.album-card,
.song-row,
.artist-row,
.playlist-row,
.picker-row,
.detail-track-row,
.queue-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  box-shadow: 0 16px 42px rgba(2, 5, 16, 0.18);
}

.album-card,
.playlist-card,
.cta-card {
  border-radius: 28px;
  overflow: hidden;
}

.album-card::before,
.spotlight-hero::before,
.song-row::before,
.artist-row::before,
.playlist-row::before,
.picker-row::before,
.detail-track-row::before,
.queue-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 18%, rgba(255, 255, 255, 0.12) 50%, transparent 82%);
  transform: translateX(-140%);
  opacity: 0;
  transition: transform 0.9s ease, opacity 0.25s ease;
  pointer-events: none;
}

.album-card:hover::before,
.spotlight-hero:hover::before,
.song-row:hover::before,
.artist-row:hover::before,
.playlist-row:hover::before,
.picker-row:hover::before,
.detail-track-row:hover::before,
.queue-row:hover::before {
  transform: translateX(140%);
  opacity: 1;
}

.song-row,
.artist-row,
.playlist-row,
.picker-row,
.detail-track-row,
.queue-row {
  border-bottom: 0;
  border-radius: 24px;
  padding: 14px 12px;
  overflow: hidden;
}

.song-row.current,
.detail-track-row.current,
.queue-row.current {
  background:
    linear-gradient(145deg, rgba(255, 95, 109, 0.18), rgba(255, 179, 107, 0.06)),
    rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 95, 109, 0.18);
}

.album-art-card,
.art-tile {
  border-radius: 24px;
}

.album-meta {
  padding: 14px 6px 6px;
}

.album-meta h4,
.playlist-copy h4,
.song-title,
.queue-title {
  font-size: 15px;
}

.row-art,
.mini-art,
.detail-art,
.queue-current-art {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.row-art-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: linear-gradient(145deg, rgba(255, 95, 109, 0.2), rgba(255, 179, 107, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.row-side {
  gap: 8px;
}

.row-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--text2);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1;
}

.row-chevron {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text2);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.add-mark {
  color: #fff;
  background: linear-gradient(145deg, rgba(255, 95, 109, 0.84), rgba(255, 179, 107, 0.74));
}

.track-index-pill {
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 700;
}

.artist-avatar {
  background: linear-gradient(145deg, rgba(255, 95, 109, 0.9), rgba(255, 179, 107, 0.72));
  box-shadow: 0 14px 26px rgba(255, 95, 109, 0.22);
}

#mini-player {
  height: 82px;
  border-radius: 28px;
  padding: 12px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    rgba(9, 12, 20, 0.28);
  box-shadow: 0 24px 70px rgba(3, 7, 18, 0.38);
}

#mini-progress,
#queue-progress-bar,
#loading-progress-bar {
  background: linear-gradient(90deg, rgba(255, 95, 109, 1), rgba(255, 179, 107, 1));
}

.player-shell {
  gap: 8px;
}

.player-topbar,
.player-now,
.player-queue,
.sheet-surface,
.loading-card {
  position: relative;
  overflow: hidden;
}

.player-topbar,
.player-now,
.player-queue {
  border-radius: 30px;
}

.player-now {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-tabs {
  background: rgba(255, 255, 255, 0.1);
}

.player-tabs button {
  min-width: 118px;
}

.player-tabs button.active {
  background: rgba(255, 255, 255, 0.18);
}

.player-art {
  border-radius: 28px;
  box-shadow:
    0 28px 70px rgba(3, 7, 18, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.player-art.playing {
  animation: albumFloat 7s ease-in-out infinite;
}

.player-info h3 {
  font-size: clamp(22px, 3vw, 28px);
}

.player-info p {
  color: rgba(255, 255, 255, 0.72);
}

.player-queue {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
}

.sheet-element.open .player-shell,
.sheet-element.open .sheet-surface {
  animation: sheetSettle 0.7s var(--ease-spring) both;
}

#toast {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    rgba(11, 14, 22, 0.72);
  box-shadow: 0 18px 44px rgba(3, 7, 18, 0.26);
}

.icon-only {
  font-size: 0;
  line-height: 0;
}

.nav-btn[data-icon],
.pill-btn[data-icon],
.chip-btn[data-icon],
.text-btn[data-icon],
.player-tabs button[data-icon],
.row-meta[data-icon],
.row-chevron[data-icon],
.icon-only[data-icon],
.row-art-icon[data-icon],
.stat-tile[data-icon],
.drag-handle[data-icon] {
  --icon-size: 18px;
}

.nav-btn[data-icon]::before,
.pill-btn[data-icon]::before,
.chip-btn[data-icon]::before,
.text-btn[data-icon]::before,
.player-tabs button[data-icon]::before,
.row-meta[data-icon]::before,
.row-chevron[data-icon]::before,
.icon-only[data-icon]::before,
.row-art-icon[data-icon]::before,
.stat-tile[data-icon]::before,
.drag-handle[data-icon]::before {
  content: "";
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) no-repeat center / contain;
  mask: var(--icon) no-repeat center / contain;
}

.nav-btn[data-icon]::before {
  --icon-size: 20px;
  opacity: 0.92;
}

.pill-btn[data-icon]::before,
.chip-btn[data-icon]::before,
.player-tabs button[data-icon]::before {
  --icon-size: 16px;
}

.row-meta[data-icon]::before,
.drag-handle[data-icon]::before,
.row-chevron[data-icon]::before {
  --icon-size: 14px;
}

.icon-only[data-icon]::before {
  --icon-size: 18px;
}

.stat-tile[data-icon]::before {
  --icon-size: 20px;
  margin-bottom: 6px;
}

[data-icon="home"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9.5V20h14V9.5'/%3E%3Cpath d='M9.5 20v-5h5v5'/%3E%3C/svg%3E");
}

[data-icon="spark"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 1.6 4.4L18 9l-4.4 1.6L12 15l-1.6-4.4L6 9l4.4-1.6z'/%3E%3Cpath d='M18.5 3.5 19 5l1.5.5L19 6l-.5 1.5L18 6l-1.5-.5L18 5zM4.5 14.5 5 16l1.5.5L5 17l-.5 1.5L4 17l-1.5-.5L4 16z'/%3E%3C/svg%3E");
}

[data-icon="radio"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10h16v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z'/%3E%3Cpath d='m8 10 8-6M8 15h.01M12 15h.01M16 15h.01'/%3E%3Ccircle cx='8' cy='15' r='1' fill='black' stroke='none'/%3E%3Ccircle cx='12' cy='15' r='1' fill='black' stroke='none'/%3E%3Ccircle cx='16' cy='15' r='1' fill='black' stroke='none'/%3E%3C/svg%3E");
}

[data-icon="search"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
}

[data-icon="clock"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5v5l3 1.8'/%3E%3C/svg%3E");
}

[data-icon="artist"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5.5 19a6.5 6.5 0 0 1 13 0'/%3E%3C/svg%3E");
}

[data-icon="album"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='3'/%3E%3Ccircle cx='12' cy='12' r='3.25'/%3E%3Ccircle cx='12' cy='12' r='1' fill='black' stroke='none'/%3E%3C/svg%3E");
}

[data-icon="playlist"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h10M4 12h10M4 17h6'/%3E%3Cpath d='M18 6v9.5a2.5 2.5 0 1 1-1.5-2.3V7.5L21 6v7.5a2.5 2.5 0 1 1-1.5-2.3'/%3E%3C/svg%3E");
}

[data-icon="heart"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='m12 20-1.2-1.1C6 14.5 3 11.8 3 8.5A4.5 4.5 0 0 1 7.5 4C9.2 4 10.8 4.8 12 6c1.2-1.2 2.8-2 4.5-2A4.5 4.5 0 0 1 21 8.5c0 3.3-3 6-7.8 10.4z'/%3E%3C/svg%3E");
}

[data-icon="plus"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}

[data-icon="lyrics"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 7h12M6 12h9M6 17h12'/%3E%3C/svg%3E");
}

[data-icon="shuffle"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4h4v4'/%3E%3Cpath d='m20 4-6.5 6.5M4 7h4l5 5M4 17h4l2.5-2.5M13.5 13.5 20 20M16 20h4v-4'/%3E%3C/svg%3E");
}

[data-icon="repeat"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 2.5 21 6l-4 3.5'/%3E%3Cpath d='M3 11V9a3 3 0 0 1 3-3h15'/%3E%3Cpath d='M7 21.5 3 18l4-3.5'/%3E%3Cpath d='M21 13v2a3 3 0 0 1-3 3H3'/%3E%3C/svg%3E");
}

[data-icon="equalizer"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 5v14M12 5v14M18 5v14'/%3E%3Ccircle cx='6' cy='9' r='2' fill='black' stroke='none'/%3E%3Ccircle cx='12' cy='15' r='2' fill='black' stroke='none'/%3E%3Ccircle cx='18' cy='11' r='2' fill='black' stroke='none'/%3E%3C/svg%3E");
}

[data-icon="playlist-add"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 7h10M4 12h10M4 17h6'/%3E%3Cpath d='M18 10v8M14 14h8'/%3E%3C/svg%3E");
}

[data-icon="play-circle"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='m10 8.5 5 3.5-5 3.5z' fill='black' stroke='none'/%3E%3C/svg%3E");
}

[data-icon="trash"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4h6v3M7.5 7l1 12h7l1-12'/%3E%3Cpath d='M10 11v5M14 11v5'/%3E%3C/svg%3E");
}

[data-icon="chevron-right"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E");
}

[data-icon="waveform"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 13h2l1.5-5 3 10 2.5-7 1.5 4H20'/%3E%3C/svg%3E");
}

[data-icon="music-note"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 5v10.5a2.5 2.5 0 1 1-1.5-2.3V7.5L19 6v7.5a2.5 2.5 0 1 1-1.5-2.3'/%3E%3C/svg%3E");
}

[data-icon="grip"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='8' cy='7' r='1.5'/%3E%3Ccircle cx='16' cy='7' r='1.5'/%3E%3Ccircle cx='8' cy='12' r='1.5'/%3E%3Ccircle cx='16' cy='12' r='1.5'/%3E%3Ccircle cx='8' cy='17' r='1.5'/%3E%3Ccircle cx='16' cy='17' r='1.5'/%3E%3C/svg%3E");
}

button:disabled {
  opacity: 0.45;
  transform: none;
  cursor: default;
}

@media (min-width: 960px) {
  .spotlight-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.9fr);
    align-items: stretch;
  }

  .spotlight-hero {
    grid-template-columns: minmax(0, 1.2fr) auto;
    align-items: center;
  }

  .spotlight-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #add-tracks-btn {
    width: 48px;
    min-width: 48px;
    padding: 0;
    border-radius: 18px;
    font-size: 0;
  }

  #add-tracks-btn::before {
    --icon-size: 18px;
  }

  .spotlight-actions {
    gap: 8px;
  }

  .spotlight-actions .pill-btn,
  .spotlight-actions .chip-btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }

  .spotlight-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-tile {
    padding: 14px;
  }
}

/* Player / Queue layout stabilization patch */
#player-sheet .player-body,
#player-sheet .player-now,
#player-sheet .player-queue,
#player-sheet .queue-list {
  min-height: 0;
}

#player-sheet .player-body {
  transition:
    grid-template-rows 0.4s var(--ease-fluid),
    grid-template-columns 0.4s var(--ease-fluid);
}

#player-sheet .player-now {
  transition:
    transform 0.38s var(--ease-fluid),
    padding 0.32s ease,
    border-radius 0.32s ease,
    background 0.32s ease;
}

#player-sheet .player-queue {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr);
  opacity: 0;
  transform: translateY(26px);
  pointer-events: none;
  max-height: 0;
  transition:
    transform 0.4s var(--ease-fluid),
    opacity 0.3s ease,
    max-height 0.4s var(--ease-fluid),
    padding 0.3s ease;
}

#player-sheet[data-stage="0"] .player-body {
  grid-template-rows: minmax(0, 1fr);
}

#player-sheet[data-stage="0"] .player-queue {
  padding-top: 0;
  padding-bottom: 0;
}

#player-sheet[data-stage="1"] .player-body {
  grid-template-rows: minmax(0, 56%) minmax(0, 44%);
}

#player-sheet[data-stage="1"] .player-queue,
#player-sheet[data-stage="2"] .player-queue {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: min(76vh, 700px);
}

#player-sheet[data-stage="2"] .player-body {
  grid-template-rows: minmax(136px, 25vh) minmax(0, 1fr);
}

#player-sheet[data-stage="2"] .queue-list {
  overflow: auto;
}

[data-layout="landscape"] #player-sheet[data-stage="1"] .player-queue {
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .player-body {
  grid-template-columns: minmax(0, 44%) minmax(0, 56%);
  grid-template-rows: minmax(0, 1fr);
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .player-now {
  display: grid;
  grid-template-columns: minmax(220px, 38%) 1fr;
  grid-template-areas:
    "tabs tabs"
    "media info"
    "media seek"
    "media controls"
    "media actions";
  align-items: center;
  gap: 18px;
  padding: 18px;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .player-tabs {
  display: inline-grid;
  grid-area: tabs;
  justify-self: start;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .player-media-stack {
  grid-area: media;
  flex: 1;
  padding: 0;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .player-info {
  grid-area: info;
  align-self: end;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .seek-wrap {
  grid-area: seek;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .transport-wrap {
  grid-area: controls;
  padding-top: 0;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .player-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-start;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .volume-wrap {
  display: none;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .player-art {
  width: min(34vh, 300px);
  height: min(34vh, 300px);
  border-radius: 24px;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .transport-cluster .icon-btn:not(.filled.large) {
  display: inline-grid;
}

[data-layout="landscape"] #player-sheet[data-stage="2"] .transport-cluster .filled.large {
  width: 64px;
  min-width: 64px;
  min-height: 64px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes riseIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ambientShift {
  0%, 100% {
    transform: scale(1) translate3d(0, 0, 0);
  }
  50% {
    transform: scale(1.08) translate3d(-1.5%, -1%, 0);
  }
}

@keyframes orbFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(2%, -1.5%, 0) rotate(8deg);
  }
}

@keyframes albumFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.018);
  }
}

@keyframes sheetSettle {
  0% {
    opacity: 0.2;
    transform: translateY(24px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
