/* SAM 고객지원 채팅 위젯 — 랜딩 공용. 랜딩 CSS 와 충돌하지 않게 .sam-chat 아래로만 스코프 */
.sam-chat { --sc-primary: #2563eb; --sc-primary-dark: #1e40af; --sc-ink: #17202e; --sc-muted: #6b7280; --sc-bg: #fff; --sc-soft: #f3f4f6; --sc-ai: #eef4ff; --sc-agent: #ecfdf5; --sc-sys: #fffbeb; font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Malgun Gothic", sans-serif; font-size: 14px; line-height: 1.45; color: var(--sc-ink); }
.sam-chat *, .sam-chat *::before, .sam-chat *::after { box-sizing: border-box; }
.sam-chat__launcher { position: fixed; right: 20px; bottom: 20px; z-index: 9990; width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--sc-primary); color: #fff; box-shadow: 0 10px 28px rgba(37, 99, 235, .35); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .15s ease, background .15s ease; }
.sam-chat__launcher:hover { background: var(--sc-primary-dark); transform: translateY(-2px); }
.sam-chat__launcher.is-open { background: var(--sc-ink); }
.sam-chat__badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.sam-chat__panel { position: fixed; right: 20px; bottom: 88px; z-index: 9991; width: 360px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 110px); background: var(--sc-bg); border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 23, 42, .22); display: flex; flex-direction: column; overflow: hidden; }
.sam-chat__panel[hidden] { display: none; }
.sam-chat__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--sc-primary); color: #fff; }
.sam-chat__panel[data-state="handoff"] .sam-chat__head { background: #ea580c; }
.sam-chat__panel[data-state="human"] .sam-chat__head { background: #059669; }
.sam-chat__panel[data-state="closed"] .sam-chat__head { background: #6b7280; }
.sam-chat__title { font-weight: 700; font-size: 15px; }
.sam-chat__status { font-size: 12px; opacity: .9; }
.sam-chat__close { border: 0; background: transparent; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.sam-chat__body { flex: 1; overflow-y: auto; padding: 14px 12px; background: #fafbfc; display: flex; flex-direction: column; gap: 10px; }
.sam-chat__msg { max-width: 86%; display: flex; flex-direction: column; }
.sam-chat__msg--visitor { align-self: flex-end; align-items: flex-end; }
.sam-chat__msg--system { align-self: center; max-width: 94%; }
.sam-chat__who { font-size: 11px; color: var(--sc-muted); margin: 0 4px 3px; }
.sam-chat__msg--system .sam-chat__who { display: none; }
.sam-chat__bubble { padding: 9px 12px; border-radius: 14px; background: var(--sc-soft); white-space: pre-wrap; word-break: break-word; }
.sam-chat__msg--visitor .sam-chat__bubble { background: var(--sc-primary); color: #fff; border-bottom-right-radius: 4px; }
.sam-chat__msg--ai .sam-chat__bubble { background: var(--sc-ai); border-bottom-left-radius: 4px; }
.sam-chat__msg--agent .sam-chat__bubble { background: var(--sc-agent); border-bottom-left-radius: 4px; }
.sam-chat__msg--system .sam-chat__bubble { background: var(--sc-sys); color: #7c5a00; font-size: 12.5px; text-align: center; }
.sam-chat__bubble a { color: var(--sc-primary-dark); text-decoration: underline; }
.sam-chat__msg--visitor .sam-chat__bubble a { color: #fff; }
.sam-chat__typing .sam-chat__bubble { display: flex; gap: 4px; padding: 12px 14px; }
.sam-chat__typing span { width: 6px; height: 6px; border-radius: 50%; background: #93a4c0; animation: sam-chat-blink 1.2s infinite; }
.sam-chat__typing span:nth-child(2) { animation-delay: .2s; } .sam-chat__typing span:nth-child(3) { animation-delay: .4s; }
@keyframes sam-chat-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.sam-chat__contact { padding: 10px 12px; border-top: 1px solid #e5e7eb; background: #fff7ed; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sam-chat__contact[hidden] { display: none; }
.sam-chat__contact-title { grid-column: 1 / -1; font-size: 12px; color: #9a3412; font-weight: 600; }
.sam-chat__contact input { width: 100%; padding: 7px 9px; border: 1px solid #e5e7eb; border-radius: 8px; font: inherit; font-size: 13px; }
.sam-chat__contact-actions { grid-column: 1 / -1; display: flex; gap: 6px; }
.sam-chat__contact-actions button { flex: 1; padding: 7px; border-radius: 8px; border: 1px solid #ea580c; background: #ea580c; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sam-chat__contact-actions button[type="button"] { background: #fff; color: #9a3412; }
.sam-chat__foot { border-top: 1px solid #e5e7eb; padding: 8px 10px 6px; background: #fff; }
.sam-chat__handoff { display: inline-block; margin-bottom: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid #ea580c; background: #fff; color: #9a3412; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.sam-chat__handoff[hidden] { display: none; }
.sam-chat__handoff:hover { background: #fff7ed; }
.sam-chat__form { display: flex; align-items: flex-end; gap: 6px; }
.sam-chat__form textarea { flex: 1; resize: none; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 12px; font: inherit; font-size: 14px; line-height: 1.4; max-height: 96px; outline: none; }
.sam-chat__form textarea:focus { border-color: var(--sc-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.sam-chat__form button { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--sc-primary); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sam-chat__form button:disabled, .sam-chat__form textarea:disabled { opacity: .5; cursor: not-allowed; }
.sam-chat__note { margin-top: 5px; font-size: 11px; color: var(--sc-muted); text-align: center; }
@media (max-width: 480px) {
  .sam-chat__launcher { right: 14px; bottom: 14px; width: 52px; height: 52px; }
  .sam-chat__panel { right: 0; left: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
}
