.mw-chatbot {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  font-family: Inter, Helvetica, Arial, sans-serif;
  width: min(400px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.mw-chatbot__panel {
  width: 100%;
  height: min(580px, calc(100dvh - 120px));
  margin-bottom: 8px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dbe4f0;
  box-shadow: 0 14px 36px rgba(13, 43, 89, 0.16);
  display: none;
  flex-direction: column;
}

.mw-chatbot.mw-chatbot--open .mw-chatbot__panel {
  display: flex;
}

.mw-chatbot.mw-chatbot--open .mw-chatbot__toggle {
  display: none;
}

.mw-chatbot__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2a67d2 0%, #3f86ef 100%);
  color: #fff;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.mw-chatbot__header-left {
  display: flex;
  align-items: center;
  min-width: 120px;
  gap: 8px;
}

.mw-chatbot__logo {
  height: 26px;
  width: auto;
  display: block;
}

.mw-chatbot__header-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mw-chatbot__avatar {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.mw-chatbot__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  font-size: 11px;
  padding: 4px 9px;
}

.mw-chatbot__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc40;
}

.mw-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafd;
  scroll-behavior: smooth;
}

.mw-chatbot__msg-row {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.mw-chatbot__msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #d3dfef;
  flex: 0 0 auto;
}

.mw-chatbot__msg-wrap {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.2s ease;
}

.mw-chatbot__msg-wrap--visible {
  opacity: 1;
  transform: translateY(0);
}

.mw-chatbot__msg-wrap--user {
  justify-content: flex-end;
  align-items: flex-end;
}

.mw-chatbot__msg-wrap--user .mw-chatbot__msg-row {
  justify-content: flex-end;
}

.mw-chatbot__msg {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: 14px;
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(15, 44, 91, 0.05);
}

.mw-chatbot__msg--bot {
  background: #fff;
  color: #213047;
  border: 1px solid #e2eaf3;
}

.mw-chatbot__msg--user {
  margin-left: auto;
  background: #dce9ff;
  border: 1px solid #c8dcff;
  color: #1b3d7a;
  box-shadow: none;
}

.mw-chatbot__quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  max-width: 100%;
}

.mw-chatbot__quick-btn {
  border: 1px solid #cfdbec;
  background: #fff;
  color: #2a4d83;
  border-radius: 5px;
  padding: 2px 4px;
  font-size: 8px;
  line-height: 1.15;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.mw-chatbot__quick-btn:hover,
.mw-chatbot__quick-btn:focus-visible {
  background: #f3f7fd;
  border-color: #bfd2ee;
  outline: none;
}

.mw-chatbot__quick-btn:active {
  transform: translateY(1px);
}

.mw-chatbot__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e4eaf2;
  background: #fff;
  position: sticky;
  bottom: 0;
}

.mw-chatbot__input {
  flex: 1;
  border: 1px solid #cad8eb;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #1f324f;
  background: #fff;
}

.mw-chatbot__input::placeholder {
  color: #6f8099;
}

.mw-chatbot__input:focus {
  outline: none;
  border-color: #2a67d2;
  box-shadow: 0 0 0 3px rgba(42, 103, 210, 0.14);
}

.mw-chatbot__send {
  border: none;
  border-radius: 12px;
  background: #2a67d2;
  color: #fff;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(42, 103, 210, 0.22);
}

.mw-chatbot__send svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.mw-chatbot__send:hover,
.mw-chatbot__send:focus-visible {
  background: #245ab8;
  transform: translateY(-1px);
  outline: none;
}

.mw-chatbot__send:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(42, 103, 210, 0.2);
}

.mw-chatbot__newsletter {
  margin-top: 8px;
  max-width: 88%;
  background: #eef5ff;
  border: 1px solid #d8e5f7;
  border-radius: 12px;
  padding: 12px;
}

.mw-chatbot__newsletter h4 {
  margin: 0 0 4px;
  color: #204578;
  font-size: 14px;
}

.mw-chatbot__newsletter p {
  margin: 0 0 10px;
  font-size: 12px;
  color: #30465f;
  line-height: 1.5;
}

.mw-chatbot__newsletter-form {
  display: grid;
  gap: 8px;
}

.mw-chatbot__newsletter-form input {
  border: 1px solid #c6dafc;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
}

.mw-chatbot__newsletter-form button {
  border: none;
  border-radius: 8px;
  background: #2a67d2;
  color: #fff;
  font-weight: 600;
  padding: 9px 12px;
  cursor: pointer;
}

.mw-chatbot__newsletter-success {
  border: 1px solid #b7e8c5;
  background: #dbf7e2;
  color: #13662a;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
}

.mw-chatbot__typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mw-chatbot__typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mw-chatbot__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9cb5df;
  animation: mwchat-bounce 1s infinite ease-in-out;
}

.mw-chatbot__typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.mw-chatbot__typing span:nth-child(3) {
  animation-delay: 0.4s;
}

.mw-chatbot__typing-label {
  font-size: 12px;
  color: #5b6f8d;
}

@keyframes mwchat-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.mw-chatbot__msg p {
  margin: 0;
}

.mw-chatbot__msg p + p {
  margin-top: 10px;
}

.mw-chatbot__msg ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.mw-chatbot__msg a {
  color: #1e529f;
}

.mw-chatbot__toggle {
  border: none;
  border-radius: 999px;
  background: #78b7ea;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(58, 128, 211, 0.25);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mw-chatbot__toggle:hover,
.mw-chatbot__toggle:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(58, 128, 211, 0.3);
  background: #69aee5;
  outline: none;
}

.mw-chatbot__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 8px;
  border-radius: 999px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 767px) {
  .mw-chatbot {
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
  }

  .mw-chatbot__panel {
    width: 100%;
    height: min(84dvh, 680px);
    margin-bottom: 8px;
  }

  .mw-chatbot__header {
    padding: 12px;
    gap: 8px;
  }

  .mw-chatbot__logo {
    height: 22px;
  }

  .mw-chatbot__avatar {
    width: 24px;
    height: 24px;
  }

  .mw-chatbot__msg-avatar {
    width: 20px;
    height: 20px;
  }

  .mw-chatbot__status {
    font-size: 10px;
    padding: 4px 8px;
  }

  .mw-chatbot__messages {
    padding: 10px;
  }

  .mw-chatbot__msg {
    max-width: 90%;
    font-size: 14px;
    line-height: 1.55;
  }

  .mw-chatbot__form {
    padding: 10px;
    gap: 7px;
  }

  .mw-chatbot__input {
    min-width: 0;
    padding: 10px 11px;
  }

  .mw-chatbot__send {
    width: 42px;
    height: 42px;
  }
}
