/* ===== 챗봇 위젯 ===== */
.chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 520px;
  max-height: 75vh;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--elev-overlay, 0 24px 60px rgba(26,16,80,.34));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  transform-origin: bottom right;
  animation: chatbot-in var(--dur-base, .38s) var(--ease-out-expo, cubic-bezier(.16,1,.3,1));
}
@keyframes chatbot-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

.chatbot-header {
  background: var(--grad-cta, linear-gradient(135deg,#6D5BFF,#5A45E8));
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}

.chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  animation: msg-in var(--dur-base, .38s) var(--ease-out-expo, cubic-bezier(.16,1,.3,1)) both;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.msg-bot {
  align-self: flex-start;
  background: #f1f3f7;
  color: #1a1a1a;
}

.msg-user {
  align-self: flex-end;
  background: var(--violet, #6D5BFF);
  color: #fff;
}

.chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eee;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}

.chatbot-input:focus {
  border-color: #6D3FE8;
}

.chatbot-send {
  background: #6D3FE8;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
  cursor: pointer;
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: default;
}
/* Floating chatbot button */
.chatbot-fab {
  position: fixed !important;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: linear-gradient(135deg, #6D5BFF 0%, #8E66FF 100%);
  color: #fff;
  box-shadow: 0 18px 42px rgba(83, 66, 210, .34), inset 0 1px 0 rgba(255, 255, 255, .34);
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
  transform: translateZ(0);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s cubic-bezier(.2, .8, .2, 1);
}

.chatbot-fab i {
  font-size: 24px;
  line-height: 1;
}

.chatbot-fab:hover {
  transform: translateY(-3px) translateZ(0);
  box-shadow: 0 22px 48px rgba(83, 66, 210, .42), inset 0 1px 0 rgba(255, 255, 255, .38);
}

.chatbot-fab:active {
  transform: translateY(-1px) scale(.98) translateZ(0);
}

.chatbot-widget {
  bottom: 100px;
}

@media (max-width: 680px) {
  .chatbot-fab {
    right: 20px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
    z-index: 9998;
    box-shadow: 0 14px 34px rgba(83, 66, 210, .34);
  }

  .chatbot-fab i {
    font-size: 21px;
  }

  .chatbot-fab span {
    font-size: 10px;
  }

  .chatbot-widget {
    left: 12px;
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: auto;
    height: min(540px, calc(100vh - 146px));
    max-height: calc(100vh - 146px);
    border-radius: 22px;
  }
}

@media (max-width: 360px) {
  .chatbot-fab {
    right: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}