#pv-chat {
  color-scheme: dark;
  --pvc-panel: #0c0c0e;
  --pvc-field: #151518;
  --pvc-raised: #202024;
  --pvc-line: #2c2c31;
  --pvc-ink: #f5f5f6;
  --pvc-muted: #a6a6ad;
  --pvc-green: #63e5af;
  --pvc-gap: 20px;
  --pvc-right: max(var(--pvc-gap), env(safe-area-inset-right, 0px));
  --pvc-bottom: max(var(--pvc-gap), env(safe-area-inset-bottom, 0px));
  position: fixed;
  z-index: 65;
  right: var(--pvc-right);
  bottom: var(--pvc-bottom);
  color: var(--pvc-ink);
  font: 400 14px/1.45 Geist, system-ui, sans-serif;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
#pv-chat *, #pv-chat *::before, #pv-chat *::after { box-sizing: border-box; }
#pv-chat [hidden] { display: none !important; }
#pv-chat :is(h2, h3, p, form) { margin: 0; }
#pv-chat :is(button, input, textarea) { font: inherit; letter-spacing: inherit; }
#pv-chat button { cursor: pointer; }
#pv-chat button:disabled { cursor: default; }
#pv-chat :focus-visible { outline: 2px solid var(--pvc-green); outline-offset: 3px; }
#pv-chat svg { display: block; width: 19px; height: 19px; flex: none; }

#pv-chat .pvc-launch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 19px 0 15px;
  border: 1px solid #444449;
  border-radius: 100px;
  background: linear-gradient(160deg, #242427, #111113 80%);
  color: #f7f7f7;
  box-shadow: inset 0 1px #ffffff0d, 0 5px 24px #0007;
  font-weight: 550;
  transition: transform .18s ease, border-color .18s ease;
}
#pv-chat .pvc-launch:hover { transform: translateY(-2px); border-color: #79797e; }
.pvc-launch-symbol, .pvc-launch-close { position: relative; display: grid; place-items: center; }
#pv-chat .pvc-launch-symbol svg { width: 23px; height: 23px; }
#pv-chat .pvc-launch-close { display: none; }
#pv-chat .pvc-launch[aria-expanded="true"] { width: 48px; padding: 0; }
#pv-chat .pvc-launch[aria-expanded="true"] .pvc-launch-close { display: grid; }
#pv-chat .pvc-launch[aria-expanded="true"] :is(.pvc-launch-text, .pvc-launch-symbol) { display: none; }
#pv-chat .pvc-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - var(--pvc-right) - 12px));
  max-height: calc(100vh - var(--pvc-bottom) - 72px);
  max-height: calc(100dvh - var(--pvc-bottom) - 72px);
  overflow: hidden;
  padding: 0;
  background: var(--pvc-panel);
  border: 1px solid #414145;
  border-radius: 22px;
  box-shadow: inset 0 1px #ffffff08, 0 24px 80px #0008, 0 4px 14px #0006;
  transform-origin: bottom right;
  animation: pvc-open .2s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes pvc-open { from { opacity: 0; transform: translateY(7px) scale(.985); } to { opacity: 1; transform: none; } }
