/* Live chat box (public/js/chat.js). Light panel in every theme; accent from the site's --primary. */
.gpc { --gpc-accent: var(--primary, #B4FF00); --gpc-accent-ink: var(--primary-contrast, #0B0D10); --gpc-ink: #0B0D10; --gpc-muted: #6b7280; --gpc-line: #e6e8ec; --gpc-bg: #fff; --gpc-soft: #f3f4f6; --gpc-offset: 0px; position: fixed; right: 18px; bottom: calc(18px + var(--gpc-offset)); z-index: 2147482000; font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--gpc-ink); }
.gpc * { box-sizing: border-box; }
.gpc [hidden], .gpc[hidden] { display: none !important; }
.gpc-bubble { position: relative; width: 58px; height: 58px; border-radius: 999px; border: 0; cursor: pointer; background: var(--gpc-accent); color: var(--gpc-accent-ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 28px -10px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.06); transition: transform .15s; }
.gpc-bubble:hover { transform: scale(1.05); }
.gpc-bubble::before, .gpc-bubble::after { content: ""; position: absolute; inset: 0; border-radius: 999px; border: 2px solid var(--gpc-accent); animation: gpcPulse 2.2s ease-out infinite; pointer-events: none; }
.gpc-bubble::after { animation-delay: 1.1s; }
.gpc.open .gpc-bubble::before, .gpc.open .gpc-bubble::after { display: none; }
@keyframes gpcPulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
.gpc-tip { position: absolute; right: 68px; top: 50%; transform: translateY(-50%); background: #111827; color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none; }
.gpc-bubble:hover .gpc-tip { opacity: 1; }
.gpc.open .gpc-tip { display: none; }
@media (prefers-reduced-motion: reduce) { .gpc-bubble::before, .gpc-bubble::after { animation: none; display: none; } }
.gpc-bubble svg { width: 28px; height: 28px; transition: opacity .15s, transform .2s; }
.gpc-bubble svg.x { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.6); }
.gpc.open .gpc-bubble svg:not(.x) { opacity: 0; transform: rotate(90deg) scale(.6); }
.gpc.open .gpc-bubble svg.x { opacity: 1; transform: none; }
.gpc-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #e11d48; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.gpc-win { position: absolute; right: 0; bottom: 70px; width: 380px; max-width: calc(100vw - 24px); height: 600px; max-height: calc(100vh - 110px); background: var(--gpc-bg); border-radius: 18px; box-shadow: 0 24px 64px -16px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.08); display: flex; flex-direction: column; overflow: hidden; animation: gpcIn .18s ease-out; }
@keyframes gpcIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.gpc-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--gpc-ink); color: #fff; }
.gpc-avatar { width: 38px; height: 38px; border-radius: 999px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; font-size: 18px; }
.gpc-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.gpc-head-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gpc-head-t b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gpc-status { font-size: 12px; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: 6px; }
.gpc-status i { width: 8px; height: 8px; border-radius: 999px; background: #9ca3af; display: inline-block; }
.gpc-status.on i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.3); }
.gpc-ib { width: 34px; height: 34px; border-radius: 999px; border: 0; background: transparent; color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: .85; }
.gpc-ib:hover { background: rgba(255,255,255,.12); opacity: 1; }
.gpc-ib svg { width: 20px; height: 20px; }
.gpc-body { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 14px; background: #fafafa; }
.gpc-intro p { margin: 0 0 10px; }
.gpc-off { color: #92400e; background: #fef3c7; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.gpc-form label { display: block; font-size: 12px; font-weight: 600; color: var(--gpc-muted); margin: 10px 0 0; }
.gpc-form input:not([type=checkbox]), .gpc-form textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--gpc-line); border-radius: 10px; font: inherit; color: var(--gpc-ink); background: #fff; }
.gpc-form input:focus, .gpc-form textarea:focus, .gpc-input:focus { outline: 2px solid var(--gpc-accent); outline-offset: 0; border-color: transparent; }
.gpc-chk { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 400 !important; color: var(--gpc-ink) !important; font-size: 13px !important; }
.gpc-chk input { margin-top: 3px; }
.gpc-chk a, .gpc-login a, .gpc-foot-note a { color: inherit; text-decoration: underline; }
.gpc-hp { position: absolute; left: -9999px; }
.gpc-btn { display: block; width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 999px; background: var(--gpc-accent); color: var(--gpc-accent-ink); font: inherit; font-weight: 800; cursor: pointer; }
.gpc-btn:disabled { opacity: .6; }
.gpc-login { font-size: 12px; color: var(--gpc-muted); text-align: center; margin: 12px 0 0; }
.gpc-err { background: #fee2e2; color: #991b1b; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-top: 10px; }
.gpc-ctx { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--gpc-line); border-radius: 12px; padding: 8px 10px; margin-bottom: 12px; font-size: 13px; }
.gpc-ctx img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: #fff; flex: 0 0 auto; }
.gpc-ctx-t { min-width: 0; }
.gpc-ctx-t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gpc-ctx-t span { color: var(--gpc-muted); }
.gpc-msgs { display: flex; flex-direction: column; gap: 10px; }
.gpc-sys { align-self: center; text-align: center; font-size: 12px; color: var(--gpc-muted); background: #f1f2f4; border-radius: 10px; padding: 6px 10px; max-width: 90%; }
.gpc-sys.gpc-welcome { background: #fff; border: 1px solid var(--gpc-line); color: var(--gpc-ink); font-size: 13px; }
.gpc-sys.gpc-off { background: #fef3c7; color: #92400e; }
.gpc-m { max-width: 84%; display: flex; flex-direction: column; }
.gpc-m.me { align-self: flex-end; align-items: flex-end; }
.gpc-m.them { align-self: flex-start; align-items: flex-start; }
.gpc-who { font-size: 11px; color: var(--gpc-muted); margin: 0 0 3px 6px; }
.gpc-bub { max-width: 100%; min-width: 0; box-sizing: border-box; background: #fff; border: 1px solid var(--gpc-line); border-radius: 16px 16px 16px 4px; padding: 9px 12px; word-wrap: break-word; overflow-wrap: anywhere; }
.gpc-m.me .gpc-bub { background: var(--gpc-ink); color: #fff; border-color: var(--gpc-ink); border-radius: 16px 16px 4px 16px; }
.gpc-m.me .gpc-bub a { color: #fff; }
.gpc-m.temp .gpc-bub { opacity: .6; }
.gpc-m.failed .gpc-bub { border-color: #e11d48; opacity: 1; }
.gpc-m.failed .gpc-meta::after { content: " · not sent"; color: #e11d48; }
.gpc-txt a { text-decoration: underline; }
.gpc-meta { font-size: 11px; color: var(--gpc-muted); margin: 3px 6px 0; display: flex; gap: 6px; }
.gpc-tick { letter-spacing: -2px; }
.gpc-tick.read { color: #0ea5e9; font-weight: 700; }
.gpc-card { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--gpc-ink); background: #fff; border: 1px solid var(--gpc-line); border-radius: 12px; padding: 8px; margin: 2px 0 8px; width: 260px; max-width: 100%; min-width: 0; box-sizing: border-box; }
.gpc-m .gpc-bub a.gpc-card, .gpc-m.me .gpc-bub a.gpc-card { color: var(--gpc-ink); }
.gpc-card img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; flex: 0 0 auto; }
.gpc-card span { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; }
.gpc-card b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; overflow-wrap: anywhere; }
.gpc-card em { font-style: normal; color: var(--gpc-muted); }
.gpc-card em s { opacity: .7; margin-left: 4px; }
.gpc-card u { color: #0ea5e9; text-decoration: none; font-weight: 600; }
.gpc-att { display: inline-block; margin: 2px 0 6px; text-decoration: underline; font-size: 13px; }
.gpc-att.img img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; cursor: zoom-in; }
.gpc-lb { position: fixed; inset: 0; z-index: 2147483647; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.gpc-lb[hidden] { display: none !important; }
.gpc-lb img { max-width: 96vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); cursor: default; }
.gpc-lb-open { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); color: #fff; font: 600 13px/1 system-ui, sans-serif; background: rgba(255,255,255,.14); padding: 9px 14px; border-radius: 999px; text-decoration: none; }
.gpc-lb-x { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.gpc-foot { border-top: 1px solid var(--gpc-line); background: #fff; padding: 8px 10px 6px; }
.gpc-pending { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 6px; }
.gpc-pending[hidden] { display: none; }
.gpc-pend { display: inline-flex; align-items: center; gap: 6px; background: var(--gpc-soft); border-radius: 8px; padding: 3px 6px; font-size: 12px; max-width: 100%; }
.gpc-pend img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; }
.gpc-pend i { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.gpc-pend button { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; color: var(--gpc-muted); }
.gpc-compose { display: flex; align-items: flex-end; gap: 6px; }
.gpc-compose .gpc-ib { color: var(--gpc-muted); flex: 0 0 auto; }
.gpc-compose .gpc-ib:hover { background: var(--gpc-soft); }
.gpc-input { flex: 1; resize: none; border: 1px solid var(--gpc-line); border-radius: 14px; padding: 9px 12px; font: inherit; font-size: 16px; line-height: 1.35; max-height: 120px; background: #fff; color: var(--gpc-ink); }
.gpc-send { width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--gpc-accent); color: var(--gpc-accent-ink); cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.gpc-send:disabled { opacity: .5; }
.gpc-send svg { width: 20px; height: 20px; }
.gpc-foot-note { font-size: 10px; color: var(--gpc-muted); text-align: center; padding: 6px 0 0; }
.gpc-hist-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gpc-link { border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.gpc-hist-l { display: flex; flex-direction: column; gap: 8px; }
.gpc-hist-i { text-align: left; background: #fff; border: 1px solid var(--gpc-line); border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 2px; }
.gpc-hist-i b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gpc-hist-i span { color: var(--gpc-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gpc-hist-i em { font-style: normal; font-size: 11px; color: var(--gpc-muted); }
.gpc-toast { position: absolute; right: 0; bottom: 70px; background: var(--gpc-ink); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 13px; opacity: 0; transform: translateY(6px); transition: .2s; pointer-events: none; max-width: 320px; }
.gpc-toast.show { opacity: 1; transform: none; }
.gpc.open .gpc-toast { bottom: auto; top: -46px; }

/* other floating buttons move out of the chat's corner */
body.has-chat .wa-float { right: auto; left: 18px; }
body.has-chat .wa-float .tip { right: auto; left: 68px; }
body.has-chat .cookie { bottom: 88px; }
body.has-chat .totop { bottom: 96px; }
body.has-chat.has-sticky .totop { bottom: 170px; }
body.has-chat.has-sticky .gpc { bottom: calc(84px + var(--gpc-offset, 0px)); }
@media (max-width: 900px) { body.has-chat .filter-fab { bottom: 92px; } }

@media (max-width: 640px) {
  .gpc { right: 14px; }
  .gpc-bubble { width: 54px; height: 54px; }
  .gpc.open .gpc-bubble { display: none; }
  .gpc-win { position: fixed; inset: 0; width: auto; max-width: none; height: 100%; max-height: none; border-radius: 0; animation: none; }
  .gpc-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .gpc-foot { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .gpc-m { max-width: 90%; }
  body.gpc-lock { overflow: hidden; }
  .gpc.open .gpc-toast { top: auto; bottom: 90px; right: 14px; position: fixed; }
}
