/* ==========================================================================
   Chart chrome. The marks themselves are styled inline by charts.js from the
   CSS custom properties in tokens.css.
   ========================================================================== */

.chart { position: relative; }

.chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 10px;
}
.chart__legend.is-empty { display: none; }

.chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-secondary);
}

.chart__key { flex: none; display: inline-block; }
.chart__key--line { width: 12px; height: 2px; border-radius: 1px; }
.chart__key--block { width: 10px; height: 10px; border-radius: 3px; }

.chart__plot { position: relative; width: 100%; }

.chart__svg { display: block; overflow: visible; }
.chart__svg:focus { outline: none; }
.chart__svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.chart__tick {
  font-size: 11px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.chart__endlabel {
  font-size: 11.5px;
  font-family: var(--font);
  font-weight: 600;
}

.chart__annotation {
  font-size: 11px;
  font-family: var(--font);
  font-weight: 600;
}

.chart__axis-title {
  font-size: 11px;
  font-family: var(--font);
  font-weight: 500;
}

.chart__overlay { cursor: crosshair; }
.chart__cell { cursor: pointer; transition: opacity 0.12s var(--ease); }
.chart__cell:focus { outline: none; }
.chart__bar { transition: opacity 0.12s var(--ease); }
.chart__bar:focus { outline: none; }

.chart__hover { transition: opacity 0.1s var(--ease); pointer-events: none; }

/* tooltip */
.chart__tip {
  position: absolute;
  z-index: 20;
  min-width: 120px;
  max-width: calc(100% - 8px);
  padding: 9px 11px;
  border-radius: var(--r-md);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--lift-3);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.12s var(--ease), transform 0.12s var(--ease);
}
.chart__tip.is-visible { opacity: 1; transform: translateY(0); }

.chart__tip-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
}

.chart__tip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
  white-space: nowrap;
}

/* Values lead, labels follow — the reader already knows the series. */
.chart__tip-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.chart__tip-name { font-size: 12px; color: var(--text-secondary); }
.chart__tip-row .chart__tip-value { margin-left: 0; }
.chart__tip-row .chart__tip-name { margin-left: auto; }

.chart__tip-footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Forced-colors / high-contrast: hue stops carrying meaning, so lean on the
   legend and the table view, and make sure marks stay visible. */
@media (forced-colors: active) {
  .chart__key { forced-color-adjust: none; border: 1px solid CanvasText; }
  .chart__tip { border: 1px solid CanvasText; }
}
