/* APD public help chat bubble. Loaded only when the host is enabled and the key is present.
   The legacy theme (css/normalize.css) sets [hidden]{display:none} without !important.
   A later display:flex on .apd-hc-panel would un-hide the empty panel on load. */
.apd-hc-btn,.apd-hc-panel{font-family:Ubuntu,system-ui,"Segoe UI",Roboto,sans-serif;box-sizing:border-box}
.apd-hc-btn *,.apd-hc-panel *{box-sizing:border-box}
.apd-hc-btn{position:fixed;right:20px;bottom:20px;right:max(20px,env(safe-area-inset-right,0px));bottom:max(20px,env(safe-area-inset-bottom,0px));z-index:10050;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:#0b6e4f;color:#fff;border:0;border-radius:999px;padding:12px 18px;font-size:14px;font-weight:600;cursor:pointer;box-shadow:0 8px 24px rgba(11,110,79,.28);line-height:1.2;max-width:calc(100vw - 24px);-webkit-tap-highlight-color:transparent}
.apd-hc-btn:hover,.apd-hc-btn:focus{background:#095c42;outline:none}
.apd-hc-btn:focus-visible{box-shadow:0 0 0 3px #fff,0 0 0 5px #0b6e4f}
/* Closed by default. Class + [hidden] both hide so theme CSS cannot un-hide an empty panel. */
.apd-hc-btn[hidden],
.apd-hc-panel[hidden],
.apd-hc-panel:not(.apd-hc-open){
  display:none !important;
}
.apd-hc-panel{
  position:fixed;right:20px;bottom:20px;z-index:10051;
  width:min(380px,calc(100vw - 24px));
  height:min(540px,calc(100vh - 32px));
  height:min(540px,calc(100dvh - 32px));
  max-height:calc(100vh - 16px);
  max-height:calc(100dvh - 16px);
  background:#fff;color:#14201b;
  border-radius:16px;box-shadow:0 18px 50px rgba(0,0,0,.22);
  flex-direction:column;overflow:hidden;border:1px solid #d7e0e9;
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.apd-hc-panel.apd-hc-open{display:flex !important;opacity:1;visibility:visible;transform:none}
.apd-hc-head{display:flex;align-items:center;justify-content:space-between;gap:8px;background:#0b6e4f;color:#fff;padding:12px 12px 12px 16px;flex:0 0 auto}
.apd-hc-head strong{font-size:15px;font-weight:700;color:#fff}
.apd-hc-head span{display:block;font-size:12px;font-weight:400;opacity:.9;margin-top:1px;color:#fff}
.apd-hc-x{background:transparent;border:0;color:#fff;font-size:22px;line-height:1;cursor:pointer;width:44px;height:44px;flex:0 0 44px;border-radius:8px;-webkit-tap-highlight-color:transparent}
.apd-hc-x:hover,.apd-hc-x:focus{background:rgba(255,255,255,.12);outline:none}
.apd-hc-list{flex:1 1 auto;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;padding:14px 14px 8px;display:flex;flex-direction:column;gap:10px;background:#f7f8f6;color:#14201b}
.apd-hc-msg{max-width:88%;padding:10px 12px;border-radius:14px;font-size:16px;line-height:1.45;white-space:pre-wrap;word-wrap:break-word}
.apd-hc-msg.user{align-self:flex-end;background:#0b6e4f;color:#fff;border-bottom-right-radius:4px}
.apd-hc-msg.bot{align-self:flex-start;background:#fff;color:#14201b;border:1px solid #d7e0e9;border-bottom-left-radius:4px}
.apd-hc-links{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 0}
.apd-hc-links a{display:inline-block;background:#e8f4ef;color:#0b6e4f;text-decoration:none;font-size:14px;font-weight:600;padding:6px 10px;border-radius:999px}
.apd-hc-links a:hover{background:#d5ece3}
.apd-hc-note{font-size:13px;color:#4a5c54;padding:0 14px 8px;flex:0 0 auto}
.apd-hc-note.err{color:#9a1f1f}
.apd-hc-form{display:flex;gap:8px;padding:10px 12px 12px;border-top:1px solid #d7e0e9;background:#fff;flex:0 0 auto;align-items:flex-end}
.apd-hc-form textarea,
.apd-hc-form input[type="text"],
.apd-hc-form input[type="tel"]{flex:1;resize:none;border:1px solid #c5d0c9;border-radius:10px;padding:10px 12px;font:inherit;font-size:16px;line-height:1.3;min-height:44px;color:#14201b;background:#fff;width:auto;max-width:100%;-webkit-text-size-adjust:100%}
.apd-hc-form button,
.apd-hc-cb button{background:#0b6e4f;color:#fff;border:0;border-radius:10px;padding:0 14px;min-height:44px;font-weight:700;cursor:pointer;flex:0 0 auto}
.apd-hc-form button:disabled{opacity:.55;cursor:default}
.apd-hc-hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
.apd-hc-human{margin:0 14px 8px;display:flex;flex-wrap:wrap;gap:8px;flex:0 0 auto}
.apd-hc-human button{background:#fff;color:#0b6e4f;border:1px solid #0b6e4f;border-radius:999px;padding:7px 12px;font-size:16px;font-weight:600;cursor:pointer}
.apd-hc-human button:hover{background:#e8f4ef}
.apd-hc-cb{padding:0 14px 10px;display:flex;flex-direction:column;gap:6px;flex:0 0 auto}
.apd-hc-cb label{font-size:14px;color:#14201b}
.apd-hc-cb input{font-size:16px;padding:10px 12px;border:1px solid #c5d0c9;border-radius:10px;min-height:44px;width:100%;color:#14201b;background:#fff}
.apd-hc-chips{display:flex;flex-wrap:nowrap;gap:8px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding:8px 14px;background:#f7f8f6;border-top:1px solid #edf1ee;flex:0 0 auto}
.apd-hc-chips::-webkit-scrollbar{display:none}
.apd-hc-chips button,.apd-hc-chips .apd-hc-chip{flex:0 0 auto;display:inline-flex;align-items:center;min-height:40px;padding:0 14px;border-radius:999px;border:1px solid #0b6e4f;background:#fff;color:#0b6e4f;font-size:15px;font-weight:600;line-height:1;white-space:nowrap;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.apd-hc-chips button:hover,.apd-hc-chips .apd-hc-chip:hover{background:#e8f4ef}
.apd-hc-links a.apd-hc-primary{background:#0b6e4f;color:#fff;font-size:15px;padding:10px 16px;min-height:40px;display:inline-flex;align-items:center}
.apd-hc-links a.apd-hc-primary:hover{background:#095c42}
/* Small screens: compact launcher; open as a full-width bottom sheet. */
@media (max-width:640px){
  .apd-hc-btn{right:max(12px,env(safe-area-inset-right,0px));bottom:max(12px,env(safe-area-inset-bottom,0px));padding:10px 14px;font-size:14px}
  .apd-hc-panel{
    left:0;right:0;bottom:0;top:auto;width:100%;max-width:none;
    height:100vh;height:100dvh;
    max-height:100vh;max-height:100dvh;
    border-radius:16px 16px 0 0;
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
}
/* Reduced motion must never leave the open panel invisible or mid-animation. */
@media (prefers-reduced-motion:reduce){
  .apd-hc-btn,.apd-hc-panel,.apd-hc-panel *{
    animation:none !important;
    transition:none !important;
  }
  .apd-hc-panel.apd-hc-open{
    opacity:1 !important;
    visibility:visible !important;
    transform:none !important;
  }
}
