/* M5 lane F · ของค้างจาก M4 + UI redesign (docs/reviews/UI-REDESIGN.md §6 F-4 F-5 F-8 F-9 · §7)
   สีจาก token ของชุดสีเท่านั้น (DESIGN-TOKENS.md §2) · ตัวอักษร ≥ 12px · ระยะ 4/8 · เป้ากด ≥ 24px (WCAG 2.5.8)
   โหลดหลัง screens-modules.css (components/shell.html) */

/* ───────── คิวงาน: แถบทำกับหลายเคส · ป็อปโอเวอร์จ่ายงานรายแถว · เป้ากด ≥ 24px · เรียง · ส่งออก ───────── */

.cs-bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 12px;
  background: var(--surf2); border: 1px solid var(--line); border-radius: var(--r-md, 10px); font-size: 13px; color: var(--ink2); }
.cs-bulkbar select { height: 32px; max-width: 18rem; padding: 0 8px; border: 1px solid var(--input); border-radius: var(--r-sm, 7px);
  background: var(--surf); color: var(--ink); font: inherit; font-size: 13px; }
.cs-bulkbar .btn .ci { width: 16px; height: 16px; }
.cs-bulk-count { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; margin-right: 4px; }
.cs-bulk-count output { min-width: 16px; font-weight: 600; color: var(--ink); }
.cs-bulk-more { position: relative; }
.cs-bulk-more > summary { list-style: none; cursor: pointer; }
.cs-bulk-more > summary::-webkit-details-marker { display: none; }
.cs-bulk-more-p { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; display: grid; gap: 8px; min-width: 18rem; padding: 12px;
  background: var(--surf); border: 1px solid var(--line); border-radius: var(--r-md, 10px); box-shadow: var(--shadow-2, 0 4px 12px var(--line)); }
.cs-bulk-more-p label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.cs-bulk-more-p .btn { justify-self: start; }
.cs-bulk-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cs-bulk-notice .btn .ci { width: 16px; height: 16px; }

/* เป้ากด: ช่องเลือกและเลขเคสอย่างน้อย 24×24 (ผลตรวจ probe tapTargets.tooSmall · F-5) */
.cs-hit { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; margin: 0; cursor: pointer; }
.cs-tbl .cb input { inline-size: 18px; block-size: 18px; }
.cs-tbl a.cs-no { display: inline-flex; align-items: center; min-height: 24px; padding-block: 2px; }

/* ผู้รับผิดชอบ: ชื่อ (ต้นแบบ) + ปุ่มเล็กเปิดป็อปโอเวอร์จ่ายงาน (ไม่มี select ทุกแถว · F-4) */
.cs-tbl td.asg { width: 1%; white-space: nowrap; position: relative; }
.cs-tbl td.asg .who { display: inline-flex; vertical-align: middle; }
.cs-asg-pop { display: inline-block; vertical-align: middle; margin-left: 4px; }
.cs-asg-btn { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border: 1px solid var(--input); border-radius: var(--r-sm, 7px); color: var(--muted); cursor: pointer; background: var(--surf); }
.cs-asg-btn::-webkit-details-marker { display: none; }
.cs-asg-btn .ci { width: 14px; height: 14px; transform: rotate(90deg); }
.cs-asg-pop[open] > .cs-asg-btn { color: var(--fg); border-color: var(--fg); }
.cs-asg-pop[open] > .cs-asg-btn .ci { transform: rotate(-90deg); }
.cs-asg-pop .cs-inline-assign { position: absolute; z-index: 15; right: 8px; top: calc(100% - 4px); padding: 8px; gap: 8px;
  background: var(--surf); border: 1px solid var(--line); border-radius: var(--r-md, 10px); box-shadow: var(--shadow-2, 0 4px 12px var(--line)); }
.cs-asg-pop .cs-inline-assign select { width: 14rem; max-width: 14rem; height: 32px; border-color: var(--input); background: var(--surf); }

/* เรียง (ต้นแบบ: "เรียง [SLA ใกล้หมดก่อน]" ชิดขวาของแถบตัวกรอง) */
.cs-sort { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--muted); }
.cs-sort select { height: 32px; padding: 0 8px; border: 1px solid var(--input); border-radius: var(--r-sm, 7px); background: var(--surf);
  color: var(--ink); font: inherit; font-size: 13px; }

@media (max-width: 900px) {
  .cs-sort { margin-left: 0; }
  .cs-asg-pop .cs-inline-assign { right: auto; left: 0; }
}