.pvc-header {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 12px 16px 12px 20px;
  background: #111113;
  border-bottom: 1px solid var(--pvc-line);
}
.pvc-brand { display: grid; place-items: center; width: 37px; height: 37px; flex: none; background: #09090a; border: 1px solid #343437; border-radius: 11px; }
.pvc-brand img { width: 29px; height: 29px; }
.pvc-heading { flex: 1; min-width: 0; }
#pv-chat .pvc-heading h2 { color: var(--pvc-ink); font-size: 16px; line-height: 1.2; letter-spacing: -.045em; font-weight: 640; }
.pvc-heading h2 span { color: #b7b7bd; font-weight: 450; }
#pv-chat .pvc-presence { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11.5px; line-height: 1.25; color: var(--pvc-muted); }
.pvc-presence > span:first-child { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #8a8a91; }
#pv-chat:is([data-status="joined"], [data-status="intro"]) .pvc-presence > span:first-child { background: var(--pvc-green); box-shadow: 0 0 7px #63e5af42; }
#pv-chat[data-status="waiting"] .pvc-presence > span:first-child { background: #e6bb79; }
.pvc-ticket { color: #a2a2a9; font: 10px/1.4 "Geist Mono", ui-monospace, monospace; letter-spacing: .02em; }
#pv-chat .pvc-minimize {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px;
  padding: 0; border: 1px solid transparent; border-radius: 50%; color: #b6b6bd; background: transparent;
}
#pv-chat .pvc-minimize:hover { background: var(--pvc-raised); color: white; }
.pvc-intake, .pvc-history { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #45454c transparent; }
.pvc-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 124px;
  overflow: hidden;
  isolation: isolate;
  padding: 17px 22px 12px;
  background: radial-gradient(ellipse at 92% 51%, #1b1b20 0%, transparent 65%);
}
.pvc-hero::before {
  content: ""; position: absolute; inset: 0 0 0 42%; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, #ffffff24 .65px, transparent .9px);
  background-size: 6px 6px;
  mask-image: radial-gradient(ellipse at 75% 43%, #0009, transparent 77%);
}
#pv-chat .pvc-hero h3 { position: relative; z-index: 1; font-size: 34px; font-weight: 540; line-height: 1.04; letter-spacing: -.065em; color: var(--pvc-ink); }
.pvc-hero h3 span { display: block; color: #c4c4ca; }
.pvc-art { position: relative; width: 110px; height: 90px; flex: none; margin: 0 2px 0 8px; pointer-events: none; }
.pvc-art i {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: 13px 13px 13px 3px;
  transform: perspective(190px) rotateY(-23deg) rotateX(12deg) rotateZ(-10deg);
}
.pvc-card-back {
  width: 65px; height: 43px; top: 9px; right: 0;
  background: linear-gradient(155deg, #65656c, #353539 20%, #242427 80%);
  border: 1px solid #727277; box-shadow: 0 3px 0 #29292c, 0 10px 12px #0007;
}
.pvc-card-back::after { content: ""; width: 29px; height: 3px; border-radius: 3px; background: #a9a9b0; box-shadow: 0 6px #73737b; }
.pvc-card-front {
  width: 76px; height: 50px; top: 32px; right: 26px;
  background: linear-gradient(152deg, #515156 0%, #343438 27%, #242426 66%, #19191b);
  border: 1px solid #77777b; box-shadow: inset 0 1px #ffffff20, 0 3px 0 #181819, 0 5px 0 #303033, 0 13px 14px #0009;
}
.pvc-card-front b { width: 6px; height: 6px; border-radius: 50%; background: #dcdcdf; box-shadow: 0 1px 1px #0008; }
.pvc-card-front b:last-child { background: var(--pvc-green); }

.pvc-start { display: grid; gap: 15px; padding: 5px 22px 20px; }
.pvc-pair { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 11px; }
.pvc-start label { display: grid; gap: 7px; min-width: 0; color: #dbdbdf; font-size: 12px; font-weight: 530; }
#pv-chat .pvc-start :is(input, textarea), #pv-chat .pvc-composer textarea {
  display: block; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 10px 12px;
  border: 1px solid #37373c; border-radius: 10px; background: var(--pvc-field); color: var(--pvc-ink);
  font-size: 14px; font-weight: 400; line-height: 1.45; box-shadow: none;
}
#pv-chat :is(input, textarea)::placeholder { color: #95959e; opacity: 1; }
#pv-chat .pvc-start textarea { min-height: 82px; max-height: 150px; resize: vertical; }
#pv-chat .pvc-start :is(input, textarea):focus { outline: 2px solid #aaaaaf; outline-offset: 1px; }
#pv-chat .pvc-primary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 46px;
  padding: 10px 17px; border: 1px solid #fff9; border-radius: 100px; background: #ededf0; color: #111114;
  font-size: 14px; font-weight: 620; letter-spacing: -.015em; transition: background .15s ease;
}
#pv-chat .pvc-primary:enabled:hover, #pv-chat .pvc-send:enabled:hover { background: #fff; }
#pv-chat :is(.pvc-primary, .pvc-send):disabled { color: #9999a1; border-color: var(--pvc-line); background: var(--pvc-raised); }
#pv-chat .pvc-disclosure { display: flex; align-items: flex-start; gap: 7px; font-size: 11.5px; line-height: 1.52; color: var(--pvc-muted); }
#pv-chat .pvc-disclosure svg { width: 13px; height: 13px; margin-top: 2px; }
#pv-chat .pvc-disclosure a { color: #d1d1d6; text-decoration: underline; text-decoration-color: #696971; text-underline-offset: 2px; }
#pv-chat .pvc-offline-note, #pv-chat .pvc-feedback { font-size: 12px; color: var(--pvc-muted); }
#pv-chat .pvc-offline-note { padding-inline-start: 9px; border-inline-start: 2px solid #88888e; }
#pv-chat .pvc-feedback { padding: 10px 16px; border-top: 1px solid var(--pvc-line); background: var(--pvc-field); }

.pvc-thread { display: flex; flex-direction: column; min-height: 0; }
.pvc-history { flex: 1 1 auto; display: flex; flex-direction: column; gap: 17px; height: min(360px, 43vh); padding: 20px 18px; }
.pvc-message { display: flex; flex-direction: column; align-self: flex-start; align-items: flex-start; max-width: 87%; min-width: 0; }
.pvc-message.pvc-own { align-self: flex-end; align-items: flex-end; }
.pvc-byline { display: flex; align-items: center; gap: 7px; padding: 0 2px 5px; color: #c2c2c8; font-size: 11px; line-height: 1.4; font-weight: 540; }
.pvc-byline time { color: #a4a4ab; font-weight: 400; font-variant-numeric: tabular-nums; }
.pvc-staff .pvc-byline::before { content: ""; width: 14px; height: 14px; background: url("/images/favicon.svg") center/contain no-repeat; }
.pvc-message > span { max-width: 100%; padding: 10px 14px; border-radius: 16px 16px 16px 4px; border: 1px solid #333338; color: var(--pvc-ink); background: #202023; overflow-wrap: anywhere; white-space: pre-wrap; text-align: start; unicode-bidi: plaintext; line-height: 1.5; }
.pvc-own > span { border-radius: 16px 16px 4px 16px; border-color: #d4d4d8; color: #161618; background: #e6e6e9; }
.pvc-event { align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--pvc-muted); font-size: 12px; text-align: center; line-height: 1.45; }
.pvc-event::before, .pvc-event::after { content: ""; flex: 0 1 19px; height: 1px; background: #36363b; }
.pvc-footer { flex: none; padding: 13px; border-top: 1px solid var(--pvc-line); background: #111113; }
.pvc-composer { display: flex; align-items: flex-end; gap: 6px; padding: 4px; border: 1px solid #39393f; border-radius: 15px; background: var(--pvc-field); }
#pv-chat .pvc-composer textarea { flex: 1; min-height: 37px; max-height: 104px; padding: 8px; border: 0; background: transparent; resize: none; }
#pv-chat .pvc-composer textarea:focus { outline: 0; }
.pvc-composer:focus-within { border-color: #a3a3aa; }
#pv-chat .pvc-send { display: grid; place-items: center; flex: none; width: 39px; height: 39px; padding: 0; border: 1px solid transparent; border-radius: 11px; background: #ededf0; color: #141417; }
.pvc-loading, .pvc-failure { display: grid; justify-items: center; align-content: center; gap: 12px; min-height: min(230px, 30vh); padding: 20px; text-align: center; }
.pvc-loading p, .pvc-failure p, .pvc-failure-icon { color: var(--pvc-muted); }
.pvc-loader { width: 23px; height: 23px; border: 2px solid #38383e; border-top-color: #d4d4d9; border-radius: 50%; animation: pvc-spin .85s linear infinite; }
@keyframes pvc-spin { to { transform: rotate(360deg); } }
#pv-chat .pvc-failure h3 { font-size: 19px; font-weight: 570; }
#pv-chat .pvc-retry { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 14px; border: 1px solid #414147; border-radius: 22px; background: var(--pvc-raised); color: var(--pvc-ink); }
#pv-chat .pvc-retry svg { width: 16px; height: 16px; }

@media (max-width: 520px) {
  #pv-chat { --pvc-gap: 10px; }
  #pv-chat .pvc-launch { width: 48px; padding: 0; }
  #pv-chat .pvc-launch-text { display: none; }
  #pv-chat .pvc-launch[aria-expanded="true"] { visibility: hidden; }
  #pv-chat .pvc-panel {
    width: min(400px, calc(100vw - var(--pvc-right) - max(10px, env(safe-area-inset-left, 0px))));
    bottom: 0; max-height: calc(100dvh - var(--pvc-bottom) - max(10px, env(safe-area-inset-top, 0px))); border-radius: 20px;
  }
  .pvc-header { min-height: 66px; padding: 10px 12px 10px 18px; }
  .pvc-hero { min-height: 112px; padding: 12px 18px; }
  .pvc-start { padding: 4px 18px 18px; gap: 14px; }
  #pv-chat .pvc-start :is(input, textarea), #pv-chat .pvc-composer textarea { font-size: 16px; }
}
@media (max-width: 355px) {
  .pvc-pair { grid-template-columns: 1fr; }
  #pv-chat .pvc-hero h3 { font-size: 30px; }
  .pvc-art { width: 85px; transform: scale(.84); transform-origin: right center; }
}
@media (max-height: 520px) {
  #pv-chat .pvc-panel { bottom: 0; max-height: calc(100dvh - var(--pvc-bottom) - 8px); }
  #pv-chat .pvc-launch[aria-expanded="true"] { visibility: hidden; }
  .pvc-header { min-height: 52px; padding-block: 5px; }
  .pvc-hero { min-height: 94px; padding-block: 8px; }
  .pvc-art { height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  #pv-chat *, #pv-chat *::before, #pv-chat *::after { animation: none !important; transition: none !important; }
}
