* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background: #0d0d0d;
  color: #f0f0f0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.profile-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}
.profile-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
}
.profile-control {
  position: relative;
}
.profile-pill {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 28px;
  padding: 0.3rem 1rem 0.3rem 0.4rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f0f0f0;
  transition: background 0.15s;
}
.profile-pill img.profile-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: block;
}
.profile-menu-item img.profile-icon {
  width: 1.9rem;
  height: 1.9rem;
  margin-right: 0.6rem;
  vertical-align: middle;
}
.profile-pill:hover {
  background: #242424;
}
.profile-pill .chev {
  font-size: 0.7rem;
  color: #888;
}
.profile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 0.4rem;
  min-width: 200px;
  z-index: 50;
  margin-top: 0.4rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.profile-menu.visible {
  display: block;
}
.profile-menu-item {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.profile-menu-item:hover {
  background: #242424;
}
.profile-menu-item.active {
  color: #1db954;
  font-weight: 600;
}
.profile-menu-divider {
  height: 1px;
  background: #2a2a2a;
  margin: 0.3rem 0;
}
.profile-menu-item.new {
  color: #1db954;
  font-weight: 600;
}
.profile-menu-item.danger {
  color: #ef4444;
}

.artists {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
  flex-shrink: 1;
  min-width: 0;
  scrollbar-width: none;
  margin: 0 0.5rem;
  padding: 0.25rem 0.25rem;
}
.artists::-webkit-scrollbar {
  display: none;
}
.card {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    opacity 0.15s,
    max-width 0.25s ease;
  opacity: 0.4;
  border: 1px solid #2a2a2a;
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 160px;
  max-width: 160px;
}
.card:hover {
  background: #333;
  max-width: none;
}
.card:hover .card-artist {
  overflow: visible;
  text-overflow: clip;
}
.card.active {
  opacity: 1;
  box-shadow: 0 0 0 3px #1db954;
  border-color: transparent;
}
.card-artist {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.albums-strip {
  display: none;
  gap: 0.75rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  flex-shrink: 0;
  padding: 2px 0 0.4rem;
  scrollbar-width: none;
}
.albums-strip::-webkit-scrollbar {
  display: none;
}
.albums-strip.visible {
  display: flex;
}
.album-pill {
  background: #1a1a1a;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s,
    box-shadow 0.2s,
    transform 0.2s;
  border: 1px solid #2a2a2a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 110px;
}
.album-pill:hover {
  background: #242424;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.album-pill.active {
  outline: 2px solid #1db954;
  outline-offset: -1px;
  border-color: transparent;
}
.album-pill.playing {
  border-color: #1db954;
}
.album-pill.playing .album-pill-name {
  color: #4ade80;
}
.album-pill img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.album-pill-no-art {
  width: 100%;
  aspect-ratio: 1;
  background: #2a2a2a;
}
.album-pill-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #ccc;
  font-size: 0.75rem;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  border: none;
  padding: 0;
}
.album-pill:hover .album-pill-remove {
  display: flex;
}
.album-pill-remove:hover {
  background: #ef4444;
  color: white;
}
.add-album-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #555;
  min-width: 3.5rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.add-album-pill:hover {
  opacity: 1;
  color: #1db954;
}
.album-pill-info {
  padding: 0.4rem 0.5rem 0.5rem;
}
.album-pill-name {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-pill-year {
  display: block;
  font-size: 0.65rem;
  color: #888;
  margin-top: 0.1rem;
}

.bottom {
  display: flex;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.songs-panel {
  width: 260px;
  flex-shrink: 0;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: width 0.2s;
}
.songs-panel.minimized {
  width: 2.6rem;
}
.songs-panel.minimized #songs-list {
  display: none;
}
.songs-panel.minimized .songs-panel-header {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  height: auto;
  width: 2.6rem;
  padding: 0.8rem 0;
  justify-content: center;
  flex: 1;
}
.songs-panel.minimized .songs-panel-header .header-text-wrap,
.songs-panel.minimized .album-queue-add {
  display: none;
}
.songs-panel.minimized .songs-minimize-btn {
  writing-mode: horizontal-tb;
  margin: 0;
}
.songs-panel-header {
  background: #161616;
  border-bottom: 2px solid #1db954;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  flex-shrink: 0;
  height: 2.6rem;
  box-sizing: border-box;
}
.songs-minimize-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccc;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s;
}
.songs-minimize-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.songs-panel-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #555;
  font-size: 0.9rem;
}
#songs-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.song-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #2a2a2a;
  cursor: pointer;
  transition: background 0.15s;
}
.song-row:last-child {
  border-bottom: none;
}
.song-row:hover {
  background: #242424;
}
.song-row.active {
  background: #0d2318;
  border-left: 3px solid #1db954;
  padding-left: calc(1rem - 3px);
}
.song-row.active .song-title {
  color: #fff;
  font-weight: 600;
}
.song-num {
  font-size: 0.8rem;
  color: #555;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}
.song-row.active .song-num {
  color: #1db954;
}
.song-title {
  flex: 1;
  font-size: 0.9rem;
  min-width: 0;
}
.song-duration {
  font-size: 0.8rem;
  color: #666;
  flex-shrink: 0;
}
.song-row.unavailable {
  opacity: 0.35;
  cursor: default;
}
.song-row.unavailable:hover {
  background: transparent;
}

.yt-panel {
  flex: 1;
  min-width: 0;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.yt-panel-header {
  background: #161616;
  border-bottom: 2px solid #1db954;
  padding: 0.85rem 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  height: 2.6rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  z-index: 2;
}
.yt-panel-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #555;
  font-size: 0.9rem;
}
.yt-panel iframe {
  display: block;
  border: none;
}
#yt-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.yt-nav {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0 0.3rem;
  flex-shrink: 0;
  transition: color 0.15s;
}
.yt-nav:hover {
  color: #fff;
}

