/* ═══════════════════════════════════════════════════════════════════════
   tuning-theme.css — Amber/Industrial Design Skin for Tuning Modules

   Applied only to pages with class="tune-page" on <body>.
   Does NOT affect existing portal pages (which use blue #58a6ff accent).

   Design tokens:
     Accent: #f5a623 (amber)
     BG:     #0d0e0f (near-black)
     Card:   #161819 (dark charcoal)
     Text:   #e8e6e3 (warm white)
     Muted:  #8a8a8a
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Fonts (self-hosted, no CDN dependency) ──────────────────────────── */
@import url('fonts/fonts.css');

/* ── Design Tokens ───────────────────────────────────────────────────── */
.tune-page {
  --tune-accent: #f5a623;
  --tune-accent-dim: #c4841a;
  --tune-accent-glow: rgba(245, 166, 35, 0.25);
  --tune-accent-subtle: rgba(245, 166, 35, 0.08);
  --tune-bg: #0d0e0f;
  --tune-bg-raised: #131415;
  --tune-card: #161819;
  --tune-card-hover: #1c1d1f;
  --tune-border: #2a2b2d;
  --tune-border-bright: #3a3b3d;
  --tune-text: #e8e6e3;
  --tune-text-secondary: #a0a0a0;
  --tune-text-muted: #8a8a8a;
  --tune-success: #2ecc71;
  --tune-warning: #f39c12;
  --tune-danger: #e74c3c;
  --tune-info: #3498db;
  --tune-font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --tune-font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tune-radius: 6px;
  --tune-radius-lg: 10px;
  --tune-shadow: 0 2px 8px rgba(0,0,0,0.4);
  --tune-shadow-lg: 0 4px 20px rgba(0,0,0,0.6);
  --tune-transition: 150ms ease;
}

/* ── Page Base ───────────────────────────────────────────────────────── */
.tune-page {
  background: var(--tune-bg);
  color: var(--tune-text);
  font-family: var(--tune-font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tune-page * {
  box-sizing: border-box;
}

.tune-page code, .tune-page pre, .tune-page .tune-mono {
  font-family: var(--tune-font-mono);
}

/* ── Card ────────────────────────────────────────────────────────────── */
.tune-card {
  background: var(--tune-card);
  border: 1px solid var(--tune-border);
  border-radius: var(--tune-radius-lg);
  padding: 20px;
  box-shadow: var(--tune-shadow);
  transition: border-color var(--tune-transition), box-shadow var(--tune-transition);
}

.tune-card:hover {
  border-color: var(--tune-border-bright);
}

.tune-card--accent {
  border-color: var(--tune-accent-dim);
  box-shadow: 0 0 0 1px var(--tune-accent-subtle), var(--tune-shadow);
}

.tune-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tune-border);
}

.tune-card__title {
  font-family: var(--tune-font-sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--tune-text);
  margin: 0;
}

.tune-card__subtitle {
  font-size: 12px;
  color: var(--tune-text-muted);
  margin-top: 2px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.tune-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--tune-border);
  border-radius: var(--tune-radius);
  background: var(--tune-card);
  color: var(--tune-text);
  font-family: var(--tune-font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tune-transition);
  white-space: nowrap;
  user-select: none;
}

.tune-btn:hover {
  background: var(--tune-card-hover);
  border-color: var(--tune-border-bright);
}

.tune-btn:active {
  transform: translateY(1px);
}

.tune-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.tune-btn--primary {
  background: var(--tune-accent);
  color: #0d0e0f;
  border-color: var(--tune-accent);
  font-weight: 600;
}

.tune-btn--primary:hover {
  background: var(--tune-accent-dim);
  border-color: var(--tune-accent-dim);
}

.tune-btn--danger {
  border-color: var(--tune-danger);
  color: var(--tune-danger);
}

.tune-btn--danger:hover {
  background: rgba(231, 76, 60, 0.1);
}

