:root {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080c14;
  --card: #111824;
  --yellow: #83a9cb;
  --yellow-strong: #95bce0;
  --yellow-light: #182b3e;
  --yellow-dark: #b8d5ef;
  --text: #e6eaf0;
  --muted: #99a3b2;
  --line: #293241;
  --blue-light: #162332;
  --blue: #7f9fbe;
  --green: #79ad88;
  --red: #c77f79;
  --cream: #080c14;
  --ink: #e6eaf0;
  --white: #111824;
  --yellow-soft: #182b3e;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 14px 34px rgba(0, 0, 0, 0.27);
  --shadow-small: 0 9px 24px rgba(0, 0, 0, 0.24);
  --subject: #252637;
  --subject-border: #555b73;
  --core: #22283a;
  --core-border: #53617c;
  --extra: #18302f;
  --extra-border: #3d6662;
  --question: #18293a;
  --question-border: #466780;
  --negative: #342329;
  --negative-border: #7b4e59;
}

body,
button,
input,
select,
textarea,
.theme-toggle {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line, #f1dfaa);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text, #2f2a1f);
  box-shadow: 0 9px 24px rgba(130, 96, 20, 0.1);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: var(--yellow-light, #fff8dc);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--yellow-strong, #ffc93f);
  outline-offset: 3px;
}

.theme-toggle__icon {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.theme-toggle svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle__moon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.theme-toggle__sun {
  opacity: 0;
  transform: scale(0.65) rotate(-35deg);
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(21, 34, 59, 0.88);
  color: #dce7ff;
  box-shadow: 0 10px 28px rgba(0, 4, 15, 0.4), 0 0 24px rgba(142, 175, 255, 0.13);
}

html[data-theme="dark"] .theme-toggle__moon {
  opacity: 0;
  transform: scale(0.65) rotate(35deg);
}

html[data-theme="dark"] .theme-toggle__sun {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.theme-toggle--floating {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2147483646;
}

.mobile-home-back--tool {
  display:none;
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] body::selection,
html[data-theme="dark"] ::selection {
  background: rgba(142, 175, 255, 0.38);
  color: #ffffff;
}

html[data-theme="dark"] :is(
  .welcome-card, .page-heading, .main-card, .hero-card, .overview-card,
  .letter-stage, .practice-card, .complete-card, .login-layout
) {
  background: var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] :is(
  .feature-card, .info-card, .unit-card, .narrow-card, .course-row,
  .stats-grid article, .table-wrap, .message, .invite-code,
  .panel, .floating-note, .structure-block, .word-card, .match-card,
  .example-item, .quiz-box, .summary-item, .category-card, .rule-box,
  .table-cell, .priority-item, .transform-card, .condition-card, .chain-item,
  .type-box, .type-example, .qw-card, .swap-card, .grid-label, .grid-cell,
  .exercise-title-card, .drop-cell, .block-bank, .grid-help, .method-card,
  .condition-mini-card, .completion-card, .rule-card, .original-sentence-card,
  .module-card, .question-card, .question-map-card, .hint-panel,
  .completion-modal, .lesson-node, .picture-scene
) {
  background: rgba(17, 27, 49, 0.96);
  border-color: var(--line);
  box-shadow: var(--soft-shadow);
}

html[data-theme="dark"] .lexicon-library {
  --lexicon-ink:var(--text);
  --lexicon-gold:var(--yellow-dark);
  --lexicon-yellow:var(--yellow-strong);
  background:var(--bg);
  border-color:var(--line);
  box-shadow:var(--shadow);
}
html[data-theme="dark"] .lexicon-library__title h1 { color:var(--text); }
html[data-theme="dark"] .lexicon-library__title .eyebrow { color:var(--yellow-dark); }
html[data-theme="dark"] .lexicon-library__title p { color:var(--muted); }
html[data-theme="dark"] .lexicon-library::before { border-color:rgba(149,188,224,.11); }
html[data-theme="dark"] .lexicon-library__orbit,
html[data-theme="dark"] .lexicon-library__orbit::before,
html[data-theme="dark"] .lexicon-library__orbit::after { border-color:rgba(149,188,224,.16); }
html[data-theme="dark"] .lexicon-library__orbit i { background:var(--yellow-strong); box-shadow:0 0 0 3px var(--bg); }
html[data-theme="dark"] .lexicon-library__stage>.lexicon-orbit-card::after { background:var(--yellow-strong); }
html[data-theme="dark"] :is(.lexicon-library__search,.lexicon-library__sort,.lexicon-master-card,.lexicon-orbit-card) {
  color:var(--text);
  background:var(--card);
  border-color:var(--line);
}
html[data-theme="dark"] .lexicon-library__search input,
html[data-theme="dark"] .lexicon-library__sort select { color:var(--text); }
html[data-theme="dark"] .lexicon-library__search button { color:var(--muted); background:var(--yellow-light); }
html[data-theme="dark"] .lexicon-master-card {
  border-color:var(--yellow-strong);
  box-shadow:var(--soft-shadow),inset 0 0 0 5px rgba(8,12,20,.38);
}
html[data-theme="dark"] .lexicon-master-card:hover,
html[data-theme="dark"] .lexicon-master-card:focus-within {
  box-shadow:0 24px 54px rgba(0,0,0,.38),inset 0 0 0 5px rgba(8,12,20,.38);
}
html[data-theme="dark"] .lexicon-master-card__icon,
html[data-theme="dark"] .lexicon-orbit-card__icon { color:var(--yellow-dark); background:var(--yellow-light); border-color:var(--line); }
html[data-theme="dark"] .lexicon-master-card>p,
html[data-theme="dark"] .lexicon-master-card small,
html[data-theme="dark"] .lexicon-orbit-card__body>span,
html[data-theme="dark"] .lexicon-orbit-card__body small { color:var(--muted); }
html[data-theme="dark"] .lexicon-master-card__count { color:var(--yellow-dark); border-color:var(--line); }
html[data-theme="dark"] .lexicon-master-card__action { color:var(--yellow-dark); background:var(--yellow-light); border-color:var(--line); }
html[data-theme="dark"] .lexicon-orbit-card:hover,
html[data-theme="dark"] .lexicon-orbit-card:focus-visible { color:var(--text); background:var(--yellow-light); border-color:var(--yellow-strong); }
html[data-theme="dark"] .lexicon-library__status { color:var(--muted); background:var(--card); border-color:var(--line); }
html[data-theme="dark"] :is(
  .lexicon-master-table-panel,
  .lexicon-master-detail,
  .lexicon-results-toolbar,
  .lexicon-master-search input,
  .lexicon-master-search select,
  .lexicon-pagination,
  .lexicon-pagination a
) {
  color:var(--text);
  background:var(--card);
  border-color:var(--line);
  box-shadow:var(--shadow-small);
}
html[data-theme="dark"] .lexicon-pagination { box-shadow:none; }
html[data-theme="dark"] .lexicon-pagination a:hover,
html[data-theme="dark"] .lexicon-pagination a:focus-visible { color:var(--yellow-dark); background:var(--yellow-light); border-color:var(--yellow-strong); }

html[data-theme="dark"] :is(
  .sentence-builder, .drop-slot, .transform-table, .transform-title,
  .sentence-cell, .word-cell, .add-word-panel, .cloud-stage,
  .completed-sentence, .result-empty, .transform-result,
  .transform-process-card, .source-row, .process-token, .vocab-accordion,
  .vocab-accordion-body, .answer-accordion, .answer-accordion-button,
  .answer-sentence, .sentence-strip, .scale-visual, .drop-zone,
  .feedback-card.hint, .nav-btn, .meaning-stage, .scene-hint,
  .result-hero, .result-card, .examples button, .type-choices button
) {
  background: #142039;
  border-color: #304362;
  color: var(--text);
  box-shadow: none;
}

html[data-theme="dark"] :is(
  .sentence-cell.empty, .word-cell.punctuation, .vocab-empty,
  .table-view-note, .vocab-accordion-head
) {
  background: #101a2e;
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="dark"] :is(
  .drop-zone.drag-over, .completed-sentence.cloud-over,
  .block-bank.over, .drop-cell.over
) {
  background: #1d3151;
}

html[data-theme="dark"] :is(
  .welcome-panel, .login-section, .student-card
) {
  background: #121e36;
}

html[data-theme="dark"] :is(
  .welcome-panel::before, .welcome-panel::after, .main-card::after,
  .login-card::after
) {
  background: rgba(165, 190, 255, 0.08);
}

html[data-theme="dark"] :is(
  .text-button, .secondary-button, .secondary-btn, .icon-button,
  .button-secondary, .ghost-btn, .reset-btn, .skip-grid-btn,
  .back-link, .logout-btn, .small-btn
) {
  background: #121d33;
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="dark"] :is(
  input, select, textarea, .stack-form input, .stack-form select,
  .stack-form textarea, .inline-form select, .answer-area input,
  .answer-area textarea
) {
  background: #0c1629;
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #71809b;
}

html[data-theme="dark"] :is(
  .empty-state, .role-switch, .multi-login-box, .upload-guide,
  .progress, .table-progress, .progress-bar, .mini-track, .progress-track
) {
  background: rgba(19, 34, 59, 0.86);
  border-color: var(--line);
}

html[data-theme="dark"] :is(th, .grid-head, .practice-topbar) {
  background: #101b30;
  border-color: var(--line);
}

html[data-theme="dark"] :is(td, th, .lesson-list a) {
  border-color: #22324e;
}

html[data-theme="dark"] :is(.teacher-tab.active, .student-tab.active) {
  background: #17243d;
  border-color: #3b5277;
  color: var(--text);
  box-shadow: var(--soft-shadow);
}

html[data-theme="dark"] .floating-note::before {
  background: #111b31;
  border-color: var(--line);
}

html[data-theme="dark"] .cowlish-lesson-back {
  border-color: rgba(156, 181, 239, 0.25) !important;
  background: rgba(14, 25, 46, 0.9) !important;
  color: #edf3ff !important;
  box-shadow: 0 10px 30px rgba(0, 4, 14, 0.42) !important;
}

html[data-theme="dark"] .cowlish-lesson-back:hover {
  background: #192b49 !important;
}

html[data-theme="dark"] .upload-guide pre {
  background: #070d18;
  color: #dbe7ff;
}

html[data-theme="dark"] .danger-button {
  background: #321f29;
  border-color: #724354;
}

html[data-theme="dark"] .brand img,
html[data-theme="dark"] .logo-icon,
html[data-theme="dark"] .brand-icon {
  box-shadow: 0 10px 28px rgba(108, 140, 212, 0.2);
}

html[data-theme="dark"] .site-content::after {
  background: rgba(8, 15, 31, 0.32);
}

/* Flat-color guard: shared pages must never render a CSS gradient. */
*,
*::before,
*::after {
  background-image: none !important;
}

:is(
  .main-card, .hero, .hero-card, .overview-card, .course-card,
  .machine-card, .game-card, .result-panel, .login-layout
) {
  background-color: var(--card, var(--white, #ffffff));
}

:is(
  .primary-button, .primary-btn, .open-btn, .spin-button,
  .progress-fill, .progress span, .table-progress span
) {
  background-color: var(--yellow-strong, #ffc93f);
}

/* Keep decorative backgrounds geometric in both light and dark themes. */
:is(.main-card, .hero-card)::after {
  content: "" !important;
  width: 140px !important;
  height: 140px !important;
  top: -18px !important;
  right: -16px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 20px !important;
  background: var(--yellow-strong, #ffc93f) !important;
  box-shadow: none !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v18M6 21h12M6 7h12M6 7l-4 8h8L6 7Zm12 0-4 8h8l-4-8Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat !important;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v18M6 21h12M6 7h12M6 7l-4 8h8L6 7Zm12 0-4 8h8l-4-8Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat !important;
  opacity: 0.14 !important;
  transform: rotate(-7deg);
  pointer-events: none;
}

:is(.condition-card, .type-box, .category-card, .login-card)::after {
  content: "" !important;
  width: 24px !important;
  height: 24px !important;
  top: 18px !important;
  right: 20px !important;
  border-radius: 6px !important;
  background: var(--yellow, #ffd86b) !important;
  box-shadow:
    -30px 9px 0 rgba(255, 201, 63, 0.72),
    -10px 37px 0 rgba(255, 216, 107, 0.6) !important;
  opacity: 0.3 !important;
  transform: rotate(7deg);
  pointer-events: none;
}

.welcome-panel::before {
  content: "" !important;
  width: 150px !important;
  height: 150px !important;
  top: 12px !important;
  right: 12px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 18px !important;
  background: var(--yellow-strong, #ffc93f) !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v18M6 21h12M6 7h12M6 7l-4 8h8L6 7Zm12 0-4 8h8l-4-8Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat !important;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v18M6 21h12M6 7h12M6 7l-4 8h8L6 7Zm12 0-4 8h8l-4-8Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat !important;
  opacity: 0.13 !important;
  transform: rotate(-8deg);
}

.welcome-panel::after {
  content: "" !important;
  width: 30px !important;
  height: 30px !important;
  left: 30px !important;
  bottom: 30px !important;
  border-radius: 7px !important;
  background: rgba(255, 201, 63, 0.78) !important;
  box-shadow:
    39px 5px 0 rgba(255, 216, 107, 0.76),
    18px -38px 0 rgba(255, 255, 255, 0.62) !important;
  opacity: 0.34 !important;
  transform: rotate(-6deg);
}

@media (max-width: 900px) {
  .theme-toggle {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle__icon,
  body,
  button,
  input,
  select,
  textarea {
    transition: none !important;
  }
}

/* Shared balance loading curtain */
.cowlish-loader {
  position:fixed;
  inset:0;
  z-index:2147483647;
  display:grid;
  place-items:center;
  visibility:hidden;
  opacity:0;
  pointer-events:none;
  isolation:isolate;
  transition:opacity .12s linear,visibility 0s linear .12s;
}
.cowlish-loader.is-active {
  visibility:visible;
  opacity:1;
  pointer-events:auto;
  transition-delay:0s;
}
.cowlish-loader__veil {
  position:absolute;
  inset:-18px;
  z-index:-1;
  background:rgba(255,250,240,.3);
  -webkit-backdrop-filter:blur(0);
  backdrop-filter:blur(0);
  transition:background-color .16s linear,-webkit-backdrop-filter .16s ease,backdrop-filter .16s ease;
}
.cowlish-loader.is-active .cowlish-loader__veil {
  background:rgba(255,250,240,.68);
  -webkit-backdrop-filter:blur(9px);
  backdrop-filter:blur(9px);
}
.cowlish-loader__stage {
  width:260px;
  display:grid;
  justify-items:center;
  color:var(--text,#2f2a1f);
  opacity:0;
  transform:translate3d(0,10px,0) scale(.94);
  transform-origin:center;
  transition:opacity .14s linear,transform .18s cubic-bezier(.16,1,.3,1);
}
.cowlish-loader.is-active .cowlish-loader__stage {
  opacity:1;
  transform:none;
}
.cowlish-loader__stage>strong {
  margin-top:5px;
  font-size:23px;
  font-weight:1000;
  letter-spacing:.08em;
}
.cowlish-loader__stage>small {
  margin-top:4px;
  color:var(--muted,#7b725f);
  font-size:11px;
  font-weight:850;
  letter-spacing:.18em;
}
.cowlish-loader__stage>small::after {
  content:"";
  display:inline-block;
  width:1.6em;
  animation:cowlish-loader-dots 1.2s steps(4,end) infinite;
}
.cowlish-loader__balance {
  position:relative;
  width:220px;
  height:142px;
}
.cowlish-loader__beam {
  position:absolute;
  z-index:3;
  top:67px;
  left:12px;
  width:196px;
  height:10px;
  border-radius:6px;
  background:#302d27;
  box-shadow:0 7px 15px rgba(78,58,14,.12);
  transform-origin:50% 50%;
  animation:cowlish-loader-balance 1.8s ease-in-out infinite;
}
.cowlish-loader__beam i {
  position:absolute;
  bottom:10px;
  width:25px;
  height:25px;
  border:1px solid #e3a20d;
  border-radius:6px;
  background:var(--yellow-strong,#ffc93f);
  box-shadow:0 5px 10px rgba(95,69,10,.12);
  animation:cowlish-loader-block 1.8s ease-in-out infinite;
}
.cowlish-loader__beam i::before,
.cowlish-loader__beam i::after {
  content:"";
  position:absolute;
  left:7px;
  right:7px;
  height:2px;
  border-radius:2px;
  background:#443719;
}
.cowlish-loader__beam i::before { top:8px; }
.cowlish-loader__beam i::after { top:14px; }
.cowlish-loader__beam i:nth-child(1) { left:4px; }
.cowlish-loader__beam i:nth-child(2) { left:36px; animation-delay:-.18s; }
.cowlish-loader__beam i:nth-child(3) { left:68px; animation-delay:-.36s; }
.cowlish-loader__beam i:nth-child(4) { right:68px; animation-delay:-.54s; background:#302d27; border-color:#4a453c; }
.cowlish-loader__beam i:nth-child(4)::before,
.cowlish-loader__beam i:nth-child(4)::after { background:#fff1c3; }
.cowlish-loader__beam i:nth-child(5) { right:36px; animation-delay:-.72s; }
.cowlish-loader__beam i:nth-child(6) { right:4px; animation-delay:-.9s; }
.cowlish-loader__axle {
  position:absolute;
  z-index:4;
  top:61px;
  left:50%;
  width:22px;
  height:22px;
  border:6px solid var(--yellow-strong,#ffc93f);
  border-radius:50%;
  background:#302d27;
  transform:translateX(-50%);
}
.cowlish-loader__stand {
  position:absolute;
  z-index:2;
  left:50%;
  bottom:14px;
  width:34px;
  height:70px;
  background:#302d27;
  clip-path:polygon(42% 0,58% 0,82% 100%,18% 100%);
  transform:translateX(-50%);
}
.cowlish-loader__base {
  position:absolute;
  left:50%;
  bottom:8px;
  width:104px;
  height:12px;
  border-radius:7px;
  background:#302d27;
  transform:translateX(-50%);
}
.cowlish-loader.is-resolving .cowlish-loader__stage {
  opacity:0;
  transform:scale(.08);
  transition:opacity .12s linear,transform .18s cubic-bezier(.4,0,.8,.2);
}
.cowlish-loader.is-resolving .cowlish-loader__veil {
  background:rgba(255,250,240,0);
  -webkit-backdrop-filter:blur(0);
  backdrop-filter:blur(0);
  transition:background-color .18s linear,-webkit-backdrop-filter .18s ease,backdrop-filter .18s ease;
}
html[data-theme="dark"] .cowlish-loader__veil { background:rgba(8,15,31,.35); }
html[data-theme="dark"] .cowlish-loader.is-active .cowlish-loader__veil { background:rgba(8,15,31,.72); }
html[data-theme="dark"] .cowlish-loader.is-resolving .cowlish-loader__veil { background:rgba(8,15,31,0); }
html.reduce-effects .cowlish-loader.is-active .cowlish-loader__veil {
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
}
@keyframes cowlish-loader-balance {
  0%,100% { transform:rotate(-4deg); }
  50% { transform:rotate(4deg); }
}
@keyframes cowlish-loader-block {
  0%,100% { transform:translateY(0); }
  50% { transform:translateY(-5px); }
}
@keyframes cowlish-loader-dots {
  0% { content:""; }
  25% { content:"."; }
  50% { content:".."; }
  75%,100% { content:"..."; }
}
@media (max-width:560px) {
  .cowlish-loader__stage { width:220px; }
  .cowlish-loader__balance { transform:scale(.86); }
}
@media (prefers-reduced-motion:reduce) {
  .cowlish-loader__beam,
  .cowlish-loader__beam i,
  .cowlish-loader__stage>small::after { animation:none!important; }
  .cowlish-loader__stage,
  .cowlish-loader__veil { transition-duration:.12s!important; transition-delay:0s!important; }
}

/* Calm dark palette and lightweight star field */
html[data-theme="dark"] body {
  position:relative;
  isolation:isolate;
  background:#080c14;
}
html[data-theme="dark"] body::before {
  content:"";
  position:fixed;
  z-index:0;
  top:0;
  left:0;
  width:2px;
  height:2px;
  border-radius:50%;
  background:transparent;
  box-shadow:
    4vw 8vh 0 rgba(255,255,255,.52),
    12vw 21vh 0 rgba(255,255,255,.3),
    19vw 6vh 0 rgba(255,255,255,.42),
    27vw 31vh 0 rgba(255,255,255,.25),
    34vw 12vh 0 rgba(255,255,255,.48),
    42vw 24vh 0 rgba(255,255,255,.28),
    49vw 5vh 0 rgba(255,255,255,.38),
    57vw 17vh 0 rgba(255,255,255,.55),
    65vw 9vh 0 rgba(255,255,255,.3),
    73vw 28vh 0 rgba(255,255,255,.43),
    81vw 13vh 0 rgba(255,255,255,.25),
    89vw 22vh 0 rgba(255,255,255,.5),
    96vw 7vh 0 rgba(255,255,255,.32),
    7vw 39vh 0 rgba(255,255,255,.35),
    15vw 54vh 0 rgba(255,255,255,.5),
    23vw 45vh 0 rgba(255,255,255,.27),
    31vw 67vh 0 rgba(255,255,255,.42),
    39vw 42vh 0 rgba(255,255,255,.32),
    47vw 58vh 0 rgba(255,255,255,.48),
    55vw 36vh 0 rgba(255,255,255,.26),
    63vw 63vh 0 rgba(255,255,255,.38),
    71vw 47vh 0 rgba(255,255,255,.53),
    79vw 71vh 0 rgba(255,255,255,.28),
    87vw 43vh 0 rgba(255,255,255,.42),
    94vw 61vh 0 rgba(255,255,255,.34),
    3vw 78vh 0 rgba(255,255,255,.46),
    11vw 91vh 0 rgba(255,255,255,.3),
    20vw 75vh 0 rgba(255,255,255,.54),
    28vw 88vh 0 rgba(255,255,255,.25),
    37vw 79vh 0 rgba(255,255,255,.39),
    45vw 95vh 0 rgba(255,255,255,.48),
    54vw 82vh 0 rgba(255,255,255,.28),
    62vw 92vh 0 rgba(255,255,255,.44),
    70vw 77vh 0 rgba(255,255,255,.34),
    78vw 89vh 0 rgba(255,255,255,.5),
    86vw 81vh 0 rgba(255,255,255,.26),
    95vw 94vh 0 rgba(255,255,255,.4);
  opacity:.8;
  pointer-events:none;
  animation:cowlish-stars-twinkle 7s ease-in-out infinite alternate;
}
html[data-theme="dark"] :is(
  .app-sidebar,
  .replica-progress-panel,
  .replica-stat-panel,
  .replica-next-panel,
  .replica-card-grid .replica-card,
  .classroom-manager__hero,
  .classroom-manager__toolbar,
  .classroom-filter-rail,
  .classroom-card-area,
  .classroom-detail-stack,
  .classroom-management-card,
  .course-simple-header,
  .course-simple-picker,
  .course-simple-detail,
  .student-classroom-header,
  .class-orbit-panel,
  .student-class-orbit-detail
) {
  background:#111824!important;
  border-color:#293241!important;
  box-shadow:0 12px 30px rgba(0,0,0,.22)!important;
}
html[data-theme="dark"] :is(
  .profile-hero,
  .profile-stat-grid article,
  .profile-card
) {
  background:#111824!important;
  border-color:#293241!important;
  box-shadow:0 12px 30px rgba(0,0,0,.22)!important;
}
html[data-theme="dark"] :is(
  .assignment-hero,
  .assignment-overview-card,
  .assignment-empty,
  .student-assignment-row,
  .student-assignment-empty,
  .homework-preview-hero,
  .homework-preview-summary article,
  .homework-preview-actions,
  .homework-card
) {
  background:#111824!important;
  border-color:#334154!important;
  box-shadow:0 12px 30px rgba(0,0,0,.22)!important;
}
html[data-theme="dark"] :is(
  .assignment-hero h1,
  .assignment-published .section-heading h2,
  .student-assignment-section .section-heading h2,
  .assignment-overview-card__copy small,
  .assignment-overview-card__copy strong,
  .assignment-overview-card__arrow,
  .assignment-empty>strong
) {
  color:var(--text)!important;
}
html[data-theme="dark"] :is(
  .student-assignment-row__title,
  .student-assignment-row__action,
  .student-assignment-empty>strong
) {
  color:var(--text)!important;
}
html[data-theme="dark"] :is(
  .assignment-hero p,
  .assignment-empty>p
) {
  color:var(--muted)!important;
}
html[data-theme="dark"] :is(
  .student-assignment-row__meta,
  .student-assignment-empty>p
) {
  color:var(--muted)!important;
}
html[data-theme="dark"] .assignment-overview-card__icon {
  color:#d8ebfc!important;
  background:#1b3043!important;
}
html[data-theme="dark"] .student-assignment-row__icon,
html[data-theme="dark"] .student-assignment-empty>.ui-icon {
  color:#d8ebfc!important;
  background:#1b3043!important;
}
html[data-theme="dark"] .student-assignment-row__meta {
  border-color:#334154!important;
}
html[data-theme="dark"] :is(
  .assignment-mobile-header>span,
  .teacher-assignment-hero-art__sheet,
  .student-assignment-hero-art__paper
) {
  background:#162332!important;
  border-color:#334154!important;
}
html[data-theme="dark"] .student-assignment-hero-art::before { background:#101a24!important; }
html[data-theme="dark"] .student-assignment-row__mobile-meta { color:var(--muted)!important; }
html[data-theme="dark"] :is(
  .homework-preview-file,
  .homework-preview-instructions
) {
  background:#162332!important;
  border-color:#334154!important;
}
html[data-theme="dark"] .student-assignment-row__status.is-new {
  border-color:#526174!important;
  background:#111824!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .assignment-overview-card__arrow {
  border-color:#334154!important;
}
html[data-theme="dark"] .assignment-empty__sheet,
html[data-theme="dark"] .assignment-empty__sheet::before {
  background:#111824!important;
  border-color:#d8ebfc!important;
}
html[data-theme="dark"] :is(
  .profile-form input,
  .profile-form textarea
) {
  background:#0c1629!important;
  border-color:#2d3a4c!important;
  color:var(--text)!important;
}
html[data-theme="dark"] :is(
  .replica-profile-link:hover,
  .replica-profile-link:focus-visible,
  .account-menu.active,
  .profile-recent article>span
) {
  background:#1b3043!important;
  border-color:#3d6484!important;
}
html[data-theme="dark"] .app-sidebar {
  color:#e6eaf0!important;
}
html[data-theme="dark"] .app-sidebar .brand-wordmark {
  color:#eef1f5!important;
}
html[data-theme="dark"] .app-sidebar :is(
  .main-nav a,
  .sidebar-action,
  .account-menu strong
) {
  color:#aeb8c7!important;
}
html[data-theme="dark"] .app-sidebar :is(
  .main-nav a:hover,
  .main-nav a:focus-visible,
  .main-nav a.active,
  .sidebar-action:hover,
  .sidebar-action:focus-visible
) {
  color:#d8ebfc!important;
}
html[data-theme="dark"] .app-sidebar .nav-active-indicator {
  background:#1b3043!important;
  box-shadow:inset 0 0 0 1px #3d6484!important;
}
html[data-theme="dark"] .app-sidebar .sidebar-action:hover,
html[data-theme="dark"] .app-sidebar .sidebar-action:focus-visible {
  background:#202a38!important;
}
html[data-theme="dark"] .app-sidebar .account-menu {
  border-color:#2d3746!important;
}
html[data-theme="dark"] .app-sidebar :is(
  .account-menu span,
  .account-meta
) {
  color:#929eaf!important;
}
html[data-theme="dark"] :is(
  .replica-data-list>a,
  .replica-activity-list>a,
  .replica-activity-list>div:not(.replica-list-empty),
  .replica-quick-grid>a,
  .replica-course-row,
  .replica-follow-list>div:not(.replica-list-empty),
  .course-simple-picker>label,
  .course-simple-list button,
  .classroom-search,
  .classroom-favorites button,
  .classroom-management-card__code,
  .classroom-preview__panel,
  .student-class-teacher
) {
  background:#161f2c!important;
  border-color:#2a3545!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .replica-card-title>span {
  background:#202936!important;
  color:#d8dee8!important;
}
html[data-theme="dark"] .replica-card-title small {
  color:#91b6d7!important;
}
html[data-theme="dark"] :is(
  .replica-data-list>a>b,
  .replica-data-list>a>em,
  .replica-course-row>em,
  .replica-follow-list b,
  .student-course-detail dd
) {
  color:#7eac89!important;
}
html[data-theme="dark"] :is(
  .replica-step.is-done b,
  .replica-follow-list span
) {
  border-color:#5d886b!important;
  background:#5d886b!important;
}
html[data-theme="dark"] :is(
  .replica-progress-ring__value
) {
  stroke:#72a47e!important;
}
html[data-theme="dark"] :is(
  .student-orbit-progress i b,
  .student-course-detail footer i b,
  .classroom-management-card__metrics>i b,
  .classroom-preview__stats i b,
  .replica-course-row>div>i b
) {
  background:#6f9f7a!important;
}
html[data-theme="dark"] :is(
  .replica-progress-panel header small,
  .replica-split-actions a,
  .classroom-preview__actions a,
  .classroom-preview__open,
  .student-orbit-detail__footer nav a,
  .classroom-view-switch button.is-active,
  .classroom-filter-rail button.is-active,
  .classroom-favorites button.is-active
) {
  background:#1a2635!important;
  border-color:#334154!important;
  color:#c3cfdd!important;
}
html[data-theme="dark"] :is(
  .replica-card-action,
  .classroom-manager__create,
  .student-classroom-header>a,
  .course-simple-header>a,
  .primary-button
) {
  background:#8fb7da!important;
  color:#0c1722!important;
  box-shadow:none!important;
}
html[data-theme="dark"] :is(
  .class-orbit__item.is-active,
  .student-course-box,
  .course-simple-list button.is-active
) {
  background:#1a2c3d!important;
  border-color:#497498!important;
  color:#deefff!important;
  box-shadow:0 12px 26px rgba(0,0,0,.22)!important;
}
html[data-theme="dark"] :is(
  .class-orbit__icon,
  .student-course-box>span,
  .course-simple-list button>span
) {
  background:#182130!important;
  box-shadow:none!important;
}
html[data-theme="dark"] :is(
  .condition-card,
  .type-box,
  .category-card,
  .login-card
)::after {
  background:#83a9cb!important;
  box-shadow:
    -30px 9px 0 rgba(131,169,203,.62),
    -10px 37px 0 rgba(149,188,224,.48)!important;
}
html[data-theme="dark"] .welcome-panel::after {
  background:rgba(131,169,203,.66)!important;
  box-shadow:
    39px 5px 0 rgba(149,188,224,.58),
    18px -38px 0 rgba(226,240,252,.38)!important;
}
html[data-theme="dark"] .cowlish-loader__beam i:nth-child(4)::before,
html[data-theme="dark"] .cowlish-loader__beam i:nth-child(4)::after {
  background:#c5ddf2;
}
html[data-theme="dark"] :is(
  .classroom-management-card>footer em,
  .classroom-preview__head>em
) {
  background:#193025!important;
  color:#8fc09b!important;
}
html[data-theme="dark"] :is(
  .replica-next-panel>a,
  .student-course-detail footer a,
  .course-simple-detail>article>footer a,
  .student-orbit-detail__footer nav a:last-child
) {
  background:#26364a!important;
  color:#d9e3ef!important;
  box-shadow:none!important;
}
html[data-theme="dark"] :is(
  .replica-list-empty,
  .student-orbit-empty,
  .course-simple-no-results,
  .course-simple-empty
) {
  background:#101721!important;
  border-color:#2a3545!important;
}
html[data-theme="dark"] :is(
  .replica-progress-ring__track,
  .student-orbit-progress>i,
  .student-course-detail footer>i,
  .classroom-management-card__metrics>i,
  .classroom-preview__stats i
) {
  background:#26303d!important;
  stroke:#26303d!important;
}
html[data-theme="dark"] .site-content::after {
  background:rgba(5,8,14,.48);
}
html[data-theme="dark"] .cowlish-loader__veil {
  background:rgba(8,12,20,.36);
}
html[data-theme="dark"] .cowlish-loader.is-active .cowlish-loader__veil {
  background:rgba(8,12,20,.76);
}
html[data-theme="dark"] .cowlish-loader.is-resolving .cowlish-loader__veil {
  background:rgba(8,12,20,0);
}
@keyframes cowlish-stars-twinkle {
  from { opacity:.46; }
  to { opacity:.8; }
}
html.reduce-effects[data-theme="dark"] body::before {
  animation:none;
  opacity:.5;
}
@media (prefers-reduced-motion:reduce) {
  html[data-theme="dark"] body::before {
    animation:none;
    opacity:.5;
  }
}

@media (max-width:600px) {
  .mobile-home-back--tool {
    position:fixed;
    top:max(12px,env(safe-area-inset-top));
    left:12px;
    z-index:2147483600;
    min-height:42px;
    display:flex;
    align-items:center;
    gap:7px;
    padding:8px 13px;
    border:1px solid var(--line);
    border-radius:14px;
    color:var(--text);
    background:var(--card);
    box-shadow:0 7px 20px rgba(54,45,24,.1);
    font-size:12px;
    text-decoration:none;
    outline:none;
    -webkit-tap-highlight-color:transparent;
  }
  .mobile-home-back--tool>span {
    font-size:20px;
    line-height:1;
  }
  .theme-toggle {
    -webkit-backdrop-filter:none;
    backdrop-filter:none;
    transition:none;
  }
  .cowlish-loader__veil,
  .cowlish-loader.is-active .cowlish-loader__veil,
  .cowlish-loader.is-resolving .cowlish-loader__veil {
    -webkit-backdrop-filter:none!important;
    backdrop-filter:none!important;
  }
  .theme-toggle:hover,
  .theme-toggle:focus {
    transform:none;
  }
  .theme-toggle--floating {
    right:max(14px,env(safe-area-inset-right));
    top:max(12px,env(safe-area-inset-top));
    bottom:auto;
    outline:none;
    -webkit-tap-highlight-color:transparent;
  }
  html[data-theme="dark"] .app-sidebar .main-nav a:hover,
  html[data-theme="dark"] .app-sidebar .main-nav a:focus,
  html[data-theme="dark"] .app-sidebar .sidebar-action:hover,
  html[data-theme="dark"] .app-sidebar .sidebar-action:focus {
    color:var(--muted)!important;
    background:transparent!important;
  }
  html[data-theme="dark"] .app-sidebar .main-nav a.active {
    color:var(--text)!important;
    background:var(--yellow-light)!important;
  }
}
