/* <ad-chart>: SVG bars with pattern fills; the table remains for AT. */
ad-chart {
  display: block;
  max-inline-size: var(--measure-wide);
}

.chart {
  inline-size: 100%;
  block-size: auto;
  font-family: var(--font-sans);
  overflow: visible;
}

.chart__label {
  font-size: 15px;
  font-weight: 600;
  fill: var(--text);
}

.chart__value {
  font-size: 15px;
  font-weight: 700;
  fill: var(--text);
  font-variant-numeric: tabular-nums;
}

.chart__bar {
  stroke: var(--text);
  stroke-width: 1;
}

.chart__fill--0 { fill: var(--accent); }
.chart__fill--1 { fill: var(--amber); }
.chart__fill--2 { fill: var(--lavender); }
.chart__fill--3 { fill: var(--coral); }

.chart__hatch {
  stroke: oklch(from var(--text) l c h / 0.55);
  stroke-width: 1.5;
}

/* Bars grow in when they scroll into view. */
@media (prefers-reduced-motion: no-preference) {
  .chart__bar {
    transform-origin: left center;
    animation: bar-grow 700ms var(--ease-out) both;
  }

  @keyframes bar-grow {
    from {
      transform: scaleX(0.05);
    }
  }
}

/* Forced colours (Windows High Contrast): patterns keep bars distinct. */
@media (forced-colors: active) {
  .chart__fill--0,
  .chart__fill--1,
  .chart__fill--2,
  .chart__fill--3 {
    fill: Canvas;
  }

  .chart__hatch,
  .chart__bar {
    stroke: CanvasText;
  }
}

.chart__table.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
