/* Referrals (js/referrals.js): invite banner, Rewards page tabs, the Referrals tab. */

/* ---------------------------------------------------------------- Rewards page tabs */
.rw-tabs { margin: 0 0 26px; }
.rw-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 20px; border-radius: 999px; font-weight: 700; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.rw-tabs a:hover:not(.active) { background: var(--panel-2); color: var(--text); }
.rw-tabs a.active { background: var(--panel-3); color: var(--text); }
.rw-tabs a svg { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- invite banner (signed out, after a /r/ link) */
.ref-banner {
  display: flex; align-items: center; gap: 16px; width: calc(100% - 64px); max-width: 1136px; margin: 24px auto 0; padding: 16px 16px 16px 20px;
  border-radius: 12px; background: linear-gradient(100deg, color-mix(in srgb, var(--green) 14%, var(--p1)), var(--p1) 70%);
  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
}
.ref-banner + #view { padding-top: 24px; }
.ref-banner-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.ref-banner-ico svg { width: 22px; height: 22px; }
.ref-banner p { margin: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; line-height: 1.4; }
.ref-banner p b { font-size: 15px; }
.ref-banner p span { color: var(--muted); font-size: 13px; }
.ref-banner .btn { flex-shrink: 0; }
.ref-banner-x { flex-shrink: 0; }

/* ---------------------------------------------------------------- Referrals tab */
.ref-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 40px; align-items: center; padding: 32px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--green) 10%, var(--p1)) 0%, var(--panel) 55%);
  border: 1px solid color-mix(in srgb, var(--green) 22%, transparent);
}
.ref-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.ref-kicker svg { width: 18px; height: 18px; }
.ref-hero h2 { margin: 14px 0 12px; font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.ref-hero-text p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 460px; }
.ref-share { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: 12px; background: var(--bg-deep); }
.ref-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.ref-link { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: var(--radius); background: var(--panel-2); border: 2px solid var(--panel-3); }
.ref-link:focus-within { border-color: var(--hover); }
.ref-link-ico { color: var(--muted); display: grid; }
.ref-link input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-weight: 700; font-size: 15px; text-overflow: ellipsis; }
.ref-actions { display: flex; gap: 10px; }
.ref-actions .btn { flex: 1; gap: 8px; }
.ref-code { margin: 2px 0 0; }
.ref-code b { color: var(--text); letter-spacing: .08em; margin-left: 4px; }

.ref-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.ref-stat { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; border-radius: 10px; background: var(--panel); }
.ref-stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.ref-stat b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }

.ref-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.ref-grid .card { margin-bottom: 0; }
.ref-col { display: flex; flex-direction: column; gap: 22px; }
.ref-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.ref-steps li { display: flex; gap: 16px; align-items: flex-start; }
.ref-steps li > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ref-steps b { font-size: 15px; }
.ref-steps span:not(.ref-num) { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.ref-num { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: var(--green); border: 2px solid var(--green); background: var(--bg-deep); }
.ref-fine { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); line-height: 1.5; }
.ref-apply p { margin: -4px 0 16px; line-height: 1.5; }
.ref-apply-row { display: flex; gap: 10px; }
.ref-apply-row .input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ref-apply-row .input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ref-apply-row .btn { flex-shrink: 0; height: 48px; min-width: 110px; }

.ref-list { display: flex; flex-direction: column; gap: 8px; }
.ref-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 10px; background: var(--panel-2); }
.ref-row-who { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.ref-row-who small { color: var(--muted); font-size: 12px; }
.ref-row b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ref-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 12px; text-align: center; color: var(--muted); }
.ref-empty svg { width: 34px; height: 34px; stroke-width: 1.6; color: var(--dim); }
.ref-empty p { margin: 0; max-width: 300px; line-height: 1.5; }

@media (max-width: 1000px) {
  .ref-hero { grid-template-columns: 1fr; gap: 26px; }
  .ref-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .ref-banner { position: relative; width: calc(100% - 28px); margin-top: 14px; padding: 16px; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
  .ref-banner + #view { padding-top: 18px; }
  .ref-banner p { flex-basis: calc(100% - 58px); padding-right: 30px; }
  .ref-banner .btn { flex: 1 1 100%; }
  .ref-banner-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; }
  .ref-hero { padding: 22px; }
  .ref-hero h2 { font-size: 24px; }
  .ref-share { padding: 16px; }
}
@media (max-width: 600px) {
  .ref-stats { grid-template-columns: 1fr; gap: 10px; }
  .ref-stat { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px 18px; }
  .ref-stat b { font-size: 20px; }
  .rw-tabs { width: 100%; }
  .rw-tabs a { flex: 1; justify-content: center; }
}
