/* One input method at a time. Keep handwriting and submission in the viewport. */
#keyboardControls[hidden]{display:none}#writingControls>.input-tabs{margin-top:0}
body[data-page=study][data-input-mode=handwriting] .account-toolbar{display:none}
.ink-result{display:flex;align-items:center;gap:12px;min-height:45px;padding:6px 16px;border-top:1px solid #e8edf5;background:#f9fbfe}
.ink-result>span{color:#8a98ad;font-size:10px;white-space:nowrap}.ink-result output{font-size:20px;line-height:1.35;color:#334d70;min-width:0;overflow-wrap:anywhere;flex:1;max-height:56px;overflow:auto}.ink-result output.empty{font-size:12px;color:#a0acbd}.ink-result button{font-size:11px;min-height:30px;padding:4px 7px}
body[data-page=study][data-input-mode=handwriting] .study-top{height:54px;margin-bottom:0}
body[data-page=study][data-input-mode=handwriting] .study-nav{min-height:40px;gap:7px}
body[data-page=study][data-input-mode=handwriting] .session-line{margin:0 auto;min-height:24px}
body[data-page=study][data-input-mode=handwriting] .exercise:not([data-exercise-mode=meaning]){padding-top:10px}
.exercise[data-input-mode=handwriting]:not([data-exercise-mode=meaning]) .prompt{margin:9px 0 12px}
.exercise[data-input-mode=handwriting]:not([data-exercise-mode=meaning]) .prompt h2{font-size:30px;line-height:1.3;margin:8px 0}
.exercise[data-input-mode=handwriting]:not([data-exercise-mode=meaning]) #promptHelp{margin:4px auto 0;font-size:11px;min-height:18px;line-height:1.6}
.exercise[data-input-mode=handwriting] .input-tabs{margin:0 auto 10px}
.exercise[data-input-mode=handwriting] .input-tabs button{min-height:33px;padding:6px 19px}
.exercise[data-input-mode=handwriting] .ink-toolbar{padding:5px 13px;min-height:37px}
.exercise[data-input-mode=handwriting] .ink-toolbar button{min-height:28px}
.exercise[data-input-mode=handwriting] .canvas-wrap{height:clamp(155px,25dvh,270px);margin:0 13px}
.exercise[data-input-mode=handwriting] .ink-foot{min-height:30px;padding:4px 13px;line-height:1.5;font-size:10px;gap:8px}
.exercise[data-input-mode=handwriting] .ink-foot>span{min-width:0;flex:1}
.exercise[data-input-mode=handwriting] .ink-foot button{white-space:nowrap;min-height:28px;padding:2px 0}
.exercise[data-input-mode=handwriting] .pen-diagnostics{padding:2px 13px 7px;font-size:9px}
.exercise[data-input-mode=handwriting] .ink-candidates{max-height:78px;overflow:auto;overscroll-behavior:contain;padding:5px 13px}
.exercise[data-input-mode=handwriting] .ink-candidate-label{font-size:9px;margin:0 0 3px}
.exercise[data-input-mode=handwriting] .ink-candidate-options{gap:5px}.exercise[data-input-mode=handwriting] .ink-candidate{font-size:12px;min-height:28px;padding:3px 9px}
.exercise[data-input-mode=handwriting] .ink-letter-correction{font-size:10px;margin-top:4px}
.exercise[data-input-mode=handwriting] .answer-actions{margin:12px 0 0;min-height:44px;gap:20px}
.exercise[data-input-mode=handwriting] .answer-actions .primary{min-height:42px;padding-top:10px;padding-bottom:10px}
.exercise[data-input-mode=handwriting] .exercise-foot{padding-top:4px;padding-bottom:0;min-height:20px;margin-top:4px}
.exercise[data-input-mode=handwriting] .dictation-listen{min-height:38px;font-size:12px;padding:7px 17px}
.exercise[data-input-mode=handwriting] .dictation-status{margin-top:3px;font-size:9px}
.exercise[data-input-mode=handwriting] .peek-word{padding:7px 16px;font-size:23px;margin-top:8px}.exercise[data-input-mode=handwriting] .peek-word small{font-size:9px}
body[data-page=study][data-input-mode=handwriting] .page-footer{margin-top:8px}
@media(max-width:600px){body[data-page=study][data-input-mode=handwriting] .app-main{padding-top:0}body[data-page=study][data-input-mode=handwriting] .study-top{height:47px}body[data-page=study][data-input-mode=handwriting] .study-nav{gap:0;min-height:36px}body[data-page=study][data-input-mode=handwriting] .study-nav button{min-height:33px}.exercise[data-input-mode=handwriting]:not([data-exercise-mode=meaning]) .prompt{margin:7px 0 9px}.exercise[data-input-mode=handwriting]:not([data-exercise-mode=meaning]) .prompt h2{font-size:27px;margin:7px 0}.exercise[data-input-mode=handwriting]:not([data-exercise-mode=meaning]) #promptHelp{font-size:10px}.exercise[data-input-mode=handwriting] .canvas-wrap{height:clamp(145px,24dvh,220px)}.exercise[data-input-mode=handwriting] .ink-toolbar{padding:5px 10px}.ink-result{padding:5px 11px;gap:8px}.ink-result output{font-size:18px}.exercise[data-input-mode=handwriting] .answer-actions{gap:18px}.exercise[data-input-mode=handwriting] .feedback.error{margin-top:10px;padding:9px;font-size:11px}.exercise[data-input-mode=handwriting] .feedback.error>span{display:none}.exercise[data-input-mode=handwriting] .diff{font-size:15px}.exercise[data-input-mode=handwriting] .ink-candidates{max-height:65px}}
@media(max-height:720px){.exercise[data-input-mode=handwriting] .canvas-wrap{height:clamp(110px,21dvh,150px)}.exercise[data-input-mode=handwriting]:not([data-exercise-mode=meaning]) .prompt{margin:5px 0 7px}.exercise[data-input-mode=handwriting] .ink-candidates{max-height:50px}.exercise[data-input-mode=handwriting] .exercise-foot{display:none}}
.exercise[data-input-mode=handwriting] div.dictation-status{display:none}
.exercise[data-input-mode=handwriting][data-exercise-mode=spelling] #promptHelp{display:none}
.exercise[data-input-mode=handwriting][data-exercise-mode=spelling] .canvas-wrap{height:clamp(110px,17dvh,180px)}
.exercise[data-input-mode=handwriting] .dictation-listen{margin:6px auto 0}
.exercise[data-input-mode=handwriting] .feedback.error{max-height:80px;overflow:auto;overscroll-behavior:contain}
@media(max-width:600px){.exercise[data-input-mode=handwriting] .feedback.error{max-height:60px}}
@media(max-width:600px){.exercise[data-input-mode=handwriting] .feedback.error{max-height:48px;margin-top:8px}}

.ink-result>span>small{display:block;font-size:9px;margin-top:3px;color:#889bb7}
.ink-result .ink-case-word{font:inherit;color:inherit;line-height:inherit;border:0;border-radius:4px;background:transparent;padding:2px 0;min-height:30px;white-space:normal;overflow-wrap:anywhere;text-decoration:underline;text-decoration-style:dotted;text-decoration-color:#bac9dc;text-underline-offset:4px}
.ink-result .ink-case-word:hover:not(:disabled){background:#edf3ff;color:#315f9f}.ink-result .ink-case-word:disabled{opacity:1;text-decoration:none}.ink-result output{max-height:64px}

.ink-privacy{margin:0;padding:3px 13px 5px;font-size:10px;line-height:1.5;color:#7c8da7}.exercise[data-input-mode=handwriting] .ink-privacy{font-size:9px}


/* Restrict selection in handwriting view; keep editable answer controls usable. */
body[data-page=study][data-input-mode=handwriting] #studyPage{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
body[data-page=study][data-input-mode=handwriting] input,body[data-page=study][data-input-mode=handwriting] textarea{user-select:text;-webkit-user-select:text;-webkit-touch-callout:default}
#ink,.canvas-wrap{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#penModeToggle{font-size:11px;max-width:180px;white-space:normal;touch-action:manipulation}
body[data-pen-only=true][data-input-mode=handwriting] #studyPage{touch-action:none}