/* Mobile shop: independently scrolling catalog, collapsible cart, fixed checkout row. */
/* NPC desktop side portraits must not leave a narrow, vertical mobile header. */
html[data-mobile-ui="true"] body #cc-game .g-dialog.sv21-npc-dialog:not(:has(.sv-appearance-editor)){display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:0!important}
html[data-mobile-ui="true"] body #cc-game .g-dialog:not(:has(.sv-appearance-editor))>.g-dialoghead{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;align-self:stretch!important;width:100%!important;min-width:0!important;box-sizing:border-box;flex:0 0 auto!important;text-align:left!important;border-left:0!important;margin:0 0 8px!important;padding:0 0 8px!important;top:0!important}
html[data-mobile-ui="true"] body #cc-game .g-dialog:not(:has(.sv-appearance-editor))>.g-dialoghead>div{flex:1 1 0!important;min-width:0!important}
html[data-mobile-ui="true"] body #cc-game .g-dialog:not(:has(.sv-appearance-editor))>.g-dialoghead>.g-close{position:static!important;align-self:center!important;flex:0 0 auto!important;min-width:44px!important;min-height:44px!important;margin:0!important;padding:8px!important}
html[data-mobile-ui="true"] body #cc-game .g-dialog.sv21-npc-dialog:not(:has(.sv-appearance-editor))>#g-dialogbody{align-self:stretch!important;width:100%!important;max-width:100%!important;min-width:0!important;min-height:0!important;flex:1 1 auto!important;box-sizing:border-box;padding:0!important;margin:0!important}
html[data-mobile-ui="true"] body #cc-game .g-dialog:has(.sv131-shop){display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;overflow:hidden!important;padding:10px!important}
html[data-mobile-ui="true"] body #cc-game .g-dialog:has(.sv131-shop)>.g-dialoghead{position:static!important;min-height:44px;top:auto!important;margin:0 0 6px!important;padding:0 0 6px!important}
html[data-mobile-ui="true"] body #cc-game .g-dialog:has(.sv131-shop) .g-portrait{display:none!important}
html[data-mobile-ui="true"] body #cc-game .g-dialog:not(:has(.sv-appearance-editor)):has(.sv131-shop)>#g-dialogbody{display:flex!important;flex:1 1 0!important;min-width:0;min-height:0;overflow:hidden!important}
html[data-mobile-ui="true"] body #cc-game .sv-root:has(>.sv131-shop){display:flex;flex-direction:column;flex:1 1 0;min-width:0;min-height:0;overflow:hidden}
html[data-mobile-ui="true"] body #cc-game .sv-root:has(>.sv131-shop)>.sv-storage-note{flex:none;max-height:32px;overflow:auto;font-size:11px;line-height:1.3;margin:3px 0 0}
html[data-mobile-ui="true"] body #cc-game .sv131-shop{display:flex;flex-direction:column;flex:1 1 0;min-width:0;min-height:0;overflow:hidden}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-store-heading{flex:none;align-items:center;gap:8px;padding:0 2px 6px;border-bottom:1px solid #c9b78f}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-store-heading h3{font-size:17px;line-height:1.4;margin:0;white-space:nowrap}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-store-heading .sv-balance{display:flex;align-items:baseline;gap:6px;text-align:right;white-space:nowrap}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-store-heading .sv-balance span{font-size:11px}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-store-heading .sv-balance strong{font-size:18px;line-height:1.4}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv121-shop-nav{flex:none;min-width:0;margin:0;padding:6px 0}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv121-shop-nav .sv-tabs{display:flex;flex-wrap:nowrap;gap:5px;min-width:0;margin:0;padding:0 0 3px;border:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv121-shop-nav .sv-tab{flex:0 0 auto;min-width:52px;min-height:44px;padding:7px 10px;white-space:nowrap;font-size:13px;line-height:1.4}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-catalog{flex:1 1 0;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scroll-padding-block:8px;outline-offset:-2px;padding:0 2px 10px}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv121-shop-note{font-size:12px;line-height:1.5;margin:4px 0 8px}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-product{min-width:0;padding:10px 7px;gap:5px;border-radius:8px;box-shadow:0 2px 0 #c6ae8360}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-product .sv-row h3{font-size:13px;line-height:1.5}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-product .sv-note{font-size:11px;line-height:1.5;margin:4px 0}
html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-product>.sv-button{min-height:44px;font-size:12px;padding:7px 4px}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-footer{position:relative;z-index:4;flex:0 0 auto;min-width:0;padding:0 2px;border-top:1px solid #c9b78f;background:#fbf3df;box-shadow:0 -5px 9px #5d472015}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-cart{position:static}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-cart>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;box-sizing:border-box;list-style:none;cursor:pointer;font-size:13px;line-height:1.4;font-weight:650}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-cart>summary::-webkit-details-marker{display:none}
html[data-mobile-ui="true"] body #cc-game .sv131-cart-toggle::after{content:'展开清单 ▴';font-size:12px;font-weight:400}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-cart[open] .sv131-cart-toggle::after{content:'收起清单 ▾'}
html[data-mobile-ui="true"] body #cc-game .sv131-cart-items{position:absolute;bottom:100%;left:0;right:0;z-index:1;box-sizing:border-box;max-height:min(240px,max(72px,calc(var(--mobile-vh,100dvh) - 270px)));overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scroll-padding-block:6px;outline-offset:-2px;padding:8px;border:1px solid #c9b78f;border-radius:10px 10px 0 0;background:#fbf3df;box-shadow:0 -5px 16px #5d472025}
html[data-mobile-ui="true"] body #cc-game .sv131-cart-items .sv-empty{padding:12px 4px;font-size:13px}
html[data-mobile-ui="true"] body #cc-game .sv131-cart-items .sv-cart-row{display:grid;grid-template-columns:minmax(0,1fr) 134px;gap:4px 10px;padding:8px 0;align-items:center}
html[data-mobile-ui="true"] body #cc-game .sv131-cart-items .sv-cart-row .sv-row h3{font-size:13px;line-height:1.4}
html[data-mobile-ui="true"] body #cc-game .sv131-cart-items .sv-cart-count{grid-template-columns:44px minmax(28px,1fr) 44px;gap:5px;margin:0}
html[data-mobile-ui="true"] body #cc-game .sv131-cart-items .sv-cart-count .sv-quantity-button{width:44px;min-height:44px;padding:0}
html[data-mobile-ui="true"] body #cc-game .sv131-cart-items .sv-cart-row>.sv-button{justify-self:start;min-width:44px;min-height:44px;font-size:12px;line-height:1.3;padding:7px 4px}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-checkout{display:grid;grid-template-columns:minmax(0,1fr) minmax(140px,1fr);align-items:center;gap:10px}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-checkout .sv-cart-total{display:flex;flex-direction:column;align-items:flex-start;gap:1px;margin:0;font-size:11px;line-height:1.35}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-checkout .sv-cart-total strong{font-size:19px;line-height:1.4}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-checkout>.sv-button{min-width:0;min-height:46px;font-size:13px;padding:8px}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-footer>.sv-note{font-size:10px;line-height:1.4;margin:5px 0 0}
html[data-mobile-ui="true"] body #cc-game .sv131-shop-footer>.sv-error{box-sizing:border-box;font-size:12px;line-height:1.5;max-height:54px;overflow:auto;margin:0 0 6px;padding:6px 8px}
@media(min-width:600px){
 html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv-product-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 html[data-mobile-ui="true"] body #cc-game .sv131-shop .sv121-departments{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-height:520px){
 html[data-mobile-ui="true"] body #cc-game .sv131-shop-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,1fr);gap:0 14px;align-items:center}
 html[data-mobile-ui="true"] body #cc-game .sv131-shop-cart{grid-column:1;grid-row:1}
 html[data-mobile-ui="true"] body #cc-game .sv131-shop-checkout{grid-column:2;grid-row:1}
 html[data-mobile-ui="true"] body #cc-game .sv131-shop-footer>.sv-error{grid-column:1/-1;grid-row:2}
 html[data-mobile-ui="true"] body #cc-game .sv131-shop-footer>.sv-note{display:none}
}
@media(max-height:520px) and (max-width:599px){
 html[data-mobile-ui="true"] body #cc-game .sv131-shop-footer{display:block}
}
