@keyframes cpStatusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(176, 122, 6, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(176, 122, 6, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(176, 122, 6, 0);
  }
}

@keyframes cpShimmer {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(220%);
  }
}

@keyframes cpDotBlink {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes cpLiveBorderPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(6, 164, 176, 0.4),
      inset 0 0 0 1px rgba(6, 164, 176, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(6, 164, 176, 0),
      inset 0 0 0 1px rgba(6, 164, 176, 0.75);
  }
}

@keyframes cpLiveDotPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: translateY(-50%) scale(0.95);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
  }
}

@keyframes cpRateSkeletonWave {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* История обменов: активные статусы pending/processing идут как _yelow */
.story__element_status._yelow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  animation: cpStatusPulse 1.9s ease-out infinite;
}

.story__element_status._yelow::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: cpDotBlink 1.3s ease-in-out infinite;
}

/* Карточка статусов заявки: анимируем только живые этапы */
.status .item.status-active-live {
  position: relative;
  overflow: hidden;
  padding-right: 28px;
  animation: cpLiveBorderPulse 1.6s ease-in-out infinite;
  isolation: isolate;
}

.status .item.status-active-live > * {
  position: relative;
  z-index: 2;
}

.status .item.status-active-live::before {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: cpLiveDotPulse 1.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

.status .item.status-active-live::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -120%;
  width: 120%;
  background: linear-gradient(
    110deg,
    rgba(6, 164, 176, 0) 20%,
    rgba(6, 164, 176, 0.35) 50%,
    rgba(6, 164, 176, 0) 80%
  );
  animation: cpShimmer 1.8s linear infinite;
  will-change: transform;
  pointer-events: none;
  z-index: 1;
}

/* Блок курса на главной: числа в формуле должны быть одинаково контрастными */
.curs-excenge__top .exchange-rate-value {
  opacity: 1;
}

.curs-excenge__top.exchange-rate-header {
  align-items: center;
  flex-wrap: wrap;
  overflow: hidden;
}

.curs-excenge__top.exchange-rate-header .exchange-rate-live {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.curs-excenge__top.exchange-rate-header .exchange-rate-skeleton {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.curs-excenge__top.exchange-rate-header .exchange-rate-skeleton-segment {
  display: block;
  height: 16px;
  border-radius: 5px;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(255, 255, 255, 0.24) 45%,
    rgba(255, 255, 255, 0.08) 65%
  );
  background-size: 230% 100%;
  animation: cpRateSkeletonWave 1.4s ease-in-out infinite;
  min-width: 40px;
}

.curs-excenge__top.exchange-rate-header .exchange-rate-skeleton-segment--left {
  flex: 0 1 52%;
  max-width: 180px;
}

.curs-excenge__top.exchange-rate-header .exchange-rate-skeleton-segment--right {
  flex: 0 1 38%;
  max-width: 150px;
  animation-delay: 0.2s;
}

.curs-excenge__top.exchange-rate-header .exchange-rate-skeleton-eq {
  flex: 0 0 auto;
  opacity: 0.4;
}

.curs-excenge__top.exchange-rate-header.is-loading .exchange-rate-live {
  display: none;
}

.curs-excenge__top.exchange-rate-header.is-loading .exchange-rate-skeleton {
  display: inline-flex;
}

@media (max-width: 767px) {
  .curs-excenge__top.exchange-rate-header .exchange-rate-skeleton {
    gap: 6px;
  }

  .curs-excenge__top.exchange-rate-header .exchange-rate-skeleton-segment {
    height: 14px;
    border-radius: 4px;
  }

  .curs-excenge__top.exchange-rate-header .exchange-rate-skeleton-segment--left {
    flex-basis: 48%;
    max-width: 120px;
  }

  .curs-excenge__top.exchange-rate-header .exchange-rate-skeleton-segment--right {
    flex-basis: 34%;
    max-width: 95px;
  }
}

.detales__btn.exchange-expired-badge {
  background: #b01a06;
}

.detales__btn.exchange-cancelled-badge {
  background: #b01a06;
}

.detales__text.exchange-expired-text {
  opacity: 1;
  font-size: 16px;
  line-height: 1.45;
}

.detales__right ._btn.exchange-expired-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.detales__right ._btn.exchange-expired-actions .exchange-expired-action-btn {
  display: inline-block;
  width: auto;
  margin-top: 0;
  padding: 10px 18px;
  font-size: 16px;
}

.detales__right ._btn.exchange-cancel-action-wrap {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.detales__right ._btn.exchange-cancel-action-wrap .exchange-cancel-action-btn {
  display: inline-block;
  width: auto;
  margin-top: 0;
  padding: 10px 18px;
  font-size: 16px;
  border-color: #b01a06;
  background: #b01a06;
}

.detales__right ._btn.exchange-cancel-action-wrap .exchange-cancel-action-btn:hover {
  background: #8f1705;
}

.detales__right ._btn.exchange-cancel-action-wrap .exchange-cancel-action-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.right-excenge__ditales .exchange-aml-warning-red {
  color: #d33c2d;
  opacity: 1;
  font-weight: 600;
}

.exchange-payment-content {
  transition: opacity 0.2s ease;
}

.exchange-payment-content.exchange-payment-content-locked {
  filter: grayscale(1);
  opacity: 0.45;
}

.exchange-payment-panel .exchange-payment-qr-locked {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 14px;
}

.exchange-payment-copy-btn--mobile {
  display: none;
}

.exchange-payment-address--mobile {
  display: none;
}

@media (max-width: 1200px) {
  .exchange-payment-content .detales__flex {
    display: flex;
    flex-direction: column;
  }

  .exchange-payment-content .detales__content {
    order: 1;
  }

  .exchange-payment-content .detales__qr {
    order: 2;
    width: 100%;
    justify-content: center;
    align-self: center;
  }

  .exchange-payment-content .detales__qr img {
    margin: 0 auto;
  }

  .exchange-payment-content .exchange-payment-address--desktop {
    display: none !important;
  }

  .exchange-payment-content .exchange-payment-address--mobile {
    display: block !important;
    order: 3;
    width: 100%;
  }

  .exchange-payment-content .exchange-payment-address--mobile label {
    margin-top: 0;
  }

  .exchange-payment-content .exchange-payment-copy-btn--desktop {
    display: none !important;
  }

  .exchange-payment-content .exchange-payment-copy-btn--mobile {
    display: block !important;
    order: 4;
    width: 100%;
  }

  .exchange-payment-content .exchange-payment-copy-btn--mobile button {
    width: 100%;
  }
}

.exchange-verification-warning {
  display: block;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f0c419;
  color: #2c2200;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  text-decoration: none;
}

.exchange-verification-warning:hover {
  background: #ffd44a;
  color: #241d00;
}

@media (max-width: 998px) {
  .detales__block {
    flex-direction: column;
  }

  .detales__left .account__block:first-child {
    order: 2;
  }

  .detales__left .account__block:last-child {
    order: 1;
  }

  .exchange-verification-warning {
    font-size: 13px;
    padding: 10px 12px;
  }
}
