:root {
  --medovo-honey: #d99a16;
  --medovo-honey-dark: #b97b05;
  --medovo-brown: #49331f;
  --medovo-cream: #fffaf0;
  --medovo-green: #47614c;
}

.medovo-bot,
.medovo-bot * {
  box-sizing: border-box;
}

.medovo-bot {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
  font-family: inherit;
  color: var(--medovo-brown);
}

.medovo-bot__launcher {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--medovo-green);
  box-shadow: 0 10px 30px rgba(42, 35, 22, 0.23);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.medovo-bot__launcher:hover,
.medovo-bot__launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(42, 35, 22, 0.30);
}

.medovo-bot__bee {
  font-size: 24px;
  line-height: 1;
}

.medovo-bot__panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  display: flex;
  flex-direction: column;
  width: min(370px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 105px));
  overflow: hidden;
  border: 1px solid rgba(73, 51, 31, 0.12);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(42, 35, 22, 0.28);
  animation: medovo-bot-in .2s ease-out;
}

.medovo-bot__panel[hidden] {
  display: none;
}

.medovo-bot__header {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  padding: 15px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--medovo-green), #334c39);
}

.medovo-bot__header strong,
.medovo-bot__header small {
  display: block;
}

.medovo-bot__header strong {
  font-size: 16px;
  line-height: 1.3;
}

.medovo-bot__header small {
  margin-top: 2px;
  color: rgba(255,255,255,.82);
  font-size: 12px;
}

.medovo-bot__avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: #fff7df;
  font-size: 24px;
}

.medovo-bot__close {
  width: 36px;
  height: 36px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.12);
  font: 400 28px/1 Arial, sans-serif;
  cursor: pointer;
}

.medovo-bot__close:hover,
.medovo-bot__close:focus-visible {
  background: rgba(255,255,255,.22);
}

.medovo-bot__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  background: linear-gradient(#fffdf8, var(--medovo-cream));
}

.medovo-bot__messages {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.medovo-bot__message {
  align-self: flex-start;
  max-width: 89%;
  padding: 10px 12px;
  border: 1px solid rgba(73, 51, 31, .08);
  border-radius: 5px 15px 15px 15px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(73, 51, 31, .06);
  font-size: 14px;
  line-height: 1.48;
  white-space: pre-line;
}

.medovo-bot__message--user {
  align-self: flex-end;
  border-color: rgba(217, 154, 22, .15);
  border-radius: 15px 5px 15px 15px;
  background: #ffefc8;
}

.medovo-bot__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 2px;
}

.medovo-bot__option,
.medovo-bot__submit {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid rgba(71, 97, 76, .32);
  border-radius: 12px;
  color: var(--medovo-green);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.medovo-bot__option:hover,
.medovo-bot__option:focus-visible {
  border-color: var(--medovo-green);
  background: #f4f8f4;
  transform: translateY(-1px);
}

.medovo-bot__option--primary,
.medovo-bot__submit {
  border-color: var(--medovo-honey);
  color: #fff;
  background: var(--medovo-honey);
}

.medovo-bot__option--primary:hover,
.medovo-bot__option--primary:focus-visible,
.medovo-bot__submit:hover,
.medovo-bot__submit:focus-visible {
  border-color: var(--medovo-honey-dark);
  background: var(--medovo-honey-dark);
}

.medovo-bot__option--back {
  width: 100%;
  border-color: transparent;
  color: #756653;
  background: transparent;
  font-weight: 500;
}

.medovo-bot__form {
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: 100%;
  padding: 13px;
  border: 1px solid rgba(73, 51, 31, .12);
  border-radius: 14px;
  background: #fff;
}

.medovo-bot__field > span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
}

.medovo-bot__field input {
  display: block;
  width: 100%;
  height: 42px;
  padding: 8px 10px;
  border: 1px solid #cfc5b8;
  border-radius: 9px;
  color: #2d261d;
  background: #fff;
  font: inherit;
  font-size: 16px;
}

.medovo-bot__field input:focus {
  border-color: var(--medovo-honey);
  outline: 2px solid rgba(217, 154, 22, .2);
}

.medovo-bot__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  line-height: 1.35;
  color: #695e50;
}

.medovo-bot__consent input {
  margin-top: 2px;
  flex: 0 0 auto;
}

.medovo-bot__consent a,
.medovo-bot__call {
  color: var(--medovo-green);
  text-decoration: underline;
}

.medovo-bot__submit {
  width: 100%;
  text-align: center;
}

.medovo-bot__submit:disabled {
  opacity: .65;
  cursor: wait;
}

.medovo-bot__status {
  color: #a43d2f;
  font-size: 12px;
  line-height: 1.35;
}

.medovo-bot__call {
  display: block;
  font-size: 12px;
  text-align: center;
}

.medovo-bot__honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

@keyframes medovo-bot-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 520px) {
  .medovo-bot {
    right: 12px;
    bottom: 12px;
  }

  .medovo-bot__panel {
    right: 0;
    bottom: 64px;
    width: calc(100vw - 24px);
    height: min(640px, calc(100dvh - 92px));
  }

  .medovo-bot__launcher {
    min-height: 50px;
    padding: 10px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .medovo-bot__panel,
  .medovo-bot__launcher,
  .medovo-bot__option {
    animation: none;
    transition: none;
  }
}

