/* Last stylesheet: presentation only. Light mode inherits the existing classroom UI. */
#themeToggle{display:inline-flex!important;align-items:center;justify-content:center;min-height:42px;min-width:118px;white-space:nowrap;gap:8px;flex-shrink:0;color:#f0f7ff;background:#173454;border:1px solid #55718f}
#themeToggle:hover:not(:disabled){background:#254766;border-color:#8cb6da;color:#fff}
#themeToggle:focus-visible{outline:3px solid #67e8f9;outline-offset:3px;box-shadow:none}
@media screen{
 html[data-color-mode=dark]{color-scheme:dark;--color-background:#0b1220;--color-surface:#14223a;--color-surface-muted:#1b2c47;--color-header:#0b162c;--color-text:#edf4ff;--color-text-secondary:#b2c3d9;--color-border:#344b68;--color-primary:#22d3ee;--color-primary-hover:#67e8f9;--color-primary-light:#183e50;--color-secondary:#2dd4bf;--color-secondary-light:#133b3b;--color-accent:#c4b5fd;--color-accent-light:#30274b;--color-success:#5eead4;--color-warning:#fbbf24;--color-danger:#fb7185;--color-info:#67e8f9;--color-focus:#67e8f9;--ink:var(--color-text);--muted:var(--color-text-secondary);--paper:var(--color-background);--line:var(--color-border);--ui-shadow:0 6px 22px #0003;background:var(--color-background);color:var(--color-text)}
 html[data-color-mode=dark] body{background:var(--color-background);color:var(--color-text)}
 html[data-color-mode=dark] body>header{background:var(--color-header);border-bottom:1px solid var(--color-border)}
 html[data-color-mode=dark] #brand .logo{background:#22d3ee;color:#082637;box-shadow:none}
 html[data-color-mode=dark] #brand :is(strong,b){color:#f1f7ff}
 html[data-color-mode=dark] #brand small{color:#b2c3d9}
 html[data-color-mode=dark] header nav :is(button,a){color:#dceaff;border-color:#405a78}
 html[data-color-mode=dark] header nav :is(button,a):hover{background:#213b5c;color:#fff}
 html[data-color-mode=dark] .module-nav a[aria-current=page]{background:#22d3ee;color:#082637;box-shadow:none}
 html[data-color-mode=dark] #themeToggle{background:#183e50;color:#a5f3fc;border-color:#398a9c}
 html[data-color-mode=dark] a{color:#a5f3fc}
 html[data-color-mode=dark] :is(h1,h2,h3,h4,legend){color:var(--color-text)}
 html[data-color-mode=dark] :is(.intro,.lab-breadcrumb,.lab-title p,.card-body p,.card-body small,.home-meta,.section-title>span,.track-card p,.mini-card p,.line-mini-cards p,.strategy-cards p,footer p,footer small){color:var(--color-text-secondary)}
 html[data-color-mode=dark] :is(.eyebrow,.lab-title .eyebrow,.hero-accent,.hero-dot,footer>span){color:#67e8f9}
 html[data-color-mode=dark] .nkw-hero-copy>.eyebrow{background:#183e50;color:#a5f3fc;border-color:#398a9c}
 html[data-color-mode=dark] :is(.nkw-hero-visual,.card,.card-body,.line-card .card-body,.sumo-card .card-body,.lab-title,.project-bar,.editor-panel,.sim-panel,.panel,.mini-scenarios,.line-learning-panel,.learning-sheet,.match-panel,.analysis-panel,.research-panel,.team-card,.track-card,.mission,.mini-card,.line-mini-cards article,.strategy-cards article,.rescue-quality fieldset){background:var(--color-surface);border-color:var(--color-border);color:var(--color-text)}
 html[data-color-mode=dark] .nkw-hero-visual-top{background:#1b2c47;color:#dceaff}
 html[data-color-mode=dark] .nkw-hero-visual-bottom{background:#0b162c}
 html[data-color-mode=dark] .nkw-ready-dot{background:#133b3b;color:#99f6e4}
 html[data-color-mode=dark] .home-meta b{background:#183e50;color:#a5f3fc}
 html[data-color-mode=dark] .card-photo{border-color:#22d3ee}
 html[data-color-mode=dark] #lab :is(.panel>.panel-head,.panel-head,.example-bar,.layout-bar,.sim-camera-toolbar,.sim-options,.sim-statusbar,.editor-bottom,.drive-info,.team-card-head,.execution-banner,.debug-step,.line-debug,.team-editor-tabs,.sensor-range-controls,.rescue-sensor-state){background:#182a44;border-color:var(--color-border);color:var(--color-text)}
 html[data-color-mode=dark] #lab :is(.editor-panel,.sim-panel)>.panel-head{background:#1b3153;border-top-color:#22d3ee;color:#e5f7ff}
 html[data-color-mode=dark] #lab .panel-head :is(strong,.tiny,span,label){color:#dceaff!important}
 html[data-color-mode=dark] #lab :is(.tiny,.sensor-note,.control-group-label,.view-label,.sim-options .debug,.sim-options .overlay-controls,.sim-options .view-label span,.team-card small,.sensor-range-controls small,.matrix-fields small,#saved,#opponentEditorNote,#scenarioNote,.team-decision,.replay-events small,.analysis-evidence small,#dialogBody p){color:var(--color-text-secondary)}
 html[data-color-mode=dark] :is(button,#lab button){background:#233753;border-color:#54708f;color:#edf4ff;box-shadow:none}
 html[data-color-mode=dark] :is(button,#lab button):hover:not(:disabled){background:#304b6d;border-color:#67e8f9;color:#fff}
 html[data-color-mode=dark] :is(.primary,#lab .primary,.card .primary,.line-card .primary,.sumo-card .primary,#lab #simulationControls #run,#lab .project-bar #save,#lab #robustRun,#lab #rescueStudyRun,#lab #batchStart){background:#22d3ee;border-color:#22d3ee;color:#082637;box-shadow:none}
 html[data-color-mode=dark] :is(.primary,#lab .primary,.card .primary,#lab #simulationControls #run,#lab .project-bar #save):hover:not(:disabled){background:#67e8f9;border-color:#67e8f9;color:#082637}
 html[data-color-mode=dark] .wide span{color:inherit}
 html[data-color-mode=dark] #lab #simulationControls{background:var(--color-surface);border-color:var(--color-border);border-top-color:#22d3ee}
 html[data-color-mode=dark] #lab #simulationControls :is(label,output){color:var(--color-text-secondary)}
 html[data-color-mode=dark] #lab #simulationControls #pause{background:#fbbf24;color:#382306;border-color:#fbbf24}
 html[data-color-mode=dark] #lab #simulationControls #stop{background:#be123c;color:#fff;border-color:#fb7185}
 html[data-color-mode=dark] #lab #simulationControls #reset{background:#233753;color:#edf4ff;border-color:#54708f}
 html[data-color-mode=dark] :is(button,#lab button,#lab #simulationControls button):disabled{background:#1a293e!important;color:#8fa2b9!important;border-color:#344b68!important;box-shadow:none;cursor:not-allowed}
 html[data-color-mode=dark] :is(#lab,#dialogBody) :is(input:not(.blocklyHtmlInput):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),select,textarea){background:#101e33;color:#edf4ff;border-color:#54708f}
 html[data-color-mode=dark] #lab label{color:#b2c3d9}
 html[data-color-mode=dark] :is(input,textarea)::placeholder{color:#a6b7cc}
 html[data-color-mode=dark] :is(input[type=checkbox],input[type=radio],input[type=range],progress){accent-color:#22d3ee}
 html[data-color-mode=dark] #lab :is(.title-tools button,#loadExample,#scenarioStarter,#lineMiniStarter,.panel-head button){background:#233753;color:#edf4ff;border-color:#54708f}
 html[data-color-mode=dark] #lab :is(.selected,[aria-selected=true],.sim-camera-toolbar .view-buttons .selected,.team-editor-tabs button.selected,.team-editor-tabs #showB.selected){background:#183e50;color:#a5f3fc;border-color:#67e8f9}
 html[data-color-mode=dark] #lab :is(.telemetry,.stats>div,.sensor,.sensor:nth-child(n),.team-motors span,.team-edge span,.team-opponent span,.cal-pair,.timing-checks){background:#14223a;color:#c1d1e5;border-color:var(--color-border)}
 html[data-color-mode=dark] #lab :is(.telemetry strong,.stats strong,.stats>div:nth-child(n) strong,.sensor strong,.sensor:nth-child(n) strong,.drive-info b,.team-motors b,.team-card-head strong,.sensor-range-controls output,.execution-banner strong,.line-debug strong,.debug-step strong,.team-decision strong,.match-panel #matchStatus>b){color:#f0f8ff}
 html[data-color-mode=dark] #lab :is(.sensor.on,.team-card .detected,.rescue-missions>span.complete){background:#133b3b;color:#99f6e4;border-color:#388c7f}
 html[data-color-mode=dark] #lab .sim-statusbar :is(.state,[data-ui-state=ready],[data-ui-state=running],[data-ui-state=finished]){background:#133b3b;color:#99f6e4;border-color:#388c7f}
 html[data-color-mode=dark] #lab .sim-statusbar [data-ui-state=paused]{background:#473611;color:#fde68a;border-color:#967026}
 html[data-color-mode=dark] #lab .sim-statusbar [data-ui-state=error]{background:#4c1b2d;color:#fecdd3;border-color:#b95873}
 html[data-color-mode=dark] #lab .sim-statusbar [data-ui-state=stopped]{background:#24334a;color:#d5e0ef;border-color:#54708f}
 html[data-color-mode=dark] #lab .sim-statusbar [data-ui-state=replay]{background:#342650;color:#e9d5ff;border-color:#9978c5}
 html[data-color-mode=dark] #lab :is(.advanced-tools,.advanced-tools>summary){background:#14223a;color:#e2ecfa;border-color:var(--color-border)}
 html[data-color-mode=dark] #lab .advanced-hint{color:#b2c3d9}
 html[data-color-mode=dark] :is(.notice,#lab>.notice,.analysis-evidence article,.rescue-issues article){background:#30291a;color:#fce3ab;border-color:#806236;border-left-color:#fbbf24}
 html[data-color-mode=dark] :is(th,.event,.team-card-head){background:#182a44;color:#dceaff;border-color:var(--color-border)}
 html[data-color-mode=dark] :is(td,fieldset,.event small){color:var(--color-text-secondary);border-color:var(--color-border)}
 html[data-color-mode=dark] :is(.event time,.replay-events time){color:#67e8f9}
 html[data-color-mode=dark] dialog{background:#14223a;color:#edf4ff;border-color:#54708f}
 html[data-color-mode=dark] .dialog-top{background:#0b162c;color:#edf4ff;border-color:var(--color-border)}
 html[data-color-mode=dark] #dialogBody p{color:#b2c3d9}
 html[data-color-mode=dark] :is(.code-panel,#dialogBody pre){background:#0b162c;color:#e2ecfa}
 html[data-color-mode=dark] #toast{background:#243b58;color:#fff;border:1px solid #54708f}
 html[data-color-mode=dark] :is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #67e8f9;outline-offset:3px;box-shadow:none}
 /* Keep Blockly and data graphics legible in their original palette. No SVG/canvas filters. */
 html[data-color-mode=dark] :is(#blockly,.blocklyWidgetDiv,.blocklyDropDownDiv,.blocklyToolboxDiv){color-scheme:light}
 html[data-color-mode=dark] #blockly{background:#fff}
 html[data-color-mode=dark] .chart-grid figure{background:#fff;color:#172033}
 html[data-color-mode=dark] .chart-grid figcaption{color:#475569}
}
@media(max-width:600px){header nav #themeToggle{display:inline-flex!important;min-width:118px;min-height:42px}}
@media print{
 html[data-color-mode=dark]{color-scheme:light;--color-background:#fff;--color-surface:#fff;--color-surface-muted:#eef3fa;--color-text:#172033;--color-text-secondary:#475569;--color-border:#dce4f0;--color-header:#071a33;--ink:#172033;--paper:#fff;--muted:#475569;--line:#dce4f0;background:#fff;color:#172033}
 #themeToggle,#themeAnnouncement{display:none!important}
}
