.activity-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--ui-space-6);
  min-width: 0;
}
.activity-charts.charts-bars,
.activity-charts.charts-donut {
  grid-template-columns: minmax(0, 1fr);
}
.chart-panel .panel-body {
  position: relative;
  display: grid;
  min-height: 320px;
  padding: 24px;
}
.chart-panel .panel-body.is-loading > :not(.chart-loading),
.chart-panel .panel-body.has-error > .chart-content {
  visibility: hidden;
}
.chart-content {
  min-width: 0;
}
.chart-content.is-empty {
  display: flex;
  flex-direction: column;
}
.chart-content.is-empty > .chart-state {
  flex: 1;
}
.chart-feedback {
  position: absolute;
  inset: var(--ui-space-6);
  display: grid;
  place-items: center;
}
.chart-feedback[hidden] {
  display: none;
}
.chart-state.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  padding: 8px 0;
  margin: 0;
  border: 0;
  background: transparent;
  text-align: center;
  color: var(--ui-muted);
}
.chart-state-illustration {
  display: block;
  width: 152px;
  height: 114px;
  flex-shrink: 0;
  color: var(--ui-brand);
}
.chart-state-halo {
  fill: var(--ui-soft);
}
.chart-state-paper {
  fill: var(--ui-surface);
  stroke: var(--ui-line);
  stroke-width: 1.5;
}
.chart-state-line,
.chart-state-dashed,
.chart-state-spark {
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.35;
}
.chart-state-dashed {
  stroke-dasharray: 3 5;
}
.chart-state-dot,
.chart-state-bar {
  fill: currentColor;
  opacity: 0.14;
}
.chart-state-bar-accent {
  opacity: 0.3;
}
.chart-state-track {
  stroke: var(--ui-line);
  stroke-width: 13;
}
.chart-state-accent {
  stroke: currentColor;
  stroke-width: 13;
  stroke-linecap: round;
  opacity: 0.35;
}
.chart-state-badge {
  fill: var(--ui-danger-bg);
  stroke: var(--ui-surface);
  stroke-width: 3;
}
.chart-state-alert {
  stroke: var(--ui-danger);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.chart-state-copy {
  max-width: 34ch;
}
.chart-state-copy h3 {
  margin: 0;
  color: var(--ui-ink);
  font: 500 15px/1.45 var(--ui-font);
}
.chart-state-copy p {
  margin: 8px 0 0;
  color: var(--ui-muted);
  font: 400 var(--ui-text-small)/1.6 var(--ui-font);
  overflow-wrap: anywhere;
}
.chart-state .button {
  flex-shrink: 0;
}
.chart-panel[data-density="compact"] .chart-state {
  gap: 10px;
}
.chart-panel[data-density="compact"] .chart-state-illustration {
  width: 112px;
  height: 84px;
}
.chart-panel[data-density="compact"] .chart-feedback {
  inset: var(--ui-space-4);
}
.chart-legend:empty {
  display: none;
}
.chart-loading {
  position: absolute;
  inset: var(--ui-space-4);
  display: grid;
  place-items: center;
}
.chart-loading[hidden] {
  display: none;
}
.chart-loading-visual {
  display: grid;
  justify-items: center;
  gap: var(--ui-space-6);
  width: min(280px, 100%);
}
.chart-loading-ring {
  position: relative;
  width: 136px;
  height: 136px;
  box-sizing: border-box;
  border: 18px solid var(--ui-line);
  border-radius: 50%;
}
.chart-loading-ring::after {
  content: "";
  position: absolute;
  inset: -18px;
  border: 18px solid transparent;
  border-top-color: var(--ui-brand);
  border-right-color: color-mix(in srgb, var(--ui-brand) 35%, transparent);
  border-radius: 50%;
  animation: chart-loading-turn 1.6s linear infinite;
}
.chart-loading-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 136px;
  padding: 0 12px 8px;
  border-bottom: 1px solid var(--ui-line);
}
.chart-loading-bars i {
  flex: 1;
  max-width: 32px;
  height: 70%;
  border-radius: var(--ui-radius-control) var(--ui-radius-control) 0 0;
  background: color-mix(in srgb, var(--ui-brand) 35%, var(--ui-surface));
  transform-origin: bottom;
  animation: chart-loading-rise 1.5s ease-in-out infinite;
}
.chart-loading-bars i:nth-child(2) {
  height: 95%;
  animation-delay: 0.12s;
}
.chart-loading-bars i:nth-child(3) {
  height: 55%;
  animation-delay: 0.24s;
}
.chart-loading-bars i:nth-child(4) {
  height: 80%;
  animation-delay: 0.36s;
}
.chart-loading-bars i:nth-child(5) {
  height: 65%;
  animation-delay: 0.48s;
}
.chart-loading-legend {
  display: flex;
  gap: 8px;
}
.chart-loading-legend i {
  width: 36px;
  height: 6px;
  border-radius: 999px;
  background: var(--ui-line);
  animation: chart-loading-glow 1.5s ease-in-out infinite alternate;
}
.chart-loading-legend i:nth-child(2) {
  animation-delay: 0.2s;
}
.chart-loading-legend i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes chart-loading-turn {
  to {
    transform: rotate(360deg);
  }
}
@keyframes chart-loading-rise {
  0%,
  100% {
    transform: scaleY(0.5);
    opacity: 0.45;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}
@keyframes chart-loading-glow {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chart-loading-ring::after,
  .chart-loading-bars i,
  .chart-loading-legend i {
    animation: none;
  }
}
.chart-panel .panel-heading {
  padding: 16px 24px;
}
.chart-panel[data-density="compact"] .panel-body {
  min-height: 240px;
  padding: var(--ui-space-4);
}
.chart-panel[data-density="compact"] .activity-bars {
  height: 180px;
}
.chart-panel[data-density="compact"] .activity-donut {
  width: 150px;
  height: 150px;
}
.activity-donut {
  display: block;
  width: min(210px, 100%);
  height: 210px;
  margin: 0 auto 20px;
}
.activity-bars {
  height: 250px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 16px 8px 48px;
  border-bottom: 1px solid var(--ui-line);
  background: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent 49px,
    var(--ui-line) 50px
  );
}
.chart-bar {
  flex: 1;
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  position: relative;
  color: var(--ui-muted);
  font-size: var(--ui-text-small);
}
.chart-bar strong {
  font-weight: 500;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.chart-bar i {
  display: block;
  width: 100%;
  max-width: 48px;
  min-height: 0;
  border-radius: 5px 5px 0 0;
}
.chart-bar > span {
  position: absolute;
  top: calc(100% + 8px);
  width: 100%;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.3;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 16px;
  color: var(--ui-muted);
  font-size: var(--ui-text-small);
}
.chart-total {
  text-align: center;
  font-size: var(--ui-text-small);
  color: var(--ui-ink);
  font-variant-numeric: tabular-nums;
}
.chart-legend span {
  min-width: 0;
  overflow-wrap: anywhere;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.chart-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 9px;
}
@media (max-width: 760px) {
  .activity-charts {
    grid-template-columns: minmax(0, 1fr);
  }
  .chart-panel .panel-body {
    padding: 16px;
  }
  .activity-bars {
    gap: 12px;
    padding-bottom: 60px;
  }
}
