.referral-app .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 28px;
  color: var(--desk-ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.6px;
  text-decoration: none;
}

.referral-app .logo strong {
  color: var(--desk-accent);
}

.referral-app .logo-image {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(34,215,255,.38);
  box-shadow: 0 0 20px rgba(34,215,255,.24);
}

.referral-content {
  padding-top: 32px;
}

.referral-shell {
  width: min(1180px, calc(100% - 26px));
  margin: 0 auto;
  padding-bottom: 60px;
}

.referral-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 26px 0 20px;
}

.hero-copy {
  max-width: 640px;
}

.eyebrow {
  display: inline-block;
  color: var(--desk-accent);
  font: 700 9px 'DM Mono', monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin-top: 12px;
  color: var(--desk-ink);
  font-size: clamp(2.3rem, 4vw, 4.3rem);
  line-height: .96;
  letter-spacing: -.07em;
}

.hero-copy h1 em {
  color: var(--desk-accent);
  font-style: normal;
}

.hero-copy p {
  margin-top: 18px;
  max-width: 560px;
  color: var(--desk-muted);
  font-size: 15px;
  line-height: 1.7;
}

.hero-copy strong {
  color: var(--desk-accent-strong);
  font-weight: 800;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid rgba(21,174,202,.32);
  border-radius: 999px;
  background: linear-gradient(120deg, var(--desk-accent), #2d7ef8);
  color: #fff;
  font: 700 11px Manrope, sans-serif;
  box-shadow: 0 12px 26px rgba(21,180,216,.18);
  cursor: pointer;
}

.text-link {
  color: var(--desk-muted);
  font: 700 11px Manrope, sans-serif;
}

.hero-orbit {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 250px;
  height: 250px;
  border: 1px solid var(--desk-line);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(244,248,250,.84));
  box-shadow: 0 18px 46px rgba(6,28,38,.08);
}

body[data-theme="dark"] .hero-orbit {
  background: linear-gradient(145deg, rgba(13,29,43,.86), rgba(8,17,25,.9));
  box-shadow: 0 18px 46px rgba(0,0,0,.18);
}

.orbit-ring {
  position: absolute;
  border: 1px solid rgba(21,174,202,.22);
  border-radius: 50%;
}

.ring-one { width: 180px; height: 180px; }
.ring-two { width: 130px; height: 130px; }

.orbit-core {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(21,174,202,.3);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(21,174,202,.18), rgba(7,16,24,.94));
  box-shadow: 0 0 28px rgba(21,174,202,.12);
}

.orbit-core span {
  font: 800 26px 'DM Mono', monospace;
  color: #d29b2c;
}

.orbit-core small {
  display: block;
  margin-top: 4px;
  color: var(--desk-muted);
  font-size: 9px;
  max-width: 80px;
  line-height: 1.35;
}

.orbit-node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(21,174,202,.22);
  border-radius: 50%;
  background: var(--desk-surface);
  color: var(--desk-accent);
  font: 700 9px 'DM Mono', monospace;
}

.node-one { top: 20px; left: 26px; }
.node-two { top: 28px; right: 26px; }
.node-three { bottom: 18px; left: 50%; transform: translateX(-50%); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.stat-card {
  padding: 20px 18px 18px;
  border: 1px solid var(--desk-line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--desk-surface), var(--desk-surface-raised));
  box-shadow: var(--desk-shadow);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  color: var(--desk-ink);
  font: 800 34px 'DM Mono', monospace;
  letter-spacing: -.06em;
}

.stat-card small,
.stat-label {
  display: block;
  color: var(--desk-muted);
  font: 700 10px 'DM Mono', monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.stat-featured {
  background: linear-gradient(135deg, rgba(21,174,202,.12), rgba(250,252,253,.88));
  border-color: rgba(21,174,202,.24);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-top: 8px;
  color: var(--desk-ink);
  font-size: clamp(1.4rem, 1.7vw, 2.2rem);
  letter-spacing: -.05em;
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(21,174,202,.18);
  border-radius: 999px;
  background: rgba(21,174,202,.08);
  color: var(--desk-positive);
  font: 700 9px 'DM Mono', monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.status-label i,
.live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--desk-positive);
  box-shadow: 0 0 10px var(--desk-positive);
  animation: pulse 1.8s ease-in-out infinite;
}

.withdrawal-section {
  margin-top: 34px;
}

.withdrawal-grid {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 16px;
}

