/*! supertwentyplus licence: (c) 2026 Supertwentyplus Pte. Ltd. All rights reserved. Proprietary, not open source.
   Use only as provided on supertwentyplus.com (free or by subscription, under its Terms). Copying, reuse or hosting elsewhere,
   in whole or in part, needs a written licence: supertwentyplus@gmail.com. See LICENSE.txt at the site root. */
/* STP Sound Mixer Labs */
.mx-app { gap: 20px; }
.mx-transport { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 16px 24px; align-items: center; padding: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--card-radius); }
@media (max-width: 640px) { .mx-transport { grid-template-columns: 1fr; } }
.mx-play { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; min-width: 140px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--ink); color: var(--surface); font: 700 18px var(--font-display); cursor: pointer; }
.mx-play-icon { font-size: 22px; fill: currentColor; stroke: none; }
.mx-play[aria-pressed="true"] { background: #B42318; }
.mx-master { display: flex; flex-direction: column; gap: 6px; }
.mx-master label { font-weight: 600; font-size: 14px; }
.mx-master output { font-family: var(--font-mono); }
.mx-app input[type="range"] { width: 100%; min-height: 30px; accent-color: var(--ink); }
.mx-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mx-presets-label { font-weight: 700; font-size: 15px; }
.mx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mx-chip { min-height: 40px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; }
.mx-chip:hover { border-color: var(--ink); }
.mx-group { display: flex; flex-direction: column; gap: 10px; }
.mx-group-title { font-size: 17px; }
.mx-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 10px; }
.mx-ch { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--card-radius); transition: border-color .15s ease, background .15s ease; }
.mx-ch.is-on { border-color: var(--ink); background: var(--bg); }
.mx-toggle { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.mx-toggle .icon { font-size: 24px; color: var(--ink-3); }
.mx-ch.is-on .mx-toggle .icon { color: var(--accent); }
.mx-name { font-weight: 700; font-size: 15px; }
.mx-onoff { padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-3); font: 700 12px var(--font-mono); }
.mx-ch.is-on .mx-onoff { background: var(--ink); color: var(--surface); }
.mx-ch:not(.is-on) .mx-vol { opacity: .55; }
.mx-extras { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; padding-top: 6px; border-top: 1px solid var(--line); }
.mx-extras select { min-height: 46px; padding: 0 12px; background: var(--surface); color: var(--ink); border: var(--input-border); border-radius: var(--btn-radius); font-size: 16px; }
.mx-extra-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mx-extra-btns .btn { min-height: 46px; }
.btn.is-rec { border-color: #B42318; color: #B42318; }
.btn.is-rec::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #B42318; animation: mx-blink 1s infinite; }
@keyframes mx-blink { 50% { opacity: .2; } }
.mx-status { font-weight: 600; color: var(--accent-text); min-height: 1.4em; }
.mx-status:empty { min-height: 0; }

/* Studio */
.st { display: flex; flex-direction: column; gap: 16px; padding: clamp(16px, 3vw, 24px); background: var(--bg); border: 2px solid var(--ink); border-radius: var(--card-radius); }
.st-head { display: flex; flex-direction: column; gap: 4px; }
.st-title { font-size: 26px; }
.st-sub { color: var(--ink-2); }
.st-insts { flex-wrap: wrap; border-radius: 16px; }
.st-inst { min-height: 42px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; }
.st-inst[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.st-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.st-box { margin: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: var(--btn-radius); background: var(--surface); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.st-box legend { padding: 0 6px; font-weight: 800; font-size: 14px; }
.st-box.is-disabled { opacity: .5; }
.st-row label, .st-lbl, .st-sliders label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.st-row output, .st-sliders output { font-family: var(--font-mono); color: var(--ink); }
.st-inline { display: flex; gap: 8px; align-items: center; }
.st-inline input { flex: 1; }
.st-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-two select { width: 100%; min-height: 40px; margin-top: 4px; padding: 0 8px; background: var(--surface); color: var(--ink); border: var(--input-border); border-radius: 8px; font-size: 14px; }
.st-oct { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.st-oct output { min-width: 28px; text-align: center; font: 700 16px var(--font-mono); }
.st-mini { min-width: 40px; min-height: 40px; padding: 0 10px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; }
.st-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px 14px; }
.st-sliders label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px; }
.st-sliders input, .st-row input[type="range"], .st-tempo input { width: 100%; accent-color: var(--ink); min-height: 28px; }

.st-keys-wrap { overflow-x: auto; padding-bottom: 4px; }
.st-keys-wrap[hidden] { display: none; }
.st-keys { position: relative; height: 170px; min-width: 560px; user-select: none; touch-action: none; }
.st-key { position: absolute; top: 0; padding: 0; margin: 0; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; padding-bottom: 8px; }
.st-key.is-white { left: calc(var(--pos) * 100% / var(--whites)); width: calc(100% / var(--whites)); height: 100%; background: #FFFFFF; border: 1.5px solid var(--ink); border-radius: 0 0 8px 8px; z-index: 1; }
.st-key.is-black { left: calc(var(--pos) * 100% / var(--whites) - (100% / var(--whites)) * 0.3); width: calc(100% / var(--whites) * 0.6); height: 60%; background: #16233F; border: 1px solid #000; border-radius: 0 0 6px 6px; z-index: 2; color: #FFFFFF; }
.st-key.is-white.is-down { background: #CFE0FF; }
.st-key.is-black.is-down { background: #3E6FD8; }
.st-kl { font: 700 11px var(--font-mono); opacity: .55; }
.st-kn { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.st-pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.st-pads[hidden] { display: none; }
.st-pad { min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; user-select: none; touch-action: manipulation; transition: transform .06s ease, background .06s ease; }
.st-pad.is-hit, .st-pad:active { background: #FFE066; transform: scale(.97); }
.st-hintrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.st-hintrow .field-hint { flex: 1 1 300px; }
.st-midi { min-height: 42px; font-size: 14px; }

.st-recorder { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--btn-radius); }
.st-rec-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.st-recbtn.is-rec { background: #B42318; border-color: #B42318; }
.st-recbtn.is-rec::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #FFFFFF; animation: mx-blink 1s infinite; }
.st-time { font: 700 16px var(--font-mono); color: var(--ink-2); }
.st-rec-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; font-size: 14px; font-weight: 600; }
.st-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.st-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.st-tempo { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; }
.st-tempo output { font-family: var(--font-mono); }
.st-tracks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.st-track { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; }
.st-track.is-muted { opacity: .55; }
.st-tname { min-width: 0; min-height: 36px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font-weight: 700; font-size: 15px; }
.st-tname:hover, .st-tname:focus { border-color: var(--line); background: var(--surface); }
.st-tmeta { font-size: 13px; color: var(--ink-3); text-align: right; }
.st-tbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.st-tb { min-height: 36px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.st-tb[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.st-del:hover { border-color: #B42318; color: #B42318; }
.st-tvol { width: 100%; max-width: 220px; justify-self: end; accent-color: var(--ink); }
.st-rec-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.mx-bg { display: flex; flex-direction: column; gap: 20px; }
.mx-bg-title { font-size: 22px; }
@media (max-width: 560px) { .st-track { grid-template-columns: 1fr; } .st-tmeta { text-align: left; } .st-tvol { justify-self: start; } .st-pads { grid-template-columns: repeat(2, 1fr); } }

.st-loading { font-size: 14px; font-weight: 600; color: var(--accent-text); }
.st-loading:empty { display: none; }
.st-count { margin-left: auto; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font: 700 13px var(--font-mono); color: var(--ink-2); }
.st-count.is-full { background: #FFF1DB; border-color: #F1C985; color: #7A4B00; }
.st-upgrade { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; background: #FFF1DB; border: 1px solid #F1C985; border-radius: var(--btn-radius); color: #5C3A00; font-weight: 600; }
.st-upgrade[hidden] { display: none; }
.st-upgrade p { flex: 1 1 260px; }
.st-credits a { color: var(--link-hover); }

.st-best-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; }
.st-best-state { font-size: 13px; font-weight: 700; color: var(--accent-text); }
.st-best { font-size: 13px; }
.st-best:disabled { opacity: .45; cursor: default; }
.st-sliders label.is-off { opacity: .4; }
/* v2350: Try a tune */
.st-tunebox .field-hint { margin: 0; }
.st-tunes { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.st-tune { grid-column: span 2; min-height: 36px; padding: 4px 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; cursor: pointer; text-align: center; }
.st-tune.is-long { grid-column: span 3; }
@media (max-width: 600px) { .st-tunes { grid-template-columns: repeat(2, minmax(0, 1fr)); } .st-tune { grid-column: span 1; } .st-tune.is-long { grid-column: span 2; } }
.st-tune:hover { border-color: var(--ink-2); }
.st-tune[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.st-tune-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.st-tune-row .st-tempo input { width: 140px; max-width: 100%; }
.st-tune-now { margin: 0; font-size: 14px; color: var(--ink-2); min-height: 1.4em; }
.st-key.is-white.is-tune { background: #FFE08A; }
.st-key.is-black.is-tune { background: #D99A00; }
/* v2390: instruments in even rows of 8 (4 on phones) */
.st-insts { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); align-self: stretch; }
.st-insts .st-inst { padding: 4px 6px; font-size: 13px; line-height: 1.2; min-height: 44px; text-align: center; }
@media (max-width: 600px) { .st-insts { grid-template-columns: repeat(4, minmax(0, 1fr)); } .st-insts .st-inst { font-size: 12px; padding: 4px 2px; } }
