/* mix/mix.css — mixing studio layout. Colours only through tokens. */
html,body.mx-body{height:100%;margin:0;overflow:hidden;background:var(--bg-0);color:var(--text);font-family:var(--font);font-size:var(--fs-m)}
.mx-app{display:grid;grid-template-rows:auto auto auto minmax(0,1fr) auto;height:100%;min-width:0}
.mx-app .bm-topbar{position:relative}
.mx-title{background:transparent;border:1px solid transparent;color:var(--text);font:600 var(--fs-m) var(--font);padding:5px 8px;border-radius:var(--radius-s);width:min(220px,26vw)}
.mx-title:hover{border-color:var(--line-2)} .mx-title:focus{outline:none;border-color:var(--accent);background:var(--bg-2)}
.mx-saved{font-size:var(--fs-xs);color:var(--text-3);min-width:70px}
.mx-spacer{flex:1}

/* transport */
.mx-transport{display:flex;align-items:center;gap:var(--sp-3);padding:8px var(--sp-4);background:var(--bg-1);border-bottom:1px solid var(--line);flex-wrap:wrap}
.mx-group{display:flex;align-items:center;gap:6px}
.mx-lcd{font:600 17px var(--mono);font-variant-numeric:tabular-nums;background:var(--bg-0);border:1px solid var(--line-2);border-radius:var(--radius-s);padding:3px 10px;min-width:92px;text-align:center;letter-spacing:.02em}
.mx-lcd small{display:block;font-size:10px;color:var(--text-3);font-weight:500;letter-spacing:.08em}
.mx-lcd.mx-sec{font-size:14px;color:var(--text-2);min-width:92px}
.mx-num{width:58px;text-align:center;font:600 13px var(--mono)}
.mx-sel{height:28px;background:var(--bg-3);color:var(--text);border:1px solid var(--line-2);border-radius:var(--radius-s);padding:0 6px;font-size:var(--fs-s)}
.mx-lbl{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--text-3)}
.bm-btn.mx-arm-on{color:var(--bad)}

/* clip bar */
.mx-clipbar{display:flex;align-items:center;gap:var(--sp-3);padding:4px var(--sp-4);min-height:36px;background:var(--bg-0);border-bottom:1px solid var(--line);font-size:var(--fs-s);color:var(--text-2);overflow-x:auto;white-space:nowrap}
.mx-clipbar .bm-input{width:64px;height:26px;text-align:center;font-family:var(--mono)}
.mx-clipbar .mx-cname{width:130px;text-align:left;font-family:var(--font)}
.mx-clipbar[data-empty="1"] .mx-cfields{display:none}
.mx-hint{color:var(--text-3)}
/* clip bar: one control height (inputs 32 / select 28 / small buttons 26 before) and the row is centred, like every toolbar row above it; a row wider than the window keeps its start edge and scrolls (safe) */
.mx-clipbar{justify-content:safe center}
.mx-clipbar .bm-input,.mx-clipbar .mx-sel,.mx-clipbar .bm-btn{height:var(--ctl-h,32px);min-height:var(--ctl-h,32px);box-sizing:border-box}

/* timeline */
.mx-main{display:grid;grid-template-columns:minmax(0,1fr);min-height:0;min-width:0}
.mx-tl{position:relative;display:grid;grid-template-columns:232px minmax(0,1fr);grid-template-rows:34px minmax(0,1fr);min-height:0;min-width:0;background:var(--bg-0)}
.mx-corner{display:flex;align-items:center;gap:6px;padding:0 8px;background:var(--bg-1);border-bottom:1px solid var(--line);border-right:1px solid var(--line)}
.mx-ruler{position:relative;background:var(--bg-1);border-bottom:1px solid var(--line);overflow:hidden;cursor:text}
.mx-ruler canvas,.mx-laneview canvas{display:block;width:100%;height:100%}
.mx-scroll{grid-column:1 / 3;overflow-y:auto;overflow-x:hidden;display:grid;grid-template-columns:232px minmax(0,1fr);min-height:0;position:relative}
.mx-heads{border-right:1px solid var(--line);background:var(--bg-1)}
.mx-lanecell{position:relative;min-width:0}
.mx-laneview{position:sticky;top:0;width:100%;overflow:hidden}
.mx-playhead{position:absolute;top:0;bottom:0;width:0;pointer-events:none;z-index:5;left:232px}
.mx-playhead::before{content:"";position:absolute;left:-0.5px;top:0;bottom:0;width:1px;background:var(--accent-2);box-shadow:0 0 6px var(--accent-glow)}
.mx-playhead::after{content:"";position:absolute;left:-5px;top:0;border:5px solid transparent;border-top-color:var(--accent-2)}
.mx-empty{position:absolute;inset:34px 0 0 232px;display:none;align-items:center;justify-content:center;pointer-events:none}
.mx-empty.mx-show{display:flex}
.mx-empty .bm-empty{pointer-events:auto}
.mx-drop{outline:2px dashed var(--accent);outline-offset:-4px}

