.balance-sheet-layer .balance-sheet { height:min(calc(712px + env(safe-area-inset-bottom)),calc(100% - 20px)); }
.balance-sheet .balance-referral-entry {
  width:100%; min-height:76px; height:76px; margin-top:12px; padding:12px;
  display:flex; flex-direction:row; align-items:center; justify-content:flex-start; gap:10px;
  border:1px solid #ffae6652; border-radius:20px; background:linear-gradient(120deg,#723a203d,#41221770);
  color:#ffead5; text-align:left; box-shadow:inset 0 1px #ffcc9d12;
}
.referral-fire-emblem { width:44px; height:44px; display:grid; place-items:center; flex:none; border-radius:14px; border:1px solid #ffb76065; color:#ffdb9b; background:radial-gradient(circle at 25% 10%,#ffbd5f,transparent 55%),linear-gradient(145deg,#dc601f,#7f1d12); box-shadow:0 0 16px #ff691c22,inset 0 1px #ffe5b033; }
.referral-fire-emblem svg { width:30px; height:30px; fill:currentColor; }
.referral-fire-emblem .ref-arrow { fill:none; stroke:#fff1dc; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.balance-sheet .balance-referral-copy { display:flex; flex-direction:column; align-items:flex-start; min-width:0; flex:1; gap:4px; white-space:normal; }
.balance-referral-copy strong { font-size:14px; line-height:1.25; }
.balance-referral-copy small { font-size:11px; line-height:1.3; color:#d9ac86; }
.referral-entry-chevron { width:16px; height:20px; flex:none; fill:none; stroke:#dba37b; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.referral-sheet-layer { z-index:90; }
.referral-sheet-layer .case-sheet-backdrop { background:#14070299; backdrop-filter:blur(14px); }
.referral-sheet-layer .referral-program-sheet {
  width:min(100%,560px); max-height:calc(100dvh - 20px); padding:12px 16px calc(20px + env(safe-area-inset-bottom));
  color:#fff0de; background:radial-gradient(ellipse at top,#80401930,transparent 70%),linear-gradient(140deg,#2e190f,#160c08);
  border-color:#ffae6638; box-shadow:0 -15px 60px #0008; overflow:hidden;
}
.referral-program-sheet .sheet-handle { background:#ba794552; flex:none; }
.referral-program-head { display:flex; align-items:center; gap:10px; margin:20px 0 16px; flex:none; }
.referral-program-head > div { min-width:0; flex:1; }
.referral-program-head h2 { margin:0; font-size:18px; line-height:1.2; }
.referral-program-head p { margin:5px 0 0; font-size:12px; line-height:1.35; color:#ca9d7c; }
.referral-program-head button { display:grid; place-items:center; width:36px; height:36px; flex:none; border:1px solid #ffb57722; border-radius:50%; color:#ffe9d1; background:#6c381d65; padding:0; }
.referral-program-head button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
.referral-program-body { min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-width:none; }
.referral-program-body::-webkit-scrollbar { display:none; }
.referral-explanation { padding:16px; margin-bottom:14px; border:1px solid #ffac6533; border-radius:20px; background:linear-gradient(145deg,#85421935,#45241855); }
.referral-explanation p { margin:0; font-size:14px; line-height:1.55; }
.referral-explanation p + p { margin-top:12px; }
.referral-percent { color:#ffba5d; }
.referral-share-row { display:flex; align-items:stretch; gap:9px; }
.referral-personal-link { min-width:0; flex:1; padding:12px; border:1px solid #ffa6692e; border-radius:18px; background:#542d1b50; }
.referral-personal-link label { display:block; font-size:9px; font-weight:700; letter-spacing:.08em; color:#c89573; margin-bottom:7px; }
.referral-personal-link > div { display:flex; align-items:center; gap:6px; }
.referral-personal-link input { min-width:0; flex:1; width:0; padding:0; border:0; outline:0; background:none; color:#ffd092; font:inherit; font-size:16px; font-weight:600; line-height:24px; text-overflow:ellipsis; }
.referral-personal-link button { width:25px; height:25px; flex:none; display:grid; place-items:center; color:#e4b992; border-radius:7px; }
.referral-personal-link button svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.6; }
.referral-share-button { flex:none; width:64px; min-height:70px; display:grid; place-items:center; border:1px solid #ffc071; border-radius:18px; background:linear-gradient(135deg,#ffab43,#e14a1a); color:#fff6e2; box-shadow:0 6px 20px #ff5f1620,inset 0 1px #ffe2a84a; }
.referral-share-button svg { width:28px; height:28px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linejoin:round; stroke-linecap:round; }
.referral-feedback { min-height:16px; margin:7px 2px 10px; font-size:11px; line-height:1.4; color:#ffc778; }
.referral-stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.referral-stat-grid article { min-width:0; min-height:78px; padding:12px 6px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:7px; border:1px solid #ffae6825; border-radius:17px; background:#4e2a1a50; }
.referral-stat-grid article > span { font-size:9px; text-transform:uppercase; font-weight:700; letter-spacing:.04em; color:#c59575; }
.referral-stat-grid article > strong { display:flex; align-items:center; justify-content:center; gap:4px; color:#ffe6c4; font-size:22px; line-height:1; white-space:nowrap; }
.referral-inline-star { display:block; width:18px; height:18px; object-fit:contain; flex:none; transform:translateY(-1px); }
.referral-fraction-note { margin:12px 3px 19px; color:#b78b6f; font-size:11px; line-height:1.5; }
.referral-history-section { margin-top:18px; }
.referral-history-section > header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
.referral-history-section h3 { margin:0; font-size:17px; }
.referral-history-section header > span { min-width:27px; padding:5px; border-radius:12px; background:#7a421a44; text-align:center; font-size:12px; color:#ffcc92; }
.referral-history { display:grid; gap:8px; }
.referral-history-item,.referral-reward-item { min-width:0; display:flex; align-items:center; gap:9px; padding:12px; border:1px solid #ffae6528; border-radius:17px; background:#4e2a1b50; }
.referral-person-avatar { display:grid; place-items:center; width:35px; height:35px; flex:none; border-radius:50%; background:linear-gradient(140deg,#ba6925,#632418); color:#ffdfaa; font-size:16px; font-weight:700; }
.referral-person-info { min-width:0; flex:1; display:grid; gap:5px; }
.referral-person-info strong,.referral-reward-item > div strong { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; line-height:1.3; }
.referral-person-info small,.referral-person-earned small,.referral-reward-item small { font-size:10px; color:#bd906e; line-height:1.35; }
.referral-person-earned { min-width:0; flex:none; display:grid; justify-items:end; gap:5px; }
.referral-person-earned strong,.referral-reward-item > strong { display:flex; align-items:center; justify-content:flex-end; gap:4px; font-size:14px; color:#ffd08b; line-height:1; white-space:nowrap; }
.referral-reward-item > div { min-width:0; flex:1; display:grid; gap:5px; }
.referral-reward-item > strong { flex:none; }
.referral-empty { text-align:center; padding:20px 14px; border:1px solid #ffab6123; border-radius:18px; background:#4e2a1b35; color:#d8aa83; }
.referral-empty strong { font-size:14px; color:#ffe0ba; }
.referral-empty p { margin:7px 0; font-size:12px; line-height:1.5; }
.referral-empty button { margin:14px auto 0; min-height:40px; padding:10px 20px; color:#ffecd5; background:#9b4d2160; border-radius:14px; font-size:14px; }
.referral-program-sheet :focus-visible { outline:2px solid #ffc27d; outline-offset:3px; }
.referral-program-sheet button:disabled { opacity:.5; cursor:default; }
.referral-loading { color:#d4a384; text-align:center; min-height:120px; padding:30px 10px; font-size:14px; }
@media(max-width:350px) { .balance-referral-copy strong { font-size:13px; } .balance-referral-copy small { font-size:10px; } .balance-sheet .balance-referral-entry { gap:8px; padding:10px; } .balance-referral-entry .referral-fire-emblem { width:38px; height:38px; } .referral-program-head h2 { font-size:16px; } .referral-program-head .referral-fire-emblem { width:38px; height:38px; } .referral-stat-grid article > strong { font-size:19px; } }
@media(max-height:600px) { .balance-sheet-layer .balance-sheet { height:calc(100% - 10px); } }

