/* MLLE chat widget — minimal styles, brand-consistent */
.chat-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #5C0C0F;
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 14px 22px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 999;
  transition: transform 0.15s ease;
}
.chat-fab:hover { transform: translateY(-2px); }

.chat-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: min(380px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 40px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  font-family: inherit;
}
.chat-panel.active { display: flex; }

.chat-header {
  background: #5C0C0F;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-header h3 { margin: 0; font-size: 16px; font-weight: 500; }
.chat-header .chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #faf7f3;
}
.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: #5C0C0F;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #222;
  border: 1px solid #eee;
  border-bottom-left-radius: 4px;
}
.chat-msg.bot.thinking { color: #888; font-style: italic; }
.chat-msg.error { background: #fee; color: #900; align-self: center; font-size: 13px; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eee;
  background: #fff;
}
.chat-input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.chat-input-row input:focus { border-color: #5C0C0F; }
.chat-input-row button {
  background: #5C0C0F;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0 18px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.chat-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

/* RTL support when Arabic is active */
.chat-panel.rtl .chat-msg.user { align-self: flex-start; border-bottom-left-radius: 4px; border-bottom-right-radius: 14px; }
.chat-panel.rtl .chat-msg.bot { align-self: flex-end; border-bottom-right-radius: 4px; border-bottom-left-radius: 14px; }
.chat-panel.rtl .chat-messages { direction: rtl; }
.chat-panel.rtl .chat-input-row input { text-align: right; }
