/* LF-SITE-001B — Text Visibility Safety Layer
   Loaded last. Component-scoped only: never recolor generic .section/.panel wrappers. */
:root{
  --ep-tv-dark:#071f1b;
  --ep-tv-ink:#102a23;
  --ep-tv-body:#263c34;
  --ep-tv-ivory:#fff8ea;
  --ep-tv-soft:#dce9e2;
  --ep-tv-gold:#e6c879;
  --ep-tv-green:#63e7ab;
  --ep-tv-red:#ff8278;
}

/* Universal chrome / dark nav surfaces */
.top-stack,.site-header,.subnav,.mi-subnav,.mi-page-root .mi-universal-hero{color:var(--ep-tv-ivory)}
.top-stack :is(a,span,strong,small),.site-header :is(a,span,strong,small),.subnav :is(a,span,strong,small){opacity:1}

/* AI Market Explainer — filters, feed and controls */
body[data-page="market-explainer"] .filters button:not(.active){color:#f4f1e8!important}
body[data-page="market-explainer"] .filters button:not(.active) b{color:#fff8e7!important;background:#1b4a3b!important}
body[data-page="market-explainer"] .filters button.active{color:#14271f!important}
body[data-page="market-explainer"] .filters button.active b{color:#fff8e7!important;background:#214a3b!important}
body[data-page="market-explainer"] .period button.active{color:#14271f!important}
body[data-page="market-explainer"] .feed.panel,
body[data-page="market-explainer"] .rail .panel:not(.impact):not(.source){color:#f8f4e9!important}
body[data-page="market-explainer"] .feed.panel :is(h1,h2,h3,strong),
body[data-page="market-explainer"] .rail .panel:not(.impact):not(.source) :is(h1,h2,h3,strong){color:#fff8e8!important}
body[data-page="market-explainer"] .feed.panel :is(p,small,.publisher,#published),
body[data-page="market-explainer"] .rail .panel:not(.impact):not(.source) :is(p,small){color:#dce9e2!important;opacity:1!important}
body[data-page="market-explainer"] .mode.panel{color:#172d26!important}
body[data-page="market-explainer"] .mode.panel .section-heading span{color:#3d554c!important;opacity:1!important}
body[data-page="market-explainer"] .mode-buttons button:not(.active){color:#173129!important;background:#f8ecd0!important}
body[data-page="market-explainer"] .mode-buttons button:not(.active) small{color:#4b5f57!important;opacity:1!important}
body[data-page="market-explainer"] .mode-buttons button.active{color:#fff8e8!important}
body[data-page="market-explainer"] .mode-buttons button.active small{color:#e1ece6!important;opacity:1!important}
body[data-page="market-explainer"] .explain{color:#172d26!important}
body[data-page="market-explainer"] .explain>p{color:#243b33!important;opacity:1!important}
body[data-page="market-explainer"] .explain-cards section{color:#fff8e8!important}
body[data-page="market-explainer"] .explain-cards section p{color:#edf5f0!important;opacity:1!important}

/* Market Dashboard — dark market strip must never inherit light-panel ink */
body[data-page="personal-dashboard"] .market-strip,
body[data-page="personal-dashboard"] .market-tiles,
body[data-page="personal-dashboard"] .market-tile{color:#fff8ea!important}
body[data-page="personal-dashboard"] .market-tile small{color:#e7ca79!important;opacity:1!important}
body[data-page="personal-dashboard"] .market-tile strong{color:#fff8ea!important;opacity:1!important}
body[data-page="personal-dashboard"] .market-tile em{color:#63e7ab!important;opacity:1!important}
body[data-page="personal-dashboard"] .market-tile em.down{color:#ff8278!important}
body[data-page="personal-dashboard"] .weather-tile{color:#fff8ea!important}
body[data-page="personal-dashboard"] .weather-tile small{color:#ead18f!important;opacity:1!important}
body[data-page="personal-dashboard"] .weather-tile strong{color:#fff8ea!important;opacity:1!important}
body[data-page="personal-dashboard"] .weather-tile em{color:#d1dfd9!important;opacity:1!important}
body[data-page="personal-dashboard"] .dark-card :is(p,small,.muted,.subtle),
body[data-page="personal-dashboard"] .watchlist-panel :is(p,small,.muted,.subtle),
body[data-page="personal-dashboard"] .movers-card :is(p,small,.muted,.subtle){color:#d7e4dd!important;opacity:1!important}
body[data-page="personal-dashboard"] .light-card{color:#14231f!important}
body[data-page="personal-dashboard"] .light-card :is(h1,h2,h3,h4,strong,b){color:#14231f!important}
body[data-page="personal-dashboard"] .light-card :is(p,small,.muted,.subtle){color:#42554d!important;opacity:1!important}

/* Strategy Lab — explicit surface ownership */
body[data-page="strategy-lab"] .sl-app .scenario-panel,
body[data-page="strategy-lab"] .sl-app .controls-panel{color:#fff8ea!important}
body[data-page="strategy-lab"] .sl-app .scenario-panel :is(h1,h2,h3,strong,label),
body[data-page="strategy-lab"] .sl-app .controls-panel :is(h1,h2,h3,strong,label){color:#fff8ea!important}
body[data-page="strategy-lab"] .sl-app .scenario-panel :is(p,small,span),
body[data-page="strategy-lab"] .sl-app .controls-panel :is(p,small,span){opacity:1}
body[data-page="strategy-lab"] .sl-app .results-panel,
body[data-page="strategy-lab"] .sl-app .outcome-panel,
body[data-page="strategy-lab"] .sl-app .portfolio-response,
body[data-page="strategy-lab"] .sl-app .result-card{color:#102a23!important}
body[data-page="strategy-lab"] .sl-app :is(.results-panel,.outcome-panel,.portfolio-response,.result-card) :is(h1,h2,h3,h4,strong,b,label,span,small,p){opacity:1}

/* Radar — dark rail/story text */
body[data-page="radar"] :is(.news-rail,.radar-main,.radar-stage,.radar-news,.news-card,.story-card){color:#f8f4e9}
body[data-page="radar"] :is(.news-rail,.radar-main,.radar-stage,.radar-news,.news-card,.story-card) :is(h1,h2,h3,strong){color:#fff8e8!important}
body[data-page="radar"] :is(.news-rail,.radar-main,.radar-stage,.radar-news,.news-card,.story-card) :is(p,small,.muted){color:#d7e5de!important;opacity:1!important}

/* Editorial light surfaces — only classes that are explicitly light */
body :is(.light-card,.paper-card,.cream-card,.form-shell,.legal-box,.quiet-panel){color:#102a23!important}
body :is(.light-card,.paper-card,.cream-card,.form-shell,.legal-box,.quiet-panel) :is(h1,h2,h3,h4,strong,b){color:#102a23!important}
body :is(.light-card,.paper-card,.cream-card,.form-shell,.legal-box,.quiet-panel) :is(p,li,small,.muted){color:#334b42!important;opacity:1!important}

/* Accessibility safeguard: do not hide normal text via inherited opacity. */
body :is(p,li,small,label,button,a,strong,b,h1,h2,h3,h4){text-shadow:none}

/* Market Explainer selected-story feature panel — explicit light-surface ownership.
   The feature card is intentionally ivory in the current visual system, so its
   typography must never inherit dark-surface/light-text rules. */
body[data-page="market-explainer"] .feature.panel{
  color:#102a23!important;
}
body[data-page="market-explainer"] .feature.panel .feature-text :is(h1,h2,h3,strong,b){
  color:#102a23!important;
  opacity:1!important;
}
body[data-page="market-explainer"] .feature.panel .feature-text :is(p,small,#published){
  color:#334b42!important;
  opacity:1!important;
}
body[data-page="market-explainer"] .feature.panel .metadata{
  color:#42584f!important;
  opacity:1!important;
}
body[data-page="market-explainer"] .feature.panel .category-badge{
  color:#8a5c13!important;
  border-color:#d8bd79!important;
  background:#fff5da!important;
}
body[data-page="market-explainer"] .feature.panel .publisher{
  color:#715523!important;
  border-color:#dec98f!important;
  background:#efe4c3!important;
}
body[data-page="market-explainer"] .feature.panel .primary{
  color:#15241d!important;
  opacity:1!important;
}

/* Market Dashboard snapshot strip — explicit descendant protection. */
body[data-page="personal-dashboard"] .market-strip .market-tile small{
  color:#e7ca79!important;opacity:1!important;visibility:visible!important;
}
body[data-page="personal-dashboard"] .market-strip .market-tile strong{
  color:#fff8ea!important;opacity:1!important;visibility:visible!important;
}
body[data-page="personal-dashboard"] .market-strip .market-tile em{
  color:#63e7ab!important;opacity:1!important;visibility:visible!important;
}
body[data-page="personal-dashboard"] .market-strip .market-tile em.down{color:#ff8278!important}
body[data-page="personal-dashboard"] .market-strip .weather-tile :is(small,strong,em){opacity:1!important;visibility:visible!important}
