.hzs-accessible-chart {
  --hzs-chart-ink: #102a43;
  --hzs-chart-muted: #486581;
  --hzs-chart-border: #9fb3c8;
  --hzs-chart-surface: #f7fafc;
  margin: 2rem 0;
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--hzs-chart-border);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, var(--hzs-chart-surface));
  color: var(--hzs-chart-ink);
  box-shadow: 0 14px 34px rgba(16, 42, 67, 0.08);
}

.hzs-accessible-chart > .hzs-accessible-chart__title {
  margin: 0 0 0.65rem;
  color: var(--hzs-chart-ink);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.25;
}

.hzs-accessible-chart__summary {
  max-width: 78ch;
  color: #243b53;
  line-height: 1.65;
}

.hzs-accessible-chart__summary > :first-child {
  margin-top: 0;
}

.hzs-accessible-chart__summary > :last-child {
  margin-bottom: 0;
}

.hzs-accessible-chart__legend {
  margin: 0.9rem 0 0.7rem;
}

.hzs-accessible-chart__legend ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hzs-accessible-chart__legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--hzs-chart-ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.hzs-chart-key {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid #1f2933;
  border-radius: 3px;
  background-color: #0f5e82;
}

.hzs-chart-key--series-0 {
  background-color: #0f5e82;
}

.hzs-chart-key--series-1 {
  background-color: #a43a2f;
}

.hzs-chart-key--series-2 {
  background-color: #2e6b3b;
}

.hzs-chart-key--series-3 {
  background-color: #7a4e00;
}

.hzs-chart-key--series-4 {
  background-color: #4f3b78;
}

.hzs-chart-key--series-5 {
  background-color: #37474f;
}

.hzs-chart-key--series-6 {
  background-color: #006d77;
}

.hzs-chart-key--series-7 {
  background-color: #8f2d56;
}

.hzs-chart-key--series-8 {
  background-color: #5c4d00;
}

.hzs-chart-key--series-9 {
  background-color: #3d5a80;
}

.hzs-chart-key--series-10 {
  background-color: #6b4226;
}

.hzs-chart-key--series-11 {
  background-color: #5a189a;
}

.hzs-chart-key--line {
  height: 18px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: none;
}

.hzs-chart-key--line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  border-top: 3px solid #0f5e82;
}

.hzs-chart-key--line::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 3px;
  width: 8px;
  height: 8px;
  border: 2px solid #ffffff;
  outline: 1px solid #1f2933;
  border-radius: 50%;
  background: #0f5e82;
}

.hzs-chart-key--line.hzs-chart-key--series-1::before {
  border-color: #a43a2f;
  border-top-style: dashed;
}

.hzs-chart-key--line.hzs-chart-key--series-1::after {
  border-radius: 1px;
  background: #a43a2f;
}

.hzs-chart-key--line.hzs-chart-key--series-2::before {
  border-color: #2e6b3b;
  border-top-style: dotted;
}

.hzs-chart-key--line.hzs-chart-key--series-2::after {
  border-radius: 0;
  background: #2e6b3b;
  transform: rotate(45deg);
}

.hzs-chart-key--line.hzs-chart-key--series-3::before {
  border-color: #7a4e00;
  border-top-style: dashed;
}

.hzs-chart-key--line.hzs-chart-key--series-3::after {
  border-radius: 0;
  background: #7a4e00;
  transform: rotate(45deg) scale(0.8);
}

.hzs-chart-key--line.hzs-chart-key--series-4::before {
  border-color: #4f3b78;
  border-top-style: double;
}

.hzs-chart-key--line.hzs-chart-key--series-4::after {
  background: #4f3b78;
}

.hzs-chart-key--line.hzs-chart-key--series-5::before {
  border-color: #37474f;
  border-top-style: dotted;
}

.hzs-chart-key--line.hzs-chart-key--series-5::after {
  border-radius: 1px;
  background: #37474f;
}

