/* DYOR preferred palette contract — deliberately loaded after every legacy layer. */
:root {
  --dyor-void: #111111;
  --dyor-black: #111111;
  --dyor-graphite: #202020;
  --dyor-dark-grey: #202020;
  --dyor-iron: #202020;
  --dyor-iron-light: #FFFFFF;
  --dyor-paper: #FFFFFF;
  --dyor-white: #FFFFFF;
  --dyor-orange: #E85002;
  --dyor-orange-soft: #E85002;
  --dyor-positive: #16d7aa;
  --bg: var(--dyor-void);
  --panel: var(--dyor-black);
  --panel-soft: var(--dyor-graphite);
  --surface: var(--dyor-black);
  --surface-soft: var(--dyor-graphite);
  --ink: var(--dyor-paper);
  --text: var(--dyor-paper);
  --white: var(--dyor-paper);
  --muted: var(--dyor-iron-light);
  --line: rgba(242,242,242,.22);
  --border: rgba(242,242,242,.22);
  --accent: var(--dyor-orange);
  --accent-orange: var(--dyor-orange);
  --accent-lime: var(--dyor-iron);
  --orange: var(--dyor-orange);
  --red: var(--dyor-orange);
  --green: var(--dyor-iron);
  --lime: var(--dyor-iron);
  --blue: var(--dyor-dark-grey);
  --blue-strong: var(--dyor-dark-grey);
  --blue-neon: var(--dyor-iron);
  --cream: var(--dyor-paper);
  --paper: var(--dyor-paper);
  --paper-warm: var(--dyor-paper);
  --positive: var(--dyor-positive);
  --danger: var(--dyor-orange);
}

html, body, .app-shell { background: var(--dyor-void) !important; color: var(--dyor-paper) !important; }
body::before { opacity: .24 !important; filter: grayscale(1) !important; }

/* Shell and navigation */
.side-nav,
.topbar,
.mobile-nav-toggle,
.more-menu,
.command-palette,
.site-footer {
  border-color: rgba(242,242,242,.24) !important;
  background: var(--dyor-black) !important;
  color: var(--dyor-paper) !important;
  box-shadow: none !important;
}
.brand, .brand strong, .nav-link, .more-menu :where(a,button), .site-footer :where(a,span,p) { color: var(--dyor-paper) !important; }
.brand .dyor-y, .site-footer a { color: var(--dyor-orange) !important; }
.nav-link:is(.active,[aria-current="page"],:hover,:focus-visible),
.more-menu :where(a,button):is(:hover,:focus-visible) {
  border-color: var(--dyor-orange) !important;
  background: var(--dyor-orange) !important;
  color: var(--dyor-black) !important;
}
.nav-link:is(.active,[aria-current="page"],:hover,:focus-visible) * { color: var(--dyor-black) !important; }
.nav-badge, .watchlist-count, .portfolio-count, .count-pill {
  border-color: var(--dyor-iron) !important;
  background: var(--dyor-graphite) !important;
  color: var(--dyor-paper) !important;
  box-shadow: none !important;
}

/* Homepage and entrance */
.entrance,
#home-view,
.home-hero,
.marketing-hero,
.homepage-story,
.homepage-proof,
.homepage-cta { background-color: var(--dyor-void) !important; color: var(--dyor-paper) !important; }
.entrance :where(h1,h2,h3,strong,b,p,span,small,label),
#home-view :where(h1,h2,h3,h4,strong,b) { color: var(--dyor-paper) !important; }
.entrance :where(p,small,.hero-proof small),
#home-view :where(p,small,li,figcaption) { color: var(--dyor-iron-light) !important; }
.entrance .eyebrow, #home-view :where(.eyebrow,.label) { color: var(--dyor-orange-soft) !important; }
.entrance .hero-proof,
#home-view :where(.marketing-proof-card,.home-proof-card,.market-read,.homepage-cta,.home-feature-card) {
  border-color: rgba(242,242,242,.24) !important;
  background: var(--dyor-black) !important;
  box-shadow: none !important;
}
.entrance .hero-search,
#home-view :where(.search,input,select) { border-color: var(--dyor-iron) !important; background: var(--dyor-graphite) !important; color: var(--dyor-paper) !important; }
.entrance-live-status[data-state="live"]::before { background: var(--dyor-orange) !important; box-shadow: 0 0 0 .24rem rgba(255,77,0,.14) !important; }

