/* Production theme repair only. Layout and trading behavior remain unchanged. */
html[data-theme="light"] { background:#f4f7fb;color-scheme:light; }
html[data-theme="dark"] { color-scheme:dark; }
body.light {
  --bg:#f4f7fb;--card:#fff;--card2:#edf3f9;
  --text:#14263b;--txt:#14263b;--dim:#536a82;--muted:#536a82;
  --line:#cddbe9;--line-strong:#7ba8d5;
  --accent:#0967d2;--accent2:#087aab;--up:#087d5d;--down:#be2949;--warn:#996000;
  --surface:linear-gradient(145deg,#fff,#f6f9fd);
  --surface-soft:linear-gradient(145deg,#fff,#f2f6fb);
  --surface-raised:linear-gradient(145deg,#fff,#edf4fb);
  --shadow:0 8px 24px rgba(25,65,100,.07);
  --shadow-raised:0 16px 48px rgba(25,65,100,.12);
  --zeno-shadow:0 8px 24px rgba(25,65,100,.07);
  background:#f4f7fb!important;color:var(--text);color-scheme:light;
}
body.light #appView {
  --market-cyan:#087e91;--market-cyan-soft:#ddf5ef;
  --market-red:#be2949;--market-red-soft:#fce7eb;
}
body.light::before { opacity:.12; }
/* The legacy sheet contains dark #appView overrides; these cover both mobile
   and desktop without changing the shared spacing/size system. */
body.light :is(header.app-header,nav.tabs,.wallet-balance-dock,.mobile-bottom-nav,.bottom-nav,.mobile-nav) {
  background:rgba(250,252,255,.98)!important;border-color:var(--line)!important;
  box-shadow:0 3px 16px rgba(25,65,100,.06)!important;
}
body.light :is(.card,.panel,.mcard,.featured-card,.product-card,.profile-card,.confirmbox,
  .trader-dialog,.mobile-menu,.profile-drawer,.news-card,.venue-compare,.venue-row,
  .portfolio-hero .card,.portfolio-positions-table,.leaderboard-ranking,.leaderboard-highlight,
  .smart-hero,.smart-card,.following-card,.copy-steps,.copy-summary,.copy-stage,
  .copy-search-box,.detail-inline-insight,.market-inline-insight,.detail-glass-card,
  .asset-price-panel,.asset-price-chart,.price-chart-wrap,.trade-form,.trade-panel,
  .order-review,.order-summary,.order-status,.setupstep,.settings-card,.settings-section,
  .settings-account-card,.settings-info-card,.settings-language-card,.settings-panel,
  .wallet-card,.wallet-network-card,.wallet-account-card,.wallet-activity-card,
  .modal-card,.dialog-card,.sheet-card,.deposit-card,.transfer-card,.auth-point) {
  background:var(--surface-soft)!important;border-color:var(--line)!important;
  color:var(--text);box-shadow:var(--shadow)!important;
}
body.light :is(#profileDrawer,#traderModal,#mobileMenu,.wallet-shell,.wallet-shell-header,
  .wallet-shell-tabs,.settings-drawer,.settings-dialog,.drawer-panel,.drawer-footer,
  .modal-content,.modal-body,.modal-header,.panel-head,.panel-footer) {
  background:var(--card)!important;color:var(--text);border-color:var(--line)!important;
}
body.light :is(.search input,input,select,textarea,.preferences-select,.market-route-button,
  .filter,.filter-btn,.chip,.pill,.quick-btn,.amount-preset,.copy-option,.authswitch,
  .segmented,.trade-switch,.detail-chart-tabs,.asset-chart-tabs,.portfolio-tabs,
  .portfolio-filter,.wallet-tabs,.wallet-action,.wallet-action-btn,.market-detail-tabs) {
  background:#edf3f9!important;color:var(--text)!important;border-color:var(--line)!important;
}
body.light :is(input,textarea)::placeholder { color:#657a90!important;opacity:1; }
body.light :is(h1,h2,h3,h4,.mtitle,.market-title,.featured-title,.profile-name,.section-title,
  .wallet-balance-dock b,.portfolio-hero b,.metric-value,.stat-value,.balance-value,
  .featured-price-summary b,.asset-price-value,.wallet-balance,.wallet-total,
  .highlight-name,.trader-name,.highlight-metrics b,.settings-title,.setting-value,
  .detail-insight-head,.detail-inline-insight p,.market-inline-insight p) { color:var(--text)!important; }
body.light :is(.dim,.muted,.subtitle,.subtle,.hint,.meta,.label,.wallet-balance-dock span,
  .wallet-balance-dock small,.highlight-metrics small,.leaderboard-highlight>small,
  .venue-price-explanation,.detail-inline-insight small,.market-inline-insight small,
  .detail-meta,.market-meta,.stat-label,.metric-label,.setting-row>span,
  .asset-price-label,.price-label,.profile-label,.balance-label,.news-source) { color:var(--dim)!important; }
body.light :is(nav.tabs,.mobile-bottom-nav,.bottom-nav,.mobile-nav,.wallet-shell-tabs) button {
  color:var(--dim)!important;background:transparent!important;
}
body.light :is(nav.tabs,.mobile-bottom-nav,.bottom-nav,.mobile-nav,.wallet-shell-tabs) button.active {
  color:#075fc3!important;background:#e3efff!important;border-color:#83b6ed!important;
}
body.light :is(.filter,.filter-btn,.chip,.pill,.quick-btn,.amount-preset,.copy-option).active,
body.light :is(.segmented,.trade-switch,.detail-chart-tabs,.asset-chart-tabs,.portfolio-tabs,.wallet-tabs) .active {
  background:#dcecff!important;color:#0759b1!important;border-color:#77aee8!important;
}
body.light :is(button.ghost,.btn-ghost,.btn-secondary,.secondary,.icon-btn,.icon-button,
  .profile-close,.drawer-close,.modal-close,.close-btn,.market-route-button) {
  background:#edf3f9!important;color:var(--text)!important;border-color:var(--line)!important;
}
body.light :is(.trader-row,.trader-row:hover,.activity-row,.position-row,.order-row,
  .wallet-row,.venue-head,.settings-row,.setting-row,table th,table td) {
  border-color:var(--line)!important;color:var(--text);
}
body.light :is(.trader-row:hover,.activity-row:hover,.position-row:hover,.order-row:hover) { background:#eaf2fc!important; }
body.light :is(table thead,table th) { background:#edf3f9!important; }
body.light :is(.drawer-backdrop,.modal-backdrop,.modal-overlay,.dialog-overlay,.overlay-backdrop) {
  background:rgba(18,36,57,.35)!important;
}
body.light :is(.asset-price-panel,#probabilityPanel,.asset-price-chart,.price-chart-wrap,.chart-container,
  #assetPricePanel,#featuredAssetPricePanel,#assetPriceChart,#featuredAssetPriceChart) { background:transparent!important; }
body.light :is(.price-grid,.chart-grid) { stroke:#d3dfeb!important; }
body.light :is(.price-target,.chart-target) { stroke:#6b7d91!important; }
body.light :is(.price-axis,.price-label,.price-tick,.asset-price-axis,.chart-axis) { fill:#536a82!important;color:#536a82!important; }
/* Keep outcomes visibly distinct, with sufficient text contrast in both themes. */
body.light :is(.outcome.up,.outcome.yes,.outcome-btn.up,.outcome-btn.yes,
  .venue-up,.venue-outcome-up,.price-up,.buy-up,.up-btn,.trade-up) {
  background:#ddf5ef!important;color:#075e4c!important;border-color:#269b83!important;
}
body.light :is(.outcome.down,.outcome.no,.outcome-btn.down,.outcome-btn.no,
  .venue-down,.venue-outcome-down,.price-down,.buy-down,.down-btn,.trade-down) {
  background:#fce7eb!important;color:#a32240!important;border-color:#d66c83!important;
}
body.light :is(.up,.yes,.positive,.probability-yes) { --outcome-text:#087d5d; }
body.light :is(.down,.no,.negative,.probability-no) { --outcome-text:#be2949; }
body.light :is(.probability-yes,.positive) { color:#087d5d!important; }
body.light :is(.probability-no,.negative) { color:#be2949!important; }
body.light :is(.detail-inline-insight strong,.market-inline-insight strong,a) { color:#075fc3; }
body.light :is(.wallet-network,.wallet-address,.deposit-address,.setupstep,.confirmrow,.confirm-row,
  .order-review-row,.order-review-summary,.order-result-details,.main-deposit-address,
  .main-deposit-gas,.main-deposit-grid b,.copy-summary-row,.copy-search-row) {
  background:var(--surface-soft)!important;color:var(--text);border-color:var(--line)!important;
}
body.light .brand-logo-frame { filter:drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
body.light .brand-logo-frame span { color:#14263b!important; }
body.light :focus-visible { outline-color:#0967d2; }
/* Exact legacy selectors used by production detail, account and dialogs. */
body.light :is(.featured-market-block,.market-summary>div,.overview-panel,.detail-stat,
  .chart-mode-switch,.featured-chart-mode-switch,.trade-underlying-chart,.trade-ending-time,
  .confirmgrid,.setupgrid,.withdrawal-consent,.withdrawal-consent-route,.sell-consent-market,
  .social-filter-panel,.social-profile-wallet,.social-profile-stats,.social-feed-card,
  .social-profile-panel,.social-follow-dialog,.social-filter-choice>summary,.social-filter-menu>summary,
  .social-filter-group button,.zeno-language-button,.zeno-language-options,.zeno-language-option,
  .wallet-account-strip button,.wallet-funds-nav,.wallet-route-grid,.wallet-amount-control,
  .swap-amount-control,.swap-review,.deposit-selection-summary,.deposit-address-block,
  .transfer-crypto-card,.transfer-detail-grid,.wallet-shell-footer,.deposit-status-list,
  .copy-task-metrics div,.copy-review .copy-summary-row,.interest-grid button,
  .notification-head,.wallet-head,.profile-head,.segbar,.amts button,.ivals button,
  .trade-asset-price>span,.asset-target-overlay,.sell-consent-refresh,.btn,
  .portfolio-inline-row,.wallet-transfer-history-row,.toast) {
  background:var(--surface-soft)!important;color:var(--text)!important;border-color:var(--line)!important;
}
body.light :is(.zeno-language-option:hover,.zeno-language-option[aria-selected="true"],
  .social-filter-group button.active,.interest-grid button.active,.wallet-funds-nav button.active,
  .wallet-account-strip button[aria-selected="true"],.btn.active,.amts button.sel) {
  background:#dcecff!important;color:#0759b1!important;border-color:#77aee8!important;
}
body.light :is(.mtitle,.featured-title h2,.detail-heading-copy h2,.asset-price-metrics b,
  .trade-asset-price b,#assetTargetPrice,#tradeAssetTargetPrice,.panel-headline .eyebrow,
  .social-wallet-row code,.withdrawal-consent-amounts dd,.withdrawal-consent-route b,
  .venue-main b,.venue-price b,.obtn b,.featured-odd b,.zeno-language-current,
  .profile-identity h3,.profile-identity p,.profile-identity strong) { color:var(--text)!important; }
body.light :is(.asset-price-metrics small,.asset-chart-axis,.asset-chart-times,.asset-chart-empty,
  .asset-price-source,.asset-chart-key,.trade-asset-price>span,.trade-chart-heading,
  .trade-chart-heading small,.trade-underlying-chart>small,.chart-section-label,
  .chart-section-label .detail-ending-label,.trade-ending-time>span:first-child,
  .detail-metadata,.featured-metadata,.featured-footer,.event-breadcrumb,
  .event-breadcrumb button,.overview-panel p,.overview-panel h3,.resolution-source small,
  .trade-account-details,.amount-label,.order-type-field,.trade-outcome-label,
  .withdrawal-consent-scope,.withdrawal-consent-details,.withdrawal-consent-amounts dt,
  .social-wallet-heading,.social-wallet-heading small,.social-filter-group>b,
  .social-filter-count,.venue-source,.venue-price small,.venue-price-note,.obtn small,
  .venue-state,.venue-details summary,.sell-consent-venue,.authcopy,.auth-consent,
  .zeno-language-option,.wallet-account-strip span,.wallet-account-strip small,
  .profile-identity p,.wallet-flow-kicker,.wallet-flow-back,.eyebrow,#assetPriceEnding,
  #chartName,#chartSource,#selSub,#detailInlineInsight,.transfer-receipt-balance-title) { color:var(--dim)!important; }
body.light :is(.chart-mode-switch,.featured-chart-mode-switch,.segbar,.ivals) button { color:var(--dim)!important; }
body.light :is(.chart-mode-switch,.featured-chart-mode-switch,.segbar,.ivals) button.active {
  background:#dcecff!important;color:#0759b1!important;border-color:#77aee8!important;
}
body.light :is(.obtn.up,.featured-odd.up,.venue-price.up) {
  background:#ddf5ef!important;color:#075e4c!important;border-color:#269b83!important;
}
body.light :is(.obtn.down,.featured-odd.down,.venue-price.down) {
  background:#fce7eb!important;color:#a32240!important;border-color:#d66c83!important;
}
body.light :is(.obtn.up,.featured-odd.up,.venue-price.up) :is(span,b,small),
body.light :is(.obtn.up,.featured-odd.up,.venue-price.up)>span:first-child { color:#075e4c!important; }
body.light :is(.obtn.down,.featured-odd.down,.venue-price.down) :is(span,b,small),
body.light :is(.obtn.down,.featured-odd.down,.venue-price.down)>span:first-child { color:#a32240!important; }
body.light :is(.obtn.up.sel,.venue-price.up.selected-outcome) { background:#bdeadd!important; }
body.light :is(.obtn.down.sel,.venue-price.down.selected-outcome) { background:#f6cbd5!important; }
body.light :is(#assetLivePrice,#tradeAssetLivePrice,#assetPriceStatus) { color:#996000!important; }
body.light :is(.price-live-line,.price-last,.asset-chart-key.live) { stroke:#a26600; }
body.light :is(.asset-price-axis,.asset-chart-y-axis) { color:var(--dim)!important; }
body.light :is(.confirmback,.mobile-menu-backdrop) { background:rgba(18,36,57,.35)!important; }
body.light .withdrawal-consent::backdrop { background:rgba(18,36,57,.35); }
body.light :is(.withdrawal-consent-cancel,.err,.error,.deposit-error) { color:#a32240!important; }
body.light :is(.copy-wallet-state,.deposit-warning) { background:#fff2d9!important;color:#805000!important;border-color:#dcb66b!important; }
body.light .venue-tag.predictfun { background:#eee7ff;color:#68429a;border-color:#bba5dc; }
body.light .asset-price-chart .price-grid { stroke:#d3dfeb!important; }
body.light :is(b,strong,.value,.news-copy b,.portfolio-inline-row strong) { color:var(--text)!important; }
body.light :is(.value.pos,.value.positive,.pos) { color:#087d5d!important; }
body.light :is(.value.neg,.value.negative,.neg) { color:#be2949!important; }
body.light :is(.chips button,.filterbar button,.explore-tabs button,.view-button,
  .featured-save,.favourite-btn,.featured-probability,.featured-news-panel,
  .featured-ending,.market-ending,.news-item,.news-link,.search-results,
  .market-filters,.filters-panel,.market-position-card,.market-controls,
  .mcp-clients button,.mcp-connection,.mcp-endpoint,.mcp-prompt,.mcp-status) {
  background:var(--surface-soft)!important;color:var(--text)!important;border-color:var(--line)!important;
}
body.light :is(.chips button.active,.filterbar button.active,.explore-tabs button.active,
  .view-button.active,.view-button[aria-pressed="true"]) {
  background:#dcecff!important;color:#0759b1!important;border-color:#77aee8!important;
}
body.light :is(.featured-probability span,.featured-probability small,.news-copy small,
  .featured-ending,.market-ending,.featured-countdown,.market-countdown,
  #mcpEndpoint,#mcpSamplePrompt,.mcp-safety,.mcp-connection p) { color:var(--dim)!important; }
body.light :is(.slippagebox,.trade-estimate,.insight-direction,.asset-chart-target-note,
  .trader-info,.trader-stat,.trader-stats>div,.smart-money-summary>div,.social-profile-summary,
  .copytrading-hero,.copy-task,.copy-empty,.copy-review,.copy-table,.following-tools,
  .market-best,.detail-pill,.data-note,.source-note,.profile-venue-card) {
  background:var(--surface-soft)!important;color:var(--text)!important;border-color:var(--line)!important;
}
body.light :is(#detailBalanceValue,#tradeReferencePrice,.trade-market-about summary,
  .slippagebox summary,.slippagebox summary b,.featured-probability strong,.highlight-metrics b) { color:var(--text)!important; }
body.light :is(.trade-market-about p,.trade-market-about span,#tradeMarketAboutCopy,
  #tradeMarketResolution,.detail-venue-balance>span,.slippage-summary,
  .slippagebox small,.reference-price-row>span,.insight-direction,.asset-chart-target-note) { color:var(--dim)!important; }
body.light :is(.venue-tag,.detail-pill,.featured-badge) { background:#e4edf8!important;color:#355a80!important;border-color:var(--line)!important; }
body.light .venue-tag.predictfun { background:#eee7ff!important;color:#68429a!important;border-color:#bba5dc!important; }
body.light :is(.wallet-account-strip,.wallet-funds-nav,.wallet-shell-footer) {
  background:var(--card)!important;border-color:var(--line)!important;
}
body.light .wallet-funds-nav button { color:var(--dim)!important; }
body.light .wallet-funds-nav button[aria-pressed="true"] { color:#0759b1!important;background:#dcecff!important; }
body.light .profile-identity .avatar { color:#0759b1!important;background:#dcecff!important; }
body.light :is(.mcp-integration,.mcp-client-tabs,.mcp-step,.mcp-endpoint,.mcp-prompt,.mcp-sample,
  .mcp-client-tab span,.social-close,.social-wallet-control,.social-copy-status) {
  background:var(--surface-soft)!important;color:var(--text)!important;border-color:var(--line)!important;
}
body.light :is(.mcp-step p,.mcp-safety,.mcp-endpoint code,.mcp-prompt code,.mcp-steps small) { color:var(--dim)!important; }
body.light .mcp-client-tab.active { background:#dcecff!important;color:#0759b1!important; }
body.light .mcp-ready.mcp-unavailable { color:#805000; }
body.light :is(.wallet-ready,.main-wallet-badge) { color:#087d5d; }
body.light .mcp-client-tab:not(.active) { color:var(--dim)!important; }
body.light :is(table th,table td,.portfolio-transfer-direction) { color:var(--text)!important; }
body.light :is(.portfolio-transfer-meta,.portfolio-transfer-symbol,.portfolio-record-meta,
  .portfolio-record-value span,.portfolio-record-details p,.portfolio-record-details summary,
  .position-metrics span,.transfer-receipt summary) { color:var(--dim)!important; }
body.light .portfolio-position-card { background:var(--surface-soft)!important;border-color:var(--line)!important; }
body.light .portfolio-status.pending { color:#805000!important;background:#fff0d5!important; }
body.light .portfolio-status.info { color:#235c9b!important;background:#e4effc!important; }
body.light .portfolio-status.neutral { color:var(--dim)!important;background:#edf3f9!important; }
body.light .venue-logo.polymarket { background:#dceaff!important;color:#235c9b!important; }
body.light .venue-logo.predictfun { background:#eee7ff!important;color:#68429a!important; }
body.light :is(.featured-arrow,.filter-toggle) { background:#edf3f9!important;color:var(--text)!important;border-color:var(--line)!important; }
body.light .filter-toggle.active { background:#dcecff!important;color:#0759b1!important;border-color:#77aee8!important; }
body.light .featured-dots button { background:#bdcddd!important; }
body.light .featured-dots button.active { background:#14899e!important; }
body.light .platform-dot.polymarket { background:#dceaff;color:#235c9b; }
body.light .platform-dot.predictfun { background:#eee7ff;color:#68429a; }
body.light .social-copy-coming:disabled { background:#e7edf4!important;color:#64768a!important;border-color:var(--line)!important; }
/* The venue changes data, not the chart frame or its inner gutters. */
#tab-trade.compact-trade-stage #probabilityPanel {
  margin:3px 18px 0;padding:6px 6px 5px;min-width:0;
  border:1px solid rgba(95,133,169,.2);border-radius:10px;
  background:linear-gradient(160deg,rgba(12,31,48,.68),rgba(4,14,25,.32));
}
#tab-trade.compact-trade-stage #probabilityPanel #chartWrap { margin:0;padding:0;min-width:0;border:0;background:none; }
#probabilityLegend { margin:0 0 6px;min-width:0; }
#probabilityLegend > .probability-legend { margin:0;gap:6px 16px;align-items:center; }
.probability-basis { color:var(--dim);font-size:10px;font-weight:400; }
@media (max-width:720px) {
  #tab-trade.compact-trade-stage #probabilityPanel { margin:3px 12px 0; }
}
@media (max-width:720px) {
  body.light #appView #tab-trade.compact-trade-stage #btnTrade {
    box-shadow:0 -9px 0 10px #f4f7fb,0 5px 16px rgba(25,65,100,.1)!important;
  }
  body.light #appView #tab-trade.compact-trade-stage #btnTrade:disabled { filter:none!important;opacity:.6; }
}
