.momentum-chart-image {
  position: relative;
  display: block;
  container-type: inline-size;
}

.preview-chart .momentum-chart-image {
  width: 2202px;
}

.momentum-chart-labels {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

@supports (width: 1cqw) {
  :lang(zh) .momentum-chart-labels {
    display: block;
  }
}

/* Coordinates are the English text bounds in the 2202 px wide source image. */
.momentum-chart-label {
  --source-pixel: calc(100cqw / 2202);
  position: absolute;
  left: calc((var(--label-x) - 0.5) * var(--source-pixel));
  top: calc(var(--label-y) * var(--source-pixel));
  width: calc((var(--label-width) + 1.5) * var(--source-pixel));
  height: calc(10 * var(--source-pixel));
  background: #000;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: calc(10 * var(--source-pixel));
  font-weight: 400;
  line-height: calc(10 * var(--source-pixel));
  text-size-adjust: none;
  white-space: nowrap;
}

.momentum-chart-label.continuation {
  --simplified-label: "延续";
  --traditional-label: "延續";
  color: #7d8ea3;
}

.momentum-chart-label.up {
  --simplified-label: "涨破";
  --traditional-label: "漲破";
  color: #26a69a;
}

.momentum-chart-label.down {
  --simplified-label: "跌破";
  --traditional-label: "跌破";
  color: #ef5350;
}

.momentum-chart-label::before {
  content: var(--simplified-label);
}

:lang(zh-TW) .momentum-chart-label::before {
  content: var(--traditional-label);
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", sans-serif;
}