.card-remove {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
  font-size: 0.75rem;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  padding: 0;
  flex-shrink: 0;
}
.card:hover .card-remove {
  display: flex;
}
.card-remove:hover {
  background: #ef4444;
  color: white;
}
.card-top-hits {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 20px;
  background: rgba(29, 185, 84, 0.15);
  border: 1px solid rgba(29, 185, 84, 0.4);
  color: #1db954;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}
.card-top-hits .top-hits-label {
  display: none;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}
.card:hover .card-top-hits .top-hits-label {
  display: inline;
}
.card-top-hits:hover {
  background: #1db954;
  color: white;
  border-color: #1db954;
}
.card-top-hits:disabled {
  opacity: 0.4;
  cursor: default;
}

.add-artist-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: #1a1a1a;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 300;
  color: #f0f0f0;
  opacity: 0.6;
  transition:
    opacity 0.15s,
    background 0.15s;
  line-height: 1;
}
.add-artist-btn:hover {
  opacity: 0.8;
  background: #333;
}
.card {
  position: relative;
} /* needed for yt-bar */
.card-yt-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #2a2a2a;
}
.card-yt-bar-fill {
  height: 100%;
  background: #ff0000;
  transition: width 1s linear;
  border-radius: 0 2px 2px 0;
}
.album-pill {
  position: relative;
}
.album-pill.pending {
  opacity: 0.35;
  filter: grayscale(0.6);
}
.album-pill.pending img {
  filter: brightness(0.6);
}
.album-pill.loading {
  opacity: 0.85;
}
.album-yt-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #2a2a2a;
}
.album-yt-bar-fill {
  height: 100%;
  background: #1db954;
  transition: width 0.5s linear;
}

.modal-progress {
  height: 3px;
  background: #2a2a2a;
  border-radius: 2px;
  margin-bottom: 1rem;
  overflow: hidden;
  display: none;
}
.modal-progress.active {
  display: block;
}
.modal-progress-fill {
  height: 100%;
  width: 30%;
  background: #1db954;
  border-radius: 2px;
  animation: indeterminate 1.4s ease-in-out infinite;
}
@keyframes indeterminate {
  0% {
    transform: translateX(-200%);
  }
  100% {
    transform: translateX(500%);
  }
}
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(var(--scroll-dist));
  }
}

