/* RC141: unified NIGHT component surface contract.
 * This file intentionally loads after the historical appearance CSS so a
 * themed parent never leaves a white child with light-on-light text.
 * Only color/surface styles are changed; content and layout are retained. */

:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-shell,.sk78-workspace,.sk79-workspace,.sk80-workspace,.sk81-tools,.sk81-universities,.sk85-preferences,.sk85-discovery,.sk-profile-center,.ls-app-center){
  --sk-bg:#0c192b;--sk-card:#142741;--sk-text:#f0f6ff;--sk-muted:#c5d5e9;
  --sk-border:#425e80;--sk-accent:#82b6ff;--sk-accent2:#6296df;
  --sk85-ink:#f0f6ff;--sk85-subtle:#bfd0e5;
  --ls-surface:#142741;--ls-surface-2:#1c3453;--ls-surface-3:#254362;
  --ls-text:#f0f6ff;--ls-text-strong:#fff;--ls-text-muted:#c5d5e9;
  --ls-border:#425e80;--ls-line:#425e80;
  color:#f0f6ff!important;
}

/* Standard cards, strategy summaries, university records and nested tables. */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-term-summary>div,.sk-month-board article,.sk-drift-signals article,.sk-goal-summary>div,.sk-milestone-track article,.sk-goal-collab,.sk-parent-shared-goal,.sk-cockpit-metrics>div,.sk-cockpit-signals article,.sk-command-actions article,.sk-command-sim-metrics span,.sk-learning-signals>div,.sk-card,.sk-exam-card,.sk-stat,.sk-mini-task,.sk-empty,.sk-task,.sk-report-metrics>div,.sk-progress-row,.sk-notification,.sk-learning-subject,.sk-learning-route-strip,.sk-learn-lesson-body,.sk-learning-resource-hub,.sk-kmap-group,.sk-kmap-node,.sk-kmap-detail,.sk-kmap-graph,.sk-kmap-cluster,.sk-kmap-cluster-head,.sk-kmap-advanced-view,.sk-kmap-list-fallback,.sk-kmap-topic-chip,.sk-family-stats>div,.sk-family-notification-list article,.sk-child-access-grid article,.sk-age-home-grid article,.sk-diagnostic-dashboard-metrics span,.sk-ai-chat-card,.sk-ai-chat-empty,.sk-ai-bubble,.sk-ai-action-chip,.sk-task-explanation,.sk-support-reasons span,.sk85-discovery,.sk85-saved,.sk85-program-card,.sk85-program-stats>div,.sk85-compare,.sk85-limitation,.sk85-empty,.sk85-saved-card,.sk85-manual-entry,.sk85-preference-item,.sk85-preference-card,.sk85-preference-main,.sk85-selection-summary,.sk86-history,.sk86-university-history,.sk86-saved-history,.sk86-history-table,.sk86-history-scroll table,.sk86-history-scroll td,.sk80-panel,.sk80-exam-tile,.sk80-school,.sk80-preference,.sk80-result,.sk80-tile,.sk80-hub-card,.sk80-history-body,.sk80-date-form,.sk78-card,.sk78-detail,.sk78-publication,.sk78-empty,.sk78-map,.sk79-official,.sk79-lab,.sk79-subject-tile,.sk81-tool-card,.sk81-university,.sk81-match,.sk81-catalog-filter,.sk81-universities,.sk81-report-panel,.sk131-programme-explorer,.sk131-programme-count,.sk131-programme-explorer .sk80-school,.sk-content-question-card,.sk-content-progress-panel,.sk-subject-test-card,.sk-subject-test-row,.sk-topic-question-row,.sk-assessment-start-card,.sk-assessment-blueprint,.sk-assessment-live-card,.sk-assessment-live-metrics>div,.sk-assessment-latest,.sk-assessment-question-map-panel,.sk-assessment-tools-rail>section,.sk-learning-league .sk-league-row,.sk-learning-outcome-grid>article,.sk-reading-card,.sk-reading-rule,.sk-reading-question,.sk-growth-hub-grid>article,.sk-review-kpis article,.sk-review-due-list a,.sk-profile-panel,.sk-profile-summary-item,.sk-profile-topic-row,.sk-profile-completion,.sk-profile-action-box,.ls-app-card,.ls-app-platform-section,.ls-app-signup,.ls-app-steps){
  background:#182e4a!important;background-image:none!important;
  border-color:#405e82!important;color:#eef6ff!important;
  box-shadow:0 8px 20px rgba(2,10,25,.13)!important;
}

