html[data-theme="light"] { color-scheme: light; }

@media screen {
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111722;
  --panel: #1a2230;
  --panel-soft: #202a39;
  --ink: #e5ebf3;
  --muted: #a2afc0;
  --line: #303d4f;
  --line-strong: #47586d;
  --navy: #0c1420;
  --navy-2: #111d2c;
  --navy-3: #1a2a3d;
  --brand: #8ea6ff;
  --brand-strong: #a9baff;
  --brand-soft: #28334f;
  --success: #61cca1;
  --danger: #ff8992;
  --warning: #e6b75c;
  --shell-ink: #e5ebf3;
  --shell-muted: #a2afc0;
  --shell-line: #303d4f;
  --shell-blue: #80a8e8;
  --shell-blue-soft: #1c3049;
  --shell-navy: #0c1420;
  --border: #303d4f;
  --surface-muted: #202a39;
  --surface-card: #1a2230;
  --surface-subtle: #161d29;
  --surface-answer: linear-gradient(135deg, #1b2434, #17202e);
  --surface-warning: #2b2214;
  --ink-warning: #f6cf7f;
  --line-warning: #5c461e;
  --surface-danger: #2e1920;
  --line-danger: #69303b;
  --accent: #83a5ff;
  --accent-soft: #28334f;
}

/* Keep Project Studio surfaces on the shared dark theme. The base Studio
   widgets and model-project reports predate the theme tokens, so their
   light surfaces need matching dark overrides here. */
  html[data-theme="dark"] #tab-studio :is(
    .studio-open-tabs, .studio-editor-panel, .studio-reference-panel,
    .studio-explorer, .studio-library, .studio-output, .studio-monaco,
    .studio-fallback-editor, .studio-file, .studio-asset,
    .studio-asset-search input, .studio-command-reference,
    .studio-language-status, .studio-status, .studio-asset-status
  ) {
    border-color: var(--line);
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-open-tabs {
    background: var(--panel);
  }

  html[data-theme="dark"] #tab-studio .studio-open-tab {
    border-color: transparent;
    color: var(--muted);
  }

  html[data-theme="dark"] #tab-studio .studio-open-tab:hover,
  html[data-theme="dark"] #tab-studio .studio-open-tab:focus-visible {
    background: var(--panel-soft);
    color: var(--ink);
    outline: 2px solid var(--brand);
    outline-offset: -2px;
  }

  html[data-theme="dark"] #tab-studio .studio-open-tab.active {
    border-bottom-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
  }

  html[data-theme="dark"] #tab-studio .studio-monaco,
  html[data-theme="dark"] #tab-studio .studio-fallback-editor,
  html[data-theme="dark"] #tab-studio .studio-output {
    background: var(--bg);
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-code-workspace.is-markdown :is(
    .studio-editor-surface, .studio-markdown-preview-pane
  ) {
    border-color: var(--line);
    background: var(--panel);
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-markdown-pane-heading {
    border-color: var(--line);
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-markdown-preview {
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-markdown-preview :is(h1, h2, h3, h4, h5, h6) {
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-markdown-preview blockquote {
    border-color: var(--brand);
    background: var(--panel-soft);
    color: var(--muted);
  }

  html[data-theme="dark"] #tab-studio .studio-markdown-preview code:not(pre code) {
    background: var(--panel-soft);
    color: var(--brand-strong);
  }

  html[data-theme="dark"] #tab-studio .studio-markdown-preview .markdown-table-wrap {
    border-color: var(--line);
    background: var(--panel);
  }

  html[data-theme="dark"] #tab-studio .studio-markdown-preview :is(th, td) {
    border-color: var(--line);
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-markdown-preview th {
    background: var(--panel-soft);
  }

  html[data-theme="dark"] #tab-studio .studio-markdown-preview tbody tr:nth-child(even) td {
    background: var(--panel-soft);
  }

  html[data-theme="dark"] #tab-studio .studio-markdown-preview tbody tr:hover td {
    background: var(--brand-soft);
  }

  html[data-theme="dark"] #tab-studio .studio-fallback-editor::selection {
    background: #344875;
  }

  html[data-theme="dark"] #tab-studio .studio-file,
  html[data-theme="dark"] #tab-studio .studio-asset {
    background: transparent;
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-file:hover,
  html[data-theme="dark"] #tab-studio .studio-file.active,
  html[data-theme="dark"] #tab-studio .studio-asset:hover {
    border-color: var(--line-strong);
    background: var(--brand-soft);
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-file-icon {
    background: var(--panel-soft);
    color: var(--brand);
  }

  html[data-theme="dark"] #tab-studio :is(
    .studio-file small, .studio-asset small, .studio-status,
    .studio-asset-status, .studio-language-status,
    #studioFileMeta, #studioRunStatus
  ) {
    color: var(--muted);
  }

  html[data-theme="dark"] #tab-studio .studio-status.error-text,
  html[data-theme="dark"] #tab-studio .studio-language-status.error-text {
    color: #ff9ba1;
  }

  html[data-theme="dark"] #tab-studio .studio-output :is(
    .structured-section, .structured-metric, .result-stat,
    .result-box, .table-wrap, .empty-state
  ) {
    border-color: var(--line);
    background-color: var(--panel-soft);
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-output :is(
    .structured-metric strong, .result-stat strong,
    .structured-section h2, .structured-section h3
  ) {
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-output :is(
    .structured-metric span, .result-stat span, .structured-section p,
    pre, code
  ) {
    color: var(--muted);
  }

  html[data-theme="dark"] #tab-studio .studio-output :is(th, td) {
    border-color: var(--line);
    color: var(--ink);
  }

  html[data-theme="dark"] #tab-studio .studio-output th {
    background: var(--panel-soft);
  }

  html[data-theme="dark"] .studio-eviews-import-dialog {
    border-color: var(--line-strong);
    background: var(--panel);
    color: var(--ink);
  }

  html[data-theme="dark"] .studio-eviews-import-dialog :is(
    .studio-eviews-import-header, .studio-eviews-import-summary-item,
    .studio-eviews-import-section, .studio-eviews-import-issue,
    .studio-eviews-import-filename, .studio-eviews-import-note,
    .studio-eviews-import-override
  ) {
    border-color: var(--line);
    background: var(--panel-soft);
    color: var(--ink);
  }

  html[data-theme="dark"] .studio-eviews-import-dialog :is(
    h2, h3, strong, .studio-eviews-import-status,
    .studio-eviews-import-summary-item span, .app-dialog-description,
    .app-dialog-help, .app-dialog-label
  ) {
    color: var(--ink);
  }

  html[data-theme="dark"] .studio-eviews-import-dialog .studio-eviews-import-status.is-error {
    color: #ff9ba1;
  }

  html[data-theme="dark"] .studio-eviews-import-dialog .dialog-close {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }

  html[data-theme="dark"] .studio-eviews-import-dialog .dialog-close:hover,
  html[data-theme="dark"] .studio-eviews-import-dialog .dialog-close:focus-visible {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--ink);
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-summary-card, .model-project-artifact,
    .model-project-route, .model-project-action,
    .model-project-action-output, .model-project-result-stat,
    .model-project-action-status,
    .model-project-forecast-fan, .model-project-sensitivity-parameters,
    .model-project-sensitivity-chart, .model-project-scenario-studio-scenarios,
    .model-project-scenario-studio-choice, .model-project-scenario-studio-grid-host,
    .model-project-revision-impact-result, .model-project-revision-impact-item,
    .model-project-table-wrap, .model-project-list-item,
    .model-project-validation-stat, .model-project-comparison-table-wrap
  ) {
    border-color: var(--line);
    background-color: var(--panel);
    color: var(--ink);
  }

  html[data-theme="dark"] #modelProjectHome .model-project-route-heading {
    border-top-color: var(--line);
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-sensitivity-table th, .model-project-sensitivity-table td,
    .model-project-scenario-studio-table th, .model-project-scenario-studio-table td,
    .model-project-comparison-table th, .model-project-comparison-table td
  ) {
    border-bottom-color: var(--line);
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-artifact-icon, .model-project-action-icon
  ) {
    background: var(--brand-soft);
    color: var(--brand);
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-route:hover, .model-project-route:focus-visible,
    .model-project-action:hover, .model-project-action:focus-visible,
    .model-project-scenario-studio-choice:hover,
    .model-project-scenario-studio-choice:focus-within
  ) {
    border-color: var(--brand);
    background-color: var(--brand-soft);
    color: var(--ink);
    outline-color: var(--brand);
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-card-kicker, .model-project-artifact-copy strong,
    .model-project-route-heading, .model-project-action small,
    .model-project-action-status, .model-project-result-stat span,
    .model-project-sensitivity-table th, .model-project-sensitivity-table td,
    .model-project-scenario-studio-scenarios legend,
    .model-project-scenario-studio-choice,
    .model-project-scenario-studio-table th,
    .model-project-scenario-studio-table td,
    .model-project-revision-impact-controls label,
    .model-project-revision-impact-result p,
    .model-project-revision-impact-warnings,
    .model-project-comparison-table th,
    .model-project-comparison-table td
  ) {
    color: var(--ink);
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-artifact-copy small, .model-project-route-heading small,
    .model-project-route small, .model-project-list-item span,
    .model-project-list-item small, .model-project-validation-group h4,
    .model-project-validation-note, .model-project-revision-impact-stat span,
    .model-project-revision-impact-item small,
    .model-project-revision-impact-omitted,
    .model-project-summary-card small
  ) {
    color: var(--muted) !important;
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-summary-card strong, .model-project-result-stat strong,
    .model-project-sensitivity-table tbody th,
    .model-project-scenario-studio-table tbody th,
    .model-project-revision-impact-result h4,
    .model-project-revision-impact-stat strong,
    .model-project-revision-impact-item strong,
    .model-project-forecast-table th,
    .model-project-comparison-table tbody th,
    .model-project-list-item strong,
    .model-project-validation-stat strong
  ) {
    color: var(--ink);
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-action-status.success-text,
    .model-project-scenario-studio-actions .helper.success,
    .model-project-revision-impact-panel > .helper.success
  ) {
    border-color: #285843;
    background: #19382e;
    color: #88ddb5;
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-action-status.error-text,
    .model-project-forecast-studio-actions .helper.error,
    .model-project-sensitivity-actions .helper.error,
    .model-project-scenario-studio-actions .helper.error,
    .model-project-revision-impact-panel > .helper.error
  ) {
    background: #42262c;
    color: #ffabb2;
  }

  html[data-theme="dark"] #modelProjectHome .model-project-action-status.muted {
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--muted);
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-forecast-studio-actions .helper.warning,
    .model-project-sensitivity-actions .helper.warning,
    .model-project-scenario-studio-actions .helper.warning,
    .model-project-revision-impact-panel > .helper.warning
  ) {
    color: #f2cf84;
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-sensitivity-table thead th,
    .model-project-scenario-studio-table thead th,
    .model-project-forecast-table th,
    .model-project-comparison-table thead th
  ) {
    background: var(--panel-soft);
    color: var(--muted);
  }

  html[data-theme="dark"] #modelProjectHome :is(
    .model-project-table-wrap, .model-project-sensitivity-matrix-wrap,
    .model-project-scenario-studio-table-wrap,
    .model-project-comparison-table-wrap
  ) {
    border-color: var(--line);
  }

  html[data-theme="dark"] #modelProjectHome .model-project-sensitivity-table input[type="number"],
  html[data-theme="dark"] .model-project-scenario-dialog .model-project-assumption-field :is(input, select) {
    border-color: var(--line-strong);
    background: var(--bg);
    color: var(--ink);
  }

  html[data-theme="dark"] #modelProjectHome :is(input, select, button):focus-visible,
  html[data-theme="dark"] .studio-view-tabs :is(button, [role="tab"]):focus-visible,
  html[data-theme="dark"] .studio-support-rail :is(button, input, summary):focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
  }

  html[data-theme="dark"] .model-project-scenario-dialog {
    border-color: var(--line-strong);
    background: var(--panel);
    color: var(--ink);
  }

  html[data-theme="dark"] .model-project-scenario-dialog-header {
    border-color: var(--line);
    background: var(--panel-soft);
  }

  html[data-theme="dark"] .model-project-scenario-dialog :is(
    .model-project-assumptions-heading h3,
    .model-project-assumptions-heading p,
    .model-project-assumption-field,
    .model-project-scenario-meta-grid label, .app-dialog-description,
    .app-dialog-label, .app-dialog-help
  ) {
    color: var(--ink);
  }

  html[data-theme="dark"] .model-project-assumption-row {
    border-color: var(--line);
    background: var(--panel-soft);
  }

  html[data-theme="dark"] .model-project-scenario-dialog .dialog-close {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }

  html[data-theme="dark"] .model-project-scenario-dialog .dialog-close:hover,
  html[data-theme="dark"] .model-project-scenario-dialog .dialog-close:focus-visible {
    border-color: var(--brand);
    background: var(--brand-soft);
  }

