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

.ls-chatbot {
  position: fixed;
  right: 16px;
  bottom: 92px;            /* 모바일: 하단 전체폭 핑크 CTA 바 위로 */
  z-index: 35;             /* CTA(30) 위, 사이트 모달(40)·B2B 바텀시트(60) 아래 */
  font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

/* 패널이 열리면 런처는 숨겨 CTA와의 시각적 경쟁을 줄인다 */
.ls-chatbot.is-open .ls-chat-toggle { display: none; }

/* 런처 버튼 — Figma 상담하기 마스코트 아이콘 */
.ls-chat-toggle {
  display: block; margin-left: auto; padding: 0;
  border: none; background: none; cursor: pointer; line-height: 0;
  width: 60px; height: 60px;
}
.ls-chat-toggle img {
  width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.28));
  transition: transform .12s ease;
}
.ls-chat-toggle:hover img { transform: scale(1.06); }

/* 패널 */
.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; }

/* 응급 CTA 배너 */
.ls-emergency { background: #cf222e; color: #fff; padding: 10px 12px; flex: 0 0 auto; }
.ls-emergency-text { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.ls-emergency-actions { display: flex; gap: 6px; }
.ls-em-btn {
  flex: 1; text-align: center; text-decoration: none; cursor: pointer;
  background: #fff; color: #cf222e; border: none; border-radius: 8px;
  padding: 8px 4px; font-size: 12px; font-weight: 700;
}
.ls-em-btn.call { background: #fff3cd; }

.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 2px;
  cursor: pointer; font-size: 12.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;
}

/* 빠른 진입 버튼 (§4.1) */
.ls-quick { display: flex; flex-direction: column; gap: 8px; align-self: flex-start; max-width: 90%; }
.ls-quick-btn {
  text-align: left; border: 1px solid #d7dbe6; background: #fff; color: #333647;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 13.5px;
}
.ls-quick-btn:hover { border-color: #333647; background: #f4f6fb; }

/* 칩(결과 내 '상담원 연결' 등) */
.ls-chip {
  border: 1px solid #ea3062; background: #fff; color: #ea3062;
  padding: 7px 12px; border-radius: 16px; cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.ls-chip:hover { background: #fdeef2; }

/* 구조화 문진 카드 */
.ls-intake {
  align-self: stretch; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column;
}
.ls-intake-title { font-weight: 700; color: #333647; margin-bottom: 6px; }
.ls-checks { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.ls-checks label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #444; }
.ls-checks input { margin: 0; }

/* 위험도 분류 결과 */
.ls-risk { display: inline-block; color: #fff; font-weight: 700; font-size: 12px;
  padding: 3px 10px; border-radius: 12px; margin-bottom: 8px; }
.ls-triage-body { font-size: 13px; line-height: 1.55; }
.ls-phrases { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e5e7eb; }
.ls-phrase { margin-top: 6px; }
.ls-phrase .vi { display: block; font-weight: 600; color: #1f2328; }
.ls-phrase .ko { display: block; font-size: 12px; color: #888; }

/* 공통 폼 라벨/버튼 */
.ls-form-label { display: block; padding: 0 0 10px; font-size: 13px; color: #444; }
.ls-docs-scroll .ls-form-label { padding: 0 14px 12px; }
.ls-form-label select,
.ls-form-label input[type=text],
.ls-form-label input[type=tel],
.ls-form-label input[type=email],
.ls-form-label input[type=file] {
  display: block; width: 100%; margin-top: 6px; padding: 9px;
  border: 1px solid #d0d7de; border-radius: 8px;
  font-size: 14px; font-weight: 400; box-sizing: border-box;
}
/* 파일 입력의 "선택된 파일 없음" 텍스트도 select와 동일 크기·굵기로 */
.ls-form-label input[type=file] { font-size: 14px; font-weight: 400; }
.ls-form-label input[type=file]::-webkit-file-upload-button { font-size: 14px; font-weight: 400; }

/* 미리 입력된 예시(placeholder)는 작게 */
#ls-chatbot input::placeholder,
#ls-chatbot textarea::placeholder { font-size: 12px; color: #aab; }
.ls-primary-btn {
  margin-top: 4px; padding: 11px; width: 100%; border: none;
  background: #ea3062; color: #fff; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.ls-primary-btn:disabled { background: #e9a9bd; cursor: default; }
.ls-docs-scroll .ls-primary-btn { width: calc(100% - 28px); margin: 0 14px; }
.ls-consent { display: flex; gap: 8px; padding: 0 14px 12px; font-size: 12.5px; color: #555; line-height: 1.45; }
.ls-consent input { margin-top: 2px; flex: 0 0 auto; }
.ls-form-label .req { color: #cf222e; }
.ls-docs-scroll .ls-form-label input + input { margin-top: 6px; }

/* 서류 점검 탭 */
.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-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) 위 + 가로 중심 정렬
   (런처 60px / CTA 90px → 폭 차 15px의 절반만큼 더 들여써 중심을 맞춤) */
@media (min-width: 769px) {
  .ls-chatbot { right: 65px; bottom: 176px; }
}
