/* One palette for the shell and legacy feature surfaces. Explicit semantic
   states below preserve status meaning and branded provider icons. */
:root { --workspace-skeleton: #edf1ef; }
html[data-theme="dark"] {
  color-scheme: dark;
  background: #111816;
  --workspace-skeleton: #202d27;
}
html[data-theme="dark"] .app-shell {
  --app-ink: #e6eee9;
  --app-muted: #a4b5ac;
  --app-border: #314139;
  --app-accent: #228163;
  --skills-line: #314139;
  --skills-green: #228163;
  --night-base: #111816;
  --night-surface: #18211d;
  --night-raised: #202c25;
  --night-selected: #203e32;
  --night-link: #8ed8b8;
  background: var(--night-base);
  color: var(--app-ink);
}
html[data-theme="dark"] .app-shell .app-sidebar { background: var(--night-surface); border-right: 1px solid var(--app-border); }
html[data-theme="dark"] .app-shell :is(.app-brand, .app-wordmark) { color: var(--app-ink); }
html[data-theme="dark"] .app-shell .app-nav a { color: var(--app-muted); }
html[data-theme="dark"] .app-shell :is(.app-nav a:hover, .app-account > a:hover, .app-account > button:hover) { background: var(--night-raised); }
html[data-theme="dark"] .app-shell .app-nav a[aria-current="page"],
html[data-theme="dark"] .app-shell .app-nav a[aria-current="page"]:visited { background: var(--night-selected); color: #a6edcc; }
html[data-theme="dark"] .app-shell .app-account { border-color: var(--app-border); }
html[data-theme="dark"] .app-shell :is(.app-account > a, #workspace-sign-out, .app-theme select) { color: var(--app-muted); background: transparent; }
html[data-theme="dark"] .app-shell :is(.app-main, .shell, .content, .connections-content, .credential-workspace) { background: var(--night-base); }
html[data-theme="dark"] .app-shell :is(.app-card, .panel, .provider-dialog, .provider-settings-card, .skill-library, .skill-selection, .skill-row, .agent-detail, .detail-collection, .export-panel, .version-entry, .package-tree, .package-preview, .quick-search, .quick-credential, .quick-list, .upload, .guidance, .access-note, #credential-create, #credential-create-frame) {
  background: var(--night-surface); color: var(--app-ink); border-color: var(--app-border); box-shadow: none;
}
html[data-theme="dark"] .app-shell :is(h1, h2, h3, h4, strong, dt, dd, label, legend, th, td, summary, .field-label, .app-card h2, .detail-identity p, .skill-select, .file-path, .file-folder summary, .skill-markdown p, #search-title) { color: var(--app-ink); }
html[data-theme="dark"] .app-shell :is(p, small, .hint, .coverage, .eyebrow, .search-help, .detail-help, .advanced, .search-subtitle, .quick-status, .quick-empty, .quick-group-heading, .export-created, .quick-open small, .detail-summary span, #status, #catalog-status, #connection-footer, #detail-status) { color: var(--app-muted); }
html[data-theme="dark"] .app-shell :is(a:not(.app-nav a):not(.app-brand), .text-action, .quick-more, .quick-group-heading button, .quick-detail a, .url-field > a, .field-value a, #stored-records > summary) { color: var(--night-link); }
html[data-theme="dark"] .app-shell :is(button, .button, input, select, textarea, .field-value, .catalog-search-label, .search-box, .scope-picker > summary, .fixed-format, .detail-endpoint),
html[data-theme="dark"] .app-shell #workspace-name[readonly],
html[data-theme="dark"] .app-shell #search-home .quick-top {
  background: var(--night-surface); color: var(--app-ink); border-color: var(--app-border);
}
html[data-theme="dark"] .app-shell :is(input, textarea)::placeholder { color: #99aaa1; opacity: 1; }
html[data-theme="dark"] .app-shell :is(.primary, .primary-button, #catalog-custom, .connect-app, .provider-banner .primary, .provider-dialog .primary, .provider-settings-card .primary, .app-page-skills .button:not(.secondary)) {
  background: #227d5e; border-color: #389c78; color: #fff;
}
html[data-theme="dark"] .app-shell :is(button[aria-pressed="true"], button[aria-selected="true"], .settings-nav button[aria-selected="true"], #categories button[aria-pressed="true"], .file-path[aria-pressed="true"], .catalog-categories button[aria-pressed="true"], .skill-row[data-selected="true"], tr.selected td, .agent-table tr.selected td, .quick-option[aria-selected="true"]) {
  background: var(--night-selected); color: #a6edcc; border-color: #46745d;
}
html[data-theme="dark"] .app-shell :is(.quick-option:hover, .export-choice:hover) { background: var(--night-raised); }
html[data-theme="dark"] .app-shell :is(.provider-banner, .project-summary, .package-complete, .time-preview, .no-access, .connections-guide, .storage-note, .detail-icon, .skill-icon, .skill-symbol, .agent-icon, .tag-pill, .version-marker, .quick-icon) { background: var(--night-selected); color: #a6edcc; }
html[data-theme="dark"] .app-shell :is(th, #scope-repository) { background: var(--night-surface); }
html[data-theme="dark"] .app-shell :is(.catalog-badge, .badge, .export-state, .file-kind, .security-note, .quick-footer, #categories .count, pre, code, .field-value, .detail-field input:read-only, .detail-field textarea:read-only) { background: var(--night-raised); color: #c0d0c6; border-color: var(--app-border); }
html[data-theme="dark"] .app-shell :is(.catalog-badge.connected, .export-state.allowed, .provider-state, .badge.active, .badge.live) { background: #1c3e2e; color: #a6edcc; }
html[data-theme="dark"] .app-shell :is(.badge.pending_approval, .package-warning, #conflict) { background: #3d321c; color: #f2cf87; }
html[data-theme="dark"] .app-shell :is(.error, .metadata-error, .export-state.error, .export-state.denied, #catalog-status.error, #setup-result, #status.error, #detail-status.error) { color: #ffaaaa; }
html[data-theme="dark"] .app-shell :is(.export-state.error, .export-state.denied) { background: #402628; }
html[data-theme="dark"] .app-shell :is(.app-page-heading, .credential-heading, .settings-nav, #categories, .credential-list, .credential-detail, .detail-heading, .detail-tabs, .detail-section, .detail-summary > div, .detail-permission, .updated-line, .preview-heading, .library-columns, .skill-row, .connection-tabs, .agent-detail, th, td, .quick-top, .quick-status, .quick-group, .export-scope, .export-configuration > h2, #stored-records, .provider-billing-note) { border-color: var(--app-border); }
html[data-theme="dark"] .app-shell :is(.settings-nav button, .skill-select, .file-path, .detail-tab, .detail-close, .quick-open, .export-choice) { background: transparent; }
html[data-theme="dark"] .app-shell :is(.catalog-search-label input, .search-box input, .quick-top input, .app-theme select) { background: transparent; }
html[data-theme="dark"] .app-shell #search-home :is(.quick-search, .quick-status) { background: transparent; }
html[data-theme="dark"] .app-shell #search-home .quick-list { background: var(--night-surface); }
html[data-theme="dark"] .app-shell #search-home kbd { color: var(--app-muted); border-color: var(--app-border); }
html[data-theme="dark"] .app-shell dialog::backdrop { background: #030906aa; }
html[data-theme="dark"] .app-shell :focus-visible { outline-color: #81d5af; }
