#mwai-chat-id {
  --mwai-spacing: 15px;
  --mwai-fontSize: 15px;
  --mwai-borderRadius: 10px;
  --mwai-fontColor: #FFFFFF;
  --mwai-backgroundPrimaryColor: #454654;
  --mwai-backgroundSecondaryColor: #343541;
  --mwai-aiAvatarBackgroundColor: #10a37f;
  --mwai-userAvatarBackgroundColor: #135ea4;
  --mwai-headerButtonsColor: #FFFFFF;
}

#mwai-chat-id .mwai-open-button {
  position: absolute;
  right: 0;
  bottom: 0;
  transition: all 0.2s ease-out;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: end;
}

#mwai-chat-id .mwai-open-button .mwai-icon-text {
  background: var(--mwai-backgroundPrimaryColor);
  color: var(--mwai-headerButtonsColor);
  max-width: 200px;
  font-size: 13px;
  margin-bottom: 15px;
  padding: 5px 10px;
  border-radius: 8px;
}

#mwai-chat-id .mwai-open-button:hover {
  cursor: pointer;
  filter: saturate(2.5) hue-rotate(5deg);
}

#mwai-chat-id .mwai-content {
  background: var(--mwai-backgroundSecondaryColor);
  color: var(--mwai-fontColor);
  font-size: var(--mwai-fontSize);
  border-radius: var(--mwai-borderRadius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#mwai-chat-id .mwai-conversation {
  overflow: auto;
}

#mwai-chat-id * {
  box-sizing: border-box;
}

#mwai-chat-id a {
  color: #2196f3;
}

#mwai-chat-id h1 {
  font-size: 200%;
}

#mwai-chat-id h2 {
  font-size: 160%;
}

#mwai-chat-id h3 {
  font-size: 140%;
}

#mwai-chat-id h4 {
  font-size: 120%;
}

#mwai-chat-id pre {
  color: var(--mwai-fontColor);
  border-radius: var(--mwai-borderRadius);
  padding: calc(var(--mwai-spacing) * 2 / 3) var(--mwai-spacing);
  break-after: auto;
  font-size: 95%;
  font-family: system-ui;
  background: #343541;
}

#mwai-chat-id pre code {
  padding: 0 !important;
  font-family: system-ui;
  background: #343541;
}

#mwai-chat-id ol {
  padding: 0;
  margin: 0 0 0 20px;
}

#mwai-chat-id .mwai-reply {
  display: flex;
  padding: var(--mwai-spacing);
}

#mwai-chat-id .mwai-ai, #mwai-chat-id .mwai-system {
  background: var(--mwai-backgroundPrimaryColor);
}

#mwai-chat-id .mwai-name {
  color: var(--mwai-fontColor);
  margin-right: 5px;
}

#mwai-chat-id .mwai-name .mwai-name-text {
  opacity: 0.50;
}

#mwai-chat-id .mwai-name .mwai-avatar {
  margin-right: 10px;
  width: 40px;
  height: 40px;
  background: var(--mwai-aiAvatarBackgroundColor);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  overflow: hidden;
}

#mwai-chat-id .mwai-name .mwai-avatar img {
  max-width: 100%;
  max-height: 100%;
}

#mwai-chat-id .mwai-name .mwai-avatar.mwai-svg img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

#mwai-chat-id .mwai-user .mwai-name .mwai-avatar {
  background: var(--mwai-userAvatarBackgroundColor);
}

#mwai-chat-id .mwai-text {
  flex: auto;
}

#mwai-chat-id .mwai-text > *:first-child {
  margin-top: 0;
}

#mwai-chat-id .mwai-text > *:last-child {
  margin-bottom: 0;
}

#mwai-chat-id .mwai-input {
  display: flex;
  padding: var(--mwai-spacing);
  border-top: 1px solid var(--mwai-backgroundPrimaryColor);
}

#mwai-chat-id .mwai-input textarea {
  background: var(--mwai-backgroundPrimaryColor);
  color: var(--mwai-fontColor);
  flex: auto;
  padding: calc(var(--mwai-spacing) / 2) var(--mwai-spacing);
  border: none;
  border-radius: 5px;
  font-size: var(--mwai-fontSize);
  resize: none;
  font-family: inherit;
  line-height: calc(var(--mwai-spacing) * 2);
  margin: 0;
}

#mwai-chat-id .mwai-input textarea:focus {
  outline: none;
}

#mwai-chat-id .mwai-input button {
  background: none;
  color: var(--mwai-fontColor);
  background-color: var(--mwai-backgroundSecondaryColor);
  border: 1px solid var(--mwai-backgroundPrimaryColor);
  margin-left: var(--mwai-spacing);
  width: 90px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease-out;
  max-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mwai-chat-id .mwai-input button .mwai-timer {
  margin-left: 5px;
  margin-right: 5px;
  font-size: 11px;
}

#mwai-chat-id .mwai-input button:hover {
  background: var(--mwai-backgroundPrimaryColor);
}

#mwai-chat-id button {
  position: relative;
}

#mwai-chat-id button[disabled] span {
  display: none;
}

#mwai-chat-id button[disabled]::before {
  content: '';
  width: 18px;
  height: 18px;
  margin: auto;
  border: 3px solid transparent;
  border-top-color: var(--mwai-fontColor);
  border-radius: 50%;
  animation: mwai-button-spinner 1s ease infinite;
}

#mwai-chat-id.mwai-window {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 460px;
  z-index: 9999;
}

#mwai-chat-id.mwai-window .mwai-header {
  display: none;
  justify-content: flex-end;
  align-items: center;
}

