@layer workspace-tone, live-preview;

html[data-preview-theme="dark"] {
  --preview-accent: #065dff;
  --preview-accent-hover: #004cda;
  --preview-accent-border-dark: #80aaff;
}

.cl-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.cl-theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--preview-accent, #065dff);
  cursor: pointer;
}

.cl-theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cl-theme-toggle .cl-theme-sun,
html[data-preview-theme="dark"] .cl-theme-toggle .cl-theme-moon {
  display: none;
}

html[data-preview-theme="dark"] .cl-theme-toggle .cl-theme-sun {
  display: block;
}

.cl-theme-toggle:hover {
  background: var(--preview-accent-tint, #eaf2ff);
}

html[data-preview-theme="dark"] .cl-theme-toggle:hover {
  background: var(--preview-accent);
}

.cl-theme-toggle:focus-visible {
  outline: 2px solid var(--preview-accent-border-dark, var(--preview-accent, #065dff));
  outline-offset: 2px;
}

@layer live-preview {
  html[data-preview-theme="dark"] {
    color-scheme: dark;
    background-color: #292928 !important;
  }

  html[data-preview-theme="dark"] :is(
    #authForm, .security-panel, .security-view, .security-content, .security-card,
    .desktop-account-list, .desktop-account-group, .desktop-account-row, #accountBtn,
    .recharge-card, .recharge-benefit-sidebar, .recharge-main, .recharge-content,
    .recharge-account-copy, .membership-sidebar-faq, .membership-nav-item,
    .membership-offer, .offer-banner, .offer-recommend, .annual-select-label,
    .recharge-checkout, .membership-services, .recharge-top-btn, .membership-back-btn,
    .credit-plan-card, .credit-campaign-tag, .credit-selection-mark,
    .customer-service-card, .customer-service-chat-head, .customer-service-login,
    .customer-service-wechat, .customer-service-avatar, .customer-service-conversation,
    .customer-service-messages, .customer-service-composer, .customer-service-loading,
    .task-center-card, .task-center-toolbar, .task-center-shell, .task-row,
    .smart-tool-popover, .image-model-menu, .creation-rail, .prompt-library-card,
    .psd-export-card, .promotion-center-card, .app-install-guide-card,
    .crealink-chat-card, .crealink-chat-panel, .crealink-chat-composer,
    .asset-preview-card, .professional-files-card, .unified-composer-shell
  ) {
    background: #292928 !important;
    color: #ebebeb !important;
    border-color: #494948 !important;
    box-shadow: none !important;
  }

  html[data-preview-theme="dark"] :is(
    #authForm, #rechargeModal, #customerServiceModal, #taskCenterModal,
    #crealinkChatModal, #promotionCenterModal, #creditHistoryModal,
    #professionalFilesModal, #assetPreviewModal, #appInstallGuide,
    #promptLibraryModal, #psd-exportModal
  ) :is(h1,h2,h3,h4,p,a,button,label,span,small,strong,b,li,summary,dt,dd,input,textarea,select,em) {
    color: #ebebeb !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] :is(
    #authForm, #rechargeModal, #customerServiceModal, #taskCenterModal,
    #crealinkChatModal, #promotionCenterModal, #creditHistoryModal, #appInstallGuide
  ) :is(input,textarea,select,button):not([type="checkbox"],[type="radio"],svg *,#authClose,#authTabs button) {
    background-color: #292928 !important;
    border-color: #494948 !important;
  }

  html[data-preview-theme="dark"] #rechargeModal :is(
    .credit-plan-card.is-selected, .membership-offer.is-selected, .credit-selection-mark,
    .membership-nav-item.is-active, .annual-select-label
  ) {
    border-color: #80aaff !important;
  }

  html[data-preview-theme="dark"] #rechargeModal :is(.recharge-card,.recharge-main,.membership-offer,.credit-plan-card)::before,
  html[data-preview-theme="dark"] #rechargeModal :is(.recharge-card,.recharge-main,.membership-offer,.credit-plan-card)::after {
    background: none !important;
  }

}

@layer live-preview {
  html[data-preview-theme="dark"] .app-shell :is(
    .focus-example,.focus-example-art,.focus-example-copy,.unified-composer-shell,
    .config-step,#dashboardPromptSurface,#promptBox,.unified-reference-stack,
    .dashboard-reference-home,.referenceUploadAction,.reference-slot,.reference-upload,
    .smart-tool-popover,.image-model-menu,.generation-loading-card,.result-card
  ), html[data-preview-theme="dark"] #taskCenterModal :is(
    [class*="task-center"],[class*="task-search"],.task-row,.task-row-thumb
  ) {
    background: #292928 !important;
    color: #ebebeb !important;
    border-color: #494948 !important;
    box-shadow: none !important;
  }

  html[data-preview-theme="dark"] #moduleTabs button.module-user-selected,
  html[data-preview-theme="dark"] .credit-plan-card.is-selected {
    outline: 1px solid #80aaff;
    outline-offset: -1px;
  }

}

