html[data-theme="dark"] {
  --sia-bg: #0d1117;
  --sia-surface: #151a21;
  --sia-surface-soft: #1b222b;
  --sia-heading: #f2f6f8;
  --sia-text: #d2dde3;
  --sia-muted: #91a2ad;
  --sia-teal: #43bdb8;
  --sia-teal-dark: #79d7d2;
  --sia-teal-soft: #173d3b;
  --sia-line: #2b3742;
  --sia-line-strong: #3a4a56;
  --sia-danger: #ff8585;
  --sia-danger-soft: #3a2226;
  --sia-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);

  --bg: #0d1117;
  --bg-page: #0d1117;
  --bg-alt: #11171e;
  --bg-strong: #111d23;
  --surface: #151a21;
  --surface-soft: #1b222b;
  --panel: rgba(21, 26, 33, 0.96);
  --panel-solid: #151a21;
  --card: rgba(21, 26, 33, 0.96);
  --card-solid: #151a21;
  --soft: #1b292d;
  --line: #2b3742;
  --line-soft: #232e38;
  --line-strong: #3a4a56;
  --border: #2b3742;
  --border-soft: #232e38;
  --border-strong: #3a4a56;
  --text: #d2dde3;
  --heading: #f2f6f8;
  --ink: #f2f6f8;
  --ink-soft: #d2dde3;
  --navy: #f2f6f8;
  --muted: #91a2ad;
  --muted-soft: #738690;
  --muted-2: #738690;
  --teal: #43bdb8;
  --teal-dark: #79d7d2;
  --teal-soft: #173d3b;
  --teal-softer: #142b2c;
  --teal-50: #142b2c;
  --teal-100: #173d3b;
  --teal-200: #20514e;
  --teal-300: #2e7772;
  --teal-400: #3ca9a4;
  --teal-500: #43bdb8;
  --teal-600: #58c9c4;
  --teal-700: #79d7d2;
  --teal-800: #9be3df;
  --teal-900: #f2f6f8;
  --brand-dark: #79d7d2;
  --danger: #ff8585;
  --danger-bg: #3a2226;
  --danger-soft: #3a2226;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.3);
  --shadow-teal: 0 20px 46px rgba(24, 169, 166, 0.16);
  overflow-x: clip;
}

