#mlv-stay-assistant-root {
  --mlv-primary: #6F8292;
  --mlv-primary-dark: #5B7385;
  --mlv-accent: #C6A467;
  --mlv-bg: #F6F0E6;
  --mlv-panel: #FFF9F0;
  --mlv-text: #211E1A;
  --mlv-muted: #756D63;
  --mlv-border: #E1D7C9;
  --mlv-border-strong: #D3C7B8;
  --mlv-soft: rgba(111, 130, 146, 0.12);
  --mlv-soft-strong: rgba(111, 130, 146, 0.18);
  --mlv-bot: #FFFDF8;
  --mlv-user: #ECF2EF;
  --mlv-input: #FFFDF8;
  --mlv-shadow: 0 18px 58px rgba(34, 30, 24, 0.13);
  font-family: Gilroy, "Gilroy", Arial, sans-serif;
  color: var(--mlv-text);
  line-height: 1.45;
  position: relative;
  z-index: 2147483000;
}

#mlv-stay-assistant-root,
#mlv-stay-assistant-root * {
  box-sizing: border-box;
  font-family: Gilroy, "Gilroy", Arial, sans-serif;
}

#mlv-stay-assistant-root button,
#mlv-stay-assistant-root input,
#mlv-stay-assistant-root a {
  font-family: Gilroy, "Gilroy", Arial, sans-serif;
}

.mlv-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
}

.mlv-chat__launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 15px 10px 12px;
  border: 1px solid rgba(111, 130, 146, 0.28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.94), rgba(246, 240, 230, 0.94));
  color: var(--mlv-primary-dark);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  box-shadow: 0 16px 42px rgba(34, 30, 24, 0.13);
  transform: translateZ(0);
  transition: transform 180ms ease, background 180ms ease, opacity 180ms ease, border-color 180ms ease, color 180ms ease;
  backdrop-filter: blur(16px);
}

.mlv-chat__launcher[hidden] {
  display: none !important;
}

.mlv-chat__launcher:hover,
.mlv-chat__launcher:focus-visible {
  transform: translateY(-2px);
  outline: none;
  color: #fff;
  border-color: rgba(111, 130, 146, 0.48);
  background: linear-gradient(135deg, var(--mlv-primary), var(--mlv-primary-dark));
}

.mlv-chat__launcher-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 11px;
  background: rgba(111, 130, 146, 0.12);
  color: currentColor;
}

.mlv-chat__launcher-icon svg {
  width: 20px;
  height: 20px;
}

.mlv-chat__panel {
  width: min(390px, calc(100vw - 34px));
  height: min(600px, 78vh);
  min-height: 420px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  border: 1px solid var(--mlv-border);
  border-radius: 28px;
  background: linear-gradient(180deg, #FFFDF8 0%, var(--mlv-panel) 100%);
  box-shadow: var(--mlv-shadow);
  transform: translateZ(0);
  z-index: 2147483001;
}

.mlv-chat__panel[hidden] {
  display: none !important;
}

.mlv-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 17px 14px 18px;
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 1px solid var(--mlv-border);
}

.mlv-chat__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mlv-chat__avatar,
.mlv-mini-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, var(--mlv-primary), var(--mlv-primary-dark));
}

.mlv-chat__avatar {
  width: 46px;
  height: 46px;
  border-radius: 17px;
  border: 1px solid rgba(111, 130, 146, 0.28);
}

.mlv-chat__avatar svg {
  width: 46px;
  height: 46px;
  display: block;
}

.mlv-chat__title-wrap {
  min-width: 0;
}

.mlv-chat__name {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--mlv-text);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.mlv-chat__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6E9876;
}

.mlv-chat__subtitle {
  margin: 4px 0 0;
  color: var(--mlv-muted);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mlv-chat__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--mlv-border);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.82);
  color: var(--mlv-text);
  cursor: pointer;
  box-shadow: none;
  padding: 0;
  line-height: 1;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.mlv-chat__close svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0;
  pointer-events: none;
}

