:root {
  --black: #222;
  --white: #fff;
  --primary: #c9a227;
  --secondary: #e8b923;
  --tertiary: #b8860b;
  --accent: #ff4d79;
  --attention: #e60000;
  --gray: #b1b1b1;
  --dark-gray: #999;
  --bg-dark-gray: #ddd;
  --bg-gray: #f7f7f7;
  --bg-green: #e5f5f4;
  --bg-yellow: #fffcd7;
  --link: #009995;
  --btn: #009995;
  --btn-bg: #fff;
  --gold-20: #f8f0cc;
  --gold-40: #ebdea6;
  --gold-60: #ac8919;
  --gold-80: #c1b78a;
  --platinum-20: #e7f5fa;
  --platinum-40: #c3dee8;
  --platinum-60: #5194ad;
  --platinum-80: #9eafba;
  --silver-20: #ebeaf2;
  --silver-40: #d0cfe6;
  --silver-60: #9b7ccc;
  --silver-80: #a9a9ba;
}

:root {
  --shadow: 0 0 7px rgb(0 0 0 / 20%);
  --menu-gap: clamp(12px, 1vw, 25px);
  --link-hover: 0.6;
  --transition: 0.3s ease;
  --drop-shadow: 0 0 5px rgb(0 0 0 / 20%);
}

.p-price-chart {
  padding-block: 40px 60px;
}

.p-price-chart__title {
  margin-bottom: 8px;
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 700;
  line-height: 1.4;
}

.p-price-chart__unit {
  margin-bottom: 16px;
  font-size: 12px;
  color: #666;
  text-align: right;
}

.p-price-chart__canvas-wrap {
  position: relative;
  width: 100%;
  height: 400px;
  aspect-ratio: 610/400;
  margin-bottom: 24px;
}

.p-price-chart__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  margin-bottom: 20px;
}

.p-price-chart__date-range {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}

@media screen and (width <=767px) {
  .p-price-chart__date-range {
    font-size: 12px;
    line-height: 1.2;
  }
}

.p-price-chart__date {
  background: var(--white);
  border: 1px solid var(--bg-dark-gray);
  border-radius: 4px;
}

@media screen and (width >=768px) {
  .p-price-chart__date {
    min-width: 140px;
    padding: 8px 10px;
  }
}

@media screen and (width <=767px) {
  .p-price-chart__date {
    padding: 8px 6px;
  }
}

@media screen and (width <=767px) {
  .p-price-chart__range-separator {
    flex-shrink: 0;
  }
}

.p-price-chart__range-error {
  width: 100%;
  margin: 0;
  color: #c0392b;
  font-size: 13px;
}

.p-price-chart__periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.p-price-chart__period {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--gold-60);
  cursor: pointer;
  background: var(--white);
  border: 1px solid var(--gold-60);
  border-radius: 4px;
  transition: background-color var(--transition), color var(--transition);
}

.p-price-chart__period.is-active,
.p-price-chart__period[aria-pressed=true] {
  color: var(--white);
  background: var(--gold-60);
  border-color: var(--gold-60);
}

@media (any-hover: hover) {
  .p-price-chart__period:hover {
    opacity: 0.6;
  }

  .p-price-chart__period.is-active:hover,
  .p-price-chart__period[aria-pressed=true]:hover {
    color: var(--white);
    background: var(--gold-60);
    border-color: var(--gold-60);
  }
}

.p-price-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-left: 0;
  list-style: none;
}

.p-price-chart__legend-btn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 2px 0;
  font-size: 14px;
  color: var(--black);
  cursor: pointer;
  background: transparent;
  transition: color var(--transition);
}

.p-price-chart__legend-btn[aria-pressed=true] {
  color: var(--legend-color);
}

.p-price-chart__legend-btn.is-inactive {
  color: var(--black);
  opacity: 1;
}

@media (any-hover: hover) {
  .p-price-chart__legend-btn:hover {
    opacity: 0.7;
  }

  .p-price-chart__legend-btn.is-inactive:hover {
    opacity: 1;
  }
}

.p-price-chart__legend-checkbox {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  margin-top: 0.15em;
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: 2px;
  transition: background-color var(--transition), border-color var(--transition);
}

.p-price-chart__legend-btn[aria-pressed=true] .p-price-chart__legend-checkbox {
  background: var(--legend-color);
  border-color: var(--legend-color);
}

.p-price-chart__legend-btn[aria-pressed=true] .p-price-chart__legend-checkbox::after {
  position: absolute;
  bottom: 0.2em;
  left: 0.3em;
  width: 0.5em;
  height: 0.9em;
  content: "";
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  rotate: 45deg;
}

.p-price-chart__legend-label {
  line-height: 1.4;
}

@media screen and (width <=767px) {
  .p-price-chart {
    padding-block: 30px 40px;
  }

  .p-price-chart__canvas-wrap {
    height: 280px;
  }

  .p-price-chart__period {
    flex: 1 1 calc(50% - 8px);
    min-width: 100px;
  }
}