/* PMH Menu Chatbot (ทดสอบ) — ทุก class ขึ้นต้นด้วย pmhbot- เพื่อไม่ชนกับธีมหลัก */
:root{--pmhbot-a:#0fa58f;--pmhbot-b:#1f6fe0;--pmhbot-ink:#1f2d3a;--pmhbot-mute:#6b7c8c;--pmhbot-bg:#f4f8fb}
#pmhbot-fab,#pmhbot-panel,#pmhbot-tip{font-family:Prompt,system-ui,sans-serif;box-sizing:border-box}
#pmhbot-panel *{box-sizing:border-box}

/* ปุ่มลอย */
#pmhbot-fab{position:fixed;right:22px;bottom:74px;z-index:9998;width:64px;height:64px;border-radius:50%;border:0;padding:0;cursor:pointer;
  background:linear-gradient(135deg,var(--pmhbot-a),var(--pmhbot-b));box-shadow:0 10px 28px rgba(31,111,224,.45);
  display:flex;align-items:center;justify-content:center;transition:transform .25s cubic-bezier(.34,1.56,.64,1)}
#pmhbot-fab:hover{transform:scale(1.1) rotate(-6deg)}
#pmhbot-fab svg{width:42px;height:42px}
#pmhbot-fab::before,#pmhbot-fab::after{content:"";position:absolute;inset:0;border-radius:50%;border:2px solid var(--pmhbot-a);animation:pmhbot-ring 2.4s infinite;pointer-events:none}
#pmhbot-fab::after{animation-delay:1.2s}
#pmhbot-fab.pmhbot-on::before,#pmhbot-fab.pmhbot-on::after{display:none}
@keyframes pmhbot-ring{0%{transform:scale(1);opacity:.7}100%{transform:scale(1.7);opacity:0}}
#pmhbot-fab .pmhbot-badge{position:absolute;top:-6px;left:-8px;background:#ff4d6d;color:#fff;font-size:10px;font-weight:500;padding:2px 7px;border-radius:10px;box-shadow:0 2px 6px rgba(0,0,0,.2)}
#pmhbot-fab .pmhbot-x{display:none;color:#fff;font-size:30px;line-height:1}
#pmhbot-fab.pmhbot-on svg{display:none}#pmhbot-fab.pmhbot-on .pmhbot-x{display:block}

/* ป้ายชวนคุย */
#pmhbot-tip{position:fixed;right:96px;bottom:84px;z-index:9997;background:#fff;color:var(--pmhbot-ink);padding:10px 30px 10px 14px;border-radius:14px 14px 4px 14px;
  box-shadow:0 8px 24px rgba(0,0,0,.15);font-size:14px;max-width:240px;opacity:0;transform:translateY(10px) scale(.95);transition:all .35s;pointer-events:none}
#pmhbot-tip.pmhbot-show{opacity:1;transform:none;pointer-events:auto;cursor:pointer}
#pmhbot-tip b{color:var(--pmhbot-b);font-weight:600}
#pmhbot-tip button{position:absolute;top:4px;right:6px;border:0;background:none;color:#9aa8b5;font-size:16px;cursor:pointer;line-height:1}

/* หน้าต่างแชท */
#pmhbot-panel{position:fixed;right:22px;bottom:150px;z-index:9999;width:390px;max-width:calc(100vw - 32px);height:600px;max-height:calc(100vh - 170px);
  background:#fff;border-radius:22px;box-shadow:0 24px 60px rgba(15,40,80,.3);display:flex;flex-direction:column;overflow:hidden;color:var(--pmhbot-ink);font-size:14px;
  opacity:0;visibility:hidden;transform:translateY(20px) scale(.96);transform-origin:bottom right;transition:opacity .25s,transform .25s,visibility .25s}
