.mwai-chat {
  --mwai-spacing: 10px;
  --mwai-fontSize: 13px;
  --mwai-lineHeight: 1.5;
  --mwai-borderRadius: 10px;
  --mwai-width: 460px;
  --mwai-maxHeight: 40vh;
  --mwai-iconTextColor: black;
  --mwai-iconTextBackgroundColor: white;
  --mwai-fontColor: black;
  --mwai-backgroundPrimaryColor: #fafafa;
  --mwai-backgroundHeaderColor: #0084ff;
  --mwai-headerButtonsColor: white;
  --mwai-backgroundUserColor: #0084ff;
  --mwai-backgroundAiColor: #eee;
  --mwai-backgroundAiSecondaryColor: #ddd;
}

.mwai-chat * {
  box-sizing: border-box;
}

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

.mwai-chat .mwai-conversation {
  display: flex;
  flex-direction: column;
  overflow: auto;
  max-height: var(--mwai-maxHeight);
  padding: var(--mwai-spacing);
}

.mwai-chat .mwai-conversation .mwai-reply {
  margin-bottom: var(--mwai-spacing);
  padding: 7px 12px;
  border-radius: 15px;
  font-size: var(--mwai-fontSize);
  color: var(--mwai-fontColor);
  position: relative;
}

.mwai-chat .mwai-conversation .mwai-reply .mwai-name {
  display: none;
}

.mwai-chat .mwai-conversation .mwai-reply .mwai-name-text {
  display: none;
}

.mwai-chat .mwai-conversation .mwai-reply *:first-child {
  margin-top: 0px;
}

.mwai-chat .mwai-conversation .mwai-reply *:last-child {
  margin-bottom: 0px;
}

.mwai-chat .mwai-conversation .mwai-reply.mwai-ai {
  align-self: flex-start;
  background: var(--mwai-backgroundAiColor);
  margin-left: 5px;
}

.mwai-chat .mwai-conversation .mwai-reply.mwai-ai::before, .mwai-chat .mwai-conversation .mwai-reply.mwai-ai::after {
  content: "";
  position: absolute;
  z-index: 1;
  bottom: 0;
  left: -10px;
  width: 10px;
  height: 20px;
  background: var(--mwai-backgroundPrimaryColor);
  border-bottom-right-radius: 10px;
}

.mwai-chat .mwai-conversation .mwai-reply.mwai-ai::before {
  z-index: 0;
  left: -7px;
  height: 20px;
  width: 20px;
  background: var(--mwai-backgroundAiColor);
  border-bottom-right-radius: 15px;
}

.mwai-chat .mwai-conversation .mwai-reply.mwai-user {
  align-self: flex-end;
  background: var(--mwai-backgroundUserColor);
  color: white;
  margin-right: 10px;
}

.mwai-chat .mwai-conversation .mwai-reply.mwai-user::before, .mwai-chat .mwai-conversation .mwai-reply.mwai-user::after {
  content: "";
  position: absolute;
  z-index: 1;
  bottom: 0;
  right: -10px;
  width: 10px;
  height: 20px;
  background: var(--mwai-backgroundPrimaryColor);
  border-bottom-left-radius: 10px;
}

.mwai-chat .mwai-conversation .mwai-reply.mwai-user::before {
  z-index: 0;
  right: -10px;
  height: 20px;
  width: 20px;
  background: var(--mwai-backgroundUserColor);
  background-attachment: fixed;
  border-bottom-left-radius: 15px;
}

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

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

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

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

.mwai-chat .mwai-text h1 {
  font-size: 200%;
}

.mwai-chat .mwai-text h2 {
  font-size: 160%;
}

.mwai-chat .mwai-text h3 {
  font-size: 140%;
}

.mwai-chat .mwai-text h4 {
  font-size: 120%;
}

.mwai-chat .mwai-text p {
  font-size: var(--mwai-fontSize);
  line-height: var(--mwai-lineHeight);
}

.mwai-chat .mwai-text p code {
  background: var(--mwai-backgroundAiSecondaryColor);
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 90%;
  font-family: system-ui;
}

.mwai-chat .mwai-text pre {
  color: var(--mwai-fontColor);
  border-radius: var(--mwai-borderRadius);
  break-after: auto;
  white-space: pre-wrap;
  max-width: 100%;
  width: 100%;
  font-family: system-ui;
  background: var(--mwai-backgroundAiSecondaryColor);
  padding: var(--mwai-spacing);
}

