/* ====================================
   Track Info Sidedrawer
   Optimized CSS with best practices
======================================= */

/* Base structure */
:root {
  --sidedrawer-width: 400px;
  --sidedrawer-rail-width: 68px;
  --sidedrawer-transition: 0.3s ease;
  --sidedrawer-z-index: 1001;
  --overlay-z-index: 1000;
  --image-preview-z-index: 1100;
}

/* Main content shifts when drawer is open (desktop) — keeps tracklist in view */
#page-content {
  transition: margin-right var(--sidedrawer-transition);
}

body.sidedrawer-open #page-content,
body.sidedrawer-persistent #page-content {
  margin-right: var(--sidedrawer-width);
}

/* The persistent sidebar floats above page chrome (z-index 90), so the audio
 * player and global header keep their full width — the sidebar simply sits
 * on top of their right edge. This avoids the player getting cut off when
 * the sidebar opens and lets the header expand back when it closes. */

/* Core components */
.sidedrawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidedrawer-width);
  height: 100vh;
  background-color: var(--color-surface);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: var(--sidedrawer-z-index);
  transform: translateX(100%);
  transition: transform var(--sidedrawer-transition);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidedrawer.visible {
  transform: translateX(0);
}

/* Persistent (docked) mode — sidebar reads as a floating card pinned beside
 * the page content (Claude-app style): inset from the viewport edges with
 * rounded corners, anchored top and bottom so opening the audio player
 * shortens the bottom without ever leaving a gap at the top. */
.sidedrawer.persistent {
  --sidedrawer-inset: 12px;
  transform: translateX(0);
  /* Pin to viewport top — not below the header — so scrolling never leaves
   * a dead band above the sidebar. The header gets its own margin-right
   * (below) so the two never overlap horizontally. */
  top: calc(var(--safe-area-top, 0px) + var(--sidedrawer-inset));
  right: var(--sidedrawer-inset);
  /* Persistent mode is on from page load; the transport's height is only
   * reserved while a player bar is actually on screen (rule below). */
  bottom: var(--sidedrawer-inset);
  height: auto;
  width: calc(var(--sidedrawer-width) - var(--sidedrawer-inset) * 2);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.06));
  overflow: hidden; /* clip header/content corners to the radius */
  /* Sit above the sticky .global-header (z-index 100) and audio player
   * so the floating card cleanly overlaps both at the right edge. */
  z-index: 110;
}

/* Player-aware bottom edge: reserve the transport's height only while a
 * player bar is on screen, so the idle card reaches the viewport bottom. */
body:has(.nts-audio-player.visible) .sidedrawer.persistent,
body:has(.youtube-player.visible) .sidedrawer.persistent {
  bottom: calc(var(--nts-player-offset) + var(--sidedrawer-inset));
}

/* Persistent header — a slim "Now Playing" strip that anchors the card and
 * carries the collapse affordance (replaces the old hover-✕ on the photo). */
.sidedrawer.persistent .sidedrawer-header {
  min-height: 40px;
  padding: 0 10px 0 16px;
  background-color: var(--color-surface);
}

.sidedrawer.persistent .sidedrawer-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.sidedrawer.persistent .sidedrawer-title > i {
  display: none; /* the eq bars replace the music glyph in persistent mode */
}

/* Equalizer bars — signal that the panel follows playback. Static (paused)
 * until a track is loaded; the reduced-motion global disables them fully. */
.sidedrawer-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
  flex-shrink: 0;
}

.sidedrawer.persistent .sidedrawer-eq {
  display: inline-flex;
}

.sidedrawer-eq i {
  width: 2.5px;
  border-radius: 1px;
  background: var(--color-text-secondary);
  animation: sidedrawer-eq 1s ease-in-out infinite;
}

.sidedrawer-eq i:nth-child(1) { height: 6px; animation-delay: 0s; }
.sidedrawer-eq i:nth-child(2) { height: 10px; animation-delay: 0.25s; }
.sidedrawer-eq i:nth-child(3) { height: 7px; animation-delay: 0.5s; }

.sidedrawer:not(.has-track) .sidedrawer-eq i {
  animation-play-state: paused;
  height: 4px;
  opacity: 0.5;
}

