.site-theme-toggle{
  position:fixed;z-index:20;inset-block-end:max(1rem,env(safe-area-inset-bottom));inset-inline-end:1rem;
  display:flex;align-items:center;gap:.45rem;min-height:44px;
  border:1px solid #cbd6ef;border-radius:999px;padding:.5rem .9rem;
  color:#24345c;background:#fff;font:inherit;
  font-size:.88rem;font-weight:650;line-height:1.2;box-shadow:0 3px 14px #18284e20
}
.site-theme-toggle:hover{background:#edf2ff;color:#24345c}
.site-theme-toggle:focus-visible{outline:3px solid #7498ff;outline-offset:3px}
.site-theme-toggle span:first-child{font-size:1.16rem;line-height:1}
body{padding-block-end:4.1rem}
html[data-theme="dark"]{
  color-scheme:dark;background:#08090d;color:#eef2ff;
  --blue:#546ff0;--ink:#eef2ff;--muted:#b3bfd7;--line:#2c3750;
  --theme-bg:#08090d;--theme-card:#141926;--theme-raised:#1b2234;
  --theme-fg:#eef2ff;--theme-subtle:#b8c4dc;--theme-border:#35415c;--theme-link:#adc2ff
}
html[data-theme="dark"] body,html[data-theme="dark"] .shell{background:var(--theme-bg);color:var(--theme-fg)}
html[data-theme="dark"] :is(aside,.portal .portal-auth,.card,.lesson,.study-recent button,.study-book,.study-empty,.modal,.sidebar-note,.portal-panel,.feature,.feature-card,.auth-panel,.auth-card,.account-card,.learning-filters,.subject-filter-panel,.wordlab-card,.topic-card){
  background:var(--theme-card);color:var(--theme-fg);border-color:var(--theme-border)
}
html[data-theme="dark"] :is(.welcome h1,.welcome p,.directory-lesson h3,.directory-tile strong,.sidebar-note strong,.study-workspace h2,.portal-introduction h1,.portal-introduction h2,.brand,.lesson h1,.lesson h2){color:var(--theme-fg)}
html[data-theme="dark"] :is(.muted,.eyebrow,.top .eyebrow,.brandtag,.directory-lesson p,.directory-tile small,.study-book small,.study-recent small,footer,.stat-caption,.sidebar-note p,.lead){color:var(--theme-subtle)}
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea,.portal-auth input,.portal-auth select,.study-search input){
  background:var(--theme-raised);color:var(--theme-fg);border-color:var(--theme-border)
}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#a7b4ce}
html[data-theme="dark"] :is(.soft,.options button,.topic-tags span,.pill,.module-count,.notice,.explain,.worked-example,.learning-goal,.lesson-route,.question-context,.catalog-library-link,.learner-preview-banner){
  background:#202a42;color:var(--theme-fg);border-color:var(--theme-border)
}
html[data-theme="dark"] .options button.selected{background:#374a86;border-color:#a6bcff}
html[data-theme="dark"] .feedback{background:#123a30;color:#d4f8e9;border-color:#327b63}
html[data-theme="dark"] .feedback.wrong{background:#492730;color:#ffe1e6;border-color:#a45969}
html[data-theme="dark"] a{color:var(--theme-link)}
html[data-theme="dark"] .text-button{color:var(--theme-link)}
html[data-theme="dark"] .brand-logo{background:#f6f8ff;border-radius:.55rem;padding:.15rem .35rem}
html[data-theme="dark"] .shell>aside nav button{color:var(--theme-subtle)}
html[data-theme="dark"] .shell>aside nav button:is(.active,:hover,:focus-visible){background:#25365f;color:#dce7ff}
html[data-theme="dark"] .study-banner{background:linear-gradient(120deg,#18284b,#383169)}
html[data-theme="dark"] .study-banner h1{color:#fff}
html[data-theme="dark"] .study-banner .study-mission{background:#dce5ff;color:#233568}
html[data-theme="dark"] .study-library :is(.directory-tile,.directory-lesson),
html[data-theme="dark"] :is(.study-recent button,.study-book){background:var(--theme-card);border-inline-start-color:var(--tile-icon)}
html[data-theme="dark"] .study-library .directory-tile:is(:hover,:focus-visible),
html[data-theme="dark"] :is(.study-recent button,.study-book):is(:hover,:focus-visible){background:var(--theme-raised);border-color:var(--tile-icon)}
html[data-theme="dark"] :is(.directory-arrow,.study-book b){color:var(--tile-icon)}
html[data-theme="dark"] .site-theme-toggle{background:#212b42;color:#eef2ff;border-color:#465a82}
html[data-theme="dark"] .site-theme-toggle:hover{background:#2e3d5c}
html[data-theme="dark"] :is(.family-card,.privacy-box,.intro,.soft-button,.step-pills span,.step-pills b){
  background:var(--theme-card);color:var(--theme-fg);border-color:var(--theme-border)
}
html[data-theme="dark"] :is(.design-notice,.learner-scope-note,.preview-banner){background:#202a42;color:var(--theme-fg)}
html[data-theme="dark"] :is(.intro h1,.privacy-box strong,.facts b){color:var(--theme-fg)}
html[data-theme="dark"] :is(.family-intro,.intro>p,.auth-note,.facts span,.contact-note,.language-control,summary,label){color:var(--theme-subtle)}
html[data-theme="light"],html[data-theme="light"] body,html[data-theme="light"] .shell{background:#fff}
@media print{.site-theme-toggle{display:none!important}body{padding-block-end:0}html[data-theme="dark"],html[data-theme="dark"] body,html[data-theme="dark"] .lesson{color-scheme:light;background:#fff;color:#111}}
