/* This sheet loads before the instrument sheets. Scope control refinements so
   their later base rules do not erase focus feedback or restore transition:all.
   Playable pads, piano keys, step cells and the Guide retain their own states. */
body { color-scheme:dark; }
body :is(.transport-btn,.session-tool,.arr-tool,.export-btn,.studio-button,.beat-style,.beat-section,.beat-bar-tab,.beat-play-btn,.beat-close-btn,.piano-close,.pad-close-btn,.instrument-min-btn,.guide-btn,.ctx-item,.modify-preview-btn,.modify-take-btn,.sampler-btn,.sampler-x,.export-x,.track-btn,.scene-launch,.scene-options-btn,.clip-play-btn,.clip-options-btn,.folder-header,.subfolder-header,.import-btn) {
  transition:background-color 140ms ease,border-color 140ms ease,color 140ms ease,opacity 140ms ease;
}
body :is(input,select,textarea,summary):focus-visible {
  outline:2px solid #c4a9ef; outline-offset:3px;
}
body :is(.transport-btn,.session-tool,.arr-tool,.ctx-item):focus-visible {
  outline:2px solid #c4a9ef; outline-offset:3px;
}
body .track-name:focus-visible { outline-offset:2px; border-radius:3px; }
body :is(.folder-header,.subfolder-header):focus-visible { outline:2px solid #c4a9ef; outline-offset:-2px; background:var(--surface2); border-radius:4px; }
/* A collapsed sound editor must leave both the Tab order and accessibility tree. */
body #modify-panel:not(.open) { visibility:hidden; pointer-events:none; }
body .modify-header { height:auto; min-height:44px; }
body .modify-clip-id { min-width:0; flex:1; }
body .modify-title { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body .modify-color-swatch,body .modify-close { flex-shrink:0; }
body .modify-body { height:auto; }
body :is(.sample-meta,.vol-mini,.param-section-hdr) { color:#a092b1; }
body .sample-meta { font-size:11px; line-height:1.45; }
body .vol-mini { font-size:var(--vd-fs-2xs,.6875rem); }
body .track-controls .track-btn:not(.muted):not(.soloed) { color:#b4a5c5; }
body .track-controls .track-btn { min-width:24px; height:24px; font-size:var(--vd-fs-2xs,.6875rem); }
body :is(.instrument-window,.sampler-card,.export-card,.song-builder-dialog,.studio-shortcuts,.ctx-menu) {
  scrollbar-color:#75618a #19151f;
}
/* The studio reset removes the browser's dialog margin. Restore centering for
   modal tasks; movable instrument windows and the floating Guide are excluded. */
body dialog:is(.inspire-modal,.inspire-reward,.studio-shortcuts,.song-builder-dialog,.arr-audio-progress) { margin:auto; }
body :is(.sampler-x,.export-x,.modify-close) {
  min-width:36px; min-height:36px; width:36px; height:36px;
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
}
body :is(.sampler-actions,.export-actions,.song-builder-actions) { flex-wrap:wrap; }
body :is(.sampler-name-input,.export-input,.studio-take-name) { min-width:0; }
body .starter-menu { width:min(370px,calc(100% - 24px)); max-height:50dvh; overflow:auto; overscroll-behavior:contain; }
body .beat-window .beat-play-btn { min-height:36px; }
body .beat-window .beat-style { min-height:36px; justify-content:center; }
body .beat-window .beat-style small { font-size:11px; line-height:1.35; }
body .beat-window .beat-controls:not(.beat-sound-selectors) select {
  min-height:36px; padding:7px 9px; font-size:13px; max-width:100%;
}
body .beat-window :is(.beat-character-controls,.beat-melodic-controls) label { min-width:0; }
body .beat-window .beat-layer.muted { opacity:.7; }
body .beat-window :is(.beat-melodic-controls output,.beat-layer output,.beat-bar-summary) { font-variant-numeric:tabular-nums; }
body .beat-window :is(.beat-tick,.beat-caption) { color:#a79ab8; }
body .beat-window .beat-grid { scroll-padding-inline:8px; }
body .instrument-window :is(.studio-field,.studio-event-form) input { max-width:100%; min-width:0; }
body .instrument-window :is(.studio-performance-status,.studio-hint,.studio-preset-note) { overflow-wrap:anywhere; }

.clip-controls,.scene-controls { display:flex; align-items:center; gap:3px; flex-shrink:0; }
body :is(.scene-options-btn,.clip-options-btn) { width:22px; height:22px; padding:0; border:0; border-radius:4px; background:rgba(0,0,0,.18); color:inherit; font:700 16px/1 system-ui; cursor:pointer; }
body :is(.scene-options-btn,.clip-options-btn):focus-visible { outline:2px solid #d7c2ff; outline-offset:2px; }

/* Give the range a generous hit area without turning its entire height into a
   solid bar. The visible track stays thin; musical category colors are kept. */
body input[type="range"] {
  appearance:none; -webkit-appearance:none; background:transparent;
  min-height:24px; padding:0; cursor:pointer;
}
body input[type="range"]::-webkit-slider-runnable-track {
  height:3px; border-radius:999px; background:var(--border2,#51455e);
}
body input[type="range"]::-webkit-slider-thumb {
  appearance:none; -webkit-appearance:none; width:14px; height:14px;
  margin-top:-5.5px; border:0; border-radius:50%;
  background:var(--range-thumb,var(--accent2,#b49ae8)); box-shadow:none;
}
body input[type="range"]::-moz-range-track {
  height:3px; border:0; border-radius:999px; background:var(--border2,#51455e);
}
body input[type="range"]::-moz-range-thumb {
  width:14px; height:14px; border:0; border-radius:50%;
  background:var(--range-thumb,var(--accent2,#b49ae8)); box-shadow:none;
}
body .pad-window input[type="range"] { --range-thumb:#deb27b; }
body .beat-layer[data-layer] { --range-thumb:var(--bm-accent-edge,#c4b5fd); } /* v75: one slider design for every lane */
body input[type="checkbox"] { accent-color:#b49ae8; }
body input[type="range"]:disabled { cursor:default; opacity:.45; }
body input[type="range"]:disabled::-webkit-slider-thumb { cursor:default; }

@media (hover:hover) {
  body :is(.session-tool,.arr-tool,.modify-preview-btn,.modify-take-btn):hover:not(:disabled):not([aria-disabled="true"]) { border-color:#8b76a1; }
  body :is(.beat-close-btn,.piano-close,.pad-close-btn):hover:not(:disabled) { background-color:#36303f; color:#fff; }
  body :is(.scene-options-btn,.clip-options-btn):hover:not(:disabled):not([aria-disabled="true"]) { background:rgba(0,0,0,.4); }
}
/* A disabled instrument action should not look actionable on hover. */
body .instrument-window .studio-button:disabled:hover { background:#252231; border-color:#4b425f; color:#ded6ef; }
body .instrument-window .studio-button.primary:disabled:hover { background:#a88adb; border-color:#bba3e3; color:#17111e; }
body .pad-window .studio-button.primary:disabled:hover { background:#deb27b; border-color:#edc897; color:#24190c; }
body .instrument-window .studio-button.danger:disabled:hover { border-color:#bb687d; color:#ffdce5; }
@media (pointer:coarse) {
  body .topbar .transport-btn { width:44px; height:44px; }
  body :is(.session-tool,.arr-tool,.ctx-item,.import-btn,.add-scene-btn) { min-height:44px; }
  body :is(.sampler-x,.export-x,.modify-close,.instrument-min-btn,.beat-close-btn,.piano-close,.pad-close-btn,.vocals-close,.add-scene-btn) { min-width:44px; min-height:44px; }
  body .instrument-window :is(.studio-button,.studio-select,.studio-field select,.beat-play-btn,.beat-style,.beat-section,.beat-bar-tab) { min-height:44px; }
  body :is(.folder-header,.subfolder-header,.studio-take-editor summary,.studio-midi summary,.studio-sound-design summary,.studio-piano-ideas summary,.studio-follow-key) { min-height:44px; box-sizing:border-box; }
  body .scene-label { flex-wrap:wrap; row-gap:4px; padding-inline:4px; }
  body :is(.scene-controls,.clip-controls) :is(.scene-options-btn,.scene-launch,.clip-options-btn,.clip-play-btn) { min-width:44px; min-height:44px; }
}
@media (max-width:600px) {
  /* Keep all timeline actions reachable without consuming the timeline height. */
  body .arr-toolbar { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:thin; }
  body .arr-toolbar > * { flex-shrink:0; }
  body .modify-panel.open { height:min(300px,45dvh); overflow-y:auto; }
  body .modify-header { display:grid; grid-template-columns:minmax(0,1fr) auto; padding:8px 12px; gap:6px 8px; }
  body .modify-clip-id { grid-column:1; grid-row:1; flex-wrap:wrap; gap:5px; }
  body .modify-close { grid-column:2; grid-row:1; }
  body .modify-actions { grid-column:1 / -1; grid-row:2; min-width:0; }
  body .modify-body { min-height:88px; flex-shrink:0; }
  /* Keep the library usable while leaving room for the studio toolbar. */
  body .workspace>.sidebar { width:150px; }
  body .sidebar :is(.sidebar-header,.search-box) { padding-inline:8px; gap:5px; }
  body .sidebar .sidebar-header { flex-wrap:wrap; }
  body .sidebar :is(.browser-feature,.browser-status) { margin-inline:8px; padding-inline:8px; }
  body .sidebar .browser-feature { font-size:12px; }
  body .sidebar .browser-feature small { font-size:11px; line-height:1.45; }
  body .sidebar .folder-header { padding-inline:8px; gap:5px; font-size:11px; letter-spacing:.04em; }
  body .sidebar .subfolder-header { padding-inline:12px 8px; gap:4px; font-size:11px; letter-spacing:0; }
  body .sidebar .sample-item { padding-inline:12px 8px; gap:4px; flex-wrap:wrap; }
  body .sidebar .sample-item .sample-name { flex:1 1 100%; }
  body .sidebar .sample-type { font-size:var(--vd-fs-2xs,.6875rem); }
  body .sidebar :is(.browser-status,.import-folder-hint) { overflow-wrap:anywhere; }
  body .main .scene-selection-note { max-width:100%; line-height:1.45; }
  body .beat-window .beat-header { flex-wrap:wrap; gap:8px; }
  body .beat-window .beat-title { flex:1 1 100%; }
  body .beat-window .beat-header-right { width:100%; justify-content:space-between; }
}
@media (max-width:600px) and (pointer:coarse) {
  /* Physical keyboard shortcuts stay visible when a laptop is simply resized. */
  body .piano-key .piano-note-label:not(.piano-pitch-label),
  body .piano-key.black .piano-note-label { display:none; }
  body .piano-key.white .piano-pitch-label { font-size:var(--vd-fs-2xs,.6875rem); opacity:.85!important; margin-top:0!important; }
}
@media (max-width:420px) {
  body .workspace>.sidebar { width:128px; }
  body .sampler-count-row { flex-wrap:wrap; }
  body .export-player { gap:8px; flex-wrap:wrap; }
  body .export-wave { flex-basis:calc(100% - 54px); }
  body .export-time { margin-left:auto; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; }
  body :is(.transport-btn,.session-tool,.arr-tool,.export-btn,.studio-button,.beat-style,.beat-section,.beat-bar-tab,.beat-play-btn,.beat-close-btn,.piano-close,.pad-close-btn,.instrument-min-btn,.guide-btn,.ctx-item,.modify-preview-btn,.modify-take-btn,.sampler-btn,.sampler-x,.export-x,.track-btn,.scene-launch,.scene-options-btn,.clip-play-btn,.clip-options-btn,.folder-header,.subfolder-header,.folder-arrow,.subfolder-arrow,.import-btn,.param-mini-fill,.arr-playhead) { transition:none; }
  body :is(.sampler-card,.export-card,.sampler-backdrop,.export-backdrop,.sampler-rec-dot) { animation:none; }
  body #btn-rec.recording { animation:none; }
  body .clip.playing .clip-progress { animation:none; transform:scaleX(1); }
}
