.trend {
  min-width: 0;
  user-select: none;
  -webkit-user-select: none;
}

.trend-inline {
  position: relative;
  align-self: end;
  padding-bottom: 1px;
}

.trend-meta {
  position: absolute;
  right: 0;
  top: -18px;
  max-width: 100%;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(2px);
  transition:
    opacity 120ms ease,
    transform 140ms var(--ease);
  pointer-events: none;
}

.trend-meta.visible {
  opacity: 1;
  transform: translateY(0);
}

.trend-chart {
  position: relative;
  width: 100%;
  height: 54px;
  touch-action: pan-y;
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.trend-area {
  fill: var(--text);
  opacity: .028;
}

.trend-line {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  path-length: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: trend-draw 480ms var(--ease) forwards;
}

.trend-line.empty {
  opacity: 0;
}

.trend-focus-line {
  stroke: var(--line-strong);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 100ms ease;
}

.trend-focus-dot {
  fill: var(--text);
  stroke: var(--bg);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 100ms ease;
}

.trend-empty {
  position: absolute;
  inset: auto 0 12px auto;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.best-day {
  display: none;
  margin-top: 5px;
  min-width: 0;
  text-align: right;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.25;
  letter-spacing: -0.008em;
}

.best-day.visible {
  display: block;
}

.best-day-label,
.best-day-value {
  display: block;
}

.best-day-label {
  margin-bottom: 2px;
  font-weight: 540;
}

.best-day-value {
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes trend-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 370px) {
  .trend-chart {
    height: 48px;
  }

  .trend-meta {
    font-size: 8.5px;
    top: -17px;
  }

  .best-day {
    font-size: 9px;
  }
}
