*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100vw; position: relative; }
#app { overflow-x: hidden; }

:root {
  --bg: #030303;
  --sidebar-bg: #000000;
  --sidebar-active: rgba(255, 255, 255, 0.12);
  --separator: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --text-secondary: #aaaaaa;
  --text-tertiary: #606060;
  --accent: #ffffff;
  --accent-hover: #e0e0e0;
  --link: #aaaaaa;
  --orange: #ff9500;
  --packs-green: #e53935;
  --green: #e53935;
  --red: #e53935;
  --pink: #ff2d55;
  --surface: #1a1a1a;
  --surface2: #272727;
  --surface3: #3a3a3a;
  --sidebar-width: 280px;
}

html { font-size: 16px; }
body {
  font-family: -apple-system, "system-ui", "Apple Color Emoji", "SF Pro", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: none; }
a:hover { opacity: 0.85; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ===== LAYOUT: Sidebar + Main ===== */
.app { min-height: 100vh; }

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--separator);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  padding: 8px 12px 24px;
  letter-spacing: -0.02em;
}

.sidebar-logo-img {
  max-width: 100%;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.sidebar-artists-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 12px 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.sidebar-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-item svg {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.sidebar-item.active svg {
  color: #ffffff;
}

.sidebar-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--separator);
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.15s;
}
.sidebar-logout-btn:hover { color: var(--text); }

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Main content area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px 40px 120px;
  min-height: 100vh;
  max-width: 100%;
}

/* ===== Legal Pages ===== */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.legal-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.legal-subtitle {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.legal-date {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.legal-content {
  font-size: 16px;
  color: var(--text);
}

.legal-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.legal-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-top: 24px;
  margin-bottom: 12px;
}

.legal-content p {
  margin-bottom: 16px;
  color: var(--text);
}

.legal-content ul {
  margin-bottom: 16px;
  padding-left: 20px;
}

.legal-content li {
  margin-bottom: 8px;
  color: var(--text);
}

.legal-content a {
  color: var(--accent);
  text-decoration: none;
}

.legal-content a:hover {
  text-decoration: underline;
}

.legal-separator {
  border: none;
  height: 1px;
  background: var(--separator);
  margin: 48px 0;
}

/* ===== Site Footer ===== */
.site-footer {
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid var(--separator);
  text-align: center;
}

.footer-links {
  font-size: 14px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-separator {
  color: var(--text-tertiary);
  margin: 0 12px;
}

.section-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.97); }

.btn-primary, .btn-save, .btn-secondary {
  background: #e53935;
  color: #ffffff;
  border-radius: 6px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover { color: var(--text); }

.btn-danger {
  background: #e53935;
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #d32f2f; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-success {
  background: rgba(229, 57, 53, 0.15);
  color: var(--red);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
}
.form-group input::placeholder, .form-group textarea::placeholder {
  color: var(--text-tertiary);
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ===== Beat list (Apple Music song rows) ===== */
.beat-list {
  border-top: 1px solid var(--separator);
}

.beat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--separator);
  background: transparent;
  transition: background 0.1s;
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  box-shadow: none;
}