@keyframes sidedrawer-eq {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

/* Collapse affordance — desktop persistent mode only; mobile keeps the ✕. */
.sidedrawer-collapse {
  display: none;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: var(--border-radius-md);
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidedrawer.persistent .sidedrawer-collapse {
  display: inline-flex;
}

.sidedrawer.persistent .sidedrawer-close {
  display: none;
}

.sidedrawer-collapse:hover {
  background-color: var(--color-surface-alt);
  color: var(--color-text-primary);
}

/* Collapsed rail content — avatar + vertical now-playing label; the whole
 * strip is a click target that expands the panel. */
.sidedrawer-rail {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0 14px;
  cursor: pointer;
  z-index: 3;
}

.sidedrawer.persistent.collapsed .sidedrawer-rail {
  display: flex;
}

.sidedrawer-rail-expand {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidedrawer-rail:hover .sidedrawer-rail-expand {
  background-color: var(--color-surface-alt);
  color: var(--color-text-primary);
}

.sidedrawer-rail-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  color: var(--color-text-tertiary);
  font-size: 0.7rem;
  box-shadow: inset 0 0 0 1px rgba(var(--color-text-primary-rgb), 0.08);
}

.sidedrawer-rail-label {
  writing-mode: vertical-rl;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-height: 60%;
}

/* Suppress layout transitions during initial persistent-mode entry so the
 * content column doesn't visibly slide on every full page load. */
body.sidedrawer-no-anim #page-content,
body.sidedrawer-no-anim .global-header,
body.sidedrawer-no-anim .sidedrawer {
  transition: none !important;
}

/* Apple-style edge fades: a soft blur+gradient strip at the top and bottom
 * of the floating card so content fades into the surface as it scrolls
 * past, instead of cutting off sharply. Pointer-events disabled so the
 * overlays never intercept clicks on links/buttons beneath. */
.sidedrawer.persistent::before,
.sidedrawer.persistent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28px;
  pointer-events: none;
  z-index: 2;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

.sidedrawer.persistent::before {
  top: 0;
  background: linear-gradient(
    to bottom,
    var(--color-surface) 0%,
    rgba(var(--color-surface-rgb), 0.6) 60%,
    rgba(var(--color-surface-rgb), 0) 100%
  );
}

.sidedrawer.persistent::after {
  bottom: 0;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, transparent 100%);
  background: linear-gradient(
    to top,
    var(--color-surface) 0%,
    rgba(var(--color-surface-rgb), 0.6) 60%,
    rgba(var(--color-surface-rgb), 0) 100%
  );
}

/* Slide the global header left in lockstep with #page-content so its
 * inner nav stays aligned with the page beneath, then expands back to
 * full width when the sidebar closes. */
.global-header {
  transition: margin-right var(--sidedrawer-transition);
}

body.sidedrawer-open .global-header,
body.sidedrawer-persistent .global-header {
  margin-right: var(--sidedrawer-width);
}

body.sidedrawer-collapsed .global-header {
  margin-right: var(--sidedrawer-rail-width, 0);
}

/* Collapsed-rail state: sidebar shrinks to a narrow strip with just a toggle
 * handle so the user can reclaim screen width without losing the panel. */
body.sidedrawer-collapsed #page-content {
  margin-right: var(--sidedrawer-rail-width, 0);
}

.sidedrawer.persistent.collapsed {
  width: 44px;
  border-radius: 22px;
  overflow: hidden;
}

/* Edge fades read as smears on the narrow pill — drop them while collapsed. */
.sidedrawer.persistent.collapsed::before,
.sidedrawer.persistent.collapsed::after {
  display: none;
}

.sidedrawer.persistent.collapsed .sidedrawer-content,
.sidedrawer.persistent.collapsed .sidedrawer-header {
  opacity: 0;
  pointer-events: none;
}

/* Resize handle — invisible hit strip on the left edge; line + pill appear
 * only on hover (or while dragging). Kept inside overflow:hidden so card
 * corners stay clean — the pill is centred on the edge and half-clips. */
.sidedrawer-resize-handle {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 10px;
  cursor: col-resize;
  z-index: 6;
  touch-action: none;
}

.sidedrawer.persistent:not(.collapsed) .sidedrawer-resize-handle {
  display: block;
}