.tune-btn--ghost {
  background: transparent;
  border-color: transparent;
}

.tune-btn--ghost:hover {
  background: var(--tune-accent-subtle);
}

.tune-btn--sm {
  padding: 4px 10px;
  font-size: 12px;
}

.tune-btn--lg {
  padding: 12px 24px;
  font-size: 15px;
}

/* ── Badges ──────────────────────────────────────────────────────────── */
.tune-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-family: var(--tune-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tune-badge--accent {
  background: var(--tune-accent-subtle);
  color: var(--tune-accent);
  border: 1px solid rgba(245, 166, 35, 0.2);
}

.tune-badge--success {
  background: rgba(46, 204, 113, 0.1);
  color: var(--tune-success);
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.tune-badge--warning {
  background: rgba(243, 156, 18, 0.1);
  color: var(--tune-warning);
  border: 1px solid rgba(243, 156, 18, 0.2);
}

.tune-badge--danger {
  background: rgba(231, 76, 60, 0.1);
  color: var(--tune-danger);
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.tune-badge--info {
  background: rgba(52, 152, 219, 0.1);
  color: var(--tune-info);
  border: 1px solid rgba(52, 152, 219, 0.2);
}

.tune-badge--ai {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.15), rgba(245, 120, 35, 0.1));
  color: var(--tune-accent);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

.tune-badge--manual {
  background: rgba(160, 160, 160, 0.1);
  color: var(--tune-text-secondary);
  border: 1px solid rgba(160, 160, 160, 0.2);
}

/* ── Sliders (Amber Thumb) ───────────────────────────────────────────── */
.tune-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--tune-border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.tune-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tune-accent);
  border: 2px solid var(--tune-bg);
  box-shadow: 0 0 0 2px var(--tune-accent-dim);
  cursor: pointer;
  transition: box-shadow var(--tune-transition);
}

.tune-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 4px var(--tune-accent-glow);
}

.tune-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tune-accent);
  border: 2px solid var(--tune-bg);
  box-shadow: 0 0 0 2px var(--tune-accent-dim);
  cursor: pointer;
}

/* Vertical slider (for EQ bands) */
.tune-slider--vertical {
  writing-mode: vertical-lr;
  direction: rtl;
  height: 120px;
  width: 4px;
}

.tune-slider--vertical::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
}

/* ── Channel Strip ───────────────────────────────────────────────────── */
.tune-channel-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  background: var(--tune-card);
  border: 1px solid var(--tune-border);
  border-radius: var(--tune-radius);
  min-width: 60px;
  transition: border-color var(--tune-transition);
}

.tune-channel-strip:hover {
  border-color: var(--tune-border-bright);
}

.tune-channel-strip--active {
  border-color: var(--tune-accent-dim);
  box-shadow: 0 0 8px var(--tune-accent-subtle);
}

.tune-channel-strip__label {
  font-family: var(--tune-font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--tune-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tune-channel-strip__value {
  font-family: var(--tune-font-mono);
  font-size: 11px;
  color: var(--tune-text-muted);
}

/* ── Mute / Solo / Phase toggles ─────────────────────────────────────── */
.tune-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--tune-radius);
  border: 1px solid var(--tune-border);
  background: transparent;
  color: var(--tune-text-muted);
  font-family: var(--tune-font-mono);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--tune-transition);
  user-select: none;
}

.tune-toggle:hover {
  border-color: var(--tune-border-bright);
  color: var(--tune-text);
}

.tune-toggle--mute.active {
  background: var(--tune-danger);
  border-color: var(--tune-danger);
  color: #fff;
}

.tune-toggle--solo.active {
  background: var(--tune-accent);
  border-color: var(--tune-accent);
  color: #0d0e0f;
}

.tune-toggle--phase.active {
  background: var(--tune-info);
  border-color: var(--tune-info);
  color: #fff;
}

