/* Shared light-theme contrast, loaded after each product's legacy styles.
   Keep text and its surface together. Charts and presentation artwork have
   their own dark surfaces; they must not inherit the light text palette. */
html[data-logri-theme="light"] {
  --text: #302735 !important;
  --ink: #302735 !important;
  --muted: #574736 !important;
  --gold: #67420c !important;
  --orange: #67420c !important;
  --amber: #67420c !important;
  --purple: #653087 !important;
  --violet: #653087 !important;
  --violet2: #653087 !important;
  --green: #17583f !important;
  --red: #922339 !important;
  --blue: #1e5179 !important;
  --logri-on-accent: #fff3d6;
}
html[data-logri-theme="light"] :is(body[data-view],.account-live) { --muted: #574736 !important; }

/* Shared navigation and small text. */
html[data-logri-theme="light"] :is(.muted,.micro,.caption,.updated,.exchange-number) {
  color: var(--muted) !important;
}
html[data-logri-theme="light"] :is(.brand,.logo,.academy-nav) { color: var(--text) !important; }
html[data-logri-theme="light"] :is(.brand>span:not(.brand-pin),.logo>span,.store-brand .tg,.logri-academy-link span) {
  color: var(--gold) !important;
}
html[data-logri-theme="light"] :is(.lang,.store-languages a) { color: var(--muted) !important; }
html[data-logri-theme="light"] :is(.lang.active,.store-languages a.active) {
  color: var(--text) !important;
  background: var(--panel-soft) !important;
}
html[data-logri-theme="light"] :is(.logri-footer-nav a,.logri-program-links a,.account-public-info a,.breadcrumbs a,.academy-breadcrumbs a) {
  color: var(--purple) !important;
}
html[data-logri-theme="light"] :is(.breadcrumbs span,.academy-breadcrumbs,.academy-breadcrumbs span) { color: var(--muted) !important; }
html[data-logri-theme="light"] footer:not(.gn-footer) a:not(.button):not(.btn) { color: var(--purple) !important; }
html[data-logri-theme="light"] :is(.button.secondary,.button.outline,.btn.secondary,.button-soft) {
  background: var(--panel) !important;
  color: var(--purple) !important;
  border-color: var(--border) !important;
}
html[data-logri-theme="light"] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea) {
  color: var(--text) !important;
  background: var(--panel) !important;
  border-color: var(--border) !important;
  -webkit-text-fill-color: var(--text);
}
html[data-logri-theme="light"] :is(input,textarea)::placeholder {
  color: var(--muted) !important;
  opacity: 1;
}

/* The main site's older book, legal and product templates. */
html[data-logri-theme="light"][data-logri-site="main"] :is(.legalPage p,.legalPage li,.legalPage b,.discovery p,.discovery li,.discovery details p,.discovery .pending) {
  color: var(--text) !important;
}
html[data-logri-theme="light"][data-logri-site="main"] :is(.legalPage a,.discovery .label,.discovery .price,.priceLine b,.languageBanner,.bonusBox strong) {
  color: var(--purple) !important;
}
html[data-logri-theme="light"][data-logri-site="main"] :is(.legalPage .updated,.discovery .micro,.priceLine span,.bonusBox span,.discovery .price small) {
  color: var(--muted) !important;
}
html[data-logri-theme="light"][data-logri-site="main"] :is(.discovery .free,.discovery .featured,.freeCta,.darkBox,.futureBook,.bundleList article,.path3 a,.freeNext article,.freeNext .nextPrimary,.bonusBox,.statsCards article,.statsTable,.bullets2>div,main>.cards>article) {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-logri-theme="light"][data-logri-site="main"] :is(main>.cards>article h2,main>.cards>article p,.bullets2>div,.statsTable td) { color: var(--text) !important; }
html[data-logri-theme="light"][data-logri-site="main"] :is(.bullets2 b,.languageBanner b,.freeNext p) { color: var(--text) !important; }
html[data-logri-theme="light"][data-logri-site="main"] :is(main>.cards>article a,.nextBook,.freeNext .tag) { color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="main"] .actions>a:not(.button):not(.btn) { color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="main"] :is(.gamefi-card,.gamefi-facts>div,.gamefi-knowledge,.gamefi-chat) {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-logri-theme="light"][data-logri-site="main"] :is(.gamefi-intro,.gamefi-copy p,.gamefi-copy h3,.gamefi-identity h2 a,.gamefi-facts dd,.gamefi-knowledge h2,.gamefi-knowledge p,.gamefi-chat span) { color: var(--text) !important; }
html[data-logri-theme="light"][data-logri-site="main"] :is(.gamefi-muted,.gamefi-conditions,.gamefi-note,.gamefi-media figcaption,.gamefi-checked) { color: var(--muted) !important; }
html[data-logri-theme="light"][data-logri-site="main"] :is(.gamefi-badge,.gamefi-number,.gamefi-chat strong,.gamefi-knowledge a,.gamefi-facts dt,.gamefi-sources a) { color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="main"] .gamefi-identity .btn.big {
  background: var(--purple) !important;
  color: var(--logri-on-accent) !important;
}

