/* Reference palette is shared by the existing workspace and legacy page controls. */
html:not([data-workspace-theme="dark"]) body.media-workspace {
  --ws-success: #396d50;
}
html:not([data-workspace-theme="dark"]) body.media-workspace :is(.ws-record-meta, .ws-availability, .ws-eyebrow) {
  color: var(--ws-muted);
}
html:not([data-workspace-theme="dark"]) body.media-workspace .ws-empty > p {
  color: var(--ws-muted);
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="home"] .ws-blue .ws-tool-tag {
  background-color: #585be0;
}
@media (min-width: 768px) {
  html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="home"] .ws-tool-availability {
    color: var(--ws-ink);
  }
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="home"] .ws-discover-search > span {
  color: var(--ws-muted-strong);
}
html:not([data-workspace-theme="dark"]) body.media-workspace :is(.ws-capability>.ws-status, .ws-status-expired, .ws-status-pending, .ws-status-cancelled) {
  color: var(--ws-muted-strong);
}
html:not([data-workspace-theme="dark"]) body.media-workspace .ws-status-completed {
  color: var(--ws-success);
}
html:not([data-workspace-theme="dark"]) body.media-workspace :is(.ws-status-processing, .ws-status-queued) {
  color: #355d9d;
}
html:not([data-workspace-theme="dark"]) body.media-workspace .ws-status-failed {
  color: #a04450;
}
html:not([data-workspace-theme="dark"]) body.media-workspace .ws-status-partial {
  color: #7c5824;
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="download"] .task-title>div>p {
  color: var(--ws-muted) !important;
}
html:not([data-workspace-theme="dark"]) body.media-workspace:is([data-workspace-view="tools"], [data-workspace-view="transcript"]) .wb-hero p {
  color: var(--ws-muted);
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="tools"] .wb-flow-steps li:not(.is-active):not(.is-complete) {
  color: var(--ws-muted);
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="account"] :is(.card span, .empty) {
  color: var(--ws-muted);
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="pricing"] .cp-pricing-intro>p:last-child {
  color: var(--ws-muted);
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="pricing"] .purchase-panel .pricing-tabs button:not(.active) {
  color: var(--ws-muted-strong);
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="pricing"] :is(.preview-hint, .purchase-trust) {
  color: var(--ws-muted);
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="pricing"] :is(
  .purchase-panel #pricingMarketNotice, .purchase-trust a, .agreement a, .product-note:not(.pricing-capability-note),
  .pricing-card-audience, .pricing-card.free-plan .is-locked, .benefit-intro > p, .benefit-row small,
  .usage-estimates__heading small, .usage-estimate > small
) {
  color: var(--ws-muted-strong);
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="pricing"]
.automation-benefit:not(.is-boundary) .automation-benefit__mark {
  color: #2453a5;
}
html:not([data-workspace-theme="dark"]) body.media-workspace[data-workspace-view="pricing"]
.free-compare > div:not(.vip-extra, .limits) > h2 {
  color: var(--ws-success);
}
html:not([data-workspace-theme="dark"]) body.media-workspace:is([data-workspace-view="service"], [data-workspace-view="privacy"]) .legal-lead {
  color: var(--ws-muted) !important;
}

