/* First-stage dark preview: landing page, fashion home and one-click recolor.
 * Paint only. Other workspaces keep their existing palette; real color samples
 * and media are deliberately excluded from surface overrides.
 */
html[data-theme="dark"] {
  --aotu-dark-page: #111214;
  --aotu-dark-shell: #141517;
  --aotu-dark-subtle: #17181b;
  --aotu-dark-panel: #1b1c20;
  --aotu-dark-control: #222328;
  --aotu-dark-control-hover: #2c2d34;
  --aotu-dark-control-pressed: #26232f;
  --aotu-dark-chip: #222328;
  --aotu-dark-chip-hover: #2c2d34;
  --aotu-dark-line: #303137;
  --aotu-dark-text: #f2f2f5;
  --aotu-dark-text-secondary: #b0b0bb;
  --aotu-dark-text-tertiary: #9696a3;
  --aotu-dark-primary: #bca8ff;
  --aotu-dark-primary-hover: #cebeff;
  --aotu-dark-primary-pressed: #ab91f5;
  --aotu-dark-strong: #7652ed;
  --aotu-dark-strong-hover: #8663fa;
  --aotu-dark-focus: #bca8ff;
  color-scheme: dark;
  background: var(--aotu-dark-page);
}

/* Keep selection visible above the shared neutral button and hover rules. */
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"]
  .swatch-button.selected:not(:disabled):not(.is-disabled):not([aria-disabled="true"]) {
  background: #34294e !important;
  border-color: #bca8ff !important;
  color: #ffffff !important;
  outline: 2px solid #bca8ff !important;
  outline-offset: -2px;
}