/* Homepage semantic colour roles: orange is brand; green is positive data only. */
.entrance-header .nav-cta,
.entrance .entrance-button,
.entrance .hero-actions .entrance-button,
.entrance-search button {
  border-color: var(--dyor-orange) !important;
  background: var(--dyor-orange) !important;
  color: var(--dyor-black) !important;
}
.entrance-header > a span,
.entrance .opening .hero-copy em,
.entrance .opening .hero-copy h1 span,
.entrance .final-scene > em { color: var(--dyor-orange) !important; }
.entrance .opening,
.entrance .scene,
.entrance .final-scene { background-color: var(--dyor-black) !important; color: var(--dyor-paper) !important; }
.entrance .scene :where(h1,h2,h3,p,b,strong,span,small,li,a,em),
.entrance .final-scene :where(h1,h2,h3,p,b,strong,span,small,li,a,em) { color: var(--dyor-paper) !important; }
.entrance .opening .hero-copy em,
.entrance .opening .hero-copy h1 span,
.entrance .final-scene > em { color: var(--dyor-orange) !important; }
.entrance .market-tape { border-color: rgba(242,242,242,.22) !important; background: var(--dyor-black) !important; }
.entrance .market-tape :where(span,b,small) { color: var(--dyor-paper) !important; }
.entrance .market-tape i:not(.down) { color: var(--dyor-positive) !important; }
.entrance .market-tape i.down { color: var(--dyor-orange) !important; }
.entrance .hero-proof { background: var(--dyor-black) !important; }
.entrance .hero-proof :where(b,small) { color: var(--dyor-paper) !important; }