html[data-workspace-theme="dark"] body.media-workspace {
  color-scheme: dark;
  --background: 0 0% 4%;
  --foreground: 0 0% 94%;
  --surface-background: 0 0% 6%;
  --surface-foreground: 0 0% 96%;
  --surface-muted: 0 0% 11%;
  --surface-elevated: 0 0% 14.9%;
  --card: 0 0% 9%;
  --popover: 0 0% 9%;
  --muted-foreground: 0 0% 63.9%;
  --subtle: 0 0% 63.9%;
  --border: 0 0% 17%;
  --brand: 267 53% 54%;
  --brand-hover: 265 48% 43%;
  --brand-soft: 267 42% 18%;
  --brand-soft-foreground: 270 95% 75%;
  --sidebar-background: 0 0% 3.9%;
  --sidebar-foreground: 0 0% 98%;
  --sidebar-accent: 0 0% 14.9%;
  --ws-canvas: hsl(var(--background));
  --ws-surface: hsl(var(--surface-background));
  --ws-panel: hsl(var(--surface-elevated));
  --ws-ink: hsl(var(--foreground));
  --ws-muted: hsl(var(--muted-foreground));
  --ws-muted-strong: var(--ws-muted);
  --ws-line: hsl(var(--border));
  --ws-brand: hsl(var(--brand));
  --ws-brand-soft: hsl(var(--brand-soft));
  --ws-brand-ink: hsl(var(--brand-soft-foreground));
  --ws-success: #6ee7b7;
  --ws-success-soft: #10251c;
  --ws-danger: #fca5a5;
  --ws-danger-soft: #2d1518;
  --ws-warning: #fcd48b;
  --ws-warning-soft: #2a2113;
  --wb-ink: var(--ws-ink);
  --wb-muted: var(--ws-muted);
  --wb-subtle: var(--ws-muted);
  --wb-line: var(--ws-line);
  --wb-line-strong: var(--ws-line);
  --wb-blue: var(--ws-brand);
  --wb-blue-dark: var(--ws-brand-ink);
  --wb-soft: var(--ws-brand-soft);
  --wb-canvas: var(--ws-canvas);
  --wb-surface: var(--ws-surface);
  --wb-success: var(--ws-success);
  --wb-danger: var(--ws-danger);
  --wb-navy: hsl(var(--card));
  --wb-shadow: none;
  --guided-ink: var(--ws-ink);
  --guided-muted: var(--ws-muted);
  --guided-subtle: var(--ws-muted);
  --guided-line: var(--ws-line);
  --guided-line-strong: var(--ws-line);
  --guided-blue: var(--ws-brand);
  --guided-blue-dark: var(--ws-brand-ink);
  --guided-blue-soft: var(--ws-brand-soft);
  --guided-green: var(--ws-success);
  --guided-green-soft: var(--ws-success-soft);
  --guided-surface: var(--ws-surface);
  --guided-bg: var(--ws-canvas);
  --pricing-ink: var(--ws-ink);
  --pricing-muted: var(--ws-muted);
  --pricing-line: var(--ws-line);
  --pricing-blue: var(--ws-brand);
  --pricing-blue-dark: var(--ws-brand-ink);
  --pricing-violet: var(--ws-brand-ink);
  --pricing-violet-soft: var(--ws-brand-soft);
  --pricing-green: var(--ws-success);
  --pricing-green-soft: var(--ws-success-soft);
  --bg: var(--ws-canvas);
  --bg-alt: hsl(var(--surface-muted));
  --surface: var(--ws-surface);
  --surface-alt: hsl(var(--surface-muted));
  --text: var(--ws-ink);
  --text-muted: var(--ws-muted);
  --text-dim: var(--ws-muted);
  --pri: var(--ws-brand-ink);
  --pri-hover: var(--ws-brand-ink);
  --pri-light: var(--ws-brand-soft);
  --pri-gradient: var(--ws-brand);
  --green: var(--ws-success);
  --green-light: var(--ws-success-soft);
  --green-gradient: #087f5b;
  --rose: var(--ws-danger);
  --rose-light: var(--ws-danger-soft);
  --amber-light: var(--ws-warning-soft);
  --clay-inset-sm: none;
  --clay-inset: none;
  --clay-sm: none;
  --clay: none;
  --clay-lg: none;
  --clay-pressed: none;
  --clay-floating: 0 20px 48px #0006;
  --clay-pri: none;
  --clay-pri-pressed: none;
  --hsk-blue: var(--ws-brand);
  --hsk-blue-strong: var(--ws-brand-ink);
  --hsk-ink: var(--ws-ink);
  --hsk-copy: var(--ws-muted);
  --hsk-line: var(--ws-line);
  --hsk-soft: hsl(var(--surface-muted));
  --hsk-green: var(--ws-success);
  --hsk-purple: var(--ws-brand-ink);
  background: var(--ws-canvas);
  color: var(--ws-ink);
  scrollbar-color: #68717f #ffffff0f;
}
html[data-workspace-theme="dark"] body.media-workspace::before,
html[data-workspace-theme="dark"] body.media-workspace::after {
  background: none;
}

