.chart-card {
  position: relative;
  height: 260px;
}

.chart-card.bar-card {
  height: 220px;
}

.chart-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  height: 100%;
}

.chart-canvas-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.chart-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  max-height: 100%;
  overflow-y: auto;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend-item .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-legend-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.chart-legend-item .name {
  font-size: var(--font-size-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-secondary);
}

.chart-legend-item .amount {
  font-size: var(--font-size-sm);
  font-weight: 600;
  white-space: nowrap;
}

.chart-legend-item .pct {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.category-rank-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
}

.category-rank-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-rank-item input[type='checkbox'] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--color-accent);
}

.category-rank-item .name {
  flex: 1;
  font-size: var(--font-size-sm);
}

.category-rank-item .amount {
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.category-rank-item .percent {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  width: 40px;
  text-align: right;
}
