/* Studio workspace: a dense editor, kept calm. Colour marks tracks, selection and the playhead only. */
.st-bar { gap: 8px 14px; margin-bottom: 10px; }
.field.st-inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.field.st-inline > label { white-space: nowrap; color: var(--muted); }
.st-loop { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.st-loop input.num { width: 4.2em; }

.st-timeline { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); max-height: min(46dvh, 27rem); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.st-heads { border-right: 1px solid var(--line); min-width: 0; }
.st-corner { position: sticky; top: 0; z-index: 2; height: 64px; display: grid; grid-template-rows: 24px 20px 20px; align-items: center; padding-left: 8px; font-size: 0.75rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.st-headrow { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 6px 3px; border-bottom: 1px solid var(--line); }
.st-headrow[aria-current="true"] { background: var(--soft); box-shadow: inset 3px 0 0 var(--accent); }
.st-chip { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 2px; }
button.st-name { flex: 1 1 auto; min-width: 0; min-height: 1.75rem; padding: 0 4px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.st-name[aria-current="true"] { font-weight: 600; }
.st-mslrow { display: inline-flex; gap: 2px; flex: 0 0 auto; }
button.st-msl { min-width: 1.7rem; min-height: 1.7rem; padding: 0; font-size: 0.75rem; }
/* The shared tick mark would not fit: pressed state is shown by fill, weight and an underline instead. */
button.st-msl[aria-pressed="true"]::before { content: none; }
button.st-msl[aria-pressed="true"] { font-weight: 700; text-decoration: underline; }
.st-meter { display: block; flex: 1 1 3rem; height: 5px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.st-meter > i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.st-meter > i.hot { background: var(--bad); }
.st-headrow > .st-meter { position: absolute; left: 6px; right: 6px; bottom: 2px; height: 3px; }
.st-lanes { position: relative; min-width: 0; overflow-x: clip; }
.st-ruler { display: block; width: 100%; height: 64px; position: sticky; top: 0; z-index: 1; touch-action: none; cursor: pointer; }
.st-tracks { display: block; width: 100%; touch-action: pan-y; }
.st-playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; z-index: 3; }
input.st-scroll { display: block; margin: 4px 0 14px; }

.st-panel { min-width: 0; }
.st-tools { gap: 8px 14px; }
.st-status { margin-left: auto; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.st-rollwrap { position: relative; overflow: clip; }
.st-roll { height: 340px; cursor: crosshair; }

.st-steps { overflow-x: auto; padding-bottom: 6px; }
.st-steprow { display: grid; grid-template-columns: 7.5rem repeat(var(--steps, 16), minmax(1.75rem, 1fr)); gap: 2px; margin-bottom: 2px; min-width: calc(7.5rem + var(--steps, 16) * 1.9rem); }
.st-stephead { font-size: 0.7rem; color: var(--muted); text-align: center; }
button.st-piece { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: left; padding: 0 6px; min-height: 2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.st-step { display: flex; align-items: flex-end; min-height: 2rem; min-width: 0; padding: 0; overflow: hidden; }
button.st-step.st-beat { margin-left: 3px; }
button.st-step.st-first { margin-left: 7px; }
.st-stephead.st-first { text-align: left; padding-left: 7px; }
/* A hit is a filled bar whose height is its velocity: shape, not colour, carries the state. */
button.st-step > i { display: block; width: 100%; height: 0; background: var(--ink); }
button.st-step[aria-pressed="true"] { border-color: var(--ink); }

.st-sub { border-top: 1px solid var(--line); padding: 10px 0 6px; }
.st-sub > .row > .grow { flex: 1 1 auto; }
.st-numrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.st-after { margin-top: 8px; }
.st-check { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.st-panel table input[type="text"] { width: 100%; min-width: 6rem; }
.st-mixer { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 4px 28px; }
.st-chan { border-top: 1px solid var(--line); padding: 8px 0; }
.st-chan .st-meter { margin-bottom: 8px; }
.st-chan .field, .st-insp .field { grid-template-columns: minmax(0, 1fr) auto; }
.st-chan .field > label, .st-insp .field > label { grid-column: 1 / -1; }
.st-insp .field > select, .st-insp .field > input[type="text"] { grid-column: 1 / -1; }
.st-insp h3 { margin: 14px 0 8px; }
.st-bounce { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.85rem; }
.st-bounce progress { width: 100%; accent-color: var(--ink); }

@media (max-width: 860px) {
  .st-timeline { grid-template-columns: 8.75rem minmax(0, 1fr); max-height: 44dvh; }
  .st-headrow { flex-wrap: wrap; align-content: center; gap: 2px 6px; }
  .st-headrow > button.st-name { flex-basis: calc(100% - 16px); }
  button.st-msl { min-width: 2.5rem; min-height: 2.25rem; }
  .st-roll { height: 300px; }
  .st-steprow { grid-template-columns: 5.5rem repeat(var(--steps, 16), minmax(1.75rem, 1fr)); min-width: calc(5.5rem + var(--steps, 16) * 1.9rem); }
  .st-status { margin-left: 0; flex-basis: 100%; }
}
.st-panel td:last-child { white-space: nowrap; }
