/* HZMusic Web – Styles
   Design: dark theme, solid colors (minimal gradients), accent #FA586A
   Responsive: desktop sidebar + mobile bottom nav
*/

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  --bg-primary:      #080808;
  --bg-secondary:    #101010;
  --bg-tertiary:     #181818;
  --bg-hover:        #222222;
  --bg-card:         #121212;
  --bg-card-hover:   #1a1a1a;
  --accent:          #FA586A;
  --accent-dim:      rgba(250, 88, 106, 0.15);
  --accent-hover:    #ff6b7c;
  --text-primary:    #ffffff;
  --text-secondary:  #999999;
  --text-tertiary:   #666666;
  --border:          rgba(255,255,255,0.08);
  --border-strong:   rgba(255,255,255,0.14);
  --radius-sm:       5px;
  --radius-md:       8px;
  --radius-lg:       10px;
  --radius-xl:       12px;
  --sidebar-width:   280px;
  --player-height:   88px;
  --mobile-nav-h:    60px;
  --mobile-header-h: 52px;
  --transition:      0.15s ease;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
hr { border: none; border-top: 1px solid var(--border); }

/* Hide browser-native search clear/cancel buttons */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { display: none; }

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ============================================================
   Layout
   ============================================================ */
#app {
  display: grid;
  grid-template-rows: 1fr var(--player-height);
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-areas:
    "sidebar main"
    "player player";
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Sidebar */
#sidebar {
  grid-area: sidebar;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo { margin-bottom: 32px; padding: 0 8px; }
.sidebar-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.nav-list { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover  { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item svg    { flex-shrink: 0; }

/* Separator line, kept out of the nav-items themselves so it never touches
   a button's own hover/active background. */
.nav-divider { height: 1px; background: var(--border); margin: 8px 0; }

.sidebar-footer { margin-top: auto; padding-top: 16px; }

/* Main content */
#main-content {
  grid-area: main;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 28px 16px;
  background: var(--bg-primary);
}

/* Mobile header – hidden on desktop */
#mobile-header {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--mobile-header-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
#back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
#back-btn:hover { color: var(--text-primary); }
.mobile-logo {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.mobile-logo-img {
  height: 24px;
  width: auto;
}

/* Mobile nav – hidden on desktop */
#mobile-nav { display: none; }
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 500;
  transition: color var(--transition);
  border: none;
  background: none;
  cursor: pointer;
}
.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item:hover  { color: var(--text-primary); }

/* ============================================================
   Player Bar
   ============================================================ */
#player-bar {
  grid-area: player;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  user-select: none;
  z-index: 100;
}

.pb-progress-section {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 308px;
}

.pb-progress-wrap {
  height: 3px;
  background: var(--bg-hover);
  cursor: pointer;
  flex: 1;
}
.pb-progress {
  height: 100%;
  background: var(--bg-tertiary);
  position: relative;
  cursor: pointer;
}
.pb-progress::before {
  content: '';
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  background: var(--accent);
}
.pb-progress:hover::after {
  content: '';
  position: absolute;
  top: -4px;
  left: var(--progress, 0%);
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.pb-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  flex: 1 1 100%;
  height: 100%;
}

.pb-track {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 0 280px;
}
.pb-cover {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  position: relative;
  cursor: pointer;
}
.pb-track-info { min-width: 0; flex: 1; }
.pb-title  { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-artist {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.pb-artist:hover { color: var(--text-primary); }
.pb-device { display: block; font-size: 10px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.pb-center {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex: 1;
}
.pb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
  border: none;
  background: none;
  cursor: pointer;
}
.pb-btn:hover { color: var(--text-primary); }
.pb-btn.active { color: var(--accent); }
.pb-like.active { color: var(--accent); }
.pb-play {
  width: 34px;
  height: 34px;
  background: transparent;
  color: #fff;
  border-radius: 50%;
}
.pb-play svg { width: 24px; height: 24px; }

.pb-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 280px;
  justify-content: flex-end;
}
.pb-time { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }

.pb-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}
.pb-volume-icon {
  width: 20px;
  height: 20px;
}
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 3px;
  border-radius: 2px;
  cursor: pointer;
  outline: none;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0;
  height: 0;
}
.volume-slider:hover::-webkit-slider-thumb,
.volume-slider.is-dragging::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 0;
  height: 0;
  border: none;
  background: none;
}
.volume-slider:hover::-moz-range-thumb,
.volume-slider.is-dragging::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  cursor: pointer;
}

/* ============================================================
   Player bar – Ad mode
   ============================================================ */
.pb-ad-mode .pb-progress::before {
  background: #e6a000;
}
.pb-ad-mode .pb-progress:hover::after {
  background: #e6a000;
}
.pb-ad-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(230, 160, 0, 0.15);
  border-radius: var(--radius-sm);
}
.pb-ad-mode .pb-title {
  color: #e6a000;
}
.pb-ad-mode .pb-time {
  color: #e6a000;
}

/* ============================================================
   Views
   ============================================================ */
.view-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

/* Loading */
.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 80px 0;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-hover);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 22px; height: 22px; border-width: 2px; }
/* Inline loading state for a track list — subtle, no full-page spinner */
.track-list-loading {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty / Error states */
.empty-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 14px;
}
.error-state { color: var(--accent); }

/* Sections */
.section { margin-bottom: 24px; }
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Horizontal scroll */
.horizontal-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }

