#leiu-chat-open,#leiu-chat-panel{position:fixed;z-index:100000;right:max(20px,env(safe-area-inset-right));border:0;box-sizing:border-box}
#leiu-chat-open{bottom:max(20px,env(safe-area-inset-bottom));width:54px;height:54px;display:grid;place-items:center;border-radius:50%;background:#192631;color:white;padding:0;cursor:pointer;box-shadow:0 3px 16px #17233230}
#leiu-chat-open:focus-visible{outline:3px solid #447eb2;outline-offset:4px}
#leiu-chat-panel{bottom:86px;width:min(376px,calc(100vw - 36px));height:min(540px,calc(100dvh - 110px));border-radius:20px;background:#fff;box-shadow:0 10px 44px #18232d30;opacity:0;transform:translateY(10px) scale(.98);transform-origin:bottom right;pointer-events:none;transition:opacity .16s,transform .18s}
#leiu-chat-panel.is-open{opacity:1;transform:none;pointer-events:auto}
#leiu-chat-panel.wide{width:min(720px,calc(100vw - 40px))}
@media(max-width:520px),(pointer:coarse) and (max-width:960px){
html.leiu-chat-open,html.leiu-chat-open body{overflow:hidden;overscroll-behavior:none;background:#fff}
/* Safari shows the layout viewport behind its translucent keyboard accessory bar.
   Keep that area opaque while the iframe fits the smaller visual viewport. */
html.leiu-chat-open body::after {
  content: ""; position: fixed; inset: 0; min-height: 100lvh;
  z-index: 2147483646; background: #fff;
}
html.leiu-chat-open #leiu-chat-panel { z-index: 2147483647; }
#leiu-chat-open[data-panel-visible]{visibility:hidden}#leiu-chat-panel,#leiu-chat-panel.wide{inset:var(--chat-visible-top,0px) auto auto var(--chat-visible-left,0px);width:var(--chat-visible-width,100%);height:var(--chat-visible-height,100dvh);max-width:none;max-height:none;border-radius:0;transform:none}}
@media(prefers-reduced-motion:reduce){#leiu-chat-panel{transition:none;transform:none}}

#leiu-chat-panel:focus { outline:none; }
#leiu-chat-open[data-unread]::after { content:attr(data-unread);position:absolute;right:-3px;top:-4px;min-width:20px;height:20px;padding:0 4px;box-sizing:border-box;border-radius:10px;background:#286bb6;color:#fff;font:600 12px/20px system-ui;text-align:center }

#leiu-chat-feedback:not([hidden]) {
  position: fixed; z-index: 2147483647; bottom: 88px; right: 18px;
  max-width: min(310px, calc(100vw - 36px)); border-radius: 10px;
  padding: 14px 16px; background: #192631; color: white; font: 15px/1.45 system-ui;
}
#leiu-chat-feedback a { color: inherit; text-decoration: underline; }

#leiu-chat-open[aria-busy="true"] svg { display: none; }
#leiu-chat-open[aria-busy="true"]::before {
  content: ""; width: 20px; height: 20px; border: 2px solid #a5b9ca;
  border-top-color: white; border-radius: 50%; animation: leiu-chat-loading .85s linear infinite;
}
@keyframes leiu-chat-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #leiu-chat-open[aria-busy="true"]::before { animation: none; } }

/* Remove the store from rendering while retaining every form node and its state. */
html.leiu-mobile-chat-open, html.leiu-mobile-chat-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
  background: #fff !important;
}
html.leiu-mobile-chat-open body > :not(#leiu-mobile-chat) { display: none !important; }
#leiu-mobile-chat {
  position: absolute; inset: 0 auto auto 0; width: 100%; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  overflow: clip; border-radius: 0; box-shadow: none; background: white; color-scheme: light;
}
#leiu-mobile-chat::backdrop { background: white; }
#leiu-mobile-chat:not([open]) { display: none; }
#leiu-mobile-chat [data-chat-host] {
  width: 100%; height: 100%; overflow: clip; container-type: size;
}
