/* Shared interface picker is the only A addition. Presentation rules stay scoped to B. */
#interfaceChoice{border:1px solid #b9cbbf;border-radius:9px;margin:0 0 14px;padding:9px;background:#f8faf4}
#interfaceChoice legend{font-size:13px;font-weight:650;color:#294d46;padding:0 5px}
#interfaceChoice>div{display:flex;gap:5px}
#interfaceChoice button{flex:1;min-width:44px;min-height:44px;font-size:12px;padding:6px}
#interfaceChoice button[aria-pressed=true]{background:#254d45;color:white;border-color:#254d45}
#interfaceChoice p{font-size:11px;line-height:1.45;color:#53675d;margin:8px 0 0}
body.interface-b{position:fixed;inset:0;width:100%;min-height:0;background:#f4f2ec;height:var(--b-viewport-height,100dvh);overflow:hidden;overscroll-behavior:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
body.interface-b>header{display:flex!important;min-height:56px;padding:6px 12px;gap:8px;flex-wrap:nowrap}
.interface-b h1{font-size:19px;white-space:nowrap}
.interface-b h1>span:not(#bBadge),.interface-b .eyebrow{display:none}
#bBadge{display:inline-grid;place-items:center;margin-left:9px;width:24px;height:24px;border-radius:7px;background:#dce9e2;color:#254d45;font-size:12px;vertical-align:middle}
.interface-b .head-actions{gap:6px;flex-wrap:nowrap}
.interface-b #languageSwitch button{min-width:44px;min-height:44px;padding:5px;font-size:11px}
.interface-b #home{display:flex!important;min-height:44px;padding:6px 10px;white-space:nowrap;font-size:12px}
.interface-b .workspace-menu>summary{padding:8px;min-width:44px}
.interface-b .workspace-menu>summary svg{display:none}
body.interface-b>main{flex:1 1 0;min-width:0;padding:0 8px 8px;min-height:0;overflow:hidden}
body.interface-b .instrument,body.interface-b[data-handedness=left] .instrument{display:grid;grid-template-columns:78px minmax(0,1fr) 78px;grid-template-rows:auto auto auto minmax(0,1fr);min-height:0;overflow:hidden;border:1px solid #b8c8be;border-radius:14px}
body.interface-b .palette-top,body.interface-b[data-handedness=left] .palette-top{grid-column:1/-1;grid-row:1}
body.interface-b #paletteViewport,body.interface-b[data-handedness=left] #paletteViewport{grid-column:1/-1;grid-row:2}
body.interface-b .canvas-tools,body.interface-b[data-handedness=left] .canvas-tools{grid-column:1/-1;grid-row:3}
body.interface-b #stage,body.interface-b[data-handedness=left] #stage{grid-column:2;grid-row:4}
#bGestureRail{grid-column:1;grid-row:4;min-height:0;display:flex;flex-direction:column;gap:9px;padding:5px;background:#e8eee4;border-right:1px solid #b8c8be;overflow:auto;overscroll-behavior:contain}
#bGestureRail p{margin:0;font-size:10px;line-height:1.3;text-align:center;color:#3f5d50}
.b-gesture-group{display:flex;flex-direction:column;gap:3px}
#bGestureRail button{min-width:44px;min-height:44px;width:100%;padding:4px;font-size:11px;line-height:1.2;touch-action:none;user-select:none;-webkit-user-select:none}
#bGestureRail .b-hold-tool{min-height:58px;background:#fff;border:1px solid #a7beb0;font-weight:650}
#bGestureRail .b-hold-tool[aria-pressed=true]{background:#254d45;color:#fff;box-shadow:inset 0 0 0 2px #d8e998}
#bGestureRail button[hidden]{display:none!important}
#bGestureRail :is(#strum,#path){background:#f6f8f1;border:1px solid #becbbf}
#bGestureRail :is(#strum,#path)[aria-pressed=true]{background:#254d45;color:#fff}
body.interface-b .palette-top{display:flex;flex:none;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 16px;padding:4px 8px;background:#f9faf6;min-height:52px}
body.interface-b .timbres{display:flex;gap:2px;flex-wrap:nowrap}
body.interface-b .timbres button{padding:5px 8px;min-height:44px;font-size:11px}
body.interface-b .palette-options{display:none}
.interface-b .octave-controls{display:flex;gap:4px;align-items:center}
.interface-b .octave-controls button{min-width:44px;min-height:44px}
.interface-b #visibleRange{min-width:58px;text-align:center;font-size:11px}
#bPaletteHelp{color:#536c61;font-size:11px;margin:0;white-space:nowrap}
body.interface-b #paletteViewport{display:block!important;flex:none;margin:0;padding:4px 0 6px;background:#10232a;overflow-x:auto;overflow-y:hidden;min-height:60px;touch-action:pan-x;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#7a9c99 #10232a}
body.interface-b #palette{display:flex;justify-content:flex-start;gap:2px;width:max-content!important;height:auto!important;min-height:50px;padding:0 8px;background:none;touch-action:pan-x}
body.interface-b #palette .piano-key{position:relative!important;left:auto!important;top:auto!important;bottom:auto;width:auto!important;flex:0 0 clamp(44px,calc((100vw - 32px)/13),68px);min-width:44px;height:48px!important;min-height:44px;padding:0;touch-action:pan-x;background:transparent;border:0;border-radius:7px}
body.interface-b #palette .piano-key[hidden]{display:none!important}
body.interface-b #palette .piano-key:hover{background:#ffffff17}
body.interface-b #palette .symbol{top:5px!important;bottom:auto!important;left:50%;width:36px;height:36px}
body.interface-b #palette .black-key .symbol{width:28px;height:28px;top:9px!important}
body.interface-b #palette .note-label{inset:0!important;height:48px!important;display:grid;place-items:center;font-size:10px}
body.interface-b #paletteViewport.piano-overlay .white-key{background:#e9eee6}
body.interface-b #paletteViewport.piano-overlay .black-key{background:#03070b;border:1px solid #82918b}
body.interface-b #paletteViewport.piano-overlay .white-key .note-label{color:#183e31}
body.interface-b .canvas-tools{display:flex;flex:none;flex-direction:row;padding:6px 8px;background:#f1f4ed;border-bottom:1px solid #becbc1;gap:8px;overflow:visible;min-height:58px}
#bEssentials{display:flex;flex:1;justify-content:center;gap:5px}
body.interface-b .canvas-tools #bEssentials button{display:flex;flex-direction:row;gap:5px;width:auto;min-width:74px;height:44px;padding:6px 10px;margin:0;border:1px solid #c3cec5;border-radius:8px}
body.interface-b .canvas-tools #bEssentials #draw{grid-column:auto}
body.interface-b .canvas-tools #draw:not([aria-pressed=true]){background:#fff;border-color:#c3cec5;color:#24303e}
body.interface-b .canvas-tools #canvasUndo{width:auto!important;font-size:12px}
body.interface-b .canvas-tools #canvasUndo::before{content:none}
.interface-b .canvas-tools .tool-label{font-size:12px}
.interface-b .canvas-tools button svg{width:18px;height:18px}
.interface-b .mode-tooltip,.interface-b #toolHint{display:none!important}
body.interface-b #stage{display:block;flex:1;min-height:0;width:100%;border:0;border-radius:0}
body.interface-b #modeHint{left:12px;bottom:12px;padding:8px 10px;max-width:calc(100% - 24px);border-radius:8px}
body.interface-b #modeHint strong{font-size:12px}
body.interface-b #stage[data-mode=erase]{box-shadow:inset 0 0 0 3px #d58a77}
body.interface-b #stage[data-mode=draw]{box-shadow:inset 0 0 0 3px #86bda5}
body.interface-b #viewNavigation{display:flex!important;position:absolute;top:auto;bottom:12px;right:12px;z-index:6}
.interface-b #viewNavigation button{min-width:44px;min-height:44px}
.interface-b #stage :is(.bell,.path-button)::before{content:'';position:absolute;min-width:var(--phone-hit-size,44px);min-height:var(--phone-hit-size,44px);width:100%;height:100%;left:50%;top:50%;transform:translate(-50%,-50%)}
#bSelectionTools{position:absolute;z-index:7;left:12px;top:12px;display:flex;align-items:center;gap:5px;padding:5px 7px;border-radius:10px;background:#f7f9f0;border:1px solid #b9ccbf;box-shadow:0 3px 15px #00141a24;color:#244b3c}
#bSelectionTools[hidden],#bSaveNotice[hidden]{display:none!important}
#bSelectionLabel{font-size:11px;margin-right:4px}
.interface-b .b-tool-buttons button{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:5px;min-width:44px;min-height:44px;padding:6px 9px;font-size:12px;border:1px solid #bfcfc3;border-radius:8px;background:#fff;color:#254d45}
.interface-b .b-tool-buttons button svg{width:19px;height:19px}
.interface-b .b-tool-buttons .tool-label{display:block;font-size:12px}
.interface-b .b-tool-buttons button[aria-pressed=true]{background:#254d45;color:white}
.interface-b .b-tool-buttons button[hidden]{display:none!important}
#bRecordRail{grid-column:3;grid-row:4;min-height:0;display:flex;flex-direction:column;gap:8px;padding:5px;background:#e8eee4;border-left:1px solid #b8c8be;overflow:auto;overscroll-behavior:contain}
#bRecordRail button{display:block;min-width:44px;min-height:52px;width:100%;padding:5px 3px;font-size:11px;line-height:1.3;white-space:normal;touch-action:manipulation}
#bRecordRail #record{background:#fff4f1;color:#762e34;border:1px solid #b56b70;font-weight:650}
#bRecordRail #record.active{background:#96343a;color:white;box-shadow:inset 0 0 0 2px #ffdbd3}
#bRecordHint{margin:0;font-size:10px;line-height:1.3;text-align:center;color:#3f5d50}
#bRecordRail[data-recording=true] #bRecordHint{color:#762e34;font-weight:650}
body.interface-b .workspace-panel{top:var(--settings-top,62px);right:max(8px,env(safe-area-inset-right));width:min(380px,calc(100vw - 16px));max-height:calc(var(--b-viewport-height,100dvh) - var(--settings-top,62px) - env(safe-area-inset-bottom) - 8px);border-radius:14px;z-index:40}
.interface-b .workspace-panel h2{font-size:13px;margin:12px 0 8px;color:#294d46}
#bExtraTools{display:flex;flex-wrap:wrap;gap:5px}
#bSoundOptions{padding-bottom:10px;border-bottom:1px solid #ccd7ce}
#bSoundOptions .palette-filter{display:flex;flex-wrap:wrap;margin:8px 0}
.interface-b #helpStart,.interface-b #canvasView{display:inline-flex;min-height:44px;margin:12px 5px 0 0}
.interface-b #paletteToggle{display:none!important}
.interface-b #soundReadiness{flex:none;font-size:11px;min-height:0;padding:5px 12px}
.interface-b #soundReadiness[hidden]{display:none}
.interface-b #empty h2{font-size:26px}
.interface-b #empty p{font-size:13px}
.interface-b .record-bar{display:none}
@media(max-width:700px){
 body.interface-b>header{flex-wrap:wrap;min-height:54px;padding:4px 8px;gap:0 8px}
 .interface-b h1{font-size:16px}.interface-b .head-actions{flex:1;justify-content:flex-end;gap:3px}
 .interface-b #languageSwitch button{font-size:10px;min-width:44px}
 .interface-b #home{font-size:11px;padding:4px 7px}
 body.interface-b>main{padding:0 4px 4px}
 body.interface-b .palette-top{gap:0 4px;padding:2px 5px;justify-content:space-between}
 body.interface-b .timbres{width:100%;justify-content:space-between}body.interface-b .timbres button{flex:1 1 0;min-width:44px;padding:4px;font-size:10px}
 .interface-b #bPaletteHelp{display:none}
 body.interface-b #palette{gap:2px}
 body.interface-b #palette .piano-key{min-width:44px;height:44px!important}
 body.interface-b #paletteViewport{padding:3px 0;min-height:0}
 body.interface-b .canvas-tools{padding:4px;min-height:52px;flex-wrap:wrap;gap:4px}
 #bEssentials{gap:3px}
 body.interface-b .canvas-tools #bEssentials button{flex:1;min-width:44px;padding:3px;gap:2px;flex-direction:column}
 .interface-b .canvas-tools .tool-label{font-size:10px}
 body.interface-b #modeHint{bottom:8px;left:8px;padding:6px;max-width:calc(100% - 150px)}
 body.interface-b #modeHint>span{display:none}
 body.interface-b #viewNavigation{bottom:8px;right:8px}
 #bSelectionTools{left:6px;top:6px;gap:3px;padding:3px}
 #bSelectionLabel{display:none}.interface-b .b-tool-buttons button{font-size:11px;padding:5px}
 .interface-b #drawOptions{left:6px;top:62px;max-width:calc(100% - 12px);flex-wrap:wrap}
 .interface-b #empty h2{font-size:21px}.interface-b #empty p{font-size:12px}
}
@media(max-width:420px){.interface-b>header>div:first-child{width:100%}.interface-b h1{font-size:14px;line-height:20px}.interface-b #bBadge{height:18px;width:18px}.interface-b .head-actions{justify-content:space-between;width:100%}.interface-b .workspace-menu>summary{font-size:11px}.interface-b #empty h2{font-size:18px}.interface-b #empty p{display:none}body.interface-b .instrument,body.interface-b[data-handedness=left] .instrument{grid-template-columns:68px minmax(0,1fr) 68px}}
@media(max-width:350px){body.interface-b #paletteViewport{padding:3px 0}body.interface-b #palette{padding:0 8px;gap:2px}.interface-b #bPaletteHelp{font-size:9px}}
@media(max-height:500px) and (min-width:601px){.interface-b>header{min-height:48px}.interface-b .palette-top{min-height:44px}.interface-b #bPaletteHelp{display:none}.interface-b #paletteViewport{min-height:0;padding-top:0;padding-bottom:0}.interface-b .canvas-tools{padding:2px 8px;min-height:48px}.interface-b #empty h2{font-size:18px}.interface-b #empty p{display:none}}
@media(max-height:500px){body.interface-b .instrument,body.interface-b[data-handedness=left] .instrument{grid-template-columns:116px minmax(0,1fr) 78px}#bGestureRail{gap:5px;padding:4px}.b-gesture-group{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:3px}#bGestureRail .b-hold-tool{min-height:44px}#bRailHint{display:none}}

@media(max-height:500px){body.interface-b .instrument:has(#bGestureRail[data-locks=false]){grid-template-columns:78px minmax(0,1fr) 78px}#bGestureRail[data-locks=false] .b-gesture-group{display:flex;flex-direction:column}}

@media(max-height:500px){#bRecordRail{gap:4px;padding:4px}#bRecordRail button{min-height:44px}#bRecordHint{font-size:9px}}

body.interface-b #paletteViewport{--b-edge-left:transparent;--b-edge-right:transparent;box-shadow:inset 12px 0 12px -10px var(--b-edge-left),inset -12px 0 12px -10px var(--b-edge-right)}
body.interface-b #paletteViewport[data-b-before=true]{--b-edge-left:#e3f5ef}
body.interface-b #paletteViewport[data-b-after=true]{--b-edge-right:#e3f5ef}

/* Compact header: retain the original controls and their keyboard focus states. */
body.interface-b>header{min-height:64px;padding:8px 12px;gap:12px;align-items:center;flex-wrap:nowrap}
body.interface-b>header>div:first-child{flex:1 1 auto;min-width:0;width:auto}
body.interface-b h1{display:flex;align-items:center;gap:8px;margin:0;font-size:21px;line-height:1.15;letter-spacing:-.65px}
body.interface-b #bBadge{width:21px;height:21px;margin:0;border-radius:6px;font-size:11px;line-height:1;letter-spacing:0}
body.interface-b .creator-credit{display:block;margin:4px 0 0;font-size:11px;line-height:1.35;letter-spacing:0;color:#52655d}
body.interface-b>header>.head-actions{flex:0 0 auto;min-width:0;width:auto;gap:6px;margin-left:auto;align-items:center;justify-content:flex-end;flex-wrap:wrap}
body.interface-b #languageSwitch{align-items:center}
body.interface-b #languageSwitch button{height:44px;min-height:44px;min-width:44px;padding:0 8px;font-size:12px;font-weight:550;line-height:1;border-color:#bbc9c2;background:#fafbf7;color:#294d46}
body.interface-b #languageSwitch button[aria-pressed=true]{background:#294f46;color:#fff;box-shadow:inset 0 -2px 0 #a8cfba}
body.interface-b :is(#home,#bSaveNotice),body.interface-b .workspace-menu>summary{display:flex;align-items:center;justify-content:center;gap:5px;height:44px;min-height:44px;min-width:44px;padding:0 10px;border:1px solid #bbc9c2;border-radius:8px;background:#fafbf7;color:#294d46;font-size:12px;font-weight:550;line-height:1.2;white-space:nowrap}
body.interface-b :is(#home,#bSaveNotice):hover,body.interface-b .workspace-menu>summary:hover{background:#e8efea}
body.interface-b #bSaveNotice{color:#8a2f42;border-color:#bc7580;background:#fff7f8}
body.interface-b #bSaveNotice[hidden]{display:none}
body.interface-b #suiteShareMount{display:flex;align-items:center;flex:none;--rgf-control-color:#52655d;--rgf-control-hover:#e8efea}
body.interface-b #soundReadiness{gap:6px;margin:0;padding:0 12px 6px;border:0;background:transparent;color:#52655d}
body.interface-b #soundReadiness #audioStatus{font-size:11px;line-height:1.4}
body.interface-b #soundReadiness progress{width:64px;height:8px}
@media(max-width:600px){
 body.interface-b>header{flex-wrap:wrap;gap:6px;padding:8px 10px 6px}
 body.interface-b>header>div:first-child{width:100%}
 body.interface-b h1{font-size:20px}
 body.interface-b>header>.head-actions{width:100%;gap:4px;justify-content:flex-end}
 body.interface-b #soundReadiness{padding:0 10px 6px}
}

/* Keep the linked original-author credit readable when the header narrows. */
.creator-credit a{color:inherit;text-decoration:underline;text-decoration-color:#7f9e90;text-underline-offset:2px;border-radius:2px}
.creator-credit a:hover{color:#294f46}