/* Album card */
.album-card {
  flex-shrink: 0;
  width: 130px;
  cursor: pointer;
}
.album-card:hover { background: none; }
.album-card-cover {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
  margin-bottom: 8px;
}
.album-card-info { padding: 0 2px; }
.album-card-title  { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.album-card-artist { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Slightly larger cover buttons on the home screen for more visual weight. */
.view-home .album-card { width: 150px; }
.view-home .album-card-cover { width: 150px; height: 150px; }
.view-home .artist-pill { width: 132px; }
.view-home .artist-pill-avatar { width: 126px; height: 126px; }

/* Cover image helpers */
.cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-fallback {
  width: 100%;
  height: 100%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 24px;
}
.cover-fallback.small { font-size: 14px; }
.cover-fallback.playlist-fallback { color: var(--accent); opacity: 0.6; }

/* Artist profile image (used inside pill avatar and hero avatar) */
.artist-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Artist pill */
.artist-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 120px;
  cursor: pointer;
  flex-shrink: 0;
}
.artist-pill-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
  overflow: hidden;
}
.artist-pill-name {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  color: var(--text-secondary);
}

/* Playlist card */
.playlist-card {
  flex-shrink: 0;
  width: 130px;
  cursor: pointer;
}
.playlist-card-cover {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
  margin-bottom: 8px;
}
.playlist-card-info { padding: 0 2px; }
.playlist-card-name  { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.playlist-card-count { font-size: 11px; color: var(--text-secondary); }

.playlist-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* ============================================================
   Featured Card (Home)
   ============================================================ */
.featured-section { margin-bottom: 28px; }

/* Featured widget — full-bleed artist banner background with a dark gradient
   and the track info overlaid, mirroring the iOS FeaturedCard. */
.featured-card {
  position: relative;
  height: 220px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.featured-card:hover { transform: translateY(-2px); box-shadow: 0 20px 48px rgba(0,0,0,0.45); }
.featured-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.featured-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.85) 100%);
}
.featured-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
}
.featured-text { min-width: 0; }
.featured-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  padding: 3px 9px;
  margin-bottom: 10px;
}
.featured-title  { font-size: 24px; font-weight: 800; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.3px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.45); }
.featured-artist { font-size: 14px; color: rgba(255,255,255,0.8); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-play-featured {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-play-featured svg { width: 28px; height: 28px; }
.btn-play-featured:hover { background: var(--accent-hover); transform: scale(1.06); }

.featured-cover-link { cursor: pointer; }

/* Featured row — pairs the featured widget (~40%) with the personalised
   "Zuletzt gehört" cards (~60%) to its right. */
.featured-row {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 20px;
  align-items: stretch;
}

/* Personalised "Zuletzt gehört" widget: 6 horizontal cards, 3 rows × 2 cols. */
.recent-widget {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.recent-widget-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}
.recent-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  min-height: 0;
}
.recent-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 10px 6px 6px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}
.recent-card:hover { background: var(--bg-tertiary); }
.recent-card-cover {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
  position: relative;
}
.recent-card-info { min-width: 0; }
.recent-card-title {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}
.recent-card-artist {
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-widget--empty {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
}
.recent-widget-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.btn-full { width: 100%; justify-content: center; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(220, 38, 38, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-danger:hover { background: rgba(220, 38, 38, 0.25); }
.btn-danger.btn-full { width: 100%; justify-content: center; }

.btn-icon-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
  background: none;
}
.btn-icon-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.btn-icon:hover { background: var(--bg-hover); }

/* ============================================================
   Track Row
   ============================================================ */
.track-list { display: flex; flex-direction: column; }

.track-row {
  display: grid;
  grid-template-columns: 28px 40px 1fr auto 36px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.track-row:hover { background: var(--bg-card-hover); }
.track-row.is-playing { background: var(--accent-dim); }

.track-num {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  flex-shrink: 0;
}
.track-row.is-playing .track-num { color: var(--accent); }

.track-cover-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
  position: relative;
  flex-shrink: 0;
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.track-title  { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; }
.track-artist-line { display: inline-flex; align-items: center; gap: 0; overflow: hidden; }
.track-meta { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; }
.track-title.accent { color: var(--accent); }

.track-dur { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; text-align: right; }
.track-streams {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) {
  .track-streams { display: none; }
}

.track-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition: color var(--transition), background var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  opacity: 0;
}
.track-row:hover .track-menu-btn { opacity: 1; }
.track-menu-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

/* No track number variant */
.track-row:not(:has(.track-num)) {
  grid-template-columns: 40px 1fr auto 36px;
}

/* Variant without cover art (album/release view) */
.track-row.no-cover {
  grid-template-columns: 28px 1fr auto 36px;
}
.track-row.no-cover:not(:has(.track-num)) {
  grid-template-columns: 1fr auto 36px;
}
/* Variant with streams column (artist top-tracks) */
.track-row.no-cover.has-streams {
  grid-template-columns: 28px 1fr auto 36px;
}

/* Per-track artist buttons shown in the album/release view */
.track-artist-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  min-width: 0;
}
.track-artist-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.track-artist-btn:hover { color: var(--accent); text-decoration: underline; }
.track-artist-sep {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-right: 3px;
}

/* ============================================================
   Album View
   ============================================================ */
.album-hero {
  display: flex;
  gap: 32px;
  margin-bottom: 12px;
  align-items: center;
}
.album-hero-left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.album-hero-cover {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  flex-shrink: 0;
  position: relative;
}
.album-hero-info { flex: 1; min-width: 0; }
.album-type-badge {
  display: inline;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: inherit;
}
.album-hero-title  { font-size: 52px; font-weight: 800; margin-bottom: 6px; letter-spacing: -1.5px; }
.album-hero-artist { font-size: 15px; margin-bottom: 4px; }
.album-hero-meta   { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-start; margin-top: 16px; }
.album-track-footer {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 12px 4px 4px;
}

.artist-link { color: var(--accent); cursor: pointer; font-weight: 600; }
.artist-link:hover { text-decoration: underline; }

/* Mobile-only artist row list (hidden on desktop) */
.album-mobile-artists { display: none; }
.album-artist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  font: inherit;
}
.album-artist-row:hover,
.album-artist-row:active { background: var(--bg-hover); }
/* Artist pill inside row button: horizontal compact layout */
.album-artist-row .artist-pill {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: auto;
  flex: 1;
}
.album-artist-row .artist-pill-avatar {
  width: 36px;
  height: 36px;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.album-artist-row .artist-pill-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-artist-row-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.album-track-list { padding: 4px 0; }

/* ============================================================
   Artist View
   ============================================================ */
.artist-hero {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 32px;
  padding: 24px;
  min-height: 340px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(250, 88, 106, 0.42) 0%, rgba(26, 26, 31, 0.95) 100%);
  border-radius: var(--radius-xl);
}
.artist-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(11,11,14,0.72) 100%);
  z-index: 1;
}
.artist-hero-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.artist-hero-avatar,
.artist-hero-info {
  position: relative;
  z-index: 2;
}
.artist-hero-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(11, 11, 14, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.artist-hero-initial { font-size: 40px; font-weight: 800; color: var(--accent); }
.artist-hero-name { font-size: 64px; font-weight: 800; letter-spacing: -0.5px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.45); }

