/* 플로팅 버튼 */
.wschat-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(0,0,0,.15);
  cursor: pointer;
}

/* 모달 컨테이너(크기 변화는 여기에 적용) */
.wschat-modal {
  position: fixed;
  right: 20px;
  bottom: 80px;
  /* 기본 크기 */
  width: 360px;
  height: 480px;
  /* 최소/최대 범위 */
  min-width: 280px;
  min-height: 360px;
  max-width: 92vw;
  max-height: 80vh;

  z-index: 2147483001;
  display: none;
}
.wschat-modal.open { display: block; }

/* 풀사이즈(확대) 모드 */
.wschat-modal.full {
  right: 8px;
  bottom: 8px;
  width: 96vw !important;
  height: 86vh !important;
  max-width: 96vw !important;
  max-height: 90vh !important;
}

/* 모바일에서 더블탭 시 확대 커서 표시는 필요 없지만, 데스크톱 안내용 */
@media (pointer: coarse) {
  .wschat-title { cursor: default; } /* 모바일은 드래그 리사이즈 안씀(더블탭 확대) */
}

/* 카드 프레임: 부모 높이에 맞춰 전부 채움 */
.wschat-card {
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 내부 스크롤은 메시지 영역에만 */
}

/* 헤더/상태 영역은 고정 */
.wschat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #111827;
  color: #fff;
  flex: 0 0 auto;
}
.wschat-title { font-weight: 600; }
.wschat-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.wschat-status {
  font-size: 12px;
  color: #374151;
  padding: 6px 10px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  flex: 0 0 auto;
}

/* 본문: 세로 레이아웃 고정, 메시지 영역만 스크롤 */
.wschat-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  flex: 1 1 auto;     /* 남은 공간 채움 */
  min-height: 0;      /* 중요: flex 자식의 스크롤 허용 */
}

/* 대화 내용: 여기만 스크롤 */
.wschat-messages {
  flex: 1 1 auto;
  min-height: 0;      /* 중요: 자식 스크롤 활성에 필요 */
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
}

/* 입력줄은 항상 하단 고정(스크롤 영향 없음) 
.wschat-inputrow {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.wschat-input {
  flex: 1 1 auto;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
}
*/
/* 입력줄은 항상 하단 고정(스크롤 영향 없음) */
.wschat-inputrow { display: flex; gap: 8px; flex: 0 0 auto; }

/* textarea 자동확장용 스타일 */
.wschat-input {
  flex: 1 1 auto;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.4;
  min-height: 38px;          /* rows=1 기본 높이 */
  max-height: 140px;         /* 너무 커지지 않도록 상한 */
  resize: none;              /* 사용자 임의 리사이즈 금지 (모바일 호환) */
  overflow-y: hidden;        /* JS로 높이 늘릴 때 내부 스크롤 숨김 */
  white-space: pre-wrap;     /* soft wrap */
  word-break: break-word;
}

.wschat-input.is-scroll {
  overflow-y: auto;          /* 상한을 초과한 경우 내부 스크롤 허용 */
}

