/* UI 017.3C C.4.5.1 — iOS visual viewport / overflow geometry hotfix.
   Additive only. Keeps C.4.5 data/render logic untouched. */

/* While the Inventory modal exists, the document behind it must never become the
   scroll owner. This prevents Safari from exposing page-level X/Y indicators after resume. */
html:has(#i173c-inventory-layer),
body:has(#i173c-inventory-layer){
  overflow:hidden !important;
  overscroll-behavior:none !important;
  max-width:100% !important;
}

#i173c-inventory-layer{
  inset:auto !important;
  left:var(--i173c-vv-left,0px) !important;
  top:var(--i173c-vv-top,0px) !important;
  width:var(--i173c-vv-width,100vw) !important;
  height:var(--i173c-vv-height,100dvh) !important;
  min-width:0 !important;
  max-width:100vw !important;
  overflow:clip !important;
}

#i173c-inventory-layer .i173c-scroll{
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  overflow-x:hidden !important;
  scrollbar-width:none;
}

#i173c-inventory-layer .i173c-scroll::-webkit-scrollbar,
#i173c-inventory-layer .i173c-filters::-webkit-scrollbar{
  width:0;
  height:0;
  display:none;
}

#i173c-inventory-layer .i173c-shell,
#i173c-inventory-layer .i173c-tools,
#i173c-inventory-layer .i173c-list-head,
#i173c-inventory-layer .i173c-grid{
  min-width:0 !important;
  max-width:100% !important;
}

#i173c-inventory-layer .i173c-shell,
#i173c-inventory-layer .i173c-grid{
  width:100% !important;
}

#i173c-inventory-layer .i173c-list-head{
  overflow:hidden;
}

#i173c-inventory-layer .i173c-list-head > span{
  min-width:0;
  max-width:40%;
  padding-right:2px;
}

#i173c-inventory-layer .i173c-item-card{
  width:100%;
  max-width:100%;
}

/* The cloned dock can inherit stale layout-viewport dimensions from the hidden home screen.
   max-width prevents that inline geometry from escaping the current visual viewport. */
#i173c-inventory-layer .i173c-local-dock{
  max-width:calc(var(--i173c-vv-width,100vw) - 12px) !important;
}

@media (max-width:599px){
  /* Give the right edge a little more breathing room than the left. On iPhone this
     pulls the whole content column left without changing the accepted card proportions. */
  #i173c-inventory-layer .i173c-scroll{
    padding-left:10px !important;
    padding-right:16px !important;
  }

  #i173c-inventory-layer .i173c-filter-wrap{
    margin-left:-10px !important;
    margin-right:-16px !important;
  }

  #i173c-inventory-layer .i173c-filters{
    padding-left:10px !important;
    padding-right:16px !important;
  }
}

@media (max-width:359px){
  #i173c-inventory-layer .i173c-scroll{
    padding-left:7px !important;
    padding-right:12px !important;
  }

  #i173c-inventory-layer .i173c-filter-wrap{
    margin-left:-7px !important;
    margin-right:-12px !important;
  }

  #i173c-inventory-layer .i173c-filters{
    padding-left:7px !important;
    padding-right:12px !important;
  }
}