/* When a meta bar follows, remove bottom radius so the two elements connect flush */
.artist-hero--with-meta {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  margin-bottom: 0;
}

/* Meta bar — sits directly below the hero; gradient above fades banner into bar */
.artist-meta-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: #0b0b0e;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  margin-bottom: 32px;
  z-index: 0;
}
.artist-meta-bar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 52px;
  background: linear-gradient(to bottom, transparent, #0b0b0e);
  pointer-events: none;
  z-index: 2;
}
.artist-meta-listeners,
.artist-meta-verified {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}
.artist-meta-verified {
  color: var(--accent);
}

/* Discography filter chips */
.disc-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.disc-filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.disc-filter-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.disc-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.disc-filter-btn.active:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.disc-empty { padding: 8px 0; }

/* ============================================================
   Genre Cards (Homepage)
   ============================================================ */
.genre-card {
  flex-shrink: 0;
  width: 170px;
  height: 220px;
  border-radius: var(--radius-md, 8px);
  background: var(--bg-tertiary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  position: relative;
  overflow: hidden;
  border: none;
  transition: box-shadow 0.18s ease;
}
.genre-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
/* Photo fills the whole card; the name overlays the bottom with a black
   gradient so the artwork is never cut off behind a separate info bar. */
.genre-card-photo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.genre-card-photo svg {
  width: 48px;
  height: 48px;
  color: var(--text-tertiary);
  position: relative;
  z-index: 1;
}
.genre-card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 12px 11px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 45%, transparent 100%);
}
.genre-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
  display: block;
}

/* BPM badge inside track rows */
.track-bpm {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ============================================================
   Playlist View
   ============================================================ */
.playlist-hero { display: flex; gap: 32px; margin-bottom: 12px; align-items: center; }
.playlist-hero-cover {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  flex-shrink: 0;
  position: relative;
}
.playlist-hero-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--accent);
  opacity: 0.7;
}
.playlist-hero-fallback--favorites {
  background: linear-gradient(135deg, rgba(250,88,106,0.18) 0%, rgba(250,88,106,0.06) 100%);
  color: var(--accent);
  opacity: 1;
}

/* 2×2 mosaic cover for user playlists (mirrors iOS PlaylistMosaicCoverView) */
.playlist-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
}
.playlist-mosaic-tile {
  position: relative;
  overflow: hidden;
}
.playlist-mosaic-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.playlist-mosaic-tile .cover-fallback {
  position: absolute;
  inset: 0;
  background: var(--bg-tertiary);
}

/* Favorites playlist card accent */
.playlist-card-favorites .playlist-card-cover {
  background: linear-gradient(135deg, rgba(250,88,106,0.18) 0%, rgba(250,88,106,0.06) 100%);
}
.playlist-card-favorites .cover-fallback { color: var(--accent); opacity: 1; }
.playlist-hero-left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.playlist-hero-info { flex: 1; min-width: 0; }
.playlist-hero-title { font-size: 42px; font-weight: 800; margin-bottom: 8px; letter-spacing: -1px; }
.playlist-hero-meta  { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.playlist-hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-start; }

/* ============================================================
   Library View (tabbed grid)
   ============================================================ */
.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.library-header .view-title { margin-bottom: 0; }

