/* Appearance changes affect interface chrome, not simulated weather/daylight. */
.theme-toggle {
  font-size: 21px;
  line-height: 1;
}
#themeSetting {
  padding: 8px 10px;
  min-width: 135px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
}
html[data-theme='light'] {
  color-scheme: light;
}
html[data-theme='light'] .editor-main,
html[data-theme='light'] .editor-wrap {
  background: #fafbff;
}
html[data-theme='light'] .editor-toolbar,
html[data-theme='light'] .editor-status {
  background: #f0f3fa;
  border-color: #e1e7f2;
}
html[data-theme='light'] .editor-toolbar select {
  background: #fff;
  border-color: #dce3f0;
  color: #586b88;
}
html[data-theme='light'] .editor-toolbar .text-btn,
html[data-theme='light'] .editor-actions button {
  color: #607291;
}
html[data-theme='light'] .editor-actions button:hover {
  background: #e4eafa;
}
html[data-theme='light'] .editor-actions .primary {
  background: #5260df;
  color: #fff;
}
html[data-theme='light'] .line-numbers {
  background: #f5f7fc;
  color: #667183;
  border-color: #e6ebf5;
}
html[data-theme='light'] .highlight {
  color: #3d506c;
}
html[data-theme='light'] .code-input {
  caret-color: #5260df;
}
html[data-theme='light'] .syn-comment {
  color: #74859d;
}
html[data-theme='light'] .syn-keyword {
  color: #8451b5;
}
html[data-theme='light'] .syn-number {
  color: #a46b25;
}
html[data-theme='light'] .syn-string {
  color: #287f69;
}
html[data-theme='light'] .syn-type {
  color: #1f63b5;
}
html[data-theme='light'] .syn-builtin {
  color: #b44a2c;
}
html[data-theme='light'] .syn-function {
  color: #7a5a00;
}
html[data-theme='light'] .syn-constant {
  color: #b02a6b;
}
html[data-theme='light'] .syn-operator {
  color: #5f6f88;
}
html[data-theme='light'] .code-line.current-line {
  background: #5260df0f;
}
html[data-theme='light'] .code-line.error-line {
  background: #d9363e1f;
  box-shadow: inset 3px 0 0 #d9363e;
}
html[data-theme='light'] .syn-match {
  outline-color: #5260df99;
  background: #5260df1f;
}
html[data-theme='light'] .syn-unmatched {
  outline-color: #d9363e;
}
html[data-theme='light'] .editor-status {
  color: #7082a0;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --ink: #e1e8f5;
  --muted: #a1b0c8;
  --line: #29364c;
  --cream: #0e1625;
  --white: #172234;
  --sage: #242e4b;
}
html[data-theme='dark'] body {
  background: radial-gradient(ellipse at 65% 0%, #20294b 0, transparent 42%), #0e1625;
  color: #e1e8f5;
}
html[data-theme='dark'] header {
  background: #111c2dee;
  border-color: #263248;
}
html[data-theme='dark'] .brand {
  color: #e3eafb;
}
html[data-theme='dark'] .world-talk,
html[data-theme='dark'] .chat-topic,
html[data-theme='dark'] .chat-avatar,
html[data-theme='dark'] .chat-bubble strong,
html[data-theme='dark'] .chat-questions button {
  color: #9da8ff;
}
html[data-theme='dark'] .from-technician .chat-avatar {
  color: #fff;
}
html[data-theme='dark'] .from-technician .chat-bubble strong {
  color: #ffffffcc;
}
html[data-theme='dark'] .predict-result .correct {
  color: #7fd6a2;
}
html[data-theme='dark'] .predict-result .wrong {
  color: #f0a08c;
}
html[data-theme='dark'] .offline-badge {
  background: #3a2e1b;
  color: #f2c784;
}
html[data-theme='dark'] .day-log-feedback.correct {
  color: #7fd6a2;
}
html[data-theme='dark'] .day-log-feedback.wrong,
html[data-theme='dark'] .day-log-error {
  color: #f0a08c;
}
html[data-theme='dark'] .dash-tile.alert {
  border-color: #f0a08c;
}
html[data-theme='dark'] .dash-tile.alert strong {
  color: #f0a08c;
}
html[data-theme='dark'] .needed-now {
  border-color: #6b5226;
  background: #2c2416;
}
html[data-theme='dark'] .needed-tag,
html[data-theme='dark'] .needed-now > strong,
html[data-theme='dark'] .needed-request small,
html[data-theme='dark'] .situation-line {
  color: #f2c784;
}
html[data-theme='dark'] .needed-request {
  border-color: #5a4626;
}
html[data-theme='dark'] .ac-kind,
html[data-theme='dark'] .ac-signature b {
  color: #9da8ff;
}
html[data-theme='dark'] .ac-kind.ac-keyword {
  color: #e7a6e1;
}
html[data-theme='dark'] .ac-kind.ac-pin {
  color: #7fd6a2;
}
html[data-theme='dark'] .brand-quest {
  color: #9da8ff;
}
html[data-theme='dark'] .brand small,
html[data-theme='dark'] .chapter {
  color: #8d9db8;
}
html[data-theme='dark'] .saved {
  color: #86bda6;
}
html[data-theme='dark'] .xp {
  background: #252e4e;
  color: #abb5ff;
  border-color: #384369;
}
html[data-theme='dark'] .avatar {
  background: #26304e;
  color: #abb5ff;
  border-color: #172234;
  box-shadow: 0 0 0 1px #39435b;
}
html[data-theme='dark'] .icon-btn {
  color: #a6b5cf;
}
html[data-theme='dark'] .icon-btn:hover {
  background: #27334d;
}
html[data-theme='dark'] .rail {
  background: #111b2bcc;
  border-color: #263248;
}
html[data-theme='dark'] .rail-item {
  color: #92a3bf;
}
html[data-theme='dark'] .rail-item.active {
  background: #283250;
  color: #b0baff;
}
html[data-theme='dark'] .rail-item:hover {
  background: #243149;
  color: #c1caff;
}
html[data-theme='dark'] h1,
html[data-theme='dark'] h2,
html[data-theme='dark'] h3 {
  color: #e1e9f8;
}
html[data-theme='dark'] h1 > span {
  color: #9ca8ff;
}
html[data-theme='dark'] .eyebrow {
  color: #9aa9df;
}
html[data-theme='dark'] .travel-heading p,
html[data-theme='dark'] .page-heading p {
  color: #a0afc8;
}
html[data-theme='dark'] .outline {
  background: #1a263bbd;
  color: #b7c5dc;
  border-color: #334159;
}
html[data-theme='dark'] .outline:hover {
  background: #293354;
  border-color: #6471ac;
  color: #d1d7ff;
}
html[data-theme='dark'] #freeExploration,
html[data-theme='dark'] .primary {
  background: #5865d0;
  color: #fff;
  border-color: #5865d0;
}
html[data-theme='dark'] #freeExploration:hover,
html[data-theme='dark'] .primary:hover {
  background: #606cd8;
}
html[data-theme='dark'] .travel-summary > span {
  background: #172234bb;
  color: #a0b0c9;
  border-color: #2b3950;
}
html[data-theme='dark'] .travel-summary strong {
  color: #c6d1e8;
}
html[data-theme='dark'] .panel {
  background: #172234;
  border-color: #2b384e;
  box-shadow: 0 4px 18px #0000000b;
}
html[data-theme='dark'] .destination-panel > .eyebrow {
  color: #98a7d8;
}
html[data-theme='dark'] .travel-select,
html[data-theme='dark'] .board-select,
html[data-theme='dark'] .wiring-row input[type='number'],
html[data-theme='dark'] #clockSpeed,
html[data-theme='dark'] #difficultySelect,
html[data-theme='dark'] .regional-weather select {
  background: #202e43;
  color: #b7c7e0;
  border-color: #35445e;
}
html[data-theme='dark'] .location-choice {
  background: #242f4d;
  border-color: #394775;
  color: #b2bcff;
}
html[data-theme='dark'] .location-choice:hover {
  background: #2d3858;
}
html[data-theme='dark'] .location-choice small {
  color: #9cadd0;
}
html[data-theme='dark'] .location-choice > span {
  color: #a4b1f5;
}
html[data-theme='dark'] .destination-detail h2 {
  color: #e0e9fa;
}
html[data-theme='dark'] .architecture-label {
  color: #bab0d7;
}
html[data-theme='dark'] .destination-description,
html[data-theme='dark'] .request,
html[data-theme='dark'] .guide,
html[data-theme='dark'] .component-card p,
html[data-theme='dark'] .bench-heading p,
html[data-theme='dark'] .weather-readings-note,
html[data-theme='dark'] .destination-missions,
html[data-theme='dark'] .environment > p,
html[data-theme='dark'] .journey-note p,
html[data-theme='dark'] .install-dialog p,
html[data-theme='dark'] .weather-source,
html[data-theme='dark'] .regional-weather .weather-source {
  color: #a1b0c8;
}
html[data-theme='dark'] .travel-label,
html[data-theme='dark'] .env-row label,
html[data-theme='dark'] .toggle-row,
html[data-theme='dark'] .weather-metrics,
html[data-theme='dark'] .regional-weather .weather-metrics,
html[data-theme='dark'] .live-reading,
html[data-theme='dark'] .wiring-row label,
html[data-theme='dark'] .wiring-row small {
  color: #a1b0c8;
}
html[data-theme='dark'] .destination-weather,
html[data-theme='dark'] .weather-readings-note {
  border-color: #2d3b51;
}
html[data-theme='dark'] .weather-title,
html[data-theme='dark'] .destination-weather .weather-title,
html[data-theme='dark'] .weather-main small,
html[data-theme='dark'] .weather-main > span {
  color: #a1b1cb;
}
html[data-theme='dark'] .weather-main strong,
html[data-theme='dark'] .regional-weather .weather-main strong {
  color: #d0e0fa;
}
html[data-theme='dark'] .weather-metrics strong {
  color: #c0d2ee;
}
html[data-theme='dark'] .weather-source a {
  color: #a3b6ff;
}
html[data-theme='dark'] .weather-source.fallback,
html[data-theme='dark'] .hint,
html[data-theme='dark'] .local-mode-note,
html[data-theme='dark'] .debug-card {
  background: #362e23;
  color: #e1c698;
  border-color: #594a34;
}
html[data-theme='dark'] .region-progress {
  color: #a1b2ce;
}
html[data-theme='dark'] .journey-note {
  background: #222e49;
  border-color: #354363;
}
html[data-theme='dark'] .journey-note strong {
  color: #bbc9ee;
}
html[data-theme='dark'] .text-btn {
  color: #a7b8dc;
}
html[data-theme='dark'] .text-btn:hover {
  color: #d2d9ff;
}
html[data-theme='dark'] .panel-bar {
  border-color: #2b384f;
}
html[data-theme='dark'] .tabs button {
  color: #9bacca;
}
html[data-theme='dark'] .world-tabs button.selected {
  background: #2a3655;
  color: #bcc5ff;
}
html[data-theme='dark'] .world-status,
html[data-theme='dark'] .sim-clock {
  color: #a0b0ca;
}
html[data-theme='dark'] .world-footer {
  border-color: #2b384f;
  color: #a0b1cb;
}
html[data-theme='dark'] kbd {
  background: #24334a;
  border-color: #374862;
  color: #bdcde4;
}
html[data-theme='dark'] .mission-number {
  color: #91a2be;
}
html[data-theme='dark'] .mission-number span {
  color: #a4b4d3;
}
html[data-theme='dark'] .mission-card h2 {
  color: #e2eafa;
}
html[data-theme='dark'] .pill {
  background: #2b3655;
  color: #b4beff;
}
html[data-theme='dark'] .quest-meta {
  border-color: #2a384e;
  color: #a5b5cf;
}
html[data-theme='dark'] .quest-meta > span:last-child {
  color: #dcc18a;
}
html[data-theme='dark'] .mission-budget {
  color: #9eb0ce;
}
html[data-theme='dark'] .resident-avatar {
  background: #383530;
}
html[data-theme='dark'] .resident-card strong {
  color: #c2d1e9;
}
html[data-theme='dark'] .resident-card small {
  color: #99acc8;
}
html[data-theme='dark'] .mission-steps {
  border-color: #2d3b51;
}
html[data-theme='dark'] .step {
  color: #9badc8;
}
html[data-theme='dark'] .step i {
  border-color: #41516c;
  color: #9cacc5;
}
html[data-theme='dark'] .step.current {
  color: #b3bdff;
}
html[data-theme='dark'] .step.current i {
  color: #fff;
}
html[data-theme='dark'] .step.complete {
  color: #8ed4bc;
}
html[data-theme='dark'] .step.complete i {
  background: #23473f;
  border-color: #345d52;
  color: #8ed4bc;
}
html[data-theme='dark'] .hint-btn {
  color: #a6b5cf;
}
html[data-theme='dark'] .section-heading h3 {
  color: #c4d1e8;
}
html[data-theme='dark'] .env-row label strong {
  color: #a8baff;
}
html[data-theme='dark'] .range-endpoints {
  color: #90a3c0;
}
html[data-theme='dark'] .practice-scenario-label,
html[data-theme='dark'] #weatherClockSource {
  color: #a0b0ca;
}
html[data-theme='dark'] .bench-tabs button.selected {
  color: #b8c3ff;
}
html[data-theme='dark'] .bench-tabs .count {
  background: #2b3655;
  color: #b5c2ff;
}
html[data-theme='dark'] #advancedTools {
  color: #a7b8d7;
  border-color: #3a4864;
}
html[data-theme='dark'] .live-panel {
  background: #172234;
}
html[data-theme='dark'] .live-title,
html[data-theme='dark'] .serial-title {
  color: #bdcde5;
}
html[data-theme='dark'] .live-title > span:last-child,
html[data-theme='dark'] .live-panel > p,
html[data-theme='dark'] .serial pre {
  color: #a0b1cd;
}
html[data-theme='dark'] .live-reading strong {
  color: #b6ccf7;
}
html[data-theme='dark'] .output-state {
  background: #2b3950;
  color: #adbed9 !important;
}
html[data-theme='dark'] .output-state.on {
  background: #24473c;
  color: #93d7b9 !important;
}
html[data-theme='dark'] .serial {
  border-color: #2b3c54;
}
html[data-theme='dark'] .serial pre.error {
  color: #f4a998;
}
html[data-theme='dark'] .bench-heading h3 {
  color: #c8d8ef;
}
html[data-theme='dark'] .component-card,
html[data-theme='dark'] .component-card.required {
  background: #1b293f;
  border-color: #334561;
}
html[data-theme='dark'] .component-icon {
  background: #2b3657;
  color: #a9bafd;
}
html[data-theme='dark'] .component-card h4 {
  color: #ccdbf2;
}
html[data-theme='dark'] .component-card .component-label {
  color: #a6b7d9;
}
html[data-theme='dark'] .component-card button {
  color: #bac9ff;
  background: #2d3b60;
}
html[data-theme='dark'] .component-card button:hover {
  background: #37476d;
}
html[data-theme='dark'] .installed-badge,
html[data-theme='dark'] .wire-good {
  color: #8bceb2;
}
html[data-theme='dark'] .board-card {
  background: #202f45;
}
html[data-theme='dark'] .board-card p {
  color: #adbed9;
}
html[data-theme='dark'] .wiring-row,
html[data-theme='dark'] .test-row {
  border-color: #2e405a;
}
html[data-theme='dark'] .wiring-row strong {
  color: #c0d2ee;
}
html[data-theme='dark'] .wire-error,
html[data-theme='dark'] .test-summary.fail,
html[data-theme='dark'] .test-row .failed {
  background: #3b2d29;
  color: #edba9a;
}
html[data-theme='dark'] .test-summary,
html[data-theme='dark'] .test-row .passed {
  background: #244239;
  color: #9ed5b8;
}
html[data-theme='dark'] .test-row small {
  color: #a3b6d1;
}
html[data-theme='dark'] .empty-bench {
  color: #a5b8d5;
}
html[data-theme='dark'] .fault-card {
  background: #202e47;
  border-color: #344562;
}
html[data-theme='dark'] .fault-card:hover {
  background: #293959;
  border-color: #5f76b1;
}
html[data-theme='dark'] .fault-card strong {
  color: #b8ccf5;
}
html[data-theme='dark'] .fault-card small {
  color: #a7b9d7;
}
html[data-theme='dark'] .fault-card > span {
  color: #d4bc8f;
}
html[data-theme='dark'] .circuit-row {
  color: #a4b8d7;
  border-color: #32425b;
}
html[data-theme='dark'] .circuit-row.selected {
  background: #293653;
}
html[data-theme='dark'] .circuit-row strong {
  color: #c4d6ef;
}
html[data-theme='dark'] .circuit-row code {
  color: #a4c3f6;
}
html[data-theme='dark'] .circuit-selection {
  color: #b0c4e5;
}
html[data-theme='dark'] .circuit-selection pre,
html[data-theme='dark'] .guide pre,
html[data-theme='dark'] #networkStatus,
html[data-theme='dark'] #debugVariables {
  background: #101c2e;
  color: #a4bedf;
}
html[data-theme='dark'] .resource-totals > div {
  background: #1d2b42;
  border-color: #334562;
}
html[data-theme='dark'] .resource-totals small {
  color: #a5bad9;
}
html[data-theme='dark'] .resource-totals strong {
  color: #b8d0f8;
}
html[data-theme='dark'] #resourceHistory td,
html[data-theme='dark'] #resourceHistory th,
html[data-theme='dark'] .teacher-report td,
html[data-theme='dark'] .teacher-report th {
  border-color: #33435b;
}
html[data-theme='dark'] .export-contents {
  color: #b1c5e6;
}
html[data-theme='dark'] .tools-grid button {
  background: #273652;
  color: #b5cbef;
}
html[data-theme='dark'] .advanced-form label {
  color: #a2b6d4;
}
html[data-theme='dark'] .advanced-form select,
html[data-theme='dark'] .advanced-form input,
html[data-theme='dark'] .network-editors textarea,
html[data-theme='dark'] .setting-row input[type='text'],
html[data-theme='dark'] .install-dialog select {
  color: #bbceed;
  background: #202e46;
  border-color: #394a68;
}
html[data-theme='dark'] .network-editors label {
  color: #adc1dc;
}
html[data-theme='dark'] .app-footer {
  color: #90a4c1;
}
html[data-theme='dark'] dialog {
  background: #172234;
  color: #b2c5e1;
  border-color: #38465e;
}
html[data-theme='dark'] .dialog-top h2,
html[data-theme='dark'] .guide h3 {
  color: #c6d8f4;
}
html[data-theme='dark'] .guide code {
  background: #2a3855;
  color: #b4c9ef;
}
html[data-theme='dark'] .quest-option,
html[data-theme='dark'] .setting-row {
  border-color: #34435b;
}
html[data-theme='dark'] .quest-option.selected {
  background: #293752;
}
html[data-theme='dark'] .quest-option strong {
  color: #bfcef0;
}
html[data-theme='dark'] .quest-option small,
html[data-theme='dark'] .setting-row small {
  color: #9eb2d2;
}
html[data-theme='dark'] .badge {
  background: #25334e;
  color: #b2c8ec;
}
html[data-theme='dark'] .badge small {
  color: #a0b5d5;
}
html[data-theme='dark'] .simulation-column .live-panel {
  border-color: #2c3b53;
}
@media (max-width: 600px) {
  html[data-theme='dark'] .rail {
    background: #111b2bf5;
  }
  .header-actions {
    gap: 5px;
  }
  .theme-toggle {
    width: 29px;
    font-size: 19px;
  }
}
@media (max-width: 380px) {
  header {
    padding-left: 12px;
    padding-right: 12px;
  }
  .header-actions {
    gap: 2px;
  }
  .header-actions .icon-btn {
    width: 26px;
  }
  .brand {
    font-size: 20px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
  }
  .brand {
    gap: 6px;
  }
}
html[data-theme='light'] .editor-actions .primary:hover {
  background: #424fc6;
  color: #fff;
}
html[data-theme='dark'] .editor-main,
html[data-theme='dark'] .simulation-column .editor-main {
  border-color: #2c3b53;
}
html[data-theme='light'] .plotter {
  --plot-1: #2a78d6;
  --plot-2: #eb6834;
  --plot-3: #1baf7a;
  --plot-4: #eda100;
  --plot-5: #e87ba4;
  --plot-6: #008300;
  --plot-7: #4a3aa7;
  --plot-8: #e34948;
  --plot-surface: #fafbff;
  --plot-text: #3d506c;
  --plot-muted: #7082a0;
  --plot-grid: #dfe5f0;
  --plot-track: #eef1f8;
  --plot-threshold: #3d506cb3;
  --plot-crosshair: #3d506c55;
  --plot-on: #5260df;
  --plot-input: #8593aa;
  border-top-color: #e1e7f2;
}
html[data-theme='light'] .plot-tooltip {
  background: #fff;
  box-shadow: 0 6px 18px #3d506c22;
}
html[data-theme='light'] .editor-main {
  --diag-warning: #b26b00;
  --diag-info: #2a6fd6;
}
html[data-theme='light'] .diag-message,
html[data-theme='light'] .diag-panel {
  color: #3d506c;
  background: #f0f3fa;
  border-top-color: #e1e7f2;
}
html[data-theme='light'] .diag-item {
  color: #3d506c;
}
html[data-theme='light'] .diag-item:hover,
html[data-theme='light'] .diag-item:focus-visible {
  background: #e4eafa;
}
html[data-theme='light'] .diag-item span {
  color: #7082a0;
}
html[data-theme='light'] .diag-summary {
  border-color: #dce3f0;
}
html[data-theme='light'] .diag-summary.has-warnings {
  border-color: var(--diag-warning);
}
html[data-theme='light'] .hunt-banner {
  color: #3d506c;
  background: #f0f3fa;
  border-bottom-color: #e1e7f2;
}
html[data-theme='light'] .hunt-results li span,
html[data-theme='light'] .hunt-results em {
  color: #7082a0;
}
html[data-theme='light'] .hunt-results li.found span {
  color: #18794e;
}
html[data-theme='light'] .hunt-results li.missed span {
  color: #b26b00;
}
html[data-theme='light'] .code-line.hunt-flag,
html[data-theme='light'] .code-line.hunt-missed {
  background: #b26b001a;
  box-shadow: inset 3px 0 0 #b26b00;
}
html[data-theme='light'] .code-line.hunt-found {
  background: #18794e14;
  box-shadow: inset 3px 0 0 #18794e;
}
html[data-theme='dark'] .layout-switch {
  background: #1a263bbd;
  border-color: #334159;
}
html[data-theme='dark'] .layout-switch button {
  color: #9fb0cc;
}
html[data-theme='dark'] .layout-switch button[aria-pressed='true'] {
  color: #d1d7ff;
  background: #293354;
}
html[data-theme='dark'] .destination-panel .enter-location {
  box-shadow: 0 -14px 14px #172234;
}
html[data-theme='dark'] .split-handle::after {
  background: #334159;
}
html[data-theme='dark'] .split-handle:focus-visible {
  outline-color: #8d9bff;
}
html[data-theme='dark'] .split-handle:hover::after,
html[data-theme='dark'] .split-handle:focus-visible::after,
html[data-theme='dark'] .split-handle.dragging::after {
  background: #7d8ef4;
}
html[data-theme='dark'] .day-toggle {
  background: #1a263b;
  border-color: #334159;
}
html[data-theme='dark'] .day-toggle[aria-pressed='true'] {
  background: #0e1526;
  border-color: #46557a;
}