@layer live-preview {
  html[data-preview-theme="dark"] :is(
    .app-shell,#dashboardCreationPane,.prompt-library-shell,.prompt-library-prompt,
    .prompt-library-toolbar,.prompt-library-search,.prompt-library-tab,.generation-placeholder-icon.is-failed
  ) {
    background: #292928 !important;
    color: #ebebeb !important;
    border-color: #494948 !important;
    box-shadow: none !important;
  }

  html[data-preview-theme="dark"] :is(#promptBox,.config-step,#dashboardCreationPane)::before,
  html[data-preview-theme="dark"] :is(#promptBox,.config-step,#dashboardCreationPane)::after {
    background: none !important;
    box-shadow: none !important;
  }

  html[data-preview-theme="dark"] :is(#moduleTabs button.module-user-selected,#generateBtn) {
    background: #292928 !important;
    color: #ebebeb !important;
    border-color: #80aaff !important;
    outline: 1px solid #80aaff;
    outline-offset: -1px;
  }

  html[data-preview-theme="dark"] :is(#moduleTabs button.module-user-selected,#generateBtn):hover {
    background: #172f57 !important;
  }

  html[data-preview-theme="dark"] .app-shell :is(
    .workspace-shortcut-icon > *,
    .workspace-account-chevron
  ) {
    color: #ebebeb !important;
  }
}

@layer live-preview {
  html[data-preview-theme="dark"] body:has(.download-platforms),
  html[data-preview-theme="dark"] :is(.site-header,.download-heading,.platform-card,.download-site-footer):where(body:has(.download-platforms) *) {
    background: #292928 !important;
    border-color: #494948 !important;
    color: #ebebeb !important;
    box-shadow: none !important;
  }

  html[data-preview-theme="dark"] body:has(.download-platforms) :is(h1,h2,h3,p,a,span,strong,small) {
    color: #ebebeb !important;
  }

}

@layer live-preview {
  html[data-preview-theme="dark"] :is(
    .crealink-chat-shell,.crealink-chat-sidebar,.crealink-chat-main,.crealink-chat-head,
    .crealink-chat-message,.crealink-chat-new,
    .promotion-center-head,.promotion-brand-mark,.promotion-account-badge,
    .promotion-invite-hero,.promotion-hero-symbol,.promotion-enroll,.promotion-join-state
  ) {
    background: #292928 !important;
    border-color: #494948 !important;
    color: #ebebeb !important;
    box-shadow: none !important;
  }

  html[data-preview-theme="dark"] .promotion-head-divider {
    background: #505050 !important;
  }

}

@layer live-preview {
}

@layer workspace-tone {

  html[data-preview-theme="dark"] .cl-home .cl-button:not(:disabled) {
    background: var(--preview-accent) !important;
    border-color: var(--preview-accent) !important;
    color: #fff !important;
  }

  html[data-preview-theme="dark"] .cl-home .cl-button:not(:disabled):is(:hover,:focus-visible) {
    background: var(--preview-accent-hover) !important;
  }

  html[data-preview-theme="dark"] .cl-theme-toggle {
    color: #b9d1ff !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel {
    background: #30302f !important;
    color: #ebebeb !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel :is(.auth-methods,.auth-subpanel) {
    background: #292928 !important;
    border-color: #494948 !important;
    box-shadow: none !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel input:not([type="checkbox"]) {
    background: #383837 !important;
    border-color: #555554 !important;
    color: #ebebeb !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel input:not([type="checkbox"])::placeholder {
    color: #b8b8b8 !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel input:not([type="checkbox"]):focus {
    border-color: var(--preview-accent-border-dark) !important;
    box-shadow: 0 0 0 3px #065dff30 !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #383837 inset !important;
    -webkit-text-fill-color: #ebebeb !important;
    caret-color: #ebebeb !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel .sms-code-row button:enabled {
    background: #27384f !important;
    border: 1px solid #567bb6 !important;
    color: #c6dcff !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel .sms-code-row button:enabled:is(:hover,:focus-visible) {
    background: #304b73 !important;
    border-color: var(--preview-accent-border-dark) !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel .sms-code-row button:disabled {
    background: #383837 !important;
    border: 1px solid #555554 !important;
    color: #b8b8b8 !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel :is(.auth-link,.auth-terms-acceptance a,#authTabs button) {
    color: #b9d1ff !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel :is(#authClose,#authTabs button) {
    background-color: transparent !important;
    background-image: none !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    transition-property: color !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel #authClose:is(:hover,:focus-visible) {
    background: #434342 !important;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel #authTabs button:is(:hover,:focus-visible) {
    text-decoration: underline !important;
    text-underline-offset: 3px;
  }

  html[data-preview-theme="dark"] #authModal.auth-form-open .auth-login-panel :is(#authSubmit,.auth-methods button.active):enabled {
    background: var(--preview-accent) !important;
    color: #fff !important;
  }

  html[data-preview-theme="dark"] :is(
    .cl-home .cl-header, .lime-workbench, .lime-inner, .topbar, .recharge-benefit-sidebar,
    .crealink-chat-sidebar
  ) {
    background-color: #242424 !important;
  }

  html[data-preview-theme="dark"] :is(
    #dashboardCreationPane,.dashboard-recent,.dashboard-scenes,.dashboard-featured,
    .template-card,.dashboard-scene-copy,.focus-example,.security-panel,.desktop-account-list,
    .desktop-account-group,.desktop-account-row,.customer-service-card,.customer-service-chat-head,
    .membership-offer,.credit-plan-card,.recharge-checkout,.membership-services,
    .task-center-card,.smart-tool-popover,.prompt-library-shell,.promotion-center-card
  ) {
    background-color: #30302f !important;
  }

  html[data-preview-theme="dark"] :is(
    #promptBox,#dashboardPromptSurface,.workspace-global-search,.workspace-global-search input,
    #referenceUploadZone,.focus-example-art,.prompt-library-prompt
  ) {
    background-color: #323231 !important;
  }

  html[data-preview-theme="dark"] :is(
    .cl-home .cl-description,.cl-home .cl-footer p,.design-record-copy small,
    .dashboard-brand-caption,.dashboard-scenes header p,.template-meta,
    .recharge-card .recharge-title-copy p,.customer-service-chat-head p
  ) {
    color: #b8b8b8 !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] :is(
    #moduleTabs button.module-user-selected,#generateBtn
  ) {
    background: var(--preview-accent) !important;
    border-color: var(--preview-accent-border-dark) !important;
    outline-color: var(--preview-accent-border-dark);
  }

  html[data-preview-theme="dark"] :is(
    #moduleTabs button.module-user-selected,#generateBtn
  ):hover {
    background: var(--preview-accent-hover) !important;
  }

  html[data-preview-theme="dark"] .cl-home .cv-workspace .cv-app-sidebar > b {
    color: #000 !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] .cl-home .cv-workspace .cv-app-composer > p {
    color: #283240 !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] .cl-home .cv-workspace .cv-app-composer > :is(small,div) {
    color: #596474 !important;
  }

  html[data-preview-theme="dark"] .cl-home .cv-workspace .cv-app-composer > .cv-completion {
    color: #3b694a !important;
  }

  html[data-preview-theme="dark"] .cl-home .cv-workspace .cv-app-sidebar > span.active {
    background: #eaf2ff !important;
    color: var(--preview-accent) !important;
  }

  html[data-preview-theme="dark"] .cl-home .cv-workspace .cv-app-composer > div > b,
  html[data-preview-theme="dark"] .cl-home .cv-workspace .cv-app-composer > i {
    background: var(--preview-accent) !important;
  }

  html[data-preview-theme="dark"] .workspace-global-search input::placeholder {
    color: #b8b8b8 !important;
    -webkit-text-fill-color: currentColor !important;
  }
}

@layer workspace-tone {
  html[data-preview-theme="dark"] .smart-tool-button:is(:hover,:focus-visible,[aria-expanded="true"]) {
    background: #414140 !important;
    border-color: #565655 !important;
    color: #f1f1f1 !important;
  }

  html[data-preview-theme="dark"] :is(.smart-tool-popover,.image-model-menu) :is(button.choice,[role="option"]) {
    background: #30302f !important;
    border-color: #494948 !important;
    color: #ebebeb !important;
  }

  html[data-preview-theme="dark"] :is(.smart-tool-popover,.image-model-menu) :is(button.choice,[role="option"]):is(:hover,:focus-visible) {
    background: #414140 !important;
    border-color: #626261 !important;
  }

  html[data-preview-theme="dark"] :is(.smart-tool-popover,.image-model-menu) :is(button.choice,[role="option"]):is(.active,[aria-pressed="true"],[aria-selected="true"]) {
    background: var(--preview-accent) !important;
    border-color: #6d95d8 !important;
    color: #f2f7ff !important;
  }

  html[data-preview-theme="dark"] #smartRatioMenu :is(#ratioPanel,#sizePanel) {
    background: transparent !important;
    color: #ebebeb !important;
  }

  html[data-preview-theme="dark"] #smartRatioMenu #ratioChoices {
    border-radius: 14px !important;
    row-gap: 4px !important;
  }

  html[data-preview-theme="dark"] #smartRatioMenu :is(.ratio-use-choice,.dimension-input,#customSizeConfirm) {
    border-radius: 10px !important;
  }

  html[data-preview-theme="dark"] #smartRatioMenu .ratio-shape > i {
    border-radius: 3px !important;
  }

  html[data-preview-theme="dark"] #smartRatioMenu :where(.ratio-use-choice,.dimension-input,#customSizeConfirm) {
    background: #363635 !important;
    border-color: #50504f !important;
    color: #ebebeb !important;
  }

  html[data-preview-theme="dark"] #smartRatioMenu .ratio-shape > i {
    border-color: #d1d1d0 !important;
  }

  html[data-preview-theme="dark"] #smartRatioMenu :is(.ratio-use-choice,#customSizeConfirm):is(:hover,:focus-visible) {
    background: #313d50 !important;
    border-color: var(--preview-accent-border-dark) !important;
    color: #fff !important;
  }

  html[data-preview-theme="dark"] #smartRatioMenu .ratio-use-choice.active {
    background: var(--preview-accent) !important;
    border-color: var(--preview-accent-border-dark) !important;
    color: #fff !important;
  }

  html[data-preview-theme="dark"] #smartRatioMenu .dimension-input:focus-within {
    border-color: var(--preview-accent-border-dark) !important;
  }

  html[data-preview-theme="dark"] #smartRatioMenu .dimension-input input::placeholder {
    color: #b8b8b8 !important;
  }

  html[data-preview-theme="dark"] #dashboardCreationPane :is(
    #dashboardAddImage,#referenceUploadAction,#promptProfessionalizeBtn,#promptLibraryOpenBtn
  ):is(:hover,:focus-visible) {
    background: var(--preview-accent) !important;
    border-color: var(--preview-accent-border-dark) !important;
    color: #fff !important;
    box-shadow: none !important;
  }

  html[data-preview-theme="dark"] #dashboardCreationPane #promptLibraryOpenBtn .prompt-library-icon::after {
    filter: brightness(0) invert(.92);
  }

  html[data-preview-theme="dark"] #promptLibraryOpenBtn svg {
    color: #dededd !important;
    stroke: currentColor !important;
  }

  /* The shipped iframe owns the motion. Invert its rendered palette only. */
  html[data-preview-theme="dark"] .cr-generation-orbs-frame {
    filter: invert(1) !important;
  }

  html[data-preview-theme="dark"] :is(.cr-render-stage,.cr-mobile-orbs-stage):has(> .cr-generation-orbs-frame) {
    background: #000 !important;
  }

  html[data-preview-theme="dark"] :is(
    .design-loader,.result-pending-artwork,.design-conversation-progress:not(.is-failed),
    .mobile-creator-progress:not(.error)
  ):has(.cr-generation-orbs-frame) {
    background: #30302f !important;
    border-color: #494948 !important;
    color: #ebebeb !important;
  }

  html[data-preview-theme="dark"] :is(
    .design-loader,.result-pending-artwork,.design-conversation-progress:not(.is-failed),
    .mobile-creator-progress:not(.error)
  ):has(.cr-generation-orbs-frame) :is(
    .generation-loading-status,.progress-meter-head,.result-generation-percent,
    .conversation-generation-percent,#progressPercent
  ) {
    color: #ebebeb !important;
  }
}

