/* Legacy popup chat. Load after page and language styles (layout rank 501). */
#mmc-chat .chat-box,
#mmc-chat .chat-box *,
#mmc-chat .chat-box *::before,
#mmc-chat .chat-box *::after {
  box-sizing: border-box;
}

#mmc-chat .chat-box {
  height: auto;
  right: 16px;
  bottom: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #243446;
}

#mmc-chat .chat-box ul.boxs {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0;
  margin: 0;
}

#mmc-chat .chat-box ul.boxs li.box {
  float: none;
  width: 340px;
  max-width: calc(100vw - 24px);
  height: 460px;
  max-height: calc(100vh - 72px);
  margin: 0;
  background: #fff;
  border: 1px solid #cbd6e2;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 4px 24px rgba(28, 49, 75, .14);
}

#mmc-chat .chat-box ul.boxs li.box .had-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

#mmc-chat .chat-box ul.boxs li.box .box-header {
  display: flex;
  align-items: center;
  flex: 0 0 52px;
  height: 52px;
  padding: 6px 8px 6px 12px;
  background: #fff;
  border-bottom: 1px solid #e1e7ef;
  border-radius: 0;
  color: #1c354f;
}

#mmc-chat .chat-box ul.boxs li.box .box-header .info {
  display: flex;
  align-items: center;
  gap: 10px;
  float: none;
  flex: 1;
  min-width: 0;
  width: auto;
}

#mmc-chat .chat-box ul.boxs li.box .box-header .info span.box-username {
  display: block;
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#mmc-chat .chat-box ul.boxs li.box .box-header .info span.box-username a {
  color: #1c354f;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

#mmc-chat .chat-box ul.boxs li.box .box-header .chat-avatar {
  display: flex;
  position: relative;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  background: #e7eef6;
  color: #627b96;
}

#mmc-chat .chat-box ul.boxs li.box .box-header .chat-avatar svg { width: 24px; height: 24px; }

#mmc-chat .chat-box ul.boxs li.box .box-header .chat-avatar-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
}

#mmc-chat .chat-box ul.boxs li.box .box-header .tools {
  display: flex;
  float: none;
  width: auto;
  padding: 0;
  gap: 2px;
}

#mmc-chat .chat-box ul.boxs li.box .box-header .tools button {
  appearance: none;
  position: relative;
  display: block;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  background: transparent;
  color: #52657b;
  cursor: pointer;
}

#mmc-chat .chat-box ul.boxs li.box .box-header .tools button:hover {
  background: #edf2f7;
  opacity: 1;
}

#mmc-chat .chat-box ul.boxs li.box .box-header .tools button.collapse,
#mmc-chat .chat-box ul.boxs li.box .box-header .tools button.close { background-image: none; }

#mmc-chat .chat-box .box-header .tools .collapse::before,
#mmc-chat .chat-box .box-header .tools .close::before,
#mmc-chat .chat-box .box-header .tools .close::after {
  content: '';
  position: absolute;
  top: 19px;
  left: 13px;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

#mmc-chat .chat-box .box-header .tools .close::before { transform: rotate(45deg); }
#mmc-chat .chat-box .box-header .tools .close::after { transform: rotate(-45deg); }

#mmc-chat .chat-box ul.boxs li.box .box-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  background: #f7f9fc;
}

#mmc-chat .chat-box ul.boxs li.box .box-body .status { display: none; }

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  background: #f7f9fc;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-color: #b8c5d4 transparent;
  scrollbar-width: thin;
}