/* The standalone Studio context has its own native command ribbon. */
  html[data-theme="dark"] body[data-workspace="studio"] #appHeader.topbar,
  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon > .global-ribbon-tabs,
  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon > .global-ribbon-body,
  html[data-theme="dark"] body[data-workspace="studio"] #shellContextToolbar {
    border-color: var(--line) !important;
    background: var(--panel) !important;
    color: var(--ink) !important;
  }

  html[data-theme="dark"] body[data-workspace="studio"] #appHeader :is(
    .brand strong, .brand span, .project-context, .shell-header-context,
    .active-object-save-status, .app-menu-menu > summary,
    .shell-compact-menu > summary, .shell-header-actions button,
    .topbar button
  ) {
    color: var(--ink);
  }

  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon :is(
    .global-ribbon-tab, .global-ribbon-command,
    .global-ribbon-mini, .global-ribbon-menu-trigger,
    .shell-context-command
  ) {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }

  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon :is(
    .global-ribbon-tab:hover, .global-ribbon-tab:focus-visible,
    .global-ribbon-command:hover, .global-ribbon-command:focus-visible,
    .global-ribbon-mini:hover, .global-ribbon-mini:focus-visible,
    .global-ribbon-menu-trigger:hover,
    .global-ribbon-menu-trigger:focus-visible,
    .shell-context-command:hover, .shell-context-command:focus-visible
  ) {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--ink);
  }

  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon :is(
    .global-ribbon-tab.active, .global-ribbon-tab[aria-selected="true"]
  ) {
    border-color: var(--line);
    background: var(--panel);
    color: var(--brand);
    box-shadow: inset 0 -2px var(--brand);
  }

  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon :is(
    .global-ribbon-label, .global-ribbon-command > span:last-child,
    .shell-context-toolbar-label, .global-ribbon-hint
  ) {
    color: var(--muted);
  }

  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon :is(
    .global-ribbon-icon, .shell-context-command-icon
  ) {
    color: var(--brand);
    filter: none;
  }

  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon :is(
    .global-ribbon-command, .global-ribbon-mini,
    .global-ribbon-menu-trigger, .shell-context-command
  ):disabled,
  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon :is(
    .global-ribbon-command, .global-ribbon-mini,
    .global-ribbon-menu-trigger, .shell-context-command
  )[aria-disabled="true"] {
    border-color: var(--line);
    background: var(--panel);
    color: var(--muted);
    opacity: .58;
  }

  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon :is(
    .global-ribbon-menu-popover, .app-menu-popover,
    .shell-compact-menu-panel
  ) {
    border-color: var(--line-strong);
    background: var(--panel);
    color: var(--ink);
  }

  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon .global-ribbon-menu-popover :is(
    button, a, label, span, select, input
  ) {
    color: var(--ink);
  }

  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon .global-ribbon-menu-popover :is(
    button, a
  ):hover,
  html[data-theme="dark"] body[data-workspace="studio"] #globalRibbon .global-ribbon-menu-popover :is(
    button, a
  ):focus-visible {
    border-color: var(--line-strong);
    background: var(--brand-soft);
    color: var(--ink);
  }

html[data-theme="dark"],
html[data-theme="dark"] body {
  background: #111722;
  color: #e5ebf3;
}

html[data-theme="dark"] body[data-workspace-host="true"] {
  background: #111722;
  color: #e5ebf3;
}

html[data-theme="dark"] .main,
html[data-theme="dark"] .tab,
html[data-theme="dark"] #tab-workbook,
html[data-theme="dark"] #tab-notes,
html[data-theme="dark"] #tab-analytics,
html[data-theme="dark"] #tab-notebooks,
html[data-theme="dark"] #tab-code,
html[data-theme="dark"] #tab-studio,
html[data-theme="dark"] #tab-overview,
html[data-theme="dark"] #tab-models,
html[data-theme="dark"] #tab-diagnostics,
html[data-theme="dark"] #tab-ai,
html[data-theme="dark"] #tab-team,
html[data-theme="dark"] #tab-transform,
html[data-theme="dark"] #tab-scenario,
html[data-theme="dark"] #tab-history,
html[data-theme="dark"] #tab-import,
html[data-theme="dark"] #tab-identity,
html[data-theme="dark"] #tab-visualizations {
  color: #e5ebf3;
}

html[data-theme="dark"] .main,
html[data-theme="dark"] body[data-workspace-view="true"] .main {
  background: #111722;
  color: #e5ebf3;
}

