/* CSS-side chart compatibility. JS-side Plotly relayout is in theme_charts.js. */
html[data-theme="dark"] :where(
  [class*="Chart"],
  [class*="chart"],
  [class*="Graph"],
  [class*="graph"]
) {
  --chart-line-muted: var(--chart-grid);
  --chart-text-muted: var(--chart-axis);
}
html[data-theme="dark"] :where(
  [class*="Tooltip"],
  [class*="tooltip"],
  .reports-bar-tooltip,
  .chartTooltip
) {
  background-color: var(--chart-tooltip-bg) !important;
  color: var(--chart-tooltip-text) !important;
  border-color: color-mix(in srgb, var(--chart-tooltip-bg) 72%, var(--border-strong)) !important;
  box-shadow: var(--shadow-md) !important;
}
html[data-theme="dark"] :where(
  [class*="Tooltip"] *,
  [class*="tooltip"] *,
  .reports-bar-tooltip *,
  .chartTooltip *
) { color: inherit; }
html[data-theme="dark"] :where(.modebar, .modebar-group) { background: var(--surface-2) !important; }
html[data-theme="dark"] :where(.modebar-btn path) { fill: var(--text-muted) !important; }
html[data-theme="dark"] :where(.modebar-btn:hover path) { fill: var(--brand-hover) !important; }


/* v465: universal dark tooltips. */
html[data-theme="dark"] .chartTooltip,
html[data-theme="dark"] .chartTooltip *,
html[data-theme="dark"] .chartTooltip--stockCell,
html[data-theme="dark"] .chartTooltip--wbRegion{
  background: var(--chart-tooltip-bg) !important;
  color: var(--chart-tooltip-text) !important;
  border-color: var(--popover-border) !important;
}


/* v466: tooltip internals should not inherit old white blocks. */
html[data-theme="dark"] .chartTooltip{background:var(--chart-tooltip-bg)!important;color:var(--chart-tooltip-text)!important;border:1px solid var(--popover-border)!important;box-shadow:var(--shadow-lg)!important}
html[data-theme="dark"] .chartTooltip :is(.stockTip,.stockTip__title,.stockTip__product,.stockTip__grid,.stockTip__grid span,.stockTip__grid b,.stockTip__formula,.stockTip__alert,.stockTip__muted,.stockTip__bestTurnover,.chartBarTip,.chartBarTip__meta,.chartBarTip__article,.chartBarTip__name,.chartTipRow,.chartTipRow span,.chartTipRow b){
  background:transparent!important;border-color:rgba(255,255,255,.08)!important;color:var(--chart-tooltip-text)!important;box-shadow:none!important;
}
html[data-theme="dark"] .chartTooltip .stockTip__formula{background:rgba(255,255,255,.05)!important}
html[data-theme="dark"] .chartTooltip .stockTip__alert{background:rgba(255,121,121,.12)!important;border-color:rgba(255,121,121,.28)!important;color:#ffd1d1!important}
html[data-theme="dark"] .chartTooltip .stockTip__bestTurnover{background:rgba(39,199,199,.12)!important;border-color:rgba(39,199,199,.28)!important;color:#b8f2f2!important}
html[data-theme="dark"] .chartTooltip .chartBarTip img{background:#404040!important;border-color:rgba(255,255,255,.08)!important}
