.qmr-chatbot {
  --qmr-primary: #5bbd62;
  --qmr-accent: #46b957;
  width: min(100%, 900px);
  margin: 20px auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e4ece6;
  color: #30343b;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.qmr-chatbot * {
  box-sizing: border-box;
}

.qmr-chatbot-header {
  background: #fff;
  color: #1f2933;
  padding: 13px 18px;
  border-bottom: 4px solid var(--qmr-primary);
}

.qmr-chatbot-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
}

.qmr-brand-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border: 2px solid #d8f1db;
  border-radius: 50%;
  background: #f0fff4;
  color: var(--qmr-accent);
  font-weight: 800;
}

.qmr-brand-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qmr-brand-name {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.qmr-chatbot-body {
  min-height: 430px;
  padding: 16px;
  background: #fff;
}

.qmr-message {
  width: fit-content;
  max-width: min(760px, 86%);
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 22px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.qmr-message p {
  margin-top: 0;
}

.qmr-message p:last-child {
  margin-bottom: 0;
}

.qmr-message-bot {
  background: #e8eaef;
  color: #30343b;
  border-top-left-radius: 8px;
}

.qmr-message-user {
  margin-left: auto;
  background: #eefaf0;
  color: #1f6e2f;
  border: 1px solid #cdeed2;
  border-top-right-radius: 8px;
}

.qmr-loading {
  min-width: 54px;
  text-align: center;
}

.qmr-error {
  background: #fff1f1;
  color: #9d2424;
}

.qmr-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 18px;
}

.qmr-option {
  min-height: 42px;
  padding: 9px 17px;
  border: 1px solid var(--qmr-accent);
  border-radius: 999px;
  background: #fff;
  color: var(--qmr-accent);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.qmr-option:hover,
.qmr-option:focus {
  background: var(--qmr-accent);
  color: #fff;
  outline: none;
}

.qmr-option:active {
  transform: translateY(1px);
}

.qmr-option:disabled {
  cursor: default;
  opacity: 0.48;
}

.qmr-used-options {
  opacity: 0.65;
}

.qmr-restart {
  border-color: #8a96a8;
  color: #526070;
}

.qmr-restart:hover,
.qmr-restart:focus {
  background: #526070;
  color: #fff;
}

@media (max-width: 640px) {
  .qmr-chatbot {
    margin: 10px auto;
    border-left: 0;
    border-right: 0;
  }

  .qmr-chatbot-header {
    padding: 11px 14px;
  }

  .qmr-brand-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .qmr-brand-name {
    font-size: 16px;
  }

  .qmr-chatbot-body {
    min-height: 360px;
    padding: 14px;
  }

  .qmr-message {
    max-width: 94%;
    padding: 11px 14px;
    border-radius: 18px;
  }

  .qmr-options {
    display: grid;
    grid-template-columns: 1fr;
  }

  .qmr-option {
    width: 100%;
    border-radius: 14px;
    white-space: normal;
  }
}
