/* One viewport per page. Dense controls, tabs and bounded content keep actions in reach. */
html,body{height:100%;overflow:hidden}body{min-width:300px}.app{height:100dvh;max-width:1100px;display:flex;flex-direction:column;padding:0 16px;overflow:hidden}header{padding:6px 0;gap:6px;flex:none;min-height:44px}.brand{font-size:18px}.brand span{font-size:10px}nav{gap:0}nav button{min-height:30px;padding:4px 8px;font-size:12px}main{flex:1;min-height:0;overflow:hidden}.view{height:100%;min-height:0;padding:8px 0;display:flex;flex-direction:column;gap:7px;overflow:auto;overscroll-behavior:contain}.view>*{flex-shrink:0}footer{display:none}.notice{flex:none;font-size:12px;max-height:65px;overflow:auto;margin:5px 0;padding:6px 10px}.intro,.today-heading{margin:0;gap:8px}.intro h1,h1{font-size:21px}.intro p{font-size:12px;margin:2px 0}.intro>.eyebrow{display:none}.today-heading{flex-direction:row;align-items:center}.today-heading label{width:155px;font-size:11px;gap:2px}.today-heading input{min-height:30px;padding:4px 8px;font-size:13px}.panel{padding:12px;margin:0;border-radius:12px}.actions{gap:7px;margin-top:8px}button,select,input:not([type=checkbox]),textarea{min-height:34px;padding:6px 9px;font-size:13px}label{font-size:12px;gap:3px}h2{font-size:16px}.muted{font-size:12px}details{margin-top:6px}
/* Setup: exactly scene, level and quantity, plus the Chinese hint switch. */
.scene-lobby{padding:12px;box-shadow:none}.lobby-filters{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.lobby-filters label:first-child{grid-column:auto}.lobby-filters select{min-height:34px;padding:5px 7px}.scene-section-heading{margin:9px 0 6px}.scene-section-heading h2{font-size:12px}#scene-count{font-size:10px}.scene-grid{gap:8px}.scene-card{min-height:70px;padding:8px 10px;gap:2px;display:grid;grid-template-columns:28px 1fr;grid-template-rows:auto auto;align-content:center}.scene-icon{grid-row:1/3;font-size:22px}.scene-card strong{font-size:13px}.scene-meta{font-size:11px}.scene-card[aria-pressed=true]:after{top:5px;right:5px;width:15px;height:15px;font-size:10px}.scene-description,.scene-usage{display:none}#difficulty-note{font-size:11px;margin-top:6px}.launch-options{align-items:center;justify-content:space-between;margin-top:9px;gap:10px}.launch-options .pack-info{margin:0;font-size:12px;width:auto}.launch-action{margin-top:9px}#start-btn{min-height:38px;font-size:15px;min-width:185px}.launch-action p{margin-top:4px;font-size:11px}.scene-lobby .secondary-actions{margin-top:7px;padding-top:6px}.secondary-actions summary{font-size:11px}.today-overview,.rules{margin:0;padding:1px 0;font-size:12px}.chinese-switch{display:inline-flex!important;flex-direction:row!important;align-items:center;gap:7px!important;width:auto!important;position:relative;cursor:pointer}.chinese-switch input{position:absolute;opacity:0;width:34px;height:20px;margin:0}.switch-track{width:34px;height:20px;border-radius:20px;background:#b9b5cc;display:block;position:relative;transition:background .15s}.switch-track:before{content:'';position:absolute;width:16px;height:16px;left:2px;top:2px;background:white;border-radius:50%;transition:transform .15s}.chinese-switch input:checked+.switch-track{background:var(--green)}.chinese-switch input:checked+.switch-track:before{transform:translateX(14px)}.chinese-switch input:focus-visible+.switch-track{outline:2px solid var(--green);outline-offset:3px}
/* Tabs reserve a fixed content area; lists never push navigation offscreen. */
.page-tabs{display:flex;gap:5px;flex:none;border-bottom:1px solid var(--line);padding-bottom:5px}.page-tabs button{border:0;background:transparent;min-height:30px;padding:4px 12px}.page-tabs [aria-selected=true]{background:var(--soft);color:var(--green);font-weight:650}.tab-panes{flex:1!important;min-height:0;overflow:hidden}.tab-pane{height:100%;min-height:0;overflow:auto;padding:1px 2px 4px;overscroll-behavior:contain}.tab-pane>.panel+.panel{margin-top:8px}#profile .tab-pane>.stats{margin-bottom:8px}.stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.stat{padding:8px 11px;font-size:12px}.stat strong{font-size:22px}.evidence-chips{margin:6px 0;gap:5px}.evidence-chip{font-size:11px;padding:4px 7px}.level-row{padding:6px 0}.level-row p{font-size:12px}.profile-intro{gap:7px}#profile>.actions{margin:0;flex:none}#due-materials{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}#due-materials .learning-card{padding:10px}.fields{gap:9px 12px}.speech-row label{min-width:120px}#settings-form .muted{font-size:11px}#settings-form .fields{margin-bottom:7px}.info-dialog{max-height:calc(100dvh - 24px);padding:18px;overflow:hidden}.info-dialog-body{max-height:calc(100dvh - 170px);overflow:auto;padding:8px 0}.info-dialog .card-grid{grid-template-columns:1fr;gap:7px}.info-dialog h2{font-size:17px}.info-dialog>button{display:block;margin:8px auto 0}.info-dialog-body .learning-card{padding:9px}
/* Material library pagination. */
.library-filters{margin:0;gap:7px;align-items:end}.library-filters label:first-child{min-width:110px}.library-filters label{min-width:85px}.library-filters input,.library-filters select{min-height:32px}#library-count{margin:0}#library-cards{flex:1;min-height:0;overflow:auto;align-content:start;gap:8px;grid-template-columns:repeat(3,minmax(0,1fr))}.material-card{padding:10px;gap:5px}.material-card h2{font-size:14px}.material-card .eyebrow,.material-card p{font-size:11px}.material-card .actions{margin-top:3px;gap:4px}.material-card button{font-size:12px;min-height:30px;padding:4px 7px}.material-card details{margin:1px 0;font-size:11px}.list-pager{display:flex;align-items:center;justify-content:center;gap:14px;flex:none}.list-pager button{min-height:30px;padding:4px 10px}
/* Practice: submit and exit remain outside the answer scroll area. */
#practice{gap:5px;overflow:hidden}.practice-top{gap:7px}.practice-top>div{flex-basis:auto;min-width:0}.practice-top h2{font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.practice-top .eyebrow{font-size:10px;margin:0}.badge,.score-badge{padding:3px 7px;font-size:12px}.timer{font-size:15px}.exit-button{font-size:11px;min-height:30px}.progress{margin:2px 0;height:5px}#audio-label{font-size:10px}.audio-controls{margin:1px 0;padding:6px;gap:6px}.audio-controls button{min-height:32px;font-size:12px;padding:4px 8px}.audio-controls label{font-size:11px}.audio-controls select{width:67px;min-height:30px;padding:4px}.audio-controls input[type=checkbox]{width:15px;height:15px}#practice>.muted.centered{font-size:10px}#combo-status{font-size:12px;margin:0}.practice-steps{margin:2px 0;gap:3px;max-height:40px;overflow:auto}.step{width:18px;min-width:18px;height:18px;font-size:9px}.translation{margin:3px auto;font-size:18px;min-height:25px;max-height:65px;overflow:auto;flex-shrink:1!important}#writing{display:flex;flex-direction:column;flex:1;min-height:0;gap:5px}.answer-scroll{flex:1;min-height:0;overflow:auto;padding:5px 4px}.slots{min-height:0;gap:10px;margin:6px 0;align-content:start}.word input{font-size:23px;padding:4px 2px}.word small{font-size:10px;min-height:15px}.reference{padding:8px;margin:6px 0;font-size:16px}#writing>.actions{margin:0;flex:none}#word-count{font-size:10px}#correct{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;justify-content:center}.correct-answer{margin:6px auto;font-size:23px}.feedback{margin:0;min-height:18px;font-size:11px;max-height:40px;overflow:auto}.practice-footer{margin:0;padding-top:6px;font-size:11px;gap:6px;flex:none}.practice-footer label{font-size:11px}.effect-volume input{width:65px}.practice-footer input[type=checkbox]{width:15px;height:15px}.practice-footer #save-status{font-size:10px}
/* Result and import use one focused pane at a time. */
.result-hero{padding:0}.result-hero h1{font-size:20px}.result-score{font-size:43px;margin:1px 0}.result-score small{font-size:16px}.result-hero>p{font-size:12px}#result .tab-pane h2{font-size:15px}#result .tab-pane>.panel{border:0;padding:8px}.result-hero .actions{margin-top:6px}#ranking table,#history table{font-size:12px}#transcript article{padding:8px 0}#transcript p{font-size:13px}#editor:not([hidden]){height:100%;display:flex;flex-direction:column;gap:5px;min-height:0}#import .tab-pane:has(#editor:not([hidden])){overflow:hidden}#editor>.import-metadata{flex:none;max-height:45%;overflow:auto;margin:0}#editor .fields{padding:9px;gap:6px 10px}#editor .fields .muted{font-size:10px}#editor .fields input{min-height:30px}#sentence-editor{flex:1;min-height:0;overflow:auto}#sentence-editor article{padding:8px;margin:5px 0;gap:7px}#sentence-editor article>div{gap:5px}#sentence-editor textarea{font-size:13px;padding:6px}#editor>.actions{flex:none;margin:0}#editor-count,#draft-status,#import-audio-note{font-size:10px;margin:0}#video-review-audio{height:32px;margin:0;flex:none}.empty-review{padding:14px}#import .panel h2{margin-bottom:6px}.video-import-actions{margin:7px 0}.video-import-actions label{min-width:110px}.ended-card{margin:auto;padding:20px}.end-icon{font-size:30px}
@media(max-width:600px){.app{padding:0 10px}header{padding:5px 0}.brand{font-size:17px}nav{width:100%;justify-content:space-between}nav button{font-size:11px;padding:3px 5px;min-height:28px}.view{padding:6px 0;gap:6px}.today-heading h1{font-size:19px}.today-heading label{width:120px}.scene-lobby{padding:9px}.lobby-filters{gap:6px}.lobby-filters select{font-size:12px;padding:5px;min-height:32px}.scene-section-heading{margin-top:8px}#scene-count{font-size:9px}.scene-card{min-height:68px;display:flex;gap:1px;padding:6px;align-items:flex-start}.scene-icon{font-size:20px}.scene-card strong{font-size:12px}.scene-meta{font-size:10px}.scene-grid{gap:6px}#difficulty-note{font-size:10px}.launch-options{flex-wrap:nowrap}.launch-options .pack-info{font-size:10px;flex:1;text-align:right}.launch-action{margin-top:7px}.launch-action p{font-size:10px}.scene-lobby .secondary-actions{padding-top:5px;margin-top:6px}.today-overview summary,.rules summary{font-size:11px}.library-filters{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px}.library-filters label:first-child{grid-column:1/-1}.library-filters label{min-width:0}.library-filters button{font-size:11px;min-height:32px}.library-filters label:first-child{flex-basis:auto}#library-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.material-card{padding:8px}.material-card h2{font-size:13px}.page-tabs button{font-size:12px;padding:4px 9px}.stats{gap:5px}.stat{padding:7px;font-size:11px}.stat strong{font-size:20px}#due-materials{grid-template-columns:1fr}.practice-top>div{flex-basis:100%}.practice-top{gap:5px}.practice-top h2{font-size:15px}.audio-controls{gap:4px}.audio-controls button{font-size:11px;padding:4px 6px;min-height:30px}.translation{font-size:16px;max-height:50px}.correct-answer{font-size:20px}.word input{font-size:21px}.slots{gap:8px}.practice-footer{gap:4px}.practice-footer #save-status{display:none}.tab-pane>.panel{padding:10px}.result-hero .actions button{font-size:11px;padding:5px 7px;min-height:30px}.result-score{font-size:38px}#result .evidence-chips{margin:3px 0}.ended-card{padding:16px}.info-dialog{padding:14px}}
@media(max-height:600px){.scene-section-heading{display:none}.scene-grid{margin-top:8px}.scene-card{min-height:55px}#difficulty-note{display:none}.today-heading h1{font-size:18px}.practice-steps,#combo-status{display:none}.audio-controls{padding:4px}.practice-footer{padding-top:3px}.result-score{font-size:32px}.result-hero h1{font-size:18px}}
/* Mobile keyboards shrink the visual viewport without always changing 100dvh. */
@media (max-width:1000px){
 .app{height:var(--app-visible-height,100dvh)}
 body.mobile-practice header{display:none}
 body.mobile-practice #practice{padding:2px 0 4px;gap:4px}
 body.mobile-practice .practice-top{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto auto;align-items:center;gap:4px}
 body.mobile-practice .practice-top>div{flex-basis:auto}
 body.mobile-practice .practice-top h2{font-size:14px}
 body.mobile-practice .practice-top .eyebrow{display:none}
 body.mobile-practice .exit-button{margin:0}
 body.mobile-practice .progress{margin:1px 0}
 body.mobile-practice #audio-label,body.mobile-practice #practice>.muted.centered,body.mobile-practice #combo-status,body.mobile-practice .practice-steps{display:none}
 body.mobile-practice .audio-controls{margin:0;padding:4px;gap:4px}
 body.mobile-practice .translation{min-height:0;margin:2px auto;max-height:42px}
 body.mobile-practice .slots{margin:2px 0;gap:7px}
 body.mobile-practice .answer-scroll{padding:2px 3px;scroll-padding:12px}
 body.mobile-practice #writing>.actions{margin:0}
 body.mobile-practice #check-btn{min-height:36px}
 body.mobile-practice .feedback{min-height:0;max-height:34px}
 body.mobile-keyboard-open .audio-controls button:not(#play-btn),body.mobile-keyboard-open .audio-controls label,body.mobile-keyboard-open .practice-footer,body.mobile-keyboard-open #word-count{display:none}
 body.mobile-keyboard-open .audio-controls #play-btn{min-height:34px}
}
@media (max-width:600px){
 body.mobile-practice .practice-top{grid-template-columns:minmax(0,1fr) auto auto auto}
 body.mobile-practice .practice-top>div{grid-column:1/-1}
 body.mobile-practice .practice-top .exit-button{grid-column:4;grid-row:2}
}
