/* Text determines card height, including after the correction panel opens. */
html[data-design] #modal.lessonMode .lessonInner .exerciseArea{min-height:0;overflow-y:auto!important;overscroll-behavior:contain;scroll-padding-block:16px}
html[data-design] #modal.lessonMode .lessonInner .exerciseArea>.options{flex:0 0 auto!important;min-height:0!important;height:auto!important;grid-auto-rows:auto!important;align-content:start;gap:12px!important}
html[data-design] #modal.lessonMode .lessonInner .options>.choiceRow{display:grid!important;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:8px;min-height:min-content;height:auto;flex-shrink:0}
html[data-design] #modal.lessonMode .lessonInner .option{box-sizing:border-box;height:auto!important;min-height:72px!important;max-height:none;padding:12px 14px!important;flex-shrink:0;white-space:normal;overflow-wrap:anywhere}
html[data-design] #modal.lessonMode .lessonInner .choiceContent{flex:1 1 auto;min-width:0;gap:6px}
html[data-design] #modal.lessonMode .lessonInner .choiceContent>.thai{font-size:24px;line-height:1.7;max-width:100%;white-space:normal;overflow-wrap:anywhere}
html[data-design] #modal.lessonMode .lessonInner .choiceContent :is(.reading,small){margin:0;font-size:13px;line-height:1.65;white-space:normal;overflow-wrap:anywhere}
html[data-design] #modal.lessonMode .lessonInner .choiceNumber{flex:none;align-self:center}
html[data-design] #modal.lessonMode .lessonInner .choiceAudio{box-sizing:border-box;align-self:center;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:10px}
html[data-design] #modal.lessonMode .lessonInner :is(.tapCards,.workshopAnswers){flex-shrink:0;grid-auto-rows:auto;align-items:stretch}
/* Only the correction content scrolls; the next action keeps its own row. */
html[data-design] #modal.lessonMode .lessonInner>.modalfoot.focusFeedback{box-sizing:border-box;position:relative;inset:auto;display:flex;flex:0 0 auto;flex-direction:column;align-items:stretch;gap:14px;width:100%;max-height:55%;margin:0;padding:16px 16px calc(12px + var(--app-safe-bottom))!important;overflow:hidden}
html[data-design] #modal.lessonMode .lessonInner>.modalfoot.focusFeedback>#feedback{flex:1 1 auto;min-width:0;min-height:0;max-height:none!important;overflow-y:auto;overscroll-behavior:contain;padding:0 0 2px}
html[data-design] #modal.lessonMode .lessonInner>.modalfoot.focusFeedback>.primary{flex:0 0 auto;min-height:48px!important;width:100%;margin:0}
html[data-design] #modal .resultHeading{align-items:flex-start;gap:12px}
html[data-design] #modal .resultHeading>div{min-width:0}
html[data-design] #modal .resultHeading strong{font-size:20px;line-height:1.35;overflow-wrap:anywhere}
html[data-design] #modal .resultHeading small{font-size:12px;line-height:1.5;margin-top:5px}
html[data-design] #modal .resultSymbol{flex:none}
html[data-design] #modal .resultPhrase{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;gap:8px 12px;align-items:center;margin-top:16px;padding-top:16px}
html[data-design] #modal .resultPhrase>.thai{grid-column:1;grid-row:1;margin:0;font-size:25px;line-height:1.7;min-width:0;white-space:normal;overflow-wrap:anywhere}
html[data-design] #modal .resultMeaning{grid-column:1;grid-row:2;min-width:0;margin:0;font-size:14px;line-height:1.6;overflow-wrap:anywhere}
html[data-design] #modal .lessonCoach{flex-shrink:0;gap:12px;margin-top:18px}
html[data-design] #modal .lessonCoach>div:last-child{min-width:0}
html[data-design] #modal .lessonCoach :is(strong,span){white-space:normal;overflow-wrap:anywhere;line-height:1.6}
@media(max-width:360px){html[data-design] #modal.lessonMode .lessonInner :is(.tapCards,.workshopAnswers){grid-template-columns:minmax(0,1fr)}html[data-design] #modal .resultPhrase{grid-template-columns:minmax(0,1fr)}html[data-design] #modal .resultPhrase .feedbackAudio{grid-column:1;grid-row:3;justify-self:start}html[data-design] #modal .resultHeading strong{font-size:18px}}

/* Legible answer numbers at phone size, including disabled and graded cards. */
html[data-design] #modal.lessonMode .lessonInner .option .choiceNumber{box-sizing:border-box;display:grid;place-items:center;flex:0 0 28px;align-self:center;width:28px;min-width:28px;height:28px;min-height:28px;margin:0;padding:0!important;border:1px solid #8aaf99!important;border-radius:9px;background:#dcecdf!important;color:#214b43!important;-webkit-text-fill-color:currentColor;font-family:Outfit,sans-serif;font-size:14px!important;font-weight:750!important;font-variant-numeric:tabular-nums;line-height:1!important;letter-spacing:0;opacity:1;box-shadow:none}
html[data-design] #modal.lessonMode .lessonInner .option:is(.selected,[aria-pressed="true"],[data-answer-selected="true"]) .choiceNumber{background:#1c6355!important;color:#effff7!important;border-color:#1c6355!important;box-shadow:0 0 0 2px #effff7}

/* Grading changes colours, never the geometry of the existing answer controls. */
html[data-design] #modal .characterQuiz .characterChoices{flex:0 0 auto!important;min-height:0!important;grid-auto-rows:auto!important;align-content:start}
html[data-design] #modal .characterQuiz .characterChoice{box-sizing:border-box;min-height:80px;height:auto;padding:16px 18px;flex-shrink:0}
html[data-design] #modal .characterQuiz .characterStoryBody>*{flex-shrink:0}
html[data-design] #modal .characterQuiz .quizPortrait{flex:none}
html[data-design] #modal .characterStoryFoot.answered>div{min-width:0}
html[data-design] #modal .characterStoryFoot.answered>div>.uiIcon{flex:0 0 20px;width:20px;height:20px}
html[data-design] #modal :is(.option,.foundationCard,.characterChoice,.pairCard,.miniChoice,.workshopAnswers button,.walkingChoices button,.choiceAudio){transform:none!important;animation:none!important;transition-property:background-color,border-color,color,box-shadow,opacity}
html[data-design] #modal .choiceAudio>.uiIcon{flex:none;width:21px;height:21px}
html[data-design] #modal .answerResult .resultSymbol{transform:none!important;animation:none!important}
html[data-design] #modal.lessonMode .lessonInner>.modalfoot{box-sizing:border-box;padding-left:16px!important;padding-right:16px!important}
html[data-design] #modal.lessonMode .lessonInner>.modalfoot>.primary{box-sizing:border-box;min-height:48px!important;padding:12px 16px!important;font-size:15px;line-height:1.4}
/* A scrollbar appearing must not steal width from answer cards or their icons. */
html[data-design] #modal :is(.characterStoryBody,.exerciseArea,.miniGameBody,.foundationArea){scrollbar-width:none;scrollbar-gutter:auto}
html[data-design] #modal :is(.characterStoryBody,.exerciseArea,.miniGameBody,.foundationArea)::-webkit-scrollbar{display:none;width:0;height:0}
/* Reserve the correction border before grading, so the action keeps its width. */
html[data-design] #modal.lessonMode .lessonInner>.modalfoot{border-left:1px solid transparent;border-right:1px solid transparent;border-bottom:1px solid transparent}
html[data-design] #modal.lessonMode .lessonInner>.modalfoot.focusFeedback{border-color:color-mix(in srgb,var(--result-accent,#50dfba) 24%,transparent)}

/* Pairing always exposes a readable pronunciation, including selected/matched cards. */
html[data-design] #modal.lessonMode .pairGrid{flex:0 0 auto;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch}
html[data-design] #modal.lessonMode .pairGrid>div{grid-auto-rows:minmax(94px,auto);align-content:start}
html[data-design] #modal.lessonMode .pairGrid .pairCard{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:auto;min-height:94px;padding:12px 8px;font-size:14px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
html[data-design] #modal.lessonMode .pairCard>.thai{display:block;font-size:23px;line-height:1.6}
html[data-design] #modal.lessonMode .pairCard>.pairReading{display:block;font-family:Outfit,sans-serif;font-size:14px;font-weight:600;line-height:1.5;color:inherit;opacity:1;white-space:normal;overflow-wrap:anywhere}

/* The confirm/continue action uses the same type in every exercise state. */
html[data-design] #modal :is(.lessonInner,.characterReader,.miniGameSheet,.walkingSheet,.learningQuizSheet) :is(.modalfoot,.characterStoryFoot,.miniGameFoot,.walkingSheet,.quizFooter)>.primary,
html[data-design] #modal :is(#check,#foundationContinue,#missionNextScene,#walkingNext,#nextMiniRound,#verifyMiniMemory,#finishMiniMemory,#verifyCharacter,#nextCharacterQuestion,#nextStoryCloze,#verifyAssessment,#correctionNext,#verifyLegacyStory,#nextStoryQuestion,.gameRepeatVerify){font-family:Outfit,sans-serif!important;font-size:15px!important;font-weight:700!important;line-height:1.4!important;letter-spacing:.02em!important;text-transform:none!important;font-style:normal!important}
html[data-design] #modal .storyWordChoices>button.selected{background:color-mix(in srgb,var(--lesson-accent,#64e0b7) 55%,white)!important;color:#163c34!important;box-shadow:inset 0 0 0 2px var(--lesson-accent,#64e0b7)}
