/* ==========================================================================
   Primeguage chat widget (visitor side)
   Bottom-right launcher + panel. Uses the theme tokens (light / night, 78% glass).
   All sizes are px: the site sets html { font-size: 10px }, so rem would be too small.
   ========================================================================== */
.pgch { position: fixed; right: 20px; bottom: 20px; z-index: 99985; font-family: 'Poppins', sans-serif; color: var(--pg-text, #14213d); }
.pgch *, .pgch *::before, .pgch *::after { box-sizing: border-box; }

/* ---------- launcher ---------- */
.pgch-launcher {
  position: relative;
  width: 60px; height: 60px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #0623b1 0%, #2f6bff 100%);
  box-shadow: 0 14px 32px rgba(6, 35, 177, .42), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .25s cubic-bezier(.2, 1.2, .3, 1), box-shadow .25s;
  -webkit-tap-highlight-color: transparent;
}
.pgch-launcher:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 18px 38px rgba(6, 35, 177, .5), inset 0 1px 0 rgba(255, 255, 255, .3); }
.pgch-launcher:active { transform: scale(.95); }
.pgch-launcher svg { width: 28px; height: 28px; grid-area: 1 / 1; transition: transform .35s cubic-bezier(.2, 1.2, .3, 1), opacity .2s; }
.pgch-launcher .pgch-ico-close { opacity: 0; transform: rotate(-90deg) scale(.5); }
.pgch-open .pgch-launcher .pgch-ico-chat { opacity: 0; transform: rotate(90deg) scale(.5); }
.pgch-open .pgch-launcher .pgch-ico-close { opacity: 1; transform: none; }
.pgch-launcher::after {           /* soft attention pulse until first opened */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(47, 107, 255, .55);
  animation: pgchPulse 2.6s ease-out 3;
  pointer-events: none;
}
.pgch-open .pgch-launcher::after { animation: none; }
@keyframes pgchPulse { 0% { box-shadow: 0 0 0 0 rgba(47, 107, 255, .55); } 70%, 100% { box-shadow: 0 0 0 18px rgba(47, 107, 255, 0); } }
.pgch-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 22px; height: 22px; padding: 0 6px;
  display: none; place-items: center;
  border-radius: 11px; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
  color: #fff; background: #e5484d; box-shadow: 0 0 0 3px var(--pg-bg, #fff);
}
.pgch-badge.pgch-on { display: block; }