html[data-theme="dark"] body {
  background: linear-gradient(145deg, #10171b 0%, #0d1117 58%, #102725 100%) !important;
  color: var(--sia-text) !important;
  overflow-x: clip;
}

html[data-theme="dark"] body::before,
html[data-theme="dark"] body::after {
  opacity: 0.16;
}

html[data-theme="dark"] :where(h1, h2, h3, h4, h5, h6) {
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] :where(input, textarea, select) {
  background-color: #11171e !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(input, textarea)::placeholder {
  color: #74858f !important;
}

html[data-theme="dark"] option {
  background: #151a21;
  color: var(--sia-text);
}

html[data-theme="dark"] :where(.sidebar, .app-frame, .extension-card, .auth-shell, .auth-panel, .auth-card) {
  background: #151a21 !important;
  border-color: var(--sia-line) !important;
  box-shadow: var(--sia-shadow) !important;
}

html[data-theme="dark"] :where(
  .card,
  .panel,
  .stat-card,
  .tool-card,
  .catalog-card,
  .project-card,
  .library-idea-card,
  .idea-picker,
  .selected-idea-summary,
  .project-scene-card,
  .voice-workspace,
  .summary-workspace,
  .summary-reference-card,
  .editor,
  .prompt-card,
  .modal,
  .opportunity-search,
  .opportunity-result-card,
  .opp-single-card,
  .niche-card,
  .channel-card,
  .preview-card,
  .audio-frame,
  .plan-card,
  .plan-picker,
  .help-card,
  .side-card
) {
  background: #151a21 !important;
  border-color: var(--sia-line) !important;
  box-shadow: var(--sia-shadow) !important;
}

html[data-theme="dark"] :where(
  .idea-picker-head,
  .idea-picker-tools,
  .idea-generation-results-head,
  .scenes-workspace-head,
  .summary-head,
  .voice-workspace-head,
  .project-flow,
  .toolbar,
  .filters,
  .result-toolbar,
  .content,
  .section-shell,
  .subscription-box,
  .protected-box,
  .info-row,
  .metrics,
  .features,
  .install,
  .timeline
) {
  background: #181f27 !important;
  border-color: var(--sia-line) !important;
}

html[data-theme="dark"] :where(
  .small-button,
  .catalog-retry,
  .button.secondary,
  .btn-ghost,
  .soft-button,
  .mini-button,
  .filter-button,
  .chip,
  .select-box,
  .card-action,
  .close-button,
  .icon-button,
  .pagination-button,
  .sort-select,
  .example-chip,
  .delete-all-btn,
  .quota-delete-btn,
  .cta.secondary,
  .back-link,
  .manage-link
) {
  background-color: #171e26 !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(
  .control-shell,
  .style-picker-trigger,
  .style-picker-menu,
  .style-option,
  .voice-picker-trigger,
  .voice-picker-menu,
  .voice-option,
  .project-voice-picker-trigger,
  .project-voice-picker-menu,
  .project-voice-option,
  .project-voice-search,
  .category-select-trigger,
  .category-select-menu,
  .category-option,
  .filter-select-trigger,
  .filter-select-menu,
  .filter-select-option,
  .input-shell,
  .opportunity-search-input,
  .search,
  .skip-scenes-option
) {
  background-color: #11171e !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(
  .sidebar-account-menu,
  .sidebar-user-menu,
  .kebab-menu,
  .row-menu,
  .dropdown-menu
) {
  background: #1b222b !important;
  border-color: var(--sia-line-strong) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36) !important;
}

