/* Loaded after the shared preview styles; the legacy POC keeps its own bag. */
.halo-preview #preview-bag.backpack {
  --bag-top: 109px;
  top: var(--bag-top);
  width: max-content;
  min-width: 0;
  max-width: none;
  max-height: none;
  overflow: visible;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--ink, #ece4d3);
  z-index: 6;
}
.halo-preview #preview-bag.backpack[open] { z-index: 9; }
.backpack:not([open]) .backpack-panel { display: none; }
.halo-preview:not(.clean-view).poi-open #preview-bag.backpack { visibility: visible; opacity: 1; pointer-events: auto; }
.halo-preview.backpack-open .poi-panel { visibility: hidden; opacity: 0; pointer-events: none; }
.backpack .backpack-trigger {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: var(--hud-trigger-width, 154px);
  height: var(--hud-trigger-height, 48px);
  min-height: var(--hud-trigger-height, 48px);
  padding: 8px 11px;
  border: 1px solid rgb(222 207 177 / 22%);
  border-radius: 4px;
  background: rgb(23 23 20 / 76%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  user-select: none;
}
.backpack .backpack-trigger svg { color: #d6c3a2; flex: 0 0 auto; }
.backpack .backpack-trigger-label { flex: 1; min-width: 0; font-size: 11px; letter-spacing: .3px; }
.backpack #bag-count { flex: 0 0 auto; min-width: 19px; padding: 2px 4px; color: #e6d4b3; background: rgb(219 196 154 / 8%); border: 1px solid rgb(219 196 154 / 15%); border-radius: 3px; text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }
.backpack .backpack-shortcut { flex: 0 0 auto; color: #c1b8a5; font-family: inherit; font-size: 9px; line-height: 1; opacity: .7; }
.backpack .backpack-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: flex;
  flex-direction: column;
  width: min(348px, calc(100vw - 2 * var(--edge, 20px)));
  max-height: min(520px, calc(100dvh - var(--bag-top) - 70px));
  overflow: hidden;
  border: 1px solid rgb(222 226 202 / 35%);
  border-radius: 5px;
  background: rgb(22 40 38 / 46%);
  box-shadow: 0 8px 28px rgb(12 25 20 / 12%), inset 0 1px rgb(231 237 205 / 10%);
  backdrop-filter: blur(6px) saturate(1.12);
  -webkit-backdrop-filter: blur(6px) saturate(1.12);
  text-shadow: 0 1px 3px rgb(8 17 16 / 65%);
}
.backpack .backpack-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-bottom: 1px solid rgb(222 207 177 / 13%); flex: 0 0 auto; }
.backpack .backpack-eyebrow { margin: 0 0 5px; color: #e0d0ac; font-size: 8px; letter-spacing: 1.6px; text-transform: uppercase; }
.backpack h2 { margin: 0; font: 400 17px/1.2 Georgia, serif; letter-spacing: .2px; color: #f0e7d6; }
.backpack .backpack-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; color: #d6cbb8; font-size: 23px; border: 1px solid transparent; background: transparent; cursor: pointer; }
.backpack #bag-items { flex: 1 1 auto; min-height: 72px; max-height: 280px; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #6b6252 transparent; list-style: none; }
.backpack #bag-items > li { padding: 0; color: inherit; }
.backpack #bag-items > .backpack-row { display: flex; align-items: center; gap: 2px; }
.backpack .backpack-row .backpack-item { flex: 1; min-width: 0; }
.backpack .backpack-consume { flex: 0 0 auto; min-height: 44px; padding: 7px; border: 1px solid rgb(183 224 204 / 28%); border-radius: 3px; color: #dfecd9; background: rgb(176 224 204 / 8%); font-size: 9px; }
.backpack .backpack-consume:hover { background: rgb(176 224 204 / 18%); }
.backpack .backpack-consume:disabled { opacity: .55; cursor: default; }
.backpack .backpack-feedback { margin: 0; padding: 8px 16px; color: #f0d2ac; font-size: 10px; line-height: 1.5; }
.backpack .backpack-item { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 66px; padding: 8px; text-align: left; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #e9e0d0; cursor: pointer; }
.backpack .backpack-item-image { display: block; flex: 0 0 48px; width: 48px; height: 48px; max-width: 48px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; object-fit: contain; object-position: center; user-select: none; }
.backpack .backpack-item-copy { display: grid; flex: 1; gap: 4px; min-width: 0; }
.backpack .backpack-item-name { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.backpack .backpack-item-group { color: #d6ddca; font-size: 9px; }
.backpack .backpack-item-quantity { color: #eee0be; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.backpack .backpack-item[aria-pressed="true"] { background: rgb(202 177 132 / 8%); border-color: rgb(202 177 132 / 25%); }
.backpack #bag-items > .backpack-empty { display: grid; gap: 9px; padding: 25px 18px 29px; color: #d6ddca; font-size: 11px; line-height: 1.6; }
.backpack .backpack-empty strong { font-size: 13px; font-weight: 400; color: #e2d8c6; }
.backpack .backpack-detail { flex: 0 1 auto; min-height: 0; max-height: 184px; margin: 0 16px; padding: 15px 0 13px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-top: 1px solid rgb(222 207 177 / 16%); }
.backpack .backpack-detail h3 { margin: 0; color: #eee3cf; font-size: 13px; font-weight: 500; line-height: 1.45; }
.backpack .backpack-detail-quantity { margin: 7px 0; font-size: 10px; color: #eee0be; }
.backpack .backpack-description { margin: 9px 0 0; font-size: 11px; line-height: 1.65; color: #d6ddca; }
.backpack .backpack-note { flex: 0 0 auto; margin: 0; padding: 10px 16px; border-top: 1px solid rgb(222 207 177 / 10%); color: #c7d1bd; font-size: 9px; line-height: 1.5; }
.backpack [hidden] { display: none !important; }
.backpack :is(summary, button):focus-visible { outline: 2px solid #d2ba8d; outline-offset: 2px; }
@media (hover: hover) {
  .backpack .backpack-item:hover, .backpack .backpack-close:hover { background: rgb(202 177 132 / 7%); border-color: rgb(202 177 132 / 18%); }
}
@media (max-width: 720px) {
  .halo-preview #preview-bag.backpack { --bag-top: 139px; }
  .backpack .backpack-shortcut { display: none; }
}
@media (max-height: 560px) {
  .halo-preview #preview-bag.backpack { --bag-top: 75px; }
  .backpack .backpack-panel { position: fixed; top: var(--edge, 20px); left: var(--edge, 20px); max-height: calc(100dvh - 2 * var(--edge, 20px)); }
  .backpack .backpack-detail { max-height: 100px; }
}
@media (max-height: 560px) and (max-width: 720px) {
  .halo-preview #preview-bag.backpack { --bag-top: 127px; }
}
