/* Scoped to the card: the existing dashboard keeps its approved layout. */
body.wallet-open{background:#611B61;overflow:hidden}.wallet-open #app{display:block}.wallet-open .desktop-message{display:none}
.wallet{--card-plum:#611B61;position:fixed;inset:0;width:100%;min-height:0;height:100dvh;max-width:600px;margin:auto;padding:calc(env(safe-area-inset-top) + 6px) max(7px,env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 9px) max(7px,env(safe-area-inset-left));background:#611B61;color:white;animation:none;display:flex;flex-direction:column;overflow:hidden;overscroll-behavior:none}
.wallet-ready{display:grid;grid-template-rows:minmax(0,1fr) 26px 26px 44px;flex:1;min-height:0;gap:0}
.wallet-pages{display:flex;height:100%;min-height:0;container-type:size;width:100%;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain;border-radius:23px;outline-offset:-4px}
.wallet-pages::-webkit-scrollbar{display:none}.wallet-page{scroll-snap-align:start;scroll-snap-stop:always;flex:0 0 100%;width:100%;min-width:0;height:100%;overflow:hidden;border-radius:23px;background:#fff;color:var(--card-plum);border:1px solid #ffffffaa}
/* The text and footer reserve their actual height; only the image row flexes. */
.wallet-face{height:100%;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto;justify-items:center;position:relative;isolation:isolate;overflow:hidden;padding-top:clamp(12px,2.5cqh,24px);border-radius:22px;row-gap:clamp(6px,1.4cqh,12px)}
.wallet-page:last-child .wallet-face{grid-template-rows:auto auto minmax(0,1fr) auto auto auto}
.wallet-logo{width:88%;max-width:440px;height:clamp(38px,9cqh,70px);object-fit:contain;display:block;margin:0 auto}
.wallet-ribbon{position:absolute;left:0;top:10%;width:100%;height:30%;pointer-events:none;z-index:-1}
.wallet-photo{width:auto;height:100%;max-height:min(68cqw,40cqh);max-width:68%;aspect-ratio:1;align-self:center;min-height:0;overflow:hidden;border:5px solid #edc437;border-radius:26px;background:#faf6ef;display:grid;place-items:center;color:#611B61}
.wallet-picture{width:100%;height:100%;object-fit:cover;display:block}.wallet-no-photo{text-align:center;font-size:17px;padding:20px}
.wallet-person{text-align:center;width:100%;padding:0 13px;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(5px,1.2cqh,8px)}
.wallet-label{font-size:14px;letter-spacing:2.5px;font-weight:600;color:#795370}.wallet-name{font-size:clamp(20px,4.8cqh,32px);line-height:1.12;font-weight:800;letter-spacing:-1px;color:#611B61;overflow-wrap:anywhere;margin:0;max-width:100%}
.wallet-plan-label{font-size:15px;font-weight:400;letter-spacing:1.5px;margin-top:4px}.wallet-badge{font-size:17px;font-weight:700;line-height:1.2;text-transform:uppercase;background:linear-gradient(110deg,#f7d85d,#e0ad1d 65%,#f3ce52);border:1px solid #d49f1b;box-shadow:inset 0 0 0 1px #ffeb9b;border-radius:6px;padding:7px 17px;max-width:90%;overflow-wrap:anywhere;color:#481346}
.wallet-face footer{flex-shrink:0;position:relative;isolation:isolate;min-height:0;height:clamp(48px,10cqh,66px);width:100%;display:flex;align-items:flex-end;justify-content:center;padding:22px 12px 12px;color:white;text-align:center;font-size:16px;line-height:1.3;margin-top:auto}
.wallet-wave{position:absolute;z-index:-1;width:100%;height:100%;inset:0}.wallet-title{font-size:clamp(18px,4cqh,25px);font-weight:500;display:flex;align-items:center;justify-content:center;gap:10px;margin:0 10px;text-align:center;line-height:1.2}.wallet-title svg{width:26px;height:28px;flex-shrink:0}
.wallet-qr{width:100%;height:100%;min-height:0;background:white;display:grid;place-items:center;overflow:hidden}.wallet-qr img{width:76%;height:100%;min-height:0;display:block;object-fit:contain}
.wallet-qr-error{font-size:16px;color:#611B61;text-align:center;padding:15px}
.wallet-instruction{font-size:clamp(14px,2.8cqh,18px);color:#4b4350;line-height:1.35;text-align:center;margin:0 22px}.wallet-details{text-align:center;width:100%;padding:0 13px;display:flex;flex:1;flex-direction:column;justify-content:center;align-items:center;gap:clamp(5px,1cqh,9px)}.wallet-details .wallet-name{font-size:clamp(20px,4.8cqh,32px)}.wallet-plan{font-size:clamp(18px,3.6cqh,23px);overflow-wrap:anywhere;max-width:100%}.wallet-id{font-size:clamp(13px,2.7cqh,16px);color:#514651;overflow-wrap:anywhere;max-width:100%}
.wallet-pager{display:flex;justify-content:center;align-items:center;gap:0;flex-shrink:0;height:24px;margin-top:2px}.wallet-pager button{position:relative;width:32px;height:24px;background:none;border:0;padding:0}.wallet-pager button:after{content:'';position:absolute;inset:8px 12px;border-radius:8px;background:#b99cba}.wallet-pager button[aria-pressed=true]:after{background:#efc331;inset-inline:8px}
.wallet-hint{font-size:14px;line-height:1.3;text-align:center;margin:0 0 8px;color:#f7e9f5}.wallet-upload{display:flex;align-items:center;justify-content:center;gap:12px;flex-shrink:0;min-height:44px;border:1px solid #d57ad1;border-radius:10px;background:transparent;color:white;font-size:18px;margin:0 7px;transition:transform .15s,background .15s}.wallet-upload svg{width:25px;height:25px}.wallet-upload:active{transform:scale(.98);background:#ffffff20}.wallet-back .wallet-upload{background:white;color:#611B61;border-color:white}
.wallet-status{margin:auto 24px;text-align:center;line-height:1.5}.wallet-retry{margin:10px auto 20px;padding:12px 24px;color:#611B61;border:0;border-radius:9px;background:white;font-size:16px}
.wallet-photo-dialog{width:min(90vw,400px);max-height:90dvh;overflow:auto;border:0;border-radius:18px;padding:22px;color:#611B61}.wallet-photo-dialog::backdrop{background:#210821c9}.wallet-photo-dialog h2{margin:0 0 18px;font-size:23px}.wallet-photo-dialog button{display:block;width:100%;border:1px solid #d5b5d2;background:#fff;color:#611B61;min-height:44px;border-radius:8px;margin-top:10px;font-size:16px}.wallet-photo-dialog .wallet-save{background:#611B61;color:white}.wallet-preview{width:100%;max-height:38dvh;object-fit:contain;margin-top:16px;border-radius:12px}.wallet-crop-note{font-size:14px}.wallet-photo-error{color:#922b36;font-size:15px}.wallet-photo-dialog button:disabled{opacity:.6}
/* Extremely short/landscape viewports retain legibility through outer scrolling. */
@media(max-height:500px){.wallet{overflow-y:auto}.wallet-ready{min-height:490px}}
@media(prefers-reduced-motion:reduce){.wallet-pages{scroll-behavior:auto}.wallet-upload{transition:none}.wallet-upload:active{transform:none}}