#mmc-chat .chat-box ul.boxs li.box .connection-notice {
  position: static;
  flex: 0 0 auto;
  z-index: 2;
  padding: 10px 14px;
  margin: 0;
  background: #edf3fa;
  border-bottom: 1px solid #dae4ef;
  color: #425a74;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages { padding: 14px 12px 4px; }

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message {
  display: flex;
  clear: both;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
}

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message.out { justify-content: flex-end; }
#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message .sender { display: none; }

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message .body {
  float: none;
  width: auto;
  min-width: 0;
  max-width: 88%;
}

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message.no-avatar .body { width: auto !important; }

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message .body .content {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #dce4ed;
  border-radius: 11px;
  background: #fff;
  color: #243446;
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message.out .body .content {
  margin: 0;
  border-color: #cfdeef;
  background: #e7f0fa;
  color: #173c63;
}

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message .body .content::after { display: none; }

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message .body .seen,
#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message .body .seen2 {
  margin: 4px 2px 0;
  color: #5e7085;
  font-size: 12px;
  line-height: 16px;
}

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message .body .seen { float: none; }
#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message.out .body .seen { text-align: right; }
#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message .body .seen2 {
  float: none;
  margin: 4px 2px 0;
  text-align: right;
}
#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message .body .seen2.active + .seen { display: none; }

#mmc-chat .chat-box ul.boxs li.box .box-body .message-scrooler .lcmessages .message .body .content .preview-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto !important;
  margin: 0;
  border-radius: 6px;
}

#mmc-chat .chat-box ul.boxs li.box .box-footer {
  display: flex;
  align-items: flex-end;
  flex: 0 0 auto;
  gap: 6px;
  height: auto !important;
  min-height: 64px;
  padding: 10px;
  border-top: 1px solid #dce4ed;
  background: #fff;
}

#mmc-chat .chat-box ul.boxs li.box .box-footer .item { float: none; }

#mmc-chat .chat-box ul.boxs li.box .box-footer .send-message {
  flex: 1;
  width: auto;
  height: auto !important;
  min-width: 0;
  overflow: visible;
}

#mmc-chat .chat-box ul.boxs li.box .box-footer .send-message .textarea {
  min-height: 42px;
  max-height: 108px;
  padding: 9px 10px;
  border: 1px solid #becbd9;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: #243446;
  font: 16px/22px Arial, Helvetica, sans-serif;
  overflow-y: auto;
  word-break: break-word;
}

#mmc-chat .chat-box ul.boxs li.box .box-footer .textarea:focus { border-color: #2874b8; box-shadow: 0 0 0 2px #dceafa; }
#mmc-chat .chat-box ul.boxs li.box .box-footer .send-message .textarea .placeholder { color: #5f7185; }

#mmc-chat .chat-box ul.boxs li.box .box-footer .file {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 42px;
  margin: 0;
  border-radius: 7px;
  background: none;
  color: #52657b;
  cursor: pointer;
}

#mmc-chat .chat-box .box-footer .file svg { width: 22px; height: 22px; }
#mmc-chat .chat-box .box-footer .file:hover { background: #edf2f7; }
#mmc-chat .chat-box .box-footer .file .selected-file { position: absolute; width: 1px; height: 1px; }

#mmc-chat .chat-box ul.boxs li.box .box-footer .send-button {
  appearance: none;
  flex: 0 0 54px;
  height: 42px;
  padding: 0 8px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: #1769aa;
  color: #fff;
  font: 700 14px/42px Arial, Helvetica, sans-serif;
  box-shadow: none;
  cursor: pointer;
}

#mmc-chat .chat-box ul.boxs li.box .box-footer .send-button:hover { background: #11558c; }
#mmc-chat .chat-box button:focus-visible,
#mmc-chat .chat-box .file:focus-visible { outline: 2px solid #1769aa; outline-offset: 2px; }

#mmc-chat .chat-box ul.boxs li.box .typing-indicator {
  min-width: 42px;
  height: 28px;
  margin: 0 0 12px;
  padding: 9px;
  background: #e8eef5;
  animation: none;
}

#mmc-chat .chat-box ul.boxs li.box .typing-indicator span { width: 6px; height: 6px; background: #62768d; }

#mmc-chat .chat-box ul.boxs li.box.collapsed { height: 52px; }
#mmc-chat .chat-box ul.boxs li.box.collapsed .box-header { position: static; width: 100%; }
#mmc-chat .chat-box ul.boxs li.box.collapsed .tools .collapse::after {
  content: '';
  position: absolute;
  top: 13px;
  left: 19px;
  width: 2px;
  height: 14px;
  border-radius: 1px;
  background: currentColor;
}
#mmc-chat .chat-box ul.boxs li.new-message .box-header { animation: none; box-shadow: inset 0 3px #2874b8; }