.wschat-btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.wschat-send {
  background: #111827;
  color: #fff;
}
.wschat-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 하단 액션(채팅 시작 버튼 등)도 고정 */
.wschat-actions {
  padding: 8px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.wschat-primary {
  background: #2563eb;
  color: #fff;
}

/* 말풍선 스타일 */
.wschat-bubble {
  max-width: 78%;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.4;
  border-radius: 12px;
  word-break: break-word;
  white-space: pre-wrap;
}
.wschat-bubble a { text-decoration: underline; }
.wschat-bubble.me {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.wschat-bubble.bot {
  align-self: flex-start;
  background: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 4px;
}

/* 크기 변경 핸들 */
.wschat-title {
  font-weight: 600;
  cursor: se-resize; /* 드래그로 크기 변경 */
}

/* 타이핑(응답 대기) 버블 */
.wschat-bubble.typing {
  align-self: flex-start;              /* 상대(좌측)처럼 보이게 */
  background: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 점 3개 애니메이션 */
.wschat-typing-dots {
  display: inline-flex;
  gap: 4px;
}
.wschat-typing-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #9ca3af;
  opacity: .35;
  animation: wschat-blink 1.4s infinite;
}
.wschat-typing-dots .dot:nth-child(2) { animation-delay: .2s; }
.wschat-typing-dots .dot:nth-child(3) { animation-delay: .4s; }

@keyframes wschat-blink {
  0%, 80%, 100% { opacity: .35; transform: translateY(0); }
  40%           { opacity: 1;    transform: translateY(-2px); }
}

/* --- 이미지 트레이 --- */
.wschat-tray[hidden] { display: none !important; }
.wschat-tray {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
  margin-bottom: 8px;
}
.wschat-tray-grid {
  display: grid;
  grid-template-columns: repeat(5, 72px);
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}
.wschat-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wschat-thumb img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.wschat-thumb.pending {
  border-style: dashed;
  color: #64748b;
  font-size: 12px;
}
.wschat-thumb.uploading {
  border-color: #93c5fd;
  background: #eff6ff;
}
.wschat-thumb.error {
  border-color: #ef4444;
  box-shadow: inset 0 0 0 2px #ef4444;
  color: #ef4444;
  font-weight: 700;
  font-size: 12px;
}
.wschat-thumb .tag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 4px;
}
.wschat-thumb .del {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.55);
  cursor: pointer;
  line-height: 18px;
  text-align: center;
}
.wschat-tray-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* 응답 대기 버블(기존) 재사용 */
.wschat-bubble.typing { align-self: flex-start; background: #e5e7eb; color:#111827; border-bottom-left-radius:4px; display:inline-flex; align-items:center; gap:6px; }
.wschat-typing-dots { display:inline-flex; gap: 4px; }
.wschat-typing-dots .dot { width:6px; height:6px; border-radius:999px; background:#9ca3af; opacity:.35; animation:wschat-blink 1.4s infinite; }
.wschat-typing-dots .dot:nth-child(2){ animation-delay:.2s; }
.wschat-typing-dots .dot:nth-child(3){ animation-delay:.4s; }
@keyframes wschat-blink { 0%,80%,100%{opacity:.35;transform:translateY(0)} 40%{opacity:1;transform:translateY(-2px)} }

/* 드래그 중 선택 방지/커서 */
.wschat-no-select * { user-select: none !important; }
.wschat-title { font-weight: 600; cursor: nwse-resize; }

/* 모바일 확대 모드 */
.wschat-modal.full {
  right: 8px; bottom: 8px;
  width: 96vw !important; height: 86vh !important;
  max-width: 96vw !important; max-height: 90vh !important;
}
@media (pointer: coarse) { .wschat-title { cursor: default; } }

/* --- 이미지 트레이 --- */
.wschat-tray[hidden] { display: none !important; }
.wschat-tray {
  position: relative;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px 8px 12px;
  background: #f8fafc;
  margin-bottom: 8px;
  overflow: hidden; /* 페이드 엣지를 위한 클리핑 */
}

/* 가로 스크롤로 변경 (기존 grid → flex) */
#wschat-tray-grid,
.wschat-tray-grid {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 4px 2px;
}

/* 스크롤바 최소화(지원 브라우저에서) */
.wschat-tray-grid::-webkit-scrollbar { height: 6px; }
.wschat-tray-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.wschat-tray-grid::-webkit-scrollbar-track { background: transparent; }

/* 썸네일(고정 폭) */
.wschat-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;           /* 가로 줄 세우기 */
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;  /* 스냅 */
}

/* 상태/기존 스타일 그대로… (필요시 이전 정의 유지) */
.wschat-thumb img { max-width: 100%; max-height: 100%; display:block; }
.wschat-thumb.pending { border-style: dashed; color:#64748b; font-size:12px; }
.wschat-thumb.uploading { border-color:#93c5fd; background:#eff6ff; }
.wschat-thumb.error { border-color:#ef4444; box-shadow: inset 0 0 0 2px #ef4444; color:#ef4444; font-weight:700; font-size:12px; }
.wschat-thumb .tag { position:absolute; left:4px; bottom:4px; background:rgba(0,0,0,.6); color:#fff; font-size:10px; padding:2px 4px; border-radius:4px; }
.wschat-thumb .del { position:absolute; right:2px; top:2px; width:18px; height:18px; border:0; border-radius:50%; color:#fff; background:rgba(0,0,0,.55); cursor:pointer; line-height:18px; text-align:center; }

/* 트레이 네비게이션 버튼 (좌/우) */
.wschat-tray-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 28px;
  height: 48px;
  border: 0;
  border-radius: 6px;
  background: rgba(17,24,39,.55);
  color: #fff;
  cursor: pointer;
  display: none; /* 기본은 숨김 → overflow 시 보임 */
}
.wschat-tray-nav.left  { left: 4px; }
.wschat-tray-nav.right { right: 4px; }

/* 트레이가 넘칠 때만 표시 */
.wschat-tray.is-overflow .wschat-tray-nav { display: inline-block; }

/* 페이드 엣지(스크롤 힌트) */
.wschat-tray.is-overflow::before,
.wschat-tray.is-overflow::after {
  content: "";
  position: absolute;
  top: 0; width: 20px; height: 100%;
  pointer-events: none;
}
.wschat-tray.is-overflow::before {
  left: 0;
  background: linear-gradient(to right, rgba(248,250,252,1), rgba(248,250,252,0));
}
.wschat-tray.is-overflow::after {
  right: 0;
  background: linear-gradient(to left, rgba(248,250,252,1), rgba(248,250,252,0));
}

/* 트레이 액션 버튼 영역 */
.wschat-tray-actions { display:flex; gap:8px; justify-content:flex-end; margin-top: 8px; }

/* 최대화 모드(데스크톱/모바일 공통) */
.wschat-modal.max {
  inset: 2vh 2vw auto auto;           /* 우하단 여백 */
  width: 96vw !important;
  height: 90vh !important;
  max-width: 96vw !important;
  max-height: 90vh !important;
}

/* 루트에 .embedded 가 붙으면 다이얼로그 느낌 제거 */
.wschat-root.embedded .wschat-modal {
  position: static;                 /* 고정/플로팅 해제 → 문서 흐름에 배치 */
  inset: auto;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  background: transparent;          /* 바탕 투명 */
  box-shadow: none;                  /* 그림자 제거 */
  border: 0;                         /* 테두리 제거 */
}

.wschat-root.embedded .wschat-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  /* 본문 섹션처럼 보이되, 내부 스크롤 영역은 기존 유지 */
}

/* 임베디드 모드에서는 FAB 숨김 */
.wschat-root.embedded .wschat-fab { display: none !important; }
/* 최대화(.max) 상태에서는 FAB 기본 숨김 */
.wschat-modal.max ~ .wschat-fab,
.wschat-modal.max + .wschat-fab,
.wschat-modal.max .wschat-fab {
  display: none !important;
}

/* ------- 최상단: 문서 스크롤 잠금(모달 열릴 때 JS가 body에 wschat-lock을 붙임) ------- */
body.wschat-lock { overflow: hidden !important; }

/* ------- 뷰포트 치수 변수 (JS가 설정) ------- */
.wschat-root { --wschat-vh: 100vh; --wschat-vw: 100vw; }

/* ------- 임베디드 + 최대화: 화면을 정확히 채우는 '고정 배치' ------- */
/* (이 블록이 이전 규칙들을 모두 '덮어씁니다') */
.wschat-root.embedded .wschat-modal.max {
  position: fixed !important;     /* 문서 흐름 영향 제거 → 상단 여백 사라짐 */
  top: 0 !important;
  left: 0 !important;
  transform: none !important;     /* 가운데 정렬용 transform 제거 */
  width: var(--wschat-vw) !important;      /* 화면 가로에 딱 맞춤 */
  height: var(--wschat-vh) !important;     /* 화면 세로에 딱 맞춤 */
  max-width: var(--wschat-vw) !important;
  max-height: var(--wschat-vh) !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  overflow: hidden !important;     /* 바깥으로 넘침 금지 → 페이지 스크롤바 방지 */
  z-index: 9999;                   /* 테마 요소 위로 */
}

/* 카드/바디/메시지: 전체 높이 채우기 + 메시지 영역만 스크롤 */
.wschat-root.embedded .wschat-card {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.wschat-root.embedded .wschat-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;     /* 내부에서만 스크롤 */
}

.wschat-root.embedded .wschat-messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;       /* 여기만 세로 스크롤 */
}

/* 입력줄/트레이는 고정 높이, 넘침 없음 */
.wschat-root.embedded .wschat-inputrow,
.wschat-root.embedded #wschat-tray {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  overflow: visible !important;
}

/* (선택) 이전에 적용했던 full-bleed 여백 보정은 최대화일 땐 비활성화 */
.wschat-root.embedded {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ===== WS 끊김 팝업 ===== */
.wschat-ask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;                 /* 필요 시 표시 */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
}
.wschat-ask.open { display: flex; }

.wschat-ask-dialog {
  width: min(92vw, 420px);
  max-width: 92vw;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  overflow: hidden;
}

.wschat-ask-hd {
  padding: 14px 16px;
  background: #111827;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}

.wschat-ask-bd {
  padding: 16px;
  color: #111827;
  line-height: 1.5;
  font-size: 14px;
}

.wschat-ask-ft {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  justify-content: flex-end;
}

.wschat-ask-btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}
.wschat-ask-btn.primary { background: #2563eb; color: #fff; }
.wschat-ask-btn { background: #e5e7eb; color: #111827; }

/* 처음 로딩 히어로(가운데 타이틀) */
.wschat-hero {
  flex: 1 1 auto;
  min-height: 240px;
  padding: 24px 16px;
  color: #111827;
  text-align: center;
  font-weight: 700;
  line-height: 1.3;
  font-size: clamp(20px, 5vw, 32px);
  display: flex;
  flex-direction: column;   /* 타이틀 + 스타터 세로 배치 */
  align-items: center;
  justify-content: center;
  gap: 16px;
  display: none;
}

#wschat-hero-title {
  max-width: 90%;
}

/* Conversation Starter 리스트 영역 */
.wschat-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 90%;
}

/* 개별 Starter 버튼 */
.wschat-starter-item {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  background: #f1f5f9;
  color: #111827;
  cursor: pointer;
  white-space: nowrap;
}
.wschat-starter-item:hover {
  background: #e2e8f0;
}
.wschat-starter-item:active {
  background: #cbd5e1;
}

/* 히어로 활성화 시 다른 영역은 감춤 */
.wschat-body.has-hero #wschat-tray,
.wschat-body.has-hero #wschat-messages {
  display: none !important;
}

/* 히어로가 보일 땐 본문 레이아웃을 안정적으로 유지 */
.wschat-body.has-hero {
  display: flex !important;
  flex-direction: column !important;
}

/* 히어로가 보일 때: 본문을 세로 플렉스로, 히어로는 남은 공간을 차지 */
.wschat-body.has-hero {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}
.wschat-body.has-hero #wschat-hero {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  align-items: center;
  justify-content: center;
}
/* 입력창은 항상 하단 고정 블록 */
.wschat-body.has-hero .wschat-inputrow {
  display: flex !important;
  flex: 0 0 auto !important;
}

