.platform-theme-light {
  --ts-light-bg: #f4f7fb;
  --ts-light-panel: #ffffff;
  --ts-light-panel-soft: #f8fafc;
  --ts-light-border: rgba(91, 109, 132, .22);
  --ts-light-border-strong: rgba(71, 85, 105, .34);
  --ts-light-text: #0f172a;
  --ts-light-muted: #475569;
  --ts-light-faint: #64748b;
  color: var(--ts-light-text);
  color-scheme: light;
  background: var(--ts-light-bg);
}

.platform-theme-light :is(
  .topbar,
  .app-rail,
  .rail-workspace,
  .workspace-main,
  .workspace-side,
  .summary-card,
  .chart-shell,
  .ticket-panel,
  .table-panel,
  .event-panel,
  .broker-panel,
  .guardrail-panel,
  .workbench-panel,
  .auth-panel,
  .session-state-card,
  .mobile-workspace-frame,
  .mobile-trade-workspace,
  .mobile-chart-order-popover
) {
  border-color: var(--ts-light-border);
  color: var(--ts-light-text);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 30px rgba(31, 45, 61, .07);
}

.platform-theme-light :is(
  .account-selector summary,
  .account-selector-menu,
  .account-option,
  .chart-tabs,
  .chart-toolbar,
  .instrument-select,
  .timeframe-select,
  .toolbar-actions button,
  .session-strip > button,
  .chart-layout,
  .chart-area,
  .chart-secondary-panel,
  .chart-view-controls,
  .chart-layout-button,
  .chart-tool-button,
  .chart-menu,
  .ticket-symbol-row,
  .ticket-control-row,
  .price-input-row,
  .market-source-note,
  .ticket-account-pill,
  .ticket-action-strip,
  .ticket-compact-control,
  .bracket-settings-panel,
  .bracket-editor,
  .workbench-tabbar,
  .workbench-layout-controls,
  .ticket-tabs button,
  .order-type-tabs button,
  .rail-card,
  .rail-metric-card,
  .session-state-detail,
  .cockpit-metric,
  .account-metric,
  .provisioning-metric,
  .size-preset-row button,
  .stepper button,
  .bracket-summary-button,
  .bracket-unit-toggle button,
  input,
  select,
  textarea
) {
  border-color: var(--ts-light-border);
  color: var(--ts-light-text);
  background: var(--ts-light-panel-soft);
}

.platform-theme-light :is(
  .brand-block,
  .brand-block strong,
  .account-selector summary strong,
  .account-option strong,
  .symbol-cell,
  .panel-heading h2,
  .ticket-symbol-row h2,
  .ticket-account-pill strong,
  .session-state-card h1,
  .auth-form h1,
  .auth-panel-header span,
  .rail-card strong,
  .rail-metric-card strong,
  .cockpit-panel-head h2,
  .cockpit-metric strong,
  .provisioning-metric strong,
  .ticket-execution-notice strong,
  .ticket-grid label,
  .ticket-grid strong
) {
  color: var(--ts-light-text);
}

.platform-theme-light :is(
  .muted,
  .account-selector summary span,
  .account-selector-header,
  .account-option span,
  .ticket-account-pill span,
  .market-source-note,
  .panel-heading span,
  .chart-tabs button,
  .workbench-tabs button,
  .ticket-tabs button,
  .session-state-card p,
  .auth-form p,
  .rail-card span,
  .rail-metric-card span,
  .cockpit-panel-head span,
  .cockpit-metric-label,
  .cockpit-metric small,
  .provisioning-metric span,
  .provisioning-metric em,
  .ticket-execution-notice span,
  .ticket-limit-note,
  small
) {
  color: var(--ts-light-muted);
}

.platform-theme-light .brand-wordmark {
  filter: invert(1) brightness(.42) contrast(1.45);
  opacity: .92;
}

.platform-theme-light .rail-logo img {
  filter: none;
}

.platform-theme-light :is(.rail-button,.rail-avatar) {
  border-color: transparent;
  color: #334155;
  background: transparent;
}

