#n8n-chat {
  --chat--color--primary: #3858e9;
  --chat--color--primary-shade-50: #2843c2;
  --chat--color--primary--shade-100: #1f3494;
  --chat--color--secondary: #3858e9;
  --chat--color-secondary-shade-50: #2843c2;
  --chat--color-white: #ffffff;
  --chat--color-light: #f5f6f8;
  --chat--color-light-shade-50: rgba(0, 0, 0, 0.05);
  --chat--color-light-shade-100: rgba(0, 0, 0, 0.08);
  --chat--color-medium: #c7c9d1;
  --chat--color-dark: #0b0b0e;
  --chat--color-disabled: #c7c9d1;
  --chat--color-typing: #6b6c76;

  --chat--spacing: 1rem;
  --chat--border-radius: 0.75rem;
  --chat--transition-duration: 0.2s;
  --chat--font-family: 'Inter', sans-serif;

  --chat--window--width: 400px;
  --chat--window--height: 640px;
  --chat--window--bottom: 1.5rem;
  --chat--window--right: 1.5rem;
  --chat--window--border: 1px solid rgba(0, 0, 0, 0.08);
  --chat--window--border-radius: 1.25rem;
  --chat--window--margin-bottom: 1rem;

  --chat--header-height: auto;
  --chat--header--padding: 1.5rem 1.5rem 1.25rem;
  --chat--header--background: #ffffff;
  --chat--header--color: #0b0b0e;
  --chat--header--border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  --chat--heading--font-size: 1.375rem;
  --chat--subtitle--font-size: 0.875rem;
  --chat--subtitle--line-height: 1.5;

  --chat--message--font-size: 0.9375rem;
  --chat--message--padding: 0.75rem 1rem;
  --chat--message--border-radius: 0.875rem;
  --chat--message-line-height: 1.6;
  --chat--message--margin-bottom: 0.75rem;
  --chat--message--bot--background: #f5f6f8;
  --chat--message--bot--color: #1a1a1f;
  --chat--message--bot--border: 1px solid rgba(0, 0, 0, 0.06);
  --chat--message--user--background: #3858e9;
  --chat--message--user--color: #ffffff;
  --chat--message--user--border: none;
  --chat--message--pre--background: rgba(0, 0, 0, 0.05);

  --chat--body--background: #ffffff;
  --chat--footer--background: #ffffff;
  --chat--footer--color: #6b6c76;
  --chat--footer--border-top: 1px solid rgba(0, 0, 0, 0.08);

  --chat--textarea--height: 50px;
  --chat--input--border: 1px solid rgba(0, 0, 0, 0.12);
  --chat--input--border-radius: 0.75rem;
  --chat--input--background: #f5f6f8;
  --chat--input--text-color: #1a1a1f;
  --chat--input--placeholder--font-size: 0.875rem;
  --chat--input--border-active: 1px solid #3858e9;
  --chat--input--container--background: #f5f6f8;
  --chat--input--container--border: 1px solid rgba(0, 0, 0, 0.12);
  --chat--input--container--border-radius: 0.875rem;
  --chat--input--button--border-radius: 0.625rem;

  --chat--button--border-radius: 9999px;
  --chat--button--color--primary: #ffffff;
  --chat--button--background--primary: #3858e9;
  --chat--button--color--primary--hover: #ffffff;
  --chat--button--background--primary--hover: #2843c2;

  --chat--toggle--size: 60px;
  --chat--toggle--background: #3858e9;
  --chat--toggle--hover--background: #2843c2;
  --chat--toggle--active--background: #1f3494;
  --chat--toggle--color: #ffffff;

  --chat--input--send--button--background: transparent;
  --chat--input--send--button--color: #3858e9;
  --chat--input--send--button--background-hover: transparent;
  --chat--input--send--button--color-hover: #2843c2;
}

