/* LessonSky RC139: coherent Day / SOFT Dim / Night, foreground-on-surface contract.
   Keep geometry and application behavior unchanged; only appearance is adjusted. */

/* DIM: not a second night mode. A matte, 1-step darker version of Day.
   Day remains #eff3f9 background / #fbfcfe surface;
   Dim uses #e2e8f0 / #eef2f7 with the same readable dark lettering. */
:is(html.lessonsky-dim body,body.lessonsky-dim){
  --ls-bg:#e2e8f0;--ls-bg-2:#dbe4ee;
  --ls-surface:#eef2f7;--ls-surface-2:#e8edf4;--ls-surface-3:#dce5f0;
  --ls-surface-soft:#e5ecf4;--ls-surface-glass:rgba(237,242,248,.96);
  --ls-border:#c4d0df;--ls-line:#c5d0df;--ls-line-strong:#9caec6;
  --ls-text:#1e3350;--ls-text-strong:#142944;--ls-muted:#526781;--ls-text-muted:#526781;
  --ls-muted-2:#62758e;--ls-accent:#365fa7;--ls-primary:#315eaa;
  --ls-primary-2:#5879ad;--ls-primary-soft:#d6e3f4;
  --ls-hero-1:#2c517e;--ls-hero-2:#3d648b;--ls-hero-3:#52678d;
  --ls-shadow-sm:0 5px 14px rgba(30,51,80,.045);
  --ls-shadow-md:0 10px 22px rgba(30,51,80,.065);
  --ls-shadow-lg:0 16px 30px rgba(30,51,80,.075);
  color-scheme:light!important;
  color:#1e3350!important;
  background:#e2e8f0!important;
}
html.lessonsky-dim{color-scheme:light!important;background:#e2e8f0!important}
html.lessonsky-dim body{background:#e2e8f0!important;color:#1e3350!important}

/* Uniform soft surfaces in Dim – do not preserve old near-black card backgrounds. */
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(
  .sk-card,.sk80-panel,.sk78-card,.sk78-detail,.sk78-publication,.sk78-empty,
  .sk81-tool-card,.sk81-universities,.sk81-university,.sk81-match,
  .sk80-exam-tile,.sk80-school,.sk80-preference,.sk80-hub-card,.sk80-tile,
  .sk79-subject-tile,.sk79-official,.sk79-lab,
  .sk-profile-panel,.sk-profile-tabs,.sk-profile-hero,.sk-profile-identity,
  .sk-profile-summary-item,.sk-profile-completion,.sk-profile-topic-row,
  .sk-progress-row,.sk-stats .sk-stat,.sk-growth-hub-grid>article,
  .sk-learning-league,.sk-assessment-start-card,.sk-assessment-live-card,
  .sk-content-question-card,.sk-assessment-question-map-panel,
  .sk-account-bar,.sk-account-dock,.ls-app-card,.ls-app-platform-section
):not(.sk-experience-hero):not(.sk80-hero):not(.sk78-hero):not(.sk-career-premium-hero){
  background:#eef2f7!important;
  border-color:#c4d0df!important;
  color:#1e3350!important;
  box-shadow:0 6px 18px rgba(30,51,80,.055)!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(
  .sk-progress-row,.sk-profile-summary-item,.sk-profile-topic-row,.sk81-tool-card,
  .sk80-exam-tile,.sk79-subject-tile,.sk80-tile,.sk-stats .sk-stat,
  .sk-assessment-live-metrics>div,.sk80-panel .sk80-result,.sk78-example,
  .sk78-map-center,.sk-learning-league .sk-league-row,.sk-growth-subnav
){background:#e9eef5!important;border-color:#c4d0df!important}
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(.sk-shell,.sk-card,.sk80-workspace,.sk78-workspace,.sk79-workspace,.sk-profile-center,.sk81-tools)
:is(h1,h2,h3,h4,h5,h6,strong,b,summary,label,legend,.sk-progress-copy>span,.sk-progress-copy strong){
  color:#1e3350!important;opacity:1!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(.sk-shell,.sk-card,.sk80-workspace,.sk78-workspace,.sk79-workspace,.sk-profile-center,.sk81-tools)
:is(p,small,.sk-hint,.sk-muted,.sk-progress-copy small,.sk-stat span){color:#536881!important;opacity:1!important}
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(.sk-card,.sk78-workspace,.sk79-workspace,.sk80-workspace,.sk-profile-center)
:is(input:not([type=checkbox]):not([type=radio]),select,textarea){
  background:#eaf0f7!important;color:#1a3351!important;border-color:#bbcadd!important;caret-color:#254a80!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(input,textarea)::placeholder{color:#62758e!important;opacity:1!important}
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(.sk-small-btn,.sk-btn-ghost,.sk80-button:not(.primary),.sk78-secondary){
  background:#dbe7f6!important;color:#224b7c!important;border-color:#acbfd7!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(.sk-btn-primary,.sk80-button.primary){background:#315d9f!important;color:#fff!important;border-color:#416eb0!important}
:is(html.lessonsky-dim body,body.lessonsky-dim) .sk-shell[data-sk-l10n-surface="dashboard"] :is(.sk-dashboard-primary-nav,.sk-growth-subnav,.sk-dashboard-workspace-tabs){
  background:#dde6f1!important;border-color:#bfcee0!important;color:#1d3655!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim) .sk-shell[data-sk-l10n-surface="dashboard"] :is(.sk-dashboard-primary-nav,.sk-growth-subnav,.sk-dashboard-workspace-tabs) a:not(.is-active):not([aria-current="page"]){
  background:transparent!important;color:#314d71!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim) .sk-shell[data-sk-l10n-surface="dashboard"] :is(.sk-dashboard-primary-nav,.sk-growth-subnav,.sk-dashboard-workspace-tabs) a:is(.is-active,[aria-current="page"]){
  background:#cadbf4!important;color:#143e72!important;box-shadow:inset 0 0 0 1px #a8c4e6!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim) .sk-meter{background:#d2dce7!important}
:is(html.lessonsky-dim body,body.lessonsky-dim) .sk-progress-score b{color:#214b79!important}
/* Hero remains a distinct, gently toned brand accent; it is not a white panel. */
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(.sk-experience-hero,.sk80-hero,.sk78-hero){
  background:linear-gradient(115deg,#385f8c,#466c94 60%,#696b96)!important;
  border-color:#7491b5!important;color:#fff!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim) :is(.sk-experience-hero,.sk80-hero,.sk78-hero)
:is(h1,h2,h3,p,small,strong,.sk-kicker,.sk78-eyebrow){color:#f3f7ff!important}

/* The dashboard's separate statistics grid had its own white gradient. */
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell.sk-dashboard-view-grow .sk-stats[data-sk-growth-section="progress"] .sk-stat{
  background:#182f4d!important;border-color:#405e85!important;
  color:#f1f7ff!important;box-shadow:none!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell.sk-dashboard-view-grow .sk-stats[data-sk-growth-section="progress"] .sk-stat :is(strong,b){color:#f1f7ff!important}
:is(html.lessonsky-dark body,body.lessonsky-dark)
.sk-shell.sk-dashboard-view-grow .sk-stats[data-sk-growth-section="progress"] .sk-stat :is(span,small){color:#c4d7ee!important}

/* NIGHT: specifically repair the progress list's white rows and muted progress copy. */
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-shell.sk-dashboard-view-grow
:is(.sk-progress-row,.sk-learning-progress-row){
  background:linear-gradient(130deg,#1b3352,#1a2e49)!important;
  border:1px solid #476386!important;
  box-shadow:none!important;
  color:#edf5ff!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-shell.sk-dashboard-view-grow
.sk-progress-copy :is(span,strong,b){color:#eff6ff!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-shell.sk-dashboard-view-grow
.sk-progress-copy small{color:#bfd2e8!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-shell.sk-dashboard-view-grow
.sk-progress-score b{color:#eff6ff!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-shell.sk-dashboard-view-grow
.sk-meter{background:#334a68!important;border:1px solid #496789!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-shell.sk-dashboard-view-grow
.sk-level-form :is(select,option){background:#102842!important;color:#f0f6ff!important;border-color:#56759a!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-shell.sk-dashboard-view-grow
.sk-level-form .sk-small-btn{background:#3167ae!important;color:#fff!important;border-color:#7097cd!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-shell.sk-dashboard-view-grow
.sk-stats[data-sk-growth-section="progress"] .sk-stat :is(strong,b){color:#f4f8ff!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-shell.sk-dashboard-view-grow
.sk-stats[data-sk-growth-section="progress"] .sk-stat :is(span,small){color:#c4d6ed!important;opacity:1!important}

/* Night: normalize nested panels not represented by sk-card alone. */
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk-progress-row,.sk-learning-progress-row,.sk-topic-question-row,.sk-kmap-node,
 .sk-learn-lesson-body>div,.sk-learn-explanation-grid article,.sk78-example,
 .sk78-activity,.sk79-misconception,.sk79-official,.sk79-lab,
 .sk79-subject-tile,.sk80-exam-tile,.sk80-hub-card,.sk80-tile,
 .sk81-tool-card,.sk81-university,.sk81-match,.sk81-catalog-filter,
 .sk81-universities,.sk80-school,.sk80-preference,.sk80-history-body,
 .sk-profile-topic-row,.sk-profile-summary-item,.sk-profile-completion,
 .sk-profile-action-box,.sk-verified-resource-list>a,.sk-deep-practice-panel,
 .sk-reading-card,.sk-reading-rule,.sk-reading-question,
 .sk-assessment-blueprint,.sk-assessment-live-metrics>div,
 .sk-assessment-latest,.sk-assessment-start-card,
 .sk-assessment-question-map-panel,.sk-assessment-tools-rail>section,
 .sk-content-question-card,.sk-content-progress-panel,
 .sk-learning-league .sk-league-row
 ){
   background:#172b47!important;color:#edf5ff!important;
   border-color:#425f83!important;
 }
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk-progress-row,.sk-learning-progress-row,.sk-topic-question-row,.sk-kmap-node,
 .sk-learn-lesson-body,.sk-learn-explanation-grid,
 .sk79-subject-tile,.sk80-exam-tile,.sk80-hub-card,.sk80-tile,
 .sk81-universities,.sk81-tool-card,.sk81-university,.sk81-match,
 .sk-profile-topic-row,.sk-profile-summary-item,
 .sk-assessment-blueprint,.sk-assessment-latest,.sk-assessment-start-card,
 .sk-assessment-tools-rail
 ) :is(strong,b,h3,h4){color:#f2f7ff!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(
 .sk-progress-row,.sk-learning-progress-row,.sk-topic-question-row,.sk-kmap-node,
 .sk-learn-lesson-body,.sk-learn-explanation-grid,
 .sk79-subject-tile,.sk80-exam-tile,.sk80-hub-card,.sk80-tile,
 .sk81-universities,.sk81-tool-card,.sk81-university,.sk81-match,
 .sk-profile-topic-row,.sk-profile-summary-item,
 .sk-assessment-blueprint,.sk-assessment-latest,.sk-assessment-start-card,
 .sk-assessment-tools-rail
 ) :is(span,small,p,li){color:#bbcee6!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) :is(.sk-card,.sk80-workspace,.sk78-workspace,.sk79-workspace)
:is(.sk-notice,.sk80-notice,.sk78-hint,.sk80-result,.sk-verified-resources,.sk-learning-outcomes){
  background:#1d3656!important;border-color:#527497!important;color:#dceaff!important;
}

/* Actual header profile dropdowns: NEVER white background with light labels in Night. */
:is(html.lessonsky-dark body,body.lessonsky-dark)
:is(.ls-site-header,.ls-global-header,.ls-app-header,header.site-header,#masthead)
:is(.sub-menu,.dropdown-menu,.ls-user-menu,.ls-profile-menu,.ls-header-dropdown,
    .account-dropdown,.profile-dropdown,.user-dropdown,.dropdown-content,.menu-dropdown,
    .popover-content,.wp-block-navigation__submenu-container,[role="menu"],
    details[open]>ul,details[open]>div,nav li ul){
  background:#152b48!important;
  color:#e9f2ff!important;
  border:1px solid #4b688d!important;
  box-shadow:0 15px 32px rgba(0,0,0,.28)!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
:is(.ls-site-header,.ls-global-header,.ls-app-header,header.site-header,#masthead)
:is(.sub-menu,.dropdown-menu,.ls-user-menu,.ls-profile-menu,.ls-header-dropdown,
    .account-dropdown,.profile-dropdown,.user-dropdown,.dropdown-content,.menu-dropdown,
    .popover-content,.wp-block-navigation__submenu-container,[role="menu"],
    details[open]>ul,details[open]>div,nav li ul)
:is(a,button,span,small,strong,summary){color:#eaf3ff!important;opacity:1!important}
:is(html.lessonsky-dark body,body.lessonsky-dark)
:is(.ls-site-header,.ls-global-header,.ls-app-header,header.site-header,#masthead)
:is(.sub-menu,.dropdown-menu,.ls-user-menu,.ls-profile-menu,.ls-header-dropdown,
    .account-dropdown,.profile-dropdown,.user-dropdown,.dropdown-content,.menu-dropdown,
    .popover-content,.wp-block-navigation__submenu-container,[role="menu"],
    details[open]>ul,details[open]>div,nav li ul)
:is(a:hover,button:hover,a:focus-visible,button:focus-visible){background:#294a70!important;color:#fff!important}
/* Common free-standing profile popovers near the navigation (theme templates). */
:is(html.lessonsky-dark body,body.lessonsky-dark)
:is(.sk-user-popover,.sk-user-dropdown,.sk-profile-dropdown,.ls-user-popover,
 .ls-profile-dropdown,.ls-account-dropdown,.sk-account-dropdown,
 [data-sk139-header-menu]){
  background:#152b48!important;color:#eaf3ff!important;border-color:#4b688d!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark)
:is(.sk-user-popover,.sk-user-dropdown,.sk-profile-dropdown,.ls-user-popover,
 .ls-profile-dropdown,.ls-account-dropdown,.sk-account-dropdown,
 [data-sk139-header-menu]) :is(a,button,span,small,strong){color:#eaf3ff!important}

/* Day and SOFT Dim: ensure the same menus use dark lettering on muted surfaces. */
:is(html.lessonsky-light body,html.lessonsky-dim body,body.lessonsky-light,body.lessonsky-dim)
:is(.ls-site-header,.ls-global-header,.ls-app-header,header.site-header,#masthead)
:is(.sub-menu,.dropdown-menu,.ls-user-menu,.ls-profile-menu,.ls-header-dropdown,
 .account-dropdown,.profile-dropdown,.user-dropdown,.dropdown-content,.menu-dropdown,
 .popover-content,.wp-block-navigation__submenu-container,[role="menu"],
 details[open]>ul,details[open]>div,nav li ul){
  background:#edf2f8!important;color:#1c3654!important;border-color:#c6d2e2!important;
}
:is(html.lessonsky-light body,html.lessonsky-dim body,body.lessonsky-light,body.lessonsky-dim)
:is(.ls-site-header,.ls-global-header,.ls-app-header,header.site-header,#masthead)
:is(.sub-menu,.dropdown-menu,.ls-user-menu,.ls-profile-menu,.ls-header-dropdown,
 .account-dropdown,.profile-dropdown,.user-dropdown,.dropdown-content,.menu-dropdown,
 .popover-content,.wp-block-navigation__submenu-container,[role="menu"],
 details[open]>ul,details[open]>div,nav li ul)
:is(a,button,span,small,strong){color:#1c3654!important;opacity:1!important}

/* Footer's floating account actions stay readable in every palette. */
:is(html.lessonsky-dim body,body.lessonsky-dim) .sk-account-dock,
:is(html.lessonsky-light body,body.lessonsky-light) .sk-account-dock{
  background:#eaf0f7!important;border-color:#bdcada!important;
}
:is(html.lessonsky-dim body,body.lessonsky-dim) .sk-account-dock a,
:is(html.lessonsky-light body,body.lessonsky-light) .sk-account-dock a{
  background:#e2eaf4!important;color:#203d62!important;border-color:#b9c9db!important;
}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-account-dock a{background:#203d5d!important;color:#f3f8ff!important;border-color:#54769b!important}
:is(html.lessonsky-dark body,body.lessonsky-dark) .sk-account-dock a.is-logout{background:#50303b!important;color:#ffdbe3!important}

/* Never allow theme quick switch to paint over quiz text or an open menu. */
html body .sk117-quick-theme[hidden],
html body .sk117-quick-theme.sk131-theme-docked[hidden]{display:none!important;pointer-events:none!important}
@media (forced-colors:active){
  :is(html.lessonsky-dim body,html.lessonsky-dark body) :is(button,select,input){forced-color-adjust:auto}
}
