/* audio-tools.css — Audio Tools additions on top of vocal-styles.css + vocal-cosmic.css.
   MS-488. Only the NEW pieces live here: the empty state, the effect / combine
   modals, the data-driven parameter controls, and a few track-row extras. Everything
   else (shell, rail, .tool card, .stem-row, .wave/.wbar, .fader, buttons) is reused
   from the Vocal Remover styles so the look matches exactly in dark + light. */

/* ── Toast / note bar ─────────────────────────────────────────────────────── */
.at-note {
  display: flex; align-items: center; gap: 12px;
  margin: 0 auto 18px; max-width: var(--maxw, 980px);
  padding: 11px 12px 11px 16px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--ink); font-size: 14px; font-weight: 500;
}
.at-note span { flex: 1; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.at-empty { text-align: center; padding: 34px 18px 30px; display: flex; flex-direction: column; align-items: center; }
.at-empty-ico {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
  margin-bottom: 16px;
}
.at-empty-ico svg { width: 30px; height: 30px; }
.at-empty h3 { margin: 0 0 8px; font-size: 21px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.at-empty p { margin: 0 0 18px; max-width: 420px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.at-empty .cta { padding: 12px 22px; }
.at-empty-hint { margin-top: 14px !important; color: var(--ink-3); font-size: 12.5px; }

/* ── Track header actions ─────────────────────────────────────────────────── */
.at-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.at-head-actions .play-btn.at-playall {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--cta); color: var(--accent-ink); border: 0; cursor: pointer; box-shadow: var(--cta-glow);
}
.at-head-actions .play-btn.at-playall svg { width: 17px; height: 17px; }
.at-head-actions .at-rewind-btn {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink);
  cursor: pointer; transition: all .15s ease;
}
.at-head-actions .at-rewind-btn:hover {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
  transform: translateY(-1px);
}
.at-clock { color: var(--ink-3); font-size: 12.5px; }

/* ── Track row extras ─────────────────────────────────────────────────────── */
.at-track-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.at-track .at-fx-badge {
  display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
}
.at-track .icon-btn.at-track-play { color: var(--accent); border-color: var(--accent-line); }
.at-track .icon-btn.at-track-play:hover { background: var(--accent-soft); }
.at-track .icon-btn.at-track-play.on-play { background: var(--cta); color: var(--accent-ink); border-color: transparent; box-shadow: var(--cta-glow); }
.at-track .icon-btn.at-fx-btn { color: var(--accent); border-color: var(--accent-line); }
.at-track .icon-btn.at-fx-btn:hover { background: var(--accent-soft); }
.at-track .icon-btn.at-wav-btn { width: auto; padding: 0 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; }
.at-track .icon-btn.at-del-btn:hover { color: #ff6b6b; border-color: #ff6b6b; }
.at-track .icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.at-wave-empty { color: var(--ink-3); font-size: 12px; opacity: .7; align-self: center; }

/* ── Modal (effect editor + combine) ──────────────────────────────────────── */
.at-modal-backdrop {
  position: fixed; inset: 0; z-index: 7000; display: grid; place-items: center; padding: 18px;
  background: color-mix(in srgb, #000 54%, transparent);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: at-fade .18s ease;
}
@keyframes at-fade { from { opacity: 0; } }
.at-modal {
  width: 100%; max-width: 640px; max-height: calc(100dvh - 36px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-xl, 18px);
  box-shadow: var(--shadow-pop); overflow: hidden;
  animation: at-pop .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes at-pop { from { transform: translateY(10px); opacity: .5; } }
.at-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.at-modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.at-modal-sub { color: var(--ink-3); font-weight: 500; font-size: 13.5px; }

/* effect chooser */
.at-fx-list { padding: 16px 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.at-fx-group-title {
  margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
}
.at-fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.at-fx-card {
  text-align: left; cursor: pointer; padding: 11px 12px; border-radius: 12px;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink);
  display: flex; flex-direction: column; gap: 3px; transition: .15s var(--ease, ease);
}
.at-fx-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.at-fx-name { font-weight: 600; font-size: 13.5px; }
.at-fx-hint { color: var(--ink-3); font-size: 11.5px; line-height: 1.35; }

/* effect editor */
.at-fx-editor { padding: 18px; overflow-y: auto; }
.at-fx-editor-hint { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.at-fx-editor-note { margin: 0 0 16px; color: var(--ink-3); font-size: 13px; }
.at-fx-editor-note.at-warn { color: #e0913a; }
.at-param-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 20px; }
.at-track-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin-bottom: 16px; }
.at-param { display: flex; flex-direction: column; gap: 7px; }
.at-param-lbl { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 500; color: var(--ink); }
.at-param-val { color: var(--ink-3); font-size: 12px; }
.at-param-range { width: 100%; }
.at-param-select { width: 100%; }
.at-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

@media (max-width: 560px) {
  .at-track-pick { grid-template-columns: 1fr; }
  .at-modal-actions { flex-direction: column-reverse; }
  .at-modal-actions button { width: 100%; justify-content: center; }
}

/* ── Track Segment Cropper ────────────────────────────────────────────────── */
.at-track.stem-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
}
.at-track-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.at-track .stem-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.at-track .stem-ctl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.at-track .wave.at-track-wavewrap,
.at-track-wavewrap {
  position: relative;
  width: 100%;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 5px;
  min-width: 0;
  height: auto !important;
  min-height: 88px;
  overflow: visible !important;
}
.at-track-canvas-scroll {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink, #8890b8) 6%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink, #8890b8) 8%, transparent);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.at-track-canvas-scroll::-webkit-scrollbar {
  height: 5px;
}
.at-track-canvas-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}
.at-track-canvas-scroll::-webkit-scrollbar-thumb {
  background: var(--accent-line, #7c5cff);
  border-radius: 3px;
}
.at-track-canvas-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--accent, #7c5cff);
}
.at-track-canvas {
  display: block;
  height: 68px;
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
}
.at-track-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--ink-2);
}
.at-zoom-icon {
  display: inline-flex;
  align-items: center;
  color: var(--ink-3);
  margin-right: 1px;
}
.at-zoom-step-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-2);
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  transition: all .12s;
}
.at-zoom-step-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--ink);
}
.at-zoom-step-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.at-zoom-slider {
  width: 72px;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0 1px;
}
.at-zoom-val {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  min-width: 24px;
  text-align: right;
}
.at-zoom-reset {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 2px;
  transition: all .12s;
}
.at-zoom-reset:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.at-track-times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 0 4px;
  gap: 8px;
  user-select: none;
}
.at-track-times b {
  color: var(--ink);
  font-weight: 600;
}
.at-track-times .at-seg-hint {
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.at-track-times .at-reset-seg {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  transition: background .12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.at-track-times .at-reset-seg:hover {
  background: var(--accent-soft);
}
.at-track .icon-btn.at-track-play-sel {
  color: var(--ink-2);
  border-color: var(--line);
}
.at-track .icon-btn.at-track-play-sel.has-segment {
  color: var(--accent);
  border-color: var(--accent-line);
}
.at-track .icon-btn.at-track-play-sel.has-segment:hover {
  background: var(--accent-soft);
}
.at-track .icon-btn.at-track-play-sel.on-play {
  background: var(--cta);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: var(--cta-glow);
}

/* Modal segment target badge */
.at-fx-seg-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
}
.at-fx-seg-target.is-segment {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--ink);
}
.at-fx-seg-target.is-full {
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.at-fx-seg-target strong {
  font-weight: 600;
  color: var(--ink);
}
.at-fx-seg-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: .02em;
  background: var(--accent);
  color: #fff;
}