/* Shared page canvas */
body:not(.entrance-active) #main-content,
body:not(.entrance-active) #main-content > .view,
body:not(.entrance-active) #main-content > [id$="-view"] {
  background-color: var(--dyor-void) !important;
  color: var(--dyor-paper) !important;
}
:is(#discover-view,#asset-view,#watchlist-view,#portfolio-view,#compare-view,#report-view,#share-view,#newsletter-view,#support-view,#universe-view,#methodology-view,#data-sources-view,#provider-status-view,#labs-view) > :is(.page-heading,.asset-browser-panel,.support-blog-hero) {
  border-color: rgba(242,242,242,.28) !important;
  background: var(--dyor-black) !important;
  color: var(--dyor-paper) !important;
  box-shadow: 10px 10px 0 var(--dyor-orange) !important;
}
:is(#discover-view,#asset-view,#watchlist-view,#portfolio-view,#compare-view,#report-view,#share-view,#newsletter-view,#support-view,#universe-view,#methodology-view,#data-sources-view,#provider-status-view,#labs-view) > :is(.page-heading,.asset-browser-panel,.support-blog-hero)::after { color: rgba(255,77,0,.86) !important; border-color: var(--dyor-orange) !important; }

/* Shared dark product surfaces */
:is(#discover-view,#asset-view,#watchlist-view,#portfolio-view,#compare-view,#share-view,#newsletter-view,#support-view,#universe-view,#methodology-view,#data-sources-view,#provider-status-view,#labs-view)
  :where(.panel,.card,.metric-card,.research-card,.source-card,.watchlist-card,.watch-alert-card,.saved-evidence-change-card,.portfolio-overview,.portfolio-holdings,.portfolio-stress,.portfolio-factor,.portfolio-liquidity,.share-controls,.share-tile,.newsletter-cover-card,.newsletter-lead-story,.newsletter-queue-card,.support-blog-card,.research-engine-surface,.live-discovery-card,.discover-row,.discover-mini-card,.compare-metric,.universe-asset-card,.data-tile) {
  border-color: rgba(242,242,242,.24) !important;
  background: var(--dyor-black) !important;
  color: var(--dyor-paper) !important;
  box-shadow: none !important;
}
:is(#discover-view,#asset-view,#watchlist-view,#portfolio-view,#compare-view,#share-view,#newsletter-view,#support-view,#universe-view,#methodology-view,#data-sources-view,#provider-status-view,#labs-view)
  :where(.panel,.card,.metric-card,.research-card,.source-card,.watchlist-card,.watch-alert-card,.saved-evidence-change-card,.share-controls,.share-tile,.newsletter-cover-card,.newsletter-lead-story,.newsletter-queue-card,.support-blog-card,.research-engine-surface,.live-discovery-card,.discover-row,.discover-mini-card,.compare-metric,.universe-asset-card,.data-tile)
  :where(h1,h2,h3,h4,strong,b,label,dt) { color: var(--dyor-paper) !important; }
:is(#discover-view,#asset-view,#watchlist-view,#portfolio-view,#compare-view,#share-view,#newsletter-view,#support-view,#universe-view,#methodology-view,#data-sources-view,#provider-status-view,#labs-view)
  :where(.panel,.card,.metric-card,.research-card,.source-card,.watchlist-card,.watch-alert-card,.saved-evidence-change-card,.share-controls,.share-tile,.newsletter-cover-card,.newsletter-lead-story,.newsletter-queue-card,.support-blog-card,.research-engine-surface,.live-discovery-card,.discover-row,.discover-mini-card,.compare-metric,.universe-asset-card,.data-tile)
  :where(p,li,dd,small,time,figcaption,span:not(.source-stage-badge):not(.signal-pill)) { color: var(--dyor-iron-light) !important; }

/* Controls and active states */
:where(button,.primary-button,.text-button,.save-button,a,summary,input,select,textarea) { accent-color: var(--dyor-orange); }
:where(input,select,textarea,.search) {
  border-color: var(--dyor-iron) !important;
  background: var(--dyor-graphite) !important;
  color: var(--dyor-paper) !important;
}
:where(input,textarea)::placeholder { color: var(--dyor-iron-light) !important; opacity: .82; }
.primary-button,
.entrance .hero-primary,
:where([data-action="generate-report"],[data-action="save-research"]) {
  border-color: var(--dyor-orange) !important;
  background: var(--dyor-orange) !important;
  color: var(--dyor-black) !important;
  box-shadow: none !important;
}
.text-button, .save-button, .tabs button, .segmented button, .asset-filter-chips button, .discover-view-stack button {
  border-color: var(--dyor-iron) !important;
  background: var(--dyor-graphite) !important;
  color: var(--dyor-paper) !important;
  box-shadow: none !important;
}
:where(.text-button,.save-button,.tabs button,.segmented button,.asset-filter-chips button,.discover-view-stack button):is(.active,[aria-pressed="true"],:hover,:focus-visible) {
  border-color: var(--dyor-orange) !important;
  background: var(--dyor-orange) !important;
  color: var(--dyor-black) !important;
}
:where(button,a,summary,input,select,textarea):focus-visible { outline: 3px solid var(--dyor-orange) !important; outline-offset: 3px !important; }

/* Status is conveyed by text and geometry; colour remains within the core system. */
.source-stage-badge,
.signal-pill,
.pill,
.asset-category-chip {
  border-color: var(--dyor-iron) !important;
  background: var(--dyor-graphite) !important;
  color: var(--dyor-paper) !important;
}
.source-stage-badge.stage-live,
.source-stage-badge.stage-connected,
.source-stage-badge.stage-calculated { border-left: 4px solid var(--dyor-paper) !important; }
.source-stage-badge:is(.stage-unavailable,.stage-source_pending),
.signal-pill:is(.overhyped,.danger) { border-left: 4px solid var(--dyor-orange) !important; color: var(--dyor-orange-soft) !important; }
:where(.bar-fill,.mini-metric i em,.score-bar i,.progress-bar i) { background: var(--dyor-orange) !important; }

/* Directional data exception. Positive is green; negative is orange. */
:where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive),
:where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive) :where(strong,b,span,small) {
  color: var(--dyor-positive) !important;
}
:where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative),
:where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative) :where(strong,b,span,small) {
  color: var(--dyor-orange) !important;
}
:where(.chart-positive,.series-positive,.trend-up) { --series-color: var(--dyor-positive); stroke: var(--dyor-positive) !important; fill: var(--dyor-positive) !important; }
:where(.chart-negative,.series-negative,.trend-down) { --series-color: var(--dyor-orange); stroke: var(--dyor-orange) !important; fill: var(--dyor-orange) !important; }

/* Portfolio and watchlist */
#portfolio-view :where(.research-portfolio-summary,.portfolio-kpis>div),
#watchlist-view :where(.watchlist-summary,.watchlist-briefing) {
  border-color: var(--dyor-black) !important;
  background: var(--dyor-paper) !important;
  color: var(--dyor-black) !important;
}
#portfolio-view :where(.research-portfolio-summary,.portfolio-kpis>div) *,
#watchlist-view :where(.watchlist-summary,.watchlist-briefing) :where(h2,h3,h4,strong,b,p,span,small) { color: var(--dyor-black) !important; }
#portfolio-view .portfolio-factor-card:is(:hover,:focus-visible,.expanded),
#watchlist-view .watchlist-card:is(:hover,:focus-within) { border-color: var(--dyor-orange) !important; }

