/* Gift inbox and post-registration invitation styles stay scoped to their dialogs. */
@media(min-width:651px){
 dialog:has(.welcome-share){width:min(580px,calc(100vw - 32px));max-height:90vh;max-height:90dvh;border-radius:24px}
 dialog:has(.welcome-share)>.modal-header{padding:23px 25px 14px;gap:10px}
 dialog:has(.welcome-share)>.modal-header h2{font-size:25px}
 dialog:has(.welcome-share)>.modal-body{padding:0 25px 25px}
 .welcome-share .invite-panel{margin-top:20px}
 .welcome-share .modal-footer{margin-top:16px}
}
@media(min-width:651px) and (min-height:601px){
 .welcome-share-hero{flex-direction:column;gap:10px;padding:16px 24px;text-align:center}
 .welcome-pet-art{flex-basis:144px;width:144px;height:144px}
 .welcome-share-kicker{font-size:16px}
 .welcome-share-hero p{font-size:15px}
}

dialog:has(#giftbox-view){width:min(760px,calc(100vw - 24px));height:min(680px,calc(100vh - 28px));height:min(680px,calc(100dvh - 28px));max-height:calc(100dvh - 28px);overflow:hidden}
dialog[open]:has(#giftbox-view){display:flex;flex-direction:column}
dialog:has(#giftbox-view)>.modal-header{flex:0 0 auto}
dialog:has(#giftbox-view)>.modal-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
dialog:has(#giftbox-view) .dialog-feedback{flex:0 0 auto;max-height:4.8em;overflow:auto}
#giftbox-view{display:flex;flex-direction:column;flex:1;min-height:0}
#giftbox-view>.giftbox-intro,#giftbox-view>.giftbox-tabs{flex:0 0 auto}
.giftbox-intro{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}
.giftbox-intro p{margin:0 0 4px;font-size:15px;color:#45675a}.giftbox-intro small{font-size:12px;color:#809184}
.giftbox-intro .button{padding:9px 13px;font-size:13px;flex-shrink:0}
.giftbox-tabs{display:flex;align-items:center;gap:5px;border-bottom:1px solid #e4ece5;padding-bottom:11px;margin-bottom:16px}
.giftbox-tabs button{border:0;background:transparent;color:#728279;padding:9px 15px;border-radius:99px;font:inherit;font-size:13px;cursor:pointer}
.giftbox-tabs button[aria-pressed=true]{background:#e8f2eb;color:#356a52;font-weight:600}.giftbox-tabs button:hover{background:#f0f5ef}
.giftbox-tabs .gift-refresh{margin-left:auto;padding:8px}.gift-refresh .icon{width:17px;height:17px}
.gift-collection{flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable;overscroll-behavior:contain;padding:2px 3px 4px;scrollbar-width:thin;scrollbar-color:#bdcebf transparent}
.gift-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.gift-card{position:relative;text-align:center;border:1px solid #e6eadf;border-radius:18px;background:linear-gradient(155deg,#fffcf5,#f4f8f0);padding:10px 8px 14px;min-width:0;overflow:hidden}
.gift-card:nth-child(3n+2){background:linear-gradient(150deg,#fff9f2,#faf0ed)}.gift-card:nth-child(3n){background:linear-gradient(150deg,#faf8ff,#f2f1f8)}
.gift-card-content{border:0;background:transparent;display:flex;align-items:center;flex-direction:column;width:100%;padding:0;color:inherit;font:inherit}.gift-card-open{cursor:pointer}
.gift-card-open:focus-visible{outline:2px solid #397557;outline-offset:1px;border-radius:10px}
.gift-card-content>.gift-present{transform:scale(.79);margin:-10px -14px -17px;flex-shrink:0}
.gift-card-from{font-size:12px;color:#819080;line-height:1.5}.gift-card-from strong{display:block;font-size:14px;font-weight:600;color:#365347;max-width:180px;overflow-wrap:anywhere}
.gift-card-caption{font-size:11px;color:#839083;margin:7px 0 10px;line-height:1.5}
.gift-card-status{display:flex;align-items:center;gap:5px;color:#427657;font-size:11px;font-weight:600}.gift-card-status .icon{width:13px;height:13px}
.gift-card time{display:block;font-size:10px;color:#8b958b;margin-top:9px}.gift-card.is-opened{background:#fcfdfb}
.gift-opened-art{display:grid;place-items:center;height:135px;width:100%;margin:0 0 10px}.gift-opened-art>.item-art{width:90px;height:90px;object-fit:contain}
.gift-more{display:block;margin:16px auto 2px;font-size:13px}.gift-loading{padding:24px 8px;color:#728478;text-align:center;font-size:14px}
.gift-empty{text-align:center;padding:0 16px 25px}.gift-empty .gift-present{transform:scale(.85);margin:0 auto -12px}.gift-empty h3{font-size:20px;margin:0 0 8px}.gift-empty p{max-width:340px;margin:0 auto 18px;font-size:14px;color:#798b7c;line-height:1.65}

/* Center a single ordinary card without changing the unwrapping layout. */
.gift-grid.is-single{grid-template-columns:minmax(0,calc((100% - 24px)/3));justify-content:center}
@media(max-width:650px){.gift-grid.is-single{grid-template-columns:minmax(0,calc((100% - 12px)/2))}}
/* A hidden wrapper must leave the layout before the prize appears. */
#giftbox-view [hidden]{display:none!important}

/* Ribbon, paper, lid, folded bows and holly are all drawn with CSS. */
.gift-present{--paper:#d77e75;--light:#efb4a0;--dark:#b76464;--ribbon:#fce6bb;--ribbon-shade:#dfb989;--box-w:136px;--box-h:101px;display:block;position:relative;width:180px;height:188px;margin:0 auto;isolation:isolate;pointer-events:none}
.gift-rarity-2{--paper:#668d79;--light:#b2cdb4;--dark:#456d5d;--ribbon:#d59088;--ribbon-shade:#ae6467}
.gift-rarity-3{--paper:#a485b4;--light:#d3bcda;--dark:#80648e;--ribbon:#f4dbb1;--ribbon-shade:#ceac77}
.gift-rarity-4{--paper:#5e8098;--light:#a9c8ce;--dark:#3b596f;--ribbon:#e8c270;--ribbon-shade:#b18b43}
.gift-rarity-5{--paper:#7e628d;--light:#b9a2c4;--dark:#4e3d68;--ribbon:#f4d178;--ribbon-shade:#ba914e}
.gift-trim-gold{--ribbon:#f6d98f;--ribbon-shade:#b68c44}.gift-shape-wide{--box-w:155px;--box-h:83px}.gift-shape-tall{--box-w:113px;--box-h:123px}.gift-shape-round{--box-w:125px;--box-h:99px}
.present-shadow{position:absolute;bottom:8px;left:23px;width:134px;height:16px;background:radial-gradient(ellipse,#51645229,transparent 70%);z-index:-1}
.present-box{position:absolute;bottom:18px;left:calc((180px - var(--box-w))/2);width:var(--box-w);height:var(--box-h);border-radius:4px 4px 9px 9px;background:linear-gradient(110deg,var(--light),var(--paper) 36%,var(--dark));box-shadow:inset -7px 0 9px #2723371a,inset 2px -2px 1px #ffffff20,0 4px 7px #3a35401a;overflow:hidden}
.gift-shape-round .present-box{border-radius:5px 5px 38% 38%/5px 5px 13% 13%}.gift-shape-round .present-lid{border-radius:45%/28%}
.present-pattern{position:absolute;inset:0;font-size:18px;line-height:32px;text-align:left;padding:6px 12px;color:#ffffff63;text-shadow:35px 20px #ffffff63,76px 4px #ffffff63,99px 43px #ffffff63,4px 49px #ffffff63,48px 63px #ffffff63,75px 82px #ffffff63}
.gift-rarity-2 .present-pattern{font-size:12px;transform:rotate(-10deg)}.gift-rarity-4 .present-pattern,.gift-rarity-5 .present-pattern{color:#f6dc9e96;text-shadow:35px 20px #f6dc9e96,76px 4px #f6dc9e96,99px 43px #f6dc9e96,4px 49px #f6dc9e96,48px 63px #f6dc9e96,75px 82px #f6dc9e96}
.present-band{position:absolute;left:0;right:0;top:43%;height:18px;background:linear-gradient(var(--ribbon),var(--ribbon-shade));box-shadow:0 2px 2px #51364318}
.present-ribbon{position:absolute;width:22px;top:0;bottom:0;left:calc(50% - 11px);background:linear-gradient(90deg,var(--ribbon-shade),var(--ribbon) 27%,var(--ribbon) 69%,var(--ribbon-shade));box-shadow:2px 0 2px #51364316}
.gift-trim-gold .present-ribbon{width:27px;left:calc(50% - 13.5px)}
.present-top{position:absolute;left:calc((180px - var(--box-w))/2 - 4px);bottom:calc(var(--box-h) + 9px);height:17px;width:calc(var(--box-w) + 8px);z-index:2;transform-origin:50% 90%}
.present-lid{display:block;position:absolute;inset:0;border-radius:5px;background:linear-gradient(var(--light),var(--paper));box-shadow:0 4px 3px #372f4426,inset 0 2px 0 #ffffff49}
.present-lid:after{content:'';position:absolute;left:calc(50% - 13px);top:0;bottom:0;width:26px;background:linear-gradient(90deg,var(--ribbon-shade),var(--ribbon),var(--ribbon-shade))}
.present-bow{z-index:2;position:absolute;bottom:11px;left:calc(50% - 35px);width:70px;height:39px;filter:drop-shadow(0 2px 1px #4d354b21)}
.present-bow i{position:absolute;bottom:3px;width:34px;height:30px;border:7px solid var(--ribbon);box-shadow:inset 0 -3px 2px var(--ribbon-shade);border-radius:60% 80% 15% 70%;transform:rotate(14deg);left:1px}
.present-bow i:nth-child(2){left:auto;right:1px;transform:scaleX(-1) rotate(14deg)}.present-bow b{position:absolute;left:29px;bottom:1px;width:14px;height:17px;background:linear-gradient(110deg,var(--ribbon),var(--ribbon-shade));border-radius:6px;box-shadow:0 1px 2px #40243720}
.present-tails{position:absolute;top:-3px;left:calc(50% - 22px);width:44px;height:30px;background:var(--ribbon);clip-path:polygon(22% 0,49% 8%,80% 0,100% 90%,70% 75%,59% 100%,48% 20%,29% 100%,20% 75%,0 88%)}
.present-seal{position:absolute;top:53%;right:13px;width:25px;height:29px;background:#fff6df;color:var(--dark);font-size:19px;line-height:27px;border-radius:3px;transform:rotate(10deg);box-shadow:0 1px 3px #33283f1a}
.present-holly{z-index:3;position:absolute;top:-9px;right:18%;height:20px;width:27px;transform:rotate(-18deg)}.present-holly i{position:absolute;width:15px;height:9px;border-radius:12px 0 12px 0;background:#567557;transform:rotate(-30deg)}.present-holly i:nth-child(2){left:13px;transform:rotate(100deg)}.present-holly b{position:absolute;top:6px;left:10px;width:6px;height:6px;border-radius:50%;background:#c95d61;box-shadow:5px 0 #ac4e55,3px 5px #d37074}
.present-star{position:absolute;color:var(--ribbon-shade);font-size:20px;top:40px;left:6px}.present-star.two{font-size:13px;top:17px;left:auto;right:8px}.gift-rarity-1 .present-star{opacity:.45}

/* The reveal moves only after the server confirms acceptance. */
dialog:has(#gift-sent-view){width:min(540px,calc(100vw - 24px));max-height:calc(100dvh - 28px)}
.gift-reveal{max-width:430px;margin:0 auto;position:relative;text-align:center;overflow:hidden;isolation:isolate;padding:0 8px 7px}.gift-from{color:#869080;font-size:13px;margin:0 0 8px}.gift-from strong{color:#486950}
.gift-unwrap-art{display:block;margin:4px auto 0;padding:5px 20px;background:none;border:0;border-radius:20px;cursor:default}
.gift-unwrap-art>.gift-present{transform:scale(1.1);margin:12px auto 3px}
.gift-unwrap-copy{font-size:14px;color:#788572;margin:8px 0 18px}.gift-back{display:block;margin:14px auto 0;font-size:12px!important;color:#819080}
.gift-reveal-status{font-size:12px;color:#58725e;line-height:1.6;margin:12px 0 0;min-height:0}.gift-reveal-status:empty{margin:0}.gift-full-shelf{margin-top:12px;font-size:13px}
.gift-prize-art{width:142px;height:142px;margin:0 auto 12px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle,#fff2ce,#f7f8e8 60%,transparent 71%)}
.gift-prize-art>.item-art{width:110px;height:110px;object-fit:contain;filter:drop-shadow(0 6px 7px #5a58441c)}.gift-prize-art>.icon{width:64px;height:64px}
.gift-eyebrow{font-size:10px!important;letter-spacing:1.5px;text-transform:uppercase;color:#8d997b;margin:0 0 8px!important}
.gift-prize h3{font-family:Outfit,sans-serif;font-size:25px;line-height:1.2;margin:0 0 9px;color:#294c40;outline:none}.gift-prize-note{font-size:13px;line-height:1.65;margin:0 auto 19px;max-width:350px;color:#7a897a}
.gift-prize-actions{display:flex;gap:9px;justify-content:center;flex-wrap:wrap}.gift-prize-actions .button{font-size:13px;padding:10px 15px}
.gift-thanks{border-top:1px solid #e9eee4;margin-top:20px;padding-top:15px}.gift-thanks .text-link{display:inline-flex;gap:6px;align-items:center;font-size:13px;color:#668570}.gift-thanks .icon{width:15px;height:15px}.gift-thanks small{display:block;color:#929d8c;font-size:11px;margin-top:5px}.gift-thanks-sent{display:flex;justify-content:center;gap:6px;color:#6e8b73;font-size:12px;margin:18px 0 0}.gift-thanks-sent .icon{width:15px;height:15px}
.gift-burst{position:absolute;left:50%;top:43%;pointer-events:none;z-index:-1}.gift-burst i{position:absolute;width:7px;height:11px;border-radius:2px;background:#d2b679;opacity:0}.gift-burst i:nth-child(3n){background:#a4bb9b}.gift-burst i:nth-child(3n+1){background:#d5a5a1}
.is-unwrapping .present-top{animation:present-lift .85s cubic-bezier(.2,.7,.2,1) forwards}.is-unwrapping .present-box{animation:present-pop .85s ease forwards}.is-unwrapping .present-star{animation:present-twinkle .7s ease both}.is-unwrapping .gift-burst i{animation:present-confetti .9s ease-out var(--delay) both}.is-unwrapping .gift-unwrap-copy{opacity:0}.is-unwrapping .gift-unwrapping>.button{visibility:hidden}
.is-revealed .gift-prize{animation:gift-arrive .35s ease-out both}
@keyframes present-lift{0%{transform:rotate(0)}20%{transform:rotate(-8deg) translateY(-2px)}40%{transform:rotate(6deg)}100%{transform:translate(14px,-100px) rotate(24deg);opacity:0}}
@keyframes present-pop{0%,35%{transform:scale(1)}20%{transform:scale(1.04,.96)}65%{transform:scale(1.08)}100%{transform:translateY(30px) scale(.85);opacity:0}}
@keyframes present-twinkle{to{transform:scale(2.5);opacity:0}}@keyframes present-confetti{15%{opacity:1}100%{transform:translate(var(--tx),var(--ty)) rotate(var(--turn));opacity:0}}@keyframes gift-arrive{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:none}}
@media(max-width:650px){.topbar:has([data-action="gift-box"]){gap:7px;padding-inline:12px}.topbar:has([data-action="gift-box"]) .top-actions{gap:4px}.topbar:has([data-action="gift-box"]) .social-nav{width:30px;flex-basis:30px}.topbar:has([data-action="gift-box"]) .account-button>.icon{display:none}.gift-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.giftbox-intro{gap:8px}.giftbox-intro p{font-size:13px}.giftbox-intro .button{font-size:12px;padding:8px 10px}.giftbox-tabs button{padding:8px 11px}.gift-prize h3{font-size:22px}}
@media(max-width:380px){.topbar:has([data-action="gift-box"]){padding-inline:8px;gap:5px}.topbar:has([data-action="gift-box"]) .brand{font-size:21px;letter-spacing:-1px}.topbar:has([data-action="gift-box"]) .top-actions{gap:2px}.topbar:has([data-action="gift-box"]) .social-nav{width:27px;flex-basis:27px}.topbar:has([data-action="gift-box"]) .social-nav>.icon{width:19px;height:19px}.topbar:has([data-action="gift-box"]) .header-admin{font-size:10px;padding:4px}.gift-card-content>.gift-present{transform:scale(.69);margin:-16px -25px -22px}.gift-card{padding-inline:5px}.gift-card-caption{font-size:10px}.giftbox-intro{flex-wrap:wrap}}
@media(max-height:620px){.gift-unwrap-art>.gift-present{transform:scale(.85);margin:-6px auto -12px}.gift-prize-art{width:105px;height:105px;margin-bottom:7px}.gift-prize-art>.item-art{width:84px;height:84px}.gift-thanks{margin-top:13px;padding-top:10px}.gift-unwrap-copy{margin-block:4px 13px}}
@media(prefers-reduced-motion:reduce){.gift-reveal *{animation:none!important;transition:none!important}}

@media(max-width:350px){.topbar:has([data-action="gift-box"]){padding-inline:6px;gap:4px}.topbar:has([data-action="gift-box"]) .brand{font-size:19px}.topbar:has([data-action="gift-box"]) .header-admin{font-size:9px;padding:4px 2px}.topbar:has([data-action="gift-box"]) .account-button .avatar{width:26px;height:26px}.topbar:has([data-action="gift-box"]) .mobile-menu{width:24px}.topbar:has([data-action="gift-box"]) .social-nav{width:26px;flex-basis:26px}}

/* History stays still; sent wrapping expands using native details, without a request. */
.gift-sent-details>summary{list-style:none}.gift-sent-details>summary::-webkit-details-marker{display:none}
.gift-sent-contents{display:grid;justify-items:center;gap:7px;border-top:1px solid #e5e7dc;margin-top:12px;padding-top:12px;font-size:12px;color:#46644e}
.gift-sent-contents>.item-art{width:58px;height:58px;object-fit:contain}.gift-sent-contents small{font-size:10px;color:#84917e}
.gift-card .gift-thanks{margin-top:12px;padding-top:10px}.gift-card .gift-thanks .text-link{font-size:11px}.gift-card .gift-thanks small{font-size:10px}.gift-card .gift-thanks-sent{font-size:11px;margin:0}
.gift-reveal-back{margin-top:15px}.gift-reveal-back .button,.gift-retry .button{font-size:13px;padding:9px 14px}.gift-retry{margin-top:12px}
.no-gift-animation .gift-prize{animation:none}
.gift-send{text-align:center;padding:0 8px 10px}.gift-send-art{overflow:hidden;padding-top:7px;margin-bottom:10px}.gift-send-art>.gift-present{margin:auto}
.gift-send h3{font-family:Outfit,sans-serif;font-size:24px;margin:8px 0;color:#294c40}.gift-send>p:not(.gift-eyebrow){font-size:14px;line-height:1.7;color:#758672;margin:8px 0 22px}
/* A single short wrapping animation belongs only to a successful new send. */
.is-sending .gift-present{animation:gift-send-float 1.15s ease-out both}
.is-sending .present-top{animation:gift-wrap-lid .6s cubic-bezier(.2,.8,.2,1) both}
.is-sending .present-box{animation:gift-wrap-box .45s ease-out both}
.is-sending .present-star{animation:gift-send-sparkle .9s .25s ease-out both}
@keyframes gift-wrap-lid{from{opacity:0;transform:translateY(-65px) rotate(-15deg)}65%{opacity:1;transform:translateY(2px) rotate(2deg)}to{transform:none}}
@keyframes gift-wrap-box{from{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}
@keyframes gift-send-float{0%,55%{transform:translateY(0)}78%{transform:translateY(-10px) rotate(-2deg)}100%{transform:none}}
@keyframes gift-send-sparkle{0%{opacity:0;transform:scale(.3)}50%{opacity:1;transform:scale(1.5)}100%{opacity:.7;transform:none}}
@media(prefers-reduced-motion:reduce){.gift-send *{animation:none!important;transition:none!important}}