.chat-window-wrapper .chat-window {
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.6);
}
.chat-window-wrapper .chat-window-toggle {
  box-shadow: 0 14px 34px -14px rgba(56, 88, 233, 0.55);
}
.chat-layout .chat-header h1 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Sofia pop-up: attention-grabbing teaser next to the chat toggle */
@keyframes chat-toggle-shake {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-10deg); }
  30% { transform: rotate(9deg); }
  45% { transform: rotate(-7deg); }
  60% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
}
@keyframes chat-teaser-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-10px) scale(1); }
  55% { transform: translateY(0) scale(1); }
  75% { transform: translateY(-4px) scale(1); }
}
@keyframes chat-typing-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
@keyframes chat-ring {
  0% { opacity: 0.65; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.7); }
}
@keyframes chat-badge-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.chat-window-wrapper .chat-window-toggle.chat-shake {
  animation: chat-toggle-shake 0.6s ease-in-out;
}
.chat-window-wrapper .chat-window-toggle.chat-has-alert {
  position: relative;
  overflow: visible;
}
.chat-alert-ring {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 2px solid #3858e9;
  pointer-events: none;
  animation: chat-ring 1.8s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}
.chat-alert-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #e5484d;
  color: #ffffff;
  font: 700 11px/20px 'Inter', sans-serif;
  text-align: center;
  box-shadow: 0 0 0 2px #ffffff;
  pointer-events: none;
  animation: chat-badge-pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

#chat-teaser {
  position: fixed;
  right: 1.5rem;
  bottom: calc(1.5rem + 60px + 0.875rem); /* clears the 60px toggle + its 1.5rem inset */
  z-index: 998;
  width: 272px;
  background: #191921;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.35), 0 22px 48px -18px rgba(11, 11, 14, 0.65), 0 12px 30px -16px rgba(56, 88, 233, 0.45);
  border-radius: 1.125rem 1.125rem 0.25rem 1.125rem;
  padding: 0.875rem 0.875rem 0.875rem 0.9375rem;
  opacity: 0;
  transform: translateY(14px) scale(0.94);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.42s cubic-bezier(0.2, 1.3, 0.4, 1);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
#chat-teaser.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#chat-teaser.is-bouncing {
  animation: chat-teaser-bounce 0.75s ease;
}
#chat-teaser:focus-visible {
  outline: 2px solid #3858e9;
  outline-offset: 3px;
}
.chat-teaser-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding-right: 1.25rem;
  margin-bottom: 0.625rem;
}
.chat-teaser-avatar {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #3858e9, #2843c2);
  color: #ffffff;
  font: 600 15px/38px 'Unbounded', 'Inter', sans-serif;
  text-align: center;
}
.chat-teaser-avatar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: #3ecf8e;
  box-shadow: 0 0 0 2px #191921;
}
.chat-teaser-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
}
.chat-teaser-status {
  display: flex;
  align-items: center;
  gap: 0.3125rem;
  font-size: 0.75rem;
  color: #8ee4b8;
  line-height: 1.3;
}
.chat-teaser-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #3ecf8e;
  box-shadow: 0 0 0 2px rgba(62, 207, 142, 0.25);
  flex-shrink: 0;
}
.chat-teaser-typing {
  display: flex;
  gap: 4px;
  padding: 0.375rem 0 0.5rem;
}
.chat-teaser-typing i {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #a3a4b0;
  animation: chat-typing-dot 1s infinite;
}
.chat-teaser-typing i:nth-child(2) { animation-delay: 0.15s; }
.chat-teaser-typing i:nth-child(3) { animation-delay: 0.3s; }
#chat-teaser p {
  display: none;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #eceef2;
  margin: 0 0 0.75rem;
}
.chat-teaser-cta {
  display: none;
  width: 100%;
  border: none;
  border-radius: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: #3858e9;
  color: #ffffff;
  font: 600 0.875rem/1.2 'Inter', sans-serif;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.chat-teaser-cta:hover { opacity: 0.9; }
.chat-teaser-cta:active { transform: scale(0.98); }
.chat-teaser-cta:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
#chat-teaser.is-ready .chat-teaser-typing { display: none; }
#chat-teaser.is-ready p,
#chat-teaser.is-ready .chat-teaser-cta { display: block; }
#chat-teaser-dismiss {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: #a3a4b0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: opacity 0.15s ease;
}
#chat-teaser-dismiss:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
#chat-teaser-dismiss:focus-visible { outline: 2px solid #3858e9; }
@media (max-width: 480px) {
  #chat-teaser { right: 1rem; width: 248px; }
}
@media (prefers-reduced-motion: reduce) {
  #chat-teaser,
  #chat-teaser.is-bouncing,
  .chat-teaser-typing i,
  .chat-alert-ring,
  .chat-alert-badge,
  .chat-window-wrapper .chat-window-toggle.chat-shake {
    animation: none !important;
    transition: opacity 0.2s ease !important;
  }
  .chat-alert-ring { display: none; }
}
