:root {
  --bg: #121212;
  --bg-elevated: #181818;
  --bg-card: #242424;
  --bg-hover: #2a2a2a;
  --text: #ffffff;
  --text-secondary: #b3b3b3;
  --accent: #1db954;
  --accent-hover: #1ed760;
  --progress-bg: #4d4d4d;
  --player-height: 90px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  padding-bottom: calc(var(--player-height) + var(--safe-bottom));
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  padding-top: max(16px, env(safe-area-inset-top));
  background: linear-gradient(180deg, #1a1a1a 0%, var(--bg) 100%);
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
  margin-left: 20px;
}

#search {
  width: 100%;
  background: #2a2a2a;
  border: none;
  border-radius: 24px;
  padding: 10px 16px 10px 42px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: background 0.2s;
}

#search:focus {
  background: #333;
}

#search::placeholder {
  color: #888;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
}

/* Main */
.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 24px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 8px 0 18px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.track-count {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Library Grid */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

@media (min-width: 600px) {
  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
  }
}

.track-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  position: relative;
  user-select: none;
}

.track-card:hover,
.track-card:active {
  background: var(--bg-hover);
}

.track-card.playing {
  background: #1a3a28;
}

.track-card .cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #333;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.track-card img.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.track-card .play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.track-card:hover .play-overlay,
.track-card.playing .play-overlay {
  opacity: 1;
}

.track-card .play-overlay svg {
  width: 48px;
  height: 48px;
  color: white;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.track-card .title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.track-card .artist {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state code {
  background: #2a2a2a;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Player Bar */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--player-height) + var(--safe-bottom));
  background: #181818;
  border-top: 1px solid #282828;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
}

.player-progress {
  height: 3px;
  background: var(--progress-bg);
  cursor: pointer;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
}

.player-progress:hover .progress-fill {
  background: var(--accent-hover);
}

.player-content {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  max-width: 40%;
}

.np-cover {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: #333;
  flex-shrink: 0;
}

.np-info {
  min-width: 0;
}

.np-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.1s;
}

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

.ctrl-btn:active {
  transform: scale(0.92);
}

.ctrl-btn.active {
  color: var(--accent);
}

.play-btn {
  background: var(--text);
  color: #000 !important;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.play-btn:hover {
  transform: scale(1.06);
  background: #fff;
}

.play-btn:active {
  transform: scale(0.96);
}

.player-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
  max-width: 40%;
}

.time-display {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.time-sep {
  margin: 0 2px;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

#volume {
  width: 90px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--progress-bg);
  border-radius: 2px;
  outline: none;
}

#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}

/* Mobile adjustments */
@media (max-width: 700px) {
  .player-right {
    display: none;
  }
  
  .now-playing {
    max-width: 50%;
  }
  
  .player-controls {
    gap: 4px;
  }
  
  .ctrl-btn:not(.play-btn) {
    padding: 6px;
  }
  
  .play-btn {
    width: 44px;
    height: 44px;
  }
  
  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .search-wrap {
    margin-left: 0;
    max-width: none;
  }
}

/* Full Player (simple expand) */
.full-player {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #1e1e1e 0%, #121212 60%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  padding-top: max(40px, env(safe-area-inset-top));
}

.full-player.hidden {
  display: none;
}

.close-full {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 20px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 8px;
}

.fp-cover {
  width: min(80vw, 340px);
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  margin-bottom: 32px;
}

.fp-info {
  text-align: center;
}

.fp-info h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.fp-info p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.hidden {
  display: none !important;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Artist / Album layout */
.artist-header {
  grid-column: 1 / -1;
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2a2a2a;
}

.artist-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.album-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
}

.album-card:hover {
  background: var(--bg-hover);
}

