.macc-chatbot {
  --macc-primary: #176b5c;
  --macc-border: #d8e2df;
  --macc-text: #13231f;
  --macc-muted: #60716c;
  --macc-dark: #1f2533;
  color: var(--macc-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

.macc-chatbot *,
.macc-chatbot *::before,
.macc-chatbot *::after {
  box-sizing: border-box;
}

.macc-chatbot button,
.macc-chatbot textarea {
  font-family: inherit;
}

.macc-chatbot--floating {
  bottom: 24px;
  position: fixed;
  right: 24px;
  z-index: 99999;
}

.macc-chatbot__launcher {
  align-items: center;
  appearance: none;
  background: var(--macc-dark);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(19, 35, 31, 0.22);
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 28px;
  font-weight: 700;
  height: 62px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 62px;
}

.macc-chatbot__panel {
  background: #fff;
  border: 1px solid var(--macc-border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(19, 35, 31, 0.2);
  display: flex;
  flex-direction: column;
  height: 520px;
  max-height: min(520px, calc(100vh - 112px));
  overflow: hidden;
  width: min(360px, calc(100vw - 32px));
}

.macc-chatbot--floating .macc-chatbot__panel {
  bottom: 0;
  display: none;
  position: absolute;
  right: 0;
}

.macc-chatbot--floating.is-open .macc-chatbot__launcher {
  display: none;
}

.macc-chatbot--floating.is-open .macc-chatbot__panel {
  display: flex;
}

.macc-chatbot--inline .macc-chatbot__panel {
  box-shadow: none;
  max-width: 720px;
  width: 100%;
}

.macc-chatbot__header {
  align-items: center;
  background: var(--macc-primary);
  color: #fff;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-height: 82px;
  padding: 16px 18px;
}

.macc-chatbot__header strong,
.macc-chatbot__header span {
  display: block;
}

.macc-chatbot__header strong {
  font-size: 18px;
  line-height: 1.25;
  margin: 0;
}

.macc-chatbot__header span {
  font-size: 13px;
  line-height: 1.25;
  margin-top: 4px;
  opacity: 0.82;
}

.macc-chatbot__close {
  align-items: center;
  appearance: none;
  background: rgba(31, 37, 51, 0.92);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex: 0 0 44px;
  font-size: 26px;
  height: 44px;
  justify-content: center;
  line-height: 1;
  margin: 0;
  padding: 0;
  width: 44px;
}

.macc-chatbot__messages {
  background: #f7faf9;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.macc-chatbot__message {
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
  max-width: 88%;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.macc-chatbot__message--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--macc-border);
}

.macc-chatbot__message--user {
  align-self: flex-end;
  background: var(--macc-primary);
  color: #fff;
}

.macc-chatbot__form {
  align-items: end;
  background: #fff;
  border-top: 1px solid var(--macc-border);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 12px 14px 14px;
}

.macc-chatbot__input {
  border: 1px solid var(--macc-border);
  border-radius: 8px;
  color: var(--macc-text);
  display: block;
  font-size: 15px;
  line-height: 1.35;
  margin: 0;
  max-height: 118px;
  min-height: 52px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.macc-chatbot__input:focus {
  border-color: var(--macc-primary);
  box-shadow: 0 0 0 2px rgba(23, 107, 92, 0.18);
  outline: none;
}

.macc-chatbot__send {
  align-items: center;
  appearance: none;
  align-self: stretch;
  background: var(--macc-dark);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 15px;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  margin: 0;
  min-height: 52px;
  padding: 0 18px;
}

.macc-chatbot__send:disabled,
.macc-chatbot__input:disabled {
  cursor: wait;
  opacity: 0.68;
}

@media (max-width: 520px) {
  .macc-chatbot--floating {
    bottom: 16px;
    right: 16px;
  }

  .macc-chatbot--floating .macc-chatbot__panel {
    max-height: calc(100vh - 104px);
    width: calc(100vw - 32px);
  }

  .macc-chatbot__form {
    grid-template-columns: 1fr;
  }

  .macc-chatbot__send {
    width: 100%;
  }
}
