/* Color and atmosphere across the academy. Reward artwork retains its original colors. */
@property --theme-brand { syntax: "<color>"; inherits: true; initial-value: #ecb9cc; }
@property --theme-poster { syntax: "<color>"; inherits: true; initial-value: #442d3b; }
@property --theme-art { syntax: "<color>"; inherits: true; initial-value: #c884a5; }
@property --theme-glow { syntax: "<color>"; inherits: true; initial-value: #d48fae; }
@property --theme-particle { syntax: "<color>"; inherits: true; initial-value: #eeb2cd; }
@property --theme-light { syntax: "<color>"; inherits: true; initial-value: transparent; }

:root[data-core-theme-ready] {
  --theme-light: transparent;
  --theme-light-field: color-mix(in srgb, var(--theme-light) calc(55% * var(--theme-lighting)), transparent);
  --theme-glow-field: color-mix(in srgb, var(--theme-glow) calc(64% * var(--theme-bloom)), transparent);
  --theme-fade: .55s;
  --theme-light-fade: .95s;
  --theme-wall: radial-gradient(ellipse at 79% 0%, var(--theme-light-field), transparent 59%),
    radial-gradient(ellipse at 75% 7%, var(--theme-glow-field), transparent 58%);
  --theme-stage: radial-gradient(ellipse at 79% 0%,
      color-mix(in srgb, var(--theme-light-field) 18%, transparent), transparent 59%),
    radial-gradient(ellipse at 75% 7%,
      color-mix(in srgb, var(--theme-glow-field) 15%, transparent), transparent 58%),
    linear-gradient(145deg, var(--theme-stage-bg), var(--theme-stage-end));
  transition: --theme-brand var(--theme-fade), --theme-poster var(--theme-fade),
    --theme-art var(--theme-fade), --theme-glow var(--theme-fade), --theme-particle var(--theme-fade),
    --theme-light var(--theme-light-fade) ease-in-out;
}
:root[data-core-atmosphere="morning"] { --theme-light: var(--theme-morning); }
:root[data-core-atmosphere="day"] { --theme-light: var(--theme-day); }
:root[data-core-atmosphere="evening"] { --theme-light: var(--theme-evening); }
:root[data-core-atmosphere="night"] { --theme-light: var(--theme-night); }

:root[data-core-theme-effect="grid"] {
  --theme-stage: repeating-linear-gradient(90deg,
      color-mix(in srgb, var(--theme-glow-field) 12%, transparent) 0 1px, transparent 1px 38px),
    repeating-linear-gradient(0deg,
      color-mix(in srgb, var(--theme-glow-field) 12%, transparent) 0 1px, transparent 1px 38px),
    radial-gradient(ellipse at 79% 0%, color-mix(in srgb, var(--theme-light-field) 18%, transparent), transparent 59%),
    linear-gradient(145deg, var(--theme-stage-bg), var(--theme-stage-end));
  --theme-wall: radial-gradient(ellipse at 78% 0%, var(--theme-light-field), transparent 66%),
    repeating-linear-gradient(90deg, var(--theme-glow-field) 0 1px, transparent 1px 38px),
    repeating-linear-gradient(0deg, var(--theme-glow-field) 0 1px, transparent 1px 38px);
}
:root[data-core-theme-effect="none"] {
  --theme-stage: radial-gradient(ellipse at 79% 0%,
      color-mix(in srgb, var(--theme-light-field) 18%, transparent), transparent 59%),
    linear-gradient(145deg, var(--theme-stage-bg), var(--theme-stage-end));
  --theme-wall: radial-gradient(ellipse at 78% 0%, var(--theme-light-field), transparent 65%);
}

::view-transition { pointer-events: none; }
::view-transition-group(root) { animation-duration: .65s; }
::view-transition-old(root) { animation: core-theme-old .65s ease both; }
::view-transition-new(root) { animation: core-theme-new .65s ease both; }
@keyframes core-theme-old { from { opacity: 1; } to { opacity: 0; } }
@keyframes core-theme-new { from { opacity: 0; } to { opacity: 1; } }

html[data-core-theme-ready]:not([data-core-theme-surface="welcome"]) body {
  background: radial-gradient(ellipse at 76% -7%, var(--theme-light-field), transparent 63%),
    radial-gradient(circle at 78% -4%, var(--cp466, rgba(221,178,172,.24)), transparent 35%),
    linear-gradient(142deg, var(--cp467,#f6eee9), var(--cp468,#ecddd5) 53%, var(--cp469,#f9f1ed));
}
html[data-core-theme-ready] :is(.app > aside, .core-navigation-rail) {
  background: var(--theme-dock) !important;
  color: var(--theme-dock-ink) !important;
}
html[data-core-theme-ready] :is(.app > aside, .core-navigation-rail) :is(.nav-btn:not(.active), .core-brand, details summary) {
  color: var(--theme-dock-ink) !important;
}
html[data-core-theme-ready] :is(.app > aside, .core-navigation-rail) :is(.nav-title, .core-brand-version) {
  color: var(--theme-dock-muted) !important;
}
html[data-core-theme-ready] :is(.app > aside, .core-navigation-rail) .nav-btn.active {
  background: var(--theme-accent) !important;
  color: var(--theme-accent-ink) !important;
}
html[data-core-theme-ready] :is(.app > aside, .core-navigation-rail) .nav-btn:not(.active, [data-section="achievements"]) .badge {
  background: var(--theme-dock);
  color: var(--theme-dock-ink) !important;
}
html[data-core-theme-ready] :is(.app > aside, .core-navigation-rail) .nav-btn.active :is(.badge, .core-nav-icon, .core-rail-label):not(:where([data-section="achievements"] .badge)) {
  color: var(--theme-accent-ink) !important;
}
html[data-core-theme-ready] :is(main, #lessonModal, #mentor) :is(
  .btn:not(.secondary, .ghost, :disabled), .plb-btn:not(.ghost, :disabled),
  .core-motion-tools button[data-core-motion-replay]
):not(:where(#achievements *, .ca-toast *, .ca-detail *, .ca-legend *, .core-sound-demo)) {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  color: var(--theme-accent-ink);
}
html[data-core-theme-ready] :is(.core-brand-line > .core-brand-word, .core-navigation-mini-brand strong, .core-navigation-mini-brand strong > span) {
  color: var(--theme-dock-brand) !important;
}
html[data-core-theme-ready] :is(.core-arrival-signature > span, .core-theme-sample-brand) {
  color: var(--theme-poster-brand) !important;
  text-shadow: 0 0 20px var(--theme-glow-field);
}
html[data-core-theme-ready] .core-brand-line em {
  color: var(--theme-dock-muted) !important;
}
html[data-core-theme-ready] :is(.core-navigation-rail .core-navigation-mini-brand > small, .app > aside .core-brand > .core-brand-ai) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--theme-ai-fill);
  color: var(--theme-ai-ink) !important;
  border: 1px solid var(--theme-ai-fill);
  padding: 2px 5px;
  border-radius: 999px;
  font: 750 10px/1.15 system-ui, sans-serif;
  letter-spacing: .06em;
  transition: none !important;
}
html[data-core-theme-ready] .core-navigation-mini-brand {
  align-items: center;
}
.core-palette-mini-hero { background: var(--preview-poster); color: var(--preview-brand) !important; }
.core-palette-mini-hero em { color: var(--preview-poster-ink); }

html[data-core-theme-ready] .core-arrival-cover {
  background: var(--theme-stage);
  color: var(--theme-poster-ink);
}
html[data-core-theme-ready] .core-arrival-signature { position: relative; z-index: 1; }
html[data-core-theme-ready] .core-arrival-signature > small { color: var(--theme-poster-muted); }
html[data-core-theme-ready] .core-arrival-signature > i {
  background: linear-gradient(90deg, transparent, var(--theme-brand), transparent);
}

html[data-core-theme-ready] :is(.core-section-poster, #style .core-style-hero, #practicebeta .plb-hero, .cabinet-hero, .career-hero, .core-design-welcome) {
  background: var(--theme-stage) !important;
  color: var(--theme-poster-ink);
  border-color: color-mix(in srgb, var(--theme-poster) 65%, var(--theme-glow)) !important;
}
html[data-core-theme-ready] :is(.core-section-poster, #style .core-style-hero, #practicebeta .plb-hero) :is(h1, h2, p),
html[data-core-theme-ready] :is(.cabinet-hero, .career-hero, .core-design-welcome) > :is(h1, h2, p, strong) {
  color: var(--theme-poster-ink) !important;
}
html[data-core-theme-ready] .core-section-poster::after { color: color-mix(in srgb, var(--theme-brand) 26%, transparent); }
html[data-core-theme-ready] .core-section-poster::before { background: none; }
html[data-core-theme-ready] :is(.core-poster-overline, #style .core-style-eyebrow) {
  color: var(--theme-poster-brand) !important;
}
html[data-core-theme-ready] .core-poster-overline::before {
  background: var(--theme-brand);
  box-shadow: 0 0 14px var(--theme-glow-field);
}
html[data-core-theme-ready] #style .core-style-orbit {
  color: var(--theme-brand);
  text-shadow: 0 0 35px var(--theme-glow-field);
  background: radial-gradient(circle, var(--theme-glow-field), transparent 65%);
}
html[data-core-theme-ready] #home .core-design-hero {
  --hero-backdrop: color-mix(in srgb, var(--theme-poster) 9%, #130c1a);
  background: var(--hero-backdrop);
}
html[data-core-theme-ready] #home .core-design-hero-media {
  isolation: isolate;
  background-color: var(--hero-backdrop);
  background-image: url("assets/core-academy-ai-hero.png?v=1081");
}
.core-design-hero-tint, .core-design-hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.core-design-hero-tint {
  background: var(--theme-art);
  opacity: var(--theme-tint);
  mix-blend-mode: color;
}
.core-design-hero-shade {
  background: linear-gradient(0deg, var(--hero-backdrop) 2%,
      color-mix(in srgb, var(--hero-backdrop) 94%, transparent) 24%,
      color-mix(in srgb, var(--hero-backdrop) 78%, transparent) 48%, transparent 88%),
    radial-gradient(ellipse 95% 70% at 12% 88%,
      color-mix(in srgb, var(--hero-backdrop) 73%, transparent), transparent 84%),
    radial-gradient(ellipse at 82% 0%, var(--theme-glow-field), transparent 60%);
}
html[data-core-theme-ready] #home .core-design-hero-copy h1 { color: var(--theme-photo-ink); }
html[data-core-theme-ready] #home .core-design-hero-copy p { color: var(--theme-photo-muted); }
html[data-core-theme-ready] #home .core-design-hero-eyebrow { color: var(--theme-photo-ink); }
html[data-core-theme-ready] #home .core-design-hero-eyebrow .core-brand-word {
  color: color-mix(in srgb, var(--theme-photo-brand) 66%, var(--theme-photo-ink));
}
html[data-core-theme-ready] #home .core-design-hero-actions .btn.secondary {
  background: var(--theme-stage-bg);
  color: var(--theme-poster-ink);
}
html[data-core-theme-ready] #home .core-design-hero-eyebrow::before {
  background: var(--theme-brand);
  box-shadow: 0 0 16px var(--theme-glow-field);
}
@media (max-width: 700px) {
  html[data-core-theme-ready] #home .core-design-hero-media {
    position: absolute;
    inset: 0;
    height: 100% !important;
    min-height: 0;
    aspect-ratio: auto;
    background-size: 100% auto;
    background-position: center top;
  }
  html[data-core-theme-ready] #home .core-design-hero-ui {
    background: transparent;
    padding-block-start: clamp(133px, 41vw, 285px) !important;
  }
  .core-design-hero-shade {
    background: linear-gradient(180deg, transparent 20px,
      color-mix(in srgb, var(--hero-backdrop) 64%, transparent) clamp(90px, 31vw, 214px),
      var(--hero-backdrop) clamp(146px, 50vw, 350px));
  }
}