.withdrawal-balance,
.withdrawal-history,
.invite-panel,
.timeline,
.next-step,
.steps-grid article,
.referral-footer {
  border: 1px solid var(--desk-line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.96), rgba(243,247,249,.95));
  box-shadow: var(--desk-shadow);
}

body[data-theme="dark"] .withdrawal-balance,
body[data-theme="dark"] .withdrawal-history,
body[data-theme="dark"] .invite-panel,
body[data-theme="dark"] .timeline,
body[data-theme="dark"] .next-step,
body[data-theme="dark"] .steps-grid article,
body[data-theme="dark"] .referral-footer {
  background: linear-gradient(160deg, rgba(17,34,48,.9), rgba(8,19,30,.96));
}

.withdrawal-balance,
.withdrawal-history { padding: 22px; }

.withdrawal-balance strong {
  display: block;
  margin-top: 10px;
  color: var(--desk-accent-strong);
  font: 800 38px 'DM Mono', monospace;
  letter-spacing: -.08em;
}

.withdrawal-balance p {
  margin-top: 8px;
  color: var(--desk-muted);
  line-height: 1.55;
}

.withdrawal-balance .primary-button {
  margin-top: 18px;
}

.message {
  min-height: 16px;
  color: var(--desk-positive);
  font-size: 10px;
  line-height: 1.4;
}

.history-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.history-heading small {
  color: var(--desk-muted);
  font-size: 10px;
}

.withdrawal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(136,161,183,.14);
}

.withdrawal-row:last-child { border-bottom: 0; }

.withdrawal-row strong {
  display: block;
  color: var(--desk-ink);
  font: 700 16px 'DM Mono', monospace;
}

.withdrawal-row small {
  display: block;
  margin-top: 4px;
  color: var(--desk-muted);
  font-size: 10px;
}

.activity-status {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font: 700 8px 'DM Mono', monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.activity-status.pending,
.activity-status.qualified,
.activity-status.rewarded,
.activity-status.approved,
.activity-status.paid,
.activity-status.confirmed {
  padding: 5px 8px;
  border: 1px solid rgba(21,174,202,.22);
  background: rgba(21,174,202,.08);
  color: var(--desk-accent);
}

.activity-status.rejected {
  border: 1px solid rgba(255,122,146,.22);
  background: rgba(255,122,146,.08);
  color: var(--desk-negative);
}

.activity-status.pending-review {
  border: 1px solid rgba(245,195,110,.22);
  background: rgba(245,195,110,.08);
  color: #b57b1b;
}

.invite-panel {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  padding: 20px;
}

.invite-copy {
  display: flex;
  align-items: center;
  gap: 16px;
}

.invite-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(21,174,202,.4);
  border-radius: 12px;
  background: rgba(21,174,202,.08);
  color: var(--desk-accent);
  font-size: 26px;
}

.invite-copy h3 { color: var(--desk-ink); font-size: 1.1rem; }
.invite-copy p {
  margin-top: 8px;
  color: var(--desk-muted);
  line-height: 1.6;
}

.invite-control {
  display: grid;
  gap: 8px;
}

.invite-control label {
  color: var(--desk-muted);
  font: 700 9px 'DM Mono', monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.link-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--desk-line);
  border-radius: 10px;
  background: rgba(8,17,25,.03);
}

body[data-theme="dark"] .link-field {
  background: rgba(8,17,25,.38);
}

.link-field input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--desk-ink);
  font: 12px Manrope, sans-serif;
}

#copy-referral {
  padding: 10px 12px;
  border: 1px solid rgba(21,174,202,.35);
  border-radius: 8px;
  background: rgba(21,174,202,.08);
  color: var(--desk-accent);
  font: 700 10px 'DM Mono', monospace;
  cursor: pointer;
}

.activity-layout {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) 280px;
  gap: 16px;
}

.timeline,
.next-step { padding: 20px; }

.timeline {
  display: grid;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(136,161,183,.12);
}

.activity-item:last-child { border-bottom: 0; }

.activity-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(21,174,202,.08);
}

