/* แชตบอทช่วยเหลือ */
.hb{--hb:#2563eb;--hb2:#1d4ed8;font-family:'Noto Sans Thai',system-ui,sans-serif}
.hb-fab{position:fixed;right:22px;bottom:22px;z-index:150;width:64px;height:64px;border-radius:50% 50% 14px 50%;border:3px solid #fff;cursor:pointer;color:#fff;padding:0;
  background:radial-gradient(circle at 30% 25%,#7dd3fc,#38bdf8 45%,#2563eb);box-shadow:0 14px 30px -10px rgba(37,99,235,.75),0 0 0 1px rgba(37,99,235,.15);display:grid;place-items:center;transition:transform .2s}
.hb-fab:hover{transform:scale(1.07) rotate(-3deg)}
.hb-fab-ico{width:50px;height:50px;display:block;margin-top:4px;animation:hbBob 3.2s ease-in-out infinite;filter:drop-shadow(0 3px 3px rgba(15,23,42,.25))}
@keyframes hbBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
.hb-fab-dots{position:absolute;left:-10px;top:-8px;display:flex;gap:3px;align-items:center;padding:5px 7px;border-radius:12px 12px 12px 3px;background:#2563eb;border:2px solid #fff;box-shadow:0 4px 10px rgba(37,99,235,.35)}
.hb-fab-dots i{width:4px;height:4px;border-radius:50%;background:#fff;animation:hbDot 1.2s infinite}
.hb-fab-dots i:nth-child(2){animation-delay:.15s}.hb-fab-dots i:nth-child(3){animation-delay:.3s}
.hb-fab-on{position:absolute;right:2px;top:4px;width:12px;height:12px;border-radius:50%;background:#22c55e;border:2px solid #fff}
.hb.open .hb-fab-dots{display:none}
@media (prefers-reduced-motion:reduce){.hb-fab-ico,.hb-fab-dots i{animation:none}}
.hb-fab-tip{position:absolute;right:70px;white-space:nowrap;background:#0f172a;color:#fff;font-size:.8rem;font-weight:600;padding:6px 10px;border-radius:8px;opacity:0;pointer-events:none;transition:opacity .2s}
.hb-fab:hover .hb-fab-tip,.hb-fab:focus-visible .hb-fab-tip{opacity:1}
.hb.open .hb-fab-ico{transform:scale(.9)}
.hb-panel{position:fixed;right:22px;bottom:94px;z-index:151;width:min(380px,calc(100vw - 24px));height:min(600px,calc(100vh - 120px));display:flex;flex-direction:column;
  background:#fff;border-radius:20px;overflow:hidden;box-shadow:0 30px 70px -20px rgba(15,23,42,.45),0 0 0 1px rgba(15,23,42,.06);animation:hbIn .22s ease-out}
.hb-panel[hidden]{display:none}
@keyframes hbIn{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.hb-head{display:flex;align-items:center;gap:10px;padding:14px 14px 14px 16px;background:linear-gradient(135deg,var(--hb2),var(--hb) 60%,#0ea5e9);color:#fff}
.hb-head b{display:block;font-size:1rem}
.hb-head small{display:flex;align-items:center;gap:6px;font-size:.75rem;opacity:.9}
.hb-head small i{width:7px;height:7px;border-radius:99px;background:#4ade80;box-shadow:0 0 0 3px rgba(74,222,128,.3)}
.hb-ava{width:42px;height:42px;border-radius:50%;background:radial-gradient(circle at 30% 25%,#e0f2fe,#bae6fd);border:2px solid rgba(255,255,255,.85);display:grid;place-items:center;flex:none;box-shadow:0 4px 12px rgba(15,23,42,.2)}
.hb-ava img{width:32px;height:32px;display:block}
.hb-x{margin-left:auto;width:34px;height:34px;border-radius:99px;border:0;background:rgba(255,255,255,.15);color:#fff;cursor:pointer;font-size:.95rem}
.hb-x:hover{background:rgba(255,255,255,.28)}
.hb-body{flex:1;overflow-y:auto;padding:14px;background:#f8fafc;display:flex;flex-direction:column;gap:10px;scroll-behavior:smooth}
.hb-msg{max-width:88%;padding:10px 13px;border-radius:16px;font-size:.92rem;line-height:1.6}
.hb-msg.bot{align-self:flex-start;background:#fff;border:1px solid #e2e8f0;border-bottom-left-radius:6px;color:#0f172a}
.hb-msg.me{align-self:flex-end;background:var(--hb);color:#fff;border-bottom-right-radius:6px}
.hb-txt{white-space:pre-line;overflow-wrap:anywhere}
.hb-link{display:inline-block;margin-top:8px;padding:6px 12px;border-radius:99px;background:#eff6ff;color:var(--hb2)!important;font-weight:700;font-size:.85rem;text-decoration:none!important}
.hb-link:hover{background:#dbeafe}
.hb-chips{display:flex;flex-wrap:wrap;gap:6px}
.hb-chip{font:inherit;font-size:.82rem;cursor:pointer;padding:6px 12px;border-radius:99px;border:1px solid #bfdbfe;background:#fff;color:var(--hb2);text-align:left}
.hb-chip:hover{background:#eff6ff}
.hb-rel{margin-top:8px;display:flex;flex-wrap:wrap;gap:5px}
.hb-rel small,.hb-fb small{width:100%;color:#64748b;font-size:.75rem}
.hb-fb{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin-top:8px;border-top:1px dashed #e2e8f0;padding-top:6px}
.hb-fb small{width:auto;margin-right:4px}
.hb-fb button{border:1px solid #e2e8f0;background:#fff;border-radius:99px;cursor:pointer;padding:2px 9px;font-size:.85rem}
.hb-fb button:hover{background:#f1f5f9}
.hb-typing{display:flex;gap:4px;padding:13px 14px}
.hb-typing span{width:7px;height:7px;border-radius:99px;background:#94a3b8;animation:hbDot 1s infinite}
.hb-typing span:nth-child(2){animation-delay:.15s}.hb-typing span:nth-child(3){animation-delay:.3s}
@keyframes hbDot{0%,60%,100%{transform:none;opacity:.5}30%{transform:translateY(-4px);opacity:1}}
.hb-form{display:flex;gap:8px;padding:10px;border-top:1px solid #e2e8f0;background:#fff}
.hb-in{flex:1;min-width:0;font:inherit;font-size:.95rem;border:1px solid #cbd5e1;border-radius:12px;padding:10px 12px;outline:0}
.hb-in:focus{border-color:var(--hb);box-shadow:0 0 0 3px rgba(37,99,235,.15)}
.hb-send{width:44px;border:0;border-radius:12px;background:var(--hb);color:#fff;font-size:1.05rem;cursor:pointer}
.hb-send:hover{background:var(--hb2)}
.hb-foot{font-size:.74rem;color:#64748b;text-align:center;padding:0 10px 10px;background:#fff}
/* ไม่ให้ทับป๊อปอัปออเดอร์ใหม่ / แถบเมนูล่างมือถือ */
body.has-hb .oa-pop-box{bottom:96px}
@media(max-width:860px){
  body.has-hb.dash-body .hb-fab{bottom:76px}
  body.has-hb.dash-body .hb-panel{bottom:142px}
  body.has-hb .oa-pop-box{bottom:146px}
}
@media(max-width:520px){
  .hb-fab{right:14px;width:58px;height:58px}
  .hb-fab-ico{width:46px;height:46px}
  .hb-panel{right:8px;left:8px;width:auto;bottom:8px!important;height:calc(100vh - 16px);height:calc(100dvh - 16px);border-radius:18px;z-index:200}
  .hb-fab-tip{display:none}
}
@media print{.hb{display:none!important}}