/* Drag-and-drop reordering & concatenation */
.at-track {
  position: relative;
  transition: transform .14s ease, box-shadow .16s ease, border-color .16s ease, opacity .16s ease;
}
.at-track.is-dragging {
  opacity: 0.35;
  filter: grayscale(40%);
  border-style: dashed;
}
.at-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 28px;
  color: var(--ink-3);
  cursor: grab;
  user-select: none;
  touch-action: none;
  border-radius: 6px;
  transition: color .12s, background .12s;
  flex-shrink: 0;
  margin-right: 4px;
}
.at-drag-handle:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.at-drag-handle:active {
  cursor: grabbing;
}

/* Drop indicator lines (reorder above / below) */
.at-drop-line {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  z-index: 40;
  pointer-events: none;
  box-shadow: 0 0 10px var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.at-drop-line.at-drop-above {
  top: -2px;
}
.at-drop-line.at-drop-below {
  bottom: -2px;
}
.at-drop-pill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Same-level concatenation drop target */
.at-track.is-drop-concat {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent), 0 10px 28px -6px rgba(124, 92, 255, 0.4) !important;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface)) !important;
}
.at-drop-concat-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 2px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 45;
  pointer-events: none;
  animation: atConcatPulse 1.6s infinite ease-in-out;
}
@keyframes atConcatPulse {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 0.65; }
}
.at-drop-concat-pill {
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .01em;
}

