/* Line chart (app/views/charts/_line_chart.html.erb). Bootstrap has no chart
   component; everything else stays Bootstrap. Colors are Bootstrap tokens so
   the chart follows the color mode. */
.line-chart {
  padding-right: 1rem;
}

.line-chart-plot {
  position: relative;
  height: 15rem;
  margin: 1rem 0 0 4.5rem;
  touch-action: pan-y;
}

.line-chart-plot:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
  border-radius: var(--bs-border-radius-sm);
}

.line-chart-plot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.line-chart-grid {
  stroke: var(--bs-border-color);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.line-chart-line {
  fill: none;
  stroke: var(--bs-primary);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.line-chart-line--dashed {
  stroke-dasharray: 6 4;
}

.line-chart-area {
  fill: var(--bs-primary);
  fill-opacity: 0.1;
}

.line-chart-y-label,
.line-chart-x-label {
  position: absolute;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.line-chart-y-label {
  right: calc(100% + 0.5rem);
  transform: translateY(-50%);
}

.line-chart-x-axis {
  position: relative;
  height: 1.5rem;
  margin: 0.375rem 0 0 4.5rem;
}

.line-chart-x-label {
  transform: translateX(-50%);
}

.line-chart-dot {
  position: absolute;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--bs-primary);
  box-shadow: 0 0 0 2px var(--bs-body-bg);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.line-chart-end-label {
  position: absolute;
  transform: translate(-100%, calc(-100% - 0.5rem));
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.line-chart-crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--bs-secondary-color);
  pointer-events: none;
}

.line-chart-tooltip {
  position: absolute;
  top: 0;
  z-index: 2;
  min-width: 10rem;
  font-size: 0.875rem;
  pointer-events: none;
}

.line-chart-key {
  display: inline-block;
  width: 1rem;
  border-top: 2px solid var(--bs-primary);
  vertical-align: middle;
}

.line-chart-key--dashed {
  border-top-style: dashed;
}
