/* Preserve the old narrow frame and character/bag composition; redesign only the inventory interior. */
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-bag-grid{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:0!important}
.compact-bag-toolbar{display:flex;flex-direction:column;gap:7px;flex:none;margin-bottom:9px}
.compact-bag-controls{display:flex;align-items:center;gap:8px;min-width:0}
.compact-bag-count{font-size:12px;color:#ead5ad;white-space:nowrap;margin-right:auto;font-variant-numeric:tabular-nums}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag .compact-bag-sort{height:34px;min-height:34px!important;width:132px;max-width:45%;padding:4px 6px;font-size:12px;background:#1b1025;border:1px solid #775783;color:#f6e6d5;border-radius:3px}
.compact-bag-views{display:flex;gap:4px}.compact-bag-views button{display:grid;place-items:center;width:34px;height:34px;min-height:34px;padding:7px;border:1px solid #775783;background:#1d1129;color:#e4cced}.compact-bag-views svg{width:18px;height:18px;fill:currentColor}.compact-bag-views button[aria-pressed=true]{background:linear-gradient(#6a2388,#391344);border-color:#e5b866;color:#fff1c9}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-search{height:36px!important;min-height:36px!important;margin:0!important;gap:0;border:1px solid #a17eb0;border-radius:3px;background:#140c1e}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-search input{min-height:34px!important;height:34px!important;max-height:34px!important;border:0!important;background:transparent!important;font-size:14px!important;padding:5px 8px!important;min-width:0;width:100%}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-search>.adventure-icon{position:static!important;flex:none;transform:none!important;width:18px!important;height:18px!important;margin-left:9px!important;color:#e5d6e9}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] #adventure-capacity{display:none!important}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-grid-tabs{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:4px!important;padding:0!important;margin:0 0 9px!important;height:auto!important;min-height:0!important;flex:none}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .bag-top-tab{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px!important;min-height:46px!important;height:46px!important;padding:3px 1px!important;line-height:1.2;font-size:11px!important;border:1px solid #74517d!important;background:linear-gradient(#281831,#130b1c);border-radius:3px;color:#eddfec;white-space:nowrap}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .bag-top-tab .adventure-icon{display:block!important;width:17px!important;height:17px!important;color:#caaaD4}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .bag-top-tab.active{border-color:#ebbd6c!important;background:linear-gradient(#6e2686,#421653);color:#fff0cf}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] #adventure-item-grid{display:grid!important;grid-template-columns:repeat(8,minmax(0,1fr))!important;grid-template-rows:none!important;grid-auto-rows:max-content!important;align-content:start;gap:6px!important;min-height:0;flex:1;height:auto!important;overflow:auto!important;padding:3px 4px 3px 3px!important;scrollbar-width:thin;scrollbar-color:#ad844d #180e22}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] :is(.adventure-grid-item,.adventure-grid-empty){position:relative;aspect-ratio:1!important;height:auto!important;min-height:0!important;padding:2px;border:1px solid #725179!important;border-image:none!important;border-radius:3px!important;background:linear-gradient(#21112b,#0d0714)!important;box-shadow:inset 0 0 0 1px #09060e!important;overflow:hidden}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-grid-empty::before{content:''!important;display:block;position:absolute;inset:25%;background:url('/assets/ui/bag-reference-v2/empty.svg') center/contain no-repeat;opacity:.28;pointer-events:none}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-grid-item[data-rarity]::before{box-shadow:inset 0 0 0 1px var(--rarity);opacity:.8}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-grid-item.selected{outline:2px solid #f6d588!important;outline-offset:-2px!important;border-color:#e2b04f!important;background:linear-gradient(#452332,#1a0c18)!important;box-shadow:inset 0 0 9px #e8b35066!important}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-grid-item:hover{border-color:#dfb5ed!important;background:#36173d!important}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-grid-item>span{font-size:12px!important;line-height:1.3!important;right:3px!important;bottom:2px!important;background:#0b0611dc;padding:0 2px;border-radius:2px;max-width:100%;font-variant-numeric:tabular-nums}
.compact-item-name{display:none}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-compact-view=list] #adventure-item-grid{grid-template-columns:1fr!important}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-compact-view=list] .adventure-grid-item{display:flex;align-items:center;gap:12px;aspect-ratio:auto!important;height:60px!important;padding:4px 8px}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-compact-view=list] .adventure-grid-item img{position:static!important;inset:auto!important;transform:none!important;flex:0 0 48px;width:48px!important;height:48px!important;max-width:48px!important;max-height:48px!important}
.compact-bag[data-compact-view=list] .compact-item-name{display:block;flex:1;min-width:0;font-size:14px;color:#fff0d8;text-align:left;padding-right:20px;overflow-wrap:anywhere}.compact-bag[data-compact-view=list] .adventure-grid-empty{display:none}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-compact-view=list] .adventure-grid-item>.item-life{left:8px!important;right:auto!important;width:48px!important}
body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-empty-note{font-size:11px!important;margin:5px 0!important;line-height:1.4!important;min-height:0!important}
@container(max-width:420px){
 body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] #adventure-item-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important}
 body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-grid-tabs{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .bag-top-tab{flex-direction:row;min-height:30px!important;height:30px!important;font-size:11px!important;gap:4px!important}
}
@container(max-width:270px){
 body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] #adventure-item-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
 .compact-bag-count{font-size:10px}.compact-bag-controls{gap:4px}
}
@media(max-height:620px){
 .compact-bag-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px;margin-bottom:5px}.compact-bag-count{display:none}
 body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag[data-page=bag] .adventure-grid-tabs{margin-bottom:5px!important}
 .compact-bag-controls{display:contents}.compact-bag-views button{height:30px;min-height:30px;width:30px;padding:6px}
 body.adventure-hud :is(#game,#pui-bag-character-pair) #equipment-dialog.compact-bag.pui-bag .compact-bag-sort{display:none}
}
@media(prefers-reduced-motion:reduce){.compact-bag *{transition:none!important}}
