.currency-chart {
  --cc-accent: #4f9c88;
  --cc-accent-soft: rgba(79, 156, 136, 0.2);
  --cc-heading: #ffdbb1;
  --cc-muted: #aaa;
  --cc-axis: #646464;
  --cc-crosshair: rgba(255, 255, 255, 0.45);
  --cc-background: transparent;
  box-sizing: border-box;
  width: 100%;
  padding: 20px 20px 80px;
  color: #fff;
  background: var(--cc-background);
  font-family: Montserrat, Arial, sans-serif;
}

.currency-chart *,
.currency-chart *::before,
.currency-chart *::after {
  box-sizing: border-box;
}

.currency-chart__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.currency-chart__heading {
  margin: 0 0 28px;
  color: var(--cc-heading);
  font-size: 35px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
}

.currency-chart__eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--cc-heading);
  font-size: 16px;
  font-weight: 400;
}

.currency-chart__ranges {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 620px;
  margin: 0 auto 26px;
}

.currency-chart__range {
  min-width: 82px;
  min-height: 48px;
  margin: 0;
  padding: 10px 15px;
  border: 1px solid var(--cc-heading);
  border-radius: 30px;
  color: var(--cc-heading);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.currency-chart__range:hover,
.currency-chart__range:focus-visible,
.currency-chart__range[aria-pressed="true"] {
  color: #000;
  background: var(--cc-heading);
  outline: none;
}

.currency-chart__range:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 219, 177, 0.25);
}

.currency-chart__plot {
  position: relative;
  width: 100%;
  height: clamp(380px, 52vw, 600px);
  min-height: 380px;
}

.currency-chart__canvas {
  width: 100% !important;
  height: 100% !important;
}

.currency-chart__summary {
  max-width: 48em;
  min-height: 3.2em;
  margin: 18px auto 0;
  color: var(--cc-muted);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
}

.currency-chart__summary strong {
  color: #d2d2d2;
  font-size: 1.1em;
}

.currency-chart__direction {
  display: inline-block;
  margin: 0 0.15em;
  font-size: 0.8em;
  vertical-align: 0.08em;
}

.currency-chart__direction--up {
  color: var(--cc-accent);
}

.currency-chart__direction--down {
  color: #e05c5c;
}

.currency-chart__empty {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--cc-muted);
  font-size: 15px;
}

.currency-chart--empty .currency-chart__empty {
  display: grid;
}

@media (max-width: 640px) {
  .currency-chart {
    padding-right: 12px;
    padding-left: 12px;
  }

  .currency-chart__heading {
    font-size: 27px;
  }

  .currency-chart__ranges {
    justify-content: flex-start;
    gap: 8px;
    padding-bottom: 4px;
    overflow-x: auto;
  }

  .currency-chart__range {
    flex: 0 0 auto;
    min-width: 74px;
    min-height: 44px;
    padding: 8px 12px;
  }

  .currency-chart__plot {
    height: 420px;
    min-height: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .currency-chart__range {
    transition: none;
  }
}

/* Theme integration: title + period toggle live outside the component, so the
   component renders as a bare plot inside the existing .chart box. */
.chart.currency-chart {
  padding: 0;
}

.chart.currency-chart .currency-chart__heading,
.chart.currency-chart .currency-chart__ranges,
.chart.currency-chart .currency-chart__summary {
  display: none;
}

/* Match the original chart height (Chart.js default 2:1 aspect ratio). */
.chart.currency-chart .currency-chart__plot {
  height: auto;
  min-height: 0;
  aspect-ratio: 2 / 1;
}
