.referral-view .app-shell,.referral-view .screen { background:#fafafa; }
.referral-page { --ref-accent:#0878ff; --ref-accent-hover:#0068df; --ref-text:#111827; --ref-muted:#667085; --ref-surface:rgba(255,255,255,.97); --ref-border:rgba(15,23,42,.08); --ref-shadow:0 8px 24px rgba(15,23,42,.055),0 2px 6px rgba(15,23,42,.025); max-width:1160px; margin:0 auto; padding:20px 32px 130px; color:var(--ref-text); font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Helvetica Neue",Arial,sans-serif; font-variant-numeric:tabular-nums; }
.referral-page * { box-sizing:border-box; }
.referral-page button { font:inherit; cursor:pointer; }
.referral-page button:focus-visible,.referral-page circle:focus-visible { outline:3px solid var(--ref-accent); outline-offset:3px; }
.referral-page .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.referral-card { position:relative; overflow:hidden; background:var(--ref-surface); border:1px solid var(--ref-border); border-radius:24px; box-shadow:var(--ref-shadow); }
.referral-card::before { content:""; position:absolute; inset:0; pointer-events:none; border-radius:inherit; box-shadow:inset 0 1px rgba(255,255,255,.9); }
.ref-header { display:grid; grid-template-columns:48px minmax(0,1fr) 48px; align-items:center; gap:12px; min-height:48px; margin-bottom:24px; }
.ref-header h1 { margin:0; text-align:center; font-size:26px; font-weight:700; letter-spacing:-.035em; line-height:1.15; }
.ref-header button { display:grid; place-items:center; width:48px; height:48px; border:1px solid var(--ref-border); border-radius:50%; background:var(--ref-surface); color:var(--ref-text); box-shadow:var(--ref-shadow); }
.ref-header button svg { width:22px; height:22px; }
.ref-hero { min-height:280px; display:grid; grid-template-columns:56% 44%; padding:28px 32px; margin-bottom:16px; isolation:isolate; }
.ref-hero-copy { position:relative; z-index:2; align-self:center; }
.ref-hero h2 { margin:0 0 7px; font-size:30px; line-height:1.1; letter-spacing:-.04em; }
.ref-hero p { margin:0 0 16px; color:var(--ref-muted); font-size:17px; line-height:1.35; }
.ref-earnings { display:block; color:var(--ref-accent); font-size:48px; font-weight:700; line-height:1.05; letter-spacing:-.045em; }
.ref-earnings-label { display:block; margin-top:4px; color:var(--ref-muted); font-size:15px; }
.ref-hero-stats { display:flex; align-items:center; margin-top:22px; }
.ref-hero-stats>div { min-width:140px; padding-right:24px; }
.ref-hero-stats>div+div { border-left:1px solid var(--ref-border); padding-left:24px; }
.ref-hero-stats b,.ref-hero-stats small { display:block; }
.ref-hero-stats b { font-size:26px; line-height:1; }
.ref-hero-stats small { margin-top:5px; color:var(--ref-muted); font-size:13px; }
.ref-illustration { position:absolute; z-index:1; right:18px; bottom:-42px; width:min(42%,420px); height:calc(100% + 24px); object-fit:contain; object-position:bottom center; transform:scale(1.12); transform-origin:bottom right; pointer-events:none; }
.ref-link-card { min-height:104px; display:grid; grid-template-columns:52px minmax(0,1fr) auto 54px; gap:16px; align-items:center; padding:18px 20px; margin-bottom:20px; }
.ref-link-icon,.ref-stat>span,.ref-step-icon,.ref-history-icon { display:grid; place-items:center; color:#39485f; background:#f5f6f8; border-radius:50%; }
.ref-link-icon { width:52px; height:52px; }
.ref-link-icon svg { width:25px; height:25px; }
.ref-link-body { min-width:0; }
.ref-link-body h2 { margin:0 0 7px; font-size:17px; font-weight:650; }
.ref-link-body code { display:block; max-width:100%; padding:11px 14px; border-radius:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ref-text); background:#f5f6f8; font-family:inherit; font-size:15px; font-weight:600; line-height:1.3; }
.ref-copy,.ref-share { height:54px; border-radius:16px; display:flex; align-items:center; justify-content:center; gap:9px; }
.ref-copy { min-width:160px; padding:0 17px; border:0; background:var(--ref-accent); color:#fff; font-weight:600!important; box-shadow:0 7px 18px rgba(0,101,255,.14); }
.ref-copy:hover,.ref-periods button.active:hover { background:var(--ref-accent-hover); }
.ref-share { width:54px; border:1px solid var(--ref-border); background:var(--ref-surface); color:#39485f; box-shadow:var(--ref-shadow); }
.ref-copy svg,.ref-share svg { width:21px; height:21px; }
.ref-section-title { margin:20px 0 12px; font-size:27px; font-weight:700; line-height:1.15; letter-spacing:-.035em; }
.ref-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.ref-stat { min-height:104px; padding:18px 16px; display:flex; align-items:center; gap:14px; }
.ref-stat>span { width:48px; height:48px; flex:none; }
.ref-stat>span svg { width:23px; height:23px; }
.ref-stat small,.ref-stat strong { display:block; }
.ref-stat small { color:var(--ref-muted); font-size:13px; }
.ref-stat strong { margin-top:4px; font-size:25px; line-height:1; font-weight:700; }
.ref-note { margin:9px 2px 19px; color:var(--ref-muted); font-size:12px; line-height:1.45; }
.ref-chart-card { margin-top:14px; padding:24px 26px 16px; }
.ref-chart-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.ref-chart-heading h2 { margin:0; font-size:19px; line-height:1.25; }
.ref-periods { display:flex; padding:3px; gap:2px; border-radius:999px; background:#f2f3f5; }
.ref-periods button { min-height:36px; border:0; padding:0 13px; border-radius:999px; background:transparent; color:var(--ref-muted); font-size:13px; white-space:nowrap; }
.ref-periods button.active { background:var(--ref-accent); color:#fff; box-shadow:0 3px 8px rgba(0,101,255,.13); }
.ref-chart-canvas { position:relative; margin-top:12px; }
.ref-chart-canvas svg { display:block; width:100%; height:auto; min-height:200px; overflow:visible; }
.ref-chart-grid line { stroke:rgba(100,116,139,.14); stroke-dasharray:3 4; }
.ref-chart-grid text,.ref-chart-date { fill:#8993a4; font-size:11px; stroke:none; }
.ref-chart-area { fill:url(#referral-area); stroke:none; }
.ref-chart-line { fill:none; stroke:var(--ref-accent); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.ref-chart-canvas circle { fill:var(--ref-accent); stroke:#fff; stroke-width:2; cursor:pointer; }
.ref-chart-tooltip { position:absolute; top:2px; left:52px; min-height:18px; padding:2px 7px; border-radius:8px; background:var(--ref-surface); color:var(--ref-text); font-size:12px; }
.ref-chart-tooltip:empty { display:none; }
.ref-chart-empty { display:grid; place-items:center; min-height:205px; color:var(--ref-muted); text-align:center; font-size:14px; }
.ref-chart-empty button,.ref-error button { margin-left:8px; padding:8px 12px; border:0; border-radius:10px; background:var(--ref-accent); color:#fff; }
.ref-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; padding:20px 24px; }
.ref-step { display:flex; align-items:flex-start; gap:10px; min-width:0; }
.ref-step-number { width:27px; height:27px; flex:none; display:grid; place-items:center; border-radius:50%; background:rgba(8,120,255,.1); color:var(--ref-accent); font-size:14px; font-weight:700; }
.ref-step-icon { width:42px; height:42px; flex:none; }
.ref-step-icon svg { width:21px; height:21px; }
.ref-step strong,.ref-step small { display:block; }
.ref-step strong { margin:2px 0 4px; font-size:14px; line-height:1.3; }
.ref-step small { color:var(--ref-muted); font-size:12px; line-height:1.35; }
.ref-history { padding:4px 24px; }
.ref-history-row { min-height:68px; display:grid; grid-template-columns:44px minmax(0,1fr) 110px auto; gap:14px; align-items:center; border-bottom:1px solid var(--ref-border); }
.ref-history-row:last-child { border-bottom:0; }
.ref-history-icon { width:40px; height:40px; }
.ref-history-icon svg { width:20px; height:20px; }
.ref-history-person { min-width:0; }
.ref-history-person strong,.ref-history-person small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ref-history-person strong { font-size:14px; }
.ref-history-person small,.ref-history-row time { margin-top:3px; color:var(--ref-muted); font-size:12px; }
.ref-history-row em { justify-self:end; padding:7px 11px; border-radius:999px; font-size:12px; font-style:normal; white-space:nowrap; }
.ref-history-row em.credited { color:#0c9146; background:#e5f8ed; }
.ref-history-row em.waiting { color:#b75b13; background:#fff1e7; }
.ref-history-more { width:100%; min-height:44px; border:0; background:transparent; color:var(--ref-accent); font-size:13px; }
.ref-history-empty { padding:28px; text-align:center; }
.ref-history-empty strong { font-size:15px; }
.ref-history-empty p { margin:6px 0 0; color:var(--ref-muted); font-size:13px; }
.ref-loading { height:280px; margin-bottom:16px; background:linear-gradient(90deg,#fff,#f4f5f7,#fff); background-size:200% 100%; animation:ref-shimmer 1.5s infinite; }
.ref-loading-small { height:104px; }
.ref-error { padding:24px; color:var(--ref-text); }
@keyframes ref-shimmer { from { background-position:100% 0 } to { background-position:-100% 0 } }
.referral-view .mobile-nav button.active { color:#0878ff!important; }
.referral-view .mobile-nav .tabbar__pill::before { background:rgba(8,120,255,.1); }
html[data-theme="dark"] .referral-view .app-shell,html[data-theme="dark"] .referral-view .screen { background:#141416; }
html[data-theme="dark"] .referral-page { --ref-text:#f5f5f7; --ref-muted:#a5a9b2; --ref-surface:rgba(38,38,42,.97); --ref-border:rgba(255,255,255,.10); --ref-shadow:0 8px 24px rgba(0,0,0,.18),inset 0 1px rgba(255,255,255,.04); }
html[data-theme="dark"] .referral-card::before { box-shadow:inset 0 1px rgba(255,255,255,.05); }
html[data-theme="dark"] .ref-link-icon,html[data-theme="dark"] .ref-stat>span,html[data-theme="dark"] .ref-step-icon,html[data-theme="dark"] .ref-history-icon,html[data-theme="dark"] .ref-link-body code,html[data-theme="dark"] .ref-periods { background:#303037; color:#d4d7dd; }
html[data-theme="dark"] .ref-share { color:#e5e7eb; }
html[data-theme="dark"] .ref-history-row em.credited { background:#173e2a; color:#83dfa7; }
html[data-theme="dark"] .ref-history-row em.waiting { background:#45301f; color:#ffc394; }
@media (max-width:900px) { .referral-page { padding:20px 24px 130px; } .ref-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .ref-steps { gap:10px; } .ref-step { flex-wrap:wrap; } }
@media (max-width:720px) { .referral-page { padding:16px 0 130px; } .ref-header { margin-bottom:16px; } .ref-header h1 { font-size:18px; } .ref-header button { width:44px; height:44px; } .ref-hero { display:flex; flex-direction:column; min-height:0; padding:24px 22px 0; } .ref-hero h2 { font-size:24px; } .ref-hero p { font-size:14px; } .ref-earnings { font-size:42px; } .ref-hero-stats>div { min-width:0; padding-right:17px; } .ref-hero-stats>div+div { padding-left:17px; } .ref-illustration { position:relative; right:auto; bottom:auto; align-self:center; width:min(275px,100%); height:190px; margin-top:-8px; object-position:top center; transform:none; } .ref-link-card { grid-template-columns:42px minmax(0,1fr) 48px; gap:10px; padding:15px; } .ref-link-icon { width:40px; height:40px; } .ref-link-body h2 { font-size:14px; } .ref-link-body code { font-size:12px; padding:9px; } .ref-copy { grid-column:1/3; grid-row:2; width:100%; min-width:0; height:46px; } .ref-share { grid-column:3; grid-row:2; width:48px; height:46px; } .ref-section-title { font-size:23px; } .ref-stat { min-height:88px; padding:13px; gap:9px; } .ref-stat>span { width:38px; height:38px; } .ref-stat strong { font-size:21px; } .ref-chart-card { padding:17px 12px 8px; } .ref-chart-heading { display:block; } .ref-chart-heading h2 { font-size:16px; margin-bottom:13px; } .ref-periods { width:max-content; max-width:100%; } .ref-periods button { padding:0 10px; font-size:11px; } .ref-chart-canvas svg { min-height:145px; } .ref-chart-grid text,.ref-chart-date { font-size:15px; } .ref-steps { grid-template-columns:1fr; padding:16px; gap:17px; } .ref-step { flex-wrap:nowrap; } .ref-history { padding:0 14px; } .ref-history-row { grid-template-columns:34px minmax(0,1fr) auto; gap:9px; padding:10px 0; } .ref-history-icon { width:32px; height:32px; } .ref-history-row time { grid-column:2; grid-row:2; margin-top:-8px; } .ref-history-row em { grid-column:3; grid-row:1/3; font-size:10px; padding:6px 8px; } .ref-history-person strong { font-size:12px; } .ref-history-person small { font-size:11px; } }
@media (prefers-reduced-motion:reduce) { .ref-loading { animation:none; } }

/* The referral screen shares the cabinet's surface, color and control system. */
.referral-view .app-shell,.referral-view .screen { background:var(--bg); }
.referral-page {
  --ref-accent:var(--accent);
  --ref-accent-hover:var(--accent-deep);
  --ref-text:var(--ink);
  --ref-muted:var(--muted);
  --ref-surface:var(--paper);
  --ref-border:var(--line);
  --ref-shadow:var(--shadow);
  --ref-control-height:48px;
  padding-top:22px;
}
.referral-card { overflow:visible; backdrop-filter:blur(20px) saturate(1.18); -webkit-backdrop-filter:blur(20px) saturate(1.18); }
.ref-header button,.ref-share,.ref-balance,.ref-copy,.ref-link-controls code {
  box-shadow:var(--shadow-small);
  border-radius:14px;
  transition:transform var(--t-tap) var(--spring),box-shadow var(--t-expand) var(--spring),background var(--t-tab-color) var(--ease-out);
}
.ref-header button:active,.ref-share:active,.ref-balance:active,.ref-copy:active { transform:scale(.97); }
.ref-hero { grid-template-columns:minmax(0,1fr) minmax(260px,42%); gap:12px; min-height:0; padding:28px 32px; align-items:center; }
.ref-hero-copy { min-width:0; }
.ref-earnings { color:var(--ink); font-size:43px; }
.ref-illustration { position:static; display:block; width:100%; height:auto; max-height:330px; object-fit:contain; object-position:center; transform:none; align-self:center; justify-self:center; }
.ref-balance { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:var(--ref-control-height); margin-top:16px; padding:0 16px; border:1px solid var(--ref-border); background:var(--ref-surface); color:var(--ref-text); font-size:14px; font-weight:600; }
.ref-balance:hover,.ref-share:hover { box-shadow:var(--shadow); transform:translateY(-2px); }
.ref-balance svg { width:17px; height:17px; }
.ref-hero-stats { margin-top:20px; }
.ref-section-title { margin:23px 0 12px; font-size:22px; font-weight:650; }
.ref-step-number { background:var(--accent-soft); color:var(--accent-deep); }
.ref-link-card { display:grid; grid-template-columns:42px minmax(0,1fr); gap:14px; min-height:88px; padding:17px 19px; margin-bottom:0; }
.ref-link-icon { width:42px; height:42px; background:transparent; color:var(--icon); }
.ref-link-controls { display:grid; grid-template-columns:minmax(0,1fr) auto var(--ref-control-height); align-items:center; gap:9px; min-width:0; }
.ref-link-controls code,.ref-copy,.ref-share { box-sizing:border-box; height:var(--ref-control-height); min-height:var(--ref-control-height); border-radius:14px; }
.ref-link-controls code { display:flex; align-items:center; min-width:0; padding:0 14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; background:rgba(118,118,128,.07); border:1px solid var(--ref-border); font-family:inherit; font-size:13px; font-weight:500; color:var(--ref-text); }
.ref-copy { min-width:138px; padding:0 15px; border:0; background:var(--system-button); color:#fff; font-size:13px!important; font-weight:600!important; box-shadow:0 7px 17px rgba(0,90,190,.17),inset 0 1px rgba(255,255,255,.22); }
.ref-copy:hover { background:var(--system-button-hover); }
.ref-share { width:var(--ref-control-height); border:1px solid var(--ref-border); background:var(--ref-surface); color:var(--icon); }
.ref-history-more { color:var(--accent-deep); }
.referral-view .mobile-nav button.active { color:var(--accent-deep)!important; }
.referral-view .mobile-nav .tabbar__pill::before { background:var(--accent-soft); }
html[data-theme="dark"] .referral-view .app-shell,html[data-theme="dark"] .referral-view .screen { background:var(--bg); }
html[data-theme="dark"] .referral-page { --ref-text:var(--ink); --ref-muted:var(--muted); --ref-surface:var(--paper); --ref-border:var(--line); --ref-shadow:var(--shadow); }
html[data-theme="dark"] .ref-link-controls code { background:rgba(142,142,147,.12); }
@media (max-width:720px) {
  .referral-page { padding:16px 0 130px; }
  .ref-hero { display:flex; flex-direction:column; align-items:stretch; gap:8px; padding:23px 20px 17px; }
  .ref-hero h2 { font-size:24px; }
  .ref-earnings { font-size:38px; }
  .ref-illustration { width:100%; height:auto; max-width:345px; max-height:none; margin:0 auto; object-fit:contain; }
  .ref-hero-stats { margin-top:16px; }
  .ref-link-card { grid-template-columns:1fr; gap:8px; padding:15px; }
  .ref-link-icon { display:none; }
  .ref-link-controls { grid-template-columns:minmax(0,1fr) auto 44px; gap:7px; }
  .ref-link-controls code,.ref-copy,.ref-share { height:44px; min-height:44px; border-radius:12px; }
  .ref-link-controls code { font-size:11px; padding:0 10px; }
  .ref-copy { grid-column:auto; grid-row:auto; min-width:0; width:auto; height:44px; padding:0 10px; font-size:11px!important; gap:5px; }
  .ref-copy svg { width:17px; height:17px; }
  .ref-share { grid-column:auto; grid-row:auto; width:44px; height:44px; }
  .ref-section-title { font-size:21px; }
}
