/* Personal star wallets (star-wallets.js): the two purses, the send sheet, the sent and
   received moments. Colors come only from config/theme.js tokens. */

/* ---------- the two purses ---------- */
.sw-purses{display:flex;align-items:center;justify-content:center;gap:10px}
.sw-purse{display:flex;align-items:center;gap:10px;min-width:0}
.sw-purse>span:last-child{display:flex;flex-direction:column;line-height:1.1;min-width:0}
.sw-purse b{font-size:1.5rem;letter-spacing:-.02em;color:var(--text-primary);font-variant-numeric:tabular-nums;transition:color .2s ease}
.sw-purse small{font-size:.8125rem;color:var(--text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:9em}
.sw-purse-link{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--surface-tinted)}

/* In the shop's balance card, under YOUR stars: your partner's purse, then the send button. */
.sw-strip{display:flex;align-items:center;gap:10px;margin-top:12px;padding-top:12px;border-top:1px solid var(--balance-border)}
.sw-strip .sw-purse{flex:1}
.sw-strip .sw-purse b{font-size:1.125rem}
.sw-send-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:auto;min-height:44px;margin:0;padding:0 16px;border-radius:999px;border:1px solid var(--balance-border);background:var(--card-background);color:var(--text-primary);font:inherit;font-weight:700;font-size:.9375rem;white-space:nowrap;flex:none;cursor:pointer}
.sw-send-btn:active{transform:scale(.97)}

/* The sheets: the close button sits in the corner (like the garden sheet), never squeezing the content. */
.modal-card:has(.sw-sheet){position:relative}
.modal-card:has(.sw-sheet)>.modal-close{position:absolute;right:16px;top:16px;float:none;margin:0}
.sw-sheet .sheet-title,.sw-sheet h2{padding:0 44px}

/* ---------- send sheet ---------- */
.sw-sheet{text-align:center}
.sw-purses-sheet{margin:6px 0 0;padding:14px 12px;border-radius:20px;background:linear-gradient(160deg,var(--balance-background),var(--balance-background-end));border:1px solid var(--balance-border)}
.sw-preview-label{margin:8px 0 0;font-size:.8125rem;color:var(--text-secondary);font-variant-numeric:tabular-nums}
.sw-amount{display:flex;align-items:center;justify-content:center;gap:14px;margin:14px 0 0}
.sw-step{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;border:1px solid var(--border-default);background:var(--card-background);color:var(--text-primary);cursor:pointer}
.sw-step:disabled{opacity:.4;cursor:default}
.sw-amount-value{display:flex;align-items:center;gap:6px}
.modal-card .sw-amount-value input{width:3.4ch;min-width:0;min-height:0;height:auto;border:0;box-shadow:none;background:none;padding:0;font:inherit;font-size:2.75rem!important;font-weight:800;letter-spacing:-.03em;line-height:1;text-align:center;color:var(--text-primary);font-variant-numeric:tabular-nums;-moz-appearance:textfield;appearance:textfield}
.sw-amount-value input::-webkit-outer-spin-button,.sw-amount-value input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.sw-amount-value input:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:10px}
.sw-amount-off{opacity:.5}
.sw-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:12px 0 0}
.sw-chip{min-width:56px;min-height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--border-default);background:var(--card-background);color:var(--text-primary);font:inherit;font-weight:700;font-variant-numeric:tabular-nums;cursor:pointer}
.sw-chip.selected{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.sw-chip:disabled{opacity:.4;cursor:default}
.sw-note-field{margin:16px 0 0;text-align:left}
.sw-optional{font-weight:500;color:var(--text-secondary);font-size:.8125rem}
.sw-empty{margin-top:14px;text-align:left}
.sw-plus-rail{display:flex;align-items:center;gap:10px;width:100%;margin:16px 0 0;padding:10px 12px;border-radius:16px;border:1px dashed var(--border-default);background:none;color:var(--text-primary);font:inherit;text-align:left;cursor:pointer}
.sw-plus-rail>span:nth-child(2){flex:1;display:flex;flex-direction:column;gap:1px}
.sw-plus-rail b{font-size:.875rem}
.sw-plus-rail small{font-size:.75rem;color:var(--text-secondary);line-height:1.35}
.sw-plus-rail svg{color:var(--text-secondary);flex:none}

/* ---------- sent / received ---------- */
.sw-burst{position:relative;display:flex;align-items:center;justify-content:center;width:96px;height:96px;margin:4px auto 0}
.sw-burst .eco-star{position:relative;z-index:1;animation:sw-pop .5s cubic-bezier(.22,1,.36,1) both}
.sw-burst>span:not(.eco-star){position:absolute;left:50%;top:50%;width:8px;height:8px;margin:-4px;border-radius:50%;background:var(--gold);opacity:0;animation:sw-spark .9s cubic-bezier(.22,1,.36,1) .1s both}
.sw-burst>span:nth-child(1){--x:-38px;--y:-22px}
.sw-burst>span:nth-child(2){--x:36px;--y:-28px}
.sw-burst>span:nth-child(3){--x:-30px;--y:30px}
.sw-burst>span:nth-child(4){--x:40px;--y:24px}
.sw-burst>span:nth-child(5){--x:2px;--y:-44px}
@keyframes sw-pop{from{transform:scale(.4);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes sw-spark{0%{transform:translate(0,0) scale(.6);opacity:0}30%{opacity:1}100%{transform:translate(var(--x),var(--y)) scale(1);opacity:0}}
.reduced-motion .sw-burst .eco-star,.reduced-motion .sw-burst>span{animation:none}
@media (prefers-reduced-motion:reduce){.sw-burst .eco-star,.sw-burst>span{animation:none}}

/* ---------- gift composer: stars inside ---------- */
.sw-gift-stars{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.sw-gift-stars .sw-chip{min-width:48px;min-height:36px;padding:0 12px}
.eco-gift-stars-art{display:inline-flex;align-items:center;justify-content:center;flex:none;width:52px;height:52px;border-radius:16px;background:var(--card-background)}
.eco-gift-stars{display:flex;align-items:center;gap:12px;padding:14px;border-radius:18px;background:linear-gradient(160deg,var(--balance-background),var(--balance-background-end));border:1px solid var(--balance-border);text-align:left}
.eco-gift-stars b{display:block;font-size:1.25rem}
.eco-gift-stars small{color:var(--text-secondary);font-size:.8125rem}
