/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  --bg:          #040405;
  --text:        #e6f1d9;
  --text-muted:  #747474;
  --text-dim:    #505848;
  --accent:      #44ff00;
  --accent-dark: #0c0c0c;
  --surface:     rgba(255,255,255,0.03);
  --surface-2:   rgba(255,255,255,0.09);
  --border:      rgba(255,255,255,0.2);
  --border-dark: #353535;
  --active-row:  rgba(255,255,255,0.06);
}

/* ── Base ──────────────────────────────────────────────────── */
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  font-family: 'Cabinet Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
}

/* ── Background images ─────────────────────────────────────── */
.bg-images {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-img {
  position: absolute;
  width: clamp(280px, 38vw, 600px);
  height: auto;
  object-fit: cover;
}
.bg-img--lt {
  top: 0;
  left: 0;
  border-radius: 0 0 40px 0;
}
.bg-img--rb {
  bottom: 0;
  right: 0;
  border-radius: 40px 0 0 0;
}

/* ── Layout ────────────────────────────────────────────────── */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Top nav */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  flex-shrink: 0;
}
.logo svg { display: block; }
.nav-contact {
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 24px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: border-color .2s, background .2s;
}
.nav-contact:hover { background: var(--surface); }

/* Main area */
.main {
  display: flex;
  flex: 1;
  gap: 0;
  overflow: hidden;
  padding: 0 24px;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: 305px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 36px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: flex-start;
  position: sticky;
  top: 0;
}

/* Search */
.search-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 10px 16px;
  gap: 8px;
  transition: border-color .2s;
}
.search-wrap:focus-within { border-color: var(--accent); }
.search-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap svg { color: var(--text-muted); flex-shrink: 0; }

/* Section label */
.filter-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
  display: block;
}

/* Tempo section */
.tempo-section {}
.tempo-inputs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.tempo-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,.09);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
}
.tempo-box.active {
  border-color: var(--accent);
  color: var(--accent);
}
.tempo-box span.bpm-label { font-size: 11px; color: var(--text-muted); }
.tempo-box.active span.bpm-label { color: var(--accent); }
.tempo-box input {
  background: none;
  border: none;
  outline: none;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  width: 36px;
}

/* Dual range slider */
.range-slider {
  position: relative;
  height: 20px;
  margin-top: 4px;
}
.range-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,.12);
  border-radius: 99px;
  transform: translateY(-50%);
}
.range-fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.range-slider input[type=range] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  appearance: none;
  background: none;
  pointer-events: none;
  outline: none;
}
.range-slider input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: all;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(68,255,0,.2);
}
.range-slider input[type=range]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: all;
  cursor: pointer;
}

/* Scale section */
.scale-section {}

/* Hide reserved checkbox */
.hide-reserved-wrap { display: flex; flex-direction: column; gap: 8px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
  position: relative;
}
.checkbox-row input[type=checkbox]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-row input[type=checkbox]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 2px;
  width: 5px; height: 9px;
  border: 2px solid #0c0c0c;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.checkbox-label { font-size: 14px; color: var(--text); cursor: pointer; user-select: none; }
.mode-row {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  align-items: center;
}
.mode-btn {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: all .2s;
}
.mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.note-dropdown-wrap { position: relative; }
.note-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  width: 115px;
  transition: border-color .2s;
}
.note-btn svg { width: 10px; transition: transform .2s; }
.note-btn.open svg { transform: rotate(180deg); }
.note-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 115px;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(2,2,2,.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 50;
  display: none;
}
.note-dropdown.open { display: block; }
.note-option {
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.note-option:hover { background: rgba(255,255,255,.06); }
.note-option.active { color: var(--accent); }
.note-option.clear { color: var(--text-muted); font-size: 12px; }

/* ── Playlist area ─────────────────────────────────────────── */
.playlist-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-left: 24px;
}

/* Genre tags */
.genre-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  flex-shrink: 0;
}
.genre-label { font-size: 15px; font-weight: 500; margin-right: 4px; }
.genre-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-dark);
  background: var(--surface);
  color: var(--text);
  transition: all .2s;
  white-space: nowrap;
  user-select: none;
}
.genre-tag .count { color: var(--text-muted); font-size: 11px; }
.genre-tag:hover { border-color: rgba(255,255,255,.2); }
.genre-tag.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-dark);
}
.genre-tag.active .count { color: rgba(0,0,0,.5); }

