:root {
  color-scheme: dark;
  --bg-0: #08060f;
  --bg-1: #0e0a18;
  --bg-2: #151026;
  --surface: rgba(24, 17, 42, 0.72);
  --surface-strong: rgba(28, 19, 48, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(160, 123, 255, 0.28);
  --text-main: #f5f1ff;
  --text-soft: #c2b5ea;
  --text-muted: #9588bd;
  --primary: #8b5cf6;
  --primary-2: #b794ff;
  --accent: #3fe0ff;
  --accent-2: #ff72df;
  --good: #4ade80;
  --warn: #f59e0b;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --blur: blur(20px);
  --player-height: 286px;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(63, 224, 255, 0.14), transparent 26%),
    radial-gradient(circle at bottom center, rgba(255, 114, 223, 0.14), transparent 32%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 40%, #05040a);
  color: var(--text-main);
  overflow-x: hidden;
}

button, input, select {
  font: inherit;
}

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

input, select {
  width: 100%;
  background: rgba(10, 9, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus, select:focus {
  border-color: rgba(139, 92, 246, 0.65);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
}

.hidden { display: none !important; }
.stack-md { display: grid; gap: 16px; }
.glass-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}
.glass-soft {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

.ambient {
  position: fixed;
  inset: auto;
  pointer-events: none;
  filter: blur(50px);
  opacity: 0.8;
  z-index: 0;
}
.ambient-a {
  top: 0;
  left: -90px;
  width: 360px;
  height: 360px;
  background: rgba(139, 92, 246, 0.22);
}
.ambient-b {
  right: 2%;
  top: 24%;
  width: 300px;
  height: 300px;
  background: rgba(63, 224, 255, 0.14);
}
.ambient-c {
  left: 34%;
  bottom: 14%;
  width: 280px;
  height: 280px;
  background: rgba(255, 114, 223, 0.14);
}

.app-frame {
  position: relative;
  z-index: 1;
  padding: 24px;
  padding-bottom: calc(var(--player-height) + 34px);
}

.auth-screen {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}
.auth-card {
  width: min(100%, 540px);
  padding: 32px;
}
.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.24);
  border-radius: 999px;
  color: var(--primary-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 800;
}
.brand-block h1, .topbar h1 {
  margin: 18px 0 10px;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1;
}
.brand-block p, .section-head p, .eq-head p, .topbar p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}
.auth-tabs {
  display: inline-flex;
  gap: 10px;
  margin: 28px 0 18px;
}
.chip {
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: 0.2s ease;
}
.chip.active,
.chip:hover {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.32);
}

.field {
  display: grid;
  gap: 8px;
}
.field span {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
}
.field-span-2 {
  grid-column: span 2;
}
.align-end {
  align-self: end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, rgba(139,92,246,0.9), rgba(99,102,241,0.88));
  color: white;
  border-color: rgba(255,255,255,0.08);
}
.btn-secondary {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
  color: var(--primary-2);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.btn-danger {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.25);
  color: #ffb4c0;
}
.btn-lg { min-height: 50px; }
.btn-sm { min-height: 38px; padding-inline: 12px; font-size: 13px; }
.btn-xs { min-height: 34px; padding-inline: 11px; font-size: 12px; }

.status-banner {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-main);
  line-height: 1.5;
}
.status-banner.success {
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.08);
  color: #baf7ca;
}
.status-banner.warning {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
  color: #ffd491;
}
.status-banner.danger {
  border-color: rgba(251, 113, 133, 0.26);
  background: rgba(251, 113, 133, 0.08);
  color: #ffc5cf;
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}
.sidebar {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 48px - var(--player-height));
}
.sidebar-head,
.section-head,
.section-head-wrap,
.eq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.section-head h2, .section-head h3, .sidebar-head h2, .eq-head h3 {
  margin: 0 0 4px;
  font-size: 22px;
}
.profile-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}
.profile-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(139,92,246,0.9), rgba(63,224,255,0.55));
  color: white;
  font-size: 20px;
  font-weight: 800;
}
.profile-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.profile-name {
  font-size: 18px;
  font-weight: 700;
}
.nav-list,
.playlist-list {
  display: grid;
  gap: 10px;
}
.nav-item,
.playlist-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: 0.18s ease;
}
.nav-item.active,
.nav-item:hover,
.playlist-item.active,
.playlist-item:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.28);
}
.playlist-item strong,
.nav-item {
  font-weight: 600;
}
.playlist-item small {
  color: var(--text-muted);
}
.sidebar-section {
  display: grid;
  gap: 14px;
  min-height: 0;
}
.playlist-list {
  max-height: 100%;
  overflow: auto;
  padding-right: 4px;
}

