/* Theme choice is orthogonal to signal data and publication state. */

html[data-theme="dark"] {color-scheme:dark}
body .theme-toggle {display:inline-flex;align-items:center;justify-content:center;flex:none;white-space:nowrap;min-height:36px;min-width:72px;padding:7px 9px;border:1px solid var(--line-strong,#505257);border-radius:5px;background:var(--surface-2,#1d1e21);color:var(--text,#f2f3f4);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}
body .theme-toggle:focus-visible {outline:2px solid var(--amber,#e2bd63);outline-offset:3px}
.auth-required-page>.theme-toggle {position:absolute;top:18px;right:18px}
html[data-theme="light"],
html[data-theme="light"] body[data-design="desk"][data-ui-version],
html[data-theme="light"] body.public-desk {
 color-scheme:light;
 --bg:#f4f5f7;--bg-raised:#fff;--surface:#fff;--surface-2:#f1f3f6;--surface-3:#e9edf2;--surface-4:#e1e6ed;
 --panel:#fff;--line:#d5dae2;--line-strong:#a6afbd;--text:#172130;--muted:#4d596a;--dim:#596677;
 --amber:#80600c;--gold:#80600c;--amber-soft:#fff4d6;--green:#147445;--red:#b52e45;--cyan:#80600c;--violet:#75582b;
 --neg-2:#b52e45;--neg-1:#a42a40;--mid:#647084;--pos-1:#167144;--pos-2:#147445;
 --heat-1:#fff8e6;--heat-2:#f7e6b5;--heat-3:#e8c873;--heat-4:#ac821f;--heat-5:#80600c;
 --shadow:0 10px 32px #17213014;
 background:var(--bg);color:var(--text);
}
html[data-theme="light"] body :is(.apex-wordmark,.auth-wordmark,.public-brand img) {filter:brightness(0)}
html[data-theme="light"] body[data-design="desk"][data-ui-version] :is(.sidebar,.topbar,.mobile-nav) {background:#fff;border-color:var(--line)}
html[data-theme="light"] body[data-design="desk"] :is(.brand-product,.mobile-brand,.location-bar strong) {color:var(--text)}
html[data-theme="light"] body[data-design="desk"][data-ui-version] :is(.command-trigger,input,select,textarea,.news-filters input,.news-filters select) {color:var(--text);background:#fff;border-color:var(--line-strong);color-scheme:light}
html[data-theme="light"] body[data-design="desk"] :is(.nav-item.active,.mobile-nav-item.active,.journey-nav button.active,.desk-market-filters .filter-button.active,.pm-feature.selected) {background:var(--amber-soft);color:#725407;border-color:#b79b50}
html[data-theme="light"] body[data-design="desk"] :is(.button.primary,.history-button.primary,.btn.primary) {background:#e2bd63;border-color:#c49a3e;color:#251d0a}
html[data-theme="light"] body[data-design="desk"] :is(.button,.filter-button,.icon-button,.profile-button,.density-toggle,.ai-fab,.journey-nav button,.mobile-more-link,.journey-market-options label) {background:var(--surface-2);color:var(--text);border-color:var(--line-strong)}
html[data-theme="light"] body[data-design="desk"] .button.primary {background:#e2bd63;color:#251d0a;border-color:#c49a3e}
html[data-theme="light"] body[data-design="desk"] :is(.desk-market-filters .filter-button.active,.journey-nav button.active) {background:var(--amber-soft);color:#725407;border-color:#b79b50}
html[data-theme="light"] body[data-design="desk"] :is(.member-direction.buy,.member-status.positive,.button.is-following) {background:#e3f4e9;color:#116038;border-color:#76ad8b}
html[data-theme="light"] body[data-design="desk"] .member-direction.sell {background:#fce8ed;color:#a4263e;border-color:#d98d9b}
html[data-theme="light"] body[data-design="desk"] .member-status.watch {background:#fff2cf;color:#755300;border-color:#baa05b}
html[data-theme="light"] body[data-design="desk"] .member-status.neutral {background:#edf0f4;color:#475467;border-color:#a7b0bf}
html[data-theme="light"] body[data-design="desk"] :is(.data-table th,.desk-signal-table thead th,.news-source-grid>div,.pm-hero-art,.research-meter,.following-card,.journey-empty) {background:var(--surface-2);border-color:var(--line);color:var(--text)}
html[data-theme="light"] body[data-design="desk"] :is(.data-table tbody tr:hover,.desk-signal-row:hover,.news-card:hover) {background:#edf1f6}
html[data-theme="light"] body[data-design="desk"] .desk-signal-row.is-selected {background:#fff5da}
html[data-theme="light"] body[data-design="desk"] .desk-signal-row.is-selected:hover {background:#f9edca}
html[data-theme="light"] body[data-design="desk"] :is(.desk-feed-status,.desk-version-note,.journey-message,.journey-updates li.is-unread) {background:#fff5dc;color:#67501b;border-color:#c7b17a}
html[data-theme="light"] body[data-design="desk"] .desk-feed-status.has-ready {background:#e3f4e9;color:#116038;border-color:#76ad8b}
html[data-theme="light"] body[data-design="desk"] :is(.desk-checks>div,.desk-detail .member-signal-levels>div) {border-color:var(--line)}
html[data-theme="light"] body[data-design="desk"] .desk-checks .watch {color:#755300}
html[data-theme="light"] body[data-design="desk"] :is(.research-meter-marker,.desk-score-track i) {background:#fff;border-color:#172130}
html[data-theme="light"] body[data-design="desk"] :is(.detail-drawer,.notification-drawer,.ai-drawer,.mobile-sheet-panel,.palette-panel,.workspace-tools-panel,.profile-menu,dialog) {background:#fff;color:var(--text);border-color:var(--line-strong)}
html[data-theme="light"] body :is(button,a,input,select,textarea,summary):focus-visible {outline-color:#80600c}
html[data-theme="light"] body[data-design="desk"] #signal-history {background:#fff;color:var(--text);border-color:var(--line)}
html[data-theme="light"] body[data-design="desk"] #signal-history :is(.history-head,.history-summary,th) {background:#f1f3f6;color:var(--muted);border-color:var(--line)}
html[data-theme="light"] body[data-design="desk"] #signal-history :is(h2,strong,.history-symbol) {color:var(--text)}
html[data-theme="light"] body[data-design="desk"] #signal-history :is(p,label,.history-count,.history-meta,.history-eyebrow,small,.history-sub) {color:var(--muted)}
html[data-theme="light"] body[data-design="desk"] #signal-history :is(input,select,.history-button) {background:#fff;color:var(--text);border-color:var(--line-strong);color-scheme:light}
html[data-theme="light"] body[data-design="desk"] #signal-history .history-button.primary {background:#e2bd63;color:#251d0a}
html[data-theme="light"] body[data-design="desk"] #signal-history tbody tr:hover {background:#f5f7fa}
html[data-theme="light"] body[data-design="desk"] #signal-history :is(td,.history-toolbar,.history-meta,.history-footer,details) {border-color:var(--line)}
html[data-theme="light"] body[data-design="desk"] #signal-history .history-badge {background:#edf0f4;color:#475467;border-color:#a7b0bf}
html[data-theme="light"] body[data-design="desk"] #signal-history .history-badge.positive {background:#e3f4e9;color:#116038;border-color:#76ad8b}
html[data-theme="light"] body[data-design="desk"] #signal-history .history-badge.negative {background:#fce8ed;color:#a4263e;border-color:#d98d9b}
html[data-theme="light"] body[data-design="desk"] #signal-history .history-badge.watch {background:#fff2cf;color:#755300;border-color:#baa05b}
html[data-theme="light"] body.public-desk :is(.bar,.hero,.card) {background:#fff;color:var(--text);border-color:var(--line)}
html[data-theme="light"] body.public-desk .card.hot {background:#fff9e9;border-color:#c7b17a}
html[data-theme="light"] body.public-desk :is(.bar a,.price) {color:var(--text)}
html[data-theme="light"] body.public-desk :is(.muted,.dim,footer.wrap) {color:var(--muted)}
html[data-theme="light"] body.public-desk :is(input,select,textarea,.btn,button) {background:#fff;color:var(--text);border-color:var(--line-strong)}
html[data-theme="light"] body.public-desk .btn.primary {background:#e2bd63;color:#251d0a}
@media(max-width:800px){
 body[data-design="desk"][data-ui-version] .topbar {gap:7px;padding-left:12px;padding-right:12px}
 body[data-design="desk"] .topbar-status {gap:5px}
 body[data-design="desk"] .topbar .theme-toggle {min-width:62px;padding:7px 5px;font-size:11px}
}
@media(max-width:380px){
 body[data-design="desk"] .apex-wordmark.mobile {width:76px}
 body[data-design="desk"] .topbar-status {gap:3px}
}

/* Legacy component colours need explicit light equivalents as well as tokens. */
html[data-theme="light"] body[data-design="desk"][data-ui-version] .nav-item.active {background:var(--amber-soft);color:#725407;border-color:#b79b50}
html[data-theme="light"] body[data-design="desk"] :is(.research-meter-label,.member-next-step strong,.journey-panel h3,.simple-help-grid summary,.plain-glossary dt) {color:var(--text)}
html[data-theme="light"] body[data-design="desk"] .research-meter.is-high .research-meter-label {color:var(--green)}
html[data-theme="light"] body[data-design="desk"] .research-meter.is-mid .research-meter-label {color:var(--amber)}
html[data-theme="light"] body[data-design="desk"] .research-meter.is-low .research-meter-label {color:var(--red)}
html[data-theme="light"] body[data-design="desk"] :is(.member-next-step p,.member-save-unavailable,.simple-next p,.simple-diagnostics,.simple-help-grid p,.plain-glossary dd,.simple-signal-levels dt,.journey-updates time,.journey-minimum) {color:var(--muted)}
html[data-theme="light"] body[data-design="desk"] :is(.following-outcome,.journey-updates a,.journey-message button,[data-telegram-check],#journeyPreferences legend,.member-card-actions a) {color:var(--amber)}
html[data-theme="light"] body[data-design="desk"] #signal-history :is(.history-intro,.history-disclosure) {background:var(--surface-2);color:var(--muted);border-color:var(--line)}
html[data-theme="light"] body[data-design="desk"] #signal-history :is(.history-kind,.history-footer,.history-empty,summary,code) {color:var(--muted)}
html[data-theme="light"] body[data-design="desk"] #signal-history .history-stop {color:var(--red)}
html[data-theme="light"] body[data-design="desk"] #signal-history .history-target {color:var(--green)}
html[data-theme="light"] body[data-design="desk"] :is(.market-news,.premium-workspace) {color:var(--text)}
html[data-theme="light"] body[data-design="desk"] :is(.news-kicker,.news-card-top,.news-card footer span,.news-sources summary,.market-news dialog h3) {color:var(--amber)}
html[data-theme="light"] body[data-design="desk"] :is(.news-section-title>span,.news-toolbar p,.news-meta,.news-card time,.news-card p,.news-card footer,.news-filters label,.news-empty,.news-sources,.news-values dt,.news-muted) {color:var(--muted)}
html[data-theme="light"] body[data-design="desk"] :is(.news-next strong,.news-close,.news-values dd) {color:var(--text)}
html[data-theme="light"] body[data-design="desk"] :is(.news-tags span,.news-values div) {background:var(--surface-2);color:var(--text);border-color:var(--line)}
@media(max-width:600px) {
 html[data-theme="light"] body[data-design="desk"] #signal-history tr {background:#fff;border-color:var(--line)}
 html[data-theme="light"] body[data-design="desk"] #signal-history td.history-price {background:var(--surface-2)}
 html[data-theme="light"] body[data-design="desk"] #signal-history td::before {color:var(--muted)}
}
html[data-theme="light"] body[data-design="desk"] :is(.member-start,.member-steps a,.pm-preview,.pm-tool) {background:var(--surface);color:var(--text);border-color:var(--line)}
html[data-theme="light"] body[data-design="desk"] :is(.member-start p,.member-steps span) {color:var(--muted)}
html[data-theme="light"] body[data-design="desk"] #signal-history .history-table-wrap {scrollbar-color:#a6afbd #f1f3f6}
@media(max-width:760px){
 body[data-design="desk"][data-ui-version] .mobile-brand .apex-wordmark {width:94px;max-width:94px}
}
@media(max-width:360px){
 body[data-design="desk"][data-ui-version] .mobile-brand .apex-wordmark {width:70px;max-width:70px}
 body[data-design="desk"][data-ui-version] .topbar {gap:4px;padding-left:8px;padding-right:8px}
}
html[data-theme="light"] body[data-design="desk"] :is(.pm-billing,.pm-table th,.pm-tabs button,.pm-demo-steps span,.pm-demo-split>span,.pm-demo-matrix b) {background:var(--surface-2);color:var(--text);border-color:var(--line)}
html[data-theme="light"] body[data-design="desk"] :is(.pm-tabs button[aria-current="page"],.pm-badge,.pm-message,#pm-sizing,.pm-high) {background:var(--amber-soft);color:var(--amber);border-color:#c7b17a}
html[data-theme="light"] body[data-design="desk"] .pm-message.pm-error {background:#fce8ed;color:var(--red);border-color:#d98d9b}
html[data-theme="light"] body[data-design="desk"] :is(.premium-workspace label,.pm-preview-art>small,.pm-tabs span) {color:var(--muted)}
