/* One bounded landscape inventory, with the same authored slots in both bags. */
@media (orientation: landscape) {
 #gameFrame #gameMenu.standard-menu-open #inventoryPage:not([hidden]),
 #gameFrame #gameMenu.standard-menu-open #inventoryPage:not([hidden]):has(#inventoryMaterialsTabPanel:not([hidden])) {
  display:grid!important;grid-template-rows:32px minmax(0,1fr)!important;gap:4px!important;
  min-height:0!important;padding:0!important;overflow:hidden!important;
 }
 #gameFrame #inventoryPage > h2 { display:none!important; }
 #gameFrame #inventoryPage > .inventory-tabs {
  height:32px!important;min-height:0!important;margin:0!important;gap:8px!important;align-items:stretch!important;
 }
 #gameFrame #inventoryPage > .inventory-tabs button { height:32px!important;min-height:0!important;min-width:100px!important;padding:2px 12px!important;font-size:12px!important; }
 #gameFrame #inventoryPage .inventory-tabs-content,
 #gameFrame #inventoryPage .inventory-tab-panel:not([hidden]),
 #gameFrame #inventoryPage .inventory-layout-v31 {
  height:100%!important;min-height:0!important;min-width:0!important;max-height:100%!important;overflow:hidden!important;
 }
 #gameFrame #inventoryPage .inventory-layout-v31 {
  display:grid!important;grid-template-columns:minmax(0,36fr) minmax(0,64fr)!important;grid-template-rows:minmax(0,1fr)!important;gap:12px!important;padding:0!important;
 }
 #gameFrame #inventoryPage .equipment-panel,
 #gameFrame #inventoryPage .backpack-panel {
  min-height:0!important;min-width:0!important;height:100%!important;padding:0!important;margin:0!important;overflow:hidden!important;background:transparent!important;
 }
 #gameFrame #inventoryPage .equipment-panel { display:grid!important;grid-template-rows:20px minmax(0,1fr)!important;gap:4px!important; }
 #gameFrame #inventoryPage .equipment-panel > h3 { display:block!important;font-size:13px!important;line-height:20px!important;margin:0!important;text-align:center; }
 #gameFrame #inventoryPage .equipment-grid {
  width:100%!important;height:100%!important;min-height:0!important;min-width:0!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:repeat(5,minmax(0,1fr))!important;grid-auto-rows:minmax(0,1fr)!important;gap:4px!important;
 }
 #gameFrame #inventoryPage .equipment-slot {
  min-height:0!important;min-width:0!important;width:100%!important;height:100%!important;padding:2px!important;overflow:hidden!important;
 }
 #gameFrame #inventoryPage .equipment-slot .inventory-item-icon { width:60%!important;height:65%!important;min-height:0!important;max-height:100%!important;margin:0!important; }
 #gameFrame #inventoryPage .equipment-slot small,
 #gameFrame #inventoryPage .equipment-placeholder { font-size:clamp(8px,1.9dvh,11px)!important;line-height:1.1!important;white-space:normal!important; }
 #gameFrame #inventoryPage .equipment-hand-badge { padding:0!important;top:2px!important;font-size:7px!important;background:transparent!important; }
 #gameFrame #inventoryPage .inventory-details { display:none!important; }
 #gameFrame #inventoryPage #backpackInventoryView,
 #gameFrame #inventoryPage .material-pouch {
  display:grid!important;grid-template-rows:20px minmax(0,1fr) 30px!important;
  min-height:0!important;height:100%!important;padding:0!important;gap:4px!important;overflow:hidden!important;
  border:0!important;border-image:none!important;border-radius:0!important;background:transparent!important;
 }
 #gameFrame #inventoryPage .backpack-heading,
 #gameFrame #inventoryPage .material-pouch-heading { grid-row:1!important;min-height:0!important;margin:0!important;display:flex!important;align-items:center!important;gap:8px!important; }
 #gameFrame #inventoryPage .backpack-heading h3,
 #gameFrame #inventoryPage .material-pouch-heading h3 { font-size:13px!important;line-height:20px!important;margin:0!important; }
 #gameFrame #inventoryPage .backpack-heading strong,
 #gameFrame #inventoryPage .material-pouch-heading strong { font-size:10px!important;line-height:1.1!important;min-width:0!important; }
 #gameFrame #inventoryPage .material-pouch-heading small,
 #gameFrame #inventoryPage .material-pouch-help { display:none!important; }
 #gameFrame #inventoryPage :is(#inventoryGrid,#materialPouchGrid) {
  display:grid!important;grid-row:2!important;align-self:center!important;justify-self:center!important;
  grid-template-columns:repeat(var(--inventory-columns,8),var(--inventory-cell,40px))!important;
  grid-template-rows:repeat(var(--inventory-rows,2),var(--inventory-cell,40px))!important;
  width:max-content!important;max-width:100%!important;height:max-content!important;aspect-ratio:auto!important;min-width:0!important;min-height:0!important;padding:0!important;gap:4px!important;overflow:hidden!important;
 }
 #gameFrame #inventoryPage :is(#inventoryGrid,#materialPouchGrid) > .inventory-slot {
  display:grid!important;place-items:center!important;position:relative!important;box-sizing:border-box!important;
  width:var(--inventory-cell,40px)!important;height:var(--inventory-cell,40px)!important;max-width:var(--inventory-cell,40px)!important;max-height:var(--inventory-cell,40px)!important;min-width:0!important;min-height:0!important;aspect-ratio:1!important;padding:3px!important;
  border:2px solid transparent!important;border-image:url('assets/ui-v63/frame.png') 10 / 6px / 0 stretch!important;border-radius:0!important;
  background:rgba(7,15,15,.5)!important;opacity:1!important;box-shadow:none!important;
 }
 #gameFrame #inventoryPage :is(#inventoryGrid,#materialPouchGrid) > .inventory-slot:is(.selected,:focus-visible) { border-image-source:url('assets/ui-v63/frame-gold.png')!important; }
 #gameFrame #inventoryPage :is(#inventoryGrid,#materialPouchGrid) > .inventory-slot.locked { opacity:.4!important; }
 #gameFrame #inventoryPage :is(#inventoryGrid,#materialPouchGrid) > .inventory-slot[hidden] { display:none!important; }
 #gameFrame #inventoryPage :is(#inventoryGrid,#materialPouchGrid) > .inventory-slot .inventory-item-icon { width:70%!important;height:70%!important;min-height:0!important;max-height:100%!important;margin:0!important; }
 #gameFrame #inventoryPage :is(#inventoryGrid,#materialPouchGrid) .inventory-stack-count { position:absolute!important;bottom:4px!important;right:5px!important;font-size:clamp(9px,2.4dvh,14px)!important; }
 #gameFrame #inventoryPage :is(#inventoryGrid,#materialPouchGrid) .inventory-slot-number { font-size:11px!important;opacity:.25!important; }
 #gameFrame #inventoryPage :is(.inventory-pagination,.material-pouch-pagination) {
  position:static!important;grid-row:3!important;width:auto!important;height:30px!important;min-height:0!important;
  display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;gap:12px!important;margin:0!important;transform:none!important;
 }
 #gameFrame #inventoryPage :is(.inventory-pagination,.material-pouch-pagination) button { width:36px!important;height:30px!important;min-height:0!important;padding:0!important;font-size:20px!important; }
 #gameFrame #inventoryPage :is(.inventory-pagination,.material-pouch-pagination) span { writing-mode:horizontal-tb!important;transform:none!important;font-size:11px!important; }
 #gameFrame #inventoryPage #inventoryMaterialsTabPanel:not([hidden]) { display:grid!important;place-items:stretch center!important; }
 #gameFrame #inventoryPage .material-pouch { width:64%!important; }
 #gameFrame #inventoryPage [hidden] { display:none!important; }
 #gameFrame .inventory-inspect-card {
  box-sizing:border-box!important;width:min(740px,100%)!important;
  height:min(350px,100%)!important;max-height:100%!important;
  display:grid!important;grid-template-columns:70px minmax(0,1fr)!important;grid-template-rows:58px 28px minmax(0,1fr) auto!important;
  gap:6px 12px!important;padding:10px 14px!important;overflow:hidden!important;
 }
 #gameFrame .inventory-inspect-icon { box-sizing:border-box!important;position:static!important;width:58px!important;height:58px!important;max-height:58px!important;grid-row:1!important;grid-column:1!important;align-self:start!important;padding:4px!important;overflow:hidden!important; }
 #gameFrame .inventory-inspect-icon .inventory-item-icon { width:48px!important;height:48px!important;max-width:100%!important;max-height:100%!important; }
 #gameFrame .inventory-inspect-card header { grid-column:2!important;grid-row:1!important;padding-right:30px!important; }
 #gameFrame .inventory-inspect-card h3 { font-size:18px!important;line-height:1.15!important;margin:0!important; }
 #gameFrame .inventory-inspect-card header strong { font-size:11px!important; }
 #gameFrame .inventory-inspect-info-tabs { grid-column:1/-1;grid-row:2;display:flex;gap:6px;align-items:center;min-height:0; }
 #gameFrame .inventory-inspect-info-tabs button { min-height:28px!important;height:28px!important;padding:2px 9px!important;font-size:12px!important; }
 #gameFrame .inventory-inspect-info-tabs button[aria-pressed=true] { color:#f4df9b;border-color:#e8d187; }
 #gameFrame .inventory-inspect-info-tabs span { font-size:11px;margin-left:auto; }
 #gameFrame .inventory-inspect-scroll { grid-column:1/-1!important;grid-row:3!important;overflow:hidden!important;display:block!important;min-height:0!important;padding:8px!important; }
 #gameFrame .inventory-inspect-scroll :is(p,b) { margin:0!important;font-size:12px!important;line-height:1.35!important;white-space:pre-line!important; }
 #gameFrame .inventory-inspect-scroll > b { display:block; }
 #gameFrame .inventory-inspect-scroll > [hidden] { display:none!important; }
 #gameFrame .inventory-inspect-actions { grid-column:1/-1!important;grid-row:4!important;display:flex!important;flex-wrap:nowrap!important;gap:8px!important;margin:0!important;min-height:0!important; }
 #gameFrame .inventory-inspect-actions :is(button,select) { min-width:0!important;flex:1!important;min-height:36px!important;height:36px!important;padding:4px!important;font-size:12px!important; }
 #gameFrame .inventory-inspect-close { width:30px!important;height:30px!important;min-height:30px!important; }
 #gameFrame .merchant-purchase-close { position:static!important;grid-column:3!important;grid-row:1!important;transform:none!important;width:36px!important;height:36px!important;min-height:36px!important; }
 @media (max-height:320px) {
  #gameFrame .merchant-purchase-card { align-content:start!important;padding:6px!important;gap:3px 12px!important;grid-template-rows:32px 14px 14px 68px 18px auto 32px!important; }
  #gameFrame .merchant-purchase-heading { grid-template-columns:32px minmax(0,1fr) 32px!important;min-height:0!important;height:32px!important; }
  #gameFrame .merchant-purchase-heading h3 { font-size:16px!important; }
  #gameFrame .merchant-purchase-icon,#gameFrame .merchant-purchase-icon .item-icon { width:32px!important;height:32px!important; }
  #gameFrame .merchant-purchase-close { width:32px!important;height:32px!important;min-height:32px!important; }
  #gameFrame .merchant-purchase-card p { font-size:11px!important;line-height:1.2!important; }
  #gameFrame .merchant-purchase-quantity { grid-template-rows:32px 22px 10px!important;gap:2px 8px!important;font-size:12px!important;min-height:0!important; }
  #gameFrame .merchant-purchase-quantity .merchant-quantity-number { height:32px!important;font-size:16px!important; }
  #gameFrame .merchant-purchase-quantity .merchant-quantity-slider { height:22px!important; }
  #gameFrame .merchant-quantity-range { font-size:9px!important;line-height:10px!important; }
  #gameFrame .merchant-purchase-total { font-size:14px!important;line-height:18px!important; }
  #gameFrame .merchant-purchase-feedback { grid-row:6!important; }
  #gameFrame .merchant-purchase-actions { grid-row:7!important;min-height:0!important; }
  #gameFrame .merchant-purchase-actions button { min-height:32px!important;height:32px!important;font-size:12px!important; }
 }
 @media (max-height:560px) {
  #gameFrame #bankPage :is(#bankGrid,#bankInventoryGrid,#bankMaterialGrid) { grid-template-columns:repeat(8,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important;aspect-ratio:auto!important;min-height:0!important;max-height:100%!important;overflow:hidden!important; }
  #gameFrame #bankPage :is(#bankGrid,#bankInventoryGrid,#bankMaterialGrid) > .bank-slot { aspect-ratio:auto!important;min-height:0!important;max-height:100%!important;height:100%!important; }
  #gameFrame #bankPage :is(#bankGrid,#bankInventoryGrid,#bankMaterialGrid) > .bank-slot[hidden] { display:none!important; }
 }
 /* Skill trees keep their authored draggable map inside a fixed canvas. */
 #gameFrame #gameMenu #creditsPage:not([hidden]) { display:grid!important;grid-template-rows:42px minmax(0,1fr)!important;gap:4px!important;overflow:hidden!important; }
 #gameFrame #creditsPage .skill-tree-heading { min-height:0!important;height:42px!important;margin:0!important; }
 #gameFrame #creditsPage .skill-tree-heading h2 { font-size:16px!important; }
 #gameFrame #creditsPage .skill-tree-heading p { font-size:10px!important;line-height:1.15!important; }
 #gameFrame #creditsPage #skillTreeView:not([hidden]) { height:100%!important;min-height:0!important;max-height:100%!important;overflow:hidden!important;scrollbar-width:none!important;touch-action:none!important; }
 #gameFrame #skillTreeView .profession-map-tools { bottom:2px!important;min-height:0!important;gap:8px!important;padding:2px!important; }
 #gameFrame #skillTreeView .profession-map-tools button { min-height:30px!important;height:30px!important;padding:2px 8px!important;font-size:11px!important; }
 #gameFrame #skillTreeView .profession-map-tools span { font-size:10px!important; }
 #gameFrame #skillNodeDetails:not([hidden]) { position:fixed!important;z-index:1200!important;top:50%!important;left:50%!important;right:auto!important;bottom:auto!important;transform:translate(-50%,-50%)!important;box-sizing:border-box!important;background:rgba(9,19,19,.94)!important;height:min(320px,calc(100dvh - 16px))!important;min-height:0!important;max-height:calc(100dvh - 16px)!important;width:min(720px,calc(100dvw - 20px))!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:48px minmax(0,1fr) 36px!important;padding:10px!important;gap:6px!important;overflow:hidden!important; }
 #gameFrame #skillNodeDetails .skill-detail-heading { min-height:0!important;height:48px!important; }
 #gameFrame #skillNodeDetails .skill-detail-heading h3 { font-size:17px!important;margin:3px 0!important; }
 #gameFrame #skillNodeDetails .skill-detail-information { display:grid!important;grid-template-columns:1.3fr 1fr!important;grid-template-rows:minmax(0,1fr) auto!important;gap:6px 12px!important;overflow:hidden!important;padding:6px!important;min-height:0!important;font-size:12px!important;line-height:1.25!important; }
 #gameFrame #skillNodeDescription { grid-column:1!important;grid-row:1!important;font-size:12px!important;margin:0!important; }
 #gameFrame #skillNodeRequirements { grid-column:2!important;grid-row:1!important;margin:0!important;padding:0 0 0 16px!important;font-size:11px!important; }
 #gameFrame #skillNodeDetails .skill-detail-actions { grid-row:3!important;gap:8px!important;height:36px!important;min-height:0!important; }
 #gameFrame #skillNodeDetails .skill-detail-actions button { min-height:36px!important;height:36px!important;padding:4px!important;font-size:12px!important; }
 #gameFrame #skillNodeDetails [hidden] { display:none!important; }
 #gameFrame #playerShopModal .player-shop-window { height:min(620px,calc(100dvh - 16px))!important;max-height:calc(100dvh - 16px)!important;min-height:0!important;display:grid!important;grid-template-rows:50px minmax(0,1fr) 20px!important;gap:4px!important;padding:8px!important;overflow:hidden!important; }
 #gameFrame #playerShopModal .player-shop-header { min-height:0!important;height:50px!important;padding:0!important; }
 #gameFrame #playerShopModal .player-shop-header h2 { font-size:18px!important;margin:0!important; }
 #gameFrame #playerShopModal .player-shop-header p { font-size:11px!important;margin:2px 0!important; }
 #gameFrame #playerShopModal .exchange-close { width:32px!important;height:32px!important;min-height:32px!important; }
 #gameFrame #playerShopBody { padding:0!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:40px minmax(0,1fr) 30px 32px!important;gap:4px!important;overflow:hidden!important; }
 #gameFrame #playerShopBody .player-shop-hero { grid-row:1!important;min-height:0!important;margin:0!important;padding:3px 8px!important; }
 #gameFrame #playerShopBody .player-shop-hero :is(strong,b) { font-size:12px!important; }
 #gameFrame #playerShopBody .player-shop-hero :is(small,span) { font-size:10px!important;line-height:1.1!important; }
 #gameFrame #playerShopBody .player-shop-listings { grid-row:2!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:minmax(0,1fr)!important;min-height:0!important;gap:6px!important;overflow:hidden!important; }
 #gameFrame #playerShopBody .player-shop-listing { min-height:0!important;display:grid!important;grid-template-rows:32px minmax(0,1fr) 30px!important;gap:3px!important;padding:5px!important;overflow:hidden!important; }
 #gameFrame #playerShopBody .player-shop-listing > .item-icon { width:30px!important;height:30px!important;justify-self:center; }
 #gameFrame #playerShopBody .player-shop-listing__copy { min-height:0!important;min-width:0!important; }
 #gameFrame #playerShopBody .player-shop-listing__copy strong { font-size:12px!important;line-height:1.15!important; }
 #gameFrame #playerShopBody .player-shop-listing__copy small { font-size:9px!important;line-height:1.15!important; }
 #gameFrame #playerShopBody .player-shop-listing__price { gap:4px!important;font-size:11px!important;margin:3px 0!important; }
 #gameFrame #playerShopBody .player-shop-buy { display:flex!important;gap:4px!important;margin:0!important;align-self:end!important; }
 #gameFrame #playerShopBody .player-shop-buy input { width:40%!important; }
 #gameFrame #playerShopBody :is(input,button) { height:30px!important;min-height:0!important;min-width:0!important;padding:2px 5px!important;font-size:11px!important;box-sizing:border-box!important; }
 #gameFrame #playerShopBody .exchange-pagination { grid-row:3!important;margin:0!important;height:30px!important;display:flex!important;gap:12px!important;justify-content:center!important;align-items:center!important; }
 #gameFrame #playerShopBody .exchange-pagination button { width:72px!important; }
 #gameFrame #playerShopBody .player-shop-form-actions { grid-row:4!important;margin:0!important;padding:0!important;min-height:0!important;height:32px!important; }
 #gameFrame #playerShopBody .player-shop-form-actions p { font-size:11px!important;margin:0!important; }
 #gameFrame #playerShopModal .player-shop-trustbar { min-height:0!important;height:20px!important;padding:0!important;font-size:9px!important; }
 #gameFrame #playerShopBody[data-shop-status="returns"] .player-shop-return-notice { display:none!important; }
 #gameFrame #playerShopBody[data-shop-status="available"] { grid-template-columns:minmax(130px,.65fr) minmax(0,1.65fr)!important;grid-template-rows:46px minmax(0,1fr) 32px 30px!important;gap:6px!important; }
 #gameFrame #playerShopBody[data-shop-status="available"] .player-shop-hero { grid-column:1!important;grid-row:1!important;height:auto!important;gap:4px!important; }
 #gameFrame #playerShopBody[data-shop-status="available"] .player-shop-hero span { display:none!important; }
 #gameFrame #playerShopBody .player-shop-form { grid-column:1!important;grid-row:2!important;display:grid!important;grid-template-columns:minmax(0,1fr) 60px!important;grid-template-rows:auto auto 30px!important;gap:4px!important;min-height:0!important;margin:0!important; }
 #gameFrame #playerShopBody .player-shop-form label:first-child { grid-column:1/-1!important; }
 #gameFrame #playerShopBody .player-shop-form label { font-size:10px!important; }
 #gameFrame #playerShopBody .player-shop-form input { width:100%!important;margin:2px 0!important; }
 #gameFrame #playerShopBody .player-shop-rent-summary { grid-column:2!important;font-size:10px!important;min-height:0!important;padding:2px!important; }
 #gameFrame #playerShopBody .player-shop-sale-list { grid-column:2!important;grid-row:1/4!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important;min-height:0!important;gap:5px!important;overflow:hidden!important; }
 #gameFrame #playerShopBody .player-shop-sale-row { min-height:0!important;display:grid!important;grid-template-columns:28px minmax(0,1fr) minmax(0,1fr)!important;grid-template-rows:30px minmax(0,1fr)!important;gap:3px!important;padding:4px!important;overflow:hidden!important; }
 #gameFrame #playerShopBody .player-shop-sale-row > .item-icon { display:none!important; }
 #gameFrame #playerShopBody .player-shop-sale-row > div { grid-column:2/-1!important;grid-row:1!important;min-width:0!important; }
 #gameFrame #playerShopBody .player-shop-sale-row > div strong { font-size:11px!important;line-height:1.1!important; }
 #gameFrame #playerShopBody .player-shop-sale-row > div small { font-size:9px!important;line-height:1.1!important; }
 #gameFrame #playerShopBody .player-shop-sale-row > label { font-size:9px!important;align-self:end!important;min-width:0!important; }
 #gameFrame #playerShopBody .player-shop-sale-row > label:nth-last-child(2) { grid-column:2!important; }
 #gameFrame #playerShopBody .player-shop-sale-row > label:last-child { grid-column:3!important; }
 #gameFrame #playerShopBody .player-shop-sale-row input { width:100%!important; }
 #gameFrame #playerShopBody[data-shop-status="available"] > .exchange-pagination { grid-column:2!important;grid-row:4!important; }
 #gameFrame #playerShopBody[data-shop-status="available"] > .player-shop-form-actions { grid-column:1!important;grid-row:3/5!important;height:100%!important;display:flex!important;flex-direction:column!important;gap:3px!important; }
}