.beat-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.beat-artwork {
  width: 50px;
  height: 50px;
  border-radius: 5px;
  background: var(--surface);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.beat-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

.beat-artwork .icon { font-size: 1.2rem; opacity: 0.4; }
.beat-artwork-text {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.beat-info { flex: 1; min-width: 0; }
.beat-title { font-weight: 600; font-size: 15px; color: var(--text); }
.beat-inline-meta { font-weight: 400; font-size: 12px; color: #555; margin-left: 6px; }
.exclusive-badge { font-size: 10px; font-weight: 700; color: var(--accent); background: rgba(229,57,53,0.15); padding: 2px 8px; border-radius: 4px; margin-left: 8px; letter-spacing: 0.5px; }
.beat-meta { font-size: 13px; color: #555; margin-top: 2px; }
.beat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.beat-artist-link { color: var(--text-secondary); text-decoration: none; }
.beat-artist-link:hover { color: var(--text); text-decoration: underline; }

.beat-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}

.beat-actions .btn {
  padding: 6px 10px;
  border-radius: 6px;
}

/* ===== Audio Player (bottom bar) ===== */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: none;
  padding: 0;
  display: none;
  z-index: 100;
  flex-direction: column;
}

.player.active { display: flex; }

/* Progress bar spanning full width at top of player */
.player-progress {
  width: 100%;
  height: 6px;
  background: var(--surface3);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: height 0.1s;
}
.player-progress:hover { height: 10px; }

.player-progress-fill {
  height: 100%;
  background: #e53935;
  width: 0%;
  transition: width 0.15s linear;
  pointer-events: none;
}

.player-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 24px;
  cursor: pointer;
}
.player-meta {
  font-size: 11px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.player-artwork {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--surface2);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-info {
  min-width: 0;
  width: 160px;
  flex-shrink: 0;
}

.player-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-title.scrolling, .player-meta.scrolling {
  text-overflow: clip;
  animation: marquee var(--scroll-dur, 8s) linear infinite;
}
@keyframes marquee {
  0%, 10% { transform: translateX(0); }
  90%, 100% { transform: translateX(var(--scroll-dist, -50%)); }
}

.player-time {
  font-size: 12px;
  font-family: inherit;
  color: var(--text-secondary);
  white-space: nowrap;
  margin-top: 2px;
}

/* Play button — filled triangle, no circle */
.play-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
  border-radius: 0;
}

.play-btn:hover { opacity: 0.7; }
.play-btn svg { fill: var(--text); stroke: none; }

/* Volume toggle + vertical popup */
.volume-toggle-wrap {
  position: relative;
  flex-shrink: 0;
}

.player-ctrl-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
}
.player-ctrl-btn:hover { color: var(--text); }

.loop-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
}
.loop-btn:hover { color: var(--text); }
.loop-btn.active { color: var(--accent); }

.vol-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s;
}
.vol-btn:hover { color: var(--text); }

.volume-popup {
  display: none;
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--separator);
  border-radius: 8px;
  padding: 16px 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 110;
}
.volume-popup.show { display: block; }

.volume-slider-v {
  -webkit-appearance: slider-vertical;
  appearance: auto;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 6px;
  height: 100px;
  accent-color: var(--accent);
  outline: none;
}

/* ===== Fullscreen Player ===== */
.full-player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
.full-player-overlay.show { display: flex; }

.full-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px;
  max-width: 420px;
  width: 100%;
}

.full-player-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}
.full-player-close:hover { color: var(--text); }

.full-player-artwork {
  width: 280px;
  height: 280px;
  border-radius: 12px;
  background: var(--surface2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.full-player-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.full-player-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-player-progress-wrap {
  width: 100%;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.full-player-progress-fill {
  height: 100%;
  background: var(--text);
  border-radius: 2px;
  width: 0%;
  transition: width 0.15s linear;
}

.full-player-time {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 12px;
  color: var(--text-secondary);
}

.full-player-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}

.full-play-btn {
  width: 64px;
  height: 64px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}
.full-play-btn:hover { opacity: 0.7; }
.full-play-btn svg { fill: var(--text); stroke: none; }

.full-loop-btn, .full-ctrl-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.full-loop-btn:hover, .full-ctrl-btn:hover { color: var(--text); }

.full-player-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: var(--text-secondary);
}
.full-volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  outline: none;
  accent-color: #ffffff;
}
.full-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
  cursor: pointer;
}

/* ===== Auth screens ===== */
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0 16px;
  box-sizing: border-box;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 32px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-card .btn-save {
  background: #e53935;
  color: #ffffff;
  border-radius: 6px;
  font-size: 16px;
  padding: 12px;
  text-align: center;
  justify-content: center;
  width: 100%;
}

.auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== Table ===== */
.log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.log-table th { text-align: left; color: var(--text-secondary); padding: 8px; border-bottom: 1px solid var(--separator); font-weight: 500; }
.log-table td { padding: 8px; border-bottom: 1px solid var(--separator); }

/* ===== Permission badges ===== */
.perm-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.perm-listen { background: rgba(229,57,53,0.12); color: var(--red); }
.perm-download { background: rgba(229,57,53,0.15); color: var(--red); }
.perm-stems { background: rgba(255,159,10,0.15); color: var(--orange); }