#pmhbot-panel.pmhbot-open{opacity:1;visibility:visible;transform:none}
.pmhbot-head{position:relative;background:linear-gradient(135deg,var(--pmhbot-a),var(--pmhbot-b));color:#fff;padding:16px 16px 18px;display:flex;align-items:center;gap:12px;overflow:hidden}
.pmhbot-head::after{content:"";position:absolute;right:-40px;top:-50px;width:160px;height:160px;border-radius:50%;background:rgba(255,255,255,.12)}
.pmhbot-av{position:relative;width:44px;height:44px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;flex:none}
.pmhbot-av svg{width:34px;height:34px}
.pmhbot-av::after{content:"";position:absolute;right:0;bottom:1px;width:11px;height:11px;border-radius:50%;background:#3ddc84;border:2px solid #fff}
.pmhbot-head b{display:block;font-weight:600;font-size:16px}
.pmhbot-head small{opacity:.9;font-size:12px}
.pmhbot-head .pmhbot-hbtn{position:relative;z-index:1;margin-left:auto;background:rgba(255,255,255,.18);border:0;color:#fff;width:32px;height:32px;border-radius:50%;cursor:pointer;font-size:15px}
.pmhbot-head .pmhbot-hbtn:hover{background:rgba(255,255,255,.3)}
.pmhbot-head .pmhbot-hbtn+.pmhbot-hbtn{margin-left:6px}

.pmhbot-body{flex:1;overflow-y:auto;padding:16px 14px;background:var(--pmhbot-bg);scroll-behavior:smooth}
.pmhbot-body::-webkit-scrollbar{width:6px}.pmhbot-body::-webkit-scrollbar-thumb{background:#cdd8e2;border-radius:3px}
.pmhbot-row{display:flex;gap:8px;align-items:flex-end;margin:8px 0;animation:pmhbot-pop .3s ease-out}
.pmhbot-row.pmhbot-me{justify-content:flex-end}
@keyframes pmhbot-pop{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.pmhbot-mini{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,var(--pmhbot-a),var(--pmhbot-b));flex:none;display:flex;align-items:center;justify-content:center}
.pmhbot-mini svg{width:22px;height:22px}
.pmhbot-msg{max-width:84%;padding:10px 14px;border-radius:18px;line-height:1.55;word-wrap:break-word}
.pmhbot-bot{background:#fff;border-bottom-left-radius:6px;box-shadow:0 2px 8px rgba(20,50,90,.07)}
.pmhbot-user{background:linear-gradient(135deg,var(--pmhbot-b),#3d8bff);color:#fff;border-bottom-right-radius:6px;box-shadow:0 4px 12px rgba(31,111,224,.3)}

/* การ์ดผลลัพธ์ */
.pmhbot-res{display:flex;align-items:center;gap:10px;margin:8px 0 0;padding:9px 10px;border-radius:12px;background:#f7fafd;border:1px solid #e3ebf3;color:var(--pmhbot-ink)!important;text-decoration:none!important;transition:all .18s}
a.pmhbot-res:hover{background:#fff;border-color:var(--pmhbot-b);transform:translateX(3px);box-shadow:0 4px 14px rgba(31,111,224,.15)}
.pmhbot-ico{width:34px;height:34px;border-radius:10px;flex:none;display:flex;align-items:center;justify-content:center;font-size:17px;background:#e7f1ff}
.pmhbot-txt{flex:1;min-width:0}
.pmhbot-txt b{display:block;font-weight:500;font-size:13.5px;line-height:1.35}
.pmhbot-txt span{display:block;font-size:11.5px;color:var(--pmhbot-mute);margin-top:1px;line-height:1.35}
.pmhbot-go{color:#9fb0c0;font-size:16px;flex:none}
a.pmhbot-res:hover .pmhbot-go{color:var(--pmhbot-b)}
.pmhbot-res.pmhbot-nolink{opacity:.6;cursor:default}
.pmhbot-tel{display:inline-block;margin-top:3px;padding:1px 8px;border-radius:8px;background:#e6f7f3;color:#0b7d6c!important;font-size:12px;font-weight:500}

/* ปุ่มลัด */
.pmhbot-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:10px 0 2px}
.pmhbot-tile{border:0;background:#fff;border-radius:14px;padding:10px 4px 8px;cursor:pointer;font-family:inherit;font-size:11.5px;color:var(--pmhbot-ink);
  box-shadow:0 2px 8px rgba(20,50,90,.07);transition:all .18s;display:flex;flex-direction:column;align-items:center;gap:4px;line-height:1.25}
.pmhbot-tile i{font-style:normal;font-size:22px}
.pmhbot-tile:hover{transform:translateY(-3px);box-shadow:0 8px 18px rgba(31,111,224,.18);color:var(--pmhbot-b)}
.pmhbot-chips{display:flex;gap:6px;padding:8px 12px;background:#fff;border-top:1px solid #edf2f7;overflow-x:auto;scrollbar-width:none}
.pmhbot-chips::-webkit-scrollbar{display:none}
.pmhbot-chip{flex:none;border:1px solid #d6e4f0;background:#fff;color:#2a5d9f;border-radius:16px;padding:5px 12px;font-size:12px;cursor:pointer;font-family:inherit;white-space:nowrap;transition:all .15s}
.pmhbot-chip:hover{background:var(--pmhbot-b);border-color:var(--pmhbot-b);color:#fff}

/* ช่องพิมพ์ + คำแนะนำสด */
.pmhbot-foot{position:relative;display:flex;gap:8px;padding:10px 12px 12px;background:#fff}
.pmhbot-foot input{flex:1;border:1.5px solid #dbe5ee;border-radius:24px;padding:10px 16px;font-family:inherit;font-size:14px;outline:none;background:var(--pmhbot-bg);transition:all .15s;min-width:0}
.pmhbot-foot input:focus{border-color:var(--pmhbot-b);background:#fff;box-shadow:0 0 0 4px rgba(31,111,224,.12)}
.pmhbot-send{border:0;background:linear-gradient(135deg,var(--pmhbot-a),var(--pmhbot-b));color:#fff;border-radius:50%;width:42px;height:42px;cursor:pointer;flex:none;display:flex;align-items:center;justify-content:center;transition:transform .15s}
.pmhbot-send:hover{transform:scale(1.08)}
.pmhbot-send svg{width:18px;height:18px}
.pmhbot-sug{position:absolute;left:12px;right:62px;bottom:100%;background:#fff;border-radius:14px;box-shadow:0 -6px 24px rgba(15,40,80,.15);overflow:hidden;display:none}
.pmhbot-sug.pmhbot-show{display:block}
.pmhbot-sug div{padding:9px 14px;cursor:pointer;font-size:13px;border-bottom:1px solid #f0f4f8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pmhbot-sug div:hover,.pmhbot-sug div.pmhbot-act{background:#eef5ff;color:var(--pmhbot-b)}
.pmhbot-sug small{color:var(--pmhbot-mute);margin-left:6px}
.pmhbot-credit{text-align:center;font-size:10.5px;color:#a3b1be;padding:0 0 8px;background:#fff}

.pmhbot-typing{display:flex;gap:4px;padding:14px 16px}
.pmhbot-typing span{width:7px;height:7px;border-radius:50%;background:#9fb3c8;animation:pmhbot-dot 1.1s infinite}
.pmhbot-typing span:nth-child(2){animation-delay:.15s}.pmhbot-typing span:nth-child(3){animation-delay:.3s}
@keyframes pmhbot-dot{0%,80%,100%{transform:translateY(0);opacity:.4}40%{transform:translateY(-5px);opacity:1}}

@media (max-width:480px){
  #pmhbot-panel{right:0;left:0;bottom:0;width:100%;max-width:100%;height:100%;max-height:100%;border-radius:0}
  #pmhbot-fab{bottom:20px;right:16px}#pmhbot-fab.pmhbot-on{display:none}
  #pmhbot-tip{right:88px;bottom:28px}
}
@media (prefers-reduced-motion:reduce){#pmhbot-fab::before,#pmhbot-fab::after{animation:none}.pmhbot-row{animation:none}}
.pmhbot-tile{position:relative}
.pmhbot-ext{position:absolute;top:5px;right:7px;font-size:10px;color:#9fb0c0}
.pmhbot-tile:hover .pmhbot-ext{color:var(--pmhbot-b)}