html[data-core-theme-ready] :is(.v21-hero-object, #core3d) {
  filter: var(--theme-object-filter);
  transition: filter var(--theme-fade) ease;
}
html[data-core-theme-ready] :is(.core-living-bloom, .core-living-core) .core-living-aura {
  background: radial-gradient(ellipse, var(--theme-glow-field), var(--theme-light-field) 31%, transparent 73%);
}
html[data-core-theme-ready] .core-lm-particle {
  background: var(--theme-particle);
  box-shadow: 0 0 11px var(--theme-glow-field);
}
html[data-core-theme-ready] .core-xp-flying-star {
  color: var(--theme-particle);
  text-shadow: 0 0 11px var(--theme-glow);
}

html[data-core-theme-ready] .core-atmos-preview { background: var(--theme-stage); color: var(--theme-poster-brand); }
html[data-core-theme-ready] .core-atmos-light {
  background: radial-gradient(ellipse at 80% 0%, var(--theme-light-field), transparent 68%);
}

.core-theme-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.core-section-poster > .core-theme-particles, .core-style-hero > .core-theme-particles { z-index: -1; }
.core-design-hero > .core-theme-particles, .scene > .core-theme-particles { z-index: 1; }
.core-theme-particles i {
  position: absolute;
  inset-inline-start: var(--x);
  inset-block-start: var(--y);
  width: calc(var(--theme-particle-size) * var(--scale));
  height: calc(var(--theme-particle-size) * var(--scale));
  background: var(--theme-particle);
  clip-path: polygon(50% 0, 61% 37%, 100% 50%, 61% 63%, 50% 100%, 39% 63%, 0 50%, 39% 37%);
  opacity: calc(var(--theme-opacity) * var(--alpha));
  animation: core-particle-drift calc((28s - 21s * var(--theme-speed)) * var(--pace)) var(--delay) ease-in-out infinite alternate;
}
html[data-core-particle-shape="dot"] .core-theme-particles i { border-radius: 50%; clip-path: none; }
html[data-core-particle-shape="diamond"] .core-theme-particles i { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
@keyframes core-particle-drift { to { translate: var(--drift) -23px; scale: .82; } }
html[data-core-particle-motion="off"] .core-theme-particles i,
html[data-core-motion-intensity="off"] .core-theme-particles i { animation: none; }
html[data-core-motion-intensity="soft"] .core-theme-particles i { animation-play-state: paused; }

#coreStyleEditor { scroll-margin-top: 100px; }
#style .core-theme-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-block: 12px; }
#style .core-theme-form[hidden], #style [data-theme-delete][hidden] { display: none; }
#style .core-theme-editor-top { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
#style .core-theme-editor :is(input[type="text"], select) {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--style-border);
  border-radius: 8px;
  background: var(--style-surface);
  color: var(--style-ink);
  padding: 6px 9px;
}
#style .core-theme-editor-top label { min-width: 0; font-size: 13px; }
#style .core-theme-editor-top :is(input, select) { margin-top: 5px; }
.core-theme-sample {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  min-height: 105px;
  padding: 18px;
  margin: 13px 0;
  border-radius: 12px;
  color: var(--theme-poster-ink);
  background: var(--theme-stage);
}
.core-theme-sample::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: var(--theme-tint);
  background: radial-gradient(ellipse at 80% 20%, var(--theme-art), transparent 61%);
}
.core-theme-sample-brand { font: 400 clamp(23px, 5vw, 38px)/1 Georgia, serif; }
.core-theme-sample-brand small { font-size: .5em; margin-left: 2px; color: var(--theme-poster-ink); }
.core-theme-sample-chip { background: var(--theme-accent); color: var(--theme-accent-ink); padding: 6px 11px; border-radius: 999px; font-size: 12px; }
.core-theme-fields details { border-block-end: 1px solid var(--style-border); padding: 10px 0; }
.core-theme-fields summary { cursor: pointer; font-size: 14px; font-weight: 650; }
.core-theme-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding-top: 10px; }
.core-theme-field { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; }
.core-theme-field > span:first-child { flex: 1; overflow-wrap: anywhere; }
#style .core-theme-field input[type="color"] { flex: 0 0 39px; width: 39px; height: 32px; padding: 2px; border: 1px solid var(--style-border); border-radius: 7px; background: var(--style-surface); }
#style .core-theme-field :is(input[type="range"], select) { width: min(40%, 160px); }
.core-theme-value { flex: 0 0 38px; text-align: end; font-variant-numeric: tabular-nums; }

