/* Approved Studio Switchboard activity system. Load after every feature stylesheet.
   Touch/art colors and instrument geometry remain feature-owned. The responsive
   workspace rules do not promise native fullscreen or change bitmap dimensions. */
body.studio-app{--studio-navy:#142754;--studio-copy:#486482;--studio-border:#d4e4ef;--studio-sky:#f4faff;--studio-white:#fff;--studio-pill:999px;background:var(--studio-sky)}
body.studio-app .studio-activity{min-width:0;color:var(--studio-navy);scroll-margin-top:1rem}
body.studio-app .studio-activity :where(h1,h2,h3,p,label,summary,button,select){overflow-wrap:anywhere}
body.studio-app .studio-activity :where(form,fieldset,section,div,label){min-width:0}
body.studio-app .studio-activity :where(input:not([type=radio]):not([type=checkbox]),select,textarea){max-width:100%;font-size:1rem}
body.studio-app .studio-activity :where(h1,.active-game-title){font-size:clamp(1.55rem,3.2vw,2.4rem);line-height:1.18;letter-spacing:-.035em;margin:1rem 0 .55rem}
body.studio-app .studio-activity .intro{font-size:1rem;line-height:1.55;margin:.5rem 0 1.5rem;max-width:65ch}
body.studio-app .studio-activity .hint{font-size:.85rem;line-height:1.55}
body.studio-app .studio-activity .play-top{gap:.5rem 1rem;flex-wrap:wrap;padding-bottom:1.1rem;font-size:.85rem}
body.studio-app .studio-activity .play-top .text-button{padding:.65rem 1rem;border:1px solid var(--studio-border);background:white;border-radius:var(--studio-pill);font-weight:700}
body.studio-app .studio-activity .play-top :where(.score,#gameProgress,#traceProgress){padding:.4rem .8rem;border-radius:var(--studio-pill);background:#e5f5ff;line-height:1.4}
body.studio-app .studio-activity .play-top .score{background:#d9f1e7}
body.studio-app .studio-activity :where(.primary,.check,.piano-song-primary){min-height:48px;border-radius:var(--studio-pill);background:var(--studio-navy);color:white;box-shadow:none;border-color:var(--studio-navy);gap:.75rem;white-space:normal}
body.studio-app .studio-activity :where(.primary,.check,.piano-song-primary):hover{background:#234475;border-color:#234475}
body.studio-app .studio-activity :where(.secondary,.text-button,.voice-open){min-height:44px;border-radius:var(--studio-pill);font-weight:700;white-space:normal}
body.studio-app .studio-activity :where(button,input,select,textarea,summary):focus-visible{outline:3px solid #0879ce;outline-offset:3px}
/* Set-up screens use the same readable controls, not a phone column stretched wide. */
body.studio-app :where(#setup,#gameSetup,#traceSetup,#longSetup,#motorPuzzleSetup){max-width:960px;margin-inline:auto}
body.studio-app .studio-activity .setup-heading{margin-top:1rem}
body.studio-app .studio-activity .setup-heading h1{font-size:clamp(1.8rem,3.5vw,2.6rem);letter-spacing:-.04em}
body.studio-app .studio-activity .setting-block{padding:1rem 0;border:0}
body.studio-app .studio-activity .setting-block h2{font-size:1.05rem;line-height:1.4;margin:.25rem 0 .85rem}
body.studio-app .studio-activity :where(.operations,.segmented,.times){gap:.55rem}
body.studio-app .studio-activity :where(.operations span,.segmented span,.times span){min-height:48px;border-radius:var(--studio-pill);border:1px solid var(--studio-border);padding:.75rem 1rem;background:white;color:var(--studio-navy);height:100%;justify-content:center;font-size:.85rem;line-height:1.4}
body.studio-app .studio-activity .segmented b{font-size:.95rem}
body.studio-app .studio-activity :where(.operations input:checked+span,.segmented input:checked+span,.times input:checked+span){background:var(--studio-navy);color:white;border:1px solid var(--studio-navy);padding:.75rem 1rem}
body.studio-app .studio-activity :where(.guided-inline,.trace-help,.privacy-note){background:white;border:1px solid var(--studio-border);border-radius:22px}
body.studio-app .studio-activity .operations span{gap:.7rem;justify-content:flex-start}
body.studio-app .studio-activity .operations b{font-size:1.3rem}
body.studio-app #gameSetup .segmented{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
body.studio-app #gameSetup .segmented span{border-radius:18px}
body.studio-app .studio-activity .times label{flex:1 1 7rem;text-align:center}
body.studio-app .studio-activity .launch-row{gap:1rem;flex-wrap:wrap;border-color:var(--studio-border)}
/* Math and shared word/number workspaces. Check remains an explicit action. */
body.studio-app :where(#play,#gamePlay,#longPlay){max-width:1080px;margin-inline:auto}
body.studio-app #gameContent{max-width:none;grid-template-columns:minmax(0,1.15fr) minmax(0,.9fr);gap:clamp(1.25rem,4vw,3rem);align-items:start}
body.studio-app :where(.question-panel:not(.correct-flash):not(.incorrect-flash),.adventure-question){background:white;border:1px solid var(--studio-border);border-radius:24px;padding:clamp(1.2rem,3vw,2.25rem)}
body.studio-app #gameBoard.right .adventure-question{background:#e5f5ed;border-color:#87b9a3}
body.studio-app #gameBoard.wrong .adventure-question{background:#fff0e3;border-color:#dba783}
body.studio-app #gameContent .question-panel{min-height:360px;display:flex;flex-direction:column;justify-content:center}
body.studio-app #gameContent .question-panel.correct-flash{background:#e5f5ed}
body.studio-app #gameContent .question-panel.incorrect-flash{background:#fff0e3}
body.studio-app .studio-activity #timer{border-radius:var(--studio-pill);background:#fff0bd;padding:.35rem .9rem;align-self:center;font-size:1rem;margin:0}
body.studio-app .studio-activity .timer-label{font-size:.65rem;margin-bottom:.35rem}
body.studio-app .studio-activity .timer-track{width:100%;margin:.7rem auto 1.2rem}
body.studio-app .studio-activity .equation{max-width:100%;font-size:3.4rem;line-height:1.15}
body.studio-app .studio-activity .answer{background:#e5f5ff;border-radius:14px;border-top:0;padding:.5rem 0;margin-top:.65rem;color:var(--studio-navy)}
body.studio-app .studio-activity :where(#feedback,#gameFeedback){height:auto;min-height:1.5em;line-height:1.5;font-size:.9rem}
body.studio-app .studio-activity .keypad-panel{padding:0}
body.studio-app .studio-activity .keypad-title{font-size:1.35rem;line-height:1.4}
body.studio-app .studio-activity .keypad{gap:.5rem}
body.studio-app .studio-activity .keypad button{height:auto;min-height:52px;padding:.6rem;border:1px solid var(--studio-border);border-radius:var(--studio-pill);background:white;box-shadow:none;font-size:1.4rem}
body.studio-app .studio-activity .keypad .utility{font-size:.75rem}
body.studio-app .studio-activity .check{margin-top:1rem;padding:.9rem 1.25rem}
body.studio-app #gameBoard{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.9fr);gap:clamp(1.25rem,4vw,3rem);align-items:start}
body.studio-app .studio-response-workspace{display:flex;flex-direction:column;gap:1rem;min-width:0}
body.studio-app .studio-response-workspace>h2{font-size:clamp(1.25rem,2.5vw,1.7rem);line-height:1.4;margin:.4rem 0 0}
body.studio-app #gameBoard .adventure-question{min-height:280px}
body.studio-app #gameBoard.reading-passage .adventure-question{min-height:340px;text-align:left}
body.studio-app #gameBoard.reading-passage #gameDisplay{font-size:clamp(1.2rem,2.4vw,1.65rem);font-weight:650;line-height:1.6}
body.studio-app #gameBoard.reading-passage .listen-row{justify-content:flex-start;margin-top:1.5rem}
body.studio-app #gameBoard .listen-row{flex-wrap:wrap}
body.studio-app #gameBoard .listen-row .hint{flex:1 1 8rem;text-align:left;font-size:.78rem}
body.studio-app #gameBoard #parentPrompt{max-width:none;line-height:1.5}
body.studio-app #parentPrompt summary{min-height:44px;display:flex;align-items:center;cursor:pointer}
body.studio-app #gameResponse:not(:empty){background:#e5f5ff;padding:.6rem;border-radius:14px;min-height:2.5rem;overflow-wrap:anywhere}
body.studio-app #gameChoices{margin:0;gap:.6rem}
body.studio-app #gameChoices button{min-height:52px;padding:.65rem .8rem;border-radius:var(--studio-pill);border:1px solid var(--studio-border);background:white;box-shadow:none;font-size:1.2rem;line-height:1.4;overflow-wrap:anywhere}
body.studio-app #gameChoices button[aria-pressed=true]{background:var(--studio-navy);border:1px solid var(--studio-navy);color:white}
body.studio-app #gameChoices button:disabled{opacity:.48}
body.studio-app #gameChoices.number-choices{grid-template-columns:repeat(3,minmax(0,1fr))}
body.studio-app #gameChoices.word-choices{grid-template-columns:minmax(0,1fr)}
body.studio-app #gameChoices.letter-choices{grid-template-columns:repeat(auto-fit,minmax(44px,1fr))}
body.studio-app .studio-response-workspace .answer-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;margin-top:auto}
body.studio-app .studio-response-workspace .answer-tools #gameSubmit{grid-column:1/-1;width:100%;margin-top:.5rem}
body.studio-app .studio-activity .long-layout{grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:clamp(1.25rem,4vw,3rem);max-width:none}
body.studio-app .studio-activity .long-board-scroll{background:white;border-color:var(--studio-border);border-radius:24px;padding:1.25rem .75rem}
body.studio-app .studio-activity .long-board{border:0;border-radius:0}
body.studio-app .studio-activity .long-controls .keypad{grid-template-columns:repeat(3,minmax(0,1fr))}
body.studio-app .studio-activity .long-controls h2{font-size:1.25rem;line-height:1.4}
/* Preschool: untouched artwork and tap-before-answer gating inside a clear frame. */
body.studio-app #preschoolPlay{max-width:1080px}
body.studio-app .preschool-tools{gap:.75rem;margin:.75rem 0}
body.studio-app .preschool-tools button{border:1px solid var(--studio-border);background:white;border-radius:var(--studio-pill);padding:.6rem 1rem;font-weight:700}
body.studio-app .preschool-tools label{font-size:.85rem}
body.studio-app .preschool-board{box-shadow:none;padding:clamp(1rem,2.5vw,1.75rem);border-radius:24px}
body.studio-app .preschool-board h2{line-height:1.4}
body.studio-app .preschool-choice{border:1px solid var(--studio-border);border-radius:22px;padding:.7rem}
body.studio-app .preschool-sound{border:1px solid var(--studio-navy);background:var(--studio-navy);color:white;border-radius:var(--studio-pill);min-height:52px;font-size:1rem;padding:.7rem 1.2rem}
body.studio-app .preschool-end{border:1px solid var(--studio-border);background:white;padding:2rem 1rem}
body.studio-app .preschool-end button{border-radius:var(--studio-pill);border:1px solid var(--studio-border);padding:.8rem 1.2rem;min-height:48px}
body.studio-app .preschool-end button:not(.primary){background:white;color:var(--studio-navy)}
/* Tracing, puzzles and coloring keep their original artwork, target rings and tools. */
body.studio-app .studio-activity .trace-layout{grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr);gap:clamp(1rem,4vw,3rem);max-width:none}
body.studio-app .studio-activity #traceCanvas{background:white;border:1px solid var(--studio-border);border-radius:24px;max-height:68svh;min-height:260px}
body.studio-app .studio-activity .trace-directions>p{font-size:1rem;line-height:1.55}
body.studio-app .studio-activity .trace-directions h2{font-size:1.35rem}
body.studio-app .studio-activity .trace-directions .secondary{width:100%}
body.studio-app .studio-activity .motor-puzzle-layout{grid-template-columns:minmax(0,1fr) minmax(0,.9fr);gap:clamp(1rem,3vw,2rem);max-width:980px}
body.studio-app .studio-activity .motor-grid{background:#e5f5ff;border:1px solid var(--studio-border);padding:.6rem;border-radius:20px}
body.studio-app .studio-activity :where(.motor-space,.motor-piece){min-width:44px;min-height:44px}
body.studio-app .studio-activity .motor-road-wrap{background:white;border:1px solid var(--studio-border);padding:1rem;max-width:640px}
body.studio-app .studio-activity .motor-picture{background:white;border-color:var(--studio-border);border-radius:20px;gap:.5rem}
body.studio-app .studio-activity .motor-picture[aria-pressed=true]{background:#e5f5ff;border-color:#0879ce;box-shadow:0 0 0 1px #0879ce}
body.studio-app .studio-activity .coloring-layout{grid-template-columns:minmax(0,1.5fr) minmax(190px,.6fr);gap:1.5rem}
body.studio-app .studio-activity .coloring-canvas{border-color:var(--studio-border);border-radius:24px}
body.studio-app .studio-activity .coloring-tools{background:white;border:1px solid var(--studio-border);padding:1rem;border-radius:22px}
body.studio-app .studio-activity .coloring-brush-controls button{border-radius:var(--studio-pill)}
body.studio-app .studio-activity .coloring-brush-controls button[aria-pressed=true]{background:var(--studio-navy);border-color:var(--studio-navy)}
body.studio-app .studio-activity .coloring-palette{grid-template-columns:repeat(3,minmax(0,1fr))}
/* Creative Canvas: tablet tool rail, phone stack; fullscreen sizing remains owned
   by creative-canvas.js/css and therefore never gets the ordinary-page grid. */
body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-controls{background:white;border:1px solid var(--studio-border);padding:1rem;border-radius:22px}
body.studio-app #creativeCanvasPlay .creative-controls button{border-width:1px;border-color:var(--studio-border);border-radius:var(--studio-pill);min-height:44px;white-space:normal}
body.studio-app #creativeCanvasPlay .creative-controls button[aria-pressed=true]{background:var(--studio-navy);border-color:var(--studio-navy);color:white;box-shadow:none}
body.studio-app #creativeCanvasPlay #creativeSave{background:var(--studio-navy);border-color:var(--studio-navy);color:white}
body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-paper{border-radius:22px;border-color:#b8d2e4;margin-top:0;box-shadow:none}
body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-heading{gap:.6rem 1rem}
body.studio-app #creativeCanvasPlay .creative-intro{color:var(--studio-copy);font-size:.9rem;line-height:1.5}
/* Instruments: only surrounding chrome. Never recolor/resize notes, piano keys,
   drum pads, pond, chosen paint, or guidance/correctness indicators. */
body.studio-app :where(#pianoPlay:not(.piano-immersive-view),#drumPlay:not(.drum-immersive-view)) :where(.piano-instrument,.drum-instrument){background:white;border:1px solid var(--studio-border);border-radius:24px;box-shadow:none}
body.studio-app :where(.piano-settings,.drum-settings){border-color:var(--studio-border);background:white;border-radius:22px}
body.studio-app :where(.piano-mode-tabs button,.piano-range button,.piano-octave-controls button,.piano-mute,.drum-mute,.piano-screen-enter,.drum-screen-enter,.piano-song-transport>button,.piano-song-transport>details>summary){border-radius:var(--studio-pill);min-height:44px;white-space:normal}
body.studio-app :where(.piano-mode-tabs button,.piano-range button,.piano-mute,.drum-mute)[aria-pressed=true]{background:var(--studio-navy);border-color:var(--studio-navy);color:white}
body.studio-app .piano-song-top{background:white;border:1px solid var(--studio-border);border-radius:20px}
body.studio-app .piano-song-options{border-radius:20px;border-color:var(--studio-border)}
body.studio-app .piano-song-options>div{max-width:100%;overflow-wrap:anywhere}
body.studio-app :where(.piano-volume,.drum-volume){flex-wrap:wrap;max-width:100%}
body.studio-app :where(.piano-volume,.drum-volume) input{max-width:100%;min-width:70px}
body.studio-app :where(.piano-screen-bar,.drum-screen-bar) button{min-height:44px;border-radius:var(--studio-pill)}
body.studio-app #aquariumPlay:not(.aquarium-immersive) .aquarium-toolbar{flex-wrap:wrap;gap:.6rem}
body.studio-app #aquariumPlay:not(.aquarium-immersive) :where(.aquarium-motion,.aquarium-fullscreen){min-height:44px;border-radius:var(--studio-pill)}
/* Results, local word lists and adult-facing forms retain truthful existing copy. */
body.studio-app :where(#results,#gameResults){max-width:780px;padding-top:1rem}
body.studio-app .studio-activity .result-star{font-size:3rem;color:#167f86;margin-bottom:1rem}
body.studio-app .studio-activity .stats{background:transparent;border:0;gap:.7rem;padding:0;margin:1.5rem 0}
body.studio-app .studio-activity .stats>div{background:white;border:1px solid var(--studio-border);border-radius:20px;padding:1.1rem .65rem;min-width:0}
body.studio-app .studio-activity .stats strong{font-size:clamp(1.5rem,4vw,2.4rem);overflow-wrap:anywhere}
body.studio-app .studio-activity .stats span{font-size:.8rem;line-height:1.4;display:block}
body.studio-app .studio-activity .result-actions{gap:.7rem;margin:1.5rem 0}
body.studio-app .studio-activity .result-actions>button{flex:1 1 10rem}
body.studio-app .studio-activity .review-row{flex-wrap:wrap;gap:.6rem}
body.studio-app .studio-activity .review-row strong{font-size:1.1rem;line-height:1.5}
body.studio-app :where(#weeks,#parentArea){max-width:980px;margin-inline:auto}
body.studio-app #weeks :where(.week-row,.week-actions){flex-wrap:wrap}
body.studio-app #weeks .week-row>label{min-width:0;overflow-wrap:anywhere}
body.studio-app .account-panel{padding:clamp(.75rem,2.5vw,1.5rem);border-radius:24px;background:transparent}
body.studio-app .account-panel :where(button,input,select,textarea){max-width:100%}
body.studio-app .account-panel button{border-radius:var(--studio-pill)}
body.studio-app :where(.reading-voice-dialog,.home-screen-dialog,.activity-preview-dialog){max-height:calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));scroll-padding:1.5rem;overscroll-behavior:contain}
/* Tablet width creates balanced working areas. Rem breakpoints also collapse
   gracefully for browser zoom; no fixed page heights clip enlarged text. */
@media(min-width:48rem) and (min-height:34rem){
 body.studio-app #preschoolBoard{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,.8fr);gap:.75rem 1.5rem;align-items:center}
 body.studio-app #preschoolBoard>:where(#preschoolPrompt,#preschoolRule){grid-column:1/-1;margin:0}
 body.studio-app #preschoolScene{grid-column:1;grid-row:3/span 3;min-height:250px}
 body.studio-app #preschoolSound{grid-column:2;grid-row:3;width:100%}
 body.studio-app #preschoolChoices{grid-column:2;grid-row:4;align-self:center}
 body.studio-app #preschoolFeedback{grid-column:2;grid-row:5;font-size:1rem}
 body.studio-app #preschoolBoard[data-studio-preschool-layout=choices]{grid-template-columns:minmax(0,1fr)}
 body.studio-app #preschoolBoard[data-studio-preschool-layout=choices] #preschoolScene{display:none}
 body.studio-app #preschoolBoard[data-studio-preschool-layout=choices] :where(#preschoolSound,#preschoolChoices,#preschoolFeedback){grid-column:1;width:100%;max-width:760px;margin-inline:auto}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive){display:grid;grid-template-columns:minmax(180px,.55fr) minmax(0,1.7fr);gap:.75rem 1.5rem;align-items:start}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive)>:where(.creative-heading,.creative-intro){grid-column:1/-1}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) #creativeControls{grid-column:1;grid-row:3/span 3;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem;padding:.7rem}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) #creativeControls>:where(.creative-tool-icons,.creative-size-control,.creative-words){grid-column:1/-1;width:100%;max-width:none}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-tool-icons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-tool-icons button{min-width:0;font-size:.75rem;padding:.5rem .25rem}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) #creativeControls>label:not(.creative-words){grid-column:1/-1;display:flex;align-items:center;justify-content:space-between}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-size-control label{flex-wrap:wrap;font-size:.8rem}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-preview-box{width:44px;height:44px}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) #creativeSize{min-width:0}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) #creativeHelp{grid-column:2;grid-row:3;margin:0;font-size:.85rem}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) #creativeStage{grid-column:2;grid-row:4}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) #creativeStatus{grid-column:2;grid-row:5;margin:0}
}
@media(max-width:47.99rem){
 body.studio-app .studio-activity :where(h1,.active-game-title){font-size:1.6rem;letter-spacing:-.025em}
 body.studio-app :where(#gameBoard,#gameContent){grid-template-columns:minmax(0,1fr);gap:1rem;max-width:560px;margin-inline:auto}
 body.studio-app #gameContent .question-panel{min-height:0;padding:1rem}
 body.studio-app #gameContent .keypad-title{display:block;font-size:1rem;margin-bottom:.65rem}
 body.studio-app .studio-activity .keypad button{min-height:44px;padding:.5rem;font-size:1.2rem}
 body.studio-app .studio-activity .keypad .utility{font-size:.7rem}
 body.studio-app .studio-activity .equation{font-size:2.5rem;max-width:180px}
 body.studio-app .studio-activity .equation .answer{font-size:1.9rem;min-height:0}
 body.studio-app #gameBoard .adventure-question,body.studio-app #gameBoard.reading-passage .adventure-question{min-height:0;padding:1.15rem}
 body.studio-app .studio-response-workspace{gap:.75rem}
 body.studio-app #gameChoices button{min-height:48px;font-size:1.1rem}
 body.studio-app #gameChoices.word-choices:not(:only-child){grid-template-columns:repeat(2,minmax(0,1fr))}
 body.studio-app #gameBoard.reading-passage #gameChoices{grid-template-columns:minmax(0,1fr)}
 body.studio-app .studio-activity :where(.long-layout,.trace-layout){grid-template-columns:minmax(0,1fr);gap:1rem;max-width:560px;margin-inline:auto}
 body.studio-app .studio-activity .long-controls .keypad{grid-template-columns:repeat(3,minmax(0,1fr))}
 body.studio-app .studio-activity .trace-directions>p{font-size:.9rem}
 body.studio-app .studio-activity .trace-directions .secondary{width:auto}
 body.studio-app .studio-activity #traceCanvas{max-height:60svh;min-height:240px}
 body.studio-app .studio-activity .coloring-layout{grid-template-columns:minmax(0,1fr);gap:1rem}
 body.studio-app .studio-activity .coloring-palette{grid-template-columns:repeat(5,minmax(0,1fr));gap:.4rem}
 body.studio-app .studio-activity .coloring-tools{padding:.75rem}
 body.studio-app .studio-activity .coloring-swatch{min-width:44px;min-height:60px;font-size:.7rem}
 body.studio-app .studio-activity .coloring-brush-controls label{flex-wrap:wrap;gap:.5rem}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-controls{padding:.7rem;gap:.55rem}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-tool-icons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;gap:.45rem}
 body.studio-app #creativeCanvasPlay .creative-tool-icons button{min-width:0;min-height:48px;padding:.4rem;font-size:.75rem}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-paper{margin-top:.7rem}
 body.studio-app #creativeCanvasPlay .creative-size-control{flex-basis:100%;max-width:none}
 body.studio-app .studio-activity .stats{gap:.4rem}
 body.studio-app .studio-activity .stats>div{padding:1rem .45rem;border-radius:16px}
 body.studio-app .studio-activity .stats span{font-size:.7rem}
 body.studio-app #gameSetup .segmented{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.studio-app .studio-activity .operations{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.studio-app .studio-activity .operations span{font-size:.75rem;padding:.65rem .7rem;gap:.4rem}
 body.studio-app .studio-activity .operations input:checked+span{padding:.65rem .7rem}
 body.studio-app .studio-activity .long-inputs{flex-wrap:wrap;gap:.75rem}
}
/* Landscape phones use both halves without shrinking below 44px targets.
   Vertical scrolling remains available instead of clipping long prompts/text. */
@media(min-width:36rem) and (max-height:33.99rem) and (orientation:landscape){
 body.studio-app :where(#gameBoard,#gameContent){grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1rem;max-width:none}
 body.studio-app .studio-activity .keypad button{height:auto;min-height:44px}
 body.studio-app .studio-activity .check{min-height:48px}
 body.studio-app .studio-activity .trace-layout{grid-template-columns:minmax(0,.75fr) minmax(0,1fr);max-width:none}
 body.studio-app .studio-activity #traceCanvas{max-height:80svh}
}
@media(max-width:23rem){
 body.studio-app .studio-activity .motor-puzzle-layout{grid-template-columns:minmax(0,1fr)}
 body.studio-app .studio-activity .motor-grid,body.studio-app .studio-activity .motor-pieces{max-width:280px;width:100%;margin-inline:auto}
 body.studio-app .studio-activity .coloring-palette{grid-template-columns:repeat(4,minmax(0,1fr))}
 body.studio-app #creativeCanvasPlay:not(.creative-immersive) .creative-tool-icons{grid-template-columns:repeat(3,minmax(0,1fr))}
 body.studio-app .studio-activity .segmented label{flex:1 1 100%}
 body.studio-app #gameSetup .segmented{grid-template-columns:minmax(0,1fr)}
 body.studio-app .studio-activity .play-top{gap:.4rem}
 body.studio-app .studio-activity .play-top>*{max-width:100%}
}
@media(prefers-reduced-motion:reduce){body.studio-app .studio-activity{scroll-behavior:auto}body.studio-app .studio-activity :where(.primary,.secondary,.check,.preschool-board){transition:none;animation:none}}

/* Keep the immersive bar touch-accessible: the legacy landscape piano rule
   contains an ID selector and otherwise wins over the shared 44px controls. */
body.studio-app #pianoPlay.piano-immersive-view .piano-screen-bar{min-height:44px}
body.studio-app #pianoPlay.piano-immersive-view .piano-screen-bar button,
body.studio-app #pianoPlay.piano-immersive-view .piano-mode-tabs button{min-height:44px;min-width:44px}

/* Compact shared games: apply in Website AND App view, after the old App-only
   landscape rules. <=1023px intentionally trades a narrow tablet/landscape pair
   of columns for a readable full-width question and response. >=64rem retains
   the existing App desktop split and the original Website DOM/layout. */
@media(max-width:63.99rem){
 body.adventure-playing #gameBoard{display:grid;grid-template-columns:minmax(0,1fr);gap:1rem;max-width:560px;margin-inline:auto;padding-bottom:calc(var(--game-submit-height,3.5rem) + 1.75rem + env(safe-area-inset-bottom) + var(--game-viewport-inset,0px))}
 body.adventure-playing #gameBoard :where(.adventure-question,.studio-response-workspace,#gameChoices,.answer-tools){box-sizing:border-box;min-width:0;width:100%}
 body.adventure-playing #gameBoard .adventure-question{min-height:0;padding:1rem}
 body.adventure-playing #gameBoard:not(.reading-passage):not(.sentence-building) #gameDisplay{font-size:clamp(1.35rem,6vw,2.25rem);line-height:1.3;word-spacing:normal;overflow-wrap:anywhere}
 body.adventure-playing #gameBoard #gameChoices{margin:0;gap:.6rem}
 body.adventure-playing #gameBoard #gameChoices.word-choices{grid-template-columns:minmax(0,1fr)}
 body.adventure-playing #gameBoard #gameChoices.number-choices{grid-template-columns:repeat(3,minmax(0,1fr))}
 body.adventure-playing #gameBoard #gameChoices button{min-width:0;width:100%;min-height:48px;padding:.65rem .8rem;line-height:1.4;overflow-wrap:normal;word-break:normal}
 body.adventure-playing #gameBoard #gameChoices.sentence-choices button{width:auto}
 body.adventure-playing #gameBoard .answer-tools{display:flex;gap:.6rem;margin-top:0}
 body.adventure-playing #gameBoard .answer-tools .secondary{flex:1;min-width:0;min-height:44px}
 /* Fixed rather than bottom-sticky: the response's containing block can begin
    below a short viewport. Keep the SAME submit node/handler and reserve space. */
 body.adventure-playing #gameBoard #gameSubmit{position:fixed;z-index:25;left:50%;transform:translateX(-50%);bottom:calc(var(--game-viewport-inset,0px) + max(.75rem,env(safe-area-inset-bottom)));width:min(560px,calc(100% - max(1rem,env(safe-area-inset-left)) - max(1rem,env(safe-area-inset-right))));max-width:none;box-sizing:border-box;min-height:52px;margin:0;padding:.85rem 1rem;line-height:1.4;white-space:normal;box-shadow:0 0 0 8px var(--paper),0 -10px 18px var(--paper)}
 body.adventure-playing #gameBoard :where(button,summary){scroll-margin-bottom:calc(var(--game-submit-height,3.5rem) + 2rem + env(safe-area-inset-bottom))}
}
