* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f4f4;
}

.hidden {
  display: none !important;
}

.chat-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  z-index: 1000;
}

.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100vh - 100px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: #111;
  color: #fff;
}

.chat-header h2 {
  margin: 0;
  font-size: 18px;
}

.chat-header p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

.close-chat {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background: #f8f8f8;
}

.message {
  max-width: 82%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message.user {
  margin-left: auto;
  background: #111;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.bot {
  margin-right: auto;
  background: #e9e9e9;
  color: #111;
  border-bottom-left-radius: 4px;
}

.chat-form,
.lead-form {
  padding: 12px;
  border-top: 1px solid #e5e5e5;
  background: #fff;
}

.chat-form {
  display: flex;
  gap: 10px;
}

.chat-form input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  outline: none;
}

.chat-form button,
.lead-form button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-form input {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  outline: none;
}

@media (max-width: 480px) {
  .chat-toggle {
    right: 12px;
    bottom: 12px;
  }

  .chat-widget {
    right: 12px;
    bottom: 68px;
    width: calc(100vw - 24px);
    height: 72vh;
  }
}