/* LessonSky RC143 – native mobile/readability patch. Loaded after RC141.
 * Night surfaces must not inherit bright light-only backgrounds while text
 * inherits dark-mode white. Light/Dim and assessment answer feedback remain intact. */

/* Secondary-school guidance was absent from the earlier dark palettes. */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk88-home .sk88-journey-card,.sk88-guidance .sk88-school,
 .sk88-guidance .sk88-type,.sk88-guidance .sk88-steps article,
 .sk88-guidance .sk88-lessons,.sk88-guidance .sk88-lesson,
 .sk88-guidance .sk88-source,.sk88-guidance .sk88-choice,
 .sk88-guidance .sk88-add,.sk88-guidance .sk88-legacy,
 .sk88-home .sk88-type,.sk88-school-grid .sk88-school,
 .sk88-journey-card,.sk88-type,.sk88-steps article,
 .sk88-lessons,.sk88-lesson,.sk88-source,.sk88-choice,.sk88-add
){
 background:#1a304d!important;background-image:none!important;
 color:#edf6ff!important;border-color:#4b6b90!important;
 box-shadow:none!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk88-journey-card,.sk88-type,.sk88-lessons,.sk88-lesson,.sk88-steps article,
 .sk88-school,.sk88-choice,.sk88-add,.sk88-source
) :is(h2,h3,h4,h5,h6,strong,b,summary,legend,label,dt,dd){
 color:#f5f9ff!important;opacity:1!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk88-journey-card,.sk88-type,.sk88-lessons,.sk88-lesson,.sk88-steps article,
 .sk88-school,.sk88-choice,.sk88-add,.sk88-source
) :is(p,small,li,figcaption){color:#cbd8e9!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk88-journey-card>span,
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk88-school a,.sk88-source a){color:#9bc9ff!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk88-group small,.sk88-school small){background:#254463!important;color:#d7eaff!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk88-filters input,.sk88-filters select,.sk88-add input,.sk88-add select,.sk88-add textarea,
 .sk88-actions button,.sk88-legacy input,.sk88-legacy select
){background:#112640!important;color:#f0f6ff!important;border-color:#6587aa!important}

/* Community permission and league panels had a light-only background. */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk-learning-league .sk-age-safe-note,.sk-age-safe-note,
 .sk-motivation-journey,.sk-motivation-community,
 .sk-motivation-pulse-grid article,.sk-community-circle,.sk-circle-board span,
 .sk-league-board>div,.sk-community-mission,.sk-league-reward,
 .sk-motivation-panel,.sk-league-consent
){background:#1b3352!important;background-image:none!important;border-color:#496a91!important;color:#eef6ff!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk-age-safe-note,.sk-motivation-journey,.sk-motivation-community,
 .sk-motivation-pulse-grid article,.sk-community-circle,.sk-circle-board span
) :is(p,small,span,em){color:#c9d8ea!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk-age-safe-note,.sk-motivation-journey,.sk-motivation-community,
 .sk-motivation-pulse-grid article,.sk-community-circle,.sk-circle-board span
) :is(h2,h3,h4,strong,b){color:#f4f9ff!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-learning-league .sk-age-safe-note{border-style:dashed!important}

/* Other nested legacy white pockets (scoped rather than a document-wide reset). */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk88-guidance,.sk88-types,.sk88-home,.sk88-journey,.sk-learning-league,
 .sk-profile-center,.sk-profile-panel,.sk88-school-grid
) :is(input[type=text],input[type=number],input[type=search],select,textarea){
 color:#f1f7ff!important;background:#10243e!important;border-color:#587aa2!important;
}

/* Assessment tool rail: narrow touch screens must never squeeze the font-size
 * label into a one-character-wide column. Keep controls large and tappable. */
@media(max-width:820px){
 body.lessonsky-assessment-focus .sk-assessment-tools-rail,
 body.lessonsky-assessment-focus .sk-assessment-tool-card{
   display:grid!important;grid-template-columns:minmax(0,1fr)!important;
   grid-template-rows:auto!important;min-width:0!important;max-width:100%!important;
   overflow:visible!important;height:auto!important;
 }
 body.lessonsky-assessment-focus .sk-assessment-tool-card>.sk-assessment-panel-head{
   grid-column:1 / -1!important;
 }
 body.lessonsky-assessment-focus .sk-assessment-tool-row{
   min-width:0!important;width:100%!important;
   display:grid!important;grid-template-columns:24px minmax(74px,1fr) auto!important;
   gap:8px!important;align-items:center!important;
 }
 body.lessonsky-assessment-focus .sk-assessment-font-tools>b{
   min-width:74px!important;white-space:normal!important;
   word-break:normal!important;overflow-wrap:normal!important;
   font-size:clamp(12px,3vw,15px)!important;
   line-height:1.25!important;
 }
 body.lessonsky-assessment-focus .sk-assessment-font-tools>div{
   display:flex!important;flex-wrap:nowrap!important;gap:5px!important;
 }
 body.lessonsky-assessment-focus .sk-assessment-font-tools>div button{
   min-width:34px!important;width:34px!important;height:36px!important;
   padding:0!important;flex:0 0 34px!important;
 }
 body.lessonsky-assessment-focus .sk-assessment-tools-rail>section{min-width:0!important;max-width:100%!important}
}
@media(max-width:370px){
 body.lessonsky-assessment-focus .sk-assessment-font-tools{grid-template-columns:22px minmax(66px,1fr) auto!important;gap:5px!important}
 body.lessonsky-assessment-focus .sk-assessment-font-tools>div button{min-width:30px!important;width:30px!important;flex-basis:30px!important}
}
