@font-face {
  font-family: Geist;
  src: url("geist-latin.woff2") format("woff2");
  font-weight: 400 850;
  font-display: swap;
}

:root {
  color-scheme: light;
  --aura-ease: cubic-bezier(.22, 1, .36, 1);
  --theme-control-ink: white;
  --theme-control-surface: oklch(100% 0 0 / .06);
  --theme-control-active: oklch(100% 0 0 / .16);
  --theme-control-line: oklch(76% .045 257);
  --theme-focus: oklch(48% .19 288);
  --theme-hero-paper: white;
  --theme-hero-ink: oklch(32% .067 290);
}

body.learning-simple { font-family: Geist, system-ui, sans-serif; }
body.learning-simple :is(button, select, input, textarea) { font-family: inherit; }

.app-header .header-utilities {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  margin-inline-start: auto;
}
.app-header .header-utilities .local-label { margin: 0; white-space: nowrap; }

#theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 9px;
  border: 1px solid var(--theme-control-line);
  border-radius: 8px;
  background: var(--theme-control-surface);
  color: var(--theme-control-ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
#theme-toggle:is(:hover, [aria-pressed="true"]) { background: var(--theme-control-active); }
#theme-toggle:focus-visible, body.learning-simple .app-header nav a:focus-visible {
  outline: 2px solid oklch(92% .104 96);
  outline-offset: 2px;
}
.theme-icon {
  flex: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
#theme-toggle[aria-pressed="true"] .theme-icon { background: linear-gradient(90deg, transparent 50%, currentColor 50%); }

@media (min-width: 761px) and (max-width: 1060px) {
  .app-header .header-utilities .local-label { display: none; }
}
@media (max-width: 760px) {
  .app-header .header-inner { position: relative; }
  .app-header .header-utilities {
    position: absolute;
    inset: 0 6px auto auto;
  }
  #theme-toggle { width: 40px; min-height: 30px; padding: 0; border-color: transparent; background: transparent; }
  #theme-toggle .theme-label { display: none; }
}

#topic-page .topic-intro-links a[data-watch-example] {
  color: var(--theme-hero-ink);
  background: var(--theme-hero-paper);
}
#topic-page .topic-intro-links a[data-watch-example]:hover { background: oklch(96% .018 293); }

[data-aura-magnet] {
  translate: var(--magnet-x, 0px) var(--magnet-y, 0px);
  transition: translate .32s var(--aura-ease), scale .18s ease;
}
[data-aura-magnet]:active:not(:disabled) { scale: .98; }

