.mr-chat-widget {
  align-items: flex-end;
  bottom: 40px;
  color: #636364;
  display: flex;
  flex-direction: column;
  font-family: Montserrat, Arial, sans-serif;
  max-width: calc(100vw - 56px);
  pointer-events: none;
  position: fixed;
  right: 28px;
  width: auto;
  z-index: 99999;
}

.mr-chat-toggle {
  align-items: center;
  align-self: flex-end;
  background: #fc5d26;
  border: 0;
  border-radius: 999px;
  box-sizing: border-box;
  box-shadow: 0 16px 36px rgba(4, 60, 108, 0.24);
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 auto;
  margin: 0;
  min-height: 50px;
  padding: 12px 18px;
  pointer-events: auto;
  position: relative;
}

.mr-chat-toggle-text {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.mr-chat-panel {
  background: #ffffff;
  border: 1px solid rgba(4, 60, 108, 0.12);
  border-radius: 14px;
  bottom: 96px;
  box-shadow: 0 24px 60px rgba(4, 60, 108, 0.24);
  display: none;
  height: auto;
  max-height: calc(100vh - 130px);
  max-width: calc(100vw - 56px);
  overflow: hidden;
  padding: 0;
  pointer-events: auto;
  position: fixed;
  right: 28px;
  width: 400px;
}

.mr-chat-widget.is-open .mr-chat-panel {
  display: flex;
  flex-direction: column;
}

.mr-chat-header {
  align-items: center;
  background: #043c6c;
  border-radius: 14px 14px 0 0;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
}

.mr-chat-title {
  margin: 0;
}

.mr-chat-title {
  font-size: 16px;
  font-weight: 700;
}

.mr-chat-close {
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  font-size: 26px;
  height: 36px;
  line-height: 1;
  width: 36px;
}

.mr-chat-body {
  flex: 1 1 auto;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding: 16px;
}

.mr-chat-messages {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.mr-chat-message {
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  padding: 11px 13px;
}

.mr-chat-message-bot {
  background: #f6f7f9;
  color: #333333;
  margin-right: 32px;
}

.mr-chat-message-user {
  background: #043c6c;
  color: #ffffff;
  margin-left: 42px;
}

.mr-chat-options {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
}

.mr-chat-options button {
  background: #ffffff;
  border: 1px solid rgba(4, 60, 108, 0.2);
  border-radius: 8px;
  color: #043c6c;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 10px;
  text-align: left;
}

.mr-chat-options button:hover,
.mr-chat-options button.is-selected {
  background: #043c6c;
  color: #ffffff;
}

.mr-chat-form {
  border-top: 1px solid #eceff2;
  display: grid;
  gap: 11px;
  padding-top: 14px;
}

.mr-chat-field label {
  color: #043c6c;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.mr-chat-field input {
  border: 1px solid #d9dee5;
  border-radius: 8px;
  color: #333333;
  font-size: 14px;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

.mr-chat-field input:focus {
  border-color: #fc5d26;
  box-shadow: 0 0 0 3px rgba(252, 93, 38, 0.14);
  outline: none;
}

.mr-chat-error {
  color: #b42318;
  display: none;
  font-size: 12px;
  margin: 0;
}

.mr-chat-error.is-visible {
  display: block;
}

.mr-chat-submit {
  background: #fc5d26;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 14px;
}

@media (max-width: 575px) {
  .mr-chat-widget {
    bottom: 24px;
    left: auto;
    right: 14px;
  }

  .mr-chat-toggle {
    align-self: flex-end;
    margin: 0;
    max-width: calc(100vw - 28px);
    padding: 11px 16px;
  }

  .mr-chat-panel {
    bottom: 82px;
    left: auto;
    max-height: min(560px, 72vh);
    max-width: calc(100vw - 28px);
    overflow: hidden;
    position: fixed;
    right: 14px;
    width: min(340px, calc(100vw - 28px));
  }

  .mr-chat-body {
    max-height: calc(72vh - 92px);
    overflow-y: auto;
  }
}

@supports (height: 100dvh) {
  @media (max-width: 575px) {
    .mr-chat-panel {
      max-height: min(560px, 72dvh);
    }

    .mr-chat-body {
      max-height: calc(72dvh - 92px);
    }
  }
}
