/* The question, every choice and the action panel share one measured phone viewport. */
@media(max-width:999px){
html:has(.screen-lesson140[data-screen-fit="true"]),body:has(.screen-lesson140[data-screen-fit="true"]){height:var(--visible-height,100dvh)!important;min-height:0!important;overflow:hidden!important}
.lesson-shell.exercise-layout.screen-lesson140{box-sizing:border-box!important;height:var(--visible-height,100dvh)!important;min-height:0!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;gap:8px!important;padding:8px 12px max(8px,env(safe-area-inset-bottom))!important;overflow:visible!important;--screen-gap:8px;--screen-pad:9px}
.screen-lesson140 .lesson-top{padding:0 0 5px!important;gap:8px!important;min-height:38px;align-items:center}.screen-lesson140 .lesson-top .iconbtn,.screen-lesson140 .review-mute{width:36px!important;height:36px!important;min-height:36px!important;min-width:36px!important}.screen-lesson140 .lesson-top .bar{height:10px!important}.screen-lesson140 .lesson-top .progress-pct{font-size:.7rem!important}
.lesson-shell.screen-lesson140>.exercise{height:100%!important;min-height:0!important;min-width:0;display:flex!important;flex-direction:column!important;gap:var(--screen-gap)!important;overflow:visible!important;justify-content:center!important;align-self:stretch}.screen-lesson140 .exercise>*{flex-shrink:0!important;min-width:0;max-width:100%;box-sizing:border-box}.screen-lesson140 .exercise h1{font-size:1.12rem!important;line-height:1.28!important;margin:0!important}.screen-lesson140 .lesson-sub,.screen-lesson140 .round-label{font-size:.68rem!important;line-height:1.25!important;margin:0!important}.screen-lesson140 .exercise>p{font-size:.875rem!important;line-height:1.35!important;margin:0!important}.screen-lesson140 .exercise .small{font-size:.75rem!important;line-height:1.35!important;margin:0!important}
.screen-lesson140 .stage,.screen-lesson140 .dialogline{gap:7px!important;margin:0!important;align-items:center!important}.lesson-shell.screen-lesson140 .bubble,.lesson-shell.screen-lesson140 .stage .bubble{padding:var(--screen-pad)!important;border-radius:11px!important;min-width:0!important}.screen-lesson140 .bubble .phrase,.screen-lesson140 .stage .bubble .phrase,.screen-lesson140 .bubble .review-expression-row .phrase{font-size:1.08rem!important;line-height:1.3!important}.screen-lesson140 .bubble p,.screen-lesson140 .dialogline small{font-size:.8rem!important;line-height:1.35!important;margin:3px 0 0!important}.screen-lesson140 .stage .mascot,.screen-lesson140 .stage>.review-fox,.screen-lesson140 .dialogline>.review-fox,.screen-lesson140 .dialogline>img,.screen-lesson140 .listen-fox{width:42px!important;height:48px!important;min-width:0!important;flex:none!important}.screen-lesson140 .audio{width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important}.screen-lesson140 .audio svg{width:21px!important;height:21px!important}
.screen-lesson140 .options{display:grid!important;grid-template-columns:minmax(0,1fr);gap:6px!important;margin:0!important}.screen-lesson140 .options.screen-short140{grid-template-columns:repeat(2,minmax(0,1fr))!important}.screen-lesson140 .exercise .option{min-height:44px!important;padding:4px 7px!important;gap:4px!important;align-items:center!important;min-width:0}.screen-lesson140 .exercise .option .choose,.screen-lesson140 .exercise .option .es,.screen-lesson140 .review-option-expression{font-size:.94rem!important;line-height:1.3!important;overflow-wrap:anywhere}.screen-lesson140 .review-option-expression{padding:0!important}.screen-lesson140 .exercise .option .review-select-only{width:36px!important;min-width:36px!important;flex-basis:36px!important;min-height:40px!important;align-self:center}.screen-lesson140 .review-select-only:before{display:none!important}.screen-lesson140 .option .review-select-only>span{font-size:24px!important}.screen-lesson140 .option .review-select-only[aria-pressed="true"]>span{font-size:0!important}
.screen-lesson140 .answerline{min-height:44px!important;padding:5px!important;gap:4px!important}.screen-lesson140 .tiles{gap:5px!important;margin:0!important}.screen-lesson140 .tile{min-height:40px!important;padding:5px 8px!important;font-size:.94rem!important;line-height:1.3!important}.screen-lesson140 .tip,.screen-lesson140 .notice{font-size:.8rem!important;line-height:1.35!important;padding:7px 9px!important;margin:0!important}.screen-lesson140 .plain,.screen-lesson140 .listen-slow{font-size:.78rem!important;min-height:32px!important;padding:2px 6px!important}.screen-lesson140 .listen-scene{padding:8px!important;gap:7px!important}.screen-lesson140 .listen-speech{min-height:38px!important}.screen-lesson140 .sound-wave{height:28px!important}.screen-lesson140 .listen-big{width:54px!important;height:54px!important;margin:0 auto!important}.screen-lesson140 .definition{font-size:1rem!important;line-height:1.4!important;margin:0!important}.screen-lesson140 input,.screen-lesson140 textarea{font-size:1rem!important;padding:7px!important;min-height:42px!important}.screen-lesson140 textarea{height:70px!important;min-height:70px!important}.screen-lesson140 label{font-size:.8rem!important;line-height:1.35!important}.screen-lesson140 .exercise>.btn{font-size:.9rem!important;min-height:42px!important;padding:5px 10px!important}
.lesson-shell.screen-lesson140 .lesson-actions,.lesson-shell.screen-lesson140 .lesson-actions.answer-sheet{position:static!important;inset:auto!important;width:100%!important;padding:6px 0 0!important;margin:0 auto!important;max-height:none!important;overflow:visible!important;border-radius:0!important;border:0!important;border-top:1px solid var(--line)!important;box-shadow:none!important;background:var(--bg)!important;animation:none!important}.screen-lesson140 .lesson-actions>.btn{min-height:44px!important;padding:6px 10px!important;font-size:.94rem!important}.screen-lesson140 .lesson-actions .feedback{padding:0 0 5px!important;margin:0!important;min-height:0!important;border:0!important;border-radius:0!important;animation:none!important}.screen-lesson140 .feedback-friend{width:28px!important;height:28px!important;margin:0 5px 0 0!important}.screen-lesson140 .feedback h3{font-size:.94rem!important;line-height:1.3!important;margin:0 0 2px!important}.screen-lesson140 .feedback div,.screen-lesson140 .feedback div p{font-size:.8rem!important;line-height:1.35!important;margin:0!important}.screen-lesson140 .feedback.bad .small{display:none!important}.screen-lesson140 .statusline:empty{display:none!important}
.screen-lesson140 .pair-grid134{gap:6px 8px!important;margin:0!important}.screen-lesson140 .pair-tile134{min-height:44px;padding:6px;font-size:.94rem;line-height:1.3}.screen-lesson140.pair-lesson134 .lesson-actions{display:none!important}.screen-lesson140 .pair-status134{font-size:.75rem!important;line-height:1.3!important;min-height:0!important;margin:0!important}
.screen-lesson140[data-screen-compact="1"]{--screen-gap:6px;--screen-pad:7px}.screen-lesson140[data-screen-compact="1"] .lesson-sub,.screen-lesson140[data-screen-compact="2"] .lesson-sub,.screen-lesson140[data-screen-compact="3"] .lesson-sub{display:none!important}
.screen-lesson140[data-screen-compact="2"],.screen-lesson140[data-screen-compact="3"]{--screen-gap:4px;--screen-pad:5px;gap:4px!important;padding:5px 10px!important}.screen-lesson140[data-screen-compact="2"] .stage>.review-fox,.screen-lesson140[data-screen-compact="3"] .stage>.review-fox,.screen-lesson140[data-screen-compact="2"] .stage>.mascot,.screen-lesson140[data-screen-compact="3"] .stage>.mascot,.screen-lesson140[data-screen-compact="2"] .dialogline>.review-fox,.screen-lesson140[data-screen-compact="3"] .dialogline>.review-fox,.screen-lesson140[data-screen-compact="2"] .dialogline>img,.screen-lesson140[data-screen-compact="3"] .dialogline>img,.screen-lesson140[data-screen-compact="2"] .listen-fox,.screen-lesson140[data-screen-compact="3"] .listen-fox{display:none!important}.screen-lesson140[data-screen-compact="3"] .exercise h1{font-size:1rem!important}.screen-lesson140[data-screen-compact="3"] .exercise>p,.screen-lesson140[data-screen-compact="3"] .tip,.screen-lesson140[data-screen-compact="3"] .notice{font-size:.8rem!important;line-height:1.25!important}.screen-lesson140[data-screen-compact="3"] .pair-tile134{font-size:.875rem;padding:3px;min-height:42px}
/* Preserve all content as a safe fallback if a future, unaudited screen is too long. */
.lesson-shell.screen-lesson140[data-screen-fit="false"]{height:auto!important;min-height:var(--visible-height,100dvh)!important;grid-template-rows:auto auto auto!important}.screen-lesson140[data-screen-fit="false"]>.exercise{height:auto!important}
}