html[data-core-theme-surface="welcome"][data-core-theme-ready] {
  --ink: var(--theme-panel-ink);
  --muted: var(--theme-panel-muted);
  color: var(--ink);
  background: var(--theme-background);
}
html[data-core-theme-surface="welcome"][data-core-theme-ready] body {
  background: var(--theme-wall), radial-gradient(ellipse at 44% 13%, var(--theme-panel), var(--theme-background) 65%, var(--theme-border));
}
html[data-core-theme-surface="welcome"] :is(.film-head, .film-foot, .screen-foot, .film-caption, .screen-ui .brand small, .auth-panel label) { color: var(--theme-muted); }
html[data-core-theme-surface="welcome"] :is(.film-head .wordmark, .screen-ui .brand span) {
  color: var(--theme-panel-ink);
  text-shadow: 0 0 22px var(--theme-glow-field);
}
html[data-core-theme-surface="welcome"] :is(.film-head button, .auth-panel, .tabs, .auth-panel input, .auth-panel select) {
  background: var(--theme-panel);
  border-color: var(--theme-border);
  color: var(--theme-panel-ink);
}
html[data-core-theme-surface="welcome"] :is(.screen-ui, .stage-floor) {
  background: var(--theme-wall), linear-gradient(135deg, var(--theme-panel), var(--theme-background));
}
html[data-core-theme-surface="welcome"] .stage-floor { background: var(--theme-wall); }
html[data-core-theme-surface="welcome"] :is(.primary, .tabs button.active) { background: var(--theme-accent); color: var(--theme-accent-ink); }