/* ───────── หัวเคส: จำนวนครั้งที่หยุดนับ (ต้นแบบ case-*.png "⊘ 1 ครั้ง") ───────── */
.clock-pausetotal .tag-count { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; font-size: 12px; color: var(--vendor-fg); }
.clock-pausetotal .tag-count .ci { width: 13px; height: 13px; }

/* ───────── แดชบอร์ด: การ์ดความพร้อมรับการตรวจ ISO (ต้นแบบ dash-*.png) ───────── */
.db-ready .db-meter b { font-size: 28px; }
.db-ready .db-meter .muted { margin-left: 4px; font-size: 12.5px; }
.db-ready-l li { grid-template-columns: 11rem minmax(0, 1fr) 2.5rem; }
.db-ready-l .rd-soon progress { color: var(--p2); }
.db-ready-l .rd-miss progress { color: var(--p1); }

/* ───────── ตัวออกแบบ workflow: ซูมผัง (ต้นแบบ designer-*.png "− 100% +") ───────── */
.wf-zoom { position: sticky; top: 8px; left: 8px; z-index: 3; float: left; display: inline-flex; align-items: center; gap: 4px; margin: 0 8px 8px 0;
  padding: 4px; background: var(--surf); border: 1px solid var(--line); border-radius: var(--r-md, 10px); box-shadow: var(--shadow-1, 0 1px 2px var(--line)); }
.wf-zoom[hidden] { display: none; }
.wf-zoom-b { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 4px; border: 0;
  border-radius: var(--r-sm, 7px); background: transparent; color: var(--ink2); font: inherit; font-size: 12.5px; cursor: pointer; }
.wf-zoom-b:hover { background: var(--sel); }
.wf-zoom-b:disabled { color: var(--muted); cursor: default; background: transparent; }
.wf-zoom-b .ci { width: 16px; height: 16px; }
.wf-zoom-v { min-width: 44px; text-align: center; font-size: 12.5px; color: var(--ink); }
.wf-z-50 .wf-svg { zoom: .5; }
.wf-z-75 .wf-svg { zoom: .75; }
.wf-z-125 .wf-svg { zoom: 1.25; }
.wf-z-150 .wf-svg { zoom: 1.5; }

/* ───────── จอแคบ: แถบเดโมบรรทัดเดียว · เมนูบนพับหลังปุ่ม · รางไอคอนไปท้ายหน้า · ตารางเป็นการ์ด (UI-REDESIGN F-8 · F-9) ───────── */
.demo-more { display: none; }
@media (max-width: 900px) {
  html[data-js] .demo-banner { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 4px 12px; }
  html[data-js] .demo-banner:not(.is-open) .demo-d { display: none; }
  html[data-js] .demo-more { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border: 1px solid currentColor;
    border-radius: var(--r-pill, 999px); background: transparent; color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
  html[data-js] .demo-banner.is-open .demo-d { flex: 1 1 100%; }
  /* layout ledger/board: เมนูหลักอยู่ในลิ้นชัก (shell.css · NAV-AUDIT) */
  /* layout command (ไม่มี JS): รางไอคอนไปท้ายหน้า (เหมือน workbench) · ปุ่ม "เมนู" บนแถบบนพาไป */
  .cm-shell { display: flex; flex-direction: column; }
  .cm-work { order: 1; }
  .cm-shell > .ir { order: 2; border-bottom: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  /* หน้าเคส: แถบปุ่มล่างแบบ fixed (screens-core .cs-actions) ต้องไม่บังรางไอคอนที่ย้ายมาท้ายหน้า */
  .cm-shell:has(.cs-actions) { padding-bottom: 88px; }
  /* ตารางงาน/เอกสารบนหน้าแรกและทะเบียนเอกสาร: หนึ่งแถว = การ์ด (เลขที่ + เรื่องเต็มบรรทัด · ช่องรองเป็น "ป้าย: ค่า") */
  .tbl-wrap:has(> .tbl-stack) { overflow: visible; }
  table.tbl-stack, table.tbl-stack tbody, table.tbl-stack tr, table.tbl-stack td { display: block; width: auto; }
  table.tbl-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  table.tbl-stack tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.tbl-stack td { padding: 2px 0; border: 0; white-space: normal; text-align: left; }
  table.tbl-stack td.st-main { font-weight: 600; color: var(--ink); line-height: 1.5; }
  table.tbl-stack td.st-main small { font-weight: 400; }
  table.tbl-stack td[data-label], table.tbl-stack td.num[data-label] { position: relative; padding-left: 40%; font-size: 13px; text-align: left; }
  table.tbl-stack td[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 2px; width: 38%; color: var(--muted); font-size: 12.5px; }
  table.tbl-stack td.st-act { padding-top: 8px; }
}