.main-column {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.topbar {
  padding: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}
.stat-card {
  min-height: 100px;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.stat-card span {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-card strong {
  font-size: 30px;
  line-height: 1;
}
.view-grid {
  display: grid;
  gap: 20px;
}
.panel {
  padding: 24px;
  display: grid;
  gap: 20px;
  min-width: 0;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.input {
  min-width: min(420px, 100%);
}
.select {
  min-width: 120px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.empty-state {
  padding: 24px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  color: var(--text-soft);
}

.track-list,
.search-grid,
.playlist-picker {
  display: grid;
  gap: 12px;
}
.track-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.track-thumb,
.search-thumb {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(139,92,246,0.35), rgba(63,224,255,0.18));
}
.track-main,
.search-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.track-title,
.search-title {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-meta,
.search-meta {
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
}
.track-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.tag-accent {
  background: rgba(63, 224, 255, 0.1);
  color: #a4f1ff;
}
.track-actions,
.search-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.icon-btn {
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
}
.icon-btn:hover,
.picker-btn:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
}
.icon-btn.is-active {
  color: #ff8dcc;
  border-color: rgba(255, 114, 223, 0.35);
  background: rgba(255, 114, 223, 0.12);
}
.search-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.player-shell {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 30;
}
.player-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background: linear-gradient(180deg, rgba(20, 14, 36, 0.72), rgba(10, 8, 20, 0.76));
}
.player-viz-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.player-viz-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 50%, rgba(139, 92, 246, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(11, 8, 20, 0.06), rgba(11, 8, 20, 0.44));
}
#player-visualizer {
  width: 100%;
  height: 100%;
  display: block;
  filter: blur(18px) saturate(1.24);
  opacity: 0.72;
}
.player-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}
.player-main {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.1fr;
  gap: 18px;
  align-items: stretch;
}
.now-playing,
.transport,
.player-side {
  padding: 16px 18px;
  border-radius: 24px;
  background: rgba(8, 6, 17, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  min-width: 0;
}
.cover-glow {
  position: absolute;
  inset: auto auto auto 10px;
  width: 54px;
  height: 54px;
  background: rgba(139, 92, 246, 0.35);
  filter: blur(26px);
  z-index: 0;
}
.player-cover {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  position: relative;
  z-index: 1;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}
.player-title {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist {
  margin-top: 6px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.transport {
  display: grid;
  gap: 14px;
}
.transport-controls,
.inline-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.player-sliders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.inline-controls.compact {
  justify-content: flex-end;
}
.round-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}
.round-btn:hover {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.28);
}
.round-btn-primary {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, rgba(139,92,246,0.95), rgba(99,102,241,0.95));
}
.progress-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  color: var(--text-soft);
  font-size: 13px;
}
.player-side {
  display: grid;
  gap: 14px;
}
.inline-field {
  display: grid;
  gap: 8px;
  min-width: 130px;
  color: var(--text-soft);
  font-size: 13px;
}
.field-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.speed-field strong {
  color: var(--text-main);
  font-size: 13px;
}
.fx-controls .btn {
  min-width: 92px;
}

