/* ═══ กระเป๋าจอสัมผัส/iPad (bag-ux-1028 · ผู้ใช้ 28 ต.ค. "ทำตามที่คุณแนะนำทั้งหมด") ═══
   สเปก design-briefs/left-hud-review-1028/REPORT.md "กระเป๋า" G1–G6 · เพิ่มเติมจาก ui-touch.css (ไม่แก้ไฟล์นั้น)
   ทุกกฎอยู่ใต้ html.bag2.touch-ui → คอมไม่เปลี่ยน · ?bag2=0 = แบบเดิม (index.html ไม่ใส่คลาส) */

/* G4 เตือนช่องเต็ม — ≥ 90 ส้ม · 100 แดง + ป้าย "เต็ม/Full" (ป้ายซ่อนนอกจอสัมผัส) */
.bag-count .bag-full { display: none; }
html.bag2.touch-ui .win .bag-count.near { color: #b8741a; font-weight: 700; }
html.bag2.touch-ui .win .bag-count.full { color: #c0392b; font-weight: 700; }
html.bag2.touch-ui .win .bag-count .bag-full {
  display: inline-block; margin-left: 5px; padding: 0 7px; border-radius: 999px; font: 700 var(--fs-xs, 12px)/1.6 var(--font);
  font-style: normal; background: #c0392b; color: #fff;
}
.bp-more { display: none; }
.bag-dot { font-style: normal; }

/* G1 + G2 แท็บหมวด: ค้างบนสุดตอนเลื่อน · แตะ 44 (รวมปุ่มย่อยที่เดิม 38) */
html.bag2.touch-ui #windows .win[data-win="gear"] .inv > .vtabs button { min-height: 44px !important; }
html.bag2.touch-ui #windows .win[data-win="gear"] .inv > .vtabs.has-salv > :is([data-tab], [data-salvopen]) { min-height: 44px !important; }
@media (max-height: 520px) {
  html.bag2.touch-ui #windows .win[data-win="gear"] .inv > .vtabs { position: sticky !important; top: 0; align-self: start; z-index: 1; }
}

/* G2 จอเตี้ยสุด (667 → สูง ≤ 380): แท็บเรียงคอลัมน์ 44 ล้นจอ → แถวชิปแนวนอนค้างบนสุดของเนื้อหา · ตารางเต็มกว้าง */
@media (max-height: 380px) {
  html.bag2.touch-ui #windows .win[data-win="gear"] .inv { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  html.bag2.touch-ui #windows .win[data-win="gear"] .inv > .vtabs {
    flex-direction: row !important; flex-wrap: nowrap; overflow-x: auto; grid-row: auto; grid-column: 1; gap: 5px; padding: 2px 0;
    background: var(--win-bg, #fdf8ec); scrollbar-width: none;
  }
  html.bag2.touch-ui #windows .win[data-win="gear"] .inv > .vtabs::-webkit-scrollbar { display: none; }
  html.bag2.touch-ui #windows .win[data-win="gear"] .inv > .vtabs button { flex: 1 0 auto; width: auto; padding-inline: 12px !important; white-space: nowrap; }
  html.bag2.touch-ui #windows .win[data-win="gear"] .inv > :not(.vtabs) { grid-column: 1; }
}

/* G3 ท้ายหน้าต่างจอเตี้ย: บรรทัดเดียว ≤ 44 — `100/100 · ⚖ 48% · Gold` · ไม่มีบัตร: คลัง/ขาย ยุบเป็น 🎫 ⋯ (แตะ = แผ่นอธิบายสิทธิ์) · มีบัตร: ปุ่มโชว์ครบ */
@media (max-height: 520px) {
  html.bag2.touch-ui #windows .win[data-win="gear"] > .foot { flex-wrap: nowrap !important; align-items: center; gap: 8px !important; padding-block: 0 !important; min-height: 44px !important; max-height: 44px; overflow: hidden; }
  html.bag2.touch-ui #windows .win[data-win="gear"] > .foot .bag-count { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; }
  html.bag2.touch-ui #windows .win[data-win="gear"] > .foot :is(.bag-dot, .bag-unit, .bag-store, .bag-wnum, .wt-mbar, .wt-pass) { display: none !important; }
  html.bag2.touch-ui #windows .win[data-win="gear"] > .foot .bag-wt { padding: 0 3px; }
  html.bag2.touch-ui #windows .win[data-win="gear"] > .foot .bag-wt .bag-wpct { margin-left: 2px; }
  html.bag2.touch-ui #windows .win[data-win="gear"] > .foot .bag-pass:not(.on) { display: none; }
  html.bag2.touch-ui #windows .win[data-win="gear"] > .foot .bp-more {
    display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 44px; min-width: 52px; padding: 0 8px;
    border: 1px solid #d9c395; border-radius: 10px; background: #fff4dc; color: #6b4510; font: 700 var(--fs-sm, 14px)/1 var(--font); white-space: nowrap;
  }
  html.bag2.touch-ui #windows .win[data-win="gear"] > .foot .bag-pass.on .bp-btn { min-height: 44px; padding: 0 8px; }
  html.bag2.touch-ui #windows .win[data-win="gear"] > .foot .bag-pass.on .bp-tag { display: none; }
  html.bag2.touch-ui #windows .win[data-win="gear"] > .foot .bag-gold { margin-left: auto; flex: none; }
}

/* G5 iPad / จอสูง ≥ 600: ช่องใหญ่ขึ้น (76) ห่าง 10 · แท็บ 44 */
@media (min-height: 600px) {
  html.bag2.touch-ui body .inv .grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)) !important; gap: 10px !important; }
  html.bag2.touch-ui body .inv .grid .slot { min-height: 76px !important; }
  html.bag2.touch-ui #windows .win[data-win="gear"] :is(.gear-tabs button, .inv > .vtabs button) { min-height: 44px !important; }
}

/* G6 ป้ายแจ้งตอนมีหน้าต่างเปิดบนจอสัมผัส: ย้ายไป ui-notify.css (ใต้หัวหน้าต่าง · ไม่ทับแท็บ — skill-easy-1105) */