/* ── Input / Select ──────────────────────────────────────────────────── */
.tune-input, .tune-select {
  padding: 6px 10px;
  background: var(--tune-bg);
  border: 1px solid var(--tune-border);
  border-radius: var(--tune-radius);
  color: var(--tune-text);
  font-family: var(--tune-font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color var(--tune-transition);
}

.tune-input:focus, .tune-select:focus {
  border-color: var(--tune-accent);
  box-shadow: 0 0 0 2px var(--tune-accent-subtle);
}

.tune-select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236a6a6a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* ── Phase Workflow Cards ────────────────────────────────────────────── */
.tune-phase {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--tune-radius);
  border: 1px solid var(--tune-border);
  background: var(--tune-card);
  transition: all var(--tune-transition);
}

.tune-phase__indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tune-phase--idle .tune-phase__indicator {
  background: var(--tune-text-muted);
}

.tune-phase--active .tune-phase__indicator {
  background: var(--tune-accent);
  animation: tune-pulse 1.5s ease-in-out infinite;
}

.tune-phase--complete .tune-phase__indicator {
  background: var(--tune-success);
}

.tune-phase--error .tune-phase__indicator {
  background: var(--tune-danger);
}

.tune-phase__label {
  font-weight: 500;
  font-size: 13px;
}

.tune-phase__status {
  margin-left: auto;
  font-family: var(--tune-font-mono);
  font-size: 11px;
  color: var(--tune-text-muted);
}

/* ── Coaching Suggestion Cards ───────────────────────────────────────── */
.tune-suggestion {
  padding: 12px 16px;
  border-radius: var(--tune-radius);
  border-left: 3px solid var(--tune-border);
  background: var(--tune-bg-raised);
  margin-bottom: 8px;
}

.tune-suggestion--info {
  border-left-color: var(--tune-info);
}

.tune-suggestion--warning {
  border-left-color: var(--tune-warning);
}

.tune-suggestion--danger {
  border-left-color: var(--tune-danger);
}

.tune-suggestion--success {
  border-left-color: var(--tune-success);
}

.tune-suggestion__text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--tune-text);
}

.tune-suggestion__action {
  margin-top: 8px;
}

.tune-suggestion--action {
  border-left-color: #f5a623;
  background: rgba(245, 166, 35, 0.06);
}