/* Text and its supporting surface are styled together, including nested light cards. */
html[data-core-theme-ready] :is(.cabinet-meta-card, .v21-notice-practice, #style .core-theme-editor, #style .core-palette-choice) {
  background: var(--theme-panel);
  color: var(--theme-panel-ink);
}
html[data-core-theme-ready] .cabinet-hero :is(.cabinet-meta-card b, #cabinetReadyValue) { color: var(--theme-panel-ink); }
html[data-core-theme-ready] .cabinet-hero :is(.cabinet-meta-card span, .readiness-ring span) { color: var(--theme-panel-muted); }
html[data-core-theme-ready] .cabinet-hero .readiness-ring::after { background: var(--theme-panel); }
html[data-core-theme-ready] .cabinet-hero .cabinet-hero-grid > div > .tiny { color: var(--theme-poster-muted); }
html[data-core-theme-ready] .core-design-welcome div :is(strong, p),
html[data-core-theme-ready] #practicebeta .plb-hero :is(.plb-overline, .plb-headchips span),
html[data-core-theme-ready] .core-design-welcome-badge {
  color: var(--theme-poster-ink) !important;
}

html[data-core-theme-ready] :is(.core-journey-module-pill.is-current, #practicebeta .plb-step.current, .studio-tab.active, .v21-category-btn.active) {
  background: var(--theme-accent) !important;
  border-color: var(--theme-accent) !important;
  color: var(--theme-accent-ink) !important;
}
html[data-core-theme-ready] :is(.studio-tab.active small, #practicebeta .plb-step.current small) { color: inherit; opacity: 1; }
html[data-core-theme-ready] :is(.core-evidence-summary, .core-ai-caption, .core-evidence-number small) { color: var(--theme-panel-muted); }
html[data-core-theme-ready] :is(#course, #style, #practicebeta) :is(.core-style-section-head > span, .plb-kicker, .core-palette-desc, .core-palette-selected) { color: var(--theme-panel-muted); }
html[data-core-theme-ready] #style .core-theme-editor { --style-ink: var(--theme-panel-ink); --style-muted: var(--theme-panel-muted); --style-surface: var(--theme-panel); }
html[data-core-theme-ready] #style {
  --style-ink: var(--theme-page-ink);
  --style-muted: var(--theme-page-muted);
  --style-surface: var(--theme-panel);
}
html[data-core-theme-ready] #style .core-style-card {
  --style-ink: var(--theme-panel-ink);
  --style-muted: var(--theme-panel-muted);
  background: var(--style-surface);
  color: var(--style-ink);
}
html[data-core-theme-ready] #style .core-style-jumps { --style-ink: var(--theme-panel-ink); }
html[data-core-theme-ready] :is(.lesson-index, .core-module-art-edition, .core-journey-secondary, .core-journey-project-btn) {
  background: var(--theme-panel) !important;
  color: var(--theme-panel-ink) !important;
}
html[data-core-theme-ready] :is(.tool-pool > .arrow, .studio-tab:not(.active) small) { color: var(--theme-panel-ink); opacity: 1; }
html[data-core-theme-ready] #course .notice:has(.status-wait),
html[data-core-theme-ready] #prompts .check {
  background: var(--theme-panel) !important;
  color: var(--theme-panel-ink) !important;
}
html[data-core-theme-ready] :is(#course .status-wait, #prompts .check .no) { color: var(--theme-panel-warn); }
html[data-core-theme-ready] #prompts .check .yes { color: var(--theme-panel-good); }
html[data-core-theme-ready] #home #coreHomeQuickStart .core-quick-mentor { background: var(--theme-stage) !important; }
html[data-core-theme-ready] #home .core-quick-mentor :is(.core-quick-tile-label, .core-alive-title, .core-alive-detail, #coreAliveNextDetail) {
  color: var(--theme-poster-ink);
}
html[data-core-theme-ready][data-core-theme-custom="true"] {
  --core-ink: var(--theme-page-ink);
  --core-secondary: var(--theme-page-muted);
}
html[data-core-theme-ready][data-core-theme-custom="true"] :where(.card, .lesson, .core-style-card, .plb-card):not(#achievements *) {
  --core-ink: var(--theme-panel-ink);
  --core-secondary: var(--theme-panel-muted);
}
html[data-core-theme-ready] #mentor .agent-msg.user,
html[data-core-theme-ready] #practicebeta .plbx-bubble-row.student .plbx-bubble {
  background: var(--theme-accent);
  color: var(--theme-accent-ink);
}
html[data-core-theme-ready] #practicebeta .plbx-bubble-row.student .plbx-speaker { color: inherit; opacity: 1; }
html[data-core-theme-ready] #mentor .mentor-head {
  background: var(--theme-stage-bg);
  color: var(--theme-poster-ink);
}
html[data-core-theme-ready] #mentor .mentor-head :is(h4, .mentor-toggle) { color: var(--theme-poster-ink); }
/* Mentor uses palette-aware surfaces and status colors with independent contrast. */
html[data-core-theme-ready] #coreMentorOrb {
  --mentor-halo: var(--theme-mentor-glow);
  background: radial-gradient(circle at 40% 30%, var(--theme-mentor-orb-face), var(--theme-mentor-orb-base) 80%);
  color: var(--theme-mentor-symbol);
  border-color: var(--theme-mentor-glow);
  box-shadow: 0 0 0 1px var(--theme-mentor-orb-base),
    inset 0 0 12px color-mix(in srgb, var(--mentor-halo) calc(36% * var(--theme-bloom)), transparent),
    0 0 24px color-mix(in srgb, var(--mentor-halo) calc(78% * var(--theme-bloom)), transparent),
    0 10px 24px #0b061e6b;
}
html[data-core-theme-ready] #coreMentorOrb:has(#coreMentorOrbDot[data-status="waiting"]) { --mentor-halo: var(--theme-mentor-orb-waiting); }
html[data-core-theme-ready] #coreMentorOrb:has(#coreMentorOrbDot[data-status="ok"]) { --mentor-halo: var(--theme-mentor-orb-ok); }
html[data-core-theme-ready] #coreMentorOrb:has(#coreMentorOrbDot[data-status="error"]) { --mentor-halo: var(--theme-mentor-orb-error); }
html[data-core-theme-ready] #coreMentorOrb:has(#coreMentorOrbDot[data-status="sleep"]) { --mentor-halo: color-mix(in srgb, var(--theme-mentor-orb-ok) 38%, white 62%); }
html[data-core-theme-ready] #coreMentorOrb:hover {
  box-shadow: 0 0 0 1px var(--theme-mentor-orb-base),
    inset 0 0 15px color-mix(in srgb, var(--mentor-halo) calc(46% * var(--theme-bloom)), transparent),
    0 0 30px color-mix(in srgb, var(--mentor-halo) calc(100% * var(--theme-bloom)), transparent),
    0 12px 26px #0b061e7a;
}
html[data-core-theme-ready] #coreMentorOrb:focus-visible { outline-color: var(--theme-mentor-glow); }
html[data-core-theme-ready] #coreMentorOrb .core-mentor-orb-symbol {
  text-shadow: 0 0 13px var(--theme-mentor-glow);
}
html[data-core-theme-ready] :is(.core-character-canvas, #coreSpiritTour canvas.core-pixel-mentor, .core-lm-guide .core-pixel-mentor) {
  filter: drop-shadow(0 0 1px var(--theme-mentor-glow))
    drop-shadow(0 0 7px color-mix(in srgb, var(--theme-mentor-glow) calc(70% * var(--theme-bloom)), transparent));
}
html[data-core-theme-ready] #coreSpiritTour.lm-speaking canvas.core-pixel-mentor {
  filter: drop-shadow(0 0 1px var(--theme-mentor-glow))
    drop-shadow(0 0 calc(8px + var(--lm-voice, 0)*18px)
      color-mix(in srgb, var(--theme-mentor-glow) calc(90% * var(--theme-bloom)), transparent)) !important;
}
html[data-core-theme-ready] #coreSpiritHalo {
  border-color: var(--theme-mentor-glow);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-mentor-glow) 35%, transparent),
    0 0 23px color-mix(in srgb, var(--theme-mentor-glow) calc(77% * var(--theme-bloom)), transparent);
}
html[data-core-theme-ready] #coreMentorOrbDot {
  --mentor-dot: var(--theme-mentor-orb-idle);
  background: var(--mentor-dot);
  border-color: var(--theme-mentor-orb-base);
  width: 16px;
  height: 16px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--mentor-dot) 85%, transparent),
    0 0 9px color-mix(in srgb, var(--mentor-dot) 62%, transparent);
}
html[data-core-theme-ready] #coreMentorOrbDot[data-status="ok"] { --mentor-dot: var(--theme-mentor-orb-ok); }
html[data-core-theme-ready] #coreMentorOrbDot[data-status="waiting"] {
  --mentor-dot: var(--theme-mentor-orb-waiting);
  animation-name: coreMentorStatusRing;
}
html[data-core-theme-ready] #coreMentorOrbDot[data-status="error"] { --mentor-dot: var(--theme-mentor-orb-error); }
html[data-core-theme-ready] #coreMentorOrbDot[data-status="sleep"] { --mentor-dot: color-mix(in srgb, var(--theme-mentor-orb-ok) 35%, white 65%); animation: none; }
@keyframes coreMentorStatusRing {
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--mentor-dot) 42%, transparent),
    0 0 12px var(--mentor-dot); }
}
html[data-core-theme-ready] #mentor #agentOnlineDot {
  --mentor-head-dot: var(--theme-mentor-head-idle);
  background: var(--mentor-head-dot);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--mentor-head-dot) 26%, transparent);
  width: 10px;
  height: 10px;
}
html[data-core-theme-ready] #mentor #agentOnlineDot.on { --mentor-head-dot: var(--theme-mentor-head-ok); }
html[data-core-theme-ready] #mentor #agentOnlineDot.waiting {
  --mentor-head-dot: var(--theme-mentor-head-waiting);
  --mentor-dot: var(--mentor-head-dot);
  animation-name: coreMentorStatusRing;
}
html[data-core-theme-ready] #mentor #agentOnlineDot.error { --mentor-head-dot: var(--theme-mentor-head-error); }
html[data-core-theme-ready] #mentor .mentor-head .core-character-header { color: var(--theme-poster-ink); }
html[data-core-theme-ready] :is(.core-character-preview, .core-character-lesson, .core-character-hub) {
  color: var(--theme-panel-muted);
}
html[data-core-theme-ready] :is(#mentor .mentor-agent-status, .core-chat-wait, #mentorAgentChat .core-mentor-typing) {
  --mentor-indicator: var(--theme-mentor-panel-idle);
  background: var(--theme-panel);
  border: 1px solid var(--theme-border);
  border-inline-start: 3px solid var(--mentor-indicator);
  color: var(--theme-panel-ink) !important;
}
html[data-core-theme-ready] :is(#mentor .mentor-agent-status.waiting, .core-chat-wait, #mentorAgentChat .core-mentor-typing) {
  --mentor-indicator: var(--theme-mentor-panel-waiting);
}
html[data-core-theme-ready] #mentor .mentor-agent-status.ok { --mentor-indicator: var(--theme-mentor-panel-ok); }
html[data-core-theme-ready] #mentor .mentor-agent-status.error { --mentor-indicator: var(--theme-mentor-panel-error); }
html[data-core-theme-ready] .core-chat-wait-star { color: var(--mentor-indicator); }
html[data-core-theme-ready] :is(.core-chat-dots i, #mentorAgentChat .core-mentor-typing > span) {
  background: var(--mentor-indicator);
  box-shadow: 0 0 5px color-mix(in srgb, var(--mentor-indicator) 46%, transparent);
}
html[data-core-theme-ready] .core-chat-dots i { width: 6px; height: 6px; }
html[data-core-theme-ready] :is(#mentor .agent-msg.ai, #aiMentorAnswer .core-chat-message.ai, #lessonMentorAnswer .core-chat-message.ai) {
  background: var(--theme-panel);
  color: var(--theme-panel-ink) !important;
}
html[data-core-theme-ready] .core-chat-message.ai .core-chat-message-label { color: var(--theme-panel-muted); }
html[data-core-theme-ready] #home .core-quick-mentor .core-quick-icon {
  color: var(--theme-poster-brand);
  background: var(--theme-stage-bg);
}
html[data-core-theme-ready] #home .core-quick-mentor .core-alive-spark {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--theme-mentor-glow) calc(78% * var(--theme-bloom)), transparent));
}
html[data-core-theme-ready] .core-chat-typing .core-chat-message-text::after {
  color: var(--theme-mentor-panel-ok);
  text-shadow: 0 0 5px color-mix(in srgb, var(--theme-mentor-panel-ok) 55%, transparent);
}
html[data-core-motion-intensity="off"] :is(#coreMentorOrbDot, #agentOnlineDot, .core-chat-wait-star, .core-chat-dots i) {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html[data-core-theme-ready] :is(#coreMentorOrbDot, #agentOnlineDot) { animation: none !important; }
}

