html[data-theme="dark"] {
  --ink: #f2f2f2;
  --ink-muted: #aaaeb3;
  --paper: #101010;
  --panel: #191919;
  --line: #363636;
  --brand: #f46b85;
  --brand-rgb: 244, 107, 133;
  --brand-dark: #ff91a5;
  --brand-light: #401822;
  --lime: #f4b3c2;
  --shadow: 0 16px 44px rgba(0, 0, 0, .32);
  color-scheme: dark;
}

html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .mobile-nav,
html[data-theme="dark"] .preview-index,
html[data-theme="dark"] .report-tools-rail { background: #0f1917; }
html[data-theme="dark"] .topbar { border-bottom-color: rgba(42,56,53,.92); background: rgba(11,18,17,.88); }
html[data-theme="dark"] .workspace-chip,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .btn-soft,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .report-list.grid-view .report-row,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .preview-header,
html[data-theme="dark"] .report-back-button,
html[data-theme="dark"] .conviction-score,
html[data-theme="dark"] .preview-metrics,
html[data-theme="dark"] .preview-metrics > button,
html[data-theme="dark"] .report-card,
html[data-theme="dark"] .market-driver-grid article,
html[data-theme="dark"] .scenario-result-grid > div,
html[data-theme="dark"] .rail-card,
html[data-theme="dark"] .report-review-footer,
html[data-theme="dark"] .mobile-tool-sheet,
html[data-theme="dark"] .mobile-tool-sheet-header button,
html[data-theme="dark"] .toast { background: var(--panel); color: var(--ink); }
html[data-theme="dark"] .report-preview,
html[data-theme="dark"] .preview-page { background: #0d1614; }

html[data-theme="dark"] .top-search,
html[data-theme="dark"] .report-search,
html[data-theme="dark"] .filter-button,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .upload-dropzone,
html[data-theme="dark"] .share-setting,
html[data-theme="dark"] .rail-input,
html[data-theme="dark"] .notes-card textarea,
html[data-theme="dark"] .mobile-tool-input,
html[data-theme="dark"] .mobile-tool-input input,
html[data-theme="dark"] .mobile-tool-panel textarea { color: var(--ink); border-color: var(--line); background: #101a18; }
html[data-theme="dark"] :is(input, textarea)::placeholder { color: #71817d; }
html[data-theme="dark"] .top-search kbd { color: #9baaa7; border-color: #34423f; background: #192321; }
html[data-theme="dark"] .dropdown-menu { border: 1px solid var(--line) !important; background: #14201e; box-shadow: var(--shadow) !important; }
html[data-theme="dark"] .dropdown-item { color: #dce8e4; }
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus { color: var(--ink); background: #1b2a27; }
html[data-theme="dark"] .dropdown-divider { border-color: var(--line); }

html[data-theme="dark"] :is(
  .workspace-copy strong,
  .security-note strong,
  .profile-copy strong,
  .report-copy strong,
  .report-client strong,
  .chart-summary strong,
  .analyst-profile strong,
  .activity-item p strong,
  .upload-dropzone strong,
  .secure-callout strong,
  .share-setting strong,
  .report-section-nav strong,
  .preview-brand strong,
  .signal-list strong,
  .market-driver-grid strong,
  .map-detail strong,
  .scenario-control label,
  .access-details strong,
  .rail-card-heading strong,
  .report-note strong,
  .mobile-tool-sheet h4,
  .service-options strong
) { color: var(--ink); }
html[data-theme="dark"] :is(
  .workspace-copy small,
  .profile-copy small,
  .panel-header p,
  .report-copy small,
  .report-client small,
  .activity-item p,
  .analyst-note,
  .secure-callout,
  .secure-callout p,
  .preview-summary,
  .meridian-take p,
  .section-heading p:last-child,
  .market-driver-grid p,
  .submarket-row,
  .comp-table td,
  .assumption-note,
  .scenario-insight,
  .ask-card > p,
  .report-note p,
  .report-answer p,
  .mobile-tool-panel > p,
  .mobile-report-answer p,
  .service-options span small,
  .toast-body p
) { color: var(--ink-muted); }

html[data-theme="dark"] .theme-toggle { color: #f1cf70; background: #1b2825; }
html[data-theme="dark"] .theme-toggle:hover { color: #ffe39a; border-color: #596044; background: #222f2b; }
html[data-theme="dark"] .notification-dot { border-color: #0b1211; }
html[data-theme="dark"] .avatar-stack span { border-color: var(--panel); }
html[data-theme="dark"] .sidebar-nav .nav-link { color: #91a09d; }
html[data-theme="dark"] .sidebar-nav .nav-link:hover { color: var(--ink); background: #172320; }
html[data-theme="dark"] .sidebar-nav .nav-link.active { color: #a8ddd2; background: #18312b; }
html[data-theme="dark"] .nav-count { color: #9caaa7; }
html[data-theme="dark"] .workspace-avatar,
html[data-theme="dark"] .security-icon { color: #a6ddd1; }
html[data-theme="dark"] .role-switch,
html[data-theme="dark"] .support-card,
html[data-theme="dark"] .scenario-value-card,
html[data-theme="dark"] .chart-hover-value { background: #07100e; }
html[data-theme="dark"] .role-switch:hover { background: #142724; }
html[data-theme="dark"] .role-icon,
html[data-theme="dark"] .support-icon,
html[data-theme="dark"] .map-pin:hover,
html[data-theme="dark"] .map-pin.active { color: #172c2a; }
html[data-theme="dark"] .btn-soft:hover { color: #9fd8cd; border-color: #46605a; background: #172421; }

html[data-theme="dark"] .view-toggle,
html[data-theme="dark"] .chart-metric-switch,
html[data-theme="dark"] .comp-filter,
html[data-theme="dark"] .scenario-presets { background: #0e1715; }
html[data-theme="dark"] .view-toggle button.active,
html[data-theme="dark"] .chart-metric-switch button.active,
html[data-theme="dark"] .comp-filter button.active,
html[data-theme="dark"] .scenario-presets button.active { color: #a9ddd2; background: #1e2d2a; }
html[data-theme="dark"] .report-section-nav:hover { color: var(--ink); background: #172320; }
html[data-theme="dark"] .report-section-nav.active { color: #a8ddd2; background: #18312b; }
html[data-theme="dark"] .report-section-nav.active small { color: #94aaa5; }
html[data-theme="dark"] .report-section-nav > span:first-child { background: #1d2a27; }
html[data-theme="dark"] .secure-view-pill { color: #a6b4b1; background: #1e2a28; }
html[data-theme="dark"] .report-type-pill { color: #a8ddd2; }
html[data-theme="dark"] .section-number { color: #293632; }
html[data-theme="dark"] .preview-actions .icon-button.active { color: #f0cf74; border-color: #61583a; background: #332f1e; }

html[data-theme="dark"] .report-row,
html[data-theme="dark"] .activity-item,
html[data-theme="dark"] .submarket-row,
html[data-theme="dark"] .comp-table td { border-color: #26332f; }
html[data-theme="dark"] .report-row:hover,
html[data-theme="dark"] .comp-table tr:hover td { background: #15211f; }
html[data-theme="dark"] .row-menu:hover,
html[data-theme="dark"] .activity-type { color: #b1bfbc; background: #1a2724; }
html[data-theme="dark"] .report-thumbnail { border-color: #454545; background: #252525; box-shadow: 0 5px 14px rgba(0,0,0,.28); }
html[data-theme="dark"] .access-badge.shared,
html[data-theme="dark"] .trend.up { color: #91d1b1; background: #17372a; }
html[data-theme="dark"] .access-badge.private { color: #d8bf7e; background: #382f1c; }
html[data-theme="dark"] .access-badge.draft,
html[data-theme="dark"] .trend.neutral { color: #b0bab8; background: #27302e; }

html[data-theme="dark"] .stat-icon.blue { color: #94b4ff; background: #1a2a4a; }
html[data-theme="dark"] .stat-icon.green,
html[data-theme="dark"] .signal-icon.positive,
html[data-theme="dark"] .driver-icon.green { color: #8ed3b7; background: #17382c; }
html[data-theme="dark"] .stat-icon.amber,
html[data-theme="dark"] .signal-icon.watch,
html[data-theme="dark"] .driver-icon.amber { color: #e1bd79; background: #3a2d19; }
html[data-theme="dark"] .stat-icon.violet { color: #b8a9f0; background: #2c2545; }
html[data-theme="dark"] .driver-icon.blue { color: #9bb9eb; background: #1c2b43; }
html[data-theme="dark"] .mini-chart span,
html[data-theme="dark"] .market-bars button { background: #274039; }
html[data-theme="dark"] .market-chart-grid i { border-color: #2b3936; }
html[data-theme="dark"] .score-ring { border-color: #29423c; border-top-color: var(--brand); border-right-color: var(--brand); }
html[data-theme="dark"] .conviction-score > b,
html[data-theme="dark"] .preview-metrics small.positive,
html[data-theme="dark"] .online-pill { color: #86c5a5; }
html[data-theme="dark"] .chart-badge,
html[data-theme="dark"] .chart-feature-value span { color: #8bc8a8 !important; background: #18372a; }
html[data-theme="dark"] .ai-badge { color: #dfc66d; background: #3a3218; }

html[data-theme="dark"] .upload-dropzone.dragging,
html[data-theme="dark"] .secure-callout,
html[data-theme="dark"] .meridian-take,
html[data-theme="dark"] .scenario-insight,
html[data-theme="dark"] .report-answer,
html[data-theme="dark"] .mobile-report-answer { border-color: #29453e; background: #142a24; }
html[data-theme="dark"] .report-note,
html[data-theme="dark"] .analyst-note,
html[data-theme="dark"] .question-chips button,
html[data-theme="dark"] .mobile-question-chips button,
html[data-theme="dark"] .assumption-note { background: #182421; }
html[data-theme="dark"] .question-chips button,
html[data-theme="dark"] .mobile-question-chips button { color: #a8b7b4; border-color: var(--line); }
html[data-theme="dark"] .report-answer > span,
html[data-theme="dark"] .mobile-report-answer > span { background: #1c312c; }
html[data-theme="dark"] .service-options input:checked + span { border-color: var(--brand); background: #14302a; }

html[data-theme="dark"] .submarket-row.header,
html[data-theme="dark"] .comp-table th { color: #91a09d; background: #101a18; }
html[data-theme="dark"] .submarket-row.featured { background: #152a24; }
html[data-theme="dark"] .comp-map { background-color: #16221e; background-image: linear-gradient(30deg, rgba(255,255,255,.035) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.035) 87.5%), linear-gradient(150deg, rgba(255,255,255,.025) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.025) 87.5%); }
html[data-theme="dark"] .map-road { background: #293630; box-shadow: 0 0 0 1px #34413d; }
html[data-theme="dark"] .map-park { background: #203a2e; }
html[data-theme="dark"] .map-label { color: #74837f; }
html[data-theme="dark"] .map-pin { border-color: #15211e; }
html[data-theme="dark"] .map-detail { border-color: rgba(77,95,90,.72); background: rgba(17,29,26,.94); box-shadow: 0 10px 26px rgba(0,0,0,.28); }
html[data-theme="dark"] .match-score { color: #d0bc82; background: #352f20; }
html[data-theme="dark"] .match-score.high { color: #8bc8a8; background: #18372a; }
html[data-theme="dark"] .sensitivity-grid b { color: #a6b3b0; background: #202b28; }
html[data-theme="dark"] .sensitivity-grid i.risk { color: #e5a294; background: #3d2722; }
html[data-theme="dark"] .sensitivity-grid i.watch { color: #dec080; background: #3b301d; }
html[data-theme="dark"] .sensitivity-grid i.good { color: #91c7aa; background: #1d382a; }
html[data-theme="dark"] .sensitivity-grid i.great { color: #91d4b3; background: #17412e; }
html[data-theme="dark"] .report-next-section { color: var(--ink); border-color: #315048; background: linear-gradient(115deg, #142722, #121d1b); box-shadow: 0 9px 24px rgba(0,0,0,.18); }
html[data-theme="dark"] .report-next-section:hover { border-color: #497267; background: linear-gradient(115deg, #19322b, #16221f); }
html[data-theme="dark"] .next-section-copy > span { color: var(--ink-muted); }

html[data-theme="dark"] .mobile-report-actions { border-color: rgba(52,69,65,.9); background: rgba(18,29,27,.94); box-shadow: 0 15px 36px rgba(0,0,0,.35); }
html[data-theme="dark"] .mobile-report-actions button { color: #a5b4b1; }
html[data-theme="dark"] .mobile-report-actions button:hover,
html[data-theme="dark"] .mobile-report-actions button.active { color: #b5e6dc; background: #19312b; }
html[data-theme="dark"] .mobile-contents-trigger,
html[data-theme="dark"] .mobile-content-nav { color: var(--ink); border-color: var(--line); background: #101a18; }
html[data-theme="dark"] .mobile-contents-trigger.active,
html[data-theme="dark"] .mobile-content-nav.active { color: #b5e6dc; border-color: #365a51; background: #18312b; }
html[data-theme="dark"] .mobile-content-nav:hover { color: var(--ink); border-color: #38524b; background: #162521; }
html[data-theme="dark"] .mobile-contents-trigger small,
html[data-theme="dark"] .mobile-content-copy small { color: #8f9e9a; }
html[data-theme="dark"] .mobile-content-number,
html[data-theme="dark"] .mobile-contents-progress { background: #1a2724; }
html[data-theme="dark"] .mobile-content-nav.active .mobile-content-number { color: #fff; background: var(--brand); }
html[data-theme="dark"] .mobile-content-nav.active .mobile-content-state { color: #a8ddd2; background: #203d36; }
html[data-theme="dark"] .mobile-contents-progress-bar { background: #293733; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) { color-scheme: dark; }
}