.tune-action-step {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Preset Slots ────────────────────────────────────────────────────── */
.tune-preset-bar {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: var(--tune-bg-raised);
  border-radius: var(--tune-radius);
}

.tune-preset-slot {
  flex: 1;
  padding: 6px 10px;
  background: var(--tune-card);
  border: 1px solid var(--tune-border);
  border-radius: var(--tune-radius);
  color: var(--tune-text-muted);
  font-family: var(--tune-font-mono);
  font-size: 11px;
  text-align: center;
  cursor: pointer;
  transition: all var(--tune-transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tune-preset-slot:hover {
  border-color: var(--tune-border-bright);
  color: var(--tune-text);
}

.tune-preset-slot--active {
  border-color: var(--tune-accent);
  color: var(--tune-accent);
  background: var(--tune-accent-subtle);
}

.tune-preset-slot--empty {
  font-style: italic;
  color: var(--tune-text-muted);
}

/* ── Safety Gate ─────────────────────────────────────────────────────── */
.tune-safety-gate {
  max-width: 560px;
  margin: 40px auto;
  padding: 32px;
  text-align: center;
}

.tune-safety-gate__icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.tune-safety-gate__title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.tune-safety-gate__text {
  font-size: 14px;
  color: var(--tune-text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.tune-safety-gate__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--tune-accent-subtle);
  border-radius: var(--tune-radius);
  border: 1px solid rgba(245, 166, 35, 0.15);
}

.tune-safety-gate__checkbox input[type="checkbox"] {
  accent-color: var(--tune-accent);
  margin-top: 2px;
  flex-shrink: 0;
}

/* ── Token Display ───────────────────────────────────────────────────── */
.tune-token-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--tune-accent-subtle);
  border: 1px solid rgba(245, 166, 35, 0.2);
  border-radius: 20px;
  font-family: var(--tune-font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--tune-accent);
}

/* ── Scrollbar (WebKit) ──────────────────────────────────────────────── */
.tune-page ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.tune-page ::-webkit-scrollbar-track {
  background: var(--tune-bg);
}

.tune-page ::-webkit-scrollbar-thumb {
  background: var(--tune-border);
  border-radius: 3px;
}

.tune-page ::-webkit-scrollbar-thumb:hover {
  background: var(--tune-border-bright);
}

/* ── Animations ──────────────────────────────────────────────────────── */
@keyframes tune-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes tune-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tune-fade-in {
  animation: tune-fade-in 300ms ease-out;
}

/* ── Layout Utilities ────────────────────────────────────────────────── */
.tune-flex { display: flex; }
.tune-flex-col { flex-direction: column; }
.tune-items-center { align-items: center; }
.tune-justify-between { justify-content: space-between; }
.tune-gap-4 { gap: 4px; }
.tune-gap-8 { gap: 8px; }
.tune-gap-12 { gap: 12px; }
.tune-gap-16 { gap: 16px; }
.tune-gap-24 { gap: 24px; }
.tune-w-full { width: 100%; }
.tune-mt-8 { margin-top: 8px; }
.tune-mt-16 { margin-top: 16px; }
.tune-mt-24 { margin-top: 24px; }
.tune-mb-8 { margin-bottom: 8px; }
.tune-mb-16 { margin-bottom: 16px; }
.tune-p-0 { padding: 0; }
.tune-text-center { text-align: center; }
.tune-text-sm { font-size: 12px; }
.tune-text-xs { font-size: 11px; }
.tune-text-muted { color: var(--tune-text-muted); }
.tune-text-accent { color: var(--tune-accent); }
.tune-text-success { color: var(--tune-success); }
.tune-text-danger { color: var(--tune-danger); }
.tune-overflow-x { overflow-x: auto; }

/* ── EQ Band Strip (horizontal 31-band layout) ──────────────────────── */
.tune-eq-strip {
  display: flex;
  gap: 2px;
  padding: 12px 8px;
  overflow-x: auto;
  background: var(--tune-bg);
  border-radius: var(--tune-radius);
}

.tune-eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 32px;
}

.tune-eq-band__freq {
  font-family: var(--tune-font-mono);
  font-size: 9px;
  color: var(--tune-text-muted);
  white-space: nowrap;
  transform: rotate(-45deg);
}

.tune-eq-band__db {
  font-family: var(--tune-font-mono);
  font-size: 10px;
  color: var(--tune-text-secondary);
}

/* ════════════════════════════════════════════════════════════════════════
   EUPHORIA-Style DSP Surface
   ════════════════════════════════════════════════════════════════════════ */

/* ── Main 3-column layout: XOver | EQ Center | Actions ────────────── */
.edsp-main {
  display: grid;
  grid-template-columns: 160px 1fr 120px;
  gap: 0;
  background: #2a2b2d;
  border: 1px solid #3a3b3d;
  border-radius: 4px;
  overflow: hidden;
  min-height: 380px;
}

/* ── Left: Crossover Panel ────────────────────────────────────────── */
.edsp-xover-panel {
  background: #323335;
  border-right: 1px solid #3a3b3d;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edsp-panel-title {
  font-family: var(--tune-font-sans);
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
  text-align: center;
  padding: 4px 0 6px;
  border-bottom: 1px solid #3a3b3d;
  margin-bottom: 4px;
}

.edsp-xover-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.edsp-xover-row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.edsp-xover-label {
  font-family: var(--tune-font-sans);
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  flex: 1;
  text-align: center;
}