html[data-core-theme-surface="welcome"] :is(.auth-panel label, .tabs button:not(.active)) { color: var(--theme-panel-muted); }
html[data-core-theme-surface="welcome"] :is(.film-head, .film-foot, .film-caption) { color: var(--theme-page-ink); }
html[data-core-theme-surface="welcome"] .film-head small { opacity: 1; }

:where(#achievements, .ca-toast, .ca-detail, .ca-legend, .ca-flyer, .exp-toast, .core-sound-demo) {
  color-scheme: light;
  --bg: #f2e8e2;
  --panel: #fff9f5;
  --panel-2: #f7ebe4;
  --text: #322829;
  --muted: #725e5e;
  --line: #ddc8c0;
  --soft: #ebd9d0;
  --accent: #965e69;
  --good: #486c58;
  --warn: #906036;
  --bad: #9d4e55;
  --core-paper: #fff9f5;
  --core-porcelain: #f9eee8;
  --core-blush: #ecd3cd;
  --core-dust: #d6a5a3;
  --core-rose: #aa727d;
  --core-ink: #322829;
  --core-secondary: #725e5e;
  --core-deep: #261e20;
  --core-deep-2: #38292d;
  --core-deep-3: #463238;
  --core-light-text: #fff7f3;
  --core-dark-muted: #dac6c1;
  --core-outline: rgba(88,54,56,.18);
}
/* Recolor the gallery and detail panels at the surface level. The badge SVGs,
   rarity tokens, reveal layers and motion declarations retain their original styles. */