/* Full-height divider line on the edge */
.sidedrawer-resize-handle::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 1px;
  background: var(--color-border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Centred grab pill — half-clips at the card edge */
.sidedrawer-resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: var(--color-border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.sidedrawer-resize-handle:hover::before,
.sidedrawer.resizing .sidedrawer-resize-handle::before {
  opacity: 0.7;
}

.sidedrawer-resize-handle:hover::after,
.sidedrawer.resizing .sidedrawer-resize-handle::after {
  opacity: 1;
  background: var(--color-text-tertiary);
}

.sidedrawer.resizing .sidedrawer-resize-handle::after {
  transform: translate(-50%, -50%) scale(0.96);
}

body.sidedrawer-resizing {
  cursor: col-resize;
  user-select: none;
}

/* Suspend the layout transitions during a drag so the page content and
 * header track the cursor 1:1 instead of easing behind it. Transitions
 * resume on pointerup when the body class is removed. */
body.sidedrawer-resizing #page-content,
body.sidedrawer-resizing .global-header,
body.sidedrawer-resizing .sidedrawer.persistent {
  transition: none;
}

.sidedrawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: var(--overlay-z-index);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--sidedrawer-transition), visibility var(--sidedrawer-transition);
}

.sidedrawer-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Header — a slim sticky bar that anchors the sidebar when its content
 * scrolls. A hairline bottom border reads as a proper header once the
 * artist card has scrolled away, and the padding rhythm matches the
 * global header so the two stack cleanly. */
.sidedrawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 20px;
  position: sticky;
  top: 0;
  min-height: 44px;
  background-color: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  z-index: 2;
}

.sidedrawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: 0.01em;
  /* Truncate gracefully rather than let a long title push the close button
   * off-screen when the sidebar is narrow. */
  min-width: 0;
}

.sidedrawer-title i {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.sidedrawer-title-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidedrawer-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidedrawer-close:hover {
  color: var(--color-text-primary);
  background-color: var(--color-surface-alt);
}

.sidedrawer-close:active {
  transform: scale(0.9);
}

.sidedrawer-content {
  padding: 12px var(--panel-pad-x) 16px;
  flex: 1;
  overflow-y: auto; /* Ensure content can scroll if needed */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0; /* Remove gap to control spacing manually */
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.sidedrawer-content::-webkit-scrollbar {
  width: 4px;
}

.sidedrawer-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidedrawer-content::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 4px;
}

/* Reserve space at the bottom of the scrollable content whenever the
 * audio player is on screen so the taste graph (and whichever section
 * is last) can scroll into full view instead of being clipped behind
 * the fixed transport.
 *
 * Skip this when the player has been narrowed to clear the drawer (open
 * or persistent on tablet+), since in that layout the player sits beside
 * the drawer rather than under it — extra padding would just leave a dead
 * band at the bottom of the sidebar. */
body:has(.nts-audio-player.visible) .sidedrawer-content {
  padding-bottom: calc(var(--nts-player-offset) + 16px);
}

@media (min-width: 768px) {
  body.sidedrawer-open:has(.nts-audio-player.visible) .sidedrawer-content,
  body.sidedrawer-persistent:not(.sidedrawer-collapsed):has(.nts-audio-player.visible) .sidedrawer-content {
    padding-bottom: 20px;
  }
}

/* Section containers */
.track-info-section {
  margin-bottom: 16px;
  background: transparent;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.track-info-section h3 {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin: 0 0 8px 0;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 0;
  border-bottom: none;
}

.track-info-section h3 i {
  font-size: 0.6rem;
  color: var(--color-text-tertiary);
}

/* Artist header */
.artist-header {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
  position: relative; /* anchors the hover-revealed close button */
}

.artist-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: var(--border-radius-lg);
  object-fit: cover;
  background-color: var(--color-surface-alt);
  display: block;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition-base);
}

.artist-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  border-radius: inherit;
  display: block;
  max-width: 100%;
  max-height: 100%;
  transition: transform var(--transition-base);
}

.artist-image:hover {
  box-shadow: 0 4px 12px var(--color-shadow), 0 8px 24px var(--color-shadow);
}

.artist-image:hover img {
  transform: scale(1.05);
}

.artist-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 2rem;
}

.artist-image.placeholder i,
.similar-artist-image.placeholder i {
  --icon: var(--icon-lg);
}