/* Track list */
.track-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  padding-left: 1px;
}
.track-list::-webkit-scrollbar { width: 4px; }
.track-list::-webkit-scrollbar-track { background: transparent; }
.track-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.track-row {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 40px 56px 120px auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}
.track-row-progress {
  display: none;
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  background: rgba(68,255,0,0.06);
  border-radius: 16px 0 0 16px;
  pointer-events: none;
  transition: width 0.15s linear;
}
.track-row:hover { background: rgba(255,255,255,.06); }
.track-row.active { background: var(--active-row); box-shadow: 0 0 0 1px var(--border); }

.track-play-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, transform .15s;
}

/* Gradient border via mask */
.track-play-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 1px;
  background: linear-gradient(145deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.06) 60%, rgba(255,255,255,0.0) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.track-row:hover .track-play-btn { background: rgba(40,40,40,0.7); transform: scale(1.08); }

/* Active (playing) row — accent glow */
.track-row.active .track-play-btn {
  background: rgba(68,255,0,0.12);
}
.track-row.active .track-play-btn::before {
  background: linear-gradient(145deg, rgba(68,255,0,0.7) 0%, rgba(68,255,0,0.1) 60%, transparent 100%);
}

.track-cover {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-dim);
  flex-shrink: 0;
  overflow: hidden;
}
.track-cover img { width: 100%; height: 100%; object-fit: cover; }

.track-info { min-width: 0; }
.track-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.track-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); text-decoration: none; }
.track-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.track-badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; flex-shrink: 0; }
.track-badge--reserved { background: rgba(255,170,0,0.15); color: #ffaa00; border: 1px solid rgba(255,170,0,0.35); }
.track-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
}
.track-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.track-tag {
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.track-waveform {
  flex: 1;
  height: 28px;
  min-width: 0;
  display: flex;
  align-items: center;
}
.track-waveform canvas {
  width: 100%;
  height: 28px;
  display: block;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ── Bottom Player ─────────────────────────────────────────── */
.player {
  flex-shrink: 0;
  position: fixed;
  bottom: 0;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: 32px;
  margin: 8px 0 16px 0;
  width: 100%;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 64px rgba(0,0,0,.8);
}
.player.hidden { display: none; }

/* Progress bar on top of player */
.player-progress-wrap {
  position: absolute;
  top: -5px;
  left: 24px;
  right: 24px;
  height: 10px;
  cursor: pointer;
}
.player-progress-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,.1);
  transform: translateY(-50%);
  border-radius: 99px;
}
.player-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  pointer-events: none;
}
.player-progress-dot {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Track info in player */
.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 180px;
  flex-shrink: 0;
}
.player-cover {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-dim);
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.player-track-name { font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-track-bpm  { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

/* Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s;
  border-radius: 6px;
}
.ctrl-btn:hover { color: var(--text); }
.ctrl-btn.active { color: var(--accent); }
.ctrl-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background .2s, transform .1s;
}
.ctrl-play:hover { background: #fff; transform: scale(1.05); }

/* Time + Volume */
.player-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  min-width: 200px;
  justify-content: flex-end;
}
.player-time { font-size: 14px; color: var(--text); white-space: nowrap; }
.volume-wrap { display: flex; align-items: center; gap: 8px; }
.volume-wrap svg { color: var(--text-muted); }
.volume-slider {
  width: 80px;
  appearance: none;
  height: 3px;
  background: rgba(255,255,255,.15);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Loading spinner ───────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar (global) ────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* ── Track page ────────────────────────────────────────────── */
body.tp-body {
  overflow: auto;
  height: auto;
}
.tp-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* On track.php the nav sits outside .tp-app, needs flex layout */
body.tp-body { display: flex; flex-direction: column; }

/* Track detail panel inside the SPA (index.php) */
.tp-view {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 120px;
}

/* Back link */
.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color .2s;
}
.nav-back:hover { color: var(--text); }

/* Hero layout */
.tp-hero {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  width: 100%;
  box-sizing: border-box;
}

/* Cover */
.tp-cover-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  flex-shrink: 0;
}
.tp-cover-glow {
  position: absolute;
  inset: -50px;
  background-size: cover;
  background-position: center;
  filter: blur(55px);
  opacity: 0.3;
  border-radius: 50%;
  pointer-events: none;
}
.tp-cover-img {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 24px;
  object-fit: cover;
  display: block;
}
.tp-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  font-size: 64px;
  color: var(--text-muted);
}

