/* <x-donut-chart>: the donut, the total in the middle and the legend (the tooltip style is in x-bar-chart.css). */
x-donut-chart {
  display: block;
  position: relative;

  .donut { position: relative; width: 220px; max-width: 100%; margin: 6px auto 0; aspect-ratio: 1 / 1; }
  .donut-svg { position: absolute; inset: 0; }
  .donut-svg svg { width: 100%; height: 100%; display: block; }
  .segment { transition: opacity 0.25s var(--ease); }
  svg.hovering .segment:not(.on) { opacity: 0.4; }

  .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
  .center small { display: block; color: var(--fg-3); font-size: 12.5px; }
  .center strong { display: block; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }

  .legend { display: grid; gap: 8px; margin-top: 16px; }
  .legend div { display: flex; align-items: center; gap: 10px; color: var(--fg-2); }
  .legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
  .legend b { margin-left: auto; color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
  .legend em { font-style: normal; color: var(--fg-3); width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
}