.mlv-chat__close:hover,
.mlv-chat__close:focus-visible {
  outline: none;
  background: #F3EDE4;
  border-color: var(--mlv-border-strong);
  color: var(--mlv-text);
  transform: translateY(-1px);
}

.mlv-chat__body {
  overflow-y: auto;
  padding: 18px 17px 13px;
  background:
    radial-gradient(circle at 6% 0%, rgba(199, 167, 106, 0.10), transparent 30%),
    radial-gradient(circle at 92% 15%, rgba(102, 135, 162, 0.10), transparent 25%),
    var(--mlv-panel);
  scrollbar-width: thin;
}

.mlv-message-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin: 0 0 12px;
  animation: mlvMessageIn 240ms ease both;
}

.mlv-message-row--user {
  justify-content: flex-end;
}

.mlv-message-row--bot {
  justify-content: flex-start;
}

.mlv-mini-avatar {
  width: 27px;
  height: 27px;
  border-radius: 10px;
  border: 1px solid rgba(255, 253, 248, 0.54);
}

.mlv-mini-avatar svg {
  width: 27px;
  height: 27px;
  display: block;
}

.mlv-message {
  max-width: 82%;
  border: 1px solid var(--mlv-border);
  border-radius: 20px;
  color: var(--mlv-text);
  font-size: 14.5px;
  line-height: 1.54;
  font-weight: 400;
  letter-spacing: -0.004em;
  box-shadow: none;
}

.mlv-message p {
  margin: 0;
}

.mlv-message p + p {
  margin-top: 10px;
}

.mlv-message--bot {
  padding: 13px 15px;
  background: rgba(255, 253, 248, 0.96);
  border-top-left-radius: 10px;
}

.mlv-message--user {
  padding: 12px 15px;
  background: var(--mlv-user);
  border-color: #D7E1DD;
  border-top-right-radius: 10px;
}

.mlv-message--typing {
  min-width: 74px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 15px 17px;
}

.mlv-message--typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mlv-primary);
  opacity: 0.38;
  animation: mlvTyping 1.12s infinite ease-in-out;
}

.mlv-message--typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.mlv-message--typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.mlv-chat__quick {
  display: flex;
  gap: 8px;
  padding: 12px 17px 0;
  background: var(--mlv-panel);
  overflow-x: auto;
  scrollbar-width: none;
}

.mlv-chat__quick:empty {
  display: none;
}

.mlv-chat__quick::-webkit-scrollbar {
  display: none;
}

.mlv-chip {
  flex: 0 0 auto;
  min-height: 37px;
  padding: 8px 13px;
  border: 1px solid var(--mlv-border);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--mlv-text);
  cursor: pointer;
  font-size: 12.8px;
  line-height: 1;
  font-weight: 600;
  text-decoration: none;
  box-shadow: none;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.mlv-chip:hover,
.mlv-chip:focus-visible {
  outline: none;
  border-color: rgba(111, 130, 146, 0.40);
  background: rgba(111, 130, 146, 0.12);
  color: var(--mlv-text);
  transform: translateY(-1px);
}

.mlv-chip--link {
  border-color: rgba(102, 135, 162, 0.34);
  background: var(--mlv-primary);
  color: #fff;
  padding-left: 16px;
  padding-right: 16px;
}

.mlv-chip--link:hover,
.mlv-chip--link:focus-visible {
  background: var(--mlv-primary-dark);
  color: #fff;
  border-color: var(--mlv-primary-dark);
}

.mlv-chat__form {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 10px;
  padding: 14px 17px 17px;
  background: var(--mlv-panel);
  border-top: 1px solid var(--mlv-border);
}

.mlv-chat__input {
  width: 100%;
  min-width: 0;
  height: 52px;
  border: 1px solid #D8CDBE !important;
  border-radius: 20px !important;
  background: #FFFDF8;
  color: var(--mlv-text);
  padding: 0 17px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}

