/* ===================== Mixer view ===================== */
.mixer-view {
  position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0;
  --mx-w: 88px; --mx-meter-bg: #06070a; --mx-cap-1: #eef0f5; --mx-cap-2: #9aa1b3;
}
:root[data-theme="light"] .mixer-view { --mx-meter-bg: #1d2029; --mx-cap-1: #ffffff; --mx-cap-2: #b8bfcf; }
.mixer-view.narrow { --mx-w: 66px; }
.mx-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; padding: 0 4px; }

.mx-body { flex: 1; min-height: 0; display: flex; background: var(--bg); }
.mx-scroll { flex: 1; min-width: 0; display: flex; gap: 10px; padding: 8px; overflow: auto; }
.mx-group { display: flex; gap: 4px; min-height: 100%; flex: none; }
.mx-buses { padding-left: 10px; border-left: 1px dashed var(--line-2); align-items: stretch; }
.mx-group-label {
  writing-mode: vertical-rl; transform: rotate(180deg); align-self: center; font-size: 10px;
  text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); margin-right: 2px;
}
.mx-master-host { flex: none; display: flex; padding: 8px; border-left: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; }

/* ---- strip ---- */
.mx-strip {
  width: var(--mx-w); flex: none; display: flex; flex-direction: column; min-height: 330px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2) 60%);
  border: 1px solid var(--line); border-radius: 7px; overflow: hidden; position: relative;
  transition: border-color .12s, box-shadow .12s;
}
.mx-strip.selected { border-color: var(--strip-color, var(--accent)); box-shadow: 0 0 0 1px var(--strip-color, var(--accent)), 0 4px 18px rgba(0,0,0,.25); }
.mx-strip.silenced .mx-fader-area, .mx-strip.silenced .mx-head { opacity: .55; }
.mx-master { width: 168px; --strip-color: var(--accent); }
.mx-bus { --strip-color: var(--accent-2); }

.mx-head {
  position: relative; padding: 7px 6px 5px; cursor: pointer; flex: none;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--strip-color, var(--accent)) 13%, var(--bg-3));
}
.mx-head:hover { background: color-mix(in srgb, var(--strip-color, var(--accent)) 22%, var(--bg-3)); }
.mx-color { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--strip-color, var(--accent)); }
.mx-name { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-sub { display: flex; align-items: center; gap: 3px; font-size: 10px; color: var(--text-3); white-space: nowrap; overflow: hidden; margin-top: 1px; }
.mx-sub span:last-child { overflow: hidden; text-overflow: ellipsis; }
.mx-del { position: absolute; top: 4px; right: 2px; width: 18px !important; height: 18px !important; opacity: 0; }
.mx-head:hover .mx-del { opacity: 1; }

.mx-sec-label { font-size: 9px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); padding: 4px 6px 2px; cursor: help; }
.narrow .mx-sec-label { padding: 3px 4px 1px; letter-spacing: .04em; }

/* inserts */
.mx-inserts { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); overflow: hidden; }
.mx-slot-list { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 5px; flex: 0 1 88px; height: 88px; min-height: 24px; overflow-y: auto; }
.mx-slot {
  display: flex; align-items: center; gap: 4px; height: 18px; min-height: 18px; padding: 0 4px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 3px; font-size: 10.5px; cursor: pointer; color: var(--text);
}
.mx-slot:hover { border-color: var(--accent); }
.mx-slot.off { opacity: .55; }
.mx-slot.off .mx-slot-name { text-decoration: line-through; color: var(--text-3); }
.mx-slot-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--good); box-shadow: 0 0 5px color-mix(in srgb, var(--good) 70%, transparent); }
.mx-slot.off .mx-slot-dot { background: var(--text-3); box-shadow: none; }
.mx-slot-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-slot-add { justify-content: center; background: transparent; border-style: dashed; color: var(--text-3); width: 100%; font: inherit; font-size: 10px; }
.mx-slot-add:hover { color: var(--text); background: var(--bg-4); }

/* sends */
.mx-sends { flex: none; border-bottom: 1px solid var(--line); min-height: calc(18px + var(--mx-send-rows, 1) * 42px); }
.mx-sends-spacer { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--line) 35%, transparent) 6px 7px); }
.mx-send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 0 2px 3px; max-height: calc(var(--mx-send-rows, 1) * 42px); overflow-y: auto; }
.mx-strip .knob { width: auto; cursor: ns-resize; }
.mx-send-knob .knob-label { font-size: 9px; max-width: 40px; color: var(--text-3); }
.narrow .mx-send-knob .knob-label { max-width: 28px; }

