/* V4.77.6 — contrast audit: dark controls and explanatory text. Loaded last. */
html[data-theme="quant-dark"] { --contrast-text:#f2f6fb; --contrast-secondary:#c6d3e3; --contrast-muted:#adbed0; }
/* Inherited muted text on dark cards must never become nearly invisible. */
html[data-theme="quant-dark"] :is(.panel,.historyfold,.hero,.operation-card,.org-drawer,.sum-rule-panel,.sum-choice-panel,.filterstats,.customrules,.shape-filters,.position-omission,.backtest-lab,.fs-gridpanel,.fs-advanced-tools,.fb-lists,.fm-content,.advdetails,.daily-panel,.calcbox,.calcoutput,.fullboard-v4758) :is(p,li,label,legend,summary,small,dt,dd,output) {
 color:var(--contrast-secondary)!important; opacity:1!important;
}
html[data-theme="quant-dark"] :is(.panel,.historyfold,.operation-card,.org-drawer,.sum-rule-panel,.sum-choice-panel,.filterstats,.customrules,.shape-filters,.backtest-lab,.fs-gridpanel,.advdetails) :is(h2,h3,h4,strong){color:var(--contrast-text)!important;opacity:1!important;}
/* Previously unthemed info, inline tips and generated dynamic results. */
html[data-theme="quant-dark"] :is(.daily-title,.daily-hint,.fs-compare-note,.fs-landscape-tip,.fs-grid-legend,.fs-gridhead,.fs-summary,.fs-picked,.fs-pages,.fs-range,.fb-note,.advnote,.labnote,.operation-note,.empty,.info,.meta,.eyebrow,.sum-choice-count,.calcoutput,.result-rule-help,.record-description,.filter-description,.filterstats,.stathelp,.fs-audit,.backtest-explain,.backtest-status,.position-omission-table,.omission-detail,.fullboard-v4758,.fs-advanced-tools){color:var(--contrast-secondary)!important;opacity:1!important;}
html[data-theme="quant-dark"] :is(.info,.meta,.labnote,.advnote,.daily-hint,.shape-hint,.fb-note,.operation-note,.result-rule-help,.fs-compare-note,.backtest-explain,.backtest-status,.empty) :is(span,small,em){color:var(--contrast-secondary)!important;opacity:1!important;}
/* Pale backgrounds surviving from old warm/light themes get dark surfaces and light text. */
html[data-theme="quant-dark"] :is(.calcbox,.calcoutput,.daily-grid,.daily-panel,.fs-audit,.fs-summary,.fs-picked,.fs-advanced-tools,.fs-compare,.fs-hundred-grid,.fs-tablewrap,.fs-gridpanel,.sum-choice-grid,.sum-presets,.formrow,.advgrid,.v4755-options,.mobile-record-controls,.fb-row,.fb-plan-output,.fb-span-grid,.fullboard-v4758,.backtest-explain,.backtest-status,.omission-detail,.omission-ranking-head,.omission-ranking-controls,.position-blindspot-panel,.historyfold-content,.fs-quick-actions) {
 background-color:#132338!important; color:var(--contrast-text)!important;border-color:#354b61!important;
}
html[data-theme="quant-dark"] :is(.calcbox,.calcoutput,.daily-grid,.daily-panel,.fs-audit,.fs-summary,.fs-picked,.fs-advanced-tools,.fs-compare,.fs-hundred-grid,.fs-tablewrap,.sum-choice-grid,.formrow,.advgrid,.fb-row,.fb-plan-output,.fullboard-v4758,.historyfold-content) :is(span,div,label,p,small){color:inherit;opacity:1!important;}
/* Keep explicit semantic colors and status badges meaningful. */
html[data-theme="quant-dark"] :is(.hit,.success,.ok,.positive,.record-rule-chip.hit){color:#7ae7c9!important;}
html[data-theme="quant-dark"] :is(.miss,.error,.negative,.row-disabled){color:#ffb1b8!important;}
/* Form fields, native controls and selected values should be legible on dark fills. */
html[data-theme="quant-dark"] :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select,option){background-color:#0f2032!important;color:#f1f6fc!important;-webkit-text-fill-color:#f1f6fc!important;border-color:#526a82!important;opacity:1!important;}
html[data-theme="quant-dark"] :is(input,textarea)::placeholder{color:#bdcbd9!important;-webkit-text-fill-color:#bdcbd9!important;opacity:1!important;}
html[data-theme="quant-dark"] :is(button,.lightbtn,.fb-action,.org-link){color:#f0f6fb!important;-webkit-text-fill-color:#f0f6fb!important;opacity:1!important;}
html[data-theme="quant-dark"] :is(button,.lightbtn,.fb-action,.org-link):disabled{opacity:.62!important;}
html[data-theme="quant-dark"] :is(button,.lightbtn,.org-link):focus-visible{outline:3px solid #89dfee!important;outline-offset:2px!important;}
html[data-theme="quant-dark"] .organized-nav > button.org-link.is-active {background:#246f86!important;color:#fff!important;-webkit-text-fill-color:#fff!important;}
/* Calendar, table and metrics: prevent gray-on-dark rendering. */
html[data-theme="quant-dark"] :is(table,.fs-table,.fm-table,.unified-records,.pair-history-table,.omission-ranking-table,.position-omission-table) :is(th,td){color:#e5eef8!important;opacity:1!important;border-color:#34485c!important;}
html[data-theme="quant-dark"] :is(table,.fs-table,.fm-table,.unified-records,.pair-history-table,.omission-ranking-table,.position-omission-table) th{color:#c2d3e3!important;background:#101d30!important;}
html[data-theme="quant-dark"] :is(.detailcell,.statbox,.filterstat,.backtest-metric,.fs-card,.fs-metric) :is(small,span,label,p){color:#c3d3e4!important;opacity:1!important;}
/* Respect the fixed five-color number grid: never recolor the heatmap canvas or swatches. */
html[data-theme="quant-dark"] :is(.fs-swatch,.fs-code-cell,#fsHeatmap,canvas){filter:none!important;}
/* Real mobile layout and tapping, including safe area; no pointer-blocking decorations. */
html[data-theme="quant-dark"] .hero::before,html[data-theme="quant-dark"] .hero::after{pointer-events:none!important;}
html[data-theme="quant-dark"] nav.tabs.organized-tabs .organized-nav{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important;}
html[data-theme="quant-dark"] nav.tabs.organized-tabs .organized-nav > button.org-link{min-width:0!important;min-height:46px!important;white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.25!important;}
@media(max-width:600px){html[data-theme="quant-dark"] :is(.panel,.historyfold,.sum-rule-panel,.sum-choice-panel){min-width:0;max-width:100%;}html[data-theme="quant-dark"] :is(input,textarea,select){font-size:16px!important;}}
