





.swd-auth .swd-referral-auth-field { isolation:isolate; }
.swd-auth .swd-referral-auth-field input[name="swd_referral_code"] {
  direction:rtl;
  text-align:right;
  font-variant-numeric:tabular-nums;
  letter-spacing:clamp(6px, 2.6vw, 14px);
  padding-inline:48px 22px;
  transition:padding .32s cubic-bezier(.22,1,.36,1), border-color .22s ease, box-shadow .22s ease;
}


.swd-auth .swd-referral-auth-field label {
  transition:top .25s ease, transform .25s ease, font-size .25s ease;
}
.swd-auth .swd-referral-auth-status {
  position:absolute;
  inset-inline-end:13px;
  top:50%;
  z-index:2;
  width:0;
  height:26px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  opacity:0;
  transform:translate(14px,-50%) scale(.72);
  pointer-events:none;
  transition:width .32s cubic-bezier(.22,1,.36,1), opacity .22s ease, transform .32s cubic-bezier(.22,1,.36,1);
}
.swd-auth .swd-referral-auth-field[data-referral-state="checking"] .swd-referral-auth-status,
.swd-auth .swd-referral-auth-field[data-referral-state="valid"] .swd-referral-auth-status,
.swd-auth .swd-referral-auth-field[data-referral-state="invalid"] .swd-referral-auth-status {
  width:26px;
  opacity:1;
  transform:translate(0,-50%) scale(1);
}

.swd-auth .swd-referral-auth-field[data-referral-state="valid"] input,
.swd-auth .swd-referral-auth-field[data-referral-state="invalid"] input,
.swd-auth .swd-referral-auth-field[data-referral-state="checking"] input { padding-inline-end:55px; }
.swd-auth .swd-referral-auth-field[data-referral-state="valid"] input { border-color:var(--swd-cap-ok, #22c55e); }
.swd-auth .swd-referral-auth-field[data-referral-state="invalid"] input {
  border-color:var(--swd-cap-bad, var(--swd-auth-error-color, #ef4444));
  animation:swd-referral-shake .36s ease;
}
.swd-referral-auth-status svg {
  width:24px;
  height:24px;
  padding:4px;
  border-radius:7px;
  box-sizing:border-box;
  stroke:var(--_cap-ink, #06231f);
  stroke-width:2.7;
  fill:none;
  animation:swd-referral-status-in .36s cubic-bezier(.22,1.4,.4,1) both;
}
.swd-auth .swd-referral-auth-field[data-referral-state="valid"] .swd-referral-auth-status svg { background:var(--swd-cap-ok, #22c55e); }
.swd-auth .swd-referral-auth-field[data-referral-state="invalid"] .swd-referral-auth-status svg { background:var(--swd-cap-bad, var(--swd-auth-error-color, #ef4444)); }
.swd-referral-spinner {
  width:17px;
  height:17px;
  border:2px solid color-mix(in srgb, var(--swd-auth-brand, #7ae2cf) 28%, transparent);
  border-top-color:var(--swd-auth-brand, #7ae2cf);
  border-radius:50%;
  animation:swd-referral-spin .72s linear infinite;
}
@keyframes swd-referral-spin { to { transform:rotate(360deg); } }
@keyframes swd-referral-status-in { from { opacity:0; transform:scale(.45) rotate(-16deg); } to { opacity:1; transform:scale(1) rotate(0); } }
@keyframes swd-referral-shake { 20%,60% { transform:translateX(3px); } 40%,80% { transform:translateX(-3px); } }


html body .swd-app .swd-bento-referral {
  grid-column:span 3;
  display:flex;
  flex-direction:column;
  gap:11px;
}
html body .swd-app .swd-bento-referral h3 {
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  font-size:var(--fs-side-name);
  color:var(--section-title);
  font-weight:var(--fw-side-name, 800);
}
html body .swd-app .swd-bento-referral h3 svg { width:20px; height:20px; color:var(--section-title, var(--brand-deep)); }
html body .swd-app .swd-referral-note { margin:0; color:var(--muted); font-size:var(--fs-detail-label); line-height:1.7; font-weight:var(--fw-detail-label, 600); }
html body .swd-app .swd-referral-share-control {
  min-width:0;
  width:100%;
  display:flex;
  align-items:stretch;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface);
  direction:ltr;
}
html body .swd-app .swd-referral-share-value {
  min-width:0;
  flex:1 1 auto;
  display:block;
  overflow:hidden;
  padding:9px 10px;
  color:var(--text);
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:calc(var(--fs-input, 14px) * .9);
  font-weight:700;
  line-height:1.35;
  text-align:left;
  text-overflow:ellipsis;
  white-space:nowrap;
  unicode-bidi:plaintext;
}
html body .swd-app .swd-referral-copy {
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  border:0;
  border-left:1px solid var(--line);
  padding:0 10px;
  background:var(--brand-soft);
  color:var(--brand-deep);
  font:inherit;
  font-size:var(--fs-button-small, 11px);
  font-weight:700;
  cursor:pointer;
  transition:background .2s ease,color .2s ease;
}
html body .swd-app .swd-referral-copy:hover:not(:disabled),
html body .swd-app .swd-referral-copy:focus-visible { background:color-mix(in srgb, var(--brand) 26%, var(--surface)); color:var(--text); outline:none; }
html body .swd-app .swd-referral-copy:focus-visible { box-shadow:inset 0 0 0 2px var(--brand-deep); }
html body .swd-app .swd-referral-copy:disabled { cursor:wait; opacity:.8; }
html body .swd-app .swd-referral-copy svg { width:14px; height:14px; }
html body .swd-app .swd-referral-count {
  display:inline-flex;
  align-items:baseline;
  gap:4px;
  margin:0;
  color:var(--muted);
  font-size:var(--fs-detail-label);
  font-weight:600;
  line-height:1.4;
}
html body .swd-app .swd-referral-count strong { color:var(--brand-deep); font-size:1.2em; font-weight:600; }

html body .swd-app .swd-referral-count > strong:not(.swd-referral-earned) { font-size:11px; }
html body .swd-app .swd-referral-count .swd-referral-earned { font-size:1em; }

html body .swd-app .swd-referral-sep { color:#000; padding-inline:1px; }
html body .swd-app[data-theme="dark"] .swd-referral-sep { color:#fff; }
html body .swd-app .swd-ow-type-referral_share { min-height:136px; }
html body .swd-app .swd-referral-overview-body { min-width:0; display:flex; flex-direction:column; gap:8px; }
html body .swd-app .swd-referral-overview-body .swd-referral-count { margin-top:auto; }
.swd-app[data-theme="dark"] .swd-bento-referral h3,
.swd-app[data-theme="dark"] .swd-bento-referral h3 svg,
.swd-app[data-theme="dark"] .swd-referral-count strong { color:var(--brand); }

@media (max-width: 860px) {
  html body .swd-app .swd-bento-referral { grid-column:span 1; }
  html body .swd-app .swd-referral-share-value { font-size:12px; }
}
@media (prefers-reduced-motion: reduce) {
  .swd-auth .swd-referral-auth-field *, .swd-auth .swd-referral-auth-field *::before { animation:none !important; transition-duration:.01ms !important; }
}