.library-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}
.lib-tab {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.lib-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.lib-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.library-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.library-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  min-width: 0;
}
.library-item:hover { background: var(--bg-hover); }
.library-item-cover {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.library-item:hover .library-item-cover { opacity: 0.82; }
.library-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.library-item-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-item-sub {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   Search View
   ============================================================ */
.view-search { padding-top: 4px; }
.search-bar-wrap { margin-bottom: 20px; }
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--accent); }
.search-icon { color: var(--text-tertiary); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--text-primary);
}
.search-bar input::placeholder { color: var(--text-tertiary); }
.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
  border-radius: 50%;
}
.search-clear:hover { color: var(--text-primary); }
.search-results { min-height: 200px; }
.search-section { margin-bottom: 20px; }
.search-section-title { font-size: 14px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }

/* ============================================================
   Context Menu
   ============================================================ */
.context-menu {
  position: fixed;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 180px;
  overflow: hidden;
}
.context-menu-item {
  padding: 11px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition);
}
.context-menu-item:hover { background: var(--bg-hover); }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  min-width: 320px;
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 12px; overflow-y: auto; flex: 1; }

.modal-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
}
.modal-list-item:hover { background: var(--bg-hover); }
.modal-list-item.accent-item { color: var(--accent); }
.modal-pl-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.modal-pl-name  { font-size: 14px; font-weight: 500; }
.modal-pl-count { font-size: 12px; color: var(--text-secondary); }

/* Settings modal */
.modal-settings { max-width: 360px; }
.settings-user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px 16px;
}
.settings-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.settings-username { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.settings-email    { font-size: 13px; color: var(--text-secondary); }
.settings-divider  { margin: 12px 4px 16px; }
.settings-section  { margin-bottom: 12px; }
.settings-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 6px 4px;
}
.settings-version {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 10px;
}
.settings-loading,
.settings-no-bugs,
.settings-error {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px;
  display: block;
}
.settings-error { color: #ef4444; }

/* Session-ID row in settings */
.settings-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px;
}
.settings-session-label {
  font-size: 14px;
  color: var(--text-primary);
}
.settings-session-id {
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  background: var(--surface-2, rgba(255,255,255,0.06));
  padding: 2px 8px;
  border-radius: 5px;
}

/* Audio-quality selector */
.settings-quality-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px;
}
.settings-quality-label {
  font-size: 14px;
  color: var(--text-primary);
}
.settings-quality-select {
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface-2, rgba(255,255,255,0.06));
  border: 1px solid var(--surface-2, rgba(255,255,255,0.12));
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.settings-quality-note {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  padding: 2px 4px;
}

/* ============================================================
   Settings Page (full view)
   ============================================================ */
.view-settings { max-width: 880px; }
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px);
  padding: 16px 18px;
}
.view-settings .settings-user {
  padding: 18px;
  margin-bottom: 18px;
}
.view-settings .settings-avatar {
  width: 56px;
  height: 56px;
  font-size: 24px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.view-settings .settings-section { margin-bottom: 0; }
.view-settings .settings-section-title { margin-left: 0; margin-bottom: 10px; }
.view-settings #settings-known-bugs-section { margin-bottom: 18px; }
.view-settings .btn-ghost.btn-full { margin-top: 4px; }
.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.view-settings .settings-version { margin-bottom: 0; text-align: right; }
@media (max-width: 768px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* Library header actions (create playlist + settings) */
.library-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* btn-ghost for settings actions */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ghost:hover { background: var(--bg-hover); }
.btn-ghost.btn-full { width: 100%; justify-content: flex-start; }

/* Known bug list */
.known-bug-item {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}
.known-bug-item:last-child { border-bottom: none; }
.known-bug-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.known-bug-title {
  font-size: 13px;
  font-weight: 600;
  flex: 1 1 auto;
}
.known-bug-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.known-bug-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 3px 0 0;
}

/* Bug report modal */
.modal-bug-report { max-width: 400px; }
.bug-report-textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px;
  box-sizing: border-box;
  font-family: inherit;
  margin-bottom: 6px;
}
.bug-report-textarea:focus { outline: none; border-color: var(--accent); }
.bug-report-counter {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  margin: 0 0 10px;
}

/* Legal modal */
.modal-legal { max-width: 480px; }
.legal-modal-body {
  max-height: 65vh;
}
.legal-modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}
.legal-modal-body h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin: 20px 0 6px;
}
.legal-modal-body h2:first-of-type { margin-top: 0; }
.legal-modal-body h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 12px 0 4px;
}
.legal-modal-body p {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0 0 8px;
}
.legal-modal-list {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0 0 8px;
  padding-left: 18px;
}
.legal-modal-list li { margin-bottom: 4px; }
.legal-modal-link {
  color: var(--accent);
  text-decoration: none;
}
.legal-modal-link:hover { text-decoration: underline; }

/* ============================================================
   Full Player
   ============================================================ */
.full-player {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: stretch;
}
.fp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(20px);
}
.fp-content {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  width: 400px;
  max-width: 100%;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px;
  overflow-y: auto;
  gap: 20px;
}
.fp-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.fp-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.fp-artwork {
  width: 280px;
  height: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-tertiary);
  margin-top: 24px;
  position: relative;
}
.fp-meta { width: 100%; }
.fp-track-info { text-align: center; margin-bottom: 20px; }
.fp-title  { font-size: 20px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-artist { font-size: 14px; color: var(--text-secondary); }

.fp-progress-wrap { margin-bottom: 8px; }
.fp-progress-bar {
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  margin-bottom: 6px;
}
.fp-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
}
.fp-progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-primary);
  left: 0%;
  pointer-events: none;
}
.fp-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
}
.fp-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.fp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.fp-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.fp-btn.active { color: var(--accent); }
.fp-play-pause {
  width: 56px;
  height: 56px;
  background: transparent;
  color: #fff;
  border-radius: 50%;
}
.fp-play-pause:hover { background: rgba(255,255,255,0.12); color: #fff; }

.fp-volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}
#fp-volume { flex: 1; }