/* ===== AI 응답(marked HTML)용 타이포그래피 ===== */

/* 기본 버블 스타일 보정: 작은 창에서도 잘 보이게 */
.wschat-bubble.bot {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: normal;
}

/* marked에서 오는 div 래퍼 */
.wschat-bubble.bot > div {
  width: 100%;
}

/* 공통 텍스트 요소 간격 줄이기 (모바일/작은창 최적화) */
.wschat-bubble.bot p,
.wschat-bubble.bot ul,
.wschat-bubble.bot ol,
.wschat-bubble.bot pre,
.wschat-bubble.bot blockquote,
.wschat-bubble.bot table {
  margin: 0 0 0.5em;
}

/* 제목은 너무 크지 않게 축소 */
.wschat-bubble.bot h1,
.wschat-bubble.bot h2,
.wschat-bubble.bot h3,
.wschat-bubble.bot h4,
.wschat-bubble.bot h5,
.wschat-bubble.bot h6 {
  margin: 0.4em 0 0.2em;
  line-height: 1.3;
  font-weight: 600;
}
.wschat-bubble.bot h1 { font-size: 1.15rem; }
.wschat-bubble.bot h2 { font-size: 1.1rem; }
.wschat-bubble.bot h3 { font-size: 1.05rem; }
.wschat-bubble.bot h4,
.wschat-bubble.bot h5,
.wschat-bubble.bot h6 { font-size: 1rem; }

