.referral-view {
  width: 100%;
  min-width: 0;
  margin-inline: auto;
  animation: app-view-in 220ms var(--app-ease);
}

.referral-heading {
  margin-bottom: 22px;
}

.referral-percentage-text {
  color: var(--app-accent);
  font-weight: 800;
}

#referral-title {
  white-space: nowrap;
}

.referral-link-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 14px;
}

.referral-link-input {
  min-width: 0;
  border-right: 0;
  overflow: hidden;
  color: var(--app-text-secondary);
  text-overflow: clip;
  white-space: nowrap;
  user-select: text;
  -webkit-user-select: text;
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
  caret-color: var(--app-accent);
}

.module-panel-meta.is-active {
  color: var(--app-accent);
}

.module-panel-meta.is-inactive {
  color: var(--app-warning);
}

.referral-copy-button {
  width: auto;
  min-width: 126px;
  white-space: nowrap;
}

.referral-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--app-border);
  background: var(--app-elevated);
}

.metric-label {
  display: block;
  margin-bottom: 10px;
  overflow: hidden;
  color: var(--app-text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric-value {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.metric-value strong {
  overflow: hidden;
  color: var(--app-accent);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  text-overflow: ellipsis;
}

.metric-value span {
  color: var(--app-text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.metric-card small {
  display: block;
  overflow: hidden;
  color: var(--app-text-muted);
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referral-share-button {
  width: 100%;
}

.status-message {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--app-border);
  background: var(--app-elevated);
  color: var(--app-text-secondary);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.status-message::before {
  content: "$ ";
  color: var(--app-accent);
}

.status-message:empty {
  display: none;
}

.status-message.is-error, .status-message.error, .status-message[data-type="error"] {
  border-color: var(--app-error-border);
  background: var(--app-error-tint);
  color: var(--app-error);
}

.status-message.is-error::before, .status-message.error::before, .status-message[data-type="error"]::before {
  color: var(--app-error);
}

.status-message.is-success, .status-message.success, .status-message[data-type="success"] {
  border-color: var(--app-accent-border);
  background: var(--app-accent-tint);
  color: var(--app-accent);
}

.referral-guide-body {
  padding-top: 4px;
  padding-bottom: 14px;
}

.referral-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.referral-step {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--app-border);
}

.referral-step:last-child {
  border-bottom: 0;
}

.referral-step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--app-accent-border);
  background: var(--app-accent-tint);
  color: var(--app-accent);
  font-size: 10px;
  font-weight: 800;
}

.referral-step h3 {
  margin: 1px 0 4px;
  color: var(--app-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.referral-step p {
  margin: 0;
  color: var(--app-text-muted);
  font-size: 10px;
  line-height: 1.55;
}

@media (max-width: 330px) {
  .referral-stats {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .metric-card small {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .referral-view {
    animation: none;
    transition: none;
  }
}