/* pan + buttons */
.mx-pan { flex: none; display: flex; flex-direction: column; align-items: center; padding: 5px 0 0; }
.mx-pan-knob .knob-arc { stroke: var(--accent-2); }
.mx-pan-val { font: 10px var(--mono); color: var(--text-2); margin-top: -2px; }
.mx-btns { flex: none; display: flex; gap: 3px; justify-content: center; padding: 5px 4px 3px; }
.mx-btn { height: 20px; min-width: 21px; padding: 0 4px; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.mx-arm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.toggle.arm.on .mx-arm-dot { background: #fff; }

/* fader + meter */
.mx-fader-area { flex: 1 0 110px; min-height: 110px; display: flex; justify-content: center; gap: 3px; padding: 12px 4px 8px; }
.mx-scale { position: relative; width: 17px; flex: none; }
.narrow .mx-scale { display: none; }
.mx-tick { position: absolute; right: 0; transform: translateY(50%); font: 8px/1 var(--mono); color: var(--text-3); display: flex; align-items: center; gap: 1px; }
.mx-tick::after { content: ''; width: 3px; height: 1px; background: var(--text-3); opacity: .7; }
.mx-fader { position: relative; width: 24px; flex: none; cursor: ns-resize; touch-action: none; }
.mx-fader-groove { position: absolute; top: 0; bottom: 0; left: 50%; width: 5px; margin-left: -2.5px; background: var(--mx-meter-bg); border-radius: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.mx-fader-fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px; background: var(--accent); opacity: .8; }
.mx-fader-cap {
  position: absolute; left: 0; right: 0; height: 18px; border-radius: 3px; pointer-events: none;
  background: linear-gradient(180deg, var(--mx-cap-1), var(--mx-cap-2));
  box-shadow: 0 2px 6px rgba(0,0,0,.5), inset 0 -1px 0 rgba(0,0,0,.25);
}
.mx-fader-cap::after { content: ''; position: absolute; left: 3px; right: 3px; top: 8px; height: 2px; background: #2a2e3a; border-radius: 1px; }
.mx-fader.active .mx-fader-cap, .mx-fader:hover .mx-fader-cap { box-shadow: 0 0 0 1px var(--accent), 0 2px 8px rgba(0,0,0,.55); }
.mx-meter-wrap { display: flex; flex-direction: column; gap: 3px; width: 13px; flex: none; }
.mx-fader-area.big .mx-meter-wrap { width: 26px; }
.mx-fader-area.big { gap: 6px; }
.mx-clip { height: 6px; flex: none; border: 0; padding: 0; border-radius: 2px; background: color-mix(in srgb, var(--bad) 22%, var(--bg)); cursor: pointer; }
.mx-clip.on { background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.mx-meter { flex: 1; width: 100%; min-height: 0; display: block; border-radius: 2px; background: var(--mx-meter-bg); }

.mx-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 2px; padding: 4px 4px 6px; border-top: 1px solid var(--line); font: 10px var(--mono); }
.mx-db { background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; color: var(--text); cursor: text; min-width: 34px; text-align: center; }
.mx-db:hover { border-color: var(--accent); }
.mx-peak { color: var(--text-3); cursor: pointer; text-align: right; }
.mx-peak.hot { color: var(--bad); font-weight: 700; }
.narrow .mx-foot { flex-direction: column; gap: 1px; }

/* master analysis */
.mx-analysis { flex: none; padding: 6px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.mx-spectrum { width: 100%; height: 64px; display: block; background: var(--mx-meter-bg); border-radius: 4px; border: 1px solid var(--line); }
.mx-loud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.mx-loud-cell { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 2px 3px; text-align: center; cursor: help; }
.mx-loud-cell span { display: block; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.mx-loud-val { font: 11px var(--mono); color: var(--text); }
.mx-loud-val.hot { color: var(--warn); }
.mx-master .mx-slot-list { flex-basis: 70px; height: 70px; }

/* add bus + empty */
.mx-add-bus {
  flex: none; width: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 1.5px dashed var(--line-2); border-radius: 7px; color: var(--text-3); cursor: pointer; font-size: 10px;
}
.mx-add-bus:hover { border-color: var(--accent-2); color: var(--text); background: var(--bg-2); }
.mx-add-bus span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .08em; text-transform: uppercase; }
.mx-empty {
  width: 280px; align-self: center; margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; color: var(--text-3); padding: 24px;
}
.mx-empty h3 { margin: 0; color: var(--text); font-size: 16px; }
.mx-empty p { margin: 0; font-size: 12px; }

/* narrow strips */
.narrow .mx-slot-add span { display: none; }
.narrow .mx-btns { gap: 2px; padding: 4px 2px 3px; }
.narrow .mx-btn { min-width: 17px; padding: 0 2px; }
.narrow .mx-head { padding: 7px 4px 4px; }