.header-text-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.header-text {
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-text.overflowing:hover {
  overflow: visible;
  text-overflow: unset;
  animation: marquee var(--scroll-duration, 4s) linear infinite alternate;
}
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.visible {
  display: flex;
}
.modal {
  background: rgba(20, 20, 20, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 12px;
  padding: 2rem;
  width: 380px;
  border: 1px solid #333;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}
.modal h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.modal input[type='text'] {
  width: 100%;
  background: #0d0d0d;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: #f0f0f0;
  font-size: 0.95rem;
  outline: none;
  margin-bottom: 0.85rem;
  font-family: inherit;
}
.modal input[type='text']:focus {
  border-color: #1db954;
}
.artist-input-wrap {
  position: relative;
  margin-bottom: 0.85rem;
}
.artist-input-wrap input[type='text'] {
  margin-bottom: 0;
}
.artist-input-wrap.has-results input[type='text'] {
  border-radius: 8px 8px 0 0;
  border-bottom-color: #222;
}
.artist-search-results {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  background: #0d0d0d;
  border: 1px solid #3a3a3a;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.artist-search-results.visible {
  display: block;
}
.artist-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid #1a1a1a;
}
.artist-search-result:last-child {
  border-bottom: none;
}
.artist-search-result:hover {
  background: #1a1a1a;
}
.artist-search-result-info {
  min-width: 0;
  flex: 1;
}
.artist-search-result-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist-search-result-genre {
  font-size: 0.72rem;
  color: #888;
  margin-top: 0.1rem;
}
.artist-search-result-badge {
  font-size: 0.65rem;
  color: #1db954;
  background: #0d2318;
  border: 1px solid rgba(29, 185, 84, 0.4);
  border-radius: 10px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.artist-search-loading {
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
  color: #555;
}
.modal-status {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 1rem;
  min-height: 1.1em;
}
.modal-status.error {
  color: #ef4444;
}
.modal-status.success {
  color: #22c55e;
}
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}
.btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  transition: opacity 0.15s;
}
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn-primary {
  background: #1db954;
  color: white;
}
.btn-primary:not(:disabled):hover {
  opacity: 0.85;
}
.btn-secondary {
  background: #2a2a2a;
  color: #ccc;
}
.btn-secondary:hover {
  background: #333;
}

.modal-wide {
  width: 520px;
}
.picker-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin: 0.5rem 0 0.6rem;
  font-weight: 600;
}
.picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 45vh;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: 0.1rem;
}
.picker-grid-empty {
  color: #666;
  font-size: 0.82rem;
  padding: 0.5rem 0;
}
.picker-chip {
  background: #0d0d0d;
  border: 1px solid #3a3a3a;
  border-radius: 20px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.picker-chip:hover {
  border-color: #1db954;
  background: #0d2318;
}
.picker-chip.added {
  background: #1db954;
  border-color: #1db954;
  color: white;
  cursor: default;
}
.picker-chip.discover {
  border-color: #3a3a4a;
  border-style: dashed;
}
.picker-chip.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.chip-genre {
  font-size: 0.65rem;
  color: #888;
  margin-left: 0.35rem;
}
.picker-section-label {
  flex-basis: 100%;
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.6rem 0 0.2rem;
}
.picker-divider {
  height: 1px;
  background: #2a2a2a;
  margin: 0.75rem 0 1rem;
}

.icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.icon-option {
  width: 3.6rem;
  height: 3.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d0d;
  border: 2px solid #3a3a3a;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  padding: 0.35rem;
}
.icon-option img {
  width: 100%;
  height: 100%;
  display: block;
}
.icon-option:hover {
  border-color: #1db954;
  background: #0d2318;
  transform: translateY(-2px);
}
.icon-option.selected {
  border-color: #1db954;
  background: #0d2318;
}

/* Queue */
.queue-toggle {
  margin-left: 0;
  flex-shrink: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 28px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f0f0f0;
  transition: background 0.15s;
  min-width: 130px;
}
.queue-toggle:hover {
  background: #242424;
}
.queue-toggle.active {
  background: #0d2318;
  border-color: #1db954;
}
.queue-count {
  background: #1db954;
  color: white;
  border-radius: 999px;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.queue-count.empty {
  display: none;
}

.queue-panel {
  width: 280px;
  flex-shrink: 0;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.queue-panel.visible {
  display: flex;
}
.queue-panel-header {
  background: #161616;
  border-bottom: 2px solid #1db954;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.queue-clear {
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.queue-clear:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
}
.queue-panel-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #555;
  font-size: 0.9rem;
}
#queue-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.drag-handle {
  color: #555;
  font-size: 0.9rem;
  cursor: grab;
  padding: 0 0.15rem;
  user-select: none;
  flex-shrink: 0;
  letter-spacing: -3px;
}
.drag-handle:active {
  cursor: grabbing;
}
.queue-row.dragging,
.pl-song-row.dragging {
  opacity: 0.4;
}
.queue-row.drag-over,
.pl-song-row.drag-over {
  background: #2f2f2f;
}
.queue-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #2a2a2a;
  cursor: pointer;
  transition: background 0.15s;
}
.queue-row:last-child {
  border-bottom: none;
}
.queue-row:hover {
  background: #242424;
}
.queue-row.playing {
  background: #0d2318;
  border-left: 3px solid #4ade80;
}
.queue-row.playing .queue-row-title {
  color: #4ade80;
}
.queue-row img {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
}
.queue-row-no-art {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  flex-shrink: 0;
  background: #2a2a2a;
}
.queue-row-info {
  flex: 1;
  min-width: 0;
}
.queue-row-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-row-meta {
  font-size: 0.7rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}
.queue-row-remove {
  color: #666;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  flex-shrink: 0;
}
.queue-row-remove:hover {
  color: #ef4444;
}

.song-row {
  position: relative;
}
.song-add {
  color: #666;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.3rem;
  flex-shrink: 0;
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s;
  cursor: pointer;
}
.song-row:hover .song-add {
  opacity: 1;
}
.song-add:hover {
  color: #1db954;
}
.song-add.added {
  color: #22c55e;
  opacity: 1;
}

