.public-chatbot {
  position: fixed;
  z-index: 90;
  right: clamp(14px, 2.4vw, 30px);
  bottom: 66px;
  display: grid;
  justify-items: end;
  gap: 10px;
  font-family: "Montserrat", "Avenir Next", "Segoe UI", sans-serif;
}

.public-chatbot-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 7px 15px 7px 7px;
  border: 2px solid #171a1d;
  border-radius: 999px;
  background: #fffdf6;
  box-shadow: 5px 6px 0 rgba(23, 26, 29, .18);
  color: #171a1d;
  cursor: pointer;
}

.public-chatbot-launcher img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  background: #d9f2ec;
}

.public-chatbot-launcher span,
.public-chatbot-panel > header div {
  display: grid;
}

.public-chatbot-launcher span {
  text-align: left;
}

.public-chatbot-launcher strong {
  font-size: 14px;
}

.public-chatbot-launcher small {
  color: #52605d;
  font-size: 11px;
}

.public-chatbot-panel {
  width: min(390px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 136px));
  overflow: auto;
  border: 2px solid #171a1d;
  border-radius: 18px 13px 20px 15px;
  background: #fffdf6;
  box-shadow: 10px 12px 0 rgba(23, 26, 29, .16), 0 18px 55px rgba(23, 26, 29, .24);
  color: #171a1d;
}

.public-chatbot[hidden],
.public-chatbot [hidden] {
  display: none !important;
}

.public-chatbot-panel > header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 46px 1fr 38px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid #b7c4c1;
  background: #e1f4ef;
}

.public-chatbot-panel > header img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.public-chatbot-panel > header strong {
  font: 700 23px/1 "Cabin Sketch", "Montserrat", sans-serif;
}

.public-chatbot-panel > header span {
  margin-top: 3px;
  color: #465653;
  font-size: 11px;
}

.public-chatbot-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #171a1d;
  font-size: 28px;
  cursor: pointer;
}

.public-chatbot-close:hover,
.public-chatbot-close:focus-visible {
  background: rgba(21, 154, 145, .14);
}

.public-chatbot-body {
  padding: 16px;
}

.public-chatbot-state {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #edf5f3;
  color: #31423f;
  font-size: 12px;
  line-height: 1.45;
}

.public-chatbot-consent,
.public-chatbot-conversation {
  display: grid;
  gap: 14px;
}

.public-chatbot-consent > p {
  margin: 0;
  color: #465653;
  font-size: 13px;
  line-height: 1.55;
}

.public-chatbot-consent label {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.public-chatbot-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: #08736d;
}

.public-chatbot-consent .button {
  width: 100%;
  min-height: 46px;
}

.public-chatbot-conversation {
  gap: 12px;
}

.public-chatbot-messages {
  display: grid;
  gap: 9px;
  max-height: 240px;
  overflow: auto;
  padding: 2px;
}

.public-chatbot-message {
  max-width: 92%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.public-chatbot-message-assistant {
  justify-self: start;
  background: #dff3ee;
}

.public-chatbot-message-user {
  justify-self: end;
  background: #172321;
  color: #fff;
}

.public-chatbot-message-error {
  justify-self: start;
  background: #fde8e6;
  color: #8d2c25;
}

.public-chatbot-conversation form {
  display: grid;
  gap: 7px;
  padding-top: 4px;
}

.public-chatbot-conversation form > label {
  font-size: 12px;
  font-weight: 700;
}

.public-chatbot-conversation textarea {
  width: 100%;
  min-height: 82px;
  padding: 10px 11px;
  border: 1.5px solid #77837f;
  border-radius: 9px;
  background: #fff;
  color: #171a1d;
  font: 500 16px/1.4 "Montserrat", "Avenir Next", "Segoe UI", sans-serif;
  resize: vertical;
}

.public-chatbot-conversation textarea:focus {
  border-color: #08736d;
  outline: 3px solid rgba(8, 115, 109, .15);
}

.public-chatbot-conversation form > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.public-chatbot-conversation form small {
  color: #66736f;
  font-size: 10px;
}

.public-chatbot-conversation button[type="submit"] {
  min-height: 38px;
  padding: 0 14px;
  border: 2px solid #171a1d;
  border-radius: 7px;
  background: #7ee4d9;
  color: #171a1d;
  font-weight: 800;
  cursor: pointer;
}

.public-chatbot-conversation button:disabled,
.public-chatbot-consent button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.public-chatbot-handoff {
  margin: 15px 0 0;
  padding-top: 12px;
  border-top: 1px solid #ccd6d3;
  color: #52605d;
  font-size: 11px;
  line-height: 1.5;
}

.public-chatbot-handoff a {
  color: #08736d;
  font-weight: 700;
  text-decoration: underline;
}

.public-chatbot-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

@media (max-width: 640px) {
  .public-chatbot {
    right: 10px;
    bottom: 124px;
  }

  .public-chatbot-launcher {
    min-height: 54px;
    padding: 5px 12px 5px 5px;
  }

  .public-chatbot-launcher img {
    width: 43px;
    height: 43px;
  }

  .public-chatbot-panel {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 196px);
  }

  .public-chatbot-body {
    padding: 14px;
  }

  .public-chatbot-messages {
    max-height: 32dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .public-chatbot * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