/* ===== Empty state ===== */
.empty { text-align: center; padding: 48px; color: var(--text-secondary); }
.empty .icon { font-size: 2rem; margin-bottom: 12px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  color: #ffffff;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s;
}
.toast.show { opacity: 1; }

/* ===== Profile ===== */
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-placeholder {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-info { flex: 1; }
.profile-username { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.profile-bio { font-size: 15px; color: var(--text-secondary); margin-top: 6px; line-height: 1.4; }

.profile-edit-header { display: flex; align-items: center; gap: 20px; }
.profile-avatar-large {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar-large img, .profile-edit-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-edit-avatar-placeholder {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Producer card */
.producer-card { transition: background 0.15s; }
.producer-card:hover { background: rgba(255,255,255,0.06); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  animation: fadeIn 0.2s ease;
}
.modal h3 { margin-bottom: 16px; font-size: 20px; font-weight: 700; }

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== Permission toggles ===== */
.perm-artist-list { margin-top: 12px; max-height: 50vh; overflow-y: auto; }
.perm-artist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--separator);
  gap: 12px;
}
.perm-artist-row:last-child { border-bottom: none; }
.perm-artist-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.perm-artist-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.perm-artist-avatar img { width: 100%; height: 100%; object-fit: cover; }
.perm-artist-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perm-toggles { display: flex; gap: 6px; flex-shrink: 0; }
.perm-toggle {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: var(--surface2);
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  transition: all 0.15s;
}
.perm-toggle:hover { opacity: 0.85; }
.perm-toggle.active {
  background: #e53935;
  color: #ffffff;
}

/* ===== Profile view ===== */
.profile-view-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 20px;
}

.profile-view-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.profile-view-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-view-initial { font-size: 3rem; font-weight: 700; color: var(--accent); }
.profile-view-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.profile-view-bio {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 400px;
  margin-top: 8px;
}

/* Role badges */
.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  background: var(--surface2);
  color: var(--text-secondary);
}
.role-badge-producer, .role-badge.producer { background: #e53935; color: #ffffff; border: none; border-radius: 6px; padding: 2px 10px; font-size: 11px; font-weight: 600; }
.role-badge-artist, .role-badge.artist { background: #e53935; color: #ffffff; border: none; border-radius: 6px; padding: 2px 10px; font-size: 11px; font-weight: 600; }

/* ===== Filter bar ===== */
.filter-bar { margin-bottom: 16px; }
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 6px;
}
.search-wrap svg { color: var(--text-secondary); flex-shrink: 0; }
.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}
.search-input::placeholder { color: var(--text-tertiary); }
.tag-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-btn {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: var(--surface2);
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  transition: all 0.15s;
}
.tag-btn:hover { color: var(--text); }
.tag-btn.active { background: #e53935; color: #ffffff; }

/* ===== Mood label ===== */
.mood-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface2);
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

/* Last played */
.last-played { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.last-played.no-plays { color: var(--text-tertiary); }

/* Email verification banner */
.verify-banner {
  background: rgba(255,159,10,0.12);
  border-radius: 6px;
  color: var(--orange);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}
.verify-banner a { color: var(--orange); text-decoration: underline; }

/* ===== Feedback ===== */
.feedback-wrap { display: flex; gap: 4px; flex-shrink: 0; }
.fb-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s;
}
.fb-btn:hover { background: rgba(255,255,255,0.08); }
.fb-btn.fb-heart:hover { color: var(--pink); }
.fb-btn.fb-heart.active { color: var(--pink); }
.fb-indicators { font-size: 12px; margin-top: 2px; }
.fb-ind-heart { color: var(--pink); font-weight: 600; }
.access-btn.access-active {
  background: rgba(229,57,53,0.15) !important;
  color: var(--red) !important;
}
.fb-count-heart {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 14px;
  color: var(--pink);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 36px;
  justify-content: flex-end;
}
.fb-count-heart.no-likes { color: var(--text-secondary); }
.fb-stat { text-align: center; min-width: 80px; }
.fb-stat-num { font-size: 32px; font-weight: 700; }
.fb-stat-label { font-size: 13px; color: var(--text-secondary); }
.fb-stat-name { font-size: 15px; font-weight: 600; margin-top: 2px; }
.fb-details { margin-top: 12px; border-top: 1px solid var(--separator); padding-top: 8px; }
.fb-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--separator);
}
.fb-detail-row:last-child { border-bottom: none; }
.fb-detail-name { font-size: 14px; font-weight: 500; flex: 1; }
.fb-detail-reaction { display: flex; align-items: center; }
.fb-detail-reaction.like { color: var(--red); }
.fb-detail-time { font-size: 12px; color: var(--text-secondary); }

