/* ==========================================================================
   Oddech — chart containers and the shared ECharts tooltip markup.
   ECharts needs an element with a real height: always use .chart (+ size modifier).
   Chart colours come from web/js/charts/theme.js (which reads tokens.css).
   ========================================================================== */

.chart { position: relative; width: 100%; height: var(--chart-h, 300px); min-width: 0; }
.chart--xs { --chart-h: 140px; }
.chart--sm { --chart-h: 220px; }
.chart--md { --chart-h: 300px; }
.chart--lg { --chart-h: 380px; }
.chart--xl { --chart-h: 460px; }
.chart--square { height: auto; aspect-ratio: 1 / 1; }
.chart--spark { --chart-h: 44px; }
@media (max-width: 767.98px) {
  .chart--lg { --chart-h: 320px; }
  .chart--xl { --chart-h: 360px; }
}

/* wide charts (calendar, hour x month) scroll horizontally on phones instead of squashing */
.chart-scroll { overflow-x: auto; overscroll-behavior-x: contain; margin: 0 calc(-1 * var(--s-5)); padding: 0 var(--s-5); scrollbar-width: none; }
.chart-scroll::-webkit-scrollbar { display: none; }
.chart-scroll > .chart { min-width: 720px; }
/* phone: hour x month heatmaps are transposed into a tall chart instead of scrolling sideways */
.chart.chart--portrait { --chart-h: 560px; }
.chart-scroll > .chart.chart--portrait { min-width: 0; }

/* loading / empty overlay inside a chart card */
.chart__state { position: absolute; inset: 0; display: grid; place-items: center; }
.chart__state .skeleton { width: 100%; height: 100%; border-radius: var(--r-md); }

/* small annotation under a chart ("Theil–Sen: −1,2 µg/m³/rok, p < 0,001") */
.chart-annot { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--text-muted); }
.chart-annot strong { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.chart-annot .swatch { width: 10px; height: 10px; }

/* key legend rendered in HTML above a chart (preferred over ECharts' own legend on mobile) */
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-xs); color: var(--text-muted); }
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend__line { width: 16px; height: 3px; border-radius: 2px; background: var(--swatch, var(--accent)); }
.chart-legend__line--dash { background: repeating-linear-gradient(90deg, var(--swatch, var(--chart-ref-line)) 0 4px, transparent 4px 7px); }

/* ---- Tooltip markup produced by charts/tooltip.js -------------------------- */
.tt { min-width: 160px; font-family: var(--font-sans); font-size: 12px; line-height: 1.45; color: var(--text); }
.tt__title { font-weight: 650; font-size: 12px; margin-bottom: 6px; color: var(--text); }
.tt__row { display: flex; align-items: center; gap: 8px; }
.tt__row + .tt__row { margin-top: 3px; }
.tt__swatch { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--swatch); }
.tt__name { color: var(--text-muted); flex: 1; }
.tt__value { font-weight: 650; font-variant-numeric: tabular-nums; }
.tt__note { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--divider); color: var(--text-faint); font-size: 11px; }

/* data-table fallback for a chart (accessibility + "Pokaż dane") */
.chart-table { margin-top: var(--s-3); }
.chart-table .table-wrap { max-height: 320px; }
