.site-chat {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1050;
  font-family: var(--primary-font, inherit);
}

.site-chat__fab {
  border: 2px solid var(--text-color, #222);
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  /* Use text/background pair so dark mode stays readable (primary is light in dark theme) */
  background: var(--text-color, #222);
  color: var(--background-color, #fff);
  box-shadow: 0 8px 20px rgb(14 23 44 / 22%);
  cursor: pointer;
}

.site-chat__fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px rgb(14 23 44 / 28%);
}

.site-chat__panel {
  position: absolute;
  right: 0;
  bottom: 4.1rem;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(520px, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--secondary-color, #fff);
  color: var(--text-color, #222);
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgb(15 80 100 / 22%);
  overflow: hidden;
}

.site-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.35rem;
}

.site-chat__close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.site-chat__hint {
  margin: 0;
  padding: 0 1rem 0.6rem;
  font-size: 0.82rem;
  color: var(--text-secondary-color, #666);
}

.site-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 180px;
}

.site-chat__bubble {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.site-chat__bubble--user {
  align-self: flex-end;
  background: var(--text-color, #222);
  color: var(--background-color, #fff);
}

.site-chat__bubble--bot {
  align-self: flex-start;
  background: var(--background-color, #f3f5f7);
  color: var(--text-color, #222);
}

.site-chat__bubble--muted {
  opacity: 0.75;
  font-style: italic;
}

.site-chat__form {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgb(15 80 100 / 12%);
}

.site-chat__form input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgb(15 80 100 / 18%);
  border-radius: 0.55rem;
  padding: 0.55rem 0.7rem;
  background: var(--background-color, #fff);
  color: inherit;
}

.site-chat__form button {
  border: none;
  border-radius: 0.55rem;
  padding: 0.55rem 0.85rem;
  background: var(--text-color, #222);
  color: var(--background-color, #fff);
  cursor: pointer;
}

.site-chat__form button:disabled,
.site-chat__fab:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
