/* S426.5 — Pulse Player design tokens + utility classes */
:root {
  /* Brand colors — modern music-app palette */
  --pulse-primary: #FF6B6B;          /* coral pink — buttons, active state */
  --pulse-primary-hover: #ff5252;
  --pulse-accent: #4ECDC4;            /* teal — highlights, equalizer */
  --pulse-accent-hover: #3db8b0;

  /* Surfaces */
  --pulse-surface: #0a0a0a;           /* near-black bg */
  --pulse-surface-elevated: #181818;  /* cards, modals, footer */
  --pulse-surface-overlay: rgba(0,0,0,.7);
  --pulse-surface-muted: #222;

  /* Text */
  --pulse-text: #eeeeee;
  --pulse-text-secondary: rgba(238,238,238,.7);
  --pulse-text-muted: rgba(238,238,238,.5);

  /* Borders */
  --pulse-border: #222;
  --pulse-border-strong: #333;

  /* Type */
  --pulse-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pulse-font-display: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --pulse-space-xs: 4px;
  --pulse-space-sm: 8px;
  --pulse-space-md: 16px;
  --pulse-space-lg: 24px;
  --pulse-space-xl: 32px;

  /* Radii */
  --pulse-radius-sm: 6px;
  --pulse-radius-md: 12px;
  --pulse-radius-lg: 24px;
  --pulse-radius-pill: 999px;

  /* Motion */
  --pulse-easing: cubic-bezier(.4, 0, .2, 1);
  --pulse-duration-fast: 120ms;
  --pulse-duration-normal: 240ms;

  /* Shadows */
  --pulse-shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --pulse-shadow-md: 0 4px 24px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.04);
  --pulse-shadow-lg: 0 12px 48px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06);
}

html, body, pulse-app {
  font-family: var(--pulse-font);
  background: var(--pulse-surface);
  color: var(--pulse-text);
}

/* Tabular numbers for time displays */
.pulse-tabular { font-variant-numeric: tabular-nums; }

/* Equalizer bars (used in mini-player when audio plays) */
.pulse-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  width: 14px;
}
.pulse-eq__bar {
  width: 3px;
  background: var(--pulse-accent);
  border-radius: 1px;
  animation: pulse-eq-bounce 800ms ease-in-out infinite;
}
.pulse-eq__bar:nth-child(1) { height: 30%; animation-delay: 0ms; }
.pulse-eq__bar:nth-child(2) { height: 80%; animation-delay: 150ms; }
.pulse-eq__bar:nth-child(3) { height: 50%; animation-delay: 300ms; }
@keyframes pulse-eq-bounce {
  0%, 100% { transform: scaleY(.4); }
  50% { transform: scaleY(1); }
}

/* Cover-art consistency — no gradient fallback needed; img always present via cover-art.ts */
.pulse-cover {
  aspect-ratio: 1;
  object-fit: cover;
}

/* Nav — icon + label pairs */
.pulse-nav { display: flex; gap: var(--pulse-space-xs); align-items: center; }
.pulse-nav-item {
  display: inline-flex;
  align-items: center;
  gap: var(--pulse-space-xs);
  background: transparent;
  border: 0;
  color: var(--pulse-text-secondary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--pulse-radius-sm);
  font: inherit;
  transition: color var(--pulse-duration-fast) var(--pulse-easing), background var(--pulse-duration-fast) var(--pulse-easing);
}
.pulse-nav-item:hover {
  color: var(--pulse-text);
  background: rgba(255,255,255,.06);
}
.pulse-nav-item--active {
  color: var(--pulse-text);
}
.pulse-nav-item__icon { width: 18px; height: 18px; display: inline-flex; }
.pulse-nav-item__label { font-size: 13px; font-weight: 500; }
.pulse-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.pulse-brand-lockup__logo {
  height: 44px;
  width: auto;
  max-width: min(280px, 52vw);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 6px 14px rgba(230,120,108,.25));
}

@media (max-width: 480px) {
  .pulse-nav-item__label { display: none; }
}

/* Route links should feel like app navigation, not default browser anchors. */
a[data-route-link] {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  font-weight: 500;
  transition:
    color var(--pulse-duration-fast) var(--pulse-easing),
    border-color var(--pulse-duration-fast) var(--pulse-easing),
    font-weight var(--pulse-duration-fast) var(--pulse-easing);
}
a[data-route-link]:hover {
  color: var(--pulse-accent);
  border-bottom-color: color-mix(in srgb, var(--pulse-accent) 65%, transparent);
  font-weight: 600;
}

/* ─── Mini player — Fix 2: fixed at very bottom, z-index 50 ─────────── */
pulse-now-playing[data-root-mounted] {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
}
/* Hide mini-player when drive mode is active */
body[data-route="drive"] pulse-now-playing[data-root-mounted] {
  display: none;
}
/* Admin sign-in: root mini-player is a sibling after <pulse-app>; hide so it cannot intercept taps */
body[data-pulse-route="admin"] pulse-now-playing[data-root-mounted] {
  display: none;
}

