/* Studio (/studio/:id) — a scrolling DAW workspace. Unlike keyboard.css this is
   NOT a full-viewport non-scrolling stage: the track stack scrolls between a fixed
   header (transport) and a fixed bottom bar (compact keyboard visualizer). */

html, body { height: 100%; }
/* Swipe-to-navigate is intentionally NOT killed page-wide: a horizontal two-finger
   swipe triggers browser back/forward everywhere EXCEPT the track area (#stTrackArea),
   which is a real scroll container (see below) that consumes the swipe as a native
   scroll. Scoping it this way keeps the rest of the page — and /listen, which
   links studio.css only for the New-studio modal card styles — free to swipe-navigate. */
/* A vertical flex column: fixed header, scrolling track stack (flex:1), a
   transport toolbar, then the keyboard panel — the panel can minimize and the
   stack simply grows to fill, no hardcoded offsets to keep in sync. */
body[data-mode="studio"] {
  overflow: hidden;
  min-height: 100vh; height: 100vh;
  display: flex; flex-direction: column;
  --st-head-w: 156px; /* mixer-head width — shared by the head + the ruler spacer */
}

/* main.js needs #trailCanvas but the studio turns trails off — keep it inert. */
#trailCanvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
}

/* ---- header (top) ------------------------------------------------------- */
.st-header {
  flex: none; height: 56px;
  display: flex; align-items: center; gap: 16px; padding: 0 18px;
  background: var(--ink-2); border-bottom: 1px solid var(--line);
}
.st-header .wordmark { margin: 0; font-size: 30px; text-decoration: none; }
.st-name {
  flex: 0 1 240px; min-width: 120px;
  background: transparent; border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font-family: inherit; font-size: 14px; padding: 6px 10px;
}
.st-name:focus { outline: none; border-color: var(--glow); }
/* non-host view: the editable inputs are swapped for plain-text spans (studio.js).
   The name span drops the input's box chrome; tempo value spans just render text. */
