.cb-referral-modal[hidden] {
  display: none !important;
}

.cb-referral-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(2, 8, 6, 0.72);
  backdrop-filter: blur(10px);
}

.cb-referral-dialog {
  position: relative;
  width: min(100%, 430px);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at top, rgba(18, 184, 90, 0.26) 0%, rgba(18, 184, 90, 0) 26%),
    linear-gradient(180deg, rgba(6, 61, 38, 0.98) 0%, rgba(3, 20, 13, 0.99) 100%);
  box-shadow: 0 28px 60px rgba(1, 10, 7, 0.46);
  color: #f4fff8;
}

.cb-referral-dialog::-webkit-scrollbar {
  width: 8px;
}

.cb-referral-dialog::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(18, 184, 90, 0.45);
}

.cb-referral-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: #f4fff8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.cb-referral-body {
  padding: 22px 18px 18px;
}

.cb-referral-eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #facc15;
}

.cb-referral-title {
  margin: 0;
  padding-right: 44px;
  font-size: 30px;
  line-height: 0.98;
  font-weight: 1000;
  text-transform: uppercase;
}

.cb-referral-subtitle {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(244, 255, 248, 0.88);
}

.cb-referral-panel,
.cb-referral-stat,
.cb-referral-empty {
  margin-top: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cb-referral-panel {
  padding: 16px;
}

.cb-referral-panel-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9ee7b8;
}

.cb-referral-link-box {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(2, 8, 6, 0.38);
  color: #f4fff8;
  word-break: break-all;
  font-size: 14px;
  font-weight: 800;
}

.cb-referral-actions {
  margin-top: 12px;
}

.cb-referral-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.cb-referral-stat {
  padding: 14px;
}

.cb-referral-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ee7b8;
}

.cb-referral-stat-value {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1;
  font-weight: 1000;
  color: #ffffff;
}

.cb-referral-amount {
  margin-top: 6px;
  font-size: 34px;
  line-height: 1;
  font-weight: 1000;
  color: #facc15;
}

.cb-referral-button {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(90deg, #12b85a 0%, #0b7a3b 55%, #facc15 100%);
  color: #052e16;
  font-size: 15px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(1, 10, 7, 0.24);
}

.cb-referral-button:active {
  transform: scale(0.98);
}

.cb-referral-button.is-secondary {
  background: linear-gradient(90deg, #facc15 0%, #f59e0b 100%);
  color: #4b2b03;
}

.cb-referral-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(244, 255, 248, 0.72);
}

.cb-referral-empty {
  padding: 16px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(244, 255, 248, 0.82);
}

body.cb-referral-open {
  overflow: hidden;
}

@media (max-width: 420px) {
  .cb-referral-modal {
    padding: 10px;
  }

  .cb-referral-body {
    padding: 18px 14px 14px;
  }

  .cb-referral-title {
    font-size: 26px;
  }

  .cb-referral-grid {
    gap: 10px;
  }

  .cb-referral-stat-value {
    font-size: 20px;
  }

  .cb-referral-amount {
    font-size: 30px;
  }
}
