/* P2E live chat widget. Every selector is prefixed .p2elc-; glass + gradient look matching the switch popup (no navy). */
.p2elc {
  --lc-bg: #131418;
  --lc-panel: rgba(27,28,34,.94);
  --lc-glass: rgba(255,255,255,.06);
  --lc-line: rgba(255,255,255,.09);
  --lc-text: #f4f4f5;
  --lc-muted: #a1a1aa;
  --lc-input: #121317;
  --lc-grad: linear-gradient(135deg, #7c5cff 0%, #c04cfd 55%, #ff7a59 100%);
  --lc-online: #4ade80;
  --lc-font: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--lc-font); color: var(--lc-text);
  position: fixed; right: 22px; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 2147483100;
}
.p2elc *, .p2elc *::before, .p2elc *::after { box-sizing: border-box; }
.p2elc :focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }

/* Launcher bubble */
.p2elc-launch {
  position: relative; width: 64px; height: 64px; border-radius: 22px; border: 0; cursor: pointer; padding: 0;
  background: var(--lc-grad); color: #fff; display: grid; place-items: center;
  box-shadow: 0 18px 44px rgba(150,70,255,.42), 0 2px 0 rgba(255,255,255,.25) inset;
  transition: transform .25s cubic-bezier(.2,.9,.25,1.3), border-radius .3s, box-shadow .2s;
  animation: p2elc-arrive .7s cubic-bezier(.2,.9,.25,1.35) both .6s;
}
.p2elc-launch:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 24px 54px rgba(150,70,255,.5), 0 2px 0 rgba(255,255,255,.25) inset; }
.p2elc-launch::before { content: ""; position: absolute; inset: -6px; border-radius: 27px; border: 2px solid rgba(192,76,253,.45); animation: p2elc-ring 2.8s ease-out infinite; }
.p2elc-launch svg { width: 28px; height: 28px; transition: transform .3s, opacity .2s; }
.p2elc-launch .ico-x { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.6); }
.p2elc.is-open .p2elc-launch { border-radius: 50%; }
.p2elc.is-open .p2elc-launch::before { display: none; }
.p2elc.is-open .p2elc-launch .ico-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.p2elc.is-open .p2elc-launch .ico-x { opacity: 1; transform: none; }
.p2elc-dot { position: absolute; right: -2px; top: -2px; width: 16px; height: 16px; border-radius: 99px; background: var(--lc-online); border: 3px solid #17181c; }
.p2elc-badge { position: absolute; left: -6px; top: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: #ff4d4f; color: #fff; font: 800 12px/22px var(--lc-font); text-align: center; border: 2px solid #17181c; transform: scale(0); transition: transform .3s cubic-bezier(.2,.9,.25,1.5); }
.p2elc-badge.is-on { transform: scale(1); }
@keyframes p2elc-arrive { from { opacity: 0; transform: translateY(30px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes p2elc-ring { 0% { opacity: .9; transform: scale(.92); } 70%, 100% { opacity: 0; transform: scale(1.22); } }

/* Teaser bubble */
.p2elc-teaser {
  position: absolute; right: 0; bottom: 80px; width: 300px;
  padding: 14px 16px 14px 14px; border-radius: 20px 20px 6px 20px;
  background: var(--lc-panel); border: 1px solid var(--lc-line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; cursor: pointer;
  opacity: 0; transform: translateY(12px) scale(.96); transform-origin: 100% 100%; visibility: hidden;
  transition: opacity .35s, transform .45s cubic-bezier(.2,.9,.25,1.3), visibility 0s linear .45s;
}
.p2elc-teaser.is-on { opacity: 1; transform: none; visibility: visible; transition: opacity .35s, transform .45s cubic-bezier(.2,.9,.25,1.3); }
.p2elc-teaser p { margin: 0; font-size: 14px; line-height: 1.45; }
.p2elc-teaser p b { display: block; font-size: 13px; color: #ddd6fe; margin-bottom: 2px; }
.p2elc-teaser-x { position: absolute; top: -10px; left: -10px; width: 26px; height: 26px; border-radius: 99px; border: 1px solid var(--lc-line); background: #24252c; color: var(--lc-muted); cursor: pointer; display: grid; place-items: center; font-size: 14px; line-height: 1; }
.p2elc-teaser-x:hover { color: var(--lc-text); }

/* Avatar */
.p2elc-av { position: relative; width: 40px; height: 40px; border-radius: 14px; background: var(--lc-grad); display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); overflow: hidden; }
.p2elc-av img { width: 100%; height: 100%; object-fit: cover; }
.p2elc-av.has-dot::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 99px; background: var(--lc-online); border: 2px solid #1b1c22; }

/* Panel */
.p2elc-panel {
  position: absolute; right: 0; bottom: 82px; width: 384px; height: min(640px, calc(100dvh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 26px; background: linear-gradient(180deg, rgba(30,31,38,.97), rgba(17,18,22,.98));
  border: 1px solid var(--lc-line);
  box-shadow: 0 40px 100px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  opacity: 0; visibility: hidden; transform: translateY(18px) scale(.94); transform-origin: 100% 100%;
  transition: opacity .3s, transform .45s cubic-bezier(.2,.9,.25,1.2), visibility 0s linear .45s;
}
.p2elc.is-open .p2elc-panel { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .45s cubic-bezier(.2,.9,.25,1.2); }

.p2elc-head { position: relative; padding: 20px 20px 18px; overflow: hidden; }
.p2elc-head::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 140% at 0% 0%, rgba(124,92,255,.45), transparent 55%), radial-gradient(90% 120% at 100% 0%, rgba(255,122,89,.28), transparent 60%); pointer-events: none; }
.p2elc-head-row { position: relative; display: flex; align-items: center; gap: 12px; }
.p2elc-head-title { flex: 1; min-width: 0; }
.p2elc-head-title b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.p2elc-head-title small { display: flex; align-items: center; gap: 6px; color: #d4d4d8; font-size: 12.5px; margin-top: 2px; }
.p2elc-head-title small i { width: 8px; height: 8px; border-radius: 99px; background: var(--lc-online); box-shadow: 0 0 10px var(--lc-online); }
.p2elc-head-title small.is-away i { background: #fbbf24; box-shadow: 0 0 10px #fbbf24; }
.p2elc-icon-btn { width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--lc-line); background: rgba(0,0,0,.2); color: var(--lc-text); cursor: pointer; display: grid; place-items: center; }
.p2elc-icon-btn:hover { background: rgba(255,255,255,.08); }
.p2elc-icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.p2elc-hello { position: relative; margin: 16px 0 0; font-size: 22px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.p2elc-hello em { font-style: normal; background: var(--lc-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.p2elc-body { flex: 1; overflow-y: auto; padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.p2elc-body::-webkit-scrollbar { width: 6px; } .p2elc-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; }
.p2elc-welcome { margin: 0 0 4px; color: #d4d4d8; font-size: 14px; line-height: 1.45; }
.p2elc-day { align-self: center; font-size: 11px; color: #71717a; letter-spacing: .08em; text-transform: uppercase; margin: 6px 0 2px; }
.p2elc-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; animation: p2elc-msg .35s cubic-bezier(.2,.9,.25,1.2) both; }
.p2elc-msg .p2elc-av { width: 28px; height: 28px; border-radius: 10px; font-size: 11px; }
.p2elc-bub { padding: 11px 14px; border-radius: 18px 18px 18px 6px; font-size: 14.5px; line-height: 1.45; background: var(--lc-glass); border: 1px solid var(--lc-line); white-space: pre-wrap; overflow-wrap: anywhere; }
.p2elc-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.p2elc-msg.me .p2elc-bub { background: var(--lc-grad); border-color: transparent; border-radius: 18px 18px 6px 18px; box-shadow: 0 8px 22px rgba(150,70,255,.25); }
.p2elc-meta { font-size: 10.5px; color: #71717a; margin: 2px 4px 0; }
.p2elc-msg.me + .p2elc-meta { align-self: flex-end; }
.p2elc-sys { align-self: center; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #c4b5fd; background: rgba(124,92,255,.12); border: 1px solid rgba(124,92,255,.25); padding: 7px 12px; border-radius: 999px; animation: p2elc-msg .35s ease both; }
.p2elc-sys svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes p2elc-msg { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

.p2elc-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.p2elc-typing span { width: 7px; height: 7px; border-radius: 99px; background: #c4b5fd; animation: p2elc-dots 1.2s infinite ease-in-out; }
.p2elc-typing span:nth-child(2) { animation-delay: .15s; } .p2elc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes p2elc-dots { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-5px); opacity: 1; } }

.p2elc-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 4px; }
.p2elc-quick button { font: 600 13px var(--lc-font); color: var(--lc-text); cursor: pointer; padding: 9px 12px; border-radius: 999px; background: rgba(124,92,255,.12); border: 1px solid rgba(167,139,250,.35); transition: background .2s, transform .15s; }
.p2elc-quick button:hover { background: rgba(124,92,255,.24); transform: translateY(-1px); }

.p2elc-card { align-self: stretch; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid var(--lc-line); display: grid; gap: 10px; animation: p2elc-msg .35s ease both; }
.p2elc-card p { margin: 0; font-size: 13.5px; color: #d4d4d8; line-height: 1.45; }
.p2elc-card form { display: flex; gap: 8px; }
.p2elc-card input { flex: 1; min-width: 0; font: inherit; font-size: 14px; color: var(--lc-text); background: var(--lc-input); border: 1px solid var(--lc-line); border-radius: 12px; padding: 10px 12px; }
.p2elc-card input:focus { outline: none; border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,.18); }
.p2elc-card button { font: 700 13.5px var(--lc-font); cursor: pointer; border: 0; border-radius: 12px; padding: 0 14px; color: #fff; background: var(--lc-grad); }

.p2elc-foot { padding: 10px 12px 12px; border-top: 1px solid var(--lc-line); background: rgba(0,0,0,.18); }
.p2elc-compose { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 18px; background: var(--lc-input); border: 1px solid var(--lc-line); transition: border-color .2s, box-shadow .2s; }
.p2elc-compose:focus-within { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(167,139,250,.15); }
.p2elc-compose textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; color: var(--lc-text); font: inherit; font-size: 15px; line-height: 1.4; padding: 8px 0; max-height: 120px; }
.p2elc-compose textarea::placeholder { color: #6b6b74; }
.p2elc-send { flex: none; width: 40px; height: 40px; border-radius: 13px; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: var(--lc-grad); box-shadow: 0 8px 20px rgba(150,70,255,.35); transition: transform .15s, opacity .2s; }
.p2elc-send:hover { transform: translateY(-1px) rotate(-6deg); }
.p2elc-send[disabled] { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.p2elc-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.p2elc-fine { margin: 8px 4px 0; font-size: 11px; color: #71717a; display: flex; align-items: center; gap: 6px; }
.p2elc-fine svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.p2elc-hp { position: absolute !important; left: -9999px !important; }

/* Phones: full-height sheet */
@media (max-width: 520px) {
  .p2elc { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
  .p2elc.has-banner { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 84px); }
  .p2elc-panel { position: fixed; inset: 0; width: auto; height: 100dvh; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .p2elc.is-open .p2elc-launch { display: none; }
  .p2elc-teaser { width: min(300px, calc(100vw - 28px)); }
}
@media (prefers-reduced-motion: reduce) {
  .p2elc *, .p2elc *::before, .p2elc *::after { animation: none !important; transition: none !important; }
}

.p2elc-handoff { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.p2elc-handoff p { flex: 1; margin: 0; font-size: 12px; line-height: 1.4; color: #d4d4d8; }
.p2elc-handoff button { flex: none; padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(167,139,250,.35); background: rgba(124,92,255,.12); color: var(--lc-text); font: 600 12px var(--lc-font); cursor: pointer; }
.p2elc-handoff button:disabled { opacity: .5; cursor: default; }
.p2elc-sources { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; font-size: 12px; }
.p2elc-sources a, .p2elc-handoff a { color: #ddd6fe; text-decoration: underline; }
.p2elc-msg.automatic .p2elc-av { background: #494060; }

body.has-hero-support .p2elc{position:absolute;top:var(--hero-support-top);left:var(--hero-chat-left);right:auto;bottom:auto}
body.has-hero-support .p2elc-panel{position:fixed;right:22px;bottom:22px}
@media(max-width:560px){body.has-hero-support .p2elc-panel{inset:0;bottom:0;right:0}}
/* GLM-public-4: under the app downloads the launcher has the install row directly above it, so the teaser opens downwards instead of over the buttons. */
body.has-hero-support .p2elc-teaser{top:80px;bottom:auto;border-radius:20px 6px 20px 20px;transform:translateY(-12px) scale(.96);transform-origin:100% 0}
body.has-hero-support .p2elc-teaser.is-on{transform:none}
/* Opening downwards it must stay under the site header (1040) and the cookie banner (9999) while closed; the open panel keeps the top layer. */
body.has-hero-support .p2elc:not(.is-open){z-index:1030}
