/* inv.css — the Tarkov-style character inventory (invscreen.js).
   Dark panels with a header bar, grids you can count, tiles tinted by what
   they are. Scoped to .tk / .lobby.inv so no other screen moves. */

/* the inventory takes the room: full width after the menu, operator hidden */
.lobby.inv .bay{display:none}
.lobby.inv .grade{opacity:.35}
.lobby.inv .pane{left:188px;right:18px;width:auto;top:0;bottom:0;overflow-y:auto;padding:78px 0 40px}

.tk{display:grid;grid-template-columns:minmax(300px,330px) minmax(330px,380px) minmax(460px,1fr);gap:10px;align-items:start}
.tk-col{background:rgba(12,15,16,.86);border:1px solid rgba(200,196,184,.12);min-width:0}
.tk-h{display:flex;align-items:center;gap:10px;padding:7px 10px;background:rgba(200,196,184,.07);
  border-bottom:1px solid rgba(200,196,184,.12);font-family:var(--disp);font-size:12px;letter-spacing:.22em;text-transform:uppercase;color:var(--bone)}
.tk-h i{font-style:normal;font-family:var(--mono);font-size:9.5px;letter-spacing:.08em;color:var(--bone-dim);text-transform:none;margin-left:auto}
.tk-sl{display:block;font-family:var(--disp);font-size:9.5px;letter-spacing:.18em;text-transform:uppercase;color:var(--bone-dim);margin-bottom:4px}

/* ---------- gear slots (SLOTS-NOTES.md) ----------
   Tarkov's slot: a dark RECESSED box -- inset shadow, no cell lines -- the
   label top-left, the worn piece's picture large and centred, the condition
   bar and percentage along the foot. Empty, it shows a faint outline of
   what goes there. A drag over it lights the whole box green, or red with
   the reason written across it (gridui.js ctx.slot). */
.tk-slots{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px}
.tk-slot{position:relative;display:flex;flex-direction:column;min-height:104px;padding:18px 6px 6px;
  background:linear-gradient(180deg,rgba(6,8,9,.92),rgba(14,17,18,.88));
  border:1px solid rgba(200,196,184,.16);box-shadow:inset 0 2px 10px rgba(0,0,0,.75),inset 0 0 0 1px rgba(0,0,0,.5)}
.tk-slot.wide{grid-column:span 2;min-height:96px}
.tk-slot .tk-sl{position:absolute;left:7px;top:5px;margin:0;font-size:9px;letter-spacing:.2em;color:rgba(200,196,184,.62);pointer-events:none;z-index:4}
.tk-slot:hover{border-color:rgba(230,226,214,.32)}
.tk-slot.disabled{opacity:.3}
.tk-slot.disabled:hover{border-color:rgba(200,196,184,.16)}
/* the drop target fills the box; it holds one tile, drawn to fill it */
.tk-slot .slotwrap{position:relative;display:block;flex:1;width:100%;min-height:72px}
.tk-slot .slotwrap .gridbg{position:absolute;inset:0;display:block}
.tk-slot .gitem.slotitem{position:absolute;inset:0;margin:0;width:100%;height:100%;padding:0;
  background:radial-gradient(ellipse at 50% 46%,rgba(120,128,124,.16),rgba(0,0,0,0) 70%);border:0;transform:none}
.tk-slot .gitem.slotitem::before{display:none}
.tk-slot .gitem.slotitem:hover{background:radial-gradient(ellipse at 50% 46%,rgba(240,160,60,.16),rgba(0,0,0,0) 72%);transform:none}
.tk-slot .gitem.slotitem .gicon{inset:2px 4px 4px 4px;width:calc(100% - 8px);height:calc(100% - 6px);object-fit:contain}
.tk-slot .gitem.slotitem .gname{left:auto;right:4px;top:-14px;bottom:auto;max-width:62%;font-size:9px;text-align:right;color:var(--bone)}
.tk-slot .gitem.slotitem .gbadge{right:4px;bottom:2px}
/* empty: a faint outline of what goes there */
.tk-glyph{position:absolute;left:50%;top:50%;width:54px;height:54px;transform:translate(-50%,-50%);
  fill:none;stroke:rgba(200,196,184,.16);stroke-width:2.2;stroke-linejoin:round;pointer-events:none}