#mmc-chat .chat-box ul.boxs li.box.minimized {
  position: relative;
  left: auto;
  bottom: auto;
  flex: 0 0 64px;
  width: 64px;
  height: 44px;
  border-radius: 10px 10px 0 0;
}

#mmc-chat .chat-box ul.boxs li.minimized .count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: inherit;
  background: #fff;
  color: #204b71;
  font: 700 16px/24px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

#mmc-chat .chat-box ul.boxs li.minimized .count svg { width: 20px; height: 20px; }
#mmc-chat .chat-box ul.boxs li.minimized .count:hover,
#mmc-chat .chat-box ul.boxs li.minimized.show .count { background: #e7f0fa; }

#mmc-chat .chat-box ul.boxs li.minimized .dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 10px);
  width: 280px;
  max-width: calc(100vw - 24px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cbd6e2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(28, 49, 75, .18);
  color: #243446;
  font-size: 16px;
  cursor: default;
}

#mmc-chat .chat-box ul.boxs li.minimized.show .dropdown { display: block; }

#mmc-chat .chat-box ul.boxs li.minimized .minimized-heading {
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e1e7ef;
  color: #425a74;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

#mmc-chat .chat-box ul.boxs li.minimized .minimized-list {
  max-height: 320px;
  max-height: min(320px, calc(100vh - 180px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  margin: 0;
  list-style: none;
}

#mmc-chat .chat-box ul.boxs li.minimized .dropdown li {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border-bottom: 1px solid #edf1f6;
  color: #243446;
}

#mmc-chat .chat-box ul.boxs li.minimized .dropdown li:last-child { border-bottom: 0; }
#mmc-chat .chat-box ul.boxs li.minimized .dropdown li:hover { color: #243446; }

#mmc-chat .chat-box ul.boxs li.minimized .dropdown .username {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 52px;
  height: auto;
  width: auto;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #243446;
  font: 400 16px/22px Arial, Helvetica, sans-serif;
  text-align: left;
  cursor: pointer;
}

#mmc-chat .chat-box ul.boxs li.minimized .dropdown .chat-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#mmc-chat .chat-box ul.boxs li.minimized .dropdown .chat-action { color: #526b84; font-size: 13px; line-height: 18px; }
#mmc-chat .chat-box ul.boxs li.minimized .dropdown .username:hover { background: #edf3fa; }

#mmc-chat .chat-box ul.boxs li.minimized .dropdown .remove {
  display: flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  float: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #62758b;
  cursor: pointer;
}

#mmc-chat .chat-box ul.boxs li.minimized .dropdown .remove svg { width: 20px; height: 20px; }
#mmc-chat .chat-box ul.boxs li.minimized .dropdown .remove:hover { background: #edf3fa !important; color: #243446; }

#mmc-chat .chat-box .chat-control-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 600px) {
  #mmc-chat .chat-box { right: 8px; }
  #mmc-chat .chat-box ul.boxs { gap: 8px; }
}

@media (max-width: 420px) {
  #mmc-chat .chat-box ul.boxs li.box.minimized { position: absolute; left: auto; right: 0; bottom: calc(100% + 8px); border-radius: 10px; }
  #mmc-chat .chat-box ul.boxs li.minimized .dropdown { left: auto; right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #mmc-chat .chat-box *, #mmc-chat .chat-box *::before, #mmc-chat .chat-box *::after { animation: none !important; }
}

#mmc-chat .chat-box ul.boxs li.box .send-status,
#mmc-chat .chat-box ul.boxs li.box .send-error {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: #7a3518;
  background: #fff5e8;
  font-size: 14px;
  line-height: 1.45;
}

#mmc-chat .chat-box ul.boxs li.box .restore-draft {
  display: block;
  min-height: 40px;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid #b9c8d8;
  border-radius: 5px;
  color: #173c63;
  background: #fff;
  font: inherit;
  cursor: pointer;
}
