/* Shared light treatment, not a second theme. Login/signup own their effects in
   accounts/css/login.css. No ink, images, layout, or lesson-paper colors change.
   All effects are screen-only and opt out of forced colors; no flashing loops. */
@media screen and (forced-colors: none) {
  html[data-wm-theme] {
    --wm-neon-violet-rgb: 167, 139, 255;
    --wm-neon-cyan-rgb: 105, 230, 245;
    --wm-neon-blue-rgb: 117, 182, 255;
    --wm-neon-pink-rgb: 239, 157, 255;
    --wm-neon-gold-rgb: 255, 217, 138;
    --wm-neon-edge: 109, 74, 255;
    --wm-neon-partner: 38, 162, 198;
    --wm-neon-frame-shadow: inset 0 1px 0 rgba(var(--wm-neon-edge), .13),
      0 12px 32px #302b5b08, -6px 0 24px rgba(var(--wm-neon-edge), .045),
      6px 0 24px rgba(var(--wm-neon-partner), .045);
    --wm-neon-action-shadow: 0 0 0 1px #8060d61a, 0 7px 22px #7655c32b,
      5px 2px 18px #40cbd016;
  }

  html[data-wm-theme="dark"] {
    --wm-neon-edge: var(--wm-neon-violet-rgb);
    --wm-neon-partner: var(--wm-neon-cyan-rgb);
    --wm-neon-frame-shadow: inset 0 1px 0 rgba(var(--wm-neon-edge), .34),
      inset 0 -1px 0 rgba(var(--wm-neon-partner), .14),
      0 0 0 1px rgba(var(--wm-neon-edge), .07),
      -8px -4px 32px rgba(var(--wm-neon-edge), .08),
      8px 4px 32px rgba(var(--wm-neon-partner), .055), 0 16px 36px #0003;
    --wm-neon-action-shadow: inset 0 1px 0 #e6dcff55, 0 0 0 1px #b99cff66,
      0 0 22px #a47aff40, 7px 0 24px #69e6f523, 0 8px 22px #0004;
    --wm-service-accent-background: linear-gradient(120deg, #9870ff38, #79a8ff16 58%, #63dcec1d);
    --wm-service-accent-shadow: inset 0 0 0 1px #bea5ff52,
      inset 0 1px 0 #e5d4ff28, 0 0 22px #ac7eff26, 8px 0 20px #69e6f50d;
  }

  /* The service canvas gets atmospheric light, never a layer over the content. */
  html[data-wm-theme="dark"] body:not(.wm-auth-page):not(.wm-login-page):not(.wm-landing) {
    background: radial-gradient(ellipse at 12% 0%, #9364ef20, transparent 48%),
      radial-gradient(ellipse at 95% 14%, #39cfec14, transparent 42%),
      radial-gradient(ellipse at 72% 94%, #d272f00b, transparent 42%), #0b1020 !important;
  }
  html[data-wm-theme="dark"] .wm-service-sidebar {
    background: linear-gradient(175deg, #19152d, #101a2d 60%, #11182b);
    border-color: #474567;
    box-shadow: 1px 0 0 #ac8aff12, 8px 0 28px #8b62ee08;
  }
  html[data-wm-theme="dark"] .wm-service-page-title {
    text-shadow: 0 0 16px #b89bff38;
  }
  html[data-wm-theme="dark"] .wm-service-nav-link.is-active .wm-service-nav-icon,
  html[data-wm-theme="dark"] .wm-service-disclosure[open] > summary .wm-service-nav-icon {
    filter: drop-shadow(0 0 5px #b595ff80);
  }

  /* Frames deliberately target UI panels, not all cards or all descendants. */
  html[data-wm-theme] :is(.wm-screen-settings-panel, .wm-public-panel, .course-catalog-panel, .course-hero__panel, .wm-usage-summary, [data-wm-neon-panel], .wm-pricing-panel),
  html[data-wm-theme] .wm-service-content :is(.panel, .summary-item) {
    box-shadow: var(--wm-neon-frame-shadow);
  }
  html[data-wm-theme="dark"] :is(.wm-screen-settings-panel, .wm-public-panel, [data-wm-neon-panel]),
  html[data-wm-theme="dark"] .wm-service-content :is(.panel, .summary-item) {
    border-color: #51446f;
  }
  html[data-wm-theme="dark"] :is(.course-catalog-panel, .course-hero__panel) {
    --wm-neon-edge: var(--wm-neon-blue-rgb);
    --wm-neon-partner: var(--wm-neon-cyan-rgb);
    box-shadow: inset 0 1px 0 #75b6ff70, 0 0 28px #75b6ff16, 0 12px 32px #0003;
  }

  /* Actions gain a two-color corona while retaining their readable solid fill. */
  html[data-wm-theme] body:not(.wm-auth-page):not(.wm-login-page) :is(
    a.wm-primary-gradient, button.wm-primary-gradient, .wm-service-resume-link, .wm-home-membership-link,
    .wm-public-button:not(.wm-public-button--secondary), .wm-brand-notice__button--primary
  ):not(:disabled):not([aria-disabled="true"]) {
    box-shadow: var(--wm-neon-action-shadow);
    transition: box-shadow 180ms ease, border-color 180ms ease;
  }
  html[data-wm-theme="dark"] body:not(.wm-auth-page):not(.wm-login-page) :is(
    a.wm-primary-gradient, button.wm-primary-gradient, .wm-service-resume-link, .wm-home-membership-link,
    .wm-public-button:not(.wm-public-button--secondary), .wm-brand-notice__button--primary
  ):not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible) {
    box-shadow: inset 0 1px 0 #f1e9ff80, 0 0 0 1px #c5adffad,
      -5px 0 24px #bd83ff55, 7px 0 28px #69e6f545, 0 10px 26px #0004;
  }
  html[data-wm-theme="dark"] :is(.course-list-card, .chapter-card, .content-card):not(.is-disabled):not(.content-card--locked):is(:hover, :focus-visible) {
    border-color: #75cddd;
    box-shadow: inset 0 1px 0 #99eaf566, 0 0 0 1px #75b6ff33,
      -5px 0 22px #a78bff26, 6px 0 26px #69e6f529, 0 12px 28px #0003;
  }
  html[data-wm-theme="dark"] .course-list-card:not(.is-disabled)::before {
    background: linear-gradient(90deg, #a78bff, #75b6ff 45%, #69e6f5 75%, #ef9dff);
  }

  /* Selected modes read as illuminated controls, with the checkmark retained. */
  html[data-wm-theme="dark"] .wm-screen-theme-input:checked + .wm-screen-theme-card {
    border-color: #c6b2ff;
    box-shadow: 0 0 0 2px #a78bff40, -4px 0 22px #a78bff55, 5px 0 20px #69e6f52e;
  }
  html[data-wm-theme="dark"] .wm-pricing-course-option[aria-checked="true"] {
    border-color: #b7a1ff;
    box-shadow: inset 0 0 0 1px #b7a1ff40, 0 0 18px #75b6ff33;
  }
  html[data-wm-theme="dark"] .wm-service-content :is(.status-dot, .wm-screen-theme-status) {
    box-shadow: 0 0 4px #b9ffee80, 0 0 14px #61dfba70;
  }
  html[data-wm-theme="dark"] .wm-service-content .notification-channel.is-disabled .status-dot {
    box-shadow: none;
  }
  html[data-wm-theme="dark"] .wm-service-content .wm-progress-gradient {
    box-shadow: 0 0 10px #9b7aff5c, 0 0 18px #69e6f530;
  }

  html[data-wm-theme="dark"] .wm-service-content :is(#planner, #recommendations, [data-planner-attendance-rhythm]) {
    border-color: #75b6ff66;
    box-shadow: inset 0 1px 0 #69e6f54d, 0 0 28px #75b6ff1f, 0 16px 36px #0003;
  }

  /* Achievement receives pink/gold accents without recoloring rank semantics. */
  html[data-wm-theme="dark"] .wm-report-achievement {
    box-shadow: inset 0 1px 0 #ef9dff52, 0 0 26px #ef9dff14, 0 14px 32px #0003;
  }
  html[data-wm-theme="dark"] .wm-hall-ranking {
    box-shadow: 0 0 0 1px #ffd98a18, 0 0 28px #ffd98a18, 0 14px 32px #0003;
  }
  html[data-wm-theme="dark"] .wm-hall-star { text-shadow: 0 0 5px #ffd98a9c, 0 0 18px #ffd98a55; }
  html[data-wm-theme="dark"] .wm-hall-title-emblem {
    box-shadow: inset 0 0 0 1px #ffd98a26, 0 0 15px #ffd98a20;
  }

  /* Public and study headers get a light seam, with no effects on paper/ink. */
  html[data-wm-theme="dark"] #site-header {
    border-bottom-color: #6b6385;
    box-shadow: 0 1px 0 #69e6f529, 0 8px 30px #9167ff12;
  }
  html[data-wm-theme="dark"] .content-pilot-header {
    border-bottom-color: #68628c;
    box-shadow: inset 0 -1px 0 #69e6f54d, 0 3px 18px #a78bff18;
  }
  html[data-wm-theme="dark"] .content-pilot-header__badge,
  html[data-wm-theme="dark"] .content-math-shell--pilot-header .content-mode-menu-toggle {
    box-shadow: inset 0 1px 0 #ded0ff66, 0 0 16px #a78bff3b;
  }
}

/* No looping animation is introduced. Remove even hover easing when requested. */
@media screen and (prefers-reduced-motion: reduce) {
  html[data-wm-theme] body:not(.wm-auth-page):not(.wm-login-page) :is(
    a.wm-primary-gradient, button.wm-primary-gradient, .wm-service-resume-link, .wm-home-membership-link,
    .wm-public-button, .wm-brand-notice__button--primary
  ) { transition: none; }
}
