/* editor.css — Track Editor modal (per-channel DAW-style editor) */

/* ── Track Editor Modal ──────────────────────────────── */
.editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}
.editor-modal {
  background: var(--bg-1);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  width: 960px;
  max-width: 96vw;
  max-height: 77vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-2);
}
.editor-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.editor-track-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}
.editor-track-type {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.editor-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.editor-btn-compare {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}
.editor-btn-compare:hover {
  border-color: var(--amber);
  color: var(--amber);
}
.editor-btn-compare.active {
  background: var(--amber);
  color: #000;
  border-color: var(--amber);
}
.editor-btn-reset {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-3);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.editor-btn-reset:hover {
  border-color: var(--text-2);
  color: var(--text-1);
}
.editor-btn-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 3px;
  line-height: 1;
}
.editor-btn-close:hover {
  color: var(--text-1);
  background: var(--bg-3);
}
.editor-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  flex-shrink: 0;
}
.editor-auto-gain {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
}

/* ── DAW Strip (left: fader+meter+pan) ───────────────── */
.ded-strip {
    width: 88px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    gap: 6px;
    border-left: 1px solid var(--border);
}
.ded-strip-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 100%;
  text-align: center;
}
.ded-auto-gain-lbl {
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ded-auto-gain-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
}
.ded-rms-lbl {
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--text-3);
}
.ded-pan-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.ded-pan-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-2);
}
.ded-pan-slider {
  width: 100%;
  height: 3px;
  -webkit-appearance: none;
  background: var(--bg-4);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.ded-pan-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-2);
  cursor: pointer;
}
/* ── Fader: simple centered wrap (no meters inside) ── */
.ded-fader-meter {
  display: flex;
  gap: 3px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  width: 100%;
  justify-content: center;
  margin-top: 16px;
}
.ded-fader-spacer {
  width: 28px;
  flex-shrink: 0;
  position: relative;
}
.ded-meter-wrap {
  display: flex;
  gap: 2px;
  height: 100%;
  flex-shrink: 0;
  margin-right: 12px;
}
.ded-meter-col {
  width: 6px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
  height: 100%;
  position: relative;
}
.ded-meter-fill {
  width: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: height 0.05s ease-out;
  height: 0%;
  position: absolute;
  bottom: 0;
}
.ded-fader-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
}

.ded-fader-scale {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.ded-fader-scale-mark {
    position: absolute;
    right: 4px;
    left: auto;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-3);
    white-space: nowrap;
    line-height: 1;
}
.ded-fader-scale-mark.unity {
  font-weight: 600;
}
.ded-fader-scale-mark::before {
  content: '';
  position: absolute;
  left: auto;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1px;
  background: var(--border-bright);
}
.ded-fader-scale-mark.unity::before {
  width: 4px;
}
.ded-fader-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.ded-fader {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 28px;
  height: 100%;
  background: transparent;
  outline: none;
  cursor: pointer;
  padding: 0;
}
.ded-fader::-webkit-slider-runnable-track {
  width: 4px;
  background: var(--bg-4);
  border-radius: 2px;
}
.ded-fader::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 14px;
  background: var(--bg-4);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  cursor: pointer;
  margin-left: -12px;
  transition: border-color 0.15s;
}
.ded-fader:hover::-webkit-slider-thumb {
  border-color: var(--accent);
}
.ded-fader-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-1);
  text-align: center;
}
.ded-strip-buttons {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  width: 100%;
  justify-content: center;
}
.ded-strip-buttons .btn-mute,
.ded-strip-buttons .btn-solo {
  flex: 1;
  max-width: 30px;
}

/* ── LEFT side: full-height dynamics column (Gate / Comp / Lim) ── */
.ded-side {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg-2);
  overflow-y: auto;
}

/* ── MIDDLE layout: full-width canvas row on top, 2 columns below ── */
.ded-cols {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.ded-cols-canvas-row {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.ded-cols-bottom {
  flex: 1;
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.ded-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.ded-col:last-child {
    border-right: none;
    background-color: var(--bg-2);
}
.ded-col-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ded-col-section:last-child {
  border-bottom: none;
  flex: 1;
}
.ded-col-title {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}
.ded-na {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  font-style: italic;
}

/* ── EQ canvas (full-width, top row) ─────────────────── */
.ded-eq-canvas {
  width: 100%;
  height: 200px;
  display: block;
  touch-action: none;
  user-select: none;
}

/* ── EQ bands: horizontal row of vertical mini-cards ── */
.ded-eq-bands {
    display: flex;
    flex-direction: row;
    gap: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    height: -webkit-fill-available;
}
.ded-col-section.eq-bands {
    padding: 3px;
}
.ded-eq-row {
  flex: 1;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px 6px;
  background: var(--bg-3);
  border-radius: 4px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--band-color, var(--accent));
}
.ded-eq-type {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--band-color, var(--accent));
  letter-spacing: 0.06em;
  text-align: center;
  font-weight: 600;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.ded-param-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
}
.ded-param-lbl {
  font-size: 8px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* ── EQ drag-bar control (replaces input fields in band cards) ─────── */
.ded-eq-drag {
  position: relative;
  height: 22px;
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  user-select: none;
  overflow: hidden;
  touch-action: none;
  transition: border-color 0.1s;
}
.ded-eq-drag:hover {
  border-color: var(--border-bright);
}
.ded-eq-drag.dragging {
  border-color: var(--accent);
}
.ded-eq-drag-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(to right, var(--accent-dim), var(--accent));
  opacity: 0.55;
  pointer-events: none;
  transition: width 0.02s linear;
}
.ded-eq-drag-val {
  position: relative;
  display: block;
  text-align: center;
  line-height: 22px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-1);
  pointer-events: none;
  z-index: 1;
}
.ded-eq-drag-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-1);
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-1);
  text-align: center;
  outline: none;
  padding: 0 4px;
  z-index: 2;
  cursor: text;
}

/* ── Knob rows: stacked layout (label/value top, slider full-width below) ── */
.ded-knob-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  margin-bottom: 8px;
  align-items: center;
}
.ded-knob-row:last-child {
  margin-bottom: 0;
}
.ded-knob-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  grid-column: 1;
  grid-row: 1;
}
.ded-knob-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-1);
  text-align: right;
  grid-column: 2;
  grid-row: 1;
  white-space: nowrap;
}
.ded-knob-slider {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  height: 3px;
  -webkit-appearance: none;
  background: var(--bg-4);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.ded-knob-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-1);
}
.bypass-btn {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  border: none;
  background: var(--border-bright);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s;
}
.bypass-btn.active {
  background: var(--accent);
}
.bypass-btn:hover {
  opacity: 0.8;
}