@layer workspace-tone {
  html[data-preview-theme="dark"] #workspaceTopbar {
    --shortcut-ink: #dededd;
    --shortcut-fill: #393938;
  }

  html[data-preview-theme="dark"] #workspaceTopbar :is(.workspace-shortcut-icon,.workspace-global-search svg,.shortcut-icon-accent) {
    color: var(--shortcut-ink) !important;
    stroke: var(--shortcut-ink) !important;
  }

  html[data-preview-theme="dark"] #workspaceTopbar .shortcut-icon-surface {
    fill: var(--shortcut-fill) !important;
  }

  html[data-preview-theme="dark"] #workspaceTopbar .workspace-account-chevron {
    color: var(--shortcut-ink) !important;
    border-color: var(--shortcut-ink) !important;
  }

  html[data-preview-theme="dark"] #workspaceTopbar :is(a,button):is(:hover,:focus-visible,[aria-expanded="true"]) {
    background: #393938 !important;
    border-color: #515150 !important;
    box-shadow: none !important;
  }

  html[data-preview-theme] #workspaceTopbar .cl-theme-toggle {
    display: inline-grid !important;
    flex: 0 0 36px;
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: var(--preview-accent) !important;
    box-shadow: none !important;
  }

  html[data-preview-theme] #workspaceTopbar .cl-theme-toggle svg {
    width: 18px !important;
    height: 18px !important;
  }

  html[data-preview-theme]:not([data-preview-theme="dark"]) #workspaceTopbar .cl-theme-sun,
  html[data-preview-theme="dark"] #workspaceTopbar .cl-theme-moon {
    display: none !important;
  }

  html[data-preview-theme="dark"] #workspaceTopbar .cl-theme-toggle {
    color: #b9d1ff !important;
  }

  html[data-preview-theme="light"] #workspaceTopbar .cl-theme-toggle:hover {
    background: #eaf2ff !important;
  }

  html[data-preview-theme="dark"] #workspaceTopbar .cl-theme-toggle:hover {
    background: #393938 !important;
  }

  html[data-preview-theme] #workspaceTopbar .cl-theme-toggle:focus-visible {
    outline: 2px solid var(--preview-accent-border-dark, var(--preview-accent)) !important;
    outline-offset: 2px;
  }

  html[data-preview-theme="dark"] #workspaceTopbar :is(#workbenchInstallBtn,#usageGuideBtn,#workspaceNotificationBtn,#customerServiceBtn) {
    border-radius: 8px !important;
  }

  html[data-preview-theme="dark"] #workspaceTopbar :is(#workbenchInstallBtn,#usageGuideBtn,#workspaceNotificationBtn,#customerServiceBtn):is(:hover,:focus-visible,[aria-expanded="true"]) {
    background: var(--preview-accent) !important;
    border-color: var(--preview-accent-border-dark) !important;
  }

  html[data-preview-theme="dark"] #moduleTabs button.module-user-selected {
    background: var(--preview-accent-hover) !important;
    border-color: var(--preview-accent-border-dark) !important;
    outline-color: var(--preview-accent-border-dark);
  }

  html[data-preview-theme="dark"] .workspace-carousel-dots button:is(.is-active,[aria-current="true"]) {
    background: var(--preview-accent) !important;
    border-color: var(--preview-accent-border-dark) !important;
    box-shadow: inset 0 0 0 1px var(--preview-accent-border-dark) !important;
  }

  html[data-preview-theme="dark"] #moduleTabs button:is(:hover,:focus-visible),
  html[data-preview-theme="dark"] #dashboardHomeBtn:is(:hover,:focus-visible) {
    background: var(--preview-accent) !important;
    border-color: var(--preview-accent-border-dark) !important;
    box-shadow: none !important;
    color: #fff !important;
  }

  html[data-preview-theme="dark"] #moduleTabs button:is(:hover,:focus-visible) :is(.module-icon,.module-tab-copy,.module-tab-copy > b) {
    color: #fff !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] :is(#moduleTabs,#dashboardHomeBtn) button:not(.module-user-selected):is(:hover,:focus-visible) .module-line-icon {
    stroke: currentColor !important;
  }

  html[data-preview-theme="dark"] #rechargeModal .recharge-account-bar::before,
  html[data-preview-theme="dark"] #rechargeModal .recharge-account-bar::after {
    display: none !important;
  }

  html[data-preview-theme="dark"] #rechargeModal .recharge-benefit-sidebar::after {
    display: none !important;
  }

  html[data-preview-theme="dark"] #rechargeModal #rechargeConfirm:disabled {
    background: #3b3b3a !important;
    border-color: #525251 !important;
    box-shadow: none !important;
    color: #bdbdbc !important;
  }

  html[data-preview-theme="dark"] #rechargeModal #rechargeConfirm:enabled {
    background: var(--preview-accent) !important;
    border-color: var(--preview-accent-border-dark) !important;
    color: #fff !important;
  }

  html[data-preview-theme="dark"] #rechargeModal .membership-services > div {
    border-color: #494948 !important;
  }

  html[data-preview-theme="dark"] #rechargeModal .membership-services i {
    background: #393938 !important;
    color: #dededd !important;
  }

  html[data-preview-theme="dark"] #rechargeModal .trial-plan-card :is(.annual-price-line,.offer-benefits > span)::before {
    color: #8fb6ff !important;
  }
}