.mlv-chat__input:focus {
  outline: none;
  border-color: rgba(111, 130, 146, 0.70) !important;
  background: #fff;
}

.mlv-chat__input::placeholder {
  color: rgba(116, 108, 97, 0.58);
}

.mlv-chat__send {
  width: 52px;
  height: 52px;
  min-width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(111, 130, 146, 0.28);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--mlv-primary), var(--mlv-primary-dark));
  color: #fff;
  cursor: pointer;
  box-shadow: none;
  padding: 0;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.mlv-chat__send svg {
  display: block;
  width: 21px;
  height: 21px;
  margin: 0;
  transform: translate(1px, -1px);
  pointer-events: none;
}

.mlv-chat__send:hover,
.mlv-chat__send:focus-visible {
  outline: none;
  background: var(--mlv-primary-dark);
  border-color: var(--mlv-primary-dark);
  transform: translateY(-1px);
}

@keyframes mlvMessageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mlvTyping {
  0%, 70%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 600px) {
  .mlv-chat {
    right: 12px;
    bottom: 12px;
  }

  body.admin-bar .mlv-chat {
    bottom: 12px;
  }

  .mlv-chat__launcher {
    min-height: 50px;
    padding: 11px 15px 11px 12px;
    border-radius: 20px;
    font-size: 14px;
  }

  .mlv-chat__launcher-icon {
    width: 28px;
    height: 28px;
    border-radius: 11px;
  }

  .mlv-chat__panel {
    width: calc(100vw - 24px);
    height: min(600px, 78vh);
    min-height: 420px;
    border-radius: 26px;
  }

  .mlv-chat__header {
    padding: 15px 14px 13px;
  }

  .mlv-chat__avatar {
    width: 42px;
    height: 42px;
    border-radius: 16px;
  }

  .mlv-chat__avatar svg {
    width: 42px;
    height: 42px;
  }

  .mlv-chat__name {
    font-size: 17px;
  }

  .mlv-chat__subtitle {
    font-size: 12.5px;
    max-width: 230px;
  }

  .mlv-chat__close {
    width: 38px;
    height: 38px;
    border-radius: 15px;
  }

  .mlv-chat__body {
    padding: 15px 14px 10px;
  }

  .mlv-message {
    max-width: 88%;
    font-size: 14px;
    border-radius: 19px;
  }

  .mlv-message--bot {
    padding: 12px 13px;
    border-top-left-radius: 9px;
  }

  .mlv-message--user {
    padding: 11px 13px;
    border-top-right-radius: 9px;
  }

  .mlv-chat__quick {
    padding: 11px 14px 0;
  }

  .mlv-chip {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 12.5px;
  }

  .mlv-chat__form {
    grid-template-columns: 1fr 50px;
    gap: 9px;
    padding: 13px 14px 14px;
  }

  .mlv-chat__input,
  .mlv-chat__send {
    height: 50px;
    border-radius: 18px;
  }

  .mlv-chat__send {
    width: 50px;
    min-width: 50px;
  }
}

@media (max-width: 380px) {
  .mlv-chat__panel {
    width: calc(100vw - 18px);
    height: min(580px, 78vh);
  }

  .mlv-chat__subtitle {
    max-width: 190px;
  }
}


.mlv-message__inline-actions {
  margin-top: 12px !important;
}

.mlv-message-action,
.mlv-message-action:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(111, 130, 146, 0.34);
  background: linear-gradient(135deg, var(--mlv-primary), var(--mlv-primary-dark));
  color: #ffffff !important;
  font-family: Gilroy, "Gilroy", Arial, sans-serif;
  font-size: 12.8px;
  line-height: 1;
  font-weight: 700;
  text-decoration: none !important;
}

.mlv-message-action:hover,
.mlv-message-action:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--mlv-primary-dark), #4F6879);
  outline: none;
  transform: translateY(-1px);
}