/* Playlist create modal */
.pl-mode-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.pl-mode-tab {
  flex: 1;
  background: #0d0d0d;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  color: #888;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-family: inherit;
}
.pl-mode-tab:hover {
  border-color: #555;
  color: #ccc;
}
.pl-mode-tab.active {
  background: #0d2318;
  border-color: #1db954;
  color: #4ade80;
}
.pl-duration-picker {
  margin-bottom: 0.85rem;
}
.pl-duration-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 0.4rem;
}
.pl-duration-options {
  display: flex;
  gap: 0.4rem;
}
.pl-duration-btn {
  flex: 1;
  background: #0d0d0d;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 0.4rem;
  color: #888;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-family: inherit;
}
.pl-duration-btn:hover {
  border-color: #555;
  color: #ccc;
}
.pl-duration-btn.active {
  background: #0d2318;
  border-color: #1db954;
  color: #4ade80;
}
.pl-duration-hint {
  font-size: 0.7rem;
  color: #666;
  margin-top: 0.35rem;
}

/* Playlists */
.pl-toggle {
  flex-shrink: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 28px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f0f0f0;
  transition: background 0.15s;
  min-width: 130px;
}
.pl-toggle:hover {
  background: #242424;
}
.pl-toggle.active {
  background: #0d2318;
  border-color: #1db954;
}
.pl-panel {
  width: 280px;
  flex-shrink: 0;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.pl-panel.visible {
  display: flex;
}
.pl-panel-header {
  background: #161616;
  border-bottom: 2px solid #1db954;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: 2.6rem;
  box-sizing: border-box;
}
#pl-panel-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-panel-btn {
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.pl-panel-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
}
.pl-panel-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #555;
  font-size: 0.9rem;
}
#pl-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.pl-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #2a2a2a;
  cursor: pointer;
  transition: background 0.15s;
}
.pl-item:last-child {
  border-bottom: none;
}
.pl-item:hover {
  background: #242424;
}
.pl-item.active {
  background: #0d2318;
  border-left: 3px solid #1db954;
  padding-left: calc(0.75rem - 3px);
}
.pl-item-info {
  flex: 1;
  min-width: 0;
}
.pl-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-item-meta {
  font-size: 0.7rem;
  color: #888;
  margin-top: 0.1rem;
}
.pl-item-remove,
.pl-item-rename {
  color: #666;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  flex-shrink: 0;
  visibility: hidden;
  cursor: pointer;
}
.pl-item-remove {
  font-size: 1.1rem;
}
.pl-item:hover .pl-item-remove,
.pl-item:hover .pl-item-rename {
  visibility: visible;
}
.pl-item-remove:hover {
  color: #ef4444;
}
.pl-item-rename:hover {
  color: #4ade80;
}
.pl-back {
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
}
.pl-back:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
}
.pl-song-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #2a2a2a;
  cursor: pointer;
  transition: background 0.15s;
}
.pl-song-row:last-child {
  border-bottom: none;
}
.pl-song-row:hover {
  background: #242424;
}
.pl-song-row.playing {
  background: #0d2318;
  box-shadow: inset 3px 0 0 #1db954;
}
.pl-song-row.playing .pl-song-row-title {
  color: #4ade80;
}
.pl-song-row img {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
}
.pl-song-row-no-art {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  flex-shrink: 0;
  background: #2a2a2a;
}
.pl-song-row-info {
  flex: 1;
  min-width: 0;
}
.pl-song-row-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-song-row-meta {
  font-size: 0.7rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}
.pl-song-row-remove {
  color: #666;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  flex-shrink: 0;
  visibility: hidden;
  cursor: pointer;
}
.pl-song-row:hover .pl-song-row-remove {
  visibility: visible;
}
.pl-song-row-remove:hover {
  color: #ef4444;
}

.songs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.album-queue-add {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ccc;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
}
.songs-panel-header:hover .album-queue-add {
  opacity: 1;
}
.album-queue-add:hover {
  background: rgba(255, 255, 255, 0.06);
}
.album-queue-add:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Remove-artist modal */
.remove-artist-text {
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}
.remove-artist-text strong {
  color: #f0f0f0;
  font-weight: 700;
}
.remove-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.remove-option {
  background: #0d0d0d;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: #f0f0f0;
  transition: all 0.15s;
}
.remove-option:hover:not(:disabled) {
  border-color: #1db954;
  background: #0d2318;
  transform: translateY(-1px);
}
.remove-option:disabled {
  opacity: 0.5;
  cursor: default;
}
.remove-option.danger:hover:not(:disabled) {
  border-color: #ef4444;
  background: #2a0d0d;
}
.remove-option-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.remove-option.danger .remove-option-title {
  color: #ef4444;
}
.remove-option-sub {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.4;
}