.artist-name-container {
  flex: 1;
  margin-top: 0;
  width: 100%; /* Ensure full width */
  min-height: 0; /* Allow flex item to shrink below content size */
}

.artist-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.artist-name-container .artist-bio {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 6px 0 0 0;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  position: relative;
  z-index: 1;
  clear: both;
}

.artist-name-container .artist-bio::-webkit-scrollbar {
  width: 4px;
}

.artist-name-container .artist-bio::-webkit-scrollbar-track {
  background: var(--color-surface-alt);
}

.artist-name-container .artist-bio::-webkit-scrollbar-thumb {
  background: var(--color-border);
}

/* Skeleton loading animations */
.tag-skeleton {
  display: inline-block;
  width: 60px;
  height: 24px;
  background: var(--color-surface-alt);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.tag-skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

.loading-tags {
  display: flex;
  gap: 8px;
  align-items: center;
}

.loading-tags .tag-skeleton:nth-child(1) { width: 55px; }
.loading-tags .tag-skeleton:nth-child(2) { width: 70px; animation-delay: 0.15s; }
.loading-tags .tag-skeleton:nth-child(3) { width: 50px; animation-delay: 0.3s; }

.similar-artists-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.similar-artists-section {
  margin-top: 16px;
  width: 100%;
  box-sizing: border-box;
  position: relative; /* Ensure proper positioning context */
  clear: both; /* Clear any floated elements */
}

.tags-container {
  margin-top: 10px; /* Add margin to separate from bio */
}

.track-links {
  margin-top: 12px; /* Add margin to separate from track details */
}

.similar-artists-loading .loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--color-text-secondary);
}

.similar-artists-loading .loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
}

.similar-artists-loading .loading-spinner svg {
  animation: spin 1s linear infinite;
}

@keyframes skeleton-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Track details */
.track-details {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  background-color: rgba(var(--color-text-primary-rgb), 0.035);
  border: 1px solid rgba(var(--color-text-primary-rgb), 0.055);
  border-radius: 6px;
  padding: 9px 10px;
  position: relative;
  width: 100%; /* Ensure full width */
  box-sizing: border-box; /* Include padding in width calculation */
  align-items: flex-start; /* Align items to start */
}

.track-details-edit-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.track-details-edit-button:hover {
  opacity: 1;
  color: var(--color-primary);
}

.track-details-edit-actions {
  display: none;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--color-border);
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  grid-column: 1 / -1;
}

.track-details-edit-actions.visible {
  display: flex;
}

.track-details-edit-actions button {
  padding: 6px 12px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.track-details-save-button {
  background-color: var(--color-primary);
  color: white;
  border: none;
}

.track-details-save-button:hover {
  opacity: 0.9;
}

.track-details-cancel-button {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.track-details-cancel-button:hover {
  background-color: var(--color-surface-alt);
}

/* Remove the editing specific layout changes */
.track-details.editing {
  display: flex;
  flex-direction: row;
}

.track-details.editing .album-cover-container {
  align-self: flex-start;
}

.track-details.editing .track-metadata {
  flex: 1;
}

/* Metadata styling */
.metadata-value.editable {
  min-width: 0;
  padding: 0;
  min-height: auto;
}

.metadata-value.editing {
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background-color: var(--color-surface);
  padding: 2px 4px;
  min-height: 22px;
  box-sizing: border-box;
  width: 100%;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.metadata-value input {
  background: none;
  border: none;
  color: var(--color-text-primary);
  font-size: 0.8rem;
  width: 100%;
  outline: none;
  padding: 0;
  margin: 0;
  line-height: 1.2;
  height: 18px;
  box-sizing: border-box;
}

.metadata-row {
  display: contents;
}

.album-cover-container {
  flex-shrink: 0;
}

.album-cover {
  width: 100px;
  height: 100px;
  border-radius: var(--border-radius-md);
  object-fit: cover;
  background-color: var(--color-surface-alt);
  display: block;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition-base);
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
  max-width: 100%;
  max-height: 100%;
  transition: transform var(--transition-base);
}

.album-cover:hover {
  box-shadow: 0 4px 12px var(--color-shadow), 0 8px 24px var(--color-shadow);
}

.album-cover:hover img {
  transform: scale(1.05);
}

.album-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary, var(--color-text-secondary));
  font-size: 1.1rem;
  opacity: 0.72;
}

