/* 상담 대화 판(assets/js/visitor-chat.js) — site.css 의 색·글꼴·단추(.btn) 변수를 그대로 쓴다.
   데스크톱: 문의하기 단추 위에 뜨는 380×640 판. 폰(≤768px): 화면 전체 시트. */

/* 입구 단추: 판이 열리면 X 로 바뀌고, 닫혀 있는 동안 온 답 수를 빨간 알약으로 */
.qa-contact { position: relative; }
.qa-contact .vc-x { display: none; }
.qa-contact.vc-open { width: 48px; padding: 0; justify-content: center; border-radius: 24px; }
.qa-contact.vc-open > svg:not(.vc-x), .qa-contact.vc-open span { display: none; }
.qa-contact.vc-open .vc-x { display: block; width: 20px; height: 20px; }
.qa-contact.vc-has-dot { overflow: visible; }
.qa-contact.vc-has-dot span { overflow: hidden; }
.vc-dot { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #d92d20; color: #fff; font-size: 11px; font-style: normal; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
html.vc-is-open .qa-top { display: none; }

.vc-panel { position: fixed; right: 24px; bottom: 80px; z-index: 96; width: 380px; height: 640px; max-height: calc(100vh - 104px); max-height: calc(100dvh - 104px); display: flex; flex-direction: column; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 48px rgba(17,24,39,.18); overflow: hidden; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.vc-panel[hidden] { display: none; }
.vc-panel button { font: inherit; }

.vc-head { flex: none; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); }
.vc-t { flex: 1; min-width: 0; }
.vc-t b { display: block; font-size: 16px; font-weight: 600; line-height: 1.2; }
.vc-t small { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--ink-3); }
.vc-t small i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #1b9e5a; }
.vc-t small i.off { background: #b3b7bd; }
.vc-ib { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.vc-ib:hover { background: var(--bg); color: var(--ink); }
.vc-ib svg { width: 18px; height: 18px; }
.vc-ib[hidden] { display: none; }

.vc-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); }
.vc-body.is-form { background: var(--panel); }

/* 시작 폼: 문의 폼(.form)과 같은 칸 모양 */
.vc-form { padding: 16px 16px 20px; }
.vc-intro { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); }
.vc-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.vc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vc-form label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.vc-form label .req { color: #c2410c; margin-left: 2px; }
.vc-form label .opt { color: var(--ink-3); font-weight: 400; margin-left: 4px; }
.vc-in { width: 100%; min-width: 0; margin: 0; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid #d7dadf; border-radius: 8px; }
.vc-in:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(31,95,191,.15); }
.vc-ta { min-height: 88px; resize: vertical; }
.vc-hint { margin: -6px 0 12px; font-size: 12px; color: var(--ink-3); }
.vc-consent { display: flex; align-items: flex-start; gap: 9px; margin: 2px 0 14px; }
.vc-consent input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; }
.vc-consent a, .vc-alt a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.vc-form .hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.vc-full { width: 100%; }
.vc-form .btn[disabled] { opacity: .6; cursor: default; }
.vc-form .form-msg { margin-top: 10px; }
.vc-alt { margin: 12px 0 0; font-size: 12px; color: var(--ink-3); text-align: center; }

/* Turnstile 확인 상자 자리: 확인이 필요할 때만 상자가 생긴다 */
.ts-box:has(iframe) { margin: 0 0 14px; }

/* 대화 */
.vc-msgs { display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 10px; }
.vc-chip { align-self: center; max-width: 90%; padding: 3px 10px; border-radius: 999px; background: #e3e6ea; color: var(--ink-2); font-size: 12px; font-weight: 500; text-align: center; }
.vc-mg { display: flex; flex-direction: column; gap: 3px; max-width: 86%; min-width: 0; }
.vc-mg.them { align-self: flex-start; align-items: flex-start; }
.vc-mg.me { align-self: flex-end; align-items: flex-end; }
.vc-who { margin: 0 0 1px 2px; font-size: 12px; color: var(--ink-3); }
.vc-bub { max-width: 100%; padding: 9px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; word-break: keep-all; unicode-bidi: isolate; }
.vc-mg.them .vc-bub { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.vc-mg.me .vc-bub { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.vc-mg.them .vc-bub.auto { border-style: dashed; color: var(--ink-2); }
.vc-meta { margin: 0 2px; font-size: 11px; color: var(--ink-3); }
.vc-meta.fail { color: #b42318; }
.vc-retry { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

.vc-note { flex: none; padding: 7px 14px; font-size: 12px; color: #b42318; background: #fdecec; border-top: 1px solid #f7d4d4; }
.vc-note[hidden] { display: none; }
.vc-foot-wrap { flex: none; }
.vc-foot { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 10px 14px; border-top: 1px solid var(--line); background: #fff; }
.vc-foot .vc-in { min-height: 40px; max-height: 120px; padding: 9px 14px; border-radius: 20px; resize: none; line-height: 1.4; }
.vc-send { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer; }
.vc-send:hover { background: var(--brand-2); }
.vc-send[disabled] { background: #d7dadf; cursor: default; }
.vc-send svg { width: 18px; height: 18px; }
.vc-ended { padding: 12px 14px 14px; text-align: center; font-size: 13px; color: var(--ink-3); background: #fff; border-top: 1px solid var(--line); }
.vc-ended .btn { display: flex; width: fit-content; margin: 8px auto 0; }

.vc-menu { position: absolute; top: 50px; right: 48px; z-index: 2; min-width: 160px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(17,24,39,.14); }
.vc-menu[hidden] { display: none; }
.vc-menu button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-size: 14px; text-align: left; cursor: pointer; }
.vc-menu button:hover, .vc-menu button:focus-visible { background: var(--bg); color: var(--ink); }
.vc-confirm { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(17,24,39,.32); }
.vc-confirm[hidden] { display: none; }
.vc-confirm-box { width: 300px; max-width: 100%; padding: 20px; background: #fff; border-radius: 12px; }
.vc-confirm-box p { margin: 0 0 16px; font-size: 14px; color: var(--ink-2); }
.vc-bt { display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 768px) {
  .vc-panel { inset: 0; z-index: 120; width: auto; height: auto; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
  html.vc-is-open, html.vc-is-open body { overflow: hidden; }
  html.vc-is-open .quick-actions { display: none; }
  .vc-in { font-size: 16px; } /* iOS 가 16px 미만 칸에서 화면을 키우지 않게 */
}
@media (max-width: 380px) { .vc-row { grid-template-columns: 1fr; gap: 0; } }