.delete-album-preview {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 1.2rem;
}
.delete-album-preview img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.delete-album-preview-no-art {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  background: #2a2a2a;
  flex-shrink: 0;
}
.delete-album-preview-info {
  min-width: 0;
}
.delete-album-preview-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.delete-album-preview-meta {
  font-size: 0.78rem;
  color: #888;
  margin-top: 0.25rem;
}
.delete-album-warn {
  font-size: 0.82rem;
  color: #ef4444;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.pl-delete-preview {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 1.2rem;
}
.pl-delete-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1db954, #0d2e1d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.pl-delete-info {
  min-width: 0;
}
.pl-delete-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-delete-meta {
  font-size: 0.78rem;
  color: #888;
  margin-top: 0.25rem;
}
.btn-danger {
  background: #ef4444;
  color: white;
}
.btn-danger:not(:disabled):hover {
  opacity: 0.85;
}

.album-picker-actions-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.album-picker-count {
  font-size: 0.8rem;
  color: #888;
}
.btn-sm {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
}
.album-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.25rem;
}
.album-picker-grid::-webkit-scrollbar {
  width: 4px;
}
.album-picker-grid::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 2px;
}
.album-pick {
  cursor: pointer;
  border: 2px solid #333;
  border-radius: 8px;
  overflow: hidden;
  transition:
    border-color 0.15s,
    opacity 0.15s;
  position: relative;
}
.album-pick:hover {
  border-color: #666;
}
.album-pick.selected {
  border-color: #1db954;
}
.album-pick.selected::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  background: #1db954;
  color: white;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}
.album-pick:not(.selected) {
  opacity: 0.5;
}
.album-pick img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.album-pick-noart {
  width: 100%;
  aspect-ratio: 1;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #555;
}
.album-pick-info {
  padding: 0.35rem 0.4rem;
}
.album-pick-name {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-pick-meta {
  font-size: 0.65rem;
  color: #888;
  margin-top: 0.15rem;
}

/* Artist card thumbnails */
.card-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.card-thumb-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #2a2a2a;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #555;
}

/* Now-playing bar */
.now-playing-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex-shrink: 0;
  background: rgba(16, 16, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  position: relative;
}
.now-playing-bar.empty .now-playing-title {
  color: #6a6a6a;
  font-style: italic;
}
.now-playing-bar.empty .now-playing-progress {
  pointer-events: none;
  opacity: 0.5;
}
.now-playing-bar.empty .now-playing-btn:not(.now-playing-mode) {
  opacity: 0.4;
  pointer-events: none;
}
.now-playing-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.now-playing-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.now-playing-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #2a2a2a;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.now-playing-info {
  flex: 1;
  min-width: 0;
}
.now-playing-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f0f0f0;
}
.now-playing-artist {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-playing-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.now-playing-btn {
  background: none;
  border: none;
  color: #b3b3b3;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  transition:
    color 0.15s,
    background 0.15s,
    transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.now-playing-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.now-playing-btn:active {
  transform: scale(0.92);
}
.now-playing-btn svg {
  display: block;
}
.now-playing-playpause {
  color: #000;
  background: #fff;
  padding: 0.45rem;
}
.now-playing-playpause:hover {
  background: #fff;
  color: #000;
  transform: scale(1.06);
}
.now-playing-playpause:active {
  transform: scale(0.96);
}
.now-playing-mode {
  position: relative;
  color: #b3b3b3;
}
.now-playing-mode:hover {
  color: #fff;
  background: transparent;
}
.now-playing-mode.active {
  color: #1db954;
}
.now-playing-mode.active:hover {
  color: #1db954;
  background: transparent;
}
.now-playing-mode.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1db954;
  transform: translateX(-50%);
}
.now-playing-time {
  font-size: 0.72rem;
  color: #888;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.now-playing-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  cursor: pointer;
  transition: height 0.15s;
}
.now-playing-progress:hover {
  height: 6px;
}
.now-playing-progress-fill {
  height: 100%;
  background: #1db954;
  width: 0%;
  transition: width 0.2s linear;
}

/* Artist filter */
.artists-filter {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  padding: 0.35rem 0.8rem;
  color: #f0f0f0;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  width: 110px;
  transition:
    width 0.2s,
    border-color 0.15s;
  flex-shrink: 0;
}
.artists-filter::placeholder {
  color: #666;
}
.artists-filter:focus {
  width: 180px;
  border-color: #1db954;
}

/* Styled scrollbars for panels */
#songs-list,
#queue-list,
#pl-list {
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
#songs-list::-webkit-scrollbar,
#queue-list::-webkit-scrollbar,
#pl-list::-webkit-scrollbar {
  width: 8px;
}
#songs-list::-webkit-scrollbar-track,
#queue-list::-webkit-scrollbar-track,
#pl-list::-webkit-scrollbar-track {
  background: transparent;
}
#songs-list::-webkit-scrollbar-thumb,
#queue-list::-webkit-scrollbar-thumb,
#pl-list::-webkit-scrollbar-thumb {
  background: #2f2f2f;
  border-radius: 4px;
}
#songs-list::-webkit-scrollbar-thumb:hover,
#queue-list::-webkit-scrollbar-thumb:hover,
#pl-list::-webkit-scrollbar-thumb:hover {
  background: #444;
}
.picker-grid,
.album-picker-grid {
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.picker-grid::-webkit-scrollbar {
  width: 8px;
}
.picker-grid::-webkit-scrollbar-thumb {
  background: #2f2f2f;
  border-radius: 4px;
}
.picker-grid::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
  pointer-events: none;
  max-width: calc(100% - 2rem);
}
.toast {
  background: rgba(25, 25, 25, 0.95);
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.3;
  max-width: 360px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  transform: translateX(20px);
  opacity: 0;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
  pointer-events: auto;
  word-wrap: break-word;
}
.toast.visible {
  transform: translateX(0);
  opacity: 1;
}
.toast-success {
  border-color: rgba(29, 185, 84, 0.55);
  box-shadow: 0 4px 18px rgba(29, 185, 84, 0.2);
}
.toast-error {
  border-color: rgba(229, 57, 53, 0.65);
  box-shadow: 0 4px 18px rgba(229, 57, 53, 0.2);
}

