/* The line a figure with a history is drawn as — a price, a rating. Ink,
   because both are measurements rather than results; only a live point is
   mint, which means live here as it does everywhere else. Every label is
   HTML: text inside the SVG would scale down with the box and come out at six
   points on a phone. */
.trailchart {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-sm);
}

.trailchart__scale {
  position: relative;
  min-width: 2.5rem;
}

.trailchart__tick {
  position: absolute;
  right: var(--space-sm);
  transform: translateY(-50%);
  font-size: var(--text-2xs);
  color: var(--text-tertiary);
}

/* The right gutter is the reference label's, so the last point of the line
   has nothing to collide with. */
.trailchart__plot {
  position: relative;
  min-width: 0;
  padding-right: 3.5rem;
}

.trailchart__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* `non-scaling-stroke` is what keeps a 2px line 2px at any container width —
   without it the whole drawing is scaled, hairlines and all. */
.trailchart__line {
  fill: none;
  stroke: var(--ink-900);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.trailchart__line--live {
  stroke: var(--ink-300);
  stroke-dasharray: 5 4;
}

.trailchart__ref {
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}

.trailchart__dot {
  fill: var(--surface-card);
  stroke: var(--ink-900);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.trailchart__dot--live {
  fill: var(--mint-500);
  stroke: var(--mint-600);
}

/* Sits on the dashed reference line, with the canvas punched out behind it so
   the line does not run through the letters. */
.trailchart__ref-label {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-micro, 0.04em);
  color: var(--text-tertiary);
}

