.music-controls {
  position: static;
  display: flex;
  align-items: center;
  padding: 0;
}

.music-toggle {
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius, 2px);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  color: var(--text);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  will-change: transform;
  width: 104px;
  transition:
    width 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.3s ease;
}

.music-toggle::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at 30% 50%, var(--accent-soft), transparent 65%);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.music-toggle:hover::after,
.music-toggle.active::after {
  opacity: 1;
}

.music-toggle:hover {
  border-color: var(--accent);
}

.music-toggle.expanded {
  width: 240px;
}

.music-toggle.active {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.music-main {
  flex: 0 0 auto;
  min-width: 104px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 12px;
  border-right: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}

.music-toggle__label {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
}

.music-toggle.active .music-toggle__label,
.music-toggle:hover .music-toggle__label {
  color: var(--text);
}

.music-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.music-eq i {
  display: block;
  width: 2px;
  height: 3px;
  border-radius: 1px;
  background: var(--line);
  transform-origin: bottom center;
  will-change: transform;
  transition: background 0.25s ease, height 0.25s ease;
}

.music-toggle:hover .music-eq i {
  background: var(--muted);
}

.music-toggle.active .music-eq i {
  background: var(--accent);
  animation: eqPulse 760ms ease-in-out infinite;
}

.music-toggle.active .music-eq i:nth-child(1) { height: 5px; }
.music-toggle.active .music-eq i:nth-child(2) { animation-delay: 80ms; height: 9px; }
.music-toggle.active .music-eq i:nth-child(3) { animation-delay: 160ms; height: 6px; }
.music-toggle.active .music-eq i:nth-child(4) { animation-delay: 240ms; height: 11px; }

@keyframes eqPulse {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  transition: width 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease, padding 0.38s ease;
}

.music-toggle.expanded .volume-control {
  width: 132px;
  min-width: 132px;
  padding: 0 12px 0 8px;
  opacity: 1;
}

#volume-slider {
  --progress: 50%;
  flex: 1;
  width: 100%;
  height: 2px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    90deg,
    var(--accent) 0 var(--progress),
    color-mix(in srgb, var(--line) 55%, transparent) var(--progress) 100%
  );
}

#volume-slider::-webkit-slider-runnable-track {
  height: 2px;
  background: transparent;
}

#volume-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-radius: var(--radius, 2px);
  border: 1px solid var(--accent);
  background: var(--text);
  box-shadow: 0 0 8px var(--accent-glow);
}

#volume-slider::-moz-range-track {
  height: 2px;
  background: color-mix(in srgb, var(--line) 55%, transparent);
}

#volume-slider::-moz-range-progress {
  height: 2px;
  background: var(--accent);
}

#volume-slider::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 1px solid var(--accent);
  border-radius: var(--radius, 2px);
  background: var(--text);
  box-shadow: 0 0 8px var(--accent-glow);
}

.volume-label {
  min-width: 32px;
  text-align: right;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.mobile-sound-dock .music-toggle,
.mobile-sound-dock .music-toggle.expanded {
  display: flex;
  width: 100%;
}