/*
    Minimal style, second pass: charts (see css/minimal/core.css for the rule). The public site's stages draw every
    chart in ink: the line that matters in the page's ink, a comparison in a quieter ink (dashed for a benchmark), area
    fills and spans as a faint ink shade, and color only where a value carries it (a gain or a loss, a low point to
    watch, money going below zero). The same here, applied only while <html data-minimal="on"> (Minimal style). With
    it off (the flat look) the heroes and every other chart keep their full colors. Sankeys keep theirs either way.

    - Canvas charts read these tokens on load and again when Minimal style or the theme changes (each watches the
      data-minimal attribute): js/dashboard-pulse.js (--dx-pulse-*), js/hero-scrub.js (--hs-*, every .hx hero),
      js/security-chart.js (--scx-*). js/series-chart.js (Performance, Net worth history) has its own minimal palette.
    - Syncfusion charts (Reports, Investments, Liabilities, Recurring, Settle, AI) draw their colors from C# palettes;
      here their series and legend keys are muted toward neutral with one filter, so the tones that carry meaning
      (income and spending, gain and loss, over and under) still read apart, quietly.
    - HTML / SVG charts built from classes (bars, meters, keys) are in css/minimal/areas.css with their area.
*/

/* ================================================================================================== Dashboard pulse */
/* Cash in ink, spending a quiet dotted ink, spending peaks quiet. Paydays keep their green (money in), a low point that
   needs a look keeps its amber and cash below zero keeps its red. The cash high's label keeps the quiet green of an
   Income label (--gr-good), as on mobile; its ring on the line stays ink. */

html[data-minimal="on"] .dx-pulse.dx-pulse.dx-pulse {
    --dx-pulse-cash: var(--mn-ink);
    --dx-pulse-high: var(--gr-good);
    --dx-pulse-spend: var(--mn-faint);
    --dx-pulse-peak: var(--mn-sub);
    --dx-pulse-glass-line: var(--mn-rule);
}

/* ================================================================================================== Hero charts */
/* Every .hx hero's chart (Accounts, Liabilities, Reports, Investments overview): the line in ink with a faint ink
   shade under it, the second series a quiet ink. Below zero (net worth, net cash flow) stays red. */

/* The canvas reads these as plain colors (a color-mix() would not parse there), so the shades are spelled out per
   theme. */
html[data-minimal="on"] {
    --mn-chart-area: rgba(11, 15, 25, .07);
    --mn-chart-area-neg: rgba(194, 49, 47, .1);
}

html[data-minimal="on"][data-bs-theme="dark"] {
    --mn-chart-area: rgba(255, 255, 255, .08);
    --mn-chart-area-neg: rgba(248, 113, 113, .12);
}

html[data-minimal="on"] .hsc.hsc.hsc.hsc {
    --hs-line: var(--mn-ink);
    --hs-line-neg: var(--mn-bad);
    --hs-area: var(--mn-chart-area);
    --hs-area-neg: var(--mn-chart-area-neg);
    --hs-second: var(--mn-faint);
    --hs-good: var(--mn-good);
}

/* On Liabilities the line is debt: it is never "below zero", so it stays ink throughout. */
html[data-minimal="on"] .hsc.hsc.hsc.hsc.hs-liabilities {
    --hs-line-neg: var(--mn-ink);
    --hs-area-neg: var(--mn-chart-area);
}

/* ================================================================================================== Security chart */
/* Candles keep a quiet green and red; the averages, your trades and the navigator are ink. */

html[data-minimal="on"] .scx.scx {
    --scx-up: var(--mn-good);
    --scx-down: var(--mn-bad);
    --scx-sma50: var(--mn-faint);
    --scx-sma200: var(--mn-ink-2);
    --scx-you: var(--mn-ink);
    --scx-focus: var(--mn-ink);
    --scx-nav-line: var(--mn-faint);
    --scx-nav: var(--mn-well);
}

html[data-minimal="on"] .nwh .scx.scx { --scx-nav-line: var(--mn-faint); --scx-nav: var(--mn-well); --scx-seg-pill: var(--tx-seg-pill); }

/* The layer chips above the chart: the key (the line's own color, now ink or a calm tone) on a neutral chip. */
html[data-minimal] .scx-layer.is-on:not(#mn) {
    border-color: var(--mn-hair);
    background: var(--mn-well);
}

/* ================================================================================================== Syncfusion charts */
/* Series, markers and legend keys muted toward neutral. Axis text, grid lines and tooltips are already neutral. */

html[data-minimal="on"] :is(.e-chart, .e-accumulationchart, .e-sparkline) :is(
    g[id$="SeriesCollection"], g[id*="SymbolGroup"], g[id$="_chart_legend_collections"], g[id$="_Series_0"]
) {
    filter: saturate(.32) brightness(1.02);
}

html[data-minimal="on"][data-bs-theme="dark"] :is(.e-chart, .e-accumulationchart, .e-sparkline) :is(
    g[id$="SeriesCollection"], g[id*="SymbolGroup"], g[id$="_chart_legend_collections"], g[id$="_Series_0"]
) {
    filter: saturate(.36) brightness(.96);
}

/* Sankeys (Reports > Cash Flow "Where your money went", and the public Reports page's admin twin) keep their category
   colors in every style (2026-11-22): a category is known by its color. */
html[data-minimal="on"] .e-sankeychart > svg { filter: none; }

/* Heat maps and gauges drawn by Syncfusion (heat map, circular gauge): the same calm. */
html[data-minimal="on"] :is(.e-heatmap, .e-circulargauge, .e-lineargauge) > svg {
    filter: saturate(.4);
}

/* Composite bars that blend one part into the next (Where every dollar went, the Dashboard's cash mix, Recurring's
   kinds): the same calm as the charts they sit under. The couple's bar (.ci-couple-bar) keeps its blue and amber. */
html[data-minimal="on"] .ci-blend-bar { filter: saturate(.25); }
