/* Enlarged static charts, loaded only by pages that offer this viewer. */
.article-body .chart-enlarge {
  display: block;
  color: #1b2a4a;
  text-decoration: none;
  cursor: zoom-in;
}

.chart-enlarge__label {
  display: block;
  padding: .75rem;
  background: #e9f0f0;
  font-size: .875rem;
  font-weight: 600;
  text-align: center;
  text-wrap: pretty;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.chart-enlarge:focus-visible,
.chart-viewer :focus-visible {
  outline: 3px solid #007f7e;
  outline-offset: -3px;
}

.chart-viewer {
  box-sizing: border-box;
  width: calc(100% - 2rem);
  height: calc(100% - 2rem);
  height: calc(100dvh - 2rem);
  max-width: 120rem;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: .5rem;
  background: #fff;
  color: #1b2a4a;
  font-family: inherit;
  overflow: hidden;
}

.chart-viewer[open] {
  display: flex;
  flex-direction: column;
}

.chart-viewer::backdrop { background: rgb(27 42 74 / 80%); }

.chart-viewer__header,
.chart-viewer__controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .5rem 1rem;
  flex-shrink: 0;
}

.chart-viewer__header { justify-content: space-between; }

.chart-viewer__title {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  text-wrap: balance;
}

.chart-viewer button,
.chart-viewer__original {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border: 1px solid #1b2a4a;
  border-radius: .25rem;
  background: #fff;
  color: #1b2a4a;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}

.chart-viewer button:disabled { opacity: .4; cursor: default; }
.chart-viewer__controls { background: #e9f0f0; }
.chart-viewer__zoom { min-width: 3.5rem; font-size: .875rem; }
.chart-viewer__hint { margin: 0; padding: .5rem 1rem; font-size: .8125rem; text-wrap: pretty; }

.chart-viewer__canvas {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
  touch-action: pan-x pan-y pinch-zoom;
}

.chart-viewer__image {
  display: block;
  max-width: none;
  height: auto;
  margin: 0 auto;
  background: #fff;
}

.chart-viewer__loading,
.chart-viewer__error { margin: 1rem; text-wrap: pretty; }
.chart-viewer [hidden] { display: none; }

@media (max-width: 600px) {
  .chart-viewer { width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
  .chart-viewer__header,
  .chart-viewer__controls { padding: .5rem; }
  .chart-viewer__original { margin-left: auto; }
}

@media print {
  .chart-enlarge__label,
  .chart-viewer[open] { display: none; }
}