.mwai-chat .mwai-text pre code {
  padding: 0 !important;
  font-family: system-ui;
  background: var(--mwai-backgroundAiSecondaryColor);
}

.mwai-chat .mwai-text ol {
  padding: 0;
  margin: 0 0 0 20px;
}

.mwai-chat .mwai-text table {
  width: 100%;
  border: 2px solid var(--mwai-backgroundAiSecondaryColor);
  border-collapse: collapse;
}

.mwai-chat .mwai-text thead {
  background: var(--mwai-backgroundAiSecondaryColor);
}

.mwai-chat .mwai-text tr, .mwai-chat .mwai-text td {
  padding: 2px 5px;
}

.mwai-chat .mwai-text td {
  border: 2px solid var(--mwai-backgroundAiSecondaryColor);
}

.mwai-chat .mwai-text .mwai-typewriter {
  display: inline-block;
}

.mwai-chat .mwai-text .mwai-typewriter > :first-child {
  margin-top: 0;
}

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

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

.mwai-chat .mwai-avatar img {
  width: 24px;
  border-radius: 5px;
}

.mwai-chat .mwai-input {
  display: flex;
  align-items: center;
  padding: var(--mwai-spacing);
}

.mwai-chat .mwai-input .mwai-input-text {
  flex: auto;
  position: relative;
  display: flex;
  background: var(--mwai-backgroundPrimaryColor);
  border-radius: var(--mwai-borderRadius);
  border: 1px solid var(--mwai-backgroundAiSecondaryColor);
  overflow: hidden;
}

.mwai-chat .mwai-input .mwai-input-text textarea {
  background: var(--mwai-backgroundPrimaryColor);
  color: var(--mwai-fontColor);
  flex: auto;
  padding: var(--mwai-spacing);
  border: none;
  font-size: var(--mwai-fontSize);
  resize: none;
  font-family: inherit;
  margin: 0;
  overflow: hidden;
}

.mwai-chat .mwai-input .mwai-input-text textarea:focus {
  outline: none;
  box-shadow: none;
}

.mwai-chat .mwai-input .mwai-input-text textarea::placeholder {
  color: var(--mwai-fontColor);
  opacity: 0.5;
}

.mwai-chat .mwai-input .mwai-input-text .mwai-microphone, .mwai-chat .mwai-input .mwai-input-text .mwai-image-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  cursor: pointer;
}

.mwai-chat .mwai-input .mwai-input-text .mwai-microphone svg, .mwai-chat .mwai-input .mwai-input-text .mwai-image-upload svg {
  fill: var(--mwai-fontColor);
  width: 34px;
  height: 34px;
  fill: var(--mwai-fontColor);
  opacity: 0.5;
  transition: opacity 0.3s ease-out;
}

.mwai-chat .mwai-input .mwai-input-text .mwai-microphone[active=true] svg, .mwai-chat .mwai-input .mwai-input-text .mwai-image-upload[active=true] svg {
  opacity: 1;
}

.mwai-chat .mwai-input .mwai-input-text .mwai-microphone[disabled] svg, .mwai-chat .mwai-input .mwai-input-text .mwai-image-upload[disabled] svg {
  opacity: 0;
}

.mwai-chat .mwai-input .mwai-input-text .mwai-image-upload {
  margin-left: 5px;
  margin-right: -5px;
}

.mwai-chat .mwai-input .mwai-input-text .mwai-image-upload svg {
  width: 42px;
  height: 42px;
  padding: 5px;
}

.mwai-chat .mwai-input .mwai-input-text .mwai-image-upload span {
  position: absolute;
  font-size: 55%;
}

.mwai-chat .mwai-input .mwai-input-text .mwai-image-upload.enabled svg {
  opacity: 1;
  filter: none;
}

.mwai-chat .mwai-input .mwai-input-text .mwai-microphone svg {
  padding: 5px 10px;
}

.mwai-chat .mwai-input button {
  margin-left: var(--mwai-spacing);
  padding: 5px 15px;
  background-color: var(--mwai-backgroundUserColor);
  color: white;
  border: none;
  border-radius: var(--mwai-borderRadius);
  cursor: pointer;
  height: 32px;
  width: 110px;
  display: flex;
  justify-content: center;
  align-items: center;
}

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