.pulse-mini {
  display: flex;
  align-items: center;
  gap: var(--pulse-space-md);
  padding: var(--pulse-space-sm) var(--pulse-space-md);
  /* S446.7 (§4.4) — defensive safe-area padding. iOS Safari's bottom
     toolbar can overlap content docked to bottom:0 in some scroll
     states, hiding the prev/play/next controls. env() returns 0 on
     non-notch devices so the visual height stays identical there.
     Padding (not bottom-offset) keeps the bar docked while shifting
     content up. Full repro of the disappear bug is still pending. */
  padding-bottom: calc(var(--pulse-space-sm) + env(safe-area-inset-bottom, 0px));
  background: var(--pulse-surface-elevated);
  border-top: 1px solid var(--pulse-border);
  /* Was: fixed 64px. Now: a minimum so the safe-area padding can grow
     the bar on devices that need it. Most rows still render at 64px. */
  min-height: 64px;
  cursor: pointer;
  transition: background var(--pulse-duration-fast) var(--pulse-easing);
  /* Fix 1: directional theme tint from current track color */
  background-image: linear-gradient(90deg, var(--pulse-theme-color-soft, transparent), transparent);
}
.pulse-mini:hover { background: #1f1f1f; }
.pulse-mini[data-empty] { color: var(--pulse-text-muted); justify-content: center; cursor: default; }
.pulse-mini__cover { width: 48px; height: 48px; border-radius: var(--pulse-radius-sm); flex-shrink: 0; }
.pulse-mini__meta { flex: 1; min-width: 0; }
.pulse-mini__title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-mini__artist {
  font-size: 12px;
  color: var(--pulse-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pulse-mini__play {
  background: var(--pulse-primary);
  color: #fff;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--pulse-duration-fast) var(--pulse-easing), background var(--pulse-duration-fast) var(--pulse-easing);
}
.pulse-mini__play:hover { background: var(--pulse-primary-hover); transform: scale(1.05); }
.pulse-mini__placeholder { font-size: 13px; }

/* Fix 4: additional controls in mini-player */
.pulse-mini__controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pulse-mini__ctl {
  background: transparent;
  border: 0;
  color: var(--pulse-text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--pulse-duration-fast) var(--pulse-easing), background var(--pulse-duration-fast) var(--pulse-easing);
}
.pulse-mini__ctl:hover { color: var(--pulse-text); background: rgba(255,255,255,.08); }
.pulse-mini__ctl[data-pressed="true"] { color: var(--pulse-primary); }
.pulse-mini__sleep-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: var(--pulse-radius-pill);
  background: rgba(255,255,255,.08);
  color: var(--pulse-text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.pulse-mini__overflow-menu {
  position: absolute;
  right: 12px;
  bottom: 58px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  padding: 8px;
  border: 1px solid var(--pulse-border-strong);
  border-radius: var(--pulse-radius-md);
  background: var(--pulse-surface-elevated);
  box-shadow: var(--pulse-shadow-md);
  z-index: 60;
}
.pulse-mini__overflow-menu button,
.pulse-mini__overflow-menu pulse-share-button {
  width: 100%;
}
.pulse-mini__overflow-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--pulse-radius-sm);
  background: transparent;
  color: var(--pulse-text);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.pulse-mini__overflow-menu button:hover {
  background: rgba(255,255,255,.08);
}
@media (max-width: 1023px) {
  .pulse-mini__ctl--more,
  .pulse-mini__overflow-menu {
    display: none;
  }
}

/* ─── Expanded now playing — bottom sheet (peek at library behind) ─── */
.pulse-expanded-scrim {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
}
.pulse-expanded-scrim__shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .42);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  animation: pulse-expanded-scrim-in var(--pulse-duration-normal) var(--pulse-easing);
}
@keyframes pulse-expanded-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.pulse-expanded {
  --pulse-expanded-frac: 0.7;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* vh fallback for engines without dvh */
  height: calc(var(--pulse-expanded-frac, 0.7) * 100vh);
  height: calc(var(--pulse-expanded-frac, 0.7) * 100dvh);
  min-height: min(220px, 30vh);
  max-height: calc(100vh - env(safe-area-inset-top, 0px) - 8px);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 8px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  /* Fix 1: expanded view uses theme color as top gradient stop */
  background: linear-gradient(180deg, var(--pulse-theme-color, var(--pulse-extracted-color, var(--pulse-surface-elevated))) 0%, var(--pulse-surface) 70%);
  z-index: 1;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, .45);
  pointer-events: auto;
  touch-action: pan-y;
  transition: height 0.24s cubic-bezier(0.34, 1.2, 0.64, 1);
  animation: pulse-expanded-sheet-in var(--pulse-duration-normal) var(--pulse-easing);
}
.pulse-expanded.pulse-expanded--dragging {
  transition: none;
}
.pulse-expanded pulse-fx-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
@keyframes pulse-expanded-sheet-in {
  from { opacity: 0; transform: translateY(28%); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-expanded-scrim__shade,
  .pulse-expanded {
    animation: none !important;
  }
  .pulse-expanded {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .pulse-expanded-scrim__shade { opacity: 1; }
}
.pulse-expanded__drag-row {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  width: 100%;
}
.pulse-expanded__drag-handle {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .28);
  cursor: grab;
  touch-action: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.pulse-expanded__drag-handle:active {
  cursor: grabbing;
  background: rgba(255, 255, 255, .4);
}
.pulse-expanded__cover-wrap {
  border-radius: var(--pulse-radius-md);
  transition: transform 0.32s cubic-bezier(0.34, 1.45, 0.54, 1);
  will-change: transform;
}
.pulse-expanded__cover-wrap--is-dragging {
  transition: none;
}
.pulse-expanded__close {
  position: absolute;
  z-index: 3;
  /* S446.7 (§4.2) — respect iOS notch / Dynamic Island. Pre-S446.7 the
     16px top fixed offset overlapped the system status bar on iPhone
     14 Pro / 15 Pro / 16 Pro families, making the X button half-eaten
     by the camera punch-out. env(safe-area-inset-*) returns 0 on
     devices without insets so the visual baseline is preserved. */
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  background: rgba(0, 0, 0, .4);
  color: #fff;
  border: 0;
  /* 44px minimum tap target (WCAG / platform HIG); icon remains 20px */
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(8px);
  transition: background var(--pulse-duration-fast) var(--pulse-easing);
}
.pulse-expanded__close:hover { background: rgba(0, 0, 0, .65); }
.pulse-expanded__inner {
  position: relative;
  z-index: 2;
  flex: 0 1 auto;
  min-height: 0;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 8px var(--pulse-space-lg) var(--pulse-space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--pulse-space-md);
}
.pulse-expanded__cover { width: min(280px, 78vw); height: auto; aspect-ratio: 1; border-radius: var(--pulse-radius-md); box-shadow: var(--pulse-shadow-lg); }
.pulse-expanded__title { font-size: 24px; font-weight: 700; margin: var(--pulse-space-lg) 0 4px 0; text-align: center; }
.pulse-expanded__artist { font-size: 16px; color: var(--pulse-text-secondary); margin: 0 0 var(--pulse-space-md) 0; text-align: center; }
.pulse-expanded__scrubber {
  display: flex;
  align-items: center;
  gap: var(--pulse-space-sm);
  width: 100%;
  font-size: 12px;
  color: var(--pulse-text-secondary);
}
.pulse-expanded__track {
  flex: 1;
  height: 4px;
  background: var(--pulse-border-strong);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.pulse-expanded__fill { height: 100%; background: var(--pulse-primary); border-radius: 2px; pointer-events: none; }
.pulse-expanded__controls {
  display: flex;
  align-items: center;
  gap: var(--pulse-space-lg);
  margin-top: var(--pulse-space-md);
}
.pulse-expanded__controls button {
  background: transparent;
  border: 0;
  color: var(--pulse-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: transform var(--pulse-duration-fast) var(--pulse-easing);
}
.pulse-expanded__controls button:hover { transform: scale(1.1); }
.pulse-expanded__play-button {
  background: var(--pulse-primary) !important;
  color: #fff !important;
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pulse-expanded__toolbar {
  display: flex;
  align-items: center;
  gap: var(--pulse-space-lg);
  margin-top: var(--pulse-space-md);
}
.pulse-expanded__toolbar button {
  background: transparent;
  border: 0;
  color: var(--pulse-text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--pulse-radius-sm);
  transition: color var(--pulse-duration-fast) var(--pulse-easing);
}
.pulse-expanded__toolbar button:hover { color: var(--pulse-text); }
.pulse-expanded__toolbar button[data-pressed="true"] { color: var(--pulse-primary); }

/* ─── Library home ──────────────────────────────────────────────────── */
.pulse-library-home { padding: var(--pulse-space-md); display: flex; flex-direction: column; gap: var(--pulse-space-xl); }

/* Hero section */
.pulse-hero {
  display: grid; grid-template-columns: auto 1fr; gap: var(--pulse-space-lg);
  align-items: center; padding: var(--pulse-space-lg);
  background: linear-gradient(135deg, rgba(255,107,107,.15), rgba(78,205,196,.15));
  border-radius: var(--pulse-radius-lg);
}
.pulse-hero__art { position: relative; width: 200px; height: 200px; flex-shrink: 0; }
.pulse-hero__cover { width: 100%; height: 100%; border-radius: var(--pulse-radius-md); box-shadow: var(--pulse-shadow-lg); }
.pulse-hero__play {
  position: absolute; bottom: 12px; right: 12px;
  background: var(--pulse-primary); color: #fff; border: 0;
  width: 56px; height: 56px; border-radius: 50%; cursor: pointer;
  font-size: 22px; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--pulse-shadow-md);
  transition: transform var(--pulse-duration-fast) var(--pulse-easing);
}
.pulse-hero__play:hover { transform: scale(1.08); }
.pulse-hero__eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--pulse-primary); font-weight: 600; }
.pulse-hero__title { font-size: 32px; font-weight: 700; margin: 4px 0; line-height: 1.1; }
.pulse-hero__artist { font-size: 16px; color: var(--pulse-text-secondary); margin: 0; }

@media (max-width: 600px) {
  .pulse-hero { grid-template-columns: 1fr; text-align: center; padding: var(--pulse-space-md); }
  .pulse-hero__art { width: 100%; max-width: 280px; height: auto; aspect-ratio: 1; margin: 0 auto; }
  .pulse-hero__art .pulse-hero__cover { height: 100%; }
  .pulse-hero__title { font-size: 24px; }
}

/* Rail titles */
.pulse-rail__title { font-size: 18px; font-weight: 600; margin: 0 0 var(--pulse-space-md) 0; }

/* Vertical track list section */
.pulse-rail-vert { display: flex; flex-direction: column; }

.pulse-tracks-list { display: flex; flex-direction: column; background: var(--pulse-surface-elevated); border-radius: var(--pulse-radius-md); overflow: hidden; }

/* Track row — used in home all-tracks, artist page, category page, search, queue */
.pulse-track-row {
  display: grid; grid-template-columns: 40px 1fr auto;
  align-items: center; gap: var(--pulse-space-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--pulse-duration-fast) var(--pulse-easing);
}
.pulse-track-row:hover { background: rgba(255,255,255,.04); }
.pulse-track-row__cover { width: 40px; height: 40px; border-radius: var(--pulse-radius-sm); }
.pulse-track-row__title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-track-row__artist { font-size: 12px; color: var(--pulse-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-track-row__duration { font-size: 12px; color: var(--pulse-text-muted); }
/* S470.5 — row badges (heart + clap count) ---------------------------------
   Subtle, non-interactive indicators that match the now-playing iconography.
   Both use CSS mask + currentColor so colors track the theme. */
.pulse-track-row__like-badge {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--pulse-accent, #e85a71);
}
.pulse-track-row__like-icon {
  width: 14px; height: 14px; display: inline-block;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;  mask-size: contain;
  -webkit-mask-repeat: no-repeat;  mask-repeat: no-repeat;
  -webkit-mask-position: center;  mask-position: center;
}
.pulse-track-row__claps {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--pulse-text-muted, #aaa);
}
.pulse-track-row__claps-icon {
  width: 12px; height: 12px; display: inline-block;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 11.5a1 1 0 0 1 2 0v3a1 1 0 0 1-2 0z M8 8.5a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0z M11 6.5a1 1 0 0 1 2 0v8a1 1 0 0 1-2 0z M14 7.5a1 1 0 0 1 2 0v7a1 1 0 0 1-2 0z M4 14.5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v2.5a4.5 4.5 0 0 1-4.5 4.5h-5A4.5 4.5 0 0 1 4 17z M18.5 5.5a1 1 0 1 1 1.4 1.4l-1.3 1.3a1 1 0 1 1-1.4-1.4z M20.5 10a1 1 0 1 1 0 2h-1.8a1 1 0 1 1 0-2z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 11.5a1 1 0 0 1 2 0v3a1 1 0 0 1-2 0z M8 8.5a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0z M11 6.5a1 1 0 0 1 2 0v8a1 1 0 0 1-2 0z M14 7.5a1 1 0 0 1 2 0v7a1 1 0 0 1-2 0z M4 14.5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v2.5a4.5 4.5 0 0 1-4.5 4.5h-5A4.5 4.5 0 0 1 4 17z M18.5 5.5a1 1 0 1 1 1.4 1.4l-1.3 1.3a1 1 0 1 1-1.4-1.4z M20.5 10a1 1 0 1 1 0 2h-1.8a1 1 0 1 1 0-2z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;  mask-size: contain;
  -webkit-mask-repeat: no-repeat;  mask-repeat: no-repeat;
  -webkit-mask-position: center;  mask-position: center;
}

/* S468 — broken track (R2 missing / decode failed). Greyed-out, no
   hover cue, and the badge stamped by markBrokenRows() reads
   "Unavailable" so the user understands why click does nothing. */
[data-track-id][data-broken="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
[data-track-id][data-broken="true"]:hover { background: transparent; }
[data-track-id] [data-broken-badge] {
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(220, 38, 38, 0.85);
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}

/* Made for you callout */
.pulse-callout {
  display: flex; align-items: center; justify-content: space-between; gap: var(--pulse-space-md);
  padding: var(--pulse-space-md) var(--pulse-space-lg);
  background: var(--pulse-surface-elevated); border-radius: var(--pulse-radius-md);
  border-left: 3px solid var(--pulse-primary);
}
.pulse-callout h3 { margin: 0 0 4px 0; font-size: 15px; }
.pulse-callout p { margin: 0; font-size: 13px; color: var(--pulse-text-secondary); }
.pulse-callout__cta { background: var(--pulse-primary); color: #fff; border: 0; padding: 8px 16px; border-radius: var(--pulse-radius-sm); cursor: pointer; font-weight: 500; flex-shrink: 0; }
.pulse-callout__cta:hover { background: var(--pulse-primary-hover); }

/* ─── Artist cards (circular avatars) ──────────────────────────────── */
.pulse-artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--pulse-space-md);
  padding: var(--pulse-space-md);
}
.pulse-artist-card {
  background: transparent; border: 0; cursor: pointer; padding: var(--pulse-space-sm);
  display: flex; flex-direction: column; align-items: center; gap: var(--pulse-space-sm);
  border-radius: var(--pulse-radius-md);
  transition: background var(--pulse-duration-fast) var(--pulse-easing);
  --avatar-size: 96px;
}
.pulse-artist-card:hover { background: rgba(255,255,255,.04); }
.pulse-artist-card__avatar {
  width: var(--avatar-size); height: var(--avatar-size);
  border-radius: 50%; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--pulse-shadow-sm);
}
.pulse-artist-card__avatar--fallback {
  color: #fff; font-size: calc(var(--avatar-size) * .4); font-weight: 700;
}
.pulse-artist-card__name {
  font-size: 14px; font-weight: 500; color: var(--pulse-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: var(--avatar-size);
}

/* Language & category tile rows */
.pulse-tile-row { display: flex; gap: var(--pulse-space-sm); flex-wrap: wrap; }
.pulse-tile {
  background: var(--pulse-surface-elevated); border: 0; color: #fff; cursor: pointer;
  padding: 16px 20px; border-radius: var(--pulse-radius-md); font-weight: 600; font-size: 14px;
  min-width: 120px;
  transition: transform var(--pulse-duration-fast) var(--pulse-easing);
}
.pulse-tile:hover { transform: scale(1.02); }
.pulse-tile--lang { background: linear-gradient(135deg, var(--pulse-accent), #2dd4bf); }
.pulse-tile--category { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }

/* ─── Trending tile (Fix 1 — S430) ──────────────────────────────────── */
.pulse-trending-tile {
  background: var(--pulse-surface-elevated); border: 0; cursor: pointer;
  border-radius: var(--pulse-radius-md); padding: 12px;
  width: 160px; flex-shrink: 0;
  text-align: left; color: var(--pulse-text);
  transition: transform var(--pulse-duration-fast), box-shadow var(--pulse-duration-fast);
}
.pulse-trending-tile:hover { transform: translateY(-3px); box-shadow: var(--pulse-shadow-md); }
.pulse-trending-tile .pulse-cover { width: 100%; height: 136px; border-radius: var(--pulse-radius-sm); margin-bottom: 8px; }
.pulse-trending-tile__title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-trending-tile__artist { font-size: 12px; color: var(--pulse-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-trending-tile__claps { font-size: 11px; color: var(--pulse-text-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ─── Drive mode: exit always tappable above FX + safe areas ──────── */
[data-drive-root] {
  position: relative;
  isolation: isolate;
}
[data-drive-root] pulse-fx-particles,
[data-drive-root] pulse-fx-particles platform-fx-particles {
  pointer-events: none !important;
  z-index: 0;
}
.pulse-drive-mode__exit {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
  /* Above queue overlay (200) and any FX canvas */
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 24px;
  background: var(--pulse-accent, #ff6b6b);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.pulse-drive-mode__exit:hover {
  filter: brightness(1.06);
}

/* ─── Fix 3: drive-mode queue panel reskin (S430) ───────────────────── */
.pulse-queue-panel--drive { font-size: 18px; }
.pulse-queue-panel--drive .pulse-track-row { padding: 16px 20px; min-height: 64px; }
.pulse-queue-panel--drive .pulse-track-row__title { font-size: 18px; font-weight: 600; }
.pulse-queue-panel--drive .pulse-track-row__artist { font-size: 14px; }
.pulse-queue-panel--drive .pulse-track-row__cover { width: 56px; height: 56px; }

/* ─── Drive Mode FAB ────────────────────────────────────────────────── */
.pulse-drive-fab {
  position: fixed;
  bottom: 88px;          /* clear the 64px mini-player + spacing */
  right: 24px;
  width: 56px; height: 56px;
  background: var(--pulse-accent);
  color: #fff;
  border: 0; border-radius: 50%;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--pulse-shadow-md);
  /* Mini-player (pulse-now-playing) is z-index 50 — FAB must stack above it or
     taps hit the bar and the car icon looks “missing”. Keep below panel (80). */
  z-index: 58;
  transition: transform var(--pulse-duration-fast) var(--pulse-easing), background var(--pulse-duration-fast) var(--pulse-easing);
}
.pulse-drive-fab:hover { background: var(--pulse-accent-hover); transform: scale(1.05); }
.pulse-drive-fab:active { transform: scale(.95); }

@media (max-width: 480px) {
  /* Left side: avoids overlap with play / next / favorite on the right. */
  .pulse-drive-fab {
    left: 16px;
    right: auto;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
  }
  .pulse-drive-fab svg { width: 24px; height: 24px; }
}

/* ─── Drive Mode auto-trigger banner ───────────────────────────────── */
.pulse-drive-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: linear-gradient(135deg, var(--pulse-accent), #2dd4bf);
  color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--pulse-space-md);
  box-shadow: var(--pulse-shadow-md);
  animation: pulse-drive-banner-slide-down var(--pulse-duration-normal) var(--pulse-easing);
}
@keyframes pulse-drive-banner-slide-down { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.pulse-drive-banner__text { font-weight: 500; }
.pulse-drive-banner__actions { display: flex; gap: 8px; }
.pulse-drive-banner__yes { background: #fff; color: var(--pulse-accent); border: 0; padding: 6px 14px; border-radius: var(--pulse-radius-sm); cursor: pointer; font-weight: 600; }
.pulse-drive-banner__no { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); padding: 6px 14px; border-radius: var(--pulse-radius-sm); cursor: pointer; }

@media (max-width: 480px) {
  .pulse-drive-banner { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ─── Toast notifications ──────────────────────────────────────────── */
.pulse-toast-host {
  position: fixed;
  bottom: 96px;       /* clear mini-player (64px) + gap */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.pulse-toast {
  background: var(--pulse-surface-elevated);
  color: var(--pulse-text);
  padding: 10px 16px;
  border-radius: var(--pulse-radius-pill);
  font-size: 13px;
  box-shadow: var(--pulse-shadow-md);
  pointer-events: auto;
  cursor: pointer;
  animation: pulse-toast-in var(--pulse-duration-normal) var(--pulse-easing);
  border: 1px solid var(--pulse-border);
}
.pulse-toast--success { border-color: rgba(78, 205, 196, .4); }
.pulse-toast--error { background: #4a1a1a; border-color: rgba(248, 113, 113, .4); color: #fca5a5; }
@keyframes pulse-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Clap button (S470.3 + S470.5) ────────────────────────────────────
   Admin toggle `clapsEnabled` is applied as body[data-fx-claps]. When
   disabled, every clap button in the tree is hidden via CSS — no JS
   subscription needed in component code. */
body[data-fx-claps="false"] platform-clap-button { display: none !important; }

/* Replace the 👏 emoji with a sleek SVG glyph (sparkle "cheer" icon).
   The element's iconSpan is empty (icon="" attribute), so the mask paints
   the glyph in currentColor. Path lives in `services/clap-icon.ts` for
   reuse with badges/track rows; keep both in sync if you change the path. */
platform-clap-button .platform-clap-button__icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 11.5a1 1 0 0 1 2 0v3a1 1 0 0 1-2 0z M8 8.5a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0z M11 6.5a1 1 0 0 1 2 0v8a1 1 0 0 1-2 0z M14 7.5a1 1 0 0 1 2 0v7a1 1 0 0 1-2 0z M4 14.5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v2.5a4.5 4.5 0 0 1-4.5 4.5h-5A4.5 4.5 0 0 1 4 17z M18.5 5.5a1 1 0 1 1 1.4 1.4l-1.3 1.3a1 1 0 1 1-1.4-1.4z M20.5 10a1 1 0 1 1 0 2h-1.8a1 1 0 1 1 0-2z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 11.5a1 1 0 0 1 2 0v3a1 1 0 0 1-2 0z M8 8.5a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0z M11 6.5a1 1 0 0 1 2 0v8a1 1 0 0 1-2 0z M14 7.5a1 1 0 0 1 2 0v7a1 1 0 0 1-2 0z M4 14.5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v2.5a4.5 4.5 0 0 1-4.5 4.5h-5A4.5 4.5 0 0 1 4 17z M18.5 5.5a1 1 0 1 1 1.4 1.4l-1.3 1.3a1 1 0 1 1-1.4-1.4z M20.5 10a1 1 0 1 1 0 2h-1.8a1 1 0 1 1 0-2z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  font-size: 0;
}
/* The count number — always shown (we removed hide-when-empty in S470.5 so
   the user has a concrete number that bumps on every tap). Hidden when the
   element renders zero AND the listener wants a quieter visual, but the
   default is to always paint at least "0". */
platform-clap-button .platform-clap-button__count {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
/* Bump animation on count change — gives the user a clear "yes, your clap
   landed" pulse beyond the existing emoji-burst. */
@keyframes pulse-clap-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Mini-player clap button — sized to match the other mini controls
   (prev/play/next/like/more are ~36-40px square). S470.9 — widened the
   tappable footprint so the whole pill (icon + count area + padding) is
   a single click target, not just the icon glyph. */
.pulse-mini__ctl--clap {
  padding: 8px 12px;
  min-width: 44px;
  min-height: 36px;
  gap: 6px;
  border-radius: 999px;
  cursor: pointer;
}
.pulse-mini__ctl--clap:hover { background: rgba(255,255,255,.06); }
.pulse-mini__ctl--clap .platform-clap-button__icon { width: 18px; height: 18px; }
.pulse-mini__ctl--clap .platform-clap-button__count { font-size: 12px; font-weight: 600; }

/* ─── Like / heart burst animation ─────────────────────────────────── */
@keyframes pulse-heart-burst {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.4); }
  60%  { transform: scale(.9); }
  100% { transform: scale(1); }
}
.pulse-heart-burst {
  animation: pulse-heart-burst 360ms var(--pulse-easing);
}

/* ─── Skeleton loaders ──────────────────────────────────────────────── */
.pulse-skeleton {
  background: linear-gradient(90deg, var(--pulse-surface-elevated) 0%, #2a2a2a 50%, var(--pulse-surface-elevated) 100%);
  background-size: 200% 100%;
  animation: pulse-skeleton-shimmer 1.5s ease-in-out infinite;
}
@keyframes pulse-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── S430 Design Polish ────────────────────────────────────────────── */

/* Glassmorphism utility */
.pulse-glass {
  background: rgba(20, 20, 20, .5);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .08);
}

/* Apply glass to mini-player */
.pulse-mini {
  background: rgba(20, 20, 20, .5) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .08);
}

/* Apply glass to toasts */
.pulse-toast {
  background: rgba(20, 20, 20, .5) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Apply glass to drive FAB */
.pulse-drive-fab {
  background: rgba(20, 20, 20, .5) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .08) !important;
}
.pulse-drive-fab:hover {
  background: rgba(30, 30, 30, .6) !important;
}

/* Track row — hover lift + cover shadow */
.pulse-track-row {
  transition: background var(--pulse-duration-fast), transform var(--pulse-duration-fast);
}
.pulse-track-row:hover {
  background: rgba(255, 255, 255, .04) !important;
  transform: translateX(4px);
}
.pulse-track-row__cover {
  box-shadow: var(--pulse-shadow-sm);
  transition: box-shadow var(--pulse-duration-normal);
}
.pulse-track-row:hover .pulse-track-row__cover {
  box-shadow: var(--pulse-shadow-md);
}

/* Mount animation on library home rails */
.pulse-library-home > section {
  animation: pulse-rail-fade-in 480ms var(--pulse-easing) backwards;
}
.pulse-library-home > section:nth-child(1) { animation-delay: 0ms; }
.pulse-library-home > section:nth-child(2) { animation-delay: 80ms; }
.pulse-library-home > section:nth-child(3) { animation-delay: 160ms; }
.pulse-library-home > section:nth-child(4) { animation-delay: 240ms; }
.pulse-library-home > section:nth-child(5) { animation-delay: 320ms; }
.pulse-library-home > section:nth-child(6) { animation-delay: 400ms; }

@keyframes pulse-rail-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero — depth + subtle motion */
.pulse-hero {
  position: relative;
  overflow: hidden;
}
.pulse-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,107,107,.2), transparent 60%),
              radial-gradient(circle at 70% 80%, rgba(78,205,196,.15), transparent 60%);
  pointer-events: none;
  animation: pulse-hero-drift 12s ease-in-out infinite alternate;
}
@keyframes pulse-hero-drift {
  from { transform: scale(1) rotate(0deg); }
  to   { transform: scale(1.1) rotate(2deg); }
}
.pulse-hero__cover {
  transition: transform var(--pulse-duration-normal);
}
.pulse-hero:hover .pulse-hero__cover {
  transform: scale(1.03);
}

/* Tile hover lift */
.pulse-tile {
  transition: transform var(--pulse-duration-fast), box-shadow var(--pulse-duration-fast);
}
.pulse-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--pulse-shadow-md);
}

/* Typography hierarchy bump */
.pulse-rail__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.5px;
  margin: 0 0 var(--pulse-space-md) 0;
}
.pulse-hero__title { font-size: 36px; letter-spacing: -1px; }
.pulse-expanded__title { font-size: 28px; letter-spacing: -.8px; }

/* ─── Fix 2: blocked-play pulsing attention animation (S430) ────────── */
.pulse-mini__play[data-blocked="true"],
.pulse-expanded__play-button[data-blocked="true"] {
  animation: pulse-button-attention 1.6s var(--pulse-easing) infinite;
}
@keyframes pulse-button-attention {
  0%, 100% { box-shadow: 0 0 0 0 var(--pulse-primary, #FF6B6B); transform: scale(1); }
  50% { box-shadow: 0 0 0 12px rgba(255, 107, 107, 0); transform: scale(1.06); }
}

/* ─── Fix 1: hero theme radial gradient stop ────────────────────────── */
.pulse-hero::before {
  background: radial-gradient(circle at 30% 20%, rgba(255,107,107,.2), transparent 60%),
              radial-gradient(circle at 70% 80%, rgba(78,205,196,.15), transparent 60%),
              radial-gradient(circle at 50% 50%, var(--pulse-theme-color-soft, transparent), transparent 80%);
}

/* ─── Fix 3: active track row CSS-driven highlight ─────────────────── */
.pulse-track-row[data-now-playing="true"] {
  background: var(--pulse-theme-color-soft, rgba(255,255,255,.06));
}
.pulse-track-row[data-now-playing="true"] .pulse-track-row__title {
  color: var(--pulse-theme-color, var(--pulse-text));
  font-weight: 600;
}

/* ─── Fix 5: View Transitions API animations ────────────────────────── */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 240ms;
  animation-timing-function: var(--pulse-easing);
}
::view-transition-old(root) { animation-name: pulse-page-out; }
::view-transition-new(root) { animation-name: pulse-page-in; }
@keyframes pulse-page-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes pulse-page-in { from { opacity: 0; transform: translateY(8px); } }

/* CSS fallback transitions */
.pulse-transition-out {
  opacity: 0;
  transition: opacity 120ms var(--pulse-easing);
}
.pulse-transition-in {
  animation: pulse-page-in 240ms var(--pulse-easing);
}

/* ─── Tracks browser (S470.1) ─────────────────────────────────────────── */

.pulse-tracks-browser { display: flex; flex-direction: column; gap: 16px; }

.pulse-filter-bar {
  display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 0; z-index: 5;
  background: rgba(10,10,10,.85);
  backdrop-filter: blur(8px);
  padding: 12px 0; margin: -8px 0 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.pulse-filter-bar__top {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.pulse-filter-bar__search {
  flex: 1 1 240px; min-width: 0;
  padding: 8px 12px; border-radius: var(--pulse-radius-sm, 6px);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  color: var(--pulse-text, #eee); font-size: 14px;
}
.pulse-filter-bar__search:focus { outline: 2px solid var(--pulse-accent, #e85a71); outline-offset: 1px; }
.pulse-filter-bar__sort-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 4px 0;
}
.pulse-filter-bar__group-label {
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pulse-text-muted, #888);
  margin-right: 4px;
}
.pulse-chip--sort {
  font-weight: 500;
}
.pulse-filter-bar__view { display: inline-flex; border-radius: var(--pulse-radius-sm, 6px); overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.pulse-filter-bar__view-btn {
  background: rgba(255,255,255,.04); border: 0; color: var(--pulse-text-secondary, #aaa);
  padding: 8px 12px; cursor: pointer; font-size: 14px;
}
.pulse-filter-bar__view-btn.is-active { background: var(--pulse-accent, #e85a71); color: #fff; }
.pulse-filter-bar__toggle {
  display: none;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  color: var(--pulse-text, #eee); border-radius: var(--pulse-radius-sm, 6px);
  padding: 8px 12px; font-size: 14px; cursor: pointer;
}
.pulse-filter-bar__count {
  display: inline-block; min-width: 18px; padding: 0 6px;
  background: var(--pulse-accent, #e85a71); color: #fff;
  border-radius: 9px; font-size: 12px; margin-left: 4px;
}
.pulse-filter-bar__chips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.pulse-chip {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  color: var(--pulse-text-secondary, #aaa); padding: 6px 12px;
  border-radius: 999px; font-size: 13px; cursor: pointer;
}
.pulse-chip:hover { background: rgba(255,255,255,.10); }
.pulse-chip.is-active { background: var(--pulse-accent, #e85a71); color: #fff; border-color: transparent; }
.pulse-chip-group { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* Horizontal-scroll variant for chip groups with many members (artists,
   categories on large catalogues). Falls back to wrap on narrow screens. */
.pulse-chip-group--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

/* S477.2 R10 — Artist picker (SDK <platform-entity-lookup> in headless
   mode). Bridges the SDK element's --ux-* tokens to Pulse's --pulse-*
   palette so the typeahead matches the dark filter-bar aesthetic without
   forking the SDK styles. */
.pulse-filter-bar__artist-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  max-width: 360px;
}
.pulse-filter-bar__artist-picker platform-entity-lookup {
  flex: 1;
  display: block;
  /* Override SDK CSS variables (declared with fallbacks) so the input
     reads as Pulse, not "generic SDK dark theme." */
  --ux-surface-container: rgba(255,255,255,.06);
  --ux-surface-container-hover: rgba(255,255,255,.10);
  --ux-text-primary: var(--pulse-text, #eee);
  --ux-text-secondary: var(--pulse-text-secondary, #aaa);
  --ux-text-disabled: rgba(255,255,255,.35);
  --ux-border: rgba(255,255,255,.08);
  --ux-border-hover: rgba(255,255,255,.18);
  --ux-border-focus: var(--pulse-accent, #e85a71);
  --ux-radius-md: 999px;
  --ux-accent: var(--pulse-accent, #e85a71);
  --ux-accent-fg: #fff;
}
/* The SDK renders its label above the input; the filter bar already
   has a "Artist" group label to the left, so suppress the duplicate. */
.pulse-filter-bar__artist-picker platform-entity-lookup .platform-entity-lookup__label {
  display: none;
}
/* Slimmer height to match the chips' visual weight. */
.pulse-filter-bar__artist-picker platform-entity-lookup .platform-entity-lookup__input {
  padding: 6px 14px;
  font-size: 13px;
}
/* Dropdown popup — keep it dark + on top of subsequent rails. */
.pulse-filter-bar__artist-picker platform-entity-lookup .platform-entity-lookup__dropdown {
  background: var(--pulse-surface-elevated, #181820);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  z-index: 70;
  margin-top: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.pulse-filter-bar__artist-picker platform-entity-lookup .platform-entity-lookup__option {
  color: var(--pulse-text, #eee);
  padding: 8px 12px;
  font-size: 13px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.pulse-filter-bar__artist-picker platform-entity-lookup .platform-entity-lookup__option:hover,
.pulse-filter-bar__artist-picker platform-entity-lookup .platform-entity-lookup__option--focused {
  background: rgba(255,255,255,.06);
}
.pulse-filter-bar__artist-picker platform-entity-lookup .platform-entity-lookup__option--create {
  font-style: italic;
  color: var(--pulse-accent, #e85a71);
}
.pulse-filter-bar__artist-picker platform-entity-lookup .platform-entity-lookup__empty {
  padding: 10px 12px;
  font-size: 12px;
  opacity: .65;
}
/* The "selected" chip shows the chosen artist + a clear button. Style
   it inline to match the other chips. */
.pulse-filter-bar__artist-picker platform-entity-lookup .platform-entity-lookup__selected {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px 6px 14px;
  background: var(--pulse-accent, #e85a71);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
}
.pulse-filter-bar__artist-picker platform-entity-lookup .platform-entity-lookup__selected-clear {
  background: rgba(255,255,255,.18);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pulse-chip-group--scroll::-webkit-scrollbar { height: 6px; }
.pulse-chip-group--scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; }
.pulse-chip-group--scroll > .pulse-chip { flex-shrink: 0; }
.pulse-chip--clear { background: transparent; border-color: transparent; color: var(--pulse-text-muted, #888); }
.pulse-chip--clear:hover { color: var(--pulse-text, #eee); }

@media (max-width: 700px) {
  .pulse-filter-bar__toggle { display: inline-flex; align-items: center; }
  .pulse-filter-bar[data-mobile-expanded="false"] .pulse-filter-bar__chips { display: none; }
}

.pulse-tracks-list--cols { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 1100px) { .pulse-tracks-list--cols { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1600px) { .pulse-tracks-list--cols { grid-template-columns: 1fr 1fr 1fr; } }

.pulse-tracks-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
pulse-track-card {
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  background: transparent; border: 0; padding: 4px;
  border-radius: var(--pulse-radius-md, 8px);
  transition: background .15s ease;
}
pulse-track-card:hover { background: rgba(255,255,255,.04); }
pulse-track-card:focus-visible { outline: 2px solid var(--pulse-accent, #e85a71); outline-offset: 2px; }
.pulse-track-card__art { position: relative; aspect-ratio: 1; border-radius: var(--pulse-radius-sm, 6px); overflow: hidden; }
.pulse-track-card__cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.pulse-track-card__claps {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,.55); color: #fff; padding: 2px 6px;
  border-radius: 999px; font-size: 11px;
}
.pulse-track-card__title {
  font-size: 14px; font-weight: 500; color: var(--pulse-text, #eee);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3;
}
.pulse-track-card__artist {
  font-size: 12px; color: var(--pulse-text-secondary, #aaa);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pulse-track-card__artist a { color: inherit; text-decoration: none; }
.pulse-track-card__artist a:hover { color: var(--pulse-text, #eee); }
