#chat-button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border: 2px solid #fe3d00;
  border-radius: 999px;
  background: #1b0b32;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(27, 11, 50, 0.28);
  z-index: 1000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

.chat-button-photo,
.chat-agent-photo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  object-fit: cover;
}

.chat-button-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.chat-button-copy strong {
  font-size: 15px;
}

.chat-button-copy small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
}

#chat-widget {
  position: fixed;
  right: 20px;
  bottom: 100px;
  width: 320px;
  max-height: 440px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  background: #f0f0f0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  z-index: 999;
}

#chat-widget.hidden {
  display: none;
}

#chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #1f2742;
  color: #fff;
}

.chat-agent-photo {
  width: 40px;
  height: 40px;
}

#chat-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.chat-agent {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-agent-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.chat-agent-meta strong {
  font-size: 15px;
}

.chat-agent-meta span {
  font-size: 12px;
  color: #8bf0b8;
}

#chat-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 10px;
}

.bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.bot {
  align-self: flex-start;
  background-color: #eef4ff;
}

.user {
  align-self: flex-end;
  background-color: #ffe6d4;
}

#chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  padding: 10px;
  border-top: 1px solid #ccc;
}

#chat-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px;
  border: none;
  outline: none;
  font-size: 14px;
}

#chat-send-button {
  min-width: 80px;
  min-height: 40px;
  flex-shrink: 0;
  padding: 10px 16px;
  border: none;
  background-color: #fe3d00;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

@media screen and (max-width: 768px) {
  #chat-widget {
    width: 95%;
    right: 2.5%;
    left: auto;
    bottom: 92px;
    max-height: 85%;
    border-radius: 12px;
  }

  #chat-button {
    right: 12px;
    bottom: 14px;
    padding-right: 12px;
  }

  .chat-button-copy strong {
    font-size: 14px;
  }

  .chat-button-copy small {
    display: none;
  }
}
