/* Track-editor waveform overrides — interactive trim + preview bar */

.te-wfbox {
  position: relative;
  user-select: none;
  cursor: ew-resize;
}

.te-wfbox__mask {
  position: absolute; top: 0; bottom: 0;
  background: rgba(0,0,0,0.42);
  pointer-events: none;
  z-index: 2;
}
.te-wfbox__mask--l { left: 0; }
.te-wfbox__mask--r { right: 0; }

.te-wf__bar.is-trimmed { opacity: 0.35; filter: saturate(0.4); }

.te-wfbox__playhead {
  position: absolute; top: 0; bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.6);
  pointer-events: none;
  z-index: 5;
  transform: translateX(-1px);
}

.te-wfbox__handle {
  position: absolute; top: -8px; bottom: -8px;
  width: 14px;
  margin-left: -7px;
  cursor: ew-resize;
  z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  transition: transform 80ms ease;
}
.te-wfbox__handle:hover { transform: scaleX(1.3); }
.te-wfbox__handle::before {
  content: ""; position: absolute; top: 8px; bottom: 8px; left: 6px;
  width: 2px; background: var(--accent, #FA3A05);
  box-shadow: 0 0 6px rgba(250, 58, 5, 0.6);
}
.te-wfbox__handle-grip {
  position: absolute; top: 0; left: 0; width: 14px; height: 14px;
  background: var(--accent, #FA3A05);
  border-radius: 3px;
  display: block;
}
.te-wfbox__handle--r .te-wfbox__handle-grip { top: auto; bottom: 0; }
.te-wfbox__handle-time {
  position: absolute;
  top: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10px;
  background: rgba(20,16,12,0.96);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 100ms ease;
}
.te-wfbox__handle--r .te-wfbox__handle-time { top: auto; bottom: -22px; }
.te-wfbox__handle:hover .te-wfbox__handle-time,
.te-wfbox:hover .te-wfbox__handle-time { opacity: 1; }

/* Preview-start bar */
.te-prevbar {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(220px, auto) 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
}
.te-prevbar__lbl {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--text, rgba(0,0,0,0.7));
}
.te-prevbar__dot {
  width: 10px; height: 10px;
  border-radius: 999px;
  background: oklch(0.7 0.15 240);
  box-shadow: 0 0 8px oklch(0.7 0.15 240 / 0.5);
}
.te-prevbar__set {
  background: transparent;
  border: 1px solid var(--line-strong, rgba(0,0,0,0.12));
  color: inherit;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 6px;
  font-family: inherit;
}
.te-prevbar__set:hover { border-color: oklch(0.7 0.15 240); color: oklch(0.7 0.15 240); }
.te-prevbar__state {
  min-width: 58px;
  font-size: 11px;
  color: var(--muted, rgba(0,0,0,0.48));
}
.te-prevbar__state--saved { color: oklch(0.58 0.14 150); }
.te-prevbar__state--error { color: oklch(0.62 0.19 28); }

.te-prevbar__track {
  position: relative; height: 24px;
  cursor: ew-resize;
  display: flex; align-items: center;
}
.te-prevbar__track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 4px; transform: translateY(-50%);
  background: var(--line-strong, rgba(0,0,0,0.08));
  border-radius: 2px;
}
.te-prevbar__fill {
  position: absolute; left: 0; top: 50%;
  height: 4px; transform: translateY(-50%);
  background: oklch(0.7 0.15 240);
  border-radius: 2px;
}
.te-prevbar__thumb {
  position: absolute; top: 50%;
  width: 16px; height: 16px;
  background: oklch(0.7 0.15 240);
  border: 2px solid var(--bg, #fff);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transform: translate(-50%, -50%);
  cursor: grab;
}
.te-prevbar__thumb:active { cursor: grabbing; }

.te-leg__sw--preview { background: oklch(0.7 0.15 240); }

/* ============================================================
   Analytics: tone down red drop-off overlay so it doesn't fight
   ============================================================ */
.ai-wave__line,
.ai-wave__dropoff,
.ai-wave path[stroke="red"],
.ai-wave [class*="dropoff"] {
  opacity: 0.35 !important;
  stroke-width: 1.2 !important;
}
.ai-wave [class*="dropoff"]:hover { opacity: 0.7 !important; }
