.vsa-chat {
  --chat-ink: #172e39;
  --chat-muted: #425751;
  --chat-accent: #185a56;
  --chat-line: #cddcd6;
  --chat-wash: #f3f7f5;
  --chat-inset-bottom: max(18px, env(safe-area-inset-bottom, 0px));
  --chat-inset-right: max(18px, env(safe-area-inset-right, 0px));
  color: var(--chat-ink);
  font: 15px/1.45 system-ui, sans-serif;
  position: fixed;
  right: var(--chat-inset-right);
  bottom: var(--chat-inset-bottom);
  z-index: 1000;
}
.vsa-chat, .vsa-chat *, .vsa-chat *::before, .vsa-chat *::after { box-sizing: border-box; }
.vsa-chat [hidden] { display: none !important; }
.vsa-chat :is(button,input,a):focus-visible { outline: 2px solid var(--chat-accent); outline-offset: 3px; }
.vsa-chat button { font: inherit; cursor: pointer; }
.vsa-chat-launch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  border: 1px solid #9bbab2;
  border-radius: 999px;
  padding: 9px 15px;
  background: white;
  color: var(--chat-accent);
  font-weight: 700 !important;
  box-shadow: 0 3px 12px #172e3915;
}
.vsa-chat-launch:hover, .vsa-chat-suggestions button:hover { background: var(--chat-wash); }
.vsa-chat-invite {
  position: absolute;
  right: 0;
  bottom: 55px;
  width: min(263px, calc(100vw - 2 * var(--chat-inset-right)));
  padding: 12px 45px 11px 14px;
  background: white;
  border: 1px solid var(--chat-line);
  border-radius: 12px;
  box-shadow: 0 4px 16px #172e391a;
}
.vsa-chat-invite p { margin: 0; color: var(--chat-ink); font-weight: 650; }
.vsa-chat-invite-dismiss {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--chat-muted);
  background: white;
  border: 0;
  border-radius: 7px;
  font-size: 22px !important;
}
.vsa-chat-invite-dismiss:hover { background: var(--chat-wash); }
.vsa-chat-icon {
  width: 15px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  position: relative;
}
.vsa-chat-icon::after {
  content: "";
  width: 5px;
  height: 5px;
  position: absolute;
  inset: auto auto -3px 2px;
  background: white;
  border-bottom: 1.5px solid;
  border-right: 1.5px solid;
  transform: skewY(42deg);
}
.vsa-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(365px, calc(100vw - 2 * var(--chat-inset-right)));
  height: min(490px, calc(100vh - 2 * var(--chat-inset-bottom)));
  height: min(490px, calc(100dvh - 2 * var(--chat-inset-bottom)));
  border: 1px solid var(--chat-line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 12px 36px #172e3926;
  overflow: hidden;
}
.vsa-chat-header {
  border-bottom: 1px solid var(--chat-line);
  padding: 13px 14px 12px 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vsa-chat-header p { font-size: 12px; color: var(--chat-accent); font-weight: 700; margin: 0 0 2px; }
.vsa-chat-header h2 { font: 400 25px/1.2 Georgia, serif; color: var(--chat-ink); margin: 0; }
.vsa-chat-close {
  border: 0;
  background: white;
  color: var(--chat-muted);
  border-radius: 7px;
  font-size: 25px !important;
  width: 44px;
  height: 44px;
  padding: 0;
}
.vsa-chat-close:hover { background: var(--chat-wash); }
.vsa-chat-conversation { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.vsa-chat-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 15px 16px; }
.vsa-chat-intro { color: var(--chat-muted); margin: 0 0 12px; }
.vsa-chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.vsa-chat-suggestions button {
  border: 1px solid var(--chat-line);
  color: var(--chat-accent);
  border-radius: 8px;
  padding: 7px 9px;
  background: white;
  font-weight: 600;
  min-height: 36px;
  font-size: 13px;
}
.vsa-chat-log { display: flex; flex-direction: column; gap: 8px; }
.vsa-chat-suggestions:not([hidden]) + .vsa-chat-log:not(:empty) { margin-top: 14px; }
.vsa-chat-message { padding: 9px 11px; border-radius: 10px; max-width: 97%; overflow-wrap: anywhere; }
.vsa-chat-message p { color: var(--chat-ink); margin: 0; }
.vsa-chat-message .vsa-chat-suggestions { margin-top: 9px; }
.vsa-chat-message--question { background: #e0eee9; align-self: end; }
.vsa-chat-message--answer { background: var(--chat-wash); align-self: start; border: 1px solid #e3ebe7; }
.vsa-chat-message a { display: block; margin-top: 6px; color: var(--chat-accent); font-size: 14px; font-weight: 650; }
.vsa-chat-typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 20px;
}
.vsa-chat-typing-dots > span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chat-accent);
  opacity: .55;
  animation: vsa-chat-dot 750ms ease-in-out infinite;
}
.vsa-chat-typing-dots > span:nth-child(2) { animation-delay: 100ms; }
.vsa-chat-typing-dots > span:nth-child(3) { animation-delay: 200ms; }
@keyframes vsa-chat-dot {
  0%, 100% { opacity: .55; }
  35% { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .vsa-chat-typing-dots > span { animation: none; }
}
.vsa-chat-bottom { border-top: 1px solid var(--chat-line); padding: 12px 16px 0; }
.vsa-chat-question { display: flex; gap: 7px; margin: 0 0 6px; }
.vsa-chat .vsa-chat-question input {
  color: var(--chat-ink);
  border: 1px solid #9bbab2;
  border-radius: 7px;
  padding: 9px 10px;
  background: white;
  min-width: 0;
  font: 16px/1.35 system-ui, sans-serif;
}
.vsa-chat-question input { width: 100%; }
.vsa-chat .vsa-chat-primary {
  border: 1px solid var(--chat-accent);
  border-radius: 7px;
  padding: 9px 12px;
  min-height: 42px;
  background: var(--chat-accent);
  color: white;
  font-weight: 700;
}
.vsa-chat .vsa-chat-primary:hover { background: #104441; }
.vsa-chat .vsa-chat-text-button {
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--chat-accent);
  font-size: 14px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.vsa-chat-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; padding: 0 16px 8px; }
.vsa-chat-footer .vsa-chat-text-button { display: inline-flex; align-items: center; min-height: 44px; }
.vsa-chat-visually-hidden { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
@media (max-width: 480px) {
  .vsa-chat { --chat-inset-right: max(12px, env(safe-area-inset-right, 0px)); --chat-inset-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
}
