/* dash-mui-charts (MUI X Charts) ↔ Mantine theme adaptation.
 *
 * MUI X renders axis/legend/grid text and strokes with its own light-theme
 * defaults (near-black), which vanish on the dark canvas. Series colors come
 * through as explicit hex from the builders (lib/ai/handler/chart_analysis.py)
 * and are untouched here — this file only remaps the CHROME (axes, labels,
 * legend, grid, tooltip) onto Mantine CSS variables, which track light/dark
 * automatically. CSS variables are reliable in stylesheets (unlike inside SVG
 * presentation attributes — the reason the builders emit hex for series).
 */

.MuiChartsAxis-tickLabel,
.MuiChartsAxis-label {
    fill: var(--mantine-color-text) !important;
}

.MuiChartsAxis-line,
.MuiChartsAxis-tick {
    stroke: var(--mantine-color-dimmed) !important;
}

.MuiChartsGrid-line {
    stroke: var(--mantine-color-default-border) !important;
}

.MuiChartsLegend-root,
.MuiChartsLegend-label {
    color: var(--mantine-color-text);
}

.MuiChartsLegend-root text {
    fill: var(--mantine-color-text) !important;
}

.MuiChartsTooltip-paper,
.MuiChartsTooltip-root .MuiPaper-root {
    background: var(--mantine-color-body) !important;
    color: var(--mantine-color-text) !important;
    border: 1px solid var(--mantine-color-default-border);
}

.MuiChartsTooltip-paper .MuiTypography-root,
.MuiChartsTooltip-root .MuiTypography-root {
    color: var(--mantine-color-text) !important;
}

/* Heatmap has its own tooltip component (MuiChartsHeatmapTooltip): the axis-value
 * header ("Fri W1") is a styled <caption> hard-coded to MUI's light-theme
 * text.secondary gray — unreadable on the dark tooltip. Attribute selectors catch
 * the generated slot class (…-axesValue) plus any future heatmap tooltip slots. */
[class*="MuiChartsHeatmapTooltip"],
[class*="MuiChartsTooltip"] caption {
    color: var(--mantine-color-text) !important;
    border-bottom-color: var(--mantine-color-default-border) !important;
}
