/* CS Chat widget (member site). Ported 1:1 from the "laravel" project's
   cs-chatbot-widget.ejs inline styles. Per-site appearance arrives as CSS
   custom properties on .csbot-root (set by the EJS partial from the agent's
   widget settings): --csbot-color, --csbot-fab, --csbot-panel-w,
   --csbot-fab-radius. Every rule is anchored on #csbotRoot (id specificity) so template-wide
   rules such as `.wap-theme-new button{width:100%}` cannot restyle the widget,
   and the widget cannot leak into the page. */
/* Neutralize template-wide form-control rules (width, min-height, borders,
   gradients, text-transform) before the widget's own rules apply. */
#csbotRoot button,#csbotRoot input{width:auto;min-width:0;min-height:0;max-width:none;margin:0;box-shadow:none;text-transform:none;letter-spacing:normal;font-family:inherit;background-image:none;line-height:normal;height:auto;float:none}
#csbotRoot{--csbot-bottom:18px;font-family:inherit}
#csbotRoot.csbot-mobile{--csbot-bottom:var(--csbot-mobile-bottom,65px)}
#csbotRoot *{box-sizing:border-box}
#csbotRoot .csbot-fab{position:fixed;bottom:var(--csbot-bottom);z-index:99998;width:var(--csbot-fab);height:var(--csbot-fab);border:0;border-radius:var(--csbot-fab-radius);
  background:var(--csbot-color);color:#fff;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.28);display:flex;align-items:center;justify-content:center;padding:0;margin:0}
#csbotRoot .csbot-fab:hover{filter:brightness(1.08)}
#csbotRoot .csbot-fab svg{width:calc(var(--csbot-fab) * .46);height:calc(var(--csbot-fab) * .46)}
#csbotRoot.csbot-right .csbot-fab,#csbotRoot.csbot-right .csbot-panel{right:18px}
#csbotRoot.csbot-left .csbot-fab,#csbotRoot.csbot-left .csbot-panel{left:18px}
#csbotRoot .csbot-panel{position:fixed;bottom:calc(var(--csbot-bottom) + var(--csbot-fab) + 10px);z-index:99999;width:var(--csbot-panel-w);max-width:calc(100vw - 36px);height:480px;max-height:calc(100vh - 120px);
  background:#fff;color:#1b1f24;border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,.3);display:none;flex-direction:column;overflow:hidden;font-size:14px;line-height:normal;text-align:left}
#csbotRoot .csbot-panel.csbot-open{display:flex}
#csbotRoot .csbot-panel.csbot-full{position:fixed;top:0;left:0;right:0;bottom:0;width:100vw;max-width:100vw;height:100vh;max-height:100vh;border-radius:0;z-index:100000}
#csbotRoot .csbot-expand{background:transparent;border:0;color:#fff;font-size:15px;cursor:pointer;line-height:1;padding:0 2px}
#csbotRoot .csbot-full .csbot-msg{max-width:680px}
#csbotRoot .csbot-head{background:var(--csbot-color);color:#fff;padding:12px 14px;font-weight:600;display:flex;justify-content:space-between;align-items:center}
#csbotRoot .csbot-head small{font-weight:400;opacity:.85;display:block;font-size:11px}
#csbotRoot .csbot-close{background:transparent;border:0;color:#fff;font-size:20px;cursor:pointer;line-height:1;padding:0}
#csbotRoot .csbot-done{background:rgba(255,255,255,.18);border:0;color:#fff;font-size:11px;cursor:pointer;border-radius:10px;padding:3px 9px;line-height:1.4}
#csbotRoot .csbot-done:hover{background:rgba(255,255,255,.32)}
#csbotRoot .csbot-head-actions{display:flex;align-items:center;gap:8px}
#csbotRoot .csbot-qa-bar{display:flex;gap:6px;padding:8px 10px;overflow-x:auto;border-bottom:1px solid #eee;background:#fff}
#csbotRoot .csbot-qa{flex:0 0 auto;font-size:12px;text-decoration:none;padding:5px 10px;border:1px solid var(--csbot-color);color:var(--csbot-color);border-radius:14px;white-space:nowrap}
#csbotRoot .csbot-qa:hover{background:var(--csbot-color);color:#fff}
#csbotRoot .csbot-body{flex:1;overflow-y:auto;padding:12px;background:#f3f4f6;display:flex;flex-direction:column;gap:8px}
#csbotRoot .csbot-msg{max-width:82%;padding:8px 11px;border-radius:12px;line-height:1.4;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere}
#csbotRoot .csbot-bot{align-self:flex-start;background:#fff;color:#1b1f24;border:1px solid #e3e6ea;border-bottom-left-radius:4px}
#csbotRoot .csbot-user{align-self:flex-end;background:var(--csbot-color);color:#fff;border-bottom-right-radius:4px}
#csbotRoot .csbot-note{align-self:center;font-size:11px;color:#6b7280;background:transparent;padding:2px;text-align:center}
#csbotRoot .csbot-foot{display:flex;gap:6px;padding:10px;border-top:1px solid #e5e7eb;background:#fff}
#csbotRoot .csbot-input{flex:1;min-width:0;border:1px solid #d1d5db;border-radius:10px;padding:9px 11px;font-size:14px;outline:none;background:#fff;color:#1b1f24;height:auto;margin:0}
#csbotRoot .csbot-input:focus{border-color:var(--csbot-color)}
#csbotRoot .csbot-send{border:0;background:var(--csbot-color);color:#fff;border-radius:10px;padding:0 14px;cursor:pointer;font-weight:600}
#csbotRoot .csbot-send:disabled{opacity:.5;cursor:default}
#csbotRoot .csbot-attach{border:1px solid #d1d5db;background:#fff;border-radius:10px;padding:0 10px;cursor:pointer;font-size:17px;line-height:1}
#csbotRoot .csbot-attach:hover{background:#f3f4f6}
#csbotRoot .csbot-attach:disabled{opacity:.5;cursor:default}
#csbotRoot .csbot-media{max-width:100%;max-height:240px;border-radius:8px;display:block;cursor:pointer}
#csbotRoot .csbot-full .csbot-media{max-height:60vh}
#csbotRoot .csbot-typing{align-self:flex-start;color:#6b7280;font-size:12px;padding:2px 4px}
#csbotRoot .csbot-link{display:inline-block;margin-top:5px;padding:5px 11px;border:1px solid var(--csbot-color);color:var(--csbot-color);border-radius:14px;text-decoration:none;font-size:13px}
#csbotRoot .csbot-link:hover{background:var(--csbot-color);color:#fff}