@layer workspace-tone {
  html[data-preview-theme="dark"] :is(
    .dashboard-featured [data-home-filter], .workspace-category-nav button,
    .dashboard-scene-load-icon, .dashboard-catalog-status, .template-view-all
  ) {
    background: #393938 !important;
    border-color: #4d4d4c !important;
    color: #ebebeb !important;
    box-shadow: none !important;
  }

  html[data-preview-theme="dark"] :is(
    .dashboard-featured [data-home-filter], .workspace-category-nav button
  ):is(:hover,:focus-visible,.active,[aria-pressed="true"]) {
    background: var(--preview-accent) !important;
    border-color: #5b7cb3 !important;
    color: #f2f7ff !important;
  }

  html[data-preview-theme="dark"] #dashboardRecent :is(.design-records,.design-record-strip) {
    background: transparent !important;
  }

  html[data-preview-theme="dark"] #dashboardRecent .design-records-head {
    border-color: #494948 !important;
  }

  html[data-preview-theme="dark"] #dashboardRecent #openAllTasksBtn {
    background: transparent !important;
    border-color: #565655 !important;
  }

  html[data-preview-theme="dark"] #dashboardRecent #openAllTasksBtn:is(:hover,:focus-visible),
  html[data-preview-theme="dark"] .dashboard-catalog-load button:is(:hover,:focus-visible) .dashboard-scene-load-icon {
    background: var(--preview-accent) !important;
    border-color: #5b7cb3 !important;
  }

  html[data-preview-theme="dark"] #taskCenterModal :is(.task-center-toolbar,#taskCenterList,.task-search-icon,#taskSearchInput) {
    background: transparent !important;
  }

  html[data-preview-theme="dark"] #taskCenterModal .task-center-search {
    background: #363635 !important;
    border-color: #50504f !important;
  }

  html[data-preview-theme="dark"] #taskCenterModal .task-center-search:focus-within {
    border-color: var(--preview-accent-border-dark) !important;
  }

  html[data-preview-theme="dark"] #taskCenterModal :is(#taskSearchSummary,.task-row-copy small),
  html[data-preview-theme="dark"] #taskCenterModal #taskSearchInput::placeholder {
    color: #b8b8b8 !important;
  }

  html[data-preview-theme="dark"] #taskCenterModal .task-row {
    background: #30302f !important;
    border-color: #494948 !important;
  }

  html[data-preview-theme="dark"] #taskCenterModal .task-row:is(:hover,:focus-visible) {
    background: #303944 !important;
    border-color: var(--preview-accent-border-dark) !important;
  }

  html[data-preview-theme="dark"] #taskCenterModal .task-row > em::after {
    color: #b9d1ff !important;
  }

  html[data-preview-theme="dark"] #taskCenterModal .task-row.completed .task-row-status {
    color: #a8e3c5 !important;
  }

  html[data-preview-theme="dark"] #taskCenterModal .task-row.failed .task-row-status {
    color: #ffb5c1 !important;
  }

  html[data-preview-theme="dark"] #crealinkChatModal :is(
    .crealink-chat-bubble,.crealink-chat-prompt-segment,.crealink-chat-document-card,
    .crealink-chat-use-prompt,.crealink-chat-avatar,.crealink-chat-attachment
  ) {
    background: #30302f !important;
    border-color: #494948 !important;
    color: #ebebeb !important;
    box-shadow: none !important;
  }

  html[data-preview-theme="dark"] #crealinkChatModal :is(.crealink-chat-prompt-segment,.crealink-chat-use-prompt) {
    background: #393938 !important;
  }

  html[data-preview-theme="dark"] #crealinkChatModal .crealink-chat-use-prompt::after {
    background: #35445d !important;
    color: #d4e4ff !important;
  }

  html[data-preview-theme="dark"] #crealinkChatInput::placeholder {
    color: #b8b8b8 !important;
  }

  html[data-preview-theme="dark"] #crealinkChatModal :is(#crealinkChatSend,#crealinkChatNew):enabled {
    background: var(--preview-accent) !important;
    border-color: var(--preview-accent-border-dark) !important;
    color: #fff !important;
  }

  html[data-preview-theme="dark"] #crealinkChatModal #crealinkChatSend:disabled {
    background: #3b3b3a !important;
    border-color: #525251 !important;
    color: #bdbdbc !important;
  }

  html[data-preview-theme="dark"] body:has(.download-platforms) :is(
    .site-header,.download-shell,.download-heading,.download-site-footer,.footer-directory,
    .footer-legal,.install-help
  ) {
    background: #292928 !important;
    border-color: #494948 !important;
    color: #ebebeb !important;
  }

  html[data-preview-theme="dark"] .download-platforms :is(.platform-card,.download-button.secondary) {
    background: #30302f !important;
    border-color: #494948 !important;
    color: #ebebeb !important;
  }

  html[data-preview-theme="dark"] .download-platforms :is(.platform-logo,.install-help summary) {
    color: #dededd !important;
  }

  html[data-preview-theme="dark"] .download-platforms .download-button.primary {
    background: var(--preview-accent) !important;
    border-color: var(--preview-accent) !important;
    color: #fff !important;
  }

}