.platform-theme-light :is(
  .chart-tabs button.active,
  .workbench-tabs button.active,
  .ticket-tabs button.active,
  .rail-button.active,
  .rail-button:hover,
  .rail-avatar:hover,
  .chart-tool-button.active,
  .chart-layout-button.active,
  .toolbar-actions button.active,
  .session-strip > button.active
) {
  border-color: var(--ts-light-border-strong);
  color: var(--ts-light-text);
  background: rgba(226, 232, 240, .95);
}

.platform-theme-light :is(.chart-grid-overlay,.chart-empty-state,.loading-skeleton) {
  border-color: rgba(98, 113, 132, .2);
  background: var(--ts-light-panel-soft);
}

.platform-theme-light :is(.cockpit-metric,.account-metric,.provisioning-metric,.rail-card,.rail-metric-card) {
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.platform-theme-light :is(button,input,select,textarea):disabled,
.platform-theme-light :is(.toolbar-actions button:disabled,.ticket-action-button:disabled,.flatten-row button:disabled,.price-input-row button:disabled) {
  border-color: rgba(148, 163, 184, .28);
  color: #64748b;
  background: #e5e7eb;
  opacity: 1;
}

.platform-theme-light :is(.ticket-execution-notice,.ticket-execution-locked,.ticket-execution-routed) {
  border-color: rgba(148, 163, 184, .32);
  background: #eef4ff;
}

.platform-theme-light .ticket-execution-locked {
  border-color: rgba(217, 119, 6, .26);
  background: #fff7ed;
}

.platform-theme-light .ticket-execution-routed {
  border-color: rgba(190, 18, 60, .24);
  background: #fff1f2;
}

.platform-theme-light :is(.account-balance-chip,.account-realized-chip,.account-unrealized-chip,.status-pill,.badge,.market-badge) {
  border-color: var(--ts-light-border);
  color: var(--ts-light-text);
  background: #ffffff;
}

.platform-theme-light :is(.buy-button,.ticket-action-buy) {
  color: #ffffff;
}

.platform-theme-light :is(.sell-button,.ticket-action-sell) {
  color: #ffffff;
}

.platform-theme-light .chart-price-label {
  color: #ffffff;
}

.platform-theme-light :is(.positive,.metric-positive) {
  color: #047857;
}

.platform-theme-light :is(.negative,.metric-negative) {
  color: #be123c;
}

/* Strong final layer: the app bundle stylesheet loads after this public file in some builds. */
.platform-shell.platform-theme-light {
  background: #eef3f8 !important;
  color: var(--ts-light-text) !important;
}

.platform-shell.platform-theme-light :is(
  .platform-content,
  .workspace-grid,
  .workspace-main,
  .workspace-side,
  .rail-workspace,
  .mobile-workspace-frame,
  .mobile-trade-workspace,
  .mobile-more-workspace
) {
  background: #eef3f8 !important;
  color: var(--ts-light-text) !important;
}

.platform-shell.platform-theme-light :is(
  .topbar,
  .app-rail,
  .chart-shell,
  .ticket-panel,
  .workbench-panel,
  .table-panel,
  .event-panel,
  .broker-panel,
  .guardrail-panel,
  .provisioning-panel,
  .auth-panel
) {
  border-color: var(--ts-light-border) !important;
  background: #ffffff !important;
  color: var(--ts-light-text) !important;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08) !important;
}

