/* Inventory 1.5.2 — the frame stays still; only its five-row tray scrolls. */
#sheet[data-type="bag"] {
  --bag-width:min(460px, calc(100vw - 24px));
  --bag-slot:calc((var(--bag-width) - 58px) / 4);
  width:var(--bag-width); max-width:460px; max-height:calc(100dvh - 28px);
  inset:0; margin:auto; height:fit-content; overflow:hidden;
  padding:19px 13px 13px; border:2px solid #8aadb9; border-radius:13px;
  background:radial-gradient(ellipse at 44% 5%,#10303c90,transparent 48%),linear-gradient(120deg,#071923,#05111a 60%,#0b2530);
  box-shadow:0 0 0 1px #07131a,0 0 0 3px #42616c,0 0 0 4px #132b36,0 24px 70px #000b,inset 0 0 0 2px #0b1a22,inset 0 0 0 3px #36525d,inset 0 1px 1px 4px #c5e4ed77;
}
#sheet[data-type="bag"][open] { display:flex; flex-direction:column; }
#sheet[data-type="bag"]::backdrop { background:#020b12bd; backdrop-filter:blur(4px); }
#sheet[data-type="bag"] .sheethead { flex-shrink:0; position:static; margin:0 4px 6px; padding:0; border:0; background:none; min-height:52px; }
#sheet[data-type="bag"] .sheethead h2 { display:flex;align-items:center;gap:10px; color:#e7f0f6;font-family:"Dig Digits","Kopai Serif",Georgia,"Times New Roman",serif;font-size:31px;letter-spacing:.2px;text-shadow:0 2px 1px #000; }
#sheet[data-type="bag"] .sheethead h2::before { content:"";display:block;width:48px;height:54px;background:url('/assets/ui-v130/backpack.webp') center/contain no-repeat;filter:drop-shadow(0 3px 4px #0009); }
#sheet[data-type="bag"] .sheethead button { width:36px;height:36px;border:1px solid #9bbcc9;background:radial-gradient(circle at 35% 20%,#254958,#071823 80%);box-shadow:0 0 0 2px #020e15,inset 0 0 0 2px #24404d,0 3px 6px #0006; }
#sheet[data-type="bag"] .sheethead button .ui-icon { width:17px;height:17px; }
#sheet[data-type="bag"] #sheetBody { min-height:0; padding:0; display:flex;flex-direction:column; }
.bag-frame-corners { position:absolute;inset:0;pointer-events:none;z-index:3; }
.bag-frame-corners i { position:absolute;width:18px;height:7px;border:1px solid #bde9f2;background:linear-gradient(180deg,#e6f5fc,#779caa 40%,#183542 52%,#8cb0bc);box-shadow:0 0 0 1px #112833;transform:rotate(-45deg); }
.bag-frame-corners i::after { content:"";position:absolute;width:8px;height:3px;left:4px;top:1px; background:#48edfc;box-shadow:0 0 7px #07d4ea; }
.bag-frame-corners i:nth-child(1) { top:6px;left:-1px; }
.bag-frame-corners i:nth-child(2) { top:6px;right:-1px;transform:rotate(45deg); }
.bag-frame-corners i:nth-child(3) { bottom:6px;left:-1px;transform:rotate(45deg); }
.bag-frame-corners i:nth-child(4) { bottom:6px;right:-1px; }
.bag-capacity { display:flex;align-items:center;gap:11px;margin:3px 5px 14px;min-height:20px; }
.bag-capacity>b { font-size:14px;font-variant-numeric:tabular-nums;color:#e6eff5;white-space:nowrap; }
.bag-capacity>b>span { color:#94b5c8;font-weight:500; }
.bag-capacity-track { flex:1;height:9px;padding:1px;border:1px solid #497282;border-radius:8px;background:#020d15;box-shadow:0 1px #96c4d522;overflow:hidden; }
.bag-capacity-track>i { display:block;height:100%;max-width:100%;border-radius:5px;background:linear-gradient(180deg,#b9fbff,#22def0 40%,#00a7c3 70%,#60ecfa);box-shadow:0 0 9px #03cbea8c; }
.bag-tabs { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex:none;margin:0 0 10px;border:1px solid #526f7c;border-radius:8px;padding:2px;background:#030d15;box-shadow:0 0 0 2px #142e3a,inset 0 1px #9bc5d12a; }
.bag-tab { min-width:0;min-height:40px;display:flex;align-items:center;justify-content:center;gap:5px;padding:5px 2px;border:0;border-right:1px solid #3d5b6977;border-radius:0;background:linear-gradient(180deg,#12293699,#08121b77);color:#91b0c4;font-size:11px;line-height:1;cursor:pointer; }
.bag-tab:last-child { border-right:0; }
.bag-tab svg { width:16px;height:18px;flex:none;fill:#829fab;color:#d0e2e9;filter:drop-shadow(0 2px 1px #0009); }
.bag-tab.is-active { color:#ecfcff;background:radial-gradient(ellipse at bottom,#0760759c,#052635);border:1px solid #3ce8f3;border-radius:6px;box-shadow:inset 0 0 10px #00c7ea33,0 0 6px #0bdbec2a;text-shadow:0 0 6px #42e5ff55; }
.bag-tab.is-active svg { fill:#79f7ff;color:#e0ffff; }
.bag-tab:focus-visible,.bag-slot:focus-visible { outline:2px solid #9bfcff;outline-offset:2px; }
.bag-grid-scroll { flex:0 1 auto;min-height:0;height:calc(var(--bag-slot) * 5 + 36px);max-height:calc(100dvh - 208px);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#436a7b #05131d;outline:none;padding:2px; }
.bag-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;align-content:start; }
.bag-slot { position:relative;display:block;min-width:0;width:100%;aspect-ratio:1;padding:0;overflow:hidden;border:1px solid #96b1ba;border-radius:7px;background:radial-gradient(ellipse at 50% 58%,#163e4a66,transparent 72%),linear-gradient(145deg,#06121a,#0a202a 55%,#06141d);box-shadow:inset 0 0 0 1px #031018,inset 0 0 0 2px #39555f,inset 0 3px 7px #0008,0 1px 0 #142e38;cursor:pointer; }
.bag-slot::before,.bag-slot::after { content:"";position:absolute;z-index:1;width:12px;height:4px;background:linear-gradient(180deg,#d3e9ef,#6b929f 55%,#284b5a);border:1px solid #142c37;box-shadow:inset 4px 0 #55d4e7;transform:rotate(-45deg); }
.bag-slot::before { top:2px;left:-2px; }
.bag-slot::after { bottom:2px;right:-2px; }
.bag-slot-corners::before,.bag-slot-corners::after { content:"";position:absolute;z-index:1;width:12px;height:4px;background:linear-gradient(180deg,#d3e9ef,#6b929f 55%,#284b5a);border:1px solid #142c37;box-shadow:inset -4px 0 #55d4e7;transform:rotate(45deg); }
.bag-slot-corners::before { top:2px;right:-2px; }
.bag-slot-corners::after { bottom:2px;left:-2px; }
.bag-slot:hover { background-color:#124453;border-color:#a2e5ed; }
.bag-slot:active { transform:scale(.97); }
.bag-art { position:absolute;inset:7px 7px 10px;display:grid;place-items:center;pointer-events:none; }
.bag-art>* { display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain;overflow:hidden;filter:drop-shadow(0 4px 3px #0009); }
.bag-count { position:absolute;z-index:2;bottom:4px;right:6px;font-size:16px;line-height:1.1;font-weight:700;font-variant-numeric:tabular-nums;color:#e8f7ff;text-shadow:0 2px 2px #000,1px 0 2px #000,-1px 0 2px #000;pointer-events:none; }
.bag-slot--empty { cursor:default; }
.bag-slot--empty:hover { background-color:initial;border-color:#96b1ba; }
.bag-slot--empty:active { transform:none; }
.bag-empty-mark { position:absolute;inset:0;display:grid;place-items:center;color:#244754;font-size:35px;text-shadow:0 1px #020a10;opacity:.66; }
#sheet[data-type="bag"] #sheetBody>.bag-footer { position:relative;flex:none;display:flex;justify-content:center;align-items:center;gap:7px;margin:14px 4px 0;padding:13px 0 2px;border-top:1px solid #486571;color:#8cafc3;font-size:11px;line-height:1.2;text-align:center; }
.bag-footer::before { content:"";position:absolute;top:-4px;left:calc(50% - 3px);width:6px;height:6px;transform:rotate(45deg);background:#41dce9;border:1px solid #aad8e0;box-shadow:0 0 0 3px #0a202b,0 0 0 4px #3e5f6a; }
.bag-footer>span { font-size:18px;line-height:1; }
@media(min-width:420px) { .bag-tab { font-size:12px;gap:7px; }.bag-tab svg { width:19px;height:21px; }.bag-count { font-size:19px; }.bag-capacity>b { font-size:16px; }.bag-footer { font-size:12px!important; } }
@media(max-width:350px) { #sheet[data-type="bag"] { --bag-width:calc(100vw - 18px);padding-left:10px;padding-right:10px;--bag-slot:calc((var(--bag-width) - 52px) / 4); }.bag-tab { font-size:10px;gap:3px; }.bag-tab svg { width:13px;height:15px; }.bag-count { font-size:14px; }#sheet[data-type="bag"] .sheethead h2 { font-size:28px; }#sheet[data-type="bag"] #sheetBody>.bag-footer { font-size:10px;gap:5px; } }
@media(prefers-reduced-motion:reduce) { .bag-slot:active { transform:none; } }

.bag-category-badge { position:absolute;top:3px;left:3px;z-index:2;display:grid;place-items:center;width:18px;height:19px;border:1px solid #267b7d;border-radius:0 0 8px 0;background:#05232bd9; }
.bag-category-badge svg { width:11px;height:12px;fill:#4ad7c7;color:#b7fcf3; }

/* CSS-drawn information symbol avoids missing glyphs in the embedded UI font. */
.bag-footer>span { width:16px;height:16px;flex:none;display:inline-grid;place-items:center;border:1px solid #8cafc3;border-radius:50%;font-size:0; }
.bag-footer>span::before { content:"i";font-family:"Dig Digits","Kopai Serif",Georgia,serif;font-size:12px;font-weight:bold;line-height:1; }
/* Preserve five full rows on compact phones without shrinking the item artwork. */
@media(max-height:620px) {
  #sheet[data-type="bag"] { padding-top:12px;padding-bottom:9px; }
  #sheet[data-type="bag"] .sheethead { min-height:44px;margin-bottom:2px; }
  #sheet[data-type="bag"] .sheethead h2 { font-size:27px; }
  #sheet[data-type="bag"] .sheethead h2::before { width:38px;height:42px; }
  .bag-capacity { margin-top:0;margin-bottom:8px; }
  .bag-tabs { margin-bottom:8px; }
  .bag-tab { min-height:34px; }
  #sheet[data-type="bag"] #sheetBody>.bag-footer { margin-top:9px;padding-top:9px;padding-bottom:1px; }
}

.bag-tab>span { white-space:nowrap; }
@media(max-width:350px) { .bag-tab { font-size:9px;gap:3px; }.bag-tab svg { width:11px; } }

#sheet[data-type="bag"] .sheethead button { color:#bdd6e2; }

