/* Chart styles - shared by leaderboard and content charts */

/* Chart section layout */
.chart-section {
  margin-bottom: 2.5rem;
}

/* Charts embedded inside prose need balanced spacing above and below. */
.section > .chart-section {
  margin: 1.75rem 0;
}

.chart-container {
  background: var(--gray-900);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem;
}

/* Scatter chart */
.scatter-chart {
  display: block;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  height: auto;
  aspect-ratio: 800 / 500;
}

.scatter-chart .grid-line {
  stroke: var(--gray-800);
}

.scatter-chart .axis-label {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  fill: var(--text);
  text-anchor: middle;
}

.scatter-chart .axis-label.x-axis-label-rotated {
  text-anchor: end;
  font-size: 0.65rem;
}

.scatter-chart .y-axis-label {
  text-anchor: end;
}

.scatter-chart--dense-y .axis-label.y-axis-label {
  font-size: 0.65rem;
}

.scatter-chart .axis-title {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 0.875rem;
  fill: var(--text);
  text-anchor: middle;
}

.scatter-chart .ci-line,
.scatter-chart .ci-cap {
  stroke-width: 2;
  opacity: 0.5;
}

.scatter-chart .data-point {
  stroke: var(--gray-900);
  stroke-width: 1.5;
  cursor: pointer;
  transition: r 0.15s ease;
}

.scatter-chart .data-point:hover {
  r: 8;
}

.scatter-chart .scatter-label {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  fill: var(--text);
}

/* Connector arrows between points */
.scatter-chart .connector-line {
  stroke: var(--text);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.scatter-chart .arrowhead {
  fill: var(--text);
}

/* Chart tooltip */
.chart-tooltip {
  position: fixed;
  background: var(--bg);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  pointer-events: none;
  font-size: 0.75rem;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 1000;
  white-space: nowrap;
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip .tooltip-agent {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-weight: 600;
}

.chart-tooltip .tooltip-stats {
  color: var(--text);
}

/* Responsive */
@media (max-width: 640px) {
  .chart-section {
    margin-bottom: 2rem;
  }

  .chart-container {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}