/* Auxiliary text on the corrected dark surfaces. */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-month-board article>div span,.sk-month-board article small,.sk-month-board article p,.sk-term-summary small,.sk-goal-summary small,.sk-milestone-track small,.sk-cockpit-metrics small,.sk-cockpit-signals small,.sk-card-head p,.sk-card p,.sk-command-disclaimer,.sk-stat span,.sk-exam-title>span,.sk85-section-heading p,.sk85-program-card p,.sk85-meta,.sk85-program-name,.sk85-program-stats dt,.sk85-result-count,.sk85-limitation,.sk85-filters label,.sk86-history-note,.sk86-single-year,.sk86-coverage-note,.sk86-history-scroll td,.sk85-saved-tools small,.sk80-panel p,.sk80-exam-tile small,.sk80-hub-card p,.sk78-card p,.sk78-detail p,.sk79-subject-tile p,.sk81-tool-card small,.sk81-university p,.sk81-match p,.sk131-programme-explorer p,.sk-kmap-node small,.sk-kmap-detail p,.sk-learning-signals small,.sk-learning-signals span,.sk-goal-collab p,.sk-goal-collab small,.sk-goal-summary small,.sk-parent-shared-goal small,.sk-support-reasons span,.sk85-discovery small,.sk85-discovery dt,.sk85-saved small){color:#c6d7eb!important;opacity:1!important}

:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-term-summary strong,.sk-month-board article strong,.sk-goal-summary strong,.sk-milestone-track strong,.sk-cockpit-metrics strong,.sk-cockpit-signals strong,.sk-drift-signals article strong,.sk85-section-heading h2,.sk85-section-heading h3,.sk85-program-card h4,.sk85-program-card h3,.sk85-program-stats dd,.sk85-preference-main h4,.sk85-compare h4,.sk86-history summary,.sk86-history-scroll th,.sk86-history-scroll td,.sk86-history-table td,.sk86-history-table th,.sk80-school h3,.sk80-exam-tile strong,.sk131-programme-explorer h2,.sk-learning-signals strong,.sk-card-head h2,.sk-month-board article>div strong,.sk-kmap-node strong){color:#f4f8ff!important;opacity:1!important}

/* Pills and decorative counters. */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk85-count,.sk131-programme-count,.sk85-meta,.sk-kmap-node-status,.sk-milestone-track article>span,.sk-exam-title>span,.sk-kmap-legend span,.sk-family-plan-badge,.sk-day span,.sk-diagnostic-question-meta span){background:#254362!important;border-color:#517399!important;color:#e6f1ff!important}

/* Search, filters, notes and selections: all receive the same readable control palette. */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),.sk-shell select,.sk-shell textarea,.sk85-discovery input:not([type="checkbox"]):not([type="radio"]),.sk85-discovery select,.sk85-discovery textarea,.sk85-preferences input:not([type="checkbox"]):not([type="radio"]),.sk85-preferences select,.sk85-preferences textarea,.sk80-workspace input:not([type="checkbox"]):not([type="radio"]),.sk80-workspace select,.sk80-workspace textarea,.sk78-workspace input:not([type="checkbox"]):not([type="radio"]),.sk78-workspace select,.sk78-workspace textarea,.sk81-tools input:not([type="checkbox"]):not([type="radio"]),.sk81-tools select,.sk81-tools textarea){
  background:#10243e!important;background-image:none!important;
  color:#f1f7ff!important;border:1px solid #56769c!important;
  caret-color:#d3e8ff!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-shell,.sk85-discovery,.sk85-preferences,.sk80-workspace,.sk78-workspace) :is(input,textarea)::placeholder{color:#b4c8e1!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-shell,.sk85-discovery,.sk85-preferences,.sk80-workspace,.sk78-workspace) option{background:#112740!important;color:#f1f7ff!important}

:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk85-more button,.sk85-compare button,.sk85-notes button,.sk85-manual-entry button,.sk-shell .sk-btn-ghost,.sk-shell .sk-small-btn,.sk-shell .sk-check,.sk81-pagination a,.sk78-pagination a,.sk80-button:not(.primary),.sk78-secondary){background:#28496f!important;color:#eef7ff!important;border-color:#5b80ab!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk85-program-actions a,.sk85-notes summary,.sk85-saved-tools a,.sk86-history-table a,.sk86-history-scroll a,.sk85-compare-label){color:#a8d1ff!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk85-program-actions button,.sk85-program-card button[type="submit"]){background:#316ab2!important;color:#fff!important;border-color:#6b97d5!important}

/* Table headers & scrollable official yearly results. */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk86-history-table th,.sk86-history-scroll thead th,.sk85-comparison-table th){background:#24405f!important;color:#edf6ff!important;border-color:#56769b!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk86-history-table td,.sk86-history-scroll tbody td,.sk86-history-scroll tbody th,.sk85-comparison-table td){background:#182e4a!important;color:#e3edfb!important;border-color:#456586!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk86-history>summary,.sk86-university-history>summary,.sk86-saved-history>summary){background:#203d5e!important;color:#eef7ff!important}

/* Preference explorer does not inherit the normal sk-card surface contract. */
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk85-preferences, :is(html.lessonsky-dark body,body.lessonsky-dark) .sk85-discovery{background:#152940!important;color:#f0f6ff!important;border-color:#426184!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk85-preferences :is(h2,h3,h4,h5,legend,label,summary,th),
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk85-discovery :is(h2,h3,h4,h5,legend,label,summary,th){color:#f2f7ff!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk85-preferences :is(.sk80-school,.sk80-hub-card,.sk85-saved-card),
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk85-discovery :is(.sk85-program-card,.sk85-program-stats>div){background:#1d3655!important;color:#f0f6ff!important;border-color:#456688!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk85-discovery,.sk85-preferences) :is(.sk85-program-card,.sk85-saved-card,.sk85-discovery) :is(p,small,dt){color:#c2d4e9!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk85-program-stats dd{color:#f5f9ff!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk85-compare[hidden], :is(html.lessonsky-dark body,body.lessonsky-dark) .sk85-saved-card [hidden]{display:none!important}

/* Error/success messages retain meaningful status rather than forced blue. */
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-notice.is-error{background:#4b2a34!important;border-color:#99667b!important;color:#ffe3ea!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-notice.is-success{background:#164a41!important;border-color:#428c7b!important;color:#ddfff2!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-drift-badge.is-stable,.sk-parent-pace.is-strong,.sk-parent-pace.is-on_track){background:#134f42!important;color:#d0fff0!important;border-color:#418c7a!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-drift-badge.is-watch,.sk-parent-pace.is-watch){background:#514025!important;color:#ffe3b2!important;border-color:#a17e41!important}

/* Theme switch: desktop – fixed below the actual profile (not in the menu). */
html body .sk117-quick-theme.sk141-theme-below-profile,
html body .sk117-quick-theme.sk141-theme-below-profile.sk131-theme-fallback{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  position:fixed!important;inset:auto!important;
  left:var(--sk141-x,calc(100vw - 56px))!important;
  top:var(--sk141-y,74px)!important;
  right:auto!important;bottom:auto!important;
  width:40px!important;height:40px!important;margin:0!important;
  transform:none!important;pointer-events:auto!important;
  z-index:45!important;
}
html body .sk117-quick-theme.sk141-theme-below-profile button{
  width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;
  max-width:40px!important;padding:0!important;border-radius:13px!important;
  border:1px solid #6080a9!important;background:#1b3657!important;color:#f0f7ff!important;
  box-shadow:0 7px 19px rgba(0,8,23,.20)!important;
}
html.lessonsky-light body .sk117-quick-theme.sk141-theme-below-profile button,
html.lessonsky-dim body .sk117-quick-theme.sk141-theme-below-profile button{
  background:#ecf2fa!important;color:#234d7f!important;border-color:#b5c8e0!important;
}
html body .sk117-quick-theme.sk141-theme-below-profile[hidden],
html body .sk117-quick-theme.sk131-theme-docked[hidden]{display:none!important;pointer-events:none!important}
body:has(.sk-assessment-focus-shell) .sk117-quick-theme,
body:has(.sk-practice-session) .sk117-quick-theme{display:none!important}
@media (max-width:767px){
  html body .sk117-quick-theme.sk141-theme-below-profile{display:none!important}
  html body .sk-mobile-topbar .sk117-quick-theme.sk131-theme-mobile{
    position:static!important;inset:auto!important;display:inline-flex!important;
    margin:0 6px 0 0!important;z-index:20!important;
  }
}

/* RC141 additional surface coverage – guided learning, career, parent, language and skills. */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-guide-quick-card,.sk-guide-role-grid article,.sk-guide-section,.sk-guide-search-wrap,.sk-guide-quick-links a,.sk-role-guide-card,.sk-role-guide-disclosure,.sk-university-grid article,.sk-university-guide,.sk-family-command-grid article,.sk-family-child-ribbon,.sk-family-shell .sk-family-overview,.sk-family-guardians,.sk-family-intelligence-summary,.sk-parent-intelligence-family-grid article,.sk-parent-intelligence-rule,.sk-parent-intelligence-child,.sk-parent-intelligence-metrics article,.sk-parent-intelligence-actions article,.sk-parent-loop-child,.sk-parent-five>div,.sk-family-advanced,.sk-teacher-loop-metrics>div,.sk-teacher-action-list article,.sk-teacher-card-stats span,.sk-passport-match,.sk-recovery-card,.sk-recovery-tech,.sk-habit-resume,.sk-habit-recovery-box,.sk-habit-settings,.sk-notification-category,.sk-notification-device-list label,.sk-notification-policy-note,.sk-learning-kpis article,.sk-learning-recommendation,.sk-learning-trend-card,.sk-learning-studio-guide,.sk-pro-concept-grid article,.sk-pro-steps article,.sk-pro-activity,.sk-library-quiz,.sk-interactive-question,.sk-learning-editorial-note,.sk-foundation-diagnostic-session,.sk-foundation-summary,.sk-foundation-subject-grid article,.sk-foundation-remediation-item,.sk-learning-media-flow article,.sk-deep-practice-panel,.sk-learning-outcome-grid>article,.sk-official-outcome-list article,.sk-verified-resource-list>a,.sk-topic-question-empty,.sk-experience-mission,.sk-experience-kpis article,.sk-experience-subject-section,.sk-experience-subject,.sk-assessment-family-result>div,.sk-content-latest-assessment>div,.sk-personal-records,.sk-personal-record-grid article,.sk-exam-intelligence-kpis>div,.sk-compact-topics .sk-cpt-subject,.sk-compact-topics .sk-cpt-row,.sk-compact-topics .sk-cpt-bulk,.sk-official-session-list>div,.sk-score-session,.sk-reading-boundary,.sk-career-selector,.sk-career-card,.sk-career-detail-grid article,.sk-career-workline,.sk-career-work-style,.sk-career-explorer,.sk-career-clusters a,.sk-interest-grid span,.sk-career-tags span,.sk-career-status,.sk-language-level-grid>article,.sk-language-progress,.sk-language-hold,.sk-language-lesson-list>article,.sk-language-best,.sk-language-lesson-grid article,.sk-language-model-text,.sk-language-question,.sk-language-result,.sk-language-review article,.sk-language-output-grid>article,.sk-language-starter-grid article,.sk-language-voice-profile,.sk-language-track-lesson,.sk-language-passage,.sk-language-task,.sk-language-source-registry,.sk-language-continuity,.sk-language-v4-questions fieldset,.sk-language-v4-output article,.sk-language-v4-result,.sk-language-v4-sources,.sk-universal-grade-subject[open]>summary,.sk-universal-grade-topic,.sk-grade-test-question,.sk-grade-test-noscript,.sk-learn-subject,.sk-learn-topic-card,.sk-learn-lesson-body>div,.sk-learn-depth-row,.sk-learn-explanation-grid article,.sk-skill-domain,.sk-skill-route-card,.sk-skill-path-head,.sk-skill-module,.sk-skill-task,.sk-skill-project-grid>div,.sk-skill-project-status,.sk-motivation-pulse-grid article,.sk-circle-board span,.sk-driving-browser-practice,.sk-driving-readiness-note,.sk-age-lesson-preteen,.sk-age-lesson-teen,.sk-age-learning-chip,.sk-career-compass-item,.sk-career-compass-dimension,.sk-career-compass-rec,.sk-career-compass-project,.sk-ask-explanation,.sk-ask-hints,.sk-ask-human-row,.sk-ask-feedback,.sk-parent-loop-child,.sk-notification,.sk-exam-selectors,.sk-selector-check,.sk-ib-note,.sk-ib-row,.sk-diagnostic-result-metrics>div,.sk-diagnostic-topic-results article,.sk-examiner-result-card,.sk-examiner-criteria article){
  background:#192f4d!important;background-image:none!important;
  color:#eef6ff!important;border-color:#425f82!important;
}

/* Mixed internal texts from legacy light-only teaching components. */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-learn-lesson-body,.sk-learn-explanation-grid,.sk-language-lesson-grid,.sk-career-detail-grid,.sk-skill-project-grid,.sk-guide-section,.sk-university-grid,.sk-parent-intelligence-family-grid,.sk-age-home-grid)
:is(h2,h3,h4,h5,h6,strong,b,legend,summary,dt,dd){color:#f0f6ff!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-learn-lesson-body,.sk-learn-explanation-grid,.sk-language-lesson-grid,.sk-career-detail-grid,.sk-skill-project-grid,.sk-guide-section,.sk-university-grid,.sk-parent-intelligence-family-grid,.sk-age-home-grid)
:is(p,small,figcaption,li){color:#c5d5e9!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-language-v4-questions label:not(:has(input:checked)),.sk-grade-test-options label:not(:has(input:checked)),.sk-content-options label:not(:has(input:checked)),.sk-career-compass-options label:not(:has(input:checked))){
 background:#203b5b!important;color:#f3f8ff!important;border-color:#56769b!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-language-v4-questions label:has(input:checked),.sk-grade-test-options label:has(input:checked),.sk-content-options label:has(input:checked),.sk-career-compass-options label:has(input:checked)){
 background:#2d5584!important;color:#fff!important;border-color:#8cb9ff!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-content-options label,.sk-grade-test-options label,.sk-language-v4-questions label) :is(b,strong,span){color:inherit!important}

/* Soft Dim remains a gentle reduction from Day, including the newly discovered white-only fields. */
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(
 .sk-term-summary>div,.sk-month-board article,.sk-goal-summary>div,
 .sk-milestone-track article,.sk-goal-collab,.sk-parent-shared-goal,
 .sk85-discovery,.sk85-saved,.sk85-program-card,.sk85-program-stats>div,
 .sk85-compare,.sk85-limitation,.sk86-history,.sk86-history-table,
 .sk86-history-scroll table,.sk80-school,.sk80-preference
){background:#e8eef5!important;background-image:none!important;color:#203955!important;border-color:#c2d0e1!important}
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(.sk85-discovery,.sk85-saved,.sk85-program-card)
:is(h3,h4,dt,dd,strong,summary,legend,label){color:#1b3553!important}
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(.sk85-discovery,.sk85-saved,.sk85-program-card)
:is(p,small){color:#50667f!important}
/* In narrow desktop layouts, add a safe strip before the first card. */
@media(min-width:768px){
 html body.sk141-theme-clearance :is(.sk-shell,.sk80-workspace,.sk78-workspace,.sk79-workspace,.sk81-tools){
   padding-top:max(52px,2.75rem)!important;
 }
}
