html[data-theme="dark"]{color-scheme:dark}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:36px;height:36px;padding:0;border:1px solid #34445b;border-radius:10px;background:#182334;color:#d4e3f8;cursor:pointer}
.theme-toggle:hover{background:#253851}.theme-toggle:focus-visible{outline:2px solid #6d9af1;outline-offset:3px}.theme-toggle svg{pointer-events:none}
.admin-sidebar-footer .theme-toggle{margin-bottom:12px}.login-card>.theme-toggle{float:right}
html[data-theme="light"]{color-scheme:light;--bg:#f2f5fa;--surface:#fff;--surface-2:#edf2f8;--line:#d6dfeb;--text:#18263a;--muted:#52627a;--blue:#285dc1;--green:#087443;--red:#b72d43;--purple:#7146bc}
html[data-theme="light"] body{background:#f2f5fa;color:#18263a}
html[data-theme="light"] :is(.desk-body,.admin-console-body,.login-body){background:linear-gradient(135deg,#f4f7fc,#edf2f8);color:#18263a}
html[data-theme="light"] :is(.panel,.desk-card,.account-card,.admin-card,.admin-stat-card,.login-card,.admin-modal-card,.pnl-detail-modal,.order-modal,.admin-insight-card){background:#fff;border-color:#d6dfeb;color:#18263a;box-shadow:0 8px 28px #2234540b}
html[data-theme="light"] :is(.desk-topbar,.topbar,.admin-sidebar,.admin-mobile-header,.admin-mobile-tabs){background:#fff;border-color:#d6dfeb;color:#18263a}
html[data-theme="light"] :is(.admin-hero,.account-card.featured){background:linear-gradient(120deg,#e8efff,#f8fbff);border-color:#c5d5f0;color:#18263a}
html[data-theme="light"] :is(.summary>div,.market-footnote,.ticket-instrument,.search-results,.brokerage-market,.admin-profile,.admin-table-wrap,.selected-box,.statement-summary){background:#f8faff;border-color:#d6dfeb;color:#18263a}
html[data-theme="light"] :is(input,select,textarea){background:#fff!important;color:#18263a!important;border-color:#bac9dc!important}
html[data-theme="light"] :is(input,select,textarea):focus{outline-color:#487dd3;border-color:#487dd3!important}
html[data-theme="light"] :is(input,select,textarea):disabled{background:#edf1f6!important;color:#64748b!important}
html[data-theme="light"] input::placeholder{color:#6b7b92}
html[data-theme="light"] :is(th,.market-table thead,.activity-table th,.admin-table th){background:#edf2f9;color:#52627a;border-color:#d6dfeb}
html[data-theme="light"] :is(td,.admin-table td,.market-table td,.activity-table td){color:#283950;border-color:#dce4ee}
html[data-theme="light"] :is(.admin-table tbody tr:hover td,.activity-table tr:hover td,.search-item:hover,.market-row:hover){background:#edf3fc}
html[data-theme="light"] .market-row.selected{background:#e8efff}
html[data-theme="light"] :is(.instrument-name b,.position-entry strong,.account-card strong,.admin-user-cell b,.admin-shortcuts>a b,.empty-state b){color:#18263a}
html[data-theme="light"] :is(.muted,.tiny,.paper-note,.admin-note,.admin-eyebrow,.admin-nav-label,.admin-stat-card small,.admin-hero p,.admin-section-heading p,.admin-tab-heading p,.pnl-detail-modal p,.admin-brand small,.admin-profile small,.instrument-name span,.account-card>span,.account-card small,.desk-brand span,.ticket-grid label,.ticket-estimate span,.brokerage-market label,.login-card label,.admin-user-cell small,.position-entry span,.admin-stat-top>span){color:#52627a}
html[data-theme="light"] :is(.table-action,.refresh-btn,.filter-btn,.side-choice,.stepper button,.admin-secondary-btn,.admin-action-btn,.admin-logout,.logout-link,.top-link,.interval,.btn:not(.primary):not(.danger),.theme-toggle){background:#edf2f9;color:#304b70;border-color:#c5d2e4}
html[data-theme="light"] :is(.exchange-filter,.script-filters,.stepper){background:#f5f8fc;border-color:#ccd7e6}
html[data-theme="light"] :is(.filter-btn.active,.script-filters button.active,.admin-nav a.active,.admin-mobile-tabs a.active,.workspace-tab.active,.interval.active){background:#dce9ff;color:#1d4f9e;border-color:#adc6ed}
html[data-theme="light"] :is(.admin-nav a,.script-filters button,.admin-mobile-tabs a,.activity-tab,.workspace-tab){color:#52627a}
html[data-theme="light"] .activity-tab.active{color:#2456ac}
html[data-theme="light"] .activity-tab span{background:#e4ebf6;color:#385077}
html[data-theme="light"] :is(.admin-user-avatar,.user-avatar,.admin-avatar){background:#e3ecfb;color:#2b579b;border-color:#bdcfea}
html[data-theme="light"] :is(.positive,.admin-table td.positive,.number-col.positive){color:#087443!important}
html[data-theme="light"] :is(.negative,.admin-table td.negative,.number-col.negative){color:#b72d43!important}
html[data-theme="light"] :is(.quote-btn.ask,.side-choice.buy.active,.side.buy.active,.transaction-side.buy,.side-label.buy,.admin-status.active,.success,.badge.good,.admin-role-chip,.admin-live-pill){background:#e0f4e9;color:#086c3d;border-color:#acd9bf}
html[data-theme="light"] :is(.quote-btn.bid,.side-choice.sell.active,.side.sell.active,.transaction-side.sell,.side-label.sell,.admin-status.disabled,.table-action.danger,.admin-action-btn.danger,.error,.badge.bad){background:#fde9ed;color:#ae283e;border-color:#edbbc4}
html[data-theme="light"] :is(.btn.primary,.admin-primary-btn,.place-order){color:#fff}
html[data-theme="light"] .position-entry-row>td{background:#f3f7fd!important}
html[data-theme="light"] .position-entry{background:#fff;border-color:#d2deed;color:#304b70}
html[data-theme="light"] .position-actions .entry-toggle{background:#e9f0fc;border-color:#b9cce7;color:#2f5f9f}
html[data-theme="light"] .position-actions .entry-toggle[aria-expanded="true"]{background:#d8e7fc;color:#164c97}
html[data-theme="light"] :is(.admin-example,.admin-shortcuts>a){background:#edf3ff;border-color:#c3d2eb;color:#39567f}
html[data-theme="light"] :is(.card-heading,.activity-bar,.ticket-estimate,.statement-heading,.desk-toolbar,.admin-sidebar-footer){border-color:#d6dfeb}
html[data-theme="light"] dialog::backdrop{background:#14223966;backdrop-filter:blur(3px)}
html[data-theme="light"] .theme-toggle:hover{background:#dbe8fc;color:#244f96}
html[data-theme="light"] #orderDialog{background:#fff;color:#18263a;border-color:#c3d0e2;box-shadow:0 24px 90px #18263a33}
html[data-theme="light"] #orderDialog #orderFeedback:not(:empty){background:#fde9ed;color:#a42339;border-color:#e3a9b4}
html[data-theme="light"] .workspace-toolbar{background:#fff;border-color:#d6dfeb}
html[data-theme="light"] :is(.workspace-link,.statement-note,.statement-footer,.statement-summary span,.workspace-caption){color:#52627a}
html[data-theme="light"] .workspace-link.active{background:#e3edff;color:#2456ac}
html[data-theme="light"] .workspace-link:hover{color:#174891}
html[data-theme="light"] :is(.user-name,.ltp-cell,.admin-user-form label,.admin-profile b){color:#283950}
html[data-theme="light"] :is(#brokerageStatus,.admin-modal label,.form-grid label){color:#52627a}

/* Complete light palette, including transient content and interaction states. */
html[data-theme="light"] a{color:#285dc1}
html[data-theme="light"] :is(.brand,.admin-brand-mark,.desk-mark){color:#fff}
html[data-theme="light"] :is(.admin-brand,.logo){color:#18263a}
html[data-theme="light"] :is(.summary,.admin-mix-track){background:#dce4ee;border-color:#d6dfeb}
html[data-theme="light"] :is(.virtual-chip,.simulation-badge,.logo span,.admin-exchange,.badge){background:#e8effa;color:#365682;border-color:#c4d4ec}
html[data-theme="light"] :is(.connection-pill,.side){background:#edf2f9;color:#52627a;border-color:#c5d2e4}
html[data-theme="light"] :is(.connection-pill.live,.status.COMPLETE,.badge.good){background:#e0f4e9;color:#086c3d;border-color:#acd9bf}
html[data-theme="light"] :is(.connection-pill.waiting,.status.OPEN,.warning-panel){background:#fff6df;color:#805800;border-color:#e8ce89}
html[data-theme="light"] :is(.connection-pill.offline,.status.REJECTED,.status.CANCELLED,.badge.bad,.btn.danger){background:#fde9ed;color:#ae283e;border-color:#edbbc4}
html[data-theme="light"] :is(.stale-rate){color:#805800}
html[data-theme="light"] :is(.buy-text,.admin-example strong){color:#087443}
html[data-theme="light"] .admin-pnl-preview{color:#087443!important}
html[data-theme="light"] .sell-text{color:#b72d43}
html[data-theme="light"] :is(.search-results,.modern-results){background:#fff;border-color:#c5d2e4;box-shadow:0 12px 32px #2234541f}
html[data-theme="light"] .modern-results .search-item{color:#18263a;border-color:#dce4ee}
html[data-theme="light"] :is(.modern-results .search-item small,.modern-results .search-item em,.search-item small,.watch-symbol small,.summary small,.search-empty,.eyebrow,.market-clock,.ticket-instrument span,.admin-modal-card p,.admin-user-form label span,.admin-shortcuts>a small,.admin-mix-row>div:first-child){color:#52627a}
html[data-theme="light"] :is(.modern-results .search-item:hover,.watch-item:hover,.mcx-rate-row:hover){background:#edf3fc}
html[data-theme="light"] :is(.chart-wrap,.multiplier-example,code){background:#f4f7fc;color:#304b70;border-color:#d6dfeb}
html[data-theme="light"] :is(.multiplier-table-wrap thead,.statement-summary>div){background:#fff;border-color:#d6dfeb}
html[data-theme="light"] .admin-modal{background:#14223966;box-shadow:none}
html[data-theme="light"] .admin-modal-card{background:#fff;color:#18263a;border-color:#c5d2e4;box-shadow:0 24px 70px #18263a33}
html[data-theme="light"] :is(.admin-sidebar,.admin-hero){box-shadow:0 8px 28px #2234540b}
html[data-theme="light"] .admin-section-icon{background:#e3ecff;color:#285dc1}
html[data-theme="light"] .admin-section-icon.users-icon{background:#e0f4e9;color:#087443}
html[data-theme="light"] .admin-section-icon.multiplier-icon{background:#efe7fb;color:#7146bc}
html[data-theme="light"] .admin-stat-symbol{background:color-mix(in srgb,var(--card-color) 9%,white);border-color:color-mix(in srgb,var(--card-color) 25%,white);color:color-mix(in srgb,var(--card-color) 75%,#18263a)}
html[data-theme="light"] .accent-gold{--card-color:#946500}
html[data-theme="light"] .admin-stat-card:hover{border-color:color-mix(in srgb,var(--card-color) 42%,#d6dfeb);box-shadow:0 12px 30px #22345414}
html[data-theme="light"] :is(.admin-mix-row strong,.ticket-instrument.empty>b){color:#304b70}
html[data-theme="light"] :is(.admin-nav a:hover,.admin-mobile-tabs a:hover,.admin-logout:hover,.admin-shortcuts>a:hover){background:#edf3fc;color:#2456ac;border-color:#c5d2e4}
html[data-theme="light"] .admin-nav a.active{background:#dce9ff;color:#1d4f9e;box-shadow:none}
html[data-theme="light"] :is(.top-link,.logout-link){background:transparent;color:#52627a}
html[data-theme="light"] :is(.top-link:hover,.logout-link:hover){color:#174891}
html[data-theme="light"] :is(.table-action:hover,.refresh-btn:hover,.stepper button:hover,.position-actions .entry-toggle:hover,.admin-secondary-btn:hover,.admin-action-btn:hover){background:#dce9ff;color:#1d4f9e;border-color:#adc6ed;filter:none}
html[data-theme="light"] :is(.table-action.danger:hover,.admin-action-btn.danger:hover,.btn.danger:hover){background:#fbdce3;color:#922238;border-color:#df9dab}
html[data-theme="light"] :is(.quote-btn:hover,.admin-primary-btn:hover){filter:brightness(.96)}
html[data-theme="light"] .place-order:disabled{background:#e3e9f1;color:#617087}
html[data-theme="light"] :is(.empty-cell,.admin-empty){color:#52627a!important}
html[data-theme="light"] :is(.xbtn,.remove-watch){color:#617087}
html[data-theme="light"] :is(.xbtn:hover,.remove-watch:hover){color:#b72d43}
html[data-theme="light"] :is(#toast,.admin-toast){background:#fff;color:#18263a;border-color:#c5d2e4;box-shadow:0 12px 36px #22345426}
html[data-theme="light"] :is(#toast.ok,.admin-toast:not(.error)){background:#e0f4e9;color:#086c3d;border-color:#acd9bf}
html[data-theme="light"] :is(#toast.error,.admin-toast.error){background:#fde9ed;color:#ae283e;border-color:#edbbc4}
html[data-theme="light"] #orderDialog::backdrop{background:#14223966}
html[data-theme="light"] :is(.market-table th span,.market-card .market-table .number-col:before){color:#52627a}
html[data-theme="light"] :is(.filter-btn.active,.admin-nav a.active){box-shadow:none}
html[data-theme="light"] :is(button,a,input,select,textarea):focus-visible{outline:2px solid #285dc1;outline-offset:2px}
html[data-theme="light"]{scrollbar-color:#afbed2 #f2f5fa}

/* Client light-mode market filter matches the admin overview filter. */
html[data-theme="light"] .desk-body .exchange-filter{background:#f5f8fc;border:1px solid #ccd7e6;border-radius:10px;padding:4px;gap:4px;box-shadow:none}
html[data-theme="light"] .desk-body .exchange-filter .filter-btn{background:transparent;color:#52627a;border:0;border-radius:7px;padding:10px 14px;font-size:12px;font-weight:400;box-shadow:none}
html[data-theme="light"] .desk-body .exchange-filter .filter-btn:hover{background:transparent;color:#52627a}
html[data-theme="light"] .desk-body .exchange-filter .filter-btn.active,
html[data-theme="light"] .desk-body .exchange-filter .filter-btn.active:hover{background:#dce9ff;color:#1d4f9e;border-color:#adc6ed;box-shadow:none}

html[data-theme="light"] .desk-body .market-card .exchange-filter .filter-btn{padding:8px 7px;font-size:11px}
@media(max-width:400px){
    html[data-theme="light"] .desk-body .market-card .exchange-filter{gap:2px;padding:3px}
    html[data-theme="light"] .desk-body .market-card .exchange-filter .filter-btn{padding:8px 5px;font-size:10px}
}

.client-logout-icon{display:none}
html[data-theme="light"] .desk-body .desk-top-actions .logout-link{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:0 11px;border:1px solid #e6c9ce;border-radius:9px;background:#fff5f6;color:#a12c40;font-size:12px;font-weight:650;text-decoration:none;transition:background .15s,border-color .15s,color .15s}
html[data-theme="light"] .desk-body .logout-link .client-logout-icon{display:block;flex-shrink:0}
html[data-theme="light"] .desk-body .desk-top-actions .logout-link:hover{background:#fce5e9;border-color:#d995a2;color:#842136}
html[data-theme="light"] .desk-body .desk-top-actions .logout-link:focus-visible{outline:2px solid #a12c40;outline-offset:3px}
@media(max-width:400px){html[data-theme="light"] .desk-body .desk-top-actions .logout-link{padding:0 8px;gap:5px}}

/* Client logout control in dark mode, matching the light-mode shape. */
html:not([data-theme="light"]) .desk-body .desk-top-actions .logout-link{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:0 11px;border:1px solid #62404a;border-radius:9px;background:#2b1c24;color:#f2a8b5;font-size:12px;font-weight:650;text-decoration:none;transition:background .15s,border-color .15s,color .15s}
html:not([data-theme="light"]) .desk-body .logout-link .client-logout-icon{display:block;flex-shrink:0}
html:not([data-theme="light"]) .desk-body .desk-top-actions .logout-link:hover{background:#40232e;border-color:#b66c7c;color:#ffd5dd}
html:not([data-theme="light"]) .desk-body .desk-top-actions .logout-link:focus-visible{outline:2px solid #f2a8b5;outline-offset:3px}
@media(max-width:400px){html:not([data-theme="light"]) .desk-body .desk-top-actions .logout-link{padding:0 8px;gap:5px}}