/* Version list */
.version-list { margin-top: 8px; }
.version-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--separator);
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.version-item:hover { background: rgba(255,255,255,0.04); }
.version-item.selected { border-color: var(--text); background: rgba(255,255,255,0.06); }
.version-item-radio { font-size: 14px; color: var(--text-secondary); flex-shrink: 0; }
.version-item.selected .version-item-radio { color: var(--text); }
.version-item-info { display: flex; flex-direction: column; gap: 2px; }
.version-item-name { font-weight: 600; color: var(--text); font-size: 14px; }
.version-item-meta { font-size: 12px; color: var(--text-secondary); }

/* Edit modal close */
.edit-modal-close {
  background: none; border: none; color: var(--text-secondary);
  font-size: 28px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.edit-modal-close:hover { color: var(--text); }

/* Save button states */
.btn-save-edit {
  width: 100%;
  padding: 12px;
  margin-top: 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface3);
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}
.btn-save-edit:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-save-edit.dirty { background: #e53935; color: #ffffff; opacity: 1; }
.btn-save-edit.dirty:hover { background: #d32f2f; }

/* Selection */
::selection { background: rgba(255,255,255,0.3); color: #fff; }

/* Avatars — circular */
.profile-avatar, .profile-avatar img,
.profile-avatar-large, .profile-avatar-large img,
.profile-view-avatar, .profile-view-avatar img,
.perm-artist-avatar, .perm-artist-avatar img { border-radius: 50% !important; }

/* SVG icons */
.btn svg, .beat-actions svg, .icon svg, .empty .icon svg,
.sidebar-item svg {
  display: inline-block;
  vertical-align: middle;
}

/* ===== Category labels ===== */
.category-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  #backHeader {
    margin-left: 0 !important;
    top: 48px !important;
  }
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 20px 16px 160px;
    overflow-x: hidden;
    max-width: 100vw;
  }
  .card {
    overflow-x: hidden;
    word-break: break-word;
  }

  .player-inner {
    padding: 10px 12px;
    justify-content: flex-start;
  }
  .player-info {
    flex: 1;
    max-width: none;
  }

  .section-title {
    font-size: 28px;
  }

  .beat-item {
    flex-wrap: nowrap;
  }
  .beat-info {
    flex: 1;
    min-width: 0;
  }
  .beat-actions {
    flex-shrink: 0;
  }

  /* Mobile bottom nav */
  .mobile-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000000;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid var(--separator);
    z-index: 90;
    padding: 8px 0 calc(env(safe-area-inset-bottom, 8px) + 4px);
    justify-content: space-around;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    font-size: 10px;
    color: var(--text-secondary);
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .mobile-nav-item svg {
    width: 24px;
    height: 24px;
  }

  .mobile-nav-item.active {
    color: #ffffff;
  }

  .player.active {
    bottom: 64px;
  }

  .form-row { flex-direction: column; gap: 0; }
  .beat-actions { flex-wrap: nowrap; }
  .perm-artist-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .perm-toggles { padding-left: 42px; }
}

.mobile-nav { display: none; }
.mobile-header { display: none; }

/* Mobile header + profile */
@media (max-width: 768px) {
  .mobile-header {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: var(--bg);
    border-bottom: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 80;
  }

  .mobile-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
  }

  .mobile-profile-btn {
    cursor: pointer;
    position: relative;
  }

  .mobile-profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .mobile-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-profile-menu {
    position: fixed;
    top: 48px;
    right: 8px;
    background: var(--surface2);
    border: 1px solid var(--separator);
    border-radius: 8px;
    padding: 4px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    z-index: 85;
    display: none;
  }
  .mobile-profile-menu.show { display: block; }
  .mobile-profile-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
  }
  .mobile-profile-menu button:hover { background: rgba(255,255,255,0.08); }

  .main-content {
    padding-top: 64px !important;
  }
}

