/* Workshop visual system — a focused, graphite IDE, not a dashboard.
   The browser owns behavior; this layer only owns the visual language.
   UI chrome, source editor and status colors deliberately remain separate. */
:root {
  color-scheme: dark;
  --bg: #1b1d20;
  --panel: #24262a;
  --deep: #1f2023;
  --line: #393c42;
  --text: #dfe1e5;
  --muted: #a0a4ad;
  --cyan: #9bbcff;
  --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --sans: 'Segoe UI Variable Text', 'Segoe UI', 'Microsoft YaHei UI', sans-serif;
  --chrome: #24262a;
  --chrome-deep: #202226;
  --surface: #292b2f;
  --surface-raised: #303338;
  --source: #1f2023;
  --edge: #404349;
  --edge-strong: #555a63;
  --ink: #dfe1e5;
  --secondary: #9da0a8;
  --blue: #3574f0;
  --blue-soft: #253356;
  --java: #e5b17e;
  --ok: #7dc387;
  --warn: #d8b26e;
  --fault: #f28b82;
  --action-ink: #e9edf5;
  --action-muted: #a5abb7;
  --action-blue: #9bbcff;
  --action-line: #555e6b;
  --action-prep: #e6c087;
  --action-live: #90d7a5;
  --action-fault: #ffaaa3;
  --ui-ease: cubic-bezier(.2, .75, .25, 1);
}