.eq-panel {
  margin-top: 2px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(8, 6, 17, 0.24);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  gap: 18px;
}
.eq-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.eq-band {
  padding: 14px 10px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  display: grid;
  justify-items: center;
  gap: 10px;
}
.eq-name {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 700;
}
.eq-band strong {
  font-size: 12px;
  color: var(--primary-2);
}
.eq-slider-wrap {
  position: relative;
  width: 100%;
  min-height: 196px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eq-slider-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 168px;
  height: 12px;
  transform: translate(-50%, -50%) rotate(-90deg);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(73, 49, 128, 0.72), rgba(180, 132, 255, 0.22));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.eq-slider {
  width: 168px;
  transform: rotate(-90deg);
  transform-origin: center;
}
.preamp-band {
  border-color: rgba(63, 224, 255, 0.14);
}
#visualizer {
  width: 100%;
  height: 164px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(12, 8, 24, 0.56), rgba(7, 6, 15, 0.34));
  border: 1px solid rgba(196, 153, 255, 0.14);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  padding: 0;
  border: 0;
  box-shadow: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(86, 52, 155, 0.92), rgba(192, 137, 255, 0.72));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 0 24px rgba(139, 92, 246, 0.14);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-top: -4px;
  border: 1px solid rgba(255,255,255,0.85);
  background: radial-gradient(circle at 30% 30%, #ffffff 0, #f4ebff 28%, #c6a4ff 52%, #8b5cf6 100%);
  box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.16), 0 8px 18px rgba(49, 23, 93, 0.5);
}
input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(86, 52, 155, 0.92), rgba(192, 137, 255, 0.72));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 0 24px rgba(139, 92, 246, 0.14);
}
input[type="range"]::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(111, 72, 204, 1), rgba(215, 160, 255, 0.92));
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.85);
  background: radial-gradient(circle at 30% 30%, #ffffff 0, #f4ebff 28%, #c6a4ff 52%, #8b5cf6 100%);
  box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.16), 0 8px 18px rgba(49, 23, 93, 0.5);
}
#seek-slider::-webkit-slider-runnable-track,
#volume-slider::-webkit-slider-runnable-track,
#speed-slider::-webkit-slider-runnable-track {
  height: 12px;
}
#seek-slider::-moz-range-track,
#volume-slider::-moz-range-track,
#speed-slider::-moz-range-track,
#seek-slider::-moz-range-progress,
#volume-slider::-moz-range-progress,
#speed-slider::-moz-range-progress {
  height: 12px;
}

.dialog {
  border: none;
  background: transparent;
  padding: 0;
  width: min(100% - 32px, 520px);
}
.dialog::backdrop {
  background: rgba(5, 5, 12, 0.55);
  backdrop-filter: blur(8px);
}
.dialog-card {
  padding: 20px;
}
.picker-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  text-align: left;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
}
.picker-btn small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
}

.toast-root {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 40;
  display: grid;
  gap: 10px;
}
.toast {
  min-width: 280px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(18, 14, 31, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 50px rgba(0,0,0,0.38);
}
.toast.success { border-color: rgba(74, 222, 128, 0.26); }
.toast.error { border-color: rgba(251, 113, 133, 0.26); }
.toast.warning { border-color: rgba(245, 158, 11, 0.26); }

@media (max-width: 1280px) {
  .shell { grid-template-columns: 280px minmax(0, 1fr); }
  .player-main { grid-template-columns: 1fr; }
  .inline-controls.compact { justify-content: center; }
}

@media (max-width: 980px) {
  .app-frame { padding: 16px; padding-bottom: calc(var(--player-height) + 32px); }
  .shell { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .topbar { flex-direction: column; }
  .stats-grid { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: span 1; }
  .eq-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .player-sliders { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --player-height: 380px; }
  .app-frame { padding-bottom: calc(var(--player-height) + 40px); }
  .player-shell { left: 14px; right: 14px; bottom: 14px; }
  .track-item, .search-card { grid-template-columns: 1fr; align-items: start; }
  .track-actions, .search-actions { justify-content: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
  .eq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eq-slider-wrap { min-height: 172px; }
  .eq-slider,
  .eq-slider-wrap::before { width: 140px; }
}

.sidebar-overlay,
.sidebar-toggle,
.sidebar-close {
  display: none;
}

.sidebar-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upload-hint {
  padding: 16px 18px;
  color: var(--text-soft);
  line-height: 1.6;
}

.track-item {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.track-item:hover {
  border-color: rgba(139, 92, 246, 0.16);
  transform: translateY(-1px);
}

.track-item.is-current {
  border-color: rgba(139, 92, 246, 0.32);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08), rgba(255, 255, 255, 0.03));
}

.track-item.is-playing {
  box-shadow: 0 18px 40px rgba(62, 35, 122, 0.26);
}

.track-clickzone {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-radius: 16px;
  cursor: pointer;
  outline: none;
}

.track-clickzone:focus-visible {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.28);
}

.track-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.track-title-row .track-title {
  flex: 1 1 auto;
  min-width: 0;
}

.track-play-indicator {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--primary-2);
  font-size: 12px;
  line-height: 1;
}