.edsp-xover-sublabel {
  font-size: 10px;
  color: #777;
  flex: 1;
  text-align: center;
}

.edsp-xover-value {
  font-family: var(--tune-font-mono);
  font-size: 10px;
  color: #e8e6e3;
  flex: 1;
  text-align: center;
  background: #1a1a1a;
  padding: 2px 4px;
  border-radius: 2px;
}

.edsp-xover-select {
  flex: 1;
  min-width: 0;
  padding: 2px 4px;
  font-size: 10px;
  font-family: var(--tune-font-sans);
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 2px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* ── Center: EQ area ──────────────────────────────────────────────── */
.edsp-center {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* EQ Graph wrapper */
.edsp-eq-graph-wrap {
  display: flex;
  position: relative;
  background: #1e1f20;
  border-bottom: 1px solid #3a3b3d;
}

.edsp-eq-graph-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 4px;
  font-family: var(--tune-font-mono);
  font-size: 9px;
  color: #777;
  width: 28px;
  flex-shrink: 0;
  text-align: right;
}

.edsp-eq-graph {
  flex: 1;
  position: relative;
  height: 200px;
  overflow: hidden;
}

.edsp-eq-graph canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.edsp-eq-ch-overlay {
  position: absolute;
  right: 4px;
  top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2;
}

.edsp-eq-ch-btn {
  padding: 2px 6px;
  font-family: var(--tune-font-mono);
  font-size: 9px;
  font-weight: 600;
  color: #888;
  background: rgba(30,30,30,0.8);
  border: 1px solid #444;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: all 100ms;
}

.edsp-eq-ch-btn:hover { color: #ccc; border-color: #666; }
.edsp-eq-ch-btn.active { color: #fff; background: #c03030; border-color: #e03030; }

.edsp-eq-graph-xaxis {
  display: flex;
  justify-content: space-between;
  padding: 2px 28px 2px 28px;
  font-family: var(--tune-font-mono);
  font-size: 8px;
  color: #666;
  background: #1e1f20;
  border-bottom: 1px solid #3a3b3d;
}

/* ── Band Detail Table ────────────────────────────────────────────── */
.edsp-band-table {
  background: #282828;
  border-bottom: 1px solid #3a3b3d;
  overflow-x: auto;
  padding: 0 2px;
}

.edsp-band-row {
  display: flex;
  align-items: center;
  min-height: 18px;
}

.edsp-band-row--header {
  border-bottom: 1px solid #3a3b3d;
}

.edsp-band-cell {
  flex: 1;
  min-width: 28px;
  text-align: center;
  font-family: var(--tune-font-mono);
  font-size: 9px;
  color: #999;
  padding: 1px 0;
  white-space: nowrap;
}

.edsp-band-cell--label {
  flex: 0 0 32px;
  font-weight: 600;
  color: #aaa;
  text-align: right;
  padding-right: 4px;
  font-size: 10px;
}

.edsp-band-cell--freq {
  color: #e03030;
  font-size: 8px;
}

.edsp-band-cell--q {
  color: #e03030;
  font-size: 8px;
}

.edsp-band-cell--db {
  color: #e8e6e3;
}

/* ── 31 Vertical EQ Sliders ───────────────────────────────────────── */
.edsp-eq-sliders {
  display: flex;
  align-items: flex-start;
  padding: 4px 2px 8px;
  background: #2a2b2d;
  overflow-x: auto;
  gap: 0;
}

.edsp-eq-slider-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 28px;
  position: relative;
}

.edsp-eq-slider {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  height: 100px;
  width: 6px;
  background: linear-gradient(to top, #333 0%, #555 50%, #333 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.edsp-eq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 10px;
  background: #ddd;
  border: 1px solid #999;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.edsp-eq-slider::-moz-range-thumb {
  width: 14px;
  height: 10px;
  background: #ddd;
  border: 1px solid #999;
  border-radius: 2px;
  cursor: pointer;
}

.edsp-ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e03030;
  margin-top: 2px;
}

/* ── Right: Action Panel ──────────────────────────────────────────── */
.edsp-action-panel {
  background: #323335;
  border-left: 1px solid #3a3b3d;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edsp-action-btn {
  padding: 6px 8px;
  font-family: var(--tune-font-sans);
  font-size: 11px;
  color: #ccc;
  background: #3a3b3d;
  border: 1px solid #4a4b4d;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  transition: all 100ms;
}

.edsp-action-btn:hover {
  background: #484950;
  color: #fff;
}

.edsp-action-btn--active {
  background: #4a4b4d;
  color: #fff;
  border-color: #666;
}

/* ════════════════════════════════════════════════════════════════════════
   BOTTOM: 8 Channel Strips Bar
   ════════════════════════════════════════════════════════════════════════ */
.edsp-channel-bar {
  display: flex;
  gap: 0;
  background: #2a2b2d;
  border: 1px solid #3a3b3d;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 6px 4px;
  align-items: stretch;
  overflow-x: auto;
}

/* Sub VOL */
.edsp-sub-vol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #3a3b3d;
  border-radius: 3px;
  background: #323335;
  min-width: 60px;
}

.edsp-sub-vol-title {
  font-family: var(--tune-font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #e03030;
  background: rgba(224,48,48,0.15);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(224,48,48,0.3);
}

.edsp-sub-vol-db {
  font-family: var(--tune-font-mono);
  font-size: 10px;
  color: #ccc;
}

.edsp-sub-vol-fader-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Unit selector */
.edsp-unit-sel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  min-width: 50px;
}

.edsp-unit-title {
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
}

.edsp-unit-opt {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #ccc;
  cursor: pointer;
}

.edsp-unit-opt input[type="radio"] {
  accent-color: #e03030;
  width: 12px;
  height: 12px;
}

/* Channel strip */
.edsp-ch-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  flex: 1;
  min-width: 72px;
  background: #363738;
  border: 1px solid #3a3b3d;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 100ms;
}

