/* Charts: the two drawn pieces that are not an ECharts chart
   (docs/portal.md, "Charts: the one engine").

   Meter: "used of total" as one bar. templates/_meter.html draws it on
   the server, static/js/dashboard/meter.js builds the same elements for
   rows that arrive by fetch, and the dashboard's progress card
   (static/js/dashboard/render.js) uses that script too.

   Sparkline: a tiny line or bar strip with no axes. templates/_sparkline.html
   draws it from what services/sparkline.py builds.

   base.html links this file for every signed-in page. The documents that
   do not extend base.html (the public report page, the report card frame
   and the two print documents) inline it with chart_css(), so a PDF
   carries the same rules.

   The fills are shapes inside an <svg>: their size is an attribute the
   macro or the script writes, never a style= attribute, so the same
   markup is allowed on a moved page (tests/test_app_guard.py).

   Colours are the theme's tokens, read where the piece is drawn, so both
   follow light and dark. A surface with its own colours (the client home
   feature card, a report tile) sets --spark-color and friends on the
   piece from its own stylesheet. */

/* ── Meter ─────────────────────────────────────────────────────────── */
.app-meter { --meter-fill: var(--chart-lead, var(--con-data)); --meter-h: 8px; display: block; min-width: 0; }
.app-meter-bar { display: block; width: 100%; height: var(--meter-h); border-radius: 999px; overflow: hidden; }
.app-meter-track { fill: color-mix(in srgb, var(--meter-fill) 22%, transparent); }
.app-meter-fill { fill: var(--meter-fill); }
/* What is used beyond the total: stripes, so it reads as overage in any
   colour and for anyone who cannot tell the tones apart. */
.app-meter-over {
  stroke: var(--con-bad-solid, var(--con-bad)); stroke-width: var(--meter-h);
  stroke-dasharray: 3 3;
}
.app-meter-ok { --meter-fill: var(--con-good-solid, var(--con-good)); }
.app-meter-warn { --meter-fill: var(--con-warn-solid, var(--con-warn)); }
.app-meter-bad { --meter-fill: var(--con-bad-solid, var(--con-bad)); }
/* No total known: an empty track, no fill and no value. */
.app-meter-none .app-meter-track { fill: var(--theme-border); }
/* The dashboard progress card's thick bar. */
.app-meter-lg { --meter-h: 26px; }
.app-meter-lg .app-meter-bar { border-radius: 6px; }
.app-meter-text {
  margin-top: 4px; font-size: 12px; line-height: 1.4;
  color: var(--theme-text-muted); font-variant-numeric: tabular-nums;
}

/* ── Sparkline ─────────────────────────────────────────────────────── */
.app-spark {
  --spark-color: var(--chart-lead, var(--con-data)); --spark-width: 1.5px;
  display: block; width: 100%; height: 36px; overflow: visible;
}
.app-spark-line, .app-spark-compare {
  fill: none; stroke: var(--spark-color); stroke-width: var(--spark-width);
  stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke;
}
/* The series it is compared with: fainter and dashed, under the line. */
.app-spark-compare {
  stroke: var(--spark-compare, var(--theme-text-muted)); stroke-width: 1.5px;
  stroke-dasharray: 4 3; stroke-linecap: butt;
}
.app-spark-area { fill: var(--spark-fill, color-mix(in srgb, var(--spark-color) 14%, transparent)); stroke: none; }
.app-spark-bar { fill: var(--spark-color); }
