/* ==========================================================================
   Audio player — compact waveform style
   ========================================================================== */

:root {
  --ap-wave-idle: color-mix(in srgb, currentColor 20%, transparent);
  --ap-wave-active: currentColor;
}

html.dark {
  --ap-wave-idle: color-mix(in srgb, currentColor 24%, transparent);
  --ap-wave-active: currentColor;
}

.ap-card {
  position: relative;
  color: inherit;
  overflow: visible;
  border: 0;
  border-radius: 9999px;
}

.ap-row {
  display: flex !important;
  align-items: center;
  gap: .7rem;
  width: 100%;
  min-width: 0;
}

.ap-right {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .35rem;
  min-height: 40px;
}

.ap-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-width: 0;
}

/* buttons */
.ap-btn {
  border: 1px solid currentColor;
  color: inherit;
  background: transparent;
  opacity: .95;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
  transition:
    opacity .18s ease,
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    box-shadow .18s ease;
}

.ap-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}

html.dark .ap-btn:hover {
  background: rgba(0, 0, 0, .28);
}

.ap-play {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  flex: 0 0 auto;
}

.ap-time {
  font-size: 12px;
  line-height: 1;
  opacity: .78;
  user-select: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 0;
}

.ap-speedbtn {
  height: 24px;
  min-width: 40px;
  padding: 0 .5rem;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  flex: 0 0 auto;
}

/* waveform */
.ap-progress-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 18px;
}

@media (min-width: 900px) {
  .ap-progress-wrap {
    height: 28px;
  }

  .ap-range {
    height: 28px;
  }

  .ap-range::-webkit-slider-runnable-track {
    height: 28px;
  }

  .ap-range::-webkit-slider-thumb {
    height: 28px;
  }

  .ap-range::-moz-range-track,
  .ap-range::-moz-range-progress,
  .ap-range::-moz-range-thumb {
    height: 28px;
  }
}

.ap-wave {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 1px;
  width: 100%;
  min-width: 0;
  pointer-events: none;
  overflow: hidden;
}

.ap-wave-seg {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  min-height: 4px;
  border-radius: 9999px;
  background: var(--ap-wave-idle);
  transition: background-color .14s linear, opacity .14s linear;
  opacity: .95;
}

.ap-wave-seg.is-active {
  background: var(--ap-wave-active);
  opacity: 1;
}

/* invisible seek layer */
.ap-range {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.ap-range::-webkit-slider-runnable-track {
  height: 18px;
  background: transparent;
}

.ap-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.ap-range::-moz-range-track {
  height: 18px;
  background: transparent;
  border: 0;
}

.ap-range::-moz-range-progress {
  height: 18px;
  background: transparent;
  border: 0;
}

.ap-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* compact */
@media (max-width: 380px) {
  .ap-wave { gap: 1px; }
  .ap-wave-seg { min-width: 0; }
}