/* Reserve the existing 220px pad and 48px primary controls at short heights.
   Long/enlarged prompts keep their focusable, scrollable reading area. */
@media (max-height:550px) {
 body.has-study-frame main{padding-top:2px}
 body.has-study-frame #exercise .study-layout{gap:2px}
 body.has-study-frame #exercise .prompt-panel,
 body.has-study-frame.has-compact-answer #exercise[data-answer-revealed=true] .prompt-panel{height:44px;min-height:44px;max-height:44px;padding:4px 8px}
 body.has-study-frame #writing-panel{padding:2px}
 body.has-study-frame #writing-panel .paper-toolbar{display:none}
 /* Two-line recognition status stays inside the existing 48px control. */
 body.has-study-frame #mobile-writing-actions>#recognize{line-height:1.2;padding-block:4px}
 body.has-study-frame #study-frame-exam-prompt{height:44px;min-height:44px;max-height:44px;padding:4px 8px;margin-bottom:2px}
 body.has-study-frame[data-study-frame-state=exam] #exam-panel{margin-top:0}
 body.has-study-frame[data-study-frame-state=exam] .exam-layout{margin-top:0}
 body.has-study-frame[data-study-frame-state=exam] #exam-panel>.section-heading{position:absolute;width:1px;height:1px;padding:0;margin:0;overflow:hidden;clip-path:inset(50%)}
}
/* Grade cards keep their decision controls in the shared, measured dock. */
#mobile-navigation:not([hidden]){grid-template-columns:repeat(2,minmax(0,1fr))}
#mobile-navigation .card-assessment{grid-column:1/-1;min-width:0;grid-row:1}
#mobile-navigation .card-assessment[hidden]{display:none}
#mobile-navigation .self-check{display:flex;gap:8px;justify-content:center;margin:0}
#mobile-navigation .self-check[hidden]{display:none}
#mobile-navigation .self-check button{flex:1;min-height:44px}
#mobile-navigation #known{background:#183747;color:white}
#mobile-navigation .card-assessment .source-note{margin:4px 0 0;font-size:12px;line-height:1.4;text-align:center}
#answer-explorer .answer-card-summary{text-align:center}
#answer-explorer .answer-summary-glyph{font-size:100px;line-height:1.2}
#answer-explorer .answer-summary-reading,#answer-explorer .answer-card-summary .answer-card-reading{font-size:26px;line-height:1.4;margin:4px 0 12px;color:#173142}
#answer-explorer .answer-card-summary .answer-card-languages{text-align:left}
#answer-explorer .answer-card-memory{padding:10px 14px;margin:0 0 10px}
#answer-explorer .answer-card-memory h3{font-size:13px;margin:0 0 4px}
#answer-explorer .answer-card-memory .memory-scene{font-size:16px;line-height:1.6}
#answer-explorer .answer-card-memory .source-note{font-size:12px;margin:6px 0 0}
.answer-card-details>summary{min-height:44px;padding:10px 4px;cursor:pointer;color:#173142;font-size:14px}
body[data-study-mode=learn] main{padding-top:12px}
body[data-study-mode=learn] #course-bar{margin:0 0 8px;padding:0}
body[data-study-mode=learn] #course-bar .eyebrow{display:none}
body[data-study-mode=learn] #course-title{font-size:20px;margin:0}
body[data-study-mode=learn] #exercise>.lesson-head{margin:8px 0}
body[data-study-mode=learn] #exercise .prompt-panel{position:relative;padding:12px}
body[data-study-mode=learn] #exercise .prompt-top{position:absolute;right:12px;top:12px;margin:0}
body[data-study-mode=learn] #exercise .prompt-top .eyebrow{display:none}
body[data-study-mode=learn] #exercise #answer-box{margin:0}
body[data-study-mode=learn] #revealed-answer-card{display:flex;flex-direction:column;padding:12px}
body[data-study-mode=learn] #revealed-answer-card[hidden]{display:none}
body[data-study-mode=learn] #answer-card-toolbar{order:2;margin-top:8px}
body[data-study-mode=learn] #exercise[data-answer-revealed=true] #learn-panel{display:none}
/* The wide desktop rule previously added 48px above an active writing pad. */
body:not(.has-study-frame) #exercise[data-learning-drill] #recall-status{margin:0;padding:0;border:0;background:transparent;font-size:12px;line-height:1.4}
@media (min-width:1400px) and (max-height:900px) {
 body[data-study-mode=write]:not(.has-study-frame):has(#exercise:not([hidden])) main{padding-top:0}
}

/* Keep optional exam allocation rules reachable without crowding the inputs. */
#exam-allocation-note>summary{min-height:44px;padding-block:10px;cursor:pointer;font-size:14px;line-height:1.5}

/* End-of-practice answer review: keep the glyphs side by side on narrow screens. */
#article-finish-review{margin-block:12px}
#article-finish-review>summary{min-height:44px;padding-block:10px;cursor:pointer;font-weight:700}
#article-finish-cards{display:flex;gap:8px;margin-top:8px}
#article-finish-cards>section{flex:1;min-width:0;padding:8px 5px;border:1px solid var(--line,#dbe2e5);border-radius:8px;text-align:center;overflow-wrap:anywhere}
#article-finish-cards .article-finish-glyph{display:block;font-family:HanjaSerif,serif;font-size:42px;line-height:1.4}
#article-finish-cards h3{font-size:14px;margin:4px 0}
#article-finish-cards p{font-size:13px;line-height:1.5;margin:6px 0}
#article-finish-link:not([hidden]){display:inline-flex;align-items:center;min-height:44px}
#article-finish-cue,#article-finish-resume-note{margin:10px 0;font-size:13px;line-height:1.6}

/* Short, sourced comparison examples stay legible in small answer cards. */
.comparison-example{overflow-wrap:anywhere}
.comparison-example a{text-decoration:underline;text-underline-offset:3px}
.comparison-sources{margin-top:12px;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.comparison-sources>summary{cursor:pointer;min-height:44px;padding-block:10px}
.comparison-sources p{margin:8px 0!important;font-size:13px!important}
.comparison-sources a{display:inline-block;min-height:44px;padding-block:10px;margin-right:8px}
