/* คำสั่ง 35 ข้อ F — หน้าต่าง "ดูร้าน" (stock-shops.js) · มือถือ bottom sheet · จอคอม (≥ 700px) กลางจอ ≤ 520px */
html.ssh-lock, html.ssh-lock body { overflow: hidden; }
.ssh-modal { position: fixed; inset: 0; z-index: 9500; display: none; align-items: flex-end; justify-content: center; background: rgba(17, 12, 8, .52); }
.ssh-modal.open { display: flex; }
.ssh-sheet {
  width: 100%; max-width: 520px; max-height: 92vh; box-sizing: border-box; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fff; color: #1f2937; border-radius: 24px 24px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  font-family: 'Anuphan', sans-serif;
}
@media (min-width: 700px) {
  .ssh-modal { align-items: center; padding: 24px; }
  .ssh-sheet { border-radius: 22px; max-height: 86vh; padding: 18px 20px 20px; }
  .ssh-grab { display: none; }
}
.ssh-grab { width: 44px; height: 5px; border-radius: 99px; background: #d6d3d1; margin: 0 auto 10px; }
.ssh-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.ssh-head-text { flex: 1; min-width: 0; }
.ssh-title { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.3; color: #1f2937; overflow-wrap: anywhere; }
.ssh-code { margin-top: 2px; font-size: 14px; font-weight: 700; color: #6b7280; }
.ssh-x { flex: none; width: 40px; height: 40px; margin: -6px -6px 0 0; border: 0; background: transparent; font-size: 20px; color: #6b7280; cursor: pointer; border-radius: 999px; }
.ssh-x:hover { background: #f3f4f6; }
.ssh-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ssh-box { background: #f5f5f4; border-radius: 14px; padding: 9px 6px; text-align: center; }
.ssh-box-label { font-size: 13px; font-weight: 700; color: #44403c; }
.ssh-box-num { font-size: 22px; font-weight: 800; color: #1f2937; line-height: 1.25; }
.ssh-box.neg { background: #fdecea; }
.ssh-box.neg .ssh-box-label, .ssh-box.neg .ssh-box-num { color: #c0392b; }
.ssh-box.pos .ssh-box-num { color: #15803d; }
.ssh-warn { background: #fef9e7; border: 1.5px solid #f5d77a; color: #92400e; border-radius: 14px; padding: 10px 12px; font-size: 14px; font-weight: 700; line-height: 1.45; margin-bottom: 10px; }
.ssh-note { font-size: 12.5px; color: #6b7280; margin: -2px 2px 10px; line-height: 1.45; }
.ssh-tabs { display: flex; gap: 4px; padding: 4px; background: #f1efec; border-radius: 14px; margin-bottom: 10px; }
.ssh-tab { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 6px; border-radius: 11px; font: inherit; font-size: 14.5px; font-weight: 700; color: #6b7280; cursor: pointer; white-space: nowrap; }
.ssh-tab.active { background: #fff; color: #1f2937; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.ssh-group { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: #44403c; margin: 12px 2px 8px; }
.ssh-group:first-child { margin-top: 4px; }
.ssh-dot { flex: none; width: 12px; height: 12px; border-radius: 99px; }
.ssh-dot.wait { background: #f59e0b; }
.ssh-dot.done { background: #16a34a; }
.ssh-dot.adj { background: #6366f1; }
.ssh-row { display: flex; align-items: center; gap: 10px; border: 1.5px solid #e7e5e4; border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.ssh-row.wait { background: #fffbf2; border-color: #fbe3b6; }
.ssh-row.adj { background: #f7f7fe; border-color: #dcdcf7; }
.ssh-row.diff { background: #fafaf9; border-style: dashed; }
.ssh-row-main { flex: 1; min-width: 0; }
.ssh-row-name { font-size: 15.5px; font-weight: 700; color: #1f2937; overflow-wrap: anywhere; line-height: 1.35; }
.ssh-row-meta { font-size: 13px; color: #6b7280; margin-top: 2px; overflow-wrap: anywhere; line-height: 1.4; }
.ssh-row-side { flex: none; text-align: right; }
.ssh-row-qty { font-size: 16px; font-weight: 800; color: #1f2937; white-space: nowrap; }
.ssh-row-status { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ssh-row.wait .ssh-row-status { color: #c2410c; }
.ssh-row.done .ssh-row-status { color: #15803d; }
.ssh-pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.ssh-pill.gosave { background: #e0f2fe; color: #0369a1; }
.ssh-pill.manual { background: #ede9fe; color: #6d28d9; }
.ssh-formula { margin: 12px 2px 2px; font-size: 13px; color: #44403c; line-height: 1.5; }
.ssh-foot { margin-top: 10px; text-align: center; font-size: 12px; color: #9ca3af; }
.ssh-empty { padding: 18px 10px; text-align: center; color: #6b7280; font-size: 14px; }
.ssh-empty.err { color: #b91c1c; }
.ssh-retry { margin-top: 8px; border: 0; border-radius: 10px; padding: 8px 14px; background: #ec5728; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.ssh-loading { padding: 22px 10px; text-align: center; color: #6b5f52; font-size: 14px; font-weight: 700; }
.ssh-dots { display: inline-flex; gap: 4px; margin-left: 6px; }
.ssh-dots i { width: 5px; height: 5px; border-radius: 99px; background: #c94f1c; animation: go-dot 1.2s infinite; }
.ssh-dots i:nth-child(2) { animation-delay: .2s; }
.ssh-dots i:nth-child(3) { animation-delay: .4s; }

/* คำสั่ง 50 — รายการคงเหลือติดลบ: หัว (ค้างบนสุดตอนเลื่อน) + ป้ายแดง "ติดลบ N ลัง" + ร้านที่รอส่งออก (ชื่อ | N ลัง) */
/* หัวค้างบนสุด: ขยายพื้นหัวทับ padding บนของแผ่น (มือถือ 10px · คอม 18px) ไม่ให้แถวที่เลื่อนผ่านโผล่เหนือหัว — ตำแหน่งตอนยังไม่เลื่อนเท่าเดิม */
.ssh-sheet.ssh-neg .ssh-head { position: sticky; top: -10px; z-index: 1; background: #fff; margin-top: -10px; padding-top: 10px; margin-bottom: 0; padding-bottom: 10px; }
@media (min-width: 700px) {
  .ssh-sheet.ssh-neg .ssh-head { top: -18px; margin-top: -18px; padding-top: 18px; }
}
.ssh-negbadge { display: inline-block; background: #fdecec; color: #b91c1c; font-size: 15px; font-weight: 800; line-height: 1.3; border-radius: 999px; padding: 6px 14px; margin: 0 0 12px; }
.ssh-negrow { display: flex; align-items: center; gap: 12px; background: #fffaf2; border: 1.5px solid #fde3c0; border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.ssh-negrow-name { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 700; color: #1f2937; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ssh-negrow-qty { flex: none; font-size: 16px; font-weight: 800; color: #b45309; white-space: nowrap; }

/* การ์ดสต็อค — กดได้ทั้งใบ + ปุ่ม "ดูร้าน ›" */
.stock-tap { cursor: pointer; }
.stock-tap:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.stock-card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.stock-card-foot .balance-line { margin-top: 0; }
.stock-shops-btn {
  flex: none; display: inline-flex; align-items: center; border: 1.5px solid #f5b48f; background: #fff3ec; color: #c2410c;
  border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.3; cursor: pointer; white-space: nowrap;
}
.stock-card-foot { margin-top: 6px; }
