html[data-theme="dark"] {
  color-scheme: dark;
  color: #dce5ed;
  background: #151b22;
}

html[data-theme="dark"] #themeToggle[aria-pressed="true"]::after { content: "✓"; color: #8fc6ff; }

html[data-theme="dark"] .menu-bar,
html[data-theme="dark"] .menu-popover,
html[data-theme="dark"] .asset-menu,
html[data-theme="dark"] .asset-menu-popup { background: #252e38; border-color: #465565; }
html[data-theme="dark"] .menu-trigger,
html[data-theme="dark"] .menu-direct,
html[data-theme="dark"] .menu-popover button,
html[data-theme="dark"] .asset-menu button { color: #e0e8ef; }
html[data-theme="dark"] .menu-trigger:hover,
html[data-theme="dark"] .menu-direct:hover,
html[data-theme="dark"] .menu-trigger.active,
html[data-theme="dark"] .menu-popover button:hover,
html[data-theme="dark"] .asset-menu button:hover,
html[data-theme="dark"] .asset-menu-popup button:hover { background: #344c65; }
html[data-theme="dark"] .menu-popover hr { border-color: #465565; }
html[data-theme="dark"] .menu-popover kbd { color: #9cabb8; }

html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .asset-toolbar { background: linear-gradient(#303b47,#25303b); border-color: #4b5c6c; }
html[data-theme="dark"] .tool,
html[data-theme="dark"] .asset-toolbar button { color: #9ccaff; }
html[data-theme="dark"] .tool:hover,
html[data-theme="dark"] .toolbar-help:hover,
html[data-theme="dark"] .asset-toolbar button:hover { background: #344b62; border-color: #5a84aa; }
html[data-theme="dark"] .tool-separator,
html[data-theme="dark"] .asset-separator { background: #52606d; border-color: #52606d; }
html[data-theme="dark"] .autosave-label { color: #a8b7c5; }

html[data-theme="dark"] .resource-pane,
html[data-theme="dark"] .room-side,
html[data-theme="dark"] .sprite-editor-side,
html[data-theme="dark"] .pixel-tools,
html[data-theme="dark"] .pixel-colors { background: #242e38; border-color: #495968; }
html[data-theme="dark"] .pane-heading,
html[data-theme="dark"] .resource-footer,
html[data-theme="dark"] .room-tabs,
html[data-theme="dark"] .room-side-foot { background: #26313c; border-color: #455563; color: #afc0cf; }
html[data-theme="dark"] .pane-heading button,
html[data-theme="dark"] .tree-twisty,
html[data-theme="dark"] .tree-group-head .count { color: #a6bbce; }
html[data-theme="dark"] .resource-filter,
html[data-theme="dark"] .resource-footer button { background: #1c252f; border-color: #536677; color: #d5e3ee; }
html[data-theme="dark"] .resource-filter input { background: transparent; color: #e2eaf1; }
html[data-theme="dark"] .tree-group-head { color: #e2eaf1; }
html[data-theme="dark"] .tree-group-head:hover,
html[data-theme="dark"] .tree-item:hover { background: #34495d; }
html[data-theme="dark"] .tree-item.selected { background: #315a7e; color: #fff; }
html[data-theme="dark"] .tree-empty { color: #9cabb8; }
html[data-theme="dark"] .resource-footer button:hover { background: #344c65; }

html[data-theme="dark"] .workspace {
  background-color: #1b2530;
  background-image: linear-gradient(135deg,#ffffff08 25%,transparent 25%),linear-gradient(225deg,#ffffff08 25%,transparent 25%),linear-gradient(45deg,#ffffff08 25%,transparent 25%),linear-gradient(315deg,#ffffff08 25%,#1b2530 25%);
}
html[data-theme="dark"] .workspace-watermark { color: #8ba7bd30; text-shadow: none; opacity: 1; }
html[data-theme="dark"] .workspace-watermark span { color: #7899b650; }
html[data-theme="dark"] .editor-window,
html[data-theme="dark"] .asset-editor-window { background: #26313b; border-color: #607487; color: #dce5ed; box-shadow: 0 6px 22px #0008; }
html[data-theme="dark"] .window-titlebar { background: linear-gradient(90deg,#245486,#3774a3); }
html[data-theme="dark"] .editor-window.inactive .window-titlebar { background: linear-gradient(90deg,#485968,#617182); }
html[data-theme="dark"] .window-controls button { background: #2b3e50; border-color: #6a8ba8; color: #e9f2fa; }
html[data-theme="dark"] .window-controls button:hover { background: #456582; }
html[data-theme="dark"] .window-body,
html[data-theme="dark"] .sprite-editor-content,
html[data-theme="dark"] .sprite-frame-area,
html[data-theme="dark"] .path-editor-layout { background: #26313b; }
html[data-theme="dark"] .object-col,
html[data-theme="dark"] .path-editor-controls { border-color: #475766; }
html[data-theme="dark"] .field-label,
html[data-theme="dark"] .sprite-metadata,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .code-foot,
html[data-theme="dark"] .path-editor-help,
html[data-theme="dark"] .sprite-live-preview,
html[data-theme="dark"] .sprite-editor-empty,
html[data-theme="dark"] .action-copy small,
html[data-theme="dark"] .record-panel span:nth-child(2) { color: #a6b8c8; }
html[data-theme="dark"] .text-input,
html[data-theme="dark"] .select-input,
html[data-theme="dark"] .number-input,
html[data-theme="dark"] .modal input,
html[data-theme="dark"] .modal select,
html[data-theme="dark"] .sprite-speed input,
html[data-theme="dark"] .path-point-fields input { background: #18232d; border-color: #526779; color: #e9f1f8; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #91a4b5; }
html[data-theme="dark"] .classic-button,
html[data-theme="dark"] .room-tabs button,
html[data-theme="dark"] .pixel-tool,
html[data-theme="dark"] .brush-sizes button,
html[data-theme="dark"] .path-point-fields button,
html[data-theme="dark"] .path-preview-toolbar button { background: #344252; border-color: #62788c; color: #e0eaf3; box-shadow: none; }
html[data-theme="dark"] .classic-button:hover,
html[data-theme="dark"] .room-tabs button:hover,
html[data-theme="dark"] .pixel-tool:hover,
html[data-theme="dark"] .brush-sizes button:hover,
html[data-theme="dark"] .path-point-fields button:hover,
html[data-theme="dark"] .path-preview-toolbar button:hover { background: #415c75; }
html[data-theme="dark"] .room-tabs button.active,
html[data-theme="dark"] .pixel-tool.selected,
html[data-theme="dark"] .brush-sizes button.selected { background: #315a7e; border-color: #82b9e9; color: #fff; }
html[data-theme="dark"] .panel-box,
html[data-theme="dark"] .event-list,
html[data-theme="dark"] .visual-action-list,
html[data-theme="dark"] .record-panel,
html[data-theme="dark"] .path-point-list,
html[data-theme="dark"] .path-option-group { background: #202a34; border-color: #526574; }
html[data-theme="dark"] .panel-box legend,
html[data-theme="dark"] .collision-options legend,
html[data-theme="dark"] .path-option-group legend { color: #bacbda; }
html[data-theme="dark"] .event-row:hover,
html[data-theme="dark"] .visual-action-row:hover,
html[data-theme="dark"] .path-point-row:hover { background: #34495d; }
html[data-theme="dark"] .event-row.selected,
html[data-theme="dark"] .visual-action-row.selected,
html[data-theme="dark"] .path-point-row.selected { background: #315a7e; border-color: #6c9fca; color: #fff; }
html[data-theme="dark"] .collision-options { border-color: #526574; }
html[data-theme="dark"] .collision-options:disabled { background: #2b3540; color: #8999a7; border-color: #44515e; }
html[data-theme="dark"] .collision-options:disabled legend { color: #8999a7; }
html[data-theme="dark"] .action-icon { background: #2e3b48; border-color: #667f94; box-shadow: none; }
html[data-theme="dark"] .palette-tabs button,
html[data-theme="dark"] .palette-action { background: #303c49; border-color: #5a6e7f; color: #e1eaf2; }
html[data-theme="dark"] .palette-tabs button.active { background: #315a7e; border-color: #82b9e9; color: #fff; }
html[data-theme="dark"] .palette-action:hover { background: #3b5770; }
html[data-theme="dark"] .palette-action small { color: #d4e1ec; }
html[data-theme="dark"] .visual-action-list.drag-target { background: #29445c; }

html[data-theme="dark"] .room-canvas-wrap,
html[data-theme="dark"] .pixel-workspace { background: #1a222a; }
html[data-theme="dark"] .room-empty-message { background: #1b2835e8; color: #dce5ed; }
html[data-theme="dark"] .room-status { background: #1b2835e8; color: #dce5ed; }
html[data-theme="dark"] .path-point-row { background: #202a34; color: #dce5ed; }
html[data-theme="dark"] .path-point-row small,
html[data-theme="dark"] .path-list-empty { color: #a6b8c8; }
html[data-theme="dark"] .path-preview-toolbar { background: #2b3743; border-color: #526574; color: #c3d2df; }
html[data-theme="dark"] .sprite-frame { background: #26313b; color: #dce5ed; }
html[data-theme="dark"] .sprite-frame:hover { background: #34495d; }
html[data-theme="dark"] .sprite-frame.selected { background: #315a7e; }
html[data-theme="dark"] .brush-sizes,
html[data-theme="dark"] .sprite-speed { border-color: #526574; color: #c3d2df; }
html[data-theme="dark"] .color-labels,
html[data-theme="dark"] .custom-color { color: #c3d2df; }
html[data-theme="dark"] .asset-status { background: #25313c; border-color: #526574; color: #dce5ed; }
html[data-theme="dark"] .asset-status span { border-color: #526574; }

html[data-theme="dark"] .empty-hint,
html[data-theme="dark"] .modal { background: #293541; border-color: #607487; color: #e0e9f1; }
html[data-theme="dark"] .empty-hint p,
html[data-theme="dark"] .modal-help { color: #b0c1d0; }
html[data-theme="dark"] .modal h2 { color: #f0f5fa; }
html[data-theme="dark"] .modal-help code { background: #1a2733; }
html[data-theme="dark"] .resource-picker button,
html[data-theme="dark"] .language-choices button,
html[data-theme="dark"] .game-picker button { background: #344252; border-color: #62788c; color: #e0eaf3; }
html[data-theme="dark"] .resource-picker button:hover,
html[data-theme="dark"] .language-choices button:hover,
html[data-theme="dark"] .game-picker button:hover { background: #415c75; }
html[data-theme="dark"] .status-bar { background: #222c36; border-color: #4b5d6d; color: #b6c6d4; }
html[data-theme="dark"] .game-dialog { background: #25313c; border-color: #607487; }
html[data-theme="dark"] .game-dialog-foot { color: #bdcbd8; }