.platform-shell.platform-theme-light :is(
  .account-selector summary,
  .account-selector-menu,
  .account-option,
  .session-strip > button,
  .account-balance-chip,
  .account-realized-chip,
  .account-unrealized-chip,
  .chart-tabs,
  .chart-tabs button,
  .chart-toolbar,
  .toolbar-actions,
  .toolbar-actions button,
  .layout-profile-control,
  .layout-profile-control button,
  .instrument-select,
  .timeframe-select,
  .chart-layout,
  .chart-area,
  .chart-secondary-panel,
  .chart-view-controls,
  .chart-layout-button,
  .chart-tool-button,
  .chart-menu,
  .ticket-tabs,
  .ticket-tabs button,
  .ticket-symbol-row,
  .ticket-control-row,
  .ticket-instrument-strip,
  .ticket-compact-control,
  .ticket-account-pill,
  .ticket-action-strip,
  .ticket-price-field,
  .price-input-row,
  .price-input-row button,
  .size-preset-row button,
  .stepper button,
  .bracket-settings-panel,
  .bracket-editor,
  .bracket-summary-button,
  .bracket-unit-toggle,
  .bracket-unit-toggle button,
  .workbench-tabbar,
  .workbench-tabs,
  .workbench-tabs button,
  .workbench-layout-controls,
  .workbench-layout-controls button,
  .workbench-mode-chip,
  .rail-card,
  .rail-metric-card,
  .rail-context-bar,
  .rail-context-bar select,
  .rail-context-pill,
  .cockpit-panel,
  .cockpit-metric,
  .account-metric,
  .provisioning-metric,
  input,
  select,
  textarea
) {
  border-color: var(--ts-light-border) !important;
  background: var(--ts-light-panel-soft) !important;
  color: var(--ts-light-text) !important;
}

.platform-shell.platform-theme-light :is(
  .cockpit-metric,
  .account-metric,
  .provisioning-metric,
  .rail-card,
  .rail-metric-card,
  .ticket-account-pill,
  .account-option,
  .dom-row
) {
  background: #ffffff !important;
}

.platform-shell.platform-theme-light :is(
  .brand-block,
  .brand-block strong,
  .account-strip strong,
  .account-selector summary strong,
  .account-option strong,
  .chart-tabs button.active,
  .workbench-tabs button.active,
  .ticket-tabs button.active,
  .panel-heading h2,
  .ticket-symbol-row h2,
  .ticket-account-pill strong,
  .cockpit-panel-head h2,
  .cockpit-metric strong,
  .rail-card strong,
  .rail-metric-card strong,
  .ticket-grid strong,
  .status-pill,
  .badge,
  .market-badge
) {
  color: var(--ts-light-text) !important;
}

.platform-shell.platform-theme-light :is(
  .muted,
  .account-strip span,
  .account-selector summary span,
  .account-option span,
  .chart-tabs button,
  .workbench-tabs button,
  .ticket-tabs button,
  .panel-heading span,
  .ticket-account-pill span,
  .cockpit-panel-head span,
  .cockpit-metric-label,
  .cockpit-metric small,
  .rail-card span,
  .rail-metric-card span,
  .ticket-limit-note,
  small
) {
  color: var(--ts-light-muted) !important;
}

.platform-shell.platform-theme-light .brand-wordmark {
  filter: brightness(0) saturate(100%) !important;
  opacity: .9 !important;
}