/* Chrome, native dialogs, and the account popover. */
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-sidebar, dialog.ws-mobile-menu) {
  background: hsl(var(--sidebar-background));
  color: hsl(var(--sidebar-foreground));
  box-shadow: 1px 0 0 var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace .ws-topbar {
  background: var(--ws-canvas);
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-nav>a, .ws-collapse, .ws-menu-button, .ws-mobile-menu>.ws-brand-row button) {
  color: hsl(var(--sidebar-foreground));
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-nav>a:hover, .ws-nav>a[aria-current=page], .ws-collapse:hover, .ws-account-menu[open]>.ws-account-summary, .ws-account-menu>.ws-account-summary:hover) {
  background: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-foreground));
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-sidebar-links>a, .ws-shell-options>summary, .ws-upgrade, .ws-credit, .ws-record-action, .ws-pagination>button, .ws-mobile-menu>form button, .ws-detail-dialog>form button, .ws-folder-actions button, .scroll-to-top) {
  background: hsl(var(--surface-muted));
  border-color: var(--ws-line);
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(dialog, .ws-shell-options-panel) {
  background: hsl(var(--popover));
  border-color: var(--ws-line);
  color: hsl(var(--surface-foreground));
}
html[data-workspace-theme="dark"] body.media-workspace .ws-asset-filters .ws-shell-options-panel {
  background: hsl(var(--popover));
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-account-panel>a:hover, .ws-account-panel>.ws-logout:hover, .ws-record-action:hover, .ws-account-plan) {
  background: hsl(var(--surface-elevated));
}
html[data-workspace-theme="dark"] body.media-workspace .ws-avatar {
  background: var(--ws-brand-soft);
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace.ws-signed-in .ws-account {
  background: var(--ws-brand-soft);
}
html[data-workspace-theme="dark"] body.media-workspace.ws-signed-in .ws-account-menu>.ws-account-summary {
  background: transparent;
}
html[data-workspace-theme="dark"] body.media-workspace.ws-signed-in .ws-account-menu[open]>.ws-account-summary,
html[data-workspace-theme="dark"] body.media-workspace.ws-signed-in .ws-account-menu>.ws-account-summary:hover {
  background: hsl(var(--sidebar-accent));
}
html[data-workspace-theme="dark"] body.media-workspace .ws-icon {
  filter: brightness(0) invert(1);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-skip:focus, .ws-source-form button, .ws-button, .ws-record-action.ws-primary-action, .ws-folder-actions button[type=submit], .draft-controls button, .ls-actions button:first-child, .ws-discover-search>button, .ws-discover-search>a) {
  background: var(--ws-brand);
  border-color: var(--ws-brand);
  color: #fff;
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-source-form button:hover, .ws-button:hover, .ws-record-action.ws-primary-action:hover) {
  background: hsl(var(--brand-hover));
}

/* Shared surfaces and fields preserve content, previews, and platform artwork. */
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-source-form, .ws-quick-source, .ws-capability, .ws-filters, .ws-task-row, .ws-download-input, .ws-download-demo-result, .parse-entry, .download-collection, .download-collection button, .download-link-queue textarea, .download-link-queue button, .download-link-queue li) {
  background: var(--ws-surface);
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.download-collection, .download-link-queue textarea, .download-link-queue button, .download-link-queue li) {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-record-card, .ws-summary) {
  background: hsl(var(--card));
}
html[data-workspace-theme="dark"] body.media-workspace :is(input, select, textarea) {
  color: var(--ws-ink);
  border-color: var(--ws-line);
  accent-color: var(--ws-brand);
}
html[data-workspace-theme="dark"] body.media-workspace :is(input, textarea)::placeholder {
  color: var(--ws-muted);
  opacity: 1;
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-filters>select, .ws-folder-dialog input, .ws-folder-dialog select, .ws-language select, .draft-controls input) {
  background: var(--ws-surface);
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-hero h1, .ws-hero .ws-greeting, .download-head h1, .ws-page-heading h1, .ws-breadcrumb strong, .ws-empty h3, .ws-discover-empty h3, .ws-discover-empty strong) {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-eyebrow, .ws-hero p.ws-fine-print, .ws-quick-source>summary, .ws-capability p, .ws-section-heading>a, .ws-record-meta, .ws-availability, .ws-empty p, .ws-page-heading>p, .ws-download-help, .ws-download-platforms-more>summary, .ws-download-input>svg, .download-head p, .supported, .ws-filter-row>label, .ws-filter-row>span:first-child, .ws-filter-row>button, .ws-workflow-tabs>a, .ws-workflow-tabs>button, .download-link-queue, .download-link-queue li small, .download-collection li>span, .parse-status, .parse-elapsed, .parse-stages, .task-dismiss, .task-live) {
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-empty, .ws-loading, .download-link-queue, .task-feedback, .parse-progress) {
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.parse-progress, .task-feedback, .task-feedback button, .notice-action, .task-dismiss:hover, .subtitle-format) {
  background: hsl(var(--surface-muted));
  color: var(--ws-ink);
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.parse-progress-head, .parse-label) {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.parse-percent, .parse-stages span.active, .parse-retry) {
  color: var(--ws-danger);
}
html[data-workspace-theme="dark"] body.media-workspace .parse-retry {
  background: var(--ws-danger-soft);
  border-color: #653238;
}
html[data-workspace-theme="dark"] body.media-workspace .scan-track {
  background: hsl(var(--surface-elevated));
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-discover-search, .ws-discover-empty, .ws-record-preview, .ws-task-symbol, .ws-detail-artifacts>a, .ws-download-demo-save, .ws-workflow-tabs, .ws-media-text-history>.ws-category-filters, .ws-media-output-actions .ws-workflow-tabs, .ws-record-toolbar>.ws-category-filters, .ws-empty.ws-asset-empty) {
  background: hsl(var(--surface-muted));
  color: var(--ws-muted);
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace .ws-discover-search>input:disabled {
  color: var(--ws-muted);
  -webkit-text-fill-color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-category-filters>button, .ws-source-tabs>button, .ws-media-output-actions .ws-workflow-tabs>button) {
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-filter-row>button[aria-pressed=true], .ws-category-filters>button[aria-selected=true], .ws-category-filters>button[aria-pressed=true], .ws-source-tabs>button[aria-pressed=true], .ws-workflow-tabs>a[aria-current=page], .ws-workflow-tabs>button[aria-selected=true], .ws-workflow-tabs>button[aria-pressed=true]) {
  background: hsl(var(--surface-elevated));
  color: var(--ws-ink);
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-record-type, .ws-status, .task-status-label, .wb-status) {
  background: hsl(var(--surface-elevated));
  border-color: var(--ws-line);
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace :is(#workspaceDownloadExample, .ws-record-toolbar>[data-workspace-refresh]) {
  background: var(--ws-brand-soft);
  border-color: var(--ws-line);
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace .parse-shell textarea {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=download] .parse-shell #parseBtn:disabled {
  background: hsl(var(--surface-elevated)) !important;
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=download] .task-action {
  color: var(--ws-brand-ink) !important;
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=download] #mediaCard :is(.intent-tab[aria-selected=true], .mode[aria-pressed=true]) {
  color: var(--ws-brand-ink) !important;
}
html[data-workspace-theme="dark"] body.media-workspace #taskList>.task-empty::before {
  background-color: var(--ws-brand-soft) !important;
}
html[data-workspace-theme="dark"] body.media-workspace #localTrends #localTrendsSearch {
  background: hsl(var(--surface-muted));
}
html[data-workspace-theme="dark"] body.media-workspace #localTrends .lt-filter-options>button[aria-pressed=true] {
  background: var(--ws-brand);
  color: #fff;
}