html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); font: 13px/1.55 var(--sans); }
button, input, select, textarea { font-family: var(--sans); }
button, input, select, .file-button { border-radius: 4px; }
button, .file-button {
  min-height: 30px;
  border: 1px solid var(--edge-strong);
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: inset 0 1px #ffffff08;
  padding: 5px 11px;
  line-height: 1.4;
}
button:hover:not(:disabled), .file-button:hover { background: #3a3d43; border-color: #757b86; }
button:active:not(:disabled) { background: #292d33; box-shadow: inset 0 1px 3px #0004; }
button:disabled { color: #858991; border-color: #45474c; background: #2d2f33; opacity: 1; }
button.primary, .model-library #model-import, .model-library #model-bind,
.model-library #model-quick-apply, .tuner-panel button.primary {
  border-color: #3977ec; background: var(--blue); color: #fff; font-weight: 550;
}
button.primary:hover:not(:disabled), .model-library #model-import:hover:not(:disabled),
.model-library #model-bind:hover:not(:disabled), .model-library #model-quick-apply:hover:not(:disabled),
.tuner-panel button.primary:hover:not(:disabled) { background: #4682f4; border-color: #6194f7; }
button.primary:disabled { color: #aab4c5; background: #2b3850; border-color: #3b4b67; }
button.danger { border-color: #86504f; background: #482e30; color: #ffc5bf; }
input:not([type=checkbox]):not([type=range]), select {
  min-height: 30px; background-color: #222428; border: 1px solid #4a4e55; color: var(--ink);
}
input:not([type=checkbox]):not([type=range]):hover:not(:disabled), select:hover:not(:disabled) {
  border-color: #747b88; background-color: #2a2d33;
}
input[type=checkbox], input[type=range] { accent-color: var(--blue); }
input:disabled, select:disabled { color: #858a95; border-color: #3e4147; background-color: #292b2f; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
summary:focus-visible, .file-button:focus-within {
  outline: 2px solid #8eb5ff; outline-offset: 2px; box-shadow: 0 0 0 3px #3574f026;
}
::selection { background: #214283; }
* { scrollbar-width: thin; scrollbar-color: #5a5e66 transparent; }

/* Main IDE title bar: compact navigation, one restrained brand accent. */
body > header {
  position: relative; z-index: 10; min-height: 54px; gap: 24px; padding: 7px 20px;
  background: var(--chrome); border-bottom: 1px solid #3b3e44; box-shadow: 0 1px 5px #0003;
}
.brand { gap: 10px; color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.brand small { margin-top: 1px; color: var(--secondary); font-size: 9px; letter-spacing: .2px; font-weight: 400; }
.brand-mark {
  width: 32px; height: 32px; border: 1px solid #4d76bd; border-radius: 5px;
  background: #294273; color: #eef4ff; font: 600 19px/1 var(--mono);
  box-shadow: inset 0 -3px #79a5ff; text-shadow: 0 1px 2px #14213a;
}
.workspace-pages { align-self: stretch; gap: 18px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.workspace-pages a {
  display: flex; align-items: center; position: relative; padding: 3px 1px; border: 0;
  border-radius: 0; color: var(--secondary); font-size: 12px; white-space: nowrap;
}
.workspace-pages a:hover { background: transparent; color: var(--ink); }
.workspace-pages a[aria-current=page] { color: #f0f3fa; background: transparent; box-shadow: inset 0 -2px #82acff; }
#environment { max-width: 340px; margin-left: auto; color: var(--secondary); font-size: 10px; line-height: 1.5; }
#environment::before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0; border-radius: 50%; background: #86aef7; }
body > header > a:last-child { margin-left: 0; font-size: 10px; color: var(--secondary); }

main { grid-template-columns: 190px minmax(0, 1fr); gap: 0 14px; padding: 0 14px 12px; }
.intro { padding: 16px 2px 14px; gap: 18px; }
.intro h1 { font-size: 19px; line-height: 1.35; font-weight: 600; letter-spacing: -.015em; }
.intro h1::before { content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 9px 2px 1px; background: var(--blue); border-radius: 1px; }
.intro p:not(.eyebrow) { margin: 4px 0 0 17px; color: var(--secondary); font-size: 11px; }
.project-actions { gap: 6px; }
.project-actions button, .project-actions .file-button { min-height: 28px; padding: 4px 9px; font-size: 11px; }
#export-project::before, .file-button::before { margin-right: 6px; color: #b8c6de; font: 14px/1 var(--mono); }
#export-project::before { content: '⇩'; }
.file-button::before { content: '⇧'; }
.project-actions > label:not(.file-button) { color: var(--secondary); font-size: 11px; }
#notice { margin: 0 0 10px; padding: 8px 11px; border-left: 2px solid #6796e9; background: #222b3b; color: #c0d6ff; font-size: 11px; }
#error-banner { padding: 10px 12px; border-color: #875453; border-radius: 4px; background: #39282b; color: #ffc2bb; font-size: 12px; }

/* Project tool window. Mechanisms are navigational nodes, not feature cards. */
#module-nav {
  gap: 1px; padding: 7px 5px; top: 10px; max-height: calc(100dvh - 20px); overflow-y: auto;
  background: var(--chrome-deep); border: 1px solid var(--line); border-radius: 5px;
}
#module-nav::before {
  content: '项目 / 机构'; padding: 5px 8px 11px; margin-bottom: 5px; border-color: var(--line);
  color: #c7cbd3; font-size: 11px; font-weight: 600;
}
#module-nav > button {
  min-height: 42px; padding: 6px 7px 6px 29px; border: 0; border-radius: 3px;
  background: transparent; color: #c9cdd5; font-size: 12px; line-height: 1.35; box-shadow: none;
}
#module-nav > button::before {
  content: ''; left: 10px; top: 12px; width: 9px; height: 9px;
  border: 1px solid #8b929f; border-radius: 2px; background: #343941; color: transparent;
}
#module-nav > button::after { content: ''; position: absolute; left: 13px; top: 15px; width: 3px; height: 3px; background: #a2adbd; }
#module-nav > button:hover:not(:disabled) { background: #30343c; color: #fff; }
#module-nav > button[aria-pressed=true] { background: var(--blue-soft); color: #edf3ff; box-shadow: inset 2px 0 #77a5ff; }
#module-nav > button[aria-pressed=true]::before { content: ''; border-color: #91b4fa; background: #3b568c; }
#module-nav > button[aria-pressed=true]::after { background: #c5d9ff; }
#module-nav small { margin: 0 0 1px; color: #858e9c; font: 8px/1.4 var(--mono); letter-spacing: .4px; }
#module-nav span { margin-top: 1px; color: #939aa6; font-size: 10px; }
#module-nav > button[aria-pressed=true] small, #module-nav > button[aria-pressed=true] span { color: #b8c9e9; }
#ide-files { padding-top: 7px; margin-top: 6px; border-color: var(--line); }
#ide-files p { color: var(--secondary); font-size: 10px; }
#ide-files button { padding: 5px 8px; color: #b9bfca; font-size: 10px; }
#ide-files button::before { color: var(--java); }
#ide-files button[aria-pressed=true] { background: var(--blue-soft); color: #e0ebff; }

/* Neutral tool windows keep code and measurements visually dominant. */
.workbench { grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); gap: 12px; }
.panel {
  padding: 14px; border: 1px solid var(--edge); border-radius: 5px; background: var(--surface);
  box-shadow: 0 1px 2px #0002;
}
.editor-panel, .visual-panel, .config-panel, .tuner-panel { background: var(--surface); border-color: var(--edge); }
.config-panel, .tuner-panel { align-self: stretch; }
.tuner-panel { border-top: 1px solid var(--edge); }
.panel-heading { margin-bottom: 12px; gap: 8px; }
.panel-heading h2, .panel h2 { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.panel-heading .eyebrow { margin: 0 0 2px; color: #959ba7; font: 8px/1.4 var(--mono); letter-spacing: .45px; }
.badge, #session-status {
  padding: 3px 7px; border: 1px solid #4a4f58; border-radius: 3px; background: #23262b;
  color: #b6bdc9; font: 9px/1.5 var(--mono);
}
#session-status { border-color: transparent; background: transparent; }
#session-status::before { width: 5px; height: 5px; }
#session-status[data-status=idle] { color: #9ca3af; }
#session-status[data-status=running] { border-color: #416d50; background: #233a2b; }
#session-status[data-status=failed] { border-color: #844d4a; background: #40292b; }

/* Editor: familiar JetBrains source colors and quiet surrounding chrome. */
.editor-panel > .panel-heading { padding-bottom: 10px; border-color: var(--line); }
.editor-panel .badge { color: #c8b291; border-color: #5e5345; background: #2b2926; }
.example-row { padding-bottom: 5px; }
.example-row select { min-height: 30px; font-size: 11px; }
.code-source-toolbar { margin: 6px 0; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
#code-format { color: var(--java); }
#code-format::before { content: 'J'; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 6px; border: 1px solid #786049; border-radius: 2px; font: 9px var(--mono); }
.code-source-toolbar select { min-height: 26px; border-color: transparent; background-color: transparent; color: #aeb5c2; font-size: 10px; }
.editor-hint { margin: 8px 0 10px; color: #9da3af; font-size: 10px; }
.editor-wrap { grid-template-columns: 42px minmax(0, 1fr); border: 1px solid #42454b; border-radius: 3px; background: var(--source); }
.editor-wrap:focus-within { border-color: #6295f1; box-shadow: 0 0 0 1px #3574f033; }
.code-surface { background: var(--source); }
#code-editor, #code-highlight, #line-numbers { font: 13px/24px var(--mono); }
#code-editor { caret-color: #f0f3f8; }
#code-editor::selection { background: #214283; color: #f2f4f8; -webkit-text-fill-color: #f2f4f8; }
#line-numbers { background: #1d1f22; border-right: 1px solid #303237; color: #747981; }
#editor-active-line { background: #26282d; }
.editor-wrap:not(:focus-within) #editor-active-line { background: #232529; }
.editor-footer { min-height: 29px; padding: 6px 3px; border-color: var(--line); color: #8f97a5; font-size: 9px; }
#editor-position { color: #bdc7d8; }
.code-tabs { background: #222428; border-color: var(--line); }
.code-tabs button { min-height: 30px; padding: 6px 11px; color: #a8afbb; }
.code-tabs button::before { color: var(--java); }
.code-tabs button:hover:not(:disabled) { background: #32363e; }
.code-tabs button[aria-pressed=true] { background: #2e3441; border-bottom-color: #79a6ff; color: #eef3ff; }
.api-help { border-color: var(--line); }
.api-help summary { color: #a7bddf; font-size: 11px; }
.api-help ul { color: #b2bdcd; font-size: 11px; }
#diagnostics { color: #f3a49c; font-size: 11px; }

/* Preview is an instrument panel: quiet chrome, legible measured values. */
.camera-toolbar { gap: 7px; margin-bottom: 10px; font-size: 10px; }
.camera-toolbar select, .camera-toolbar button { min-height: 27px; padding-top: 3px; padding-bottom: 3px; font-size: 10px; }
.camera-toolbar small { color: #9099a7; font-size: 10px; }
.viewport { height: 320px; border: 1px solid #444a53; border-radius: 3px; background: #182028; }
#workshop-canvas { border-radius: 3px; }
#preview-label { top: 10px; left: 10px; padding: 3px 6px; border: 1px solid #4b5c6b; border-radius: 3px; background: #202a33e8; color: #c0d6e5; font-size: 10px; }
.axis-key { color: #8594a4; font-size: 9px; }
.model-picker { padding: 9px 10px; margin-bottom: 10px; border-color: var(--edge); border-radius: 3px; background: #24272c; }
.model-picker > strong { font-size: 11px; font-weight: 600; }
.model-picker-fields { gap: 7px; margin: 6px 0; }
.model-picker label, .model-picker p, .model-picker small { color: #9fa7b4; font-size: 10px; }
.model-picker select { min-height: 28px; font-size: 10px; }
.model-picker-actions button, .model-picker-actions a { font-size: 10px; }
.connection-strip { gap: 7px; margin: 10px 0 0; padding: 8px; border: 1px solid #363b42; border-radius: 3px; background: #22252a; color: #939ca9; font-size: 10px; }
.connection-strip strong { color: #c4cdd9; font-size: 10px; }
.motor-dot, .sensor-dot { width: 6px; height: 6px; }
.timeline-row { padding: 10px 0; border-color: var(--line); }
.timeline-row button { min-height: 25px; font-size: 9px; }
.timeline-row output { color: #a4adba; font-size: 9px; }
.metrics { gap: 12px; padding: 12px 0; border-color: var(--line); }
.metrics > div { border-color: #41464f; }
.metrics span { color: #9ea6b3; font-size: 10px; }
.metrics strong { color: #e0e6ef; font-size: 18px; font-weight: 500; }
.chart-heading { color: #c6cdd8; font-size: 10px; }
.chart-heading small { color: #929ba8; font-size: 9px; }
#telemetry-chart { height: 82px; }
.model-note { padding-top: 9px; border-color: var(--line); color: #979fab; font-size: 10px; }

/* Configuration and device tools share one neutral selection language. */
.field, .input-field { color: #aeb4bf; font-size: 10px; }
.field input, .field select, .input-field input { font-size: 11px; }
.field-grid, .input-fields { gap: 10px; }
.module-config summary { color: #d2d7df; font-size: 12px; }
.input-module { border-color: var(--line); }
.input-module h3 { color: #bccce3; font-size: 11px; }
.tuner-devices { gap: 4px; }
.tuner-devices button { min-height: 27px; padding: 4px 8px; border: 1px solid #494e55; font-size: 10px; }
.tuner-devices button[aria-pressed=true] { border-color: #648ddd; background: var(--blue-soft); color: #e1ecff; }
.tuner-device-header { padding: 9px 10px; border: 1px solid #3c4148; border-radius: 3px; background: #22252a; }
.tuner-device-header strong { font-size: 11px; }
.tuner-tabs { border-color: var(--line); }
.tuner-tabs button { min-height: 30px; color: #a9b0bc; font-size: 11px; }
.tuner-tabs button:hover:not(:disabled) { background: #343840; }
.tuner-tabs button[aria-selected=true] { background: #2e3441; border-bottom-color: #79a6ff; color: #e1ebff; }
.tuner-parameter-table th, .tuner-parameter-table td { border-color: var(--line); }
.tuner-parameter-table input { background: #22252a; border-color: #494e55; }
.tuner-parameter-table tr[data-dirty=true] { background: #393124; }
.tuner-panel :focus-visible { outline-color: #8eb5ff; }
.tuner-panel .eyebrow, .tuner-panel .operator-inputs summary { color: #a9b9d0; }
.tuner-actions button { font-size: 10px; }
#tuner-live-values div { background: #22252a; }
.safety-state { border-color: #67543a; border-radius: 3px; background: #342e24; color: #e8c18a; font-size: 10px; }
.safety-state.enabled { border-color: #3f6e4c; background: #24372a; color: #a4d7ad; }
details > summary { font-size: 11px; }
details[open] > summary { color: #bfd3f4; }

/* Driver Station retains its safety palette inside the IDE drawer. */
.driver-station { margin-top: 3px; }
.driver-station #ds-toggle {
  order: 2; align-self: stretch; justify-content: flex-start; min-height: 36px; padding: 7px 12px;
  border: 1px solid #55514a; border-radius: 4px; background: #29292b; color: #e0bd8c;
  box-shadow: none; font: 500 11px/1.5 var(--sans);
}
.driver-station #ds-toggle:hover { background: #353432; border-color: #817665; }
.ds-toggle-arrow { width: 17px; color: #b9c5d6; font-size: 17px; }
.ds-toggle-action { margin-left: auto; color: #a3a8b1; font-size: 10px; }
.ds-drawer-content { padding: 9px; border: 1px solid #55565a; border-top: 2px solid #a18b63; border-radius: 5px 5px 0 5px; background: #303134; }
.ds-navigation button { border-color: #54575d; background: #383a3f; color: #d0d3da; }
.ds-navigation button[aria-pressed=true] { border-color: #6f83a9; background: #29364c; color: #e3edff; box-shadow: inset 2px 0 #83abfa; }
.ds-faceplate { background: #303134; }
.ds-mode-rows button { background: #404247; border-color: #55585e; }
.ds-mode-rows button[aria-pressed=true] { border-color: #8796b1; background: #252b36; box-shadow: inset 2px 0 #d0d8e6; }
.ds-match-actions .ds-enable { background: #39753b; border-color: #65946a; }
.ds-match-actions .ds-disable { background: #a03739; border-color: #c3635d; }
.ds-message-pane { background: #25272b; border-color: #666b73; }
#ds-operation-messages { color: #c4c9d2; }
.ds-runtime-support { border-color: #52565e; }
.ds-runtime-support #estop-button { background: #783538; border-color: #c86e68; }
.logs-panel .panel-heading { margin-bottom: 9px; }
#logs { height: 140px; border: 1px solid #3d424a; border-radius: 3px; background: #1e2024; color: #b7c3d4; font: 11px/1.7 var(--mono); }
.check { border-color: #48684e; border-radius: 3px; color: #9ed0a8; }
.history-label { color: #a8afbb; font-size: 10px; }
footer { margin-top: 12px; padding: 13px 1px; border-color: #34373d; color: #8e959f; font-size: 10px; }
footer strong { color: #a9b0bb; font-size: 10px; }
footer a { color: #9fb9e5; }

/* Full simulation and the model library use the same window chrome. */
.final-sim-toolbar { padding: 13px 1px; border-bottom: 1px solid var(--line); }
.final-sim-toolbar h1 { font-size: 18px; font-weight: 600; }
.final-sim-toolbar p:not(.eyebrow), #sim-model-status { color: var(--secondary); font-size: 10px; }
.sim-view-actions button, .sim-view-actions select { min-height: 28px; font-size: 10px; }
#sim-inputs { border-color: var(--edge); border-radius: 4px; background: var(--surface); }
body.final-sim .visual-panel { border-color: var(--edge); }
body.final-sim .viewport { background: #182028; }
.source-example-dialog { border-color: #5b626d; border-radius: 6px; background: #292c31; color: var(--ink); box-shadow: 0 16px 48px #0009; }
.source-example-dialog h2 { font-size: 17px; }
.source-example-dialog p { color: #bcc1ca; font-size: 12px; }

body.model-library { background: var(--bg); color: var(--ink); font: 13px/1.55 var(--sans); }
.model-library main { max-width: 1720px; padding: 16px 20px; }
.model-library h1 { margin-bottom: 5px; font-size: 20px; font-weight: 600; }
.model-library h2 { font-size: 14px; font-weight: 600; }
.model-library h3 { color: #c4cad4; font-size: 12px; }
.model-library p { color: #a0a6b0; font-size: 11px; }
.model-library section { padding: 14px; border: 1px solid var(--edge); border-radius: 5px; background: var(--surface); box-shadow: none; }
.model-library .import, .model-library .quick-use { background: var(--surface); border-color: var(--edge); }
.model-library .quick-use { border-top: 2px solid #6689c7; }
.model-library .quick-steps { gap: 18px; }
.model-library .quick-steps > li { border-color: var(--edge); }
.model-library .quick-steps > li::before { color: #91b4ef; font-size: 16px; }
.model-library .quick-steps label { color: #d5dae3; font-size: 11px; }
.model-library label { color: #afb5bf; font-size: 10px; }
.model-library input, .model-library select, .model-library button { font-size: 11px; }
.model-library .notice { border-color: #5a6b85; border-radius: 4px; background: #293141; color: #c1d1ec; }
.model-library #model-categories { gap: 3px; padding: 5px; border-color: var(--edge); border-radius: 4px; background: var(--chrome-deep); }
.model-library #model-categories button { min-height: 27px; border-color: transparent; background: transparent; color: #aab2c0; font-size: 10px; }
.model-library #model-categories button[aria-pressed=true] { border-color: #526a94; background: var(--blue-soft); color: #e0ecff; box-shadow: none; }
.model-library .layout { gap: 12px; grid-template-columns: minmax(260px, .9fr) minmax(0, 1.6fr); }
.model-library .grid { gap: 6px; }
.model-library .card { border-color: #454a53; border-radius: 4px; background: #25282d; }
.model-library .card:hover:not(:disabled) { border-color: #6d7787; background: #30353d; }
.model-library .card[aria-pressed=true] { border-color: #668ddd; background: var(--blue-soft); box-shadow: inset 2px 0 #8bb3ff; }
.model-library .card small { color: #929ba9; }
.model-library canvas { border-color: #444a53; border-radius: 3px; background: #182028; box-shadow: none; }
.model-library #model-current-binding { border-color: var(--edge); border-radius: 3px; background: #22252a; color: #bdc7d6; font-size: 11px; }
.model-library #model-quick-selected { color: #b6c0cf; }
.model-library .binding { border-color: var(--line); }
.model-library #model-delete { border-color: #774b4a; background: #412b2d; color: #efb2ad; }

@media (min-width: 1600px) {
  main { grid-template-columns: 208px minmax(0, 1fr); }
  .workbench { grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); }
  #code-editor, #line-numbers { height: 480px; }
  .viewport { height: 360px; }
}
@media (max-width: 1150px) {
  main { grid-template-columns: 166px minmax(0, 1fr); gap: 0 10px; padding: 0 10px 10px; }
  body > header { gap: 16px; padding-inline: 14px; }
  .workspace-pages { gap: 13px; }
  .workbench { gap: 10px; }
  .panel { padding: 13px; }
  .viewport { height: 350px; }
  #environment { max-width: 240px; }
}
@media (max-width: 800px) {
  body > header { flex-wrap: wrap; gap: 7px 14px; padding: 8px 12px; }
  .brand { margin-right: auto; }
  #environment { order: 3; width: 100%; max-width: none; margin: 0; padding-top: 5px; border-top: 1px solid #363a41; }
  .workspace-pages { order: 4; flex-basis: 100%; justify-content: flex-start; gap: 20px; height: 31px; }
  .workspace-pages a { flex: 0 1 auto; padding: 3px 1px; font-size: 11px; text-align: left; }
  main { padding-inline: 9px; }
  .intro { padding-block: 12px; }
  .intro h1 { font-size: 18px; }
  .intro .project-actions { margin-top: 0; }
  #module-nav { position: static; max-height: none; }
  .panel { padding: 12px; }
  .model-library main { padding: 12px; }
}
@media (max-width: 650px) {
  body > header > a:last-child { font-size: 9px; }
  main { padding: 0 7px 8px; }
  .intro { padding-inline: 3px; }
  .intro h1 { font-size: 17px; }
  .intro p:not(.eyebrow) { font-size: 10px; }
  .project-actions { justify-content: flex-start; }
  #module-nav { gap: 3px; padding: 6px; }
  #module-nav::before { padding: 4px 5px 7px; }
  #module-nav > button { min-height: 48px; padding: 6px 4px 6px 22px; font-size: 11px; }
  #module-nav > button::before { left: 6px; top: 10px; }
  #module-nav > button::after { left: 9px; top: 13px; }
  #module-nav > button[aria-pressed=true] { box-shadow: inset 0 -2px #77a5ff; }
  #module-nav small { font-size: 7px; }
  #module-nav span { font-size: 9px; }
  #ide-files button { font-size: 9px; }
  .workbench { gap: 10px; }
  .panel-heading h2, .panel h2 { font-size: 13px; }
  .panel-heading .eyebrow { font-size: 7px; }
  #code-editor, #code-highlight, #line-numbers { font-size: 12px; line-height: 22px; }
  #code-editor, #line-numbers { height: 370px; }
  .viewport { height: 310px; }
  .metrics { gap: 8px; }
  .metrics strong { font-size: 15px; }
  .model-library .layout { grid-template-columns: minmax(0, 1fr); }
  .model-library .quick-steps { gap: 10px; }
  .model-library section { padding: 12px; }
}
@media (max-width: 380px) {
  .brand small { max-width: 180px; font-size: 8px; }
  .workspace-pages { gap: 15px; }
  .workspace-pages a { font-size: 10px; }
  .intro h1 { font-size: 16px; }
  .project-actions button, .project-actions .file-button { padding-inline: 7px; font-size: 10px; }
  .metrics strong { font-size: 13px; }
  .camera-toolbar small { font-size: 9px; }
}
@media (forced-colors: active) {
  .brand-mark, #module-nav > button::before, #code-format::before { border-color: CanvasText; }
  #module-nav > button::after { background: CanvasText; }
  .intro h1::before, #environment::before { background: Highlight; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Runtime lives in the shared title bar, including on the simulation view. */
.runtime-control { display:flex; align-items:center; flex-wrap:wrap; gap:4px 7px; min-width:0; margin-left:auto; }
.runtime-control label { color:var(--secondary); font-size:11px; }
.runtime-control #runtime-mode { max-width:100%; min-inline-size:132px; font-size:11px; }
.runtime-control small { color:var(--secondary); font-size:10px; }
.runtime-control + #environment { margin-left:0; }
@media (max-width:1150px) { body > header:has(.runtime-control) { flex-wrap:wrap; } }
@media (max-width:800px) { .runtime-control { order:2; margin-left:0; } }
@media (max-width:480px) { .runtime-control { flex-basis:100%; } }

/* Phoenix Tuner-inspired accent; never used for Driver Station safety states. */
.tuner-panel {
  --lime: #b8de32; --lime-ink: #d6ee92; --lime-border: #718442; --lime-selected: #343d25;
  --action-blue: var(--lime-ink); --action-line: #596748;
  border-top:2px solid var(--lime);
}
.tuner-panel .eyebrow, .tuner-panel .operator-inputs summary { color:var(--lime-ink); }
.tuner-panel .panel-heading .badge { border-color:#54633b; background:#2b3224; color:var(--lime-ink); }
.tuner-panel .tuner-device-header { border-inline-start:2px solid var(--lime-border); }
.tuner-panel .tuner-devices button[aria-pressed=true], .tuner-panel .tuner-tabs button[aria-selected=true] {
  color:var(--lime-ink); border-color:var(--lime-border); background:var(--lime-selected);
  box-shadow:inset 0 -2px var(--lime);
}
.tuner-panel button.primary { background:var(--lime); border-color:var(--lime); color:#1d2708; }
.tuner-panel button.primary:hover:not(:disabled) { background:#cbea62; border-color:#d7f17a; }
.tuner-panel button.primary:disabled { background:#343b2a; border-color:#515d3e; color:#adb69b; }
.tuner-panel :focus-visible { outline-color:var(--lime-ink); }
.tuner-panel :is(input[type=checkbox],input[type=range]) { accent-color:var(--lime); }
.tuner-panel select option:checked { background:var(--lime-selected); border-color:var(--lime-border); }
.tuner-panel select option:is(:hover,:focus-visible):not(:disabled) { background:#3c462b; }

/* Non-blocking, screen-reader-friendly release notice. */
.availability-toast {
  position:fixed; z-index:20; inset-block-start:12px; inset-inline-end:12px;
  max-inline-size:min(340px,calc(100% - 24px)); padding:10px 13px;
  border:1px solid var(--edge-strong); border-inline-start:3px solid var(--cyan); border-radius:5px;
  background:var(--surface-raised); color:var(--ink); box-shadow:0 4px 16px #0005;
  font:13px/1.45 var(--sans); pointer-events:none;
}
.availability-toast:empty { opacity:0; }
@media (prefers-reduced-motion:no-preference) {
  .availability-toast:not(:empty) { animation:availability-enter 160ms ease-out both; }
  @keyframes availability-enter { from { opacity:0; } to { opacity:1; } }
}