/* Courses, lesson readers, exams and the beginner's calculator. */
html[data-logri-theme="light"][data-logri-site="academy"] :is(.contents,.panel,.practice,fieldset,.answer-label,#quiz-result,.result-card) {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-logri-theme="light"][data-logri-site="academy"] :is(.module-row h3,.reader article p,.reader article strong,.reader article li,.reader article blockquote,.practice p,details p,.intro,label,.book-art b) { color: var(--text) !important; }
html[data-logri-theme="light"][data-logri-site="academy"] :is(.meta,.reader-nav a,footer nav a,.course-card .meta span,.byline) { color: var(--muted) !important; }
html[data-logri-theme="light"][data-logri-site="academy"] :is(.book-art>span,.reader article a) { color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="academy"] main>a { color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="academy"] :is(.success,.correct,#quiz-result.success) { color: var(--green) !important; }
html[data-logri-theme="light"][data-logri-site="academy"] :is(.error,.incorrect,#calc-error,#quiz-result.error) { color: var(--red) !important; }

/* HOLD and Drops share a separate application with fixed dark surfaces. */
html[data-logri-theme="light"][data-logri-site="tools"] :is(.notice,.title-row button,.hold-market-input,.hold-plans,.hold-axis-grid>span,.hold-axis-grid>div,.hold-macro,.hold-coverage-summary,.hold-portfolio,.hold-table-head,.hold-row:hover,.hold-row.selected,.portfolio-risk-stats>div,.portfolio-stress>div,.portfolio-scenario-total,.portfolio-table thead,.portfolio-table tfoot,.hold-market-panel,.hold-help,.hold-inputs,.hold-prices,.hold-assumptions,.views button,.logo-frame,.filters button,.review-form) {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-logri-theme="light"][data-logri-site="tools"] :is(.hold-thesis,.hold-market-input label,.hold-inputs label,.hold-prices p,.hold-axis-grid,.hold-group,.hold-table-head,.portfolio-table,.portfolio-scenario-total) { color: var(--text) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] :is(.hold-inputs small,.hold-axis-grid>span,.hold-prices p,.hold-table-head,.hold-list small,.portfolio-risk-stats small,.portfolio-stress small) { color: var(--muted) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] :is(.hold-group.large,.hold-group.asymmetric,.hold-filters button.selected,.filters button.active,.filters button[aria-pressed=true]) { color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] :is(.hold-group.mid) { color: var(--blue) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] :is(.hold-group.small,.unconfirmed,.checked.stale,.new) { color: var(--amber) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] :is(.hold-group.growth,.hold-status,.hold-change.up,.confirmed,.checked.fresh) { color: var(--green) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] :is(.hold-change.down,.hold-risk,.failed) { color: var(--red) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] .hold-status { background: var(--panel-soft) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] :is(.breakdown,.breakdown>span,.hold-detail-heading button,.portfolio-picker-actions button) { background: var(--panel) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] .portfolio-modes button { background: var(--panel) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] .portfolio-modes button[aria-pressed="true"] { background: var(--purple) !important; color: var(--logri-on-accent) !important; border-color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] .hold-status.caution { color: var(--amber) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] .hold-coverage-summary b { color: var(--text) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] .hold-coverage-summary :is(span,small) { color: var(--muted) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] .hold-coverage-summary summary { color: var(--gold) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] .portfolio-options label:has(input:checked) { background: var(--panel-soft) !important; color: var(--text) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] :is(.portfolio-options small,.portfolio-risk-stats span,.portfolio-stress span,.portfolio-table th small,.portfolio-scenario-total small) { color: var(--muted) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] .hold-cta:not(:disabled) { color: var(--logri-on-accent) !important; }
html[data-logri-theme="light"][data-logri-site="tools"] .hold-cta:disabled { background: var(--panel-soft) !important; color: var(--muted) !important; opacity: 1; }
html[data-logri-theme="light"][data-logri-site="tools"] :is(.detail-link,.card-links a,.hold-owner a,.hold-help summary,.hold-market-panel summary) { color: var(--purple) !important; }

/* Radar controls, reports, semantic statuses and public instructions. */
html[data-logri-theme="light"][data-logri-site="radar"] :is(.radar-list,.chart-panel,.reversal-pick,.summary-scan-state,.summary-workspace,.summary-market-list,.summary-list-title,.summary-market-list>button.active,.summary-market-list>button:hover,.probability-ring>span,.factor-card,.horizon-toolbar,.horizon-toolbar button,.probability-drivers article,.accuracy-control,.accuracy-headline article,.accuracy-grids>article,.accuracy-segments>div,.news-card,.news-card>aside,.news-card>aside>div:not(.news-scores),.radar-guide,.radar-guide li,.coin-list-grid span,.custom-watchlist-editor,.telegram-note,.partner-consent-callout,.partner-link-card,.partner-link-card button,.partner-legal-scroll,.partner-tier-list article,.promo-new button,.promo-code,.promo-list>article,.admin-console-heading>button,.admin-search button,.admin-actions button,.admin-row-actions button,.admin-table-wrap td>button:not(.admin-link),.admin-tabs button) {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-logri-theme="light"][data-logri-site="radar"] .reversal-pick.empty { opacity: 1; }
html[data-logri-theme="light"][data-logri-site="radar"] .signal { background: var(--panel-soft) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] .signal:is(.signal-watch,.signal-approach) { color: var(--amber) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] .signal:is(.signal-breakout,.signal-working,.signal-reversal) { color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] .signal.signal-retest { color: var(--green) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] .signal:is(.signal-blocked,.signal-invalid) { color: var(--red) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.trade-plan-card.short .trade-plan-heading strong,.trade-plan-card.short .trade-plan-heading>b,.market-level.blocked strong,.error-banner,.telegram-error,.danger-button,.access-return-status.error) { color: var(--red) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.telegram-success,.partner-read.done,.partner-tier-list em) { color: var(--green) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.elliott-level strong,.partner-tier-head>b,.partner-tier-list span,.partner-read,.signal-api-panel a,.autotrade-observation summary,.autotrade-test-run summary,.news-scores b) { color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.metrics small,.scan-footnote,.trade-plan-title>small,.trade-plan-levels small,.take-profit-list small,.modal-counter,.history-audit-note,.intelligence-summary small,.intelligence-toolbar>span,.flow-sort-group>b,.factor-card header span,.factor-card dt,.factor-card dd,.summary-method,.horizon-toolbar>b,.horizon-toolbar span,.probability-drivers article>span,.accuracy-headline small,.accuracy-segments small,.news-method,.news-method>small,.news-card-main>p,.news-card-main footer span,.news-card>aside small,.access-row .no,.access-demo-active,.access-payment-heading p,.access-payment-options small,.radar-guide li small,.partner-private-terms,.autotrade-test-run li span) { color: var(--muted) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.news-card-main h2,.radar-guide li strong,.partner-legal-scroll p,.access-payment-heading h3) { color: var(--text) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] .scan-button:disabled { background: var(--panel-soft) !important; color: var(--muted) !important; opacity: 1; }
html[data-logri-theme="light"][data-logri-site="radar"] .auth-promo button:disabled { background: var(--panel-soft) !important; color: var(--muted) !important; opacity: 1; }
html[data-logri-theme="light"][data-logri-site="radar"] .poc-panel :is(.poc-note,.poc-toolbar span,.poc-metrics span,.poc-section-title span,.poc-columns h2 small,.poc-card h3 small,.poc-card header span,.poc-card dt,.poc-card footer,.poc-empty,.poc-watch-grid small,.poc-history small,.poc-coin span,.poc-coin small,.poc-example p) { opacity: 1; }
html[data-logri-theme="light"] .logri-tour-controls button:disabled { opacity: .7; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.research-initial-loading-card,.pattern-message,.history-empty,.efficiency-table-wrap,.history-table-wrap,.risk-sizer-results>div,.mover-forecast-summary article,.mover-work-summary article,.decision-card,.history-calibration,.history-calibration-grid>div,.summary-risk-results>div,.overview-agreement,.event-card,.event-metrics section,.auth-access-details,.access-crypto-picker,.access-order-state,.access-row.head,.guide-help-bar,main>.cards>.card,.notice,.legend li,.steps li,.example,.toc,.quick-start,.zone-card) {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-logri-theme="light"][data-logri-site="radar"] :is(.access-row>span,.access-legal-document>p,.access-legal-document h3,.access-legal-document section p,.access-crypto-picker-head h4,.access-order-state.ready span,.pattern-row>b,.efficiency-table td,.history-table td,.risk-sizer-results strong,.mover-work-summary strong,.decision-card dd,.guide-help-bar>div,main>.cards>.card p,.notice) { color: var(--text) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.access-options small,.access-row>b small,.access-legal-meta,.access-order-state.ready small,.mover-work-summary span,.decision-card dt,.signal,.signal-late,.history-expired,.poc-expired .poc-stage,.poc-coin.poc-stale) { color: var(--muted) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.access-tier,.signal-breakout,.signal-reversal,.signal-working,.history-waiting,.model-badge.abcd,.decision-action.watch,.flow-status.watch,.poc-sweep .poc-stage,.poc-coin.poc-sweep) { color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.history-active,.poc-long,.poc-returned .poc-stage,.poc-coin.poc-impulse,.auth-verified,.auth-sent) { color: var(--green) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.signal-blocked,.model-badge.reversal,.flow-status.do_not_enter,.poc-short,.poc-invalidated .poc-stage,.poc-coin.poc-error,.auth-error) { color: var(--red) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.history-review,.model-badge.movers,.patterns-warning,.poc-status,.risk-warning,.guide-help-icon) { color: var(--amber) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.poc-accumulation .poc-stage,.poc-coin.poc-accumulation) { color: var(--blue) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] .up { color: var(--green) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] .down { color: var(--red) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.event-card header small,.event-metrics small,.event-metrics p,.overview-note,.events-method,.overview-table small) { color: var(--muted) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] .event-card>a { color: var(--purple) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.intelligence-summary,.intelligence-empty,.intelligence-toolbar button,.flow-metrics>div) { background: var(--panel) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.funding-metric small,.funding-metric em,.flow-card>footer>small,.auth-access-details>span) { color: var(--muted) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] :is(.main-tabs button.active,.main-tabs .access-tab.active) { color: var(--logri-on-accent) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] main>.cards>article { background: var(--panel) !important; color: var(--text) !important; border-color: var(--border) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] main>.cards>article :is(h2,p) { color: var(--text) !important; }
html[data-logri-theme="light"][data-logri-site="radar"] main>.cards>article a { color: var(--purple) !important; }
html[data-logri-theme="light"] .logri-gf-tour-controls button:disabled { opacity: .7; }
html[data-logri-theme="light"] body[data-logri-page="guide"] :is(main>article,main>ol>li,.step,.models>div,.return-route) {
  background: var(--panel) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-logri-theme="light"] body[data-logri-page="guide"] :is(header,main) a:not(.button):not(.btn) { color: var(--purple) !important; }
html[data-logri-theme="light"] body[data-logri-page="guide"] :is(article h2,article h3,article p,.models>div h3,.models>div p) { color: var(--text) !important; }

/* The account keeps its pin artwork and dark welcome/document covers. */
html[data-logri-theme="light"] .account-live :is(.badge-card,.gallery-badge,.activity-option.passed,.career-table .current-row,.workspace-nav a.active,.workspace-nav a:hover,.account-orbit-intro,.pill.neutral,.pill.pending) {
  background: var(--panel-soft) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
html[data-logri-theme="light"] .account-live :is(.workspace-nav a,.account-nav a,.account-orbit-intro p,.account-orbit-intro h2,.account-product-actions a,.profile-head,.career-table) { color: var(--text) !important; }
html[data-logri-theme="light"] .account-live :is(.hero .rank-code,.hero .eyebrow,.workspace-eyebrow,.approved-pins .eyebrow,.workspace-symbol.ambassador) { color: var(--gold) !important; }
html[data-logri-theme="light"] .account-live .hero .button.secondary { color: var(--purple) !important; background: var(--panel) !important; border-color: var(--border) !important; }
html[data-logri-theme="light"] .account-live .document-cover:not(.gold) { color: #fff3f8 !important; }
html[data-logri-theme="light"] .account-live .document-cover:not(.gold) :is(p,small,.wordmark) { color: #fff3f8 !important; }
html[data-logri-theme="light"] .account-live :is(.pill.success,.activity-option.passed .pill) { color: var(--green) !important; }
html[data-logri-theme="light"] .account-live :is(.pill.pending,.workspace-symbol.orbit) { color: var(--purple) !important; }
html[data-logri-theme="light"] .account-live .hero p { opacity: 1; }

/* Preserve chart contrast, candle colors and TP/SL semantics on dark canvases.
   Captions stay in the page's normal light-theme text palette. */
html[data-logri-theme="light"] :is(.chart,.history-chart,.research-chart svg,.poc-card svg,.poc-example svg,svg[data-chart-style="abcd"]) {
  background: #0b101b !important;
  --bg: #0b101b !important;
  --panel: #141e2e !important;
  --text: #f2eaf6 !important;
  --muted: #b8bfd0 !important;
  --gold: #e5bd69 !important;
  --green: #8fd3b1 !important;
  --red: #ee9eac !important;
}