/* Share, newsletter and support use intentional paper inversion. */
:is(#share-view,#newsletter-view,#support-view) :where(.newsletter-market-board,.newsletter-side-note,.support-blog-card:nth-of-type(even),.share-preview-card) {
  border-color: var(--dyor-black) !important;
  background: var(--dyor-paper) !important;
  color: var(--dyor-black) !important;
}
:is(#share-view,#newsletter-view,#support-view) :where(.newsletter-market-board,.newsletter-side-note,.support-blog-card:nth-of-type(even),.share-preview-card) :where(h2,h3,h4,strong,b,p,span,small,li) { color: var(--dyor-black) !important; }

/* Buddy follows the product rather than retaining the cream/lime prototype. */
.buddy-launcher,
.dyor-buddy,
.dyor-buddy :where(.buddy-handle,.buddy-thread,.buddy-compose,.buddy-suggestions,.buddy-context,.buddy-answer) {
  border-color: rgba(242,242,242,.3) !important;
  background: var(--dyor-black) !important;
  color: var(--dyor-paper) !important;
  box-shadow: none !important;
}
.buddy-launcher :where(b,small,kbd),
.dyor-buddy :where(h2,h3,strong,b,p,span,small,li,summary,label) { color: var(--dyor-paper) !important; }
.dyor-buddy :where(.buddy-handle small,.buddy-context small,.buddy-limit,.buddy-welcome p,.buddy-answer ul) { color: var(--dyor-iron-light) !important; }
.buddy-avatar { border-color: var(--dyor-orange) !important; box-shadow: 0 0 0 5px rgba(255,77,0,.14) !important; }
.buddy-question,
.dyor-buddy .buddy-modes button[aria-pressed="true"],
.dyor-buddy .buddy-modes button[aria-selected="true"],
.dyor-buddy .primary-button { border-color: var(--dyor-orange) !important; background: var(--dyor-orange) !important; color: var(--dyor-black) !important; }
.dyor-buddy textarea { border-color: var(--dyor-iron) !important; background: var(--dyor-graphite) !important; color: var(--dyor-paper) !important; }

/* Reference-led shape language: soft actions, composed Buddy, quiet keylines. */
:where(.primary-button,.entrance-button,.nav-cta,[data-primary-action],[data-action="generate-report"],[data-action="save-research"]) {
  min-height: 44px !important;
  border-radius: 999px !important;
  padding-inline: 1.35rem !important;
}
:where(.text-button,.save-button,.tabs button,.segmented button,.asset-filter-chips button,.discover-view-stack button,input,select,textarea,summary) {
  border-radius: 12px !important;
}
:where(.panel,.card,[class$="-panel"],[class$="-card"],[class$="-surface"],[class$="-workbench"],[class$="-module"]) {
  border-color: rgba(242,242,242,.22) !important;
  box-shadow: none !important;
}
.buddy-launcher { border-radius: 999px !important; }
.dyor-buddy { border-radius: 20px !important; overflow: hidden !important; }
.dyor-buddy :where(.buddy-handle,.buddy-thread,.buddy-compose,.buddy-suggestions,.buddy-context,.buddy-answer) {
  border-color: rgba(242,242,242,.22) !important;
}

/* The Buddy sheet must remain opaque even when palette variables are not scoped
   onto a server-rendered research route. */
html body .dyor-buddy,
html body .dyor-buddy :where(.buddy-handle,.buddy-thread,.buddy-suggestions,.buddy-context) {
  background: #11100f !important;
  background-color: #11100f !important;
}
html body .dyor-buddy .buddy-compose,
html body .dyor-buddy .buddy-answer {
  background: #202020 !important;
  background-color: #202020 !important;
}

/* Final six-colour lock. Legacy grey and blue-black surfaces resolve here. */
:where(.signal-stack>article,.market-console,.flow-strip>article,.signal-list>article,.buddy-panel,.lens-grid>a,.narrative-grid>article,
  .live-discovery-panel,.live-discovery-card,.verified-change-event>article,.verified-change-proof,.research-engine-surface,
  .compare-hero-card,.re-divergence-list>article,.re-summary-grid>article,.re-question,.re-agenda>article,
  .watchlist-card,.watch-alert-card,.saved-evidence-change-card,.report-outcome-card,.report-advanced-settings,.report-export-options) {
  background: var(--dyor-graphite) !important;
  color: var(--dyor-paper) !important;
  border-color: rgba(242,242,242,.22) !important;
}
:where(.signal-stack>article,.market-console,.flow-strip>article,.signal-list>article,.buddy-panel,.lens-grid>a,.narrative-grid>article,
  .live-discovery-panel,.live-discovery-card,.verified-change-event>article,.verified-change-proof,.research-engine-surface,
  .compare-hero-card,.re-divergence-list>article,.re-summary-grid>article,.re-question,.re-agenda>article,
  .watchlist-card,.watch-alert-card,.saved-evidence-change-card,.report-outcome-card,.report-advanced-settings,.report-export-options)
  :where(h1,h2,h3,h4,p,strong,b,span,small,li,dt,dd,time,label,summary,a) { color: var(--dyor-paper) !important; }

:where(.eyebrow,.label,.tip-kicker,.identity-accent,.impact-text,.brand .dyor-y,.entrance-header>a span,.entrance-footer>a span) {
  color: var(--dyor-orange) !important;
}
:where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive),
:where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive) :where(strong,b,span,small) {
  color: var(--dyor-positive) !important;
}
:where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative),
:where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative) :where(strong,b,span,small) {
  color: var(--dyor-orange) !important;
}