.mwai-chat .mwai-input button:hover {
  filter: brightness(1.2);
}

.mwai-chat button[disabled] {
  cursor: not-allowed;
}

.mwai-chat button[disabled] span {
  opacity: 0.5;
}

.mwai-chat button[disabled].mwai-busy span {
  display: none;
}

.mwai-chat button[disabled].mwai-busy: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 .mwai-compliance {
  opacity: 0.50;
  margin-top: calc( -1 * var(--mwai-spacing));
  padding: calc(var(--mwai-spacing) / 1.5) var(--mwai-spacing);
  font-size: smaller;
  color: var(--mwai-fontColor);
  text-align: left;
}

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

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

.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-open-button .mwai-icon-text {
  background: var(--mwai-iconTextBackgroundColor);
  color: var(--mwai-iconTextColor);
  max-width: 200px;
  font-size: 13px;
  margin-bottom: 15px;
  padding: 5px 10px;
  border-radius: 8px;
}

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

.mwai-window {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: var(--mwai-width);
  z-index: 9999;
}

.mwai-window .mwai-header {
  display: none;
  justify-content: flex-end;
  align-items: center;
  border-radius: var(--mwai-borderRadius) var(--mwai-borderRadius) 0 0;
  background: var(--mwai-backgroundHeaderColor);
}

.mwai-window .mwai-header .mwai-buttons {
  display: flex;
  align-items: center;
}

.mwai-window .mwai-header .mwai-buttons .mwai-resize-button {
  justify-content: center;
  height: 32px;
  width: 22px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mwai-window .mwai-header .mwai-buttons .mwai-resize-button:before {
  transition: all 0.2s ease-out;
  content: ' ';
  cursor: pointer;
  position: absolute;
  height: 13px;
  width: 13px;
  border: 1px solid var(--mwai-headerButtonsColor);
}

.mwai-window .mwai-header .mwai-buttons .mwai-resize-button:hover:before {
  width: 16px;
  height: 16px;
}

.mwai-window .mwai-header .mwai-buttons .mwai-close-button {
  justify-content: center;
  height: 32px;
  width: 33px;
  cursor: pointer;
  border-radius: var(--mwai-borderRadius);
}

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

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

.mwai-window .mwai-header .mwai-buttons .mwai-close-button:before, .mwai-window .mwai-header .mwai-buttons .mwai-close-button:after {
  content: ' ';
  cursor: pointer;
  position: absolute;
  height: 22px;
  width: 1px;
  background-color: var(--mwai-headerButtonsColor);
}

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

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

.mwai-window .mwai-content {
  display: none;
  opacity: 0;
  max-height: var(--mwai-maxHeight);
  border-radius: 0 0 var(--mwai-borderRadius) var(--mwai-borderRadius);
  overflow: hidden;
}

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

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

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

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

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

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

.mwai-window.mwai-top-left .mwai-open-button, .mwai-window.mwai-bottom-left .mwai-open-button {
  align-items: flex-start;
}

.mwai-window.mwai-top-right .mwai-open-button, .mwai-window.mwai-top-left .mwai-open-button {
  flex-direction: column-reverse;
}

.mwai-window.mwai-top-right .mwai-open-button .mwai-icon-text, .mwai-window.mwai-top-left .mwai-open-button .mwai-icon-text {
  margin-bottom: 0;
  margin-top: 15px;
}

.mwai-window.mwai-fullscreen .mwai-header .mwai-buttons {
  margin-bottom: 0px;
}

.mwai-window.mwai-fullscreen .mwai-header .mwai-buttons .mwai-resize-button:before {
  width: 16px;
  height: 16px;
}

.mwai-window.mwai-fullscreen .mwai-header .mwai-buttons .mwai-resize-button:hover:before {
  width: 13px;
  height: 13px;
}

.mwai-fullscreen:not(.mwai-window), .mwai-fullscreen.mwai-window.mwai-open {
  position: fixed;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: 0 !important;
  width: inherit;
  height: inherit;
  max-height: inherit;
  max-width: inherit;
  display: flex;
  flex-direction: column;
  margin: 0;
  z-index: 999999;
  background-color: var(--mwai-backgroundSecondaryColor);
}

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

.mwai-fullscreen:not(.mwai-window) .mwai-content .mwai-conversation, .mwai-fullscreen.mwai-window.mwai-open .mwai-content .mwai-conversation {
  flex: auto;
  max-height: none;
}

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

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

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

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

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

@media (max-width: 760px) {
  .mwai-chat.mwai-window {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    z-index: 9999999999;
  }
  .mwai-chat .mwai-reply {
    flex-direction: column;
  }
  .mwai-chat .mwai-input {
    flex-direction: column;
  }
}

.mwai-copy-button {
  opacity: 0;
  transition: all 0.3s ease-out;
  width: 22px;
  height: 22px;
  position: absolute;
  right: var(--mwai-spacing);
}

.mwai-copy-button .mwai-copy-button-one {
  position: absolute;
  width: 16px;
  height: 16px;
  margin-top: 0px;
  margin-left: 0px;
  background: white;
  opacity: 0.4;
  transition: all 0.2s ease-in;
  cursor: pointer;
  border-radius: 2px;
}

.mwai-copy-button .mwai-copy-button-two {
  position: absolute;
  width: 16px;
  height: 16px;
  margin-top: 6px;
  margin-left: 6px;
  background: white;
  opacity: 0.6;
  transition: all 0.2s ease-in;
  cursor: pointer;
  border-radius: 2px;
}

.mwai-copy-button:hover .mwai-copy-button-one {
  opacity: 0.6;
  margin-top: 0px;
  margin-left: 6px;
}

.mwai-copy-button:hover .mwai-copy-button-two {
  opacity: 1;
  margin-top: 6px;
  margin-left: 0px;
}

.mwai-copy-button.mwai-animate .mwai-copy-button-one {
  opacity: 0;
}

.mwai-copy-button.mwai-animate .mwai-copy-button-two {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  margin-left: 2px;
  opacity: 1;
}

.mwai-chat .mwai-reply:hover .mwai-copy-button {
  display: block;
  opacity: 1;
}

.mwai-chat pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em;
}