.hzs-chart-key--line.hzs-chart-key--series-6::before {
  border-color: #006d77;
  border-top-style: solid;
}

.hzs-chart-key--line.hzs-chart-key--series-6::after {
  border-radius: 0;
  background: #006d77;
  transform: rotate(45deg);
}

.hzs-chart-key--line.hzs-chart-key--series-7::before {
  border-color: #8f2d56;
  border-top-style: dashed;
}

.hzs-chart-key--line.hzs-chart-key--series-7::after {
  border-radius: 0;
  background: #8f2d56;
  transform: rotate(45deg) scale(0.8);
}

.hzs-chart-key--line.hzs-chart-key--series-8::before {
  border-color: #5c4d00;
  border-top-style: dotted;
}

.hzs-chart-key--line.hzs-chart-key--series-8::after {
  background: #5c4d00;
}

.hzs-chart-key--line.hzs-chart-key--series-9::before {
  border-color: #3d5a80;
  border-top-style: dashed;
}

.hzs-chart-key--line.hzs-chart-key--series-9::after {
  border-radius: 1px;
  background: #3d5a80;
}

.hzs-chart-key--line.hzs-chart-key--series-10::before {
  border-color: #6b4226;
  border-top-style: double;
}

.hzs-chart-key--line.hzs-chart-key--series-10::after {
  border-radius: 0;
  background: #6b4226;
  transform: rotate(45deg);
}

.hzs-chart-key--line.hzs-chart-key--series-11::before {
  border-color: #5a189a;
  border-top-style: dotted;
}

.hzs-chart-key--line.hzs-chart-key--series-11::after {
  border-radius: 0;
  background: #5a189a;
  transform: rotate(45deg) scale(0.8);
}

.hzs-accessible-chart__canvas,
.hzs-accessible-chart__table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  border-radius: 10px;
}

.hzs-accessible-chart__canvas {
  border: 1px solid #bcccdc;
  background: #ffffff;
}

.hzs-accessible-chart__canvas:focus-visible,
.hzs-accessible-chart__table-wrap:focus-visible {
  outline: 3px solid #0f3b63;
  outline-offset: 3px;
}

.hzs-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: inherit;
  background: #ffffff;
}

.hzs-chart-svg__grid line {
  stroke: #9fb3c8;
  stroke-width: 1;
}

.hzs-chart-svg__grid text,
.hzs-chart-svg__category,
.hzs-chart-svg__value,
.hzs-chart-svg__unit,
.hzs-chart-svg__donut-total-label,
.hzs-chart-svg__donut-total {
  fill: #243b53;
  font-family: inherit;
  font-size: 13px;
}

.hzs-chart-svg__grid .hzs-chart-svg__axis {
  stroke: #243b53;
  stroke-width: 2;
}

.hzs-chart-svg__value {
  font-size: 14px;
  font-weight: 900;
  paint-order: stroke fill;
  stroke: #ffffff;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.hzs-chart-svg__category {
  font-size: 14px;
  font-weight: 700;
}

.hzs-chart-svg__unit {
  font-size: 14px;
  font-weight: 800;
}

.hzs-chart-svg__donut-total-label {
  font-size: 16px;
  font-weight: 700;
}

.hzs-chart-svg__donut-total {
  font-size: 22px;
  font-weight: 800;
}

.hzs-accessible-chart__table-section {
  margin-top: 2.25rem;
  padding: 0.25rem 0.85rem 0.85rem;
}

.hzs-accessible-chart--display-table .hzs-accessible-chart__table-section {
  margin-top: 1.25rem;
}