@media(max-width:999px){.screen-lesson140 .lesson-top{padding-left:44px!important;box-sizing:border-box!important}.screen-lesson140[data-screen-compact="3"]{--screen-gap:2px;gap:2px!important}}
@media(max-width:999px){
.screen-lesson140 .exercise:has(>.screen-deck140){justify-content:flex-start!important}
.screen-lesson140 .exercise>.screen-deck140{position:relative;width:100%;flex:1 1 0!important;min-height:0!important;max-width:100%}
.screen-step140{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;gap:var(--screen-gap);min-width:0;min-height:0;overflow:visible}
.screen-step140[hidden]{display:none!important}.screen-step140>*{flex-shrink:0;max-width:100%;box-sizing:border-box;min-width:0}.screen-step140>p{font-size:.875rem!important;line-height:1.35!important;margin:0!important}.screen-step140>.definition{font-size:1rem!important}
.screen-pager140{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:36px;flex:none;width:100%;font-size:.75rem;color:var(--muted)}.screen-pager140 button{font-family:inherit;font-size:.78rem;line-height:1.25;border:1px solid var(--line);background:var(--surface);color:var(--blue);border-radius:8px;min-height:36px;padding:3px 10px}.screen-pager140 button:disabled{opacity:.4}
.screen-step140>.screen-internal140{flex:1 1 0!important;min-height:0!important;max-height:100%;overflow-y:auto!important;overscroll-behavior:contain;padding-bottom:3px!important;scrollbar-width:thin}.screen-has-internal140{justify-content:flex-start}
.screen-text-part140:after{content:'اضغط لسماع النص كامل';display:block;direction:rtl;font:400 .68rem/1.3 Yalla,Arial;color:var(--muted);margin-top:4px}
.screen-lesson140[data-screen-compact="3"] .lesson-actions,.screen-lesson140[data-screen-compact="3"] .lesson-actions.answer-sheet{padding-top:2px!important}
}