/* Equipped containers retain their actual two/three equal slot rows. The
   quiver transfer panel occupies its own row instead of absorbing the grid. */
@media (orientation: landscape) {
 #gameFrame .item-container-overlay { overflow:hidden!important; }
 #gameFrame .item-container-window {
  display:grid!important;grid-template-rows:auto 30px minmax(0,1fr) auto!important;
  min-width:0!important;min-height:0!important;max-height:100%!important;
  gap:6px!important;overflow:hidden!important;align-content:stretch!important;
 }
 #gameFrame .item-container-window > .item-container-heading { grid-row:1!important;min-height:0!important;min-width:0!important; }
 #gameFrame .item-container-window > .item-container-pagination { grid-row:2!important;height:30px!important;min-height:0!important;margin:0!important; }
 #gameFrame .item-container-pagination button { height:30px!important;min-height:30px!important;padding:2px 10px!important; }
 #gameFrame .item-container-window > .item-container-grid {
  grid-row:3!important;height:100%!important;max-height:none!important;min-height:0!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(var(--container-rows,3),minmax(0,1fr))!important;
  grid-auto-rows:minmax(0,1fr)!important;align-content:stretch!important;
 }
 #gameFrame .item-container-window .item-container-slot { min-height:0!important;height:100%!important;padding:3px!important; }
 #gameFrame .item-container-window .item-container-slot :is(svg,img,.item-icon,.item-sprite,.inventory-item-icon) {
  min-height:0!important;max-height:70%!important;object-fit:contain!important;
 }
 #gameFrame .item-container-window > footer {
  grid-row:4!important;min-height:0!important;min-width:0!important;
  grid-template-columns:minmax(0,1fr) 76px auto auto!important;
  gap:5px!important;padding-top:5px!important;align-items:center!important;
 }
 #gameFrame .item-container-window > footer > [hidden] { display:none!important; }
 #gameFrame .item-container-window > footer :is(button,input) { min-height:32px!important;height:32px!important; }
 #gameFrame .item-container-window > footer > strong { font-size:12px!important;line-height:1.2!important; }
 #gameFrame .item-container-window > footer > output { white-space:normal!important;overflow-wrap:anywhere;font-size:11px!important;line-height:1.25!important; }
 #gameFrame .item-container-window:has(.item-container-transfer:not([hidden])) {
  grid-template-rows:auto minmax(0,1fr) auto!important;
 }
 #gameFrame .item-container-window:has(.item-container-transfer:not([hidden])) > .item-container-grid { grid-row:2!important; }
 #gameFrame .item-container-window:has(.item-container-transfer:not([hidden])):has(footer output:not(:empty)) {
  grid-template-rows:auto minmax(0,1fr) auto auto!important;
 }
 #gameFrame .item-container-window:has(.item-container-transfer:not([hidden])) > footer > :not(output) { display:none!important; }
 #gameFrame .item-container-window:has(.item-container-transfer:not([hidden])) > footer:has(output:not(:empty)) {
  display:block!important;grid-row:4!important;padding-top:3px!important;
 }
 #gameFrame .item-container-window:has(.item-container-transfer:not([hidden])) > footer > output:not(:empty) { display:block!important; }
 #gameFrame .item-container-window > .item-container-transfer { grid-row:3!important;min-width:0!important;min-height:0!important; }
 #gameFrame .item-container-window .item-container-transfer > * { min-width:0!important;min-height:0!important; }
 #gameFrame .item-container-window .item-container-ammo-types { flex-wrap:wrap!important;overflow:hidden!important; }
 #gameFrame .item-container-window .item-container-ammo-type { flex:1 1 86px;min-width:0!important; }
 #gameFrame .item-container-window .item-container-counts { min-width:0!important; }
 #gameFrame .item-container-window .item-container-stepper { grid-template-columns:repeat(3,minmax(0,1fr)) minmax(42px,1.8fr) repeat(3,minmax(0,1fr))!important; }
 #gameFrame .item-container-window .item-container-stepper input { min-width:0!important;height:36px!important; }
 #gameFrame .item-container-window .item-container-transfer-actions button { min-width:0!important; }

 /* Range and typed quantity remain together, including on 288px displays. */
 #gameFrame #bankTransferModal {
  position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
  max-width:100%!important;max-height:100%!important;box-sizing:border-box!important;
 }
 #gameFrame #bankTransferModal .bank-transfer-card {
  box-sizing:border-box!important;display:grid!important;
  width:min(640px,100%)!important;max-width:100%!important;max-height:100%!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:32px 46px 18px 26px 12px 36px 36px!important;
  gap:4px!important;padding:10px 14px!important;overflow:hidden!important;
 }
 #gameFrame #bankTransferModal .bank-transfer-card > * { box-sizing:border-box!important;min-width:0!important;min-height:0!important;margin:0!important; }
 #gameFrame #bankTransferModal header { display:grid!important;grid-template-columns:minmax(0,1fr) 32px!important;align-items:center!important;gap:8px!important; }
 #gameFrame #bankTransferModal header h3 { margin:0!important;font-size:16px!important;line-height:1.2!important; }
 #gameFrame #bankTransferModal header small { display:block;font-size:8px!important;line-height:1.2!important; }
 #gameFrame #bankTransferClose { position:static!important;width:32px!important;height:32px!important;min-height:32px!important;padding:0!important; }
 #gameFrame #bankTransferModal .inventory-drop-stack-item { grid-template-columns:40px minmax(0,1fr)!important;gap:8px!important;padding:2px 6px!important; }
 #gameFrame #bankTransferIcon,#gameFrame #bankTransferIcon .inventory-item-icon { width:38px!important;height:38px!important;max-height:38px!important; }
 #gameFrame #bankTransferItemName { font-size:13px!important;line-height:1.2!important; }
 #gameFrame #bankTransferAvailable { font-size:11px!important;line-height:1.2!important; }
 #gameFrame #bankTransferModal .inventory-drop-stack-range-label { font-size:12px!important;line-height:18px!important; }
 #gameFrame #bankTransferAmount { padding:0 6px!important;font-size:12px!important;line-height:16px!important; }
 #gameFrame #bankTransferRange { width:100%!important;min-height:0!important;height:26px!important; }
 #gameFrame #bankTransferModal .inventory-drop-stack-scale { font-size:10px!important;line-height:12px!important; }
 #gameFrame #bankTransferModal .bank-transfer-input-label { gap:8px!important;font-size:12px!important;line-height:1.2!important; }
 #gameFrame #bankTransferInput { height:36px!important;min-height:0!important;padding:3px!important;font-size:16px!important; }
 #gameFrame #bankTransferModal footer { grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important; }
 #gameFrame #bankTransferModal footer button { min-width:0!important;min-height:36px!important;height:36px!important;padding:3px 8px!important;font-size:12px!important; }
 @media (max-height:480px) {
  #gameFrame .item-container-window { padding:7px!important;gap:5px!important; }
  #gameFrame .item-container-heading { padding-bottom:3px!important; }
  #gameFrame .item-container-heading h2 { font-size:18px!important;line-height:1.2!important; }
  #gameFrame .item-container-heading p { font-size:11px!important;line-height:1.2!important; }
  #gameFrame .item-container-slot strong { right:4px!important;bottom:3px!important;font-size:12px!important; }
  #gameFrame .item-container-transfer { grid-template-columns:minmax(0,.9fr) minmax(0,1fr) minmax(0,2.1fr) minmax(0,1.1fr)!important;gap:5px!important;padding:5px!important; }
  #gameFrame .item-container-counts { gap:3px!important; }
  #gameFrame .item-container-counts article { grid-template-columns:24px minmax(0,1fr)!important;column-gap:3px!important; }
  #gameFrame .item-container-counts .inventory-item-icon { width:24px!important;height:24px!important; }
  #gameFrame .item-container-counts strong { font-size:12px!important; }
 }
}