/* Player when active with mobile nav */
@media (min-width: 769px) {
  .player.active ~ .mobile-nav { display: none; }
}

/* ===== ADMIN DASHBOARD ===== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.admin-stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
}
.admin-stat-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.admin-stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.admin-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-role-producer { background: rgba(255,255,255,0.1); color: #ccc; }
.admin-role-artist { background: rgba(255,255,255,0.06); color: #999; }
.admin-role-admin { background: rgba(255,255,255,0.15); color: #fff; }

/* ===== BILLING / SUBSCRIPTION ===== */
.billing-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 768px) {
  .billing-plans-grid { grid-template-columns: 1fr; }
}
.billing-plan-card {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: 16px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}
.billing-plan-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.billing-plan-card.current { border-color: var(--red); }
.billing-plan-card.popular { border-color: var(--red); }
.billing-popular-badge {
  position: absolute;
  top: -10px;
  background: var(--red);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.billing-plan-name {
  font-size: 20px;
  font-weight: 700;
  margin-top: 8px;
  margin-bottom: 4px;
}
.billing-plan-price {
  font-size: 36px;
  font-weight: 800;
  color: var(--red);
  margin-bottom: 4px;
}
.billing-plan-period {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}
.billing-plan-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.billing-plan-features {
  list-style: none;
  text-align: left;
  width: 100%;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}
.billing-plan-features li {
  padding: 6px 0;
  border-bottom: 1px solid var(--separator);
}
.billing-plan-features li:last-child { border-bottom: none; }
.billing-btn-subscribe {
  width: 100%;
  padding: 12px;
  background: var(--red);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.billing-btn-subscribe:hover { opacity: 0.85; }
.billing-btn-current {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--red);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--red);
  border-radius: 10px;
  cursor: default;
}
.billing-status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.billing-status-badge.active { background: rgba(229,57,53,0.15); color: var(--red); }
.billing-status-badge.past_due { background: rgba(255,68,68,0.15); color: var(--red); }
.billing-status-badge.canceled { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.billing-progress-bar {
  height: 6px;
  background: var(--separator);
  border-radius: 3px;
  overflow: hidden;
}
.billing-progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 3px;
  transition: width 0.3s;
}
.billing-usage-section { margin-top: 12px; }

/* Legal Pages */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  color: var(--text);
}
.legal-header { margin-bottom: 32px; }
.legal-back {
  color: var(--red);
  text-decoration: none;
  font-size: 14px;
  display: inline-block;
  margin-bottom: 16px;
}
.legal-back:hover { text-decoration: underline; }
.legal-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}
.legal-effective {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}
.legal-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
}
.legal-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text);
}
.legal-content p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 12px;
}
.legal-content ul {
  margin: 0 0 12px 20px;
  padding: 0;
}
.legal-content li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.legal-content a {
  color: var(--red);
  text-decoration: none;
}
.legal-content a:hover { text-decoration: underline; }
.legal-content strong { color: var(--text); }
.legal-contact {
  background: var(--surface);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
}
.legal-contact p { margin: 0; }
.legal-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--separator);
  text-align: center;
  font-size: 13px;
}
.legal-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}
.legal-footer a:hover { color: var(--text); }
.auth-footer-links {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
}
.auth-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}
.auth-footer-links a:hover { color: var(--text); }

