/* Shared appearance tokens. Keep data series and profit/loss semantics intact. */
:root{--tx-bg:#08121f;--tx-surface:#101f2f;--tx-raised:#172b3d;--tx-border:#344c60;--tx-text:#edf3fa;--tx-muted:#a6bbcd;--tx-accent:#71dce4;--tx-selected:#173d4d;--tx-good:#6ee7b7;--tx-bad:#ff9aa8;--tx-warn:#f4d089;--tx-shadow:0 6px 24px #0002}
html[data-theme=light]{--tx-bg:#edf2f7;--tx-surface:#fff;--tx-raised:#f3f7fb;--tx-border:#c6d3df;--tx-text:#182b3d;--tx-muted:#526779;--tx-accent:#086879;--tx-selected:#e0f2f5;--tx-good:#08734f;--tx-bad:#aa2945;--tx-warn:#875300;--tx-shadow:0 6px 24px #20394e0d}
html[data-theme] body{--as-shell:var(--tx-bg);--as-surface:var(--tx-surface);--as-border:var(--tx-border);--as-text:var(--tx-text);--as-muted:var(--tx-muted);background:var(--tx-bg)!important;color:var(--tx-text)!important;font-family:Inter,ui-sans-serif,system-ui,sans-serif}
html[data-theme] .as-product-nav,html[data-theme] .vi-daily-workspace>header{background:var(--tx-surface)!important;border-color:var(--tx-border)!important;color:var(--tx-text)}
html[data-theme] .as-product-nav__link{color:var(--tx-muted)!important}
html[data-theme] .as-product-nav__link--active{background:var(--tx-selected)!important;color:var(--tx-accent)!important;border-color:var(--tx-border)!important}
html[data-theme] :is(.vi-product-brand,.vi-daily-brand,.tx-brand) strong{color:var(--tx-text)!important}
html[data-theme] :is(.vi-product-brand,.vi-daily-brand,.tx-brand) :is(small,em){color:var(--tx-accent)!important}
html[data-theme=light] :is(.vi-product-brand,.vi-daily-brand,.tx-brand) img{background:#102b3b;border-radius:6px;padding:4px;box-sizing:content-box}
html[data-theme] .tx-theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;min-height:32px;padding:6px 11px;border:1px solid var(--tx-border)!important;border-radius:7px;background:var(--tx-raised)!important;color:var(--tx-text)!important;font:600 12px/1.3 ui-sans-serif,system-ui;cursor:pointer;white-space:nowrap}
html[data-theme] :is(button,a,select,input,summary):focus-visible{outline:2px solid var(--tx-accent)!important;outline-offset:3px}
html[data-theme] :is(.tx-dashboard-overview,.vi-daily-workspace #sessions,.vi-daily-workspace #history,.vi-daily-workspace #sessionCards article.tx-market-card,.tx-data-panel,.tx-lab-grid>aside,.tx-lab-main>section,.tx-replay-setup){background:var(--tx-surface)!important;color:var(--tx-text)!important;border-color:var(--tx-border)!important;box-shadow:var(--tx-shadow)}
html[data-theme] :is(.tx-lab,.tx-market-prices strong,.tx-symbol-identity h3){color:var(--tx-text)!important}
html[data-theme] :is(.tx-dashboard-intro p,.tx-dashboard-metrics dt,.tx-market-quote-top,.tx-market-quote-foot,.tx-market-prices small,.tx-symbol-identity div>span,.tx-market-card-footer,.tx-room-button small,.tx-lab p,.tx-lab label,.tx-lab small,.tx-data-table th,.tx-replay-setup p,.tx-replay-fields small,.tx-choice legend,.tx-replay-fields>label){color:var(--tx-muted)!important}
html[data-theme] :is(.tx-market-card [data-quote-source],.tx-dashboard-kicker,.tx-lab-kicker,.tx-lab a,.tx-market-quote-foot a,.tx-lab details,.tx-lab-heading>span){color:var(--tx-accent)!important}
html[data-theme] :is(.tx-dashboard-metrics,.tx-dashboard-metrics>div,.tx-market-quote-foot,.tx-market-room-actions,.tx-data-table td,.tx-data-table th,.tx-lab-editor){border-color:var(--tx-border)!important}
html[data-theme] :is(.tx-market-card-menu>div,.tx-market-room,.tx-lab pre,#labStrategyRules>div,.tx-radio-row label,.tx-replay-setup button,.tx-lab button,.tx-dashboard-actions :is(button,a,select)){background:var(--tx-raised);color:var(--tx-text);border-color:var(--tx-border)}
html[data-theme] :is(.tx-room-button,.tx-market-card-menu :is(a,button),.tx-room-button>span:last-child,.tx-market-room-actions button,.tx-market-card .tx-market-prices [data-quote-spot],.tx-market-card .tx-market-prices [data-quote-future],.tx-market-card .tx-market-prices [data-quote-basis]){color:var(--tx-text)!important}
html[data-theme] .tx-symbol-monogram{background:var(--tx-selected);border-color:var(--tx-border);color:var(--tx-accent)}
html[data-theme] :is(.tx-replay-setup,.tx-lab,.vi-daily-workspace) :is(select,input:not([type=radio]):not([type=checkbox])){background:var(--tx-raised)!important;color:var(--tx-text)!important;border-color:var(--tx-border)!important}
html[data-theme] :is(.tx-radio-row label:has(input:checked),.tx-setup-steps [aria-current=step],.tx-lab button[aria-pressed=true],.tx-replay-setup [data-summary]){background:var(--tx-selected)!important;color:var(--tx-accent)!important;border-color:var(--tx-accent)!important}
html[data-theme] :is(.tx-dashboard-actions #btnDeskLive,.tx-lab-launch #labStart,.tx-replay-setup button[type=submit]){background:#0a705d!important;color:#fff!important;border-color:#0a705d!important}
html[data-theme] .tx-dashboard-actions #btnDeskBacktest{background:var(--tx-selected);color:var(--tx-accent);border-color:var(--tx-accent)}
html[data-theme] .tx-desk-notice{background:var(--tx-raised);color:var(--tx-warn)}
html[data-theme] :is(.tx-market-room.running small,.tx-market-room.running .tx-room-button){color:var(--tx-good)!important}
html[data-theme=light] .tx-market-room.running{background:#edf9f3;border-color:#73b99b}
html[data-theme] .tx-market-room.paused small{color:var(--tx-warn)!important}
html[data-theme] :is(.tx-room-stop,.tx-market-card-menu [data-remove-symbol-card],#labError){color:var(--tx-bad)!important}
/* Legacy utility-based screens: reports, strategy editor, positions and tables. */
html[data-theme=light] body :is([class*="bg-slate-950"],[class*="bg-slate-900"],[class*="bg-gray-900"],[class*="bg-gray-950"]){background:var(--tx-surface)!important}
html[data-theme=light] body :is([class*="bg-slate-800"],[class*="bg-gray-800"]){background:var(--tx-raised)!important}
html[data-theme=light] body :is(.text-white,[class*="text-slate-100"],[class*="text-slate-200"],[class*="text-slate-300"],[class*="text-gray-100"],[class*="text-gray-200"]){color:var(--tx-text)!important}
html[data-theme] body :is(.text-slate-400,.text-slate-500,.text-slate-600,.text-gray-400,.text-gray-500){color:var(--tx-muted)!important}
html[data-theme=light] body :is([class*="border-slate-"],[class*="border-gray-"]){border-color:var(--tx-border)!important}
html[data-theme=light] body :is(.text-cyan-200,.text-cyan-300,.text-cyan-400,.text-sky-300,.text-blue-300,.text-indigo-300){color:var(--tx-accent)!important}
html[data-theme=light] body :is(.text-emerald-200,.text-emerald-300,.text-emerald-400,.text-green-300,.text-green-400,.is-profit){color:var(--tx-good)!important}
html[data-theme=light] body :is(.text-rose-200,.text-rose-300,.text-rose-400,.text-red-300,.text-red-400,.is-loss){color:var(--tx-bad)!important}
html[data-theme=light] body :is(.text-amber-200,.text-amber-300,.text-amber-400,.text-yellow-300,.text-yellow-400){color:var(--tx-warn)!important}
/* Workspace chrome follows the theme; canvas colors use the chart API. */
html[data-theme] :is(.tx-workbench,.tx-workbench-header,.tx-analytics,.as-chart-card,.as-execution-panel,.as-execution-plan-card,.as-fullscreen-execution-plan,.tx-workspace-menu,#runningTradeStatus,.as-trade-flash){background:var(--tx-surface)!important;color:var(--tx-text)!important;border-color:var(--tx-border)!important}
html[data-theme] :is(.vi-chart-toolbar,.vi-chart-footer,.tx-chart-options-panel,.as-running-cards dl>div,.tx-analytics .as-oi-reach-row,.as-chart-floating-quotes button,.tx-workbench .tx-header-timeframes,.tx-workbench-header button,.tx-workbench .vi-chart-toolbar button,.tx-chart-options summary){background:var(--tx-raised)!important;color:var(--tx-text)!important;border-color:var(--tx-border)!important}
html[data-theme] :is(#txSession strong,.tx-readings b,.tx-dial-face b,.as-running-cards dd,.tx-analytics-heading strong,.tx-analytics h3){color:var(--tx-text)!important}
html[data-theme] :is(.tx-workbench-header>span:not(.tx-header-spacer),#txSession small,.tx-session-health .tx-paper-badge,.tx-readings>span,.tx-analytics p,.tx-dial header,.tx-dial footer,.tx-pulse-summary span,.as-running-cards dt,.as-running-updated,.tx-nav-heading,.tx-analytics #oiReachStatus,.as-oi-reach-row small){color:var(--tx-muted)!important}
html[data-theme] :is(.tx-readings,.tx-levels,.tx-pulse-summary,.tx-workbench-header #txSession){border-color:var(--tx-border)!important}
html[data-theme=light] :is(.as-chart-stage,.as-pully-pane,.as-chart-side,.tx-workbench .as-chart-body){background:#fff!important}
html[data-theme=light] .tx-workbench #btnStop{background:#aa2945!important;color:white!important;border-color:#aa2945!important}
html[data-theme=light] .tx-workbench #btnPause{color:var(--tx-warn)!important;border-color:#bfa263!important}
html[data-theme] .tx-workbench .tx-header-timeframes button[aria-pressed=true]{background:var(--tx-selected)!important;color:var(--tx-accent)!important}
html[data-theme=light] :is(.tx-dial-face i){background:#182b3d}
html[data-theme=light] :is(.tx-activity-rail,.as-execution-metrics>div,.as-chart-history-selector,.as-chart-history-selector select){background:var(--tx-raised)!important;color:var(--tx-text)!important;border-color:var(--tx-border)!important}
html[data-theme=light] .tx-activity-rail :is(strong,button,summary){color:var(--tx-accent)!important}
@media(prefers-reduced-motion:reduce){html[data-theme] *,html[data-theme] *::before,html[data-theme] *::after{scroll-behavior:auto!important}}
/* Mixed desk: dark operational anchors, light reading and configuration surfaces. */
html[data-theme=light] :is(.as-product-nav,.tx-dashboard-overview,.tx-workbench-header,.vi-chart-toolbar,.vi-chart-footer){--tx-surface:#101f2f;--tx-raised:#172b3d;--tx-border:#344c60;--tx-text:#edf3fa;--tx-muted:#a6bbcd;--tx-accent:#71dce4;--tx-selected:#173d4d;--tx-good:#6ee7b7;--tx-bad:#ff9aa8;--tx-warn:#f4d089}
html[data-theme=light] :is(.as-chart-stage,.as-pully-pane,.as-chart-side,.tx-workbench .as-chart-body){background:#0b1220!important;color:#cbd5e1!important}
html[data-theme=light] .tx-replay-setup header{box-shadow:none;background:transparent!important}
html[data-theme] .tx-replay-setup .tx-replay-eyebrow{color:var(--tx-accent)}
html[data-theme=light] .as-chart-tf-buttons button.is-active{background:#0b657b!important;color:#fff!important}
html[data-theme=light] .tx-workbench-header .as-chart-floating-quotes :is(.text-white,.text-slate-100,.text-slate-200){color:#edf3fa!important}
html[data-theme] :is(.tx-activity-label,.as-paper-panel-bar>strong){color:var(--tx-accent)!important}
html[data-theme] :is(.tx-activity-rail [data-activity-message],.tx-dial-labels,.tx-oi-balance small,.as-oi-reach-heading strong,.as-paper-panel-bar[data-pnl-tone=neutral]>[data-paper-summary]){color:var(--tx-muted)!important}
html[data-theme] .tx-activity-rail :is(button,summary,ol){background:var(--tx-raised)!important;color:var(--tx-text)!important;border-color:var(--tx-border)!important}
html[data-theme] .tx-activity-rail li p{color:var(--tx-muted)}
html[data-theme=light] body .vi-chart-toolbar select,html[data-theme=light] body .vi-chart-footer select{background:#172b3d!important;color:#edf3fa!important;border-color:#344c60!important}
html[data-theme=light] .tx-analytics :is(header,.tx-dial header){box-shadow:none!important;background:transparent!important}
html[data-theme=light] .tx-analytics #txFreshness{color:var(--tx-accent)}
html[data-theme=light] .tx-oi-balance>div>span:first-child,html[data-theme=light] .as-oi-reach-row.is-bear>span,html[data-theme=light] .as-oi-reach-row.is-bear>b,html[data-theme=light] .as-oi-reach-row.is-bear .as-oi-points,html[data-theme=light] #oiReachBearShare{color:var(--tx-bad)!important}
html[data-theme=light] .tx-oi-balance>div>span:last-child,html[data-theme=light] .as-oi-reach-row.is-bull>span,html[data-theme=light] .as-oi-reach-row.is-bull>b,html[data-theme=light] .as-oi-reach-row.is-bull .as-oi-points,html[data-theme=light] #oiReachBullShare{color:var(--tx-good)!important}
html[data-theme=light] #txDirection{color:var(--tx-text)!important}
html[data-theme=light] .as-paper-panel-bar[data-pnl-tone=profit]{color:#08734f!important}
html[data-theme=light] .as-paper-panel-bar[data-pnl-tone=loss]{color:#aa2945!important}
html[data-theme=light] .as-paper-panel-bar[data-pnl-tone=profit]>[data-paper-summary],html[data-theme=light] .as-paper-panel-bar[data-pnl-tone=loss]>[data-paper-summary]{color:inherit!important}
html[data-theme=light] .as-paper-panel-bar>[data-paper-toggle]{background:#e0f2f5!important;border-color:#8fbfc8!important;color:#086879!important}
html[data-theme=light] :is(.tx-lab>header,body[data-backtest-library] main>header){--tx-text:#edf3fa;--tx-muted:#a6bbcd;--tx-accent:#71dce4;background:#101f2f!important;color:var(--tx-text)!important;border:1px solid #344c60;border-radius:9px;padding:18px 20px;box-shadow:none!important}
html[data-theme=light] :is(.tx-lab>header,body[data-backtest-library] main>header) :is(h1,h2){color:#edf3fa!important}
html[data-theme=light] .as-product-nav [class*="bg-emerald-950"]{background:#163d37!important;color:#a7f3d0!important;border-color:#347d69!important}
html[data-theme] #toastStack>div{background:var(--tx-surface)!important;color:var(--tx-text)!important;border-color:var(--tx-border)!important}
html[data-theme] #toastStack>div[class*="border-rose"]{background:#fff0f3!important;color:#94233d!important;border-color:#ce7287!important}
html[data-theme] #toastStack>div[class*="border-red"]{background:#fff0f3!important;color:#94233d!important;border-color:#ce7287!important}
html[data-theme] #sessionStateNotice button{color:var(--tx-text)!important;background:var(--tx-raised)!important;border-color:var(--tx-border)!important}
html[data-theme=light] :is(.tx-lab>header,body[data-backtest-library] main>header){--tx-raised:#172b3d;--tx-border:#344c60}
html[data-theme=light] .tx-lab>header button{background:#172b3d!important;color:#edf3fa!important;border-color:#344c60!important}