.edsp-ch-strip:hover {
  border-color: #555;
}

.edsp-ch-strip--active {
  border-color: #e03030;
  box-shadow: 0 0 6px rgba(224,48,48,0.2);
}

.edsp-ch-strip-label {
  font-family: var(--tune-font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  padding: 2px 10px;
  border-radius: 3px;
  border: 1px solid #555;
  text-align: center;
}

.edsp-ch-strip-label.active {
  background: #c03030;
  color: #fff;
  border-color: #e03030;
}

.edsp-ch-fader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 2px;
}

.edsp-gain-fader {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  height: 80px;
  width: 6px;
  background: linear-gradient(to top, #222 0%, #555 50%, #222 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.edsp-gain-fader::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 8px;
  background: linear-gradient(to bottom, #e03030, #b02020);
  border: 1px solid #ff4040;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.edsp-gain-fader::-moz-range-thumb {
  width: 18px;
  height: 8px;
  background: linear-gradient(to bottom, #e03030, #b02020);
  border: 1px solid #ff4040;
  border-radius: 2px;
  cursor: pointer;
}

.edsp-ch-fader-db {
  font-family: var(--tune-font-mono);
  font-size: 10px;
  color: #ccc;
}

.edsp-ch-phase {
  font-family: var(--tune-font-mono);
  font-size: 10px;
  color: #ccc;
  padding: 1px 6px;
  background: #2a2b2d;
  border-radius: 2px;
}

.edsp-mute-btn {
  background: transparent;
  border: 1px solid #555;
  border-radius: 3px;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  transition: all 100ms;
}

.edsp-mute-btn:hover {
  border-color: #888;
  color: #ccc;
}

.edsp-mute-btn.active {
  background: #c03030;
  border-color: #e03030;
  color: #fff;
}

.edsp-phase-btn {
  background: #2a2b2d;
  border: 1px solid #555;
  border-radius: 3px;
  color: #ccc;
  font-family: var(--tune-font-mono);
  font-size: 10px;
  cursor: pointer;
  padding: 2px 8px;
  transition: all 100ms;
}

.edsp-phase-btn:hover {
  border-color: #888;
  color: #fff;
}

.edsp-phase-btn.active {
  background: #3498db;
  border-color: #5dade2;
  color: #fff;
}

.edsp-ch-off {
  font-family: var(--tune-font-mono);
  font-size: 9px;
  color: #e03030;
  min-height: 12px;
}

.edsp-ch-delay {
  font-family: var(--tune-font-mono);
  font-size: 9px;
  color: #888;
  text-align: center;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
  transition: background 100ms;
}

.edsp-ch-delay:hover {
  background: rgba(255,255,255,0.05);
  color: #ccc;
}

/* ── Diagnostics Panel (25-Test Display) ────────────────────────────── */
.diag-panel {
  background: var(--tune-card);
  border: 1px solid var(--tune-border-bright);
  border-radius: var(--tune-radius-lg);
  padding: 16px;
  margin: 16px 0;
}

.diag-panel h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--tune-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.diag-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--tune-border);
  border-radius: var(--tune-radius);
  background: rgba(0, 0, 0, 0.3);
  text-align: center;
  font-size: 11px;
  transition: all var(--tune-transition);
}

.diag-card:hover {
  border-color: var(--tune-border-bright);
  background: rgba(0, 0, 0, 0.5);
}

.diag-icon {
  font-size: 24px;
  line-height: 1;
}

.diag-name {
  font-size: 10px;
  color: var(--tune-text-secondary);
  font-weight: 500;
  line-height: 1.2;
  max-width: 130px;
}

.diag-status {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
}

.diag-detail,
.diag-value {
  font-size: 8px;
  color: var(--tune-text-muted);
  font-family: var(--tune-font-mono);
  max-width: 130px;
  line-height: 1.1;
  word-break: break-word;
}

/* Test Status Colors */
.diag-card.diag-pass {
  border-color: var(--tune-success);
  background: rgba(46, 204, 113, 0.08);
}

.diag-card.diag-pass .diag-status {
  background: var(--tune-success);
  color: #000;
}

.diag-card.diag-warn {
  border-color: var(--tune-warning);
  background: rgba(243, 156, 18, 0.08);
}

.diag-card.diag-warn .diag-status {
  background: var(--tune-warning);
  color: #000;
}

.diag-card.diag-fail {
  border-color: var(--tune-danger);
  background: rgba(231, 76, 60, 0.08);
}

.diag-card.diag-fail .diag-status {
  background: var(--tune-danger);
  color: #fff;
}

.diag-card.diag-pending {
  border-color: var(--tune-border);
  background: rgba(0, 0, 0, 0.3);
}

.diag-card.diag-pending .diag-status {
  background: var(--tune-border-bright);
  color: var(--tune-text-muted);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .edsp-main {
    grid-template-columns: 120px 1fr 100px;
  }
  .edsp-ch-strip {
    min-width: 60px;
  }

  .diag-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

@media (max-width: 768px) {
  .tune-card {
    padding: 14px;
  }

  .tune-channel-strip {
    min-width: 48px;
    padding: 8px 4px;
  }

  .tune-eq-strip {
    gap: 1px;
  }

  .tune-eq-band {
    min-width: 24px;
  }

  .edsp-main {
    grid-template-columns: 1fr;
  }

  .edsp-xover-panel, .edsp-action-panel {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-left: none;
    border-bottom: 1px solid #3a3b3d;
  }

  .diag-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

  .diag-card {
    padding: 10px;
    font-size: 10px;
  }

  .diag-icon {
    font-size: 20px;
  }

  .diag-name {
    font-size: 9px;
  }
}