/* Recording Panel & Controls in Audio Tools */
.at-record-wrap {
  margin-top: 16px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.at-rec-timer {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  color: #e5484d;
  background: rgba(229, 72, 77, 0.12);
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid rgba(229, 72, 77, 0.25);
  letter-spacing: 0.04em;
}
.at-head-rec-btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color .15s, background .15s, color .15s;
}
.at-head-rec-btn:hover:not(:disabled) {
  border-color: #e5484d;
  color: #e5484d;
}
.at-head-rec-btn.is-active {
  border-color: #e5484d;
  background: rgba(229, 72, 77, 0.1);
  color: #e5484d;
}
.at-head-rec-btn .rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e5484d;
  flex-shrink: 0;
}
.at-head-rec-btn.is-active .rec-dot {
  animation: recPulse 1s infinite;
}
.at-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* ── Video Monitor & Video Track (MS-488) ────────────────────────── */
.at-video-monitor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.at-video-monitor:hover {
  border-color: color-mix(in srgb, #00d2ff 40%, var(--line));
}
.at-vm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: color-mix(in srgb, #00d2ff 6%, var(--surface));
  border-bottom: 1px solid var(--line);
  gap: 12px;
  flex-wrap: wrap;
}
.at-vm-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.at-vm-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 210, 255, 0.15);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.at-vm-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.at-vm-dur {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.at-vm-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.at-vm-mute-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2, rgba(255, 255, 255, 0.05));
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
}
.at-vm-mute-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.at-vm-mute-btn.is-muted {
  background: rgba(229, 72, 77, 0.14);
  color: #ff6b6b;
  border-color: rgba(229, 72, 77, 0.35);
}
.at-vm-fader {
  width: 90px;
  margin: 0 4px;
}
.at-vm-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s ease;
}
.at-vm-icon-btn:hover {
  background: var(--accent-soft);
  color: var(--ink);
  border-color: var(--accent-line);
}
.at-vm-icon-btn.active {
  background: var(--accent-soft);
  color: #00d2ff;
  border-color: #00d2ff;
}
.at-vm-viewport {
  position: relative;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.at-vm-viewport video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.at-vm-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity .18s ease;
}
.at-vm-viewport:hover .at-vm-overlay {
  opacity: 1;
}
.at-vm-play-hint {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.at-video-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 210, 255, 0.16);
  color: #00d2ff;
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: .04em;
  margin-right: 4px;
}
.at-video-badge.is-audioless {
  background: rgba(239, 68, 68, 0.18);
  color: #ff6b6b;
}
.at-vm-strip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
}
.at-vm-strip-btn:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #ff6b6b;
  border-color: rgba(239, 68, 68, 0.35);
}
.at-strip-btn:hover {
  color: #ff6b6b !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}
.at-track-thumb {
  width: 38px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(0, 210, 255, 0.3);
  background: #000;
  flex-shrink: 0;
}
.stem-swatch.is-video {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.at-add-video {
  background: linear-gradient(135deg, #0099ff, #00d2ff) !important;
  color: #fff !important;
  border: none !important;
}
.at-add-video:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.4);
}

/* ── NLE Segment Quick Toolbar ─────────────────────────────────────── */
.at-seg-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  margin-top: 4px;
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
  border-top: 1px dashed var(--line);
  border-radius: 0 0 8px 8px;
}
.at-seg-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all .14s ease;
  line-height: 1.4;
}
.at-seg-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.at-seg-btn:active:not(:disabled) {
  transform: translateY(0);
}
.at-seg-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  border-color: transparent;
}
.at-seg-sep {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--line);
  margin: 0 3px;
}

/* Desktop: compact enough that the eleven tools fit ONE line in English (owner 2026-10-01). Tighter
   padding, gap and icon gap, and the buttons keep their own width. It still wraps: a longer
   language (ru, ja) would otherwise run past the card's edge and cut the last tool off. A phone keeps
   the roomier wrapping toolbar above, where a bigger target matters more than one row. */