html[data-theme="dark"] .page-heading,
html[data-theme="dark"] .section-heading { border-color: #303d4f; }

html[data-theme="dark"] :is(label, legend, .form-label, .input-label, .searchable-checkbox-filter-label) {
  color: #c5d0df;
}

html[data-theme="dark"] :is(
  .panel, .metric-card, .goal-card, .home-checklist,
  .home-secondary-card, .structured-section, .result-box, .result-stat,
  .plan-step, .stat-grid > div, .notes-list-panel, .notes-editor-panel,
  .notes-preview-panel, .notebook-sidebar, .notebook-editor-panel,
  .notebook-cell, .markdown-visualization-embed, .research-agent-workspace,
  .research-conversations, .research-artifact-panel, .research-chat-composer,
  .research-file-card, .research-source-link, .research-chat-message,
  .research-chat-tool, .workflow-step, .workflow-list-item, .compact-item,
  .main[data-layout="grid"] .tab[data-window-open="true"]
) {
  border-color: #303d4f;
  background-color: #1a2230;
  color: #e5ebf3;
  box-shadow: 0 2px 10px rgb(0 0 0 / 18%);
}

html[data-theme="dark"] :is(
  h1, h2, h3, h4, .panel h2, .panel h3, .section-heading h2,
  .page-heading h1, .page-heading h2, .notes-list-heading h2,
  .markdown-preview h1, .markdown-preview h2, .markdown-preview h3,
  .window-chrome-title strong,
  .metric-card strong, .notes-title-label, .research-window-heading h1
) { color: #e7edf6; }

html[data-theme="dark"] :is(
  .muted, .eyebrow, .page-heading p, .panel-heading p, .helper,
  .empty-state, .notes-list-help, .notes-keyboard-help, .notes-editor-footer,
  .markdown-preview, .markdown-preview blockquote, .notebook-list-item small,
  .notebook-list-item, .notebook-cell-gutter, .research-report-preview,
  .research-file-card small, .research-source-link small
) { color: #a2afc0; }

html[data-theme="dark"] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  textarea, select, .form-control
) {
  border-color: #435167;
  background-color: #151d29;
  color: #e5ebf3;
}

html[data-theme="dark"] :is(input, textarea, select)::placeholder { color: #8795a8; }
html[data-theme="dark"] :is(input, textarea, select):focus { border-color: #829bff; }

html[data-theme="dark"] :is(
  .button.secondary, .notes-tool, .sheet-tab-color-choice, .sheet-tab-color-input-label input,
  .formula-bar-toggle, .sheet-action, .sheet-nav, .notebook-cell-actions button,
  .workspace-tab-select, .app-dialog, dialog
) {
  border-color: #435167;
  background-color: #202a39;
  color: #dce5f0;
}

html[data-theme="dark"] :is(.button.secondary, .notes-tool, .sheet-action, .sheet-tab, .notebook-cell-actions button):hover {
  border-color: #7186c6;
  background-color: #2a3650;
  color: #eef3ff;
}

html[data-theme="dark"] :is(table, .table-wrap, .markdown-table-wrap, .notebook-table-wrap) {
  border-color: #344256;
  color: #dfe7f1;
}

html[data-theme="dark"] :is(th, .notebook-table-wrap th, .markdown-preview th) {
  border-color: #3b495e;
  background-color: #222d3d;
  color: #c5d1df;
}

html[data-theme="dark"] :is(td, .notebook-table-wrap td, .markdown-preview td) {
  border-color: #303d4f;
}

html[data-theme="dark"] tr:hover td,
html[data-theme="dark"] .markdown-preview tbody tr:nth-child(even) td,
html[data-theme="dark"] .markdown-preview tbody tr:hover td { background-color: #202b3b; }

html[data-theme="dark"] :is(
  .helper, .notes-toolbar, .notebook-editor-panel, .notebook-cell-gutter,
  .notebook-output-text, .markdown-preview blockquote, .markdown-preview code,
  .research-advanced-options, .research-agent-artifact, .admin-filter-tabs,
  .compact-item, .window-chrome, .sheet-bar
) {
  border-color: #344256;
  background-color: #202a39;
  color: #c6d1df;
}

html[data-theme="dark"] :is(.notes-list-item.active, .notebook-list-item.active, .workflow-list-item.active, .admin-filter.active) {
  border-color: #6074b2;
  background: #28334f;
  color: #e4eaff;
}

/* Shared host and workspace chrome. */
html[data-theme="dark"] .workspace-desktop-header,
html[data-theme="dark"] .workspace-pane,
html[data-theme="dark"] .workspace-pane-editor,
html[data-theme="dark"] .workspace-document-frame,
html[data-theme="dark"] .workspace-desktop-content,
html[data-theme="dark"] .workspace-desktop-dialog,
html[data-theme="dark"] .workspace-desktop-dialog-body {
  border-color: #303d4f;
  background: #151d29;
  color: #e5ebf3;
}

html[data-theme="dark"] .workspace-desktop-header { box-shadow: 0 1px 5px rgb(0 0 0 / 35%); }
html[data-theme="dark"] .workspace-desktop-brand,
html[data-theme="dark"] .workspace-desktop-active strong,
html[data-theme="dark"] .workspace-desktop-dialog h2 { color: #e5ebf3; }
html[data-theme="dark"] .workspace-desktop-status,
html[data-theme="dark"] .workspace-desktop-dialog p { color: #a2afc0; }
html[data-theme="dark"] .workspace-desktop-actions .workspace-action,
html[data-theme="dark"] .workspace-desktop-menu > summary,
html[data-theme="dark"] .workspace-desktop-menu-item,
html[data-theme="dark"] .workspace-tab-menu-list button {
  border-color: #435167;
  background: #202a39;
  color: #dce5f0;
}
html[data-theme="dark"] .workspace-desktop-actions .workspace-action:hover,
html[data-theme="dark"] .workspace-desktop-menu > summary:hover,
html[data-theme="dark"] .workspace-desktop-menu[open] > summary,
html[data-theme="dark"] .workspace-desktop-menu-item:hover,
html[data-theme="dark"] .workspace-tab-menu-list button:hover {
  border-color: #7186c6;
  background: #2a3650;
  color: #f0f4ff;
}
html[data-theme="dark"] .workspace-desktop-actions .workspace-action.primary { background: #5267de; color: #fff; }
html[data-theme="dark"] .workspace-global-tabbar,
html[data-theme="dark"] .workspace-pane-tabs,
html[data-theme="dark"] .workspace-floating-titlebar,
html[data-theme="dark"] .workspace-desktop-layout-actions { border-color: #303d4f; background: #1b2432; }
html[data-theme="dark"] .workspace-document-tab.is-active,
html[data-theme="dark"] .workspace-tab-select,
html[data-theme="dark"] .workspace-document-tab.is-active .workspace-tab-select,
html[data-theme="dark"] .workspace-floating-titlebar strong { color: #dfe7f3; }
html[data-theme="dark"] .workspace-pane.is-active { box-shadow: inset 0 0 0 1px #6679c3; }
html[data-theme="dark"] .workspace-splitter { background: #344256; }
html[data-theme="dark"] .workspace-desktop-menu-panel,
html[data-theme="dark"] .workspace-tab-menu-list { border-color: #435167; background: #1a2230; }
html[data-theme="dark"] .workspace-desktop-menu-heading { border-color: #344256; color: #9eacbd; }
html[data-theme="dark"] .workspace-desktop-error { color: #ff9ba1 !important; }

html[data-theme="dark"] .workspace-host-menus .app-menu-menu > summary,
html[data-theme="dark"] .workspace-host-menus .shell-compact-menu > summary,
html[data-theme="dark"] .workspace-host-menus .shell-header-actions .shell-app-action,
html[data-theme="dark"] .workspace-host-menus .shell-header-actions .shell-utility-action {
  border-color: transparent;
  background: transparent;
  color: #dce5f0;
}
html[data-theme="dark"] .workspace-host-menus .app-menu-menu > summary:hover,
html[data-theme="dark"] .workspace-host-menus .app-menu-menu[open] > summary,
html[data-theme="dark"] .workspace-host-menus .shell-compact-menu > summary:hover,
html[data-theme="dark"] .workspace-host-menus .shell-compact-menu[open] > summary,
html[data-theme="dark"] .workspace-host-menus .shell-header-actions .shell-app-action:hover,
html[data-theme="dark"] .workspace-host-menus .shell-header-actions .shell-utility-action:hover {
  border-color: #435167;
  background: #2a3650;
  color: #f0f4ff;
}
html[data-theme="dark"] .workspace-host-menus .app-menu-menu > summary :is(span, svg),
html[data-theme="dark"] .workspace-host-menus .shell-compact-menu > summary :is(span, svg) { color: inherit; }

html[data-theme="dark"] .appearance-theme-toggle {
  border-color: #435167;
  background: #202a39;
  color: #f2d88b;
}
html[data-theme="light"] .appearance-theme-toggle {
  border-color: #d4deea;
  background: #fff;
  color: #52617a;
}
.appearance-theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.appearance-theme-icon { display: inline-block; line-height: 1; }
.appearance-theme-toggle { width: 32px; min-width: 32px; justify-content: center; gap: 0; padding-inline: 4px; font-size: 15px; }
@media (max-width: 520px) {
  .workspace-desktop-actions .appearance-theme-toggle { display: grid; width: 31px; min-width: 31px; height: 29px; padding: 0; font-size: 15px; }
}

/* Workbook work surface, while keeping explicitly formatted cells intact. */
html[data-theme="dark"] .workbook-ribbon-tabs,
html[data-theme="dark"] .workbook-ribbon-body,
html[data-theme="dark"] .workbook-toolbar,
html[data-theme="dark"] .workbook-formula-row,
html[data-theme="dark"] .workbook-grid,
html[data-theme="dark"] .sheet-table td.frozen-column-cell,
html[data-theme="dark"] .sheet-table tr.frozen-row td.frozen-column-cell {
  border-color: #303d4f;
  background: #151d29;
  color: #e5ebf3;
}
html[data-theme="dark"] .sheet-table th,
html[data-theme="dark"] .sheet-table thead th,
html[data-theme="dark"] .sheet-table thead th.corner,
html[data-theme="dark"] .sheet-table .frozen-column-header,
html[data-theme="dark"] .sheet-table .frozen-row-header {
  border-color: #344256;
  background: #222d3d;
  color: #c3cfde;
}
html[data-theme="dark"] .sheet-table tbody th { background: #1c2634; color: #aab6c6; }
html[data-theme="dark"] .sheet-table th,
html[data-theme="dark"] .sheet-table td { border-color: #303d4f; }
html[data-theme="dark"] .workbook-cell[data-theme-fill="default"][data-theme-font-color="default"] {
  background: #18212e !important;
  color: #e5ebf3 !important;
}
html[data-theme="dark"] .workbook-cell[data-theme-fill="explicit"][data-theme-font-color="default"][data-theme-fill-tone="light"] {
  color: #172033 !important;
}
html[data-theme="dark"] .workbook-cell[data-theme-fill="explicit"][data-theme-font-color="default"][data-theme-fill-tone="dark"],
html[data-theme="dark"] .workbook-cell[data-theme-fill="none"][data-theme-font-color="default"] {
  color: #e5ebf3 !important;
}
html[data-theme="dark"] .workbook-cell[data-theme-fill="default"][data-theme-font-color="explicit"][data-theme-font-color-tone="dark"] {
  background: #fff !important;
}
html[data-theme="dark"] .workbook-cell[data-theme-fill="default"][data-theme-font-color="explicit"][data-theme-font-color-tone="light"] {
  background: #18212e !important;
}
html[data-theme="dark"] .workbook-cell[data-theme-fill="none"][data-theme-font-color="explicit"][data-theme-font-color-tone="dark"] {
  background-image: linear-gradient(#fff, #fff) !important;
}
html[data-theme="dark"] .workbook-cell[data-theme-fill="none"][data-theme-font-color="explicit"][data-theme-font-color-tone="light"] {
  background-image: linear-gradient(#18212e, #18212e) !important;
}
html[data-theme="dark"] .workbook-cell.table-cell[data-theme-fill="default"][data-theme-font-color="default"] { background: #202a39 !important; }
html[data-theme="dark"] .workbook-cell.table-header[data-theme-fill="default"][data-theme-font-color="default"],
html[data-theme="dark"] .workbook-cell.table-header-cell[data-theme-fill="default"][data-theme-font-color="default"] {
  background: #30415b !important;
  color: #e6edf8 !important;
}
html[data-theme="dark"] .workbook-cell.table-totals[data-theme-fill="default"][data-theme-font-color="default"],
html[data-theme="dark"] .workbook-cell.table-totals-cell[data-theme-fill="default"][data-theme-font-color="default"] {
  border-top-color: #627796 !important;
  background: #263448 !important;
  color: #e6edf8 !important;
}
html[data-theme="dark"] .workbook-cell.table-style-green.table-cell[data-theme-fill="default"][data-theme-font-color="default"] { background: #20352f !important; }
html[data-theme="dark"] .workbook-cell.table-style-green.table-header[data-theme-fill="default"][data-theme-font-color="default"],
html[data-theme="dark"] .workbook-cell.table-style-green.table-header-cell[data-theme-fill="default"][data-theme-font-color="default"] { background: #2d5140 !important; color: #e4f4e8 !important; }
html[data-theme="dark"] .workbook-cell.table-style-orange.table-cell[data-theme-fill="default"][data-theme-font-color="default"] { background: #3c3023 !important; }
html[data-theme="dark"] .workbook-cell.table-style-orange.table-header[data-theme-fill="default"][data-theme-font-color="default"],
html[data-theme="dark"] .workbook-cell.table-style-orange.table-header-cell[data-theme-fill="default"][data-theme-font-color="default"] { background: #5a422c !important; color: #fff0dc !important; }
html[data-theme="dark"] .workbook-cell.table-style-gray.table-cell[data-theme-fill="default"][data-theme-font-color="default"] { background: #29313d !important; }
html[data-theme="dark"] .workbook-cell.table-style-gray.table-header[data-theme-fill="default"][data-theme-font-color="default"],
html[data-theme="dark"] .workbook-cell.table-style-gray.table-header-cell[data-theme-fill="default"][data-theme-font-color="default"] { background: #3a4657 !important; color: #eef2f7 !important; }
html[data-theme="dark"] .workbook-cell.range-selected[data-theme-fill="default"][data-theme-font-color="default"] { background: #273957 !important; }
html[data-theme="dark"] .workbook-cell.editing[data-theme-fill="default"][data-theme-font-color="default"] { background: #373222 !important; }
html[data-theme="dark"] .workbook-cell-editor,
html[data-theme="dark"] .formula-bar,
html[data-theme="dark"] .workbook-name-box,
html[data-theme="dark"] .workbook-toolbar input,
html[data-theme="dark"] .workbook-toolbar select { border-color: #435167; background: #151d29; color: #e5ebf3; }
html[data-theme="dark"] .formula-bar::placeholder { color: #8998aa; }
html[data-theme="dark"] .workbook-ribbon-tab,
html[data-theme="dark"] .ribbon-command,
html[data-theme="dark"] .ribbon-mini-command,
html[data-theme="dark"] .sheet-tab,
html[data-theme="dark"] .sheet-action,
html[data-theme="dark"] .sheet-nav { color: #c3cfde; }
html[data-theme="dark"] .workbook-ribbon-tab.active,
html[data-theme="dark"] .workbook-ribbon-tab[aria-selected="true"],
html[data-theme="dark"] .sheet-tab.active { background: #27344a; color: #c8d4ff; }
html[data-theme="dark"] .ribbon-group,
html[data-theme="dark"] .sheet-bar,
html[data-theme="dark"] .workbook-status-bar { border-color: #303d4f; background: #1b2432; color: #aebacc; }
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workbook-ribbon-tabs,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workbook-ribbon-body {
  border-color: #303d4f;
  background: #1b2432;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workbook-ribbon-tab { color: #c3cfde; }
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workbook-ribbon-tab.active,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workbook-ribbon-tab[aria-selected="true"] { color: #b8c8ff; }
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-command,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-mini-command { color: #dce5f0; }
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-command > span:last-child,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-mini-command > span:last-child,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-group-label,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-select-wrap { color: #aebacc; }
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-select-wrap select,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook #workbookRibbonToggle { border-color: #435167; background: #151d29; color: #e5ebf3; }
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-command:hover,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-mini-command:hover { border-color: #435167; background: #263448; color: #f0f4ff; }

/* Markdown preview remains a dark reading surface with readable embedded content. */
html[data-theme="dark"] .notes-list-item,
html[data-theme="dark"] .notes-tool,
html[data-theme="dark"] .notes-title-input,
html[data-theme="dark"] .notes-editor,
html[data-theme="dark"] .notebook-cell-editor,
html[data-theme="dark"] .notebook-cell-editor:focus {
  border-color: #435167;
  background: #151d29;
  color: #e5ebf3;
}
html[data-theme="dark"] .notes-editor:focus,
html[data-theme="dark"] .notes-tool:hover { background: #202a39; }
html[data-theme="dark"] .markdown-preview h1,
html[data-theme="dark"] .markdown-preview h2,
html[data-theme="dark"] .markdown-preview h3,
html[data-theme="dark"] .markdown-preview h4 { color: #e5ebf3; }
html[data-theme="dark"] .markdown-preview blockquote { border-color: #8297e8; background: #202a39; color: #c3cfde; }
html[data-theme="dark"] .markdown-preview code { background: #29354a; color: #d6dcff; }
html[data-theme="dark"] .markdown-preview pre,
html[data-theme="dark"] .notebook-output-text,
html[data-theme="dark"] .notebook-cell-gutter { background: #101722; color: #d8e2ef; }
html[data-theme="dark"] .markdown-preview th,
html[data-theme="dark"] .markdown-preview td,
html[data-theme="dark"] .markdown-table-wrap { border-color: #344256; }
html[data-theme="dark"] .markdown-visualization-embed { background: #1a2230; }

/* Python Lab, Code, Analytics, and utility panels. */
html[data-theme="dark"] #pythonStudioWorkspace,
html[data-theme="dark"] #pythonStudioWorkspace .py-files,
html[data-theme="dark"] #pythonStudioWorkspace .py-results-grid,
html[data-theme="dark"] #pythonStudioWorkspace .py-results-grid > section,
html[data-theme="dark"] #pythonStudioWorkspace .py-results-grid > aside,
html[data-theme="dark"] #pythonStudioWorkspace .py-economics-grid > aside,
html[data-theme="dark"] #pythonStudioWorkspace .py-economics-grid > section,
html[data-theme="dark"] .studio-monaco,
html[data-theme="dark"] .notebook-output-text {
  border-color: #344256;
  background: #1a2230;
  color: #dfe7f1;
}
html[data-theme="dark"] #pythonStudioWorkspace .py-heading h2,
html[data-theme="dark"] #pythonStudioWorkspace h3 { color: #e5ebf3; }
html[data-theme="dark"] #pythonStudioWorkspace .py-notice,
html[data-theme="dark"] #pythonStudioWorkspace .py-files,
html[data-theme="dark"] #pythonStudioWorkspace th { background: #202a39; color: #c3cfde; }
html[data-theme="dark"] #pythonStudioWorkspace .py-source,
html[data-theme="dark"] #pythonStudioWorkspace .py-monaco,
html[data-theme="dark"] #pythonStudioWorkspace [data-workflow="report-preview"] { background: #151d29; color: #e5ebf3; }
html[data-theme="dark"] #pythonStudioWorkspace .py-error { background: #48252b; color: #ffd9dc; }
html[data-theme="dark"] #pythonStudioWorkspace .py-console { background: #101722; color: #dbe8ee; }
html[data-theme="dark"] .studio-file,
html[data-theme="dark"] .studio-project-card,
html[data-theme="dark"] .studio-asset-card,
html[data-theme="dark"] .code-editor-panel,
html[data-theme="dark"] .notebook-cell-output { border-color: #344256; background: #1a2230; color: #dfe7f1; }

/* Keep late loaded shell and ribbon styles inside the active dark palette. */
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .app-menu-menu > summary,
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .shell-compact-menu > summary,
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .shell-header-actions .shell-app-action,
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .shell-header-actions .shell-utility-action {
  border-color: transparent !important;
  background: #151d29 !important;
  color: #e5ebf3 !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .app-menu-menu > summary:hover,
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .app-menu-menu[open] > summary,
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .shell-compact-menu > summary:hover,
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .shell-compact-menu[open] > summary {
  border-color: #435167 !important;
  background: #2a3650 !important;
  color: #fff !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .app-menu-popover,
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .shell-compact-menu-panel {
  border-color: #435167 !important;
  background: #1a2230 !important;
  color: #e5ebf3 !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .app-menu-command,
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .shell-compact-menu-panel :is(button, a, span, strong, label) {
  color: #dce5f0 !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .app-menu-command:hover,
html[data-theme="dark"] body[data-workspace-host="true"] header.workspace-desktop-header .workspace-host-menus .shell-compact-menu-panel button:hover {
  background: #2a3650 !important;
  color: #fff !important;
}

@media (forced-colors: none) {
  html[data-theme="dark"] #shellFileMenuPanel :is(#healthBadge, #toggleExplorerQuick, #toggleContextBar) {
    border-color: var(--line-strong) !important;
    background: var(--panel-soft) !important;
    color: var(--ink) !important;
  }
  html[data-theme="dark"] #shellFileMenuPanel :is(#healthBadge, #toggleExplorerQuick, #toggleContextBar):is(:hover, :focus-visible) {
    border-color: var(--brand) !important;
    background: var(--brand-soft) !important;
    color: var(--ink) !important;
  }
  html[data-theme="dark"] #shellFileMenuPanel #healthBadge.success { color: #83d7b4 !important; }
  html[data-theme="dark"] #shellFileMenuPanel #healthBadge.danger { color: #ffadb2 !important; }
  html[data-theme="dark"] #shellFileMenuPanel .menu-command-icon {
    color: var(--ink) !important;
  }
  html[data-theme="dark"] #shellWorkspaceMenuPanel .shell-workspace-tool:is(.active, :hover, :focus-visible) {
    border-color: var(--brand) !important;
    background: var(--brand-soft) !important;
    color: var(--ink) !important;
  }
  html[data-theme="dark"] #shellWorkspaceMenuPanel .shell-workspace-tool:is(.active, :hover, :focus-visible) > span {
    color: var(--ink) !important;
  }
}

@media (forced-colors: none) {
  html[data-theme="dark"] .app-dialog .app-dialog-option {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .app-dialog .app-dialog-option:not(.disabled):is(:hover, .selected, :focus-within) {
    border-color: var(--brand);
    background: var(--brand-soft);
  }
  html[data-theme="dark"] .app-dialog .app-dialog-option:focus-within {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
  }
  html[data-theme="dark"] .app-dialog .app-dialog-option input {
    accent-color: var(--brand);
  }
  html[data-theme="dark"] .app-dialog .app-dialog-option-copy strong {
    color: var(--ink);
  }
  html[data-theme="dark"] .app-dialog .app-dialog-option-copy small {
    color: var(--muted);
  }
  html[data-theme="dark"] .app-dialog .app-dialog-option-copy .app-dialog-option-meta {
    color: var(--brand-strong) !important;
  }
  html[data-theme="dark"] .app-dialog .app-dialog-option.disabled {
    border-color: var(--line);
    background: var(--bg);
  }
  html[data-theme="dark"] .app-dialog .app-dialog-option.disabled .app-dialog-option-copy strong {
    color: var(--muted);
  }
  html[data-theme="dark"] .app-dialog .app-dialog-option-disabled-reason {
    color: var(--danger) !important;
  }
}

/* Workspace controls are mirrored into the hosted header and keep their
   original shell classes. Apply the same dark surfaces in both locations. */
html[data-theme="dark"] #shellWorkspaceMenuPanel :is(
  .shell-more-tools > summary,
  .shell-more-tools-popover,
  #analyticalToolbar .toolbar-context-group > label,
  #analyticalToolbar .toolbar-advanced-context > summary,
  #analyticalToolbar .toolbar-context-fields,
  #analyticalToolbar .icon-action,
  .shell-dock-button,
  .app-menu-layout-option
) {
  border-color: var(--line-strong) !important;
  background: var(--panel-soft) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] #shellWorkspaceMenuPanel #analyticalToolbar .toolbar-context-group :is(select, input) {
  border-color: var(--line-strong) !important;
  background: var(--bg) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] #shellWorkspaceMenuPanel :is(
  .shell-more-tools > summary:hover,
  .shell-more-tools > summary:focus-visible,
  .shell-more-tools[open] > summary,
  #analyticalToolbar .toolbar-advanced-context > summary:hover,
  #analyticalToolbar .toolbar-advanced-context > summary:focus-visible,
  #analyticalToolbar .toolbar-advanced-context[open] > summary,
  #analyticalToolbar .icon-action:hover,
  #analyticalToolbar .icon-action:focus-visible,
  #analyticalToolbar .icon-action.active,
  .shell-dock-button:hover,
  .shell-dock-button:focus-visible,
  .shell-dock-button[aria-pressed="true"],
  .app-menu-layout-option:hover,
  .app-menu-layout-option:focus-visible,
  .app-menu-layout-option.active
) {
  border-color: var(--brand) !important;
  background: var(--brand-soft) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] #shellWorkspaceMenuPanel :is(
  #shellWorkspaceTools,
  #workspaceTabs.shell-object-tabs,
  #analyticalToolbar,
  #shellExperienceNav
) { border-color: var(--line) !important; }

/* The host menu is deliberately narrow, so stack its footer groups to give
   the individual controls enough room for their labels. */
body[data-workspace-host="true"] .workspace-host-menus #shellWorkspaceMenuPanel .shell-workspace-menu-tools {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tabbar-menus,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-desktop-layout-actions {
  border-color: #293548 !important;
  background: #141c28 !important;
  color: #dfe7f3 !important;
  box-shadow: none;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tabbar-menus > .workspace-close-all-action,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tabbar-menus .workspace-desktop-menu > summary,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-scroll-group {
  border-color: #344359 !important;
  background: #1d2635 !important;
  color: #d7e2f0 !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-scroll-group > .workspace-tab-scroll {
  border-color: #2f3d52 !important;
  background: transparent !important;
  color: #d7e2f0 !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tabbar-menus > .workspace-close-all-action:hover,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tabbar-menus .workspace-desktop-menu > summary:hover,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-scroll-group > .workspace-tab-scroll:not(:disabled):hover {
  border-color: #6379b8 !important;
  background: #28354d !important;
  color: #ffffff !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab::before {
  background: #2c3a4f;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab:not(.is-active):hover {
  background: #1e293b !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab .workspace-tab-select {
  border-color: transparent !important;
  background: transparent !important;
  color: #a9b8cd !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab:hover .workspace-tab-select {
  color: #e4ecf8 !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab .workspace-tab-close,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab .workspace-tab-menu > summary {
  border-color: transparent !important;
  background: transparent !important;
  color: #93a4bc !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab.is-active {
  border-color: #3a4c69 !important;
  background: #223047 !important;
  box-shadow: inset 0 2px 0 0 #7c96ff;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab.is-grouped {
  box-shadow: inset 0 2.5px 0 0 var(--tab-group-color, #7c96ff);
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab.is-active .workspace-tab-select {
  background: transparent !important;
  color: #f4f7fd !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab.is-active .workspace-tab-icon {
  color: #8ca6ff;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab.is-grouped .workspace-tab-icon {
  color: var(--tab-group-color, #8ca6ff);
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab .workspace-tab-menu[open] > summary,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab .workspace-tab-menu > summary:hover,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab .workspace-tab-menu > summary:focus-visible {
  background: #334563 !important;
  color: #ffffff !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-document-tab .workspace-tab-close:hover {
  background: rgba(239, 83, 98, 0.24) !important;
  color: #ff9ba4 !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-group-pill {
  border-color: color-mix(in srgb, var(--tab-group-color, #7c96ff) 52%, transparent);
  background: color-mix(in srgb, var(--tab-group-color, #7c96ff) 20%, #182232);
  color: #e6eef9;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-group-pill:hover {
  background: color-mix(in srgb, var(--tab-group-color, #7c96ff) 30%, #1c283b);
  border-color: color-mix(in srgb, var(--tab-group-color, #7c96ff) 78%, transparent);
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tabbar-menus .workspace-desktop-menu-panel,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-menu-list {
  border-color: #3a4a63 !important;
  background: #1a2333 !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55) !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-menu-list button.workspace-menu-item {
  border: 0 !important;
  background: transparent !important;
  color: #dce6f3 !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-menu-list button.workspace-menu-item:not(:disabled):hover,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-menu-list button.workspace-menu-item:not(:disabled):focus-visible {
  background: #28364e !important;
  color: #ffffff !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-menu-list button.workspace-menu-item.is-danger:not(:disabled):hover,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-tab-menu-list button.workspace-menu-item.is-danger:not(:disabled):focus-visible {
  background: rgba(222, 75, 99, 0.22) !important;
  color: #ff9ca6 !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-menu-separator {
  background: #2d3b50;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-global-tabbar .workspace-menu-section-heading {
  color: #8ea0b8;
}
html[data-theme="dark"] .workspace-tab-editor-label { color: #a7b7cc; }
html[data-theme="dark"] .workspace-tab-editor-input {
  border-color: #3c4c64;
  background: #1d2635;
  color: #edf3fb;
}
html[data-theme="dark"] .workspace-tab-color-swatch.is-selected {
  box-shadow: 0 0 0 2px #151d29, 0 0 0 4px var(--swatch-color, #7c96ff);
}

html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon > .global-ribbon-tabs,
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon > .global-ribbon-body,
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon[data-shell-contextual="true"],
html[data-theme="dark"] body[data-workspace-view="true"] #shellContextToolbar {
  border-color: #303d4f !important;
  background: #1b2432 !important;
  color: #e5ebf3 !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon .global-ribbon-tab,
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon .global-ribbon-command,
html[data-theme="dark"] body[data-workspace-view="true"] #shellContextToolbar .shell-context-command {
  color: #dce5f0 !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon .global-ribbon-tab.active,
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon .global-ribbon-tab[aria-selected="true"] {
  color: #b8c8ff !important;
  box-shadow: inset 0 -2px #829bff !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon .global-ribbon-group {
  border-color: #344256 !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon .global-ribbon-label,
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon .global-ribbon-command > span:last-child,
html[data-theme="dark"] body[data-workspace-view="true"] #shellContextToolbar .shell-context-command-label,
html[data-theme="dark"] body[data-workspace-view="true"] #shellContextToolbar .shell-context-toolbar-label {
  color: #aebacc !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon .global-ribbon-icon,
html[data-theme="dark"] body[data-workspace-view="true"] #shellContextToolbar .shell-context-command-icon {
  color: #9eb6f3 !important;
  filter: none !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #globalRibbon .global-ribbon-command:hover,
html[data-theme="dark"] body[data-workspace-view="true"] #shellContextToolbar .shell-context-command:hover {
  border-color: #435167 !important;
  background: #2a3650 !important;
  color: #fff !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-more > summary,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-group-more > summary {
  border-color: #435167 !important;
  background: #202a39 !important;
  color: #dce5f0 !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-more > summary:hover,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-more > summary:focus-visible,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-more[open] > summary,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-group-more > summary:hover,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-group-more > summary:focus-visible,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-group-more[open] > summary {
  border-color: #7186c6 !important;
  background: #2a3650 !important;
  color: #fff !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-more-panel,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-group-more-panel {
  border-color: #435167 !important;
  background: #1a2230 !important;
  color: #e5ebf3 !important;
  box-shadow: 0 10px 28px rgb(0 0 0 / 42%) !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-more-panel > .ribbon-group {
  border-color: #344256 !important;
  background: #202a39 !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-group-more-panel > button,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-group-more-panel > label {
  color: #dce5f0 !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-group-more-panel > button:hover,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .workspace-ribbon-group-more-panel > button:focus-visible {
  border-color: #435167 !important;
  background: #2a3650 !important;
  color: #fff !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-icon,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .ribbon-icon-svg {
  color: #9eb6f3 !important;
  fill: currentColor;
  filter: none !important;
}

html[data-theme="dark"] body :is(.button.primary, .button.primary:hover, .button.primary:focus-visible) {
  border-color: #4059c4;
  background: #4059c4;
  color: #fff;
}
html[data-theme="dark"] body .button.danger,
html[data-theme="dark"] body .button.danger:hover,
html[data-theme="dark"] body .button.danger:focus-visible {
  border-color: #8b4653;
  background: #512a32;
  color: #ffdce0;
}
html[data-theme="dark"] body #tab-notebooks .notebook-sidebar,
html[data-theme="dark"] body #tab-notebooks .notebook-sidebar .notebook-list,
html[data-theme="dark"] body #tab-notebooks .notebook-sidebar .notebook-list-item:not(.active):hover,
html[data-theme="dark"] body #pythonStudioWorkspace .py-files {
  border-color: #344256 !important;
  background: #1a2230 !important;
  color: #dfe7f1 !important;
}
html[data-theme="dark"] body #tab-visualizations .searchable-checkbox-options,
html[data-theme="dark"] body #tab-visualizations .analyst-viz-host:has(.analyst-viz-message) {
  border-color: #344256 !important;
  background: #151d29 !important;
  color: #dfe7f1 !important;
}
html[data-theme="dark"] body #tab-visualizations .searchable-checkbox-option,
html[data-theme="dark"] body #tab-visualizations .searchable-checkbox-empty,
html[data-theme="dark"] body #tab-visualizations .searchable-checkbox-no-match,
html[data-theme="dark"] body #tab-visualizations .analyst-viz-message {
  color: #c3cfde !important;
}
html[data-theme="dark"] body #tab-workbook .sheet-bar,
html[data-theme="dark"] body #tab-workbook .workbook-statusbar,
html[data-theme="dark"] body #tab-workbook .workbook-statusbar * {
  border-color: #303d4f !important;
  background: #1b2432 !important;
  color: #aebacc !important;
}
html[data-theme="dark"] body #tab-workbook .add-sheet {
  border-color: #435167 !important;
  background: #202a39 !important;
  color: #dce5f0 !important;
}
}

@media print {
  html[data-theme="dark"] { color-scheme: light; }
  .appearance-theme-toggle { display: none !important; }
}

@media screen {
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-floating-titlebar .workspace-action {
  border-color: #435167 !important;
  background: #202a39 !important;
  color: #dce5f0 !important;
}
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-floating-titlebar .workspace-action:hover,
html[data-theme="dark"] body[data-workspace-host="true"] .workspace-floating-titlebar .workspace-action:focus-visible {
  border-color: #7186c6 !important;
  background: #2a3650 !important;
  color: #fff !important;
}

html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .global-ribbon-menu-trigger {
  border-color: #435167 !important;
  background: #202a39 !important;
  color: #dce5f0 !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .global-ribbon-menu-trigger:hover,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .global-ribbon-menu-trigger:focus-visible,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .global-ribbon-menu[open] > .global-ribbon-menu-trigger {
  border-color: #7186c6 !important;
  background: #2a3650 !important;
  color: #fff !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .global-ribbon-menu-icon,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .global-ribbon-menu-chevron {
  color: #9eb6f3 !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .global-ribbon-menu-popover {
  border-color: #435167 !important;
  background: #1a2230 !important;
  color: #e5ebf3 !important;
  box-shadow: 0 10px 28px rgb(0 0 0 / 42%) !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .global-ribbon-menu-popover :is(button, a, label, span, select, input) {
  color: #dce5f0 !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .global-ribbon-menu-popover :is(button, a):hover,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .global-ribbon-menu-popover :is(button, a):focus-visible {
  border-color: #435167 !important;
  background: #2a3650 !important;
  color: #fff !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .spill-formula-source {
  border-color: #435167 !important;
  background: #202a39 !important;
  color: #dce5f0 !important;
}
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .spill-formula-source:hover,
html[data-theme="dark"] body[data-workspace-view="true"] #tab-workbook .spill-formula-source:focus-visible {
  border-color: #7186c6 !important;
  background: #2a3650 !important;
  color: #fff !important;
}

html[data-theme="dark"] #tab-import.import-window.active,
html[data-theme="dark"] #tab-import .import-dialog-header,
html[data-theme="dark"] #tab-import .import-mode-tabs,
html[data-theme="dark"] #tab-import .import-catalog-column,
html[data-theme="dark"] #tab-import .import-config-column,
html[data-theme="dark"] #tab-import .import-file-panel,
html[data-theme="dark"] #tab-import .import-file-card,
html[data-theme="dark"] #tab-import .catalog-category h3,
html[data-theme="dark"] #tab-import .import-section-heading,
html[data-theme="dark"] #tab-import .import-catalog-result,
html[data-theme="dark"] #tab-import .import-selection-summary,
html[data-theme="dark"] #tab-import .import-dimensions-panel,
html[data-theme="dark"] #tab-import .import-dimension-row,
html[data-theme="dark"] #tab-import .searchable-checkbox-options,
html[data-theme="dark"] #tab-import .searchable-checkbox-option,
html[data-theme="dark"] #tab-import .import-full-table-note,
html[data-theme="dark"] #tab-import .import-preview-output {
  border-color: var(--line) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] #tab-import.import-window.active,
html[data-theme="dark"] #tab-import :is(.import-dialog-header, .import-catalog-column, .import-config-column, .import-file-card, .catalog-category h3, .import-catalog-result) {
  background: var(--panel) !important;
}
html[data-theme="dark"] #tab-import :is(.import-online-panel, .import-file-panel) {
  background: var(--bg) !important;
}
html[data-theme="dark"] #tab-import :is(.import-mode-tabs, .import-section-heading, .import-selection-summary, .import-dimensions-panel, .import-dimension-row, .searchable-checkbox-options, .import-full-table-note, .import-preview-output) {
  background: var(--panel-soft) !important;
}
html[data-theme="dark"] #tab-import .import-catalog-result:hover,
html[data-theme="dark"] #tab-import .import-catalog-result.selected,
html[data-theme="dark"] #tab-import .searchable-checkbox-option:hover,
html[data-theme="dark"] #tab-import .searchable-checkbox-option:focus-within {
  background: var(--brand-soft) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] #tab-import :is(.import-search-row label, .import-filter-bar label, .import-section-heading label, .import-dimension-name strong, .import-selection-summary strong, .import-full-table-note strong, .import-dimensions-heading strong, .import-catalog-result, .searchable-checkbox-option, .searchable-checkbox-filter-label) {
  color: var(--ink) !important;
}
html[data-theme="dark"] #tab-import :is(.import-catalog-result span, .import-catalog-result small, .catalog-category h3 small) {
  color: var(--muted) !important;
}
html[data-theme="dark"] #tab-import .catalog-badge {
  background: var(--brand-soft) !important;
  color: var(--brand-strong) !important;
}
html[data-theme="dark"] #tab-import :is(.import-search-row input, .import-search-row select, .import-section-heading select, .import-filter-bar input, .import-filter-bar select, .import-filter-bar .filter-check, .import-dimension-row select, .searchable-checkbox-filter-label input) {
  border-color: var(--line-strong) !important;
  background: var(--bg) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] #tab-import .import-mode-tabs button { color: var(--muted); }
html[data-theme="dark"] #tab-import .import-mode-tabs button.active { color: var(--brand-strong); }

html[data-theme="dark"] #tab-overview .import-dimension-row,
html[data-theme="dark"] #tab-overview .searchable-checkbox-options {
  border-color: var(--line) !important;
  background: var(--panel-soft) !important;
}
html[data-theme="dark"] #tab-overview :is(.import-dimension-name strong, .searchable-checkbox-option, .searchable-checkbox-filter-label) {
  color: var(--ink) !important;
}
html[data-theme="dark"] #tab-overview :is(.import-dimension-row select, .searchable-checkbox-filter-label input) {
  border-color: var(--line-strong) !important;
  background: var(--bg) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] #tab-overview .dataset-view-actions .muted { color: var(--muted); }
html[data-theme="dark"] #tab-overview :is(.pivot-field-picker, .pivot-shelf, .pivot-source-field, .pivot-field-card, .pivot-filter-results, .pivot-filter-search-row button, .pivot-aggregation-control select, .pivot-field-search input, .pivot-filter-search-row input, .pivot-source-field select, .pivot-shelf-count, .pivot-icon-button) {
  border-color: var(--line-strong) !important;
  background: var(--panel-soft) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] #tab-overview :is(.pivot-shelf-fields, .pivot-filter-option, .pivot-source-handle) {
  border-color: var(--line-strong) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] #tab-overview :is(.pivot-field-picker, .pivot-shelf, .pivot-source-field, .pivot-field-card) {
  background: var(--panel-soft) !important;
}
html[data-theme="dark"] #tab-overview .pivot-source-field,
html[data-theme="dark"] #tab-overview .pivot-field-card,
html[data-theme="dark"] #tab-overview .pivot-filter-results {
  border-color: var(--line) !important;
}
html[data-theme="dark"] #tab-overview :is(.pivot-source-field select, .pivot-field-search input, .pivot-filter-search-row input, .pivot-aggregation-control select, .pivot-shelf-count, .pivot-icon-button, .pivot-source-handle) {
  background: var(--bg) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] #tab-overview .pivot-filter-chip {
  border-color: var(--brand-strong);
  background: var(--brand-soft);
  color: var(--ink);
}
html[data-theme="dark"] #tab-overview .pivot-shelf.is-drag-over,
html[data-theme="dark"] #tab-overview .pivot-shelf-fields.is-drag-over {
  border-color: var(--brand-strong) !important;
  background: var(--brand-soft) !important;
}
html[data-theme="dark"] #tab-overview .pivot-safety-note {
  border-color: #81652f;
  background: #352b18;
  color: #f1d89e;
}
html[data-theme="dark"] #tab-overview .chip {
  border-color: var(--line-strong);
  background: var(--panel-soft);
  color: var(--ink);
}
html[data-theme="dark"] #tab-overview .chip.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}
html[data-theme="dark"] #tab-overview .storage-alert {
  border-color: #715d36;
  background: #322b1e;
  color: #f2d79c;
}
html[data-theme="dark"] #tab-overview .storage-alert strong { color: #ffe3a6; }
html[data-theme="dark"] #tab-overview #seriesChart:is(:empty, :has(.analyst-viz-message)) {
  background: var(--bg) !important;
  color: var(--ink);
}
html[data-theme="dark"] #tab-overview #seriesChart .analyst-viz-accessibility-dialog {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--ink);
}
html[data-theme="dark"] #tab-overview #seriesChart :is(.analyst-viz-accessibility-source-note, .analyst-viz-accessibility-bounds-note, .analyst-viz-accessibility-page-status, .analyst-viz-accessibility-statistics p) {
  color: var(--muted);
}
html[data-theme="dark"] #tab-overview #seriesChart :is(.analyst-viz-accessibility-statistics, .analyst-viz-accessibility-table-slot) {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}
html[data-theme="dark"] #tab-overview #seriesChart .analyst-viz-accessibility-table :is(th, td) {
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] #tab-overview #seriesChart .analyst-viz-accessibility-table thead th {
  background: var(--panel-soft);
}
html[data-theme="dark"] #tab-overview #seriesChart .analyst-viz-accessibility-dialog button {
  border-color: var(--line-strong);
  background: var(--panel-soft);
  color: var(--ink);
}
html[data-theme="dark"] #tab-overview #seriesChart .analyst-viz-accessibility-dialog button:hover,
html[data-theme="dark"] #tab-overview #seriesChart .analyst-viz-accessibility-dialog button:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--ink);
}
/* Spreadsheet menus and filters use their own light surface colors. */
@media (forced-colors: none) {
  /* Theme the ribbon in hosted and standalone workbook views. */
  html[data-theme="dark"] body #tab-workbook :is(
    .workbook-toolbar, .workbook-ribbon-tabs, .workbook-ribbon-body
  ) {
    border-color: var(--line) !important;
    background: var(--panel) !important;
    color: var(--ink) !important;
  }
  html[data-theme="dark"] body #tab-workbook :is(
    .workbook-ribbon-tab, .ribbon-command, .ribbon-mini-command
  ) {
    background: transparent !important;
    color: var(--ink) !important;
  }
  html[data-theme="dark"] body #tab-workbook :is(
    .workbook-ribbon-tab.active, .workbook-ribbon-tab[aria-selected="true"],
    .workbook-ribbon-tab:hover, .workbook-ribbon-tab:focus-visible,
    .ribbon-command:hover, .ribbon-command:focus-visible, .ribbon-command[aria-pressed="true"],
    .ribbon-command.show-formulas-active,
    .ribbon-mini-command:hover, .ribbon-mini-command:focus-visible, .ribbon-mini-command[aria-pressed="true"]
  ) {
    border-color: var(--line-strong) !important;
    background: var(--brand-soft) !important;
    color: var(--ink) !important;
  }
  html[data-theme="dark"] body #tab-workbook :is(
    .ribbon-group-label, .workbook-ribbon-hint,
    .ribbon-command > span:last-child, .ribbon-mini-command > span:last-child
  ) { color: #c5d1df !important; }
  html[data-theme="dark"] body #tab-workbook :is(
    .ribbon-command .ribbon-icon, .ribbon-command .ribbon-icon-svg
  ) {
    color: var(--ink) !important;
    filter: none;
  }
  html[data-theme="dark"] body #tab-workbook #workbookRibbonToggle {
    border-color: var(--line-strong) !important;
    background: var(--panel-soft) !important;
    color: var(--ink) !important;
  }
  html[data-theme="dark"] body #tab-workbook #workbookRibbonToggle:is(:hover, :focus-visible) {
    border-color: var(--brand) !important;
    background: var(--brand-soft) !important;
    color: var(--ink) !important;
  }
  html[data-theme="dark"] body #tab-workbook :is(.ribbon-check-wrap > span, .ribbon-shortcuts > span) {
    color: var(--ink) !important;
  }
  html[data-theme="dark"] body #tab-workbook .ribbon-shortcuts kbd {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] #tab-workbook .workbook-save-status.is-saved { color: #83d7b4 !important; }
  html[data-theme="dark"] #tab-workbook .workbook-save-status.is-saving { color: #a9c7ff !important; }
  html[data-theme="dark"] #tab-workbook .workbook-save-status:is(.is-unsaved, .is-conflict) { color: #eac57e !important; }
  html[data-theme="dark"] #tab-workbook .workbook-save-status.is-error { color: #ffadb2 !important; }

  html[data-theme="dark"] :is(.workbook-context-menu, .workbook-filter-menu) {
    border-color: var(--line-strong);
    background: var(--panel);
    color: var(--ink);
  }
  html[data-theme="dark"] .workbook-context-menu [role="menuitem"]:is(:hover, :focus-visible):not(:disabled):not([aria-disabled="true"]) {
    background: var(--brand-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .workbook-context-menu [role="menuitem"]:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
  }
  html[data-theme="dark"] .workbook-filter-menu :is(
    .workbook-filter-checklist, .workbook-filter-date-groups,
    .workbook-filter-rank, .workbook-filter-dynamic, .workbook-filter-color,
    .filter-date-group-item
  ) {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .workbook-filter-menu :is(
    .find-label, .filter-menu-field, .filter-check-option, .filter-date-group-fields label,
    .filter-date-group-blank, .filter-rank-fields label,
    .workbook-filter-dynamic > label, .filter-color-fields label
  ) { color: var(--ink); }
  html[data-theme="dark"] .workbook-filter-menu :is(
    input:not([type="checkbox"]), select
  ) {
    border-color: var(--line-strong);
    background: var(--bg);
    color: var(--ink);
  }
  html[data-theme="dark"] .workbook-filter-menu :is(
    .find-command, [data-filter-checklist-action], [data-filter-checklist-page]
  ) {
    border-color: var(--line-strong);
    background: var(--panel);
    color: var(--ink);
  }
  html[data-theme="dark"] .workbook-filter-menu :is(
    .find-command, [data-filter-checklist-action], [data-filter-checklist-page]
  ):is(:hover, :focus-visible):not(:disabled),
  html[data-theme="dark"] .workbook-filter-menu .filter-check-option:is(:hover, :focus-within) {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .workbook-filter-menu :is(
    [data-filter-checklist-status], .filter-date-group-pages,
    .filter-date-group-status, .filter-rank-status,
    .filter-dynamic-status, .filter-color-status
  ) { color: var(--muted); }
  html[data-theme="dark"] .workbook-filter-menu :is(
    .filter-date-group-status, .filter-rank-status, .filter-dynamic-status, .filter-color-status
  )[data-error="true"] { color: var(--danger); }

  /* The command palette results and footer use fixed light-mode colors. */
  html[data-theme="dark"] .command-palette-dialog :is(.command-palette-shell, .command-search, .command-footer) {
    border-color: var(--line-strong);
  }
  html[data-theme="dark"] .command-palette-dialog .command-result { color: var(--ink); }
  html[data-theme="dark"] .command-palette-dialog .command-result:is(:hover, :focus-visible, .selected) {
    background: var(--brand-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .command-palette-dialog .command-result:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
  }
  html[data-theme="dark"] .command-palette-dialog .command-result-icon {
    background: var(--panel-soft);
    color: var(--brand-strong);
  }
  html[data-theme="dark"] .command-palette-dialog :is(.command-result small, .command-result kbd, .command-footer) {
    color: var(--muted);
  }
  html[data-theme="dark"] .command-palette-dialog .command-footer { background: var(--panel-soft); }
  html[data-theme="dark"] .command-palette-dialog .command-search kbd {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }

  /* Shared dialog sections and close controls have explicit light fills. */
  html[data-theme="dark"] .app-dialog :is(
    .app-data-validation-fieldset, .app-cell-shift-fieldset, .app-dialog-details,
    .app-conditional-format-manager-rule, .app-sort-column-row,
    .app-timeline-connections-section, .app-slicer-connections-section,
    .app-pivot-field-chooser, .app-pivot-axis-section, .app-pivot-calculated-section,
    .app-pivot-filter-editor, .app-pivot-report-filter-editor,
    .app-chart-editor-title-link, .app-chart-editor-series-row,
    .app-chart-editor-axis, .app-cell-shift-range, .app-function-library-help
  ) {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .app-dialog :is(.app-data-validation-fieldset legend, .app-cell-shift-fieldset legend, .app-dialog-details dt, .app-dialog-details dd) {
    color: var(--ink);
  }
  html[data-theme="dark"] .app-dialog :is(.app-sort-column-field select, .app-chart-editor-axis select) {
    border-color: var(--line-strong);
    background: var(--bg);
    color: var(--ink);
  }
  html[data-theme="dark"] .app-dialog :is(.app-dialog-header, .app-dialog-actions) {
    border-color: var(--line);
  }
  html[data-theme="dark"] .app-dialog :is(.app-dialog-header, .app-dialog-actions) {
    background: var(--panel);
  }
  html[data-theme="dark"] .app-dialog .dialog-close {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .app-dialog .dialog-close:is(:hover, :focus-visible) {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--ink);
    outline: 2px solid var(--brand);
    outline-offset: -2px;
  }
}

/* Empty chart hosts have no visualization theme until a preview is rendered. */
html[data-theme="dark"] #tab-visualizations #visualizationCanvas:empty,
html[data-theme="dark"] #tab-models #modelChart:empty,
html[data-theme="dark"] #tab-models #modelChart:has(.analyst-viz-message),
html[data-theme="dark"] #tab-models #modelChart:has(.analyst-viz-d3-frame) {
  background: var(--bg);
  color: var(--ink);
}

/* The regression disclosure is an interactive link on the panel surface. */
html[data-theme="dark"] #tab-analytics .regression-advanced-settings > summary {
  color: var(--brand-strong);
}
html[data-theme="dark"] #tab-analytics .regression-advanced-settings > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

html[data-theme="dark"] #tab-import .import-selection-summary :is(span, small) {
  color: var(--muted);
}

html[data-theme="dark"] #tab-visualizations .searchable-checkbox-status {
  color: var(--muted);
}

/* Notes uses a light gradient in the base sheet, so override the image too. */
html[data-theme="dark"] #tab-notes .notes-list-panel {
  background: var(--panel);
}
html[data-theme="dark"] #tab-notes .notes-list-item:not(.active):is(:hover, :focus-visible) {
  background: var(--panel-soft);
  color: var(--ink);
}
html[data-theme="dark"] #tab-notes .notes-list-item-icon {
  background: var(--brand-soft);
  color: var(--brand-strong);
}
html[data-theme="dark"] #tab-notes :is(.notes-list-heading, .notes-list-help, .notes-tool-group) {
  border-color: var(--line);
}

/* Notebook errors and pending edits need their own dark status colors. */
html[data-theme="dark"] #tab-notebooks .notebook-error {
  background: #48252b;
  color: #ffd9dc;
}
html[data-theme="dark"] #tab-notebooks .notebook-cell-type {
  color: var(--brand-strong);
}
html[data-theme="dark"] #pythonStudioWorkspace [data-py="dirty"] {
  color: #f2cf84;
}

html[data-theme="dark"] #tab-team .admin-filter {
  color: var(--muted);
}
html[data-theme="dark"] #tab-team .admin-filter:is(:hover, :focus-visible, .active) {
  background: var(--brand-soft);
  color: var(--ink);
}

/* Research conversations contain nested panels with fixed light backgrounds. */
html[data-theme="dark"] #tab-ai :is(
  .research-chat-column, .research-chat-timeline,
  .research-settings-grid, .research-live-progress,
  .research-live-progress-item, .research-agent-step,
  .research-artifact-tabs, .research-agent-status,
  .research-chat-activity, .research-tool-row, .research-log-row,
  .legacy-ai-workflows
) {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--ink);
}
html[data-theme="dark"] #tab-ai :is(
  .research-conversation-item, .research-conversation-item strong,
  .research-settings-grid label, .research-log-history-heading,
  .research-live-progress-heading strong, .research-live-progress-item strong,
  .research-chat-tool-heading strong, .research-file-card strong,
  .research-agent-artifact strong, .research-window-heading h1,
  .research-pane-heading h3, .research-chat-header h3,
  .research-composer-label, .research-chat-activity > summary,
  .research-tool-row-copy strong, .research-log-row-copy strong,
  .legacy-ai-workflows > summary
) {
  color: var(--ink);
}
html[data-theme="dark"] #tab-ai :is(
  .research-conversation-item span, .research-live-progress-item span,
  .research-agent-step span, .research-chat-message-label,
  .research-chat-tool p, .research-artifact-tab,
  .research-tool-row-copy span, .research-log-row-copy span,
  .research-chat-header p, .research-window-heading p:not(.eyebrow),
  .research-agent-actions .helper-inline
) {
  color: var(--muted);
}
html[data-theme="dark"] #tab-ai :is(
  .research-conversation-item:is(:hover, :focus-visible, .active),
  .research-artifact-tab:is(:hover, :focus-visible, .active),
  .research-agent-settings > summary:is(:hover, :focus-visible),
  .research-drawer-toggle:is(:hover, :focus-visible, .active),
  .research-drawer-close:is(:hover, :focus-visible)
) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--ink);
}
html[data-theme="dark"] #tab-ai :is(
  .research-agent-settings > summary, .research-mode-chip,
  .research-live-progress-icon, .research-activity-icon
) {
  border-color: var(--line-strong);
  background: var(--brand-soft);
  color: var(--brand-strong);
}
html[data-theme="dark"] #tab-ai :is(.research-drawer-toggle, .research-drawer-close) {
  border-color: var(--line-strong);
  background: var(--panel-soft);
  color: var(--ink);
}
html[data-theme="dark"] #tab-ai .research-chat-message.user {
  background: var(--brand-soft);
  color: var(--ink);
}
html[data-theme="dark"] #tab-ai .research-chat-message.assistant {
  background: var(--panel-soft);
  color: var(--ink);
}
html[data-theme="dark"] #tab-ai :is(
  .research-agent-status.error, .research-live-progress-item.error,
  .research-agent-step.failed, .research-chat-tool.failed,
  .research-chat-activity.failed, .research-tool-row.failed,
  .research-log-row.error
) {
  background: #48252b;
  color: #ffd9dc;
}
html[data-theme="dark"] #tab-ai :is(.research-live-progress-item.warning, .research-log-row.warning) {
  background: #3c3220;
  color: #f2cf84;
}
html[data-theme="dark"] #tab-ai .research-agent-status.success {
  background: #19382e;
  color: #88ddb5;
}
html[data-theme="dark"] #tab-ai .research-live-progress-item.error .research-live-progress-icon {
  background: #703740;
  color: #ffd9dc;
}