/* Match the existing final palette layer's specificity, without changing layout. */
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body:not(.feature-focus-mode):not(.section-focus-mode):not(.library-focus-mode):not(.works-focus-mode)
  :is(.function-board, .advanced-board) {
  background: transparent !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body:not(.feature-focus-mode):not(.section-focus-mode):not(.library-focus-mode):not(.works-focus-mode)
  :is(.function-card, .feature-head, .advanced-card) {
  background: var(--aotu-dark-panel) !important;
  color: var(--aotu-dark-text) !important;
  border-color: var(--aotu-dark-line) !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body:not(.feature-focus-mode):not(.section-focus-mode):not(.library-focus-mode):not(.works-focus-mode)
  .function-card:hover .feature-head {
  background: var(--aotu-dark-control-hover) !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body:not(.feature-focus-mode):not(.section-focus-mode):not(.library-focus-mode):not(.works-focus-mode)
  .feature-icon {
  color: var(--aotu-dark-primary) !important;
  background: #292533 !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"]
  :is(.custom-color-picker-row, .custom-color-picker-row.selected) {
  background: var(--aotu-dark-panel) !important;
  color: var(--aotu-dark-text) !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"]
  :is(.inline-color-setting-row input, .inline-color-hex-field, .inline-color-eyedropper) {
  background: var(--aotu-dark-control) !important;
  color: var(--aotu-dark-text) !important;
  border-color: var(--aotu-dark-line) !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"]
  :is(.inline-color-setting-row input:focus-visible, .inline-color-hex-field:focus-within, .inline-color-eyedropper:focus-visible, .swatch-button:focus-visible) {
  outline: 2px solid var(--aotu-dark-focus) !important;
  outline-offset: 2px;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"] .create-button {
  color: #fff !important;
  background: var(--aotu-dark-strong) !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"] .create-button:hover:not(:disabled) {
  background: var(--aotu-dark-strong-hover) !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"] .create-button:disabled {
  background: #302b40 !important;
  color: #aaa3ba !important;
}

/* Recolor delivery placeholders use the same quiet surface as upload panels. */
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"] #detail-page-latest-panel
  .wrinkle-latest-card:is(.is-media-loading, .is-media-load-failed) {
  background: #1b1c20 !important;
  border-color: #303137 !important;
}
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"] #detail-page-latest-panel
  .wrinkle-latest-card:is(.is-media-loading, .is-media-load-failed) .wrinkle-latest-state {
  background: transparent !important;
  color: #b0b0bb !important;
}
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"] #detail-page-latest-panel
  .wrinkle-latest-card:is(.is-media-loading, .is-media-load-failed) .wrinkle-latest-state strong {
  color: #d5d5dd !important;
}
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.feature-focus-mode[data-active-feature="colors"] #detail-page-latest-panel
  .wrinkle-latest-card:is(.is-media-loading, .is-media-load-failed) .wrinkle-latest-state small {
  color: #b0b0bb !important;
}

/* Selected navigation uses the same strong violet as enabled generation actions. */
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body :is(.side-nav a.active:not(.nav-primary), .nav-sublist a.active) {
  color: #ffffff !important;
  background-color: var(--aotu-dark-strong) !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body :is(.side-nav a.active:not(.nav-primary), .nav-sublist a.active) :is(.lucide, .lucide *) {
  color: #ffffff !important;
  stroke: currentColor !important;
  opacity: 1 !important;
}

/* The small selection marker on the far left is white. */
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body :is(.side-nav a.active:not(.nav-primary), .nav-sublist a.active)::before {
  background: #ffffff !important;
}

/* Late feature-specific light fills found by the full public-route audit. */
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body :is(.fashion-home-ad-card, .fashion-buyer-show-appearance-icon, .pet-detail-product-type-icon) {
  background-color: var(--aotu-dark-panel) !important;
  background-image: none !important;
  border-color: var(--aotu-dark-line) !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body .image-to-psd-message.error {
  color: #ffb4bd !important;
  background-color: #2b191d !important;
  border-color: #663039 !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body .ic-minimap-node:not(.is-selected) {
  background-color: #4a4c54 !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body.mobile-personal-page
  :is(
    .generate-button,
    .login-card button,
    .register-card button,
    .recharge-card button,
    .membership-plan-card > button:not(:disabled),
    .card-actions a,
    .card-actions button,
    .payment-submit,
    .empty-state button,
    .config-state-card button,
    .record-card > button,
    .work-load-more,
    .confirm-sheet [data-confirm-ok],
    .auth-switch button.is-active,
    .record-tabs button.is-active,
    .recharge-tabs button.is-active
  ) {
  color: #ffffff !important;
  background-color: var(--aotu-dark-strong) !important;
  background-image: none !important;
  border-color: transparent !important;
}

/* Hidden and late-rendered panels: dialogs, dropdowns, toolbars and work viewers. */
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body
  :is(
    #generation-channel-switch,
    #generation-channel-model-menu,
    #video-material-mention-menu,
    #free-generate-option-grid,
    #works-detail,
    #preview-empty-actions,
    .free-page-stage,
    .free-page-select-menu,
    .free-page-select summary,
    .detail-count-menu,
    .video-compact-menu,
    .set-ratio-select,
    .set-ratio-menu,
    .compare-pane,
    .local-edit-toolbar,
    .repair-brush-row,
    .agent-reference-selection,
    .speech-training-upload
  ) {
  color: var(--aotu-dark-text) !important;
  background-color: var(--aotu-dark-panel) !important;
  background-image: none !important;
  border-color: var(--aotu-dark-line) !important;
  box-shadow: none !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body
  :is(
    #free-page-upload-zone,
    #video-smart-speaking-disabled-tooltip,
    .agent-empty-symbol,
    .agent-mode-chip,
    .agent-drop-hint,
    .advanced-chip,
    .ctm-dialog-icon,
    .voice-clone-preview-icon,
    .speech-training-icon,
    .video-remix-progress-icon,
    .upload-instant-thumb,
    .try-on-garment-preview-chip,
    .print-resolution-bubble,
    .ratio-mini,
    .repair-tool-note,
    #preview-badge
  ) {
  color: var(--aotu-dark-text-secondary) !important;
  background-color: var(--aotu-dark-control) !important;
  background-image: none !important;
  border-color: var(--aotu-dark-line) !important;
  box-shadow: none !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body .free-page-select-menu button.selected {
  color: var(--aotu-dark-text) !important;
  background-color: #34294e !important;
  border-color: var(--aotu-dark-primary) !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body .speech-training-note {
  color: #f2cf8a !important;
  background-color: #2a2115 !important;
  border-color: #5a4726 !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body .detail-module-check {
  color: #ffffff !important;
  background-color: var(--aotu-dark-strong) !important;
  border-color: transparent !important;
}

/* Generation is the primary action across every workspace: use the strong violet,
 * while disabled actions retain a visibly quieter dark surface. */
html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body
  :is(
    .create-button,
    .create-button.full,
    .generate-button,
    #generate,
    #mobile-generate,
    .primary-button,
    .submit-button,
    .confirm-button,
    .free-generate-submit,
    .generation-submit-button,
    .start-generate-button,
    .pet-generate-button
  ):not(.danger-button):not(:disabled):not([aria-disabled="true"]) {
  color: #ffffff !important;
  background-color: var(--aotu-dark-strong) !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body
  :is(
    .create-button,
    .create-button.full,
    .generate-button,
    #generate,
    #mobile-generate,
    .primary-button,
    .submit-button,
    .confirm-button,
    .free-generate-submit,
    .generation-submit-button,
    .start-generate-button,
    .pet-generate-button
  ):not(.danger-button):not(:disabled):not([aria-disabled="true"]):hover {
  background-color: var(--aotu-dark-strong-hover) !important;
}

html[data-theme="dark"]:not(#dark-preview-a):not(#dark-preview-b):not(#dark-preview-c)
  body
  :is(
    .create-button,
    .create-button.full,
    .generate-button,
    #generate,
    #mobile-generate,
    .primary-button,
    .submit-button,
    .confirm-button,
    .free-generate-submit,
    .generation-submit-button,
    .start-generate-button,
    .pet-generate-button
  ):not(.danger-button):is(:disabled, [aria-disabled="true"]) {
  color: #aaa3ba !important;
  background-color: #302b40 !important;
  background-image: none !important;
  border-color: transparent !important;
  opacity: 1 !important;
}

/* Image workspaces: color-only corrections, preserving geometry and real swatches. */
html[data-theme="dark"]:not(#image-colors-a):not(#image-colors-b):not(#image-colors-c):not(#image-colors-d):not(#image-colors-e) body.feature-focus-mode:not([data-active-feature^="video-"]) #task-panel button:is(.selected,.is-selected,[aria-pressed="true"],[aria-selected="true"]):not(.swatch-button):not(:disabled):not([aria-disabled="true"]) {
  background-color: #292237 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: inset 0 0 0 1px #bca8ff !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-theme="dark"]:not(#image-colors-a):not(#image-colors-b):not(#image-colors-c):not(#image-colors-d):not(#image-colors-e) body.feature-focus-mode:not([data-active-feature^="video-"]) #task-panel button:is(.selected,.is-selected,[aria-pressed="true"],[aria-selected="true"]):not(.swatch-button):not(:disabled):not([aria-disabled="true"]) :is(span,strong,small,i,svg) {
  color: #ffffff !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-theme="dark"]:not(#image-colors-a):not(#image-colors-b):not(#image-colors-c):not(#image-colors-d):not(#image-colors-e) body.feature-focus-mode:not([data-active-feature^="video-"]) #task-panel button:is(.selected,.is-selected,[aria-pressed="true"],[aria-selected="true"]):not(.swatch-button):not(:disabled):not([aria-disabled="true"]) .lucide,
html[data-theme="dark"]:not(#image-colors-a):not(#image-colors-b):not(#image-colors-c):not(#image-colors-d):not(#image-colors-e) body.feature-focus-mode:not([data-active-feature^="video-"]) #task-panel button:is(.selected,.is-selected,[aria-pressed="true"],[aria-selected="true"]):not(.swatch-button):not(:disabled):not([aria-disabled="true"]) .lucide * {
  stroke: #ffffff !important;
}
html[data-theme="dark"]:not(#image-colors-a):not(#image-colors-b):not(#image-colors-c):not(#image-colors-d):not(#image-colors-e) body.feature-focus-mode:not([data-active-feature^="video-"]) #task-panel .set-mode-button small {
  color: var(--aotu-dark-text-secondary) !important;
}
html[data-theme="dark"]:not(#image-colors-a):not(#image-colors-b):not(#image-colors-c):not(#image-colors-d):not(#image-colors-e) body.feature-focus-mode:not([data-active-feature^="video-"]) #task-panel .generate-count-label {
  color: var(--aotu-dark-text) !important;
}
html[data-theme="dark"]:not(#image-colors-a):not(#image-colors-b):not(#image-colors-c):not(#image-colors-d):not(#image-colors-e) body.feature-focus-mode:not([data-active-feature^="video-"]) #task-panel .background-official-material-icon {
  background-color: #34294e !important;
  background-image: none !important;
  color: var(--aotu-dark-primary) !important;
}
html[data-theme="dark"]:not(#image-colors-a):not(#image-colors-b):not(#image-colors-c):not(#image-colors-d):not(#image-colors-e) body.feature-focus-mode:not([data-active-feature^="video-"]) #task-panel .lucide {
  color: var(--aotu-dark-primary) !important;
}
html[data-theme="dark"]:not(#image-colors-a):not(#image-colors-b):not(#image-colors-c):not(#image-colors-d):not(#image-colors-e) body.feature-focus-mode:not([data-active-feature^="video-"]) #task-panel :is(input,textarea,select):focus {
  border-color: var(--aotu-dark-primary) !important;
  outline-color: var(--aotu-dark-primary) !important;
}

/* Detail selections include div cards, not only selected buttons. */
html[data-theme="dark"]:not(#detail-color-a):not(#detail-color-b):not(#detail-color-c):not(#detail-color-d):not(#detail-color-e):not(#detail-color-f) body[data-active-feature="detail-page"] .detail-page-module-card:is(.is-selected,.has-count) {
 border-color: #bca8ff !important;
 box-shadow: none !important;
 background-color: #292237 !important;
}
html[data-theme="dark"]:not(#detail-color-a):not(#detail-color-b):not(#detail-color-c):not(#detail-color-d):not(#detail-color-e):not(#detail-color-f) body[data-active-feature="detail-page"] .detail-page-module-card.has-count::after {
 color: #ddd2ff !important;
 background-color: #3b2f55 !important;
}
html[data-theme="dark"]:not(#detail-color-a):not(#detail-color-b):not(#detail-color-c):not(#detail-color-d):not(#detail-color-e):not(#detail-color-f) body[data-active-feature="detail-page"] .detail-style-recommend-badge {
 background-color: #34294e !important;
 background-image: none !important;
 color: #e5dcff !important;
 border-color: transparent !important;
 -webkit-text-fill-color: currentColor !important;
}
html[data-theme="dark"]:not(#detail-color-a):not(#detail-color-b):not(#detail-color-c):not(#detail-color-d):not(#detail-color-e):not(#detail-color-f) body[data-active-feature="detail-page"] .detail-style-preset-auto:is(.selected,[aria-pressed="true"]) .detail-style-recommend-badge {
 background-color: rgba(255,255,255,0.16) !important;
 color: #ffffff !important;
}

/* Canvas palette: paint-only, with media and user-selected text colors preserved. */
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c):has(.ic-app) {
 --ic-bg: #111214;
 --ic-panel: #1b1c20;
 --ic-card: #1b1c20;
 --ic-card-soft: #222328;
 --ic-line: #303137;
 --ic-line-strong: #48434f;
 --ic-text: #f2f2f5;
 --ic-muted: #b0b0bb;
 --ic-soft: #9696a3;
 --ic-accent: #bca8ff;
 --ic-accent-deep: #bca8ff;
 --ic-accent-soft: #292237;
 --ic-function-prompt: #bca8ff;
 --ic-function-prompt-deep: #bca8ff;
 --ic-function-prompt-soft: #292237;
 --ic-dark-glass: #1b1c20;
 --ic-dark-glass-strong: #1b1c20;
 --ic-dark-media: #111214;
}
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) :is(.ic-selection-toolbar,.ic-canvas-settings-popover,.ic-detail-official-library,.ic-speech-panel-footer,.ic-detail-panel-footer,.ic-template-publish-dialog > header,.ic-template-publish-dialog form > footer) {
 background-color: #1b1c20 !important;
 border-color: #303137 !important;
 color: #f2f2f5 !important;
}
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) :is(.ic-detail-module-option,.ic-detail-style-options button,.ic-detail-panel-field select,.ic-detail-product-name-input,.ic-detail-card-field textarea,.ic-detail-card-copy-field textarea,.ic-detail-batch-actions,.ic-detail-batch-actions button,.ic-detail-card-actions button,.ic-detail-card-options button,.ic-detail-card-color-modes button,.ic-detail-industry-grid button,.ic-template-field input,.ic-template-field textarea,.ic-template-field select) {
 background-color: #222328 !important;
 border-color: #303137 !important;
 color: #f2f2f5 !important;
}
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) :is(.ic-library-item.is-selected,.ic-all-tasks-category.is-selected,.ic-psd-panel-row.is-selected,.ic-speech-voice-option.is-selected,.ic-app button[aria-pressed="true"],.ic-app button[aria-checked="true"],.ic-select-menu [aria-selected="true"],.ic-detail-module-option.is-selected) {
 background-color: #292237 !important;
 color: #f2f2f5 !important;
 border-color: transparent !important;
 box-shadow: inset 0 0 0 1px #bca8ff !important;
}
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) :is(.ic-node.is-selected .ic-node-body) {
 border-color: #bca8ff !important;
 box-shadow: none !important;
}
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) :is(.ic-generate-button,.ic-media-process-run,.ic-dialog:not(.is-danger) .is-primary,.ic-template-publish-dialog .is-primary) {
 background-color: #7652ed !important;
 background-image: none !important;
 color: #ffffff !important;
 border-color: transparent !important;
}
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) :is(.ic-generate-button:hover:not(:disabled),.ic-media-process-run:hover:not(:disabled),.ic-dialog:not(.is-danger) .is-primary:hover:not(:disabled)) {
 background-color: #8663fa !important;
}
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) :is(.ic-generate-button:disabled,.ic-media-process-run:disabled,.ic-dialog:not(.is-danger) .is-primary:disabled) {
 background-color: #302b40 !important;
 color: #aaa3ba !important;
}
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) :is(.ic-app input:focus-visible,.ic-app textarea:focus-visible,.ic-app button:focus-visible) {
 outline-color: #bca8ff !important;
}
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) :is(.ic-select-menu [role="option"]:hover:not([aria-selected="true"]),.ic-context-menu button:hover:not(:disabled)) {
 background-color: #2c2d34 !important;
}

html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) :is(.ic-selection-frame,.ic-node-group-frame.is-selected) {
 border-color: #bca8ff !important;
 background-color: rgba(188,168,255,.07) !important;
 box-shadow: none !important;
}

html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) .ic-minimap > span {
 background-color: rgba(188,168,255,.07) !important;
 border-color: #bca8ff !important;
}
html[data-theme="dark"]:not(#canvas-palette-a):not(#canvas-palette-b):not(#canvas-palette-c) .ic-generate-button {
 box-shadow: none !important;
}

/* Account utilities: paint-only charcoal/violet surfaces and semantic action states. */
html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.checkin-reward-panel, .credit-summary-card, .credit-center-summary > div, .credit-package-hero, .credit-package-card, .credit-checkin-card, .credit-record-empty, .member-plan-board, .member-plan-card, .credit-payment-page, .credit-payment-hero, .credit-payment-order, .credit-payment-checkout, .credit-payment-detail-list, .credit-payment-note, .credit-wechat-pay-box) {
  background-color: var(--aotu-dark-panel) !important;
  background-image: none !important;
  border-color: var(--aotu-dark-line) !important;
  color: var(--aotu-dark-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.checkin-card-head h2, .credit-package-price strong, .credit-package-hero strong, .credit-center-summary strong, .member-plan-price strong, .member-plan-head strong) {
  color: var(--aotu-dark-text) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.checkin-card-head p, .checkin-reward-panel small, .checkin-reward-panel span, .checkin-notes li, .credit-package-hero small, .credit-package-hero li, .credit-package-card p, .credit-package-meta b, .credit-package-usage span, .credit-center-summary small, .member-plan-pay-note) {
  color: var(--aotu-dark-text-secondary) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.checkin-card-head span, .checkin-reward-panel strong, .checkin-notes .lucide, .credit-package-price small, .credit-package-hero span, .credit-bucket-pill, .member-plan-feature-list li, .member-plan-feature-list i) {
  color: var(--aotu-dark-primary) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.checkin-card-icon, .credit-package-top em, .credit-summary-card em, .member-plan-popular, .member-plan-current, .credit-payment-amount) {
  background-color: #292237 !important;
  background-image: none !important;
  color: var(--aotu-dark-primary) !important;
  box-shadow: none !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body .credit-summary-card::before {
  background-color: var(--aotu-dark-primary) !important;
  background-image: none !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.credit-package-card.is-recommended, .member-plan-card.is-featured, .member-plan-card.is-current) {
  background-color: #292237 !important;
  border-color: var(--aotu-dark-primary) !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.credit-package-card:hover, .member-plan-card:hover) {
  background-color: var(--aotu-dark-control-hover) !important;
  border-color: var(--aotu-dark-primary) !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.credit-mini-action, .credit-payment-back, .credit-payment-method button, .material-library-tabs button, .unified-material-group-list button) {
  background-color: var(--aotu-dark-control) !important;
  background-image: none !important;
  border-color: var(--aotu-dark-line) !important;
  color: var(--aotu-dark-text) !important;
  box-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.credit-mini-action:hover, .credit-payment-back:hover, .credit-payment-method button:hover, .material-library-tabs button:hover, .unified-material-group-list button:hover) {
  background-color: var(--aotu-dark-control-hover) !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.material-library-tabs button.selected, .unified-material-group-list button.selected, .credit-payment-method button.selected, .credit-payment-method button[aria-pressed="true"], .member-plan-switch button.selected) {
  background-color: #292237 !important;
  border-color: var(--aotu-dark-primary) !important;
  color: var(--aotu-dark-text) !important;
  background-image: none !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.material-library-tabs button .lucide, .credit-mini-action i) {
  color: var(--aotu-dark-primary) !important;
  background-color: transparent !important;
  background-image: none !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.material-library-tabs small, .unified-material-group-list small) {
  color: var(--aotu-dark-text-secondary) !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(#checkin-submit, .credit-package-card button, .member-plan-card button, .credit-checkin-card button, .credit-payment-submit, .credit-wechat-qr button, .material-toolbar-button.primary) {
  background-color: var(--aotu-dark-strong) !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(#checkin-submit:hover:not(:disabled):not([aria-disabled="true"]), .credit-package-card button:hover:not(:disabled):not([aria-disabled="true"]), .member-plan-card button:hover:not(:disabled):not([aria-disabled="true"]), .credit-checkin-card button:hover:not(:disabled):not([aria-disabled="true"]), .credit-payment-submit:hover:not(:disabled):not([aria-disabled="true"]), .credit-wechat-qr button:hover:not(:disabled):not([aria-disabled="true"]), .material-toolbar-button.primary:hover:not(:disabled):not([aria-disabled="true"])) {
  background-color: var(--aotu-dark-strong-hover) !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.material-toolbar-button.danger:not(:disabled):not([aria-disabled="true"])) {
  background-color: #2b191d !important;
  border-color: #663039 !important;
  color: #ffb4bd !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(.material-toolbar-button.danger:hover:not(:disabled):not([aria-disabled="true"])) {
  background-color: #3a2228 !important;
}

html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body :is(#checkin-submit:is(:disabled, [aria-disabled="true"]), .credit-package-card button:is(:disabled, [aria-disabled="true"]), .member-plan-card button:is(:disabled, [aria-disabled="true"]), .credit-checkin-card button:is(:disabled, [aria-disabled="true"]), .credit-payment-submit:is(:disabled, [aria-disabled="true"]), .credit-wechat-qr button:is(:disabled, [aria-disabled="true"]), .material-toolbar-button.primary:is(:disabled, [aria-disabled="true"]), .credit-mini-action:is(:disabled, [aria-disabled="true"]), .credit-payment-back:is(:disabled, [aria-disabled="true"]), .credit-payment-method button:is(:disabled, [aria-disabled="true"]), .material-library-tabs button:is(:disabled, [aria-disabled="true"]), .unified-material-group-list button:is(:disabled, [aria-disabled="true"]), .material-toolbar-button.danger:is(:disabled, [aria-disabled="true"])) {
  background-color: var(--aotu-dark-disabled) !important;
  background-image: none !important;
  color: var(--aotu-dark-text-disabled) !important;
  border-color: var(--aotu-dark-line) !important;
  -webkit-text-fill-color: currentColor !important;
  box-shadow: none !important;
}

/* Expanded detail nodes and empty upload slots must not inherit light gradients. */
html[data-theme="dark"]:not(#canvas-detail-a):not(#canvas-detail-b):not(#canvas-detail-c):not(#canvas-detail-d) :is(.ic-detail-module-editor,.ic-detail-module-generating,.ic-detail-module-visual,.ic-node.is-detail-module-node .ic-node-body) {
 background-color: #1b1c20 !important;
 background-image: none !important;
 color: #f2f2f5 !important;
}
html[data-theme="dark"]:not(#canvas-detail-a):not(#canvas-detail-b):not(#canvas-detail-c):not(#canvas-detail-d) :is(.ic-detail-source-preview.is-empty,.ic-detail-source-slot,.ic-detail-product-slot:not(.is-filled) > button:first-child,.ic-detail-product-slot:not(.is-filled) small,.ic-detail-source-preview.is-empty > span) {
 background-color: #222328 !important;
 background-image: none !important;
 color: #b0b0bb !important;
 border-color: #303137 !important;
}
html[data-theme="dark"]:not(#canvas-detail-a):not(#canvas-detail-b):not(#canvas-detail-c):not(#canvas-detail-d) :is(.ic-detail-card-copy-field > button,.ic-detail-card-copy-head button,.ic-detail-style-badge,.ic-detail-official-library > header nav button,.ic-detail-official-button) {
 background-color: #292237 !important;
 background-image: none !important;
 color: #e5dcff !important;
 border-color: #48434f !important;
 box-shadow: none !important;
}
html[data-theme="dark"]:not(#canvas-detail-a):not(#canvas-detail-b):not(#canvas-detail-c):not(#canvas-detail-d) :is(.ic-detail-style-options button:not([aria-pressed="true"]),.ic-detail-card-color-grid button:not([aria-pressed="true"])) {
 background-color: #222328 !important;
 background-image: none !important;
 color: #f2f2f5 !important;
}
html[data-theme="dark"]:not(#canvas-detail-a):not(#canvas-detail-b):not(#canvas-detail-c):not(#canvas-detail-d) :is(.ic-detail-generate-button:not(:disabled)) {
 background-color: #7652ed !important;
 color: #ffffff !important;
 box-shadow: none !important;
 border-color: transparent !important;
}
html[data-theme="dark"]:not(#canvas-detail-a):not(#canvas-detail-b):not(#canvas-detail-c):not(#canvas-detail-d) :is(.ic-detail-generate-button:disabled) {
 background-color: #302b40 !important;
 color: #aaa3ba !important;
 box-shadow: none !important;
 border-color: transparent !important;
}

/* Keep CTA child text and arrows readable above inherited icon colors. */
html[data-theme="dark"]:not(#cta-color-a):not(#cta-color-b):not(#cta-color-c):not(#cta-color-d):not(#cta-color-e):not(#cta-color-f):not(#cta-color-g) :is(.platform-primary-action,.growth-top-cta,.growth-primary,.nav-media-mode-option.is-active) {
 background-color: #7652ed !important;
 background-image: none !important;
 color: #ffffff !important;
 -webkit-text-fill-color: currentColor !important;
}
html[data-theme="dark"]:not(#cta-color-a):not(#cta-color-b):not(#cta-color-c):not(#cta-color-d):not(#cta-color-e):not(#cta-color-f):not(#cta-color-g) :is(.platform-primary-action,.growth-top-cta,.growth-primary,.nav-media-mode-option.is-active):hover {
 background-color: #8663fa !important;
}
html[data-theme="dark"]:not(#cta-color-a):not(#cta-color-b):not(#cta-color-c):not(#cta-color-d):not(#cta-color-e):not(#cta-color-f):not(#cta-color-g) :is(.platform-primary-action,.growth-top-cta,.growth-primary,.nav-media-mode-option.is-active) :is(span,i,svg),
html[data-theme="dark"]:not(#cta-color-a):not(#cta-color-b):not(#cta-color-c):not(#cta-color-d):not(#cta-color-e):not(#cta-color-f):not(#cta-color-g) .side-nav a.active svg {
 color: #ffffff !important;
 -webkit-text-fill-color: currentColor !important;
}
html[data-theme="dark"]:not(#cta-color-a):not(#cta-color-b):not(#cta-color-c):not(#cta-color-d):not(#cta-color-e):not(#cta-color-f):not(#cta-color-g) :is(.platform-primary-action,.growth-top-cta,.growth-primary,.nav-media-mode-option.is-active,.side-nav a.active) :is(svg,svg *) {
 stroke: #ffffff !important;
}

/* Library navigation uses neutral gray; other utilities retain their accents. */
html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body.library-focus-mode .material-library-shell :is(
  .material-library-tabs > button[data-material-library-category],
  .unified-material-group-list > button[data-material-group]
).selected:not(:disabled):not([aria-disabled="true"]) {
  background-color: #2b2d32 !important;
  border-color: #62666f !important;
  color: #f5f5f5 !important;
}
html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body.library-focus-mode .material-library-shell :is(
  .material-library-tabs > button[data-material-library-category],
  .unified-material-group-list > button[data-material-group]
):focus-visible:not(:disabled):not([aria-disabled="true"]) {
  border-color: #b4b7be !important;
  outline-color: #b4b7be;
}
html[data-theme="dark"]:not(#utility-palette-a):not(#utility-palette-b):not(#utility-palette-c) body.library-focus-mode .material-library-shell .material-library-tabs > button[data-material-library-category]:not(:disabled):not([aria-disabled="true"]) .lucide {
  color: #d7c7ff !important;
  background-color: #33294e !important;
}

/* Failure explanations are plain text, not status badges, in either theme. */
html:not(#work-error-paint-a):not(#work-error-paint-b):not(#work-error-paint-c)
  body .work-meta .work-meta-error {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