/* ===== LANDING PAGE ===== */
.landing { max-width: 100%; overflow-x: hidden; }
.landing-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; max-width: 1100px; margin: 0 auto;
}
.landing-logo { font-size: 22px; font-weight: 800; letter-spacing: 2px; color: var(--text); white-space: nowrap; }
.landing-hero {
  text-align: center; padding: 80px 24px 60px; max-width: 720px; margin: 0 auto;
}
.landing-hero h1 {
  font-size: clamp(32px, 6vw, 56px); font-weight: 800; line-height: 1.1; margin-bottom: 24px;
}
.landing-sub { font-size: 18px; color: var(--text-secondary); line-height: 1.6; max-width: 560px; margin: 0 auto; }
.landing-artist-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.landing-artist-link:hover { text-decoration: underline; }
.landing-section {
  max-width: 900px; margin: 0 auto; padding: 60px 24px; text-align: center;
  border-top: 1px solid var(--separator);
}
.landing-section h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 700; margin-bottom: 16px; }
.landing-dim { color: var(--text-secondary); font-size: 16px; line-height: 1.6; }
.landing-problems {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 24px;
}
.landing-problems span {
  background: rgba(255,255,255,0.06); padding: 10px 20px; border-radius: 8px;
  font-size: 15px; color: var(--text-secondary);
}
.landing-features { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.landing-feature {
  background: rgba(229,57,53,0.08); border: 1px solid rgba(229,57,53,0.2);
  padding: 12px 24px; border-radius: 8px; font-size: 15px; color: var(--text);
  max-width: 400px; width: 100%;
}
.landing-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 32px; max-width: 640px; margin-left: auto; margin-right: auto;
}
@media (max-width: 600px) { .landing-two-col { grid-template-columns: 1fr; gap: 20px; max-width: 320px; } }
.landing-artist-img { width: 280px; height: 280px; background-size: cover; background-position: center; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
@media (max-width: 600px) { .landing-artist-img { width: 140px; height: 140px; } #landingArtists .landing-artist-wrap { gap: 16px !important; } }
.landing-two-col > div {
  background: var(--surface); border: 1px solid var(--separator); border-radius: 12px;
  padding: 28px 24px; text-align: center;
}
.landing-steps { list-style: none; padding: 0; color: var(--text-secondary); line-height: 2.2; font-size: 15px; counter-reset: step; }
.landing-steps li { color: var(--text-secondary); }
.landing-steps li::before { counter-increment: step; content: counter(step) ". "; color: var(--accent); font-weight: 600; }
.landing-list-x, .landing-list-check { list-style: none; padding: 0; line-height: 2.2; font-size: 15px; }
.landing-list-x li::before { content: '✖ '; color: #ff453a; }
.landing-list-check li::before { content: '✔ '; color: var(--red); }
.landing-pricing {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px;
}
@media (max-width: 600px) { .landing-pricing { grid-template-columns: 1fr; max-width: 320px; margin: 8px auto 0; } }
.landing-plan {
  background: var(--surface); border: 1px solid var(--separator); border-radius: 12px;
  padding: 32px 24px; text-align: center;
}
.landing-plan.featured { border-color: var(--red); position: relative; }
.landing-plan.featured::after {
  content: 'POPULAR'; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: #ffffff; font-size: 11px; font-weight: 700;
  padding: 2px 12px; border-radius: 4px;
}
.landing-plan h3 { font-size: 18px; margin-bottom: 8px; }
.landing-price { font-size: 36px; font-weight: 800; margin-bottom: 16px; }
.landing-price span { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.landing-plan ul { list-style: none; padding: 0; color: var(--text-secondary); line-height: 2; font-size: 14px; }
.landing-cta {
  text-align: center; padding: 80px 24px; max-width: 600px; margin: 0 auto;
  border-top: 1px solid var(--separator);
}
.landing-cta h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 700; line-height: 1.3; }
.landing-footer {
  text-align: center; padding: 40px 24px; color: var(--text-secondary); font-size: 13px;
  border-top: 1px solid var(--separator);
}
.landing-footer a { color: var(--text-secondary); text-decoration: none; }
.landing-footer a:hover { color: var(--text); }
/* Artist & Album Grids */
/* Discover Hero */
.discover-hero {
  width: 100%; height: 320px; border-radius: 16px; background-size: cover; background-position: center top;
  display: flex; align-items: flex-end; cursor: pointer; overflow: hidden; margin-bottom: 32px;
  transition: transform 0.2s;
}
.discover-hero:hover { transform: scale(1.005); }
.discover-hero-content { padding: 24px 28px; width: 100%; }
.discover-hero-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); margin-bottom: 6px; }
.discover-hero-title { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }

/* Discover Artist Row */
.discover-artist-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; padding: 8px 0 16px; max-width: 100%; box-sizing: border-box; }
.discover-artist-chip { cursor: pointer; text-align: center; transition: opacity 0.2s; display: flex; flex-direction: column; align-items: center; width: 100%; }
.discover-artist-chip:hover { opacity: 0.8; }
.discover-artist-img { width: 100%; aspect-ratio: 1; border-radius: 8px; background: var(--surface); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); }
.discover-artist-name { font-weight: 600; font-size: 13px; margin-top: 10px; max-width: 120px; line-height: 1.3; }