/* Full Player — sections (up next / song info) */
.fp-section {
  width: 100%;
}
.fp-section:empty { display: none; }
.fp-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

/* Als Nächstes */
.fp-up-next-track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}
.fp-up-next-cover {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
}
.fp-up-next-cover img { width: 100%; height: 100%; object-fit: cover; }
.fp-up-next-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fp-up-next-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-up-next-artist {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Song Infos */
.fp-song-info-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fp-info-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
}
.fp-info-label {
  color: var(--text-secondary);
  min-width: 90px;
  flex-shrink: 0;
}
.fp-info-value {
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.fp-info-value--pre {
  white-space: pre-wrap;
}

/* ============================================================
   Auth Pages (Login / Register / Forgot Password)
   ============================================================ */
#auth-page {
  position: fixed;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  animation: authFadeIn 0.2s ease;
}
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#auth-page::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(250,88,106,0.055) 0%, transparent 65%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 40px 36px 32px;
  position: relative;
  margin: auto 0;
}
.auth-logo {
  text-align: center;
  margin-bottom: 12px;
}
.auth-logo-img {
  height: 48px;
  width: auto;
  display: block;
  margin: 0 auto;
}
.auth-accent {
  height: 2px;
  width: 56px;
  background: var(--accent);
  border-radius: 1px;
  margin: 0 auto 10px;
}
.auth-title {
  font-size: 21px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.55;
}
.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-fp-link {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
  line-height: 1;
}
.auth-fp-link:hover { text-decoration: underline; }
.auth-error {
  background: rgba(220,38,38,0.1);
  border: 1px solid rgba(220,38,38,0.28);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #ff6b6b;
  margin-bottom: 14px;
}
.auth-success-msg {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.28);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #22c55e;
  margin-bottom: 14px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 6px;
  color: var(--text-tertiary);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.btn-auth-switch {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: color var(--transition);
  text-align: center;
}
.btn-auth-switch:hover {
  text-decoration: underline;
}
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.auth-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}
.auth-success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

/* Form fields (shared across auth and app) */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-field label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-field input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
}
.form-field input:focus { border-color: var(--accent); }
.form-field input::placeholder { color: var(--text-tertiary); }

/* Register – avatar upload */
.reg-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.reg-avatar-label { cursor: pointer; }
.reg-avatar-preview {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transition: border-color var(--transition);
}
.reg-avatar-preview:hover { border-color: var(--accent); }
.reg-avatar-preview.has-image { border-style: solid; border-color: var(--accent); }
.reg-avatar-initial {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-tertiary);
  user-select: none;
  line-height: 1;
}
.reg-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition);
}
.reg-avatar-preview:hover .reg-avatar-overlay { opacity: 1; }
.reg-avatar-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Field-level validation errors */
.field-error {
  display: block;
  font-size: 11.5px;
  color: #ff6b6b;
  margin-top: 4px;
  line-height: 1.4;
}
.form-field input.input-error {
  border-color: rgba(220,38,38,0.6);
}
.form-field input.input-error:focus {
  border-color: #ef4444;
}

/* Wider card for plan selection / upgrade */
.auth-card-wide { max-width: 640px; }

/* Sidebar upgrade button */
.btn-sidebar-upgrade {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  margin-bottom: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(250,88,106,0.3);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-sidebar-upgrade:hover {
  background: rgba(250,88,106,0.22);
  border-color: rgba(250,88,106,0.5);
}

/* Plan cards */
.plan-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: -4px;
  margin-bottom: 20px;
}
.plan-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.plan-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  background: var(--bg-secondary);
}
.plan-card:hover { border-color: var(--accent); }
.plan-card-selected {
  border-color: var(--accent);
  background: rgba(250, 88, 106, 0.07);
}
.plan-card-premium { border-color: rgba(250,88,106,0.28); }
.plan-card-premium:hover { border-color: var(--accent); }
.plan-card-premium.plan-card-selected {
  border-color: var(--accent);
  background: rgba(250, 88, 106, 0.09);
  box-shadow: 0 4px 28px rgba(250, 88, 106, 0.14);
}
.plan-card-header {
  margin-bottom: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}