.track-metadata {
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 1px;
  align-items: baseline;
  min-width: 0;
  overflow: hidden;
}

.metadata-label {
  font-weight: 700;
  color: var(--color-text-tertiary, var(--color-text-secondary));
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.105em;
  padding: 1px 0;
}

.metadata-value {
  color: var(--color-text-secondary);
  font-size: 0.76rem;
  line-height: 1.32;
  font-weight: 500;
  padding: 1px 0;
  min-width: 0;
}

/* Clickable label */
.metadata-value.clickable,
.metadata-value .metadata-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(var(--color-text-secondary-rgb), 0.38);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.metadata-value.clickable {
  cursor: pointer;
  color: var(--color-text-primary);
}

.metadata-value.clickable:hover {
  color: var(--color-text-secondary);
  text-decoration-color: rgba(var(--color-text-secondary-rgb), 0.58);
}

.metadata-value .metadata-link {
  color: inherit;
  /* Wrapped links hit-test per line fragment at font height, leaving a dead
     band between the lines where the cursor flips to the arrow. Vertical
     padding on an inline box closes it without moving any layout. */
  padding-block: 0.25em;
}

.metadata-value .metadata-link:hover {
  color: var(--color-text-primary);
  text-decoration-color: rgba(var(--color-text-primary-rgb), 0.42);
}

/* Album genres */
.album-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.album-genre {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  line-height: 1.2;
  padding: 3px 9px;
  background-color: var(--color-surface-alt);
  border: none;
  border-radius: var(--border-radius-full);
  color: var(--color-text-secondary);
}

/* External links */
.external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sidedrawer-content > .external-links {
  background-color: var(--color-surface);
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 4px;
  background-color: var(--color-surface-alt);
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.external-link:hover {
    background-color: var(--color-border);
}

.external-link i {
  font-size: 0.9rem;
}

/* Artist bio */
.artist-bio {
  line-height: 1.5;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  margin-bottom: 15px;
  padding: 4px 0;
}

/* Same inline-safe hit padding as .metadata-link: keeps the pointer steady
   across bio links that wrap onto a second line. */
.artist-bio a {
  padding-block: 0.25em;
}

/* Top Albums section */
.albums-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.album-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 6px;
  transition: background-color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.album-list-item:hover {
  background-color: rgba(var(--color-surface-alt-rgb), 0.5);
  transform: translateX(3px);
}

.album-list-cover {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.album-list-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.album-list-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-list-year {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* Recommendations section */
.recommendations-section {
  margin-top: 15px;
}

.recommendation-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  margin-bottom: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.recommendation-item:hover {
  background-color: rgba(var(--color-surface-alt-rgb), 0.5);
}

.recommendation-cover {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recommendation-info {
  flex: 1;
}

.recommendation-album {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.recommendation-artist {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.recommendation-reason {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-top: 3px;
}

/* Image gallery */
.image-gallery {
  margin-top: 15px;
}

.image-gallery-main {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-main-image {
  width: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  cursor: pointer;
  display: block;
}

.gallery-main-image:hover {
  transform: scale(1.02);
}

.image-gallery-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.image-gallery-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.image-gallery-thumbnails::-webkit-scrollbar-track {
  background: transparent;
}

.image-gallery-thumbnails::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 6px;
}

.gallery-thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.gallery-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Loading indicator */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  width: 100%;
  color: var(--color-text-secondary);
}

.loading-spinner {
  margin-bottom: 15px;
  animation: spin 1.5s linear infinite;
}

.loading-spinner svg {
  stroke-dasharray: 60;
  stroke-dashoffset: 120;
  stroke: var(--color-text-primary);
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes dash {
  0% { stroke-dashoffset: 120; }
  50% { stroke-dashoffset: 30; }
  100% { stroke-dashoffset: 120; }
}

/* Error message */
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  width: 100%;
  color: var(--color-error);
  text-align: center;
  padding: 20px;
}

.error-message i {
  --icon: var(--icon-lg);
  font-size: 40px;
  margin-bottom: 15px;
}

.error-message p {
  margin-bottom: 15px;
  font-size: 16px;
}

.success-message {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(52, 199, 89, 0.1);
  border-left: 3px solid #34c759;
  padding: 10px 15px;
  margin-bottom: 15px;
  border-radius: 4px;
  animation: fadeIn 0.3s ease;
}

.success-message i {
  color: #34c759;
  font-size: 1.2rem;
}

.success-message p {
  margin: 0;
  color: var(--color-text-primary);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Idle state shown in the persistent sidebar before any track has played */
.sidedrawer-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--color-text-secondary);
  min-height: 240px;
}

.sidedrawer-idle i {
  --icon: var(--icon-lg);
  font-size: 2.4rem;
  opacity: 0.5;
}

.sidedrawer-idle h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.sidedrawer-idle p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 280px;
}

/* Image preview overlay */
.image-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: var(--image-preview-z-index);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--sidedrawer-transition), visibility var(--sidedrawer-transition);
}

.image-preview-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.image-preview-container {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.image-preview {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.image-preview-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.image-preview-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.image-preview-controls {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  color: white;
}

.image-preview-prev,
.image-preview-next {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s ease;
}

.image-preview-prev:hover,
.image-preview-next:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.image-preview-counter {
  font-size: 0.9rem;
}

/* Track lyrics styling */
.track-lyrics {
  max-height: 300px;
  overflow-y: auto;
  padding: 15px;
  background-color: var(--color-surface-alt);
  border-radius: 6px;
  border-left: 3px solid var(--color-border);
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  white-space: pre-line;
}

.track-lyrics::-webkit-scrollbar {
  width: 6px;
}

.track-lyrics::-webkit-scrollbar-track {
  background: transparent;
}

.track-lyrics::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 6px;
}

.track-lyrics p {
  margin: 0 0 8px 0;
}

.track-lyrics p:empty {
  height: 1em;
}

/* No similar artists message */
.no-similar-artists {
    padding: 15px;
    background-color: var(--color-surface-alt);
    border-radius: 8px;
    text-align: center;
    margin: 10px 0;
    color: var(--color-text-secondary);
}

/* Similar artists grid */
.similar-artists-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.similar-artist-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background-color: var(--color-surface-alt);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    min-width: 0;
}

.similar-artist-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
    aspect-ratio: 1 / 1;
    transition: box-shadow var(--transition-base);
}