/* 리스트: 안쪽 들여쓰기 살짝만 */
.wschat-bubble.bot ul,
.wschat-bubble.bot ol {
  padding-left: 1.1em;
}
.wschat-bubble.bot li {
  margin: 0.15em 0;
}

/* 인라인 코드 */
.wschat-bubble.bot code {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

/* 블록 코드 (``` ``` 등) */
.wschat-bubble.bot pre {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  background: #0f172a;
  color: #e5e7eb;
  padding: 8px;
  border-radius: 6px;
  overflow-x: auto;
  max-height: 220px;    /* 너무 길면 버블 안에서 자체 스크롤 */
  box-sizing: border-box;
}
.wschat-bubble.bot pre code {
  background: transparent;
  padding: 0;
}

/* 인용문(>) */
.wschat-bubble.bot blockquote {
  border-left: 3px solid #e5e7eb;
  padding-left: 8px;
  color: #4b5563;
  font-style: italic;
}

/* 테이블: 작은 폭에서도 깨지지 않도록 */
.wschat-bubble.bot table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.wschat-bubble.bot th,
.wschat-bubble.bot td {
  border: 1px solid #e5e7eb;
  padding: 4px 6px;
}
.wschat-bubble.bot th {
  background: #f3f4f6;
  font-weight: 600;
}

/* 이미지/미디어: 폭을 버블 안에 맞추기 */
.wschat-bubble.bot img,
.wschat-bubble.bot video,
.wschat-bubble.bot iframe {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* 링크: 클릭이 잘 되도록 */
.wschat-bubble.bot a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.wschat-bubble.bot a:hover {
  text-decoration-thickness: 2px;
}

.wschat-bubble.bot .chat-messages {
  height: auto !important;
  max-height: none !important;
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 버블 안에서 마지막 요소는 아래 여백 제거 */
.wschat-bubble.bot > *:last-child {
  margin-bottom: 0 !important;
}

/* p 태그 아래 여백도 살짝만 사용 (이미 있으면 보강) */
.wschat-bubble.bot p {
  margin-bottom: 0.3em;
}
.wschat-bubble.bot p:last-child {
  margin-bottom: 0;
}

/* ===== 언어 선택 셀렉트 ===== */
.wschat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* 타이틀 + 언어 선택을 왼쪽 그룹 / 닫기 버튼 오른쪽 이런 구조라면 조정 가능 */
.wschat-lang-wrap {
  margin-left: auto;
  margin-right: 8px;
}

.wschat-lang {
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  height: 28px;
}

.wschat-lang:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}