/* หน้าแสตมป์ รอบ 2 (stamp-audit-1106 · client/stamp-combo-list.js · ?cx2=0 = แบบเดิม)
   แท็บ แปะ / คอมโบ / คลัง · หน้าคอมโบ = แถวสถานะ + ค้นหา + ตัวกรอง → รายการกระชับ (มือถือ) / รายการ 40% + รายละเอียด (iPad · คอม)
   ตัวหนังสือใช้ --fs-* ของ ui-scale.css เท่านั้น (server/ui-scale.test.js: ไฟล์ใหม่ = 0 px ตรง) · ปุ่ม --btn-h (สัมผัส 48) · ไม่ใช้ transform scale
   กล่องอ้างอิง (container) = .spg-cx2 ชื่อ cx2win — กว้าง ≥ 720px = สองคอลัมน์ */

/* ── แท็บหลัก ─────────────────────────────────────────── */
.cx2-tabs .ui-ic, .cx2-tabs .cmb-fi { width: 20px; height: 20px; flex: none; }
html.touch-ui body #windows .cx2-tabs button { min-height: var(--btn-h, 48px); }

/* ── โครงหน้า: เต็มความสูงของตัวหน้าต่าง · รายการ/รายละเอียดเลื่อนแยก ───────────── */
.spg.spg-cx2 { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; container: cx2win / inline-size; font-family: var(--font, sans-serif); color: #4a3a20; }
.cx2 { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }

/* แถวบน: สถานะ · ค้นหา · ตัวกรอง · ? (แถวเดียว) */
.cx2-bar { display: flex; align-items: center; gap: 8px; min-width: 0; flex: none; }
.cx2-st { display: flex; gap: 2px; padding: 0; border-radius: 99px; background: #f3e6c8; min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.cx2-st::-webkit-scrollbar { display: none; }
html body #windows .cx2-st button { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: var(--btn-h, 44px); padding: 0 12px; border: 0; border-radius: 99px; background: transparent; color: #5b4526; font: 600 var(--fs-sm, 14px) var(--font-head, var(--font)); white-space: nowrap; cursor: pointer; }
html body #windows .cx2-st button.on { background: linear-gradient(#3f8584, #2f6f73); color: #fff; box-shadow: 0 2px 0 #1f4f52; }
html body #windows .cx2-st button.zero:not(.on) { opacity: .6; }
.cx2-st small { min-width: 20px; padding: 0 5px; border-radius: 99px; background: #fffaf0; color: #6b4510; font: 600 var(--fs-xs, 12px) var(--font); line-height: 18px; text-align: center; }
.cx2-st button.on small { background: #fff3; color: #fff; }
html.touch-ui body #windows .cx2-st button { min-height: var(--btn-h, 48px); }
.cx2-q { flex: 1 1 140px; min-width: 104px; max-width: 280px; display: flex; align-items: center; gap: 6px; height: var(--btn-h, 44px); padding: 0 12px; border-radius: 99px; border: 1.5px solid #e0cfab; background: #fffaf0; box-sizing: border-box; }
.cx2-q:focus-within { border-color: #2f6f73; box-shadow: 0 0 0 3px #2f6f7333; }
.cx2-q .ui-ic { width: 18px; height: 18px; flex: none; opacity: .75; }
html body #windows .cx2-q input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: #4a3a20; font: 500 var(--fs-sm, 14px) var(--font); outline: none; box-shadow: none; }
html body #windows .cx2-fbtn { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--btn-h, 44px); padding: 0 14px; border-radius: 99px; border: 1.5px solid #e0cfab; background: #fffaf0; color: #5b4526; font: 600 var(--fs-sm, 14px) var(--font-head, var(--font)); cursor: pointer; white-space: nowrap; }
html body #windows .cx2-fbtn.on, html body #windows .cx2-fbtn.has { border-color: #2f6f73; color: #1f4f52; background: #e8f3ef; }
.cx2-fbtn .ui-ic { width: 18px; height: 18px; }
.cx2-fbtn small { min-width: 20px; border-radius: 99px; background: #2f6f73; color: #fff; font: 700 var(--fs-xs, 12px) var(--font); line-height: 20px; text-align: center; }
html body #windows .cx2-help { flex: none; min-width: var(--btn-h, 44px); min-height: var(--btn-h, 44px); }
/* stamp-ux-1106 B: ไอคอนค้นหา / ปิดค้นหา — โผล่เฉพาะกล่องแคบ (กฎท้ายไฟล์) */
html body #windows :is(.cx2-qbtn, .cx2-qx) { display: none; flex: none; align-items: center; justify-content: center; min-width: var(--btn-h, 44px); min-height: var(--btn-h, 44px); padding: 0; border-radius: 99px; border: 1.5px solid #e0cfab; background: #fffaf0; color: #5b4526; font: 700 var(--fs-body, 16px) var(--font); cursor: pointer; }
.cx2-qbtn .ui-ic { width: 20px; height: 20px; }
.cx2-q input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }   /* ✕ ของเบราว์เซอร์ซ้อนกับปุ่มปิดค้นหา */

/* แผงตัวกรอง (หลายมิติ · หลายอันพร้อมกัน) */
.cx2-fp { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 10px; border-radius: 14px; background: #fffaf0; border: 1.5px solid #e6d6b0; box-shadow: 0 3px 10px #5a3c1414; }
.cx2-fd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cx2-fd > small { font: 700 var(--fs-xs, 12px) var(--font); color: #8a7a62; margin-right: 2px; }
.cx2-fd.end { margin-left: auto; }
html body #windows .cx2-fc { min-height: var(--btn-h, 44px); padding: 0 12px; border-radius: 99px; border: 1.5px solid #e6d6b0; background: #fffdf6; color: #5b4526; font: 600 var(--fs-sm, 14px) var(--font-head, var(--font)); cursor: pointer; white-space: nowrap; }
html body #windows .cx2-fc.on { border-color: #2f6f73; background: linear-gradient(#3f8584, #2f6f73); color: #fff; }
html body #windows .cx2-fc.main { border-color: #2f6f73; background: #2f6f73; color: #fff; }
html body #windows .cx2-fc:disabled { opacity: .5; cursor: default; }
.cx2-helpbox { flex: none; }

/* ── รายการ + รายละเอียด ───────────────────────────────── */
.cx2-split { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.cx2-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; padding: 2px 4px 10px 2px; }
.cx2-det { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 2px 4px; }
.cx2-lhead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; padding: 0 2px 2px; }
.cx2-quota { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.cx2-qc { display: inline-flex; align-items: center; gap: 3px; padding: 0 9px; border-radius: 99px; line-height: 24px; background: #f3e6c8; color: #6b4510; font: 600 var(--fs-xs, 12px) var(--font); }
.cx2-qc.full { background: #d6e9e4; color: #1f4f52; }
.cx2-qc .ui-ic { width: 14px; height: 14px; }
.cx2-found { display: inline-flex; align-items: center; gap: 4px; color: #6b4510; font: 600 var(--fs-xs, 12px) var(--font); }
.cx2-found .ui-ic { width: 16px; height: 16px; }

.cx2-row { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 64px; padding: 6px 10px 6px 6px; border-radius: 14px; background: #fffaf0; border: 1.5px solid #e6d6b0; box-shadow: 0 2px 0 #e6d6b0; cursor: pointer; }
.cx2-row.k-on { border-color: #2f6f73; background: linear-gradient(90deg, #e8f3ef, #fffaf0 70%); box-shadow: 0 2px 0 #2f6f7355; }
.cx2-row.k-sec { background: linear-gradient(90deg, #efebf8, #fffaf0 70%); border-color: #d5cdea; }
.cx2-row.sel { outline: 3px solid #e8b64a; outline-offset: -2px; }
.cx2-row:focus-visible { outline: 3px solid #2f6f73; outline-offset: -2px; }
.cx2-th { width: 88px; border-radius: 10px; overflow: hidden; flex: none; line-height: 0; }
.cx2-th .cba { border-radius: 10px; }
.cx2-mid { display: grid; gap: 4px; min-width: 0; }
.cx2-nmr { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cx2-nm { min-width: 0; font: 700 var(--fs-body, 16px)/1.25 var(--font-head, var(--font)); color: #1f4f52; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cx2-subr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.cx2-x { font: 700 var(--fs-sm, 14px) var(--font); color: #6b4510; }
.cx2-hint { min-width: 0; font: 500 var(--fs-xs, 12px)/1.35 var(--font); color: #5d4f84; overflow: hidden; max-height: 2.7em; overflow-wrap: anywhere; }   /* stamp-ux-1106 B: สูงสุด 2 บรรทัด (เดิมบรรทัดเดียว ตัด …) · ไม่ใช้ -webkit-box: Chrome ไม่นับความสูงตอนจัดแถวกริด → แถวทับกัน */
.cx2-hint.fx { color: #5b4526; }
.cx2-hint .ui-ic { width: 14px; height: 14px; }

/* สถานะจังหวะผล (เซิร์ฟ stamp_rt) */
.cx2-rt { display: inline-flex; align-items: center; gap: 4px; padding: 0 9px; border-radius: 99px; line-height: 24px; background: #f3e6c8; color: #6b4510; font: 600 var(--fs-xs, 12px) var(--font); white-space: nowrap; }
.cx2-rt .ui-ic { width: 14px; height: 14px; }
.cx2-rt.st-cd { background: #e8e3f5; color: #463b74; }
.cx2-rt.st-ready { background: #d6e9e4; color: #1f4f52; }
.cx2-rt.st-count, .cx2-rt.st-warm { background: #fbefcf; color: #6e4a0c; }
.cx2-rt.st-on { background: #2f6f73; color: #fff; }
.cx2-rt.st-fixed { background: #e8f3ef; color: #2f6f73; }
.cx2-rt.st-cycle { background: #e3eef6; color: #2b5470; }
.cx2-rtm { width: 120px; }

/* รายละเอียด */
.cx2-d { display: grid; gap: 8px; min-width: 0; padding-bottom: 6px; }
html body #windows .cx2-back { flex: none; display: inline-flex; align-items: center; min-height: var(--btn-h, 44px); padding: 0 14px; border-radius: 99px; border: 1.5px solid #e0cfab; background: #fffaf0; color: #1f4f52; font: 600 var(--fs-sm, 14px) var(--font-head, var(--font)); cursor: pointer; }
.cx2-dh { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cx2-dh h3 { margin: 0; min-width: 0; font: 700 var(--fs-title, 20px)/1.25 var(--font-head, var(--font)); color: #1f4f52; overflow-wrap: anywhere; }
.cx2-badge { width: 28px; height: 28px; margin-left: auto; flex: none; }
.cx2-tags { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #5b4526; font: 600 var(--fs-xs, 12px) var(--font); }
.cx2-hero .cba { aspect-ratio: auto; height: clamp(96px, 22cqw, 140px); border-radius: 14px; border: 2px solid #e6d6b0; box-shadow: 0 3px 0 #e6d6b0; }
.cx2-d.k-on .cx2-hero .cba { border-color: #2f6f73; box-shadow: 0 3px 0 #2f6f7355; }
.cx2-dg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; }
.cx2-d h5 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; color: #8a4a10; font: 700 var(--fs-sm, 14px) var(--font-head, var(--font)); }
.cx2-req, .cx2-fx { min-width: 0; }
.cx2-req .cbc-slots { flex-wrap: wrap; gap: 6px; } .cx2-req .cbc-slots .stp { --w: 56px; } .cx2-req .cbc-sl.any, .cx2-req .cbc-sl.sec { width: 56px; height: 68px; }
.cx2-need, .cx2-fxl { margin: 4px 0 0; padding-left: 18px; color: #4a3a20; font: 500 var(--fs-sm, 14px)/1.45 var(--font); }
.cx2-fxl + h5 { margin-top: 8px; }
.cx2-now { margin: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 10px; border-radius: 12px; background: #f6efe0; }
.cx2-now > small { color: #8a7a62; font: 700 var(--fs-xs, 12px) var(--font); }
.cx2-swap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 12px; border-radius: 12px; background: #fdf6e3; border: 1.5px dashed #e8b64a; color: #4a3a20; font: 500 var(--fs-sm, 14px)/1.4 var(--font); }
.cx2-swap b { display: inline-flex; align-items: center; gap: 4px; color: #8a4a10; } .cx2-swap .ui-ic { width: 16px; height: 16px; }
.cx2-swap .off { color: #a2401a; font-weight: 700; } .cx2-swap .ok { color: #2f6f73; font-weight: 600; } .cx2-swap.bad { color: #a2401a; }
.cx2-miss:empty { display: none; }
.cx2-d .cx2-btns { position: static; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; justify-self: end; max-width: 100%; margin: 0; padding: 8px 10px; border-radius: 14px; background: #fffaf0f5; border: 1px solid #e6d6b0; }
html.touch-ui body #windows :is(.cx2-d .cbc-go, .cx2-d .cbd-mob .cbc-go) { min-height: var(--btn-h, 48px); }

/* คลัง: แหล่งใบ */
.cx2-src { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; }
html body #windows .cx2-src button { min-height: var(--btn-h, 44px); padding: 0 14px; border-radius: 99px; border: 1.5px solid #e0cfab; background: #fffaf0; color: #5b4526; font: 600 var(--fs-sm, 14px) var(--font-head, var(--font)); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
html body #windows .cx2-src button.on { border-color: #2f6f73; background: #e8f3ef; color: #1f4f52; cursor: default; }
.cx2-src .ui-ic { width: 18px; height: 18px; }

/* หน้าแปะ: กล่องโบนัสคอมโบ แยกคงที่/ตามเงื่อนไข */
.spg-cbn .cx2-rt { margin-left: 6px; vertical-align: middle; }
.spg-cbn small.cx2-fix, .spg-cbn small.cx2-cond { display: block; }
.spg-cbn small.cx2-cond { color: #6e4a0c; }
.spg-cbn small.cx2-cond .ui-ic { width: 14px; height: 14px; vertical-align: -2px; }

/* ── กล่องแคบ (มือถือแนวนอน · กล่อง < 720px หรือจอเตี้ย ≤ 520px): คอลัมน์เดียว · แตะแถว = รายละเอียดเต็มกล่อง ── */
@container cx2win (max-width: 719.98px) {
  .cx2:not(.has-sel) .cx2-det { display: none; }
  .cx2.has-sel .cx2-list { display: none; }
  .cx2-th { width: 64px; } .cx2-th .cba { aspect-ratio: auto; height: 56px; }
  .cx2-row { min-height: 58px; padding: 5px 8px 5px 5px; gap: 8px; }
  .cx2-hero .cba { height: 96px; }
  .cx2-bar { gap: 6px; }
  html body #windows .cx2-fbtn { padding: 0 12px; }
}
@media (max-height: 520px) {   /* มือถือแนวนอน 844×390 / 667×375: กว้างพอสองคอลัมน์แต่เตี้ย — รายการ/รายละเอียดเต็มความสูงทีละอย่าง */
  .cx2:not(.has-sel) .cx2-det { display: none; }
  .cx2.has-sel .cx2-list { display: none; }
  .cx2-th { width: 64px; } .cx2-th .cba { aspect-ratio: auto; height: 56px; }
  .cx2-row { min-height: 58px; padding: 5px 8px 5px 5px; gap: 8px; }
  .cx2-hero .cba { height: 96px; }
  .cx2-bar { gap: 6px; }
  .spg.spg-cx2 { gap: 6px; }
  .cx2 { gap: 6px; }
  html body #windows .cx2-fbtn { padding: 0 12px; }
  .cx2-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); grid-auto-rows: max-content; align-content: start; }   /* แถวกระชับสองคอลัมน์ในจอกว้าง-เตี้ย */
  .cx2-lhead { grid-column: 1 / -1; }
  .cx2-dg { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .cx2-dg > .cx2-swap, .cx2-dg > .cx2-miss { grid-column: 1 / -1; }
  .cx2.has-sel > .cx2-bar, .cx2.has-sel > .cx2-fp, .cx2.has-sel > .cx2-helpbox { display: none; }   /* ดูรายละเอียด: ซ่อนแถวสถานะ/ตัวกรอง ให้เนื้อหาได้ความสูงเต็ม (‹ กลับ อยู่หัวรายละเอียด) */
  .cx2-d .cx2-btns { position: static; justify-self: stretch; justify-content: flex-start; box-shadow: none; }
  html body #windows .cx2-st button { padding: 0 10px; }
  .cx2-q { min-width: 96px; padding: 0 10px; }
  /* รายละเอียดจอเตี้ย: ภาพเล็กซ้าย · ผลตามเงื่อนไข/สถานะตอนนี้ขึ้นก่อน (อ่านได้ตั้งแต่เปิด ไม่ต้องเลื่อนผ่านภาพใหญ่) */
  .cx2-d { grid-template-columns: 150px minmax(0, 1fr); column-gap: 12px; align-items: start; }
  .cx2-dh, .cx2-d .cx2-btns { grid-column: 1 / -1; }
  .cx2-hero { grid-column: 1; grid-row: 2 / span 2; }
  .cx2-hero .cba { height: 100px; }
  .cx2-tags, .cx2-dg { grid-column: 2; }
  .cx2-dg { grid-template-columns: minmax(0, 1fr); }
  .cx2-dg > .cx2-fx { order: -1; }
}
/* ── กล่องกว้าง + สูงพอ (iPad · คอม): รายการ ~40% + รายละเอียด ─────────────────── */
@media (min-height: 521px) {
  @container cx2win (min-width: 720px) {
    .cx2-split { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
    html body #windows .cx2-back { display: none; }
    .cx2-det { border-left: 1.5px solid #ead8ad; padding-left: 12px; }
  }
  @container cx2win (min-width: 1000px) {
    .cx2-dg { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
    .cx2-dg > .cx2-swap, .cx2-dg > .cx2-miss { grid-column: 1 / -1; }
  }
}

/* ── stamp-ux-1106 B: แถวบนในกล่องแคบ (< 900px · มือถือแนวนอน 844/667 · iPad split) ไม่ล้น ไม่บีบ ──
   ค้นหา = ไอคอน (แตะ → ช่องค้นหากางแทนแถวสถานะ + ✕) · ตัวกรอง = ไอคอน + ตัวเลข (ชื่อเต็มอยู่ใน aria-label) · แถวสถานะยืดเต็มที่ที่เหลือ */
@container cx2win (max-width: 899.98px) {
  html body #windows .cx2-qbtn { display: inline-flex; }
  .cx2-q { display: none; }
  .cx2-st { flex: 1 1 auto; }
  html body #windows .cx2-st button { flex: 1 0 auto; justify-content: center; padding: 0 9px; }
  html body #windows .cx2-fbtn { min-width: var(--btn-h, 44px); padding: 0 10px; justify-content: center; gap: 4px; }
  .cx2-fbtn .cx2-fl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cx2-bar.q-open .cx2-st, html body #windows .cx2-bar.q-open .cx2-qbtn { display: none; }
  .cx2-bar.q-open .cx2-q { display: flex; flex: 1 1 auto; max-width: none; }
  html body #windows .cx2-bar.q-open .cx2-qx { display: inline-flex; }
}

/* ── stamp-ux-1106 ทาง ข: แท็บ "กล่อง" (stamp-box.js) + ปุ่มทางลัดในกระเป๋า ── */
.spg.spg-boxtab { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }   /* ไม่มี padding ของตัวเอง — แถบแท็บต้องอยู่ที่เดียวกับแท็บคอมโบ (check-window-stable) */
.spg-boxtab .spg-box { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.spg-boxtab .sbx-inv { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sbx-head { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: #4a3a20; font: 600 var(--fs-sm, 14px)/1.3 var(--font); }
.sbx-head b { font: 700 var(--fs-body, 16px)/1.2 var(--font-head, var(--font)); color: #1f4f52; }
.sbx-head small { color: #6d8a5a; font: 500 var(--fs-xs, 12px)/1.3 var(--font); }
.sbx-head.near small { color: #9a6a10; } .sbx-head.full small { color: #a2401a; font-weight: 700; }
.sbx-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
html body #windows .sbx-acts button { min-height: var(--btn-h, 44px); padding: 0 12px; border-radius: 12px; border: 1.5px solid #e0cfab; background: #fffaf0; color: #5b4526; font: 600 var(--fs-sm, 14px) var(--font-head, var(--font)); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
html body #windows .sbx-acts button .ui-ic { width: 16px; height: 16px; }
html body #windows .sbx-acts .sbx-del { color: #a2401a; border-color: #e8c3b4; }
.sbx-where { flex: 1 1 100%; margin: 2px 0 0; color: #7a6540; font: 500 var(--fs-xs, 12px)/1.4 var(--font); }
.spg-tabs .spg-envn { min-width: 18px; padding: 0 5px; border-radius: 99px; background: #c0503a; color: #fff; font: 700 var(--fs-xs, 12px)/1.5 var(--font); font-style: normal; text-align: center; }
/* กล่อง: กริดเลื่อนเอง · แผงขวา = รายละเอียดเลื่อน + ปุ่มหลัก/ปุ่มจัดการตรึงล่าง (มือถือเตี้ยเห็นปุ่มโดยไม่เลื่อน) */
.spg-boxtab .sbx-inv { display: flex; overflow: hidden; }
.spg-boxtab .sbx-inv > .sfl { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.spg-boxtab .sbx-inv .sfl-subs { flex: none; }   /* แถวหมวดย่อยไม่ถูกบีบจนตัดล่าง */
.spg-boxtab .sbx-inv .sfl-body { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
.spg-boxtab .sbx-inv .grid.sfl-grid { min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.spg-boxtab .sbx-inv .sfl-side { position: static; display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.spg-boxtab .sbx-inv .sfl-det { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.spg-boxtab .sbx-inv .sfl-dsc { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.spg-boxtab .sbx-inv .sfl-dacts, .spg-boxtab .sbx-inv .sbx-acts { flex: none; }
.spg-boxtab .sbx-inv .sbx-acts { margin-top: 6px; }
@media (max-height: 520px) { .spg-boxtab .sbx-where { display: none; } .spg-boxtab .sbx-head { display: none; } }   /* จอเตี้ย: ตัวนับอยู่บนรางซ้ายแล้ว (กล่อง n/300) — เหลือแถวหมวดแถวเดียวก่อนเนื้อหา */
/* แท็บสมุด: สมุดแสตมป์ชิ้นเดียวกับสมุดผจญภัย (codex.js stampBookHtml) — ตัดรางหมวด · container ชื่อเดียวกับสมุด (cxw) ให้ผังมือถือ/คอมของสมุดทำงานเหมือนเดิม */
.spg.spg-booktab { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; container: cxw / inline-size; }
.spg-booktab > .cx.cx-embed { display: block; flex: 1 1 auto; min-height: 0; height: auto; border-radius: 12px; }
.spg-booktab > .cx.cx-embed > .cx-main { height: 100%; box-sizing: border-box; overflow: hidden; }
.spg-booktab > .cx.cx-embed .cx-body { overflow-y: auto; overscroll-behavior: contain; }
/* กระเป๋า: แถบบางเหนือตารางของ (เต็มแถว) */
html body #windows .inv .grid > .bag-box { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-height: var(--btn-h, 44px); width: 100%; padding: 4px 12px; box-sizing: border-box; border-radius: 12px; border: 1.5px dashed #2f6f73; background: #eef6f3; color: #1f4f52; text-align: left; cursor: pointer; font: 600 var(--fs-sm, 14px)/1.25 var(--font); }
.inv .grid > .bag-box b { font: 700 var(--fs-sm, 14px)/1.2 var(--font-head, var(--font)); }
.inv .grid > .bag-box small { flex: 1 1 auto; min-width: 0; color: #4f6f6a; font: 600 var(--fs-xs, 12px)/1.3 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv .grid > .bag-box .bag-box-go { flex: none; padding: 4px 12px; border-radius: 99px; background: #2f6f73; color: #fff; font: 700 var(--fs-xs, 12px)/1.4 var(--font-head, var(--font)); }

/* ── stamp-ux-1106 รอบ 3: รางซ้ายแนวตั้ง (แปะ/กล่อง/คอมโบ/สมุด) ทุกจอ — แบบรางสมุดผจญภัย · เนื้อหาได้ความสูงเต็ม (?srail=0 = แถบบนเดิม) ── */
.spg-shell { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; height: 100%; min-height: 0; }
html body #windows .spg-shell > .spg-tabs { grid-area: auto; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; margin: 0; padding: 6px 4px; overflow-y: auto; border-radius: 14px; background: #f3e6c8; }
html body #windows .spg-shell > .spg-tabs button { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 60px; margin: 0; padding: 6px 2px; white-space: normal; text-align: center; line-height: 1.15; font: 700 var(--fs-sm, 14px)/1.15 var(--font-head, var(--font)); }
html body #windows .spg-shell > .spg-tabs button small { font: 600 var(--fs-xs, 12px)/1.1 var(--font); }
html body #windows .spg-shell > .spg-tabs button > :is(.ui-ic, .cmb-fi) { width: 24px; height: 24px; }
html body #windows .spg-shell > .spg-tabs button > span[aria-hidden] { font-size: var(--fs-name, 18px); line-height: 1; }
html body #windows .spg-shell > .spg-tabs .spg-envn, html body #windows .spg-shell > .spg-tabs .cmb-new-dot { position: absolute; top: 3px; right: 3px; margin: 0; }
.spg-shell > .spg { min-width: 0; min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; }
.spg-shell > .spg:not(.spg-cx2):not(.spg-boxtab):not(.spg-booktab):not(.spg-cst):not(.spg-alb) { grid-template-areas: "side main" "sheet sheet"; align-content: start; }
@media (max-height: 520px) { .spg-shell { grid-template-columns: 76px minmax(0, 1fr); gap: 6px; } html body #windows .spg-shell > .spg-tabs button { min-height: 52px; } }
/* แท็บสมุด: แถวหัวแถวเดียว [🔍][รายการ|รายละเอียด][มอน|ดัน|กิจกรรม] · หมวดเป็น pill เล็ก (ภาพจางเป็นพื้นเดิม) · ค้นหากาง = แทนทั้งแถว */
.spg-booktab .cx-embed > .cx-main { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; }
.sbk-row { flex: none; display: flex; align-items: center; gap: 6px; min-width: 0; }
.sbk-rowc { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.sbk-rowc::-webkit-scrollbar { display: none; }
html body #windows .sbk-row :is(.sbk-qbtn, .sbk-qx) { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: var(--btn-h, 44px); min-height: var(--btn-h, 44px); padding: 0; border-radius: 99px; border: 1.5px solid #e0cfab; background: #fffaf0; color: #5b4526; font: 700 var(--fs-body, 16px) var(--font); cursor: pointer; }
html body #windows .sbk-row .sbk-qx, .sbk-row .sbk-q { display: none; }
.sbk-row.q-open .sbk-rowc, html body #windows .sbk-row.q-open .sbk-qbtn { display: none; }
.sbk-row.q-open .sbk-q { display: flex; flex: 1 1 auto; min-width: 0; }
html body #windows .sbk-row.q-open .sbk-qx { display: inline-flex; }
.sbk-row .sbk-q input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.sbk-rowc .sbk-seg { flex: none; }
#windows .sbk-rowc .sjk { flex: none; margin: 0; overflow: visible; gap: 4px; }
#windows .sbk-rowc .sjk .sjk-b { flex: none; min-width: 0; min-height: var(--btn-h, 44px); padding: 2px 12px 2px 8px; column-gap: 6px; grid-template-rows: auto; grid-template-columns: auto auto auto; }
#windows .sbk-rowc .sjk .sjk-b i { grid-row: auto; font-size: var(--fs-body, 16px); }
#windows .sbk-rowc .sjk .sjk-b b { font-size: var(--fs-sm, 14px); white-space: nowrap; }
#windows .sbk-rowc .sjk .sjk-b small { white-space: nowrap; }
/* คอม: กล่องใช้ผัง sfl แบบกริด (หมวดซ้าย · เนื้อขวา) — ยืดเต็มความสูง */
html:not(.touch-ui) .spg-boxtab .sbx-inv > .sfl { display: grid; grid-template-rows: minmax(0, 1fr); height: 100%; align-items: stretch; }
html:not(.touch-ui) .spg-boxtab .sbx-inv .sfl-subs { align-self: start; }
/* จอสัมผัสเตี้ย: แถบล่างของหน้าต่างแสตมป์ (คำอธิบาย) ซ่อน — เนื้อหาได้ความสูงเพิ่ม (คำอธิบายเดียวกันอยู่ใน ? / หัวข้อแต่ละแท็บ) */
@media (max-height: 520px) { html.touch-ui body #windows .win[data-win="stamps"] > .foot:is(:empty, :has(> .spg-foot:only-child)) { display: none; } }

/* รอบ 4: แถวตัวกรองของสมุด (ทั้งหมด/มีแล้ว/…/ตัวกรองเพิ่ม) ห่อบรรทัดแทนเลื่อนข้าง — ไม่มีแถบเลื่อนแนวนอนในแท็บสมุด */
#windows .spg-booktab .sj-fbar { flex-wrap: wrap; overflow-x: visible; }
/* ── stamp-ux-1106 รอบ 4: แท็บแปะ — ไม่มีแถบเลื่อนแนวนอน · จอสัมผัสเตี้ยเลื่อนแนวตั้งชั้นเดียว · ช่องแปะ 4 ช่องเต็มกว้างเป็นพระเอก ── */
.spg-shell > .spg { overflow-x: hidden; }
.spg-sumln { display: none; }
@media (max-height: 520px) {
  html.touch-ui .spg-shell > .spg.spg-pin { display: flex; flex-direction: column; gap: 8px; }
  html.touch-ui .spg-shell > .spg.spg-pin > .spg-main { display: contents; }
  html.touch-ui .spg-shell > .spg.spg-pin > *, html.touch-ui .spg-shell > .spg.spg-pin > .spg-main > * { flex: none; }   /* ไม่ให้ flex บีบแผงสรุปที่กางจนเหลือ 0 (เลื่อนทั้งหน้าแทน) */
  html.touch-ui body #windows .spg-pin .spg-slot > :is(.stp, .stp-empty) { order: 1; grid-row: auto; } html.touch-ui body #windows .spg-pin .spg-slot > .spg-sv { order: 2; grid-row: auto; align-self: start; }   /* ภาพก่อน ค่าใต้ภาพ */
  html.touch-ui .spg-pin .spg-pickbar { order: 0; }
  html.touch-ui .spg-pin .spg-slots { order: 1; }
  html.touch-ui .spg-pin .spg-sumln { order: 2; }
  html.touch-ui .spg-pin > .spg-side { order: 3; display: none; height: auto; min-height: 0; overflow: visible; padding: 0; }
  html.touch-ui .spg-pin.side-open > .spg-side { display: flex; }
  html.touch-ui .spg-pin .spg-own { order: 4; }
  html.touch-ui .spg-pin :is(.spg-folds, .spg-cmb) { order: 5; }
  /* ช่องแปะ: ภาพบน · ค่าใต้ภาพบรรทัดเดียว (เดิมภาพซ้าย-ค่าขวา บีบจนเหลือตัวเลขตัวเดียว "5/9/8") · ไม่มีชื่อบนป้ายแสตมป์ (ถูกตัดเหลือ 3 ตัวอักษร — ชื่อเต็มอยู่แผ่นรายละเอียดตอนแตะ) */
  html.touch-ui body #windows .spg-pin .spg-slot { grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; row-gap: 2px; padding: 6px 4px 4px; }
  html.touch-ui body #windows .spg-pin .spg-slot > :is(.stp, .stp-empty) { --w: 60px; --sw: 69px; grid-row: auto; margin: 0 auto; }
  html.touch-ui .spg-pin .spg-sv { grid-column: 1; max-width: 100%; text-align: center; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.touch-ui .spg-pin .spg-sv b { display: inline; }
  html.touch-ui .spg-pin .spg-sv .spg-fxn, html.touch-ui .spg-pin .spg-slot .cmb-pv { display: none; }
  html.touch-ui .spg-pin :is(.spg-slot, .spg-own-it) .stp-pl { display: none; }
  /* กล่องในแท็บแปะ: ห่อหลายแถว (เลื่อนแนวตั้งเดียวกับหน้า) แทนแถวเลื่อนข้าง */
  html.touch-ui .spg-pin .spg-strip { flex-wrap: wrap; overflow-x: visible; }
  html body #windows .spg-pin .spg-sumln { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-height: var(--btn-h, 44px); width: 100%; padding: 4px 10px; box-sizing: border-box; overflow: hidden; border-radius: 12px; border: 1.5px solid #e0cfab; background: #fffaf0; color: #4a3a20; text-align: left; cursor: pointer; font: 600 var(--fs-xs, 12px)/1.2 var(--font); }
  .spg-sumln .spg-sumc { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: #f3e6c8; white-space: nowrap; overflow: hidden; }
  .spg-sumln .spg-sumc > span { overflow: hidden; text-overflow: ellipsis; }
  .spg-sumln .spg-sumc b { color: #2f6f73; font: 700 var(--fs-sm, 14px)/1.1 var(--font-head, var(--font)); }
  .spg-sumln .spg-sumc em { font-style: normal; color: #a2401a; }
  .spg-sumln .spg-sumc :is(.ui-ic, .stp-skic) { width: 16px; height: 16px; flex: none; }
  .spg-sumln .spg-sumc.near { background: #e8f3ef; color: #1f4f52; flex: none; }
  .spg-sumln .spg-sumc.more { flex: none; }
  .spg-sumln > i { margin-left: auto; font-style: normal; color: #8a7a62; flex: none; }
}
