/* Shared tokens for desktop, cloud and mobile. Only presentation is themed. */
:root {
  --theme-bg: #f6f8fc;
  --theme-surface: #fff;
  --theme-raised: #fbfdff;
  --theme-soft: #f1f5f9;
  --theme-text: #172b4d;
  --theme-muted: #52657c;
  --theme-line: #dce6f0;
  --theme-line-strong: #cbd5e1;
  --theme-accent: #2563eb;
  --theme-accent-soft: #eff6ff;
  --theme-accent-ink: #1d4ed8;
  --theme-danger: #b42318;
  --theme-danger-bg: #fff1ef;
  --theme-warning: #854d0e;
  --theme-warning-bg: #fff8e6;
  --theme-success: #166534;
  --theme-success-bg: #effbf3;
  --theme-planned: #6d28d9;
  --theme-planned-bg: #f5f3ff;
  --theme-progress-shade: #0001;
  --theme-focus: #2563eb;
  --theme-primary-fill: #2563eb;
  --theme-primary-hover: #1d4ed8;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #101827;
  --theme-surface: #172336;
  --theme-raised: #1c2b41;
  --theme-soft: #23334a;
  --theme-text: #e7eef8;
  --theme-muted: #acbcd1;
  --theme-line: #354760;
  --theme-line-strong: #516683;
  --theme-accent: #75a8ff;
  --theme-accent-soft: #213c63;
  --theme-accent-ink: #a9c9ff;
  --theme-danger: #ffb4aa;
  --theme-danger-bg: #442a30;
  --theme-warning: #f4cd85;
  --theme-warning-bg: #3b3224;
  --theme-success: #92d9ad;
  --theme-success-bg: #203b34;
  --theme-planned: #d4c2ff;
  --theme-planned-bg: #302a49;
  --theme-progress-shade: #0002;
  --theme-focus: #9ac1ff;
  --bg: var(--theme-bg);
  --surface: var(--theme-surface);
  --surface-raised: var(--theme-raised);
  --surface-soft: var(--theme-soft);
  --soft: var(--theme-accent-soft);
  --text: var(--theme-text);
  --ink: var(--theme-text);
  --muted: var(--theme-muted);
  --line: var(--theme-line);
  --line-strong: var(--theme-line-strong);
  --border: var(--theme-line);
  --accent: var(--theme-accent);
  --accent-hover: #93bbff;
  --accent-soft: var(--theme-accent-soft);
  --orange: var(--theme-accent);
  --orange-soft: var(--theme-accent-soft);
  --blue: var(--theme-accent);
  --brand: var(--theme-accent);
  --brand-soft: var(--theme-accent-soft);
  --text-primary: var(--theme-text);
  --text-secondary: var(--theme-muted);
  --text-tertiary: #9caec7;
  --green: #92d9ad;
  --amber: #f4cd85;
  --red: #ffb4aa;
  --mobile-bg: var(--theme-bg);
  --mobile-surface: var(--theme-surface);
  --mobile-ink: var(--theme-text);
  --mobile-muted: var(--theme-muted);
  --mobile-line: var(--theme-line);
  --mobile-accent: var(--theme-accent);
  --shadow-1: 0 4px 14px #0002;
  --shadow-2: 0 12px 32px #0004;
  scrollbar-color: #607591 #172336;
}
/* Components use the same control dimensions in both themes. */
.badge { font-size: 12px; line-height: 1.4; }
:is(.badge.success, .badge.green) { color: var(--theme-success); background: var(--theme-success-bg); }
:is(.badge.warning, .badge.amber, .badge.paused) { color: var(--theme-warning); background: var(--theme-warning-bg); }
:is(.badge.error, .badge.danger, .badge.red) { color: var(--theme-danger); background: var(--theme-danger-bg); }
:is(.schedule-advanced > summary, .gantt-row-label) small { color: var(--theme-muted); }
#devices-view.device-center-rounded :is(#selected-meta, #device-detail-tabs button:not(.active), #device-status-filters > button:not(.active), #speed-mode > button:not(.active) strong, .device-utility-tabs button:not(.active), .axis-step-control button:not(.active), .material-slot.is-empty .material-slot-material) { color: var(--theme-muted); }
#devices-view.device-center-rounded #material-source-label { color: var(--theme-success); }
#devices-view.device-center-rounded #telemetry-grid .runtime-status-item.operation .runtime-status-cell-copy > b { color: var(--theme-accent-ink); }
#schedule-view :is(.schedule-plan-card small, .schedule-rollup-chip small, .schedule-timeline-heading small, .gantt-hour span, .schedule-range button:not(.active), .badge.neutral) { color: var(--theme-muted); }
:is(.settings-dashboard .badge.neutral, .pack-analysis-dialog .badge.neutral) { color: var(--theme-muted); }
.settings-dashboard .badge.warning { color: var(--theme-warning); }
.settings-dashboard .badge.success { color: var(--theme-success); }
:is(.email-settings-field small, .email-rule-heading small, .email-content-summary > small, .email-settings-toggle small, .ai-config-note, .clone-dialog small, .clone-target em, .smart-schedule-dialog p, .smart-schedule-dialog small, .smart-schedule-fields label > span, #smart-schedule-ai-status, #smart-schedule-config-note, #smart-schedule-footer-status, .pack-analysis-auto-export-note, #pack-password-state, .send-advanced-routing summary small) { color: var(--theme-muted); }
#send-view .send-readiness-count { color: var(--theme-accent-ink); }
.archive-media-editor { display: grid; gap: 14px; min-width: 0; padding: 14px; border: 1px solid var(--theme-line); border-radius: 10px; background: var(--theme-raised); color: var(--theme-text); }
.archive-media-editor label { display: grid; gap: 8px; margin: 0; min-width: 0; font-size: 13px; }
.archive-media-editor input, .archive-media-editor select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--theme-line-strong); border-radius: 8px; background: var(--theme-surface); color: var(--theme-text); font: inherit; }
.archive-media-editor p { margin: 0; overflow-wrap: anywhere; line-height: 1.6; }
.archive-media-editor .muted { color: var(--theme-muted); }
.archive-media-editor a { color: var(--theme-accent); overflow-wrap: anywhere; }
.archive-media-editor .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.timelapse-local-editor > summary { cursor: pointer; min-height: 40px; padding-block: 10px; }
.timelapse-local-editor { margin-top: 16px; border: 1px solid var(--theme-line); border-radius: 10px; }
.appearance-settings { display: grid; gap: 12px; margin: 0; padding: 18px; min-width: 0; border: 0; background: var(--theme-surface); color: var(--theme-text); border-radius: 12px; box-sizing: border-box; }
.appearance-settings .appearance-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.appearance-heading strong { font-size: 16px; }
.appearance-heading span, .appearance-settings .appearance-help { font-size: 12px; line-height: 1.6; color: var(--theme-muted); margin: 0; }
.appearance-settings > label { margin: 0; font-size: 13px; }
.appearance-settings select, .appearance-settings input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--theme-line-strong); border-radius: 8px; background: var(--theme-raised); color: var(--theme-text); font: inherit; }
.appearance-settings .appearance-schedule { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.appearance-schedule label { display: grid; gap: 8px; margin: 0; font-size: 12px; }
.appearance-settings .appearance-save { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.appearance-settings button { min-height: 40px; padding: 8px 14px; border: 1px solid #2563eb; border-radius: 8px; background: #2563eb; color: #fff; font: inherit; cursor: pointer; }
.appearance-settings button:disabled { opacity: .6; cursor: wait; }
.appearance-settings button:not(:disabled):hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.appearance-save span { flex: 1 1 160px; font-size: 12px; color: var(--theme-muted); line-height: 1.5; }
.appearance-save [data-error="true"] { color: var(--theme-danger); }
.appearance-disclosure { min-width: 0; margin: 12px 0; }
.appearance-disclosure summary { color: var(--theme-accent-ink); cursor: pointer; font-size: 13px; }
.appearance-disclosure[open] { border: 1px solid var(--theme-line); border-radius: 10px; background: var(--theme-surface); }
.appearance-disclosure[open] > summary { padding: 12px; }
.cloud-header .appearance-disclosure { margin: 0; }
:is(.topbar, .cloud-header) .appearance-disclosure { position: relative; flex: 0 0 auto; margin: 0; }
:is(.topbar, .cloud-header) .appearance-disclosure[open] { border: 0; border-radius: 0; background: transparent; }
:is(.topbar, .cloud-header) .appearance-disclosure > summary { padding: 8px; }
:is(.topbar, .cloud-header) .appearance-disclosure > [data-appearance-settings] { position: absolute; z-index: 30; top: calc(100% + 12px); right: 0; width: min(360px, calc(100vw - 32px)); max-height: calc(100dvh - 110px); overflow: auto; border: 1px solid var(--theme-line); border-radius: 12px; background: var(--theme-surface); box-shadow: 0 12px 36px #0003; }
.appearance-settings :is(button, select, input):focus-visible { outline: 3px solid var(--theme-focus); outline-offset: 2px; }
[data-appearance-native]:empty, [data-appearance-status]:empty { display: none; }

/* Legacy fixed light surfaces; media, color swatches and 3D canvases excluded. */
html[data-theme="dark"] body { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme="dark"] .brand > img { filter: brightness(0) invert(1); }
html[data-theme="dark"] .backend-connection-card { --backend-blue: var(--theme-accent); --backend-blue-strong: var(--theme-accent-ink); --backend-blue-soft: var(--theme-accent-soft); --backend-ink: var(--theme-text); --backend-muted: var(--theme-muted); --backend-line: var(--theme-line); }
html[data-theme="dark"] .settings-dashboard :is(.delivery-mode-options, .delivery-mode-option:has(input:checked), .slicer-runtime-empty, .slicer-preset-import-status, .slicer-advanced-body, .email-rule-card, .email-settings-panel.is-disabled .email-rule-card, .email-event-options span, .email-content-summary > span) { background: var(--theme-raised); border-color: var(--theme-line); color: var(--theme-text); }
html[data-theme="dark"] .settings-dashboard :is(b, .slicer-runtime-name strong, .email-rule-heading strong, .email-event-fieldset legend, .email-settings-field, .delivery-mode-option b) { color: var(--theme-text); }
html[data-theme="dark"] .settings-dashboard :is(.slicer-advanced-body p, .email-settings-toggle small, .email-rule-heading small, .email-content-summary > small, .email-settings-status, .delivery-mode-option small, .delivery-mode-status) { color: var(--theme-muted); }
html[data-theme="dark"] .email-event-options input:checked + span { background: var(--theme-accent-soft); color: var(--theme-accent-ink); border-color: var(--theme-accent); }
html[data-theme="dark"] :is(.slicer-model-setup-dialog, .slicer-model-card, .slicer-model-setup-footer, .slicer-model-search, .slicer-model-nozzles label) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] .slicer-model-setup-dialog :is(strong, h2) { color: var(--theme-text); }
html[data-theme="dark"] :is(.workspace, .platform-view, .device-list-panel-final, .device-inspector-final, .full-slicer-view, .full-slicer-host, .full-slicer-loading, .mobile-login-page) { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme="dark"] :is(.sidebar, .workspace-toolbar, .full-slicer-toolbar, .cloud-header, .statusbar, .platform-card, .kpi-card, .card, .telemetry-card, .material-panel-final, .device-console-context-final, .device-console-controls-final, .device-utility-drawer, .device-management-actions, .user-menu-popover, .toast, .mobile-login-card, .slicer-workspace-tab, .dashboard-order-row, .dashboard-device-card, .history-row, .history-detail-panel, .storage-file-detail-panel, .orca-connection-input input) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] body.sidebar-railed:not(.sidebar-pinned) .sidebar:is(:hover, :has(:focus-visible)) { background: var(--theme-surface); }
html[data-theme="dark"] :is(dialog, .form-dialog, .stop-print-dialog, .message-inbox-dialog, .device-alert-dialog, .plate-clearance-confirm-dialog) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] dialog :is(header, footer), html[data-theme="dark"] .form-dialog.login-dialog form > header { background: var(--theme-raised); border-color: var(--theme-line); }
html[data-theme="dark"] dialog::backdrop { background: #060c18aa; }
html[data-theme="dark"] :is(input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select) { color: var(--theme-text); background-color: var(--theme-raised); border-color: var(--theme-line-strong); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #9caec7; opacity: 1; }
html[data-theme="dark"] :is(input, select, textarea, button):disabled { opacity: .55; }
html[data-theme="dark"] :is(.brand-lockup-text, .primary-nav button, .full-slicer-toolbar h1, .slicer-prep-intro strong, .login-brand-title, .form-dialog.login-dialog header h2, .form-dialog.login-dialog header .login-brand-title, .history-row-copy strong, .history-detail-facts dd, .history-reprint-option span, .history-reprint-requirement-copy strong, .diagnostic-analysis-pattern header strong) { color: var(--theme-text); }
html[data-theme="dark"] :is(.primary-nav button.active, .primary-nav button:hover, .slicer-workspace-tab[aria-selected="true"], .dashboard-fleet-group[aria-pressed="true"], .device-row.selected, .device-row.active, .toast-action, .history-selection, .diagnostic-analysis-summary) { color: var(--theme-accent-ink); background: var(--theme-accent-soft); border-color: var(--theme-line-strong); }
html[data-theme="dark"] :is(.segmented, .speed-mode-buttons, .device-utility-tabs, .device-settings-tabs, .device-list-progress-track, .runtime-status-grid, .history-detail-facts dt, .attention-row, .dashboard-order-empty, .platform-load-status, .diagnostic-analysis-pattern, .aux-readback-status, .storage-summary, .settings-facts, .slicer-runtime-list) { background: var(--theme-soft); color: var(--theme-muted); border-color: var(--theme-line); }
html[data-theme="dark"] :is(.secondary-button, .text-button, .full-slicer-batch, .monitor-controls button, .message-inbox-button, .message-inbox-button:hover, .aux-readback-refresh) { background: var(--theme-surface); color: var(--theme-accent-ink); border-color: var(--theme-line-strong); }
html[data-theme="dark"] :is(.secondary-button, .device-row-compact, .dashboard-order-row):hover { background: var(--theme-raised); }
html[data-theme="dark"] :is(.primary-button, .full-slicer-toolbar .primary-button, .mobile-primary) { color: #fff; border-color: #3479e8; background: #2563eb; }
html[data-theme="dark"] :is(.primary-button, .full-slicer-toolbar .primary-button, .mobile-primary):not(:disabled):hover { background: #1d4ed8; }
html[data-theme="dark"] :is(.badge.neutral, .badge.blue, .history-status-badge.status-1, .full-slicer-toolbar .badge.neutral) { color: var(--theme-accent-ink); background: var(--theme-accent-soft); border-color: var(--theme-line); }
html[data-theme="dark"] :is(.badge.warning, .badge.paused, .badge.amber, .toast.warning, .clearance-row-button, .plate-clearance-bulk:not(:disabled), .plate-clearance-card, .dashboard-maintenance-row.due, .dashboard-maintenance-row.soon, .history-status-badge.status-2, .diagnostic-risk-medium, .diagnostic-risk-high, .dialog-status:not(:empty)) { color: var(--theme-warning); background: var(--theme-warning-bg); border-color: #7f683c; }
html[data-theme="dark"] :is(.badge.error, .badge.danger, .badge.red, .toast.error, .monitor-kpi.critical, .diagnostic-risk-critical, .platform-load-status[data-state="degraded"], .danger-button, .dialog-status[data-error="true"]) { color: var(--theme-danger); background: var(--theme-danger-bg); border-color: #9b5c61; }
html[data-theme="dark"] :is(.badge.success, .badge.green, .toast.success, .history-status-badge.status-3, .diagnostic-risk-low, .aux-readback-status[data-state="ready"]) { color: var(--theme-success); background: var(--theme-success-bg); border-color: #477a64; }
html[data-theme="dark"] :is(.kpi-card.danger strong, .batch-load-note.error) { color: var(--theme-danger); }
html[data-theme="dark"] :is(.kpi-card.warning strong, .dashboard-device-status.attention, .dashboard-maintenance-summary .due strong, .dashboard-maintenance-summary .soon strong) { color: var(--theme-warning); }
html[data-theme="dark"] :is(.dashboard-device-status.printing, .dashboard-maintenance-row-head strong, .diagnostic-observation-fix) { color: var(--theme-accent-ink); }
html[data-theme="dark"] :is(.dashboard-order-details, .dashboard-order-notice, .dashboard-order-empty p, .dashboard-order-empty strong, .history-row-copy small, .history-pagination span, .history-status-text, .diagnostic-analysis-pattern p, .diagnostic-analysis-pattern small, .slicer-prep-intro small, .dashboard-device-status) { color: var(--theme-muted); }
html[data-theme="dark"] table { color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] :is(th, td) { border-color: var(--theme-line); }
html[data-theme="dark"] :is(thead, th, tr:nth-child(even)) { background: var(--theme-raised); }
html[data-theme="dark"] :is(.gantt-header, .gantt-group, .gantt-row-label, .gantt-time-cell, .gantt-canvas, .schedule-toolbar, .schedule-item, .schedule-day, .schedule-event, .chart-grid, .chart-empty) { background-color: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] :is(.schedule-view, .schedule-range, .schedule-plan-lane > header, .gantt-corner, .gantt-label, .gantt-row, .gantt-hour, .gantt-time-grid, .agenda-date, .agenda-item, .schedule-edit-context, .order-material-route, .order-detail-stat, .maintenance-reminder-item) { background-color: var(--theme-raised); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] :is(.schedule-planning-shell, .schedule-plan-lane, .schedule-plan-card, .schedule-rollup-chip, .schedule-gantt, .schedule-range button.active, .gantt-label-cell, .agenda-group, .order-card, .order-detail-card, .material-card, .material-table, .diagnostic-record, .diagnostic-knowledge-item, .wiki-result-card, .wiki-cache-facts) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] :is(.schedule-view strong, .schedule-view b, .schedule-edit-context strong, .order-material-route b, .order-detail-stat strong, .maintenance-reminder-item b, .wiki-cache-facts dd, .wiki-result-copy strong, .diagnostic-record-facts strong, .pack-analysis-dropzone strong, .pack-analysis-kpi strong, .pack-analysis-system dd, .pack-analysis-category strong) { color: var(--theme-text); }
html[data-theme="dark"] :is(.schedule-filter, .schedule-legend, .schedule-legend .legend-note, .schedule-rollup-chip small, .schedule-plan-card small, .schedule-plan-time, .schedule-plan-empty, .schedule-timeline-heading small, .gantt-hour span, .schedule-range button) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.schedule-rollup-chip.warning) { background: var(--theme-warning-bg); border-color: #7f683c; color: var(--theme-warning); }
html[data-theme="dark"] :is(.schedule-rollup-chip.danger, .schedule-plan-card.risk, .schedule-plan-card.live.risk) { background: var(--theme-danger-bg); border-color: #9b5c61; color: var(--theme-danger); }
html[data-theme="dark"] :is(.schedule-rollup-chip.success) { background: var(--theme-success-bg); border-color: #477a64; color: var(--theme-success); }
html[data-theme="dark"] :is(a:not(.primary-button):not(.mobile-primary), .link-button) { color: var(--theme-accent-ink); }
html[data-theme="dark"] :is(button, input, select, textarea, a):focus-visible { outline-color: var(--theme-focus); }
html[data-theme="dark"] #app-splash { background: radial-gradient(ellipse at 50% 40%, #203754, #101827 68%); color: var(--theme-text); }
html[data-theme="dark"] :is(.app-splash-brand, .app-splash-hint) { color: var(--theme-text); }
html[data-theme="dark"] .app-splash-mark { background: var(--theme-raised); box-shadow: 0 12px 40px #0004; }
html[data-theme="dark"] #devices-view.device-center-rounded { --console-line: var(--theme-line); --console-soft: var(--theme-bg); --device-ring-track: var(--theme-line); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.device-utility-drawer, .realtime-control-card, .runtime-status-grid, .runtime-status-grid > .runtime-status-item, .device-settings-tabs button.active, .device-utility-tabs button.active, .speed-mode-button.active, #device-detail-tabs) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.device-avatar, .task-finish, .device-utility-tabs, .speed-mode-buttons, #device-detail-tabs button.active) { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.task-finish b, .device-utility-drawer-header strong, .device-utility-tabs button, #device-detail-tabs button, .task-elapsed, .device-settings-tabs button) { color: var(--theme-muted); }
html[data-theme="dark"] #devices-view.device-center-rounded #btn-stop { color: var(--theme-danger); background: var(--theme-danger-bg); border-color: #9b5c61; }
/* Device-center rules deliberately match the original ID-scoped specificity. */
html[data-theme="dark"] #devices-view.device-center-rounded :is(.workspace-toolbar, .device-list-panel, .device-list-panel-final, .device-panel-heading-final, .material-slot, .device-row-compact, .temperature-entry, .extrusion-thermal) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] #devices-view.device-center-rounded #current-task-card { background: var(--theme-surface); color: var(--theme-text); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.device-status-filters, .device-status-filters button, .speed-mode-buttons, .extrusion-direction:disabled) { background: var(--theme-soft); color: var(--theme-muted); border-color: var(--theme-line); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.device-row-compact.selected, .device-row-compact.active, .device-row-compact[aria-selected="true"], .device-status-filters button.active, .speed-mode-button.active, .device-row-compact:has([aria-pressed="true"])) { background: var(--theme-accent-soft); color: var(--theme-accent-ink); border-color: var(--theme-accent); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(h1, h2, h3, .card-title strong, .device-copy strong, .runtime-status-cell-copy > b, .temperature-control-row > strong, .temperature-current b, .runtime-control-subheading strong, .speed-mode-button strong, .extrusion-console-heading strong, .extrusion-thermal b, .device-utility-drawer-handle, .device-utility-drawer-handle span) { color: var(--theme-text); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.runtime-status-cell-copy > span, .temperature-control-row span, .extrusion-direction b, .extrusion-direction small, .extrusion-thermal small, .lifetime-summary small, .material-slot.empty .material-slot-material) { color: var(--theme-muted); }
html[data-theme="dark"] #devices-view.device-center-rounded .device-list-progress-ring::before { background: var(--theme-raised); }
html[data-theme="dark"] #devices-view.device-center-rounded .device-list-progress-ring { --device-ring-track: var(--theme-line); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.speed-mode-button.is-active, .speed-mode-buttons.is-readonly .speed-mode-button.is-active) { background: var(--theme-raised); color: var(--theme-accent-ink); }
html[data-theme="dark"] #devices-view.device-center-rounded .runtime-status-card .temperature-entry input { color: var(--theme-text); background: transparent; }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.runtime-status-card .temperature-entry kbd, .extrusion-nozzle-state) { background: var(--theme-raised); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.runtime-status-heading small, .runtime-status-cell-copy .is-printing, .extrusion-nozzle-state small) { color: var(--theme-muted); }
html[data-theme="dark"] #devices-view.device-center-rounded #extrusion-temperature { color: var(--theme-text); }
html[data-theme="dark"] #devices-view.device-center-rounded .device-console-context-final > .plate-clearance-card { background: var(--theme-warning-bg); color: var(--theme-warning); border-color: #7f683c; }
html[data-theme="dark"] body:not(.cloud-body) main :is(form:not(.appearance-settings), .option), html[data-theme="dark"] #service-mode-status { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] main .option:has(input:checked) { background: var(--theme-accent-soft); border-color: var(--theme-accent); }
html[data-theme="dark"] :is(.cloud-body p, main p, main small) { color: var(--theme-muted); }
/* Expanded send controls use the same surfaces as their collapsed summary. */
html[data-theme="dark"] #send-view .send-layout { background: var(--theme-bg); }
html[data-theme="dark"] #send-view :is(
  .send-assets, .send-inspector, .send-selection, .send-plan-fact, .send-manual-plan,
  .send-manual-plan-body, .send-advanced-routing, .send-review-settings,
  .send-device-option, .send-physical-slot, .send-task-setting, .send-delivery-setting,
  .send-file-timelapse, .send-progress-panel, .send-progress-row,
  .send-route-check-details, .send-route-check-row, .send-route-slot-matrix,
  .send-sync-slot-details, .send-file-search, .send-readiness-actions
) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] #send-view :is(
  .send-brief-chip, .send-slice-choice, .send-quick-plan, .send-decision-bar,
  .send-file-library-tabs, .send-scope-shortcuts, .send-route-check-meta small,
  .send-delivery-options label, .send-batch-overview > span, .send-group-counts > span,
  .send-device-state, .send-readiness-count, .send-filter-details, .send-asset-status,
  .send-progress-row > strong
) { background: var(--theme-raised); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] #send-view :is(h1, h2, h3, h4, strong, b, label, summary, .send-slice-title) { color: var(--theme-text); }
html[data-theme="dark"] #send-view :is(p, small, .send-slice-fact, .send-device-list-hint) { color: var(--theme-muted); }
html[data-theme="dark"] #send-view :is(.send-slice-row.selected, .send-physical-slot.selected, .send-device-option:has(input:checked), .send-scope-shortcuts button.active, .send-file-library-tabs button.active, .send-delivery-options label:has(input:checked)) { background: var(--theme-accent-soft); color: var(--theme-accent-ink); border-color: var(--theme-accent); }
html[data-theme="dark"] #send-view :is(.send-file-library-tabs button, .send-scope-shortcuts button, .send-icon-action, .send-file-heading-actions > button, .send-progress-retry, .send-progress-reconcile) { background: var(--theme-surface); color: var(--theme-accent-ink); border-color: var(--theme-line-strong); }
html[data-theme="dark"] #send-view :is(.send-manual-plan > summary:hover, .send-review-settings > summary:hover, .send-slice-row:hover, .send-sync-slot-details[open] > summary) { background: var(--theme-soft); }
html[data-theme="dark"] #send-view :is(.send-asset-status.ok, .send-preflight-result.ok, .send-route-check-row.ok, .send-brief-chip.ok, .send-runtime-badge.live, .send-real-delivery-note, .send-route-check-state, .send-route-check-meta small.ok, .send-decision-bar.ready, .send-decision-bar.done, .send-progress-row.started > strong) { background: var(--theme-success-bg); color: var(--theme-success); border-color: var(--theme-success); }
html[data-theme="dark"] #send-view :is(.send-asset-status.warning, .send-preflight-result.ok.warning, .send-route-check-row.warn, .send-brief-chip.warning, .send-runtime-badge.demo, .send-route-check-state.warn, .send-route-check-meta small.warning, .send-decision-bar.attention, .send-progress-row.waiting_online > strong, .send-progress-row.unknown > strong) { background: var(--theme-warning-bg); color: var(--theme-warning); border-color: var(--theme-warning); }
html[data-theme="dark"] #send-view :is(.send-asset-status.error, .send-preflight-result.error, .send-progress-row.failed > strong, .send-progress-row.blocked > strong) { background: var(--theme-danger-bg); color: var(--theme-danger); border-color: var(--theme-danger); }
html[data-theme="dark"] #send-view .send-decision-bar:is(.confirm, .working) { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
html[data-theme="dark"] #send-view .send-decision-bar > strong { background: var(--theme-soft); color: inherit; }
html[data-theme="dark"] #send-view :is(.send-decision-bar, .send-real-delivery-note, .send-route-check-row) :is(b, strong, small) { color: inherit; }
html[data-theme="dark"] #send-view :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select) { background-color: var(--theme-raised); color: var(--theme-text); border-color: var(--theme-line-strong); }
/* Dialog bodies and expanded result cards do not inherit a fixed light palette. */
html[data-theme="dark"] :is(.smart-schedule-config, .smart-schedule-advanced, .smart-schedule-result, .smart-schedule-ai-toggle, .smart-schedule-wave, .smart-schedule-blockers, .smart-schedule-result-details, .smart-schedule-blocker-row, .storage-file-row, .storage-file-details, .pack-analysis-dropzone, .pack-analysis-panel, .pack-analysis-issue-item, .quotation-panel) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] :is(.smart-schedule-metric, .smart-schedule-explanation, .smart-schedule-empty > span, .storage-file-details dt, .pack-analysis-kpi, .pack-analysis-panel-heading, .pack-analysis-issue-excerpt, .pack-analysis-chip, .pack-analysis-feature, .pack-analysis-notes span) { background: var(--theme-raised); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] dialog :is(h1, h2, h3, h4) { color: var(--theme-text); }
html[data-theme="dark"] :is(.smart-schedule-dialog, .storage-drawer-dialog, .pack-analysis-dialog, .quotation-panel) :is(strong, b, dd, label) { color: var(--theme-text); }
html[data-theme="dark"] :is(.smart-schedule-dialog, .storage-drawer-dialog, .pack-analysis-dialog, .quotation-panel) :is(p, small, dt) { color: var(--theme-muted); }
html[data-theme="dark"] .smart-schedule-safety { background: var(--theme-success-bg); color: var(--theme-success); border-color: var(--theme-success); }
html[data-theme="dark"] .smart-schedule-safety :is(strong, small) { color: inherit; }
html[data-theme="dark"] :is(.smart-schedule-metric.warning, .pack-analysis-issue-severity.warning) { background: var(--theme-warning-bg); color: var(--theme-warning); border-color: var(--theme-warning); }
html[data-theme="dark"] .smart-schedule-metric.warning :is(b, svg) { color: inherit; }
html[data-theme="dark"] :is(.smart-schedule-invalid, .smart-schedule-empty.error > span, .pack-analysis-issue-severity.error) { background: var(--theme-danger-bg); color: var(--theme-danger); border-color: var(--theme-danger); }
html[data-theme="dark"] .smart-schedule-invalid :is(strong, small) { color: inherit; }
html[data-theme="dark"] #send-view :is(.send-manual-plan[open] > summary, .send-review-settings > summary, .send-sync-slot-details[open] > summary, .send-inline-material-sync, .send-force-prepare, .quotation-facts > span) { background: var(--theme-raised); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] #send-view :is(.send-force-prepare, .send-recovery-brief) { background: var(--theme-warning-bg); color: var(--theme-warning); }
html[data-theme="dark"] :is(.quotation-panel, .pack-analysis-dialog) :is(span, .field-hint) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.slicer-kernel-policy, .wave-preset-summary, .pack-password-row, .clone-section, .clone-categories > label, .clone-target) { background: var(--theme-raised); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] :is(.settings-dashboard .slicer-advanced-body p, .pack-analysis-dialog .status-text, .pack-analysis-auto-export-note, .pack-password-row > small, .clone-target em, .storage-drawer-toolbar, .storage-device-status, .storage-drawer-tabs button, .smart-schedule-config-note, .smart-schedule-footer > span) { color: var(--theme-muted); }
html[data-theme="dark"] .clone-dialog :is(h3, b, strong, label) { color: var(--theme-text); }
html[data-theme="dark"] :is(.clone-warning, #clone-result, #orca-connection-status) { background: var(--theme-warning-bg); color: var(--theme-warning); border-color: var(--theme-warning); }
html[data-theme="dark"] dialog .eyebrow { color: var(--theme-accent-ink); }
html[data-theme="dark"] .storage-drawer-tabs button.active { color: var(--theme-accent-ink); border-color: var(--theme-accent); }
html[data-theme="dark"] .storage-drawer-dialog > header p { color: var(--theme-muted); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.axis-step-control, .xy-control-pad, .lighting-control, .lighting-toggle) { background: var(--theme-raised); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] #devices-view.device-center-rounded :is(.aux-control-empty, .extrusion-danger-zone span, .lighting-copy small) { color: var(--theme-muted); }
html[data-theme="dark"] #devices-view.device-center-rounded .task-finish b { color: var(--theme-accent-ink); }
html[data-theme="dark"] #devices-view.device-center-rounded #extrude-stop { background: var(--theme-danger-bg); color: var(--theme-danger); border-color: var(--theme-danger); }
html[data-theme="dark"] #devices-view.device-center-rounded .axis-step-control button.active,
:root :is(.primary-button, .primary-small, .blue-button, .send-icon-action.primary) { background: var(--theme-primary-fill); color: #fff; border-color: var(--theme-primary-fill); }
:root :is(.primary-button, .primary-small, .blue-button, .send-icon-action.primary):hover:not(:disabled) { background: var(--theme-primary-hover); }
html[data-theme="dark"] #schedule-view :is(.schedule-advanced, .schedule-advanced > summary:hover, .gantt-row.current-work-row, .gantt-row:hover, .gantt-row-label, .gantt-group-label, .gantt-group-lane, .gantt-lane, .schedule-insight-card, .schedule-insight, .schedule-agenda-card) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-line); }
html[data-theme="dark"] #schedule-view :is(h1, h2, h3, strong, b) { color: var(--theme-text); }
html[data-theme="dark"] #schedule-view :is(small, p, .gantt-footer span, .schedule-agenda-row time span) { color: var(--theme-muted); }
html[data-theme="dark"] #schedule-view .gantt-row-status { background: var(--theme-raised); color: var(--theme-muted); }
html[data-theme="dark"] #schedule-view .gantt-row-status.risk { background: var(--theme-danger-bg); color: var(--theme-danger); }
#schedule-view .gantt-bar { background: var(--theme-accent-soft); color: var(--theme-accent-ink); border-color: var(--theme-line-strong); }
#schedule-view .gantt-bar.live { background: var(--theme-success-bg); color: var(--theme-success); border-color: var(--theme-success); }
#schedule-view .gantt-bar:is(.future, .paused) { background: var(--theme-planned-bg); color: var(--theme-planned); border-color: var(--theme-planned); }
#schedule-view .gantt-bar:is(.clearance, .maintenance) { background: var(--theme-warning-bg); color: var(--theme-warning); border-color: var(--theme-warning); }
#schedule-view .gantt-bar.repair { background: var(--theme-danger-bg); color: var(--theme-danger); border-color: var(--theme-danger); }
#schedule-view .gantt-bar .gantt-bar-copy :is(b, small) { color: inherit; opacity: 1; }
#schedule-view .gantt-bar-progress { background: var(--theme-progress-shade); }
html[data-theme="dark"] #schedule-view .schedule-insight.warning .schedule-insight-icon { background: var(--theme-warning-bg); color: var(--theme-warning); }
html[data-theme="dark"] #schedule-view .schedule-insight.success .schedule-insight-icon { background: var(--theme-success-bg); color: var(--theme-success); }
html[data-theme="dark"] :is(.pack-analysis-export-status, .pack-analysis-history-status, .quotation-version-status, .word-export-status, .schedule-footer > div) { color: var(--theme-muted); }
html[data-theme="dark"] #send-view :is(.quotation-facts, .quotation-lifecycle) { background: var(--theme-soft); border-color: var(--theme-line); }
html[data-theme="dark"] #send-view .quotation-lifecycle span { background: var(--theme-raised); color: var(--theme-muted); }
html[data-theme="dark"] #send-view .quotation-lifecycle span.active { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
html[data-theme="dark"] #send-view .quotation-lifecycle span.complete { background: var(--theme-success-bg); color: var(--theme-success); }
html[data-theme="dark"] :is(.pack-analysis-export-status, .pack-analysis-history-status).success,
html[data-theme="dark"] :is(.quotation-version-status, .word-export-status).ok { color: var(--theme-success); }
html[data-theme="dark"] :is(.pack-analysis-export-status, .pack-analysis-history-status).error { color: var(--theme-danger); }
html[data-theme="dark"] :is(.quotation-version-status, .word-export-status).warning { color: var(--theme-warning); }
html[data-theme="dark"] #settings-view :is(.slicer-advanced-body > p, .slicer-kernel-policy span) { color: var(--theme-muted); }
html[data-theme="dark"] .clone-dialog :is(.clone-section > small, .clone-categories small, .clone-target small) { color: var(--theme-muted); }
html[data-theme="dark"] #devices-view.device-center-rounded .axis-step-control button:not(.active) { color: var(--theme-muted); }
html[data-theme="dark"] #send-view #send-material-sync-state { color: var(--theme-muted); }
html[data-theme="dark"] #send-view #send-material-sync-state.ok { color: var(--theme-success); }
html[data-theme="dark"] #send-view #send-material-sync-state.error { color: var(--theme-danger); }
html[data-theme="dark"] #send-view #send-material-sync-state.working { color: var(--theme-accent-ink); }
html[data-theme="dark"] .clone-dialog .clone-heading small { color: var(--theme-muted); }
@media (max-width: 480px) { .appearance-settings { padding: 16px; } .appearance-settings .appearance-schedule { gap: 8px; } :is(.topbar, .cloud-header) .appearance-disclosure > [data-appearance-settings] { position: fixed; top: 76px; right: 16px; } }