/* Analysis and summary use the same input, report, and language-picker controls. */
html[data-workspace-theme="dark"] body.media-workspace :is(#localTextAiPreview, .lta-example-panel, #workspaceSubtitleOutput) :is(.ws-media-input-frame, .lta-report-reader, .lta-report-card, textarea, input[type=url], input[type=text], select, .lta-language-panel) {
  background: var(--ws-surface);
  border-color: var(--ws-line);
  color: hsl(var(--surface-foreground));
}
html[data-workspace-theme="dark"] body.media-workspace #localTextAiPreview[data-task=summary],
html[data-workspace-theme="dark"] body.media-workspace #workspaceSubtitleOutput .ws-media-input-frame {
  background: var(--ws-surface);
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace :is(#localTextAiPreview, .lta-example-panel) button {
  background: hsl(var(--surface-muted));
  border-color: var(--ws-line);
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace #localTextAiPreview :is(#localTextAiSubmit, #localTextAiApply, #localVideoTextLoad, #localCommentCollect, #localVideoAnalysisSubmit, #localVideoAnalysisConfirm) {
  background: var(--ws-brand);
  border-color: var(--ws-brand);
  color: #fff;
}
html[data-workspace-theme="dark"] body.media-workspace #localTextAiPreview:is([data-task=structure],[data-task=comments]) #localVideoAnalysisSubmit:disabled {
  background: hsl(var(--surface-elevated));
  border-color: var(--ws-line);
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace #localTextAiPreview :is(.lta-entry-modes, .lta-language-button, .lta-target-language select),
html[data-workspace-theme="dark"] body.media-workspace #workspaceSubtitleOutput .ws-source-tabs {
  background: hsl(var(--surface-muted));
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace #localTextAiPreview :is(.lta-entry-modes label:has(input:checked), #localTextAiLanguageList button.is-active, #localTextAiLanguageList button:hover),
html[data-workspace-theme="dark"] body.media-workspace #workspaceSubtitleOutput .ws-source-tabs>button[aria-pressed=true] {
  background: hsl(var(--surface-elevated));
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(#localTextAiPreview, #workspaceSubtitleOutput) .lta-source-box>svg,
html[data-workspace-theme="dark"] body.media-workspace #localTextAiPreview :is(.lta-language-title, .lta-language-search svg, #localTextAiLanguageList button small, #localTextAiLanguageEmpty, #localTextAiRecentStatus, .lta-recent-heading h2, .lta-recent-heading button, .lta-analysis-line-hint) {
  color: var(--ws-muted);
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace #localTextAiPreview .lta-example-link {
  background: var(--ws-brand-soft);
  border-color: var(--ws-line);
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace #localTextAiPreview :is(.lta-language-search, #localTextAiReports, #localCommentSamples) {
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.lta-report-card h3, .wb-kicker) {
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(#localTextAiUploadEntry input[type=file], .ls-import input)::file-selector-button {
  background: hsl(var(--surface-elevated));
  border-color: var(--ws-line);
  color: var(--ws-ink);
}

/* Existing workbench forms and generated text retain their established layout. */
html[data-workspace-theme="dark"] body.media-workspace :is(.wb-command-bar, .wb-source-canvas, .wb-account, .wb-secondary, .wb-language-control, .wb-language-menu, .wb-checkout, .wb-project-section, .wb-workflow, .wb-workflow-check, .wb-method, .wb-artifacts a, .wb-actions button) {
  background: var(--ws-surface);
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.wb-tool-panel, .wb-summary-dock, .wb-url-row, .wb-item, .wb-check, .wb-project, .wb-empty, .wb-delivery-item, .wb-workflow-mark, .wb-language-count, .wb-workflow-configure, .wb-progress) {
  background: hsl(var(--surface-muted));
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.wb-url-row input, .wb-options input, .wb-options select, .wb-dialog textarea) {
  background: var(--ws-surface);
  border-color: var(--ws-line);
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.wb-trust-row, .wb-tool-panel-head h3, .wb-field, .wb-check, .wb-workflow-mark, .wb-method, .wb-progress-copy strong, .wb-flow-steps li) {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.wb-dock-overview, .wb-quote) {
  background: hsl(var(--card));
  border-color: var(--ws-line);
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.wb-workflow:hover, .wb-workflow[data-selected=true], .wb-workflow[aria-checked=true], .wb-workflow[aria-pressed=true], .wb-workflow[data-selected=true] .wb-workflow-mark, .wb-workflow[aria-pressed=true] .wb-workflow-mark, .wb-language-chip, .wb-method.active, .wb-notice, .wb-auth-gate) {
  background: var(--ws-brand-soft);
  border-color: var(--ws-brand);
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.wb-primary, .wb-url-row button, .wb-link-button, .wb-dock-overview>.wb-primary, .wb-channel-url-row button) {
  background: var(--ws-brand);
  color: #fff;
}
html[data-workspace-theme="dark"] body.media-workspace .wb-flow-steps li span {
  background: hsl(var(--surface-elevated));
  border-color: var(--ws-line);
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace .wb-flow-steps li.is-active span {
  background: var(--ws-brand);
  color: #fff;
}

/* Account information, device management, and the native invoice dialog. */
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=account] :is(.summary, .card, .panel, .device-row, .empty, .invoice-cancel, .invoice-dialog input, .invoice-dialog select, .invoice-dialog textarea) {
  background: var(--ws-surface);
  color: var(--ws-ink);
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=account] :is(.head, .item, .invoice-head, .summary .card+.card) {
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=account] :is(.head h1, .card b, .panel h2, .item h3, .device-summary strong, .device-row h3, .invoice-head h2, .invoice-dialog label) {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=account] :is(.head p, .card span, .sub, .item p, .item small, .state small, .side .panel p, .invoice-state, .invoice-head p, .device-summary, .item-dismiss) {
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=account] .device-row p {
  color: var(--ws-muted) !important;
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=account] :is(.state, .invoice-link, .task-list-feedback button) {
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=account] :is(.item-cover, .order-mark, .invoice-close, .task-list-feedback, .item-dismiss:hover) {
  background: var(--ws-brand-soft);
  border-color: var(--ws-line);
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=account] .button {
  background: var(--ws-brand);
  color: #fff;
}

/* Pricing uses semantic variables plus fixed-color purchase and benefits panels. */
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.purchase-panel, .pricing-card, .plan-row, .plan-row:hover, .automation-benefit, .usage-estimates, .usage-estimate, .free-compare, .purchase-value__tier, .pricing-facts, .pricing-assist, .compact-credit-notice, .payment-options, .payment-box, .payment-provider, .payment-country select, .estimator-box, .estimator-form select, .estimator-form input, .estimator-head button) {
  background: hsl(var(--card));
  border-color: var(--ws-line);
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.benefit-intro h1, .benefit-intro p strong, .automation-benefit h2, .usage-estimates__heading strong, .benefit-row h2, .benefit-row p, .purchase-heading h2, .plan-name, .plan-price strong, .pricing-card h3, .pricing-card-price small, .pricing-card-total, .pricing-card-points, .plan-benefit-group li, .pricing-facts span, .payment-head h2, .payment-summary strong, .estimator-form label, .estimator-result p) {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.benefit-intro p, .automation-benefit p, .usage-estimates__heading small, .usage-estimate span, .usage-estimate>small, .benefit-row small, .free-compare li, .product-note, .pricing-mode-help, .preview-hint, .pricing-card-audience, .pricing-card-saving, .pricing-card-term, .pricing-card-note, .purchase-trust, .purchase-trust a, .agreement, .agreement a, .pricing-assist>span, .payment-options summary, .payment-head p, .payment-country, .payment-country small, .payment-summary, .payment-result p, .estimator-result span, .estimator-note) {
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.plan-row.is-selected, .plan-row.is-previewed, .purchase-value, .automation-benefit__mark, .automation-benefit__badge, .benefit-mark, .plan-benefit-group h4, .pricing-card.is-selected .plan-benefit-group h4, .pricing-card-badge, .purchase-value__tier.is-vip, .payment-provider.active, .payment-summary, .estimator-result) {
  background: var(--ws-brand-soft);
  border-color: var(--ws-brand);
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.pricing-card-price, .plan-price small, .usage-estimate b, .usage-estimate b small, .automation-benefit__eyebrow, .purchase-value>strong, .purchase-value__tier.is-vip b, .free-compare .vip-extra h2, .compact-credit-notice strong) {
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.purchase-value__detail, .purchase-value__rights li) {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.purchase-panel .pricing-tabs, .purchase-panel .pricing-tabs button, .purchase-panel .payment-profile-switch button[data-payment-profile], .pricing-card-action, .pricing-assist button, .close) {
  background: hsl(var(--surface-muted));
  border-color: var(--ws-line);
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.purchase-panel .pricing-tabs button.active, .purchase-panel .payment-profile-switch button[data-payment-profile][aria-pressed=true], .purchase-panel .payment-profile-switch button[data-payment-profile]:hover) {
  background: var(--ws-brand-soft);
  color: var(--ws-brand-ink);
  border-color: var(--ws-brand);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.pricing-buy, .pay-action, .checkout-provider-button, .estimator-apply, .recommended, .pricing-card-action:hover, .pricing-card.is-selected .pricing-card-action, .pricing-assist button:hover) {
  background: var(--ws-brand);
  color: #fff;
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] .pricing-card.free-plan .pricing-card-action {
  background: #087f5b;
  color: #fff;
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] .pricing-card.free-plan .pricing-card-ribbon {
  color: var(--ws-canvas);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.benefit-row, .free-compare>div+div, .purchase-panel .pricing-tabs, .payment-head) {
  border-color: var(--ws-line);
}