#mwai-chat-id.mwai-window .mwai-header .mwai-resize-button {
  justify-content: center;
  height: 40px;
  width: 25px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

#mwai-chat-id.mwai-window .mwai-header .mwai-resize-button:before {
  transition: all 0.2s ease-out;
  content: ' ';
  cursor: pointer;
  position: absolute;
  height: 15px;
  width: 15px;
  opacity: 0.75;
  border: 2px solid var(--mwai-headerButtonsColor);
}

#mwai-chat-id.mwai-window .mwai-header .mwai-resize-button:hover:before {
  width: 20px;
  height: 20px;
}

#mwai-chat-id.mwai-window .mwai-header .mwai-close-button {
  justify-content: center;
  height: 35px;
  width: 35px;
  cursor: pointer;
}

#mwai-chat-id.mwai-window .mwai-header .mwai-close-button:before, #mwai-chat-id.mwai-window .mwai-header .mwai-close-button:after {
  content: ' ';
  cursor: pointer;
  position: absolute;
  height: 25px;
  width: 2px;
  background-color: var(--mwai-headerButtonsColor);
  opacity: 0.75;
}

#mwai-chat-id.mwai-window .mwai-header .mwai-close-button:before {
  transition: all 0.2s ease-out;
  transform: translate(16px, 5px) rotate(45deg);
}

#mwai-chat-id.mwai-window .mwai-header .mwai-close-button:after {
  transition: all 0.2s ease-out;
  transform: translate(16px, 5px) rotate(-45deg);
}

#mwai-chat-id.mwai-window .mwai-header .mwai-close-button:hover:before {
  opacity: 1;
  transform: translate(16px, 5px) rotate(135deg);
}

#mwai-chat-id.mwai-window .mwai-header .mwai-close-button:hover:after {
  opacity: 1;
  transform: translate(16px, 5px) rotate(45deg);
}

#mwai-chat-id.mwai-window .mwai-content {
  display: none;
  opacity: 0;
  max-height: 40vh;
}

#mwai-chat-id.mwai-window.mwai-bottom-left {
  bottom: 30px;
  right: inherit;
  left: 30px;
}

#mwai-chat-id.mwai-window.mwai-bottom-left .mwai-open-button {
  right: inherit;
  left: 0;
}

#mwai-chat-id.mwai-window.mwai-top-right {
  top: 30px;
  bottom: inherit;
  right: 30px;
}

#mwai-chat-id.mwai-window.mwai-top-right .mwai-open-button {
  top: 0;
  bottom: inherit;
}

#mwai-chat-id.mwai-window.mwai-top-left {
  top: 30px;
  bottom: inherit;
  right: inherit;
  left: 30px;
}

#mwai-chat-id.mwai-window.mwai-top-left .mwai-open-button {
  top: 0;
  bottom: inherit;
  right: inherit;
  left: 0;
}

#mwai-chat-id .mwai-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 5px;
}

#mwai-chat-id .mwai-gallery img {
  width: 100%;
}

#mwai-chat-id.mwai-window.mwai-fullscreen .mwai-close-button {
  height: 40px;
}

#mwai-chat-id.mwai-window.mwai-fullscreen .mwai-close-button:before, #mwai-chat-id.mwai-window.mwai-fullscreen .mwai-close-button:after {
  height: 30px;
}

#mwai-chat-id.mwai-window.mwai-fullscreen .mwai-resize-button:before {
  width: 20px;
  height: 20px;
}

#mwai-chat-id.mwai-window.mwai-fullscreen .mwai-resize-button:hover:before {
  width: 15px;
  height: 15px;
}

#mwai-chat-id.mwai-fullscreen:not(.mwai-window), #mwai-chat-id.mwai-fullscreen.mwai-window.mwai-open {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  width: inherit;
  height: inherit;
  max-height: inherit;
  max-width: inherit;
  display: flex;
  flex-direction: column;
  margin: 0;
}

#mwai-chat-id.mwai-fullscreen:not(.mwai-window) .mwai-content, #mwai-chat-id.mwai-fullscreen.mwai-window.mwai-open .mwai-content {
  height: 100%;
  max-height: inherit;
  border-radius: inherit;
}

#mwai-chat-id.mwai-fullscreen:not(.mwai-window) .mwai-content .mwai-conversation, #mwai-chat-id.mwai-fullscreen.mwai-window.mwai-open .mwai-content .mwai-conversation {
  flex: auto;
}

#mwai-chat-id.mwai-window.mwai-open .mwai-header {
  display: flex;
}

#mwai-chat-id.mwai-window.mwai-open .mwai-content {
  display: flex;
  transition: opacity 200ms ease-in-out 0s;
  opacity: 1;
}

#mwai-chat-id.mwai-window.mwai-open .mwai-open-button {
  display: none;
}

@media (max-width: 760px) {
  #mwai-chat-id.mwai-window {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    z-index: 9999999999;
  }
  #mwai-chat-id .mwai-reply {
    flex-direction: column;
  }
  #mwai-chat-id .mwai-input {
    flex-direction: column;
  }
  #mwai-chat-id .mwai-input button {
    margin: 15px 0 0 0;
    height: 40px;
    width: inherit;
  }
  #mwai-chat-id .mwai-name {
    margin-right: 0;
    max-width: inherit;
  }
}

@keyframes mwai-button-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}

.admin-bar #mwai-chat-id.mwai-fullscreen:not(.mwai-window),
.admin-bar #mwai-chat-id.mwai-fullscreen.mwai-window.mwai-open {
  top: 32px;
}