/* Section Title Links */
/* Sort Bar */
.sort-bar { display: flex; gap: 8px; padding: 8px 0 16px; flex-wrap: wrap; }
.sort-btn { background: transparent; border: 1px solid var(--separator); color: var(--text-secondary); font-size: 12px; font-weight: 500; padding: 6px 14px; border-radius: 20px; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.sort-btn:hover { border-color: var(--text-tertiary); color: var(--text); }
.sort-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

.section-title-link { color: inherit; text-decoration: none; }
.section-title-link:hover { color: var(--accent); }

/* Album & Artist Grids */
.artist-grid, .album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; padding: 8px 0; max-width: 100%; box-sizing: border-box; }
.artist-card, .album-card { cursor: pointer; text-align: left; padding: 12px; border-radius: 10px; transition: background 0.2s; }
.artist-card:hover, .album-card:hover { background: var(--surface-hover, #1a1a1a); }
.artist-avatar { width: 100px; height: 100px; border-radius: 50%; background: var(--surface); background-size: cover; background-position: center; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; }
.artist-card-name { font-weight: 600; font-size: 14px; margin-top: 4px; text-align: center; }
.album-artwork { width: 100%; aspect-ratio: 1; border-radius: 8px; background: var(--surface); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.album-card-title { font-weight: 600; font-size: 13px; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-card-artist { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

@media (max-width: 600px) {
  .discover-hero { height: 220px; border-radius: 12px; margin-bottom: 24px; }
  .discover-hero-title { font-size: 24px; }
  .discover-artist-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .discover-artist-chip { width: 100%; }
  .discover-artist-img { width: 100%; height: auto; }
  .discover-artist-name { font-size: 12px; max-width: 140px; }
  .album-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; overflow: hidden; max-width: 100%; }
  .album-card { padding: 8px; overflow: hidden; max-width: 100%; box-sizing: border-box; }
  .album-card .album-artwork { width: 100%; aspect-ratio: 1; max-width: 100%; overflow: hidden; }
  .album-card-title { font-size: 12px; }
}

/* ===== ARTIST PAGE TABS ===== */
.artist-tabs {
  display: flex;
  gap: 32px;
  margin-bottom: 24px;
}

.artist-tab {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 0 12px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.artist-tab:hover {
  color: var(--text);
}

.artist-tab.active {
  color: var(--text);
  border-bottom-color: #e53935;
}

/* ===== TRACK MENU ===== */
.track-menu {
  background: #1a1a1a;
  border: 1px solid var(--separator);
  border-radius: 6px;
  padding: 4px 0;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.track-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.track-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ===== EXCLUSIVE BADGES ===== */
.exclusive-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  background: #e53935;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ===== ALBUM/ARTIST HEADERS ===== */
.artist-header, .album-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}
.artist-header .section-title { word-break: break-word; }

/* Album track view */
.album-track-item .beat-artwork { display: none; }
.album-track-num {
  width: 32px; min-width: 32px; text-align: center; cursor: pointer;
  color: var(--text-secondary); font-size: 15px; font-variant-numeric: tabular-nums;
}
.album-track-num .track-num-play { display: none; }
.album-track-item:hover .track-num-text { display: none; }
.album-track-item:hover .track-num-play { display: inline; color: var(--text); }
.track-duration { color: var(--text-secondary); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: 4px; }

/* Play overlay on artwork */
.artwork-playable { position: relative; cursor: pointer; }
.artwork-play-overlay {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); border-radius: 4px; color: #fff;
}
.artwork-playable:hover .artwork-play-overlay { display: flex; }

/* Product type selector */
.product-type-btn { border: 1px solid var(--separator) !important; }
.product-type-btn.active { background: #e53935 !important; border-color: #e53935 !important; color: #fff !important; }

.artist-header .artist-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  flex-shrink: 0;
}

.album-header .album-artwork {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .artist-header, .album-header {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    gap: 16px;
  }
  .album-header .album-artwork {
    width: 180px;
    height: 180px;
  }
  
  .artist-tabs {
    justify-content: center;
    gap: 24px;
  }
  
  .track-menu {
    right: auto;
    left: 0;
  }
}
