/* 베트남 장기체류보험 상담 도우미 위젯
   - 색상은 사이트 팔레트에 맞춤(다크 #333647, 포인트 핑크 #ea3062)
   - "보험 비교 견적" 플로팅 CTA 위에 위치(겹침 방지)
   - 표시/숨김은 .is-open 클래스로 제어([hidden] 속성은 display:flex에 덮여 안 먹힘) */

.ls-chatbot {
  position: fixed;
  right: 16px;
  bottom: 92px;            /* 모바일: 하단 전체폭 핑크 CTA 바 위로 */
  z-index: 9999;
  font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

/* 런처 버튼 */
.ls-chat-toggle {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
  border: none; cursor: pointer;
  background: #333647; color: #fff;
  padding: 11px 16px; border-radius: 28px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  font-size: 14px; font-weight: 600; line-height: 1;
}
.ls-chat-toggle:hover { background: #2a2c3a; }
.ls-chat-toggle-icon { font-size: 17px; }

/* 패널 */
.ls-chat-panel {
  position: absolute;
  right: 0; bottom: 56px;
  width: 360px; max-width: calc(100vw - 32px);
  height: 520px; max-height: calc(100vh - 170px);
  background: #fff; border-radius: 16px;
  box-shadow: 0 14px 44px rgba(0,0,0,.28);
  display: none; flex-direction: column; overflow: hidden;
}
.ls-chatbot.is-open .ls-chat-panel { display: flex; }

.ls-chat-header {
  display: flex; justify-content: space-between; align-items: center;
  background: #333647; color: #fff; padding: 14px 16px;
}
.ls-chat-header-title strong { font-size: 15px; }
.ls-chat-header-title small { display: block; opacity: .8; font-size: 11.5px; margin-top: 3px; }
.ls-chat-close {
  background: none; border: none; color: #fff; font-size: 26px; line-height: 1;
  cursor: pointer; padding: 0 2px; margin-left: 8px;
}
.ls-chat-close:hover { opacity: .7; }

.ls-chat-tabs { display: flex; border-bottom: 1px solid #eee; flex: 0 0 auto; }
.ls-chat-tab {
  flex: 1; border: none; background: #f6f8fa; padding: 11px 0;
  cursor: pointer; font-size: 13.5px; color: #666;
}
.ls-chat-tab.is-active {
  background: #fff; color: #ea3062; font-weight: 700;
  box-shadow: inset 0 -2px 0 #ea3062;
}

/* 본문(탭) — .is-active 일 때만 flex 표시 */
.ls-chat-body { flex: 1; min-height: 0; display: none; flex-direction: column; }
.ls-chat-body.is-active { display: flex; }

.ls-chat-log {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; background: #f7f9fb;
}
.ls-msg {
  max-width: 86%; padding: 10px 12px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.ls-msg.user { align-self: flex-end; background: #ea3062; color: #fff; border-bottom-right-radius: 4px; }
.ls-msg.bot { align-self: flex-start; background: #fff; color: #222; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; }
.ls-msg.typing { color: #999; font-style: italic; }

.ls-chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #eee; flex: 0 0 auto; }
.ls-chat-input input {
  flex: 1; min-width: 0; border: 1px solid #d0d7de; border-radius: 20px;
  padding: 10px 14px; font-size: 14px; outline: none;
}
.ls-chat-input input:focus { border-color: #ea3062; }
.ls-chat-input button {
  border: none; background: #ea3062; color: #fff; border-radius: 20px;
  padding: 0 16px; cursor: pointer; font-size: 14px; flex: 0 0 auto;
}

/* 서류 점검 탭 */
.ls-docs-scroll { flex: 1; overflow-y: auto; padding-bottom: 14px; }
.ls-docs-intro { padding: 14px; font-size: 13px; color: #555; line-height: 1.5; }
.ls-docs-intro em { color: #999; font-style: normal; display: block; margin-top: 4px; }
.ls-docs-label { display: block; padding: 0 14px 12px; font-size: 13px; color: #444; }
.ls-docs-label select, .ls-docs-label input {
  display: block; width: 100%; margin-top: 6px; padding: 9px;
  border: 1px solid #d0d7de; border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.ls-docs-check {
  margin: 0 14px; padding: 11px; width: calc(100% - 28px); border: none;
  background: #ea3062; color: #fff; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.ls-docs-result { padding: 14px; font-size: 13px; line-height: 1.6; }
.ls-docs-result ul { margin: 6px 0 12px; padding-left: 18px; }
.ls-docs-result .ok { color: #1a7f37; }
.ls-docs-result .miss { color: #cf222e; }
.ls-docs-result .note { color: #888; font-size: 12px; margin-top: 8px; }

/* 데스크톱: 핑크 CTA(90×140, right:50px bottom:20px) 위로 배치 */
@media (min-width: 769px) {
  .ls-chatbot { right: 50px; bottom: 176px; }
}