/* Report pages remain paper-led. */
#report-view .report-controls,
#report-view .report-preview,
#report-view .report-preview :where(.report-verdict-card,.report-callout,.report-visual,.report-compare-card,.report-evidence,.report-category-section,.report-investor-read,.report-kpi) {
  background-color: var(--dyor-paper) !important;
  color: var(--dyor-black) !important;
}
#report-view .report-controls :where(h1,h2,h3,h4,strong,b,p,span,small,label,summary),
#report-view .report-preview :where(h1,h2,h3,h4,strong,b,p,span,small,li,dt,dd) { color: var(--dyor-black) !important; }
#report-view .report-preview .report-kpi:nth-child(2),
#report-view .report-outcome-card:is(.active,[aria-pressed="true"],:hover) { background: var(--dyor-orange) !important; color: var(--dyor-black) !important; }
#report-view .report-outcome-card { background: var(--dyor-black) !important; color: var(--dyor-paper) !important; }
#report-view .report-outcome-card * { color: inherit !important; }

/* Hydrated route states must not reintroduce legacy prototype colours. */
:where(.verified-change-event,.verified-change-event>article,.verified-change-proof,.re-result-card,.re-summary-grid>article,
  .re-buddy,.re-agenda>article,.re-question,.compare-hero-card) {
  background: var(--dyor-graphite) !important;
  border-color: rgba(242,242,242,.22) !important;
  box-shadow: none !important;
}
:where(.verified-change-proof span,.verified-change-proof a,.re-result-card footer span,.re-summary-grid>article>span,
  .re-buddy span,.re-agenda>article span,.re-evidence-list li span,.re-question legend,.compare-hero-card>div>span,
  .report-chapter-nav button span) { color: var(--dyor-paper) !important; }
:where(button[data-re-preset].active,button[data-re-preset="material-change"]) {
  background: var(--dyor-orange) !important;
  border-color: var(--dyor-orange) !important;
}
:where(button[data-re-preset].active,button[data-re-preset="material-change"]) * {
  color: var(--dyor-black) !important;
}
:where(.primary-nav a.active,.primary-nav button.active) {
  background: var(--dyor-graphite) !important;
  color: var(--dyor-paper) !important;
  border-color: rgba(242,242,242,.24) !important;
}
.compare-hero-card :where(.positive,[data-direction="up"]) { color: var(--dyor-positive) !important; }
.compare-hero-card :where(.negative,[data-direction="down"]) { color: var(--dyor-orange) !important; }

html[data-theme] body #discover-view .verified-change-event,
html[data-theme] body #discover-view .verified-change-event > article,
html[data-theme] body #discover-view .verified-change-proof {
  background: var(--dyor-graphite) !important;
  border-color: rgba(242,242,242,.22) !important;
}
html[data-theme] body #discover-view .verified-change-proof span,
html[data-theme] body #discover-view .verified-change-proof strong,
html[data-theme] body #discover-view .verified-change-proof a { color: var(--dyor-paper) !important; }
html[data-theme] body #discover-view button[data-re-preset="material-change"],
html[data-theme] body #discover-view button[data-re-preset].active {
  background: var(--dyor-orange) !important;
  border-color: var(--dyor-orange) !important;
}
html[data-theme] body #discover-view button[data-re-preset="material-change"] strong,
html[data-theme] body #discover-view button[data-re-preset].active strong,
html[data-theme] body #discover-view .re-result-card footer span { color: var(--dyor-paper) !important; }
html[data-theme] body #discover-view button[data-re-preset="material-change"] strong,
html[data-theme] body #discover-view button[data-re-preset].active strong { color: var(--dyor-black) !important; }

