.home-chatbot {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  font-family: "Kanit", sans-serif;
}

.home-chatbot-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 7px 16px 7px 7px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: linear-gradient(135deg, #075444, #0b9268);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(5, 70, 54, 0.3);
}

.home-chatbot-launcher img,
.home-chatbot-head img {
  object-fit: cover;
  border-radius: 50%;
}

.home-chatbot-launcher img {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.home-chatbot-launcher:hover,
.home-chatbot-launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px rgba(5, 70, 54, 0.38);
}

.home-chatbot-status {
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #b8ee42;
}

.home-chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(420px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid #c9ded6;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(4, 54, 44, 0.3);
}

.home-chatbot-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
}

.home-chatbot-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 36px 36px;
  align-items: center;
  gap: 9px;
  padding: 12px;
  background: linear-gradient(135deg, #06483b, #087d5a);
  color: #fff;
}

.home-chatbot-head img {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.home-chatbot-head span {
  display: grid;
}

.home-chatbot-head strong {
  font-size: 17px;
}

.home-chatbot-head small {
  color: rgba(255, 255, 255, 0.78);
}

.home-chatbot-head a,
.home-chatbot-head button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 22px;
  cursor: pointer;
}

.home-chatbot-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  overflow: auto;
  background: #f6fbf9;
}

.home-chatbot-message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.home-chatbot-message.user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: #087d5a;
  color: #fff;
}

.home-chatbot-message.assistant {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: #e7f4ef;
  color: #153b32;
}

.home-chatbot-message.loading {
  opacity: 0.7;
}

.home-chatbot-sources {
  display: grid;
  gap: 5px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #c9ded6;
  font-size: 11px;
}

.home-chatbot-source {
  padding: 6px 7px;
  border-radius: 7px;
  background: #fff;
}

.home-chatbot-suggestions {
  display: flex;
  gap: 7px;
  padding: 9px 12px;
  overflow-x: auto;
  border-top: 1px solid #dbeae4;
  background: #fff;
}

.home-chatbot-suggestions button {
  flex: 0 0 auto;
  max-width: 260px;
  padding: 7px 10px;
  border: 1px solid #bcdacf;
  border-radius: 999px;
  background: #f1faf6;
  color: #116349;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.home-chatbot-form {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #dbeae4;
}

.home-chatbot-form textarea {
  min-height: 48px;
  max-height: 120px;
  resize: none;
  padding: 11px;
  border: 1px solid #b8d4ca;
  border-radius: 13px;
  font: inherit;
  outline: none;
}

.home-chatbot-form textarea:focus {
  border-color: #087d5a;
  box-shadow: 0 0 0 3px rgba(8, 125, 90, 0.12);
}

.home-chatbot-form button {
  border: 0;
  border-radius: 13px;
  background: #087d5a;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.home-chatbot-form button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.home-chatbot-note {
  margin: 0;
  padding: 0 12px 10px;
  color: #6b817b;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 640px) {
  .home-chatbot {
    right: 12px;
    bottom: 12px;
  }

  .home-chatbot-launcher span:not(.home-chatbot-status) {
    display: none;
  }

  .home-chatbot-launcher {
    min-height: 58px;
    padding: 5px;
  }

  .home-chatbot-panel {
    position: fixed;
    inset: 10px;
    width: auto;
    height: auto;
    border-radius: 20px;
  }
}