/* Legacy summary and checkout panels remain reachable from download results. */
html[data-workspace-theme="dark"] body.media-workspace .ws-submenu-panel {
  --ws-panel: hsl(var(--surface-muted));
  background: hsl(var(--popover));
}
html[data-workspace-theme="dark"] body.media-workspace:is([data-workspace-view=service],[data-workspace-view=privacy]) .legal-card {
  background: transparent !important;
}
html[data-workspace-theme="dark"] body.media-workspace:is([data-workspace-view=service],[data-workspace-view=privacy]) .legal-page :is(h1,h2,h3,p,li) {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace:is([data-workspace-view=service],[data-workspace-view=privacy]) .legal-note {
  background: var(--ws-brand-soft);
  border-color: var(--ws-line);
}
html[data-workspace-theme="dark"] body.media-workspace:is([data-workspace-view=service],[data-workspace-view=privacy]) .legal-note a {
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=account] :is(.card, .panel) {
  /* The shared legacy skin marks these white surfaces important. */
  background: var(--ws-surface) !important;
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.cp-pricing-intro h1, #paymentProfileTitle) {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] :is(.cp-pricing-intro>p, #enterprisePlanLink) {
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace :is(#selectedCount, .wb-workflow-badge) {
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=home] .ws-blue .ws-tool-tag {
  background-color: #585be0;
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ai-summary-panel, .ai-summary-status, .ai-summary-empty, .ai-summary-offer__button, .ai-summary-offer__button:hover, .ai-summary-panel__language span, .ai-summary-result__tools button, .conversion-paywall__dialog, .conversion-paywall__fact, .conversion-paywall__plan-option, .conversion-paywall__method, .conversion-paywall__result, .conversion-paywall__secondary) {
  background: hsl(var(--card));
  border-color: var(--ws-line);
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ai-summary-panel h3, .ai-summary-panel legend, .ai-summary-empty strong, .ai-summary-result h4, .ai-summary-status__row, .conversion-paywall h2, .conversion-paywall__fact strong, .conversion-paywall__plan h3, .conversion-paywall__plan ul, .conversion-paywall__order) {
  color: var(--ws-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ai-summary-offer__button small, .ai-summary-panel__intro, .ai-summary-panel__trust, .ai-summary-empty p, .ai-summary-status__hint, .ai-summary-result p, .ai-summary-result ul, .ai-summary-result ol, .conversion-paywall__lead, .conversion-paywall__fact span, .conversion-paywall__trust, .conversion-paywall__switch-hint) {
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace .ai-summary-result__disclaimer {
  color: var(--ws-muted) !important;
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ai-summary-panel__language input:checked+span, .ai-summary-panel__price, .conversion-paywall__eyebrow, .conversion-paywall__plan-option.active, .conversion-paywall__method.active) {
  background: var(--ws-brand-soft);
  color: var(--ws-brand-ink);
  border-color: var(--ws-brand);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ai-summary-status__row strong, .ai-summary-result__chapters time, .conversion-paywall__price, .conversion-paywall__progress) {
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ai-summary-panel__generate, .ai-summary-offer__icon, .conversion-paywall__action, .conversion-paywall__checkout-link) {
  background: var(--ws-brand);
  color: #fff;
}
html[data-workspace-theme="dark"] body.media-workspace .conversion-paywall__close {
  background: hsl(var(--surface-elevated));
  color: var(--ws-ink);
}

/* Outcome colors remain legible on the shared dark surfaces. */
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-status-completed, .wb-status.completed, .wb-payment-result.success, .notice.success, .ai-summary-result__notice),
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=pricing] .purchase-value__tier.is-free {
  background: var(--ws-success-soft);
  border-color: #27553e;
  color: var(--ws-success);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=download] .task:is([data-task-status=done],[data-task-status=completed]) .task-status-label {
  background: var(--ws-success-soft);
  border-color: #27553e;
  color: var(--ws-success);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-status-processing, .ws-status-queued, .wb-status.processing, .wb-status.ready, .wb-payment-result.processing, .notice.info, .download-collection button[aria-current=true], .subtitle-format.selected) {
  background: var(--ws-brand-soft);
  border-color: var(--ws-brand);
  color: var(--ws-brand-ink);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-status-failed, .wb-status.failed, .wb-notice.error, .wb-payment-result.failure, .ls-error, .payment-message, .task-list-feedback.is-error, .device-remove, .parse-error, .notice.error, .ai-summary-error, .conversion-paywall__error) {
  background: var(--ws-danger-soft);
  border-color: #653238;
  color: var(--ws-danger);
}
html[data-workspace-theme="dark"] body.media-workspace .ai-summary-error strong {
  color: inherit;
}
html[data-workspace-theme="dark"] body.media-workspace :is(#localTextAiPreview, #workspaceSubtitleOutput) :is(input, select, textarea)[aria-invalid=true],
html[data-workspace-theme="dark"] body.media-workspace #localTextAiPreview .lta-source-box:has([aria-invalid=true]),
html[data-workspace-theme="dark"] body.media-workspace .ws-download-input:has(textarea[aria-invalid=true]),
html[data-workspace-theme="dark"] body.media-workspace .download-link-queue textarea[aria-invalid=true] {
  border-color: var(--ws-danger);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=download] .task[data-task-status=failed] .task-status-label {
  background: var(--ws-danger-soft);
  border-color: #653238;
  color: var(--ws-danger);
}
html[data-workspace-theme="dark"] body.media-workspace[data-workspace-view=download] .task[data-task-status=cancelled] .task-status-label {
  background: hsl(var(--surface-elevated));
  border-color: var(--ws-line);
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-form-error, .task p.task-error, .task-action.cancel, .device-feedback.is-error, #downloadQueueMessage) {
  color: var(--ws-danger) !important;
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-local-banner, .ws-notice, .ws-status-partial, .ws-transcript-continuation, .wb-payment-result.warning, .ai-summary-error.is-membership, .automation-benefits.is-points .automation-benefit.is-boundary, .automation-benefits.is-points .automation-benefit.is-boundary .automation-benefit__mark, .automation-benefits.is-points .automation-benefit.is-boundary .automation-benefit__badge) {
  background: var(--ws-warning-soft);
  border-color: #5d4826;
  color: var(--ws-warning);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.invoice-message, .ws-local-mark, .free-compare .limits h2) {
  color: var(--ws-warning);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.ws-status-expired, .wb-payment-result.neutral) {
  background: hsl(var(--surface-muted));
  border-color: var(--ws-line);
  color: var(--ws-muted);
}
html[data-workspace-theme="dark"] body.media-workspace :is(.purchase-value__tier.is-free b, .free-compare h2, .payment-success) {
  color: var(--ws-success);
}
html[data-workspace-theme="dark"] body.media-workspace .wb-command-status {
  color: var(--ws-success);
}
html[data-workspace-theme="dark"] body.media-workspace .device-feedback {
  color: var(--ws-success) !important;
}
