/* ===== กล่องข้อความจากทีมงาน (js/70-support-chat.js) — ปุ่มลอยซ้ายล่าง (เหนือแถวปุ่มเสียง/วิทยุ/คู่มือ #aiSndBtn #rdoBtn #gdBtn) + แผงแชท ===== */
.spc-fab{position:fixed;left:12px;bottom:calc(66px + env(safe-area-inset-bottom,0px));z-index:8600;display:inline-flex;align-items:center;gap:8px;height:48px;padding:0 18px 0 14px;border-radius:999px;border:1px solid rgba(255,255,255,.16);background:#1c1714;color:#f3ebe1;font:inherit;font-size:14px;font-weight:700;cursor:pointer;box-shadow:0 10px 28px rgba(0,0,0,.45);transition:transform .15s,background .15s}
.spc-fab[hidden]{display:none}
.spc-fab:hover{transform:translateY(-2px)}
.spc-fab:focus-visible{outline:3px solid #f59a23;outline-offset:3px}
.spc-fab svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.spc-fab.has{background:#f59a23;color:#1a1009;border-color:transparent}
.spc-fab.on{background:#2a221c;color:#f3ebe1}
.spc-dot{position:absolute;top:-5px;right:-5px;min-width:20px;height:20px;padding:0 5px;border-radius:99px;background:#e5322d;color:#fff;font-size:11.5px;line-height:20px;text-align:center;box-shadow:0 0 0 2px #0e0b09}
.spc-dot[hidden]{display:none}
.spc-p{position:fixed;left:12px;bottom:calc(124px + env(safe-area-inset-bottom,0px));z-index:8601;display:flex;flex-direction:column;width:min(370px,calc(100vw - 36px));height:min(520px,calc(100vh - 120px));border-radius:18px;overflow:hidden;background:#17120f;border:1px solid rgba(255,255,255,.12);box-shadow:0 24px 60px rgba(0,0,0,.6);color:#f3ebe1}
.spc-p[hidden]{display:none}
.spc-h{display:flex;align-items:center;gap:8px;padding:12px 12px 12px 16px;border-bottom:1px solid rgba(255,255,255,.08)}
.spc-h b{flex:1;min-width:0;font-size:15.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.spc-h button{flex:none;width:34px;height:34px;border-radius:50%;border:0;background:rgba(255,255,255,.07);color:inherit;font-size:20px;line-height:1;cursor:pointer}
.spc-h button:hover{background:rgba(255,255,255,.14)}
.spc-l{flex:1;overflow:auto;padding:6px}
.spc-it{display:flex;flex-direction:column;gap:4px;width:100%;padding:11px 12px;border:0;border-radius:12px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
.spc-it:hover,.spc-it:focus-visible{background:rgba(255,255,255,.06);outline:0}
.spc-r1{display:flex;justify-content:space-between;gap:8px}
.spc-r1 b{font-size:14px}
.spc-r1 small{flex:none;font-size:11.5px;color:#a99c8d}
.spc-r2{font-size:13px;color:#cdbfae;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.spc-r3{display:flex;gap:6px}
.spc-r3 i{font-style:normal;font-size:11px;font-weight:700;padding:2px 8px;border-radius:99px;background:rgba(255,255,255,.08);color:#cdbfae}
.spc-st.in_progress{background:rgba(245,154,35,.16);color:#f5b041}
.spc-st.done{background:rgba(76,211,131,.14);color:#4cd383}
.spc-r3 .spc-n{background:#e5322d;color:#fff}
.spc-log{flex:1;overflow:auto;display:flex;flex-direction:column;gap:8px;padding:14px}
.spc-b{max-width:82%;padding:9px 12px;border-radius:16px;font-size:14px;line-height:1.5}
.spc-b div{white-space:pre-wrap;word-break:break-word}
.spc-b small{display:block;margin-top:3px;font-size:11px;opacity:.65}
.spc-b.me{align-self:flex-end;background:#f59a23;color:#1a1009;border-bottom-right-radius:5px}
.spc-b.them{align-self:flex-start;background:#2a221c;border:1px solid rgba(255,255,255,.08);border-bottom-left-radius:5px}
.spc-wait{margin:4px auto 0;font-size:12.5px;color:#a99c8d;text-align:center}
.spc-in{display:flex;gap:8px;align-items:flex-end;padding:10px;border-top:1px solid rgba(255,255,255,.08)}
.spc-in textarea{flex:1;min-height:42px;max-height:120px;margin:0;padding:10px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.14);background:#0e0b09;color:inherit;font:inherit;font-size:14px;resize:none}
.spc-in textarea:focus{outline:0;border-color:#f59a23}
.spc-go{flex:none;height:42px;padding:0 16px;border-radius:12px;border:0;background:#f59a23;color:#1a1009;font:inherit;font-weight:800;cursor:pointer}
.spc-er{margin:0;padding:0 12px 8px;font-size:12.5px;color:#ff8a80}
.spc-er:empty{display:none}
@media (max-width:640px){
  .spc-fab{left:12px;bottom:calc(76px + env(safe-area-inset-bottom,0px));height:44px;padding:0 12px}
  .spc-fab .spc-fl{display:none}
  .spc-p{left:8px;right:8px;width:auto;bottom:calc(128px + env(safe-area-inset-bottom,0px));height:min(70vh,520px)}
}
@media (prefers-reduced-motion:reduce){.spc-fab{transition:none}}
/* โหมดกลางวัน */
html.day .spc-fab:not(.has){background:#fff;color:#2a2018;border-color:rgba(0,0,0,.12);box-shadow:0 8px 22px rgba(0,0,0,.15)}
html.day .spc-p{background:#fff;color:#2a2018;border-color:rgba(0,0,0,.1);box-shadow:0 20px 50px rgba(0,0,0,.2)}
html.day .spc-h,html.day .spc-in{border-color:rgba(0,0,0,.08)}
html.day .spc-h button{background:rgba(0,0,0,.05)}
html.day .spc-it:hover{background:rgba(0,0,0,.04)}
html.day .spc-r2{color:#5a4d42}
html.day .spc-r1 small,html.day .spc-wait{color:#8a7d70}
html.day .spc-r3 i{background:rgba(0,0,0,.06);color:#5a4d42}
html.day .spc-b.them{background:#f3efe9;border-color:rgba(0,0,0,.06)}
html.day .spc-in textarea{background:#faf8f5;border-color:rgba(0,0,0,.14)}
