/* chat-ext.css — คอลัมน์ร้าน/ช่องทาง + ห้องไทยมาร์ทในหน้าแชท (สไตล์ Duoke · 2026-09-27) — ต่อจาก chat.css
   มอคอัพที่ Mai เคาะ: Temp/185_chat_duoke_style.html · สี: LINE #06c755 · ไทยมาร์ท #e4252b · แบรนด์ #008042
   ⚠ ตัวแปร --line ในโปรเจกต์นี้คือ "สีเส้นขอบ" ไม่ใช่สี LINE — ใช้ --cx-line แทน */

:root { --cx-line: #06c755; --cx-tm: #e4252b; --cx-tm-soft: #fdecec; --cx-brand: #008042; --cx-unread: #e5484d; }

/* ---- โครง 4 คอลัมน์: ร้าน 190px · ห้อง · แชท · แผงขวา ---- */
.app.cx { grid-template-columns: var(--cx-shops-w, 190px) var(--rooms-w, minmax(260px, 18fr)) minmax(380px, 30fr) minmax(360px, min(var(--tools-w), calc(100% - 860px))); }
.app.cx.rail { grid-template-columns: var(--cx-shops-w, 190px) var(--rooms-w, minmax(260px, 18fr)) minmax(380px, 30fr) 52px; }

/* ---- คอลัมน์ร้าน ---- */
.cx-shops { background: #f6f8f5; padding: 6px; gap: 2px; overflow: visible; z-index: 5; position: relative; }   /* overflow visible = คำอธิบาย ⓘ ไม่ถูกตัด */
.cx-shops .cx-hd { font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); padding: 4px 8px 6px; display: flex; align-items: center; gap: 2px; }
.cx-shops .h { font-size: var(--fs-xs); color: var(--text-3); padding: 10px 8px 4px; display: flex; align-items: center; gap: 2px; }
.cx-shops .ihint::after { left: 0; right: auto; transform: none; top: calc(100% + 6px); bottom: auto; }
.cx-shops .cx-warn { color: #b45309; cursor: help; margin-left: 3px; }
.cx-shops .cx-none { font-size: var(--fs-xs); color: var(--text-3); padding: 4px 8px; }
.cx-sh { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; min-width: 0; position: relative; outline: none; }
.cx-sh:hover { background: #eaeee9; }
.cx-sh:focus-visible { box-shadow: 0 0 0 2px var(--cx-brand); }
.cx-sh[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }
.cx-sh .ic { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; color: #fff; font-size: var(--fs-xs); font-weight: 700; flex: none; }
.cx-sh .ic.all { background: #1c2420; } .cx-sh .ic.l { background: var(--cx-line); } .cx-sh .ic.t { background: var(--cx-tm); }
.cx-sh .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-sh .n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--cx-unread); color: #fff; font-size: var(--fs-xs); display: grid; place-items: center; font-weight: 600; flex: none; }
.cx-sh .ed { display: none; flex: none; border: 0; background: transparent; color: var(--text-3); font-size: var(--fs-xs); width: 20px; height: 20px; border-radius: 5px; cursor: pointer; padding: 0; }
.cx-sh:hover .ed, .cx-sh:focus-within .ed { display: inline-grid; place-items: center; }
.cx-sh .ed:hover { background: var(--surface); color: var(--cx-brand); }
.cx-sh.editing { background: var(--surface); box-shadow: 0 0 0 1px var(--cx-brand); }
.cx-sh .cx-in { flex: 1; min-width: 0; font: inherit; font-size: var(--fs-xs); border: 1px solid var(--border-strong); border-radius: 6px; padding: 2px 6px; background: var(--surface); color: var(--text); outline: none; }
.cx-sh .cx-in:focus { border-color: var(--cx-brand); }

/* ---- แถวห้อง: รูป + ป้ายช่องทาง (มุมขวาล่าง) + ตัวเลขแดง (มุมซ้ายบน) ---- */
.room .avw { position: relative; width: 38px; height: 38px; flex: none; }
.room .avw .cx-src { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface); font-size: 8px; font-weight: 700; color: #fff; display: grid; place-items: center; line-height: 1; }   /* fs-keep: จุดป้ายแหล่งแชทวงกลม 16px (กราฟิก) */
.cx-src.l { background: var(--cx-line); } .cx-src.t { background: var(--cx-tm); }
.room .avw .cx-ub { position: absolute; left: -5px; top: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--cx-unread); color: #fff; font-size: var(--fs-xs); display: grid; place-items: center; border: 2px solid var(--surface); font-weight: 600; line-height: 1; }
.room .nm .cx-shop { font-size: var(--fs-xs); font-weight: 400; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 24px; flex: 0 1 auto; }
.room .nm .t { flex: 0 1 auto; }
.app[data-shop="tm"] #btnMoreRooms { display: none; }   /* ดูเฉพาะร้านไทยมาร์ท — ปุ่มโหลดห้อง LINE เก่าไม่เกี่ยว */

/* ---- ห้องไทยมาร์ทที่เปิดอยู่ ---- */
.cx-pill { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; background: var(--cx-tm-soft); color: var(--cx-tm); border: 1px solid #f6c9c9; line-height: 1.5; }
.app.cx-ext #tools .body:not(#cxPanel) { display: none !important; }
.app.cx-ext #tools .tab[aria-disabled="true"] { color: #c9cec9; cursor: not-allowed; }
/* ห้องไทยมาร์ท/แพลตฟอร์ม: แผงขวาเป็นของตัวเอง ไม่ใช้แท็บของ LINE (Mai 2026-09-27 — ว่างไว้ก่อน รอเติมฟีเจอร์) */
.app.cx-ext #tools .tabs { display: none !important; }
.cx-cmd { margin: auto; text-align: center; color: var(--text-3); display: grid; gap: 6px; padding: 30px 16px; }
.cx-cmd .t { font-size: var(--fs-md); font-weight: 600; color: var(--text-2); }
.cx-cmd .s { font-size: var(--fs-xs); }

/* ---- ลากขยายคอลัมน์ร้าน (60–320px · จำไว้ในเครื่อง · ดับเบิลคลิก = กลับค่าเดิม) ---- */
.cx-grip { position: absolute; top: 0; bottom: 0; right: -8px; width: 10px; cursor: col-resize; z-index: 6; }
.cx-grip:hover, .app.cx-drag .cx-grip { background: linear-gradient(90deg, transparent 4px, var(--cx-brand) 4px, var(--cx-brand) 6px, transparent 6px); opacity: .5; }
.app.cx-drag { user-select: none; cursor: col-resize; }
/* แคบกว่า 120px = เหลือแค่ไอคอน */
.cx-shops.slim { padding: 6px 4px; }
.cx-shops.slim .cx-hd, .cx-shops.slim .h, .cx-shops.slim .cx-none { display: none; }
.cx-shops.slim .cx-sh { justify-content: center; padding: 7px 4px; }
.cx-shops.slim .cx-sh .nm, .cx-shops.slim .cx-sh .ed { display: none !important; }
.cx-shops.slim .cx-sh .n { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; font-size: var(--fs-xs); padding: 0 4px; }

.cx-tmchip { background: var(--cx-tm-soft); color: var(--cx-tm); }
.cx-tmchip.stale { background: var(--surface-2); color: var(--text-3); }

/* ---- จอกลาง: คอลัมน์ร้านเหลือแค่ไอคอน ---- */
@media (max-width: 1000px) {
  .app.cx, .app.cx.rail { grid-template-columns: 52px 240px minmax(0, 1fr); }
  .cx-shops { padding: 6px 4px; }
  .cx-shops .cx-hd, .cx-shops .h, .cx-shops .cx-none { display: none; }
  .cx-sh { justify-content: center; padding: 7px 4px; }
  .cx-sh .nm, .cx-sh .ed { display: none !important; }
  .cx-sh .n { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; font-size: var(--fs-xs); padding: 0 4px; }
}
/* ---- จอแคบ: ร้านเป็นแถบเลื่อนแนวนอนเหนือรายการห้อง ---- */
@media (max-width: 760px) {
  .app.cx, .app.cx.rail { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .app.cx.m-chat { grid-template-rows: minmax(0, 1fr); }
  .app.cx.m-chat .cx-shops { display: none; }
  .cx-shops { flex-direction: row; overflow-x: auto; padding: 4px; }
  .cx-sh { flex: none; padding: 5px 8px; }
  .cx-sh .nm { display: inline !important; max-width: 120px; }
  .cx-sh .n { position: static; }
}

/* ================= ห้องไทยมาร์ท: ข้อความในห้อง + กล่องตอบสไตล์ Duoke (มอคอัพ Temp/187_tm_composer_duoke.html · 2026-09-27) ================= */
#msgs[data-cx] { overflow-x: hidden; gap: 4px; }   /* ป้ายคำอธิบายไม่ดันจนเกิดแถบเลื่อนแนวนอน */
.cx-top { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 2px 0 6px; max-width: 100%; }
.cx-readnote { display: inline-flex; align-items: center; font-size: var(--fs-xs); color: var(--warn-ink, #b45309); background: var(--warn-soft, #fff4e0); border: 1px solid #f3dcb2; padding: 2px 8px 2px 10px; border-radius: 8px; }
.cx-readnote .ihint { color: inherit; opacity: .75; }
.cx-readnote .ihint::after { top: calc(100% + 6px); bottom: auto; font-weight: 400; }   /* ป้ายอยู่บนสุดของห้อง — คำอธิบายเด้งลงล่าง ไม่โดนตัด */
.cx-topwarn { font-size: var(--fs-xs); color: var(--danger-ink, #b42318); text-align: center; }
.cx-wait { margin: auto; color: var(--text-3); font-size: var(--fs-sm); text-align: center; max-width: 380px; line-height: 1.6; padding: 20px 12px; }
.cx-wait small { font-size: var(--fs-xs); }
.cx-day { margin: 6px 0; }
/* ⚠ ห้ามใช้คลาส .in/.out/.st ในห้องนี้ — style.css มี .in (ช่องกรอก: กว้างเต็ม สูง 36px มีกรอบ) และ .st (ขั้นตอน: flex แนวตั้ง) ทำให้แถวลูกค้าเป็นกล่องขาวเต็มแถว (เจอจริง 2026-09-27) */
.cx-row { display: flex; gap: 8px; align-items: flex-end; margin-top: 2px; width: auto; height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.cx-row.cx-us { justify-content: flex-end; }
.cx-row .av { width: 30px; height: 30px; font-size: var(--fs-xs); flex: none; }
.cx-col { max-width: 68%; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.cx-row.cx-us .cx-col { align-items: flex-end; }
.cx-who { font-size: var(--fs-xs); color: var(--text-3); margin: 6px 4px 2px; }
.cx-b { width: fit-content; max-width: 100%; padding: 8px 12px; border-radius: 12px; font-size: var(--fs-sm); line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.cx-row.cx-them .cx-b { background: var(--them, #fff); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.cx-row.cx-us .cx-b { background: var(--me, #d9f3e6); border-bottom-right-radius: 4px; }   /* เขียวเดียวกับข้อความออกของ LINE */
.cx-row.cx-us.cx-wait-row .cx-b { opacity: .7; }
.cx-row.cx-us.cx-fail .cx-b { box-shadow: 0 0 0 1px var(--cx-tm); }
.cx-b.img { padding: 4px; display: grid; gap: 4px; }
.cx-pic { display: block; padding: 0; border: 0; background: var(--surface-2); border-radius: 9px; overflow: hidden; cursor: zoom-in; min-width: 120px; min-height: 80px; }
.cx-pic img { display: block; max-width: 240px; max-height: 300px; width: auto; height: auto; object-fit: contain; }
.cx-pic.ld, .cx-pic.busy, .cx-pic.bad { cursor: default; width: 180px; height: 120px; display: grid; place-items: center; font-size: var(--fs-xs); color: var(--text-3); text-align: center; padding: 8px; }
.cx-cap { padding: 2px 8px 4px; }
.cx-card { color: var(--text-2); }
.cx-t { font-size: var(--fs-xs); color: var(--text-3); margin: 2px 4px 0; white-space: nowrap; display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.cx-t.r { justify-content: flex-end; }
.cx-t .cx-st { display: inline; position: static; padding: 0; gap: 0; text-align: inherit; }
.cx-t .cx-st.ok { color: var(--cx-brand); }
.cx-t .cx-st.wait { color: var(--text-3); }
.cx-t .cx-st.slow { color: var(--warn-ink, #b45309); cursor: help; }
.cx-t .cx-st.fail { color: var(--cx-tm); font-weight: 600; }
.cx-t .cx-st.unsure { color: var(--warn-ink, #b45309); font-weight: 600; white-space: normal; }   /* ไม่แน่ใจว่าส่งถึง — ไม่มีปุ่มส่งซ้ำ */
.cx-t .cx-by { color: var(--text-2); font-weight: 600; }   /* ชื่อแอดมินที่ส่งจากหน้านี้ ใต้ฟอง */
.cx-t .ihint { margin-left: 0; }
.cx-t .ihint::after { left: auto; right: 0; transform: none; }
.dko .ihint::after { left: auto; right: 0; transform: none; }   /* แผงขวา DK: ⓘ อยู่ชิดขอบขวา — คำอธิบายเปิดไปทางซ้าย ไม่ดันแผงให้มีแถบเลื่อนแนวนอน */
.cx-retry { border: 0; background: none; padding: 0; margin-left: 4px; font: inherit; font-size: var(--fs-xs); color: var(--cx-tm); text-decoration: underline; cursor: pointer; }
.cx-retry:disabled { opacity: .5; cursor: default; text-decoration: none; }

/* ---- กล่องตอบ ---- */
.cx-comp { border-top: 1px solid var(--border); padding: 6px 12px 10px; position: relative; background: var(--surface); display: grid; gap: 4px; }
.cx-comp[hidden], .cx-comp .attach[hidden] { display: none; }
.cx-comp.drop { background: var(--cx-tm-soft); outline: 2px dashed var(--cx-tm); outline-offset: -4px; }
.cx-tools { display: flex; align-items: center; gap: 4px; }
.cx-tools .sp { flex: 1; }
.cx-tb { width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; font-size: var(--fs-lg); color: var(--text-2); cursor: pointer; display: grid; place-items: center; padding: 0; }
.cx-tb:hover { background: var(--surface-2); }
.cx-tb:disabled { opacity: .3; cursor: not-allowed; background: none; }
.cx-why { font-size: var(--fs-xs); color: var(--cx-tm); font-weight: 600; }
.cx-ta { width: 100%; min-height: 74px; max-height: 160px; border: 0; outline: none; resize: none; font: inherit; font-size: var(--fs-sm); line-height: 1.45; color: var(--text); background: transparent; padding: 6px 2px; }
.cx-ta::placeholder { color: var(--text-3); }
.cx-ta:disabled { cursor: not-allowed; }
.cx-foot { display: flex; align-items: center; gap: 8px; }
.cx-foot .sp { flex: 1; }
.cx-cnt { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.cx-cnt.over { color: var(--cx-tm); font-weight: 700; }
.cx-send { background: var(--cx-tm); color: #fff; border: 0; border-radius: 8px; padding: 7px 18px; font: inherit; font-weight: 600; font-size: var(--fs-sm); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.cx-send:hover:not(:disabled) { filter: brightness(.94); }
.cx-send:disabled { opacity: .45; cursor: not-allowed; }
.cx-comp .cpop { bottom: calc(100% - 2px); left: 12px; }
.cx-comp .cx-emo { display: grid; grid-template-columns: repeat(10, 30px); gap: 2px; padding: 6px; }
.cx-comp .cx-emo[hidden] { display: none; }
.cx-emo button { width: 30px; height: 30px; border: 0; background: none; border-radius: 6px; font-size: var(--fs-xl); cursor: pointer; padding: 0; display: grid; place-items: center; }
.cx-emo button:hover { background: var(--surface-2); }
@media (max-width: 760px) { .cx-comp .cx-emo { grid-template-columns: repeat(8, 30px); } .cx-col { max-width: 80%; } }

/* กล่องตอบห้องไทยมาร์ท = แถวเดียวขนาดเท่ากล่อง LINE (Mai 2026-09-27) */
.cx-comp { padding: 7px 10px 9px; gap: 5px; }
.cx-box { display: flex; gap: 7px; align-items: flex-end; }
.cx-box .cx-tools { gap: 2px; align-self: flex-end; padding-bottom: 3px; }
.cx-box .cx-tb { width: 32px; height: 32px; font-size: var(--fs-lg); }
.cx-box .cx-ta { flex: 1; width: auto; min-height: 40px; max-height: 160px; border: 1px solid var(--input-border); border-radius: 11px; padding: 8px 11px; background: var(--input-bg); line-height: 1.4; }
.cx-box .cx-ta:focus { border-color: var(--cx-tm); box-shadow: 0 0 0 3px var(--cx-tm-soft); }
.cx-box .cx-cnt { align-self: center; }
.cx-box .cx-send { height: 36px; padding: 0 16px; }
.cx-comp > .cx-why { padding-left: 4px; }

/* การ์ดสินค้าที่ลูกค้าส่งมา (แบบหน้าไทยมาร์ท) */
.cx-prod { display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; width: 260px; max-width: 100%; }
.cx-prod img, .cx-prod .ph { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; }
.cx-prod .n { font-size: var(--fs-sm); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cx-prod .p { color: var(--cx-tm); font-weight: 700; font-size: var(--fs-sm); margin-top: 2px; }
.cx-prod .s { font-size: var(--fs-xs); color: var(--text-3); }
.cx-prod .q { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 5px; text-align: center; font-size: var(--fs-xs); color: var(--text-2); }
.cx-prod .q.out { color: var(--text-3); }
a.cx-prod { color: inherit; text-decoration: none; cursor: pointer; } a.cx-prod:hover .n { text-decoration: underline; }

/* ไอคอนแพลตฟอร์มจริง (แทนตัว L/T) */
.cx-chimg { display: block; width: 100%; height: 100%; object-fit: cover; }
.room .avw .cx-src { background: none !important; overflow: hidden; padding: 0; }
.cx-sh .ic.img { background: none !important; overflow: hidden; padding: 0; }
.cx-sh .ic.img .cx-chimg { border-radius: 5px; }
.cx-pill .cx-chimg.pl { width: 13px; height: 13px; border-radius: 3px; margin-right: 4px; display: inline-block; vertical-align: -2px; }

/* ห้อง Duoke ที่มีใบ (581 · มอคอัพ ข4): ไอคอน + ตัวเลข เป็นแคปซูลเดียวที่มุมขวาล่าง · ตัวเลขแดง (.cx-ub) อยู่มุมซ้ายบน ไม่ทับกัน
   ขอบขาว 1.5px = box-shadow (border ใช้เป็นเส้นของแคปซูลเทา) · ความจำเพาะสูงกว่า "background: none !important" ข้างบน */
.room .avw .cx-src.cx-oc { width: auto; height: 19px; right: -6px; bottom: -4px; box-sizing: border-box; padding: 0 5px 0 2px; gap: 2px; display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid transparent; box-shadow: 0 0 0 1.5px var(--surface, #fff); font-size: var(--fs-xs); font-weight: 700; line-height: 1; overflow: hidden; z-index: 1; white-space: nowrap; }
.room .avw .cx-src.cx-oc .cx-chimg { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.room .avw .cx-src.cx-oc b { font-weight: 700; font-variant-numeric: tabular-nums; }
.room .avw .cx-src.cx-oc.new { background: var(--ok, #047857) !important; color: #fff; }
.room .avw .cx-src.cx-oc.old { background: var(--surface-2, #f0f2ee) !important; color: var(--text-2, #4b5550); border-color: var(--border-strong, #cfd4cc); }

/* ข้อความระบบของแพลตฟอร์ม (Duoke · 574) — กลางจอ ตัวเล็ก */
.cx-row.cx-sys { justify-content: center; margin: 4px 0; }
.cx-row.cx-sys span { font-size: var(--fs-xs); color: var(--text-3, #6b7280); background: var(--surface-2, #f1f3f1); padding: 2px 10px; border-radius: 10px; max-width: 80%; text-align: center; }

/* ---------- แผงขวาห้อง Duoke: การ์ดคำสั่งซื้อแบบหน้า Duoke (575 · chat-ext-orders.js) ---------- */
.dko { display: flex; flex-direction: column; min-height: 100%; font-size: var(--fs-md); line-height: 1.4; text-align: left; grid-column: 1 / -1; width: 100%; }   /* แผงขวาเป็นตาราง 2 ช่อง — การ์ดต้องเต็มแผง */
.dko-tabs { display: flex; align-items: center; gap: 6px; padding: 8px 48px 8px 12px; border-bottom: 1px solid var(--border-strong, #cfd4cc); position: sticky; top: 0; background: var(--surface, #fff); z-index: 1; }
/* แท็บแยกเป็นกล่องชัด ๆ แท็บที่เปิดอยู่เทพื้นเขียว (Mai 2026-09-28 "ทำให้แต่ละแท็บดูแยกชัด") */
.dko-tabs .on { font-weight: 700; color: #fff; background: var(--brand, #008042); border-color: var(--brand, #008042); }
.dko-tabs i { font-style: normal; font-size: var(--fs-xs); background: var(--surface-2, #eef0ee); border-radius: 999px; padding: 0 6px; margin-left: 2px; color: var(--text-2); }
.dko-tabs .on i { background: rgba(255,255,255,.25); color: #fff; }
.dko-tabs .muted { margin-left: auto; }
.dko-list { padding: 8px 10px; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }   /* การ์ดหดตามแผงเสมอ — ชื่อยาวตัด … ในการ์ด ไม่ดันความกว้าง (Mai 2026-09-27) */
.dko { min-width: 330px; }   /* ขั้นต่ำ ≈ แผงขวาย่อสุด 360px (หักขอบใน) — แคบกว่านี้ค่อยมีแถบเลื่อนแนวนอน */
.dko-card { border: 1px solid var(--border-strong, #cfd4cc); border-radius: 10px; padding: 8px 10px; background: var(--surface, #fff); }
/* การ์ดที่กาง: แถบหัว (สถานะ · เลข · วันที่) เทพื้นเต็มกว้าง — เห็นชัดว่าใบใหม่เริ่มตรงไหน (Mai 2026-09-27 "2 คำสั่งซื้อกลืนกัน") */
.dko-card:not(.fold) > .dko-h, .dko-card:not(.fold) > .dko-no, .dko-card:not(.fold) > .dko-dt { background: var(--surface-2, #f0f2ee); margin-left: -10px; margin-right: -10px; padding-left: 10px; padding-right: 10px; }
.dko-card:not(.fold) > .dko-h { margin-top: -8px; padding-top: 8px; border-radius: 9px 9px 0 0; }
.dko-card:not(.fold) > .dko-no { margin-top: 0; padding-top: 4px; }
.dko-card:not(.fold) > .dko-dt { margin-top: 0; padding-bottom: 7px; margin-bottom: 8px; border-bottom: 1px solid var(--border, #e4e7e1); }
.dko-card.fold { background: var(--surface-2, #f7f8f7); }
.dko-h { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.dko-h .sp { flex: 1; } .dko-h .ar { color: var(--text-3); }
.dko-st { font-size: var(--fs-xs); font-weight: 700; padding: 1px 8px; border-radius: 5px; background: #fff1e0; color: #c2410c; }
.dko-st.b { background: #e8efff; color: #1d4ed8; } .dko-st.ok { background: #e6f4ec; color: #047857; } .dko-st.x { background: #fdecec; color: #b91c1c; }
.dko-no { margin-top: 4px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.dko-dt, .dko-sum { color: var(--text-3); font-size: var(--fs-sm); margin-top: 1px; }
.dko-fi { display: flex; gap: 8px; align-items: center; margin-top: 6px; }   /* การ์ดหุบ: แถวสินค้า */
.dko-th { width: 40px; height: 40px; border-radius: 6px; flex: none; }
.dko-th > img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.dko-fi .i { flex: 1; min-width: 0; }
.dko-fi .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dko-fi .s { font-size: var(--fs-sm); color: var(--text-3); display: flex; gap: 12px; align-items: baseline; }
.dko-fi .sku { color: var(--text-2); }
.dko-fi .q { color: var(--text-2); } .dko-fi .q.hi { color: #c2410c; font-weight: 700; }
.dko-fi .amt { font-weight: 700; flex: none; white-space: nowrap; }
.dko-fl { font-size: var(--fs-sm); color: var(--text-2); margin-top: 5px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.dko-fl .dot { color: var(--text-3); }
.dko-cp { border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: var(--fs-sm); padding: 0 2px; }
.dko-cp:hover { color: var(--brand, #008042); }
.dko-items { margin-top: 8px; display: grid; gap: 8px; }
.dko-it { display: flex; gap: 8px; align-items: flex-start; }
.dko-it > img, .dko-it > .ph, .dko-it .thumb .ph { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-2, #eef0ee); display: grid; place-items: center; }
.dko-it .i { flex: 1; min-width: 0; }
.dko-it .n { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dko-it .n a { color: inherit; text-decoration: none; } .dko-it .n a:hover { text-decoration: underline; }
.dko-it .s { color: var(--text-3); font-size: var(--fs-sm); }
.dko-it .r { text-align: right; flex: none; }
.dko-it .p { font-weight: 700; font-size: var(--fs-md); } .dko-it .o { color: var(--text-3); text-decoration: line-through; font-size: var(--fs-xs); }
.dko-it .q { color: var(--text-2); } .dko-it .q.hi { color: #c2410c; font-weight: 700; }
.dko-sec { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; display: grid; gap: 3px; }
.dko-sec .hd { font-weight: 700; color: var(--text-2); }
.dko-sec .row { display: flex; justify-content: space-between; gap: 10px; }
.dko-sec .row.col { flex-direction: column; gap: 1px; align-items: flex-start; }
.dko-sec .row .k { color: var(--text-3); flex: none; }
.dko-sec .row > span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.dko-sec .row.col > span:last-child { text-align: left; }
.dko-lst { color: #1d4ed8; font-weight: 600; }
.dko-lst.bad { color: #c2410c; }   /* พัสดุมีปัญหา — ส้ม */
.dko-addr summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
.dko-wait { padding: 24px 12px; text-align: center; color: var(--text-3); }
.dko-foot { padding: 6px 12px 10px; margin-top: auto; }
.dko .mono { font-family: ui-monospace, Consolas, monospace; }
/* สถานะบนการ์ดคำสั่งซื้อในแชท (Duoke) — สีตามความหมาย ตรงกับแผงขวา */
.cx-prod .p.cx-ost { display: inline-block; font-size: var(--fs-xs); padding: 1px 8px; border-radius: 5px; background: #fff1e0; color: #c2410c; }
.cx-prod .p.cx-ost.b { background: #e8efff; color: #1d4ed8; } .cx-prod .p.cx-ost.ok { background: #e6f4ec; color: #047857; } .cx-prod .p.cx-ost.x { background: #fdecec; color: #b91c1c; }

/* แท็บสินค้า (576) */
.dko-tabs button { border: 1px solid var(--border-strong, #cfd4cc); background: var(--surface, #fff); font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 5px 12px; border-radius: 8px; white-space: nowrap; }
.dko-tabs button:not(.on):hover { background: var(--surface-2, #eef0ee); color: var(--text-1, #222); }
.dko-search { padding: 8px 10px 0; }
.dko-search .in { width: 100%; }
.dko-prod { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.dko-prod > img, .dko-prod > .ph { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-2, #eef0ee); display: grid; place-items: center; }
.dko-prod .i { flex: 1; min-width: 0; }
.dko-prod .n { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dko-prod .n a { color: inherit; text-decoration: none; } .dko-prod .n a:hover { text-decoration: underline; }
.dko-prod .s { color: var(--text-3); font-size: var(--fs-sm); }
.dko-prod .r { text-align: right; flex: none; }
.dko-prod .p { font-weight: 700; font-size: var(--fs-md); white-space: nowrap; }
.dko-prod .st { font-size: var(--fs-sm); color: var(--text-2); } .dko-prod .st.out { color: #b91c1c; font-weight: 600; }
.dko-vars summary { cursor: pointer; color: var(--text-2); font-size: var(--fs-sm); margin-top: 2px; }
/* ตารางตัวเลือก: คอลัมน์ตรงกันทุกแถว (Mai 2026-09-27 "ทำคอลัมน์อย่าโย้") */
.dko-vars table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: var(--fs-sm); line-height: 1.35; table-layout: fixed; }
.dko-vars th { text-align: left; font-weight: 600; color: var(--text-3); border-bottom: 1px solid var(--line); padding: 3px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dko-vars td { padding: 3px 5px; border-bottom: 1px dashed var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dko-vars col.c-at { width: auto; }   /* ตัวเลือก = ที่เหลือทั้งหมด (ตัดด้วย … ชี้ดูเต็มที่ title) */
.dko-vars col.c-sku { width: 84px; } .dko-vars col.c-pr { width: 60px; } .dko-vars col.c-sell { width: 74px; } .dko-vars col.c-pf { width: 86px; }
.dko-vars .num { text-align: right; font-variant-numeric: tabular-nums; }   /* ไม่ใช้ .n — ชนกับกฎชื่อสินค้า .dko-prod .n (line-clamp) ทำตัวเลขซ้อนกัน */
.dko-sell { font-weight: 700; color: #047857; } .dko-sell.out { color: #b91c1c; } .dko-sell.na { color: var(--text-3); font-weight: 400; }
.dko-sell.big { font-size: var(--fs-md); }
.dko-prod .pst { font-size: var(--fs-xs); color: var(--text-3); }
.dko-vars summary .dko-live { font-size: var(--fs-xs); margin-left: 6px; }

/* การ์ดคำสั่งซื้อ: ช่องใหม่ตามสเปก Temp/dk_panel_spec.md ข้อ 6 (เลขพัสดุกดได้ · เหตุผลยกเลิก) */
.dko-link { border: 0; background: none; padding: 0; font: inherit; color: #1d4ed8; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; text-align: inherit; }
.dko-link:hover { color: var(--brand, #008042); }
.dko-cancel { color: #b91c1c; font-weight: 600; }
/* แท็บสินค้า: ตัวเลือกช่องค้น + ปุ่มส่งการ์ด (ส่ง = สีหลัก) */
.dko-search { display: flex; gap: 6px; }
.dko-search select.in { flex: none; width: auto; min-width: 96px; font-size: var(--fs-sm); }
.dko-search input.in { flex: 1; min-width: 0; }
.dko-prod .dko-send { margin-top: 6px; white-space: nowrap; }
.dko-prod .dko-send .spin { width: 12px; height: 12px; }

/* รูปทุกจุดในแผงขวา DK = hover ซูม (Mai 2026-09-27 · มาตรฐาน .thumb ของ ui.js) */
.dko-it .thumb, .dko-prod .thumb { width: 44px; height: 44px; border-radius: 6px; flex: none; }
.dko-it .thumb > img, .dko-prod .thumb > img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

/* การ์ดที่กาง ห้อง Duoke (มอคอัพ dk_card_detail_mk2b ③ · Mai 2026-09-27): ตาราง 2 คอลัมน์ + แท็บในการ์ด ยอดชำระ / ขนส่ง */
.dko-card.dx { container: dkocard / inline-size; }   /* ผู้รับ | ยอดชำระ วางคู่เมื่อการ์ดกว้าง ≥520px (วัดที่การ์ด ไม่ใช่จอ) */
.dko-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 10px; }
.dko-g2 .kv { min-width: 0; }
.dko-g2 .k { color: var(--text-3); font-size: var(--fs-xs); }
.dko-g2 .v { font-weight: 600; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.dko-cxl { margin-top: 8px; color: #b91c1c; font-weight: 600; font-size: var(--fs-sm); overflow-wrap: anywhere; }   /* เหตุผลที่ยกเลิก — แดง อยู่นอกแท็บ เห็นตลอด */
.dko-ptabs { display: flex; gap: 2px; margin-top: 10px; border-bottom: 1px solid var(--border, #e4e7e1); }
.dko-ptabs button { border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; padding: 6px 10px; margin-bottom: -1px; }
.dko-ptabs button:hover { color: var(--text); }
.dko-ptabs button.on { color: var(--brand, #008042); border-bottom-color: var(--brand, #008042); font-weight: 700; }
.dko-pane { padding-top: 8px; display: grid; gap: 8px; min-width: 0; }
.dko-pay2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@container dkocard (min-width: 520px) { .dko-pay2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.dko-blk { min-width: 0; }
.dko-blk .bt { font-size: var(--fs-xs); color: var(--text-3); font-weight: 700; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.dko-blk .who { font-weight: 600; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.dko-blk .addr { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.45; overflow-wrap: anywhere; }
.dko-notes { border-top: 1px dashed var(--border, #e4e7e1); padding-top: 7px; }
.dko-cpt { border: 0; background: none; cursor: pointer; color: var(--text-3); font: inherit; font-size: var(--fs-xs); font-weight: 400; padding: 0 2px; }
.dko-cpt:hover { color: var(--brand, #008042); }
.dko-mr { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: var(--fs-sm); padding: 1px 0; }
.dko-mr .k { color: var(--text-2); flex: none; max-width: 55%; overflow-wrap: anywhere; }
.dko-mr .v { min-width: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.dko-mr.tot { border-top: 1px solid var(--border, #e4e7e1); margin-top: 4px; padding-top: 5px; font-weight: 700; font-size: var(--fs-md); }
.dko-mr.tot .k { color: var(--text); }
.dko-mr .neg { color: var(--accent, #0f766e); }   /* ส่วนลด (−) = สีเน้น */
.dko-pwait { padding: 12px 4px; color: var(--text-3); font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dko-pwait .spin { width: 12px; height: 12px; }
.dko-pwait.bad { color: #b91c1c; flex-direction: column; align-items: flex-start; gap: 6px; }
.dko-none { padding: 2px 0; }
/* ไทม์ไลน์พัสดุ: ไอคอนเล็กตาม kind แทนจุด (delivered เขียว · out น้ำเงิน · hub/pickup เทา · problem ส้มหนา · info จาง) · อันบนสุดหนา */
.dko-tl { list-style: none; margin: 2px 0 0; padding: 0 0 0 22px; position: relative; min-width: 0; }
.dko-tl::before { content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--border, #e4e7e1); }
.dko-tl li { position: relative; font-size: var(--fs-sm); margin-bottom: 6px; overflow-wrap: anywhere; min-width: 0; }
.dko-tl li > .ic { position: absolute; left: -22px; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface, #fff); display: grid; place-items: center; font-size: var(--fs-xs); line-height: 1; }
.dko-tl li.k-info > .ic { font-size: var(--fs-lg); color: var(--text-3); }
.dko-tl li.now .d { font-weight: 700; }
.dko-tl .t { color: var(--text-3); font-size: var(--fs-xs); }
.dko-tl .d[title] { cursor: help; }
.dko-tl .k-delivered > .d, .dko-ev.k-delivered, .dko-lst.k-delivered { color: #15803d; }
.dko-tl .k-out > .d, .dko-ev.k-out, .dko-lst.k-out { color: #1d4ed8; }
.dko-tl .k-hub > .d, .dko-tl .k-pickup > .d, .dko-ev.k-hub, .dko-ev.k-pickup, .dko-lst.k-hub, .dko-lst.k-pickup { color: var(--text-2); }
.dko-tl .k-problem > .d, .dko-ev.k-problem, .dko-lst.k-problem { color: #c2410c; font-weight: 700; }
.dko-tl .k-info > .d, .dko-ev.k-info { color: var(--text-3); }
.dko-tl li.now.k-info > .d { color: var(--text); }   /* อันล่าสุดไม่จางแม้ไม่รู้ชนิด */
.dko-lst.k-info { color: #1d4ed8; }
.dko-lst .ic { margin-right: 4px; font-size: var(--fs-xs); }
/* บรรทัดความเคลื่อนไหวล่าสุด (การ์ดหุบ + รายละเอียดล่าสุด) */
.dko-ev { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; max-width: 100%; font-size: var(--fs-sm); }
.dko-ev > .ic { flex: none; font-size: var(--fs-xs); line-height: 1; }
.dko-ev.k-info > .ic { font-size: var(--fs-md); }
.dko-ev .tx { min-width: 0; overflow-wrap: anywhere; }
.dko-ev[title] { cursor: help; }
.dko-fe { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; min-width: 0; }
.dko-fe .dko-ev { flex: 1; }
.dko-fe .dko-ev .tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dko-fe .t { flex: none; color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; }
.dko-more { border: 0; background: none; padding: 0 0 0 14px; font: inherit; font-size: var(--fs-sm); color: #1d4ed8; cursor: pointer; justify-self: start; }
.dko-more:hover { text-decoration: underline; }

/* ---- แท็บ "ลูกค้า" ห้อง Duoke/ไทยมาร์ท (Temp/194 · 2026-09-28) ----
   แถบแท็บ (#cxPanel) อยู่บนสุด · ใต้แถบ = หน้าลูกค้าตัวเดิมของ LINE (#pCust) ที่ chat-ext-cust.js เปิดให้ */
.app.cx-ext.cx-cust:not(.rail) #tools .body#pCust { display: grid !important; }
.app.cx-ext.cx-cust #tools #cxPanel { order: -1; flex: none; overflow: visible; padding: 0; }
.app.cx-ext.cx-cust #tools .dko-cust { min-height: 0; }
.cx-cnote { background: var(--warn-soft); color: var(--warn-ink); border-radius: 8px; padding: 7px 10px; font-size: var(--fs-xs); grid-column: 1 / -1; }
/* ปุ่มใต้ฟองแชทขาเข้า (ใช้เป็นข้อมูลออกบิล/ที่อยู่จัดส่ง · อ่านข้อความจากรูป) — ชุดเดียวกับห้อง LINE */
.cx-acts { max-width: 420px; }
.cx-acts .ocrbox { background: var(--surface); }

/* ---- จัดวางแท็บลูกค้าห้องแพลตฟอร์มใหม่ (Mai 2026-09-28 "จัดวางองค์ประกอบใหม่ให้ลงตัว" · เฉพาะโหมด ext ไม่แตะแผง LINE) ----
   คอลัมน์เดียวบนลงล่าง: หัวลูกค้า → ช่องค้นจับคู่ → การ์ดข้อมูลออกบิล → ข้อมูลจัดส่งจากแพลตฟอร์ม (ย่อไว้) → ปุ่มบันทึก (ติดล่างเมื่อเลื่อน)
   การ์ดมีกรอบชัด + แถบหัวเทพื้น (กันส่วนต่าง ๆ "กลืน" กัน) · ใช้ได้ตั้งแต่แผงกว้าง ~360px ไม่มีแถบเลื่อนแนวนอน */
.app.cx-ext.cx-cust #pCust { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; padding: 10px; overflow-x: hidden; }
.app.cx-ext.cx-cust #pCust > * { grid-column: 1 / -1; min-width: 0; }
.app.cx-ext.cx-cust #pCust .cbx2 { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }
.app.cx-ext.cx-cust #pCust > .crow { border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; flex-wrap: wrap; }
.app.cx-ext.cx-cust #pCust > .crow .grow { flex: 1 1 140px; }
.app.cx-ext.cx-cust #pCust .matchf { width: 100%; }
.app.cx-ext.cx-cust #pCust .matchf input.in { width: 100%; }
.app.cx-ext.cx-cust #pCust .cbx, .app.cx-ext.cx-cust #pCust .cx-ship { border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 10px 10px; background: var(--surface); display: grid; gap: 8px; }
.app.cx-ext.cx-cust #pCust .cbx > h4 { margin: 0 -10px; padding: 7px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border-strong); border-radius: 10px 10px 0 0; color: var(--text-2); }
.app.cx-ext.cx-cust #pCust .cbx.folded > h4 { border-bottom: 0; border-radius: 10px; }
.app.cx-ext.cx-cust #pCust .cbx .g2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.app.cx-ext.cx-cust #pCust .cbx .field, .app.cx-ext.cx-cust #pCust .cbx .field input, .app.cx-ext.cx-cust #pCust .cbx .field textarea { min-width: 0; }
.app.cx-ext.cx-cust #pCust .cbx .seg2 { display: flex; flex-wrap: wrap; }
.app.cx-ext.cx-cust #pCust .cbx .seg2 button { flex: 1 1 120px; }
.app.cx-ext.cx-cust #pCust .pastebox { margin: 0; }
.app.cx-ext.cx-cust #pCust .pastebox textarea.in { min-height: 72px; }
/* ข้อมูลจัดส่งจากแพลตฟอร์ม: <details> ย่อไว้ · บรรทัดสรุป = ผู้รับ · โทร */
.cx-ship > summary { list-style: none; cursor: pointer; margin: 0 -10px; padding: 7px 10px; background: var(--surface-2); border-radius: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.cx-ship > summary::-webkit-details-marker { display: none; }
.cx-ship > summary::before { content: '▸'; color: var(--text-3); font-size: var(--fs-xs); }
.cx-ship[open] > summary { border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--border-strong); }
.cx-ship[open] > summary::before { content: '▾'; }
.cx-ship .cx-ship-t { font-size: var(--fs-xs); font-weight: 800; color: var(--text-2); letter-spacing: .03em; }
.cx-ship .cx-ship-sum { flex: 1 1 120px; min-width: 0; font-size: var(--fs-xs); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-ship .cx-ship-b { display: grid; gap: 6px; padding-top: 8px; font-size: var(--fs-xs); }
.cx-ship .ckv span:not(.k) { overflow-wrap: anywhere; }
/* ปุ่มบันทึกลูกค้าใหม่: เต็มกว้าง ติดล่างเมื่อแผงเลื่อน */
.app.cx-ext.cx-cust #pCust > .tagrow:has([data-savenew]) { position: sticky; bottom: 0; z-index: 3; background: var(--surface); margin: 0 -10px -10px; padding: 8px 10px 10px; border-top: 1px solid var(--border-strong); display: flex; gap: 6px; align-items: center; }
.app.cx-ext.cx-cust #pCust [data-savenew] { flex: 1; justify-content: center; }
.app.cx-ext.cx-cust #pCust > .syschips { margin: 0; }

/* ---- หน้าย่อยใต้การ์ดหัวลูกค้า (ห้องแพลตฟอร์ม · Mai 2026-09-28): 1 ข้อมูลลูกค้า · 2 เทียบ/เช็คข้อมูลออกบิล ----
   ปุ่มแบ่งช่องมีกรอบชัด ปุ่มที่เลือก = เขียวทึบ (เหมือนแท็บหลัก) · ติดบนเมื่อแผงเลื่อน · หน้า 2 ซ่อนทุกอย่างของหน้า 1 ยกเว้นการ์ดหัว */
.app.cx-ext.cx-cust #pCust > .cx-subtabs { display: flex; gap: 0; position: sticky; top: -10px; z-index: 4; background: var(--surface); margin: 0 -10px; padding: 6px 10px; border-bottom: 1px solid var(--border-strong); }
.cx-subtabs > button { flex: 1 1 0; min-width: 0; padding: 7px 8px; font: inherit; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); background: var(--surface); border: 1px solid var(--border-strong); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-subtabs > button:first-child { border-radius: 8px 0 0 8px; }
.cx-subtabs > button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.cx-subtabs > button:hover { background: var(--surface-2); }
.cx-subtabs > button.on { background: var(--brand, #008042); border-color: var(--brand, #008042); color: #fff; }
.app.cx-ext.cx-cust #pCust.cx-p2 > :not(.crow):not(.cx-subtabs):not(.cx-cmpbody) { display: none !important; }
.app.cx-ext.cx-cust #pCust > .cx-cmpbody { min-width: 0; overflow-x: hidden; }

/* ---- กลุ่มสถานะบนหัวหน้าแชท (chat-status.js · Mai 2026-09-28 "คำสั้น · จัดกลุ่ม") ----
   [ สถานะ ● LINE ● ไทยมาร์ท ● Duoke ] · รายละเอียดอยู่ใน tooltip · ชิปยาวเดิมซ่อนเมื่อกลุ่มทำงาน */
.cp .hdr .sub.st-on #oaChip, .cp .hdr .sub.st-on .cx-tmchip { display: none !important; }
.stgrp { display: inline-flex; align-items: center; gap: 2px; flex-wrap: nowrap; max-width: 100%; min-width: 0; padding: 2px 4px 2px 8px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: var(--fs-xs); line-height: 1.5; white-space: nowrap; overflow: hidden; }
.stgrp .stl { font-weight: 700; color: var(--text-3); margin-right: 4px; }
.stgrp .stc { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-weight: 600; color: var(--text-2); cursor: default; }
.stgrp .stc:hover, .stgrp .stc:focus { background: var(--surface-2); outline: none; }
.stgrp .stc .dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; flex: none; }
.stgrp .stc.ok .dot { background: #16a34a; }
.stgrp .stc.stale .dot { background: #f59e0b; }
.stgrp .stc.down .dot { background: #dc2626; }
.stgrp .stc.down { color: var(--danger-text, #b91c1c); }
/* วิดีโอในฟอง (ไทยมาร์ท · Mai 20 ต.ค. 69) */
.cx-vid { display: block; max-width: 280px; max-height: 360px; border-radius: 8px; background: #000; }
