.chatbot-container {
  --chatbot-background-color: #ffffff;
  --chatbot-text-color: #231815;
  --chatbot-primary-color: #cdff48;
  --chatbot-user-bubble-color: #cdff48;
  --chatbot-bot-bubble-color: #f3f4f6;
  --chatbot-container-radius: 8px;
  --chatbot-bubble-radius: 1.5lh;
  --chatbot-font-size: 14px;

  display: flex;
  flex-direction: column;
  height: 100%;
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;

  /* Easings */
  --ease-in-out-quad: cubic-bezier(0.455, 0.03, 0.515, 0.955);
  --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
  --ease-in-back: cubic-bezier(0.6, -0.28, 0.735, 0.045);
  --ease-out-back: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 1rem 2rem 2rem;
  scrollbar-width: none;
}

.chatbot-message {
  display: flex;
  align-items: flex-end;
  gap: 0.5em;
  opacity: 0;
  transform: scaleY(1.2) translateY(20px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out-back);
  will-change: opacity, transform;
  transform-style: preserve-3d;
  .chatbot-bubble-text {
    transition: opacity 300ms 0ms, transform 300ms 0ms;
    opacity: 0;
    transform: translateY(10px);
  }
}

.chatbot-message.is-visible {
  opacity: 1;
  transform: scaleY(1) translateY(0);
    .chatbot-bubble-text {
      opacity: 1;
      transform: translateY(0);
    }
}

.chatbot-message.bot {
  justify-content: flex-start;
  & + .chatbot-message.user {
    margin-top: 12px;
  }
}

.chatbot-message.user {
  flex-direction: row-reverse;
  transition-duration: 0.15s;
  & + .chatbot-message.bot {
    margin-top: 12px;
  }
}

.chatbot-message.error .chatbot-bubble{
  color: #c33;
}

.chatbot-bubble {
  max-width: 70%;
  padding: 0.75lh 0.85lh;
  border-radius: var(--chatbot-bubble-radius);
  font-size: var(--chatbot-font-size);
  line-height: 1.5;
}

.chatbot-bubble.bot {
  background: var(--chatbot-bot-bubble-color);
  color: var(--chatbot-text-color);
  border-bottom-left-radius: 0px;
}