.track-actions {
  position: relative;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.track-menu-shell {
  position: relative;
}

.track-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 8px;
  display: grid;
  gap: 6px;
  border-radius: 18px;
  background: rgba(15, 11, 26, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
  z-index: 8;
}

.track-menu-btn {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}

.track-menu-btn:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.2);
}

.track-menu-btn.danger {
  color: #ffb4c0;
}

.player-card {
  border-color: rgba(169, 126, 255, 0.16);
}

@media (max-width: 980px) {
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 4, 12, 0.56);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 24;
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 16px;
    left: 16px;
    bottom: 16px;
    width: min(86vw, 360px);
    min-height: auto;
    z-index: 26;
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.22s ease;
    overflow: auto;
  }

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

  .shell.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-toggle,
  .sidebar-close {
    display: inline-flex;
  }

  .topbar {
    align-items: stretch;
  }

  .topbar-main {
    width: 100%;
  }

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

  .track-item {
    grid-template-columns: 1fr;
  }

  .track-actions {
    justify-content: flex-start;
  }

  .track-menu {
    left: 0;
    right: auto;
  }
}

@media (max-width: 760px) {
  :root {
    --player-height: 430px;
  }

  .app-frame {
    padding: 14px;
    padding-bottom: calc(var(--player-height) + 42px);
  }

  .topbar,
  .panel,
  .auth-card,
  .player-card {
    padding: 18px;
  }

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

  .stat-card {
    min-height: 84px;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar > * {
    width: 100%;
  }

  .input,
  .select {
    min-width: 0;
  }

  .track-clickzone {
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: start;
  }

  .track-thumb,
  .search-thumb {
    width: 52px;
    height: 52px;
  }

  .track-meta {
    gap: 8px;
    font-size: 13px;
  }

  .player-shell {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .player-main {
    gap: 12px;
  }

  .now-playing,
  .transport,
  .player-side,
  .eq-panel {
    padding: 14px;
    border-radius: 20px;
  }

  .now-playing {
    align-items: center;
  }

  .player-cover {
    width: 62px;
    height: 62px;
    border-radius: 18px;
  }

  .transport-controls {
    justify-content: space-between;
  }

  .round-btn {
    width: 44px;
    height: 44px;
  }

  .round-btn-primary {
    width: 54px;
    height: 54px;
  }

  .player-sliders {
    gap: 10px;
  }

  .progress-line {
    grid-template-columns: 44px 1fr 44px;
    gap: 10px;
  }

  .eq-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toast-root {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

.section-meta {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 14px;
}

.download-queue-panel {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(18, 14, 31, 0.74);
  border: 1px solid rgba(139, 92, 246, 0.18);
  backdrop-filter: blur(20px);
}

.download-job {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.download-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.download-job-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-job-meta {
  color: var(--text-soft);
  font-size: 12px;
}

.download-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.download-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(139,92,246,0.95), rgba(192,132,252,0.95));
  box-shadow: 0 0 20px rgba(139,92,246,0.35);
}

.load-sentinel {
  padding: 12px 14px;
  text-align: center;
  color: var(--text-soft);
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.library-fallback {
  display: grid;
  gap: 14px;
  padding-top: 6px;
}

.status-banner.warning {
  border-color: rgba(245, 158, 11, 0.2);
}

@media (max-width: 760px) {
  .download-job-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
