#mm-livechat-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2500;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
#mm-livechat-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e67e22;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform 0.2s, background 0.2s;
}
#mm-livechat-label {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #2c3e50;
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  pointer-events: none;
}
#mm-livechat-btn:hover {
  transform: scale(1.08);
  background: #cf6d17;
}
#mm-livechat-btn .mm-lc-unread {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #e74c3c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 20px;
}

#mm-livechat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 360px;
  height: 480px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  z-index: 2500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: mm-lc-slide-up 0.25s ease-out;
}
@keyframes mm-lc-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#mm-livechat-header {
  background: #2c3e50;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#mm-livechat-header-title {
  font-size: 15px;
  font-weight: 600;
}
#mm-livechat-header-sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}
#mm-livechat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.7;
}
#mm-livechat-close:hover { opacity: 1; }

/* Onboarding form */
#mm-livechat-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 24px;
  gap: 14px;
  background: #f5f6fa;
}
.mm-lc-form-sub {
  font-size: 14px;
  color: #666;
  text-align: center;
  margin: 0 0 4px;
}
#mm-livechat-form input {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
#mm-livechat-form input:focus { border-color: #e67e22; }
#mm-livechat-form-submit {
  background: #e67e22;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
#mm-livechat-form-submit:hover { background: #cf6d17; }

/* Chat area */
#mm-livechat-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#mm-livechat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f5f6fa;
}

.mm-lc-msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
}
.mm-lc-msg-agent {
  align-self: flex-start;
  background: #e9ecef;
  color: #222;
  border-bottom-left-radius: 4px;
}
.mm-lc-msg-client {
  align-self: flex-end;
  background: #e67e22;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.mm-lc-msg-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 3px;
  display: block;
}
.mm-lc-msg-client .mm-lc-msg-time { text-align: right; }

.mm-lc-typing {
  align-self: flex-start;
  padding: 8px 14px;
  background: #e9ecef;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  display: none;
  gap: 4px;
  align-items: center;
}
.mm-lc-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: mm-lc-bounce 1.2s infinite;
}
.mm-lc-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.mm-lc-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes mm-lc-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

#mm-livechat-offline {
  padding: 10px 14px;
  background: #fff3cd;
  color: #856404;
  font-size: 13px;
  text-align: center;
  display: none;
  flex-shrink: 0;
}

#mm-livechat-input-area {
  display: flex;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e9ecef;
  flex-shrink: 0;
  gap: 8px;
  align-items: flex-end;
}
#mm-livechat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
  font-family: inherit;
}
#mm-livechat-input:focus { border-color: #e67e22; }
#mm-livechat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e67e22;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.15s;
}
#mm-livechat-send:hover { background: #cf6d17; }
#mm-livechat-send:disabled { background: #ccc; cursor: default; }

/* Mobile */
@media (max-width: 480px) {
  #mm-livechat-panel {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 8px;
    height: calc(100vh - 80px);
    max-height: none;
    border-radius: 10px;
  }
  #mm-livechat-btn {
    bottom: 16px;
    right: 16px;
  }
}