.chatbot-bubble.user {
  background: var(--chatbot-user-bubble-color);
  color: var(--chatbot-text-color);
  border-bottom-right-radius: 0px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chatbot-bubble.confirm {
  background-color: #d2d1d1;
  padding: 1lh .75lh;
}

.chatbot-timestamp {
  display: block;
  font-size: 10px;
  opacity: 0.55;
  margin-bottom: 4px;
  line-height: 1;
  white-space: nowrap;
}

.chatbot-message.bot .chatbot-timestamp {
  text-align: left;
}

.chatbot-message.user .chatbot-timestamp {
  text-align: right;
}
.chatbot-bubble:has(.chatbot-buttons:only-child){
  background-color: transparent;
  padding: 0;
  .chatbot-buttons {
    margin: 0;
  }
}

.chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chatbot-chip {
  padding: 0.75lh 0.85lh;
  background: var(--chatbot-primary-color);
  color: var(--chatbot-text-color);
  border: none;
  border-radius: var(--chatbot-bubble-radius);
  cursor: pointer;
  font-size: var(--chatbot-font-size);
  line-height: 1.5;
  transition: all 0.2s;
  text-align: left;
}

.chatbot-chip:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.chatbot-chip:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

.chatbot-input-area {
  overflow: hidden;
}

.chatbot-input-area-inner {
  padding: 1.6rem 1.2rem;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  min-height: 9em;
  position: relative;
  overflow: hidden;
}

.chatbot-input-hint {
  position: absolute;
  inset: 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  text-align: center;
  font-size: min(14px, 1.2rem);
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.chatbot-input-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  position: relative;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  padding-bottom: 30px;
  box-shadow: 0 0 0px var(--chatbot-primary-color, #cdff48);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 300ms ease;
}

.chatbot-input-area.is-selection-guide .chatbot-input-row {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
}

.chatbot-input-area.is-selection-guide .chatbot-input-hint {
  opacity: 1;
  transform: translateY(0);
}

.chatbot-input-area.is-free-input .chatbot-input-row {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.chatbot-input-area.is-free-input .chatbot-input-hint {
  opacity: 0;
  transform: translateY(-4px);
}

.chatbot-input {
  flex: 1;
  padding: 0.5lh 0.5lh;
  border: none;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 14px;
  outline: none;
  resize: vertical;
  min-height: 44px;
  max-height: 120px;
  width: 100%;
  line-height: 1.5;
  transition: opacity 180ms ease;
}
@supports (field-sizing: content){
  .chatbot-input {
    width: 100%;
    min-height: 1lh;
    field-sizing: content;
  }
}
/* @media (max-width: 600px) {
  .chatbot-input {
    font-size: 16px;
  }
} */

.chatbot-input-row:has(.chatbot-input:focus) {
  border-color: var(--chatbot-primary-color);
  box-shadow: 0 0 8px var(--chatbot-primary-color, #cdff48);
}

.chatbot-input-area.is-loading .chatbot-input-row {
  pointer-events: none;
}

.chatbot-input-area.is-loading .chatbot-input {
  opacity: 0.45;
}

.chatbot-input-loading {
  position: absolute;
  top: 12px;
  right: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.chatbot-input-area.is-loading .chatbot-input-loading {
  opacity: 1;
  transform: translateY(0);
}

.chatbot-input-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-top-color: var(--chatbot-text-color);
  border-radius: 999px;
  animation: chatbot-input-spinner 0.8s linear infinite;
}

@keyframes chatbot-input-spinner {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.chatbot-send {
  border: none;
  border-radius: 0;
  padding: 12px;
  min-height: 44px;
  cursor: pointer;
  white-space: nowrap;
 
  background-color: transparent;
  font-size: 0;

  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  &::after {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    background-image: url(./icon-sendchat.svg);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
  }
}

.chatbot-send:hover {
  opacity: 0.92;
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chatbot-image {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
}

.chatbot-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1.25rem 1.75rem;
  font-size: min(1.3rem, var(--chatbot-font-size));
  margin-top: 8px;
  text-decoration: none;
  transition: all 0.2s;

  color: var(--chatbot-text-color);
  background-color: #fff;
  border: 1px solid var(--chatbot-text-color);
  border-radius: 0;
  &::after {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    background-image: url(./icon-arrow01.svg);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    margin-left: 8px;
  }
}

.chatbot-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.chatbot-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.chatbot-summary-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chatbot-summary-item-label {
  opacity: 0.5;
  font-size: 9px;
  display: block;
  margin-bottom: 0.5em;
}
.chatbot-summary-item {
  width: 100%;
  text-align: left;
  border: none;
  background: #ffffff;
  border-radius: 1lh;
  padding: 0.75lh 0.75lh;
  cursor: pointer;
  font-size: 13px;
  transition: ease 200ms;
}

.chatbot-summary-item:hover {
  box-shadow: 0 2px 6px #888;
  transform: translateY(-1px);
}

.chatbot-submit-button {
  width: 100%;
  margin-top: 14px;
  border: none;
  border-radius: 100vmax;
  padding: 1lh;
  font-weight: 600;
  color: var(--chatbot-text-color);
  background: var(--chatbot-primary-color);
  cursor: pointer;
  transition: ease 200ms;
  border-style: solid;
  border-width: 1px;
  border-color: var(--chatbot-primary-color);
}

.chatbot-submit-button:hover {
  background-color: #fff;
  /* color: var(--chatbot-primary-color); */
}

.chatbot-scroll-spacer {
  width: 100%;
  flex: 0 0 auto;
  pointer-events: none;
}