.plan-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}
.plan-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.4px;
}
.plan-price-free {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-tertiary);
}
.plan-period { font-size: 12px; font-weight: 400; color: var(--text-secondary); letter-spacing: 0; }
.plan-value-hint {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 4px;
  min-height: 14px;
}
.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.plan-features li {
  font-size: 12px;
  line-height: 1.4;
  padding-left: 18px;
  position: relative;
}
.plan-feat-ok { color: var(--text-primary); }
.plan-feat-ok::before {
  content: '✓';
  position: absolute;
  left: 0; top: 0;
  color: #22c55e;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}
.plan-feat-no { color: var(--text-tertiary); }
.plan-feat-no::before {
  content: '–';
  position: absolute;
  left: 0; top: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .auth-card-wide { max-width: 420px; }
}

/* Register – password rules */
.reg-rules {
  list-style: none;
  margin: -4px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.reg-rules li {
  font-size: 12px;
  color: var(--text-tertiary);
  padding-left: 16px;
  position: relative;
  line-height: 1.6;
  transition: color var(--transition);
}
.reg-rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #333;
  transition: background var(--transition);
}
.reg-rules li.valid { color: #22c55e; }
.reg-rules li.valid::before { background: #22c55e; }

/* ============================================================
   iOS App Banner (mobile only, injected by JS)
   ============================================================ */
#ios-banner {
  display: none;
  grid-area: banner;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.ios-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  overflow: hidden;
}
.ios-banner-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ios-banner-text {
  flex: 1;
  min-width: 0;
}
.ios-banner-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.ios-banner-text span {
  font-size: 11px;
  color: var(--text-secondary);
}
.ios-banner-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.ios-banner-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ios-banner-close:hover { color: var(--text-secondary); }

/* ============================================================
   Responsive – Mobile
   ============================================================ */
@media (max-width: 768px) {
  #app {
    grid-template-rows: var(--mobile-header-h) 1fr var(--player-height) calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main"
      "player"
      "nav";
  }

  #ios-banner { display: flex; }

  /* Banner row injected by JS when not dismissed */
  #app.show-ios-banner {
    grid-template-rows: var(--mobile-header-h) 56px 1fr var(--player-height) calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    grid-template-areas:
      "header"
      "banner"
      "main"
      "player"
      "nav";
  }

  #sidebar         { display: none; }
  #mobile-header   { display: flex; grid-area: header; }
  #mobile-nav {
    display: flex;
    grid-area: nav;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  #main-content { padding: 16px; }

  .pb-track  { flex: 1; min-width: 0; }
  .pb-right  { display: none; }
  .pb-center { flex: 0 0 auto; }
  .pb-progress-section { padding: 0 12px; }

  /* Featured card: shorter banner on mobile, stacked above the side widget */
  .featured-row { grid-template-columns: 1fr; gap: 16px; }
  .featured-card { height: 180px; }
  .featured-content { padding: 16px; }
  .featured-title { font-size: 20px; }
  .btn-play-featured { width: 46px; height: 46px; }
  /* Recently-played cards: narrower 2 × 2 grid on mobile (only the first 4). */
  .recent-grid { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(2, 1fr); }
  .recent-card:nth-child(n+5) { display: none; }

  /* Album hero: iOS-inspired mobile layout */
  .album-mobile-artists { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .album-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 20px;
  }
  .album-hero-left {
    width: 75%;
    align-items: stretch;
    gap: 0;
    margin: 0 auto 16px;
  }
  .album-hero-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
  }
  .album-hero-info {
    text-align: left;
  }
  .album-hero-title { font-size: 28px; }
  .album-hero-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    margin-top: 0;
  }
  .album-hero-actions .btn-play-all {
    flex: 1;
    justify-content: center;
    padding: 14px 0;
    font-size: 16px;
    border-radius: var(--radius-md);
  }
  .album-hero-actions .btn-save-album {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    justify-content: center;
    padding: 0;
    font-size: 16px;
    border-radius: var(--radius-md);
  }
  .album-hero-artist { display: none; }

  /* Artist hero */
  .artist-hero {
    flex-direction: row;
    align-items: flex-end;
    text-align: left;
    gap: 8px;
    min-height: 260px;
    padding: 16px;
  }
  .artist-hero-avatar { width: 72px; height: 72px; }
  .artist-hero-initial { font-size: 30px; }
  .artist-hero-name { font-size: 30px; }
  .artist-meta-bar { gap: 10px; padding: 8px 16px; }

  /* Playlist hero */
  .playlist-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }
  .playlist-hero-left {
    width: 160px;
    align-items: stretch;
    gap: 12px;
  }
  .playlist-hero-cover { width: 160px; height: 160px; }
  .playlist-hero-actions { justify-content: center; width: 160px; flex-direction: column; flex-wrap: nowrap; }
  .playlist-hero-actions .btn-primary,
  .playlist-hero-actions .btn-danger {
    width: 100%;
    justify-content: center;
    padding: 14px 0;
    font-size: 16px;
    border-radius: var(--radius-md);
  }

  /* Full player on mobile - full width */
  .fp-content {
    width: 100%;
    margin: 0;
    border-left: none;
  }
  .fp-artwork { width: 240px; height: 240px; }

  /* Lyrics panel */
  .lyrics-panel {
    width: 100%;
    bottom: calc(var(--player-height) + var(--mobile-nav-h));
  }

  .view-title { font-size: 22px; }

  /* 3-dot context menu button: always visible on mobile */
  .track-menu-btn { opacity: 1; }
}

@media (max-width: 480px) {
  .pb-center { gap: 6px; }
  .pb-btn    { width: 30px; height: 30px; }
  .pb-play   { width: 30px; height: 30px; }

  /* Compact track row on small screens */
  .track-row {
    grid-template-columns: 36px 1fr auto 32px;
  }
  .track-cover-wrap { display: none; }
  .track-num { font-size: 11px; }
}

/* ============================================================
   Tablet (768–1024px)
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-width: 200px; }
  .pb-volume-wrap { display: none; }
  .pb-right { flex: 0 0 80px; }
  /* Right padding = pb-inner padding (16) + pb-right (80) + gap (12) = 108px.
     Left padding stays 308px (pb-inner padding 16 + pb-track 280 + gap 12). */
  .pb-progress-section { padding-right: 108px; }
}

