.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pv-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 13px 18px;
  box-shadow: 0 16px 44px rgb(12 32 54 / 28%);
  font: 700 14px var(--app-font-sans);
  cursor: pointer;
}

.pv-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: 90;
  display: none;
  width: min(390px, calc(100vw - 28px));
  height: min(690px, calc(100vh - 112px));
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: 18px;
  background: hsl(var(--card));
  box-shadow: 0 25px 70px rgb(12 32 54 / 32%);
  grid-template-rows: auto minmax(120px, 1fr) auto auto auto;
}

.pv-chat-panel.is-open { display: grid; }

.pv-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.pv-chat-header strong,
.pv-chat-header small { display: block; }
.pv-chat-header small { opacity: .72; margin-top: 2px; }
.pv-chat-header button { border: 0; background: transparent; color: inherit; font-size: 28px; cursor: pointer; }

.pv-chat-messages {
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, hsl(var(--background)), hsl(var(--card)));
}

.pv-chat-message {
  max-width: 88%;
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.pv-chat-message.bot { background: white; border: 1px solid hsl(var(--border)); border-bottom-left-radius: 4px; }
.pv-chat-message.user { margin-left: auto; background: hsl(var(--secondary)); color: hsl(var(--primary)); border-bottom-right-radius: 4px; }
.pv-chat-message a { color: inherit; font-weight: 700; }

.pv-chat-quick { display: flex; gap: 7px; overflow-x: auto; padding: 10px 12px 0; }
.pv-chat-quick button { flex: 0 0 auto; border: 1px solid hsl(var(--primary) / .25); border-radius: 999px; background: transparent; padding: 7px 10px; color: hsl(var(--primary)); font: 700 11px var(--app-font-sans); cursor: pointer; }

.pv-chat-composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; }
.pv-chat-composer input,
.pv-chat-lead input { width: 100%; border: 1px solid hsl(var(--border)); border-radius: 8px; background: white; padding: 10px 11px; font: 13px var(--app-font-sans); }
.pv-chat-composer input:focus,
.pv-chat-lead input:focus { outline: 2px solid hsl(var(--secondary)); outline-offset: 1px; }
.pv-chat-composer button,
.pv-chat-lead > button { border: 0; border-radius: 8px; background: hsl(var(--primary)); color: white; padding: 10px 13px; font: 700 12px var(--app-font-sans); cursor: pointer; }

.pv-chat-lead { overflow-y: auto; max-height: 390px; padding: 12px; border-top: 1px solid hsl(var(--border)); background: hsl(var(--background)); }
.pv-chat-lead > * + * { margin-top: 8px; }
.pv-chat-lead small { color: hsl(var(--muted-foreground)); }
.pv-chat-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pv-chat-consent { display: flex; align-items: flex-start; gap: 7px; font-size: 10px; line-height: 1.4; color: hsl(var(--muted-foreground)); }
.pv-chat-consent input { width: auto; margin-top: 2px; }
.pv-chat-status { font-size: 11px; color: hsl(var(--muted-foreground)); }
.pv-chat-disclaimer { padding: 8px 12px 10px; border-top: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); font-size: 9px; line-height: 1.35; }

@media (max-width: 520px) {
  .pv-chat-launcher { right: 14px; bottom: 14px; }
  .pv-chat-panel { inset: 10px 10px 72px; width: auto; height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .pv-chat-launcher, .pv-chat-panel { scroll-behavior: auto; }
}
