.chart-panel {
  position: relative;
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: var(--r-panel);
  background: var(--surface);
}

.chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
}

.ticker {
  font-size: var(--step-2);
  font-weight: 850;
  font-stretch: 125%;
  line-height: 1;
  letter-spacing: -0.01em;
}

.ticker-name {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: var(--step--1);
  line-height: 1.3;
}

.ticker-move {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-top: 4px;
  color: var(--accent);
  font-size: var(--step--1);
  font-weight: 650;
}

.stamp {
  padding: 0.5em 0.95em 0.55em;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-hand);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  transform: rotate(-4deg);
}

.chart-frame {
  position: relative;
  margin-top: 18px;
}

.no-js .chart-frame {
  display: none;
}

.chart-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  fill: var(--grid);
}

.candle {
  cursor: pointer;
}

.candle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.candle-hit {
  fill: transparent;
}

.candle-wick,
.candle-body {
  fill: var(--candle-up);
  transition: fill 0.15s ease;
}

.candle--down .candle-wick,
.candle--down .candle-body {
  fill: var(--candle-down);
}

.candle--next .candle-wick,
.candle--next .candle-body {
  fill: var(--candle-next);
}

.candle.is-active .candle-wick,
.candle.is-active .candle-body {
  fill: var(--candle-hot);
}

.chart-label {
  fill: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 650;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
}

.chart-note text {
  fill: var(--accent);
  font-family: var(--font-hand);
  font-size: 15px;
  font-weight: 600;
}

.chart-note polygon {
  fill: var(--accent);
}

@media (max-width: 480px) {
  .chart-note text {
    font-size: 13px;
  }
}

.chart-svg.is-entering .candle {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: candle-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i) * 80ms);
}

.chart-svg.is-entering .chart-note {
  animation: note-in 0.4s ease both;
  animation-delay: calc(var(--i) * 80ms + 450ms);
}

@keyframes candle-rise {
  from {
    transform: scaleY(0);
  }
}

@keyframes note-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.chart-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: max-content;
  max-width: min(260px, 100%);
  padding: 0.5em 0.8em;
  border-radius: 10px;
  background: var(--tip-bg);
  color: var(--tip-ink);
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
}

.chart-tip[hidden] {
  display: none;
}

.chart-foot {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: var(--step--1);
  line-height: 1.5;
}
