/* Viewport adjustments for each native workspace, below the shared 54px header. */
body[data-screen-tool]{box-sizing:border-box}
/* Symmetry: two columns of secondary tools on short screens. */
@media(min-width:650px) and (max-height:600px){
 body[data-screen-tool=all-about-do]{grid-template-columns:240px minmax(0,1fr)!important}
 body[data-screen-tool=all-about-do] .symmetry-sidebar{width:100%;align-self:stretch}
 body[data-screen-tool=all-about-do] .symmetry-main-tools{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 body[data-screen-tool=all-about-do] .symmetry-color-presets{grid-column:1/-1;grid-template-columns:repeat(12,minmax(0,1fr));padding:0}
 body[data-screen-tool=all-about-do] .symmetry-view-tools{display:grid;grid-template-columns:1fr 1fr;gap:4px}
 body[data-screen-tool=all-about-do] .symmetry-main-tools>.tool-btn{min-height:27px}
 body[data-screen-tool=all-about-do] .symmetry-view-tools>.tool-btn{min-height:30px;font-size:10px}
 body[data-screen-tool=all-about-do] header h1.symmetry-title{margin-inline:245px 0!important}
}
/* Negative harmony piano keeps both chord rows and all arcs visible. */
body[data-screen-tool=piano-negative-harmony]{height:var(--studio-app-height);min-height:0;display:flex;flex-direction:column;gap:5px;padding:6px 12px!important}
body[data-screen-tool=piano-negative-harmony] h1{font-size:22px;line-height:1.15;margin:0}
body[data-screen-tool=piano-negative-harmony] .subtitle{margin:0;font-size:11px;line-height:1.3}
body[data-screen-tool=piano-negative-harmony] .controls{margin:0;gap:5px;flex:none;flex-wrap:wrap}
body[data-screen-tool=piano-negative-harmony] .control-group{padding:4px 6px;gap:5px}
body[data-screen-tool=piano-negative-harmony] .control-group select,body[data-screen-tool=piano-negative-harmony] .control-group button{padding:5px;min-height:30px;font-size:12px}
body[data-screen-tool=piano-negative-harmony] .display-container{flex:1;min-height:0;display:grid;grid-template-rows:auto minmax(70px,1fr) auto minmax(55px,1fr) auto;width:100%;max-width:1500px;min-width:0;gap:4px;margin:0 auto;overflow:visible}
body[data-screen-tool=piano-negative-harmony] .piano{width:100%;min-width:0;height:100%;min-height:0}
body[data-screen-tool=piano-negative-harmony] .chords-row{margin:0;padding:2px 0;gap:2px;min-width:0;width:100%}
body[data-screen-tool=piano-negative-harmony] .chord{padding:4px 1px;min-width:0;flex:1}
body[data-screen-tool=piano-negative-harmony] .chord-name{font-size:14px}
body[data-screen-tool=piano-negative-harmony] .chord-roman{font-size:10px}
body[data-screen-tool=piano-negative-harmony] .arcs-container{height:100%;min-height:0;margin:0}
body[data-screen-tool=piano-negative-harmony] .octave-labels{margin:0;font-size:10px}
body[data-screen-tool=piano-negative-harmony] :is(.piano,.chords-row,.arcs-container,.octave-labels){min-width:0!important;max-width:100%;box-sizing:border-box}
body[data-screen-tool=piano-negative-harmony] .display-container{padding-bottom:0!important;overflow-x:visible!important}
body[data-screen-tool=piano-negative-harmony] #arcs{height:100%;width:100%;min-height:0;display:block}
body[data-screen-tool=piano-negative-harmony] .legend{margin:0;font-size:10px;line-height:1.2}
body[data-screen-tool=piano-negative-harmony]>footer{flex:none;margin:0!important;padding:2px!important;font-size:10px!important}
@media(max-width:600px){
 body[data-screen-tool=piano-negative-harmony]{padding:5px!important}
 body[data-screen-tool=piano-negative-harmony] .controls{display:grid;grid-template-columns:1fr 1fr}
 body[data-screen-tool=piano-negative-harmony] .control-group{display:flex;flex-wrap:wrap;justify-content:center}
 body[data-screen-tool=piano-negative-harmony] .control-group label{font-size:11px}
 body[data-screen-tool=piano-negative-harmony] .solfege{font-size:10px}
 body[data-screen-tool=piano-negative-harmony] .chord-name{font-size:11px}
}
@media(max-height:450px){
 body[data-screen-tool=piano-negative-harmony] .subtitle{display:none}
 body[data-screen-tool=piano-negative-harmony] h1{font-size:18px}
 body[data-screen-tool=piano-negative-harmony] .controls{gap:3px}
 body[data-screen-tool=piano-negative-harmony] .control-group{padding:2px}
 body[data-screen-tool=piano-negative-harmony] .legend{display:none}
}
/* Metronome: the central instrument and transport share the available height. */
body[data-screen-tool=metronom]{height:var(--studio-app-height);min-height:0!important}
body[data-screen-tool=metronom] .app-container{height:calc(var(--studio-app-height) - 22px);min-height:0;display:flex;flex-direction:column;padding:5px 10px!important;gap:5px!important}
body[data-screen-tool=metronom] .header-container{min-height:30px!important;padding:0!important;flex:none}
body[data-screen-tool=metronom] .header-container h1{margin:0;font-size:22px}
body[data-screen-tool=metronom] .main-content{flex:1;min-height:0}
body[data-screen-tool=metronom] .metronome-modes{flex:none;margin:0}
body[data-screen-tool=metronom]>footer{margin:0!important;padding:2px!important;font-size:10px!important;line-height:14px!important}
@media(max-height:500px){
 body[data-screen-tool=metronom] .side-controls #side-slot{height:65px!important;--circle-size:55px}
 body[data-screen-tool=metronom] .tempo-term-display{min-height:30px;padding:3px!important;margin-top:2px!important}
 body[data-screen-tool=metronom] .bpm-label{font-size:11px!important;line-height:1.1!important}
 body[data-screen-tool=metronom] .side-controls #bpm-value{font-size:34px!important;line-height:1.1!important}
 body[data-screen-tool=metronom] .side-controls .bpm-row{margin:2px 0!important}
 body[data-screen-tool=metronom] .side-controls{gap:4px!important;padding:4px!important}
 body[data-screen-tool=metronom] .side-controls .term-en{font-size:12px!important;line-height:1.1}
 body[data-screen-tool=metronom] .side-controls .term-he{font-size:10px!important;line-height:1.1}
 body[data-screen-tool=metronom] .metronome-settings{padding:5px!important;gap:4px}
 body[data-screen-tool=metronom] .metronome-flash-toggle{padding:2px;font-size:10px}
 body[data-screen-tool=metronom] .metronome-modes button{min-height:30px;padding:4px 8px;font-size:12px}
 body[data-screen-tool=metronom] .header-container{min-height:24px!important;height:24px}
 body[data-screen-tool=metronom] .header-container h1{font-size:18px}
}
/* Drawing practice: board size is calculated from the actual free space. */
body[data-screen-tool=clef-trainer]{height:var(--studio-app-height);min-height:0}
body[data-screen-tool=clef-trainer] .app-header .header-inner{padding-top:0!important}
body[data-screen-tool=clef-trainer] .app-header{padding:5px!important}
body[data-screen-tool=clef-trainer] .header-actions{padding:0!important}
body[data-screen-tool=clef-trainer] .workspace-card{overflow:visible!important}
body[data-screen-tool=clef-trainer] #steps-selector{display:flex;flex-wrap:wrap;gap:3px;overflow:visible}
body[data-screen-tool=clef-trainer] #steps-selector>*{padding:4px 8px;min-width:28px;flex:1}
body[data-screen-tool=clef-trainer] .step-title-text{display:none}
@media(max-width:899px){
 body[data-screen-tool=clef-trainer] .main-layout{display:flex;flex-direction:column;min-height:0;margin:4px auto;padding:0 6px;width:100%}
 body[data-screen-tool=clef-trainer] .workspace-card{gap:5px;padding:6px}
 body[data-screen-tool=clef-trainer] .header-inner{flex-direction:row!important;gap:5px!important}
 body[data-screen-tool=clef-trainer] .header-actions{width:auto!important}
 body[data-screen-tool=clef-trainer] .clef-tab-desc{display:none}
 body[data-screen-tool=clef-trainer] .clef-tab-title{font-size:12px}
 body[data-screen-tool=clef-trainer] .clef-tab-btn{padding:3px!important;min-height:30px;gap:3px!important}
 body[data-screen-tool=clef-trainer] .clef-tab-icon{font-size:28px;line-height:28px;width:30px;height:30px}
 body[data-screen-tool=clef-trainer] .clef-tab-info{line-height:1.2}
 body[data-screen-tool=clef-trainer] .trainer-practice-rail{gap:4px;flex:none}
 body[data-screen-tool=clef-trainer] .workspace-top-bar{padding:0;gap:4px}
 body[data-screen-tool=clef-trainer] .clef-name-large{font-size:16px}
 body[data-screen-tool=clef-trainer] .mode-btn{padding:4px 6px;font-size:11px}
 body[data-screen-tool=clef-trainer] .instruction-banner{padding:5px;min-height:0}
 body[data-screen-tool=clef-trainer] .instruction-text{font-size:12px;line-height:1.3}
 body[data-screen-tool=clef-trainer] .toolbar-bottom{padding:3px 0;flex-wrap:wrap}
 body[data-screen-tool=clef-trainer] .tool-btn{padding:4px 6px;font-size:11px}
 body[data-screen-tool=clef-trainer] .trainer-practice-rail>div[style]{padding:4px!important;gap:4px!important}
}
@media(min-width:650px) and (max-width:899px){
 body[data-screen-tool=clef-trainer] .workspace-card{display:grid;grid-template-columns:minmax(0,1fr) 360px;direction:ltr;gap:8px;align-items:center}
 body[data-screen-tool=clef-trainer] .trainer-practice-rail{direction:rtl;grid-column:2;grid-row:1}
 body[data-screen-tool=clef-trainer] #canvas-wrapper{grid-column:1;grid-row:1;min-height:0}
 body[data-screen-tool=clef-trainer] .clef-tabs-container{flex-direction:row}
 body[data-screen-tool=clef-trainer] .clef-active-info{display:none}
 body[data-screen-tool=clef-trainer] .mode-toggles{padding:2px;gap:2px}
 body[data-screen-tool=clef-trainer] .instruction-banner{max-height:none}
 body[data-screen-tool=clef-trainer] .trainer-practice-rail>div[style]>div{margin:0!important;gap:4px!important}
 body[data-screen-tool=clef-trainer] .toolbar-bottom{display:grid;grid-template-columns:1fr 1fr;gap:3px}
 body[data-screen-tool=clef-trainer] .color-dot{width:16px;height:16px}
 body[data-screen-tool=clef-trainer] .color-dots-group{gap:3px}
 body[data-screen-tool=clef-trainer] .tool-label{font-size:10px}
}
/* Keep the complete range visible without stretching the keys to the viewport height. */
body[data-screen-tool=ranges]{height:var(--studio-app-height);min-height:0;display:flex;flex-direction:column;padding:6px 10px!important;gap:8px}
body[data-screen-tool=ranges] h1{margin:0;font-size:23px;line-height:1.2;flex:none}
body[data-screen-tool=ranges] .controls{padding:7px;margin:0;gap:6px;flex:none}
body[data-screen-tool=ranges] .legend{margin:0;font-size:12px}
body[data-screen-tool=ranges] select{padding:6px;font-size:14px}
body[data-screen-tool=ranges] .piano-container{flex:1;min-height:0;margin:0 auto 22px;padding:0;display:flex;align-items:center;width:100%;max-width:1500px}
body[data-screen-tool=ranges] #piano{flex:1;height:auto;aspect-ratio:7.5;max-height:min(220px,100%);min-height:0}
body[data-screen-tool=ranges] footer{padding:2px!important;margin:0!important;font-size:10px!important;flex:none;line-height:14px!important}
@media(orientation:landscape) and (max-height:600px){
 body[data-screen-tool=ranges] h1{font-size:20px}
 body[data-screen-tool=ranges] .controls{display:grid;grid-template-columns:minmax(0,1fr) 90px;gap:4px 12px;align-items:center!important}
 body[data-screen-tool=ranges] .controls>select{grid-column:1;grid-row:1;min-width:0;max-width:460px;width:100%;justify-self:center}
 body[data-screen-tool=ranges] .controls>.legend{grid-column:1;grid-row:2;font-size:11px;gap:12px}
 body[data-screen-tool=ranges] .range-instrument-picture{grid-column:2;grid-row:1/3;gap:3px}
 body[data-screen-tool=ranges] .range-instrument-picture img{width:64px;height:64px}
 body[data-screen-tool=ranges] .range-instrument-picture figcaption{font-size:11px;line-height:1.2}
}
/* Solfege's native practice/setting dialog already handles small screens. */
body[data-screen-tool=solfege-trainer]{height:var(--studio-app-height);min-height:0;padding:5px 8px!important}
body[data-screen-tool=solfege-trainer] .app{height:calc(100% - 20px);min-height:0;padding-top:0;grid-template-rows:auto minmax(0,1fr)}
body[data-screen-tool=solfege-trainer] .grid{min-height:0}
body[data-screen-tool=solfege-trainer] .grid:not(:has(>aside)){grid-template-columns:minmax(0,1fr)}
body[data-screen-tool=solfege-trainer] .grid>section{min-height:0}
body[data-screen-tool=solfege-trainer] h1{margin:0;font-size:22px}
body[data-screen-tool=solfege-trainer] .sub{margin:0 0 4px;font-size:11px;line-height:1.2}
body[data-screen-tool=solfege-trainer] .card{padding:8px}
.screen-options-dialog{box-sizing:border-box;position:fixed;inset:62px 10px auto;margin:0 auto;width:min(780px,calc(100vw - 20px));max-height:calc(var(--studio-app-height) - 18px);padding:12px;border:1px solid var(--border,var(--line,#637b99));border-radius:12px;background:var(--panel,#202b3b);color:var(--text,#eef4fc);font:14px/1.4 'Segoe UI',sans-serif}
.screen-options-dialog [hidden]{display:none!important}
.screen-topic-choice,.theremin-subtopic-choice{width:100%;padding:5px 8px;background:var(--panel,#202b3b);color:var(--text,#eef4fc);border:1px solid #637b99;border-radius:7px;font:13px 'Segoe UI';margin-bottom:6px}
.screen-options-dialog::backdrop{background:#060b17bb}
.screen-options-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}
.screen-options-open,.screen-options-dialog>header button{padding:7px 12px;border:1px solid #637b99;border-radius:8px;color:var(--text,#eef4fc);background:var(--panel,#202b3b);font:inherit;cursor:pointer}
.screen-options-dialog>header button{padding:3px 10px;font-size:22px}
body[data-screen-tool=conductor]{height:var(--studio-app-height);min-height:0;padding:0!important}
body[data-screen-tool=conductor] .app{height:100%;min-height:0;box-sizing:border-box;padding:7px 10px;display:flex;flex-direction:column;gap:7px}
body[data-screen-tool=conductor] .top{padding:0;margin:0;flex:none;align-items:center}
body[data-screen-tool=conductor] .top .mark,body[data-screen-tool=conductor] .title p{display:none}
body[data-screen-tool=conductor] .title h1{font-size:22px;margin:0;line-height:1.2}
body[data-screen-tool=conductor] .top-actions{margin:0;gap:6px;flex-wrap:wrap}
body[data-screen-tool=conductor] .btn{padding:6px 10px;font-size:12px;min-height:30px}
body[data-screen-tool=conductor] .layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;min-height:0;flex:1;gap:10px;direction:ltr}
body[data-screen-tool=conductor] .stage{display:flex;flex-direction:column;min-height:0}
body[data-screen-tool=conductor] .video-wrap{flex:1;min-height:0;aspect-ratio:auto}
body[data-screen-tool=conductor] .stage-foot{flex:none;padding:5px;font-size:11px}
body[data-screen-tool=conductor] .side{display:flex;flex-direction:column;min-height:0;gap:7px;direction:rtl}
body[data-screen-tool=conductor] .metrics{gap:7px;flex:none}
body[data-screen-tool=conductor] .metric{padding:7px}
body[data-screen-tool=conductor] .metric .value{font-size:32px;line-height:1}
body[data-screen-tool=conductor] .metric .label,body[data-screen-tool=conductor] .metric .unit{font-size:11px}
body[data-screen-tool=conductor] .beat-grid{margin-top:5px;gap:4px}
body[data-screen-tool=conductor] .beat{height:6px}
body[data-screen-tool=conductor] .bar-count{margin-top:3px}
body[data-screen-tool=conductor] .conductor-player{flex:1;min-height:0;padding:9px}
body[data-screen-tool=conductor] .conductor-player summary{margin:0 0 5px!important}
body[data-screen-tool=conductor] .conductor-player h2{font-size:14px;margin:0}
body[data-screen-tool=conductor] .row{margin:5px 0;gap:6px;grid-template-columns:80px minmax(0,1fr)}
body[data-screen-tool=conductor] .row label{font-size:12px}
body[data-screen-tool=conductor] .select{padding:5px;min-width:0;font-size:12px}
body[data-screen-tool=conductor] .transport{margin-top:5px}
body[data-screen-tool=conductor] .piece-progress{margin-top:7px}
body[data-screen-tool=conductor] .score-info{padding:4px;margin-top:4px;font-size:10px}
body[data-screen-tool=conductor] .now-playing{font-size:11px;margin-top:4px}
body[data-screen-tool=conductor] .footer{font-size:10px;padding:0;flex:none}
body[data-screen-tool=conductor] .screen-options-dialog .panel{padding:8px;border:0}
body[data-screen-tool=conductor] .screen-options-dialog .row{display:grid;grid-template-columns:130px 1fr}
body[data-screen-tool=conductor] .screen-options-dialog .hand-tempo-panel{padding:6px;margin:5px 0}
body[data-screen-tool=conductor] .screen-options-dialog .tempo-bounds{grid-template-columns:1fr 1fr}
body[data-screen-tool=conductor] .screen-options-dialog .mode-btn{min-height:30px;padding:5px;font-size:12px}
body[data-screen-tool=conductor] .screen-options-dialog .mode-switch{margin:0}
@media(max-width:600px){
 body[data-screen-tool=conductor] .top{display:flex;flex-wrap:wrap;gap:5px}
 body[data-screen-tool=conductor] .title h1{font-size:19px}
 body[data-screen-tool=conductor] .layout{grid-template-columns:1fr;grid-template-rows:minmax(150px,1fr) auto}
 body[data-screen-tool=conductor] .side{display:grid;grid-template-columns:90px 1fr;gap:5px}
 body[data-screen-tool=conductor] .metrics{grid-template-columns:1fr;gap:5px}
 body[data-screen-tool=conductor] .metric .value{font-size:25px}
 body[data-screen-tool=conductor] .conductor-player{padding:6px}
 body[data-screen-tool=conductor] .empty p{font-size:12px;line-height:1.35}
}
@media(max-height:450px){
 body[data-screen-tool=conductor] .layout{grid-template-columns:minmax(0,1fr) 300px}
 body[data-screen-tool=conductor] .metrics{display:grid;grid-template-columns:1fr 1fr}
 body[data-screen-tool=conductor] .metric{padding:3px}
 body[data-screen-tool=conductor] .metric .value{font-size:24px}
 body[data-screen-tool=conductor] .metric .unit,body[data-screen-tool=conductor] .bar-count{display:none}
 body[data-screen-tool=conductor] .conductor-player .row{margin:3px 0}
 body[data-screen-tool=conductor] .score-info{display:none}
 body[data-screen-tool=conductor] .screen-options-dialog .collapsible-panel details{display:grid;grid-template-columns:1fr 1fr;gap:5px 14px}
 body[data-screen-tool=conductor] .screen-options-dialog summary{grid-column:1/-1;margin:0!important}
 body[data-screen-tool=conductor] .screen-options-dialog .row{grid-template-columns:100px 1fr;margin:0}
 body[data-screen-tool=conductor] .screen-options-dialog .hint{margin:0;font-size:10px}
}
@media(max-height:600px){
 body[data-screen-tool=solfege-trainer] .training-navigation{margin:0}
 body[data-screen-tool=solfege-trainer] .stage{min-height:0;padding:4px}
 body[data-screen-tool=solfege-trainer] .notes{margin-top:4px}
 body[data-screen-tool=solfege-trainer] .note{min-height:42px;padding:4px}
 body[data-screen-tool=solfege-trainer] .note .latin{font-size:20px}
 body[data-screen-tool=solfege-trainer] .note .hz{display:none}
 body[data-screen-tool=solfege-trainer] #currentNote{font-size:32px!important}
 body[data-screen-tool=solfege-trainer] #currentHint{display:none}
 body[data-screen-tool=solfege-trainer] .staff-panel{margin-top:4px;padding:4px}
 body[data-screen-tool=solfege-trainer] .controls{gap:4px;margin-top:4px}
 body[data-screen-tool=solfege-trainer] .controls button{padding:5px 8px;font-size:12px}
 body[data-screen-tool=solfege-trainer] .row{margin-top:4px;gap:5px;font-size:12px}
 body[data-screen-tool=solfege-trainer] .progress{margin:4px 0;height:4px}
}
@media(min-width:650px) and (max-height:650px){
 body[data-screen-tool=solfege-trainer] .grid>section{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-rows:repeat(6,auto);gap:4px 8px;align-content:center}
 body[data-screen-tool=solfege-trainer] .stage{grid-column:1;grid-row:1;padding:3px;min-height:0}
 body[data-screen-tool=solfege-trainer] #currentNote{font-size:28px!important}
 body[data-screen-tool=solfege-trainer] .chord{font-size:24px}
 body[data-screen-tool=solfege-trainer] .staff-panel{grid-column:1;grid-row:2/7;margin:0;min-height:0;padding:3px}
 body[data-screen-tool=solfege-trainer] .staff-svg{height:160px}
 body[data-screen-tool=solfege-trainer] .grid>section>:not(.stage):not(.staff-panel):not(.notes){grid-column:2}
 body[data-screen-tool=solfege-trainer] .grid>section>.progress{grid-row:1}
 body[data-screen-tool=solfege-trainer] .grid>section>.controls{grid-row:2}
 body[data-screen-tool=solfege-trainer] .keyboard{height:65px}
}
/* The book already has chapter navigation; fit the current spread, not a tall page. */
body[data-screen-tool=solfege-book]{height:var(--studio-app-height);min-height:0;overflow:visible;padding:0!important}
body[data-screen-tool=solfege-trainer] .app{height:calc(100% - 26px)}
body[data-screen-tool=ranges] .octave-marker:last-child{max-width:100%;right:0}
body[data-screen-tool=clef-trainer] .screen-options-dialog .tool-group{margin:10px 0;display:flex;align-items:center;gap:10px;justify-content:center}
body[data-screen-tool=clef-trainer] .screen-options-dialog .color-dot{width:28px;height:28px}
@media(max-height:500px){body[data-screen-tool=clef-trainer] .header-actions .btn-action{height:26px;min-height:26px;padding:3px 6px;font-size:11px}body[data-screen-tool=clef-trainer] .app-header h1{font-size:17px!important;line-height:1.1}body[data-screen-tool=clef-trainer] .header-inner{min-height:26px}}
body[data-screen-tool=piano-visual-companion]{height:var(--studio-app-height);min-height:0;padding:0!important}
body[data-screen-tool=piano-visual-companion] .ui{inset:54px 0 0;padding:12px 16px 28px;box-sizing:border-box;overflow:visible}
body[data-screen-tool=piano-visual-companion] .ui>.top{gap:12px;align-items:center;flex-wrap:wrap}
body[data-screen-tool=piano-visual-companion] .ui .screen-options-open{pointer-events:auto}
body[data-screen-tool=piano-visual-companion] .ui h1{font-size:24px;line-height:1.2;margin:0}
body[data-screen-tool=piano-visual-companion] .ui .sub{font-size:13px;margin:4px 0}
body[data-screen-tool=piano-visual-companion] .ui .panel{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px;width:min(850px,100%);padding:10px;box-sizing:border-box;max-height:none;overflow:visible}
body[data-screen-tool=piano-visual-companion] .ui .themes{grid-column:1/-1;gap:7px;margin:0}
body[data-screen-tool=piano-visual-companion] .ui .panel>button,body[data-screen-tool=piano-visual-companion] .ui .panel>select{min-height:34px;padding:7px;margin:0;font-size:13px;width:100%;min-width:0}
body[data-screen-tool=piano-visual-companion] #status{grid-column:1/-1;font-size:12px;line-height:1.4;margin:0;min-height:0}
body[data-screen-tool=piano-visual-companion]>footer{position:fixed;inset:auto 0 0;padding:2px!important;margin:0!important;line-height:14px!important;font-size:10px!important;background:#151e2c}
.companion-topic-choice{width:100%;font:14px 'Segoe UI';padding:7px;background:var(--panel);color:var(--text);border:1px solid #637b99;border-radius:8px;margin-bottom:10px}
.companion-options-group{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.companion-options-group[hidden]{display:none}
.companion-option-field{display:flex;flex-direction:column;gap:5px;min-width:0}
.companion-option-field label{font-size:13px;margin:0}
.companion-option-field input,.companion-option-field select,.companion-option-field button{width:100%;min-width:0;box-sizing:border-box;font:13px 'Segoe UI';margin:0!important;padding:7px;background:var(--panel);color:var(--text);border:1px solid #637b99;border-radius:7px;min-height:30px}
.companion-option-field input[type=range]{padding:0;background:none;accent-color:#50dbcf}
@media(max-width:600px){body[data-screen-tool=piano-visual-companion] .ui{padding:8px 8px 26px}body[data-screen-tool=piano-visual-companion] .ui .panel{grid-template-columns:1fr 1fr;padding:8px}body[data-screen-tool=piano-visual-companion] .ui .panel>select{grid-column:1/-1}body[data-screen-tool=piano-visual-companion] .ui h1{font-size:21px}body[data-screen-tool=piano-visual-companion] .ui .meter{max-width:120px}}
@media(max-height:500px){body[data-screen-tool=piano-visual-companion] .ui{padding:6px 10px 24px}body[data-screen-tool=piano-visual-companion] .ui h1{font-size:18px}body[data-screen-tool=piano-visual-companion] .ui .sub{display:none}body[data-screen-tool=piano-visual-companion] .ui .panel{padding:6px;gap:5px}.companion-options-group{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.companion-option-field label{font-size:12px}.companion-option-field input,.companion-option-field select,.companion-option-field button{font-size:12px;padding:5px}}
body[data-screen-tool=rhythm-reading-trainer]{height:var(--studio-app-height);min-height:0;padding:5px 8px!important}
body[data-screen-tool=rhythm-reading-trainer]>.wrap{height:100%;min-height:0;gap:4px}
body[data-screen-tool=rhythm-reading-trainer] .wrap>.row:not(:has(*)){display:none}
body[data-screen-tool=rhythm-reading-trainer] .wrap>h1{position:static;transform:none;text-align:center;font-size:20px;line-height:1.2;margin:0;flex:none}
body[data-screen-tool=rhythm-reading-trainer] .tagline{display:none}
body[data-screen-tool=rhythm-reading-trainer] .rhythm-workspace{gap:7px}
body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice{min-height:0;padding:7px;gap:4px;overflow:visible}
body[data-screen-tool=rhythm-reading-trainer] .modebar{margin:0;gap:4px}
body[data-screen-tool=rhythm-reading-trainer] .modebar button{padding:5px 8px;font-size:12px}
body[data-screen-tool=rhythm-reading-trainer] .score-wrap{height:0!important;min-height:100px!important;flex:1!important;margin:0;padding:8px!important;box-sizing:border-box;overflow:visible}
body[data-screen-tool=rhythm-reading-trainer] #score{height:100%!important;min-height:0!important;display:flex;align-items:center;justify-content:center}
body[data-screen-tool=rhythm-reading-trainer] #score svg{height:100%!important;max-height:100%}
body[data-screen-tool=rhythm-reading-trainer] .stage{padding:0;margin:0;flex:none}
body[data-screen-tool=rhythm-reading-trainer] .transport{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px;margin:4px 0}
body[data-screen-tool=rhythm-reading-trainer] .transport button{padding:5px 9px;font-size:12px;min-height:30px;height:auto;margin:0}
body[data-screen-tool=rhythm-reading-trainer] .transport select{font-size:12px;padding:4px;min-width:0;max-width:140px}
body[data-screen-tool=rhythm-reading-trainer] .transport label{font-size:12px}
body[data-screen-tool=rhythm-reading-trainer] .tappad{height:42px;margin:4px auto 0}
body[data-screen-tool=rhythm-reading-trainer] .feedback{min-height:18px;margin:0;font-size:12px}
body[data-screen-tool=rhythm-reading-trainer] .phaselabel{font-size:12px;min-height:18px}
body[data-screen-tool=rhythm-reading-trainer] .rhythm-rail{padding:7px;gap:5px}
body[data-screen-tool=rhythm-reading-trainer] .rhythm-rail .field>span{font-size:11px}
body[data-screen-tool=rhythm-reading-trainer] .rhythm-rail select{min-height:26px;padding:3px;font-size:12px}
@media(max-height:500px){
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice .mode-hint{display:none}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-workspace{grid-template-columns:minmax(0,1fr) 280px}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-rail{display:grid;grid-template-columns:1fr 1fr;gap:4px;align-content:center}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-rail>*{min-width:0}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-rail>.panel{grid-column:1/-1}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-rail .ctlbtn{font-size:10px;padding:4px;line-height:1.3}
 body[data-screen-tool=rhythm-reading-trainer] .tappad{height:30px}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-rail .field{gap:1px}
}
body[data-screen-tool=euclidean-rhythms]{height:var(--studio-app-height);min-height:0;padding:5px 8px!important;display:flex;flex-direction:column;gap:4px}
body[data-screen-tool=euclidean-rhythms]>.euclidean-app-controls{display:none}
body[data-screen-tool=euclidean-rhythms]>h1{font-size:21px;line-height:1.2;margin:0;text-align:center;flex:none}
body[data-screen-tool=euclidean-rhythms]>.subtitle{font-size:11px;line-height:1.2;margin:0;flex:none}
body[data-screen-tool=euclidean-rhythms] .workspace{flex:1;min-height:0;width:100%;max-width:1700px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
body[data-screen-tool=euclidean-rhythms] .panel{padding:8px;min-width:0;min-height:0;max-width:none}
body[data-screen-tool=euclidean-rhythms] .controls-panel{gap:5px;display:flex;flex-direction:column}
body[data-screen-tool=euclidean-rhythms] .master-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px;flex:none}
body[data-screen-tool=euclidean-rhythms] .master-bar>button{font-size:12px;padding:5px 8px;min-height:28px}
body[data-screen-tool=euclidean-rhythms] .control-group{min-width:0;gap:3px}
body[data-screen-tool=euclidean-rhythms] .control-group label{font-size:11px}
body[data-screen-tool=euclidean-rhythms] .visual-panel{height:100%;min-height:0;padding:8px}
body[data-screen-tool=euclidean-rhythms] .panel{box-sizing:border-box}
body[data-screen-tool=euclidean-rhythms] #visualizer{display:block;box-sizing:border-box;min-height:0}
body[data-screen-tool=euclidean-rhythms] .workspace{align-items:stretch}
body[data-screen-tool=euclidean-rhythms]>#mms-home-spacer{display:none!important}
body[data-screen-tool=euclidean-rhythms] .master-bar{flex-direction:row!important}
body[data-screen-tool=euclidean-rhythms] .master-bar>button{width:auto!important}
body[data-screen-tool=euclidean-rhythms] .master-bar .control-group{width:auto!important;flex:1 1 95px;align-items:center;justify-content:center}
body[data-screen-tool=euclidean-rhythms] .master-bar .control-group input[type=range]{min-width:0;width:100px!important;height:20px;margin:0}
body[data-screen-tool=euclidean-rhythms] .euclidean-tempo-knob{width:42px!important;height:42px!important;font-size:14px}
body[data-screen-tool=euclidean-rhythms] #visualizer{transform:none!important;width:100%!important;height:100%!important}
body[data-screen-tool=euclidean-rhythms] #visualizer{width:100%;height:100%;max-width:none;max-height:none}
body[data-screen-tool=euclidean-rhythms] .track-list{max-height:none;min-height:0;flex:1;display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:minmax(0,1fr);gap:6px;overflow:visible;padding:0}
body[data-screen-tool=euclidean-rhythms] .track-card{min-height:0;min-width:0;padding:7px;gap:6px;justify-content:center}
body[data-screen-tool=euclidean-rhythms] .track-title{font-size:13px;gap:5px;min-width:0}
body[data-screen-tool=euclidean-rhythms] .track-title small{font-size:10px}
body[data-screen-tool=euclidean-rhythms] .track-params{grid-template-columns:1fr 70px;gap:6px;font-size:11px}
body[data-screen-tool=euclidean-rhythms] .track-params input,body[data-screen-tool=euclidean-rhythms] .track-params select{min-width:0;width:100%;padding:4px;height:28px;font-size:12px;box-sizing:border-box}
body[data-screen-tool=euclidean-rhythms] .add-track{padding:5px;font-size:12px;flex:none;margin:0}
body[data-screen-tool=euclidean-rhythms] .euclidean-track-choice{display:none;font:14px 'Segoe UI';padding:6px;background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:8px}
body[data-screen-tool=euclidean-rhythms] footer{margin:0!important;padding:2px!important;font-size:10px!important;line-height:14px!important;flex:none}
body[data-screen-tool=euclidean-rhythms] .screen-options-dialog .storage-panel{display:flex;flex-wrap:wrap;padding:6px;gap:7px}
body[data-screen-tool=theremin]{height:var(--studio-app-height);min-height:0;padding:5px 8px!important;display:flex;flex-direction:column;gap:5px;overflow:visible}
body[data-screen-tool=theremin]>#mms-home-spacer{display:none!important}
body[data-screen-tool=theremin] .app-hero{padding:6px 12px;min-height:0;flex:none;margin:0}
body[data-screen-tool=theremin] .app-hero .hero-copy{position:static;inset:auto;transform:none;width:100%}
body[data-screen-tool=theremin] .app-hero h1{font-size:22px!important;margin:0!important;line-height:1.2}
body[data-screen-tool=theremin] .app-hero p{font-size:12px;margin:3px 0;line-height:1.3}
body[data-screen-tool=theremin] .pro-badge{font-size:9px}
body[data-screen-tool=theremin] .edition-strip{margin:0;padding:4px 8px;min-height:0;gap:6px;flex:none}
body[data-screen-tool=theremin] .edition-strip-summary{font-size:10px;gap:6px;line-height:1.3}
body[data-screen-tool=theremin] .edition-pro-coming-soon{padding:4px 7px;min-height:0;line-height:1.2}
body[data-screen-tool=theremin] .edition-pro-coming-soon strong{font-size:10px}
body[data-screen-tool=theremin] .edition-pro-coming-soon span{font-size:9px}
body[data-screen-tool=theremin] .edition-pro-info summary{padding:4px;font-size:10px}
body[data-screen-tool=theremin] .main-container{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.85fr) minmax(340px,.95fr)!important;gap:8px;width:100%;direction:ltr}
body[data-screen-tool=theremin] .col-visual{display:flex;flex-direction:column;min-height:0;width:100%;gap:5px}
body[data-screen-tool=theremin] #status{padding:5px;min-height:0;font-size:12px;flex:none}
body[data-screen-tool=theremin] .video-container{flex:1;min-height:0;height:0;max-height:none!important;aspect-ratio:auto;margin:0;width:100%;box-sizing:border-box}
body[data-screen-tool=theremin] .video-container video,body[data-screen-tool=theremin] .video-container canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
body[data-screen-tool=theremin] .col-settings{height:100%;min-height:0;overflow:visible;width:auto;display:flex;flex-direction:column;gap:5px;direction:rtl}
body[data-screen-tool=theremin] .col-settings>.panel{margin:0;min-height:0;padding:8px}
/* Readouts occupy the spare space below the controls, beside the camera. */
body[data-screen-tool=theremin] .theremin-readouts{position:relative;flex:1;min-height:0;min-width:0;display:flex;flex-direction:column;gap:8px}
body[data-screen-tool=theremin] .theremin-readouts #staff-container{flex:1;min-height:0;height:auto;max-height:300px;margin:0;padding:5px;overflow:hidden}
body[data-screen-tool=theremin] .theremin-readouts #staff-container svg{display:block;width:100%;height:100%;max-height:100%;max-width:100%}
body[data-screen-tool=theremin] .theremin-readouts .harmony-progression-display{display:flex;flex-direction:column;align-items:stretch;flex:none;min-height:0;min-width:0;margin:0;padding:8px;gap:6px}
body[data-screen-tool=theremin] .theremin-readouts .harmony-progression-heading{gap:2px}
body[data-screen-tool=theremin] .theremin-readouts .harmony-progression-heading strong{font-size:14px}
body[data-screen-tool=theremin] .theremin-readouts .harmony-progression-chords{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;padding:0}
body[data-screen-tool=theremin] .theremin-readouts .harmony-progression-chord{min-height:42px;padding:12px 4px 5px;gap:4px;font-size:17px}
body[data-screen-tool=theremin] .theremin-readouts .harmony-progression-degree{padding:2px 4px;min-width:0;font-size:11px}
body[data-screen-tool=theremin] .theremin-readouts>.theremin-inline-settings{position:absolute!important;inset:0!important;box-sizing:border-box;width:100%;height:100%;min-height:0;max-width:none;max-height:none;margin:0;padding:8px;z-index:20;overflow:auto;pointer-events:auto}
body[data-screen-tool=theremin] .theremin-inline-settings .panel{margin:0;padding:6px}
body[data-screen-tool=theremin] .theremin-inline-settings .panel h3{display:none}
body[data-screen-tool=theremin] .theremin-inline-settings .audio-device-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
body[data-screen-tool=theremin] .theremin-inline-settings .audio-health{font-size:10px;line-height:1.25;padding:4px;margin:4px 0}
body[data-screen-tool=theremin] .theremin-inline-settings .audio-health>div{padding:3px}
body[data-screen-tool=theremin] .theremin-inline-settings .slider-group{margin:5px 0}
body[data-screen-tool=theremin] .theremin-inline-settings :is(input,select){max-width:100%;min-width:0}
body[data-screen-tool=theremin] .theremin-inline-settings .audio-device-grid>.audio-output-wrap{grid-column:1/-1;width:100%}
body[data-screen-tool=theremin] .theremin-inline-settings .audio-output-wrap select{width:100%}
body[data-screen-tool=theremin] .theremin-inline-settings .theremin-setting-choice,body[data-screen-tool=theremin] .theremin-inline-settings .theremin-subtopic-choice{width:100%;height:29px;min-height:29px;padding:3px 5px;margin:4px 0;font-size:12px}
@media(max-width:650px) and (min-height:451px){
 body[data-screen-tool=theremin] .col-settings{position:relative}
 body[data-screen-tool=theremin] .theremin-readouts{position:absolute;bottom:calc(100% + 8px);inset-inline:0;max-height:260px;z-index:8;pointer-events:none}
 body[data-screen-tool=theremin] .theremin-readouts #staff-container{height:140px;flex:none}
 body[data-screen-tool=theremin] .theremin-readouts:has(.theremin-inline-settings[open]){height:260px}
}
body[data-screen-tool=theremin] .top-controls-btns{gap:5px;display:flex;flex-wrap:wrap}
body[data-screen-tool=theremin] .top-controls-btns button{padding:6px 8px;font-size:12px;min-height:30px}
body[data-screen-tool=theremin] .theremin-audio-actions{display:flex;gap:5px;flex-basis:100%;width:100%;grid-column:1/-1}
body[data-screen-tool=theremin] .theremin-audio-actions button{flex:1;min-width:0;border:1px solid var(--border);background:var(--panel);color:var(--text)}
body[data-screen-tool=theremin] .theremin-audio-actions button[aria-expanded=true]{border-color:var(--accent,#2dd4bf);box-shadow:inset 0 0 0 1px var(--accent,#2dd4bf)}
body[data-screen-tool=theremin] .harmony-main-controls{margin-top:7px;padding:6px;gap:6px}
body[data-screen-tool=theremin] .harmony-main-key-button{min-height:30px;padding:6px;font-size:12px}
body[data-screen-tool=theremin] .harmony-main-controls label{font-size:12px}
body[data-screen-tool=theremin]>footer{flex:none;margin:0!important;padding:2px!important;font-size:10px!important;line-height:14px!important}
body[data-screen-tool=theremin] .screen-options-dialog .panel{margin:8px 0;padding:8px;font-size:12px}
body[data-screen-tool=theremin] .screen-options-dialog h3{font-size:15px;margin:3px 0}
body[data-screen-tool=theremin] .screen-options-dialog input,body[data-screen-tool=theremin] .screen-options-dialog select{min-width:0;max-width:100%;font-size:12px;padding:4px;min-height:26px}
body[data-screen-tool=theremin] .screen-options-dialog .audio-device-grid{gap:7px}
body[data-screen-tool=theremin] .screen-options-dialog .audio-health{margin:5px 0;padding:6px;font-size:11px}
body[data-screen-tool=theremin] .screen-options-dialog .sub-header{margin:5px 0}
body[data-screen-tool=theremin] .screen-options-dialog .edition-locked-panel{display:none}
body[data-screen-tool=theremin] .screen-options-dialog .theremin-setting-choice{width:100%;padding:6px;background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:8px;font-size:14px}
body[data-screen-tool=theremin] .theremin-inline-settings>header{margin-bottom:4px}
body[data-screen-tool=theremin] .theremin-inline-settings>header button{height:28px;min-height:28px;padding:0 8px;font-size:19px}
body[data-screen-tool=theremin] .screen-options-dialog.theremin-inline-settings .panel{margin:0;padding:6px}
body[data-screen-tool=theremin] .theremin-inline-settings .theremin-settings-group>.sub-header{display:none}
body[data-screen-tool=theremin] .screen-options-dialog.theremin-inline-settings .audio-health{padding:3px;margin:3px 0;font-size:10px}
body[data-screen-tool=theremin] .theremin-inline-settings .audio-status-line{margin-top:3px;font-size:10px;line-height:1.25}
body[data-screen-tool=theremin] .theremin-inline-settings #scales-hand-panel .flex-row{gap:5px;margin-bottom:4px}
body[data-screen-tool=theremin] .theremin-inline-settings .finger-count-control{padding:3px 6px;gap:6px}
body[data-screen-tool=theremin] .theremin-inline-settings .pitch-visual-controls{margin:3px 0;gap:5px}
/* Lay out the native fields together, keeping their labels and event handlers. */
body[data-screen-tool=theremin] .theremin-inline-settings #scales-hand-panel:not([hidden]){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;align-items:center}
body[data-screen-tool=theremin] .theremin-inline-settings #scales-hand-panel>.flex-row,body[data-screen-tool=theremin] .theremin-inline-settings #scales-hand-panel>.pitch-visual-controls{display:contents}
body[data-screen-tool=theremin] .theremin-inline-settings #pitch-axis-mode{grid-area:1/1}
body[data-screen-tool=theremin] .theremin-inline-settings #left-zone-mode{grid-area:1/2}
body[data-screen-tool=theremin] .theremin-inline-settings #scales-hand-panel .finger-count-control{grid-area:2/1/3/-1;grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}
body[data-screen-tool=theremin] .theremin-inline-settings .finger-count-control label{min-width:0;gap:5px;font-size:12px}
body[data-screen-tool=theremin] .theremin-inline-settings .finger-hand-icon{width:22px;height:22px;flex-basis:22px;font-size:15px;border-radius:6px}
body[data-screen-tool=theremin] .theremin-inline-settings #max-fingers{min-height:28px}
body[data-screen-tool=theremin] .theremin-inline-settings #scale-root{grid-area:3/1}
body[data-screen-tool=theremin] .theremin-inline-settings #scale-type{grid-area:3/2}
body[data-screen-tool=theremin] .theremin-inline-settings #scales-hand-panel .pitch-visual-controls>label{grid-area:4/1;font-size:12px;line-height:1.2}
body[data-screen-tool=theremin] .theremin-inline-settings #note-name-mode{grid-area:4/2}
body[data-screen-tool=theremin] .theremin-settings-navigation{display:flex;gap:4px;align-items:center;margin:2px 0}
body[data-screen-tool=theremin] .theremin-settings-navigation>select{width:0;flex:1;min-width:0;margin:0;font-size:12px}
body[data-screen-tool=theremin] .theremin-inline-settings .panel>.flex-row{margin-bottom:4px}
body[data-screen-tool=theremin] .theremin-inline-settings .slider-group{margin:4px 0!important}
body[data-screen-tool=theremin] .theremin-inline-settings .edition-inline-lock{margin-top:3px;padding:2px 5px;font-size:10px;line-height:1.2}
body[data-screen-tool=theremin] .theremin-inline-settings .edition-inline-lock span{padding:1px 3px;margin-inline-end:4px}
@media(min-width:651px) and (max-height:650px){
 body[data-screen-tool=theremin] .edition-strip{display:none}
 body[data-screen-tool=theremin] .theremin-readouts>.theremin-inline-settings{padding:6px}
 body[data-screen-tool=theremin] .top-controls-btns{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
 body[data-screen-tool=theremin] .top-controls-btns button{min-width:0!important;padding:4px;line-height:1.2}
 body[data-screen-tool=theremin] .harmony-main-controls{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:4px;margin-top:4px}
 body[data-screen-tool=theremin] .harmony-main-controls button{min-width:0;padding:4px}
 body[data-screen-tool=theremin] .harmony-main-controls>label{grid-column:span 2;grid-template-columns:auto minmax(0,1fr) 30px;gap:4px}
 body[data-screen-tool=theremin] .harmony-main-controls .harmony-key-control{grid-column:3/5;grid-row:1;grid-template-columns:auto minmax(0,1fr)}
 body[data-screen-tool=theremin] .harmony-main-controls input{min-width:0}
 body[data-screen-tool=theremin] .harmony-main-controls output{min-width:0}
 body[data-screen-tool=theremin] .harmony-main-status{grid-column:1/-1;font-size:10px}
}
@media(max-width:950px),(max-height:560px){
 body[data-screen-tool=theremin] .theremin-readouts>.theremin-inline-settings{position:fixed!important;inset:calc(var(--studio-shell-height,54px) + 8px) 8px auto!important;width:auto;height:auto;max-height:calc(100dvh - var(--studio-shell-height,54px) - 16px);max-width:none;z-index:60;overflow:auto;background:var(--bg-controls,#202b3b)}
 body[data-screen-tool=theremin] .theremin-inline-settings>header button{min-width:44px;min-height:44px;height:44px}
}
body[data-screen-tool=theremin] [hidden]{display:none!important}
/* Softer groups keep camera and accompaniment as the two primary actions. */
body[data-screen-tool=theremin] .top-controls-btns button{--theremin-button-tint:#91b8c7;background:color-mix(in srgb,var(--theremin-button-tint) 20%,var(--panel))!important;border:1px solid color-mix(in srgb,var(--theremin-button-tint) 60%,var(--border))!important;color:var(--text)!important;font-weight:600}
body[data-screen-tool=theremin] #toggle-staff-btn{--theremin-button-tint:#adc29c}
body[data-screen-tool=theremin] #toggle-harmony-progression-btn{--theremin-button-tint:#c3a6cc}
body[data-screen-tool=theremin] #harmony-toggle-btn,body[data-screen-tool=theremin] .screen-options-open{--theremin-button-tint:#b4a1d2}
body[data-screen-tool=theremin] .top-controls-btns #harmony-toggle-btn{background:color-mix(in srgb,var(--theremin-button-tint) 20%,var(--panel))!important;border:1px solid color-mix(in srgb,var(--theremin-button-tint) 60%,var(--border))!important;color:var(--text)!important}
body[data-screen-tool=theremin] .theremin-sound-open{--theremin-button-tint:#97acd4}
body[data-screen-tool=theremin] .theremin-audio-actions button:first-child{--theremin-button-tint:#d3b78c}
body[data-screen-tool=theremin] .theremin-audio-actions button:last-child{--theremin-button-tint:#8fbcaf}
body[data-screen-tool=theremin] #panic-btn,body[data-screen-tool=theremin] #harmony-main-stop{--theremin-button-tint:#bc96a3;background:color-mix(in srgb,#bc96a3 18%,var(--panel))!important;border:1px solid color-mix(in srgb,#bc96a3 55%,var(--border))!important;color:var(--text)!important}
body[data-screen-tool=theremin] .top-controls-btns button[aria-expanded=true]{background:color-mix(in srgb,var(--theremin-button-tint) 34%,var(--panel))!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--theremin-button-tint) 65%,transparent)}
body[data-screen-tool=theremin] #start-btn{background:#2b7893!important;color:#f2fbfd!important;border:1px solid #98d9e5!important;box-shadow:0 2px 9px #14394d66,inset 0 1px #d8f7fb25;font-weight:800}
body[data-screen-tool=theremin] #harmony-main-play{--mms-play-background:#327e68;background:#327e68!important;color:#f1fbf6!important;border:1px solid #9bd7bd!important;box-shadow:0 2px 9px #153d3266,inset 0 1px #d8f8e825;font-weight:800}
body[data-screen-tool=theremin] #harmony-main-play.is-playing{--mms-play-background:#3b8b71;background:#3b8b71!important;border-color:#b7ead1!important}
body[data-screen-tool=theremin] :is(#start-btn,#harmony-main-play):hover{filter:brightness(1.12)}
body[data-screen-tool=tuner]{height:var(--studio-app-height);min-height:0;padding:0!important;display:flex;flex-direction:column}
body[data-screen-tool=tuner] .wrap{padding:6px 10px!important;flex:1;min-height:0;box-sizing:border-box;width:100%;align-content:start}
body[data-screen-tool=tuner] footer{margin:0!important;padding:2px!important;font-size:10px!important;line-height:14px!important;flex:none}
body[data-screen-tool=sharp-flat-trick]{height:var(--studio-app-height);min-height:0!important;padding:5px 8px!important;display:flex;flex-direction:column}
body[data-screen-tool=sharp-flat-trick] #trick{flex:1;min-height:0;width:100%;gap:5px}
body[data-screen-tool=sharp-flat-trick] .page-head{padding:0!important;min-height:27px}
body[data-screen-tool=sharp-flat-trick] .page-head h1{font-size:21px;margin:0;line-height:1.25}
body[data-screen-tool=sharp-flat-trick] .page-head .sub{font-size:11px;margin:0}
body[data-screen-tool=sharp-flat-trick] .key-lesson-workspace{min-height:0;flex:1}
body[data-screen-tool=sharp-flat-trick] footer{margin:0!important;padding:2px!important;font-size:10px!important;line-height:14px!important;flex:none}
@media(max-height:500px){
 body[data-screen-tool=sharp-flat-trick] .key-lesson-workspace #keyboard{height:90px}
 body[data-screen-tool=sharp-flat-trick] .key-always-staff .staff-svg{height:90px!important}
 body[data-screen-tool=sharp-flat-trick] .keyboard-wrap>.key-always-staff{padding:3px;margin-top:4px}
 body[data-screen-tool=sharp-flat-trick] .key-choice-guide{padding:4px;margin-bottom:4px}
 body[data-screen-tool=sharp-flat-trick] .key-choice-guide p{font-size:10px;line-height:1.2}
 body[data-screen-tool=sharp-flat-trick] .key-lesson-menu{padding:5px}
 body[data-screen-tool=sharp-flat-trick] .keyboard-wrap{padding:6px!important}
 body[data-screen-tool=sharp-flat-trick] .page-head h1{font-size:17px}
}
body[data-screen-tool=rhythm]{height:var(--studio-app-height);min-height:0;padding:5px 8px!important}
body[data-screen-tool=rhythm] .engine-header{height:27px;min-height:27px}
body[data-screen-tool=rhythm] .engine-header h1{position:static;transform:none;text-align:center;margin:0;font-size:20px}
body[data-screen-tool=rhythm] .visualizers-wrapper{min-height:90px}
body[data-screen-tool=rhythm] footer{padding:2px!important;margin:0!important;font-size:10px!important;line-height:14px!important}
@media(max-height:500px){
 body[data-screen-tool=rhythm] .engine-header{height:23px;min-height:23px}
 body[data-screen-tool=rhythm] .engine-header h1{font-size:17px;line-height:1.2}
 body[data-screen-tool=rhythm] .engine-quick-controls{gap:3px 6px;padding:3px}
 body[data-screen-tool=rhythm] .engine-quick-controls select,body[data-screen-tool=rhythm] .engine-quick-controls input{font-size:11px;padding:2px}
 body[data-screen-tool=rhythm] .rhythm-action-row{padding:3px;gap:4px}
 body[data-screen-tool=rhythm] .engine-quick-controls .control-group{flex-direction:row!important;font-size:10px}
 body[data-screen-tool=rhythm]>#barsContainer{zoom:1}
 body[data-screen-tool=rhythm]>#barsContainer .beat-card{padding:3px}
 body[data-screen-tool=rhythm]>#barsContainer .bar-card{padding:4px}
 body[data-screen-tool=rhythm]>#barsContainer .sub-step{height:14px}
 body[data-screen-tool=rhythm]>#barsContainer .beat-header{font-size:10px}
 body[data-screen-tool=rhythm]>#barsContainer .beat-header select{font-size:10px;padding:0}
}
@media(max-width:650px){
 body[data-screen-tool=theremin] .main-container{grid-template-columns:1fr!important;grid-template-rows:minmax(0,1fr) auto}
 body[data-screen-tool=theremin] .col-settings{height:auto}
 body[data-screen-tool=theremin] .app-hero p{font-size:11px}
 body[data-screen-tool=theremin] .edition-strip{display:none}
 body[data-screen-tool=theremin] .top-controls-btns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
 body[data-screen-tool=theremin] .harmony-main-controls{margin-top:5px}
}
@media(max-height:450px){
 body[data-screen-tool=theremin] .app-hero h1{font-size:18px}
 body[data-screen-tool=theremin] .app-hero p,body[data-screen-tool=theremin] .edition-strip{display:none}
 body[data-screen-tool=theremin] .main-container{grid-template-columns:minmax(0,1fr) 290px!important}
 body[data-screen-tool=theremin] .col-settings>.panel{padding:6px}
 body[data-screen-tool=theremin] .harmony-main-controls{padding:4px;margin-top:4px;gap:4px}
 body[data-screen-tool=theremin] .screen-options-dialog .audio-device-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 body[data-screen-tool=theremin] .screen-options-dialog .audio-health,body[data-screen-tool=theremin] .screen-options-dialog .audio-status-line{font-size:10px;margin:3px 0;padding:3px}
 body[data-screen-tool=theremin] .screen-options-dialog .panel{padding:4px;margin:4px 0}
 body[data-screen-tool=theremin] .theremin-readouts>.theremin-inline-settings{position:fixed!important;inset:62px 8px 8px!important;width:auto;height:auto;padding:6px}
}
@media(max-width:1100px),(max-height:600px){
 body[data-screen-tool=euclidean-rhythms] .euclidean-track-choice{display:block;flex:none}
 body[data-screen-tool=euclidean-rhythms] .track-list{display:flex;flex-direction:column;justify-content:center}
 body[data-screen-tool=euclidean-rhythms] .track-card{flex:1;gap:10px}
 body[data-screen-tool=euclidean-rhythms] .track-card[data-track-selected=false]{display:none}
 body[data-screen-tool=euclidean-rhythms] .track-params{grid-template-columns:1fr 90px;gap:8px;font-size:13px}
 body[data-screen-tool=euclidean-rhythms] .track-instrument-icon{width:36px;height:36px}
}
@media(max-width:600px){
 body[data-screen-tool=euclidean-rhythms] .workspace{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) minmax(270px,1fr)}
 body[data-screen-tool=euclidean-rhythms] .visual-panel{grid-column:1;grid-row:1}
 body[data-screen-tool=euclidean-rhythms] .controls-panel{grid-column:1;grid-row:2}
 body[data-screen-tool=euclidean-rhythms] .master-bar{gap:6px}
 body[data-screen-tool=euclidean-rhythms]>.subtitle{display:none}
}
@media(max-height:450px){
 body[data-screen-tool=euclidean-rhythms]>.subtitle{display:none}
 body[data-screen-tool=euclidean-rhythms] .track-card{padding:5px;gap:4px}
 body[data-screen-tool=euclidean-rhythms] .track-title small{display:none}
 body[data-screen-tool=euclidean-rhythms] .track-params{font-size:11px}
 body[data-screen-tool=euclidean-rhythms] .master-bar{padding:4px;gap:4px}
 body[data-screen-tool=euclidean-rhythms] .euclidean-track-choice{padding:4px;font-size:12px}
}
body[data-screen-tool=solfege-book] .app{height:calc(var(--studio-app-height) - 22px);min-height:0;grid-template-rows:34px minmax(0,1fr) 36px;gap:5px}
body[data-screen-tool=solfege-book] .stage{min-height:0;margin:0 auto;max-height:100%;width:calc(100% - 20px)}
body[data-screen-tool=solfege-book] .bar{min-height:0;width:calc(100% - 20px);padding:3px 0}
body[data-screen-tool=solfege-book] .nav{width:min(620px,calc(100% - 20px));gap:12px;grid-template-columns:100px 1fr 100px}
body[data-screen-tool=solfege-book] .nav>button{height:32px;font-size:13px}
body[data-screen-tool=solfege-book] .hint{display:none}
body[data-screen-tool=solfege-book] .cover{padding:5% 7%}
body[data-screen-tool=solfege-book] .cover h1{font-size:clamp(35px,5vw,65px);line-height:1.1;margin:8px 0 12px}
body[data-screen-tool=solfege-book] .start{padding:9px 14px;margin-top:6px}
body[data-screen-tool=solfege-book] .copy{padding:5% 7%;min-height:0}
body[data-screen-tool=solfege-book] .copy h2,body[data-screen-tool=solfege-book] .summary h2{font-size:clamp(27px,3.5vw,46px);margin:6px 0 10px;line-height:1.1}
body[data-screen-tool=solfege-book] .copy p{font-size:15px;line-height:1.5;margin:8px 0}
body[data-screen-tool=solfege-book] .aside{margin-top:12px;padding-top:8px}
body[data-screen-tool=solfege-book] .selected{margin-top:10px;padding:8px 0}
body[data-screen-tool=solfege-book] .notes{padding:5%;gap:6px;min-height:0}
body[data-screen-tool=solfege-book] .note{padding:7px;min-height:55px}
body[data-screen-tool=solfege-book] footer{padding:2px!important;margin:0!important;font-size:10px!important;line-height:14px!important}
@media(max-width:600px){
 body[data-screen-tool=solfege-book] .spread{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr)}
 body[data-screen-tool=solfege-book] .copy{padding:12px;align-self:start}
 body[data-screen-tool=solfege-book] .copy h2{font-size:29px}
 body[data-screen-tool=solfege-book] .copy p{font-size:14px;line-height:1.4}
 body[data-screen-tool=solfege-book] .notes{padding:8px 12px;grid-template-columns:1fr 1fr;align-content:center}
 body[data-screen-tool=solfege-book] .selected{margin-top:6px;padding:5px 0}
 body[data-screen-tool=solfege-book] .manuscript{width:90%;padding:5px 12px;margin:0 auto;box-sizing:border-box}
 body[data-screen-tool=solfege-book] .manuscript h3{font-size:20px;margin:7px 0}
 body[data-screen-tool=solfege-book] .manuscript .line{padding:5px 0}
 body[data-screen-tool=solfege-book] .manuscript .line p{font-size:15px}
 body[data-screen-tool=solfege-book] .cards{padding:8px 12px;gap:6px}
 body[data-screen-tool=solfege-book] .cards article{padding:8px 0}
 body[data-screen-tool=solfege-book] .summary{padding:15px 12px;overflow:visible}
 body[data-screen-tool=solfege-book] .table{margin:14px auto}
}
@media(max-height:500px){
 body[data-screen-tool=solfege-book] .cover h1{font-size:34px;line-height:1.1}
 body[data-screen-tool=solfege-book] .cover{padding:12px 5%}
 body[data-screen-tool=solfege-book] .cover-copy>p:not(.kicker){font-size:13px;line-height:1.3;margin:5px 0}
 body[data-screen-tool=solfege-book] .copy{padding:8px 14px}
 body[data-screen-tool=solfege-book] .copy h2{font-size:27px;margin:3px 0}
 body[data-screen-tool=solfege-book] .copy p{font-size:12px;line-height:1.3;margin:4px 0}
 body[data-screen-tool=solfege-book] .copy blockquote{font-size:12px;line-height:1.3;margin:7px 0;padding:5px 10px}
 body[data-screen-tool=solfege-book] .aside{font-size:10px;line-height:1.3;margin:6px 0}
 body[data-screen-tool=solfege-book] .selected{margin-top:5px;padding:5px 0}
 body[data-screen-tool=solfege-book] .selected span,body[data-screen-tool=solfege-book] .selected b{font-size:25px}
 body[data-screen-tool=solfege-book] .notes{padding:8px;gap:5px}
 body[data-screen-tool=solfege-book] .note{min-height:40px;padding:4px}
 body[data-screen-tool=solfege-book] .note span,body[data-screen-tool=solfege-book] .note b{font-size:18px}
 body[data-screen-tool=solfege-book] .manuscript{padding:6px 12px;width:90%}
 body[data-screen-tool=solfege-book] .manuscript h3{font-size:17px;margin:0 0 3px}
 body[data-screen-tool=solfege-book] .manuscript .line{padding:3px 0}
 body[data-screen-tool=solfege-book] .manuscript .line p{font-size:13px}
 body[data-screen-tool=solfege-book] .cards{padding:8px;gap:4px}
 body[data-screen-tool=solfege-book] .cards article{padding:6px 0}
 body[data-screen-tool=solfege-book] .cards h3{font-size:18px}
 body[data-screen-tool=solfege-book] .cards p{font-size:12px;margin:3px 0;line-height:1.3}
 body[data-screen-tool=solfege-book] .summary{padding:8px 20px;overflow:visible}
 body[data-screen-tool=solfege-book] .summary h2{font-size:27px;margin:3px}
 body[data-screen-tool=solfege-book] .summary-lead{font-size:12px;line-height:1.3}
 body[data-screen-tool=solfege-book] .summary blockquote{font-size:14px;margin:5px 0}
 body[data-screen-tool=solfege-book] .table{margin:6px auto}
 body[data-screen-tool=solfege-book] .table div{padding:6px}
}
@media(max-height:500px){
 body[data-screen-tool=sharp-flat-trick] .key-lesson-workspace #keyboard{height:90px!important;min-height:0!important}
 body[data-screen-tool=sharp-flat-trick] #fifthCaptionHost{min-height:0!important;height:auto!important;margin:3px 0!important;padding:0}
 body[data-screen-tool=sharp-flat-trick] #fifthCaptionHost p{font-size:10px!important;line-height:13px!important;margin:0;padding:0;min-height:0}
 body[data-screen-tool=sharp-flat-trick] .staff-caption{font-size:10px;line-height:12px;margin:0;padding:0;min-height:12px}
 body[data-screen-tool=sharp-flat-trick] .key-lesson-menu .controls{gap:4px!important;padding-bottom:4px!important;margin-bottom:4px!important}
 body[data-screen-tool=sharp-flat-trick] .key-lesson-menu .seg button{height:27px;min-height:0;padding:3px;font-size:12px}
 body[data-screen-tool=sharp-flat-trick] .key-lesson-menu .legend{padding-top:4px!important;margin-top:4px!important}
 body[data-screen-tool=sharp-flat-trick] .key-lesson-menu .fact{font-size:10px!important;line-height:1.2!important;margin:4px 0!important}
 body[data-screen-tool=sharp-flat-trick] .key-lesson-menu .quick-key-rule{font-size:11px!important;line-height:1.3!important;padding:3px!important;margin:4px 0!important}
 body[data-screen-tool=sharp-flat-trick] #legendOrder{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px}
 body[data-screen-tool=sharp-flat-trick] #legendOrder>*{min-width:0;text-align:center;width:auto!important}
 body[data-screen-tool=clef-trainer] .app-header{padding:3px!important}
 body[data-screen-tool=clef-trainer] .header-inner{padding:0!important;min-height:26px}
 body[data-screen-tool=clef-trainer] .header-actions .btn-action{box-sizing:border-box!important;height:26px;min-height:26px;padding:3px 6px}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-circle{width:50px!important;height:50px!important;padding:4px!important}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-circle .measure-circle{width:40px;height:40px}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-circle .circle-hand{height:16px}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-circle .circle-marker{width:10px;height:10px;margin:-5px}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-circle .beat-number{font-size:7px}
 body[data-screen-tool=rhythm-reading-trainer] .feedback{min-height:18px;height:18px;line-height:18px}
 body[data-screen-tool=rhythm-reading-trainer] .tapcount{min-height:14px;height:14px;font-size:11px;line-height:14px}
 body[data-screen-tool=rhythm-reading-trainer] .phaselabel{min-height:16px;line-height:16px}
 body[data-screen-tool=rhythm-reading-trainer] .screen-options-dialog{font-size:12px}
 body[data-screen-tool=rhythm-reading-trainer] .screen-options-dialog .rhythm-sound-group{padding:6px;display:inline-flex;max-width:45%;gap:5px}
 body[data-screen-tool=rhythm]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto auto auto minmax(0,1fr) auto;gap:4px}
 body[data-screen-tool=rhythm]>.engine-header{grid-column:1/-1;grid-row:1}
 body[data-screen-tool=rhythm]>.rhythm-action-row{grid-column:1/-1;grid-row:2}
 body[data-screen-tool=rhythm]>.engine-quick-controls{grid-column:1/-1;grid-row:3}
 body[data-screen-tool=rhythm]>.visualizers-wrapper{grid-column:1;grid-row:4;min-height:0;height:100%}
 body[data-screen-tool=rhythm]>#barsContainer{grid-column:2;grid-row:4;min-height:0;min-width:0;align-content:center;zoom:1;gap:4px}
 body[data-screen-tool=rhythm]>footer{grid-column:1/-1;grid-row:5}
 body[data-screen-tool=rhythm] .engine-pair-controls{padding:3px;gap:4px}
 body[data-screen-tool=rhythm] .engine-pair-controls select{font-size:10px;max-width:115px;padding:2px}
 body[data-screen-tool=rhythm] .engine-double-editor>h2{padding:3px;font-size:10px}
 body[data-screen-tool=rhythm]>#barsContainer .beat-card{padding:2px}
 body[data-screen-tool=rhythm]>#barsContainer .bar-card{padding:3px}
 body[data-screen-tool=rhythm]>#barsContainer .sub-step{height:14px}
 body[data-screen-tool=rhythm]>#barsContainer .beat-header{height:25px;font-size:9px}
 body[data-screen-tool=rhythm]>#barsContainer .beat-header select{font-size:9px;padding:0}
}
body[data-screen-tool=music_note_game]{height:var(--studio-app-height);min-height:0;padding:0!important}
body[data-screen-tool=music_note_game]>.wrap{padding:5px 8px;gap:4px}
body[data-screen-tool=music_note_game] .wrap>h1{margin:0;min-height:25px;font-size:21px;line-height:1.2}
body[data-screen-tool=music_note_game] #gameControls{padding:4px;gap:5px;align-items:center}
body[data-screen-tool=music_note_game] #gameControls .control-group{gap:4px;flex-wrap:wrap;font-size:11px;flex-direction:row!important}
body[data-screen-tool=music_note_game] #gameControls .secondary{padding:4px 7px;font-size:11px;min-height:27px}
body[data-screen-tool=music_note_game] #gameControls input[type=range]{width:100px}
body[data-screen-tool=music_note_game] #gameTopbar{padding:4px;margin:0;gap:5px}
body[data-screen-tool=music_note_game] #noteGameScreen .midi select{min-width:0!important;max-width:200px}
body[data-screen-tool=polyrhythm-to-pitch]{height:var(--studio-app-height);min-height:0;padding:0!important;display:flex;flex-direction:column}
body[data-screen-tool=polyrhythm-to-pitch] .app-wrapper{height:calc(var(--studio-app-height) - 22px);min-height:0;padding:6px;box-sizing:border-box;margin:0 auto}
body[data-screen-tool=polyrhythm-to-pitch] .main-grid{min-height:0;flex:1}
body[data-screen-tool=polyrhythm-to-pitch] footer{padding:2px!important;margin:0!important;line-height:14px!important;font-size:10px!important;flex:none}
body[data-screen-tool=polyrhythm-to-pitch] .polypitch-choices{display:none}
body[data-screen-tool=polyrhythm-to-pitch] [hidden]{display:none!important}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .polypitch-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.polypitch-choices label{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:12px}
.polypitch-choices select{min-width:0;width:100%;padding:6px;font:13px 'Segoe UI';border:1px solid #637b99;border-radius:7px;background:var(--panel);color:var(--text)}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .card:has(#soundContainer),body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .card:has(#chordsContainer){display:none}
@media(max-width:650px){
 body[data-screen-tool=polyrhythm-to-pitch] .app-wrapper{gap:5px;padding:5px}
 body[data-screen-tool=polyrhythm-to-pitch] .top-bar{padding:5px;gap:5px;min-height:0}
 body[data-screen-tool=polyrhythm-to-pitch] .top-title{font-size:15px;gap:5px}
 body[data-screen-tool=polyrhythm-to-pitch] .top-controls{gap:5px;flex-wrap:wrap;justify-content:center}
 body[data-screen-tool=polyrhythm-to-pitch] .top-controls button,body[data-screen-tool=polyrhythm-to-pitch] .top-controls select{font-size:11px;padding:5px 7px;min-height:28px}
 body[data-screen-tool=polyrhythm-to-pitch] .midi-select{min-width:0;max-width:150px}
 body[data-screen-tool=polyrhythm-to-pitch] .main-grid{display:flex;flex-direction:column;gap:6px}
 body[data-screen-tool=polyrhythm-to-pitch] .main-grid>div{gap:5px!important;min-height:0}
 body[data-screen-tool=polyrhythm-to-pitch] .card{padding:6px!important;gap:5px;min-width:0}
 body[data-screen-tool=polyrhythm-to-pitch] .card-label{margin-bottom:3px;font-size:11px}
 body[data-screen-tool=polyrhythm-to-pitch] #gridCanvas{height:80px;width:100%}
 body[data-screen-tool=polyrhythm-to-pitch] .tracks-list{gap:4px}
 body[data-screen-tool=polyrhythm-to-pitch] .track-row{padding:4px;gap:4px}
 body[data-screen-tool=polyrhythm-to-pitch] .keyboard-section{height:80px;min-height:0}
 body[data-screen-tool=polyrhythm-to-pitch] .piano-wrapper{height:80px;min-width:0;flex:1}
 body[data-screen-tool=polyrhythm-to-pitch] .screen-options-dialog .fx-grid{grid-template-columns:1fr;gap:8px}
 body[data-screen-tool=polyrhythm-to-pitch] .screen-options-dialog .fx-block{padding:7px;display:grid;grid-template-columns:1fr 1fr;gap:6px}
 body[data-screen-tool=polyrhythm-to-pitch] .screen-options-dialog .fx-title{grid-column:1/-1;margin:0}
 body[data-screen-tool=polyrhythm-to-pitch] .screen-options-dialog .card{margin:6px 0}
}
@media(max-height:500px){
 body[data-screen-tool=music_note_game] .wrap>h1{font-size:18px;min-height:22px}
 body[data-screen-tool=music_note_game] .wrap>.card{padding:5px;gap:4px}
 body[data-screen-tool=music_note_game] .screen-tab{padding:4px 9px;font-size:12px}
 body[data-screen-tool=music_note_game] #gameTopbar{font-size:11px}
 body[data-screen-tool=music_note_game] #gameTopbar .secondary{padding:4px 8px;font-size:11px}
 body[data-screen-tool=music_note_game] #noteGameScreen{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto minmax(0,1fr) auto;gap:4px}
 body[data-screen-tool=music_note_game] #noteGameScreen .staffbox{grid-column:1;grid-row:1/4;min-height:0;height:100%}
 body[data-screen-tool=music_note_game] #noteGameScreen .message{grid-column:2;grid-row:1;font-size:12px;min-height:18px}
 body[data-screen-tool=music_note_game] #noteGameScreen .keys.note-piano-keyboard{grid-column:2;grid-row:2;height:100%;min-height:65px;max-height:130px;padding:3px}
 body[data-screen-tool=music_note_game] .note-piano-keyboard>.key{padding-top:30px;padding-bottom:4px}
 body[data-screen-tool=music_note_game] .note-piano-keyboard .note-piano-black{height:60%;top:3px;padding:3px 1px;font-size:9px}
 body[data-screen-tool=music_note_game] .note-piano-keyboard>.key .letter{font-size:16px}
 body[data-screen-tool=music_note_game] .note-piano-keyboard>.key .name{font-size:11px}
 body[data-screen-tool=music_note_game] #noteGameScreen .midi{grid-column:2;grid-row:3;gap:4px;font-size:10px;padding:0}
 body[data-screen-tool=music_note_game] #noteGameScreen .midi button,body[data-screen-tool=music_note_game] #noteGameScreen .midi select{padding:3px 5px;font-size:10px}
 body[data-screen-tool=music_note_game] #rhythmScreen:not(.hidden){display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto auto auto;gap:4px}
 body[data-screen-tool=music_note_game] #rhythmScreen .rhythm-toolbar{grid-column:1/-1;grid-row:1;margin:0;gap:4px;padding:4px}
 body[data-screen-tool=music_note_game] #rhythmScreen .rhythm-toolbar .secondary{min-height:26px;padding:4px 6px;font-size:11px}
 body[data-screen-tool=music_note_game] #rhythmScreen .staffbox{grid-column:1;grid-row:2/6;min-height:0}
 body[data-screen-tool=music_note_game] #rhythmScreen .rhythm-play-wrap{grid-column:2;grid-row:2;min-height:45px;gap:8px}
 body[data-screen-tool=music_note_game] #rhythmScreen .hand-keys{grid-column:2;grid-row:3;gap:5px}
 body[data-screen-tool=music_note_game] #rhythmScreen .hand-key{min-height:32px;height:32px;font-size:12px;padding:4px}
 body[data-screen-tool=music_note_game] #rhythmScreen .rhythm-legend{grid-column:2;grid-row:4;gap:3px}
 body[data-screen-tool=music_note_game] #rhythmScreen .rhythm-legend .badge{font-size:10px!important;padding:3px 5px!important;line-height:1.2}
 body[data-screen-tool=music_note_game] #rhythmScreen .rhythm-message{grid-column:2;grid-row:5;font-size:10px;padding:2px}
}
/* Compact workbench keeps the live grid, four voices and keyboard visible together. */
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .main-grid{display:grid!important;grid-template-columns:minmax(0,.9fr) minmax(0,1.3fr);grid-template-rows:auto minmax(0,1fr) auto;gap:6px;min-height:0}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .main-grid>div,body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] :is(.poly-upper-settings,.poly-lower-studio){display:contents!important}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .polypitch-choices{grid-column:1;grid-row:1;align-self:start}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-speed-card{grid-column:1;grid-row:2;align-self:start;gap:4px!important;padding:6px!important}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-grid-card{grid-column:2;grid-row:1/3;min-height:0;display:flex}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-tracks-card{grid-column:2;grid-row:3;min-height:0}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .main-grid .card:has(.keyboard-section){grid-column:1;grid-row:3;min-height:0}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-grid-stage{height:0;min-height:70px;flex:1}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] #gridCanvas{height:100%;min-height:0}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-speed-card .mode-btn{min-height:28px;padding:4px;font-size:11px}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-speed-card #rateSlider{margin-block:3px}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .top-controls{flex-wrap:nowrap;gap:5px}
body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .top-controls .screen-options-open{padding:5px 8px;font-size:12px;min-height:30px}
.polypitch-midi-tools{display:flex;flex-wrap:wrap;gap:8px;padding:6px}
.polypitch-interval-shelf{margin-top:8px;min-width:0}
.polypitch-interval-shelf #intervalsContainer{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;grid-auto-rows:minmax(32px,auto)}
.polypitch-interval-shelf .poly-interval-choice>.chip{font-size:11px;min-height:32px}
body[data-pitch-intervals-visible=true] .polypitch-choices{grid-template-columns:repeat(2,minmax(0,1fr))!important}
@media(max-width:650px){
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .top-bar{grid-template-areas:'title title' 'midi transport';grid-template-columns:auto minmax(0,1fr);gap:4px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .top-controls{flex-direction:column;gap:2px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-transport{flex-wrap:wrap;justify-content:flex-start;gap:4px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-toolbar-tools{gap:4px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .main-grid{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(90px,1fr) auto auto}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .polypitch-choices{grid-row:1;grid-column:1}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-speed-card{grid-row:2;grid-column:1}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-grid-card{grid-row:3;grid-column:1}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-tracks-card{grid-row:4;grid-column:1}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .main-grid .card:has(.keyboard-section){grid-row:5;grid-column:1}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-channel-knobs .poly-knob-dial{width:34px;height:34px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-channel-knobs .poly-knob-scale{display:none}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-channel-knobs .track-info{min-height:0;font-size:10px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-channel-knobs .track-vol{gap:1px}
}
@media(max-height:500px) and (min-width:651px){
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .top-bar{grid-template-areas:'midi transport';grid-template-columns:auto 1fr;padding:3px 6px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .top-title{display:none}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .polypitch-choices label{flex-direction:row;align-items:center;font-size:10px;gap:3px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .polypitch-choices select{padding:3px;font-size:11px;height:28px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-speed-card{padding:4px!important;gap:2px!important}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-speed-card .card-label{font-size:10px;min-height:18px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-speed-card #rateDisplay{font-size:10px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-speed-card .poly-rate-scale{font-size:9px;margin:0}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-speed-card .mode-btn{min-height:24px;padding:2px;font-size:10px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .card{padding:4px;gap:3px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .card-label{font-size:10px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .keyboard-section,body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .piano-wrapper{height:60px;min-height:60px}
 body[data-screen-tool=polyrhythm-to-pitch][data-pitch-compact=true] .poly-channel-knobs .poly-knob-dial{width:28px;height:28px}
}
@media(max-height:500px){
 body[data-screen-tool=clef-trainer] .instruction-banner{padding:2px 4px!important}
 body[data-screen-tool=clef-trainer] .trainer-practice-rail{gap:2px}
 body[data-screen-tool=clef-trainer] .toolbar-bottom{padding:1px 0!important}
 body[data-screen-tool=clef-trainer] .workspace-card{padding-block:3px!important}
 body[data-screen-tool=piano-negative-harmony] .display-container{grid-template-rows:auto minmax(55px,1fr) auto minmax(40px,1fr) auto}
 body[data-screen-tool=piano-negative-harmony]{gap:3px}
}
@media(max-width:600px){body[data-screen-tool=piano-negative-harmony] .control-group{min-width:0}body[data-screen-tool=piano-negative-harmony] .controls{min-width:0;width:100%}body[data-screen-tool=piano-negative-harmony] .control-group select{max-width:100%}}
body[data-screen-tool=ranges] .piano-wrapper{overflow:visible}
body[data-screen-tool=ranges] .octave-marker{max-width:100%;box-sizing:border-box}
body[data-screen-tool=ranges] .octave-marker:last-child{transform:translateX(-100%)}
@media(min-height:501px) and (max-height:620px){
 body[data-screen-tool=music_note_game] #noteGameScreen .staffbox{min-height:120px;height:0;flex:1}
 body[data-screen-tool=music_note_game] #noteGameScreen .keys.note-piano-keyboard{height:84px;min-height:84px;flex:none}
 body[data-screen-tool=music_note_game] #noteGameScreen .note-piano-keyboard>.key{padding-top:35px;padding-bottom:4px}
 body[data-screen-tool=music_note_game] #noteGameScreen .note-piano-keyboard .note-piano-black{height:60%;padding:3px 1px}
}
body[data-screen-tool=let-splay]{height:var(--studio-app-height);min-height:0;padding:0!important}
body[data-screen-tool=let-splay]>header{padding:5px 12px;gap:5px}
body[data-screen-tool=let-splay]>header .seg:has(#zVal),body[data-screen-tool=let-splay]>header #openNew{display:none}
body[data-screen-tool=let-splay]>footer{margin:0!important;padding:2px!important;font-size:10px!important;line-height:14px!important;flex:none}
body[data-screen-tool=let-splay] #nav{overflow:visible;min-height:0;gap:4px;padding:6px}
@media(max-width:760px){body[data-screen-tool=let-splay] #nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}body[data-screen-tool=let-splay] #nav button{white-space:normal;font-size:11px;line-height:1.3;padding:5px;min-height:36px}}
@media(max-height:500px) and (min-width:761px){body[data-screen-tool=let-splay] #nav{width:190px}body[data-screen-tool=let-splay] #nav button{font-size:12px;line-height:1.3;padding:4px 6px;min-height:30px}}
@media(max-height:500px){body[data-screen-tool=notation-lexicon] .site-head{padding:3px 10px;min-height:22px}body[data-screen-tool=notation-lexicon] .search-row input{height:30px!important;min-height:30px!important}body[data-screen-tool=notation-lexicon] .search-row{height:32px;min-height:0}body[data-screen-tool=notation-lexicon] #cats{display:grid;grid-template-columns:minmax(0,1fr) 20px;align-content:start;gap:1px}body[data-screen-tool=notation-lexicon] #cats button{min-height:14px;height:14px;padding:0;font-size:9px;line-height:14px}body[data-screen-tool=notation-lexicon] .lexicon-toolbar{gap:5px}body[data-screen-tool=notation-lexicon] #quote-box{max-width:150px;min-width:0}body[data-screen-tool=notation-lexicon] .lexicon-toolbar>label{min-width:0;flex-shrink:1}body[data-screen-tool=notation-lexicon] .lexicon-toolbar select{min-width:0;max-width:100%}}
body[data-screen-tool=music_note_game] .wrap>h1{margin:0!important;min-height:0!important;width:100%}
body[data-screen-tool=music_note_game] #gameTopbar>.screen-options-open{font-size:11px;padding:4px 7px;min-height:28px;height:28px}
@media(max-width:600px){body[data-screen-tool=ranges] .octave-marker{max-width:45px;width:45px;white-space:normal;font-size:10px;line-height:1.1}body[data-screen-tool=ranges] .octave-marker:first-child{transform:none}}
body[data-screen-tool=rhythm]{display:flex!important;flex-direction:column}
body[data-screen-tool=rhythm]>.engine-header{position:static!important;inset:auto!important;flex:none;min-height:22px;height:22px;margin:0;padding:0}
body[data-screen-tool=rhythm]>.engine-header h1{font-size:18px;line-height:22px;margin:0}
body[data-screen-tool=rhythm]>.rhythm-action-row,body[data-screen-tool=rhythm]>.engine-quick-controls{flex:none}
body[data-screen-tool=rhythm]>.engine-quick-controls{flex-wrap:nowrap;gap:5px;padding:4px;justify-content:center;min-width:0}
body[data-screen-tool=rhythm]>.engine-quick-controls>div{min-width:0}
body[data-screen-tool=rhythm]>.engine-quick-controls #presetSelect{min-width:0;max-width:180px}
body[data-screen-tool=rhythm]>.engine-quick-controls .screen-options-open{min-height:28px;padding:4px 7px;font-size:11px}
.rhythm-screen-bench{display:flex;flex-direction:column;gap:6px;flex:1;min-height:0;min-width:0}
.rhythm-screen-bench>.engine-notation-with-circles{flex:1;min-height:0;width:100%}
.rhythm-screen-bench>#barsContainer{width:100%;margin:0;zoom:1;flex:none;min-height:0;height:auto;overflow:visible;gap:5px}
.rhythm-screen-bench #barsContainer .bar-card{padding:4px;gap:3px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.rhythm-screen-bench #barsContainer .bar-header,.rhythm-screen-bench #barsContainer .sound-select-wrapper{grid-column:1/-1}
.rhythm-screen-bench #barsContainer .beat-header{margin:0;gap:2px;font-size:10px;flex-wrap:nowrap}
.rhythm-screen-bench #barsContainer .beat-header select{font-size:10px;padding:1px;min-width:0}
.rhythm-screen-bench #barsContainer .beat-row{padding:3px;margin:0;min-width:0}
.rhythm-screen-bench #barsContainer .sub-step{height:19px}
.rhythm-screen-bench #barsContainer .bar-header{padding:2px;gap:3px}
.rhythm-screen-bench #barsContainer .bar-header button,.rhythm-screen-bench #barsContainer .sound-select-wrapper select{padding:3px;font-size:10px}
body[data-screen-tool=rhythm] .screen-options-dialog{font-size:13px}
body[data-screen-tool=rhythm] .screen-options-dialog .control-group{margin:8px 0;display:flex;align-items:center;gap:8px}
@media(max-height:650px) and (min-width:651px){
 .rhythm-screen-bench{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
 .rhythm-screen-bench>.engine-notation-with-circles{min-height:0;height:100%;gap:4px}
 .rhythm-screen-bench .visualizers-wrapper{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(2,minmax(0,1fr));gap:4px}
 .rhythm-screen-bench .engine-live-circles{width:145px;gap:4px}
 .rhythm-screen-bench .engine-live-circle{grid-template-columns:minmax(0,1fr) 65px;padding:3px;grid-template-rows:auto auto auto auto}
 .rhythm-screen-bench .engine-live-circle>span:first-child{font-size:9px;grid-row:1}
 .rhythm-screen-bench .engine-live-circle .engine-circle-count{display:none}
 .rhythm-screen-bench .engine-live-circle .engine-inline-mode,.rhythm-screen-bench .engine-live-circle .engine-inline-shape{font-size:9px!important;height:20px!important;min-height:20px!important;padding:1px!important}
 .rhythm-screen-bench .engine-live-circle .engine-note-select-button{height:26px;min-height:26px}
 .rhythm-screen-bench>#barsContainer{align-content:center;min-width:0}
 .rhythm-screen-bench #barsContainer .beat-row{padding:2px}
 .rhythm-screen-bench #barsContainer .sub-step{height:16px}
 .rhythm-screen-bench #barsContainer .engine-pair-controls{padding:2px;font-size:10px}
 body[data-screen-tool=rhythm] .rhythm-action-row{padding:3px;gap:4px}
 body[data-screen-tool=rhythm] .engine-circle{width:52px;height:52px;margin:0}
 body[data-screen-tool=rhythm] .engine-circle .measure-circle{width:44px;height:44px}
 body[data-screen-tool=rhythm] .engine-tempo-knob{width:34px;height:34px;min-height:34px}
 body[data-screen-tool=rhythm] .engine-tempo{gap:1px}
 body[data-screen-tool=rhythm] .engine-tempo>span{font-size:9px;line-height:10px}
 body[data-screen-tool=rhythm] .engine-meter-control{display:flex;flex-direction:row;gap:3px}
 body[data-screen-tool=rhythm] .engine-meter-fraction{flex-direction:row;height:28px}
 body[data-screen-tool=rhythm] .engine-quick-controls .control-group>label{display:none}
 body[data-screen-tool=rhythm] .engine-basic-modes .btn{font-size:10px;padding:4px}
}
.rhythm-edit-choice{display:none;font-size:12px;align-items:center;justify-content:center;gap:6px}
.rhythm-edit-choice select{padding:4px 6px;background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:6px;font:12px 'Segoe UI'}
.rhythm-screen-bench[data-edit-compact=true]>.rhythm-edit-choice{display:flex}
.rhythm-screen-bench[data-edit-compact=true] #barsContainer{display:block;align-content:start}
.rhythm-screen-bench[data-edit-compact=true] #barsContainer .bar-card[data-edit-selected=false],.rhythm-screen-bench[data-edit-compact=true] #barsContainer .engine-double-editor[data-edit-selected=false]{display:none!important}
.rhythm-screen-bench[data-edit-compact=true] #barsContainer .bar-card[data-edit-selected=true]{width:100%;min-height:0;grid-column:1/-1}
.rhythm-screen-bench[data-edit-compact=true] #barsContainer .engine-double-editor{display:block}
.rhythm-screen-bench[data-edit-compact=true] .engine-double-editor>h2,.rhythm-screen-bench[data-edit-compact=true] .engine-pair-controls{display:none}
@media(max-height:650px) and (min-width:651px){
 .rhythm-screen-bench{grid-template-areas:'notation edit' 'notation editor';grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);grid-template-rows:26px minmax(0,1fr);gap:3px 6px}
 .rhythm-screen-bench>.engine-notation-with-circles{grid-area:notation}
 .rhythm-screen-bench>#barsContainer{grid-area:editor}
 .rhythm-screen-bench .bar-card .bar-header{min-height:22px;height:22px}
 .rhythm-screen-bench .bar-card .bar-header button{min-height:20px;height:20px}
 .rhythm-screen-bench .bar-card .sound-select-wrapper{margin:0!important;padding:0!important;min-height:22px;height:22px}
 .rhythm-screen-bench .bar-card .sound-select-wrapper select{height:22px!important;min-height:22px!important}
 .rhythm-screen-bench .bar-card .beat-header{height:24px;min-height:24px}
 .rhythm-screen-bench .bar-card .engine-note-select-button{height:24px!important;min-height:24px!important;padding:1px 3px}
 .rhythm-screen-bench .bar-card .engine-note-menu-wrapper{min-width:0;flex:1}
 .rhythm-screen-bench .bar-card .engine-menu-value{font-size:9px}
 .rhythm-screen-bench .bar-card .engine-menu-note{font-size:24px;height:22px;line-height:22px}
 .rhythm-screen-bench .bar-card .beat-row{height:43px;box-sizing:border-box}
 body[data-screen-tool=rhythm] .engine-meter-fraction{width:76px!important;min-width:76px;height:28px!important;flex-direction:row!important;align-items:center;overflow:visible}
 body[data-screen-tool=rhythm] .engine-meter-fraction>input,body[data-screen-tool=rhythm] .engine-meter-fraction>select{height:26px!important;min-height:26px!important;padding:1px!important;max-width:38px!important}
 body[data-screen-tool=rhythm] .rhythm-action-row{flex-wrap:nowrap;justify-content:center}
 body[data-screen-tool=rhythm] .engine-playback-group,body[data-screen-tool=rhythm] .engine-metronome-group{gap:4px;min-width:0}
}
@media(max-width:650px){.rhythm-screen-bench>.engine-notation-with-circles{min-height:140px}.rhythm-screen-bench[data-edit-compact=true]>.rhythm-edit-choice{flex:none}.rhythm-screen-bench[data-edit-compact=true]>#barsContainer{flex:none}}
@media(max-width:600px){body[data-screen-tool=piano-negative-harmony] .nh-chord-letters{font-size:9px!important;letter-spacing:0;white-space:normal;overflow-wrap:anywhere}}
@media(max-height:500px){body[data-screen-tool=notation-lexicon] #quote-text{white-space:normal;overflow-wrap:anywhere;max-width:100%;line-height:1.25;font-size:10px}}
@media(max-height:650px) and (min-width:651px){
 body[data-screen-tool=rhythm] .rhythm-action-row{display:flex!important;flex-direction:row!important;align-items:center;flex-wrap:nowrap}
 body[data-screen-tool=rhythm] .engine-playback-group,body[data-screen-tool=rhythm] .engine-metronome-group{width:auto!important;flex:0 1 auto!important}
 .rhythm-screen-bench .engine-live-circle>span:first-child{position:static!important;grid-column:2;grid-row:1;max-width:65px}
 .rhythm-screen-bench .engine-live-circle>.engine-inline-mode{position:static!important;grid-column:2;grid-row:2;width:65px!important;max-width:65px}
 .rhythm-screen-bench .engine-live-circle>.engine-inline-shape{position:static!important;grid-column:2;grid-row:3;width:65px!important;max-width:65px}
 .rhythm-screen-bench .engine-live-circle>.engine-note-menu-wrapper{position:static!important;grid-column:2;grid-row:4;width:65px!important;max-width:65px}
 .rhythm-screen-bench .engine-live-circle>.engine-note-menu-wrapper>.engine-note-select-button{width:65px!important;min-width:0}
}
body[data-screen-tool=notation-lexicon] #quote-box #quote-text{white-space:normal!important;overflow-wrap:anywhere;line-height:1.25}
@media(max-height:650px) and (min-width:651px){
 .rhythm-screen-bench .bar-card .bar-header{margin:0!important;height:20px!important;min-height:20px!important}
 .rhythm-screen-bench .bar-card .sound-select-wrapper{height:20px!important;min-height:20px!important}
 .rhythm-screen-bench .bar-card .sound-select-wrapper select{height:20px!important;min-height:20px!important}
 .rhythm-screen-bench #barsContainer .beat-row{height:40px!important;padding:2px!important}
 .rhythm-screen-bench .bar-card .beat-header{height:22px!important;min-height:22px!important}
 .rhythm-screen-bench .bar-card .engine-note-select-button{height:22px!important;min-height:22px!important}
 .rhythm-screen-bench #barsContainer .sub-step{height:14px}
 .rhythm-screen-bench #barsContainer .bar-card{gap:2px;padding:3px}
}
@media(max-height:500px){body[data-screen-tool=notation-lexicon] #quote-box #quote-text{font-size:10px!important;line-height:1.25!important}body[data-screen-tool=notation-lexicon] #quote-box #quote-author{font-size:9px!important;line-height:1.2}}
/* Reading and imitation use the same engraving height as the dictation staff. */
@media(max-height:600px){
 body[data-screen-tool=theremin] .screen-options-dialog .audio-device-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 body[data-screen-tool=theremin] .screen-options-dialog .panel{padding:5px;margin:4px 0}
 body[data-screen-tool=theremin] .screen-options-dialog .slider-group{margin:5px 0;min-height:0}
 body[data-screen-tool=theremin] .screen-options-dialog .motion-help{font-size:11px;line-height:1.2;margin:3px 0}
 body[data-screen-tool=theremin] .screen-options-dialog .audio-health{margin:3px 0;padding:3px}
 body[data-screen-tool=solfege-book] .restart{padding:4px 10px;margin:3px 0;min-height:26px;height:30px;font-size:13px}
}
@media(max-height:500px) and (min-width:651px){
 body[data-screen-tool=conductor] .screen-options-dialog .collapsible-panel details{display:block}
 body[data-screen-tool=conductor] .screen-options-dialog .panel{padding:3px}
 body[data-screen-tool=conductor] .screen-options-dialog .hand-tempo-panel{margin:3px 0;padding:5px}
 body[data-screen-tool=conductor] .screen-options-dialog .tempo-bounds{margin:4px 0}
 body[data-screen-tool=conductor] .screen-options-dialog .hint{display:none}
 body[data-screen-tool=conductor] .screen-options-dialog .row{margin:3px 0}
 .screen-options-dialog>header{margin-bottom:4px}
 .screen-options-dialog>header button{height:28px;padding:0 8px;line-height:26px}
 .screen-options-dialog{padding:7px}
 body[data-screen-tool=theremin] .screen-options-dialog h3{display:none}
 body[data-screen-tool=theremin] .screen-options-dialog .theremin-setting-choice{height:28px;padding:3px;font-size:13px}
 body[data-screen-tool=theremin] .screen-options-dialog .audio-device-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-screen-tool=theremin] .screen-options-dialog .audio-output-wrap{grid-column:1;grid-row:1}
 body[data-screen-tool=theremin] .screen-options-dialog #audio-sample-rate{grid-column:2;grid-row:1}
 body[data-screen-tool=theremin] .screen-options-dialog #audio-latency-hint{grid-column:1;grid-row:2}
 body[data-screen-tool=theremin] .screen-options-dialog .camera-device-row{grid-column:2;grid-row:2}
 body[data-screen-tool=theremin] .screen-options-dialog .audio-health>div{padding:3px;font-size:10px;line-height:1.2}
}
body[data-screen-tool=rhythm-reading-trainer] .score-wrap{height:198px!important;min-height:198px!important;max-height:198px;flex:none!important}
body[data-screen-tool=rhythm-reading-trainer] #score svg{height:178px!important;max-height:100%;width:100%!important}
body[data-screen-tool=rhythm-reading-trainer] .score-wrap.rhythm-double-score{height:354px!important;min-height:354px!important;max-height:354px}
body[data-screen-tool=rhythm-reading-trainer] .rhythm-double-score #score svg{height:334px!important}
@media(min-width:750px){body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice{grid-template-columns:130px minmax(0,1fr);column-gap:7px}body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice .stage>.transport{padding:6px;gap:7px}body[data-screen-tool=rhythm-reading-trainer] .rhythm-workspace{grid-template-columns:minmax(0,1fr) 210px}}
@media(max-height:500px){
 body[data-screen-tool=rhythm-reading-trainer] .score-wrap{height:135px!important;min-height:135px!important;max-height:135px}
 body[data-screen-tool=rhythm-reading-trainer] #score svg{height:115px!important}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice .stage>.transport{padding:4px;gap:3px}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice .stage>.transport>.rhythm-meter-control{margin:0;max-width:100%}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice .stage>.transport #playBtn,body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice .stage>.transport #newBtn{min-height:26px;height:26px;padding:3px}
 body[data-screen-tool=rhythm-reading-trainer] #dictStaff,body[data-screen-tool=rhythm-reading-trainer] #dictStaff.dict-comparison{height:135px!important}
 body[data-screen-tool=rhythm-reading-trainer] #dictStaff .dict-staff-canvas svg,body[data-screen-tool=rhythm-reading-trainer] #dictStaff .dict-target svg{height:100px!important}
 body[data-screen-tool=rhythm-reading-trainer] .dict-palette-row button{height:25px!important;min-height:25px;min-width:25px;padding:1px}
 body[data-screen-tool=rhythm-reading-trainer] .dict-palette-row svg{height:23px;max-height:23px}
 body[data-screen-tool=rhythm-reading-trainer] #dictStaff p{display:none}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-workspace{grid-template-columns:minmax(0,1fr) 210px}
}
@media(max-height:500px) and (min-width:750px){
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice{position:relative}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice .stage>.transport{display:grid!important;grid-template-columns:1fr 1fr;gap:3px;padding:3px;align-content:start;align-items:center;justify-items:center}
 body[data-screen-tool=rhythm-reading-trainer] .stage>.transport>.rhythm-meter-control{grid-column:1/-1;grid-row:1}
 body[data-screen-tool=rhythm-reading-trainer] .stage>.transport>.rhythm-circle{grid-column:1;grid-row:2;width:40px;height:40px;min-width:40px;min-height:40px}
 body[data-screen-tool=rhythm-reading-trainer] .stage>.transport>.rhythm-tempo-control{grid-column:2;grid-row:2;font-size:9px}
 body[data-screen-tool=rhythm-reading-trainer] .stage>.transport .rhythm-tempo-knob{width:34px;height:34px}
 body[data-screen-tool=rhythm-reading-trainer] .stage>.transport>#playBtn{grid-column:1/-1;grid-row:3;width:100%!important}
 body[data-screen-tool=rhythm-reading-trainer] .stage>.transport>#newBtn{grid-column:1/-1;grid-row:4;width:100%!important;min-width:0}
 body[data-screen-tool=rhythm-reading-trainer] .stage>.transport>#stopBtn{grid-column:1;grid-row:5;min-height:26px;height:26px;padding:3px}
 body[data-screen-tool=rhythm-reading-trainer] .stage>.transport>#loopBtn{grid-column:2;grid-row:5;min-height:26px;height:26px;width:30px;padding:3px}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice>.score-wrap.rhythm-double-score{height:184px!important;min-height:184px!important;max-height:184px}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-double-score #score svg{height:174px!important}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice:has(.rhythm-double-score) #tapArea{position:absolute;bottom:4px;inset-inline-start:4px;width:122px}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice:has(.rhythm-double-score) .tappad{height:30px;margin:0}
 body[data-screen-tool=rhythm-reading-trainer] .rhythm-practice:has(.rhythm-double-score) .tapcount{font-size:10px;min-height:10px}
 body[data-screen-tool=rhythm-reading-trainer] .dict-palette-row{width:100%;box-sizing:border-box}
 body[data-screen-tool=rhythm-reading-trainer] .dict-palette-row>span{min-width:36px;font-size:10px}
 body[data-screen-tool=rhythm-reading-trainer] #dictStaff,body[data-screen-tool=rhythm-reading-trainer] #dictStaff.dict-comparison{height:120px!important}
 body[data-screen-tool=rhythm-reading-trainer] #dictArea>.transport{position:absolute;bottom:4px;inset-inline-start:5px;width:160px;margin:0;gap:3px;display:flex;justify-content:center}
 body[data-screen-tool=rhythm-reading-trainer] #dictArea>.transport>button{height:26px;min-height:26px;padding:3px 5px;font-size:11px}
 body[data-screen-tool=rhythm-reading-trainer] #dictMeter{position:absolute;bottom:34px;inset-inline-start:5px;width:160px;line-height:14px;font-size:10px;min-height:14px}
}

/* Compact Theremin: camera, readouts and controls each keep their own space. */
@media(max-width:950px),(max-height:560px){
 body[data-screen-tool=theremin] .app-hero h1,body[data-screen-tool=theremin].camera-running .app-hero h1{font-size:18px!important;line-height:1.3;margin:0!important}
 body[data-screen-tool=theremin] .app-hero p{display:none}
 body[data-screen-tool=theremin] .col-visual{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);align-content:start;gap:6px}
 body[data-screen-tool=theremin] #status{grid-area:1/1;align-self:center;min-width:0;padding:5px;font-size:11px;line-height:1.4;overflow-wrap:anywhere}
 body[data-screen-tool=theremin] .video-container{grid-area:2/1/3/-1;min-width:0;height:100%}
 body[data-screen-tool=theremin] .theremin-readouts{position:relative;inset:auto;flex:none;height:auto;max-height:none;pointer-events:auto}
 body[data-screen-tool=theremin] .col-settings>.panel{flex:none}
 body[data-screen-tool=theremin] .theremin-readouts #staff-container{flex:none;height:140px;max-height:140px}
 body[data-screen-tool=theremin] .theremin-readouts:has(.theremin-inline-settings[open]){height:auto}
 body[data-screen-tool=theremin] .harmony-progression-heading,body[data-screen-tool=theremin] .harmony-progression-chords{min-width:0;max-width:100%;overflow-wrap:anywhere}
 body[data-screen-tool=theremin] .harmony-progression-empty{grid-column:1/-1;direction:var(--mms-page-direction,rtl);text-align:start;line-height:1.4}
 body[data-screen-tool=theremin] .fullscreen-hint{display:none}
}
@media(max-width:650px) and (min-height:451px){
 html.studio-shell-enabled:not(.studio-chrome-only) body[data-screen-tool=theremin]:not(.camera-fullscreen){height:auto!important;min-height:var(--studio-app-height)!important;overflow-y:auto}
 body[data-screen-tool=theremin]:not(.camera-fullscreen) .main-container{flex:none;grid-template-rows:auto auto!important;align-content:start}
 body[data-screen-tool=theremin]:not(.camera-fullscreen) .col-visual{grid-template-rows:auto auto}
 body[data-screen-tool=theremin]:not(.camera-fullscreen) .video-container{flex:none;height:auto;aspect-ratio:16/9}
 body[data-screen-tool=theremin] .theremin-readouts{order:-1}
 body[data-screen-tool=theremin] .zone-label{font-size:9px;padding:2px 4px}
 body[data-screen-tool=theremin] :is(.left-x-hint,.right-x-hint,.right-pinch-status){font-size:9px;padding:3px 5px}
 body[data-screen-tool=theremin] .pitch-rail-status{display:none}
}
@media(max-height:450px){
 body[data-screen-tool=theremin] .col-settings{overflow-y:auto;overflow-x:hidden}
}
/* Touch screens: keep the compact clef-trainer mode buttons at least 24px tall. */
@media(pointer:coarse){body[data-screen-tool=clef-trainer] .mode-btn{min-height:28px}}
/* Phones: screen-fit rules shrink this reading text below 11px; keep it readable. */
@media(max-width:700px){.nh-chord-letters,.chord-roman,.zone-label{font-size:11px!important}}