html[data-theme] body #asset-view .re-summary-grid > article > span,
html[data-theme] body #asset-view .re-buddy span,
html[data-theme] body #asset-view .re-agenda > article span,
html[data-theme] body #asset-view .re-evidence-list li span,
html[data-theme] body #asset-view .re-question legend { color: var(--dyor-paper) !important; }
html[data-theme] body #asset-view .re-buddy { background: var(--dyor-graphite) !important; }

html[data-theme] body #compare-view .compare-hero-card {
  background: var(--dyor-graphite) !important;
  border-color: rgba(242,242,242,.22) !important;
}
html[data-theme] body #compare-view .compare-hero-card:nth-child(1) > div > span { color: var(--dyor-positive) !important; }
html[data-theme] body #compare-view .compare-hero-card:nth-child(2) > div > span { color: var(--dyor-orange) !important; }
html[data-theme] body #compare-view .active > span { color: var(--dyor-paper) !important; background: var(--dyor-graphite) !important; }

html[data-theme] body #report-view button[data-report-chapter-target].active,
html[data-theme] body #report-view button[data-report-chapter-target][aria-selected="true"] {
  background: var(--dyor-graphite) !important;
  border-color: var(--dyor-orange) !important;
}
html[data-theme] body #report-view button[data-report-chapter-target].active span,
html[data-theme] body #report-view button[data-report-chapter-target][aria-selected="true"] span { color: var(--dyor-paper) !important; }

/* Specificity fence for legacy !important rules retained for older themes. */
html[data-theme] body #discover-view#discover-view .verified-change-event > article .verified-change-proof a {
  color: var(--dyor-paper) !important;
}
html[data-theme] body #discover-view#discover-view button[data-re-preset="material-change"] > strong,
html[data-theme] body #discover-view#discover-view button[data-re-preset="material-change"] > span {
  color: var(--dyor-black) !important;
  opacity: 1 !important;
}
html[data-theme] body #discover-view#discover-view .re-result-card .re-state {
  background: var(--dyor-graphite) !important;
  color: var(--dyor-paper) !important;
  border-color: currentColor !important;
}
html[data-theme] body #asset-view#asset-view .re-state.re-unknown,
html[data-theme] body #asset-view#asset-view .re-state.re-stale {
  background: var(--dyor-graphite) !important;
  color: var(--dyor-paper) !important;
  border-color: var(--dyor-paper) !important;
}
html[data-theme] body #compare-view#compare-view button.active > span,
html[data-theme] body #compare-view#compare-view a.active > span { background: var(--dyor-graphite) !important; color: var(--dyor-paper) !important; }
html[data-theme] body .secondary-nav-links .nav-link.active,
html[data-theme] body .secondary-nav-links .nav-link[aria-current="page"] {
  background: var(--dyor-graphite) !important;
  border: 1px solid var(--dyor-orange) !important;
  color: var(--dyor-paper) !important;
}
html[data-theme] body .secondary-nav-links .nav-link.active > span,
html[data-theme] body .secondary-nav-links .nav-link[aria-current="page"] > span {
  background: transparent !important;
  color: var(--dyor-paper) !important;
}
html[data-theme] body #report-view#report-view button[data-report-chapter-target].active > span,
html[data-theme] body #report-view#report-view button[data-report-chapter-target][aria-selected="true"] > span {
  color: var(--dyor-paper) !important;
}
html[data-theme] body #report-view#report-view button[data-report-chapter-target][aria-current="location"] {
  background: var(--dyor-graphite) !important;
  border-color: var(--dyor-orange) !important;
}
html[data-theme] body #report-view#report-view button[data-report-chapter-target][aria-current="location"] > :where(span,strong) {
  color: var(--dyor-paper) !important;
}

