/* The split view (src/ui/side-panel.ts): a side panel on the left of the frame, the scene on the right (its opening starts
   at --scene-l, instrument-tokens.css). The panel is the instrument casing itself, as every panel is: solid, the frame's
   colour and corner, its only edge the rim's hairline; no translucency, no shadow. It runs from the top of the frame down
   to the rail. The divider is the gutter between the panel and the scene. */
/* Motion (docs/drums/mock/MOTION.md, The panel sliding in and out): the casing rides the opening's left edge as it travels
   (--scene-l-now, src/ui/frame-motion.ts), so it slides in from the window's edge with it over --note-dur-frame; its
   contents fade in and rise --note-rise over --note-dur from 160 ms (at once when they come in for a swapped panel:
   .side-swapped, the casing is already there). Leaving (closed, popped out or swapped: side-panel.ts holds it while it
   goes), the contents fade out over 120 ms (plain ease: the panel's ease-out would spend half of it in the first
   frame), then the casing and the opening travel back together. Leaving is its own animation (side-panel-out), not a
   transition to opacity 0: the entry animation (fill both) holds the contents' opacity, and no transition starts when
   that animation is taken off in the same style change, so the contents would vanish in one frame. The same pattern
   as a toast leaving (transport-ui.css, note-toast-out). */
body.instrument-frame #side-panel{position:fixed;z-index:9;top:var(--frame-t);left:var(--frame-l);bottom:var(--visual-bottom-now);width:var(--side-w,0px);
  translate:calc(var(--scene-l-now) - var(--frame-l) - var(--side-w,0px) - var(--frame-edge)) 0;
  box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;margin:0;padding:0;
  background:var(--note-casing);border:1px solid var(--note-rule);border-radius:var(--note-radius-panel);box-shadow:none;
  color:var(--note-text);font:var(--note-weight-text) var(--note-text-sm)/var(--note-leading) var(--note-font)}
body.instrument-frame.side-open #side-panel:not(.side-leaving)>.kit-shell>*,
body.side-floating-window #side-panel:not(.side-leaving)>.kit-shell>*{animation:side-panel-in var(--note-dur) var(--note-ease) 160ms both}
body.side-floating-window #side-panel:not(.side-leaving)>.kit-shell>*,body.instrument-frame.side-open #side-panel.side-swapped:not(.side-leaving)>.kit-shell>*{animation-delay:0ms}
body #side-panel.side-leaving>.kit-shell>*{opacity:0;animation:side-panel-out 120ms ease both}
@keyframes side-panel-in{from{opacity:0;translate:0 var(--note-rise)}to{opacity:1;translate:0 0}}
@keyframes side-panel-out{from{opacity:1}to{opacity:0}}
body.instrument-frame #side-panel[hidden],body.instrument-frame #side-panel-divider[hidden]{display:none}
body.instrument-frame #side-panel:focus{outline:none}
body.instrument-frame #side-panel:focus-visible{outline:1px solid var(--note-text);outline-offset:-4px}
/* The casing's contents are the kit's shell (src/ui/kit.ts shell, styles/kit.css): the head (title 18/500, the page
   selector, the panel's own keys in #side-panel-tools, pop out and close), the panel's display with the line under it
   (side-panel.ts PanelContext.line), and the body. A panel without a display and with nothing on its line has no row
   for them. */
/* The panel's own keys take the head's room between the title and pop out (as the older title line gave them). */
body #side-panel .kit-shell>.head>.tools:has(>.side-panel-tools:not(:empty)){flex:1 1 auto;min-width:0}
body #side-panel .kit-shell>.head:has(>.tools>.side-panel-tools:not(:empty))>.spacer{display:none}
body #side-panel .side-panel-tools{display:flex;flex:1 1 auto;align-items:center;min-width:0}
body #side-panel .side-panel-tools:empty{display:none}
body #side-panel .side-panel-line:empty{display:none}
body #side-panel .side-panel-line:not(:empty)+.kit-display:not([hidden]){margin-top:12px}
body #side-panel .display-row:has(>.kit-display[hidden]):has(>.side-panel-line:empty){display:none}
body #side-panel .display-row:has(>.kit-display[hidden]){padding-top:0}
/* The divider: the gutter between the panel and the scene, a short hairline grip in its middle that lights under the pointer. */
body.instrument-frame #side-panel-divider{position:fixed;z-index:9;top:var(--frame-t);bottom:var(--visual-bottom-now);left:calc(var(--scene-l-now) - var(--frame-edge));width:var(--frame-edge);
  cursor:col-resize;touch-action:none;outline:none}
body.instrument-frame #side-panel-divider::before{content:'';position:absolute;left:50%;top:50%;width:2px;height:40px;margin:-20px 0 0 -1px;border-radius:1px;
  background:var(--note-track);transition:background var(--note-dur) var(--note-ease),height var(--note-dur) var(--note-ease),margin var(--note-dur) var(--note-ease)}
body.instrument-frame #side-panel-divider:is(:hover,.dragging,:focus-visible)::before{height:72px;margin-top:-36px;background:var(--note-text)}
body.instrument-frame.side-resizing,body.instrument-frame.side-resizing *{cursor:col-resize!important;user-select:none}
@media(prefers-reduced-motion:reduce){body.instrument-frame #side-panel,body.instrument-frame #side-panel-divider,body.instrument-frame #side-panel-divider::before,body.instrument-frame #side-panel>*,body.instrument-frame #side-panel>.kit-shell>*{transition:none!important;animation:none!important}}
/* When the room cannot hold 480 + 360 (side-panel.ts SIDE_COVER_ROOM: phones, small tablets) a docked panel takes the whole frame, the one sanctioned
   exception to "never covered" (DIRECTION.md, Desktop and web): the scene keeps its opening under it, no divider. */
body.instrument-frame.side-cover #side-panel{width:auto;right:var(--frame-r);translate:none;z-index:25} /* over the scene's own type (scene-shell.css, 22–24), under the tray and menus */
body.instrument-frame.side-cover #side-panel-divider{display:none}
/* Floating (panel.html, src/panel-app.ts): the panel is the window, edge to edge, in the same casing. */
html:has(body.side-floating-window),body.side-floating-window{height:100%;margin:0;background:var(--note-casing);overflow:hidden}
body.instrument-frame.side-floating-window #side-panel{inset:0;width:auto;border:0;border-radius:0;transition:none;translate:none}
body.instrument-frame.side-floating-window #side-panel:focus-visible{outline:none} /* the window itself has focus: no ring round all of it */