@media (min-width: 1000px) {
  .at-seg-toolbar { flex-wrap: wrap; gap: 4px; padding: 6px 8px; }
  .at-seg-btn { flex: 0 1 auto; justify-content: center; padding: 3px 5px; gap: 4px; font-size: 10.5px; white-space: nowrap; }
  .at-seg-btn svg { flex: none; width: 12px; height: 12px; }
  .at-seg-sep { flex: none; margin: 0 1px; }
}

/* ── Pitch Shift Modal Presets ─────────────────────────────────────── */
.at-pitch-presets {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.at-pitch-presets-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.at-pitch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.at-pitch-chip {
  appearance: none;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .14s ease;
}
.at-pitch-chip:hover {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent-soft);
}
.at-pitch-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
}





/* ── the per-track effect rack — the Vocal Remover mixer's rack (owner 2026-10-01) ──────────────
   Copied from css/vocal-gpu-studio.css with the atfx- prefix (the GPU studio's files are not
   shared, separation law 2026-09-21); keep the two in step. The studio's own tokens are set on
   the wrap so the sheet reads the same on this page. */
.atfx-rack-wrap {
  --panel: var(--surface, rgba(255, 255, 255, .04));
  --stroke: var(--line, rgba(255, 255, 255, .14));
  --hover: color-mix(in srgb, var(--ink, #fff) 8%, transparent);
  --st-sheet: color-mix(in srgb, var(--bg, #0b0a1a) 94%, var(--ink, #fff) 6%);
}
.atfx-icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--stroke, rgba(255, 255, 255, .18));
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.atfx-icon-btn:focus-visible { outline: 2px solid var(--accent, #7c5cff); outline-offset: 2px; }

/* the track row's FX button: a word, and a dot when the rack is doing something */
.at-track .icon-btn.atfx-fxbtn { position: relative; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; color: inherit; border-color: var(--line); }
.at-track .icon-btn.atfx-fxbtn.on,
.at-track .icon-btn.atfx-fxbtn[aria-pressed="true"] { border-color: var(--accent, #7c5cff); color: var(--accent, #7c5cff); }
.atfx-fxdot {
  position: absolute;
  top: 3px; inset-inline-end: 3px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent, #7c5cff);
}

/* ── the rotary knob ───────────────────────────────────────────────────────────────────────── */
.atfx-knob { display: grid; justify-items: center; gap: 0; line-height: 1; }
.atfx-knob-dial {
  cursor: ns-resize;
  touch-action: none;                /* or a vertical drag scrolls the desk instead of turning it */
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.atfx-knob-dial:focus-visible { outline: 2px solid var(--accent, #7c5cff); outline-offset: 2px; }
.atfx-knob-track { fill: none; stroke: color-mix(in srgb, var(--ink, #fff) 16%, transparent); stroke-width: 3; stroke-linecap: round; }
.atfx-knob-fill { fill: none; stroke: var(--accent, #7c5cff); stroke-width: 3; stroke-linecap: round; }
.atfx-knob-ptr { stroke: var(--ink, #fff); stroke-width: 2; stroke-linecap: round; opacity: .9; }
.atfx-knob-pan .atfx-knob-fill { stroke: var(--stem-3, #46c8b6); }
.atfx-knob-val { font-size: 10.5px; font-variant-numeric: tabular-nums; opacity: .92; margin-top: 2px; }
.atfx-knob-lbl { font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; opacity: .6; }
.atfx-knob.is-set .atfx-knob-val { color: var(--accent, #7c5cff); font-weight: 600; }

/* ── the per-track effect rack ─────────────────────────────────────────────────────────────── */
.atfx-rack-wrap {
  position: fixed;
  inset: 0;
  z-index: 2147483000;               /* the cosmic rail sits at 6000 and would otherwise cover it */
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 3, 14, .55);
  backdrop-filter: blur(3px);
}
.atfx-rack {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--st-sheet);
  color: var(--ink);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  overflow: hidden;
}
.atfx-rack-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
}
.atfx-rack-head h4 { margin: 0; font-size: 15px; font-weight: 600; }
.atfx-rack-track { opacity: .65; font-weight: 400; }
.atfx-rack-head-r { display: flex; align-items: center; gap: 8px; }
.atfx-rack-reset {
  border: 1px solid var(--stroke); border-radius: 9px; background: transparent; color: inherit;
  font: inherit; font-size: 12px; min-height: 32px; padding: 0 10px; cursor: pointer;
}
.atfx-rack-reset:hover { background: var(--hover); }

.atfx-rack-presets {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--stroke);
}
.atfx-rack-preset {
  min-height: 32px; padding: 0 12px;
  border: 1px solid var(--stroke); border-radius: 999px;
  background: transparent; color: inherit; font: inherit; font-size: 12.5px; cursor: pointer;
}
.atfx-rack-preset:hover { background: var(--hover); }
.atfx-rack-preset:focus-visible { outline: 2px solid var(--accent, #7c5cff); outline-offset: 2px; }

.atfx-rack-body {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
}

.atfx-mod { flex: 0 0 auto; border: 1px solid var(--stroke); border-radius: 12px; overflow: hidden; }
.atfx-mod.is-on { border-color: color-mix(in srgb, var(--accent, #7c5cff) 55%, var(--stroke)); }
.atfx-mod-head {
  width: 100%;
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 14px;
  align-items: center; gap: 9px;
  min-height: 44px; padding: 0 12px;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.atfx-mod-head:hover { background: var(--hover); }
.atfx-mod-head:focus-visible { outline: 2px solid var(--accent, #7c5cff); outline-offset: -2px; }
.atfx-mod-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: color-mix(in srgb, var(--ink, #fff) 22%, transparent);
}
.atfx-mod.is-on .atfx-mod-dot { background: var(--accent, #7c5cff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #7c5cff) 22%, transparent); }
.atfx-mod-name { font-size: 13.5px; font-weight: 600; }
/* never colour alone — the state is a word as well as a dot */
.atfx-mod-state { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.atfx-mod.is-on .atfx-mod-state { color: var(--accent, #7c5cff); opacity: 1; }
.atfx-mod-chev {
  width: 0; height: 0; justify-self: end;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; opacity: .55;
  transition: transform .15s ease;
}
.atfx-mod.is-open .atfx-mod-chev { transform: rotate(180deg); }
.atfx-mod-body { padding: 2px 12px 12px; }
.atfx-mod-hint { margin: 0 0 10px; font-size: 12px; opacity: .7; }
.atfx-mod-note { margin: 10px 0 0; font-size: 11.5px; opacity: .62; font-style: italic; }
.atfx-mod-knobs { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; }
.atfx-mod-off {
  align-self: center;
  min-height: 32px; padding: 0 12px;
  border: 1px solid var(--stroke); border-radius: 9px;
  background: transparent; color: inherit; font: inherit; font-size: 12px; cursor: pointer;
}
.atfx-mod-off:hover { background: var(--hover); }

@media (max-width: 760px) {
  .atfx-rack { max-height: 92vh; width: 100%; }
  .atfx-mod-knobs { gap: 10px; }
}
/* A knob is a pointer-precision control; on a coarse pointer it gets a real target. */
@media (pointer: coarse) {
  .atfx-knob-dial { min-width: 44px; min-height: 44px; }
  .atfx-rack-preset { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .atfx-mod-chev { transition: none; }
}

/* IN / OUT beside the Start / End readout (owner 2026-10-01): set the selection edge at the playhead.
   Styled as the waveform's own IN / OUT flags, so the button reads as "put the flag here". */
.at-edge { display: inline-flex; align-items: center; gap: 6px; }
.at-inout-btn {
  appearance: none; cursor: pointer;
  min-height: 24px; padding: 0 7px;
  border: 1px solid var(--accent-line, var(--accent)); border-radius: 6px;
  background: var(--accent-soft, transparent); color: var(--accent);
  font: inherit; font-size: 10px; font-weight: 800; letter-spacing: .06em; line-height: 1;
}
.at-inout-btn:hover:not(:disabled) { background: var(--accent); color: #fff; }
.at-inout-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.at-inout-btn:disabled { opacity: .38; cursor: not-allowed; }
@media (pointer: coarse) { .at-inout-btn { min-height: 36px; min-width: 40px; } }
/* Phones: the readout row wraps — Start + IN and End + OUT on the first line, the segment hint and
   the zoom on lines of their own — instead of running off the card (End and OUT were clipped). */
@media (max-width: 760px) {
  .at-track-times { flex-wrap: wrap; row-gap: 8px; }
  .at-track-times > .at-edge:first-child { order: 1; }
  .at-track-times > .at-edge:last-child { order: 2; margin-inline-start: auto; }
  .at-track-times > .at-seg-hint { order: 3; flex: 1 1 100%; text-align: start; }
  .at-track-times > .at-track-zoom { order: 4; flex: 1 1 100%; }
}
