/* Weight, carry limit and grid inventory (js/inventory.js). */
.pxi-grid-wrap {
  max-width: 100%;
  overflow: auto;
}
.pxi-grid {
  position: relative;
  background-color: hsl(var(--th-bh) calc(14% * var(--th-bs)) 7%);
  background-image: linear-gradient(
      to right,
      hsl(var(--th-bh) calc(20% * var(--th-bs)) 22% / 0.55) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, hsl(var(--th-bh) calc(20% * var(--th-bs)) 22% / 0.55) 1px, transparent 1px);
  background-size: var(--pxi-cell) var(--pxi-cell);
  border: 1px solid hsl(var(--th-bh) calc(24% * var(--th-bs)) 28%);
  box-sizing: content-box;
}
.pxi-piece {
  position: absolute;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 3px;
  overflow: hidden;
  border: 1px solid hsl(var(--th-bh) calc(30% * var(--th-bs)) 40%);
  background: hsl(var(--th-bh) calc(18% * var(--th-bs)) 14% / 0.96);
  cursor: grab;
  user-select: none;
}
.pxi-piece:hover {
  outline: 1px solid var(--accent, #fff);
  z-index: 2;
}
.pxi-piece.selected {
  outline: 2px solid var(--accent, #fff);
  z-index: 3;
}
.pxi-piece.dim {
  opacity: 0.22;
}
.pxi-glyph {
  width: 70%;
  height: 70%;
  max-width: 64px;
  max-height: 64px;
  opacity: 0.55;
  color: #dfe6ea;
}
.pxi-glyph svg {
  width: 100%;
  height: 100%;
}
.pxi-name {
  position: absolute;
  top: 2px;
  left: 4px;
  right: 4px;
  font: 700 9.5px/1.15 var(--head, sans-serif);
  letter-spacing: 0.02em;
  color: #f1f4f5;
  text-shadow: 0 1px 2px #000;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pxi-qty {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font: 800 11px var(--head, sans-serif);
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.pxi-wt {
  position: absolute;
  left: 4px;
  bottom: 2px;
  font: 600 8.5px var(--head, sans-serif);
  color: #aeb8bd;
  text-shadow: 0 1px 2px #000;
}
.pxi-piece[style*='width:40px'] .pxi-name,
.pxi-piece[style*='height:40px'] .pxi-wt {
  display: none;
}
.pxi-ghost {
  position: absolute;
  pointer-events: none;
  border: 2px dashed var(--accent, #fff);
  background: hsl(var(--th-h) calc(60% * var(--th-s)) 50% / 0.18);
  z-index: 5;
}
.pxi-overflow {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid hsl(0 60% 45% / 0.6);
  background: hsl(0 50% 18% / 0.35);
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pxi-overflow span {
  padding: 2px 6px;
  border: 1px solid #ffffff33;
  cursor: grab;
}
.pxi-stash-meta {
  font: 700 10.5px var(--head, sans-serif);
  letter-spacing: 0.08em;
  color: var(--muted, #9aa);
  margin-bottom: 6px;
}
#pxu-stash-grid-wrap .pxi-grid-wrap {
  max-height: 420px;
}
.pxi-nogrid {
  padding: 14px;
  border: 1px dashed #ffffff26;
  color: var(--muted, #9aa);
  font-size: 12px;
  max-width: 220px;
}

/* carried containers */
.pxi-carry {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid hsl(var(--th-bh) calc(20% * var(--th-bs)) 22%);
  background: hsl(var(--th-bh) calc(12% * var(--th-bs)) 8% / 0.7);
}
.pxi-carry-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  margin-top: 12px;
}
.pxi-box-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}
.pxi-box-head b {
  font: 800 12px var(--head, sans-serif);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pxi-box-head small {
  color: var(--muted, #9aa);
  font-size: 11px;
}
.pxi-pocket-row {
  display: flex;
  gap: 6px;
}
.pxi-pocket-row .pxi-nogrid {
  padding: 4px;
}

/* load bar */
.pxi-load {
  display: grid;
  gap: 5px;
}
.pxi-load-top {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font: 700 11px var(--head, sans-serif);
  letter-spacing: 0.08em;
}
.pxi-load-top b {
  font-size: 14px;
}
.pxi-load-top em {
  font-style: normal;
  margin-left: auto;
  color: hsl(140 50% 60%);
}
.pxi-load.lvl-1 .pxi-load-top em {
  color: hsl(45 85% 60%);
}
.pxi-load.lvl-2 .pxi-load-top em {
  color: hsl(25 90% 60%);
}
.pxi-load.lvl-3 .pxi-load-top em {
  color: hsl(0 80% 62%);
}
.pxi-load-bar {
  position: relative;
  height: 8px;
  background: #ffffff14;
  border-radius: 4px;
  overflow: hidden;
}
.pxi-load-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: hsl(140 45% 48%);
}
.pxi-load.lvl-1 .pxi-load-bar i {
  background: hsl(45 80% 52%);
}
.pxi-load.lvl-2 .pxi-load-bar i {
  background: hsl(25 85% 52%);
}
.pxi-load.lvl-3 .pxi-load-bar i {
  background: hsl(0 75% 52%);
}
.pxi-load-bar s {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #000a;
}
.pxi-load small {
  color: var(--muted, #9aa);
  font-size: 11px;
}

/* GM footprint preview */
.pxi-gm-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}
.pxi-gm-preview span {
  display: grid;
  gap: 2px;
}
.pxi-gm-preview i {
  background: hsl(var(--th-h) calc(55% * var(--th-s)) 50% / 0.65);
  border: 1px solid #ffffff40;
}
.pxi-gm-preview em {
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
}
.pxi-gm-spec {
  font-size: 11px;
  opacity: 0.8;
}
.pxi-gm-editor {
  margin-top: 16px;
}