/* ============================================================
   Player Bar – Desktop (larger controls, raised seekbar)
   ============================================================ */
@media (min-width: 769px) {
  /* Shift the whole control cluster (buttons + seekbar) up together,
     leaving a small gap below the seekbar instead of sitting flush
     against the bottom edge. */
  #player-bar { padding-bottom: 10px; }
  .pb-progress-section { bottom: 10px; }

  .pb-center { gap: 16px; }
  .pb-btn,
  .pb-play {
    width: 42px;
    height: 42px;
  }
  .pb-btn svg  { width: 24px; height: 24px; }
  .pb-play svg { width: 28px; height: 28px; }
}

/* ============================================================
   Cover Lightbox
   ============================================================ */
.cover-lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(12px);
}
.cover-lightbox-img-wrap {
  position: relative;
  z-index: 1;
  width: min(80vmin, 520px);
  height: min(80vmin, 520px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}
.cover-lightbox-img-wrap .cover-img { border-radius: 0; }
.cover-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.55);
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 2;
}
.cover-lightbox-close:hover { background: rgba(0,0,0,0.8); }

/* Clickable album cover in release view */
.album-hero-cover-zoom {
  cursor: zoom-in;
  transition: transform var(--transition), box-shadow var(--transition);
}
.album-hero-cover-zoom:hover {
  transform: scale(1.025);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* ============================================================
   Sidebar Search
   ============================================================ */
.nav-item.active .sidebar-search-wrap,
.sidebar-search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.sidebar-search-icon { flex-shrink: 0; color: var(--accent); width: 20px; height: 20px; }
.sidebar-search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
}
.sidebar-search-input::placeholder { color: var(--text-secondary); }

/* Search-results-only container (sidebar search mode) */
.search-results-only {
  padding-top: 8px;
}

/* ============================================================
   Misc
   ============================================================ */
.accent { color: var(--accent); }

/* ============================================================
   Track Comments (Full Player)
   ============================================================ */

/* Comment bubble overlay on artwork */
.fp-comment-bubble {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  animation: commentFadeIn 0.3s ease;
  z-index: 2;
}
@keyframes commentFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fp-comment-bubble-user {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  display: block;
}
.fp-comment-bubble-text {
  font-size: 13px;
  color: #fff;
  display: block;
  line-height: 1.3;
}
.fp-comment-bubble-body {
  flex: 1;
  min-width: 0;
}

/* Comment avatar (shared) */
.fp-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FA586A, #a0003a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.fp-comment-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Comments section (list below up-next) */
.fp-comments-list {
  max-height: 300px;
  overflow-y: auto;
}
.fp-comment-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.fp-comment-row:last-child { border-bottom: none; }
.fp-comment-body {
  flex: 1;
  min-width: 0;
}
.fp-comment-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 6px;
}
.fp-comment-time {
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  color: var(--text-secondary);
  margin-right: 6px;
}
.fp-comment-text {
  font-size: 14px;
  color: var(--text-primary);
  display: block;
  margin-top: 2px;
  line-height: 1.3;
}

/* Comment input row */
.fp-comment-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.fp-comment-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}
.fp-comment-input:focus {
  border-color: var(--accent);
}
.fp-comment-send {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.fp-comment-send:hover { opacity: 0.85; }
.fp-comment-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Maintenance banner */
.maintenance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(249, 115, 22, 0.12);
  border-bottom: 1px solid rgba(249, 115, 22, 0.3);
  color: #f97316;
  font-size: 13px;
  line-height: 1.4;
  z-index: 100;
  grid-column: 1 / -1;
}
.maintenance-banner.maintenance-active {
  background: rgba(239, 68, 68, 0.12);
  border-bottom-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}
.maintenance-banner button {
  background: none;
  border: none;
  color: inherit;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
  flex-shrink: 0;
}
.maintenance-banner button:hover { opacity: 1; }

/* ============================================================
   Artist Panel
   ============================================================ */

.view-artist-panel {
  padding: 32px 32px 120px;
  max-width: 1200px;
}
.artist-panel-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

/* Streams chart + Top Tracks: side by side once there's room for both,
   stacked below that so neither gets squeezed. */
.ap-dashboard-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  align-items: start;
  gap: 24px;
  margin-bottom: 32px;
}
.ap-dashboard-row > .ap-section { margin-bottom: 0; }

/* Stat cards grid */
.ap-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.ap-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ap-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}
.ap-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sections */
.ap-section {
  margin-bottom: 32px;
}
.ap-section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* Timeline chart */
.ap-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 8px;
}
.ap-chart-bar-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.ap-chart-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}
.ap-chart-bar-wrap:hover .ap-chart-bar {
  background: var(--accent-hover);
}
.ap-chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
  padding: 0 8px;
}