.pgch-tip {
  position: absolute; right: 74px; bottom: 8px; width: max-content; max-width: 230px;
  padding: 11px 16px; border-radius: 16px 16px 4px 16px;
  font-size: 14px; line-height: 1.45; font-weight: 500;
  background: var(--pg-glass, rgba(255, 255, 255, .78));
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 0 0 1px var(--pg-glass-border, rgba(6, 35, 177, .13)), var(--pg-shadow, 0 10px 30px rgba(4, 38, 100, .16));
  opacity: 0; transform: translateY(8px) scale(.96); pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.pgch-tip.pgch-on { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.pgch-open .pgch-tip { display: none; }

/* ---------- panel ---------- */
.pgch-panel {
  position: absolute; right: 0; bottom: 78px;
  width: 388px; height: min(600px, calc(100vh - 116px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 24px;
  background: var(--pg-glass, rgba(255, 255, 255, .78));
  -webkit-backdrop-filter: blur(22px) saturate(165%); backdrop-filter: blur(22px) saturate(165%);
  box-shadow: inset 0 0 0 1px var(--pg-glass-border, rgba(6, 35, 177, .13)), 0 26px 70px rgba(4, 18, 70, .34);
  opacity: 0; visibility: hidden; transform: translateY(18px) scale(.96); transform-origin: bottom right;
  transition: opacity .25s ease, transform .3s cubic-bezier(.22, .61, .36, 1), visibility 0s linear .3s;
}
.pgch-open .pgch-panel { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .3s cubic-bezier(.22, .61, .36, 1); }

.pgch-head {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 18px; color: #fff;
  background: radial-gradient(120% 120% at 0% 0%, rgba(77, 133, 255, .55), transparent 60%), linear-gradient(135deg, #04125e 0%, #0623b1 70%, #0a2cd9 100%);
}
.pgch-avatar { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); }
.pgch-avatar svg { width: 24px; height: 24px; }
.pgch-title { flex: 1; min-width: 0; }
.pgch-title strong { display: block; font-size: 16px; line-height: 1.25; font-weight: 700; color: #fff; }
.pgch-title span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .88; }
.pgch-title span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6fe3a5; box-shadow: 0 0 0 3px rgba(111, 227, 165, .25); }
.pgch-x { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .14); cursor: pointer; font-size: 20px; line-height: 1; transition: background .2s; }
.pgch-x:hover { background: rgba(255, 255, 255, .28); }

/* messages */
.pgch-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; overscroll-behavior: contain; }
.pgch-msg { display: flex; gap: 8px; max-width: 92%; animation: pgchIn .28s ease both; }
@keyframes pgchIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pgch-msg .pgch-mav { flex: none; width: 28px; height: 28px; margin-top: 2px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #0623b1, #2f6bff); }
.pgch-msg .pgch-mav svg { width: 16px; height: 16px; }
.pgch-bub { padding: 11px 15px; border-radius: 4px 18px 18px 18px; font-size: 14.5px; line-height: 1.6; word-wrap: break-word; overflow-wrap: anywhere; background: var(--pg-surface-2, rgba(238, 243, 255, .9)); box-shadow: inset 0 0 0 1px var(--pg-glass-border, rgba(6, 35, 177, .1)); color: var(--pg-text, #14213d); }
.pgch-bub p { margin: 0; text-align: left !important; color: inherit; }
.pgch-who { display: block; margin: 0 0 3px 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--pg-muted, #56627f); }
.pgch-time { display: block; margin: 4px 4px 0; font-size: 11px; color: var(--pg-muted, #56627f); opacity: .8; }
.pgch-me { align-self: flex-end; flex-direction: row-reverse; }
.pgch-me .pgch-bub { color: #fff; background: linear-gradient(135deg, #0623b1, #2f6bff); border-radius: 18px 18px 4px 18px; box-shadow: 0 8px 18px rgba(6, 35, 177, .25); }
.pgch-me .pgch-time { text-align: right; }
.pgch-team .pgch-mav { background: linear-gradient(135deg, #0a8f5a, #2ecb8d); }
.pgch-team .pgch-bub { background: var(--pg-surface, rgba(255, 255, 255, .9)); box-shadow: inset 0 0 0 1.5px rgba(10, 143, 90, .35); }
.pgch-note { align-self: center; max-width: 92%; padding: 8px 14px; border-radius: 12px; font-size: 12.5px; line-height: 1.5; text-align: center; color: var(--pg-muted, #56627f); background: var(--pg-surface-2, rgba(238, 243, 255, .7)); }
.pgch-note.pgch-ok { color: #0a7a4c; background: rgba(46, 203, 141, .14); }
.pgch-note.pgch-bad { color: #b4232a; background: rgba(229, 72, 77, .12); }

.pgch-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.pgch-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600; text-decoration: none !important; cursor: pointer;
  color: var(--pg-heading, #0623b1) !important; background: transparent; border: 1.5px solid var(--pg-accent, #0623b1);
  transition: background .2s, transform .2s;
}
.pgch-link:hover { background: var(--pg-surface-2, rgba(238, 243, 255, .9)); transform: translateY(-1px); }
.pgch-link::after { content: "\2192"; font-size: 13px; }

.pgch-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.pgch-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--pg-muted, #56627f); opacity: .5; animation: pgchDot 1.1s infinite ease-in-out; }
.pgch-typing i:nth-child(2) { animation-delay: .16s; } .pgch-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes pgchDot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }

/* quick replies */
.pgch-chips { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 12px; }
.pgch-chips:empty { display: none; }
.pgch-chip { padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--pg-heading, #0623b1); background: transparent; border: 1.5px solid var(--pg-accent, #0623b1); transition: background .2s, color .2s, transform .2s; }
.pgch-chip:hover { background: var(--pg-accent, #0623b1); color: #fff; transform: translateY(-1px); }
.pgch-chip.pgch-team-chip { border-color: #0a8f5a; color: #0a7a4c; }
.pgch-chip.pgch-team-chip:hover { background: #0a8f5a; color: #fff; }

/* hand-off form card */
.pgch-form { align-self: stretch; padding: 16px; border-radius: 18px; background: var(--pg-surface, rgba(255, 255, 255, .9)); box-shadow: inset 0 0 0 1px var(--pg-glass-border, rgba(6, 35, 177, .13)), 0 10px 24px rgba(4, 38, 100, .08); animation: pgchIn .28s ease both; }
.pgch-form h4 { margin: 0 0 4px; font-family: 'Poppins', sans-serif; font-size: 15.5px; font-weight: 700; color: var(--pg-heading, #0623b1) !important; text-transform: none; border: 0; }
.pgch-form p.pgch-sub { margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--pg-muted, #56627f); text-align: left !important; }
.pgch-field { margin-bottom: 10px; }
.pgch-field label { display: block; margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--pg-text, #14213d); }
.pgch-field label i { color: #e5484d; font-style: normal; }
.pgch-field input, .pgch-field textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.5; color: var(--pg-text, #14213d);
  background: var(--pg-input, rgba(255, 255, 255, .7)); border: 1.5px solid var(--pg-input-border, rgba(6, 35, 177, .18)); border-radius: 11px; outline: none; height: auto; box-shadow: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
.pgch-field textarea { resize: vertical; min-height: 78px; }
.pgch-field input:focus, .pgch-field textarea:focus { border-color: var(--pg-accent, #0623b1); box-shadow: 0 0 0 3px rgba(47, 107, 255, .18); }
.pgch-field.pgch-invalid input, .pgch-field.pgch-invalid textarea { border-color: #e5484d; }
.pgch-field .pgch-err { display: none; margin-top: 3px; font-size: 12px; color: #e5484d; }
.pgch-field.pgch-invalid .pgch-err { display: block; }
.pgch-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.pgch-consent { margin: 2px 0 12px; font-size: 12px; line-height: 1.55; color: var(--pg-muted, #56627f); }
.pgch-consent a { color: var(--pg-heading, #0623b1); font-weight: 600; text-decoration: underline; }
.pgch-fbtns { display: flex; gap: 8px; }
.pgch-btn { flex: 1; min-height: 42px; padding: 10px 14px; border-radius: 11px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.pgch-btn-p { border: 0; color: #fff; background: linear-gradient(135deg, #0623b1, #2f6bff); box-shadow: 0 8px 18px rgba(6, 35, 177, .28); }
.pgch-btn-p:hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgba(6, 35, 177, .36); }
.pgch-btn-p[disabled] { opacity: .7; cursor: progress; transform: none; }
.pgch-btn-s { flex: none; color: var(--pg-muted, #56627f); background: transparent; border: 1.5px solid var(--pg-input-border, rgba(6, 35, 177, .18)); }
.pgch-btn-s:hover { background: var(--pg-surface-2, rgba(238, 243, 255, .9)); }

/* composer */
.pgch-composer { flex: none; display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px 12px; border-top: 1px solid var(--pg-glass-border, rgba(6, 35, 177, .13)); }
.pgch-composer textarea {
  flex: 1; min-width: 0; max-height: 110px; min-height: 44px; padding: 11px 14px; resize: none;
  font: inherit; font-size: 14.5px; line-height: 1.45; color: var(--pg-text, #14213d);
  background: var(--pg-input, rgba(255, 255, 255, .7)); border: 1.5px solid var(--pg-input-border, rgba(6, 35, 177, .18)); border-radius: 16px; outline: none; box-shadow: none; height: 44px; -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
.pgch-composer textarea:focus { border-color: var(--pg-accent, #0623b1); box-shadow: 0 0 0 3px rgba(47, 107, 255, .16); }
.pgch-composer textarea::placeholder { color: var(--pg-muted, #56627f) !important; opacity: .9 !important; }
.pgch-send { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; cursor: pointer; background: linear-gradient(135deg, #0623b1, #2f6bff); box-shadow: 0 8px 18px rgba(6, 35, 177, .3); transition: transform .2s, opacity .2s; }
.pgch-send:hover { transform: translateY(-1px) scale(1.05); }
.pgch-send[disabled] { opacity: .45; cursor: default; transform: none; }
.pgch-send svg { width: 20px; height: 20px; }
.pgch-foot { flex: none; padding: 0 16px 12px; font-size: 11.5px; text-align: center; color: var(--pg-muted, #56627f); }
.pgch-foot a { color: inherit; text-decoration: underline; }

/* keep the home page news pop-up clear of the launcher */
.notification-banner { bottom: 100px !important; }
/* keep the site's own back-to-top button clear of the launcher */
#scroll-Top { bottom: 96px; }

@media (max-width: 560px) {
  .pgch { right: 14px; bottom: 14px; }
  .pgch-open.pgch { right: 0; bottom: 0; left: 0; top: 0; }
  .pgch-open .pgch-launcher { display: none; }
  .pgch-panel { position: fixed; inset: 0; width: 100%; height: 100dvh; max-height: none; border-radius: 0; bottom: 0; }
  .pgch-tip { right: 70px; max-width: 200px; }
  .pgch-body { padding-bottom: 14px; }
  .pgch-composer { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .pgch-head { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  html.pgch-lock { overflow: hidden !important; }
}
@media print { .pgch { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .pgch *, .pgch *::before, .pgch *::after { animation: none !important; transition-duration: .01ms !important; } }

/* the site's global link size (16px) is too large for the footer line */
.pgch-foot a, .pgch-consent a, .pgch-sub a { font-size: inherit !important; }
