/* One scroll surface, two tasks. Small displays start with the loadout folded. */
#sheet.inventory-view{width:min(700px,calc(100% - 20px));height:min(860px,calc(100dvh - 20px));max-height:calc(100dvh - 20px)}
#sheet.inventory-view #sheetContent{padding:12px 14px 22px;overflow-y:auto;overscroll-behavior:contain;scroll-padding-top:105px}
.inventory-view .equipment-layout{display:block;height:auto;max-height:none;min-height:0;min-width:0}
.inventory-toolbar{position:sticky;top:-12px;z-index:4;padding:10px 0 8px;margin-top:-12px;background:linear-gradient(#0d1929 85%,#0d1929f5);border-bottom:1px solid #91b7cd33}
.inventory-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:3px;border:1px solid #7ba8c039;background:#08121fcc;border-radius:9px}
.inventory-tabs button{display:flex;align-items:center;justify-content:center;gap:9px;min-width:0;min-height:44px;padding:8px 7px;border:1px solid transparent;border-radius:6px;background:transparent;color:#87a5b8;font:15px Georgia}
.inventory-tabs button[aria-selected=true]{border-color:#86b6cd66;background:linear-gradient(130deg,#29465d,#142b3d);color:#e0f2fa;box-shadow:inset 0 1px #caecff26,0 2px 8px #0003}
.inventory-tabs svg{height:24px;width:24px;fill:none;stroke:currentColor;stroke-width:1.3;flex:none}
.inventory-tabs button:focus-visible{outline:2px solid #b6e9ff;outline-offset:1px}
.inventory-view .gear-wallet{padding:7px 5px 0;font-size:15px;gap:10px;align-items:center}
.inventory-view .gear-wallet>span{gap:4px;flex-wrap:wrap;min-width:0}
.inventory-view .gear-wallet .resource-icon{width:24px;height:24px}
.inventory-view .gear-wallet small{font-size:7px;letter-spacing:.8px}
.inventory-loadout{margin:8px 0 14px;border:1px solid #86acc02b;border-radius:7px;background:#0a15213d;min-width:0}
.inventory-loadout>summary{display:flex;align-items:center;gap:8px;min-height:44px;padding:9px 10px;color:#b9cddc;cursor:pointer;list-style:none;font:12px Georgia}
.inventory-loadout>summary::-webkit-details-marker{display:none}
.inventory-loadout>summary>span{flex:1;min-width:0}
.inventory-loadout>summary>small{font:9px system-ui;color:#799bae}
.inventory-loadout>summary>i{width:7px;height:7px;border-right:1px solid #9bbdd3;border-bottom:1px solid #9bbdd3;rotate:45deg;translate:0 -2px;margin:0 4px}
.inventory-loadout[open]>summary>i{rotate:225deg;translate:0 2px}
.inventory-loadout .loadout-collapse,.inventory-loadout[open] .loadout-expand{display:none}
.inventory-loadout[open] .loadout-collapse{display:inline}
.inventory-loadout>summary:focus-visible{outline:2px solid #b6e9ff;outline-offset:1px}
.inventory-view .equipment-board{--slot-height:54px;grid-template-columns:repeat(3,minmax(0,78px));grid-template-rows:repeat(4,var(--slot-height));justify-content:space-around;gap:5px 12px;padding:0 9px 11px;border:0;margin:0}
.inventory-view .equipment-board .gear-slot{width:100%;height:var(--slot-height);min-height:44px;padding:2px 3px 15px}
.inventory-view .equipment-board .gear-slot .gear-art{width:34px;height:34px;max-width:100%;object-fit:contain}
.inventory-view .equipment-board .gear-slot .gear-slot-label{font-size:7px;line-height:9px;bottom:2px;padding:2px 0 0}
.inventory-view .equipment-board .gear-slot>small{font-size:8px;right:5px;top:3px}
.inventory-view .equipment-portrait{inset:0 27%;opacity:.14}
.inventory-view .book-loadout{margin:0;padding:0 8px 10px;border:0}
.inventory-view .book-section-title{display:none}
.inventory-view .book-slots{margin:0;gap:6px}
.inventory-view .book-slot{grid-template-rows:54px minmax(28px,auto) 14px;padding:5px 4px;min-height:108px}
.inventory-view .book-slot .skill-book-art{height:54px}
.inventory-view .book-slot>span:not(.skill-book-art){font-size:10px;overflow-wrap:anywhere}
.inventory-view .book-slot .empty-book-rune{font-size:35px!important;line-height:52px!important}
.inventory-view .book-slot small{margin:0;font-size:8px}
.inventory-view .bag-heading{margin:0 2px 8px;scroll-margin-top:108px;min-height:24px}
.inventory-view .bag-heading h3{font-size:19px}
.inventory-view .bag-filters{margin-bottom:11px;flex-wrap:wrap;gap:6px}
.inventory-view .bag-filters select{min-height:38px;height:38px;flex:1;max-width:none;font-size:10px;background:#0e2032;border-color:#81acc040;color:#c8dae6}
.inventory-view .gear-fit{min-height:38px;font-size:10px!important;gap:5px}
.inventory-view .gear-fit input{width:18px!important;height:18px;accent-color:#86c6e2}
.inventory-view .equipment-layout .bag-scroll{height:auto;min-height:0;max-height:none;overflow:visible;padding:0 0 10px;flex:none}
.inventory-view .bag-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.inventory-view .gear-card{min-height:100px;padding:5px 3px 7px;gap:3px;background:linear-gradient(145deg,#20374c80,#0b1828)}
.inventory-view .gear-card .gear-art{width:100%;height:64px;object-fit:contain;flex:none}
.inventory-view .gear-card .gear-name{font-size:9px;line-height:1.3;min-height:24px;overflow-wrap:anywhere}
.inventory-view .book-card .skill-book-art{height:72px}
.inventory-view .book-card{min-height:110px}
/* Retained atlas fallback must remain square even inside rectangular cards. */
.gear-card .gear-art.cropped{width:62px;max-width:100%;height:auto;aspect-ratio:1;flex:none}
.result-item .gear-art{flex:none}
@media(max-width:360px){#sheet.inventory-view #sheetContent{padding-inline:10px}.inventory-tabs button{font-size:13px;gap:6px}.inventory-view .gear-wallet small{font-size:6px}.inventory-view .equipment-board{--slot-height:48px;column-gap:8px;padding-inline:7px}.inventory-view .equipment-board .gear-slot .gear-art{width:29px;height:29px}.inventory-view .bag-grid{gap:5px}.inventory-view .gear-card{min-height:88px}.inventory-view .gear-card .gear-art{height:51px}.inventory-view .gear-card .gear-name{font-size:8px;min-height:21px}.inventory-view .bag-filters select{font-size:9px;padding:5px}.inventory-view .book-card .skill-book-art{height:60px}.inventory-view .book-card{min-height:98px}}
@media(min-width:650px){.inventory-view .bag-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.inventory-view .equipment-board{column-gap:55px}.inventory-view .equipment-portrait{inset:0 35%}.inventory-view .book-slot{grid-template-rows:68px minmax(28px,auto) 14px}.inventory-view .book-slot .skill-book-art{height:68px}}
