/* Finvexas: one dark palette across legacy CRM, client portal and mobile.
   All appearance overrides are dark-only; status colors and light branding remain separate. */
html[data-theme="dark"] {
  color-scheme:dark;
  --fx-dark-bg:#0d1420;--fx-dark-card:#151f2f;--fx-dark-soft:#1e2a3d;
  --fx-dark-hover:#26364d;--fx-dark-line:#35445b;--fx-dark-ink:#edf2fa;
  --fx-dark-muted:#b3bfd1;--fx-dark-accent:#ffa9c1;--fx-dark-rose:#3c2333;
  --fx-dark-green:#6ee7b7;--fx-dark-green-bg:#12382e;
  --fx-dark-red:#ffacb8;--fx-dark-red-bg:#442330;
  --fx-dark-amber:#f8d281;--fx-dark-amber-bg:#3c3020;
  --bfx-ui-surface:var(--fx-dark-card);--bfx-ui-soft:var(--fx-dark-soft);
  --bfx-ui-ink:var(--fx-dark-ink);--bfx-ui-muted:var(--fx-dark-muted);
  --bfx-ui-line:var(--fx-dark-line);--bfx-ui-accent:var(--fx-dark-accent);--bfx-ui-active:var(--fx-dark-rose);
}
html[data-theme="dark"] body {color-scheme:dark}
html[data-theme="dark"] :is(input,select,textarea,button){color-scheme:dark}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--fx-dark-muted)!important;opacity:1}
html[data-theme="dark"] :is(input,select,textarea):focus-visible{outline:2px solid var(--fx-dark-accent);outline-offset:2px}
html[data-theme="dark"] :is(dialog,.modal)::backdrop{background:#020711b3}
html[data-theme="dark"] :is(.toast,.notice){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html[data-theme="dark"] .toast-error{background:var(--fx-dark-red-bg)!important;color:var(--fx-dark-red)!important}
html[data-theme="dark"] .toast-success{background:var(--fx-dark-green-bg)!important;color:var(--fx-dark-green)!important}
html[data-theme="dark"] ::selection{background:#75445b;color:#fff}

/* CRM tokens must override the older selectors that explicitly forced light mode. */
html:root[data-theme="dark"] body.page-admin {
  --crm-ink:var(--fx-dark-ink);--crm-muted:var(--fx-dark-muted);--crm-border:var(--fx-dark-line);
  --crm-surface:var(--fx-dark-card);--crm-bg:var(--fx-dark-bg);--crm-accent:var(--fx-dark-accent);
  --crm-soft:var(--fx-dark-rose);--crm-green:var(--fx-dark-green);--crm-red:var(--fx-dark-red);--crm-amber:var(--fx-dark-amber);
  --pro-text:var(--fx-dark-ink);--pro-muted:var(--fx-dark-muted);--pro-border:var(--fx-dark-line);--pro-border-strong:#52627b;
  --pro-purple:var(--fx-dark-accent);--pro-purple-deep:var(--fx-dark-soft);--pro-success:var(--fx-dark-green);--pro-danger:var(--fx-dark-red);--pro-warning:var(--fx-dark-amber);
  --bfx-line:var(--fx-dark-line);--bfx-ink:var(--fx-dark-ink);--bfx-muted:var(--fx-dark-muted);
  background:var(--fx-dark-bg)!important;color:var(--fx-dark-ink)!important;
}
html:root[data-theme="dark"] body.page-admin :is(.admin-main,.admin-layout){background:var(--fx-dark-bg)!important;color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-admin :is(.admin-side,.admin-card,.crm-card,.com-card,.cw-card,.bfx-export-card,.bfx-api-key,.crm-dialog,dialog,.modal,.admin-notification-popover,.client-delete-report){background:var(--fx-dark-card)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important;box-shadow:none!important}
html:root[data-theme="dark"] body.page-admin .admin-main article{background-color:var(--fx-dark-card)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(.admin-profile,.crm-status-strip,.crm-range-presets,.crm-directory-selection,.op-register-controls,.op-register-empty,.crm-empty,.cw-empty,.cw-filterbar,.cw-event,.admin-access-modal-head,.admin-access-editor-footer,.bfx-access-footer,.bfx-access-scroll,.bfx-api-example,.bfx-api-docs,.secret-link-row,.operator-directory-row,.permission-module-row,.permission-matrix-head,.com-compose,.com-empty){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(.admin-main,.admin-side,dialog) :is(h1,h2,h3,h4,h5,th,label,summary){color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-admin :is(.admin-main,.admin-side,dialog) :is(p,small,.crm-muted,.cw-muted,.op-muted,.crm-directory-subtext){color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] body.page-admin :is(.admin-main,.admin-side,dialog) :is(strong,b){color:inherit}
html:root[data-theme="dark"] body.page-admin :is(.crm-metric,.crm-directory-kpis,.com-kpis,.op-metrics,.cw-kpis,.cw-card,.admin-profile,.admin-card) :is(strong,b){color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-admin .admin-side :is(nav a,.admin-side-bottom a){color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] body.page-admin .admin-side nav a:is(.active,:hover){background:var(--fx-dark-rose)!important;color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] body.page-admin :is(.admin-profile>span,.crm-avatar,.crm-directory-avatar,.admin-operator-avatar,.cw-avatar,.cw-account-icon,.cw-event-icon,.crm-metric-icon,.admin-nav-count){background:var(--fx-dark-soft)!important;color:var(--fx-dark-accent)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(.admin-global-search,.admin-notification-bell,.admin-mobile-toggle){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(.admin-main,dialog,.modal) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),select,textarea){background:var(--fx-dark-bg)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important;box-shadow:none!important}
html:root[data-theme="dark"] body.page-admin :is(input[type="checkbox"],input[type="radio"]){accent-color:#d5426b}
html:root[data-theme="dark"] body.page-admin :is(table,thead,tbody,tr,td,th){border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(thead,th){background:var(--fx-dark-soft)!important;color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] body.page-admin :is(tbody,tr,td){background-color:transparent;color:var(--fx-dark-ink)}
html:root[data-theme="dark"] body.page-admin tbody tr:hover{background-color:var(--fx-dark-hover)!important}
html:root[data-theme="dark"] body.page-admin :is(.btn,.crm-btn,.cw-button,.operator-manage-button,.crm-directory-assign,.client-back,.spread-rule-remove,.manual-method-remove,.op-filter-buttons button,.crm-range-presets button,.com-tabs button){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(.btn-primary,.crm-btn-primary,.cw-button.primary,.bfx-contact-form button){background:#ae214b!important;color:#fff!important;border-color:#d84b73!important}
html:root[data-theme="dark"] body.page-admin :is(.btn-primary,.crm-btn-primary,.cw-button.primary) :is(b,span,small){color:#fff!important}
html:root[data-theme="dark"] body.page-admin :is(.btn-danger,.crm-btn-danger,.cw-button.danger){background:var(--fx-dark-red-bg)!important;color:var(--fx-dark-red)!important;border-color:#814658!important}
html:root[data-theme="dark"] body.page-admin :is(.cw-tabs a.active,.op-filter-buttons button.active,.crm-range-presets button.active){background:var(--fx-dark-rose)!important;color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] body.page-admin :is(.admin-live,.bfx-contact-state.is-on,.connection-badge,.crm-badge-green,.com-badge.priority-low,.bfx-api-badge.is-active,.cw-badge.positive,.status-active){background:var(--fx-dark-green-bg)!important;color:var(--fx-dark-green)!important;border-color:#2f6655!important}
html:root[data-theme="dark"] body.page-admin :is(.crm-badge,.com-badge,.cw-badge,.bfx-api-badge,.status-label){background:var(--fx-dark-soft);color:var(--fx-dark-ink);border-color:var(--fx-dark-line)}
html:root[data-theme="dark"] body.page-admin :is(.crm-badge-amber,.com-badge.priority-high,.bfx-api-badge.is-paused){background:var(--fx-dark-amber-bg)!important;color:var(--fx-dark-amber)!important}
html:root[data-theme="dark"] body.page-admin :is(.com-badge.priority-normal,.crm-badge.neutral,.status-closed){background:var(--fx-dark-soft)!important;color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] body.page-admin :is(.up,.positive,.profit,.settled-outcome.win,.v37-net.is-positive){color:var(--fx-dark-green)!important}
html:root[data-theme="dark"] body.page-admin :is(.down,.negative,.loss,.settled-outcome.loss,.v37-net.is-negative){color:var(--fx-dark-red)!important}
html:root[data-theme="dark"] body.page-admin .settled-outcome.loss{background:var(--fx-dark-red-bg)!important}
html:root[data-theme="dark"] body.page-admin :is(.crm-progress-track,.op-progress,.cw-meter){background:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(pre,code){background:var(--fx-dark-bg)!important;color:#c3d5fa!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin .client-workspace{--cw-border:var(--fx-dark-line);--cw-muted:var(--fx-dark-muted);--cw-ink:var(--fx-dark-ink);--cw-brand:var(--fx-dark-accent)}
html:root[data-theme="dark"] body.page-admin :is(.cw-account-list>a,.cw-facts>div,.cw-comment-list>article,.cw-timeline,.cw-form-grid,.cw-section-head,.cw-modal-header,.cw-modal-footer){background-color:var(--fx-dark-card)!important;border-color:var(--fx-dark-line)!important;color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-admin :is(.cw-link,.crm-directory-name a,.crm-account-link,.bfx-api-docs a,.client-delete-report a){color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] body.page-admin .bfx-contact-control{background:var(--fx-dark-card)!important;border-color:var(--fx-dark-line)!important;border-left-color:#d5426b!important}
html:root[data-theme="dark"] body.page-admin .v47-delete-note{background:var(--fx-dark-amber-bg)!important;color:var(--fx-dark-amber)!important;border-color:#6b5735!important}

/* Client portal, terminal dialogs and authentication. */
html[data-theme="dark"] :is(.client-shell,.page-dashboard){--cp-bg:var(--fx-dark-bg);--cp-card:var(--fx-dark-card);--cp-text:var(--fx-dark-ink);--cp-muted:var(--fx-dark-muted);--cp-line:var(--fx-dark-line);--cp-purple:var(--fx-dark-accent);--cp-purple-2:var(--fx-dark-accent);--cp-green:var(--fx-dark-green);--cp-red:var(--fx-dark-red);--portal-soft:var(--fx-dark-soft)}
html[data-theme="dark"] body:is(.page-login,.page-register,.page-forgot_password,.page-reset_password,.page-admin_secret){background:var(--fx-dark-bg)!important;color:var(--fx-dark-ink)!important}
html[data-theme="dark"] body:is(.page-login,.page-register,.page-forgot_password,.page-reset_password,.page-admin_secret) :is(input,select,.password,.auth-card,.language){background:var(--fx-dark-card)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html[data-theme="dark"] body:is(.page-login,.page-register,.page-forgot_password,.page-reset_password,.page-admin_secret) .password button{background:transparent!important;color:var(--fx-dark-muted)!important}
html[data-theme="dark"] .client-shell :is(input,textarea,select){background:var(--fx-dark-bg)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html[data-theme="dark"] :is(.page-dashboard,.client-shell) :is(dialog,.modal){background:var(--fx-dark-card)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}

/* Public website: theme only, preserving the existing home layout. */
html[data-theme="dark"] :is(.page-home,.page-info) :is(.fx-phone,.fx-phone span,.fx-button-light,.reference-white-button,.reference-breadcrumb span){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html[data-theme="dark"] :is(.page-home,.page-info) :is(.fx-phone strong,.fx-faq summary,.fx-note-mark){color:var(--fx-dark-ink)!important}
html[data-theme="dark"] :is(.page-home,.page-info) :is(.fx-phone small,.reference-header-actions>a:not(.btn)){color:var(--fx-dark-muted)!important}
html[data-theme="dark"] :is(.page-home,.page-info) .bfx-buy{background:var(--fx-dark-green-bg)!important;color:var(--fx-dark-green)!important}
html[data-theme="dark"] :is(.page-home,.page-info) .bfx-sell{background:var(--fx-dark-red-bg)!important;color:var(--fx-dark-red)!important}

/* AI has its own nested palette; it now follows the platform theme. */
html[data-theme="dark"] .ai-studio{--ai-bg:var(--fx-dark-bg);--ai-rail:var(--fx-dark-card);--ai-ink:var(--fx-dark-ink);--ai-muted:var(--fx-dark-muted);--ai-line:var(--fx-dark-line);--ai-hover:var(--fx-dark-soft);--ai-accent:var(--fx-dark-accent);--ai-soft:var(--fx-dark-rose);--ai-card:var(--fx-dark-card)}
html[data-theme="dark"] body.ai-standalone{background:var(--fx-dark-bg);color:var(--fx-dark-ink)}
html[data-theme="dark"] .fx-ai-login{color:var(--fx-dark-ink)}
html[data-theme="dark"] .fx-ai-login p{color:var(--fx-dark-muted)}
html[data-theme="dark"] .fx-ai-login input{background:var(--fx-dark-card);color:var(--fx-dark-ink);border-color:var(--fx-dark-line)}

.client-delete-report{margin-bottom:20px;padding:20px}.client-delete-report h2{margin-top:0}.client-delete-report p{line-height:1.6}.client-delete-report a{text-decoration:underline;text-underline-offset:3px}
body.page-admin .admin-theme-toggle{display:inline-grid;place-items:center;width:38px;height:38px;flex:0 0 38px;padding:0;border:1px solid var(--crm-border);border-radius:8px;background:var(--crm-surface);color:var(--crm-ink);font-size:21px;cursor:pointer}
/* Small foreground details carry the same contrast as their surrounding controls. */
html[data-theme="dark"] .client-shell :is(.portal-asset-logo,.cp-count,.portal-account-type,.portal-status,.cp-selected-account){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html[data-theme="dark"] .client-shell .portal-asset-logo b{color:var(--fx-dark-ink)!important}
html[data-theme="dark"] .client-shell :is(.cp-aside-note,.cp-side-column,.cp-main-column,.cp-account-card,.cp-section-head,.cp-empty,.portal-empty,.cp-security-state) a:not(.portal-button):not(.cp-open-terminal){color:var(--fx-dark-accent)!important}
html[data-theme="dark"] .client-shell :is(.cp-market-table,.portal-market-table,.cp-weekly-table) a{background:var(--fx-dark-soft)!important;color:var(--fx-dark-accent)!important}
html[data-theme="dark"] .client-shell :is(.cp-context-balance,.cp-chart-legend,.cp-context-selector,.client-header-equity){color:var(--fx-dark-muted)!important}
html[data-theme="dark"] .client-shell :is(.status-active,i.verified){background:var(--fx-dark-green-bg)!important;color:var(--fx-dark-green)!important}
html[data-theme="dark"] .page-dashboard :is(.timeframe-picker>summary,.chart-actions button,.chart-head button,.savexa-profit,.terminal-balance i){color:var(--fx-dark-muted)!important}
html[data-theme="dark"] .page-dashboard .down{color:var(--fx-dark-red)!important}
html[data-theme="dark"] .mobile-app{--muted:var(--fx-dark-muted);--ink:var(--fx-dark-ink);--purple:var(--fx-dark-accent);--purple-2:var(--fx-dark-accent)}
html[data-theme="dark"] .mobile-app :is(.top-account i,.section-head a,.section-head button,.portfolio-tabs button,.portfolio-tabs i,.mobile-deposit-min){color:var(--fx-dark-muted)!important}
html[data-theme="dark"] .mobile-app :is(.mobile-document-status>div,.mobile-document-summary>div,.mobile-documents-summary>div,.mobile-documents-status>div){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin .procrm-brand-mark{background:#ae214b!important;color:#fff!important}
html:root[data-theme="dark"] body.page-admin .admin-notification-bell b{background:#ae214b!important;color:#fff!important}
html:root[data-theme="dark"] body.page-admin .admin-main :is(td,td>span:not([class]),td>time,.com-text-button){color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-admin .admin-main :is(td a,.com-link,.crm-history-link){color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] body.page-admin :is(.crm-metric>span,.crm-status-strip span,.com-kpis article>span,.op-metric>span,.op-eyebrow,.com-eyebrow,.eyebrow,.bfx-presence){color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] body.page-admin :is(.bfx-api-key>summary,details.trade-editor>summary,.trade-editor-summary,.com-provider-strip,.helpdesk-ticket-list,.op-note,.bulk-spread-selected,.bulk-spread-editor,.integration-actions,.bfx-export-tabs>a,.bfx-export-presets button,.bfx-export-columns label,.bfx-export-reset,.secret-link-row button,.operator-directory-count,.bm-folders a.active,.bfx-ai-suggestions button){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(.bfx-export-tabs>a.is-active,.bm-folders a.active){background:var(--fx-dark-rose)!important;color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] body.page-admin :is(.kpi-icon,.bulk-spread-selected span,.integration-secret-clear span){background:var(--fx-dark-soft)!important;color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] body.page-admin :is(.bfx-api-key>summary,.com-provider-strip,.bulk-spread-editor) :is(b,span,label){color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-admin .admin-main tbody tr{background-color:transparent!important}
html:root[data-theme="dark"] body.page-admin .admin-main tbody tr:hover{background-color:var(--fx-dark-hover)!important}
html:root[data-theme="dark"] body.page-admin .admin-main :is(.btn,.crm-btn){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin .admin-main :is(.btn-primary,.crm-btn-primary){background:#ae214b!important;color:#fff!important;border-color:#d84b73!important}
html:root[data-theme="dark"] body.page-admin .admin-main :is(.btn-danger,.crm-btn-danger){background:var(--fx-dark-red-bg)!important;color:var(--fx-dark-red)!important}
html:root[data-theme="dark"] body.page-admin .admin-main :is(.up,.positive,.profit){color:var(--fx-dark-green)!important}
html:root[data-theme="dark"] body.page-admin .admin-main :is(.down,.negative,.loss){color:var(--fx-dark-red)!important}
html[data-theme="dark"] .mobile-app .document-status-mobile>span{background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html[data-theme="dark"] .mobile-app .document-status-mobile :is(b,small){color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-admin :is(.crm-metric-label span,.crm-pipeline-row span,.com-call-summary article>span,.com-empty span,.com-pagination span,.crm-owner-audit summary em,.clear-secret span){color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] body.page-admin :is(.bfx-export-sets>a,.bfx-export-quick button,.bfx-export-fields>label,.admin-trade-reopen>summary,.switch>span){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin .bfx-export-sets>a.is-active{background:var(--fx-dark-rose)!important;border-color:#af5d78!important}
html:root[data-theme="dark"] body.page-admin :is(.bfx-ticket-feed button,.bfx-ai-settings-title .is-off,.bfx-ai-setup-note span){color:var(--fx-dark-amber)!important}
html:root[data-theme="dark"] :is(.page-home,.page-info) :is(.reference-side-footer p a,.reference-public-index a span,.reference-public-feature-strip i){color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] :is(.page-home,.page-info) .rf-skip{background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important}
/* Match the current 224px navigation; an older dark-only rule used 278px and clipped every CRM page. */
@media screen and (min-width:901px){html:root[data-theme="dark"] body.page-admin .admin-main{margin-left:224px!important;width:calc(100% - 224px)!important;padding:24px 28px 48px!important}}
@media screen and (max-width:900px){html:root[data-theme="dark"] body.page-admin .admin-main{margin-left:0!important;width:100%!important;padding:16px!important}html:root[data-theme="dark"] body.page-admin .crm-nav-close{background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important}}
html:root[data-theme="dark"] body.page-admin :is(.bfx-access-close,.bfx-access-head,.bfx-access-form,.permission-matrix,.permission-module-block,.permission-feature-chip>span,.bfx-question-row-heading button,.bfx-question-editor-heading>span,.bm-tabs a.active){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin .bfx-access-form{background:var(--fx-dark-card)!important}
html:root[data-theme="dark"] body.page-admin .permission-matrix :is(b,strong){color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-admin .permission-cell>i{background:#53647e!important}
html:root[data-theme="dark"] body.page-admin .permission-cell input:checked+i{background:#bc315b!important}
html:root[data-theme="dark"] body.page-admin .permission-feature-chip input:checked+span{background:var(--fx-dark-rose)!important;border-color:#af5d78!important}
html:root[data-theme="dark"] body.page-admin .permission-feature-chip input:checked+span i{background:#bc315b!important;color:#fff!important}
html:root[data-theme="dark"] body.page-admin .bm-button.primary{background:#ae214b!important;color:#fff!important;border-color:#d84b73!important}
html:root[data-theme="dark"] body.page-admin .bm-envelope{color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] body.page-admin .bfx-ai-empty span{color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] body.page-admin input[type="color"]{background:var(--fx-dark-soft)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(.cw-breadcrumb a,.cw-meta span,.cw-tabs a,.cw-form-footer span,.cw-event-meta time){color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] body.page-admin .cw-form legend{color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-admin .cw-button>b{background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-admin .com-notice{background:var(--fx-dark-amber-bg)!important;color:var(--fx-dark-amber)!important;border-color:#6b5735!important}
html:root[data-theme="dark"] :is(.page-home,.page-info) :is(.reference-public-section>header>span,.reference-about-values article>span,.reference-step-line article>span,.bfx-step-number,.bfx-complaint-contacts article>span){color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] .page-info :is(.reference-side-group.active>summary>span,.bfx-swap-asset i,.bfx-swap-asset span,.bfx-glossary summary,.bfx-schedule-sources summary,.bfx-risk-calculator output,.reference-faq-card summary span,.reference-faq-card summary i,.reference-contact-form label){color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] .page-info :is(.bfx-tools-content a,.bfx-terms a,.bfx-complaint-contacts a,.reference-contact a,.bfx-source-note a,.bfx-swap-card a){color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] .page-info :is(.bfx-market-visual>span,.bfx-swap-card>strong>span,.reference-faq-tabs button,.bfx-phone,.bfx-phone>i,.bfx-phone-notice,.reference-cookie button,.bfx-table-tools button){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] .page-info .reference-faq-tabs button.active{background:var(--fx-dark-rose)!important;color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] :is(.page-register,.page-login) :is(.international-phone,.detected-country-badge){background:var(--fx-dark-card)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] .detected-country-badge em{color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] .client-shell :is(.client-equity span,.cp-account-overview-actions a,.cp-account-fund-link,.cp-result-breakdown>a){color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] .client-shell :is(.portal-market-card>header a,.portal-weekly-card>header a,.portal-news-hero aside button){background:var(--fx-dark-soft)!important;color:var(--fx-dark-accent)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] .page-dashboard :is(.account-chip>i,.timeframe-picker>summary span,.timeframe-picker>summary i){color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] .page-dashboard .terminal-metrics-strip b{color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] .page-dashboard .terminal-metrics-strip :is(.up,.positive){color:var(--fx-dark-green)!important}
html:root[data-theme="dark"] .page-dashboard .terminal-metrics-strip :is(.down,.negative){color:var(--fx-dark-red)!important}
html:root[data-theme="dark"] .page-dashboard #chartLow{color:var(--fx-dark-red)!important}
html:root[data-theme="dark"] .ai-account-avatar{background:var(--fx-dark-rose)!important;color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] .mobile-app .portfolio-tabs i{background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] :is(.page-home,.page-info) :is(.reference-register-button,.reference-primary-button){background:#ae214b!important;color:#fff!important}
html:root[data-theme="dark"] body:is(.page-home,.page-info) a.reference-register-button,html:root[data-theme="dark"] body.page-info a.reference-primary-button{color:#fff!important}
html:root[data-theme="dark"] :is(.bfx-country-toggle,.bfx-country-menu,.bfx-country-dropdown,.bfx-country-option){background:var(--fx-dark-card)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] :is(.bfx-country-list,.bfx-country-list button,.bfx-country-list [role="option"],.modal-x){background:var(--fx-dark-card)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] .bfx-country-list :is(button,[role="option"]):hover{background:var(--fx-dark-hover)!important}
html:root[data-theme="dark"] .page-info :is(p a,article>div>a:not([class]),article>span){color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] body.page-admin :is(.v37-chip,.crm-lead-code){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin .v37-chip.is-red{background:var(--fx-dark-red-bg)!important;color:var(--fx-dark-red)!important}
html:root[data-theme="dark"] body.page-admin .v37-chip.is-green{background:var(--fx-dark-green-bg)!important;color:var(--fx-dark-green)!important}
html:root[data-theme="dark"] body.page-admin .v37-chip.is-blue{background:#1a3050!important;color:#a8cbff!important}
html:root[data-theme="dark"] body.page-admin .v37-chip.is-amber{background:var(--fx-dark-amber-bg)!important;color:var(--fx-dark-amber)!important}
html:root[data-theme="dark"] body.page-admin :is(.crm-lead-comms,.crm-telegram-thread,.crm-telegram-messages){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(.crm-lead-notes,.admin-trade-edit>summary){background:var(--fx-dark-soft)!important;color:var(--fx-dark-ink)!important;border-color:var(--fx-dark-line)!important}
html:root[data-theme="dark"] body.page-admin :is(.crm-owner-audit-head span,.crm-telegram-thread header span,.crm-telegram-messages>span){color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] body.page-admin :is(.deposit-approve,.withdrawal-approve){background:var(--fx-dark-green-bg)!important;color:var(--fx-dark-green)!important;border-color:#2f6655!important}
html:root[data-theme="dark"] body.page-admin :is(.deposit-reject,.withdrawal-reject){background:var(--fx-dark-red-bg)!important;color:var(--fx-dark-red)!important;border-color:#814658!important}
html:root[data-theme="dark"] body.page-dashboard .terminal-top .terminal-metrics-strip b{color:var(--fx-dark-ink)!important}
html:root[data-theme="dark"] body.page-dashboard .terminal-top .terminal-metrics-strip b[data-equity-value="credit"]{color:var(--fx-dark-accent)!important}
html:root[data-theme="dark"] body.page-dashboard :is(.chart-daily-change,.positions-tabs em,.position-pane .empty i){color:var(--fx-dark-muted)!important}
html:root[data-theme="dark"] body.page-dashboard .positions-tabs em{background:var(--fx-dark-soft)!important}
html:root[data-theme="dark"] body.page-admin .v47-equity .is-pos{color:var(--fx-dark-green)!important}
html:root[data-theme="dark"] body.page-admin .v47-equity .is-neg{color:var(--fx-dark-red)!important}
@media(max-width:700px){body.page-admin .operator-directory-row{min-width:0!important;max-width:100%!important;grid-template-columns:minmax(0,1fr)!important}body.page-admin .operator-directory-row>*{min-width:0;max-width:100%;overflow-wrap:anywhere}body.page-admin .operator-directory-row .operator-manage-button{justify-self:start}}
@media(max-width:700px){body.page-admin .admin-header-actions{flex-wrap:wrap;min-width:0;max-width:100%}body.page-admin .admin-global-search{width:100%;min-width:0}body.page-admin .admin-main{min-width:0}body.page-admin .bfx-contact-control{min-width:0;flex-wrap:wrap}body.page-admin .bfx-contact-form{min-width:0;flex-wrap:wrap}body.page-admin .bfx-contact-form select{max-width:100%;min-width:0}.client-delete-report{padding:14px}}
/* Loading placeholders must match the calendar before its external feed arrives. */
html[data-theme="dark"] .mobile-app .event-skeleton{background:linear-gradient(90deg,var(--fx-dark-card),var(--fx-dark-soft),var(--fx-dark-card));background-size:220% 100%}
html[data-theme="dark"] .mobile-app :is(.event-flag,.impact-dots i:not(.on)){background:var(--fx-dark-soft)!important}
html[data-theme="dark"] .mobile-app :is(.indicator-list label>i,.mobile-risk-toggle label>i){background:#53647e!important}
html[data-theme="dark"] .mobile-app :is(.indicator-list,.mobile-risk-toggle) input:checked+i{background:#bc315b!important}
html[data-theme="dark"] .mobile-app .mobile-volume-stepper{background:var(--fx-dark-card)!important;border-color:var(--fx-dark-line)!important}
html[data-theme="dark"] .mobile-app .order-volume-head{color:var(--fx-dark-muted)!important}
html[data-theme="dark"] .mobile-app [data-order-side-badge]{background:var(--fx-dark-green-bg)!important;color:var(--fx-dark-green)!important}
html[data-theme="dark"] .mobile-app [data-order-side-badge].sell{background:var(--fx-dark-red-bg)!important;color:var(--fx-dark-red)!important}
html[data-theme="dark"] .mobile-app .mobile-place-order{background:#ae214b!important;color:#fff!important}