.mwai-chat code.hljs {
  padding: 3px 5px;
}

.mwai-chat .hljs {
  color: #333;
  background: #f0f0f0;
}

.mwai-chat .hljs-subst {
  color: #333;
}

.mwai-chat .hljs-comment {
  color: #888;
}

.mwai-chat .hljs-attr, .mwai-chat .hljs-doctag, .mwai-chat .hljs-keyword, .mwai-chat .hljs-meta .hljs-keyword, .mwai-chat .hljs-section, .mwai-chat .hljs-selector-tag {
  color: #0077cc;
}

.mwai-chat .hljs-attribute {
  color: #aa3377;
}

.mwai-chat .hljs-name, .mwai-chat .hljs-number, .mwai-chat .hljs-quote, .mwai-chat .hljs-selector-id, .mwai-chat .hljs-template-tag, .mwai-chat .hljs-type {
  color: #c18401;
}

.mwai-chat .hljs-selector-class {
  color: #0077cc;
}

.mwai-chat .hljs-link, .mwai-chat .hljs-regexp, .mwai-chat .hljs-selector-attr, .mwai-chat .hljs-string, .mwai-chat .hljs-symbol, .mwai-chat .hljs-template-variable, .mwai-chat .hljs-variable {
  color: #689700;
}

.mwai-chat .hljs-meta, .mwai-chat .hljs-selector-pseudo {
  color: #0077cc;
}

.mwai-chat .hljs-built_in, .mwai-chat .hljs-literal, .mwai-chat .hljs-title {
  color: #c18401;
}

.mwai-chat .hljs-bullet, .mwai-chat .hljs-code {
  color: #555;
}

.mwai-chat .hljs-meta .hljs-string {
  color: #689700;
}

.mwai-chat .hljs-deletion {
  color: #b71c1c;
}

.mwai-chat .hljs-addition {
  color: #1b5e20;
}

.mwai-chat .hljs-emphasis {
  font-style: italic;
}

.mwai-chat .hljs-strong {
  font-weight: 700;
}

.mwai-copy-button {
  position: absolute;
  left: 15px;
  zoom: 0.5;
  top: 18px;
  filter: revert;
}

.mwai-ai .mwai-copy-button {
  right: 15px;
  left: inherit;
  filter: brightness(0.4);
}
