
    .studio .keyboard-control-bar {
      flex:none; display:flex; flex-wrap:wrap; align-items:center; gap:4px 18px; width:100%; min-width:0;
      box-sizing:border-box; min-height:43px; padding:5px 20px;
      border:1px solid #455064; border-radius:8px 8px 5px 5px;
      background:linear-gradient(180deg,#303744 0%,#1c2330 46%,#161d29 100%);
      box-shadow:inset 0 1px 0 #ffffff24,inset 0 -1px 0 #0006;
    }
    .keyboard-control-bar .keyboard-sustain {
      display:inline-flex; flex:none; align-items:center; gap:10px; min-height:32px;
      color:#edf2fb; font-size:.84rem; font-weight:700; cursor:pointer;
      white-space:nowrap;
    }
    .keyboard-sustain svg { flex:none; color:#d7dce5; }
    .keyboard-control-bar #sustain {
      appearance:none; position:relative; flex:none; width:48px; height:25px;
      box-sizing:border-box; margin:0 0 0 4px; border:1px solid #667182;
      border-radius:999px; background:#252c39; cursor:pointer;
      box-shadow:inset 0 1px 3px #0007;
      transition:background .2s ease,border-color .2s ease;
    }
    .keyboard-control-bar #sustain::after {
      content:""; position:absolute; width:19px; height:19px; top:2px; left:3px;
      border-radius:50%; background:#e8e9e7; box-shadow:0 1px 3px #0008;
      transform:translateX(0); transition:transform .24s ease,background .2s ease;
    }
    .keyboard-control-bar #sustain:checked { background:#c89b41; border-color:#e2b755; }
    .keyboard-control-bar #sustain:checked::after { transform:translateX(21px); background:#fff5db; }
    .keyboard-control-bar #sustain:focus-visible { outline:2px solid #ffdf89; outline-offset:3px; }
    .keyboard-control-bar .keyboard-volume {
      display:flex; flex:0 1 360px; align-items:center; gap:12px;
      min-width:0; min-height:32px; box-sizing:border-box;
      padding-left:18px; border-left:1px solid #455064;
    }
    .keyboard-volume label {
      display:inline-flex; flex:none; align-items:center; gap:8px;
      color:#edf2fb; font-size:.84rem; font-weight:700;
      white-space:nowrap; cursor:pointer;
    }
    .keyboard-volume svg { flex:none; color:#f1c875; }
    .keyboard-control-bar #volume {
      display:block; flex:1 1 160px; width:160px; min-width:0; max-width:220px;
      height:26px; margin:0; accent-color:#f1c875; color-scheme:dark; cursor:pointer;
    }
    .keyboard-control-bar #volume:focus-visible { outline:2px solid #ffdf89; outline-offset:3px; }
    @media(max-width:600px) {
      .studio .keyboard-control-bar { padding-inline:12px; gap:4px 12px; }
      .keyboard-control-bar .keyboard-volume { flex:1 1 230px; padding-left:12px; gap:8px; }
    }
    @media(max-height:850px) and (min-width:921px) {
      .studio .keyboard-control-bar { min-height:38px; padding-block:2px; }
    }
    @media(max-width:440px) {
      .keyboard-control-bar .keyboard-volume { flex-basis:100%; padding-left:0; border-left:0; }
    }
    @media(prefers-reduced-motion:reduce) { .keyboard-control-bar #sustain,.keyboard-control-bar #sustain::after { transition:none; } }
  
/* Local display preference; the disclosure never takes space from the keyboard. */
.studio .keyboard-control-bar { position:relative; z-index:5; overflow:visible; }
.keyboard-control-bar .note-names-disclosure {
  position:relative; display:flex; align-items:stretch; flex:none; min-width:0; padding-left:18px; border-left:1px solid #455064;
}
.note-names-disclosure #noteNamesToggle {
  display:flex; align-items:center; gap:8px; min-height:32px; padding:0 0 0 12px;
  border:1px solid #e8c471; border-radius:10px; background:linear-gradient(#263143,#182130);
  color:#f1c875; font-family:inherit; font-size:.84rem; font-weight:800; white-space:nowrap; cursor:pointer; box-sizing:border-box;
}
.note-names-disclosure #noteNamesToggle svg,
.note-names-disclosure #noteNamesSettings svg { flex:none; color:inherit; }
.note-names-combined-arrow { width:34px; flex:none; display:grid; place-items:center; }
.note-names-disclosure #noteNamesToggle[aria-pressed="true"] { color:#162032; background:linear-gradient(#ffe2a2,#ecc16d); border-radius:10px 0 0 10px; padding-right:8px; }
.note-names-disclosure #noteNamesToggle[aria-pressed="true"] .note-names-combined-arrow { display:none; }
.note-names-disclosure #noteNamesSettings {
  display:grid; place-items:center; flex:none; width:34px; min-height:32px; padding:0;
  box-sizing:border-box; border:1px solid #e8c471; border-left:1px solid #aa8038;
  border-radius:0 10px 10px 0; color:#162032; background:linear-gradient(#ffe2a2,#ecc16d); cursor:pointer;
}
.note-names-disclosure #noteNamesSettings[hidden] { display:none!important; }
.note-names-disclosure #noteNamesSettings[aria-expanded="true"] .note-names-chevron { transform:rotate(180deg); }
.note-names-disclosure #noteNamesToggle:focus-visible,
.note-names-disclosure #noteNamesSettings:focus-visible,
.note-names-popup input:focus-visible { outline:2px solid #ffdf89; outline-offset:3px; }
.note-names-popup[hidden],
.note-names-popup [hidden] { display:none!important; }
.note-names-popup {
  position:absolute; z-index:6; top:calc(100% + 6px); left:0;
  width:min(280px,calc(100vw / var(--studio-fit) - 24px)); box-sizing:border-box;
  max-height:calc(40dvh / var(--studio-fit)); overflow-y:auto; overscroll-behavior:contain;
  padding:12px; border:1px solid #c99935; border-radius:12px;
  background:linear-gradient(#202a39,#131c2b); color:#edf2fb; box-shadow:0 8px 24px #05080fc7;
  font-size:.83rem; line-height:1.35; text-align:left;
}
.note-names-disclosure[data-placement="above"] .note-names-popup { top:auto; bottom:calc(100% + 6px); }
.note-names-popup strong { display:block; font-size:.9rem; }
.note-names-popup p { color:#a5b0c3; margin:4px 0 10px; font-size:.76rem; }
.note-names-popup fieldset { border:0; min-width:0; padding:0; margin:0; }
.note-names-popup .note-names-options { display:grid; gap:4px; padding-top:8px; border-top:1px solid #455064; }
.note-names-options label {
  display:flex; align-items:center; gap:10px; min-height:32px; padding:4px 8px;
  border:1px solid transparent; border-radius:8px; font-weight:700; cursor:pointer;
}
.note-names-options label:has(input:checked) { border-color:#c99935; background:#f1c87520; }
.note-names-options input { margin:0; accent-color:#f1c875; width:16px; height:16px; flex:none; }
.note-names-popup .note-spelling-options { margin-top:12px; }
.note-spelling-options legend { padding:0 0 6px; font-size:.76rem; font-weight:700; }
.note-spelling-toggle { display:flex; border:1px solid #455064; border-radius:999px; padding:2px; gap:2px; }
.note-spelling-toggle label { flex:1; position:relative; cursor:pointer; min-width:0; }
.note-spelling-toggle input { position:absolute; width:1px; height:1px; opacity:0; }
.note-spelling-toggle span { display:block; text-align:center; padding:6px 4px; border-radius:999px; font-weight:700; }
.note-spelling-toggle input:checked + span { background:linear-gradient(#ffe2a2,#ecc16d); color:#162032; }
.note-spelling-toggle input:focus-visible + span { outline:2px solid #ffdf89; outline-offset:2px; }
/* Octave numbering is independent of C-only/all and enharmonic spelling. */
.note-names-popup .note-octave-options { margin-top:12px; padding-top:5px; border-top:1px solid #455064; display:grid; gap:4px; }
.note-octave-options legend { padding:0 6px 0 0; font-size:.76rem; font-weight:700; }
.note-octave-options label { display:flex; align-items:center; gap:8px; min-height:32px; padding:4px 8px; border:1px solid transparent; border-radius:8px; font-weight:700; cursor:pointer; }
.note-octave-options label:has(input:checked) { border-color:#c99935; background:#f1c87520; }
.note-octave-options input { margin:0; accent-color:#f1c875; width:16px; height:16px; flex:none; }
.note-octave-preview { display:grid; gap:2px; padding:8px 10px; margin-top:4px; background:#101824; border-radius:8px; color:#b7c6db; font-size:.76rem; }
.note-octave-preview output { color:#f4cc80; font-size:1rem; font-weight:800; font-variant-numeric:tabular-nums; }
/* Scale labels to the existing key widths, not the number of labels.
   Labels remain presentation-only and never intercept a key gesture. */
.studio .keyboard .key-name { pointer-events:none; white-space:nowrap; }
.studio .keyboard .key-name[hidden] { display:none!important; }
.studio .keyboard .white-key .key-name { font-size:clamp(6px,calc(1.05vw / var(--studio-fit)),12px); }
.studio .keyboard .black-key .key-name { display:block; font-size:clamp(5px,calc(.72vw / var(--studio-fit)),10px); color:#dce0e9; }
.studio .keyboard.keys-61 .black-key .key-name { font-size:clamp(6px,calc(1.05vw / var(--studio-fit)),11px); }
@media(max-width:600px) {
  .keyboard-control-bar .note-names-disclosure { padding-left:12px; }
}
@media(max-width:440px) {
  .keyboard-control-bar .note-names-disclosure { padding-left:0; border-left:0; }
}
