.mini-plot.has-y-axis {
  overflow: visible;
  margin-right: 60px;
  margin-left: 60px;
}

/* 目盛りの位置（上端8%〜下端92%）に合わせて4等分の補助線を引く。 */
.plot .gridlines {
  inset: 8% 0;
  border-top: 1px solid #2b507b;
  border-bottom: 1px solid #2b507b;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #2b507b 25%);
}

.chart-axis-caption {
  position: absolute;
  top: 3px;
  left: 5px;
  z-index: 1;
  padding: 3px 6px;
  border: 1px solid #355273;
  border-radius: 2px;
  background: #0b1729dd;
  color: #bdcee4;
  font-size: 10px;
  letter-spacing: .04em;
  pointer-events: none;
}

.y-axis {
  position: absolute;
  top: 8%;
  bottom: 8%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 50px;
  color: #b9cce4;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
}

.y-axis-left {
  right: calc(100% + 9px);
  align-items: flex-end;
  text-align: right;
}

.y-axis span {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin: -9px 0;
  padding: 2px 4px;
  border: 1px solid #2c4664;
  border-radius: 2px;
  background: #0b1729dd;
}

.y-axis-right {
  left: calc(100% + 9px);
  align-items: flex-start;
}

@media (max-width: 700px) {
  .mini-plot.has-y-axis {
    margin-right: 45px;
    margin-left: 45px;
  }

  .y-axis {
    width: 38px;
    font-size: 9px;
  }

  .chart-axis-caption {
    font-size: 8px;
  }

  .y-axis-left {
    right: calc(100% + 6px);
  }

  .y-axis-right {
    left: calc(100% + 6px);
  }
}

/* 見出しとホバー表示の印を、固定ヘッダーより下に保つ。 */
.mini-plot,
.work-sparkline {
  isolation: isolate;
}

[data-chart-hover] {
  cursor: crosshair;
  touch-action: pan-y;
}

.chart-marker {
  position: absolute;
  z-index: 2;
  width: 9px;
  height: 9px;
  border: 2px solid #eef6ff;
  border-radius: 50%;
  background: #3f8de0;
  box-shadow: 0 0 0 3px #3f8de044;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.chart-marker[hidden],
.chart-tooltip[hidden] {
  display: none;
}

.chart-tooltip {
  position: fixed;
  z-index: 30;
  display: grid;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid #3d6a99;
  border-radius: 3px;
  background: #0b1729f2;
  box-shadow: 0 8px 22px #0009;
  color: #edf4ff;
  white-space: nowrap;
  text-align: center;
  transform: translate(-50%, calc(-100% - 12px));
  pointer-events: none;
}

.chart-tooltip small {
  color: #a8b9cf;
  font-size: 10px;
}

.chart-tooltip b {
  color: #71b8ff;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