/* Final compatibility lock: legacy theme files retain layout, this terminal layer owns investor-visible paint. */
html body { background-color: var(--dyor-black) !important; color: var(--dyor-paper) !important; }
html body :where(h1,h2,h3,h4,h5,h6,p,span,small,strong,b,em,label,legend,li,dt,dd,th,td,time,code,kbd,a,summary) { color: var(--dyor-paper) !important; }
html body :where(main,section,article,aside,nav,header,footer,form,fieldset,div,ul,ol,table,thead,tbody,tr) { border-color: var(--dyor-graphite) !important; }
html body :where(button,input,select,textarea,.nav-link,.secondary-nav-links,.command-centre,.command-centre-panel) {
  background-color: var(--dyor-graphite) !important; color: var(--dyor-paper) !important; border-color: var(--dyor-paper) !important;
}
html body :where(.primary-button,.entrance-button,.nav-cta,[data-primary-action],button[type="submit"]) {
  background-color: var(--dyor-orange) !important; color: var(--dyor-black) !important; border-color: var(--dyor-orange) !important;
}
html body :where(.primary-button,.entrance-button,.nav-cta,[data-primary-action],button[type="submit"]) * { color: var(--dyor-black) !important; }
html body :where(.panel,.card,[class$="-panel"],[class$="-card"],[class$="-surface"],[class$="-workbench"],[class$="-module"],.trust-page>section,.trust-page>article,.trust-page table,.status-card,.provider-card,.report-preview,.report-controls) {
  background-color: var(--dyor-graphite) !important; color: var(--dyor-paper) !important; border-color: var(--dyor-graphite) !important; background-image: none !important;
}
html body :where(.report-preview,.report-controls,.report-preview *) { color: var(--dyor-paper) !important; }
html body :where(.report-preview article,.report-preview section,.report-preview header,.report-preview footer,.report-preview div) { background-color: transparent !important; background-image: none !important; }
html body :where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive),html body :where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive) * { color: var(--dyor-positive) !important; }
html body :where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative),html body :where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative) * { color: var(--dyor-orange) !important; }
html body :where(.eyebrow,.identity-accent,.impact-text,.brand .dyor-y) { color: var(--dyor-orange) !important; }
html body :where(a,button,input,select,textarea,summary):focus-visible { outline: 3px solid var(--dyor-orange) !important; outline-offset: 3px !important; }
html body svg :where(text,tspan) { fill: var(--dyor-paper) !important; }
html[data-theme] body #command-centre-launcher#command-centre-launcher > span { color: var(--dyor-paper) !important; }
html[data-theme] body #discover-view#discover-view button[data-re-preset]:not(.active) > span { color: var(--dyor-paper) !important; opacity: 1 !important; }
html[data-theme] body #watchlist-view#watchlist-view button[aria-label^="Open "] > :where(span,p,small,strong),
html[data-theme] body #watchlist-view#watchlist-view button[aria-label^="Open "] .asset-identity-copy > strong { color: var(--dyor-paper) !important; }
html body.quality-console-page .quality-nav a[aria-current="page"] { background: var(--dyor-graphite) !important; color: var(--dyor-paper) !important; border: 1px solid var(--dyor-orange) !important; }

/* Two impossible-id guards give this deliberate release lock precedence over legacy ID selectors. */
html body *,
html body *::before,
html body *::after {
  color: var(--dyor-paper) !important;
  border-color: var(--dyor-graphite) !important;
  text-decoration-color: var(--dyor-orange) !important;
  outline-color: var(--dyor-orange) !important;
}
html body :where(button,input,select,textarea,.nav-link,.panel,.card,[class$="-panel"],[class$="-card"],[class$="-surface"],[class$="-module"]) {
  background-color: var(--dyor-graphite) !important;
  background-image: none !important;
  color: var(--dyor-paper) !important;
}
html body :where(.primary-button,.entrance-button,.nav-cta,[data-primary-action],button[type="submit"]) {
  background-color: var(--dyor-orange) !important;
  color: var(--dyor-black) !important;
  border-color: var(--dyor-orange) !important;
}
html body :where(.primary-button,.entrance-button,.nav-cta,[data-primary-action],button[type="submit"]) * { color: var(--dyor-black) !important; }
html body :where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive),
html body :where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive) * { color: var(--dyor-positive) !important; }
html body :where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative),
html body :where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative) * { color: var(--dyor-orange) !important; }
html body svg :where(text,tspan) { fill: var(--dyor-paper) !important; }
html body * {
  color: var(--dyor-paper) !important;
  background-color: transparent !important;
  background-image: none !important;
}
html body :where(button,input,select,textarea,.nav-link,.panel,.card,[class$="-panel"],[class$="-card"],[class$="-surface"],[class$="-module"]) {
  background-color: var(--dyor-graphite) !important;
  background-image: none !important;
}
html body :where(.eyebrow,.label,.identity-accent,.impact-text,.brand .dyor-y) { color: var(--dyor-orange) !important; }
html body :where(.primary-button,.entrance-button,.nav-cta,[data-primary-action],button[type="submit"]) { background-color: var(--dyor-orange) !important; color: var(--dyor-black) !important; }
html body :where(.primary-button,.entrance-button,.nav-cta,[data-primary-action],button[type="submit"]) * { color: var(--dyor-black) !important; }
html body :where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive),
html body :where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive) * { color: var(--dyor-positive) !important; }
html body :where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative),
html body :where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative) * { color: var(--dyor-orange) !important; }
html body .market-tape i:not(.down) { color: var(--dyor-positive) !important; }
html body .market-tape i.down { color: var(--dyor-orange) !important; }

