/* Inventory, paperdoll, merchant, item tooltips, loot toasts (inventory.js / items.js / loot.js) */
#bagBtn canvas { width:18px; height:18px; image-rendering:pixelated; }

/* ---------------------------------------------------------------- panels (reuse the Settings .spanel look) */
.ipanel, .vpanel { position:fixed; z-index:34; top:50%; transform:translateY(-50%); max-height:calc(100dvh - 16px);
  font-family:var(--ui-font); user-select:none; -webkit-user-select:none; }
.ipanel { right:8px; width:min(540px, calc(100vw - 16px)); }
.vpanel { right:calc(min(540px, calc(100vw - 16px)) + 20px); width:min(340px, calc(100vw - 16px)); }
.ipanel .shead, .vpanel .shead { padding:8px 12px 4px; }
.ipanel .sclose.pxbtn, .vpanel .sclose.pxbtn { min-height:34px; min-width:40px; padding:6px 10px; margin:4px; }
.ibody { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; touch-action:pan-y; padding:2px 12px 10px;
  scrollbar-width:thin; scrollbar-color:#6b4a2a transparent; }
.iwrap { display:grid; grid-template-columns:auto 1fr; gap:14px; align-items:start; }
.iside { display:flex; flex-direction:column; align-items:center; gap:6px; }
.idoll { display:grid; grid-template-columns:44px 78px 44px; gap:6px; }
.icol { display:flex; flex-direction:column; gap:6px; }
.imid { display:flex; flex-direction:column; align-items:center; gap:4px; padding-top:2px;
  background:radial-gradient(ellipse at 50% 45%, rgba(255,170,80,.16), rgba(0,0,0,0) 70%); }
.iportrait { width:64px; height:auto; image-rendering:pixelated; filter:drop-shadow(0 2px 2px #000); }
.iil { display:flex; flex-direction:column; align-items:center; font-size:11px; color:#bda97f; line-height:1.1; }
.iil b { font-size:18px; color:#f3cf7a; font-variant-numeric:tabular-nums; }
.iset { font-size:10px; color:#a8977a; text-align:center; cursor:help; }
.iset.on { color:#7dff8a; }
.ihands { display:flex; gap:6px; }
.imain { min-width:0; }
.ibag { display:grid; grid-template-columns:repeat(6, 44px); gap:4px; }
.ih2 { margin:10px 0 4px; color:#c9b07a; font-size:14px; letter-spacing:.06em; font-variant:small-caps; }
.ipouch { display:flex; flex-wrap:wrap; gap:4px; }
.ipch { display:inline-flex; align-items:center; gap:3px; min-height:30px; padding:2px 6px 2px 3px; border:0; border-radius:var(--ui-r); cursor:pointer;
  color:#f6e7c1; font:inherit; font-size:13px; background:var(--ui-slot-bg); box-shadow:var(--ui-slot); }
.ipch canvas { width:24px; height:24px; image-rendering:pixelated; }
.ipch:hover { background:#2a1d12; }
.ifoot { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:8px 12px 10px; border-top:1px solid rgba(232,190,110,.2); }
.igold { display:inline-flex; align-items:center; gap:4px; color:#ffd86a; font-size:15px; }
.igold canvas, .vgold canvas { width:24px; height:24px; image-rendering:pixelated; }
.ihint { color:#a8977a; font-size:12px; flex:1; }

/* ---------------------------------------------------------------- slots + rarity colours */
.islot2 { position:relative; width:44px; height:44px; padding:0; border:0; border-radius:var(--ui-r); cursor:pointer; touch-action:none;
  display:flex; align-items:center; justify-content:center; background:var(--ui-slot-bg); box-shadow:var(--ui-slot); }
.islot2 canvas { width:32px; height:32px; image-rendering:pixelated; pointer-events:none; }
.islot2.empty { cursor:default; }
.islot2.eq.empty { background:#17100a; }
.islot2 .isl { font-size:9px; color:#7d6a50; text-align:center; line-height:1; pointer-events:none; }
.islot2:hover:not(.empty) { filter:brightness(1.25); }
.islot2.sel { outline:2px solid #fff3c4; outline-offset:-2px; }
.islot2.cant::after { content:''; position:absolute; inset:2px; border-radius:6px; background:rgba(160,20,20,.28); pointer-events:none; }
.islot2.dover { outline:2px dashed #fff3c4; outline-offset:-3px; }
.islot2 .iup { position:absolute; right:2px; top:1px; font-style:normal; font-size:10px; font-weight:bold; color:#ffe08a; text-shadow:0 1px 1px #000; pointer-events:none; }
.q-common { box-shadow:inset 0 0 0 2px #6e6e6e !important; }
.q-uncommon { box-shadow:inset 0 0 0 2px #3fa83c, inset 0 0 10px rgba(94,224,90,.25) !important; }
.q-rare { box-shadow:inset 0 0 0 2px #3a80d8, inset 0 0 10px rgba(74,160,255,.3) !important; }
.q-epic { box-shadow:inset 0 0 0 2px #9a50d8, inset 0 0 12px rgba(192,112,255,.35) !important; }
.q-heroic { box-shadow:inset 0 0 0 2px #e07a10, inset 0 0 12px rgba(255,154,42,.38) !important; }
.q-mythic { box-shadow:inset 0 0 0 2px #e02a2a, inset 0 0 14px rgba(255,58,58,.45) !important; animation:qmyth 1.6s ease-in-out infinite; }
@keyframes qmyth { 50% { filter:brightness(1.25); } }
.idrag { position:fixed; left:0; top:0; z-index:70; width:44px; height:44px; display:flex; align-items:center; justify-content:center;
  pointer-events:none; background:rgba(18,12,8,.85); border-radius:var(--ui-r); opacity:.92; }
.idrag canvas { width:32px; height:32px; image-rendering:pixelated; }
/* inspect window (party.js) uses the same colours */
.islot.q-uncommon, .islot.q-rare, .islot.q-epic, .islot.q-heroic, .islot.q-mythic { cursor:help; }

/* ---------------------------------------------------------------- item bar counts (actionbar.js .cnt) */
.slot.item.none canvas { filter:grayscale(1) brightness(.6); }
.slot.item.none .cnt { color:#ff7a6a; }

/* ---------------------------------------------------------------- tooltip */
.itipbox { position:fixed; z-index:60; left:0; top:0; pointer-events:none; }
.itipbox.pinned { pointer-events:auto; }
.itip { width:max-content; max-width:min(270px, calc(100vw - 16px)); padding:7px 9px; color:#d8ccb0; font-family:Georgia, serif; font-size:13px; line-height:1.3;
  background:rgba(20,14,9,.97); border-radius:10px; box-shadow:0 0 0 1px rgba(8,5,2,.9), inset 0 0 0 1px rgba(232,190,110,.42), 0 6px 16px rgba(0,0,0,.7); }
.itn { display:block; font-size:15px; }
.itsub, .itil { color:#a8977a; font-size:12px; }
.itil { color:#f3cf7a; }
.itreq { font-size:12px; color:#d8ccb0; }
.itreq.bad { color:#ff6a5a; }
.its { display:flex; justify-content:space-between; gap:10px; }
.its.imp { color:#f6e7c1; }
.its.aff { color:#9ae58f; }
.its.lost { color:#a8977a; }
.its em { font-style:normal; font-size:12px; white-space:nowrap; }
.its em.up { color:#5ee05a; } .its em.down { color:#ff6a5a; }
.itset { margin-top:5px; color:#ff9a2a; }
.itsb { color:#7a6e5c; font-size:12px; } .itsb.on { color:#7dff8a; }
.itmy { margin-top:5px; color:#ff6a5a; }
.itdesc { margin-top:4px; color:#bda97f; font-style:italic; font-size:12px; }
.itbd { margin-top:4px; color:#8a7c64; font-size:11px; }
.itval { color:#ffd86a; font-size:12px; }
.itcmp { margin-top:3px; color:#7a6e5c; font-size:11px; }
.itacts { display:flex; flex-wrap:wrap; margin:6px -4px -4px; }
.itacts .pxbtn.smallbtn { min-height:32px; padding:4px 10px; margin:4px; font-size:13px; }
.pxbtn.ask { --face1:#e07050; --face2:#b04030; --lip:#7a2010; --hi:#ffb0a0; }

/* ---------------------------------------------------------------- merchant */
.vpanel .stabs { padding:0 12px 8px; }
.vgold { display:flex; align-items:center; gap:6px; color:#ffd86a; margin:4px 0; }
.vrow { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:4px 0; border-bottom:1px solid rgba(232,190,110,.1); }
.vrow > canvas { width:32px; height:32px; image-rendering:pixelated; }
.vrow .vname { color:#f6e7c1; }
.vrow em { font-style:normal; font-size:12px; color:#a8977a; flex:1; }
.vrow .pxbtn.smallbtn { min-height:32px; padding:4px 10px; margin:4px; }
.vrow.dim { opacity:.5; }
.vmy { display:flex; flex-direction:column; flex:1; min-width:150px; }
.vcost { display:flex; gap:10px; flex-wrap:wrap; margin:6px 0; }
.vcost span { display:inline-flex; align-items:center; gap:3px; }
.vcost canvas { width:22px; height:22px; image-rendering:pixelated; }
.vcost .ok b { color:#9ae58f; } .vcost .bad b { color:#ff6a5a; }
.vcost em { font-style:normal; font-size:11px; color:#a8977a; }
.vshards { height:16px; margin:6px 0; }
.vshards i { background:linear-gradient(#ff6a5a, #b0201a); }
.vshards span { position:relative; display:block; text-align:center; font-size:11px; line-height:14px; color:#fff0e8; text-shadow:0 1px 1px #000; }
.vhint { position:fixed; left:50%; bottom:calc(170px + env(safe-area-inset-bottom,0px)); transform:translateX(-50%); z-index:30; cursor:pointer;
  pointer-events:auto; padding:8px 14px; animation:vhint 1.6s ease-in-out infinite; }
@keyframes vhint { 50% { filter:brightness(1.2); } }

/* ---------------------------------------------------------------- trade window (trade.js): sits where the merchant does */
.tpanel { width:min(400px, calc(100vw - 16px)); z-index:35; }
.tbody { padding:2px 12px 10px; overflow-y:auto; overscroll-behavior:contain; }
.tcols { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.tside { padding:4px 6px 6px; border-radius:var(--ui-r); box-shadow:inset 0 0 0 1px rgba(232,190,110,.18); transition:box-shadow .2s; }
.tside.ready { box-shadow:inset 0 0 0 1px rgba(150,230,140,.55); }
.tside.ok { box-shadow:inset 0 0 0 2px #7dff8a, inset 0 0 14px rgba(125,255,138,.22); }
.thd { display:flex; justify-content:space-between; align-items:baseline; margin:2px 0 6px; }
.tstate { font-size:11px; color:#9ae58f; font-variant:normal; letter-spacing:0; }
.tgrid { display:grid; grid-template-columns:repeat(4, 40px); gap:4px; }
.tgrid .islot2 { width:40px; height:40px; }
.tgrid .islot2 canvas { width:28px; height:28px; }
.tpouch { margin-top:6px; min-height:4px; }
.tgold { display:flex; align-items:center; gap:4px; margin-top:6px; color:#ffd86a; font-size:13px; flex-wrap:wrap; }
.tgold canvas { width:22px; height:22px; image-rendering:pixelated; }
.tgold em { font-style:normal; color:#a8977a; font-size:12px; }
.tgold .tnote { flex-basis:100%; font-size:11px; }
.tgin { width:84px; min-height:30px; padding:2px 6px; color:#ffd86a; font:inherit; font-size:14px; border:0; border-radius:var(--ui-r);
  background:var(--ui-slot-bg); box-shadow:var(--ui-slot); }
.tfoot { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:8px; }
.tfoot .pxbtn.smallbtn { min-height:34px; padding:4px 12px; }
.tstatus { color:#f3cf7a; }
.islot2.offered::after { content:''; position:absolute; inset:2px; border-radius:6px; background:rgba(255,216,106,.22);
  box-shadow:inset 0 0 0 1px #ffd86a; pointer-events:none; }

/* ---------------------------------------------------------------- Market Board (market.js): also beside the bag */
.mpanel { width:min(440px, calc(100vw - 16px)); z-index:35; }
.mpanel .stabs { padding:0 12px 8px; }
.mbody { padding:2px 12px 10px; overflow-y:auto; overscroll-behavior:contain; }
.mfilter { display:flex; flex-wrap:wrap; gap:4px; margin:4px 0 6px; }
.mq { flex:1 1 140px; min-height:30px; padding:2px 8px; color:#f6e7c1; font:inherit; font-size:13px; border:0; border-radius:var(--ui-r);
  background:var(--ui-slot-bg); box-shadow:var(--ui-slot); }
.msel { min-height:30px; padding:2px 4px; color:#f6e7c1; font:inherit; font-size:12px; border:0; border-radius:var(--ui-r);
  background:#1c130b; box-shadow:inset 0 0 0 1px rgba(232,190,110,.35); }
.mrow .vmy { cursor:pointer; }
.mrow .mmine { flex:0; color:#9ae58f; font-style:normal; font-size:12px; }
.mnav { display:flex; align-items:center; gap:6px; margin-top:6px; }
.mnav .ihint { flex:0 0 auto; }
.mform { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:6px 0; }
.mlab { display:inline-flex; align-items:center; gap:4px; color:#c9b07a; font-size:13px; }
.mnote { display:block; min-height:16px; }
.mhint { bottom:calc(214px + env(safe-area-inset-bottom,0px)); }

/* ---------------------------------------------------------------- toasts */
#itoasts { position:fixed; left:50%; top:calc(64px + env(safe-area-inset-top,0px)); transform:translateX(-50%); z-index:46; display:flex;
  flex-direction:column; align-items:center; gap:4px; pointer-events:none; }
.itoast { padding:4px 10px; color:#f6e7c1; font:bold 14px Georgia, serif; text-shadow:0 1px 2px #000; background:rgba(14,10,6,.8);
  border-radius:999px; box-shadow:inset 0 0 0 1px rgba(232,190,110,.4); animation:itoast 3.2s ease-out forwards; }
@keyframes itoast { 0% { opacity:0; transform:translateY(-6px); } 8% { opacity:1; transform:none; } 80% { opacity:1; } 100% { opacity:0; } }

/* ---------------------------------------------------------------- phones */
@media (max-width: 760px) {
  .ipanel { left:6px; right:6px; width:auto; top:auto; bottom:calc(6px + env(safe-area-inset-bottom,0px)); transform:none; max-height:64dvh; }
  .vpanel { left:6px; right:6px; width:auto; top:calc(6px + env(safe-area-inset-top,0px)); transform:none; max-height:34dvh; }
  .tpanel.vpanel { max-height:36dvh; }
  .tgrid { grid-template-columns:repeat(4, 34px); gap:3px; }
  .tgrid .islot2 { width:34px; height:34px; }
  .tgrid .islot2 canvas { width:24px; height:24px; }
  .iwrap { grid-template-columns:1fr; justify-items:center; }
  .ibag { grid-template-columns:repeat(6, 42px); }
  .islot2 { width:42px; height:42px; }
  .idoll { grid-template-columns:42px 78px 42px; }
}
@media (max-height: 520px) and (min-width: 561px) {
  .ipanel { width:min(500px, 62vw); }
  .vpanel { left:6px; right:auto; width:min(320px, 36vw); }
  .islot2 { width:38px; height:38px; }
  .islot2 canvas { width:28px; height:28px; }
  .ibag { grid-template-columns:repeat(6, 38px); }
  .idoll { grid-template-columns:38px 64px 38px; }
  .iportrait { width:48px; }
}

/* the wardrobe (wardrobe.js): outfit, dyes, aura; sits where the merchant panel does */
.wbody { padding:4px 12px 12px; }
.wsec { margin:0 0 10px; }
.wsec h3 { margin:6px 0 2px; font-size:13px; color:#f6d488; }
.wnote { margin:0 0 6px; font-size:11px; opacity:.75; }
.wsec .stabs { padding:0; border:0; gap:6px; }
.wsec .stab.locked { opacity:.45; cursor:default; }
.wrow { padding:4px 0; min-height:40px; }
.wrow .slabel { display:flex; flex-direction:column; gap:1px; font-size:12px; }
.wrow .slabel b { color:#f2e2c0; font-weight:normal; }
.wrow .slabel small { font-size:10px; opacity:.65; }
.wrow .stog { min-width:64px; font-family:var(--ui-font); font-size:12px; color:#f2e2c0; }
.wrow .stog.on { color:#2a1808; }
.wsw { display:grid; grid-template-columns:repeat(8, 1fr); gap:5px; }
.wdye { aspect-ratio:1; min-height:26px; border:2px solid #1a120a; border-radius:3px; cursor:pointer; padding:0; color:#fff;
  font-size:12px; text-shadow:0 1px 0 #000; box-shadow:inset 0 0 0 1px rgba(255,255,255,.15); }
.wdye.sel { border-color:#f6d488; box-shadow:0 0 0 1px #f6d488, inset 0 0 0 1px rgba(255,255,255,.3); }
.iward { margin-top:6px; width:100%; }