@media (prefers-reduced-motion: no-preference) {
  body[data-aura-transition] .app-header { view-transition-name: aura-header; }
  body[data-aura-transition] #main { view-transition-name: aura-library; }
  body[data-aura-transition="array"] :is(#overview, #topic-page) [data-topic-preview="array"],
  body[data-aura-transition="list"] :is(#overview, #topic-page) [data-topic-preview="list"],
  body[data-aura-transition="stack"] :is(#overview, #topic-page) [data-topic-preview="stack"],
  body[data-aura-transition="queue"] :is(#overview, #topic-page) [data-topic-preview="queue"] { view-transition-name: aura-preview; }

  ::view-transition { pointer-events: none; }
  ::view-transition-old(root), ::view-transition-new(root),
  ::view-transition-old(aura-header), ::view-transition-new(aura-header) { animation-duration: .22s; }
  ::view-transition-group(aura-preview) { animation-duration: .48s; animation-timing-function: var(--aura-ease); z-index: 2; }
  ::view-transition-old(aura-preview), ::view-transition-new(aura-preview) { border-radius: 12px; overflow: clip; }
  ::view-transition-old(aura-library) { animation: aura-library-out .22s ease both; }
  ::view-transition-new(aura-library) { animation: aura-library-in .42s var(--aura-ease) both; }
}
@keyframes aura-library-out { to { opacity: 0; transform: translateY(-7px); } }
@keyframes aura-library-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  [data-aura-magnet] { translate: none; scale: none; transition: none; }
}

/* The theme changes paint only. The existing dashboard, topic and workbench
   styles own grid tracks, dimensions and spacing in both palettes. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --aura-bg: oklch(16% .022 270);
  --aura-board: oklch(19% .032 267);
  --aura-rail: oklch(22% .024 273);
  --aura-raised: oklch(27% .027 276);
  --aura-text: oklch(97% .01 275);
  --aura-muted: oklch(82% .025 273);
  --aura-quiet: oklch(74% .03 271);
  --aura-violet: oklch(84% .112 291);
  --aura-mint: oklch(87% .117 167);
  --aura-blue: oklch(84% .104 234);
  --aura-amber: oklch(87% .114 77);
  --aura-rose: oklch(85% .104 357);
  --aura-black: oklch(18% .048 284);
  --aura-glass: oklch(100% 0 0 / .045);
  --aura-hairline: oklch(100% 0 0 / .19);
  --aura-control-line: oklch(62% .052 273);
  --aura-outline: inset 0 0 0 1px var(--aura-hairline);
  --aura-shadow: 0 25px 50px -12px oklch(0% 0 0 / .48);
  --theme-focus: var(--aura-violet);
  --theme-control-ink: var(--aura-text);
  --theme-control-active: oklch(74% .113 285 / .28);
  --studio-ink: var(--aura-text);
  --studio-text: var(--aura-muted);
  --studio-muted: var(--aura-muted);
  --studio-purple: var(--aura-violet);
  --studio-purple-dark: var(--aura-violet);
  --studio-line: var(--aura-hairline);
  --studio-soft: var(--aura-raised);
  --studio-green: var(--aura-mint);
  --studio-green-soft: oklch(27% .05 166);
  --studio-rose: var(--aura-rose);
  --ink: var(--aura-text);
  --muted: var(--aura-muted);
  --canvas: var(--aura-bg);
  --paper: var(--aura-rail);
  --line: var(--aura-hairline);
}

:root[data-theme="dark"] body.learning-simple:is(.dashboard, .workbench) {
  background: var(--aura-bg);
  color: var(--aura-text);
}
:root[data-theme="dark"] .app-header {
  border-top-color: oklch(56% .094 285);
  background: var(--aura-bg);
}
:root[data-theme="dark"] .app-header nav[aria-label="Primary navigation"] > a[data-top] {
  --nav-ink: var(--aura-text);
  --nav-tint: var(--aura-raised);
  color: var(--aura-muted);
}
:root[data-theme="dark"] .app-header nav[aria-label="Primary navigation"] > a[data-top][aria-current] {
  color: var(--aura-violet);
  background: oklch(76% .15 287 / .16);
}
:root[data-theme="dark"] .app-header nav[aria-label="Primary navigation"] > a[data-top="list"][aria-current] { color: var(--aura-mint); }

:root[data-theme="dark"] body.dashboard .bento-dashboard {
  --home-ink: var(--aura-text);
  --home-muted: var(--aura-muted);
  --home-line: var(--aura-hairline);
  --home-accent: var(--aura-violet);
}
:root[data-theme="dark"] body.dashboard .bento-topic {
  --topic-fill: color-mix(in oklch, var(--topic-ink) 14%, var(--aura-rail));
  background: var(--aura-glass);
  box-shadow: var(--aura-outline);
}
:root[data-theme="dark"] body.dashboard .bento-arrays, :root[data-theme="dark"] #topic-page[data-topic="array"] { --topic-ink: var(--aura-violet); }
:root[data-theme="dark"] body.dashboard .bento-lists, :root[data-theme="dark"] #topic-page[data-topic="list"] { --topic-ink: var(--aura-mint); }
:root[data-theme="dark"] body.dashboard .bento-searching { --topic-ink: var(--aura-blue); }
:root[data-theme="dark"] body.dashboard .bento-sorting { --topic-ink: var(--aura-amber); }
:root[data-theme="dark"] body.dashboard .bento-stacks, :root[data-theme="dark"] #topic-page[data-topic="stack"] { --topic-ink: var(--aura-rose); }
:root[data-theme="dark"] body.dashboard .bento-queues, :root[data-theme="dark"] #topic-page[data-topic="queue"] { --topic-ink: var(--aura-blue); }

:root[data-theme="dark"] #topic-page {
  --hub-ink: var(--aura-text);
  --hub-muted: var(--aura-muted);
  --hub-accent: var(--topic-ink);
  --hub-tint: color-mix(in oklch, var(--topic-ink) 13%, var(--aura-rail));
  --hub-border: var(--aura-hairline);
  --hub-highlight: var(--topic-ink);
}
:root[data-theme="dark"] #topic-page :is(.topic-lesson-card, .problem-card) {
  background: var(--aura-rail);
  color: var(--aura-text);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] #topic-page .topic-lesson-card.basic-operations { background: var(--hub-tint); }
:root[data-theme="dark"] #topic-page :is(.topic-lesson-card ul a, .topic-next-links a) { color: var(--hub-accent); background: var(--aura-raised); }
:root[data-theme="dark"] #topic-page :is(.problem-card p, small) { color: var(--aura-muted); }
:root[data-theme="dark"] #topic-page .topic-problems { border-top-color: var(--aura-hairline); }
:root[data-theme="dark"] #topic-page .tag-easy { background: oklch(29% .058 164); color: var(--aura-mint); }
:root[data-theme="dark"] #topic-page .tag-medium { background: oklch(31% .065 75); color: var(--aura-amber); }
:root[data-theme="dark"] #topic-page .tag-hard { background: oklch(31% .076 10); color: var(--aura-rose); }
:root[data-theme="dark"] #topic-page .problem-pattern { background: oklch(28% .06 286); color: var(--aura-violet); border-color: oklch(62% .085 286); }

/* Workbench, code, diagrams and dialogs */
:root[data-theme="dark"] body.learning-simple :is(.button, .text-button, .workspace-button) { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple .button {
  background: var(--aura-raised);
  border-color: var(--aura-control-line);
}
:root[data-theme="dark"] body.learning-simple .button:hover:not(:disabled) {
  background: oklch(29% .038 276);
  border-color: oklch(75% .12 287 / .42);
}
:root[data-theme="dark"] body.learning-simple :is(.button.primary, #watch-workspace #teaching-play):not(:disabled) {
  color: var(--aura-black);
  background: linear-gradient(155deg, oklch(88% .096 281), oklch(73% .173 290));
  border-color: transparent;
  box-shadow: inset 0 1px oklch(100% 0 0 / .43), 0 6px 26px -8px oklch(73% .20 289 / .8);
}
:root[data-theme="dark"] body.learning-simple :is(.button.primary, #watch-workspace #teaching-play):hover:not(:disabled) {
  color: var(--aura-black);
  background: linear-gradient(155deg, oklch(92% .076 281), oklch(80% .157 290));
  border-color: transparent;
}
:root[data-theme="dark"] body.learning-simple :is(button, select, input):disabled,
:root[data-theme="dark"] body.learning-simple .button.primary:disabled {
  color: var(--aura-quiet);
  background: var(--aura-rail);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple :is(input:not([type=checkbox]), select) {
  color: var(--aura-text);
  background: var(--aura-raised);
  border-color: var(--aura-control-line);
}
:root[data-theme="dark"] body.learning-simple :is(input, textarea)::placeholder { color: var(--aura-quiet); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.lesson-bar, .learning-toolbar, .teaching-top, #lab-controls, .playback, .teaching-controls) {
  background: var(--aura-rail);
  border-color: var(--aura-hairline);
  color: var(--aura-text);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#title, #structure-name, #teaching-heading) { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#lesson-group, .lesson-summary, .memory-toggle, #structure-count, #teaching-step) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple.workbench #lesson-topic-link { color: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple.workbench[data-structure="list"] #lesson-topic-link { color: var(--aura-mint); }
:root[data-theme="dark"] body.learning-simple.workbench #lesson-topic-link:hover { background: var(--aura-raised); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.workspace-switch, .activity-switch) {
  border-color: var(--aura-hairline);
  background: var(--aura-board);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(.workspace-button, .activity-switch .button, .build-tool-picker .button)[aria-pressed="true"] {
  background: oklch(75% .15 287 / .19);
  color: var(--aura-violet);
  box-shadow: inset 0 0 0 1px oklch(76% .15 287 / .20);
}
:root[data-theme="dark"] body.learning-simple.workbench .learning-toolbar > .memory-toggle,
:root[data-theme="dark"] body.learning-simple.workbench :is(.operation-controls-form label, .teaching-case-label, .check-label, .playback label, .teaching-controls label) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.teaching-panel, #playground-lab, .playground-workbench, .execution-workbench) {
  background: var(--aura-bg);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(.execution-picture, .teaching-canvas) { background: var(--aura-board); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) {
  color: var(--aura-text);
  background: var(--aura-board);
}
:root[data-theme="dark"] body.learning-simple.workbench #scene .direct-board-scroll,
:root[data-theme="dark"] body.learning-simple.workbench #scene .direct-board-plane {
  background: transparent;
  border-color: transparent;
}
:root[data-theme="dark"] body.learning-simple.workbench :is(.visual-legend, .diagram-viewport-tools, .teaching-model, #interaction-hint, #direct-status) {
  background: var(--aura-board);
  color: var(--aura-muted);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(.visual-legend p, .diagram-viewport-tools span) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple.workbench .legend-current { background: var(--aura-mint); }
:root[data-theme="dark"] body.learning-simple.workbench .legend-new { background: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple.workbench .legend-removed { background: var(--aura-rose); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.teaching-goal, .teaching-review, .onboarding-hint, #list-builder, .draft-notice) {
  border-color: var(--aura-hairline);
  background: var(--aura-raised);
  color: var(--aura-text);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(.teaching-review h3, .teaching-review p, #teaching-problem-check summary, #builder-hint) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple.workbench #teaching-optimal-cost {
  background: oklch(27% .044 166);
  border-color: oklch(61% .1 167 / .5);
  color: var(--aura-mint);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(.canvas-algorithms > .operation-menu-toggle, .canvas-algorithms > .array-operation-nav:not([hidden]), #operation-menu) {
  color: var(--aura-text);
  background: var(--aura-rail);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple.workbench .array-operation-nav .button { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#teaching-next, #teaching-back, #teaching-classroom, #teaching-fit) { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench .execution-panel { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.execution-panel h3, #step-title, #teaching-phase) { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#execution-state, #feedback, #teaching-caption, .technical-caption, .execution-panel > h4) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple.workbench .execution-dot {
  background: var(--aura-mint);
  box-shadow: 0 0 12px oklch(85% .15 162 / .65);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(.live-instruction, #teaching-invariant, #practice-invariant) {
  background: oklch(71% .13 287 / .10);
  color: var(--aura-violet);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#code, #teaching-code) {
  background: oklch(15% .027 270 / .67);
  color: var(--aura-text);
}
:root[data-theme="dark"] body.learning-simple.workbench .execution-panel pre .code-line { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench .execution-panel pre .line-num { color: var(--aura-quiet); }
:root[data-theme="dark"] body.learning-simple.workbench .execution-panel pre .code-line.highlight {
  background: linear-gradient(90deg, oklch(72% .176 288 / .24), oklch(70% .12 282 / .045));
  color: oklch(87% .10 294);
  border-left-color: var(--aura-violet);
  text-shadow: 0 0 12px oklch(79% .16 287 / .42);
}
:root[data-theme="dark"] body.learning-simple.workbench .execution-panel :is(.variables, #teaching-variables) {
  background: transparent;
  color: var(--aura-muted);
}
:root[data-theme="dark"] body.learning-simple.workbench .execution-panel :is(.variable, .teaching-variable):not([data-pointer-role]) {
  background: var(--aura-raised);
  color: var(--aura-text);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(.scope-note, .array-motion-note, .array-access-explainer, .array-semantic-evidence, .array-problem-evidence) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) {
  --board-cell: oklch(26% .048 271);
  --board-line: oklch(56% .078 270);
  --board-lavender: oklch(30% .065 288);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.cell, .ll-logical-node, .direct-node, .ll-compact-card, .tray-value, .array-problem-token) {
  background: var(--board-cell);
  color: var(--aura-text);
  border-color: var(--board-line);
  box-shadow: 0 3px oklch(10% .03 269 / .80);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.cell.unused, .ll-logical-node.ll-released, .direct-node.ll-released) {
  color: var(--aura-quiet);
  background: var(--aura-board);
  border-color: oklch(50% .05 270);
  box-shadow: none;
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.cell.active, .memory-active .cell, .motion-target, .sort-cell-fixed, .ll-logical-node.ll-active, .direct-node.ll-active) {
  color: var(--aura-mint);
  background: oklch(28% .065 162);
  border-color: var(--aura-mint);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.array-insert-gap, .array-append-target, .allocation-neighbor, .allocation-owner) {
  color: var(--aura-violet);
  border-color: var(--board-line);
  background: var(--board-lavender);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.cell-index, .memory-index, .cell-address, .memory-metadata, .value-tray, .memory-state, .allocation-label, .lab-allocation h3, .memory-state strong) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.memory-metadata, .array-address-band, .reference-state, .ll-reference-summary, .ll-physical-panel, .allocation, .lab-allocation) {
  background: oklch(23% .034 271 / .7);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.address-equation, .address-equation strong, .address-equation > b, .base-pointer, .read-pointer) { color: var(--aura-blue); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.ll-logical-fields strong, .direct-data, .ll-node-title, .ll-logical-fields b) { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.ll-logical-fields > span, .direct-next, .direct-node .ll-node-title) {
  background: var(--board-lavender);
  border-color: var(--board-line);
  color: var(--aura-muted);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.direct-node-identity, .direct-node-identity i, .direct-node-address, .direct-next small, .ll-logical-fields strong small, .ll-null, .ll-stage-heading h3, .ll-length-label, .ll-memory-note, .ll-tray-caption, .ll-detached, .ll-head-chip small, .ll-null small, .direct-tail-label, .direct-empty, .direct-blank-hint, .direct-null) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.direct-head-chip, .direct-head-chip span, .direct-head-chip small, .ll-head-chip, .ll-logical-node.ll-active .ll-logical-fields strong, .direct-node.ll-active .direct-data) { color: var(--aura-mint); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .direct-head-chip {
  background: oklch(28% .055 162);
  border-color: var(--aura-mint);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .direct-null { background: var(--aura-board); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .ll-logical-link:not(.ll-turn-link) { color: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.ll-data, .ll-next, .ll-status, .ll-next-address, .ll-node-identity, .ll-address, .ll-svg-null) { fill: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.ll-node-bg, .ll-card-body) {
  fill: var(--board-cell);
  stroke: var(--board-line);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.ll-edge, .direct-edge) { stroke: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.ll-reference-edge, .direct-head-edge) { stroke: var(--aura-mint); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.ll-reference-label, .ll-pointer-null, .ll-pointer-pulse) { fill: var(--aura-mint); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .moving-value {
  background: var(--board-lavender);
  color: var(--aura-text);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .active-move { filter: drop-shadow(0 0 8px oklch(77% .17 273 / .75)); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.ll-pointer-after, .ll-logical-pointer-overlay marker path) {
  stroke: var(--aura-mint);
  filter: drop-shadow(0 0 4px oklch(84% .16 166 / .76));
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene)[aria-busy="true"] .ll-changed {
  filter: drop-shadow(0 0 4px oklch(84% .16 166 / .76));
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene)[aria-busy="true"] :is(.ll-edge, .direct-edge).ll-changed { stroke: var(--aura-mint); }
:root[data-theme="dark"] body.learning-simple .workbench-dialog {
  color: var(--aura-text);
  background: oklch(20% .029 274 / .94);
  border-color: var(--aura-hairline);
  box-shadow: var(--aura-outline), var(--aura-shadow);
}
:root[data-theme="dark"] body.learning-simple .workbench-dialog::backdrop { background: oklch(10% .03 264 / .76); }
:root[data-theme="dark"] body.learning-simple .workbench-dialog > header {
  background: var(--aura-rail);
  color: var(--aura-text);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple .workbench-dialog :is(h2, h3, h4, summary, label, .catalog-count) { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple .workbench-dialog :is(p, li, small) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple .workbench-dialog :is(a:not(.button), .text-button) { color: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple .dashboard-catalog .catalog-filters [aria-pressed="true"] {
  background: oklch(32% .077 284);
  color: var(--aura-violet);
}
:root[data-theme="dark"] body.learning-simple.workbench .onboarding-hint .text-button { color: var(--aura-mint); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.array-summary, .array-evidence > span, .sort-legend, .sort-stack, .sort-runs, .array-range-caption, .allocation-detail) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.array-summary strong, .array-evidence strong) { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench .array-evidence {
  background: oklch(27% .053 281);
  border-color: var(--aura-violet);
}
:root[data-theme="dark"] body.learning-simple.workbench .array-evidence.array-found {
  background: oklch(27% .05 167);
  border-color: var(--aura-mint);
}
:root[data-theme="dark"] body.learning-simple.workbench .array-evidence.array-missing {
  background: oklch(30% .048 68);
  border-color: var(--aura-amber);
}
:root[data-theme="dark"] body.learning-simple.workbench .array-range-ruler { border-color: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple.workbench .array-range-empty { color: var(--aura-amber); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.sort-ordered, .problem-active-slot) .cell {
  background: oklch(29% .061 240);
  border-color: var(--aura-blue);
  color: var(--aura-blue);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.sort-final, .problem-done-slot) .cell {
  background: oklch(28% .061 166);
  border-color: var(--aura-mint);
  color: var(--aura-mint);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.sort-compared, .sort-pivot) .cell {
  background: oklch(33% .07 69);
  border-color: var(--aura-amber);
  color: var(--aura-amber);
  box-shadow: var(--aura-outline);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.sort-cell-status, .sort-origin-badge) { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.concept-pane, .concept-table, .concept-table table, .concept-metrics span, .concept-addresses span) {
  color: var(--aura-text);
  background: var(--aura-rail);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(.concept-pane > header, .concept-table thead th) {
  background: var(--aura-raised);
  color: var(--aura-text);
}
:root[data-theme="dark"] body.learning-simple.workbench .concept-active { border-color: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.concept-pane h3, .concept-metrics strong, .concept-bars strong) { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.concept-metrics, .concept-note, .concept-key, .concept-chain, .concept-addresses small, .concept-table summary, .concept-table caption, .concept-chapter-nav span, .concept-bars li > div, .concept-bars small) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple.workbench :is(.concept-bar, .concept-matrix i) {
  background: var(--aura-raised);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(.concept-bar i, .concept-matrix i.visited) { background: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple.workbench .concept-matrix i.active {
  background: var(--aura-mint);
  outline-color: var(--aura-mint);
}
:root[data-theme="dark"] body.learning-simple.workbench .concept-table :is(th, td) { border-color: var(--aura-hairline); }
:root[data-theme="dark"] body.learning-simple #sorting-compare-dialog :is(.compare-form, .compare-frozen, .compare-table, .compare-explanations, .compare-empty) {
  color: var(--aura-text);
  background: var(--aura-board);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple #sorting-compare-dialog :is(#compare-input-panel, #compare-input-panel .compare-form, .compare-table-scroll, .compare-table :is(th, td, caption, tr), .compare-explanations article) { border-color: var(--aura-hairline); }
:root[data-theme="dark"] body.learning-simple #sorting-compare-dialog :is(.compare-table caption, .compare-table thead th, .compare-table tbody tr:nth-child(even), .compare-chip, .compare-count-bar) {
  background: var(--aura-raised);
  color: var(--aura-text);
}
:root[data-theme="dark"] body.learning-simple #sorting-compare-dialog :is(.compare-intro, .compare-frozen small, #compare-input-help, .compare-input-state, .compare-tag-note, .compare-previous, .compare-table small, .compare-table .compare-theory, .compare-tie-order, .compare-count-note, .compare-saved-note, .compare-empty p, .compare-explanations p) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple #sorting-compare-dialog :is(.compare-form label, .compare-frozen > div:first-child, #compare-input-panel > summary, .compare-explanations summary, .compare-explanations h3) { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple #sorting-compare-dialog :is(.compare-count, .compare-watch-cell .button) { color: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple #sorting-compare-dialog .compare-count-bar i { background: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple #sorting-compare-dialog :is(.compare-reordered, .compare-error) { color: var(--aura-rose); }
:root[data-theme="dark"] body.learning-simple #sorting-compare-dialog .compare-stale {
  background: oklch(28% .051 74);
  border-color: var(--aura-amber);
  color: var(--aura-amber);
}
:root[data-theme="dark"] body.learning-simple #sorting-compare-dialog #compare-run:not(:disabled) {
  color: var(--aura-black);
  background: var(--aura-violet);
  border-color: transparent;
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .ll-memory-node > rect {
  fill: var(--board-cell);
  stroke: var(--board-line);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .ll-memory-node.ll-active > rect {
  fill: oklch(28% .055 166);
  stroke: var(--aura-mint);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .ll-memory-node.ll-released > rect {
  fill: var(--aura-board);
  stroke: var(--aura-rose);
}
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .ll-memory-node > line { stroke: var(--board-line); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .ll-memory-node .ll-working-label { fill: var(--aura-amber); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .ll-memory-map marker path { fill: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) .ll-memory-map marker[id$="-changed"] path { fill: var(--aura-mint); }
:root[data-theme="dark"] body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.ll-physical-panel h3, .ll-reference-summary, .ll-reference-summary strong, .ll-variable-strip) { color: var(--aura-muted); }

:root[data-theme="dark"] body.workbench .execution-panel {
  background: var(--aura-rail);
  border-color: var(--aura-hairline);
  box-shadow: var(--aura-outline), var(--aura-shadow);
}
:root[data-theme="dark"] body.workbench .canvas-current-line:not(:empty) {
  color: var(--aura-text);
  background: oklch(25% .041 280);
  border-left-color: var(--aura-violet);
}
:root[data-theme="dark"] body.workbench #watch-workspace #teaching-play.attention-pulse:not(:disabled) {
  color: white;
}
:root[data-theme="dark"] body.workbench :is(.execution-panel, .learning-toolbar) .button:not(:disabled),
:root[data-theme="dark"] body.workbench .diagram-viewport-tools .button:not(:disabled) { border-color: var(--aura-control-line); }
:root[data-theme="dark"] body.workbench :is(.operation-controls-form label, .diagram-viewport-tools span, .visual-legend p, .value-tray > span:first-child) { color: var(--aura-muted); }
:root[data-theme="dark"] body.workbench :is(#scene, #teaching-scene) :is(.ll-length-label, .ll-stage-heading h3, .ll-logical-fields strong small, .ll-logical-fields b, .ll-logical-fields > span) { color: var(--aura-text); }

:root[data-theme="dark"] body.learning-simple #catalog-dialog .course-card {
  --catalog-marker: var(--catalog-marker-dark);
  color: var(--aura-text);
  border-color: var(--aura-hairline);
}
:root[data-theme="dark"] body.learning-simple #catalog-dialog .course-card:hover { border-color: var(--aura-control-line); }
:root[data-theme="dark"] body.learning-simple #catalog-dialog .course-card h3 { color: var(--aura-text); }
:root[data-theme="dark"] body.learning-simple #catalog-dialog .course-card :is(p, .course-meta) { color: var(--aura-muted); }
:root[data-theme="dark"] body.learning-simple #catalog-dialog .course-card .cta { color: var(--aura-violet); }
:root[data-theme="dark"] body.learning-simple #catalog-dialog :is(.catalog-controls > label, .catalog-count) { color: var(--aura-muted); }

@media (max-width: 760px) {
  :root[data-theme="dark"] body.learning-simple #sorting-compare-dialog .compare-table tr { background: var(--aura-board); }
  :root[data-theme="dark"] body.learning-simple #sorting-compare-dialog .compare-table tbody th { background: var(--aura-raised); }
  :root[data-theme="dark"] body.learning-simple #sorting-compare-dialog .compare-table td[data-label]::before { color: var(--aura-muted); }
}

body.learning-simple :is(#overview, #topic-page, #lesson-page, .workbench-dialog) :is(a, button, select, input, summary):focus-visible {
  outline-color: var(--theme-focus);
}
#topic-page .topic-hub-intro :is(a, button):focus-visible {
  outline-color: oklch(92% .104 96);
}
body.learning-simple.workbench #teaching-scene .ll-stage-heading h3 span { color: var(--studio-muted); }
:root[data-theme="dark"] body.workbench #teaching-scene .ll-turn-link::after { color: var(--aura-violet); }
:root[data-theme="dark"] body.workbench #teaching-scene .ll-turn-link.ll-changed::after { color: var(--aura-mint); }

/* Keep the heading and address row within reach when memory details are on. */
@media (max-width: 760px) {
  body.learning-simple.workbench #teaching-scene .array-sorting .array-evidence { order: 2; }
}

body.learning-simple.workbench :is(#scene, #teaching-scene) :is(.ll-reference-summary, .ll-memory-note) { color: var(--studio-muted); }
body.learning-simple.workbench .execution-panel .code-line.highlight .line-num { color: inherit; }
:root[data-theme="dark"] body.learning-simple.workbench .array-teaching .array-insertion-target .cell-index {
  background: oklch(30% .065 288);
  color: var(--aura-violet);
}
:root[data-theme="dark"] body.learning-simple.workbench #structure-count {
  background: var(--aura-raised);
  color: var(--aura-text);
}