@media(max-width:999px){.screen-bank-group140{display:flex;flex-direction:column;gap:var(--screen-gap)}.screen-bank-group140>*{flex-shrink:0}}
@media(max-width:999px){
.screen-lesson140[data-screen-compact="3"] .exercise .option .es,.screen-lesson140[data-screen-compact="3"] .exercise .option .choose,.screen-lesson140[data-screen-compact="3"] .review-option-expression{font-size:max(.875rem,14px)!important;line-height:1.25!important}
.screen-lesson140[data-screen-compact="3"] .bubble .phrase,.screen-lesson140[data-screen-compact="3"] .bubble .review-expression-row .phrase{font-size:1rem!important;line-height:1.25!important}
.screen-lesson140[data-question="dialog"] .dialogline .bubble:has(>p)>.phrase,.screen-lesson140[data-question="dialogreply"] .dialogline .bubble:has(>p)>.phrase{display:none!important}
.screen-lesson140[data-question="spell"] .tiles{gap:3px!important}.screen-lesson140[data-question="spell"] .tiles>.tile{flex:0 0 auto!important;min-width:24px!important;min-height:36px!important;padding:3px 5px!important;font-size:max(.875rem,14px)!important;line-height:1.25!important}
.screen-lesson140 .tiles>.tile:disabled,.screen-lesson140 .tiles>.tile[data-review-disabled="true"]{display:none!important}
}
@media(max-width:999px){.screen-lesson140 .option:has([data-review-es])>.audio{display:none!important}.screen-lesson140 .screen-pager140 [hidden]{display:none!important}}

@media(max-width:999px){.screen-lesson140[data-screen-compact="3"] .pair-tile134{line-height:1.2}}
@media(max-width:999px){.lesson-shell.exercise-layout.screen-lesson140{grid-template-columns:minmax(0,1fr)!important;justify-content:stretch!important}.screen-step140>.options,.screen-step140>.pair-grid134,.screen-step140>.screen-bank-group140{width:100%!important}}

@media(max-width:999px){.screen-lesson140[data-screen-empty-prefix="true"] .dialogline .bubble:has(>p)>.phrase{display:none!important}}

/* Keep overflowing choices at their natural height, never overlap adjacent answers. */
@media(max-width:999px){
.screen-lesson140 .options.screen-internal140{grid-auto-rows:max-content!important;align-content:start!important}
.screen-lesson140 .screen-feedback146{width:100%;padding:10px!important;margin:0!important;border:1px solid var(--line);border-radius:12px;min-height:0!important;animation:none!important}
.screen-lesson140[data-screen-compact="2"] .screen-step140>.review-fox,.screen-lesson140[data-screen-compact="3"] .screen-step140>.review-fox{display:none!important}
}

/* Real finger targets; long banks are paged rather than shrinking letters. */
.screen-lesson140[data-question="spell"] .tiles>.tile{min-width:44px!important;min-height:48px!important;padding:7px 10px!important;font-size:1.08rem!important}.screen-lesson140[data-question="spell"] .tiles{gap:6px!important}.option{cursor:pointer}.option .review-option-expression{flex:1;align-self:stretch;display:flex;align-items:center;min-height:44px}.option .audio{position:relative;z-index:1}

/* Phone choices use equal full-width rows, never an orphaned grid cell. */
@media(max-width:700px){.screen-lesson140 .options.screen-short140{grid-template-columns:minmax(0,1fr)!important}.screen-lesson140 .exercise .option{width:100%!important;min-height:48px!important}.screen-lesson140 .review-option-expression{justify-content:flex-start}}
