/* Batch 3, item 2: support chat bubble */
.pc { --pc-ink: #1f2437; --pc-muted: #6b6890; --pc-line: #e7e4f6; --pc-bg: #ffffff; --pc-soft: #f6f5fd; --pc-accent: #6e56f7;
  position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 10050;
  font-family: var(--pf-body, 'Geist', 'Inter', system-ui, sans-serif); color: var(--pc-ink); }
.pc-bubble { position: relative; display: grid; place-items: center; width: 58px; height: 58px; margin-left: auto; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, #2d2a6e 0%, #6e56f7 100%); color: #fff; cursor: pointer;
  box-shadow: 0 14px 32px -12px rgba(45, 42, 110, .7); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.pc-bubble:hover { transform: translateY(-2px) scale(1.04); }
.pc-bubble:focus-visible { outline: 3px solid #a78bfa; outline-offset: 3px; }
.pc-bubble svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pc-dot { position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #fff; }
.pc-panel { position: absolute; right: 0; bottom: 72px; display: flex; flex-direction: column; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px));
  border: 1px solid var(--pc-line); border-radius: 20px; background: var(--pc-bg); overflow: hidden;
  box-shadow: 0 30px 60px -24px rgba(36, 30, 92, .45), 0 4px 14px rgba(36, 30, 92, .08); animation: pcIn .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes pcIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.pc-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 16px; background: linear-gradient(135deg, #241d6b 0%, #4b37c9 100%); color: #fff; }
.pc-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.pc-avatar svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.8; }
.pc-who { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.pc-who strong { font-size: 15px; font-weight: 700; }
.pc-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #d8d2ff; }
.pc-state i { width: 8px; height: 8px; border-radius: 50%; background: #a8a4c9; }
.pc-state i.on { background: #22c55e; }
.pc-x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; }
.pc-x:hover { background: rgba(255, 255, 255, .12); }
.pc-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pc-log { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px; overflow-y: auto; background: var(--pc-soft); overscroll-behavior: contain; }
.pc-msg { max-width: 86%; padding: 10px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: pre-line; }
.pc-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--pc-line); border-bottom-left-radius: 4px; }
.pc-msg.me { align-self: flex-end; background: linear-gradient(135deg, #5b45e0, #7c6af0); color: #fff; border-bottom-right-radius: 4px; }
.pc-msg.err { align-self: flex-start; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.pc-label { margin: 4px 0 0; font-size: 11.5px; font-weight: 650; color: var(--pc-muted); }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-chip { padding: 7px 11px; border: 1px solid #ddd6fe; border-radius: 999px; background: #fff; color: #3b2fb0; font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer; }
.pc-chip:hover { background: #f2efff; }
.pc-chip.is-primary { background: linear-gradient(135deg, #2d2a6e, #6e56f7); border-color: transparent; color: #fff; }
.pc-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--pc-line); border-radius: 14px; background: #fff; }
.pc-note { margin: 0; font-size: 12.5px; color: var(--pc-muted); line-height: 1.4; }
.pc-in { width: 100%; padding: 9px 11px; border: 1px solid #e3e0f3; border-radius: 10px; font: inherit; font-size: 13.5px; color: var(--pc-ink); background: #fff; resize: vertical; }
.pc-in:focus { outline: none; border-color: #8b7bff; box-shadow: 0 0 0 3px rgba(110, 86, 247, .14); }
.pc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.pc-go { height: 40px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #2d2a6e, #6e56f7); color: #fff; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.pc-go.is-wa { background: #1fa855; }
.pc-go:disabled { opacity: .6; cursor: progress; }
.pc-hours { margin: 0; font-size: 11.5px; color: var(--pc-muted); text-align: center; }
.pc-ask { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--pc-line); background: #fff; }
.pc-ask input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid #e3e0f3; border-radius: 12px; font: inherit; font-size: 13.5px; color: var(--pc-ink); background: #fff; }
.pc-ask input:focus { outline: none; border-color: #8b7bff; }
.pc-ask button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--pc-accent); color: #fff; cursor: pointer; }
.pc-ask button svg { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 480px) { .pc-panel { position: fixed; right: 12px; left: 12px; bottom: 88px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .pc-panel { animation: none; } .pc-bubble { transition: none; } }

html[data-theme="dark"] .pc { --pc-ink: #ecebff; --pc-muted: #a9a5c9; --pc-line: rgba(167, 139, 250, .2); --pc-bg: #17162a; --pc-soft: #121124; }
html[data-theme="dark"] .pc-msg.bot, html[data-theme="dark"] .pc-form, html[data-theme="dark"] .pc-ask, html[data-theme="dark"] .pc-chip { background: #1e1c36; }
html[data-theme="dark"] .pc-chip { color: #d8d2ff; border-color: rgba(167, 139, 250, .3); }
html[data-theme="dark"] .pc-in, html[data-theme="dark"] .pc-ask input { background: #1b1930; border-color: rgba(167, 139, 250, .22); color: #ecebff; }
html[data-theme="dark"] .pc-dot { box-shadow: 0 0 0 3px #17162a; }
.pc-chip { border-radius: 16px; line-height: 1.35; }
.pc-in::placeholder, .pc-ask input::placeholder { color: #9a96b4; opacity: 1; }
html[data-theme="dark"] .pc-in::placeholder, html[data-theme="dark"] .pc-ask input::placeholder { color: #8d89ad; }
.pc-panel[hidden], .pc [hidden] { display: none !important; }

/* Batch 6: phones: a slightly smaller bubble closer to the corner, clear of the home indicator */
@media (max-width: 480px) {
  .pc { right: max(14px, env(safe-area-inset-right, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
  .pc-bubble { width: 52px; height: 52px; }
  .pc-panel { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 100px); }
}