.similar-artist-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.similar-artist-item:hover .similar-artist-image-container {
    box-shadow: 0 4px 12px var(--color-shadow), 0 8px 24px var(--color-shadow);
}

.similar-artist-item:hover .similar-artist-image {
    transform: scale(1.05);
}

.similar-artist-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    background-color: var(--color-surface);
}

.match-percentage {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    border-top-left-radius: 4px;
}

.similar-artist-info {
    padding: 8px;
    min-width: 0;
}

.similar-artist-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.similar-artist-genres {
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tags styling */
.tags-container {
  margin: 15px 0;
}

.tags-container h4 {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin: 0 0 8px 0;
  color: var(--color-text-tertiary);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background-color: var(--color-surface-alt);
  color: var(--color-text-secondary);
  border: none;
  border-radius: var(--border-radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  line-height: 1.2;
  transition: background-color 0.2s ease;
}

/* No hover treatment: these are informational spans, not links — a hover
   highlight with an arrow cursor reads as a broken control. */

/* Track links styling */
.track-links {
  margin: 20px 0;
}

.track-links h4 {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin: 0 0 10px 0;
  color: var(--color-text-tertiary);
}

.link-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* JS-managed container for direct store links (Beatport, Boomkat, Bleep...);
   its buttons join the grid as if they were direct children. */
.link-buttons .external-links {
  display: contents;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  padding: 8px 10px;
  background-color: var(--color-surface-alt);
  color: var(--color-text-primary);
  border: 0;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  text-decoration: none;
  font-size: 12.5px;
  font-family: inherit;
  line-height: 1.1;
  white-space: nowrap;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.link-button.searching {
  pointer-events: none;
  opacity: 0.72;
}

.link-button:hover {
  background-color: var(--color-border);
}

.link-button i {
  margin-right: 7px;
  font-size: 13px;
  flex-shrink: 0;
}

.link-button.youtube i {
  color: #ff0000;
}

.link-button.lastfm i {
  color: #d51007;
}

.link-button.bandcamp i {
  color: #1ea0c3;
}

.link-button.discogs i {
  color: #333333;
}

/* Similar artists section styling */
.similar-artists-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.similar-artists-section h3 {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.similar-artist-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

/* Dark mode specific adjustments */
@media (prefers-color-scheme: dark) {
  .sidedrawer {
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  }
  
.similar-artist-item {
    background-color: var(--color-dark-surface);
  }
  
.tag {
    background-color: var(--color-dark-surface-alt);
  }
  
  .link-button {
    background-color: var(--color-dark-surface);
  }
  
  .link-button:hover {
    background-color: var(--color-dark-surface-alt);
  }
  
  .link-button.discogs i {
    color: #cccccc;
  }
  
  .track-details {
    background-color: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.055);
  }
  
  .loading-spinner svg {
    stroke: var(--color-dark-text-primary);
  }
  
  .no-similar-artists {
    background-color: var(--color-dark-surface);
  }
  
  .tag-skeleton {
    background: var(--color-dark-surface-alt);
  }
  
  .tag-skeleton::after {
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.03) 50%,
      transparent 100%
    );
  }
  
  /* New styles for edit functionality */
  .metadata-value.editing {
    background-color: var(--color-dark-surface);
    border-color: var(--color-dark-border);
  }
  
  .metadata-value input {
    color: var(--color-dark-text-primary);
  }
  
  .track-details-edit-button {
    color: var(--color-dark-text-secondary);
  }
  
  .track-details-edit-button:hover {
    color: var(--color-primary);
  }
  
  .track-details-edit-actions button {
    background-color: var(--color-dark-surface) !important;
    border-color: var(--color-dark-border);
    color: var(--color-dark-text-primary);
  }
  
  .track-details-save-button {
    background-color: var(--color-primary) !important;
    color: white !important;
  }
  
  .track-details-save-button:hover {
    background-color: var(--color-primary-dark) !important;
  }
  
  .track-details-cancel-button:hover {
    background-color: var(--color-dark-surface-alt) !important;
  }
  
  .success-message {
    background-color: rgba(52, 199, 89, 0.15);
    border-left-color: #34c759;
  }
}

/* Desktop: drawer sits in cleared space; no dimming overlay */
@media (min-width: 769px) {
  .sidedrawer-overlay {
    display: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .sidedrawer-overlay {
    display: none !important;
  }

  body.sidedrawer-open #page-content,
  body.sidedrawer-persistent #page-content {
    margin-right: min(380px, 85vw);
  }

  .sidedrawer {
    width: min(380px, 85vw);
  }
}

/* Mobile: persistent mode is disabled — always fall back to overlay behaviour.
 * The JS layer enforces this by never setting body.sidedrawer-persistent on
 * narrow viewports, but we belt-and-brace it in CSS so no transform leaks. */
@media (max-width: 767px) {
  body.sidedrawer-open #page-content,
  body.sidedrawer-persistent #page-content {
    margin-right: 0;
  }

  .sidedrawer {
    width: 100%;
  }

  .sidedrawer.persistent:not(.visible) {
    transform: translateX(100%);
  }

  .sidedrawer.persistent .sidedrawer-close {
    display: flex;
  }

  /* Mobile keeps the overlay flow: no collapse affordance, no rail. */
  .sidedrawer.persistent .sidedrawer-collapse,
  .sidedrawer.persistent.collapsed .sidedrawer-rail {
    display: none;
  }
  
  .artist-header {
    flex-direction: column;
    align-items: center;
  }

  /* Generous artist portrait on mobile; capped so it doesn't dominate the
   * full-screen drawer on tablets. */
  .artist-image {
    width: min(70vw, 260px);
    height: auto;
    aspect-ratio: 1 / 1;
    margin-bottom: 15px;
  }
  
  .track-details {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .album-cover-container {
    align-self: center;
    margin-bottom: 15px;
  }
  
  .track-metadata {
    width: 100%;
  }
  
  .recommendation-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .recommendation-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
  }
  
  .similar-artists-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Defer to the container's 1/1 aspect ratio instead of a fixed height,
   * which was being honoured by some browsers and squashing the image. */
  .similar-artist-image {
    height: 100%;
  }

  .tags {
    gap: 6px;
  }
  
  .tag {
    padding: 3px 9px;
    font-size: 0.65rem;
  }
  
  .link-buttons {
    gap: 7px;
  }
  
  .link-button {
    padding: 7px 9px;
    font-size: 12px;
  }

  .link-button i {
    margin-right: 6px;
    font-size: 12px;
  }
  
  .track-details-edit-actions {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .similar-artists-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .track-details-edit-actions {
    top: 40px;
    right: 8px;
  }
}

/* ==========================================================================
   NTS Taste Graph — Stage 3 sidebar section
   Reuses the spacing rhythm and surface language of the Similar Artists grid.
   ========================================================================== */

.taste-graph-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
  width: 100%;
  box-sizing: border-box;
}