@media (forced-colors: none) {
  /* Workbook dialogs contain several controls with fixed light colors. */
  html[data-theme="dark"] .app-dialog :is(.app-dialog-description, .app-dialog-help) {
    color: #c3cfde;
  }
  html[data-theme="dark"] .app-dialog :is(.app-dialog-label, .ribbon-check-wrap, .app-dialog-checkbox-label) {
    color: var(--ink);
  }
  html[data-theme="dark"] .app-dialog :is(.ribbon-check-wrap > span, .app-dialog-checkbox-label > span) {
    color: var(--ink);
  }
  html[data-theme="dark"] .app-format-cells-dialog .app-format-cells-fieldset,
  html[data-theme="dark"] .app-paste-special-dialog .app-paste-special-body > .app-dialog-checkbox-label {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .app-format-cells-dialog :is(
    .app-format-cells-fieldset legend, .app-format-cells-color-control,
    .app-format-cells-orientation-preview-field, .app-format-cells-font-preview-field
  ) { color: var(--ink); }
  html[data-theme="dark"] .app-format-cells-dialog :is(
    .app-format-cells-orientation-preview, .app-format-cells-font-preview
  ) {
    border-color: var(--line-strong);
    background: var(--bg);
    color: var(--ink);
  }
  html[data-theme="dark"] .app-format-cells-dialog :is(
    .app-format-cells-range, .app-format-cells-color-control small,
    .app-format-cells-pattern-status, .app-format-cells-font-fallback
  ) { color: #c3cfde; }

  html[data-theme="dark"] .app-dialog :is(.app-function-library-results, .app-function-library-help) {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .app-dialog .app-function-library-result {
    border-color: transparent;
    background: var(--panel);
    color: var(--ink);
  }
  html[data-theme="dark"] .app-dialog .app-function-library-result:is(:hover, :focus-visible, .is-active) {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .app-dialog .app-function-library-result:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
  }
  html[data-theme="dark"] .app-dialog :is(
    .app-function-library-result-name, .app-function-library-result-category,
    .app-function-library-status, .app-function-library-help-signature,
    .app-function-library-help-description, .app-function-library-help-examples,
    .app-function-library-help-repeatable
  ) { color: var(--ink); }
  html[data-theme="dark"] .app-dialog .app-function-library-no-results {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }

  html[data-theme="dark"] .workbook-external-links-dialog :is(
    .workbook-external-links-header, .workbook-external-links-summary > *,
    .workbook-external-links-list > li, .workbook-external-links-list > label,
    .workbook-external-links-row
  ),
  html[data-theme="dark"] .workbook-solver-dialog > .app-dialog-form > header {
    border-color: var(--line-strong);
    background: var(--panel-soft);
    color: var(--ink);
  }
  html[data-theme="dark"] .workbook-external-links-dialog :is(
    .workbook-external-links-status, .workbook-external-links-count,
    .workbook-external-links-meta, .workbook-external-links-location,
    .workbook-external-links-note, .workbook-external-links-row strong
  ) { color: var(--ink); }
  html[data-theme="dark"] .workbook-external-links-dialog .workbook-external-links-status.is-error { color: var(--danger); }
  html[data-theme="dark"] .workbook-external-links-dialog :is(
    .workbook-external-links-list > li, .workbook-external-links-list > label, .workbook-external-links-row
  ):is(:hover, :focus-within):not([aria-disabled="true"]):not(.is-unavailable) {
    border-color: var(--brand);
    background: var(--brand-soft);
  }
  html[data-theme="dark"] .workbook-external-links-dialog :is(
    .workbook-external-links-row.is-unavailable, .workbook-external-links-row[aria-disabled="true"],
    .workbook-external-links-unavailable
  ) {
    border-color: #8d713a;
    background: #3b3020;
    color: #f2d79c;
  }

  /* Answer-first structured result cards and diagnostics across all workspaces */
  html[data-theme="dark"] .result-card,
  html[data-theme="dark"] .object-summary-card {
    border-color: #303d4f;
    background: #1a2230;
    color: #e5ebf3;
    box-shadow: 0 4px 16px rgb(0 0 0 / 28%);
  }
  html[data-theme="dark"] .result-card-answer {
    border-bottom-color: #2c394c;
    background: linear-gradient(135deg, #1d2738, #233049);
    color: #e5ebf3;
  }
  html[data-theme="dark"] .result-card-kicker {
    color: #93abff;
  }
  html[data-theme="dark"] .result-card-answer h2 {
    color: #eef3fb;
  }
  html[data-theme="dark"] .result-card-answer p {
    color: #aebcd0;
  }
  html[data-theme="dark"] .result-card-body {
    background: transparent;
    color: #e5ebf3;
  }
  html[data-theme="dark"] .result-card-warnings {
    border-left-color: #e0a642;
    background: #332919;
    color: #f3d79e;
  }
  html[data-theme="dark"] .result-card-actions span {
    border: 1px solid #3c4d73;
    background: #25324e;
    color: #bfd0ff;
  }
  html[data-theme="dark"] .result-card-provenance summary {
    color: #a6b4c8;
  }
  html[data-theme="dark"] .result-card-provenance pre,
  html[data-theme="dark"] .result-card pre,
  html[data-theme="dark"] .structured-section pre {
    border: 1px solid #2b3749;
    border-radius: 6px;
    background: #121824;
    color: #d7e2f0;
    padding: 10px;
  }
  html[data-theme="dark"] .structured-section summary {
    color: #e5ebf3;
  }
  html[data-theme="dark"] .structured-metric {
    border-color: #303d4f;
    background: #202a39;
    color: #e5ebf3;
  }
  html[data-theme="dark"] .structured-metric span {
    color: #9baac0;
  }
  html[data-theme="dark"] .structured-metric strong {
    color: #eef3fb;
  }
  html[data-theme="dark"] .issue-row {
    border-color: #344256;
    background: #202a39;
    color: #dce5f0;
  }
  html[data-theme="dark"] .issue-row.error {
    border-color: #7c3842;
    background: #351d23;
    color: #ffb8bf;
  }
  html[data-theme="dark"] .issue-row.warning {
    border-color: #7c6430;
    background: #342a18;
    color: #f4d89f;
  }
  html[data-theme="dark"] .workflow-step.needs-repair {
    border-color: #8d6838;
    background: #332719;
  }
  html[data-theme="dark"] .workflow-step .step-operation {
    border-color: #3b4a61;
    background: #141c28;
    color: #dce6f4;
  }

}
}
