/* ===== รอบ 97: จอฝั่งลูกค้า /d/{token} (cd-) — สว่างเสมอ เต็มจอ ตัวใหญ่ · ไม่มีชื่อลูกค้า/ต้นทุน ===== */
.cd { min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font); }
.cd-screen { min-height: 100vh; display: flex; flex-direction: column; }
.cd-screen .cd-cart { display: none; }
.cd-screen.is-selling .cd-cart, .cd-screen.is-paid .cd-cart { display: flex; }
.cd-screen.is-selling .cd-idle, .cd-screen.is-paid .cd-idle { display: none; }
.cd-idle { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 32px 16px; text-align: center; }
.cd-logo { width: 120px; height: 120px; border-radius: 24px; object-fit: cover; background: var(--surface); box-shadow: var(--shadow); }
.cd-shop { margin: 0; font-size: clamp(1.8rem, 5vw, 3.6rem); font-weight: 800; color: var(--brand-strong); overflow-wrap: anywhere; }
.cd-welcome { margin: 0; font-size: clamp(1rem, 2.4vw, 1.6rem); color: var(--muted); }
.cd-cart { flex: 1 1 auto; flex-direction: column; min-height: 0; }
.cd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; background: var(--brand); color: var(--brand-ink); }
.cd-head strong { font-size: clamp(1.1rem, 2.6vw, 1.8rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cd-cur { font-weight: 700; opacity: .9; flex: none; }
.cd-lines { list-style: none; margin: 0; padding: 8px 24px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.cd-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: clamp(1rem, 2.4vw, 1.6rem); }
.cd-name { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.cd-qty { color: var(--muted); white-space: nowrap; }
.cd-amt { font-weight: 700; white-space: nowrap; text-align: right; }
.cd-more { margin: 0; padding: 4px 24px; color: var(--muted); font-size: .95rem; }
.cd-more[hidden] { display: none; }
.cd-sum { padding: 12px 24px 18px; background: var(--surface); border-top: 2px solid var(--line); }
.cd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: clamp(1rem, 2.2vw, 1.5rem); padding: 4px 0; }
.cd-row[hidden] { display: none; }
.cd-total { font-size: clamp(1.5rem, 4.4vw, 3.2rem); }
.cd-total strong { color: var(--brand-strong); }
.cd-change strong { color: var(--ok); font-size: clamp(1.4rem, 3.6vw, 2.6rem); }
.cd-thanks { margin: 0; padding: 12px 24px; text-align: center; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: clamp(1.2rem, 3vw, 2rem); }
.cd-thanks[hidden] { display: none; }
.cd-closed { max-width: 560px; margin: 0 auto; padding: 80px 16px; text-align: center; }
.cd-closed h1 { font-size: 1.6rem; margin: 0 0 8px; }
@media (max-width: 760px) {
  .cd-head, .cd-sum { padding-left: 16px; padding-right: 16px; }
  .cd-lines { padding-left: 16px; padding-right: 16px; }
  .cd-lines li { grid-template-columns: minmax(0, 1fr) auto; }
  .cd-lines .cd-qty { grid-column: 1; grid-row: 2; font-size: .9em; }
  .cd-lines .cd-amt { grid-column: 2; grid-row: 1 / span 2; }
}

/* ===== รอบ 97: ราคาแยกสาขา (ฟอร์มสินค้า) · PIN อนุมัติ · คอร์ส · ตั้งค่าจอลูกค้า (r97-) ===== */
.r97-bp { display: flex; flex-direction: column; gap: 10px; }
.r97-bp-branch { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.r97-bp-branch.off { background: var(--chip); }
.r97-bp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.r97-bp-head strong { min-width: 0; overflow-wrap: anywhere; }
.r97-bp-off { margin: 0; }
.r97-bp-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.r97-bp-units .field { margin: 0; min-width: 0; }
.r97-off-badge { background: var(--danger-soft); color: var(--danger); }
.r97-course-field select { max-width: 260px; }
.r97-course-sel { font: inherit; font-size: .85rem; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 100%; }
.r97-course-tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); white-space: nowrap; vertical-align: middle; }
.r97-held { opacity: .85; }
.r97-held .rt-line-name { font-style: italic; }
.r97-call-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 10px; list-style: none; }
.r97-held-pill { background: var(--warn-soft); color: var(--warn-text, #7a5300); }
.r97-ap { min-width: 0; }
.r97-ap-who { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.r97-ap-dots { display: flex; justify-content: center; gap: 12px; padding: 6px 0; }
.r97-ap-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.r97-ap-dot.on { background: var(--ink); border-color: var(--ink); }
.r97-ap-pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 320px; width: 100%; margin: 0 auto; }
.r97-ap-key { font: inherit; font-size: 1.4rem; font-weight: 700; padding: 12px 0; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.r97-ap-key:disabled { opacity: .45; cursor: default; }
.r97-pin-card .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.r97-cd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.r97-cd-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.r97-cd-list li.is-off { opacity: .6; }
.r97-cd-name { min-width: 0; overflow-wrap: anywhere; }
.r97-cd-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.r97-cd-new { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.r97-pos-cd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; max-width: 100%; min-width: 0; }
.r97-pos-cd select { font: inherit; font-size: .85rem; padding: 3px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 160px; }
@media (max-width: 760px) {
  .r97-cd-new { grid-template-columns: 1fr; }
}
