/*
    Charts, one neutral language (2026-11-19). Loaded after every area sheet.

    - The chart surface: every hero chart and secondary chart sits on the theme's plain card color, white in light and the
      card color in dark (the cards' #151B28), with a neutral hairline. No area-tinted gradients, radial glows or scrims behind a chart.
      The area colors stay in the lines, icons and numbers.
    - Bubbles: every reading bubble, tooltip and island over a chart is a solid card of that same surface color with a
      slight border, a faint inset edge and a soft drop shadow. Light: white on white. Dark: the same thing in reverse.
      Gain / loss show only in icons and numbers; the bubble never changes color.
    - Canvas islands (js/hero-scrub.js, js/dashboard-pulse.js) and the TradingView magnifier read the same tokens.
    - 2026-11-20: the hero surfaces, the hero figures without a pill and the Reports side panes were Minimal style only;
      since 2026-11-22 they are the flat look of every style (html[data-minimal], which App.razor always writes). The
      rest of the flat look is css/minimal-style.css and css/minimal/; Minimal style's graphite is css/minimal/graphite.css.
*/

/* ------------------------------------------------------------------ Tokens */

:root {
    --chn-surface: #FFFFFF;
    --chn-line: #E3E6EC;
    --chn-tile: #F6F7F9;
    --chn-tile-line: rgba(15, 23, 42, .06);
    --chn-pill: rgba(15, 23, 42, .045);
    --chn-inset: inset 0 0 0 1px rgba(255, 255, 255, .9), inset 0 1px 2px rgba(15, 23, 42, .05);
    --chn-shadow: 0 12px 30px -16px rgba(15, 23, 42, .24), 0 2px 6px -2px rgba(15, 23, 42, .06);
    --chn-bubble: var(--chn-surface);
    --chn-bubble-line: var(--chn-line);
    --chn-ink: #0B0F19;
    --chn-muted: #565973;
}