.taste-graph-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.taste-graph-card {
  background: transparent;
  border: none;
  padding: 0;
}

.taste-graph-card h4 {
  margin: 0 0 10px 0;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.taste-graph-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.taste-item {
  display: block;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text-primary);
  background: transparent;
  transition: background-color 0.15s ease;
}

.taste-item:not(.static):hover {
  background-color: var(--color-surface-alt);
}

.taste-item.static {
  cursor: default;
}

/* "Found on" nests the artist's episodes under each show. They sit outside the
   show's own anchor (no nested links), so the rule marks them as belonging to
   the row above. */
.taste-episodes {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 1px 0 6px 9px;
  padding-left: 11px;
  border-left: 1px solid var(--color-border);
}

.taste-episode {
  display: block;
  padding: 3px 8px;
  margin-left: -8px;
  border-radius: 6px;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a.taste-episode:hover {
  background-color: var(--color-surface-alt);
  color: var(--color-text-primary);
}

.taste-item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.taste-item-sub {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  margin-top: 3px;
  line-height: 1.35;
}

.taste-item-sub:empty {
  display: none;
}

.taste-graph-skeleton {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    var(--color-surface-alt, rgba(0, 0, 0, 0.05)) 0%,
    var(--color-border) 50%,
    var(--color-surface-alt, rgba(0, 0, 0, 0.05)) 100%);
  background-size: 200% 100%;
  animation: taste-graph-shimmer 1.2s infinite linear;
  margin-top: 6px;
}

