/* The same compact waveform player is used for imported, generated and shared audio. */
.cv-node:is(.cv-node-audio,.cv-node-audio-generation) { min-height: 112px; }
.cv-audio-player {
  --cv-audio-wave-muted: #696969;
  --cv-audio-wave-played: #ededed;
  display: grid;
  grid-template-rows: minmax(48px, 1fr) 24px;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 94px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  padding: 7px 7px 3px;
  border-radius: 7px;
  color: var(--text, #ededed);
  background: var(--surface, #191919);
  user-select: none;
}
html[data-theme="light"] .cv-audio-player { --cv-audio-wave-muted: #b2b2bb; --cv-audio-wave-played: #484854; }
/* Audio keeps the reference's neutral grays in both dark appearances. */
html[data-theme="cyan"] :is(.cv-node-audio,.cv-node-audio-generation,.xs-node-audio,.cv-audio-player) {
  --cv-panel: #191919;
  --surface: #191919;
  --surface-raised: #242424;
  --text: #f5f5f5;
  --soft: #b8b8b8;
  --muted: #8c8c8c;
  --line: #373737;
  --cv-audio-wave-muted: #696969;
  --cv-audio-wave-played: #ededed;
}
/* Read-only audio captions have the same transparent face as other media. */
.cv-workspace .cv-node:is(.cv-node-audio,.cv-node-audio-generation) > .cv-node-header .cv-node-title[readonly] {
  appearance: none;
  border-color: transparent;
  background: transparent;
  color: var(--soft);
  box-shadow: none;
}
.cv-workspace .cv-node:is(.cv-node-audio,.cv-node-audio-generation) > .cv-node-header .cv-node-title[readonly]:focus-visible {
  outline: 0;
  text-decoration: underline;
  text-decoration-color: var(--cv-accent);
  text-underline-offset: 4px;
}
.cv-audio-wave { position: relative; min-width: 0; min-height: 48px; overflow: hidden; border-radius: 5px; background: var(--surface-raised, #242424); cursor: pointer; touch-action: none; }
.cv-audio-waveform { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cv-audio-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.cv-node-preview .cv-audio-player { touch-action: none; }
.cv-stage:not(.is-hand) .cv-node-preview .cv-audio-player { cursor: grab; }
.cv-audio-toggle { display: grid; place-items: center; flex: none; width: 23px; height: 23px; padding: 3px; color: var(--text, #ededed); border: 0; border-radius: 5px; background: transparent; cursor: pointer; touch-action: manipulation; }
.cv-audio-toggle:hover { background: color-mix(in srgb, var(--soft, #999999) 14%, transparent); }
.cv-audio-player .cv-audio-toggle svg { display: block; width: 14px; height: 14px; fill: currentColor; stroke: none; }
.cv-audio-time { min-width: 0; font: 10px/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--soft, #bbbbbb); white-space: nowrap; }
.cv-audio-player :is(.cv-audio-wave,.cv-audio-toggle):focus-visible { outline: 2px solid var(--cv-accent, var(--violet, #a394ff)); outline-offset: -2px; }
.cv-audio-error { position: absolute; inset: 7px 7px 28px; display: grid; place-items: center; padding: 5px; background: var(--surface-raised, #242424); color: var(--danger, #e78b9b); font-size: 11px; text-align: center; pointer-events: none; }
.cv-audio-error[hidden] { display: none !important; }
.cv-audio-player audio.cv-audio-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; max-height: 1px !important; margin: 0 !important; padding: 0 !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden !important; }
.cv-node-preview > .cv-audio-player, .cv-generation-result > .cv-audio-player { height: 100%; min-height: 94px; }
.cv-viewer-body > .cv-audio-player { min-height: 150px; }
