/* Audio Splitter — a summary uploader (after="summary") over a form: the
   Waveform card (waveform, hint, transport tray), the Auto-split on silence
   card, the Export format card and the Segments card. The layout is
   styles/components/form.css; only the waveform, its playhead and markers,
   the time readout and the segment rows' insides are the page's own. */

/* The waveform is the card's first row, edge to edge. */
.as-waveform-wrap {
  position: relative;
  background: var(--bg-elev);
  cursor: crosshair;
  user-select: none;
}

.as-waveform {
  display: block;
  width: 100%;
  height: 88px;
}

.as-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  pointer-events: none;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(0, 122, 255, 0.5);
}

.as-marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.as-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--danger);
  transform: translateX(-50%);
  border: none;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
  transition:
    background var(--duration-snap) var(--ease-standard),
    box-shadow var(--duration-snap) var(--ease-standard),
    width var(--duration-snap) var(--ease-standard);
}

/* Pill handle at the top — communicates the marker is grabbable/removable. */
.as-marker::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  border-radius: 0 0 6px 6px;
  background: var(--danger);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform var(--duration-snap) var(--ease-spring);
}

.as-marker:hover,
.as-marker:focus-visible {
  background: color-mix(in srgb, var(--danger) 82%, #000);
  width: 3px;
  box-shadow: 0 0 6px color-mix(in srgb, var(--danger) 60%, transparent);
  outline: none;
}

.as-marker:hover::before,
.as-marker:focus-visible::before {
  transform: translateX(-50%) scale(1.25);
}

.as-time {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

/* ── Segment rows: number · time range over length · Preview / Export ────── */
.as-segment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* The actions drop under the times as a unit when the row is too narrow, so
   a time range never breaks across lines (as-2). */
.as-segment {
  flex-wrap: wrap;
  transition: background var(--duration-snap) var(--ease-standard);
}
.as-segment:hover { background: var(--bg-hover); }
.as-segment:first-child { border-start-start-radius: inherit; border-start-end-radius: inherit; }
.as-segment:last-child { border-end-start-radius: inherit; border-end-end-radius: inherit; }

.as-segment-num {
  flex: none;
  width: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: end;
}

.as-segment-label { white-space: nowrap; }

.as-segment-time {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.as-segment-actions {
  display: flex;
  gap: var(--space-2);
  flex: none;
  margin-inline-start: auto;
}

.as-empty__icon { color: var(--accent); }

/* A prose value in a key/value row reads in the UI face, not mono. */
.as-kv-prose { font-family: var(--sans); font-size: 12px; }
