/* Content count must not change the geometry of any embedded inventory. */
html[data-client] body #dialogue-box.npc-dialogue:is(.trade-buy,.trade-sell) .shop-bag-grid,html body #dialogue-box.npc-dialogue .refine-panel .refine-bag-grid {
 height:196px!important;max-height:196px!important;min-height:0!important;
 overflow-y:auto!important;overflow-x:hidden!important;align-content:start!important;
 grid-auto-rows:44px!important;grid-template-rows:none!important;scrollbar-gutter:stable;
 overscroll-behavior:contain;touch-action:pan-y!important;box-sizing:border-box;padding-right:5px;
}
html body #dialogue-box :is(.shop-bag-slot,.refine-bag-slot){min-height:44px;max-height:44px;aspect-ratio:auto!important}
html body #dialogue-box :is(.shop-linked-bag,.refine-bag){min-height:0!important;min-width:0!important;align-self:start!important}
html[data-client=pc] body #dialogue-box.open:is(.trade-buy,.trade-sell) {overflow:hidden!important;display:flex;flex-direction:column}
html[data-client=pc] body #dialogue-box:is(.trade-buy,.trade-sell) .npc-intro{flex:none}
html[data-client=pc] body #dialogue-box:is(.trade-buy,.trade-sell) .npc-trade{min-height:0!important;flex:1!important;overflow-y:auto!important;overflow-x:hidden!important;max-height:100%!important}
html[data-client=pc] body #dialogue-box:is(.trade-buy,.trade-sell) .npc-actions{flex:none}
html body #inventory-grid{max-height:244px;overflow-y:auto!important;overflow-x:hidden!important;grid-auto-rows:44px;align-content:start;overscroll-behavior:contain}
html body #storage-window .storage-mobile-bag{max-height:280px;overflow-y:auto;align-content:start}
@media(max-width:680px){html body #dialogue-box :is(.shop-bag-grid,.refine-bag-grid){height:156px!important;max-height:156px!important}}

/* V8: top anchored full shop, scroll only the growing sell list. */
html[data-client=pc] body #dialogue-box.open:is(.trade-buy,.trade-sell){top:16px!important;bottom:auto!important;transform:translateX(-50%) scale(var(--pc-shop-scale,1))!important;transform-origin:top center!important;box-sizing:border-box!important}
html[data-client=pc] body #dialogue-box:is(.trade-buy,.trade-sell) .npc-trade{flex:none!important;max-height:none!important;overflow:visible!important}
html[data-client=pc] body #dialogue-box.trade-sell .npc-trade{max-height:260px!important;overflow-y:auto!important}
html[data-client=pc] body #dialogue-box.trade-sell .trade-footer{position:sticky!important;bottom:0;z-index:2}
