.chart-shell {
  max-width: 880px;
  padding-bottom: 42px;
}

.chart-topbar {
  padding-top: 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.back-link svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chart-heading {
  position: relative;
  padding: 58px 2px 28px;
}

.asset-switch {
  position: absolute;
  top: 52px;
  left: 0;
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.65);
}

.asset-switch a {
  min-width: 47px;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.asset-switch a.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(28, 31, 25, 0.06);
}

.chart-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.chart-heading h1 {
  margin: 0;
  font-size: clamp(27px, 7vw, 40px);
  letter-spacing: -1.2px;
}

.chart-current {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 14px;
}

.chart-current strong {
  font-size: clamp(25px, 7vw, 36px);
  font-weight: 800;
}

.chart-current > span {
  color: var(--muted);
  font-size: 10px;
}

.chart-current em {
  margin-right: 5px;
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--muted);
  background: #e9eae5;
  direction: ltr;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.chart-current em.is-up {
  color: var(--green);
  background: var(--green-soft);
}

.chart-current em.is-down {
  color: var(--red);
  background: var(--red-soft);
}

.chart-card {
  padding: 16px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(25, 28, 21, 0.035);
}

.chart-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 16px;
}

.chart-toolbar h2 {
  margin: 0 0 3px;
  font-size: 13px;
}

.chart-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.range-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #f4f4f1;
}

.range-tabs button {
  padding: 5px 7px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-family: inherit;
  font-size: 8px;
  font-weight: 600;
  cursor: pointer;
}

.range-tabs button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 7px rgba(28, 31, 25, 0.07);
}

.chart-stage {
  position: relative;
  height: 290px;
  direction: ltr;
}

#priceChart {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 100px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
  background: rgba(25, 27, 23, 0.92);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.14);
  direction: rtl;
  font-size: 9px;
  line-height: 1.8;
  pointer-events: none;
  transform: translate(-50%, -110%);
}

.chart-tooltip strong {
  display: block;
  font-size: 11px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  direction: rtl;
  font-size: 11px;
}

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

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 24px;
  align-items: center;
  padding: 8px 4px 0;
  color: var(--muted);
  font-size: 8px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 14px;
  height: 2px;
  border-radius: 2px;
}

.chart-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.chart-stats article {
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
}

.chart-stats span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 8px;
}

.chart-stats strong {
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 700;
}

.chart-footer {
  display: flex;
  justify-content: space-between;
  padding: 18px 3px 0;
  color: var(--muted);
  font-size: 8px;
}

.chart-footer span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (min-width: 700px) {
  .chart-card {
    padding: 20px 20px 14px;
  }

  .chart-stage {
    height: 360px;
  }

  .range-tabs button {
    padding-inline: 10px;
    font-size: 9px;
  }
}

@media (max-width: 430px) {
  .chart-toolbar {
    display: block;
  }

  .range-tabs {
    margin-top: 12px;
  }

  .range-tabs button {
    flex: 1;
  }

  .chart-stage {
    height: 260px;
  }
}