html[data-core-theme-ready] :is(#achievements, .ca-detail) { color-scheme: inherit; }
html[data-core-theme-ready] #achievements {
  --text: var(--theme-page-ink);
  --muted: var(--theme-page-muted);
  --line: var(--theme-border);
  --core-ink: var(--theme-panel-ink);
  --core-secondary: var(--theme-panel-muted);
  color: var(--text);
}
html[data-core-theme-ready] #achievements .exp-hero {
  background: var(--theme-stage) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-poster-ink);
}
html[data-core-theme-ready] #achievements .exp-hero::after {
  color: color-mix(in srgb, var(--theme-poster-brand) 10%, transparent);
}
html[data-core-theme-ready] #achievements .exp-hero h1 { color: var(--theme-poster-ink) !important; }
html[data-core-theme-ready] #achievements .exp-hero p { color: var(--theme-poster-muted) !important; }
html[data-core-theme-ready] #achievements .exp-hero .exp-eyebrow { color: var(--theme-poster-brand); }
html[data-core-theme-ready] #achievements .exp-hero .exp-eyebrow::before {
  background: var(--theme-brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-brand) 12%, transparent);
}
html[data-core-theme-ready] #achievements .exp-orb { color: var(--core-light-text); }
html[data-core-theme-ready] #achievements :is(.exp-summary-card, .exp-rarity-box, .exp-award, .exp-award.exp-locked,
    .ca-preview-box, .exp-bottom .card, .core-living-collection),