html[data-theme="dark"] .sidebar-account-menu-item {
  background: transparent !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .sidebar-account-menu-item:hover {
  background: var(--sia-teal-soft) !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .sidebar-user-menu {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .sidebar-user-menu:hover {
  background: var(--sia-teal-soft) !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .app-shell {
  background: transparent !important;
}

html[data-theme="dark"] .main {
  background: transparent !important;
}

html[data-theme="dark"] :where(
  .start-project,
  .empty,
  .library-search-wrap,
  .channels-card-head,
  .top-cap,
  .top-header-icon,
  .field-info-popover,
  .mode-switch,
  .mode-button.active,
  .opportunity-search-form,
  .view-tabs,
  .input-wrap,
  .btn-secondary,
  .benefit-icon
) {
  background: var(--sia-surface) !important;
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(
  .channel-gate-icon,
  .comp-hub-ai,
  .step-number,
  .plan-badge.muted,
  .quota-track,
  .eyebrow
) {
  background: var(--sia-teal-soft) !important;
  border-color: #20514e !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .hero > .eyebrow {
  background: transparent !important;
  border-color: transparent !important;
}

html[data-theme="dark"] :where(.comp-hub-refresh, .nichos-toast) {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(.footer-note, .opportunity-pro-lock) {
  background: var(--teal-softer) !important;
  border-color: #20514e !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(
  .catalog-skeleton,
  .ideas-hub-library-link,
  .ideas-hub-quota,
  .presets-bar.comp-hub-presets,
  .empty-state,
  .opportunity-example
) {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .preset-btn.active {
  background: var(--sia-teal-soft) !important;
  border-color: #20514e !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .top-chip {
  background: var(--sia-surface) !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

/* Page canvases and hero workspaces */
html[data-theme="dark"] :where(
  .ideas-hub-hero,
  .opportunity-single-shell,
  .comp-hub-hero,
  .progress-container.is-background
) {
  background:
    radial-gradient(circle at 82% 12%, rgba(67, 189, 184, 0.13), transparent 34%),
    linear-gradient(145deg, #11171e 0%, #10181e 58%, #112523 100%) !important;
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .ideas-hub-hero :where(p, .ideas-hub-empty-copy) {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] :where(.ideas-hub-loading-orb, .comp-hub-hero-icon) {
  background: radial-gradient(circle at 34% 28%, #29424a 0%, #1b292d 58%, #151a21 100%) !important;
  border-color: var(--sia-line-strong) !important;
}

html[data-theme="dark"] :where(.ideas-hub-loading-bulb, .ideas-hub-sync-state) {
  background: var(--sia-teal-soft) !important;
  border-color: #20514e !important;
  color: var(--sia-teal-dark) !important;
}

/* Data-backed cards, tables and generated results */
html[data-theme="dark"] :where(
  .channel-row,
  .channel-row.preview-row,
  .library-card,
  .library-empty,
  .ideas-hub-result-card,
  .ideas-hub-result-card.locked-demo,
  .comp-table-row,
  .list-view.comp-hub-list,
  .opp-detail-cell,
  .cat-card,
  .opportunity-empty,
  .drawer,
  .drawer-head,
  .summary-card,
  .checklist li,
  .channel-video,
  .video-card,
  .project-setup-options,
  .idea-generation-results,
  .scenes-workspace,
  .scene-card,
  .history-item,
  .voice-result,
  .summary-audio-item,
  .project-scene-prompt,
  .summary-script
) {
  background: var(--sia-surface) !important;
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] :where(
  .ideas-hub-result-why,
  .ideas-hub-result-save,
  .ideas-hub-result-copy,
  .ideas-hub-demo-lock,
  .opp-details-panel,
  .opportunity-reason,
  .comp-video-transcript,
  .comp-hub-note,
  .idea-picker-progress,
  .idea-generation-progress,
  .voice-script-summary,
  .audio-frame,
  .progress-wrap,
  .history-meta,
  .prompt-box,
  .time-pill,
  .channel-note,
  .value-note
) {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(
  .library-order-trigger,
  .library-order-menu,
  .library-card-save,
  .prompt-filter-select,
  .prompt-filter-menu,
  .prompt-clear-button,
  .comp-hub-filters-shell,
  .comp-hub-clear-filters,
  .opp-refresh-btn,
  .opp-action-secondary,
  .library-generate-link,
  .drawer-close,
  .niche-save,
  .col-page-btn,
  .history-actions a,
  .history-actions button,
  .history-pagination button,
  .confirm-actions button,
  .modal-close,
  .btn-danger,
  .btn,
  .prompt-new-button
) {
  background: #171e26 !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

/* Channels */
html[data-theme="dark"] .channel-row :where(.metric, .metric-col, [class*="metric-col-"]) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .channel-row :where(.channel-name, .metric-value) {
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] .channel-row :where(.metric-label, .channel-meta) {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] :where(.feedback, .channels-card-head) {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(.confirm-modal, .kebab-menu) {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

/* Competitors */
html[data-theme="dark"] :where(.comp-hub-presets, .comp-hub-table-head) {
  background: #181f27 !important;
  border-color: var(--sia-line) !important;
}

html[data-theme="dark"] :where(
  .comp-hub-heading p,
  .comp-hub-header .refresh-meta-inline,
  .comp-hub-hero-body p,
  .comp-hub-presets .preset-desc,
  .comp-hub-field label,
  .comp-channel-subs,
  .comp-hub-note
) {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] :where(
  .comp-hub-presets .preset-title,
  .comp-hub-filter-title,
  .comp-video-title,
  .comp-channel-name,
  .comp-col-views
) {
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] .comp-hub-presets .preset-btn {
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .comp-hub-presets .preset-btn.active {
  background: var(--sia-teal-soft) !important;
  box-shadow: inset 0 -3px 0 var(--sia-teal) !important;
}

html[data-theme="dark"] .comp-hub-presets .preset-btn.active :where(.preset-title, .preset-icon) {
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .comp-hub-table-head {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .comp-head-hint svg {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .comp-rank-pill {
  background: var(--sia-teal-soft) !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .comp-video-thumb,
html[data-theme="dark"] .comp-channel-avatar-new {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line-strong) !important;
}

html[data-theme="dark"] :where(.comp-growth-value, .comp-growth-spark) {
  color: var(--sia-teal) !important;
}

html[data-theme="dark"] .comp-growth-value.down {
  color: var(--sia-danger) !important;
}

html[data-theme="dark"] .comp-table-row:hover {
  background: #1b292d !important;
}

html[data-theme="dark"] :where(.comp-hub-field select, .comp-hub-field input) {
  background: #11171e !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

/* Niches and catalog */
html[data-theme="dark"] :where(
  .filter-select-menu,
  .lock-overlay-inner,
  .niche-rank,
  .library-empty
) {
  background: var(--sia-surface) !important;
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .lock-overlay {
  background: rgba(13, 17, 23, 0.82) !important;
}

html[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1b222b 25%, #26343c 50%, #1b222b 75%) !important;
}

/* Projects, scenes and voice */
html[data-theme="dark"] :where(
  .idea-search,
  .project-select-trigger,
  .project-select-menu,
  .project-select-option,
  .script-expand-tools,
  .scene-control select,
  .scene-control input,
  .voice-control select,
  .title-input,
  .script-input
) {
  background: #11171e !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .project-select-option:hover,
html[data-theme="dark"] .project-select-option.is-active {
  background: var(--sia-teal-soft) !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .script-expand-button {
  background: var(--sia-teal-soft) !important;
  border-color: #2e7772 !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .script-expand-button:hover {
  background: #20514e !important;
}

html[data-theme="dark"] .script-expand-progress-track {
  background: var(--sia-line) !important;
}

html[data-theme="dark"] .skip-scenes-check {
  background: #11171e;
  border-color: var(--sia-line-strong);
}

html[data-theme="dark"] .skip-scenes-option:has(input:checked) {
  background: var(--sia-teal-soft) !important;
  border-color: #2e7772 !important;
}

html[data-theme="dark"] .skip-scenes-option input:checked + .skip-scenes-check {
  background: var(--sia-teal) !important;
  border-color: var(--sia-teal) !important;
  color: #0d1117 !important;
}

html[data-theme="dark"] .selected-idea-reference {
  background: #11171e;
  border-color: var(--sia-line);
}

html[data-theme="dark"] .selected-idea-reference:hover {
  border-color: #2e7772;
}

html[data-theme="dark"] .configured-channel-avatar {
  background: var(--sia-surface) !important;
  border-color: var(--sia-line) !important;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="dark"] .configured-channel-add .configured-channel-avatar {
  background: transparent !important;
  border-color: #2e7772 !important;
}

html[data-theme="dark"] :where(
  .stat,
  .history-empty,
  .locked-demo-banner,
  body.subscription-plan-required .scene-card,
  body.subscription-plan-required .history-item
) {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .field-info-popover::after {
  background: var(--sia-surface) !important;
  border-color: var(--sia-line) !important;
}

html[data-theme="dark"] :where(.audio-meta .voice-tag, .voice-preview-button) {
  background: #171e26 !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

/* Pricing, billing and admin */
html[data-theme="dark"] .plan-card .metric {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line) !important;
}

html[data-theme="dark"] :where(
  .plan-picker-item,
  .tabs,
  .toast
) {
  background: var(--sia-surface) !important;
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(.status-pill.warning, .status-draft) {
  background: #3a3120 !important;
  border-color: #6d5730 !important;
  color: #f2cc7c !important;
}

html[data-theme="dark"] :where(.status-pill.danger, .status.error, .nichos-toast.error) {
  background: var(--sia-danger-soft) !important;
  border-color: #6b3439 !important;
  color: #ffadad !important;
}

html[data-theme="dark"] :where(.button.danger, .btn.danger, .btn-danger) {
  background: var(--sia-danger-soft) !important;
  border-color: #6b3439 !important;
  color: #ffadad !important;
}

html[data-theme="dark"] :where(.flow-step.done, button.flow-step:hover) {
  background: var(--sia-teal-soft) !important;
  border-color: #20514e !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .flow-step.done strong {
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] .flow-step.done .flow-step-copy > span {
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .flow-step.active {
  background: var(--sia-surface-soft) !important;
  border-color: #2e7772 !important;
  box-shadow: inset 0 -3px 0 var(--sia-teal) !important;
}

html[data-theme="dark"] .flow-step.active.done {
  background: var(--sia-teal-soft) !important;
}

html[data-theme="dark"] .flow-step.active strong {
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] .flow-step.active .flow-step-copy > span {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .project-voice-search input {
  background: transparent !important;
  border: 0 !important;
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] .project-voice-option:hover,
html[data-theme="dark"] .project-voice-option.is-active {
  background: var(--sia-teal-soft) !important;
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] .project-voice-preview {
  background: #171e26 !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .project-voice-preview:hover:not(:disabled),
html[data-theme="dark"] .project-voice-preview.is-playing {
  background: var(--sia-teal) !important;
  border-color: var(--sia-teal) !important;
  color: #071113 !important;
}

html[data-theme="dark"] :where(.soft-button.is-copied, .mini-button.is-copied) {
  background: #173831 !important;
  border-color: #2d685d !important;
  color: #8ee0cb !important;
}

html[data-theme="dark"] :where(.scene-text, .history-item p) {
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .ico {
  background: var(--sia-teal-soft) !important;
  border-color: #20514e !important;
  color: var(--sia-teal-dark) !important;
}

/* Remaining generated and contextual states */
html[data-theme="dark"] :where(
  .ideas-hub-result-ref,
  .opp-single-chip,
  .comp-hub-hero-art-chip,
  .card-thumb .badge-rank
) {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(
  .ideas-hub-result-title,
  .ideas-hub-result-ref-title,
  .library-card-title,
  .comp-video-title
) {
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] :where(
  .ideas-hub-result-ref-meta-line,
  .ideas-hub-result-card p,
  .library-card-summary
) {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .opp-single-side-score {
  background: radial-gradient(circle at 30% 20%, #24433f, #173d3b) !important;
  border-color: #20514e !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .channel-gate-card {
  background: linear-gradient(180deg, #151a21 0%, #142b2c 100%) !important;
  border-color: var(--sia-line) !important;
}

html[data-theme="dark"] :where(
  .stat-icon.gold,
  .prompt-type-icon.guion
) {
  background: #3a3120 !important;
  color: #f2cc7c !important;
}

html[data-theme="dark"] .stat-icon.purple {
  background: #302a46 !important;
  color: #c3b7ff !important;
}

html[data-theme="dark"] .prompt-type-icon.marketing {
  background: #402731 !important;
  color: #ffadc5 !important;
}

html[data-theme="dark"] :where(.tag, .favorite-toggle, .favorite-toggle-box) {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .metrics .metric {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line) !important;
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(.feature .lock, .cta.plan-change) {
  background: #202832 !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] body::after {
  background-color: transparent !important;
}

html[data-theme="dark"] :where(
  .btn-primary,
  .button.primary,
  .primary-button,
  .cta.primary,
  .btn-add,
  .ideas-hub-cta,
  .save-button,
  .generate-button
) {
  background: #167c79 !important;
  border-color: #269a96 !important;
  color: #fff !important;
}

html[data-theme="dark"] .btn.btn-primary,
html[data-theme="dark"] .btn.btn-add-channel {
  background: #167c79 !important;
  border-color: #269a96 !important;
  color: #fff !important;
}

html[data-theme="dark"] :where(.library-tab, .prompt-filter-trigger) {
  color: var(--sia-text) !important;
}

html[data-theme="dark"] :where(.preset-title, .preset-desc) {
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .preset-btn.active :where(.preset-title, .preset-desc) {
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] :where(.add-benefits li, .progress-ring, .brand-subtitle) {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .field-info {
  background: var(--sia-teal-soft) !important;
  border-color: #20514e !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .plan-card strong {
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] .plan-card .price span,
html[data-theme="dark"] .plan-card .metric span {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .value-icon {
  background: #167c79 !important;
  color: #fff !important;
}

html[data-theme="dark"] .quota-ring span {
  color: #17364a !important;
}

html[data-theme="dark"] .plan-badge:not(.muted) {
  background: #167c79 !important;
  color: #fff !important;
}

html[data-theme="dark"] .sidebar-nav a,
html[data-theme="dark"] .sidebar-tools-toggle,
html[data-theme="dark"] .sidebar-theme-toggle {
  color: #d2dde3 !important;
}

html[data-theme="dark"] .sidebar-nav a svg,
html[data-theme="dark"] .sidebar-tools-toggle svg,
html[data-theme="dark"] .sidebar-theme-toggle svg {
  color: #91a2ad !important;
  fill: none !important;
  stroke: currentColor !important;
}

html[data-theme="dark"] .sidebar-nav a:hover,
html[data-theme="dark"] .sidebar-nav a.active,
html[data-theme="dark"] .sidebar-tools-toggle:hover,
html[data-theme="dark"] .sidebar-tools-toggle.active,
html[data-theme="dark"] .sidebar-theme-toggle:hover {
  background: var(--sia-teal-soft) !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .sidebar-nav a:hover svg,
html[data-theme="dark"] .sidebar-nav a.active svg,
html[data-theme="dark"] .sidebar-tools-toggle:hover svg,
html[data-theme="dark"] .sidebar-tools-toggle.active svg,
html[data-theme="dark"] .sidebar-theme-toggle:hover svg {
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] :where(.brand-name span, .sidebar-user .user-meta strong, .tool-card strong, .catalog-card strong) {
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] :where(.sidebar-section-label, .lead, .subtitle, .description, .footnote) {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] :where(.sidebar-user, .prompt-card-divider, .summary-section, .info-row, .channel-row, .divider) {
  border-color: var(--sia-line) !important;
}

html[data-theme="dark"] :where(.teal-soft, .tool-icon, .title-icon, .panel-icon, .icon-box, .icon-bubble, .row-icon, .plan-icon, .meta-pill, .status-pill, .summary-metric, .catalog-tag, .category-pill, .idea-tag) {
  background: var(--sia-teal-soft) !important;
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .auth-visual {
  background: linear-gradient(145deg, #11171e 0%, #15302f 52%, #1f6662 100%) !important;
}

html[data-theme="dark"] .auth-visual::before,
html[data-theme="dark"] .auth-visual::after {
  opacity: 0.18;
}

html[data-theme="dark"] .auth-shell {
  --ink: var(--sia-heading);
  --muted: var(--sia-muted);
  --line: var(--sia-line);
  --brand-2: var(--sia-teal-dark);
}

html[data-theme="dark"] .auth-panel {
  background: var(--sia-surface) !important;
}

html[data-theme="dark"] .auth-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .auth-visual :where(.brand-subtitle, .benefit) {
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .auth-visual .benefit-icon {
  background: #11171e !important;
  color: var(--sia-teal-dark) !important;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="dark"] .auth-card .tabs {
  border-color: var(--sia-line) !important;
}

html[data-theme="dark"] .auth-card .tab {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .auth-card .tab.active {
  color: var(--sia-teal-dark) !important;
  border-bottom-color: var(--sia-teal) !important;
}

html[data-theme="dark"] .auth-card .sub,
html[data-theme="dark"] .auth-card .field label,
html[data-theme="dark"] .auth-card .signup-row,
html[data-theme="dark"] .auth-card .loading,
html[data-theme="dark"] .auth-card .divider {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .auth-card .input-wrap {
  background: #11171e !important;
  border-color: var(--sia-line-strong) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .auth-card .input-wrap:focus-within {
  border-color: var(--sia-teal) !important;
  box-shadow: 0 0 0 4px rgba(67, 189, 184, 0.14) !important;
}

html[data-theme="dark"] .auth-card .input-wrap :where(input, input::placeholder) {
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .auth-card .input-wrap input::placeholder {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .auth-card .input-wrap svg,
html[data-theme="dark"] .auth-card .toggle-pass {
  color: var(--sia-muted) !important;
}

html[data-theme="dark"] .auth-card .link {
  color: var(--sia-teal-dark) !important;
}

html[data-theme="dark"] .auth-card .btn-primary {
  background: var(--sia-teal) !important;
  border-color: var(--sia-teal) !important;
  color: #0d1117 !important;
}

html[data-theme="dark"] .auth-card .btn-secondary {
  background: var(--sia-surface-soft) !important;
  border-color: var(--sia-line-strong) !important;
  color: var(--sia-heading) !important;
}

html[data-theme="dark"] .auth-card .divider::before,
html[data-theme="dark"] .auth-card .divider::after {
  background: var(--sia-line) !important;
}

html[data-theme="dark"] .auth-card .msg {
  color: var(--sia-text) !important;
}

html[data-theme="dark"] .auth-card .msg.ok {
  background: #17302f !important;
  border-color: #32736f !important;
  color: #a6e5e1 !important;
}

html[data-theme="dark"] .auth-card .msg.ok::before {
  background: #245653 !important;
  color: #a6e5e1 !important;
}

html[data-theme="dark"] .auth-card .msg.error {
  background: #321d1f !important;
  border-color: #704044 !important;
  color: #f2aaa6 !important;
}

html[data-theme="dark"] .auth-card .msg.error::before {
  background: #512b2e !important;
  color: #f2aaa6 !important;
}

html[data-theme="dark"] :where(.error-banner, .message.error, .feedback.error, .status.error) {
  background: var(--sia-danger-soft) !important;
  border-color: #6b3439 !important;
  color: #ffadad !important;
}

html[data-theme="dark"] :where(.message.ok, .message.success, .feedback.success) {
  background: #173831 !important;
  border-color: #2d685d !important;
  color: #8ee0cb !important;
}

html[data-theme="dark"] .status-pill.warning,
html[data-theme="dark"] .status-pill.preview,
html[data-theme="dark"] .feedback.warning {
  background: #3a3120 !important;
  border-color: #6d5730 !important;
  color: #f2cc7c !important;
}

html[data-theme="dark"] .status-pill.danger,
html[data-theme="dark"] .status-pill.inactive {
  background: #2a252b !important;
  border-color: #54434b !important;
  color: #c8b8bf !important;
}

html[data-theme="dark"] .opportunity-example-icon {
  background: var(--sia-teal-soft) !important;
  color: var(--sia-teal-dark) !important;
}

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

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #3b4a54;
}

.sidebar-theme-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 22px;
  color: #183247;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 1rem;
  gap: 14px;
  justify-content: space-between;
  min-height: 54px;
  padding: 13px 14px;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease;
  width: 100%;
}

.theme-toggle-label {
  font-weight: 650;
}

.sidebar-account-theme-toggle {
  align-items: center;
  border: 0;
  border-radius: 12px;
  display: flex;
  min-height: 46px;
  padding: 8px 10px 8px 12px;
}

.sidebar-account-menu-divider {
  background: #dbe9ec;
  height: 1px;
  margin: 5px 8px;
}

html[data-theme="dark"] .sidebar-account-menu-divider {
  background: var(--sia-line) !important;
}

.theme-switch {
  align-items: center;
  background: #dce9ec;
  border: 1px solid #bfd3d8;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 52px;
  height: 30px;
  padding: 3px;
  transition: background 0.2s ease, border-color 0.2s ease;
  width: 52px;
}

.theme-switch-thumb {
  align-items: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(18, 49, 74, 0.18);
  color: #ca8b20;
  display: inline-flex;
  height: 22px;
  justify-content: center;
  transform: translateX(0);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  width: 22px;
}

.theme-switch-thumb svg {
  flex: 0 0 14px;
  height: 14px;
  width: 14px;
}

.sidebar-theme-toggle.is-dark .theme-switch {
  background: #20514e;
  border-color: #2e7772;
}

.sidebar-theme-toggle.is-dark .theme-switch-thumb {
  background: #11171e;
  color: #9be3df;
  transform: translateX(22px);
}

html[data-theme="dark"] .theme-switch-thumb svg {
  color: inherit !important;
}

.sidebar-theme-toggle:hover {
  background: var(--sia-teal-soft, #e7f7f6);
  color: var(--sia-teal-dark, #0f8585);
}

.sidebar-theme-toggle svg,
.floating-theme-toggle svg {
  fill: none;
  flex: 0 0 28px;
  height: 28px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  width: 28px;
}

.sidebar-theme-toggle svg {
  color: #698390;
}

.floating-theme-toggle {
  align-items: center;
  background: var(--sia-surface, #fff);
  border: 1px solid var(--sia-line-strong, #c9dfe4);
  border-radius: 999px;
  bottom: 20px;
  box-shadow: var(--sia-shadow, 0 18px 44px rgba(18,49,74,0.08));
  color: var(--sia-heading, #0d2343);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 8px;
  min-height: 46px;
  padding: 0 15px;
  position: fixed;
  right: 20px;
  z-index: 100;
}

.floating-theme-toggle svg {
  flex-basis: 20px;
  height: 20px;
  width: 20px;
}

html[data-theme="dark"] .floating-theme-toggle {
  background: #1b222b;
  border-color: var(--sia-line-strong);
  color: var(--sia-text);
}

@media (max-width: 900px) {
  .sidebar-theme-toggle:not(.sidebar-account-theme-toggle) {
    align-items: center;
    background: var(--sia-surface, #fff);
    border: 1px solid var(--sia-line-strong, #c9dfe4);
    border-radius: 50%;
    bottom: 16px;
    box-shadow: var(--sia-shadow, 0 18px 44px rgba(18,49,74,0.08));
    height: 46px;
    justify-content: center;
    min-height: 46px;
    padding: 0;
    position: fixed;
    right: 16px;
    width: 46px;
    z-index: 100;
  }

  .sidebar-theme-toggle:not(.sidebar-account-theme-toggle) .theme-toggle-label {
    display: none;
  }

  .sidebar-theme-toggle:not(.sidebar-account-theme-toggle) .theme-switch {
    background: transparent;
    border: 0;
    flex-basis: 44px;
    height: 44px;
    justify-content: center;
    padding: 0;
    width: 44px;
  }

  .sidebar-theme-toggle:not(.sidebar-account-theme-toggle) .theme-switch-thumb,
  .sidebar-theme-toggle:not(.sidebar-account-theme-toggle).is-dark .theme-switch-thumb {
    box-shadow: none;
    height: 34px;
    transform: none;
    width: 34px;
  }

  .sidebar-theme-toggle:not(.sidebar-account-theme-toggle) .theme-switch-thumb svg {
    flex-basis: 20px;
    height: 20px;
    width: 20px;
  }

  html[data-theme="dark"] .sidebar-theme-toggle:not(.sidebar-account-theme-toggle) {
    background: var(--sia-surface) !important;
    border-color: var(--sia-line-strong) !important;
  }
}

@media (max-width: 520px) {
  .floating-theme-toggle span {
    display: none;
  }

  .floating-theme-toggle {
    height: 46px;
    justify-content: center;
    padding: 0;
    width: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="dark"] *,
  html[data-theme="dark"] *::before,
  html[data-theme="dark"] *::after {
    transition-duration: 0.01ms !important;
  }
}
