/* Stable viewport layer avoids resizing the background as mobile browser bars move. */
.folder-cart .folder-art{background:url('assets/bear-folder.png') -19px -12px/137px 110px no-repeat;clip-path:none}
body::before{display:none}
.shop-background{position:fixed;top:0;left:0;width:100%;height:100vh;height:100lvh;z-index:-1;pointer-events:none;background:#eefcff url('assets/maozi-fixed-background.png') center/cover no-repeat;transform:translateZ(0);backface-visibility:hidden}
body .grid .card{filter:none;transform-style:flat}
body .grid .card .photo-button{transform-style:flat}
body dialog#cart{width:min(440px,calc(100% - 28px));padding:32px 28px 26px;max-height:86dvh;filter:none;transform-origin:50% 8%}
body dialog#cart[open]{animation:receipt-drop .48s cubic-bezier(.2,.85,.25,1.08) both}
body dialog#cart[open]::backdrop{animation:receipt-backdrop .28s ease both}
@keyframes receipt-drop{0%{opacity:0;transform:translateY(-34px) rotate(-2.4deg) scale(.92)}58%{opacity:1;transform:translateY(7px) rotate(1deg) scale(1.01)}78%{transform:translateY(-3px) rotate(-.45deg) scale(1)}100%{opacity:1;transform:translateY(0) rotate(0) scale(1)}}
@keyframes receipt-backdrop{from{opacity:0}to{opacity:1}}
body #cart .dialog-head{width:calc(100% - 20px);margin:0 auto 18px;padding:5px 15px 0}
body #cart .dialog-head h2{font-size:20px;letter-spacing:1px;margin:7px 0 4px}
body #cart .eyebrow{font-size:9px;letter-spacing:1px}
body #cart .receipt-subtitle{display:none}
body #cart .receipt-rule,body #cartItems,body #cart .receipt-total,body #cart .cart-bottom{width:calc(100% - 30px);margin-left:auto;margin-right:auto}
body #cart .receipt-rule{padding:10px 2px;font-size:10px}
body #cartItems{max-height:clamp(120px,31dvh,280px);overflow:auto;overscroll-behavior:contain;padding:0 2px}
body #cart .cart-row{gap:10px;padding:13px 0;align-items:center;display:grid;grid-template-columns:40px minmax(0,1fr) 18px auto}
body #cart .cart-row img{width:40px;height:48px}
body #cart .cart-row h3{font-size:13px;line-height:1.5;margin:0 0 4px;overflow-wrap:anywhere}
body #cart .cart-row p{font-size:10px;line-height:1.5}
body #cart .remove{font-size:10px;align-self:center;min-height:32px}
body #cart .receipt-total{font-size:14px;padding:14px 2px}
body #cart .cart-bottom p{font-size:11px;margin:15px 0 12px;line-height:1.7}
body #cart .primary{width:78%;margin:0 auto;font-size:15px;padding:10px;min-height:42px}
body #cart .receipt-end{margin:19px 0 0;font-size:13px;letter-spacing:2px}
body #cart .receipt-end span{font-size:10px;margin-top:4px}
body #cart .empty{padding:22px 0;font-size:12px}body #cart .empty span{font-size:27px}
@media(max-width:650px){body dialog#cart{padding:29px 20px 23px}body #cart .receipt-rule,body #cartItems,body #cart .receipt-total,body #cart .cart-bottom{width:calc(100% - 20px)}body #cart .dialog-head{width:calc(100% - 12px)}body #cart .cart-row{grid-template-columns:36px minmax(0,1fr) 16px auto;gap:7px}body #cart .cart-row img{width:36px;height:43px}}
@media(prefers-reduced-motion:reduce){body dialog#cart[open],body dialog#cart[open]::backdrop{animation:none}}
.edit-toolbar{position:sticky;top:70px;z-index:4;display:flex;gap:7px;align-items:center;flex-wrap:wrap;padding:10px;background:#eff9fff5;border:1px solid #8cbdd7;border-radius:10px;font-size:12px}
.edit-toolbar[hidden],.edit-product[hidden]{display:none}
.edit-toolbar button,.edit-product{border:1px solid #81b5d0;border-radius:5px;background:white;padding:7px;color:#275b77}
body .grid .card .edit-product{display:block;margin:10px auto 0;width:100%;font-size:12px;background:#fff0f7;border-color:#d9a7c1}
body .grid .card .edit-product[hidden]{display:none}
body.editing .grid .card{rotate:0deg!important;transform:none!important}
#inlineEditor{width:min(460px,calc(100% - 28px));max-height:85dvh;padding:20px;border:2px solid #b2d3e8;border-radius:16px;background:#f8fcff;filter:none}
.editor-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.editor-head h2{margin:0;font-size:20px}.editor-head button{border:0;background:transparent;font-size:26px;width:40px;height:40px}
#inlineEditor label{display:grid;gap:5px;font-size:13px;margin:10px 0}#inlineEditor input,#inlineEditor select{width:100%;min-width:0;border:1px solid #b2d3e8;background:white;border-radius:6px;padding:9px;font-size:16px;color:#27516a}
.editor-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.editor-images{display:flex;gap:8px;overflow:auto;padding:8px 0}.editor-images>div{flex:0 0 86px}.editor-images img{width:86px;height:80px;object-fit:cover;border-radius:5px}.editor-images button{font-size:11px;padding:5px;border:1px solid #c5dae7;background:white;border-radius:4px;margin:2px 0}
.editor-help{font-size:11px;color:#668699}.editor-footer{display:flex;gap:10px;justify-content:space-between;margin-top:15px}.editor-save{border:1px solid #81b5d0;border-radius:6px;background:#ceeaff;padding:10px 16px;color:#254e71;font-weight:700}.editor-footer [data-delete-product]{border:0;background:none;color:#a74668;font-size:12px}.editor-status{font-size:12px;color:#a74668;min-height:18px;margin:8px 0 0}