.taste-graph-skeleton:first-child {
  margin-top: 0;
}

.taste-graph-card.loading .taste-graph-skeleton:nth-child(2) { width: 85%; }
.taste-graph-card.loading .taste-graph-skeleton:nth-child(3) { width: 70%; }
.taste-graph-card.loading .taste-graph-skeleton:nth-child(4) { width: 60%; }

@keyframes taste-graph-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.taste-graph-empty {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
  padding: 4px 0;
}

/* Credits (Discogs extraartists) */
.credits-section,
.label-more-section {
  margin: 20px 0;
}

.credits-section h4,
.label-more-section h4 {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin: 0 0 10px 0;
  color: var(--color-text-tertiary);
}

.credit-rows {
  display: flex;
  flex-direction: column;
}

.credit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--border-radius-md);
  text-decoration: none;
  color: var(--color-text-primary);
}

.credit-row:hover {
  background-color: var(--color-surface-alt);
}

.credit-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.credit-name {
  font-weight: 600;
  font-size: 0.82rem;
}

.credit-role {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
}

.credit-lib-count {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  white-space: nowrap;
}

/* More from this label on NTS */
.label-more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.label-more-card {
  min-width: 0;
  text-decoration: none;
  color: var(--color-text-primary);
}

.label-more-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: var(--border-radius-md);
  background-color: var(--color-surface-alt);
}

.label-more-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  font-size: 18px;
}

.label-more-title {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 4px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.label-more-sub {
  font-size: 0.65rem;
  color: var(--color-text-tertiary);
  margin-top: 1px;
}

.label-more-link {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 7px;
  margin-top: 10px;
  border: 1px dashed var(--color-border);
  border-radius: var(--border-radius-md);
}

.label-more-link:hover {
  color: var(--color-text-primary);
  border-color: var(--color-accent-border);
}

/* Print styles - hide sidedrawer when printing */
@media print {
  .sidedrawer,
  .sidedrawer-overlay,
  .image-preview-overlay {
    display: none !important;
  }
}