.album-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #333;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.album-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-cover[data-loading] {
  background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.album-title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.cover[data-loading] {
  background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Artist-first library navigation */
/* Artist-first library: full-width rows, compact artwork, no cramped cards */
.artist-grid { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 26px; }
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 14px; margin-bottom: 26px; }
.artist-card { appearance: none; display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0; padding: 12px; text-align: left; color: inherit; background: #1b1b1b; border: 1px solid #292929; border-radius: 14px; cursor: pointer; transition: background .2s, border-color .2s; }
.artist-card:hover, .artist-card:focus-visible { background: #252525; border-color: #505050; outline: none; }
.artist-card-image { display: block; width: 68px; height: 68px; flex: 0 0 68px; object-fit: cover; border-radius: 50%; background: #292929; }
.artist-card-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.artist-card-info strong { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artist-card-info span { color: var(--text-secondary); font-size: .84rem; }
.library-subheading { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; margin: 24px 0 12px; padding-bottom: 9px; border-bottom: 1px solid #303030; }
.library-subheading h3 { font-size: 1.25rem; margin: 0; letter-spacing: -.2px; }
.library-subheading span { color: var(--text-secondary); font-size: .9rem; }
.back-button { display: inline-flex; width: max-content; max-width: 100%; min-height: 42px; align-items: center; justify-content: flex-start; border: 1px solid #333; border-radius: 999px; color: var(--text); background: #202020; padding: 9px 16px; margin: 8px 0 20px; cursor: pointer; white-space: nowrap; }
.artist-detail-heading { display: flex; align-items: center; gap: 18px; margin: 4px 0 28px; padding: 12px 0 20px; border-bottom: 1px solid #292929; }
.random-play-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; margin: -8px 0 26px; padding: 12px 18px; border: 0; border-radius: 999px; background: #f5f5f5; color: #111; font: inherit; font-weight: 700; cursor: pointer; }
.random-play-button span:first-child { font-size: 1.25rem; }
.random-play-button:active { transform: scale(.99); background: #ddd; }
.artist-detail-image { width: clamp(100px, 27vw, 156px); height: clamp(100px, 27vw, 156px); flex: 0 0 auto; object-fit: cover; border-radius: 50%; background: #292929; box-shadow: 0 8px 30px #0008; }
.artist-detail-heading h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 5vw, 2.2rem); line-height: 1.1; }
.artist-detail-heading p { margin: 0; color: var(--text-secondary); font-size: .95rem; line-height: 1.45; }
.track-list { display: flex; flex-direction: column; gap: 2px; width: 100%; margin-bottom: 28px; }
.track-row { display: grid; grid-template-columns: 48px 28px minmax(0,1fr) 34px; align-items: center; gap: 12px; width: 100%; min-height: 68px; text-align: left; border: 0; border-bottom: 1px solid #252525; border-radius: 0; padding: 9px 6px; color: inherit; background: transparent; cursor: pointer; }
.track-row:hover, .track-row.playing { background: #1b2b21; }
.track-row-cover { width: 48px; height: 48px; border-radius: 7px; object-fit: cover; background: #292929; }
.track-row-number { color: var(--text-secondary); font-variant-numeric: tabular-nums; font-size: .9rem; }
.track-row-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.track-row-text strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .98rem; font-weight: 600; }
.track-row-text small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-secondary); font-size: .82rem; }
.track-row-play { text-align: center; font-size: 1.1rem; color: #eee; }
@media (max-width: 480px) { .artist-card { padding: 10px; gap: 12px; } .artist-card-image { width: 60px; height: 60px; flex-basis: 60px; } .sub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .track-row { grid-template-columns: 42px 22px minmax(0,1fr) 26px; gap: 8px; padding: 8px 2px; } .track-row-cover { width: 42px; height: 42px; } .artist-detail-heading { gap: 14px; } }

/* Premium full-width library layout fixes */
#library.library-grid {
  display: block;
  width: 100%;
  min-width: 0;
}
#library > * { min-width: 0; max-width: 100%; }
.library-subheading { width: 100%; }
.artist-detail-heading { width: 100%; min-width: 0; overflow: hidden; }
.artist-detail-heading > div { min-width: 0; flex: 1 1 auto; }
.artist-detail-heading h2 { overflow-wrap: anywhere; }
.artist-grid { width: 100%; }
.artist-card { box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.sub-grid { width: 100%; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
.album-card { min-width: 0; border: 1px solid #303030; box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.random-play-button {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  min-height: 48px;
  margin: 0 0 26px;
  padding: 13px 20px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: linear-gradient(135deg, #282828, #191919 70%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.06);
  text-align: left;
  justify-content: flex-start;
}
.random-play-button:active { background: #303030; transform: scale(.99); }
.track-list { display: flex; width: 100%; }
.track-row {
  display: grid;
  grid-template-columns: 48px 28px minmax(0,1fr) 34px;
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  padding: 10px 8px;
  transition: background .18s ease;
}
.track-row-text { min-width: 0; }
.track-row-text small { display: none; }
.track-row:hover, .track-row:focus-visible, .track-row.playing {
  background: linear-gradient(90deg, rgba(29,185,84,.16), rgba(29,185,84,.035));
  outline: none;
}
.track-row-cover { box-shadow: 0 4px 14px rgba(0,0,0,.28); }
.back-button {
  background: linear-gradient(135deg, #242424, #181818);
  border-color: #343434;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
@media (max-width: 480px) {
  .main { padding-left: 16px; padding-right: 16px; }
  #library.library-grid { display: block; }
  .artist-detail-heading { align-items: center; gap: 14px; }
  .artist-detail-image { width: 104px; height: 104px; flex-basis: 104px; }
  .artist-detail-heading h2 { font-size: 1.55rem; }
  .random-play-button { width: 100%; justify-content: center; text-align: center; }
  .track-row { grid-template-columns: 42px 24px minmax(0,1fr) 28px; gap: 9px; }
}

/* ===== PREMIUM POLISH: edge-to-edge tracks, glass surfaces, refined controls ===== */
:root {
  --bg: #090b0a;
  --bg-elevated: #101311;
  --bg-card: #151916;
  --bg-hover: #1c241f;
  --text: #f7f8f7;
  --text-secondary: #9da6a0;
  --accent: #72f0a0;
  --accent-hover: #92ffb5;
  --radius: 18px;
}
html, body { background: radial-gradient(ellipse at 50% -20%, #1c2921 0%, #0b0d0c 48%, #080908 100%); }
.header {
  background: linear-gradient(180deg, rgba(15,18,16,.97), rgba(10,12,11,.88));
  border-bottom: 1px solid rgba(255,255,255,.055);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  padding-left: 22px; padding-right: 22px;
}
.logo { letter-spacing: -.8px; font-size: clamp(1.35rem, 4vw, 1.65rem); }
.search-wrap { max-width: none; margin-left: 18px; }
#search {
  background: rgba(255,255,255,.065); border: 1px solid rgba(255,255,255,.075);
  border-radius: 16px; padding-top: 13px; padding-bottom: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
#search:focus { background: rgba(255,255,255,.09); border-color: rgba(114,240,160,.38); }
.main { padding: 8px 22px 34px; }
.section-header { margin: 14px 0 22px; gap: 14px; }
.section-header h2 { font-size: clamp(1.65rem, 5vw, 2rem); letter-spacing: -1px; }
.track-count { font-size: .92rem; }
.library-subheading { margin: 30px 0 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.095); }
.library-subheading h3 { font-size: 1.32rem; letter-spacing: -.45px; }
.library-subheading span { color: #89938c; }
.artist-grid { gap: 10px; margin: 12px 0 28px; }
.artist-card {
  padding: 13px 15px; gap: 15px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.085);
  box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.035);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.artist-card:active { transform: scale(.985); }
.artist-card:hover, .artist-card:focus-visible { background: linear-gradient(135deg, rgba(114,240,160,.11), rgba(255,255,255,.035)); border-color: rgba(114,240,160,.28); }
.artist-card-image { width: 64px; height: 64px; flex-basis: 64px; border: 1px solid rgba(255,255,255,.13); box-shadow: 0 5px 18px #0005; }
.artist-card-info { gap: 6px; }
.artist-card-info strong { font-size: 1.05rem; letter-spacing: -.25px; }
.artist-card-info span { font-size: .85rem; color: #a0aaa3; }
.artist-detail-heading { gap: 18px; margin: 12px 0 24px; padding: 8px 0 22px; border-bottom: 1px solid rgba(255,255,255,.09); }
.artist-detail-image { width: clamp(104px, 30vw, 160px); height: clamp(104px, 30vw, 160px); border-radius: 50%; border: 1px solid rgba(255,255,255,.15); box-shadow: 0 12px 34px #0008; }
.artist-detail-heading h2 { font-size: clamp(1.6rem, 6vw, 2.35rem); letter-spacing: -1px; overflow-wrap: normal; word-break: normal; }
.artist-detail-heading p { color: #a4aea7; }
.back-button {
  width: auto !important; max-width: 100%; min-height: 36px; display: inline-flex;
  padding: 8px 0; margin: 0 0 18px; border: 0; border-radius: 0;
  color: #a8f5c0; background: transparent; box-shadow: none;
  font: inherit; font-size: .9rem; font-weight: 600; white-space: normal;
}
.back-button:hover { color: #fff; background: transparent; }
.random-play-button {
  width: auto !important; max-width: 100%; min-height: 44px; display: inline-flex;
  align-items: center; justify-content: center; gap: 9px; margin: 0 0 24px;
  padding: 11px 17px; border: 1px solid rgba(114,240,160,.28); border-radius: 14px;
  color: #dffff0; background: linear-gradient(135deg, rgba(48,133,81,.32), rgba(21,49,32,.48));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 22px rgba(0,0,0,.2);
  font-size: .92rem; font-weight: 650; text-align: left;
}
.random-play-button span:last-child { overflow-wrap: anywhere; }
.random-play-button:active { transform: scale(.985); background: linear-gradient(135deg, rgba(48,133,81,.45), rgba(21,49,32,.6)); }
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 14px; margin: 8px 0 30px; }
.album-card {
  appearance: none; width: 100%; min-width: 0; padding: 10px; text-align: left; color: inherit;
  border: 1px solid rgba(255,255,255,.075); border-radius: 17px;
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  box-shadow: 0 10px 25px #0003, inset 0 1px 0 rgba(255,255,255,.04);
}
.album-card:active { transform: scale(.98); }
.album-cover-wrap { aspect-ratio: 1; margin-bottom: 11px; border-radius: 12px; overflow: hidden; background: #1d241f; box-shadow: 0 8px 20px #0005; }
.album-cover { border-radius: 12px; }
.album-title { font-size: .98rem; font-weight: 700; line-height: 1.3; letter-spacing: -.2px; }
.album-meta { margin-top: 5px; font-size: .84rem; color: #9da79f; }
/* Every track is one clean, edge-to-edge row: no card grid or oversized controls. */
.track-list { display: flex; flex-direction: column; width: 100%; gap: 0; margin: 0 0 30px; }
.track-row {
  appearance: none; display: grid; grid-template-columns: 42px 28px minmax(0,1fr) 34px;
  align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 66px;
  padding: 9px 2px; border: 0; border-bottom: 1px solid rgba(255,255,255,.075); border-radius: 0;
  background: transparent; color: #f5f7f5; text-align: left; box-shadow: none;
  transition: background .16s ease;
}
.track-row:first-child { border-top: 1px solid rgba(255,255,255,.045); }
.track-row:hover, .track-row:focus-visible { outline: none; background: linear-gradient(90deg, rgba(114,240,160,.075), transparent 92%); }
.track-row.playing { background: linear-gradient(90deg, rgba(114,240,160,.13), rgba(114,240,160,.015)); }
.track-row-cover { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: #202720; box-shadow: 0 3px 10px #0004; }
.track-row-number { color: #8d9890; font-size: .85rem; font-variant-numeric: tabular-nums; }
.track-row-text { display: block; min-width: 0; }
.track-row-text strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .99rem; line-height: 1.35; font-weight: 590; letter-spacing: -.15px; }
.track-row-text small { display: none !important; }
.track-row-play { justify-self: end; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #c4f8d5; font-size: .95rem; }
.track-row:active .track-row-play { background: rgba(114,240,160,.13); }
/* Persistent player: refined glass bar and restrained accent. */
.player-bar { background: rgba(15,18,16,.94); border-top: 1px solid rgba(255,255,255,.13); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 -12px 36px rgba(0,0,0,.28); }
.player-progress { background: rgba(255,255,255,.12); }
.progress-fill { background: linear-gradient(90deg, #43d879, #a1ffc0); }
.np-cover { border-radius: 10px; box-shadow: 0 5px 16px #0005; }
.play-btn { box-shadow: 0 4px 18px rgba(114,240,160,.13); }
.ctrl-btn:focus-visible { outline: 2px solid #72f0a0; outline-offset: 3px; }
@media (max-width: 480px) {
  .header { display: block; padding: max(17px, env(safe-area-inset-top)) 18px 13px; }
  .header-left { margin-bottom: 13px; }
  .search-wrap { display: block; max-width: none; width: 100%; margin: 0; }
  #search { padding-top: 12px; padding-bottom: 12px; }
  .main { padding: 8px 18px 30px; }
  .section-header { margin: 12px 0 18px; }
  .artist-card { padding: 11px 12px; gap: 13px; }
  .artist-card-image { width: 58px; height: 58px; flex-basis: 58px; }
  .artist-detail-heading { align-items: center; gap: 14px; width: 100%; }
  .artist-detail-image { width: 98px; height: 98px; flex-basis: 98px; }
  .artist-detail-heading > div { flex: 1 1 0; min-width: 0; }
  .artist-detail-heading h2 { font-size: clamp(1.35rem, 6vw, 1.7rem); overflow-wrap: break-word; }
  .artist-detail-heading p { font-size: .85rem; }
  .random-play-button { width: auto !important; max-width: 100%; }
  .sub-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .track-row { grid-template-columns: 38px 24px minmax(0,1fr) 28px; gap: 9px; min-height: 62px; padding: 8px 0; }
  .track-row-cover { width: 38px; height: 38px; }
  .track-row-text strong { font-size: .94rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; } }

/* Navigation + artwork reliability polish */
.back-button {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 13px !important;
  margin: 2px 0 18px !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  border-radius: 12px !important;
  color: #e8f5ec !important;
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 5px 16px rgba(0,0,0,.14) !important;
  font-size: .9rem !important;
  font-weight: 600 !important;
  white-space: normal !important;
  text-align: left;
}
.back-button .back-chevron { color: #8af2ad; font-size: 1.15rem; line-height: 1; }
.back-button:active { transform: scale(.98); background: rgba(114,240,160,.1) !important; }
.artwork-image { display: block; object-position: center; }
.artist-card-image, .artist-detail-image, .album-cover, .track-row-cover { color: transparent; }
.artist-card-image { aspect-ratio: 1; }
.album-cover { width: 100%; height: 100%; object-fit: cover; }
.track-row { grid-template-columns: 44px minmax(0,1fr) 34px; }
.track-row-number { display: none; }
@media (max-width: 480px) {
  .track-row { grid-template-columns: 42px minmax(0,1fr) 32px; gap: 11px; }
  .track-row-cover { width: 42px; height: 42px; }
  .back-button { min-height: 38px; font-size: .86rem !important; }
}