html[data-core-theme-ready] .ca-detail {
  background: var(--theme-panel);
  color: var(--theme-panel-ink);
}
html[data-core-theme-ready] #achievements :is(.exp-summary-card, .exp-rarity-box, .ca-preview-box, .exp-bottom .card,
    .core-living-collection, .exp-empty, .exp-award.exp-locked:not(:hover, :focus-visible)) {
  border-color: var(--theme-border);
}
html[data-core-theme-ready] #achievements .exp-filterbar .tiny,
html[data-core-theme-ready] #achievements .ca-collection-tools label { color: var(--theme-page-muted); }
html[data-core-theme-ready] #achievements :is(.exp-muted, .exp-note, .exp-rarity-box label, .exp-recent-row small,
    .ca-family, .ca-progress-text, .exp-award p, .exp-award-bottom, .ca-preview-box small),
html[data-core-theme-ready] .ca-detail :is(small, .ca-progress-text) {
  color: var(--theme-panel-muted);
}
html[data-core-theme-ready] #achievements :is(.exp-award-rarity, .ca-detail-open, .exp-play-sound, .exp-award-bottom b,
    .ca-progress-text b, .exp-rate-grid b),
html[data-core-theme-ready] .ca-detail .ca-progress-text b {
  color: var(--theme-panel-ink) !important;
}
html[data-core-theme-ready] #achievements :is(.exp-track, .ca-progress, .exp-award-bottom),
html[data-core-theme-ready] .ca-detail .ca-progress {
  border-color: var(--theme-border);
}
html[data-core-theme-ready] :is(#achievements, .ca-detail) :is(.exp-track, .ca-progress) {
  background: var(--theme-border);
}
html[data-core-theme-ready] #achievements :is(.exp-rate-grid > div, .exp-filter-buttons button,
    .ca-preview-box button, .ca-collection-tools select, .btn.secondary, .exp-empty) {
  background: var(--theme-panel);
  border-color: var(--theme-border);
  color: var(--theme-panel-ink);
}
html[data-core-theme-ready] #achievements .exp-filter-buttons button.active,
html[data-core-theme-ready] .ca-detail button {
  background: var(--theme-accent) !important;
  border-color: var(--theme-accent) !important;
  color: var(--theme-accent-ink) !important;
}
html[data-core-theme-ready] .ca-detail { border-color: var(--theme-border); }
html[data-core-theme-ready] .ca-detail::backdrop {
  background: color-mix(in srgb, var(--theme-stage-bg) 55%, transparent);
}

/* Banner notes are text on the shared artwork, with actions kept as controls. */
html[data-core-theme-ready] :is(.core-section-poster .core-poster-chips, #practicebeta .plb-headchips, #achievements .exp-hero .exp-badges) {
  gap: .5rem 1rem;
}
html[data-core-theme-ready] :is(.core-section-poster .core-poster-chips > span, #practicebeta .plb-hero .plb-headchips > span,
    #achievements .exp-hero .exp-badges > span, .core-design-welcome-badge) {
  background: none;
  border: 0;
  color: var(--theme-poster-muted) !important;
  padding: 0;
}
html[data-core-theme-ready] :is(.core-section-poster .core-poster-chips, #practicebeta .plb-headchips,
    #achievements .exp-hero .exp-badges) > span::before {
  content: "·";
  color: var(--theme-poster-brand);
  padding-inline-end: .3em;
}


@media (max-width: 560px) {
  #style .core-theme-editor-top, .core-theme-fields-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  :root[data-core-theme-ready] { --theme-fade: 0s; --theme-light-fade: 0s; }
  .core-theme-particles i { animation: none; }
}
html[data-core-motion-intensity="off"][data-core-theme-ready] { --theme-fade: 0s; --theme-light-fade: 0s; }
