.site-chat-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 55;
  font-family: inherit;
}

.site-chat-fab {
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: var(--ggg-radius-btn, 9999px);
  background: linear-gradient(
    to bottom right,
    var(--ggg-primary, #2563eb),
    var(--ggg-secondary, #64748b)
  );
  color: #fff;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  font-size: 1.375rem;
  line-height: 1;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.site-chat-fab:hover {
  filter: brightness(1.06);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.22);
}

.site-chat-fab:active {
  filter: brightness(0.96);
}

@keyframes site-chat-breathe {
  from {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.4;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.site-chat-fab .bx-breathe {
  transform-origin: center;
  animation: site-chat-breathe 3s infinite ease-in-out;
}

.site-chat-root.is-open .site-chat-fab .bx-breathe {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .site-chat-fab .bx-breathe {
    animation: none;
  }
}

.site-chat-panel {
  position: absolute;
  right: 0;
  bottom: 4rem;
  width: min(24rem, calc(100vw - 2rem));
  height: min(34rem, calc(100dvh - 6rem));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgb(229 231 235);
  border-radius: var(--ggg-radius-card, 1rem);
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.18);
  overflow: hidden;
}

[data-theme="dark"] .site-chat-panel {
  background: rgb(17 24 39);
  border-color: rgb(55 65 81);
}

.site-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid rgb(229 231 235);
}

[data-theme="dark"] .site-chat-header {
  border-color: rgb(55 65 81);
}

.site-chat-header-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.site-chat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--ggg-primary, #2563eb) 12%, transparent);
  color: var(--ggg-primary, #2563eb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.site-chat-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: rgb(17 24 39);
}

[data-theme="dark"] .site-chat-title {
  color: #fff;
}

.site-chat-subtitle {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  color: rgb(107 114 128);
}

.site-chat-close {
  border: 0;
  background: transparent;
  color: rgb(107 114 128);
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.site-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-chat-bubble {
  max-width: 92%;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.site-chat-bubble--bot {
  align-self: flex-start;
  background: rgb(243 244 246);
  color: rgb(31 41 55);
}

[data-theme="dark"] .site-chat-bubble--bot {
  background: rgb(31 41 55);
  color: rgb(229 231 235);
}

.site-chat-bubble--user {
  align-self: flex-end;
  background: var(--ggg-primary, #2563eb);
  color: #fff;
}

@keyframes site-chat-typing-dot {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-0.1875rem);
  }
}

.site-chat-bubble--typing {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 3rem;
  min-height: 2.25rem;
}

.site-chat-bubble--typing span {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: currentColor;
  animation: site-chat-typing-dot 1.2s infinite ease-in-out;
}

.site-chat-bubble--typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.site-chat-bubble--typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .site-chat-bubble--typing span {
    animation: none;
  }
}

.site-chat-bubble a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.site-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
}

.site-chat-suggestions[hidden] {
  display: none !important;
}

.site-chat-chip {
  border: 1px solid rgb(229 231 235);
  background: rgb(249 250 251);
  color: rgb(55 65 81);
  border-radius: 9999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.35;
  max-width: 100%;
  text-align: left;
  cursor: pointer;
}

[data-theme="dark"] .site-chat-chip {
  border-color: rgb(75 85 99);
  background: rgb(31 41 55);
  color: rgb(229 231 235);
}

.site-chat-form {
  padding: 0.75rem 1rem 0.5rem;
  border-top: 1px solid rgb(229 231 235);
}

[data-theme="dark"] .site-chat-form {
  border-color: rgb(55 65 81);
}

.site-chat-field {
  --site-chat-field-inset: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-height: calc(2rem + (2 * var(--site-chat-field-inset)));
  padding: var(--site-chat-field-inset);
  border: 1px solid rgb(209 213 219);
  border-radius: var(--ggg-radius-btn, 9999px);
  background: transparent;
  box-sizing: border-box;
}

[data-theme="dark"] .site-chat-field {
  border-color: rgb(75 85 99);
}

.site-chat-field:focus-within {
  border-color: var(--ggg-primary, #2563eb);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ggg-primary, #2563eb) 20%, transparent);
}

.site-chat-input {
  flex: 1;
  min-width: 0;
  height: 2rem;
  border: 0;
  padding: 0 0 0 0.5rem;
  font: inherit;
  line-height: 2rem;
  background: transparent;
  color: rgb(17 24 39);
  outline: none;
  box-shadow: none;
}

.site-chat-input:focus {
  outline: none;
  box-shadow: none;
}

[data-theme="dark"] .site-chat-input {
  color: #fff;
}

.site-chat-input::placeholder {
  color: rgb(156 163 175);
}

[data-theme="dark"] .site-chat-input::placeholder {
  color: rgb(107 114 128);
}

.site-chat-send {
  width: 2rem;
  height: 2rem;
  margin: 0;
  border: 0;
  border-radius: var(--ggg-radius-btn, 9999px);
  box-sizing: border-box;
  background: rgb(243 244 246);
  color: rgb(31 41 55);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  font-size: 1.125rem;
  line-height: 1;
  transition: background-color 0.2s ease, color 0.2s ease;
}

[data-theme="dark"] .site-chat-send {
  background: rgb(55 65 81);
  color: rgb(229 231 235);
}

.site-chat-send:hover {
  background: rgb(229 231 235);
}

[data-theme="dark"] .site-chat-send:hover {
  background: rgb(75 85 99);
}

.site-chat-send:active {
  background: rgb(209 213 219);
}

[data-theme="dark"] .site-chat-send:active {
  background: rgb(75 85 99);
}

.site-chat-fab i,
.site-chat-send i,
.site-chat-close i,
.site-chat-icon i {
  display: block;
  line-height: 1;
}

.site-chat-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid rgb(243 244 246);
}

[data-theme="dark"] .site-chat-footer {
  border-color: rgb(31 41 55);
}

.site-chat-footer p {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: rgb(107 114 128);
}

.site-chat-footer .bx {
  flex-shrink: 0;
  line-height: 1;
}

.site-chat-root.is-open .site-chat-panel {
  display: flex;
}

.site-chat-root:not(.is-open) .site-chat-panel {
  display: none;
}

.site-chat-root.is-loading .site-chat-send {
  opacity: 0.6;
  pointer-events: none;
}
