/* Tool-local workspace; no root or shared theme changes. */
:root{--ink:#3f2923;--paper:#f7eee5;--card:#fffdf8;--wash:#f0e1d4;--line:#ddc7b8;--muted:#756052;--sage:#9c4a33;--cinnabar:#b4442c;--cinnabar-dark:#8c3523;--gold:#b28c45;--sans:system-ui,-apple-system,'PingFang SC',sans-serif;--maxw:none}
[hidden]{display:none!important}
body{padding:max(10px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));max-width:none;min-height:100svh;font-size:14px;line-height:1.4}
button,select,input{font:inherit}button,select{min-height:40px}button{cursor:pointer}button:focus-visible,select:focus-visible,input:focus-visible,[tabindex]:focus-visible,[contenteditable]:focus-visible{outline:3px solid #245f9a;outline-offset:3px}
button[aria-pressed=true]{background:#f2d6c5;border-color:#ab5d42;color:#713e2b}
.site-head{display:flex;gap:12px;align-items:center;margin:0 0 10px;padding:0 0 10px;border-bottom:1px solid var(--line)}
.site-head .sealmark{width:40px;height:40px;min-width:40px;border-radius:11px;font:24px var(--sans);background:#b4442c;display:grid;place-items:center}
.site-head .titles{flex:1}.site-head h1{font-family:var(--sans);font-size:24px;line-height:1.15;letter-spacing:-.7px}.site-head .sub,.site-head .motto,.site-head .histlink{display:none}
.workspace-tagline{font-size:12px;color:var(--muted);margin-top:3px}.head-actions{display:flex;flex-direction:row;gap:10px;align-items:center}.langswitch button{min-width:42px;padding:7px 10px}
.sr-main,body.sr-touch .sr-main{display:flex;flex-direction:column;gap:10px;margin:0;max-width:none}
main section{margin:0}h2,h3{font-family:var(--sans);letter-spacing:0}.card{border:1px solid var(--line);border-radius:14px;padding:12px 14px;margin:0;background:var(--card);box-shadow:0 2px 6px #713e2b05}
.section-kicker{font-size:10px;letter-spacing:1.4px;font-weight:700;color:#8a634d;display:flex;align-items:center;justify-content:space-between;gap:10px}.sr-soundstatus{font-size:11px;letter-spacing:0;font-weight:400;margin:0}.sr-soundstatus.warn{color:var(--muted)}
.sr-settings{order:0!important}.sr-controls{display:grid;grid-template-columns:minmax(150px,1.3fr) minmax(218px,1.3fr) minmax(155px,1.2fr) minmax(155px,1.3fr) minmax(100px,.75fr);gap:8px 14px;margin:7px 0}
.sr-controls label{font-size:12px;gap:3px;min-width:0}.sr-controls select,body.sr-touch .sr-controls select{min-width:0;width:100%;font-size:14px}.sr-rootgroup select{width:68px!important;flex:1}.sr-rootgroup button{padding:4px 8px;min-width:38px}.sr-controls input[type=range]{width:100%;min-height:38px;margin:0}
.keyboard-settings{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid #edddd0;padding-top:7px}.sr-modebar{margin:0;gap:8px}.sr-modeswitch button{min-height:34px;padding:5px 10px}.sr-modebar>.note:first-child,#modeNote{font-size:11px}.keyboard-settings>button{min-height:34px;padding:4px 10px;font-size:12px}
#secPlay,body.sr-touch #secPlay{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,29%);gap:12px;order:1;min-height:0}
#playPanel{display:flex;flex-direction:column;gap:10px;min-width:0}.ladder-card h3,.sr-keycard h3{font-size:14px;margin:0}.ladder-card>p.note{display:none}.sr-ladder{flex-wrap:nowrap;gap:3px;margin-top:8px;align-items:stretch}.sr-step,body.sr-touch .sr-ladder .sr-step{min-width:0;padding:7px 0 5px}.sr-step .sr-jp,body.sr-touch .sr-ladder .sr-step .sr-jp{font-size:19px}.sr-step .sr-name,body.sr-touch .sr-ladder .sr-step .sr-name{display:block;font-size:10px}.sr-step.tonic:not(.on),.sr-key.tonic:not(.on),.sr-tkey.tonic:not(.on){background:#f7e7c4;border-color:#c6a86b}.sr-step.marked::after{font-size:8px}
.sr-keycard{flex:1;min-width:0;overflow:visible}.keyboard-heading{display:flex;align-items:center;justify-content:space-between}.keyboard-heading button{font-size:12px;min-height:30px;padding:3px 9px}.sr-keycard>p.note{font-size:11px;margin:4px 0 7px}.sr-kbrow,body.sr-touch .sr-kbrow{display:grid;grid-template-columns:minmax(0,1fr);gap:5px}.sr-kbrow>div:first-child,body.sr-touch .sr-kbrow>div:first-child{width:100%;min-width:0;overflow-x:auto;padding:3px}
.sr-keyboard{width:100%;min-width:560px;gap:5px;margin-top:0}.sr-row{gap:5px}.sr-key{flex:1;width:auto;min-width:0;height:clamp(45px,7.5vh,66px);font-size:19px}.sr-key .sr-letter{font-size:11px}.sr-key .sr-name{font-size:10px}.sr-shifts{margin-top:7px;gap:6px}.sr-shift,body.sr-touch .sr-shift{min-height:32px;padding:4px 12px;font-size:12px;border-style:solid;background:var(--card)}
.sr-touchgrid{gap:5px;margin:0}.sr-trow{gap:5px}.sr-tkey,body.sr-touch .sr-tkey{height:clamp(46px,8vh,70px);min-width:30px}.sr-tkey .sr-jp,body.sr-touch .sr-tkey .sr-jp{font-size:24px}.sr-staffbox,body.sr-touch .sr-staffbox{display:flex;align-items:center;gap:8px;margin:0;min-width:0;max-height:88px;overflow:hidden}.sr-staffbox>.note{font-size:11px;width:80px}.sr-staff{height:86px;width:190px;margin:0}
#notebook{display:flex;flex-direction:column;min-height:0;gap:8px;background:#fcf3e9}.notebook-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.notebook-heading h2{font-size:20px;line-height:1.2;margin:3px 0 0;letter-spacing:-.6px}.count{border:1px solid var(--line);background:white;border-radius:50%;width:30px;height:30px;display:grid;place-items:center;font-size:12px}.note{font-size:12px}.live-phrase{background:white;border:1px solid var(--line);padding:9px;border-radius:10px}.live-heading{display:flex;justify-content:space-between;gap:6px;align-items:center;font-size:11px}.live-heading span:last-child{font-size:10px;text-align:right;max-width:55%;color:var(--muted)}
.sr-roll{height:80px;margin-top:6px}.sr-trace{font-size:20px;letter-spacing:3px;min-height:32px;max-height:55px;overflow:auto;padding:4px 0;margin:2px 0 6px}.sr-trace.empty{font-size:12px}.notebook-actions{display:flex;gap:5px}.notebook-actions button{font-size:11px;min-height:36px;padding:5px 8px;flex:1;white-space:nowrap}.saved-heading{display:flex;align-items:center;justify-content:space-between}.saved-heading h3{font-size:12px}.saved-heading button{font-size:11px;min-height:32px;padding:4px 8px}
.tk-strip{flex:1;display:flex;flex-direction:column;gap:7px;overflow:auto;min-height:75px;max-height:220px;padding:3px;scroll-snap-type:y proximity}.tk-card,body.sr-touch .tk-card{flex:0 0 auto;display:grid;grid-template-columns:60px minmax(0,1fr);gap:4px 8px;padding:8px;border-radius:9px;background:white}.tk-card .tk-roll{height:47px;grid-column:1;grid-row:1/3}.tk-meta{grid-column:2}.tk-title{font:13px var(--sans);min-height:22px}.tk-sub{font-size:10px}.tk-actions{grid-column:2;gap:5px}.tk-actions button{min-height:30px;font-size:11px;padding:3px 9px}.tk-actions .tk-play{min-width:38px}.tk-empty{font-size:12px}.notebook-foot{font-size:10px;margin-top:auto;line-height:1.5}
.panel-tabs{display:none}
dialog{color:var(--ink);background:var(--card);border:1px solid var(--line);border-radius:16px;padding:20px;box-shadow:0 16px 70px #173a332f}dialog::backdrop{background:#3f292360}#settingsDrawer{margin:0 0 0 auto;inset:0 0 0 auto;width:min(440px,100%);max-width:100%;height:100dvh;max-height:100dvh;border-radius:16px 0 0 16px;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) 16px;overflow:auto}.drawer-heading{position:sticky;top:-16px;z-index:2;background:var(--card);padding:8px 0 12px;display:flex;gap:10px;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);margin-bottom:14px}.drawer-heading h2{font-size:19px}.drawer-heading button{padding:6px 12px}dialog section{margin:0 0 22px}dialog h3{font-size:16px}dialog .sr-toggles{gap:7px}dialog .card{padding:10px}dialog .cardgrid{display:flex;flex-direction:column}dialog .sr-filebtn{display:block;max-width:100%;padding:8px}dialog .sr-filebtn input{display:block;max-width:100%;font-size:12px;margin-top:7px}dialog .whybox{flex-wrap:wrap}dialog .whybox input{max-width:100%}dialog .sr-mediaform input{min-width:0;max-width:100%}dialog .site-foot{margin-top:18px;padding:10px 0;font-size:11px}#shareDialog{width:min(440px,calc(100% - 24px));margin:auto}#shareDialog p{margin:14px 0}#shareURL{width:100%;font-size:14px;margin:7px 0 12px}#shareDialog label{font-size:12px}
@media(min-width:900px) and (min-height:650px){#secPlay{min-height:calc(100dvh - 255px)}.tk-strip{max-height:calc(100dvh - 550px)} }
@media(pointer:coarse){button,select,.sr-modeswitch button,.keyboard-settings>button{min-height:44px}.sr-controls select,body.sr-touch .sr-controls select{font-size:16px}.notebook-actions button,.saved-heading button,.tk-actions button{min-height:40px}.sr-key,.sr-tkey{min-height:44px}}
@media(max-width:1050px){body{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}.sr-controls{gap:7px;grid-template-columns:1.1fr 200px 1.1fr 1.1fr 90px}.card{padding:10px}.sr-rootgroup button{padding:4px 6px;min-width:33px}.sr-modebar>#modeNote{display:none}.sr-keyboard{min-width:540px}.sr-row{gap:3px}.sr-staff{height:74px}.sr-staffbox,body.sr-touch .sr-staffbox{max-height:76px}.notebook-heading h2{font-size:18px}}
@media(max-width:899px){.sr-controls{grid-template-columns:1fr 1.4fr 1fr}.sr-controls label:nth-child(4){grid-column:1/3}.sr-controls label:nth-child(5){grid-column:3}.panel-tabs{display:flex;gap:6px}.panel-tabs button{flex:1}.sr-main{gap:8px}#secPlay,body.sr-touch #secPlay{display:block}#notebook{display:none}body[data-panel=notebook] #notebook{display:flex}body[data-panel=notebook] #playPanel{display:none}.tk-strip{max-height:40vh;min-height:130px}.sr-keyboard{min-width:560px}.sr-staffbox,body.sr-touch .sr-staffbox{display:none}#settingsDrawer .sr-staffbox{display:block}.sr-keycard .sr-staffbox[hidden]{display:none}.site-head{margin-bottom:8px}.sr-tkey,body.sr-touch .sr-tkey{height:clamp(44px,8vh,66px)}}
@media(max-width:540px){body{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}.site-head{gap:7px}.site-head h1{font-size:20px}.site-head .sealmark{display:none}.head-actions{gap:5px}.head-actions button{font-size:12px;padding:6px 8px}.workspace-tagline{font-size:10px;max-width:160px}.sr-controls{grid-template-columns:1fr 1.6fr}.sr-controls label:nth-child(3){grid-column:1}.sr-controls label:nth-child(4){grid-column:2}.sr-controls label:nth-child(5){display:flex;flex-direction:row;align-items:center;grid-column:1/-1;gap:15px}.sr-controls label:nth-child(5) input{min-height:24px}.sr-modebar>.note:first-child{display:none}.sr-modeswitch button{font-size:12px;padding:4px 8px}.keyboard-settings>button{font-size:11px;padding:4px 6px}.section-kicker{font-size:9px;letter-spacing:1px}.sr-soundstatus{font-size:9px}.sr-ladder{overflow:auto;padding-bottom:3px}.sr-step,body.sr-touch .sr-ladder .sr-step{min-width:25px}.sr-step .sr-name,body.sr-touch .sr-ladder .sr-step .sr-name{font-size:8px}.sr-step .sr-jp,body.sr-touch .sr-ladder .sr-step .sr-jp{font-size:17px}.sr-keycard>p.note{font-size:10px}.sr-shift,body.sr-touch .sr-shift{font-size:11px;min-height:36px;padding:4px 8px}.notebook-heading h2{font-size:21px}.sr-touchgrid,.sr-trow{gap:4px}.sr-tkey,body.sr-touch .sr-tkey{min-width:25px}.sr-tkey .sr-jp,body.sr-touch .sr-tkey .sr-jp{font-size:22px}}
/* Content may grow at browser/text zoom; only the notebook list and dialogs
   scroll internally. Never lock the body or clip enlarged text. */
.sr-main,body.sr-touch .sr-main{align-items:stretch}
.site-head .titles{min-width:0}.workspace-tagline,.sr-main p{margin-bottom:0}
.site-head .head-actions{width:auto;flex-shrink:0}
.site-head{padding-bottom:8px;margin-bottom:8px;flex-wrap:nowrap}
.sr-controls{margin:5px 0}.sr-settings .section-kicker{line-height:1.2}
.sr-key{height:clamp(44px,6.3vh,60px)}
.sr-tkey,body.sr-touch .sr-tkey{height:clamp(44px,6.8vh,64px)}
.sr-staffbox,body.sr-touch .sr-staffbox{max-height:64px}.sr-staff{height:64px}
.notebook-heading h2{border-bottom:0;padding-bottom:0}
#settingsDrawer .sr-staffbox{display:flex;max-height:none;overflow:visible}#settingsDrawer .sr-staff{width:230px;height:176px}
#settingsDrawer section{scroll-margin-top:80px}
.reflection-entry{border-bottom:1px solid var(--line);padding:10px 0}
.sr-keycard .keyboard-heading button{min-height:36px}
#keyPaging{display:flex;gap:4px;margin-left:6px}#keyPaging button{min-width:40px;padding:4px 8px}.keyboard-heading #playFocus{margin-left:auto}
.sr-touchgrid{min-width:max-content}.sr-tkey,body.sr-touch .sr-tkey{min-width:44px}
.notebook-actions button{font-size:13px;padding:5px 6px}.tk-actions button{font-size:12px}
@media(pointer:coarse){.sr-keycard .keyboard-heading button,.sr-shift,body.sr-touch .sr-shift{min-height:44px}}
@media(max-width:899px){.sr-staffbox,body.sr-touch .sr-staffbox{display:none}}
@media(max-width:540px){.sr-tkey,body.sr-touch .sr-tkey{height:clamp(44px,6vh,52px)}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* Revision 2: one aligned control baseline; device selection stays internal. */
.sr-controls{grid-template-columns:minmax(150px,1.25fr) minmax(190px,1fr) minmax(180px,1.3fr) minmax(140px,1fr) minmax(92px,.65fr);gap:14px;align-items:end;margin:9px 0 7px}
.sr-controls label{display:grid;grid-template-rows:auto 44px;align-items:end;gap:5px;font-size:12px;line-height:1.2}
.sr-controls select,body.sr-touch .sr-controls select,.sr-rootgroup button{height:44px;min-height:44px;max-height:44px;padding-top:0;padding-bottom:0;line-height:normal;font-size:14px}
.sr-rootgroup{display:grid;grid-template-columns:44px minmax(64px,1fr) 44px;gap:5px;align-items:stretch;height:44px}
.sr-rootgroup select{width:100%!important;margin:0}.sr-rootgroup button{padding:0 5px;min-width:44px}
.pitch-shift{display:inline-flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap}.pitch-shift svg{width:17px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}.pitch-shift span{font-size:12px}.sr-rootgroup .pitch-shift{gap:2px}.sr-rootgroup .pitch-shift svg{width:15px}
.sr-controls input[type=range]{display:block;height:44px;min-height:44px;align-self:center;margin:0;max-width:100%}
.instrument-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px}.instrument-footer #registerRange{font-size:11px;color:var(--muted);line-height:1.4}.instrument-footer button{min-height:36px;padding:4px 14px;font-size:12px}
.preferred-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}.preferred-controls label{display:grid;gap:5px;font-size:12px}.preferred-controls select{width:100%;min-height:44px;font-size:16px}.preferred-controls button{grid-column:1/-1}#registerSettings p{margin-top:10px}
@media(min-width:900px) and (min-height:650px){#secPlay,body.sr-touch #secPlay{height:calc(100dvh - 270px);min-height:0}#notebook .tk-strip{flex:1 1 0;min-height:75px;max-height:none}#playPanel{min-height:0}}
@media(pointer:coarse){.sr-controls select,body.sr-touch .sr-controls select{font-size:16px}.instrument-footer button{min-height:44px}}
@media(max-width:1050px){.sr-controls{grid-template-columns:minmax(140px,1.1fr) 165px minmax(165px,1.2fr) minmax(135px,1fr) 85px;gap:9px}}
@media(max-width:899px){.sr-controls{grid-template-columns:1fr 1.4fr 1fr}.sr-controls label:nth-child(4){grid-column:1/3}.sr-controls label:nth-child(5){grid-column:3}}
@media(max-width:540px){.sr-controls{grid-template-columns:minmax(0,1fr) minmax(160px,1.25fr);gap:9px}.sr-controls label:nth-child(3){grid-column:1}.sr-controls label:nth-child(4){grid-column:2}.sr-controls label:nth-child(5){display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:32px;align-items:center;grid-column:1/-1;gap:14px}.sr-controls label:nth-child(5) input{height:32px;min-height:32px}.sr-rootgroup{grid-template-columns:44px minmax(58px,1fr) 44px}.sr-controls select,body.sr-touch .sr-controls select{font-size:14px}.instrument-footer{gap:5px}.instrument-footer button{padding:4px 10px}}

/* Live staff stays next to the instrument. Small portrait stacks it below keys. */
.keyboard-heading{gap:7px}.keyboard-heading h3{margin-right:auto}
.keyboard-heading #playFocus{margin-left:0}.keyboard-heading #showStaff{min-height:36px;padding:4px 10px}
.sr-kbrow:has(#staffbox:not([hidden])),body.sr-touch .sr-kbrow:has(#staffbox:not([hidden])){grid-template-columns:minmax(0,1fr) 230px;gap:12px;align-items:center}
#staffbox,body.sr-touch #staffbox{display:flex;flex-direction:column;align-items:center;gap:8px;max-height:none;overflow:visible;width:230px;padding-left:10px;border-left:1px solid var(--line)}
#staffbox>.note{width:auto;font-size:12px;text-align:center}#staffbox #staff{width:220px;max-width:100%;height:176px;margin:0}
@media(pointer:coarse){.keyboard-heading #showStaff{min-height:44px}}
@media(max-width:599px){.keyboard-heading{flex-wrap:wrap}.keyboard-heading h3{flex:1 0 100%}.keyboard-heading #showStaff{margin-right:auto}.sr-kbrow:has(#staffbox:not([hidden])),body.sr-touch .sr-kbrow:has(#staffbox:not([hidden])){grid-template-columns:minmax(0,1fr)}#staffbox,body.sr-touch #staffbox{width:100%;padding:10px 0 0;border-left:0;border-top:1px solid var(--line)}#staffbox #staff{width:230px}}

/* Keep repeated clicks/taps in the same place when paging becomes necessary. */
.keyboard-heading #keyPaging[hidden]{display:flex!important;visibility:hidden;pointer-events:none}
.keyboard-heading #playFocus{width:126px;min-width:126px;white-space:nowrap}
.keyboard-heading #playFocus.keyboard-ready{background:#f2d6c5;border-color:#ab5d42;color:#713e2b}
#staffbox #staff{height:var(--staff-height,176px);max-height:220px}
#staffbox .staff-caption{font-size:11px;line-height:1.35}
#staff .st-faint{opacity:.65}#staff .st-note{stroke-width:1.2}
#staff .st-pitch-label{font:10px var(--sans);fill:var(--muted);text-anchor:middle}
#staff .st-acc{font-size:10px}
@media(max-width:599px){.keyboard-heading #showStaff{margin-right:0}.keyboard-heading #keyPaging{margin-left:auto}.keyboard-heading #playFocus{width:126px;min-width:126px}}

/* R7: keep every key label dark. The complete palette changes atomically;
   animating only the background left white text on beige between frames.
   Scope outranks shared tonic/on/solfege rules without altering other tools. */
#workspace :is(.sr-key,.sr-tkey,.sr-step,.sr-shift){
 --sr-key-bg:#fffdf8;--sr-key-border:#ddc7b8;
 background:var(--sr-key-bg);border-color:var(--sr-key-border);color:#3f2923;
 transition:transform .06s;
}
#workspace .sr-step{--sr-key-bg:#f7eee5}
#workspace :is(.sr-key,.sr-tkey,.sr-step).tonic{--sr-key-bg:#f7e7c4;--sr-key-border:#c6a86b}
#workspace :is(.sr-key,.sr-tkey,.sr-step,.sr-shift).on{
 --sr-key-bg:#f2cdb5;--sr-key-border:#8c3523;
 box-shadow:inset 0 0 0 1px #8c3523;
}
#workspace :is(.sr-key,.sr-tkey,.sr-step,.sr-shift)>span{color:#3f2923;transition:none}
#workspace :is(.sr-key,.sr-tkey,.sr-step) :is(.sr-letter,.sr-name){color:#6c5143}
#workspace :is(.sr-key,.sr-tkey) .sr-sf{color:#8c3523}
#workspace :is(.sr-key,.sr-tkey,.sr-step).marked::after{color:#3f2923;transition:none}
#staff text.st-acc{fill:#6c5143;opacity:1}

/* R6: devote width to the complete keyboard; compact supporting displays. */
#workspaceSide{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0}
#workspaceSide>#notebook{flex:1;min-height:0}
#keyViewport,body.sr-touch #keyViewport{overflow:visible;min-width:0}
.sr-keyboard{min-width:0;width:100%}
.sr-row{gap:4px}.sr-key{min-width:36px}
.sr-touchgrid{min-width:0;width:100%}.sr-trow{gap:2px}.sr-tkey,body.sr-touch .sr-tkey{flex:1;min-width:44px}
@media(min-width:1200px){
 #secPlay,body.sr-touch #secPlay{grid-template-columns:minmax(0,1fr) minmax(240px,24%)}
 .sr-kbrow:has(#staffbox:not([hidden])),body.sr-touch .sr-kbrow:has(#staffbox:not([hidden])){grid-template-columns:minmax(0,1fr) 200px;gap:10px}
 #staffbox,body.sr-touch #staffbox{width:200px}#staffbox #staff{width:190px}
}
@media(min-width:900px) and (max-width:1199px){
 #secPlay,body.sr-touch #secPlay{grid-template-columns:minmax(0,1fr) 240px;gap:10px}
 .sr-kbrow,body.sr-touch .sr-kbrow{grid-template-columns:minmax(0,1fr)}
 #workspaceSide>#staffbox{width:100%;border:1px solid var(--line);border-radius:14px;padding:7px;background:var(--card);gap:3px;flex:0 0 auto}
 #workspaceSide>#staffbox #staff{width:220px;height:156px;max-height:156px}
 #notebook{padding:9px;gap:5px}#notebook .section-kicker{display:none}#notebook .notebook-heading h2{font-size:18px;margin:0}
 #notebook .count{width:24px;height:24px}#notebook #storageNote{font-size:10px;margin:0;line-height:1.3}
 #notebook .live-phrase{padding:6px}#notebook #roll{display:none}#notebook .sr-trace{font-size:16px;min-height:20px;max-height:24px;line-height:1.2;margin:2px 0 4px;padding:0}
 #notebook .live-heading{font-size:10px}#notebook .live-heading span:last-child{font-size:9px}
 #notebook .notebook-actions button{font-size:11px;min-height:36px;padding:3px}
 #notebook .saved-heading button{min-height:30px}#notebook .tk-strip{min-height:60px;padding:2px}
 #notebook .tk-card{padding:5px;gap:3px 5px;grid-template-columns:44px minmax(0,1fr)}#notebook .tk-card .tk-roll{height:40px}
 #notebook .tk-actions{gap:3px}#notebook .tk-actions button{font-size:11px;min-height:28px;padding:2px 5px}#notebook .tk-title{font-size:12px}
 #notebook .notebook-foot{font-size:9px;line-height:1.3;margin:0}
}
@media(max-width:899px){
 #workspaceSide{display:block}
 .ladder-card:has(#staffbox:not([hidden])){display:grid;grid-template-columns:minmax(0,1fr) 230px;column-gap:10px;align-items:center}
 .ladder-card>h3,.ladder-card>#ladder,.ladder-card>#markNote{grid-column:1}
 .ladder-card>#staffbox{grid-column:2;grid-row:1/5;width:230px}
 .sr-kbrow,body.sr-touch .sr-kbrow{grid-template-columns:minmax(0,1fr)}
 .sr-ladder{flex-wrap:wrap;overflow:visible}.sr-step,body.sr-touch .sr-ladder .sr-step{flex:1 0 30px;min-width:30px}
}
@media(max-width:659px){
 .ladder-card:has(#staffbox:not([hidden])){display:block}.ladder-card>#staffbox{width:100%;margin-top:10px}
 .sr-row{flex-wrap:wrap;padding-left:0!important;gap:4px}.sr-key{flex:1 1 44px;min-width:44px}
 .sr-trow{flex-wrap:wrap}.sr-tkey,body.sr-touch .sr-tkey{flex:1 1 44px;min-width:44px}
}

/* Actual selected sound-bank readiness; no synthetic download percentage. */
.sr-sound-loading{position:relative;display:inline-flex;align-items:center;min-width:0;max-width:65%;letter-spacing:0}
.sr-sound-loading progress{position:absolute;bottom:-4px;left:0;width:100%;min-width:44px;height:3px;accent-color:var(--cinnabar)}
#retrySound{min-height:36px;font-size:12px;padding:4px 9px;margin-left:auto;white-space:nowrap}
@media(pointer:coarse){#retrySound{min-height:44px}}

/* Keep Close outside the scrollable fields while a software keyboard is open. */
#settingsDrawer{position:fixed;inset:auto;left:calc(var(--drawer-left,0px) + var(--drawer-width,100vw));top:var(--drawer-top,0px);transform:translateX(-100%);margin:0;width:min(440px,var(--drawer-width,100vw));max-width:var(--drawer-width,100vw);height:var(--drawer-height,100dvh);max-height:var(--drawer-height,100dvh);padding:0;overflow:hidden}
#settingsDrawer[open]{display:flex;flex-direction:column}
#settingsDrawer>.drawer-heading{position:static;flex:0 0 auto;margin:0;padding:max(8px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left))}
#settingsDrawer>.drawer-heading h2{margin:0;min-width:0}
#closeSettings{flex-shrink:0;min-height:44px}
#settingsDrawer>.drawer-scroll{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:16px max(16px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));scroll-padding:8px}
#settingsDrawer section{scroll-margin-top:8px}
#settingsDrawer input:is([type=text],[type=url]){font-size:16px}
