/* ============================================================================
   DCC CHARTS — styles.  Companion to dcc-charts.js. Loaded after dcc-tokens.css.
   Chart chrome is recessive by design: the data is the only loud thing.
   ========================================================================== */

.ch-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-spark { width: 80px; height: 26px; flex: none; }
.ch-donut, .ch-ring { width: auto; }

/* Axis ticks and row labels wear text tokens, never a series colour. */
.ch-tick {
  font-family: var(--font-mono); font-size: 9.5px; fill: var(--chart-axis);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.ch-rowlabel { font-family: var(--font-body); font-size: 12px; fill: var(--chart-label); }
.ch-rowval {
  font-family: var(--font-mono); font-size: 11px; fill: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.ch-centre {
  font-family: var(--font-display); font-size: 22px; font-weight: var(--fw-black);
  fill: var(--text); font-variant-numeric: proportional-nums;
}
.ch-centre-sub {
  font-family: var(--font-body); font-size: 8.5px; font-weight: var(--fw-semi);
  fill: var(--text-3); text-transform: uppercase; letter-spacing: var(--ls-eyebrow);
}

/* Marks lift on hover rather than changing colour — colour carries identity
   and must not move. */
.ch-bar, .ch-seg { transition: opacity var(--dur-fast) var(--ease); cursor: default; }
.ch-svg:hover .ch-bar, .ch-svg:hover .ch-seg { opacity: .62; }
.ch-svg .ch-bar:hover, .ch-svg .ch-seg:hover { opacity: 1; }
.ch-hot { cursor: crosshair; }
.ch-ring-v { transition: stroke-dashoffset var(--dur-slow) var(--ease); }

/* Legend. Always present for two or more series; never the only thing
   carrying identity when a direct label would fit. */
.ch-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: var(--s-3); font-size: var(--t-xs); color: var(--text-2);
}
.ch-lg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ch-lg i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ch-legend-status .ch-lg b {
  font-family: var(--font-mono); color: var(--text); font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
}

/* Tooltip. One element, moved — positioned from the page so a card's overflow
   can never clip it. */
.ch-tip {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  background: var(--surface-overlay); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); padding: 8px 10px; min-width: 120px;
  box-shadow: var(--shadow-pop); font-size: var(--t-sm); color: var(--text);
  font-family: var(--font-body);
}
.ch-tip[hidden] { display: none; }
.ch-tip-h {
  font-size: var(--t-xs); color: var(--text-3); text-transform: uppercase;
  letter-spacing: var(--ls-caps); font-weight: var(--fw-semi); margin-bottom: 5px;
}
.ch-tip-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; white-space: nowrap; }
.ch-tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ch-tip-row b {
  margin-left: auto; padding-left: 14px; font-family: var(--font-mono);
  font-variant-numeric: tabular-nums; font-weight: var(--fw-semi);
}

/* The table behind every chart. Collapsed, one click away, and the reason a
   colour-only reading of any chart here is never the only reading available. */
.ch-table { margin-top: var(--s-2); }
.ch-table summary {
  font-size: var(--t-xs); color: var(--text-3); cursor: pointer;
  padding: 3px 0; list-style: none; user-select: none;
}
.ch-table summary::-webkit-details-marker { display: none; }
.ch-table summary::before { content: '▸ '; }
.ch-table[open] summary::before { content: '▾ '; }
.ch-table summary:hover { color: var(--text-2); }
.ch-table table { width: 100%; border-collapse: collapse; margin-top: var(--s-2); font-size: var(--t-xs); }
.ch-table caption { text-align: left; color: var(--text-3); font-size: var(--t-xs); padding-bottom: 4px; }
.ch-table th {
  text-align: left; color: var(--text-3); font-weight: var(--fw-semi);
  text-transform: uppercase; letter-spacing: var(--ls-caps); font-size: var(--t-micro);
  padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line);
}
.ch-table td {
  padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line-soft);
  color: var(--text-2); font-variant-numeric: tabular-nums;
}
.ch-table td:first-child { color: var(--text); }

/* Empty state. A chart with no data says so — it never draws a plausible
   shape out of nothing. */
.ch-empty {
  display: grid; place-items: center; min-height: 110px; padding: var(--s-5);
  border: 1px dashed var(--line); border-radius: var(--r-md);
  color: var(--text-3); font-size: var(--t-sm); text-align: center;
}

/* Forced-colors / high-contrast: hand the data to the OS palette and lean on
   the table view. */
@media (forced-colors: active) {
  .ch-bar, .ch-seg { forced-color-adjust: none; }
  .ch-tip { border: 1px solid CanvasText; }
}