.st-name.st-name-text {
  flex: 0 1 auto; min-width: 0; width: auto;
  border: 0; background: none; padding: 6px 0; white-space: nowrap;
}
.st-name-host { font-size: 11px; color: var(--dim); }
.st-mode {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); background: var(--glow); padding: 3px 8px; border-radius: 4px;
}
/* error-only autosave indicator — hidden while saves succeed, shown on failure */
.st-save-warn {
  font-size: 11px; font-weight: 700; white-space: nowrap;
  color: #e0566b; padding: 3px 8px; border-radius: 4px; cursor: default;
  background: color-mix(in srgb, #e0566b 14%, transparent);
  border: 1px solid color-mix(in srgb, #e0566b 45%, transparent);
}
.st-save-warn[hidden] { display: none; }

/* top-right chrome cluster (settings gear + relocated feedback button) */
/* position: relative — the gear's .st-menu pins to this cluster's right edge */
.st-header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }

/* musical-time tempo controls (BPM / signature / measures) */
.st-tempo { display: flex; gap: 8px; align-items: center; }
.st-tempo[hidden] { display: none; }
.st-tempo-field { font-size: 12px; color: var(--muted, #94a3b8); display: flex; gap: 4px; align-items: center; }
.st-tempo-field[hidden] { display: none; }
.st-tempo-field input { width: 56px; }
.st-tempo-field input, .st-tempo-field select {
  background: rgba(255,255,255,.05); color: var(--text); border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px; padding: 2px 4px; font: inherit;
}
/* non-host read-only readout: "120 BPM - 4/4 time - 8 bars" (muted words, bold values) */
.st-tempo-readout { font-size: 12px; color: var(--muted, #94a3b8); white-space: nowrap; }
.st-tempo-val { color: var(--text); font-weight: bold; }
/* ↺ — clears a local BPM override; only shown while one is active */
.st-bpm-reset {
  background: none; border: 0; padding: 2px 5px; border-radius: 4px;
  color: var(--muted, #94a3b8); cursor: pointer; font-size: 13px; line-height: 1;
}
.st-bpm-reset:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.st-bpm-reset[hidden] { display: none; }

/* snap-to-grid controls in the transport toolbar (musical projects) */
.st-snap { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted, #94a3b8); }
.st-snap[hidden] { display: none; }
.st-snap select {
  background: rgba(255,255,255,.05); color: var(--text); border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px; padding: 2px 4px; font: inherit;
}
/* settings gear — matches keyboard.css's .settings-gear look; its dropdown is .st-menu */
.st-settings-gear {
  width: 30px; height: 30px; display: grid; place-items: center;
  font-size: 18px; line-height: 1; color: var(--dim);
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.st-settings-gear:hover { color: var(--text); transform: rotate(30deg); }
.st-settings-gear:focus-visible { outline: 2px solid var(--glow-2); outline-offset: 2px; }
/* The gear's dropdown. Deliberately a second panel rather than a promotion of grid's
   .gr-menu into style.css: there are already three unrelated menu idioms (keyboard.css's
   static .settings-menu, grid's JS-built .gr-menu, this), and unifying them would mean
   reworking grid's tile and group menus too. Revisit if a fourth page needs a dropdown. */
.st-menu {
  position: absolute; top: 100%; right: 0; z-index: 20; min-width: 190px; margin-top: 6px;
  display: flex; flex-direction: column;
  padding: 4px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px;
  background: rgba(20,20,24,.96); box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.st-menu button {
  position: relative; font: inherit; text-align: left; background: transparent; border: none;
  color: inherit; padding: 7px 10px 7px 26px; border-radius: 6px; cursor: pointer;
}
.st-menu button:hover { background: rgba(255,255,255,.08); }
.st-menu button[disabled] { opacity: .45; cursor: default; }
.st-menu button.is-checked { color: var(--glow-2); }
.st-menu button.is-checked::before { content: '\2713'; position: absolute; left: 10px; }
.st-menu-label {
  padding: 6px 10px 3px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; opacity: .55;
}
/* feedback.js appends .feedback-btn to body as position:fixed (bleeds past the 56px
   bar); studio.js moves it into the cluster, so drop the fixed positioning and let
   it flow inline beside the gear. */
.st-header-right .feedback-btn {
  position: static; top: auto; right: auto; z-index: auto;
  padding: 6px 14px; font-size: 11px;
}

/* metronome toggle — leftmost in the cluster, set further from the feedback button
   than the feedback button is from the gear (10px cluster gap + this margin). */
.st-metro-toggle {
  width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  margin-right: 12px;
  color: var(--dim); background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08); border-radius: 999px; cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.st-metro-toggle svg { width: 17px; height: 17px; display: block; }
.st-metro-toggle:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
/* on = clicks play during playback (persisted per studio); pulses on the beat via the
   shared .metro-pulse keyframes in style.css. Disabled when the project has no tempo. */
.st-metro-toggle.is-active {
  color: var(--glow-2);
  border-color: color-mix(in srgb, var(--glow) 55%, transparent);
  background: color-mix(in srgb, var(--glow) 12%, rgba(255,255,255,.04));
}
.st-metro-toggle:disabled { opacity: .4; cursor: default; }
.st-metro-toggle:disabled:hover { color: var(--dim); border-color: rgba(255,255,255,.08); }
.st-metro-toggle:focus-visible { outline: 2px solid var(--glow-2); outline-offset: 2px; }

/* ---- transport toolbar (between the stack and the keyboard panel) ------- */
/* bottom cluster = transport toolbar + keyboard panel, stacked. The positioning
   context for the chat FAB (which anchors to this cluster's top edge). */
.st-bottom { flex: none; position: relative; display: flex; flex-direction: column; }

.st-toolbar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 8px 18px; background: var(--ink-2); border-top: 1px solid var(--line);
}
/* Chat is a bottom-right FAB (the circular .chat-icon collapsed; the card grows up
   from that corner). Anchored to the TOP of the bottom cluster so it floats above the
   transport bar + keyboard drawer, and rises with the drawer when it opens — no magic
   offsets. Outside the toolbar so no button styling leaks onto the widget. */
.st-chat {
  position: absolute;
  right: 18px;
  bottom: calc(100% + 10px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.st-chat[hidden] { display: none; }
.st-toolbar button:not(.st-record) {
  background: transparent; border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font-size: 16px; width: 34px; height: 30px; cursor: pointer;
}
.st-toolbar button:not(.st-record):hover { border-color: var(--glow); }
/* transport locked during the first-take pre-roll (playhead frozen at 0) */
.st-toolbar button:not(.st-record):disabled { opacity: .4; cursor: default; }
.st-toolbar button:not(.st-record):disabled:hover { border-color: var(--line); }
.st-seek:disabled { opacity: .4; cursor: default; }
.st-seek { flex: 1; min-width: 120px; accent-color: var(--glow); }
.st-time { font-size: 12px; color: var(--dim); min-width: 92px; text-align: right; }

/* ---- track area: a REAL scroll container (BOTH axes) so a two-finger swipe over it is
   consumed natively (no browser back/forward overscroll), and — because it's one
   dual-axis node — pans DIAGONALLY (a single-axis scroller would latch the gesture to
   one axis). Horizontal is virtual: the sizer gives it huge scroll width, the inner is
   sticky so content stays put, and studio.js reads the scrollLeft delta to drive the
   canvas-virtualized timeline (see wireTrackScroll). Vertical is real: the inner's lanes
   overflow and scroll here, with the ruler sticky-pinned at the top. Both scrollbars are
   hidden — the timeline is the scrollbar. */
.st-track-area {
  flex: 1; min-height: 0; position: relative;
  overflow: scroll; overscroll-behavior: none; /* no rubber-band bounce + no swipe-nav */
  scrollbar-width: none; /* Firefox */
}
.st-track-area::-webkit-scrollbar { width: 0; height: 0; } /* WebKit/Blink */
.st-track-sizer { position: absolute; top: 0; left: 0; height: 1px; width: 1px; pointer-events: none; }
/* Sticky-left so the ruler + stack stay pinned as the container scrolls horizontally
   (that scroll is virtual — studio.js turns its delta into timeline movement). Vertical
   is a REAL scroll of this inner's overflowing lanes; keeping BOTH axes on the one
   #stTrackArea container is what lets a swipe pan diagonally — the gesture latches to a
   single node that scrolls both ways, instead of locking to one of two single-axis
   scrollers. min-height:100% so it fills the area when there are few lanes. */
.st-track-inner {
  position: sticky; left: 0; width: 100%; min-height: 100%;
  display: flex; flex-direction: column;
}

/* ---- shared seconds ruler (one strip above the stack). position:sticky top:0 keeps
   it onscreen as the lanes scroll vertically underneath — it stays in the scroll
   container (unlike position:fixed) so swipes over it still scroll the timeline and no
   hardcoded top/padding is needed. z-index:5 sits above the mixer heads (3) + lane
   chevrons (4); the opaque background occludes lanes scrolling under it. The spacer
   offsets the canvas past the sticky mixer heads (head width + the lane's 1px left
   border) so ticks align with the note lanes. */
.st-ruler {
  flex: none; height: 30px; display: flex; align-items: stretch;
  position: sticky; top: 0; z-index: 5;
  padding: 0 18px; background: var(--ink-2); border-bottom: 1px solid var(--line);
}
.st-ruler-spacer { flex: none; width: calc(var(--st-head-w) + 1px); }
.st-ruler-canvas { flex: 1; min-width: 0; display: block; height: 100%; }

/* ---- track stack -------------------------------------------------------- */
/* No own scroll: #stTrackArea is the scroll container (both axes). flex:1 fills it
   when there are few lanes (so the empty-state message centres); when lanes overflow,
   the stack grows and #stTrackArea scrolls vertically. */
.st-stack {
  flex: 1;
  padding: 14px 18px; display: flex; flex-direction: column; gap: 12px;
}
.st-lane {
  flex: none;            /* fixed height — the stack scrolls once lanes overflow */
  height: 130px;         /* collapsed default; expand sets an explicit height inline
                            (10px per pitch lane, computed by studio.js) */
  display: flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,.02);
}
.st-lane--provisional { border-color: #e0313c; box-shadow: 0 0 0 1px rgba(224,49,60,.4); }
/* armed (loop-boundary): recording hasn't begun — it starts at the next loop wrap.
   Amber + a gentle pulse to read "waiting", distinct from the solid-red recording lane.
   Overrides the red provisional styling while the .st-lane--armed class is present. */
.st-lane--provisional.st-lane--armed {
  border-color: #e0a531; box-shadow: 0 0 0 1px rgba(224,165,49,.4);
  animation: st-lane-armed-pulse 1.1s ease-in-out infinite;
}
@keyframes st-lane-armed-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(224,165,49,.35); }
  50%      { box-shadow: 0 0 0 3px rgba(224,165,49,.55); }
}
/* armed notice: large centred message overlaying the (empty) roll canvas while a take
   waits to start capturing (a later take at the next wrap, or a first take for your
   first note / "Start now"). The container ignores pointer events so the roll stays
   interactive; the "Start now" button re-enables them on itself. */
.st-lane-armed-msg {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 0 16px; pointer-events: none;
  color: #e0a531;
}
.st-lane-armed-text {
  font-size: clamp(12px, 2.2vw, 16px); font-weight: 600; letter-spacing: .02em;
}
.st-lane-armed-start {
  pointer-events: auto;
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink); background: #e0a531; border: 0; border-radius: 6px;
  padding: 6px 14px; cursor: pointer;
}
.st-lane-armed-start:hover { background: #ecb547; }
.st-lane-armed-start:focus-visible { outline: 2px solid #e0a531; outline-offset: 2px; }
.st-lane-body { flex: 1; min-width: 0; position: relative; } /* height comes from the lane (stretch) */

/* ghost lane: a dotted, lane-shaped drop target at the bottom of the stack with the
   two "new track" actions centred inside it. Hidden while recording / at the cap. */
.st-ghost-lane {
  flex: none; height: 130px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  border: 2px dashed var(--line); border-radius: 10px;
  background: rgba(255,255,255,.015);
}
.st-ghost-lane[hidden] { display: none; }
.st-ghost-lane button {
  background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font-size: 13px; padding: 8px 14px; cursor: pointer;
  transition: border-color 120ms ease-out, color 120ms ease-out;
}
.st-ghost-lane button:hover { border-color: var(--glow); color: #fff; }
.st-ghost-lane button:focus-visible { outline: 2px solid var(--glow-2); outline-offset: 2px; }
/* "Record new track" mirrors the transport Record: red, white, bold. */
.st-ghost-lane .st-ghost-rec {
  background: #b3202a; border-color: transparent; color: #fff; font-weight: 700;
}
.st-ghost-lane .st-ghost-rec:hover { background: #e0313c; border-color: transparent; }
.st-ghost-or { color: var(--dim); font-size: 12px; }

/* expand/collapse chevron — top-right of the roll, above the canvas */
.st-lane-expand {
  position: absolute; top: 6px; right: 6px; z-index: 4;
  width: 26px; height: 22px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 5px;
  background: rgba(10,12,20,.6); color: var(--dim); cursor: pointer;
}
.st-lane-expand:hover { color: var(--text); border-color: var(--glow); }
.st-lane-expand svg { width: 15px; height: 15px; display: block; }

/* full-keyboard toggle — left of the expand chevron, expanded lanes only */
.st-lane-range {
  position: absolute; top: 6px; right: 38px; z-index: 4;
  width: 26px; height: 22px; padding: 0;
  display: none; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 5px;
  background: rgba(10,12,20,.6); color: var(--dim); cursor: pointer;
}
.st-lane.is-expanded .st-lane-range { display: inline-flex; }
.st-lane-range:hover { color: var(--text); border-color: var(--glow); }
.st-lane-range svg { width: 15px; height: 15px; display: block; }

/* Piano-roll canvas — keyboard.css (which styles it on /roll) isn't loaded here.
   touch-action:none lets the canvas own every touch gesture: drag-scroll +
   two-finger pinch-zoom reach the pointer handlers instead of panning the page. */
.st-lane-body .piano-roll-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
/* The per-lane +/- zoom buttons are redundant here — pinch (trackpad or touch)
   zooms the shared time scale — so hide them (they stay on /roll). */
.st-lane-body .piano-roll-zoom { display: none; }

/* header column on the LEFT of the lane; sticky so it stays put if the stack
   scrolls horizontally. */
.st-lane-head {
  flex: none; width: var(--st-head-w);
  position: sticky; left: 0; z-index: 3;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 10px; border-right: 1px solid var(--line); background: #16161f;
}
.st-lane-labelrow { display: flex; align-items: center; gap: 6px; }
.st-lane-label { font-size: 12px; color: var(--text); }
/* owner badge — small pill pushed to the right of the track name */
.st-yours-badge {
  margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .04em;
  color: var(--glow); padding: 2px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--glow) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--glow) 40%, transparent);
}
/* another collaborator's name badge — same pill as "you", tinted per-actor inline */
.st-owner-badge {
  margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .04em;
  max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 6px; border-radius: 999px;
  color: var(--owner, #cbd5e1);
  background: color-mix(in srgb, var(--owner, #cbd5e1) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--owner, #cbd5e1) 40%, transparent);
}
/* header identity pill */
.st-identity {
  font-family: inherit; font-size: 11px; color: var(--dim); cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px;
}
.st-identity[hidden] { display: none; }
.st-identity #stIdentityName { color: var(--text); font-weight: 600; }
/* name modal (reuses .st-modal-back/.st-modal) */
.st-name-modal { display: flex; flex-direction: column; gap: 14px; }
.st-name-modal .st-num { width: 100%; font-size: 15px; padding: 10px; }
.st-name-save {
  align-self: flex-end; font-family: inherit; font-size: 13px; cursor: pointer;
  color: var(--ink); background: var(--glow); border: none; border-radius: 8px; padding: 8px 16px;
}
.st-name-save:disabled { opacity: .5; cursor: default; }
/* per-track instrument dropdown */
.st-inst {
  width: 100%; font-family: inherit; font-size: 11px; color: var(--text);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 6px; cursor: pointer;
}
.st-inst:hover { border-color: var(--glow); }
.st-inst:focus { outline: none; border-color: var(--glow); }
.st-lane-mixrow { display: flex; align-items: center; gap: 6px; }
.st-mix-btn {
  width: 26px; height: 24px; border: 1px solid var(--line); border-radius: 5px;
  background: transparent; color: var(--dim); font-size: 12px; font-weight: 700; cursor: pointer;
}
.st-mix-btn:hover { color: var(--text); }
.st-mix-btn.is-on { background: var(--glow); color: var(--ink); border-color: var(--glow); }
.st-solo.is-on { background: #56d46a; border-color: #56d46a; }
/* local lane reorder (▲/▼) — small, muted; no drag gesture today */
.st-lane-move { width: 20px; font-size: 9px; color: var(--dim); }
/* delete = red trashcan (matches the recording widget's danger icon button) */
.st-del {
  margin-left: auto; width: 28px; height: 24px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid color-mix(in srgb, #e0566b 60%, transparent); color: #e0566b;
}
.st-del svg { width: 15px; height: 15px; display: block; }
.st-del:hover { background: color-mix(in srgb, #e0566b 16%, transparent); }
.st-vol-row { display: flex; align-items: center; gap: 6px; }
.st-vol-icon { flex: none; display: inline-flex; color: var(--dim); }
.st-vol-icon svg { width: 15px; height: 15px; display: block; }
.st-vol { flex: 1; min-width: 0; accent-color: var(--glow); }

/* ---- bottom bar: compact keyboard visualizer + controls ---------------- */
.st-bar {
  flex: none;
  display: flex; flex-direction: column; gap: 8px; padding: 8px 18px 14px;
  background: var(--ink-2); border-top: 1px solid var(--line);
}
.st-bar-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.st-bar-title { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.st-panel-toggle {
  justify-self: end; background: transparent; border: 1px solid var(--line);
  border-radius: 6px; color: var(--dim); font-family: inherit; font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; cursor: pointer;
}
.st-panel-toggle:hover { color: var(--text); border-color: var(--glow); }
.st-bar-main { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
body.st-panel-min .st-bar-main { display: none; } /* minimized: collapse to the title row */

.st-piano {
  overflow-x: auto; overflow-y: hidden;
  position: relative;
  /* Shrink-wrap the keyboard (fit-content = its intrinsic ~1196px width) and centre
     it, so the felt fills the keyboard's width instead of stretching to the full
     flex row (a column-flex item stretches by default; the explicit width overrides
     that). max-width keeps it inside narrow viewports, where overflow-x scrolls. */
  width: fit-content; max-width: 100%; margin: 0 auto;
}

/* --- compact keyboard visualizer: key geometry/visuals ported from keyboard.css
   (that file isn't loaded here — its .piano centers on the viewport). The
   keyboard has an explicit pixel width (main.js), so margin:auto centers it. --- */
.st-bar .keyboard { position: relative; height: 196px; margin: 0 auto; user-select: none; }
.st-bar .piano-felt {
  height: 16px; margin: 0 0 0; border-radius: 6px 6px 0 0;
  background: linear-gradient(#2a2a37, #181821);
  box-shadow: inset 0 -3px 5px rgba(0,0,0,.6), inset 0 4px 0 color-mix(in srgb, var(--glow) 55%, #7a1226);
}
.st-bar .key { position: absolute; top: 0; box-sizing: border-box; --vel: 1; transition: filter 70ms ease-out, box-shadow 120ms ease-out, transform 60ms ease-out; }
.st-bar .key.white {
  height: 196px; z-index: 1; border-radius: 0 0 5px 5px;
  background: linear-gradient(to bottom, #fffefa 0%, #f4efe0 72%, #e3dcc6 100%);
  box-shadow: inset -1.5px 0 1px rgba(60,50,30,.28), inset 1px 0 0 rgba(255,255,255,.7), inset 0 -7px 8px -6px rgba(80,65,40,.5);
}
.st-bar .key.black {
  height: 122px; z-index: 2; border-radius: 0 0 4px 4px;
  background: linear-gradient(to bottom, #34343f 0%, #1a1a22 52%, #08080c 100%);
  box-shadow: 0 5px 6px -1px rgba(0,0,0,.7), inset 0 -4px 5px -2px rgba(255,255,255,.10), inset 0 2px 1px rgba(255,255,255,.18);
}
.st-bar .key.is-active.white {
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--glow-2) calc(28% + var(--vel) * 42%), #fffefa) 0%,
    color-mix(in srgb, var(--glow)   calc(23% + var(--vel) * 42%), #f4efe0) 100%);
  box-shadow: 0 0 calc(6px + var(--vel) * 16px) -2px color-mix(in srgb, var(--glow) calc(40% + var(--vel) * 55%), transparent),
    inset 0 0 calc(5px + var(--vel) * 9px) color-mix(in srgb, var(--glow-2) calc(28% + var(--vel) * 52%), transparent);
  transform: translateY(1.5px);
}
.st-bar .key.is-active.black {
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--glow-2) calc(22% + var(--vel) * 33%), #2a2a33) 0%,
    color-mix(in srgb, var(--glow)   calc(28% + var(--vel) * 42%), #111) 100%);
  box-shadow: 0 0 calc(6px + var(--vel) * 14px) -1px color-mix(in srgb, var(--glow) calc(45% + var(--vel) * 50%), transparent),
    inset 0 0 calc(5px + var(--vel) * 7px) color-mix(in srgb, var(--glow-2) calc(25% + var(--vel) * 35%), transparent);
  transform: translateY(1.5px);
}
.st-bar .sustain { display: none; } /* pedal indicator omitted in the compact strip */
.st-bar-controls { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* record button lives in the transport toolbar now */
.st-record {
  margin-left: auto;
  background: #b3202a; border: none; border-radius: 6px; color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 8px 14px; cursor: pointer;
}
.st-record[disabled] { opacity: .5; cursor: default; }
.st-record.is-armed { background: #e0313c; box-shadow: 0 0 0 3px rgba(224,49,60,.3); }
/* .toggle / .toggle-btn / .device / .enable-sound are shared chrome — see style.css */

/* ---- "Your studios" list (on /listen) ---------------------------------- */
.your-studios { margin-bottom: 22px; }
.studio-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.studio-open { color: var(--text); text-decoration: none; flex: 1; }
.studio-open:hover { color: var(--glow); }
.studio-tag { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); padding: 2px 6px; border-radius: 4px; }
/* forget = red trashcan (matches the studio mixer / recording widget danger icon) */
.studio-forget {
  width: 28px; height: 24px; padding: 0; border-radius: 5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid color-mix(in srgb, #e0566b 60%, transparent); color: #e0566b;
}
.studio-forget svg { width: 15px; height: 15px; display: block; }
.studio-forget:hover { background: color-mix(in srgb, #e0566b 16%, transparent); }

/* ---- creation modal ----------------------------------------------------- */
.st-modal-back { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); }
.st-modal-back[hidden] { display: none; } /* author display:flex beats the UA [hidden] rule */
.st-modal { width: min(560px, 92vw); background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; padding: 22px; color: var(--text); }
.st-modal-title { margin: 0 0 16px; font-family: 'Cormorant', serif; font-size: 26px; }
.st-modal-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.st-modal-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); min-width: 74px; }
.st-modal-sub { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 12px; }
.st-modal-fields { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.st-modal-fields[hidden] { display: none; } /* author display:flex would beat the UA [hidden] rule */
.st-modal-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--dim); }
.st-num { width: 68px; }
.st-modal select, .st-modal .st-num { background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px; font-family: inherit; }
.st-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.st-modal-cancel { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 8px 14px; font-family: inherit; cursor: pointer; }
.st-modal-create { background: var(--glow); border: none; color: var(--ink); border-radius: 6px; padding: 8px 16px; font-family: inherit; font-weight: 700; cursor: pointer; }

/* ---- creator cards (Type / Start from) ---------------------------------- */
.st-section-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 4px 0 8px; }
.st-card-grid { display: flex; gap: 10px; margin-bottom: 16px; }
.st-card { flex: 1; position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--ink); transition: border-color .12s, box-shadow .12s; }
.st-card-radio { position: absolute; opacity: 0; pointer-events: none; }
.st-card.is-selected { border-color: var(--glow); box-shadow: inset 0 0 0 1px var(--glow); }
.st-card.is-disabled { opacity: .45; cursor: not-allowed; }
.st-card-title { font-weight: 700; font-size: 15px; color: var(--text); }
.st-card-blurb { font-size: 12px; color: var(--dim); line-height: 1.3; }

/* ---- not-found overlay -------------------------------------------------- */
.st-overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; background: var(--ink);
}
.st-overlay[hidden] { display: none; } /* author display:flex would otherwise beat the UA [hidden] rule */
.st-overlay p { font-size: 16px; color: var(--text); }
.st-overlay-home { color: var(--glow); text-decoration: none; border-bottom: 1px solid var(--glow); }