.activity-dot.pending { background: #d29b2c; box-shadow: 0 0 0 6px rgba(245,195,110,.08); }
.activity-dot.qualified,
.activity-dot.rewarded,
.activity-dot.confirmed { background: var(--desk-positive); box-shadow: 0 0 0 6px rgba(69,225,174,.08); }

.activity-item strong {
  display: block;
  color: var(--desk-ink);
  font: 700 14px Manrope, sans-serif;
}

.activity-item small {
  display: block;
  margin-top: 4px;
  color: var(--desk-muted);
  font-size: 10px;
}

.next-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.next-step strong { color: var(--desk-ink); font-size: 1.15rem; }
.next-step p { color: var(--desk-muted); line-height: 1.65; }
.next-step a,
.referral-footer a {
  color: var(--desk-accent);
  font: 700 10px 'DM Mono', monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.empty-activity {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--desk-muted);
}

.empty-activity span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(21,174,202,.28);
  border-radius: 50%;
  background: rgba(21,174,202,.08);
  color: var(--desk-accent);
  font-size: 18px;
}

.empty-activity strong {
  display: block;
  color: var(--desk-ink);
  font-size: 14px;
}

.empty-activity p {
  margin-top: 6px;
  line-height: 1.55;
}

.how-section { margin-top: 34px; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.steps-grid article { padding: 22px 18px; }

.steps-grid b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(21,174,202,.3);
  border-radius: 12px;
  background: rgba(21,174,202,.08);
  color: var(--desk-accent);
  font: 800 11px 'DM Mono', monospace;
}

.steps-grid h3 {
  margin-top: 12px;
  color: var(--desk-ink);
  font-size: 1.08rem;
}

.steps-grid p {
  margin-top: 8px;
  color: var(--desk-muted);
  line-height: 1.6;
}

.referral-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
  padding: 18px 20px;
  color: var(--desk-muted);
  font: 700 9px 'DM Mono', monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.withdrawal-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2,8,14,.78);
  backdrop-filter: blur(10px);
}

.withdrawal-modal[hidden] { display: none; }

.withdrawal-modal-card {
  position: relative;
  width: min(100%, 460px);
  padding: 26px;
  border: 1px solid var(--desk-line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(238,245,247,.96));
  box-shadow: 0 24px 80px rgba(0,0,0,.15);
}

body[data-theme="dark"] .withdrawal-modal-card {
  background: linear-gradient(145deg, rgba(11,25,36,.98), rgba(8,17,26,.98));
}

.withdrawal-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--desk-muted);
  font-size: 24px;
  cursor: pointer;
}

.withdrawal-modal-card h2 { margin-top: 8px; font-size: 24px; letter-spacing: -.05em; }
.withdrawal-modal-card > p { margin-top: 8px; color: var(--desk-muted); line-height: 1.55; }

.withdrawal-form {
  display: grid;
  gap: 13px;
  margin-top: 20px;
}

.withdrawal-form label {
  display: grid;
  gap: 7px;
  color: var(--desk-ink);
  font-size: 11px;
  font-weight: 700;
}

.withdrawal-form input,
.withdrawal-form select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--desk-line);
  border-radius: 9px;
  outline: none;
  background: rgba(11,25,33,.04);
  color: var(--desk-ink);
  font: 12px Manrope, sans-serif;
}

body[data-theme="dark"] .withdrawal-form input,
body[data-theme="dark"] .withdrawal-form select {
  background: rgba(6,17,26,.82);
}

.withdrawal-form input:focus,
.withdrawal-form select:focus {
  border-color: var(--desk-accent);
  box-shadow: 0 0 0 3px rgba(21,174,202,.1);
}

.withdrawal-form .primary-button {
  margin-top: 4px;
  border: 0;
  cursor: pointer;
}

@media (max-width: 900px) {
  .withdrawal-grid,
  .activity-layout,
  .invite-panel,
  .steps-grid,
  .stats-row { grid-template-columns: 1fr; }
  .referral-hero { flex-direction: column; align-items: flex-start; }
  .hero-orbit { width: 100%; max-width: 260px; }
}

@media (max-width: 700px) {
  .app { display: block; }
  .sidebar { display: none; }
  .sidebar.mobile-open {
    position: fixed;
    display: block;
    top: 0;
    bottom: 0;
    left: 0;
    width: 250px;
    z-index: 20;
    box-shadow: 20px 0 45px rgba(0,0,0,.72);
  }
  .workspace { padding-top: 68px; }
  .topbar { left: 0; min-height: 68px; padding: 0 14px; gap: 10px; }
  .referral-shell { width: 100%; padding: 0 14px 92px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .top-actions .user-chip span { display: none; }
  .hero-copy h1 { font-size: 2.2rem; }
  .hero-actions { flex-wrap: wrap; }
  .referral-footer { flex-direction: column; align-items: flex-start; }
}

@keyframes pulse {
  0%, 100% { opacity: .8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}