/* ─ Custom Select ─ */
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dropdown);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.custom-select-trigger:hover {
  border-color: var(--accent);
  background: var(--button-hover);
}
.custom-select-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.custom-select-chevron.open {
  transform: rotate(180deg);
}
.custom-select-dropdown {
  background: var(--menu-bg);
  border: 1px solid var(--border-dropdown);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px var(--shadow-dropdown);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.custom-select-option {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
}
.custom-select-option:hover {
  background: var(--menu-item-hover);
}
.custom-select-option.selected {
  color: var(--menu-item-active-text);
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.custom-select-option.disabled {
  color: var(--text-muted);
  cursor: default;
}
.custom-select-group-label {
  padding: 0.375rem 0.75rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-top: 1px solid var(--menu-divider);
  margin-top: 0.25rem;
}
.custom-select-group-label:first-child {
  border-top: none;
  margin-top: 0;
}

.eq-ctrl-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.eq-ctrl-btn:hover {
  background: var(--accent);
  color: var(--bg-app);
}

.eq-save-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main EQ panel — canvas area + faders */
.eq-panel {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: opacity 0.2s;
}

.eq-panel--off {
  opacity: 0.4;
  pointer-events: none;
}

.eq-canvas {
  display: block;
  width: 100%;
  height: 120px;
  margin-bottom: 12px;
}

.eq-faders {
  display: flex;
  align-items: stretch;
  padding: 12px 8px 12px;
  gap: 0;
  height: 155px;
  border-top: 1px solid var(--border);
}

/* dB scale on left */
.eq-db-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 6px 0 0;
  width: 28px;
  flex-shrink: 0;
}

.eq-db-tick {
  font-size: 9px;
  color: var(--text-muted);
  font-family: monospace;
  text-align: right;
  line-height: 1;
}

/* Individual band column */
.eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.eq-gain-val {
  font-size: 9px;
  color: var(--text-muted);
  font-family: monospace;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  height: 12px;
}

/* Fader track — the rotated slider is absolute, so this only needs
   enough height for the visual fader length. */
.eq-fader-track {
  position: relative;
  flex: 1;
  min-height: 110px;
  width: 100%;
}

/* Zero-dB center mark — horizontal line at 50% = 0 dB position */
.eq-zero-mark {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 1px;
  background: var(--text-muted);
  pointer-events: none;
  top: 50%;
  transform: translateY(-50%);
}

/* Custom div-based vertical fader — no native range input, full pixel control */
.eq-fader-custom {
  position: absolute;
  inset: 0;
  user-select: none;
  touch-action: none;
}

/* The thin vertical track line */
.eq-track-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: var(--border);
  border-radius: 2px;
  pointer-events: none;
}

/* The draggable handle */
.eq-thumb {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 8px;
  transform: translateX(-50%) translateY(-50%);
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  pointer-events: none;
  transition: opacity 0.15s;
}

.eq-freq-label {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Pre-gain row */
.eq-pregain-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border-subtle);
}

.eq-pregain-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 72px;
}

.eq-pregain-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}

.eq-pregain-val {
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: right;
}

/* AutoEQ section */
.eq-autoeq-section {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.eq-autoeq-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-card);
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

.eq-autoeq-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.eq-autoeq-toggle span {
  flex: 1;
}

.eq-autoeq-body {
  padding: 10px 12px 12px;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eq-autoeq-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.eq-autoeq-status {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 0;
}

.eq-autoeq-error {
  color: var(--danger);
}

.eq-autoeq-applied {
  color: var(--accent);
}

.eq-autoeq-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
}

.eq-autoeq-result-btn {
  text-align: left;
  padding: 5px 10px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.eq-autoeq-result-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.eq-autoeq-result-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.eq-autoeq-result-source {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

