html, body {}
body {
    font-family: 'Pretendard', 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
    background: #fff;
}

.cb-chat-layout {
  display: flex;
  flex-direction: row;
  width: 100%;
  min-height: 100vh;
  background: #ffffff;
}

.cb-upload-root_up.cb-chatbot-root {
  flex: 1 1 auto;
  min-height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: stretch;
  box-sizing: border-box;
  padding: 0;
}

.cb-chatbot-header {
  width: 100%;
  background: #fff;
  box-shadow: 0 1px 12px rgba(80,100,180,0.03);
  padding: 38px 0 18px 0;
  text-align: center;
  z-index: 2;
}
.cb-chatbot-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #383838;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}
.cb-chatbot-desc {
  color: #8d98a8;
  font-size: 1.08rem;
}

#chatbot-embed-root {
  display: none;
}

.cb-chatbot-container {
  padding-left: 70px;
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: transparent;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0;
  min-height: 0;
}

.cb-chatbot-input-row {
  width: 85%;
  margin: 0 auto;
  padding: 0 0 24px 0;
  background: transparent;
  position: fixed;
  bottom: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  border: none;
  box-shadow: none;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
}

.cb-chatbot-input-inner {
  position: relative;
  width: 100%;
  max-width: 800px;
  display: flex;
  align-items: flex-end;
}

.cb-chatbot-box {
  flex: 1;
  overflow-y: auto;
  padding: 22px 14px 0 14px;
  background: transparent;
  min-height: 380px;
  box-sizing: border-box;
  width: 85%;
  margin: 0 auto;
  margin-bottom: 0;
}

.cb-chat-input {
  font-family: 'Pretendard', 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  width: 100%;
  min-height: 120px;
  max-height: 130px;
  padding: 24px 170px 24px 22px;
  border: 1.3px solid #eeeeee;
  border-radius: 16px;
  background: #fff;
  font-size: 1.18rem;
  outline: none;
  box-shadow: 0 2px 12px rgba(60,80,140,0.07);
  transition: border 0.14s, box-shadow 0.14s;
  min-width: 0;
  height: auto;
  resize: none;
  box-sizing: border-box;
  overflow-y: auto;
  line-height: 1.7;
  word-break: break-word;
}
.cb-chat-input::placeholder {
  line-height: 1.7;
}
.cb-chat-input:focus {
  border: 1.6px solid #eeeeee;
  box-shadow: 0 2px 14px rgba(60,80,140,0.13);
  background: #fff;
}

.cb-chat-send-btn {
  position: absolute;
  right: 18px;
  bottom: 18px;
  height: 46px;
  padding: 0 28px;
  border-radius: 11px;
  background: #383838;
  color: #fff;
  border: none;
  font-size: 1.18rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(70,100,170,0.08);
  transition: background .14s;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-chat-bubble {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 11px;
  width: 100%;
}
.cb-chat-bubble.user {
  align-items: flex-end;
}
.cb-bubble {
  max-width: 80%;
  display: inline-block;
  padding: 13px 18px;
  font-size: 1.09rem;
  border-radius: 17px;
  background: #fff;
  color: #283142;
  line-height: 1.6;
  word-break: break-word;
  position: relative;
}
.cb-chat-bubble.user .cb-bubble {
  background: #383838;
  color: #fff;
  border-bottom-right-radius: 6px;
  border-bottom-left-radius: 17px;
  margin-left: 17vw;
  margin-right: 0;
}
.cb-chat-bubble.bot .cb-bubble {
  background: #f9f9f9;
  color: #383838;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 17px;
}

.cb-chat-time {
  font-size: 11px;
  color: #9f9f9f;
  margin-top: 7px;
  text-align: right;
}

.cb-bubble .chat-menu-btn {
  display: block;
  margin-top: 12px;
  width: 100%;
  background: #e9ecf1;
  color: #223150;
  border: none;
  border-radius: 7px;
  padding: 12px 0;
  font-size: 1.07rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.13s;
  box-shadow: 0 2px 10px rgba(120,130,160,0.07);
}
.cb-bubble .chat-menu-btn:hover { background: #d4deed; }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid #c5d0e7;
  border-top: 3px solid #383838;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-left: 5px;
}

.cb-chat-image-preview {
    width: 100%;
}
.cb-chatbot-input-inner {
  display: flex;
  align-items: center;
  gap: 0; /* 필요에 따라 간격 조정 */
}
.img-upload-btn {
  position: absolute;
  right: 118px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: #f0f0f6;
  border-radius: 8px;
  border: none;
  font-size: 22px;
  cursor: pointer;
  transition: background 0.15s;
  color: #404050;
  margin-right: 6px; /* 전송버튼과 거리 */
}
.cb-chat-send-btn {
  margin-left: 6px;
  min-width: 60px;
}
.cb-chat-input {
  flex: 1 1 auto;
  resize: none;
}

@keyframes spin {
  0% { transform: rotate(0) }
  100% { transform: rotate(360deg) }
}

@media (max-width: 900px) {
  .cb-chatbot-container,
  .cb-chatbot-box,
  .cb-chatbot-input-row,
  .cb-chatbot-input-inner {
    max-width: 100vw;
    width: 100vw;
    min-width: 0;
  }
  .cb-sidemenu {
    display: none;
  }
  .cb-chatbot-header {
    padding: 18px 0 10px 0;
  }
  .cb-chatbot-input-row {
    padding-bottom: 0px;
    max-width: 100vw;
    background: #fff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -2px 12px rgba(50,70,110,0.08);
    left: 0;
    right: 0;
    margin: 0 auto 0 auto;
  }
  .cb-chatbot-input-inner {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
  }
  .cb-chat-input {
    min-height: 42px;
    max-height: 110px;
    padding: 16px 120px 16px 10px;
    font-size: 1.03rem;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .cb-chat-send-btn {
    height: 36px;
    font-size: 1.04rem;
    border-radius: 8px;
    padding: 0 12px;
    right: 7px;
    bottom: 7px;
  }
  .img-upload-btn {
    right: 70px;
    bottom: 7px;
    width: 36px;
    height: 36px;
  }
  .cb-chat-bubble.bot .cb-bubble{
      margin-right: 10vw;
  }
}