/* Table */
.ap-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ap-table-header {
  display: flex;
  padding: 10px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
}
.ap-table-row {
  display: flex;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.ap-table-row:last-child {
  border-bottom: none;
}
.ap-table-row:hover {
  background: var(--bg-hover);
}
.ap-col-rank {
  width: 36px;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.ap-col-title {
  flex: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ap-col-album {
  flex: 1.5;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}
.ap-col-streams {
  width: 80px;
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .view-artist-panel {
    padding: 16px 16px 120px;
  }
  .ap-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ap-stat-value {
    font-size: 20px;
  }
  .ap-col-album {
    display: none;
  }
  .ap-col-title {
    flex: 1;
  }
}

/* ---- Release management ---- */
.ap-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ap-section-header .ap-section-title {
  margin-bottom: 0;
}

/* ── Artist image management ─────────────────────────────────────────────── */
.ap-images-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: start;
}
.ap-image-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ap-image-preview-wrap {
  width: 160px;
  height: 160px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-hover);
  flex-shrink: 0;
}
.ap-banner-preview-wrap {
  width: 100%;
  height: 120px;
  border-radius: var(--radius);
}
.ap-image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ap-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 8px;
}
.ap-image-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ap-image-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.ap-img-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}
.ap-img-badge-ok      { background: rgba(74,222,128,.15); color: #4ade80; }
.ap-img-badge-missing { background: rgba(248,113,113,.15); color: #f87171; }
.ap-image-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ap-img-upload-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
@media (max-width: 600px) {
  .ap-images-grid { grid-template-columns: 1fr; }
  .ap-image-preview-wrap { width: 120px; height: 120px; }
}

.ap-release-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.ap-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ap-input {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  padding: 8px 12px;
  flex: 1;
  min-width: 140px;
}
.ap-input:focus {
  outline: none;
  border-color: var(--accent);
}
.ap-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.ap-error {
  color: #f87171;
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

.ap-release-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}
.ap-release-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
}
.ap-release-card-header:hover {
  background: var(--bg-hover);
  cursor: pointer;
}
.ap-release-info { min-width: 0; }
.ap-release-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-release-meta-row {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.ap-release-btn-group {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.ap-upload-label {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.ap-upload-label-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.ap-upload-label-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.ap-upload-label-primary {
  background: var(--accent);
  color: #fff;
  border: none;
}
.ap-upload-label-primary:hover { background: var(--accent-hover); }

.ap-release-tracks-wrap {
  border-top: 1px solid var(--border);
}
.ap-no-tracks {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.ap-release-track-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 8px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.ap-release-track-row:last-child { border-bottom: none; }
.ap-release-track-row:hover { background: var(--bg-hover); }
.ap-track-num {
  width: 28px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.ap-track-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-track-dur { color: var(--text-secondary); font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* Explicit badge (E) */
.explicit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.25);
  color: var(--text-muted, #94a3b8);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 0;
  letter-spacing: 0;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}

/* Draft / Published badges */
.ap-draft-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #f59e0b22;
  color: #f59e0b;
  vertical-align: middle;
  margin-left: 6px;
}
.ap-published-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #4ade8022;
  color: #4ade80;
  vertical-align: middle;
  margin-left: 6px;
}

/* Cover badge */
.ap-cover-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: #4ade80;
}
.ap-no-cover-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
}

/* Delete button (danger ghost) */
.btn-danger-ghost {
  background: transparent;
  border: 1px solid #f8717144;
  color: #f87171;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-danger-ghost:hover { background: #f8717122; }
.btn-danger-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* Chevron toggle */
.ap-release-chevron,
.ap-track-expand-btn {
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.ap-chevron-open {
  transform: rotate(180deg);
}

/* Release edit wrap */
.ap-release-edit-wrap {
  border-top: 1px solid var(--border);
  padding: 20px;
}

/* Edit sections */
.ap-edit-section {
  margin-bottom: 24px;
}
.ap-edit-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.ap-edit-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ap-edit-section-header .ap-edit-section-title {
  margin-bottom: 0;
}

/* Input groups with labels */
.ap-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}
.ap-input-group-sm { flex: 0 0 auto; }
.ap-input-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Textarea */
.ap-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}

/* Cover status text */
.ap-cover-status {
  font-size: 13px;
  align-self: center;
}

/* Small upload label variant */
.ap-upload-label-sm {
  font-size: 12px;
  padding: 4px 10px;
}

/* Track edit rows */
.ap-track-edit-row {
  border-bottom: 1px solid var(--border);
}
.ap-track-edit-row:last-child { border-bottom: none; }
.ap-track-edit-header {
  display: flex;
  align-items: center;
  padding: 8px 0;
  gap: 8px;
  font-size: 13px;
}
.ap-track-edit-header:hover { background: var(--bg-hover); }
.ap-track-edit-details {
  padding: 12px 0 16px;
  border-top: 1px solid var(--border);
}
.ap-track-delete-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.ap-track-delete-btn:hover { color: #f87171; background: #f8717122; }

.ap-track-edit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.ap-track-save-status {
  font-size: 13px;
}

/* Release bottom actions */
.ap-release-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.ap-release-actions-right {
  display: flex;
  gap: 8px;
}

/* Tracks list inside edit */
.ap-tracks-list {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
}

.ap-upload-progress {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
}

/* Transcoding progress bar */
.ap-processing {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.ap-processing-track {
  flex: 1;
  height: 8px;
  background: var(--surface-2, rgba(255,255,255,0.08));
  border-radius: 999px;
  overflow: hidden;
}
.ap-processing-fill {
  height: 100%;
  width: 0%;
  background: var(--accent, #FA586A);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.ap-processing-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .ap-release-card-header { flex-wrap: wrap; }
  .ap-release-edit-wrap { padding: 12px; }
  .ap-release-actions { flex-direction: column; }
  .ap-release-actions-right { flex-direction: column; width: 100%; }
  .ap-release-actions button { width: 100%; }
}