@layer workspace-tone {
  @media (min-width: 761px) {
    html[data-preview-theme="dark"] body.desktop-focus-workspace #dashboardCreationPane :is(
      .config-step,#dashboardPromptSurface,#promptBox,#briefInput,.dashboard-composer-toolbar,#dashboardInputAssets
    ) {
      background: transparent !important;
    }

    html[data-preview-theme="dark"] body.desktop-focus-workspace #dashboardCreationPane #briefInput::placeholder {
      color: #b8b8b8 !important;
    }

    html[data-preview-theme="dark"] body.desktop-focus-workspace #dashboardInputAssets:not(.focus-has-assets) {
      border-color: #595958 !important;
    }
  }
}

@layer workspace-tone {
  #progressView[data-conversation-owned] {
    display: none !important;
  }

  html[data-preview-theme="dark"] :is(#dashboardResultMeta,.design-conversation-turn) .dashboard-result-tags > span,
  html[data-preview-theme="dark"] .design-conversation-context .design-conversation-reference {
    background: #353534 !important;
    border-color: #545453 !important;
    color: #ebebeb !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.has-result-details .asset-preview-result-panel {
    background: #30302f !important;
    border-color: #494948 !important;
    color: #ebebeb !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.has-result-details .asset-preview-result-info :is(p,small,span) {
    color: #ebebeb !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.has-result-details :is(.asset-preview-tool-actions,.asset-preview-save-actions) {
    border-color: #494948 !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.has-result-details
  :is(#assetPreviewClose,.asset-preview-result-actions button,.asset-preview-tool-actions button,.asset-preview-result-thumbs button) {
    background: #393938 !important;
    border-color: #565655 !important;
    color: #ebebeb !important;
    box-shadow: none !important;
    --detail-icon-color: #9fc1ff !important;
    --detail-icon-bg: #26374f !important;
    --detail-icon-fill: #375784 !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.has-result-details
  :is(#assetPreviewClose,.asset-preview-result-actions button,.asset-preview-tool-actions button):is(:hover,:focus-visible) {
    background: #444443 !important;
    border-color: #80aaff !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.has-result-details .asset-preview-result-thumbs button.active {
    border-color: #80aaff !important;
  }
}

@layer workspace-tone {
  html[data-preview-theme="dark"] #assetPreviewModal.conversation-selection .asset-preview-card {
    --selection-line: #50504f !important;
    --selection-ink: #ebebeb !important;
    --selection-muted: #bcbcbc !important;
    --selection-soft: #253952 !important;
    --selection-accent: #8cb5ff !important;
    --workspace-canvas: #252524 !important;
    background: #30302f !important;
    border-color: var(--selection-line) !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.conversation-selection .asset-preview-card > aside {
    background: #30302f !important;
    border-color: var(--selection-line) !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.conversation-selection #assetPreviewStage {
    background: var(--workspace-canvas) !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.conversation-selection :is(
    #assetPreviewClose,.local-edit-selection-actions button,#localEditSelectionStatus
  ) {
    background: #393938 !important;
    border-color: var(--selection-line) !important;
    color: var(--selection-ink) !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.conversation-selection #localEditSelectionStatus.ready,
  html[data-preview-theme="dark"] #assetPreviewModal.conversation-selection
  :is(#assetPreviewClose,.local-edit-selection-actions button):is(:hover,:focus-visible):not(:disabled) {
    background: var(--selection-soft) !important;
    border-color: var(--selection-accent) !important;
    color: #d7e6ff !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.conversation-selection #localEditSubmit {
    background: var(--preview-accent) !important;
    color: #fff !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] #assetPreviewModal.conversation-selection
  :is(.local-edit-selection-actions button,#localEditSubmit):disabled {
    background: #383837 !important;
    border-color: #50504f !important;
    color: #ababaa !important;
    opacity: 1 !important;
  }

  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 .professional-files-card {
    --export-surface: #30302f;
    --export-field: #393938;
    --export-line: #535352;
    --export-muted: #bcbcbc;
    --export-selected: #253952;
    background: #272726 !important;
    border-color: var(--export-line) !important;
  }

  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 .download-format-option > span,
  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 :is(#professionalPrintDpi,#professionalDownloadCancel) {
    background: var(--export-field) !important;
    border-color: var(--export-line) !important;
    color: #ebebeb !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 .download-format-option:not(.unavailable):hover > span,
  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 .download-format-option:has(input:focus-visible) > span,
  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 #professionalDownloadCancel:hover {
    background: #444443 !important;
    border-color: #80aaff !important;
  }

  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 .download-format-option:has(input:checked) > span {
    background: var(--export-selected) !important;
    border-color: #80aaff !important;
  }

  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 :is(
    .download-format-copy b,.download-selected b,#professionalMasterState
  ) {
    color: #ebebeb !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 :is(
    .download-format-copy small,.download-format-hint,.download-selected > span,
    #professionalSizeSummary,#professionalPrintDpiStatus,.download-resolution-copy small
  ) {
    color: var(--export-muted) !important;
    -webkit-text-fill-color: currentColor !important;
  }

  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 :is(
    .download-format-field,.download-advanced,.download-panel-footer,.download-dialog-subtitle
  ) {
    border-color: var(--export-line) !important;
  }

  html[data-preview-theme="dark"] #professionalFilesModal.download-layout-v1 :is(
    .download-panel-footer,.download-production-facts
  ) {
    background: var(--export-surface) !important;
  }
}

@layer workspace-tone {
  html[data-preview-theme="dark"] .cr-vector-output .cr-vector-request :is(small,button) {
    background: #353534 !important;
    border-color: #545453 !important;
    color: #ebebeb !important;
    -webkit-text-fill-color: currentColor !important;
  }
}
