/* Core studio views: Arrange, editor dock, Live Loops, Mixer, Sounds, Beat Lab, Devices. */
.sc-box { position: relative; overflow: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.sc-cv { position: sticky; top: 0; left: 0; display: block; touch-action: pan-x pan-y; }
.sc-sp { pointer-events: none; }

/* Arrange */
.arr-main { flex: 1; min-height: 0; display: flex; }
.arr-heads { width: 230px; flex: none; border-right: 1px solid var(--line); background: var(--panel2); overflow: hidden; display: flex; flex-direction: column; }
.head-ruler { display: flex; align-items: center; gap: 4px; padding: 0 6px; border-bottom: 1px solid var(--line); background: #17171f; flex: none; position: relative; z-index: 2; }
.head-list { will-change: transform; }
.thead { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; background: var(--panel2); }
.thead.sel { background: #262131; } .thead:hover { background: #22222c; }
.tcolor { width: 5px; background: var(--tc); flex: none; }
.tmain { flex: 1; min-width: 0; padding: 5px 6px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.tline { flex-wrap: nowrap; gap: 4px; } .tline input[type=range] { width: 76px; min-width: 40px; flex: 1; }
.tname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tkind { font-size: 12px; opacity: .8; }
.tmenu { align-self: center; }
.arr-lanes { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Dock */
.dock-grip { height: 6px; cursor: ns-resize; background: var(--line); flex: none; touch-action: none; } .dock-grip:hover { background: var(--ochre); }
.dock { flex: none; height: 300px; display: flex; flex-direction: column; background: var(--bg2); border-top: 1px solid var(--line); }
.dock:not(.open) { height: auto !important; } .dock:not(.open) .dock-body { display: none; }
.dock-tabs { padding: 4px 8px; border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; }
.dock-tabs > button:not(.btn) { background: transparent; border: 0; color: var(--muted); padding: 4px 10px; cursor: pointer; font-weight: 600; border-radius: 6px; white-space: nowrap; }
.dock-tabs > button.on { color: var(--ochre); background: var(--raise); }
.dock-body { flex: 1; min-height: 0; overflow: hidden; display: flex; } .dock-body > div { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: auto; } .dock-body > div[hidden] { display: none; }
.mix-dock { height: 250px; } .mix-dock:not(.open) { display: none; }
.mixer-scroll { min-height: 260px; }

/* Piano roll */
.proll { display: flex; flex-direction: column; flex: 1; min-height: 0; outline: none; }
.proll-tools { padding: 4px 8px; gap: 5px; border-bottom: 1px solid var(--line); flex-wrap: wrap; } .proll-tools .clipname { color: var(--ochre); margin-right: 6px; }
.proll-area { flex: 1; min-height: 80px; display: flex; flex-direction: column; } .proll-vel { width: 100%; height: 60px; border-top: 1px solid var(--line); touch-action: none; display: block; }

/* Device chain */
.devices-panel { overflow: auto; flex: 1; }
.chain { display: flex; gap: 8px; padding: 8px; align-items: flex-start; min-width: min-content; }
.dev { flex: none; min-width: 200px; max-width: 520px; padding: 8px 10px; } .dev.off { opacity: .5; }
.dev-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; } .dev-head b { font-size: 12px; }
.dev.add { display: flex; flex-direction: column; gap: 6px; width: 240px; }
.dev.inst { width: 430px; } .dev.inst select.grow { width: 100%; }
.knobs { display: flex; flex-wrap: wrap; gap: 6px 2px; align-items: flex-end; }
.kitpads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.kitpads .pad { display: flex; flex-direction: column; gap: 2px; } .kitpads select { font-size: 10px; padding: 1px; width: 100%; }
.padbtn { height: 34px; border-radius: 6px; border: 1px solid var(--line2); background: linear-gradient(180deg, #2c2c38, #1d1d26); font-size: 10px; cursor: pointer; touch-action: none; }
.padbtn:active { background: var(--ochre); color: #1a0618; }

/* Live Loops */
.ss-wrap { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.ss-grid { display: grid; gap: 4px; min-width: min-content; }
.ss-head { padding: 6px 8px; background: var(--panel2); border-top: 3px solid var(--tc, var(--ochre)); border-radius: 6px; display: flex; flex-direction: column; cursor: pointer; overflow: hidden; } .ss-head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot { height: 44px; border-radius: 6px; background: #15151b; border: 1px solid #22222b; display: flex; align-items: center; gap: 4px; padding: 0 4px; position: relative; overflow: hidden; }
.slot.full { background: color-mix(in srgb, var(--tc) 28%, #15151b); border-color: color-mix(in srgb, var(--tc) 60%, #000); }
.slot.playing { box-shadow: inset 0 0 0 2px #9ff0c9; } .slot.queued { animation: blink .5s infinite alternate; } @keyframes blink { to { opacity: .55; } }
.slot-play { width: 28px; height: 28px; border-radius: 6px; border: 0; background: #0006; cursor: pointer; flex: none; color: var(--text); }
.slot.playing .slot-play { color: #9ff0c9; }
.slot-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 12px; cursor: pointer; } .slot-len { color: #fff9; }
.slot-add, .slot-stop { background: transparent; border: 0; color: var(--dim); cursor: pointer; width: 30px; height: 30px; } .slot-add:hover, .slot-stop:hover { color: var(--text); }
.slot-more { position: absolute; right: 2px; top: 2px; padding: 0 4px; opacity: 0; } .slot:hover .slot-more { opacity: 1; }
.scene { display: flex; align-items: center; } .scene .btn { width: 100%; justify-content: center; }
.stopper { background: transparent; border-color: transparent; justify-content: center; }

/* Mixer */
.mixer-scroll { flex: 1; min-height: 0; overflow: auto; }
.mixer { display: flex; gap: 6px; padding: 10px; min-width: min-content; align-items: stretch; }
.strip { width: 108px; flex: none; background: var(--panel2); border: 1px solid var(--line); border-top: 3px solid var(--tc, var(--line2)); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.strip.ret { --tc: var(--violet); } .strip.master { width: 290px; --tc: var(--ochre); cursor: default; }
.strip-name { font-weight: 700; font-size: 12px; width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inserts { width: 100%; display: flex; flex-direction: column; gap: 2px; }
.insert { font-size: 10px; background: #0d0d12; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #cdbfa6; } .insert.off { opacity: .4; text-decoration: line-through; } .insert.add { color: var(--dim); text-align: center; border-style: dashed; cursor: pointer; }
.fader-row { display: flex; gap: 6px; align-items: stretch; height: 160px; }
.fader { writing-mode: vertical-lr; direction: rtl; width: 30px; height: 150px; touch-action: none; } .fader.learn { outline: 2px dashed var(--ochre); }
.vmeter { border-radius: 2px; height: 150px; }
.strip-gap { width: 10px; flex: none; } .strip select { width: 100%; font-size: 11px; padding: 2px 4px; }
.spectrum { width: 100%; height: 110px; border-radius: 6px; border: 1px solid var(--line); }
.lufs-box { font-size: 11px; color: #9ff0c9; background: #0b1410; border: 1px solid #22322a; border-radius: 6px; padding: 3px 6px; width: 100%; text-align: center; }
.row.tight { gap: 3px; flex-wrap: nowrap; }

/* Sounds */
.lib-cats { display: flex; gap: 5px; padding: 8px 14px; overflow-x: auto; flex: none; border-bottom: 1px solid var(--line); } .lib-cats .pill { cursor: pointer; white-space: nowrap; }
.lib-list { flex: 1; min-height: 0; overflow: auto; padding: 8px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px; align-content: start; }
.lib-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: 8px; }
.lib-item.on { border-color: var(--ochre); } .lib-name { font-weight: 600; }
.lib-note { grid-column: 1 / -1; }
.lib-keys { flex: none; padding: 8px 14px 12px; border-top: 1px solid var(--line); background: var(--bg2); display: flex; flex-direction: column; gap: 6px; }

/* Beat Lab */
.beats { max-width: 1200px; }
.seq { display: grid; gap: 3px; margin-top: 8px; overflow-x: auto; }
.seq-lab { font-size: 11px; text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; color: var(--muted); cursor: pointer; padding: 0 6px; white-space: nowrap; overflow: hidden; touch-action: none; }
.step { height: 26px; border-radius: 4px; border: 1px solid #2a2a35; background: #1a1a22; cursor: pointer; font-size: 9px; color: #1a0618; padding: 0; }
.step.beat { background: #22222c; } .step.on { background: var(--ochre); border-color: #ffb05a; } .step.acc { background: var(--ember); } .step.chance { background: repeating-linear-gradient(45deg, var(--ochre) 0 4px, #7a5a24 4px 8px); } .step.rep { background: var(--teal); }
.chord-strips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.chord-strip { height: 90px; border-radius: 10px; border: 1px solid var(--line2); background: linear-gradient(180deg, #2c2433, #1a1620); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; touch-action: none; font-size: 15px; }
.chord-strip:active { background: var(--ochre); color: #1a0618; }
.chord-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; } .chord-cell { min-width: 120px; }
.player { display: flex; flex-direction: column; gap: 6px; }

/* Devices */
.devgrid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.devlist { margin: 4px 0 8px; padding-left: 18px; } .devlist li { margin: 2px 0; }
details summary { cursor: pointer; color: var(--ochre); margin: 6px 0; }

/* Touch & small screens */
@media (pointer: coarse) {
  .tog { width: 32px; height: 30px; } .btn { min-height: 38px; } .btn.sm { min-height: 34px; } .step { height: 36px; } .slot { height: 54px; } .knob .dial { width: 46px; height: 46px; }
  .dock-tabs > button:not(.btn) { padding: 8px 12px; }
}
@media (max-width: 760px) {
  .arr-heads { width: 128px; } .tline input[type=range] { display: none; } .tmenu { display: none; }
  .hide-sm { display: none; } .dock { height: 46vh; } .dev.inst { width: 92vw; } .chain { flex-wrap: nowrap; }
  .lib-list { grid-template-columns: 1fr; min-height: 300px; flex: none; } #view-library.flexv.on { overflow: auto; } .lib-keys .pkeys { height: 54px; } .chord-strips { grid-template-columns: repeat(4, 1fr); } .chord-strip { height: 70px; }
  .view-head { padding: 8px 10px; } .view-pad { padding: 10px; } .strip.master { width: 220px; }
}
/* automation editor */
.auto-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.auto-head { padding: 6px 10px; gap: 5px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.auto-head input[type=range] { width: 90px; vertical-align: middle; }
.auto-wrap { flex: 1; min-height: 150px; overflow-x: auto; overflow-y: hidden; }
.auto-cv { display: block; cursor: crosshair; touch-action: none; }
