.redesign-referral-card.referral-modal-shell {
  width: min(100%, 560px);
  margin: clamp(26px, 8vh, 88px) auto 0;
  padding: 0;
  border-radius: 28px;
  border: 1px solid rgba(165, 142, 255, 0.2);
  background:
    radial-gradient(circle at top center, rgba(127, 87, 255, 0.16), transparent 56%),
    linear-gradient(180deg, rgba(9, 21, 51, 0.985), rgba(5, 13, 32, 0.995));
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.referral-modal-inner {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.referral-modal-head {
  display: grid;
  gap: 12px;
}

.referral-modal-copy {
  display: grid;
  gap: 8px;
}

.referral-modal-title {
  margin: 0;
  font-size: 23px;
  line-height: 1.04;
  color: #ffe5a2;
  letter-spacing: -0.02em;
}

.referral-modal-subtitle {
  color: rgba(223, 232, 255, 0.74);
  font-size: 14px;
  line-height: 1.4;
}

.referral-modal-reward {
  color: #f1cd73;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgba(241, 205, 115, 0.16);
}

.referral-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.referral-stat-card {
  min-height: 64px;
  padding: 14px 16px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(12, 28, 63, 0.98), rgba(8, 17, 40, 0.99));
  border: 1px solid rgba(118, 147, 221, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: rgba(241, 246, 255, 0.92);
  font-size: 13px;
  line-height: 1.32;
}

.referral-link-block {
  display: block;
}

.referral-link-input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid rgba(118, 147, 221, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(9, 20, 50, 0.96), rgba(7, 14, 34, 0.985));
  color: #eef4ff;
  -webkit-text-fill-color: #eef4ff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.referral-link-input::placeholder {
  color: rgba(216, 228, 255, 0.42);
  -webkit-text-fill-color: rgba(216, 228, 255, 0.42);
}

.referral-actions-stack {
  display: grid;
  gap: 10px;
}

.referral-action-btn {
  position: relative;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.referral-action-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 42%);
  pointer-events: none;
}

.referral-action-btn-copy {
  background: linear-gradient(135deg, #b88621 0%, #f4d47b 58%, #fff1c6 100%);
  border-color: rgba(255, 228, 156, 0.42);
  color: #271700;
  box-shadow: 0 18px 32px rgba(193, 144, 37, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.referral-action-btn-share {
  background: linear-gradient(135deg, #4768c5 0%, #243c84 100%);
  border-color: rgba(117, 146, 220, 0.32);
  color: #f3f7ff;
  box-shadow: 0 18px 32px rgba(30, 49, 104, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

@media (hover:hover) {
  .referral-action-btn:hover {
    transform: translateY(-2px);
    filter: saturate(1.02) brightness(1.02);
  }
}

.referral-action-btn:active {
  transform: scale(0.985);
}

.profile-action-modal[data-mode="referral"] {
  place-items: center center;
}

.profile-action-modal[data-mode="referral"] .profile-action-card {
  width: min(100%, 640px);
  max-height: min(84vh, 780px);
  padding: 18px 18px 22px;
}

.profile-action-modal[data-mode="referral"] .profile-action-head {
  justify-content: flex-end;
  margin-bottom: 0;
}

.profile-action-modal[data-mode="referral"] .profile-action-head .panel-title {
  display: none;
}

.profile-action-modal[data-mode="referral"] .profile-action-body {
  gap: 0;
}

.profile-action-modal[data-mode="referral"] #finance-tab-deposit,
.profile-action-modal[data-mode="referral"] .redesign-convert-card,
.profile-action-modal[data-mode="referral"] .redesign-wallet-functions {
  display: none !important;
}

.profile-action-modal[data-mode="referral"] .redesign-referral-card {
  width: 100%;
  margin: 10px auto 0;
}

@media (max-width: 640px) {
  .redesign-referral-card.referral-modal-shell {
    width: 100%;
    margin-top: 18px;
    border-radius: 24px;
  }

  .referral-modal-inner {
    gap: 14px;
    padding: 18px;
  }

  .referral-modal-title {
    font-size: 18px;
  }

  .referral-modal-reward {
    font-size: 18px;
  }

  .referral-stats-grid {
    grid-template-columns: 1fr;
  }

  .referral-stat-card {
    min-height: 56px;
    padding: 12px 14px;
  }

  .referral-link-input,
  .referral-action-btn {
    min-height: 52px;
  }

  .profile-action-modal[data-mode="referral"] .profile-action-card {
    width: min(100%, 100vw);
    padding: 14px 14px 18px;
  }
}
