/* -- the result: the waveform, then the player ---------------------------------- */

.result {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.wave {
  position: relative;
  height: 112px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.wave-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.wave[data-state="ready"] .wave-canvas {
  cursor: pointer;
}

/* Before the first clip: a dashed baseline where the audio will be drawn. */
.wave[data-state="empty"]::before {
  content: "";
  position: absolute;
  inset-inline: 1rem;
  top: 50%;
  border-top: 1px dashed var(--wave-rest);
}

.wave-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.wave-empty:not(:empty) {
  /* The text sits on a patch of panel so the dashed line does not strike it. */
  background: radial-gradient(closest-side, var(--panel) 70%, transparent);
}

.wave[data-state="ready"] .wave-empty {
  display: none;
}

.result audio {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.6rem;
}



.stats {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
