/* ย่อยอุปกรณ์ (salvage.js) · ป้ายของขาย/วัตถุดิบ · ล็อก 🔒 · แท็บขายของในร้าน (shop-window.js) · ปุ่มขาย/แลกเศษของช่าง — 8 ต.ค.
   ไม่มีแผงใหม่บน HUD — ทุกอย่างอยู่ในหน้าต่างเดิม (กระเป๋า/ร้าน/ช่าง) · ชั้นเดียวกับหน้าต่างนั้น (Screen) · เอฟเฟกต์ย่อยอยู่ชั้น Popup ชั่วคราว */

/* ── ช่องกระเป๋า: ล็อก + ป้ายของขาย/วัตถุดิบ ── */
.slot .slot-lock, html body .grid .slot img.slot-lock { position: absolute; top: 1px; right: 1px; width: 18px; height: 18px; pointer-events: none; filter: drop-shadow(0 0 1px #fff); }
.slot .slot-tag { position: absolute; left: 2px; top: 2px; max-width: 62%; padding: 0 4px; border-radius: 5px; font-weight: 700; font-size: 10px; line-height: 14px; pointer-events: none; white-space: nowrap; overflow: hidden; }
.slot .slot-tag.junk { background: #8f8a80; color: #fff; }
.slot .slot-tag.mat { width: 9px; height: 9px; padding: 0; border-radius: 50%; background: #2f6f73; box-shadow: 0 0 0 1.5px #fff; }
html.touch-ui body .slot .slot-tag.junk { font-size: 12px; line-height: 16px; }
html.touch-ui body .slot .slot-tag.mat { width: 12px; height: 12px; }
.slot .qty { z-index: 1; }

/* ปุ่ม 🔨 ย่อย ในแถบแท็บกระเป๋า */
html body #windows .win:is([data-win="items"], [data-win="gear"]) .vtabs.has-salv { grid-template-columns: repeat(5, minmax(0, 1fr)) auto; } /* 5 แท็บ: วัตถุดิบ | ของขาย แยกกัน (10 ต.ค.) */ html body #windows .win:is([data-win="items"], [data-win="gear"]) .vtabs button { white-space: nowrap; letter-spacing: -.01em; }
html body #windows .win:is([data-win="items"], [data-win="gear"]) .vtabs .bag-salv { display: inline-flex; align-items: center; justify-content: center; gap: 3px; padding: 4px 8px; border: 1.5px solid #c9a873; background: #fff4dc; color: #6b4510; font-weight: 700; }
.inv .vtabs .bag-salv img { width: 22px; height: 22px; }
/* โหมดย่อย: กระเป๋ากว้างขึ้น (รายการ + ของที่ได้ต่อแถว) — คลาสใส่/ถอดใน salvage.js · จอสัมผัสเป็น Screen Shell เต็มจออยู่แล้ว */
html:not(.touch-ui) body #windows .win.win-salv { width: min(600px, calc(100vw - 24px)) !important; max-width: none; }
.bag-hint.sell { color: #8a5a12; font-weight: 700; }

/* ── โหมดย่อยในกระเป๋า ── */
.salv { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.salv-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #e0cda0; border-radius: 10px; background: linear-gradient(90deg, #f6ead0, #fffaf0); }
.salv-crest { width: 40px; height: 40px; flex: none; }
.salv-tt { flex: 1; min-width: 0; display: grid; gap: 2px; color: #4a3418; }
.salv-tt b { font-size: 15px; }
.salv-tt small { font-size: 12px; color: #7a6a50; line-height: 1.3; }
.salv-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.salv-tools .salv-n { margin-left: auto; font-size: 13px; font-weight: 700; color: #2f6f73; }
.salv-list { display: flex; flex-direction: column; gap: 4px; max-height: min(40vh, 360px); overflow: auto; overscroll-behavior: contain; }
html.touch-ui .salv-list { max-height: none; }
.salv-row { display: grid; grid-template-columns: 22px 36px minmax(0, 1fr) auto 32px; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 9px; border: 1.5px solid #e6d6b0; background: #fffaf0; cursor: pointer; }
.salv-row.on { border-color: #2f6f73; background: #eaf5f2; }
.salv-row.warn { border-color: #d08a2a; background: #fff3df; }
.salv-row.off { opacity: .55; cursor: default; }
.salv-row input { width: 18px; height: 18px; accent-color: #2f6f73; }
.salv-ic { width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; }
.salv-ic img, .salv-get img, .salv-heart img { width: 100%; height: 100%; object-fit: contain; }
.salv-nm { min-width: 0; display: grid; line-height: 1.2; }
.salv-nm b { font-size: 13px; color: #3b2a14; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.salv-nm small { font-size: 11.5px; color: #7a6a50; }
.salv-nm i { font-style: normal; color: #8f8a80; }
.salv-nm i.risk { color: #b0442e; font-weight: 700; }
.salv-out { display: flex; align-items: center; gap: 4px; }
.salv-get { display: inline-flex; align-items: center; gap: 1px; }
.salv-get img, .salv-get .ic3d { width: 24px; height: 24px; }
.salv-get b { font-size: 12px; color: #4a3418; }
.salv-heart { font-size: 11px; font-weight: 700; color: #a8741a; display: inline-flex; align-items: center; gap: 2px; }
.salv-heart.big { font-size: 13px; padding: 2px 8px; border-radius: 999px; background: #fff1cc; border: 1px solid #e8b64a; }
.salv-heart.big img, .salv-heart.big .ic3d { width: 22px; height: 22px; }
.salv-lock { width: 30px; height: 30px; padding: 3px; border-radius: 8px; border: 1.5px solid #d9c49a; background: #fff; opacity: .45; cursor: pointer; }
.salv-lock.on { opacity: 1; border-color: #e8b64a; background: #fff4dc; }
.salv-lock img { width: 100%; height: 100%; }
.salv-sum { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 8px 10px; border-radius: 10px; background: #f3eee2; border: 1px solid #e0cda0; font-size: 13px; color: #4a3418; }
.salv-sum-l { font-weight: 700; }
.salv-sum .salv-get img, .salv-sum .salv-get .ic3d { width: 28px; height: 28px; }
.salv-w { margin-left: auto; font-weight: 700; color: #2f6f73; }
.salv-flux { font-weight: 700; color: #2f6f73; font-size: var(--fs-sm, 14px); }   /* น้ำยาหลอมจากการย่อยของคราฟ (reforge-flux-1112) */
.salv-empty { color: #7a6a50; text-align: center; padding: 18px; }
.salv-go { display: inline-flex; align-items: center; gap: 6px; }
.salv-go img { width: 22px; height: 22px; }
.salv-confirm { position: absolute; inset: 0; display: grid; place-items: center; background: #3b2a1466; border-radius: 10px; z-index: 2; }
.salv-confirm-in { width: min(420px, 94%); max-height: 92%; overflow: auto; padding: 14px; border-radius: 12px; background: #fff8e8; border: 2px solid #bd9b59; box-shadow: 0 10px 30px #23180e55; color: #3b2a14; }
.salv-confirm-in ul { margin: 8px 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.salv-confirm-in li { display: flex; align-items: center; gap: 6px; }
.salv-confirm-in li .salv-ic { width: 28px; height: 28px; }
.salv-confirm-in li i { font-style: normal; color: #b0442e; }
.salv-confirm-in p { font-size: 12px; color: #7a6a50; margin: 4px 0 10px; }
.salv-confirm-act { display: flex; gap: 8px; justify-content: flex-end; }

/* เอฟเฟกต์ย่อย: แกนทึบ (normal blend) อ่านออกบนพื้นสว่าง · ชั่วคราว ถอดทิ้งใน 0.95 วิ (ไม่สะสม — ใช้ both ได้) */
.salv-fx { position: fixed; z-index: var(--z-popup, 300); width: 0; height: 0; pointer-events: none; }
.salv-fx-b { position: absolute; left: -70px; top: -70px; width: 140px; height: 140px; animation: salvB .62s cubic-bezier(.2, 1.4, .4, 1) both; filter: drop-shadow(0 3px 4px #3b2a1455); }
.salv-fx-p { position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; display: grid; place-items: center; animation: salvP .85s cubic-bezier(.15, .9, .3, 1) both; }
.salv-fx-p img, .salv-fx-p .ic3d { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px #3b2a1466); }
@keyframes salvB { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; } 35% { transform: scale(1.1) rotate(4deg); opacity: 1; } 75% { opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes salvP { 0% { transform: translate(0, 0) scale(.4); opacity: 0; } 25% { opacity: 1; } 70% { transform: translate(var(--x), var(--y)) scale(1); opacity: 1; } 100% { transform: translate(var(--x), calc(var(--y) + 14px)) scale(.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .salv-fx-b, .salv-fx-p { animation-duration: .01s; } }

/* แท็บขายของในร้าน → ui-npc-trade.css (ตะกร้าขาย · 9 ต.ค.) */

/* ── ปุ่มบนหัวหน้าต่างช่าง (Ferra · Tobin · Poppy) ── */
#windows .rw-acts, #windows .cw-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
#windows .rw-acts .rbtn, #windows .cw-acts .rbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; white-space: nowrap; }
#windows .rw-acts img { width: 22px; height: 22px; }
html.touch-ui #windows :is(.rw-acts, .cw-acts) .rbtn, html.touch-ui .salv-tools .rbtn, html.touch-ui .salv-lock { min-height: 44px; }
html.touch-ui .salv-lock { width: 44px; height: 44px; }
html.touch-ui .salv-row { grid-template-columns: 24px 40px minmax(0, 1fr) auto 44px; min-height: 52px; }
/* ลากเลือกต่อเนื่อง (bag-sell-1111 · salvage.js wirePaint): ช่องติ๊กเป็นที่จับ — ลากตรงนี้ = เลือก ไม่เลื่อนรายการ · ที่จับกว้างเต็มความสูงแถว */
.salv-tick { align-self: stretch; display: grid; place-items: center; margin: -4px 0 -4px -6px; padding-left: 6px; touch-action: none; cursor: ns-resize; }
html.touch-ui .salv-tick { margin-right: -4px; padding-right: 4px; background: linear-gradient(90deg, rgba(47, 111, 115, .08), transparent); border-radius: 9px 0 0 9px; }
html.touch-ui .salv-row input { width: 22px; height: 22px; }
.salv-drag { flex-basis: 100%; color: #7a6a50; font-size: var(--fs-xs, 12px); }
html.touch-ui .salv-drag { flex-basis: auto; }

/* สรุปของที่ได้อยู่ในแถบล่าง (ติดล่างเสมอ) */
.salv-go { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.salv-sum { flex: 1 1 auto; min-width: 0; padding: 4px 8px; }
/* จอสัมผัสแนวนอนเตี้ย (390): หัวโหมดย่อยกะทัดรัด · รายการได้พื้นที่มากสุด */
html.touch-ui .salv-tt small { display: none; }
html.touch-ui .salv-head { padding: 4px 8px; }
html.touch-ui .salv-crest { width: 30px; height: 30px; }
html.touch-ui .salv { gap: 6px; }
html.touch-ui .salv-sum { font-size: 12px; padding: 2px 6px; gap: 4px 8px; }
html.touch-ui .salv-sum .salv-get img, html.touch-ui .salv-sum .salv-get .ic3d { width: 22px; height: 22px; }