.hzs-accessible-chart__assistive-table {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hzs-accessible-chart__table-section h3,
.hzs-accessible-chart__table-section h4,
.hzs-accessible-chart__table-section h5,
.hzs-accessible-chart__table-section h6 {
  margin: 0 0 1rem;
  padding: 0 0.2rem;
  color: var(--hzs-chart-ink);
  font-size: 1.15rem;
  line-height: 1.4;
}

.hzs-accessible-chart__table-wrap {
  border: 1px solid #9fb3c8;
  border-radius: 0;
  background: #ffffff;
}

.hzs-accessible-chart__table {
  width: 100%;
  min-width: 640px;
  border: 0;
  border-collapse: collapse;
  color: #102a43;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.hzs-accessible-chart__table-caption {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hzs-accessible-chart__table th,
.hzs-accessible-chart__table td {
  padding: 0.85rem 1rem;
  border-right: 1px solid #bcccdc;
  border-bottom: 1px solid #bcccdc;
  text-align: right;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.hzs-accessible-chart__table th:last-child,
.hzs-accessible-chart__table td:last-child {
  border-right: 0;
}

.hzs-accessible-chart__table tbody tr:last-child > * {
  border-bottom: 0;
}

.hzs-accessible-chart__table thead th {
  background: #0f3b63;
  color: #ffffff;
  font-weight: 800;
}

.hzs-accessible-chart__table th:first-child {
  text-align: left;
}

.hzs-accessible-chart__table thead th:first-child,
.hzs-accessible-chart__table tbody th:first-child {
  min-width: 5.5rem;
  white-space: nowrap;
}

.hzs-accessible-chart__table td {
  white-space: nowrap;
}

.hzs-accessible-chart__table tbody tr:nth-child(even) {
  background: #f0f4f8;
}

.hzs-accessible-chart__source {
  margin-top: 1rem;
  color: var(--hzs-chart-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.hzs-accessible-chart__source a {
  color: #0f3b63;
  font-weight: 700;
  text-underline-offset: 3px;
}

.hzs-chart-error {
  padding: 0.85rem 1rem;
  border-left: 5px solid #a43a2f;
  background: #fff3f1;
  color: #722820;
  font-weight: 700;
}

@media (max-width: 700px) {
  .hzs-accessible-chart {
    padding: 1rem;
    border-radius: 12px;
  }

  .hzs-accessible-chart__legend ul {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hzs-chart-svg {
    width: 720px;
    min-width: 720px;
  }

  .hzs-accessible-chart__table-section {
    margin-top: 1.75rem;
    padding-right: 0.25rem;
    padding-bottom: 0.5rem;
    padding-left: 0.25rem;
  }

  .hzs-accessible-chart__table th,
  .hzs-accessible-chart__table td {
    padding: 0.75rem 0.8rem;
  }

  /* The theme stacks generic tables on mobile. Keep chart data as a real table. */
  .hzs-page-content .hzs-accessible-chart .hzs-accessible-chart__table {
    display: table !important;
    width: 100% !important;
  }

  .hzs-page-content .hzs-accessible-chart .hzs-accessible-chart__table thead {
    display: table-header-group !important;
    width: auto !important;
  }

  .hzs-page-content .hzs-accessible-chart .hzs-accessible-chart__table tbody {
    display: table-row-group !important;
    width: auto !important;
  }

  .hzs-page-content .hzs-accessible-chart .hzs-accessible-chart__table tr {
    display: table-row !important;
    width: auto !important;
  }

  .hzs-page-content .hzs-accessible-chart .hzs-accessible-chart__table th,
  .hzs-page-content .hzs-accessible-chart .hzs-accessible-chart__table td {
    display: table-cell !important;
    width: auto !important;
  }
}

@media (prefers-contrast: more) {
  .hzs-accessible-chart,
  .hzs-accessible-chart__canvas,
  .hzs-accessible-chart__table-wrap {
    border-width: 2px;
  }

  .hzs-chart-svg__grid line {
    stroke: #526d82;
  }
}

@media print {
  .hzs-accessible-chart {
    break-inside: avoid;
    box-shadow: none;
  }

  .hzs-accessible-chart__canvas,
  .hzs-accessible-chart__table-wrap {
    overflow: visible;
  }
}