/* Info column */
.tp-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.tp-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.1;
}

/* Meta pills */
.tp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tp-pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  font-size: 13px;
  color: var(--text-muted);
}
.tp-pill--genre {
  border-color: var(--accent);
  color: var(--accent);
}

/* Waveform */
.tp-waveform-wrap {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px 0;
  cursor: pointer;
  overflow: hidden;
}
.tp-waveform-canvas {
  display: block;
  width: 100%;
  height: 80px;
}

/* Time row */
.tp-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -6px;
  padding: 0 2px;
}

/* Playback controls */
.tp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.tp-ctrl-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color .2s, background .2s;
}
.tp-ctrl-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
.tp-play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .1s;
  flex-shrink: 0;
}
.tp-play-btn:hover { background: #66ff33; transform: scale(1.06); }

/* Action buttons */
.tp-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tp-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.tp-action-btn:hover { background: rgba(255,255,255,0.07); }
.tp-action-btn--accent {
  border-color: var(--accent);
  color: var(--accent);
}
.tp-action-btn--accent:hover { background: rgba(68,255,0,0.08); }

/* Related beats */
.tp-related {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 60px;
  width: 100%;
  box-sizing: border-box;
}
.tp-related-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}
.tp-related-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tp-related-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 14px;
  text-decoration: none;
  transition: background .15s;
}
.tp-related-row:hover { background: rgba(255,255,255,0.04); }
.tp-related-cover {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
  color: var(--text-muted);
}
.tp-related-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tp-related-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.tp-related-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Mobile track page */
@media (max-width: 576px) {
  .tp-hero {
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 24px 16px 40px;
  }
  .tp-cover-wrap { width: 220px; height: 220px; }
  .tp-cover-img  { width: 220px; height: 220px; }
  .tp-info       { width: 100%; }
  .tp-title      { font-size: 28px; text-align: center; }
  .tp-pills      { justify-content: center; }
  .tp-actions    { justify-content: center; }
  .tp-related    { padding: 0 16px 60px; }
}

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 0 12px; }
  .playlist-area { padding-left: 0; }
  .topnav { padding: 16px 20px; }
}

/* ── Mobile (<576px) ───────────────────────────────────────── */
@media (max-width: 576px) {
  html, body {
    overflow: auto;
    height: auto;
  }
  .app {
    height: auto;
    min-height: 100svh;
  }

  /* Nav */
  .topnav {
    justify-content: center;
    padding: 20px 16px;
  }
  .nav-contact { display: none; }

  /* Layout */
  .main {
    flex-direction: column;
    padding: 0 8px;
    overflow: visible;
    gap: 0;
  }
  .sidebar { display: none; }
  .playlist-area {
    padding-left: 0;
    overflow: visible;
  }

  /* Genre bar */
  .genre-bar { display: none; }

  /* Track list */
  .track-list {
    overflow: visible;
    padding-bottom: 96px;
  }

  /* Track row: play | cover | info | genre-tag */
  .track-row {
    grid-template-columns: 40px 56px 1fr auto;
    padding: 8px 12px;
  }
  .track-waveform { display: none; }
  .track-tag {
    font-size: 10px;
    padding: 3px 8px;
  }

  /* Track detail SPA panel on mobile */
  .tp-view { padding-bottom: 100px; }

  /* Active row */
  .track-row.active { background: rgba(255,255,255,0.02); }

  /* Progress background fill */
  .track-row-progress { display: block; }

  /* Bottom player — floating pill */
  .player {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    margin: 0;
    border-radius: 50px;
    height: 67px;
    padding: 0 24px;
    justify-content: center;
    z-index: 100;
  }
  .player-info { display: none; }
  .player-right { display: none; }
  .player-controls { gap: 20px; }
}
