/* SharkRule application light palette. Loaded after each screen's component CSS.
   Only presentation changes: existing forms, visibility and trading state stay intact. */
html[data-theme="light"] {
  color-scheme: light;
  --ink: var(--sr-text); --muted: var(--sr-muted); --blue: var(--sr-link);
  --blue-hover: #004b9b; --button: #0066cc; --button-hover: #0055ad;
  --line: var(--sr-border); --paper: var(--sr-surface); --soft: var(--sr-soft);
  --field: var(--sr-field); --field-line: #8a9bb0;
  --green: #176b48; --amber: #805207; --error: #ad303d;
  --onboarding-blue: var(--sr-link); --onboarding-muted: var(--sr-muted);
  --onboarding-border: var(--sr-border);
}
html[data-theme="light"] body { background: var(--sr-bg); color: var(--sr-text); }
html[data-theme="light"] :is(.exchange-auth, .consumer-declaration) {
  background: radial-gradient(ellipse at 50% 12%, #e5effc, transparent 50%), var(--sr-bg);
}
html[data-theme="light"] :is(.account-settings, .exchange-settings) {
  --settings-line: var(--sr-border); --settings-muted: var(--sr-muted); color: var(--sr-text);
}
html[data-theme="light"] .shark-builder {
  --builder-muted: var(--sr-muted); --builder-line: var(--sr-border); --builder-accent: #4b55a2;
}
html[data-theme="light"] .exchange-balance { --balance-border: var(--sr-border); }
html[data-theme="light"] .ops-shell {
  --ops-border: var(--sr-border); --ops-muted: var(--sr-muted); --ops-blue: var(--sr-link); color: var(--sr-text);
}
html[data-theme="light"] .marketplace-choices { --market-border: var(--sr-border); --market-muted: var(--sr-muted); }

/* Shared navigation, footer, controls and statuses. */
html[data-theme="light"] :is(.exchange-workspace-nav a:hover, .exchange-workspace-nav a[aria-current="page"],
 .exchange-run-link:hover, .dashboard-nav .mobile-menu a[aria-current="page"],
 .dashboard-nav button.sr-lang-option:hover, .dashboard-nav button.sr-lang-option.active,
 .dashboard-nav .dashboard-signout button:hover) { background: var(--sr-soft); color: var(--sr-link); }
html[data-theme="light"] :is(.dashboard-nav a[aria-current="page"], .dashboard-footer-brand,
 .dashboard-footer-brand:hover, .dashboard-footer .sr-company-identity strong) { color: var(--sr-text); }
html[data-theme="light"] :is(.dashboard-nav .dashboard-signout, .exchange-footer.dashboard-footer,
 .exchange-auth .exchange-footer) { border-color: var(--sr-border); }
html[data-theme="light"] :is(.dashboard-nav .dashboard-signout button, .dashboard-footer,
 .dashboard-footer-bottom .dashboard-footer-disclosure, .dashboard-footer-bottom .sr-company-identity,
 .dashboard-footer .exchange-legal-links a, .exchange-auth .exchange-legal-links a) { color: var(--sr-muted); }
html[data-theme="light"] .dashboard-footer .exchange-legal-links a:hover { color: var(--sr-link); }
html[data-theme="light"] .dashboard-footer-brand svg rect { fill: var(--sr-soft); }
html[data-theme="light"] :is(.exchange-button-secondary:hover, .exchange-auth .exchange-button-secondary:hover) {
  background: var(--sr-soft); border-color: #8a9bb0; color: var(--sr-link);
}
html[data-theme="light"] :is(.exchange-button:disabled, .exchange-auth button:disabled,
 .exchange-button[aria-disabled="true"], .exchange-field input:disabled, .exchange-field select:disabled,
 .exchange-field textarea:disabled, .exchange-auth input:disabled) {
  background: #e7ecf2; border-color: var(--sr-border); color: #657386;
}
html[data-theme="light"] :is(.exchange-status, .exchange-simple-list, .exchange-checkbox,
 .exchange-recipe-preview li, .exchange-event-list p) { color: var(--sr-text); }
html[data-theme="light"] .exchange-status-good { color: var(--green); }
html[data-theme="light"] :is(.exchange-notice, .operations-announcement) {
  background: #edf5ff; color: #244b76; border-color: #accaea;
}
html[data-theme="light"] .operations-announcement :is(svg, p) { color: #244b76; }
html[data-theme="light"] .exchange-notice-warning { background: #fff7e7; color: #805207; border-color: #d8b575; }
html[data-theme="light"] .exchange-notice[role="alert"] { background: #fff0f1; color: #ad303d; border-color: #e0a0a7; }
html[data-theme="light"] .exchange-status-panel-good { background: #edf8f1; border-color: #a3cbb3; }
html[data-theme="light"] :is(.exchange-step, .exchange-tag) { color: var(--sr-link); background: #e6f1ff; }
html[data-theme="light"] :is(.venue-danger-button, .venue-danger-button:hover) { color: #fff; background: #ad303d; }

/* Workspace surfaces preserve each Shark's identity without a dark card. */
html[data-theme="light"] :is(.workspace-tabs, .workspace-mode-options, .builder-tabs,
 .workspace-card-actions, .workspace-card-bottom, .workspace-card-note, .workspace-card-experience,
 .workspace-market-footer, .account-email-rows) { background: var(--sr-soft); border-color: var(--sr-border); }
html[data-theme="light"] :is(.workspace-editor-panel, .workspace-exchange-panel,
 .workspace-simulation-overview, .workspace-paper-history, .workspace-empty,
 .shark-identity-panel, .builder-panel, .builder-ai-panel, .exchange-settings-sheet,
 .account-settings-content, .onboarding-auth-card, .onboarding-welcome-layout,
 .ops-panel, .ops-table-wrap, .story-timeline, .story-event, .story-empty,
 .rehearsal-plan, .rehearsal-stage, .rehearsal-rules, .rehearsal-events,
 .market-choice-comparison, .market-reference, .studio-editor, .studio-ai,
 .tester-invite-list, .futures-setup .exchange-card) {
  color: var(--sr-text); background: var(--sr-surface); border-color: var(--sr-border);
  box-shadow: 0 8px 30px #243b5810;
}
html[data-theme="light"] :is(.shark-briefing, .exchange-balance, .ops-stat, .studio-intro,
 .shark-plain-rules, .onboarding-plan-strip, .onboarding-upgrade-hint, .tester-welcome-preview) {
  background: linear-gradient(135deg, #eaf3ff, var(--sr-surface) 72%);
  color: var(--sr-text); border-color: var(--sr-border); box-shadow: none;
}
html[data-theme="light"] :is(.workspace-shark, .workspace-toolbar, .workspace-state,
 .workspace-card-meta, .workspace-card-actions, .workspace-rule-preview,
 .workspace-rule-preview>div+div, .workspace-editor-intro, .workspace-advanced,
 .workspace-review-steps li, .workspace-exchange-links, .workspace-simulation-performance,
 .workspace-simulation-metrics>div, .workspace-paper-history>header,
 .workspace-paper-trades>li+li, .workspace-more-content>form,
 .workspace-more-content>div:not(.workspace-more-links), .shark-result-breakdown,
 .shark-result-breakdown>div, .briefing-result, .briefing-service-item+.briefing-service-item,
 .shark-identity-preview, .shark-rule-risk, .journey-real-choice, .journey-help,
 .onboarding-guided, .onboarding-social) { border-color: var(--sr-border); }
html[data-theme="light"] :is(.workspace-heading p, .workspace-heading .exchange-eyebrow,
 .workspace-exchange-status, .workspace-exchange-status>span:last-child, .workspace-description,
 .workspace-pnl>span, .workspace-draft-preview>span, .workspace-pnl small,
 .workspace-draft-preview small, .workspace-draft-preview p, .workspace-pnl-chart figcaption,
 .workspace-chart-empty p, .workspace-pnl-note, .workspace-card-meta, .workspace-card-bottom,
 .workspace-card-note, .workspace-footnote p, .workspace-disclosure, .workspace-refresh,
 .workspace-empty>p, .workspace-empty .workspace-small, .workspace-market-note,
 .workspace-market-number, .workspace-small, .workspace-market-footer>span,
 .workspace-editor-intro p, .workspace-editor-note, .workspace-exchange-panel>p,
 .workspace-mode-options small, .workspace-mode-explainer, .workspace-paper-return,
 .workspace-simulation-metrics dt, .workspace-simulation-metrics small,
 .workspace-paper-trades time, .workspace-paper-trades dt, .workspace-paper-empty span,
 .workspace-go-live p, .workspace-control-note, .workspace-more-content p,
 .workspace-approved-budgets, .workspace-view-filters span,
 .shark-result-breakdown dt, .shark-result-breakdown dt small, .shark-result-breakdown dd small) { color: var(--sr-muted); }
html[data-theme="light"] :is(.workspace-pnl strong, .workspace-draft-preview strong,
 .workspace-rule-preview dd, .workspace-review-steps li, .workspace-review-steps strong,
 .workspace-simulation-metrics dd, .workspace-paper-trades strong,
 .workspace-paper-trades dd, .workspace-paper-empty p, .workspace-approved-budgets strong,
 .shark-result-breakdown dd, .workspace-exchange-status:hover, .workspace-advanced summary,
 .workspace-mode-picker legend, .workspace-more-controls, .workspace-personal-purpose) { color: var(--sr-text); }
html[data-theme="light"] :is(.workspace-tabs a, .workspace-secondary,
 .workspace-view-filters a, .workspace-mode-options label>span, .builder-tabs button) {
  background: var(--sr-surface); color: var(--sr-muted); border-color: var(--sr-border);
}
html[data-theme="light"] :is(.workspace-tabs a[aria-current="page"],
 .workspace-view-filters a[aria-current="page"], .workspace-view-filters a:hover,
 .workspace-mode-options input:checked+span, .builder-tabs button[aria-selected="true"],
 .builder-tabs button:hover, .workspace-secondary:hover) {
  background: #e4f0ff; color: #195a9b; border-color: #8cb6e1; box-shadow: none;
}
html[data-theme="light"] .workspace-mode-options input[value="real"]:checked+span {
  background: #fff6e7; color: #765019; border-color: #cbaa73;
}
html[data-theme="light"] .workspace-mode-options label:hover>span { background: #e7eef7; }
html[data-theme="light"] .workspace-primary { background: #e4f0ff; color: #135a9f; border-color: #9abce0; }
html[data-theme="light"] .workspace-primary:hover { background: #d8eaff; color: #10477d; }
html[data-theme="light"] :is(.workspace-card-bottom a, .workspace-card-bottom button,
 .workspace-exchange-links a, .workspace-more-links a, .workspace-more-links button,
 .workspace-card-experience a, .workspace-review-steps li>span, .workspace-market-added,
 .shark-experience-links a, .shark-experience-links [data-shark-settings-personalize]) { color: var(--sr-link); }
html[data-theme="light"] :is(.workspace-card-bottom a:hover, .workspace-card-bottom button:hover,
 .workspace-card-experience a:hover, .shark-experience-links a:hover,
 .shark-experience-links [data-shark-settings-personalize]:hover) { color: #004b9b; }
html[data-theme="light"] :is(.workspace-card-bottom .workspace-delete, .workspace-more-links .workspace-delete) { color: #ad303d; }
html[data-theme="light"] .workspace-danger { color: #ad303d !important; background: #fff0f1 !important; border-color: #e0a0a7 !important; }
html[data-theme="light"] :is(.workspace-mode-badge, .workspace-go-live) { color: #805207; background: #fff7e7; border-color: #d8b575; }
html[data-theme="light"] .workspace-mode-badge.is-simulation { color: #48518f; background: #edf0ff; border-color: #bac3e5; }
html[data-theme="light"] .workspace-state { background: var(--sr-soft); color: var(--sr-muted); }
html[data-theme="light"] .workspace-state.is-running { color: #176b48; background: #edf8f1; border-color: #a3cbb3; }
html[data-theme="light"] .workspace-dot.is-connected { background: #176b48; box-shadow: none; }
html[data-theme="light"] .workspace-state.is-running .workspace-dot { background: #176b48; }
html[data-theme="light"] .workspace-state.is-inactive .workspace-dot { background: #ad303d; }
html[data-theme="light"] :is(.workspace-pnl.tone-positive strong, .workspace-pnl-chart.tone-positive) { color: #176b48; }
html[data-theme="light"] :is(.workspace-pnl.tone-negative strong, .workspace-pnl-chart.tone-negative) { color: #ad303d; }
html[data-theme="light"] .workspace-chart-grid { stroke: #cfdae7; }
html[data-theme="light"] .workspace-trade-side { background: #f1ecfc; color: #65449b; }
html[data-theme="light"] .workspace-trade-side.is-buy { background: #e7f2ff; color: #195a9b; }

/* Briefing, identity and plain-language explanations. */
html[data-theme="light"] :is(.briefing-period, .briefing-period span, .briefing-counts,
 .briefing-result p, .briefing-result small, .briefing-result>span, .briefing-note,
 .briefing-recorded, .briefing-updates a>span>span, .shark-status-details,
 .shark-identity-preview p, .shark-identity-editor .exchange-field label small,
 .shark-identity-scope, .shark-personal-summary p>span,
 .shark-plain-rules dd, .shark-rule-risk, .journey-intro-steps,
 .journey-real-choice p, .journey-help dd) { color: var(--sr-muted); }
html[data-theme="light"] :is(.briefing-counts strong, .briefing-updates strong,
 .shark-identity-preview h2, .shark-identity-icons legend, .shark-plain-rules h2,
 .shark-rule-risk strong, .journey-real-choice strong, .journey-help dt) { color: var(--sr-text); }
html[data-theme="light"] :is(.briefing-heading .exchange-eyebrow,
 .briefing-updates a, .briefing-updates small, .briefing-recorded-details>summary,
 .shark-status-details summary, .workspace-run-status>form>button,
 .shark-identity-preview>div>span, .shark-plain-rules dt, .journey-real-choice a,
 .journey-help summary, .journey-help summary::marker) { color: var(--sr-link); }
html[data-theme="light"] :is(.briefing-updates a, .shark-identity-icons label>span) {
  background: var(--sr-surface); color: var(--sr-muted); border-color: var(--sr-border);
}
html[data-theme="light"] :is(.briefing-updates a:hover, .shark-identity-icons input:checked+span) {
  background: #e6f1ff; color: #195a9b; border-color: #8cb6e1; box-shadow: none;
}
html[data-theme="light"] :is(.briefing-attention, .briefing-service, .workspace-run-status.is-service) {
  background: #fff7e7; border-color: #d8b575; color: #805207;
}
html[data-theme="light"] :is(.briefing-attention strong, .briefing-attention p,
 .briefing-attention a, .briefing-attention button, .briefing-service h3,
 .briefing-service-item>strong, .briefing-service-item>p, .workspace-run-status.is-service>strong) { color: #805207; }
html[data-theme="light"] .shark-personal-summary { background: #edf5ff; }
html[data-theme="light"] .shark-personal-summary p { color: #244b76 !important; }
html[data-theme="light"] .journey-intro-steps li::before { background: #e6f1ff; color: var(--sr-link); }

/* Rule editor and AI drafting: all inputs retain native states and validation. */
html[data-theme="light"] :is(.builder-heading p, .builder-heading .exchange-eyebrow,
 .shark-builder .exchange-input-unit>span, .shark-builder .exchange-hint,
 .builder-entry-options small, .builder-budget p, .builder-budget strong>span,
 .builder-mode-copy, .builder-note, .builder-how p, .builder-footer-note,
 .builder-ai-disclosure, .builder-ai-unavailable p+p, .builder-idea-card dt,
 .builder-condition legend, .builder-remove-condition, .builder-fields label>small,
 .shark-builder .builder-ai-field-help, .shark-builder .builder-ai-details-help,
 .builder-sentiment summary>span) { color: var(--sr-muted); }
html[data-theme="light"] :is(.shark-builder .exchange-field label, .builder-entry-options strong,
 .builder-budget>div>span, .builder-budget strong, .builder-how summary,
 .builder-sentiment-option, .builder-ai-unavailable p, .builder-idea-card dd,
 .builder-idea-explanation, .builder-step-heading h2, .builder-rule-summary h2,
 .builder-rule-summary p, .builder-rule-summary li, .builder-rule-summary .builder-summary-match,
 .shark-builder .builder-ai-followup legend, .shark-builder .builder-ai-consent label,
 .shark-builder .builder-draft-original summary, .shark-builder .builder-draft-original p,
 .shark-builder .builder-draft-budget, .shark-builder .builder-draft-review-note,
 .shark-builder .builder-draft-recap) { color: var(--sr-text); }
html[data-theme="light"] :is(.builder-tabs button>span, .builder-section-number,
 .builder-ai-panel .builder-section-number, .builder-option-icon, .builder-idea-kind) { color: #55518c; }
html[data-theme="light"] :is(.builder-section-number, .builder-entry-options label>span,
 .builder-condition, .builder-idea-card) { background: #f4f4fb; border-color: #cfd2e5; }
html[data-theme="light"] .builder-entry-options input:checked+span {
  background: #edf0ff; border-color: #909fce; box-shadow: none;
}
html[data-theme="light"] :is(.builder-entry-options input:checked+span strong,
 .builder-entry-options input:checked+span .builder-option-icon) { color: #414d8a; }
html[data-theme="light"] :is(.shark-builder .exchange-field input,
 .shark-builder .exchange-field select, .shark-builder .exchange-field textarea,
 .exchange-settings-credentials .exchange-field input, .account-settings-control select,
 .onboarding-auth-card input:not([type="checkbox"]):not([type="hidden"]),
 .ops-form input:not([type="hidden"]):not([type="checkbox"]), .ops-form textarea,
 .ops-subscription-case input, .ops-subscription-case select, .ops-subscription-case textarea,
 .ops-interest-filters input, .ops-interest-filters select, .ops-search input,
 .studio-fields select, .studio-type select, .studio-editor select, .studio-ai select,
 .studio-editor .ops-form input:not([type="hidden"]):not([type="checkbox"]),
 .studio-ai .ops-form input:not([type="hidden"]):not([type="checkbox"]),
 .studio-editor .ops-form textarea, .studio-ai .ops-form textarea, .tester-invite-form select) {
  background-color: var(--sr-field); color: var(--sr-text); border-color: #8a9bb0; box-shadow: none;
}
html[data-theme="light"] :is(.shark-builder .builder-editable-draft input[readonly],
 .studio-editor .ops-form input[readonly]) { background: var(--sr-soft); color: var(--sr-muted); }
html[data-theme="light"] :is(.builder-actions .exchange-button-secondary,
 .builder-idea-card .exchange-button, .builder-starters button) {
  background: #edf5ff; color: var(--sr-link); border-color: #accaea;
}
html[data-theme="light"] :is(.builder-step-heading>span, .builder-section-shark,
 .builder-rule-summary, .shark-builder .builder-ai-followup, .builder-ai-quote-confirmation) {
  background: #edf5ff; color: #244b76; border-color: #accaea;
}
html[data-theme="light"] :is(.builder-ai-status, .shark-builder .builder-ai-status) { color: #244b76; }
html[data-theme="light"] :is(.builder-ai-status[data-error="true"],
 .shark-builder .builder-ai-status[data-error="true"], .builder-sentiment-error,
 .shark-identity-error) { color: #ad303d; }
html[data-theme="light"] :is(.builder-copy-note, .workspace-data-stale) { background: #fff7e7; color: #805207; border-color: #d8b575; }
html[data-theme="light"] :is(.shark-builder .builder-ai-consent, .shark-builder .builder-draft-original) { border-color: var(--sr-border); }

/* Exchange credentials, balances, account settings and authentication. */
html[data-theme="light"] :is(.exchange-settings-logo, .exchange-balance-logo,
 .coinbase-balance .coinbase-balance-asset) { background: var(--sr-soft); border-color: var(--sr-border); }
html[data-theme="light"] :is(.exchange-settings-state, .exchange-settings-footnote,
 .exchange-settings-wallet .exchange-balance-venue, .exchange-settings-wallet .exchange-balance-status,
 .exchange-settings-wallet .exchange-balance-checked, .exchange-settings-wallet .exchange-balance-note,
 .exchange-settings-wallet .exchange-balance-breakdown dt, .exchange-settings-credentials .exchange-hint,
 .exchange-settings-credentials .exchange-settings-key-note, .exchange-balance-venue,
 .exchange-balance-amount>span, .exchange-balance-status, .exchange-balance-checked,
 .exchange-balance-note, .exchange-balance-breakdown dt, .exchange-balance-breakdown small,
 .coinbase-balance .coinbase-balance-currency, .account-email-group-count,
 .account-essential-email p, .onboarding-ocean p, .onboarding-illustration-label,
 .onboarding-rule-summary p, .onboarding-reassurance, .onboarding-welcome-note,
 .onboarding-plan-strip>div, .onboarding-upgrade-hint p, .exchange-auth .login-card>p,
 .onboarding-auth-card p, .onboarding-divider, .onboarding-auth-links,
 .onboarding-free-facts, .onboarding-choice-reassurance, .onboarding-choice-reassurance p+p,
 .onboarding-guided-intro, .onboarding-capacity-notice p) { color: var(--sr-muted); }
html[data-theme="light"] :is(.exchange-settings-funding h3 a, .exchange-settings-wallet .exchange-balance-amount strong,
 .exchange-settings-wallet .exchange-balance-breakdown dd, .exchange-settings-steps>li>strong,
 .exchange-settings-credentials .exchange-field label, .exchange-balance-heading h2,
 .exchange-balance-amount strong, .exchange-balance-breakdown dd,
 .exchange-balance[data-balance-state="stale"] .exchange-balance-amount strong,
 .account-section-heading h2, .account-settings-copy h3, .account-settings-copy>strong,
 .account-settings-copy>label, .account-settings-copy .account-profile-email,
 .account-email-group-copy strong, .account-essential-email strong, .onboarding-rule-picker strong,
 .onboarding-rule-summary strong, .onboarding-choices .onboarding-choice h2) { color: var(--sr-text); }
html[data-theme="light"] :is(.exchange-settings-text-link, .exchange-settings-links a,
 .exchange-settings-back, .exchange-settings-details>summary,
 .exchange-settings-details>summary::after, .exchange-settings-disconnect summary,
 .exchange-settings-key-note svg, .exchange-balance-connect, .account-settings-nav a,
 .onboarding-nav-link, .onboarding-custom-link a, .onboarding-text-link,
 .onboarding-plan-strip>a, .onboarding-auth-links a, .onboarding-alternate a,
 .onboarding-choice-action, .onboarding-guided>summary, .onboarding-guided>summary>span,
 .onboarding-capacity-notice a) { color: var(--sr-link); }
html[data-theme="light"] :is(.exchange-settings-text-link:hover, .exchange-settings-links a:hover,
 .exchange-settings-back:hover, .exchange-balance-connect:hover, .onboarding-guided>summary:hover) { color: #004b9b; }
html[data-theme="light"] :is(.exchange-settings-credentials, .exchange-balance--compact,
 .onboarding-rule-summary, .onboarding-capacity-notice) { background: #edf5ff; border-color: #accaea; }
html[data-theme="light"] .exchange-settings-steps .exchange-copy-value { background: var(--sr-field); border-color: var(--sr-border); color: var(--sr-text); }
html[data-theme="light"] :is(.exchange-settings .exchange-button-secondary,
 .exchange-balance-refresh, .account-settings .exchange-button-secondary,
 .account-browser-icon, .exchange-settings-steps>li::before) {
  background: #edf5ff; color: var(--sr-link); border-color: #accaea;
}
html[data-theme="light"] :is(.exchange-settings .exchange-button-secondary:hover,
 .exchange-balance-refresh:hover, .account-settings-control .exchange-button-secondary:hover,
 .account-settings-nav a:hover, .account-settings-nav a:focus-visible,
 .account-session-filters a[aria-current="page"], .account-session-filters a:hover) {
  background: #dfedfd; color: #195a9b; border-color: #8cb6e1;
}
html[data-theme="light"] :is(.exchange-balance-note, .exchange-balance-breakdown,
 .account-settings-row+.account-settings-row, .account-email-group,
 .account-session-list li+li) { border-color: var(--sr-border); }
html[data-theme="light"] .account-session-filters span { background: #e1e8f1; }
html[data-theme="light"] .account-email-group>summary::after { border-color: #536277; }
html[data-theme="light"] :is(.exchange-settings-state.is-connected,
 .exchange-balance[data-balance-state="ready"] .exchange-balance-status) { color: #176b48; }
html[data-theme="light"] :is(.exchange-settings-state.is-connected>span,
 .exchange-balance[data-balance-state="ready"] .exchange-balance-dot) { background: #176b48; }
html[data-theme="light"] :is(.exchange-settings-state.needs-attention,
 .exchange-settings-attention, .exchange-balance[data-balance-state="stale"] .exchange-balance-status,
 .exchange-balance[data-balance-state="unavailable"] .exchange-balance-status) { color: #805207; }
html[data-theme="light"] :is(.exchange-settings-state.needs-attention>span,
 .exchange-balance[data-balance-state="stale"] .exchange-balance-dot,
 .exchange-balance[data-balance-state="unavailable"] .exchange-balance-dot) { background: #805207; }
html[data-theme="light"] .onboarding-ocean { background: radial-gradient(ellipse at 45% 35%, #d8eaff, #eef5ff 70%); }
html[data-theme="light"] :is(.onboarding-ocean-orbit, .onboarding-ocean-orbit::before,
 .onboarding-ocean-orbit::after) { border-color: #b6d0eb; }
html[data-theme="light"] :is(.onboarding-nav-upgrade, .onboarding-plan-badge,
 .onboarding-mode-pill, .onboarding-step, .onboarding-auth-mark .shark-avatar,
 .onboarding-shark-float .shark-avatar, .onboarding-choice-icon) {
  background: #e6f1ff; color: var(--sr-link); border-color: #accaea; box-shadow: none;
}
html[data-theme="light"] .onboarding-nav-upgrade:hover { background: #d8eaff; }
html[data-theme="light"] :is(.onboarding-rule-picker>label, .onboarding-choices .onboarding-choice) {
  background: var(--sr-surface); border-color: var(--sr-border); color: var(--sr-text); box-shadow: none;
}
html[data-theme="light"] :is(.onboarding-rule-picker>label:has(input:checked), .onboarding-choices .onboarding-choice:hover) {
  background: #edf5ff; border-color: #8cb6e1; box-shadow: 0 8px 28px #243b5810;
}
html[data-theme="light"] .onboarding-choices .onboarding-choice p { color: var(--sr-muted); }
html[data-theme="light"] :is(.onboarding-choice-action, .onboarding-choice-action>span) { border-color: var(--sr-border); }
html[data-theme="light"] :is(.onboarding-social-buttons a, .onboarding-social a,
 .onboarding-social button, .onboarding-social .exchange-button) {
  background: var(--sr-surface); border-color: #8a9bb0; color: var(--sr-text);
}
html[data-theme="light"] .onboarding-divider::before,
html[data-theme="light"] .onboarding-divider::after { background: var(--sr-border); }
html[data-theme="light"] .onboarding-auth-card .errorlist { background: #fff0f1; color: #ad303d; border-color: #e0a0a7; }
html[data-theme="light"] :is(.exchange-auth .onboarding-password-toggle,
 .exchange-auth .onboarding-password-toggle:hover) { color: var(--sr-link); }
html[data-theme="light"] .onboarding-free-facts span::before { color: #176b48; }
@media (max-width: 800px) {
  html[data-theme="light"] .account-settings-nav { background: #f5f7fbf2; }
  html[data-theme="light"] .account-settings-nav a { background: var(--sr-surface); border-color: var(--sr-border); }
}

/* Public pricing shares the same cards as signed-in billing. */
html[data-theme="light"] :is(.pricing-launch-note, .pricing-account-summary, .subscription-details) {
  background: linear-gradient(125deg, #edf5ff, var(--sr-surface) 72%); border-color: var(--sr-border);
}
html[data-theme="light"] .pricing-card {
  --plan-accent: #1766ad; --plan-wash: #e6f1ff;
  background: radial-gradient(ellipse at 0 0, var(--plan-wash), transparent 65%), var(--sr-surface);
  border-color: var(--sr-border); color: var(--sr-text);
}
html[data-theme="light"] .pricing-free { --plan-accent: #176b48; --plan-wash: #e8f6ed; border-color: #a3cbb3; }
html[data-theme="light"] .pricing-pro { --plan-accent: #285fbc; --plan-wash: #e9f1ff; }
html[data-theme="light"] .pricing-premium { --plan-accent: #5550a0; --plan-wash: #efedfb; }
html[data-theme="light"] :is(.pricing-launch-note p, .pricing-interest-help, .pricing-notes p,
 .pricing-availability, .subscription-details .subscription-intro, .subscription-facts dt,
 .subscription-facts dd small, .subscription-details .subscription-answer p,
 .subscription-details .subscription-renewal, .subscription-risk, .subscription-toggle) { color: var(--sr-muted); }
html[data-theme="light"] :is(.pricing-interest-email, .subscription-details h2,
 .subscription-tools li, .subscription-facts dd, .subscription-disclosures summary) { color: var(--sr-text); }
html[data-theme="light"] :is(.pricing-heading .exchange-eyebrow, .subscription-details .subscription-eyebrow,
 .pricing-interest-withdraw button, .subscription-disclosures summary:hover,
 .subscription-disclosures details[open] summary) { color: var(--sr-link); }
html[data-theme="light"] .pricing-interest-withdraw button:hover { color: #004b9b; }
html[data-theme="light"] .pricing-interest-saved { background: #edf8f1; border-color: #a3cbb3; }
html[data-theme="light"] :is(.pricing-interest-saved strong, .pricing-heading>.pricing-saving,
 .subscription-tools li::before) { color: #176b48; }
html[data-theme="light"] .pricing-badge { color: #176b48; border-color: #a3cbb3; background: #edf8f1; }
html[data-theme="light"] .pricing-billing-grid .pricing-badge { color: #195a9b; border-color: #accaea; background: #edf5ff; }
html[data-theme="light"] :is(.pricing-billing-grid .pricing-current, .pricing-billing-grid .pricing-selected) { border-color: #679cce; }
html[data-theme="light"] .pricing-period button[aria-pressed="true"] { background: #e0ecfa; }
html[data-theme="light"] :is(.pricing-availability, .pricing-features, .pricing-explanation,
 .pricing-shared, .subscription-facts, .subscription-facts>div,
 .subscription-disclosures details, .subscription-facts>div:nth-child(n+3)) { border-color: var(--sr-border); }
html[data-theme="light"] .subscription-mark { background: #e6f1ff; border-color: #accaea; color: var(--sr-link); }

/* Live, simulated and historical charts keep semantic buys/sells and readable axes. */
html[data-theme="light"] .shark-live-chart {
  --chart-blue: #176ac6; --chart-green: #176b48; --chart-red: #ad303d;
  background: var(--sr-surface); border-color: var(--sr-border); color: var(--sr-text); box-shadow: 0 8px 30px #243b5810;
}
html[data-theme="light"] :is(.shark-chart-eyebrow, .shark-chart-value span,
 .shark-chart-observed, .shark-chart-feed, .shark-chart-feed-state,
 .shark-chart-caption, .shark-chart-level-title, .shark-chart-level small,
 .shark-chart-levels>p, .shark-chart-footnote p, .shark-chart-legend,
 .shark-chart-noscript, .shark-chart-tooltip small) { color: var(--sr-muted); }
html[data-theme="light"] :is(.shark-chart-mode, .shark-chart-icon, .shark-chart-switch,
 .shark-chart-zoom, .shark-chart-level) { background: var(--sr-soft); border-color: var(--sr-border); color: var(--sr-text); }
html[data-theme="light"] .shark-chart-symbol-label select { background: var(--sr-field); border-color: #8a9bb0; color: var(--sr-text); }
html[data-theme="light"] :is(.shark-chart-switch button, .shark-chart-ranges button, .shark-chart-zoom button) { color: var(--sr-muted); }
html[data-theme="light"] :is(.shark-chart-switch button[aria-pressed="true"],
 .shark-chart-ranges button[aria-pressed="true"], .shark-chart-icon:hover,
 .shark-chart-zoom button:hover) { background: #dfeeff; color: #195a9b; }
html[data-theme="light"] :is(.shark-chart-ranges button:hover, .shark-chart-level p) { color: var(--sr-link); }
html[data-theme="light"] .shark-chart-svg text { fill: var(--sr-muted); }
html[data-theme="light"] .shark-chart-svg .shark-chart-level-label { fill: #344e6c; }
html[data-theme="light"] .shark-chart-grid-line { stroke: #d7e1ed; }
html[data-theme="light"] .shark-chart-line { stroke: #176ac6; }
html[data-theme="light"] .shark-chart-head { fill: #176ac6; stroke: #d4e8ff; }
html[data-theme="light"] .shark-chart-level-line { stroke: #57748f; }
html[data-theme="light"] .shark-chart-trade circle { stroke: var(--sr-surface); }
html[data-theme="light"] .shark-chart-trade path { stroke: var(--sr-surface); }
html[data-theme="light"] :is(.shark-chart-trade:focus circle, .shark-chart-trade:hover circle) { stroke: #172333; }
html[data-theme="light"] .shark-chart-svg [data-chart-crosshair] path { stroke: #607f9d; }
html[data-theme="light"] .shark-chart-svg [data-chart-crosshair] circle { fill: var(--sr-surface); stroke: #176ac6; }
html[data-theme="light"] .shark-chart-empty { background: #f5f7fbeb; color: var(--sr-muted); }
html[data-theme="light"] .shark-chart-tooltip { background: #fffffff7; color: var(--sr-text); border-color: #9eb5cd; box-shadow: 0 8px 30px #243b5828; }
html[data-theme="light"] .shark-chart-loading { border-color: #c2d7ee; border-top-color: #176ac6; }
html[data-theme="light"] .shark-chart-footnote { border-color: var(--sr-border); }
html[data-theme="light"] .shark-chart-dialog { background: var(--sr-bg); color: var(--sr-text); }
html[data-theme="light"] .shark-chart-dialog .shark-chart-header { background: var(--sr-surface); border-color: var(--sr-border); }
html[data-theme="light"] .shark-chart-dialog::backdrop { background: #17233399; }
html[data-theme="light"] .shark-chart-feed-state[data-state="fresh"] { color: #176b48; }
html[data-theme="light"] .shark-chart-feed-state[data-state="fresh"]::before { background: #176b48; }
html[data-theme="light"] .shark-chart-feed-state[data-state="stale"] { color: #805207; }
html[data-theme="light"] .rehearsal-shell { color: var(--sr-text); }
html[data-theme="light"] :is(.story-heading p, .story-timeline header span,
 .story-timeline>p, .story-small, .story-chart figcaption, .story-chart-dates,
 .story-event-list time, .story-event>summary time, .story-steps p,
 .story-steps .story-small, .story-facts dt, .story-empty p,
 .rehearsal-heading p, .rehearsal-name p, .rehearsal-plan dt, .rehearsal-metrics dt,
 .rehearsal-plan small, .rehearsal-metrics small, .rehearsal-note, .rehearsal-price span,
 .rehearsal-scrubber label, .rehearsal-scrubber p, .rehearsal-rules dd,
 .rehearsal-events p, .rehearsal-events p span, .rehearsal-events small,
 .rehearsal-details, .rehearsal-footer, .rehearsal-signal-note p) { color: var(--sr-muted); }
html[data-theme="light"] :is(.story-intent, .story-event-list>a, .story-steps h3,
 .story-facts dd, .story-fees, .rehearsal-state, .rehearsal-metrics dd,
 .rehearsal-events strong, .rehearsal-details summary, .rehearsal-table-wrap th) { color: var(--sr-text); }
html[data-theme="light"] :is(.story-heading .exchange-eyebrow, .story-list-arrow,
 .story-steps a, .rehearsal-heading .exchange-eyebrow, .rehearsal-stage-heading .exchange-eyebrow,
 .rehearsal-scrubber output, .rehearsal-rules dt, .rehearsal-rules a,
 .rehearsal-signal-note strong) { color: var(--sr-link); }
html[data-theme="light"] :is(.story-avatar, .story-event-side, .story-step-number,
 .story-outcome, .rehearsal-label, .rehearsal-signal-note) { background: #edf5ff; color: #244b76; border-color: #accaea; }
html[data-theme="light"] :is(.story-event-side.is-buy, .story-event-list>a[aria-current="true"],
 .story-event-list>a:hover, .story-event-list>a:focus-visible,
 .rehearsal-scenarios a[aria-current]) { background: #e0edfc; color: #195a9b; border-color: #8cb6e1; }
html[data-theme="light"] .story-outcome.is-pending { color: #805207; background: #fff7e7; border-color: #d8b575; }
html[data-theme="light"] .story-grid { stroke: #d7e1ed; }
html[data-theme="light"] .story-point { fill: #577ba7; stroke: var(--sr-surface); }
html[data-theme="light"] .story-point.is-buy { fill: #176ac6; }
html[data-theme="light"] .rehearsal-axis { fill: var(--sr-muted); }
html[data-theme="light"] .rehearsal-path { stroke: #176ac6; }
html[data-theme="light"] .rehearsal-marker { fill: #176ac6; stroke: var(--sr-surface); }
html[data-theme="light"] .rehearsal-scenarios a { color: var(--sr-text); background: var(--sr-surface); border-color: var(--sr-border); }
html[data-theme="light"] :is(.rehearsal-metrics, .rehearsal-events li,
 .rehearsal-details, .rehearsal-table-wrap th, .rehearsal-table-wrap td) { border-color: var(--sr-border); }
html[data-theme="light"] .rehearsal-metrics dd.rehearsal-negative { color: #ad303d; }

/* Operations: dense tables, prompts, message previews and available controls. */
html[data-theme="light"] :is(.ops-nav, .ops-table th, .ops-ai-rule pre) { background: var(--sr-soft); color: var(--sr-text); }
html[data-theme="light"] :is(.ops-nav a, .ops-tabs a, .ops-stat>span:first-child,
 .ops-stat>small, .ops-empty, .ops-health dt, .ops-health dt small, .ops-workers small,
 .ops-incident p, .ops-table td>small, .ops-table th>small, .ops-number small,
 .ops-pagination, .ops-user-heading p, .ops-account-facts dt, .ops-request time,
 .ops-request footer, .ops-recipient-box>span, .ops-history-row span, .ops-history-row small,
 .ops-host-time, .ops-ai-rule p, .ops-ai-rule dt, .ops-ai-table td[data-label]::before,
 .ops-activity-table td[data-label]::before) { color: var(--sr-muted); }
html[data-theme="light"] :is(.ops-empty h2, .ops-empty h3, .ops-table .ops-user-link,
 .ops-request-text, .ops-form>label, .ops-history-row, .ops-message-body,
 .ops-interest-filters label, .ops-ai-prompt, .ops-ai-rule h2, .ops-ai-rule p strong,
 .ops-ai-rule dd) { color: var(--sr-text); }
html[data-theme="light"] :is(.ops-eyebrow, .ops-quiet, .ops-request header a,
 .ops-recipient-details>summary, .ops-recipient-list, .ops-health-subtitle, .ops-storage-value) { color: var(--sr-link); }
html[data-theme="light"] :is(.ops-nav a[aria-current], .ops-tabs a[aria-current],
 .ops-nav a:hover, .ops-tabs a:hover) { background: #e0edfc; color: #195a9b; box-shadow: none; }
html[data-theme="light"] :is(.ops-table tbody tr:hover, .ops-activity-table tbody tr,
 .ops-ai-table tbody tr) { background: var(--sr-surface); }
html[data-theme="light"] :is(.ops-health>div, .ops-incident, .ops-table td,
 .ops-history-row, .ops-message-body, .ops-recipient-details,
 .ops-subscription-case fieldset, .ops-subscription-case article) { border-color: var(--sr-border); }
html[data-theme="light"] :is(.ops-pill, .ops-recipient-box, .ops-button-secondary) {
  background: #edf5ff; border-color: #accaea; color: #244b76;
}
html[data-theme="light"] .ops-button-secondary:hover { background: #dfeeff; color: #195a9b; }
html[data-theme="light"] :is(.ops-search button, .ops-button:not(.ops-button-secondary)) { background: #0066cc; color: #fff; border-color: #0066cc; }
html[data-theme="light"] :is(.ops-search button:hover, .ops-button:not(.ops-button-secondary):hover) { background: #0055ad; }
html[data-theme="light"] :is(.ops-health-mark, .ops-ai-status[data-result="success"]) { background: #edf8f1; color: #176b48; border-color: #a3cbb3; }
html[data-theme="light"] .ops-ai-status[data-result="waiting"] { background: #fff7e7; color: #805207; border-color: #d8b575; }
html[data-theme="light"] .ops-ai-status[data-result="error"] { background: #fff0f1; color: #ad303d; border-color: #e0a0a7; }
html[data-theme="light"] .ops-positive { color: #176b48 !important; }
html[data-theme="light"] .ops-negative { color: #ad303d !important; }
html[data-theme="light"] .ops-warning { color: #805207 !important; }
html[data-theme="light"] .ops-dot-good { background: #176b48; }
html[data-theme="light"] .ops-dot-warning { background: #805207; }

/* Rule catalogue, operations editor and invitation screens. */
html[data-theme="light"] :is(.market-choice-categories button, .market-choice-selection,
 .market-choice-selected button, .market-reference-comparison, .tester-plan-content,
 .tester-accept-plan, .studio-action, .studio-table .studio-action) {
  background: #edf5ff; border-color: #accaea; color: #244b76;
}
html[data-theme="light"] :is(.market-choice-categories button[aria-pressed="true"],
 .tester-plan input:checked+.tester-plan-content) { background: #dfeeff; color: #195a9b; border-color: #8cb6e1; }
html[data-theme="light"] :is(.market-choice-availability, .market-choice-details>summary,
 .market-reference-status.is-recording, .market-reference-method summary,
 .studio-intro .studio-kicker, .studio-toolbar a, .studio-version-heading a,
 .studio-back, .studio-ai h2 span, .tester-plan-price, .tester-preview-mark,
 .tester-text-button, .futures-setup .exchange-eyebrow, .futures-state) { color: var(--sr-link); }
html[data-theme="light"] :is(.market-choice-rules dt, .market-choice-rules .market-choice-risk dt,
 .market-choice-rules .market-choice-risk dd, .market-choice-compare-toggle,
 .market-choice-comparison .exchange-eyebrow, .market-choice-comparison>p,
 .market-choice-comparison thead th:first-child, .market-choice-comparison tbody th,
 .market-reference-intro, .market-reference-status, .market-reference-periods dt,
 .market-reference-periods .market-reference-empty, .market-reference-periods small,
 .market-reference-caption, .market-reference-method-body p, .market-reference-settings dt,
 .market-reference-dates dt, .market-reference-method-body .market-reference-risk,
 .market-reference-evidence dt, .market-reference-comparison dt, .market-reference-comparison>span,
 .market-reference-comparison small, .studio-intro p, .studio-toolbar, .studio-version-heading,
 .studio-remove, .studio-proposals p, .studio-table td[data-label]::before, .studio-delete-confirm p,
 .studio-editor .ops-help, .studio-ai .ops-help, .studio-editor .builder-customize>summary small,
 .studio-editor .builder-customize p, .studio-editor .builder-indicator-help,
 .tester-welcome-preview>p:not(.ops-eyebrow), .tester-welcome-steps p,
 .tester-recipient p, .tester-status small, .tester-revoke summary, .tester-revoke p,
 .tester-accept-plan span, .futures-metrics dt) { color: var(--sr-muted); }
html[data-theme="light"] :is(.market-choice-rules dd, .market-choice-technical dt,
 .market-choice-selection>p, .market-choice-comparison h2, .market-choice-comparison td,
 .market-reference-heading h3, .market-reference-periods strong, .market-reference-settings dd,
 .market-reference-dates dd, .market-reference-evidence dd, .market-reference-comparison dd,
 .market-reference-benchmark-method h4, .market-reference-benchmark-method td,
 .studio-counts strong, .studio-fields label, .studio-type label, .studio-delete-confirm p strong,
 .studio-management .studio-management-name, .studio-editor .ops-form>label,
 .studio-ai .ops-form>label, .studio-editor .studio-fields label, .studio-ai .studio-fields label,
 .studio-editor .studio-form>h3, .studio-editor .builder-customize>summary,
 .studio-editor .builder-condition legend, .studio-editor .exchange-field label,
 .studio-editor .studio-entry-filters label, .studio-saved-rules, .tester-plans legend,
 .tester-plan-content strong, .tester-welcome-steps strong, .tester-recipient>strong,
 .tester-accept-plan strong, .futures-metrics dd) { color: var(--sr-text); }
html[data-theme="light"] .market-reference-comparison>p { color: #244b76 !important; }
html[data-theme="light"] :is(.market-choice-comparison caption, .market-choice-comparison thead th,
 .market-reference-benchmark-method caption, .market-reference-benchmark-method thead) { background: var(--sr-soft); color: #344e6c; }
html[data-theme="light"] :is(.market-choice-comparison-table, .market-choice-comparison th,
 .market-choice-comparison td, .market-choice-comparison td+td,
 .market-reference-periods>div+div, .market-reference-method,
 .market-reference-settings>div, .market-reference-dates>div, .market-reference-evidence,
 .market-reference-benchmark-method, .market-reference-benchmark-method th,
 .market-reference-benchmark-method td, .studio-table tr, .studio-type,
 .studio-editor .builder-customize, .studio-editor .builder-condition,
 .tester-welcome-preview .tester-preview-note, .tester-invite-row, .futures-metrics>div) { border-color: var(--sr-border); }
html[data-theme="light"] .market-choice-comparison-table { scrollbar-color: #8ba4bd var(--sr-soft); }
html[data-theme="light"] :is(.market-choice-alert, .market-choice-empty,
 .market-reference-method-body .market-reference-warning) { color: #805207; }
html[data-theme="light"] .market-reference-periods .is-positive strong { color: #176b48; }
html[data-theme="light"] :is(.market-reference-periods .is-negative strong, .tester-danger) { color: #ad303d; }
html[data-theme="light"] :is(.studio-action-primary, .studio-table .studio-action-primary,
 .marketplace-choices .workspace-primary) { color: #fff; background: #0066cc; border-color: #0066cc; }
html[data-theme="light"] :is(.studio-action-primary:hover, .marketplace-choices .workspace-primary:hover) { background: #0055ad; color: #fff; }
html[data-theme="light"] :is(.studio-action-danger, .studio-table .studio-action-danger,
 .studio-delete-confirm) { background: #fff0f1; color: #ad303d; border-color: #e0a0a7; }
html[data-theme="light"] .studio-editor { --studio-field-border: #8a9bb0; }
html[data-theme="light"] :is(.studio-editor .ops-button-secondary, .studio-editor .ops-button-secondary:hover) {
  color: #195a9b; background: #edf5ff; border-color: #accaea;
}

/* Focus rings must contrast with light surfaces, including radio-card controls. */
html[data-theme="light"] :is(.exchange-shell, .shark-builder, .shark-workspace,
 .ops-shell, .exchange-auth, .pricing-shell, .rehearsal-shell) :focus-visible {
  outline-color: #0066cc;
}
html[data-theme="light"] :is(.workspace-mode-options input:focus-visible+span,
 .builder-entry-options input:focus-visible+span, .shark-identity-icons input:focus-visible+span,
 .tester-plan input:focus-visible+.tester-plan-content) { outline-color: #0066cc; }

/* Recorded status messages remain distinguishable on pale cards. */
html[data-theme="light"] .workspace-run-status { background: #edf5ff; border-color: #accaea; }
html[data-theme="light"] .workspace-run-status>strong { color: #244b76; }
html[data-theme="light"] :is(.workspace-run-status>p, .workspace-run-status>p.workspace-run-status-time) { color: var(--sr-muted); }
html[data-theme="light"] .workspace-run-status>a { color: var(--sr-link); }
html[data-theme="light"] .workspace-run-status.is-attention { background: #fff7e7; border-color: #d8b575; }
html[data-theme="light"] .workspace-run-status.is-attention>strong { color: #805207; }
html[data-theme="light"] .workspace-run-status.is-quiet[data-shark-status="market_data"] { background: var(--sr-soft); border-color: transparent; }
html[data-theme="light"] .workspace-run-status.is-service { background: #fff7e7; border-color: #d8b575; }
html[data-theme="light"] .workspace-run-status.is-service>strong { color: #805207; }
html[data-theme="light"] :is(.shark-chart-svg [data-chart-gradient] stop, #rehearsal-fill stop) { stop-color: #176ac6; }

/* Retained private administration has its own token vocabulary. Scope those
   aliases to its body, so no historical record or safety surface is reworked. */
html[data-theme="light"] .sr-legacy-app {
  --bg: var(--sr-bg); --surface: var(--sr-surface); --surface2: var(--sr-soft);
  --ink: var(--sr-text); --ink2: #344e6c; --text: var(--sr-muted);
  --muted: var(--sr-muted); --blue: var(--sr-link); --blue2: #0876dd;
  --blueSoft: #e7f1ff; --greenSoft: #edf8f1; --border: var(--sr-border);
  --red: #ad303d; --success: #176b48; --error: #ad303d;
}
html:not([data-theme="light"]) .sr-legacy-app {
  color-scheme: dark;
  --bg: #080c12; --surface: #111821; --surface2: #18222e;
  --ink: #f0f4fa; --ink2: #d3dfeE; --text: #a9b8cb; --muted: #96a8bd;
  --blue: #80bcff; --blue2: #2b89e6; --blueSoft: #132e49;
  --greenSoft: #14352b; --green: #91d7b9; --red: #eea5ad;
  --success: #91d7b9; --warning: #e8ba82; --error: #eea5ad;
  --border: #334252; --line: #334252;
  --shadow: 0 18px 55px #0005; --shadow-card: 0 8px 28px #0002;
  --shadow-nav: 0 8px 28px #0003; --shadow-button: 0 8px 22px #0066cc20;
}
html:not([data-theme="light"]) .sr-legacy-app :is(header, .shell>aside, .filters, .builder-note, .review-aside) {
  background: #111821ed; border-color: var(--border);
}
html:not([data-theme="light"]) .sr-legacy-app :is(.stat:first-child, .notice, .welcome-panel, .review-card) {
  background: var(--surface2); border-color: var(--border);
}
html:not([data-theme="light"]) .sr-legacy-app :is(input:focus, select:focus, textarea:focus) {
  background: #0c121b; color: var(--ink);
}
html:not([data-theme="light"]) .sr-legacy-app :is(a, .eyebrow, .step, .badge, nav a[aria-current], .segmented a[aria-current]) { color: var(--blue); }
html:not([data-theme="light"]) .sr-legacy-app :is(button, .button, .btn) { background: #0066cc; color: #fff; }
html:not([data-theme="light"]) .sr-legacy-app :is(button.secondary, .button.secondary, .secondary) { background: var(--surface2); color: var(--ink2); border-color: var(--border); }
html:not([data-theme="light"]) .sr-legacy-app :is(button.ghost, .button.ghost, .text-button) { background: transparent; color: var(--blue); }
html:not([data-theme="light"]) .sr-legacy-app :is(button.danger, .button.danger) { background: #38232b; color: #eea5ad; border-color: #8b4754; }
html:not([data-theme="light"]) .sr-legacy-app :is(.badge.error, .status-error, .notice.error, .status-blocked) { background: #38232b; color: #eea5ad; border-color: #8b4754; }
html:not([data-theme="light"]) .sr-legacy-app :is(.notice.success, .status-watching) { background: #14352b; color: #91d7b9; border-color: #366f5a; }
html:not([data-theme="light"]) .sr-legacy-app :is(.mode-badge, .rule-status, .status-position, .status-settlement) { color: #c3d8ef; background: #182b40; border-color: #385470; }
html:not([data-theme="light"]) .sr-legacy-app :is(.status-paused, .badge.warning, .status-warning) { color: #e8ba82; background: #332a1c; border-color: #76603d; }
html:not([data-theme="light"]) .sr-legacy-app :is(.monitor-grid dt, .performance-caption, .performance-return.neutral) { color: var(--text); }
html:not([data-theme="light"]) .sr-legacy-app .performance-return.positive { color: #91d7b9; }
html:not([data-theme="light"]) .sr-legacy-app .performance-return.negative { color: #eea5ad; }
/* The shared preference control is intentionally neutral in the legacy shell. */
html:not([data-theme="light"]) .sr-legacy-app .sr-theme-control .sr-theme-button { background: transparent; color: #aebdce; }
html:not([data-theme="light"]) .sr-legacy-app .sr-theme-control .sr-theme-button[aria-pressed="true"] { background: #22364c; color: #e2f0ff; }
html[data-theme="light"] .sr-owner-recovery { color: var(--sr-text); background: var(--sr-bg); }
html[data-theme="light"] .sr-owner-recovery :is(header, section, details, .operation) { border-color: var(--sr-border); }
html[data-theme="light"] .sr-owner-recovery :is(section, details) { background: var(--sr-surface); }
html[data-theme="light"] .sr-owner-recovery :is(header span, ol, dt, .muted) { color: var(--sr-muted); }
html[data-theme="light"] .sr-owner-recovery :is(a, .eyebrow) { color: var(--sr-link); }
html[data-theme="light"] .sr-owner-recovery li[aria-current="step"] { color: #176b48; }
html[data-theme="light"] .sr-owner-recovery input { color: var(--sr-text); background: var(--sr-field); border-color: #8a9bb0; }
html[data-theme="light"] .sr-owner-recovery .notice { color: #805207; background: #fff7e7; border-color: #d8b575; }
html[data-theme="light"] .sr-owner-recovery .copy-button { color: #195a9b; background: #edf5ff; }
html[data-theme="light"] .sr-owner-recovery [role="alert"] { color: #ad303d; }

/* Screen-specific field colours must not hide existing validation/disabled states. */
html[data-theme="light"] :is(.exchange-shell, .exchange-auth, .ops-shell, .sr-owner-recovery)
 :is(input, select, textarea):disabled {
  background-color: #e7ecf2 !important; color: #657386 !important; border-color: var(--sr-border) !important;
}
html[data-theme="light"] :is(.exchange-shell, .exchange-auth, .ops-shell, .sr-owner-recovery)
 :is(input, select, textarea)[aria-invalid="true"],
html[data-theme="light"] :is(.exchange-shell, .exchange-auth, .ops-shell, .sr-owner-recovery)
 :is(input, select, textarea):user-invalid { border-color: #ad303d !important; }
html[data-theme="light"] .onboarding-capacity-notice .exchange-button { color: #fff; }

/* Authentication/declaration layouts use plain exchange cards, rather than
   the optional onboarding-auth-card variant. Pin both to the light surface. */
html[data-theme="light"] :is(.exchange-auth .login-card, .consumer-card) {
  color: var(--sr-text); background: var(--sr-surface); border-color: var(--sr-border);
  box-shadow: 0 12px 32px #213a5810;
}

/* Standalone account/recovery views share the bottom preference control. */
.sr-theme-footer {
  box-sizing: border-box;
  width: min(1120px, calc(100% - 48px));
  margin: 24px auto 0;
  padding: 0 0 max(28px, env(safe-area-inset-bottom));
}
.sr-theme-footer .sr-theme-control { margin-top: 0; }
@media (max-width: 540px) {
  .sr-theme-footer { width: calc(100% - 32px); margin-top: 20px; }
}
