/* ReactorBits Chat Widget */
#rb-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2196F3;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
#rb-chat-toggle:hover {
  transform: scale(1.08);
  background: #1976D2;
}
#rb-chat-toggle svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

#rb-chat-box {
  display: none;
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 10001;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#rb-chat-box.open {
  display: flex;
}

#rb-chat-header {
  background: #2196F3;
  color: #fff;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#rb-chat-header .rb-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

#rb-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rb-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}
.rb-msg.bot {
  background: #f0f0f0;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.rb-msg.user {
  background: #2196F3;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.rb-msg.typing {
  background: #f0f0f0;
  color: #999;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  font-style: italic;
}

#rb-chat-input-area {
  display: flex;
  padding: 10px 12px;
  border-top: 1px solid #eee;
  gap: 8px;
  flex-shrink: 0;
}
#rb-chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
#rb-chat-input:focus {
  border-color: #2196F3;
}
#rb-chat-send {
  background: #2196F3;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
#rb-chat-send:hover {
  background: #1976D2;
}
#rb-chat-send:disabled {
  background: #ccc;
  cursor: not-allowed;
}
#rb-chat-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

@media (max-width: 420px) {
  #rb-chat-box {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  #rb-chat-toggle {
    bottom: 16px;
    right: 16px;
  }
}
