/* Inventory panels use one layout owner; no buttons positioned outside item icons. */
#inv.inventoryV4{display:flex;flex-direction:column;align-items:stretch;gap:5px;width:min(590px,calc(100vw - 166px));max-height:47vh;overflow-y:auto;overflow-x:hidden;padding:9px;background:rgba(31,33,27,.94);border:1px solid #82745a;border-radius:14px;bottom:10px;left:50%;transform:translateX(-50%);box-sizing:border-box;pointer-events:auto;z-index:24;}
.s4InventorySection{margin:0;padding:0}.s4InventoryLabel{font:12px/1.5 sans-serif;color:#eadcc1;padding:0 2px 2px}.s4InventoryGrid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:4px;}
.s4Slot.slot{position:relative;width:auto;height:49px;min-width:0;margin:0;box-sizing:border-box;overflow:visible;display:flex;align-items:center;justify-content:center;}
.s4Slot.empty{opacity:.42;background:#34372e;border:1px dashed #82745a;}
.s4ItemUse{position:absolute;inset:0;width:100%;height:100%;padding:3px;margin:0;border:0;background:transparent;border-radius:7px;cursor:pointer;display:flex;align-items:center;justify-content:center;}.s4ItemUse>*{max-width:100%;max-height:100%;pointer-events:none}.s4Slot>.cnt,.s4Slot>.dur{pointer-events:none;}
.s4Slot>.s4Drop.enotDropBtn,#clothes .s4Drop.enotDropBtn{position:absolute!important;display:flex!important;align-items:center;justify-content:center;top:0!important;right:0!important;bottom:auto!important;left:auto!important;width:21px!important;height:21px!important;min-width:0!important;min-height:0!important;transform:none!important;padding:0!important;margin:0!important;z-index:3;opacity:1!important;pointer-events:auto!important;border:1px solid #efaba0;background:#a9362e;color:#fff6ec;border-radius:0 6px 0 6px;font:bold 20px/1 sans-serif;cursor:pointer;}
.s4Slot button:focus-visible,#inventoryV4Menu button:focus-visible{outline:3px solid #f3d089;outline-offset:1px;}
.s4BackpackSlot{display:flex;align-items:center;gap:8px;color:#d4c5a6;font:12px sans-serif;padding:2px}.s4BackpackSlot .s4Slot{width:49px;flex:none;}.s4Recovery{border:1px solid #d5a56b;border-radius:7px;padding:5px;}
#inventoryV4Tooltip,#inventoryV4Menu{position:fixed;z-index:2000;background:#26291f;color:#f0e4cb;border:1px solid #bfa47b;border-radius:9px;padding:10px;box-shadow:0 5px 18px #0007;font:13px/1.45 sans-serif;box-sizing:border-box;max-width:min(300px,calc(100vw - 16px));}
#inventoryV4Tooltip{white-space:pre-line;pointer-events:none;}#inventoryV4Menu{min-width:205px;}#inventoryV4Menu strong{display:block;margin:0 0 7px}#inventoryV4Menu button{display:block;width:100%;margin:3px 0;text-align:left;padding:9px;border:1px solid #6e775b;border-radius:6px;background:#3a4331;color:#f4e7c9;cursor:pointer;font:13px sans-serif}#inventoryV4Menu button:disabled{opacity:.55;cursor:not-allowed;}#inventoryV4Menu[hidden],#inventoryV4Tooltip[hidden]{display:none!important;}
#chest{max-width:min(540px,calc(100vw - 24px));max-height:46vh;overflow:auto;box-sizing:border-box;z-index:50;}#chestSlots{display:block;}#chestSlots .s4InventoryGrid{grid-template-columns:repeat(3,minmax(48px,1fr));}#chestSlots .s4Slot{height:54px;}#chestSlots>button{margin-top:10px;}
#enotGuideToggle{position:static!important;margin:8px 0 0!important;max-width:110px;min-height:30px;font-size:12px!important;}#dayWrap{display:flex;flex-direction:column;align-items:center;gap:3px;pointer-events:auto;}
@media(max-width:760px){#inv.inventoryV4{width:calc(100vw - 104px);left:8px;transform:none;max-height:43vh;padding:6px}.s4InventoryGrid{grid-template-columns:repeat(5,minmax(0,1fr));}.s4Slot.slot{height:43px;}#dayWrap{right:6px!important;top:7px!important;}#clock{width:66px!important;height:66px!important;}#clothes{right:5px!important;bottom:8px!important;}#clothes .slot{width:43px;height:43px;}#chest{left:8px!important;top:100px!important;transform:none!important;width:calc(100vw - 104px);}}

#s4InventoryDock{position:absolute;bottom:9px;left:50%;transform:translateX(-50%);width:min(590px,calc(100vw - 180px));display:flex;flex-direction:column;gap:7px;align-items:center;pointer-events:auto;z-index:24;}
#s4InventoryDock #clothes{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;transform:none!important;max-width:100%;box-sizing:border-box;flex-wrap:wrap;justify-content:center;}
#s4InventoryDock #inv.inventoryV4{position:relative;left:auto;bottom:auto;transform:none;width:100%;max-height:42vh;}
.s4Slot.slot:hover{transform:none}.s4Slot .cnt{position:absolute;right:3px;bottom:0;font:12px sans-serif;color:#f6d58b;text-shadow:0 1px 2px #000;}
#chest{left:16px;top:105px;transform:none;width:330px;max-height:calc(100vh - 145px);}
#inventoryV4Menu{max-height:calc(100vh - 20px);overflow-y:auto;}
#hint{max-width:170px;max-height:90px;overflow:hidden;font-size:11px;opacity:.85;}
@media(max-width:760px){#s4InventoryDock{left:8px;transform:none;width:calc(100vw - 104px)}#s4InventoryDock #clothes{gap:4px!important;padding:6px 5px 22px!important}#s4InventoryDock #clothes .slot{width:33px!important;height:36px!important}#s4InventoryDock #clothes .slot canvas{max-width:27px!important;max-height:29px!important}#s4InventoryDock #clothes>span:first-child{display:none}#s4InventoryDock #inv.inventoryV4{max-height:37vh}#hint{display:none}}
