/* V4.78.0 — targeted audit fixes; deliberately LAST after all legacy styles. */
html[data-theme="quant-dark"] { --ui-text:#eff6ff; --ui-muted:#c5d6e8; --ui-card:#14253b; --ui-card-alt:#1a3048; --ui-border:#425b75; }
/* Daily overview cards and sum distribution: convert old pale background to true dark */
html[data-theme="quant-dark"] :is(.daily-tile,.daily-sum,.integrity-card,.daily-stat,.daily-metric,.daily-number-card){
  background:#172d45 !important; background-image:none !important; color:var(--ui-text) !important;
  border:1px solid var(--ui-border) !important; box-shadow:none !important;
}
html[data-theme="quant-dark"] :is(.daily-tile,.daily-sum,.integrity-card,.daily-stat,.daily-metric,.daily-number-card) :is(span,small,p,div,label){
 color:var(--ui-muted) !important; opacity:1 !important;
}
html[data-theme="quant-dark"] :is(.daily-tile,.daily-sum,.integrity-card,.daily-stat,.daily-metric,.daily-number-card) :is(strong,b,.daily-count){
 color:#f9e2a5 !important; -webkit-text-fill-color:#f9e2a5 !important; opacity:1 !important;
}
html[data-theme="quant-dark"] .daily-sum .daily-ball{
 background:#294b56 !important;color:#fff !important;-webkit-text-fill-color:#fff !important;
 border:1px solid #6d9ca6 !important;
}
html[data-theme="quant-dark"] .daily-title{color:#f2f7ff !important;opacity:1 !important;}
html[data-theme="quant-dark"] :is(.daily-hint,.daily-status,.integrity-message,.integrity-details,.daily-position-table){color:#c7d8ea !important;opacity:1 !important;}
/* Results: legible regardless of mixed old warm background rules */
html[data-theme="quant-dark"] :is(.daily-grid,.daily-numbers) :is(.daily-tile,.daily-sum){color:#eff6ff !important;}
html[data-theme="quant-dark"] :is(.daily-grid,.daily-numbers) :is(.daily-tile,.daily-sum) strong{color:#ffe0a0 !important;}
/* Correct old charts and status boxes without touching the 5-color heatmap */
html[data-theme="quant-dark"] :is(.integrity-grid,.integrity-details,.daily-controls,.daily-filters,.daily-summary,.daily-rules,.record-counts){color:#e7f0fb !important;}
html[data-theme="quant-dark"] .daily-grid :is(.daily-tile,.daily-tile strong){opacity:1 !important;}
html[data-theme="quant-dark"] .daily-numbers :is(.daily-sum,.daily-count){opacity:1 !important;}
/* Form and table baseline */
html[data-theme="quant-dark"] :is(.panel,.daily-panel,.v4766-analytics,.historyfold,.position-omission) :is(input,select,textarea){color:#f1f7ff !important;-webkit-text-fill-color:#f1f7ff !important;background:#0d1e30 !important;border-color:#536f88 !important;}
html[data-theme="quant-dark"] :is(.panel,.daily-panel,.v4766-analytics,.historyfold,.position-omission) :is(input,textarea)::placeholder{color:#aebfd0 !important;-webkit-text-fill-color:#aebfd0 !important;opacity:1 !important;}
html[data-theme="quant-dark"] .position-omission-table :is(td,th),html[data-theme="quant-dark"] .omission-ranking-table :is(td,th){opacity:1!important;}
/* Preserve meaningful count-heatmap colors and contrast of their legend */
html[data-theme="quant-dark"] #fullstats :is(#fsHeatmap,.fs-swatch,.fs-code-cell){filter:none!important;}
/* Avoid accidental overlay interception */
html[data-theme="quant-dark"] .hero::after,html[data-theme="quant-dark"] .hero::before{pointer-events:none!important;}
@media (max-width:620px){
 html[data-theme="quant-dark"] .daily-grid,html[data-theme="quant-dark"] .daily-numbers{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0;}
 html[data-theme="quant-dark"] :is(.daily-tile,.daily-sum){min-width:0;overflow-wrap:anywhere;}
}