/* Login + change-password modals */
.login-profile-preview {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 0.8rem;
}
.login-profile-preview img {
  width: 2rem;
  height: 2rem;
}
.login-profile-preview-name {
  font-weight: 600;
  color: #f0f0f0;
}
.change-password-hint {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 0.7rem;
}
#login-modal input,
#change-password-modal input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #111;
  color: #f0f0f0;
  font-size: 0.9rem;
  outline: none;
  margin-bottom: 0.4rem;
}
#login-modal input:focus,
#change-password-modal input:focus {
  border-color: #1db954;
}
.profile-menu-lock {
  opacity: 0.7;
  margin-left: 0.35rem;
  font-size: 0.8rem;
}

/* Pending button spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
.btn-secondary .spinner {
  border-top-color: #ccc;
}
button[data-pending='1'] {
  opacity: 0.75;
  cursor: default;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Background-import progress strip */
.yt-progress-bar {
  display: none;
  position: relative;
  height: 3px;
  background: rgba(29, 185, 84, 0.12);
  border-radius: 2px;
  margin: 0 0 0.5rem;
  overflow: hidden;
}
.yt-progress-bar.active {
  display: block;
}
.yt-progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 30%;
  height: 100%;
  background: #1db954;
  border-radius: 2px;
  animation: yt-progress-slide 1.4s ease-in-out infinite;
}
@keyframes yt-progress-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(440%);
  }
}

/* Responsive: tablet and phone */
@media (max-width: 768px) {
  body {
    padding: 0.75rem;
  }

  .profile-bar {
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    position: relative;
    z-index: 80;
    background: #0d0d0d;
  }
  .profile-pill {
    padding: 0.25rem 0.75rem 0.25rem 0.3rem;
    font-size: 0.82rem;
    min-height: 44px;
  }
  .profile-pill img.profile-icon {
    width: 2rem;
    height: 2rem;
  }
  #profile-name {
    max-width: 5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .artists-filter {
    width: 90px;
  }
  .artists-filter:focus {
    width: 140px;
  }
  .artists {
    order: 2;
    flex-basis: 100%;
    margin: 0.3rem 0 0;
    min-height: 44px;
  }
  .add-artist-btn {
    order: 3;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.7rem;
  }
  .pl-toggle,
  .queue-toggle {
    min-width: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    min-height: 44px;
  }

  .albums-strip {
    margin-bottom: 0.6rem;
  }

  .bottom {
    flex-direction: column;
    gap: 0.6rem;
  }
  .songs-panel {
    width: 100%;
    max-height: 35vh;
  }
  .songs-panel.minimized {
    width: 100%;
    max-height: 2.6rem;
  }
  .songs-panel.minimized .songs-panel-header {
    writing-mode: horizontal-tb;
    text-orientation: unset;
    width: 100%;
    height: 2.6rem;
    padding: 0.85rem 1rem;
    flex: 0 0 2.6rem;
  }
  .songs-panel.minimized .songs-panel-header .header-text-wrap {
    display: block;
  }
  .songs-minimize-btn {
    display: none;
  }
  .yt-panel {
    min-height: 45vh;
  }

  .queue-panel.visible,
  .pl-panel.visible {
    position: fixed;
    inset: 0;
    z-index: 60;
    width: 100%;
    border-radius: 0;
  }

  .now-playing-bar {
    position: fixed;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    z-index: 70;
    margin-top: 0;
  }
  .now-playing-art {
    display: none;
  }
  .now-playing-bar {
    grid-template-columns: 1fr auto;
    padding: 0.45rem 0.6rem;
    gap: 0.5rem;
  }
  .now-playing-right {
    display: none;
  }
  .now-playing-title {
    font-size: 0.82rem;
  }
  .now-playing-artist {
    font-size: 0.7rem;
  }

  .now-playing-btn {
    min-height: 44px;
    min-width: 44px;
  }
  .btn {
    min-height: 44px;
  }
  .songs-minimize-btn,
  .album-queue-add {
    min-height: 32px;
  }

  .modal {
    width: calc(100vw - 1.5rem);
    max-width: 420px;
    padding: 1.5rem;
  }
  .modal-wide {
    width: calc(100vw - 1.5rem);
    max-width: 520px;
  }
  .picker-grid,
  .album-picker-grid {
    max-height: 40vh;
  }

  .card {
    min-width: 140px;
    max-width: 140px;
  }
  .card:hover {
    max-width: 220px;
  }
}

