/* <x-bar-chart>: the stacked bar chart and its tooltip (the tooltip style is shared with x-donut-chart). */
x-bar-chart {
  display: block;
  position: relative;
  width: 100%;
  height: 280px;

  & svg { display: block; width: 100%; overflow: visible; }
  & .grid { stroke: var(--line); stroke-width: 1; }
  & .axis-text { fill: var(--fg-3); font-size: 12px; font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
  & .segment { transition: opacity 0.25s var(--ease); }
  & svg.hovering .column:not(.on) .segment { opacity: 0.4; }
  & .hit { fill: transparent; }
}

x-bar-chart .tip, x-donut-chart .tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  padding: 10px 12px;
  font-size: 13px;
  min-width: 160px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);

  &.show { opacity: 1; transform: none; }
  & .tip-title { font-weight: 600; margin-bottom: 6px; }
  & .tip-row { display: flex; align-items: center; gap: 8px; color: var(--fg-2); }
  & .tip-row i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
  & .tip-row b { margin-left: auto; color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 12px; }
  & .tip-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
}
