/* LessonSky RC169: FINAL design contract for the authenticated core screens.
   This loads after the Experience117 CSS stream (priority 1100).
   Scope selectors to known plugin surfaces; no page-wide recoloring or content mutation.
   Keep state feedback, illustrations, and quiz answer colors intact. */

/* Night: profile exam preferences had independent light-card defaults. */
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="profile"] :is(.sk-exam-card,.sk-learning-subject,.sk-learning-group){
  background:#1a304b!important;background-image:none!important;
  border:1px solid #527195!important;color:#f2f8ff!important;
  box-shadow:0 6px 18px rgba(3,11,24,.14)!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="profile"] :is(.sk-exam-card,.sk-learning-subject)
:is(strong,b,h3,h4,label){color:#f4f9ff!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="profile"] :is(.sk-exam-card,.sk-learning-subject)
:is(p,small,span:not(.sk-exam-category-badge)){color:#cbdced!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="profile"] .sk-exam-title>span{
 background:#2e5076!important;color:#e9f5ff!important;border:1px solid #6083aa!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="profile"] .sk-learning-subject:has(input:checked){
 background:#214b58!important;border:2px solid #81d3bd!important;
 box-shadow:inset 0 0 0 1px rgba(129,211,189,.19)!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="profile"] .sk-exam-readiness.is-ready{
 background:#183d39!important;border:1px solid #5ab49a!important;
 color:#c7ffe7!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="profile"] .sk-exam-readiness.is-staged{
 background:#453720!important;border:1px solid #ad854f!important;
 color:#ffe2ab!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="profile"] .sk-exam-readiness :is(strong,span){color:inherit!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="profile"] .sk-country-exam-note{
 background:#453720!important;border-color:#ad854f!important;color:#ffe8be!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="profile"] .sk-country-exam-note :is(a,strong,span){color:#ffebc9!important}

/* Night: learning library, solved examples and student growth cards. */
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="dashboard"] :is(
 .sk-learn-subject,.sk-learn-topic-card,.sk-learn-topic-list,
 .sk-learn-lesson-body,.sk-learn-explanation-grid>article,
 .sk-learning-selection,.sk-progress-compact-head,
 .sk-experience-subject-section,.sk-term-strategy-card,
 .sk-score-tools-card,.sk-ai-chat-card,.sk-cockpit-card
){
 background-color:#172c47!important;background-image:none!important;
 color:#eff7ff!important;border-color:#476a8b!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="dashboard"] :is(
 .sk-learn-subject,.sk-learn-topic-card,.sk-learn-lesson-body,
 .sk-learn-explanation-grid>article,.sk-experience-subject-section,
 .sk-progress-compact-head,.sk-score-tools-card,.sk-ai-chat-card
) :is(h2,h3,h4,strong,b,summary,legend){color:#f2f8ff!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="dashboard"] :is(
 .sk-learn-topic-card,.sk-learn-lesson-body,.sk-learn-explanation-grid>article,
 .sk-experience-subject-section,.sk-score-tools-card,.sk-ai-chat-card
) :is(p,small,li){color:#c7d9ef!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="dashboard"] :is(.sk-learn-depth-row,.sk-learn-concept-chips>span,.sk-learn-topic-title>span){
 background:#294868!important;border-color:#5d7c9f!important;color:#eaf4ff!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="dashboard"] :is(.sk-learn-topic-card,.sk-ai-chat-card,.sk-score-tools-card)
:is(.sk-btn-ghost,.sk-small-btn){
 background:#28517e!important;color:#f5faff!important;border:1px solid #7096bd!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="dashboard"] .sk-learn-topic-card>details>summary{
 background:#253e5d!important;border:1px solid #537497!important;color:#f2f8ff!important;
 border-radius:10px;padding:10px 13px;
}

/* Lesson subject accordion head: older shared summary CSS produced a white
   strip with white text on small screens. This override is scoped to Learning. */
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="dashboard"] .sk-learn-subject>summary{
 background:#274766!important;background-image:none!important;
 color:#f3f9ff!important;border:1px solid #5f82a3!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="dashboard"] .sk-learn-subject>summary :is(strong,b,small,span){
 color:#f3f9ff!important;opacity:1!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell[data-sk-l10n-surface="dashboard"] .sk-learn-topic-card .sk-learn-depth-row :is(span,small){
 color:#e3f4ff!important;opacity:1!important;
}

/* Night: profile & growth pills must be intentional (no pale label islands). */
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell :is(.sk-profile-exam-chips>span,.sk-profile-completion,.sk-profile-summary-item,
 .sk-profile-topic-row,.sk-learning-league .sk-league-row){
 background:#203c5b!important;border-color:#4b6e93!important;color:#f1f8ff!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell :is(.sk-profile-completion,.sk-profile-summary-item,.sk-profile-topic-row)
:is(span,small,p){color:#cadaed!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell :is(.sk-profile-completion,.sk-profile-summary-item,.sk-profile-topic-row)
:is(strong,b){color:#f1f8ff!important;opacity:1!important}

/* Day/Dim: preserve dark lettering on soft canvases; avoid Night variables
   leaking into science and solved example blocks when toggling appearance. */
:is(html.lessonsky-dim body,body.lessonsky-dim)
:is(.sk167-science,.sk167-examples,.sk167-exam-study,.sk167-study-scaffold,.sk167-mindmap){
 background:#eaf0f7!important;border:1px solid #b7c9dc!important;color:#1d3553!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim)
:is(.sk167-examples-grid>article,.sk167-exam-study-grid>a,.sk167-mindmap-grid>article){
 background:#f3f7fc!important;border:1px solid #c3d4e5!important;color:#1d3553!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim)
:is(.sk167-examples-grid>article,.sk167-exam-study-grid>a,.sk167-mindmap-grid>article)
:is(h3,h4,strong,p,small,span){color:#2b4664!important;opacity:1!important}
:is(html.lessonsky-dim body,body.lessonsky-dim)
.sk-shell[data-sk-l10n-surface="profile"] :is(.sk-exam-card,.sk-learning-subject){
 background:#eaf0f7!important;border-color:#b3c5da!important;color:#1f3854!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim)
.sk-shell[data-sk-l10n-surface="profile"] :is(.sk-exam-card,.sk-learning-subject) :is(strong,small,label,span){
 color:#244562!important;opacity:1!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim)
.sk-shell[data-sk-l10n-surface="profile"] .sk-exam-readiness.is-ready{
 background:#d1eae0!important;border-color:#91bfaa!important;color:#16553e!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim)
.sk-shell[data-sk-l10n-surface="profile"] .sk-exam-readiness.is-staged{
 background:#f7eacf!important;border-color:#d2b783!important;color:#71430f!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim)
.sk-shell[data-sk-l10n-surface="profile"] .sk-exam-readiness :is(strong,span){color:inherit!important;opacity:1!important}

/* A visible focus indicator and legible form controls for all three modes. */
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){
 background-color:#0f253f!important;color:#f3f9ff!important;border:1px solid #7290b0!important;
 caret-color:#f3f9ff!important;color-scheme:dark!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell :is(input:not([type=checkbox]):not([type=radio]),textarea)::placeholder{
 color:#b9cde3!important;opacity:1!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell :is(input,select,textarea,button,a,summary):focus-visible{
 outline:3px solid #a4d7ff!important;outline-offset:3px!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim)
.sk-shell :is(input,select,textarea,button,a,summary):focus-visible{
 outline:3px solid #33659b!important;outline-offset:3px!important;
}

/* RC167 learning blocks live in many host containers. Keep border-box geometry
   on both desktop and phones to avoid right-edge overflow from nested padding. */
.sk-shell :is(.sk167-science,.sk167-examples,.sk167-study-scaffold,.sk167-exam-study,.sk167-mindmap){
 box-sizing:border-box!important;max-width:100%!important;min-width:0!important;
}

/* Mobile portrait: no overflowing grade filters, CTA rows or explanation cards. */
@media(max-width:680px){
 /* Earlier dashboard style widened the main shell beyond 100vw using a
    negative right margin. Contain its width before sizing lesson models. */
 .sk-shell[data-sk-l10n-surface="dashboard"]{
  box-sizing:border-box!important;width:calc(100% - 16px)!important;
  max-width:calc(100vw - 16px)!important;
  margin-left:auto!important;margin-right:auto!important;
  padding-left:8px!important;padding-right:8px!important;
 }
 .sk-shell[data-sk-l10n-surface="profile"] .sk-exam-title{
  flex-wrap:wrap!important;gap:9px!important;min-width:0!important;
 }
 .sk-shell[data-sk-l10n-surface="profile"] .sk-exam-readiness{
  flex-wrap:wrap!important;gap:5px 9px!important;min-width:0!important;
 }
 .sk-shell[data-sk-l10n-surface="profile"] .sk-exam-readiness strong{
  white-space:normal!important;overflow-wrap:anywhere!important;
 }
 .sk-shell[data-sk-l10n-surface="profile"] .sk-exam-card{
  min-width:0!important;overflow-wrap:anywhere!important;
 }
 .sk-shell[data-sk-l10n-surface="dashboard"] :is(.sk-card-head,.sk-learn-topic-title){
  flex-wrap:wrap!important;gap:10px!important;
 }
 .sk-shell[data-sk-l10n-surface="dashboard"] :is(.sk-learn-topic-card,.sk-learn-lesson-body,.sk-learn-explanation-grid>article){
  min-width:0!important;overflow-wrap:anywhere!important;
 }
 .sk-shell[data-sk-l10n-surface="dashboard"] :is(.sk-learn-topic-card .sk-btn,.sk-score-tools-card .sk-btn){
  white-space:normal!important;max-width:100%!important;text-align:center!important;
 }
}
@media(prefers-reduced-motion:reduce){
 .sk-shell .sk-learning-subject,.sk-shell .sk-exam-card,.sk-shell .sk-learn-topic-card{transition:none!important}
}
@media(forced-colors:active){
 .sk-shell :is(.sk-learning-subject,.sk-exam-card,.sk-learn-topic-card,.sk167-science){
  forced-color-adjust:auto!important;background:Canvas!important;color:CanvasText!important;border-color:CanvasText!important;
 }
}