/* Production hydration fence: dynamic research and comparison markup may carry
   legacy ID-scoped paint. Layout stays untouched; this layer only owns colour. */
html body:not(#production-palette-1):not(#production-palette-2):not(#production-palette-3):not(#production-palette-4):not(#production-palette-5):not(#production-palette-6):not(#production-palette-7):not(#production-palette-8):not(#production-palette-9):not(#production-palette-10) :not(:where(.research-evidence-consumers,.research-evidence-consumers *,button,button *,select,select *,#research-instrument *,#discovery-brief *,#connected-discovery *,#connected-research *,#report-view *,#research-snapshot *,#research-engine-workspace *,#research-review-workspace *, #portfolio-intelligence-feed *, #portfolio-coverage-map *,.re-state,.watchlist-options *, .support-blog-actions, .support-blog-actions *)) {
  color: var(--dyor-paper) !important;
  border-color: var(--dyor-graphite) !important;
}
html body:not(#production-palette-1):not(#production-palette-2):not(#production-palette-3):not(#production-palette-4):not(#production-palette-5):not(#production-palette-6):not(#production-palette-7):not(#production-palette-8):not(#production-palette-9):not(#production-palette-10) :where(.primary-button,.entrance-button,.nav-cta,[data-primary-action],button[type="submit"]),
html body:not(#production-palette-1):not(#production-palette-2):not(#production-palette-3):not(#production-palette-4):not(#production-palette-5):not(#production-palette-6):not(#production-palette-7):not(#production-palette-8):not(#production-palette-9):not(#production-palette-10) :where(.primary-button,.entrance-button,.nav-cta,[data-primary-action],button[type="submit"]) * {
  background-color: var(--dyor-orange) !important;
  color: var(--dyor-black) !important;
  border-color: var(--dyor-orange) !important;
}
html body:not(#production-palette-1):not(#production-palette-2):not(#production-palette-3):not(#production-palette-4):not(#production-palette-5):not(#production-palette-6):not(#production-palette-7):not(#production-palette-8):not(#production-palette-9):not(#production-palette-10) svg [stroke]:not([stroke="none"]):not(.chart-series-primary):not(.chart-series-secondary):not(.chart-series-benchmark) {
  stroke: var(--dyor-paper) !important;
}
html body:not(#production-palette-1):not(#production-palette-2):not(#production-palette-3):not(#production-palette-4):not(#production-palette-5):not(#production-palette-6):not(#production-palette-7):not(#production-palette-8):not(#production-palette-9):not(#production-palette-10) :where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive),
html body:not(#production-palette-1):not(#production-palette-2):not(#production-palette-3):not(#production-palette-4):not(#production-palette-5):not(#production-palette-6):not(#production-palette-7):not(#production-palette-8):not(#production-palette-9):not(#production-palette-10) :where(.positive,.change-positive,.movement-up,.price-read.up,.score-history-delta.positive) * {
  color: var(--dyor-positive) !important;
  stroke: var(--dyor-positive) !important;
}
html body:not(#production-palette-1):not(#production-palette-2):not(#production-palette-3):not(#production-palette-4):not(#production-palette-5):not(#production-palette-6):not(#production-palette-7):not(#production-palette-8):not(#production-palette-9):not(#production-palette-10) :where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative),
html body:not(#production-palette-1):not(#production-palette-2):not(#production-palette-3):not(#production-palette-4):not(#production-palette-5):not(#production-palette-6):not(#production-palette-7):not(#production-palette-8):not(#production-palette-9):not(#production-palette-10) :where(.negative,.change-negative,.movement-down,.price-read.down,.score-history-delta.negative) * {
  color: var(--dyor-orange) !important;
  stroke: var(--dyor-orange) !important;
}
html body:not(#production-palette-1):not(#production-palette-2):not(#production-palette-3):not(#production-palette-4):not(#production-palette-5):not(#production-palette-6):not(#production-palette-7):not(#production-palette-8):not(#production-palette-9):not(#production-palette-10) .chart-series-benchmark {
  stroke: var(--dyor-paper) !important;
}

@media (max-width: 900px) {
  :is(#discover-view,#asset-view,#watchlist-view,#portfolio-view,#compare-view,#report-view,#share-view,#newsletter-view,#support-view) > :is(.page-heading,.asset-browser-panel,.support-blog-hero) { box-shadow: 6px 6px 0 var(--dyor-orange) !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