/* Responsive: small phone */
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }

  .modal-overlay.visible {
    align-items: stretch;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    padding: 1.25rem;
    overflow-y: auto;
  }
  .modal-wide {
    width: 100%;
    max-width: 100%;
  }
  .picker-grid,
  .album-picker-grid {
    max-height: none;
  }

  .artists-filter {
    width: 80px;
  }
  .artists-filter:focus {
    width: 100%;
  }

  .card {
    min-width: calc(100% - 0.5rem);
    max-width: calc(100% - 0.5rem);
  }
  .card:hover {
    max-width: calc(100% - 0.5rem);
  }
  .artists {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    max-height: 40vh;
    align-items: stretch;
  }

  .pl-toggle span,
  .queue-toggle span:not(.queue-count) {
    display: none;
  }
  .pl-toggle::before {
    content: '♫';
    font-size: 1rem;
  }
  .queue-toggle::before {
    content: '☰';
    font-size: 1rem;
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: #777;
  height: 100%;
  box-sizing: border-box;
}
.empty-state-icon {
  color: #444;
  margin-bottom: 0.1rem;
}
.empty-state-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #bbb;
  letter-spacing: 0.01em;
}
.empty-state-hint {
  font-size: 0.82rem;
  color: #777;
  max-width: 22rem;
  line-height: 1.45;
  margin-top: -0.25rem;
}
.empty-state-cta {
  margin-top: 0.6rem;
}

/* Accessibility: visible focus ring only for keyboard navigation. */
:focus {
  outline: none;
}
button:focus-visible,
a:focus-visible,
[role='button']:focus-visible,
[role='menuitem']:focus-visible,
[tabindex='0']:focus-visible,
.profile-pill:focus-visible,
.pl-toggle:focus-visible,
.queue-toggle:focus-visible,
.card:focus-visible,
.album-pill:focus-visible,
.song-row:focus-visible,
.pl-item:focus-visible,
.pl-song-row:focus-visible,
.queue-row:focus-visible,
.icon-option:focus-visible,
.picker-chip:focus-visible,
.album-pick:focus-visible,
.pl-mode-tab:focus-visible,
.pl-duration-btn:focus-visible {
  outline: 2px solid #1db954;
  outline-offset: 2px;
}
input:focus-visible,
textarea:focus-visible {
  outline: none;
}
.now-playing-btn:focus-visible {
  outline: 2px solid #1db954;
  outline-offset: 2px;
}

