.chat-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #dbdbdb;
  z-index: 30;
  padding: 0.75rem 1rem;
}

.chat-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 3.25rem;
  height: calc(100vh - 3.25rem);
  background: #fff;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-overlay.is-hidden {
  display: none;
}

.chat-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #dbdbdb;
}

.chat-overlay-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background-color: #f9f9f9;
}

.chat-overlay-input {
  border-top: 1px solid #dbdbdb;
  padding: 0.75rem 0;
}

.chat-message {
  padding: 0.5rem 0.75rem;
  max-width: 75%;
  word-wrap: break-word;
  font-size: 0.9rem;
  line-height: 1.45;
  position: relative;
}

.chat-message--user {
  background-color: #00d1b2;
  color: #fff;
  align-self: flex-end;
  border-radius: 1.125rem 1.125rem 0.25rem 1.125rem;
}

.chat-message--assistant {
  background-color: #fff;
  color: #363636;
  align-self: flex-start;
  border-radius: 1.125rem 1.125rem 1.125rem 0.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.chat-bar-field {
  margin-bottom: 0;
}

.chat-bar-placeholder {
  color: #b5b5b5;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
}

.chat-bar-placeholder:focus,
.chat-bar-placeholder:active {
  border-color: #dbdbdb;
  box-shadow: none;
}

.chat-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background-color: #f5f5f5;
  border-radius: 0.75rem;
  width: fit-content;
}

.chat-typing-indicator span {
  width: 8px;
  height: 8px;
  background-color: #b5b5b5;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.chat-typing-indicator span:nth-child(1) { animation-delay: 0s; }
.chat-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

body.has-chat-bar {
  padding-bottom: 4rem;
}
