/* Stable card rows: absolute artwork must never determine the grid track height. */
.shop-modal.game-panel .rov-trade .wares-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));grid-auto-rows:292px;gap:12px;align-items:start;flex:1;min-height:0}
.shop-modal.game-panel .rov-trade .offer-art{height:292px;width:172px;max-width:100%;aspect-ratio:auto;overflow:hidden;color:#f3e1bb}
.shop-modal.game-panel .offer-art>.content{z-index:1;inset:7% 10% 8%;display:grid;grid-template-rows:128px minmax(38px,auto) 36px 16px 24px;align-content:start;gap:2px}
.shop-modal.game-panel .offer-item{width:100%;height:128px;min-height:0;display:grid;place-items:center}
.shop-modal.game-panel .offer-item .catalog-art{width:min(100%,calc(var(--item-w,1)*96px));height:min(128px,calc(var(--item-h,1)*96px));object-fit:contain}
.shop-modal.game-panel .offer-art .offer-name{margin:0;align-self:center;font:16px/1.15 var(--heading);color:#f5e5c7}
.shop-modal.game-panel .offer-art .offer-price{margin:0;align-self:center;font:17px/1.1 var(--heading);color:#ffe1a0}
.shop-modal.game-panel .offer-footprint{font:10px/1.2 var(--sans);color:#c5b18c}.shop-modal.game-panel .offer-stock{margin:0;font:11px/1.2 var(--sans);color:#d1bd96}
.shop-modal.game-panel .merchant-layout .ware-card>.catalog-art{flex:0 0 100px;height:100px;min-height:0;width:min(100%,calc(var(--item-w,1)*96px));max-height:128px}
.shop-modal.game-panel .merchant-goods .wares-grid{grid-auto-rows:260px}
.shop-modal.game-panel .merchant-layout .ware-card{overflow:hidden}
.game-panel.has-trade-popup>.modal-body{isolation:isolate;overflow:hidden}.trade-popup{position:absolute;inset:0;z-index:30;display:grid;place-items:center;background:#070805a8;overflow:auto;padding:14px;overscroll-behavior:contain}
.game-panel .trade-popup .trade-confirmation{width:100%;min-height:0;height:auto;background:none;padding:0;display:grid;place-items:center}
.game-panel .trade-popup .trade-quantity-card{position:relative;width:min(520px,100%);aspect-ratio:auto;max-height:calc(100cqh - 28px);min-height:0;padding:32px 35px;border:0;border-image:none;border-radius:0;background:#16150fee;overflow:auto;box-shadow:0 12px 36px #000b,inset 0 0 0 1px #aa8345;color:#f1ddb6;isolation:isolate}
.game-panel .trade-popup .trade-quantity-skin{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;z-index:-1;opacity:.75}
.game-panel .trade-popup .trade-quantity-content{position:static;inset:auto;overflow:visible;padding:0;color:#f1ddb6}
.game-panel .trade-popup :is(h3,p,label,strong,span){color:#f1ddb6;text-shadow:0 1px 2px #000}
.game-panel .trade-popup .trade-item-heading{gap:12px;margin-bottom:12px}.game-panel .trade-popup .trade-item-heading>.catalog-art{height:62px;width:62px}.game-panel .trade-popup h3{font:24px/1.15 var(--heading);margin:0 0 4px}
.game-panel .trade-popup .trade-quantity-controls .merchant-button{min-width:44px;min-height:44px;padding:6px 12px;border:1px solid #b49151;border-image:none;background:linear-gradient(#51412a,#221c14);color:#fff0ce;box-shadow:inset 0 0 0 2px #211a12;text-shadow:0 1px #000;font:20px var(--heading);transform:none}
.game-panel .trade-popup .trade-quantity-controls .merchant-button:is(:before,:after){content:none}.game-panel .trade-popup .merchant-button:disabled{opacity:.5}
.game-panel .trade-popup #trade-quantity{background:#161810;color:#fff1ce;border:1px solid #ad8c51;width:80px;min-height:44px}
.game-panel .trade-popup .trade-total{font-size:15px}.game-panel .trade-popup .trade-error{min-height:0;margin:8px 0;font-size:13px}.game-panel .trade-popup .haggle{margin:10px 0;font-size:13px}.game-panel .trade-popup .haggle small{font-size:11px;color:#d4bf94}
.game-panel .trade-popup .trade-confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.game-panel .quantity-art-button{position:relative;isolation:isolate;border:0!important;background:none!important;box-shadow:none!important;padding:0!important;aspect-ratio:960/214;min-height:48px;color:#fff0ce;cursor:pointer}
.game-panel .quantity-art-button img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;z-index:0}
.game-panel .quantity-art-button span{position:absolute;left:24%;right:11%;top:0;bottom:0;display:grid;place-items:center;z-index:1;font:16px/1.1 var(--heading);color:#fff0ce;pointer-events:none;text-shadow:0 1px 3px #000}
.game-panel .quantity-art-button:hover:not(:disabled){filter:brightness(1.2)}.game-panel .quantity-art-button:disabled{opacity:.48}.game-panel .quantity-art-button:focus-visible{outline:2px solid #ffe4a7;outline-offset:2px}
body:has(.shop-modal) [data-recipient].drop-ready,body:has(.shop-modal) [data-shop-backpack].drop-ready{outline:2px solid #efc879;outline-offset:3px;filter:brightness(1.15)}
body:has(.shop-modal) [data-shop-backpack]{pointer-events:auto}.shop-modal [data-shop-item]{cursor:grab}.shop-modal [data-shop-item]:active{cursor:grabbing}
@container(max-width:650px){.shop-modal.game-panel .rov-trade .wares-grid{grid-template-columns:repeat(auto-fill,minmax(172px,1fr))}.game-panel .trade-popup .trade-quantity-card{padding:22px;max-height:calc(100cqh - 20px)}.game-panel .quantity-art-button span{font-size:13px}}

/* Keep the painted frame's aspect; scroll its contents on small viewports. */
.game-panel .trade-popup .trade-quantity-card{width:min(520px,100%,calc((100cqh - 28px)*600/706));aspect-ratio:600/706;min-width:min(340px,100%);min-height:400px;padding:0;overflow:hidden;background:#14150f}
.game-panel .trade-popup .trade-quantity-skin{object-fit:contain;opacity:1}
.game-panel .trade-popup .trade-quantity-content{position:absolute;inset:7% 9%;overflow:auto;padding:0 3px}