.platform-shell.platform-theme-light .rail-logo {
  border: 1px solid rgba(15, 23, 42, .08) !important;
  background: linear-gradient(135deg, #ffffff, #d9fff0) !important;
  box-shadow: inset 0 0 0 1px rgba(45, 211, 143, .2) !important;
}

.platform-shell.platform-theme-light .rail-logo img {
  filter: none !important;
}

.platform-shell.platform-theme-light :is(.rail-button,.rail-avatar) {
  color: #475569 !important;
  background: transparent !important;
}

.platform-shell.platform-theme-light :is(
  .rail-button.active,
  .rail-button:hover,
  .rail-avatar:hover,
  .chart-tabs button.active,
  .workbench-tabs button.active,
  .ticket-tabs button.active,
  .toolbar-actions button.active,
  .chart-layout-button.active,
  .chart-tool-button.active
) {
  border-color: var(--ts-light-border-strong) !important;
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.platform-shell.platform-theme-light :is(
  .ticket-execution-notice,
  .ticket-execution-locked,
  .ticket-execution-routed,
  .market-source-note
) {
  color: #334155 !important;
  background: #eef4ff !important;
}

.platform-shell.platform-theme-light :is(button,input,select,textarea):disabled,
.platform-shell.platform-theme-light :is(
  .toolbar-actions button:disabled,
  .ticket-action-button:disabled,
  .flatten-row button:disabled,
  .price-input-row button:disabled
) {
  border-color: rgba(148, 163, 184, .35) !important;
  background: #e5e7eb !important;
  color: #64748b !important;
  opacity: 1 !important;
}

.platform-shell.platform-theme-light :is(.buy-button,.ticket-action-buy) {
  color: #ffffff !important;
  background: #16a34a !important;
}

.platform-shell.platform-theme-light :is(.sell-button,.ticket-action-sell) {
  color: #ffffff !important;
  background: #dc3f49 !important;
}

.platform-shell.platform-theme-light .chart-price-label {
  color: #ffffff !important;
}

.platform-shell.platform-theme-light :is(
  .chart-pane-content,
  .workbench-body,
  .workbench-body .table-panel,
  .workbench-body .event-panel,
  .workbench-body .broker-panel,
  .workbench-body .guardrail-panel,
  .workbench-body .provisioning-panel
) {
  background: #f8fafc !important;
  color: var(--ts-light-text) !important;
  box-shadow: none !important;
}

.platform-shell.platform-theme-light :is(
  .table-panel,
  .data-table,
  .data-row,
  .event-list,
  .event-row,
  .execution-timeline,
  .execution-item,
  .review-fill-list,
  .review-fill,
  .cockpit-empty,
  .empty-row
) {
  border-color: rgba(100, 116, 139, .18) !important;
  background: #ffffff !important;
  color: var(--ts-light-text) !important;
}

.platform-shell.platform-theme-light :is(.empty-row,.cockpit-empty) {
  border-style: dashed !important;
  color: #64748b !important;
  background: #f8fafc !important;
}

.platform-shell.platform-theme-light :is(.data-row span,.event-row span,.execution-item span,.review-fill span) {
  color: #64748b !important;
}

.platform-shell.platform-theme-light :is(
  .objective-primary,
  .workbench-body .account-summary,
  .workbench-body .account-summary .summary-card,
  .workbench-body .account-summary .summary-card.locked,
  .workbench-body .account-summary .summary-card.active
) {
  border-color: rgba(100, 116, 139, .18) !important;
  background: linear-gradient(135deg, rgba(45, 211, 143, .08), rgba(255, 255, 255, .96) 42%) !important;
  color: var(--ts-light-text) !important;
}

.platform-shell.platform-theme-light :is(.objective-primary strong,.objective-primary span) {
  color: var(--ts-light-text) !important;
}

.platform-shell.platform-theme-light .objective-primary span {
  color: #475569 !important;
}

.platform-shell.platform-theme-light :is(
  .quick-order-actions,
  .quick-action-row,
  .flatten-row
) {
  background: transparent !important;
}

.platform-shell.platform-theme-light .quick-action-button.neutral,
.platform-shell.platform-theme-light .quick-action-button.muted,
.platform-shell.platform-theme-light .flatten-row button {
  border: 1px solid rgba(100, 116, 139, .18) !important;
  color: #334155 !important;
  background: #e5e7eb !important;
}

.platform-shell.platform-theme-light .quick-action-button:disabled,
.platform-shell.platform-theme-light .flatten-row button:disabled {
  color: #94a3b8 !important;
  background: #eef2f7 !important;
}

.platform-shell.platform-theme-light .price-input-row {
  border-color: rgba(100, 116, 139, .28) !important;
  background: #ffffff !important;
}

.platform-shell.platform-theme-light .price-input-row button {
  color: #334155 !important;
  background: #e5e7eb !important;
}

.platform-shell.platform-theme-light .price-input-row input {
  color: var(--ts-light-text) !important;
  background: transparent !important;
}

.platform-shell.platform-theme-light .market-strip strong {
  color: #0f172a !important;
}

.platform-shell.platform-theme-light :is(.market-strip-pending,.market-strip-test,.market-strip-simulated) {
  color: #475569 !important;
}

.platform-shell.platform-theme-light :is(.ticket-action-button.buy,.quick-action-button.buy) {
  color: #ffffff !important;
  background: #16a34a !important;
}

.platform-shell.platform-theme-light :is(.ticket-action-button.sell,.quick-action-button.sell) {
  color: #ffffff !important;
  background: #dc3f49 !important;
}

.platform-shell.platform-theme-light .panel-title-row {
  color: var(--ts-light-text) !important;
}

.platform-shell.platform-theme-light .panel-title-row span {
  color: #64748b !important;
}
