/* Website chat (pubchat.js) — light + dark, phone = full-height sheet. */
.pc-launch { position: fixed; z-index: 2147482000; right: 20px; bottom: 20px; width: 58px; height: 58px; display: grid; place-items: center;
  padding: 0; border-radius: 50%; border: 0; cursor: pointer; background: var(--accent, #0071e3); color: #fff;
  box-shadow: 0 10px 30px rgba(0,113,227,.4); transition: transform .15s ease, box-shadow .15s ease; }
.pc-launch:hover { transform: scale(1.06); box-shadow: 0 14px 36px rgba(0,113,227,.5); }
.pc-launch:focus-visible { outline: 3px solid rgba(0,113,227,.45); outline-offset: 3px; }
.pc-launch svg { width: 26px; height: 26px; }
.pc-launch[hidden] { display: none; }
.pc { position: fixed; z-index: 2147482001; right: 18px; bottom: 18px; width: min(400px, calc(100vw - 24px)); height: min(600px, calc(100vh - 36px));
  display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--surface, #fff); color: var(--ink, #1d1d1f);
  border: 1px solid var(--line, rgba(0,0,0,.12)); box-shadow: 0 24px 70px rgba(0,0,0,.28); font: 14px/1.5 var(--font-sans, system-ui, sans-serif); }
.pc[hidden] { display: none; }
.pc-head { display: flex; flex-direction: column; gap: .55rem; padding: .75rem .9rem .7rem; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); }
.pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.pc-live { color: #1a7f37 !important; }
.pc-head b { display: block; font-size: 15px; }
.pc-head span { display: block; font-size: 12px; color: var(--muted, #6e6e73); }
.pc-actions { display: flex; align-items: center; gap: .45rem; }
.pc-actions .pc-btn { flex: 1; }
.pc-btn { font: 600 12.5px/1 var(--font-sans, system-ui, sans-serif); padding: .5rem .75rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line, rgba(0,0,0,.16)); background: transparent; color: inherit; }
.pc-btn--fill { background: var(--accent, #0071e3); border-color: var(--accent, #0071e3); color: #fff; }
.pc-btn--ghost { border-color: transparent; color: var(--link, #0066cc); padding: .45rem .5rem; }
.pc-btn:disabled { opacity: .45; cursor: default; }
.pc-x { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2, rgba(0,0,0,.06)); color: var(--muted, #6e6e73);
  font-size: 20px; line-height: 30px; cursor: pointer; padding: 0; }
.pc-x:hover { background: rgba(0,0,0,.1); color: var(--ink, #1d1d1f); }
/* the live demo under each reply */
.pc-meta { align-self: flex-start; max-width: 92%; margin: -.2rem 0 .2rem .2rem; font-size: 11.5px; line-height: 1.5; color: var(--muted, #6e6e73); }
.pc-dim { opacity: .75; }
.pc-route-btn { border: 0; background: none; padding: 0; color: var(--link, #0066cc); font: inherit; cursor: pointer; }
.pc-src a { color: var(--link, #0066cc); }
.pc-route { margin: .35rem 0 0; padding-left: 1.1rem; font-size: 11.5px; }
.pc-route li { margin: .1rem 0; }
.pc-route .pc-bad { color: var(--red, #c4312a); }
.pc-ms { display: inline-block; min-width: 4.2em; color: var(--muted, #6e6e73); font-variant-numeric: tabular-nums; }
.pc-log { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .55rem; }
.pc-msg { max-width: 86%; padding: .55rem .75rem; border-radius: 14px; white-space: normal; word-wrap: break-word; }
.pc-assistant { align-self: flex-start; background: var(--surface-2, #f2f2f5); }
.pc-visitor { align-self: flex-end; background: var(--accent, #0071e3); color: #fff; }
.pc-notice { align-self: center; max-width: 100%; font-size: 12.5px; color: var(--muted, #6e6e73); background: transparent; text-align: center; }
.pc-msg a { color: inherit; text-decoration: underline; }
.pc-assistant a { color: var(--link, #0066cc); }
.pc-err { color: var(--red, #c4312a); }
.pc-typing::after { content: "…"; display: inline-block; animation: pc-dots 1s steps(3, end) infinite; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes pc-dots { from { width: 0; } to { width: 1.2em; } }
.pc-ts { padding: .4rem .9rem .6rem; font-size: 12.5px; color: var(--muted, #6e6e73); }
.pc-ts[hidden] { display: none; }
.pc-note { margin: 0; padding: .45rem .9rem; font-size: 12.5px; color: var(--muted, #6e6e73); border-top: 1px solid var(--line, rgba(0,0,0,.06)); }
.pc-note.pc-warn { color: #b25e00; background: rgba(255,159,10,.08); }
.pc-note[hidden] { display: none; }
.pc-in { padding: .55rem .7rem .7rem; border-top: 1px solid var(--line, rgba(0,0,0,.08)); }
.pc-in textarea { width: 100%; box-sizing: border-box; resize: none; border: 1px solid var(--line, rgba(0,0,0,.15)); border-radius: 12px; padding: .55rem .7rem;
  font: inherit; color: inherit; background: var(--surface, #fff); max-height: 140px; }
.pc-in-row { display: flex; align-items: center; justify-content: space-between; margin-top: .4rem; }
.pc-count { font-size: 11.5px; color: var(--muted, #6e6e73); font-variant-numeric: tabular-nums; }
.pc-count.pc-over { color: var(--red, #c4312a); font-weight: 600; }
/* the support form covers the WHOLE panel (header + history) — nothing shows through */
.pc-form { position: absolute; inset: 0; z-index: 5; border-radius: inherit; background: var(--surface, #fff); padding: 1rem .95rem; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; }
.pc-form[hidden] { display: none; }
.pc-form label { display: flex; flex-direction: column; gap: .25rem; font-size: 12.5px; font-weight: 600; }
.pc-form input, .pc-form textarea { font: 14px/1.4 var(--font-sans, system-ui, sans-serif); font-weight: 400; padding: .5rem .65rem; border-radius: 10px;
  border: 1px solid var(--line, rgba(0,0,0,.15)); background: var(--surface, #fff); color: inherit; }
.pc-f-h { margin: 0; font-weight: 650; font-size: 15px; }
.pc-f-sub { margin: 0; font-size: 12.5px; color: var(--muted, #6e6e73); }
.pc-f-err { margin: 0; min-height: 1em; font-size: 12.5px; color: var(--red, #c4312a); }
.pc-f-btns { display: flex; gap: .4rem; flex-wrap: wrap; }
.pc-f-done p { margin: 0 0 .6rem; }
.pc { position: fixed; }
:root[data-theme="dark"] .pc, :root[data-theme="dark"] .pc-form { background: #1c1c1e; color: #f5f5f7; border-color: rgba(255,255,255,.14); }
:root[data-theme="dark"] .pc-assistant { background: #2c2c2e; }
:root[data-theme="dark"] .pc-x { background: rgba(255,255,255,.1); color: #c7c7cc; }
:root[data-theme="dark"] .pc-live { color: #30d158 !important; }
:root[data-theme="dark"] .pc-in textarea, :root[data-theme="dark"] .pc-form input, :root[data-theme="dark"] .pc-form textarea { background: #111; border-color: rgba(255,255,255,.16); }
@media (max-width: 520px) {
  .pc { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .pc-launch { right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) { .pc-typing::after { animation: none; } }

/* the assistant's hand-over: a button under its reply, never a pop-up over it */
.pc-offer { align-self: flex-start; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: -.1rem 0 .2rem; }
.pc-offer span { font-size: 12px; color: var(--muted, #6e6e73); }