/* Buttons that replaced clickable divs — inherit font + reset native chrome. */
button.profile-pill,
button.pl-toggle,
button.queue-toggle {
  font-family: inherit;
  text-align: inherit;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Cmd+K search modal */
#search-modal.modal-overlay.visible {
  align-items: flex-start;
  padding-top: 10vh;
}
.modal-search {
  width: 560px;
  max-width: calc(100vw - 2rem);
  padding: 0.5rem 0.5rem 0.75rem;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #2a2a2a;
}
.search-input-icon {
  color: #888;
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  color: #f0f0f0;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  padding: 0 !important;
  margin: 0 !important;
}
.search-input::placeholder {
  color: #666;
}
.search-hint {
  font-size: 0.68rem;
  color: #888;
  background: #2a2a2a;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: inherit;
}
.search-results {
  max-height: 58vh;
  overflow-y: auto;
  padding: 0.35rem 0;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.search-results::-webkit-scrollbar {
  width: 8px;
}
.search-results::-webkit-scrollbar-thumb {
  background: #2f2f2f;
  border-radius: 4px;
}
.search-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  padding: 0.6rem 1rem 0.3rem;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.search-result:hover,
.search-result.active {
  background: #1d1d1d;
  border-left-color: #1db954;
}
.search-result-art {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #2a2a2a;
}
.search-result-art-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  flex-shrink: 0;
}
.search-result-info {
  flex: 1;
  min-width: 0;
}
.search-result-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-play {
  color: #1db954;
  font-size: 0.8rem;
  opacity: 0;
  flex-shrink: 0;
  padding-left: 0.5rem;
}
.search-result.active .search-result-play,
.search-result:hover .search-result-play {
  opacity: 1;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  padding: 0.25rem 0.5rem 0.25rem 0.8rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #aaa;
}
.account-chip-username {
  font-weight: 600;
  color: #ddd;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-chip-logout {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #ddd;
  border-radius: 14px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.account-chip-logout:hover {
  border-color: #444;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Auth page (/login)
   ============================================================ */
body.auth-page {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: 100vh;
}
.auth-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.auth-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: #f0f0f0;
  text-align: center;
}
.auth-subtitle {
  font-size: 0.9rem;
  color: #888;
  text-align: center;
  margin-bottom: 1.8rem;
}
.auth-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}
.auth-label:first-of-type {
  margin-top: 0;
}
.auth-input {
  width: 100%;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: #f0f0f0;
  transition: border-color 0.15s;
}
.auth-input:focus {
  outline: none;
  border-color: #7c3aed;
}
.auth-submit {
  width: 100%;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background 0.15s;
}
.auth-submit:hover:not(:disabled) {
  background: #8b4dfa;
}
.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.auth-error {
  margin-top: 1rem;
  padding: 0.6rem 0.8rem;
  background: rgba(220, 60, 60, 0.1);
  border: 1px solid rgba(220, 60, 60, 0.3);
  border-radius: 8px;
  color: #f3a3a3;
  font-size: 0.85rem;
  display: none;
}
.auth-error.visible {
  display: block;
}

/* ============================================================
   Admin page (/admin)
   ============================================================ */
body.admin-page {
  overflow: auto;
  padding: 0;
  background: #0d0d0d;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid #2a2a2a;
  background: #141414;
}
.admin-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f0f0f0;
}
.admin-user {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.admin-whoami {
  font-size: 0.9rem;
  color: #aaa;
}
.admin-ghost {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #ddd;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.admin-ghost:hover:not(:disabled) {
  border-color: #444;
  color: #fff;
}
.admin-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.admin-danger {
  background: transparent;
  border: 1px solid rgba(220, 60, 60, 0.4);
  color: #f3a3a3;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.admin-danger:hover {
  background: rgba(220, 60, 60, 0.15);
}
.admin-add {
  width: auto;
  margin-top: 0;
  padding: 0.5rem 1.2rem;
}
.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.admin-panel {
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1.5rem;
}
.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.admin-panel-head h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f0f0f0;
}
.admin-hint {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1rem;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid #2a2a2a;
}
.admin-table td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid #1f1f1f;
  color: #ddd;
  vertical-align: middle;
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.admin-meta {
  color: #888;
  font-size: 0.85rem;
}
.admin-chip {
  display: inline-block;
  background: #2a2a2a;
  color: #aaa;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  margin-left: 0.4rem;
}
.admin-chip-admin {
  background: rgba(124, 58, 237, 0.2);
  color: #b794f6;
}
.admin-select {
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: #f0f0f0;
}
.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #ddd;
  margin-top: 1rem;
  cursor: pointer;
}
.admin-checkbox input {
  width: 1rem;
  height: 1rem;
  accent-color: #7c3aed;
}

/* Admin modal (uses hidden attribute, not .visible) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-backdrop[hidden] {
  display: none;
}
.modal-backdrop .modal {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1.8rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-backdrop .modal h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 1.2rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.btn-primary {
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.btn-primary:hover:not(:disabled) {
  background: #8b4dfa;
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-secondary {
  background: transparent;
  color: #ddd;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}
.btn-secondary:hover {
  border-color: #444;
  color: #fff;
}
.modal-status {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #f3a3a3;
  min-height: 1.2em;
}

@media (max-width: 640px) {
  .admin-header {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 1rem;
  }
  .admin-main {
    padding: 1rem;
  }
  .admin-panel {
    padding: 1rem;
  }
  .admin-table {
    font-size: 0.85rem;
  }
  .admin-table th,
  .admin-table td {
    padding: 0.5rem 0.4rem;
  }
}