.tk-glyph.wide{width:150px;height:56px}
.tk-slot.empty:hover .tk-glyph{stroke:rgba(200,196,184,.28)}
/* condition: the bar and the percentage under the picture */
.tk-cond{display:flex;align-items:center;gap:6px;margin-top:4px;height:10px}
.tk-cond i{display:block;flex:0 0 auto;height:3px;max-width:calc(100% - 38px);background:#8fb08a}
.tk-cond i.mid{background:var(--amber,#d9a441)}
.tk-cond i.lo{background:var(--red,#e0483a)}
.tk-cond b{font-family:var(--mono);font-size:9.5px;font-weight:500;color:var(--bone);margin-left:auto}
/* blocked: the body armour slot under a plate carrier */
.tk-slot.blocked{background:repeating-linear-gradient(135deg,rgba(255,255,255,.018) 0 6px,rgba(0,0,0,0) 6px 12px),linear-gradient(180deg,rgba(6,8,9,.92),rgba(14,17,18,.88))}
.tk-blocked{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:0 10px;
  font-family:var(--mono);font-size:10px;color:var(--bone-dim)}
/* the drag over a slot: the whole box, and the reason on a red one */
.tk-slot .drag-ghost.slotghost{inset:0;border-width:2px;border-style:solid;display:flex;align-items:center;justify-content:center;
  padding:0 8px;text-align:center;font-family:var(--mono);font-size:10px;line-height:1.35;color:#ffd9d2;z-index:5}
.tk-slot .drag-ghost.slotghost.ok{border-color:#8fd08a;background:rgba(110,190,100,.16)}
.tk-slot .drag-ghost.slotghost.no{border-color:var(--red,#e0483a);background:rgba(224,72,58,.20);text-shadow:0 1px 2px #000}
.tk-slot .tk-mod{position:absolute;right:5px;top:3px;z-index:6;font-family:var(--disp);font-size:8.5px;letter-spacing:.14em;text-transform:uppercase;
  background:rgba(255,255,255,.05);border:1px solid rgba(200,196,184,.22);color:var(--bone-dim);padding:1px 7px;cursor:pointer}
.tk-slot .tk-mod:hover{color:var(--bone);border-color:rgba(230,226,214,.5)}
.tk-slot .tk-mod + .slotwrap .gname{display:none}
.tk-none{font-family:var(--mono);color:var(--bone-dim);padding:10px 0;margin:0;font-size:10.5px;line-height:1.5}
.tk-weight{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;padding:8px 10px 11px;border-top:1px solid rgba(200,196,184,.1)}
.tk-weight .lbl{font-size:9.5px}
.tk-weight b{font-family:var(--mono);font-size:11px;color:var(--bone)}
.tk-wbar{height:6px;background:rgba(255,255,255,.07)}
.tk-wbar i{display:block;height:100%;background:#8fb08a}
.tk-wbar i.mid{background:var(--amber,#d9a441)}
.tk-wbar i.hi{background:var(--red,#e0483a)}

/* ---------- containers ---------- */
.tk-cont{padding-bottom:6px}
/* each carrier's slot box at the left, its grid beside it (Tarkov) */
.tk-carrier{display:flex;align-items:flex-start;gap:8px;padding:10px 10px 0}
.tk-carrier > .tk-slot{flex:0 0 92px;width:92px;min-height:92px}
.tk-carrier > .tk-slot .slotwrap{min-height:66px}
.tk-carrier > .tk-cgrid{flex:1;min-width:0;padding:0}
.tk-slot.tk-fixed .tk-glyph{stroke:rgba(200,196,184,.22)}
.tk-cgrid{padding:10px 10px 0}
.tk-cont .gridwrap{--cell:34px}
.tk-cont .tk-carrier .gridwrap:not(.slotwrap){--cell:30px}
.tk-chead{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 8px;margin-bottom:5px}
.tk-chead .tk-sl{margin:0;flex-basis:100%}
.tk-chead b{font-family:var(--disp);font-weight:500;font-size:11px;letter-spacing:.06em;color:var(--bone)}
.tk-chead i{font-style:normal;font-family:var(--mono);font-size:9.5px;color:var(--bone-dim)}
/* POUCHES (grid.js COMPARTMENTS): no cell where there is no pouch, and an
   outline round each pouch, so a rig reads as its pouches, not a box */
.gridwrap.pouched .gridbg i.dead{background:none;border-color:transparent}
.gpouch{position:absolute;pointer-events:none;z-index:1;box-sizing:border-box;
  border:1px solid rgba(200,196,184,.34);box-shadow:inset 0 0 0 1px rgba(0,0,0,.6)}
.tk .gridwrap.pouched .gridbg i:not(.dead){background:rgba(0,0,0,.28)}
.tk-pockets .gridwrap{--cell:38px}
.tk-note{font-family:var(--mono);font-size:10px;color:var(--bone-dim);padding:10px;margin:0;line-height:1.5}

/* ---------- stash ---------- */
.tk-tabs{display:flex;gap:2px;margin-left:auto}
.tk-tabs button,.tk-sort{font-family:var(--disp);font-size:9.5px;letter-spacing:.16em;text-transform:uppercase;
  background:rgba(255,255,255,.04);border:1px solid rgba(200,196,184,.14);color:var(--bone-dim);padding:3px 9px;cursor:pointer}
.tk-tabs button.sel{background:rgba(200,196,184,.16);color:var(--bone)}
.tk-sort:hover,.tk-tabs button:hover{color:var(--bone)}
.tk-scroll{padding:10px;max-height:calc(100vh - 150px);overflow-y:auto}
.tk-sub + .tk-sub{margin-top:14px}
.tk-stash .gridwrap{--cell:46px}
.tk h2.tk-wb,.lobby.inv h2.tk-wb{margin-top:18px}
.lobby.inv .lo-wrap{max-width:none}

/* ---------- grids and tiles, Tarkov-flavoured ---------- */
.tk .gridbg i{background:rgba(255,255,255,.028);border:1px solid rgba(255,255,255,.055);box-sizing:border-box}
.tk .gridwrap.ro .gitem{cursor:default}
.tk .gitem{background:rgba(58,62,58,.72);border:1px solid rgba(200,196,184,.22);border-left-width:1px}
.tk .gitem:hover{border-color:rgba(230,226,214,.55)}
.tk .gitem .gname{position:absolute;top:2px;right:3px;left:auto;bottom:auto;text-align:right;font-size:9px;
  letter-spacing:.04em;color:#e8e4d8;text-shadow:0 1px 1px rgba(0,0,0,.9);max-width:calc(100% - 6px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gbadge{position:absolute;right:3px;bottom:2px;font-family:var(--mono);font-size:9.5px;color:#e8e4d8;text-shadow:0 1px 1px rgba(0,0,0,.9);pointer-events:none}
.tk .gicon{inset:3px;height:calc(100% - 6px)}
/* category backing */
.tk .gitem.cat-industrial{background:rgba(70,62,50,.78)}
.tk .gitem.cat-attachment,.tk .gitem.cat-plate,.tk .gitem.cat-gear{background:rgba(52,58,60,.8)}
.tk .gitem.cat-medical{background:rgba(52,78,56,.78)}
.tk .gitem.cat-ammo{background:rgba(84,64,46,.78)}
.tk .gitem.cat-valuable,.tk .gitem.cat-valuables{background:rgba(74,58,86,.78)}
.tk .gitem.cat-key,.tk .gitem.cat-keys{background:rgba(46,62,88,.78)}
.tk .gitem.cat-intel,.tk .gitem.cat-task{background:rgba(88,80,40,.78)}
.tk .gitem.cat-tech,.tk .gitem.cat-electronics{background:rgba(44,70,78,.78)}
.tk .gitem.cat-gear-primary,.tk .gitem.cat-gear-sidearm{background:rgba(48,50,50,.85)}
.tk .gitem.cat-gear-armour{background:rgba(58,56,46,.85)}
.tk .gitem.cat-gear-pack{background:rgba(52,56,44,.85)}
.tk .gitem.cat-gear-head,.tk .gitem.cat-gear-face{background:rgba(50,54,58,.85)}

@media (max-width:1300px){
  .tk{grid-template-columns:1fr 1fr}
  .tk-stash{grid-column:span 2}
}

/* ---------- in the raid: loot screen and Tab inventory ---------- */
#lootPanel.tkp,#invPanel.tkp{width:min(1440px,97vw);max-height:92vh;display:flex;flex-direction:column}
#lootPanel.tkp .panel-body,#invPanel.tkp .panel-body{overflow:auto;padding:10px}
.tk-raid{grid-template-columns:minmax(290px,320px) minmax(300px,380px) minmax(360px,1fr)}
.tk-raid.tk-two{grid-template-columns:minmax(290px,320px) minmax(300px,1fr)}
.tk-raid .tk-cont .gridwrap{--cell:38px}
.tk-loot{background:rgba(26,18,14,.88);border-color:rgba(224,150,90,.22)}
.tk-loot .tk-h{background:rgba(224,150,90,.10)}
.tk-loot .gridwrap{--cell:44px}
.tk-loot .tk-scroll{max-height:none}
.tk-h i.searching{color:var(--amber,#d9a441)}
.tk-raid .tk-slot[data-unequip]{cursor:pointer}
.tk-raid .tk-slot[data-unequip]:hover{border-color:rgba(230,226,214,.45)}
#invPanel.tkp{width:min(820px,96vw)}

/* ---------- the inspect window ---------- */
#inspectWin{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;background:rgba(4,6,7,.62)}
#inspectWin.off{display:none}
.iv{width:min(1100px,94vw);height:min(640px,86vh);display:flex;flex-direction:column;background:rgba(12,15,16,.97);border:1px solid rgba(200,196,184,.2)}
.iv .tk-h{flex:0 0 auto}
.iv-x{margin-left:10px;background:none;border:1px solid rgba(200,196,184,.2);color:var(--bone);font-size:16px;line-height:1;padding:2px 9px;cursor:pointer}
.iv-body{flex:1;display:grid;grid-template-columns:1fr 330px;min-height:0}
.iv-view{position:relative;background:radial-gradient(ellipse at 50% 55%,rgba(70,76,74,.55),rgba(10,12,13,.95) 75%);cursor:grab;min-height:0}
.iv-view:active{cursor:grabbing}
.iv-view canvas{position:absolute;inset:0;width:100%;height:100%}
.iv-side{padding:14px 16px;border-left:1px solid rgba(200,196,184,.12);overflow:auto}
.iv-note{font-family:var(--mono);font-size:11px;line-height:1.6;color:var(--bone-dim);margin:0 0 14px}
.iv-stats>div{display:grid;grid-template-columns:1fr auto;gap:10px;padding:5px 0;border-bottom:1px solid rgba(255,255,255,.05);font-size:11.5px}
.iv-stats span{color:var(--bone-dim);font-family:var(--disp);letter-spacing:.12em;text-transform:uppercase;font-size:9.5px}
.iv-stats b{font-family:var(--mono);font-weight:500;color:var(--bone)}
.iv-stats .ibar{grid-template-columns:90px 1fr 30px;align-items:center}
.iv-stats .ibar i{height:5px;background:rgba(255,255,255,.08);display:block}
.iv-stats .ibar u{display:block;height:100%;background:#b8b4a4}
.iv-hint{font-size:9.5px;color:var(--bone-dim);margin-top:14px;font-family:var(--mono)}

/* condition bar along the bottom edge of a tile */
.gcond{position:absolute;left:0;bottom:0;height:2px;pointer-events:none;background:#8fb08a}
.gcond.mid{background:var(--amber,#d9a441)}
.gcond.lo{background:var(--red,#e0483a)}
/* found in raid (CONTRACTS2-NOTES.md): Tarkov's tick, bottom-left -- the one
   corner no other mark uses (name top, value and count bottom-right, the
   condition and fill bars a 2 px line under it) */
.gfir{position:absolute;left:3px;bottom:3px;z-index:1;font-size:10px;line-height:1;font-weight:700;
  color:#9fd38a;text-shadow:0 1px 1px rgba(0,0,0,.95),0 0 2px rgba(0,0,0,.8);pointer-events:none}
.tk.tk-one{grid-template-columns:1fr}
.tk-one .tk-stash .gridwrap{--cell:44px}

/* ---------- item containers: the case tile and its window ----------
   A case tile carries a fill bar (cells used of cells inside) along its
   bottom edge, in the cold accent so it never reads as condition. The
   window is Tarkov's: a small floating panel with a title bar you drag,
   the case's own grid, and a line saying what it takes. It floats over the
   whole lobby (fixed), below the inspect window (z 60). */
.tk .gitem.is-case{background:rgba(46,54,58,.86);border-color:rgba(160,196,206,.34)}
.gfill{position:absolute;left:0;bottom:0;height:2px;pointer-events:none;background:var(--cold,#7fc4d6)}
/* phase 2: the Loadout's carry grids are a preview of the kit, but a case
   packed in them is yours to move (drag it back, double-click to open it).
   In a raid the window sits inside the panel (a transformed box), placed
   against it: raid.js converts the click. */
.tk .gridwrap.ro .gitem.is-case{cursor:grab}
.tk.cwin{position:fixed;z-index:40;display:block;min-width:180px;background:rgba(12,15,16,.97);
  border:1px solid rgba(160,196,206,.34);box-shadow:0 10px 36px rgba(0,0,0,.6)}
.cwin-h{cursor:move;user-select:none;touch-action:none}
.cwin-h i{margin-left:auto}
.cwin-x{margin-left:8px;background:none;border:1px solid rgba(200,196,184,.2);color:var(--bone);font-size:14px;line-height:1;padding:1px 7px;cursor:pointer}
.cwin-x:hover{border-color:rgba(230,226,214,.55)}
.cwin-b{padding:8px}
.cwin .gridwrap{--cell:44px}
.cwin-f{font-family:var(--mono);font-size:9.5px;color:var(--bone-dim);padding:0 8px 8px;letter-spacing:.04em}

/* the right-click menu (GridUI.menu): Open / Inspect / Sell */
.gmenu{position:fixed;z-index:70;display:flex;flex-direction:column;min-width:120px;background:rgba(14,17,18,.98);
  border:1px solid rgba(200,196,184,.26);box-shadow:0 6px 20px rgba(0,0,0,.55);padding:2px}
.gmenu button{font-family:var(--disp);font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;text-align:left;
  background:none;border:0;color:var(--bone);padding:6px 12px;cursor:pointer}
.gmenu button:hover{background:rgba(200,196,184,.12)}
.gmenu button:disabled{color:var(--bone-dim);cursor:default}

/* An inventory is handled, not read: a drag that starts a pixel off a tile
   (or on a grid that just re-rendered under the cursor) painted the browser's
   blue text selection across every tile. Tarkov's screen selects nothing. */
.tk, .tk *, .cwin, .cwin *, .gridwrap, .gridwrap * { -webkit-user-select: none; user-select: none; }
.tk input, .tk textarea { -webkit-user-select: text; user-select: text; }

/* your own kit's wear (invscreen.js wearWarn): a gun that can jam, a plate
   that will not take much -- under the weight bar, where the gear is */
.tk-wear{margin-top:10px;font-size:11px;line-height:1.55}

/* the workbench's attachment cards (meta.js attEffect): a part this gun
   cannot take reads struck through and dimmed, its row saying why; the
   detail's Aim sway carries its change from what is fitted now, green
   where the hold steadies, red where it wanders more */
.lo-row.nf .lo-nm{text-decoration:line-through;text-decoration-color:rgba(224,72,58,.6)}
.lo-row.nf .lo-st{color:var(--red);opacity:.85}
.lo-row.nf{opacity:.62}
.lo-lock.lo-nofit{letter-spacing:.06em;text-transform:none;line-height:1.45}
.lo-dl{font-family:var(--mono);font-size:10.5px;margin-left:6px}
.lo-dl.up{color:var(--good)}
.lo-dl.dn{color:var(--red)}

/* the slot's drop ghost is a flex box: [hidden] must still hide it */
.tk-slot .drag-ghost.slotghost[hidden]{display:none}

/* ---------- a body, looted by his slots (SLOTS phase B) ----------
   The third column is HIS equipment: the same recessed slot boxes as yours,
   his rig and backpack each beside its slot, his pockets, what lies beside
   him. Tighter cells than a crate's so a full body fits without scrolling. */
.tk-loot.tk-body .tk-slots{padding:8px 0 4px}
.tk-loot.tk-body .tk-slot{min-height:88px}
.tk-loot.tk-body .tk-slot.wide{min-height:80px}
.tk-loot.tk-body .gridwrap:not(.slotwrap){--cell:32px}
.tk-loot.tk-body .tk-carrier{padding:8px 0 0}
.tk-loot.tk-body .tk-cgrid{padding:8px 0 0}
.tk-loot.tk-body .tk-carrier > .tk-cgrid{padding:0}
.tk-loot.tk-body .tk-chead b{color:#e8c9a8}
/* the slots you can drop his kit on, in the raid: they light like the lobby's */
.tk-raid .tk-slot .slotwrap{cursor:default}
.tk-raid .tk-slot .gitem.slotitem{cursor:grab}