/* track headers */
.mx-head{display:flex;gap:8px;align-items:stretch;box-sizing:border-box;padding:6px 6px 6px 0;border-bottom:1px solid var(--line);background:var(--bg-1);position:relative}
.mx-head.mx-sel{background:var(--bg-2)}
.mx-hcolor{width:6px;border-radius:0 3px 3px 0;cursor:pointer;flex:none;background:var(--tc,var(--accent))}
.mx-hmain{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px;justify-content:center}
.mx-hrow{display:flex;align-items:center;gap:4px;min-width:0}
.mx-hname{flex:1;min-width:0;background:transparent;border:1px solid transparent;color:var(--text);font:600 12.5px var(--font);padding:2px 4px;border-radius:var(--radius-xs)}
.mx-hname:hover{border-color:var(--line-2)} .mx-hname:focus{outline:none;border-color:var(--accent);background:var(--bg-2)}
.mx-tb{width:24px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-xs);background:var(--bg-3);border:1px solid var(--line-2);color:var(--text-2);font:700 11px var(--font);cursor:pointer;padding:0;flex:none}
.mx-tb:hover{background:var(--bg-4);color:var(--text)}
.mx-tb.mx-m.mx-on{background:var(--warn);border-color:var(--warn);color:var(--text-inv)}
.mx-tb.mx-s.mx-on{background:var(--info);border-color:var(--info);color:var(--text-inv)}
.mx-tb.mx-r.mx-on{background:var(--bad);border-color:var(--bad);color:#fff}
.mx-tb.mx-a.mx-on,.mx-tb.mx-fx.mx-on{background:var(--accent-soft);border-color:var(--accent);color:var(--accent-2)}
.mx-tb.mx-fx{width:auto;padding:0 6px}
.mx-sl{position:relative;height:16px;flex:1;min-width:30px;cursor:ew-resize;touch-action:none;display:flex;align-items:center}
.mx-sl::before{content:"";position:absolute;left:0;right:0;top:7px;height:3px;border-radius:2px;background:var(--bg-4)}
.mx-sl i{position:absolute;top:7px;height:3px;border-radius:2px;background:var(--accent)}
.mx-sl b{position:absolute;top:2px;width:10px;height:12px;margin-left:-5px;border-radius:3px;background:var(--text);box-shadow:var(--shadow-1)}
.mx-sl.mx-pan i{background:var(--info)}
.mx-sl span{position:absolute;right:0;top:-1px;font:9.5px var(--mono);color:var(--text-3);pointer-events:none;display:none}
.mx-hmeter{width:10px;flex:none;border-radius:2px;background:var(--bg-0)}
.mx-bustag{font-size:9px;letter-spacing:.1em;color:var(--text-3);border:1px solid var(--line-2);border-radius:var(--radius-pill);padding:0 5px}

/* mixer */
.mx-mixer{display:grid;grid-template-columns:minmax(0,1fr) auto;height:300px;background:var(--bg-1);border-top:1px solid var(--line-2);min-width:0}
.mx-mixer[hidden]{display:none}
.mx-strips{display:flex;gap:6px;padding:8px;overflow-x:auto;overflow-y:auto;min-width:0}
.mx-strip{flex:none;width:132px;display:flex;flex-direction:column;gap:6px;padding:6px;background:var(--bg-2);border:1px solid var(--line);border-radius:var(--radius-m);border-top:3px solid var(--tc,var(--accent));min-height:0}
.mx-strip.mx-master{width:156px;border-top-color:var(--accent)}
.mx-sname{font-weight:700;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mx-sfx{display:flex;flex-direction:column;gap:3px;min-height:48px;max-height:86px;overflow:auto}
.mx-slot{display:flex;align-items:center;gap:3px;background:var(--bg-3);border:1px solid var(--line-2);border-radius:var(--radius-xs);height:22px;padding:0 3px}
.mx-slot.mx-byp .mx-slotname{color:var(--text-3);text-decoration:line-through}
.mx-slotname{flex:1;min-width:0;background:none;border:0;color:var(--text);font:600 11px var(--font);text-align:left;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 2px}
.mx-slotb{width:16px;height:16px;border:0;background:none;color:var(--text-3);cursor:pointer;padding:0;font-size:12px;line-height:1}
.mx-slotb:hover{color:var(--text)} .mx-slotb.mx-on{color:var(--good)}
.mx-add{height:22px;border:1px dashed var(--line-3);background:none;color:var(--text-2);border-radius:var(--radius-xs);cursor:pointer;font-size:11px}
.mx-add:hover{border-color:var(--accent);color:var(--accent)}
.mx-ssends{display:flex;flex-direction:column;gap:3px}
.mx-send{display:flex;align-items:center;gap:4px;font-size:10.5px;color:var(--text-2)}
.mx-send .mx-sl{min-width:20px}
.mx-send span.n{width:38px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mx-sfad{flex:1;min-height:90px;display:flex;gap:6px;justify-content:center}
.mx-vf{position:relative;width:34px;cursor:ns-resize;touch-action:none}
.mx-vf::before{content:"";position:absolute;left:15px;width:4px;top:6px;bottom:6px;background:var(--bg-0);border-radius:2px}
.mx-vf b{position:absolute;left:3px;width:28px;height:16px;margin-top:-8px;border-radius:4px;background:linear-gradient(180deg,var(--bg-5),var(--bg-3));border:1px solid var(--line-3);box-shadow:var(--shadow-1)}
.mx-vf b::after{content:"";position:absolute;left:4px;right:4px;top:7px;height:2px;background:var(--text-2)}
.mx-vf .mx-unity{position:absolute;left:0;right:0;height:1px;background:var(--line-3)}
.mx-smeter{width:20px;border-radius:2px;background:var(--bg-0)}
.mx-sread{font:600 11px var(--mono);text-align:center;color:var(--text-2)}
.mx-sbtns{display:flex;gap:4px;justify-content:center}
.mx-lufs{display:grid;grid-template-columns:auto 1fr;gap:1px 6px;font:11px var(--mono);color:var(--text-2)}
.mx-lufs b{color:var(--text);text-align:right;font-weight:600}
.mx-masterwrap{padding:8px 8px 8px 0}

/* floating plugin windows */
.mx-win{position:fixed;z-index:var(--z-menu,50);min-width:300px;max-width:min(780px,96vw);max-height:92vh;overflow:auto;background:var(--bg-2);border:1px solid var(--line-3);border-radius:var(--radius-l);box-shadow:var(--shadow-3,0 20px 60px rgba(0,0,0,.55))}
.mx-wintitle{display:flex;align-items:center;gap:8px;padding:4px 8px;font-size:11px;color:var(--text-3);cursor:move;user-select:none;border-bottom:1px solid var(--line);background:var(--bg-1);position:sticky;top:0;z-index:2}
.mx-wintitle .bm-btn{margin-left:auto}

/* export */
.mx-form{display:grid;grid-template-columns:auto 1fr;gap:10px 14px;align-items:center;min-width:320px}
.mx-form label{color:var(--text-2);font-size:var(--fs-s)}
.mx-form>.bm-input{width:100%;box-sizing:border-box}                       /* every control of the form has the width of the selects */
.mx-form>input[type=checkbox]{justify-self:start;width:auto;margin:0}   /* a stretched tick box drew its tick in the middle of the cell */
/* dialogs: title and buttons sit on the centre line (a title on the left and buttons on the right left half of every row empty) */
.bm-modal-title{text-align:center}
.bm-modal-foot{justify-content:center}
.mx-progress{height:8px;border-radius:4px;background:var(--bg-3);overflow:hidden;margin-top:12px}
.mx-progress i{display:block;height:100%;width:0;background:var(--brand-grad)}

@media (max-width:900px){
  .mx-tl,.mx-scroll{grid-template-columns:150px minmax(0,1fr)}
  .mx-playhead{left:150px}.mx-empty{left:150px}
  .mx-sl{display:none}.mx-hmeter{display:block}
}
.mx-cfields{display:contents}
.mx-strip>*{flex:none}
.mx-strip>.mx-sfad{flex:1 1 auto;min-height:56px}
.mx-sfx{max-height:64px}
.mx-mixer{height:min(320px,48vh)}
.mx-num{width:72px}

/* ---- pitch editor overlay */
.mx-ntback{position:fixed;inset:0;z-index:900;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;padding:3vh 3vw}
.mx-ntwin{display:flex;flex-direction:column;width:100%;height:100%;max-width:1500px;background:var(--bg-1,#15171c);border:1px solid var(--line,#2a2e38);border-radius:10px;overflow:hidden}
.mx-nthead{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid var(--line,#2a2e38);font-weight:600}
.mx-ntbody{flex:1;min-height:0;position:relative}

/* track reorder + count-in countdown */
.mx-hcolor{cursor:grab;touch-action:none;width:8px}
.mx-reorder-ind{position:absolute;left:0;right:0;height:2px;margin-top:-1px;background:var(--accent);box-shadow:0 0 8px var(--accent);pointer-events:none;z-index:5}
.mx-insel{max-width:130px;height:28px}
.mx-countdown{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);font:800 120px/1 var(--font,system-ui);color:var(--accent);text-shadow:0 4px 40px rgba(0,0,0,.6);z-index:9999;pointer-events:none;opacity:.9}
.mx-countdown.mx-pop{animation:mxpop .5s ease-out}
@keyframes mxpop{from{transform:translate(-50%,-50%) scale(1.5);opacity:1}to{transform:translate(-50%,-50%) scale(1);opacity:.7}}
.mx-heads{position:relative}

/* ---- symmetry pass (tools/page-audit.js): one control height per toolbar, rows that span the full header width ---- */
.mx-transport .bm-btn,.mx-transport .bm-btn.bm-sm,.mx-transport .bm-btn.bm-transport,.mx-transport .mx-sel,.mx-transport .mx-num,.mx-transport .mx-insel{height:var(--ctl-h,32px);box-sizing:border-box}
.mx-transport .bm-btn.bm-icon,.mx-transport .bm-btn.bm-transport{width:var(--ctl-h,32px);padding-left:0;padding-right:0}
.mx-transport .mx-lcd{height:var(--ctl-h,32px);min-width:104px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 10px;font-size:15px;line-height:15px}
.mx-transport .mx-lcd small{font-size:9px;line-height:10px}
.mx-transport .mx-lcd.mx-sec{font-size:15px}
.mx-title{height:26px;padding:0 8px;box-sizing:border-box}
.mx-corner{justify-content:stretch}
.mx-corner>.bm-btn{flex:1 1 0;min-width:0}
.mx-hmain>.mx-hrow>.mx-tb{flex:1 1 0;width:auto;min-width:24px}
.mx-transport .bm-btn.bm-transport{min-height:var(--ctl-h,32px)}
.mx-app{grid-template-columns:minmax(0,1fr)}   /* the single column may shrink below the max-content of the top bar (no 11 px page overflow) */
.mx-transport{justify-content:center}           /* a wrapped transport row is centred; a row that holds the spacer still spreads edge to edge */
.mx-title{flex:0 1 auto;min-width:60px}
@media (max-width:900px){
  .mx-hmain>.mx-hrow>.mx-tb{min-width:0}
  .mx-hrow{gap:3px}
}
/* top bar: wraps instead of cutting File / Export off on narrow screens; below 760 px row 1 = brand + title (grows) + undo/redo, row 2 = the four tools spread edge to edge */
.mx-app .bm-topbar{height:auto;min-height:52px;flex-wrap:wrap;row-gap:6px;padding-top:6px;padding-bottom:6px}
@media (max-width:840px){
  .mx-app .bm-topbar{justify-content:space-between}
  .mx-app .bm-topbar .mx-spacer{display:none}
  .mx-title{flex:1 1 100px;width:auto}
}
/* narrow track header column: wide enough for five equal 26 px buttons */
@media (max-width:900px){
  .mx-tl,.mx-scroll{grid-template-columns:168px minmax(0,1fr)}
  .mx-playhead,.mx-empty{left:168px}
}
/* the transport spreads its left and right cluster edge to edge only when one row holds everything (>= 1300 px content width);
   below that the groups are centred as a whole, wrapped rows included (a spacer at the end of a wrapped row ate the free space and left it ragged) */
.mx-transport{container-type:inline-size}
.mx-transport>.mx-spacer{display:none}
@container (min-width:1300px){.mx-transport>.mx-spacer{display:block}}