[data-bs-theme="dark"] {
    --chn-surface: var(--rc-card, #151B28);
    --chn-line: #2B3045;
    --chn-tile: rgba(255, 255, 255, .035);
    --chn-tile-line: rgba(255, 255, 255, .06);
    --chn-pill: rgba(255, 255, 255, .06);
    --chn-inset: inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 0 0 1px rgba(255, 255, 255, .02);
    --chn-shadow: 0 16px 36px -14px rgba(0, 0, 0, .75), 0 2px 8px -2px rgba(0, 0, 0, .4);
    --chn-bubble: var(--chn-surface);
    --chn-bubble-line: var(--chn-line);
    --chn-ink: #E6E8F2;
    --chn-muted: #A3A9C0;
}

/* The Dashboard's cards are a panel of their own in dark: its charts and bubbles take that panel. */
[data-bs-theme="dark"] .dx {
    --chn-surface: #0F1421;
    --chn-line: rgba(255, 255, 255, .1);
    --chn-bubble: #0F1421;
    --chn-bubble-line: rgba(255, 255, 255, .1);
}

/* ------------------------------------------------------------------ Hero surfaces (every area)
   The flat look, every style (html[data-minimal]: App.razor always writes it, "on" or "off"). The heroes never take
   their area gradients back; their charts keep their colors unless Minimal style is on. The bubbles, tooltips and
   Measure span below stay neutral either way. */

html[data-minimal],
html[data-minimal][data-bs-theme="dark"] {
    --iv-hero-bg: var(--chn-surface);
    --lb-hero-bg: var(--chn-surface);
    --bg-hero-bg: var(--chn-surface);
    --bg-hero-border: var(--chn-line);
    --rp-hero-bg: var(--chn-surface);
    --rc-hero: var(--rc-card, var(--chn-surface));
    --rc-signals-hero: var(--rc-card, var(--chn-surface));
    --rc-hero-border: var(--rc-card-border, var(--chn-line));
}

html[data-minimal] .rc-hue,
html[data-minimal][data-bs-theme="dark"] .rc-hue {
    --rc-hero: var(--rc-card, var(--chn-surface));
    --rc-hero-border: var(--rc-card-border, var(--chn-line));
}

/* The Accounts hero recipe (.ah): Investments, Budgets, Liabilities, Reports and Dividends heroes. */
html[data-minimal] .ah.ah.ah {
    --ah-bg: var(--chn-surface);
    --ah-border: var(--chn-line);
    --ah-value-pill: var(--chn-pill);
    --ah-pill: var(--chn-pill);
    --ah-range-bg: var(--chn-pill);
    --ah-tiles-bg: transparent;
}

/* The section heroes (.hx): Accounts, Liabilities, Reports, Net worth. */
html[data-minimal] .hx.hx.hx {
    --hx-base: var(--chn-surface);
    --hx-glow-1: transparent;
    --hx-glow-2: transparent;
    --hx-border: var(--chn-line);
    --hx-glass-line: var(--chn-line);
    --hx-range-bg: var(--chn-pill);
    --hx-halo: color-mix(in srgb, var(--chn-surface) 88%, transparent);
    --hx-float: var(--chn-surface);
}

/* The hero reading charts' canvas tokens (js/hero-scrub.js). */
html .hsc.hsc.hsc {
    --hs-panel: var(--chn-surface);
    --hs-glass: var(--chn-surface);
    --hs-glass-2: var(--chn-surface);
    --hs-glass-line: var(--chn-line);
}

/* Budgets hero: no glow behind the figure, the scrim and tags in the surface color. */
html[data-minimal] .ah.rpb-hero.rpb-hero {
    --rpb-glow: transparent;
    --rpb-scrim: color-mix(in srgb, var(--chn-surface) 80%, transparent);
    --rpb-tag-bg: color-mix(in srgb, var(--chn-surface) 92%, transparent);
}

html[data-minimal] .ah.rpb-hero .rpb-hero-main::before { display: none; }

/* Dashboard hero and its page glow. */
html[data-minimal] .dx::before,
html[data-minimal][data-bs-theme="dark"] .dx::before { display: none; }

html[data-minimal] .dx-heropanel,
html[data-minimal][data-bs-theme="dark"] .dx-heropanel {
    border-color: var(--chn-line);
    background: var(--chn-surface);
}

html[data-minimal] .dsh-hero,
html[data-minimal][data-bs-theme="dark"] .dsh-hero {
    border-color: var(--chn-line);
    background: var(--chn-surface);
}

/* ------------------------------------------------------------------ Bubbles: one solid card */

/* Tokens the area sheets already route their tooltips through. */
:root,
[data-bs-theme="dark"] {
    --rp-tip-bg: var(--chn-bubble);
    --rp-tip-text: var(--chn-ink);
    --rp-tip-note: var(--chn-muted);
    --rp-tip-border: var(--chn-bubble-line);
    --rp-tip-shadow: var(--chn-inset), var(--chn-shadow);
    --aiu-tip-bg: var(--chn-bubble);
    --aiu-tip-border: var(--chn-bubble-line);
    --dtl-glass: var(--chn-bubble);
    --dtl-glass-border: var(--chn-bubble-line);
    --dtl-glass-shadow: var(--chn-inset), var(--chn-shadow);
}

html .dx.dx {
    --dx-tip-bg: var(--chn-bubble);
    --dx-tip-ink: var(--chn-ink);
}

html .dx-pulse.dx-pulse {
    --dx-pulse-panel: var(--chn-surface);
    --dx-pulse-glass: var(--chn-surface);
    --dx-pulse-glass-2: var(--chn-surface);
    --dx-pulse-glass-line: var(--chn-line);
}

.dx-tip {
    border: 1px solid var(--chn-bubble-line);
    box-shadow: var(--chn-inset), var(--chn-shadow);
}

.dtl-bubble,
.lbu-tip {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.aiu-tip { box-shadow: var(--chn-inset), var(--chn-shadow); }

/* Syncfusion chart tooltips, every chart on the site (palette fill or the control's default): the solid bubble, a
   hairline and the theme's ink (no shadow: the tooltip's SVG is cut to its own size). CSS fill wins over the SVG fill attribute. */
[id$="_tooltip_path"] {
    fill: var(--chn-bubble);
    stroke: var(--chn-bubble-line);
    stroke-width: 1px;
}

[id$="_tooltip_text"],
[id$="_tooltip_text"] tspan {
    fill: var(--chn-ink);
}

/* ------------------------------------------------------------------ Investments and net worth chart bubbles */

/* Security chart, Performance series charts and the Accounts net worth chart (.scx-island). */
.scx,
[data-bs-theme="dark"] .scx,
.nwh .scx,
[data-bs-theme="dark"] .nwh .scx {
    --scx-glass-1: var(--chn-bubble);
    --scx-glass-2: var(--chn-bubble);
    --scx-glass-3: var(--chn-bubble);
    --scx-glass-line: var(--chn-bubble-line);
    --scx-glass-edge: transparent;
    --scx-glass-hi: transparent;
    --scx-notch-bg: var(--chn-bubble);
    --scx-tile: var(--chn-tile);
    --scx-tile-line: var(--chn-tile-line);
}

.scx-island,
.nwh .scx-island {
    background: var(--chn-bubble);
    box-shadow: var(--chn-inset), var(--chn-shadow);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.scx-island::before { display: none; }

/* Return calendar: the month bubble, the drill-down and the crosshair readout. */
.rcx,
[data-bs-theme="dark"] .rcx {
    --rcx-glass-1: var(--chn-bubble);
    --rcx-glass-2: var(--chn-bubble);
    --rcx-glass-3: var(--chn-bubble);
    --rcx-glass-line: var(--chn-bubble-line);
    --rcx-glass-edge: transparent;
    --rcx-glass-hi: transparent;
    --rcx-notch-bg: var(--chn-bubble);
    --rcx-tile: var(--chn-tile);
    --rcx-tile-line: var(--chn-tile-line);
    --rcx-shadow: var(--chn-shadow);
}

.rcx-bubble,
.rcx-drill,
.rcx-d-read {
    background: var(--chn-bubble);
    box-shadow: var(--chn-inset), var(--chn-shadow);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.rcx-drill { box-shadow: var(--chn-inset); }

/* ------------------------------------------------------------------ Hero figures: the amount alone (2026-11-19) */
/* Investments Overview (TOTAL MARKET VALUE) and the Budgets hero (Budgets page and Reports > Budgets): no pill behind the
   main amount, just the figure. The wrapper stays for layout and the rise animation. Minimal style only. */
html[data-minimal] .ah .ah-value-pill.ivo-value-pill,
html[data-minimal] .ah.rpb-hero .rpb-hero-value-pill {
    padding: 0;
    border-radius: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* ------------------------------------------------------------------ Reports heroes: the right pane on the chart's surface */
/* This month's pace (Reports tabs) and Where the pace leads (Net Worth) sit on the same plain surface as the hero chart
   beside them, with the hero's own neutral hairline: no blue glass gradient, corner glow, blur or tinted shadow. Their
   tiles take the neutral tile color, no hue tint. Minimal style only. */
html[data-minimal] .hx.hx-reports .hx-side.rp-pace2,
html[data-minimal] .hx.hx-reports .hx-side.rp-nwp {
    border-color: var(--chn-line);
    background: var(--chn-surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
}

html[data-minimal] .hx.hx-reports .hx-side.rp-pace2 .rp-pace2-legend > div,
html[data-minimal] .hx.hx-reports .hx-side.rp-nwp .rp-nwp-tile {
    background: var(--chn-tile);
    border-color: var(--chn-tile-line);
}

/* The pace line's stops are hollow rings cut from the same surface. */
html[data-minimal] .hx.hx-reports .hx-side.rp-nwp .rp-nwp-node { background: var(--chn-surface); }
