.csa-analytics-grid,
.chartrow {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  margin: 12px 0 18px;
  align-items: stretch;
}

.csa-chart-card,
.chart {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--csa-chart-line, rgba(15, 23, 42, 0.12));
  border-radius: 8px;
  padding: 14px;
}

.csa-chart-card h3,
.chart h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--csa-chart-ink, currentColor);
}

.csa-chart {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.csa-chart svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.csa-chart text {
  font-family: inherit;
  font-size: 12px;
  fill: var(--csa-chart-muted, #64748b);
}

.csa-chart .csa-chart-value,
.csa-chart .csa-chart-label {
  fill: var(--csa-chart-ink, #111827);
}

.csa-chart .csa-chart-value {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.csa-stat-tile {
  display: grid;
  gap: 4px;
  min-height: 126px;
  align-content: center;
}

.csa-stat-label {
  color: var(--csa-chart-muted, #64748b);
  font-size: 0.78rem;
  line-height: 1.2;
}

.csa-stat-value {
  color: var(--csa-chart-ink, #111827);
  font-size: clamp(1.8rem, 10cqi, 3rem);
  line-height: 1;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.csa-stat-note {
  color: var(--csa-chart-muted, #64748b);
  font-size: 0.82rem;
  line-height: 1.3;
}

.csa-chart-legend,
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  padding: 0;
  color: var(--csa-chart-muted, #64748b);
  font-size: 0.78rem;
  line-height: 1.3;
}

.csa-chart-legend span,
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.csa-chart-legend i,
.legend i {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex: none;
}

.csa-chart-tip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
