/* 실시간 상담 창(ab/pages/live-chat.js) - 시안 angel.css 의 .sheet · .menu-sheet · .btn 위에 얹는다. 어느 쪽에 붙여도 되게 다른 화면 CSS 에 기대지 않는다.
   2026-11-27 형님 "이것도 퀄리티좀 올려라": 하늘 머리 칸 + 고객센터 천사(host-support.webp), 말풍선 대화, 둥근 입력 칸 + 보내기 단추, 입금 전 안내 칸(1:1 문의 · 입금). */
.ab-chat { width: min(440px, calc(100vw - 32px)); overflow: hidden; }
.ab-chat:focus, .ab-chat:focus-visible { outline: none; }
.ab-chat-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 머리 칸: 하늘 그림 위에 제목, 오른쪽에 헤드셋 천사(허리 아래는 칸 밖으로 잘린다) */
.ab-chat-top { position: relative; flex: none; display: flex; align-items: center; min-height: 112px; padding: 20px 150px 20px 24px; overflow: hidden; background: linear-gradient(165deg, #bfdcff 0%, #e3f0ff 58%, #fff3d1 100%); border-bottom: 1px solid var(--line); }
.ab-chat-top::before { content: ""; position: absolute; inset: 0; background: url("/s/art/bg-sky.webp") 40% 35% / cover no-repeat; opacity: 0.6; }
.ab-chat-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.55)); pointer-events: none; }
.ab-chat-host { position: absolute; right: 50px; bottom: -64px; z-index: 1; width: 124px; height: auto; pointer-events: none; filter: drop-shadow(0 6px 14px rgba(8, 29, 77, 0.2)); }
.ab-chat-title { position: relative; z-index: 2; display: grid; gap: 6px; min-width: 0; }
.ab-chat-title h2 { margin: 0; font-family: var(--display); font-size: 23px; font-weight: 700; line-height: 1.1; color: var(--navy); text-shadow: 0 1px 0 #fff, 0 0 12px rgba(255, 255, 255, 0.9); }
.ab-chat-title p { margin: 0; font-size: 14px; font-weight: 800; color: var(--blue-700); text-shadow: 0 0 8px rgba(255, 255, 255, 0.95); }
.ab-chat-x { position: absolute; top: 12px; right: 12px; z-index: 3; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: var(--navy); box-shadow: 0 4px 12px rgba(8, 29, 77, 0.18); transition: transform 0.15s var(--ease), color 0.2s; }
.ab-chat-x:hover { color: var(--blue); transform: scale(1.05); }
.ab-chat-x .ico { width: 20px; height: 20px; }

/* 대화 */
.ab-chat-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-height: 280px; max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 16px; background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%); }
.ab-chat-row { display: flex; align-items: flex-start; gap: 8px; max-width: 88%; }
.ab-chat-row + .ab-chat-row:not(.is-cont), .ab-chat-sys + .ab-chat-row, .ab-chat-row + .ab-chat-sys { margin-top: 8px; }
.ab-chat-row.is-me { align-self: flex-end; justify-content: flex-end; }
.ab-chat-av { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--sky-1) url("/s/art/host-support.webp") 53% 11% / 306% auto no-repeat; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(8, 29, 77, 0.18); }
.ab-chat-row.is-cont .ab-chat-av { visibility: hidden; height: 0; }
.ab-chat-col { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.ab-chat-row.is-me .ab-chat-col { justify-items: end; }
.ab-chat-who { padding: 2px 2px 0; font-size: 13px; font-weight: 800; color: var(--navy); }
.ab-chat-bub { margin: 0; padding: 11px 15px; border-radius: 4px 18px 18px 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(15, 60, 140, 0.07); font-size: 14.5px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.ab-chat-row.is-cont .ab-chat-bub { border-radius: 18px; }
.ab-chat-row.is-me .ab-chat-bub { border-radius: 18px 4px 18px 18px; background: linear-gradient(180deg, #2f7bff 0%, var(--blue-600) 100%); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(30, 107, 255, 0.26); }
.ab-chat-row.is-me.is-cont .ab-chat-bub { border-radius: 18px; }
.ab-chat-time { padding: 0 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.ab-chat-sys { align-self: center; max-width: 92%; margin: 0; padding: 7px 14px; border-radius: 12px; background: rgba(11, 42, 111, 0.06); font-size: 12.5px; line-height: 1.5; color: var(--ink-2); text-align: center; overflow-wrap: anywhere; }
.ab-chat-sys time { margin-left: 4px; color: var(--ink-3); }
.ab-chat-wait { align-self: center; margin: auto 0; padding: 10px 2px; font-size: 14px; line-height: 1.6; color: var(--ink-3); }
.ab-chat-err { margin: 0; padding: 10px 2px; font-size: 14px; font-weight: 700; color: #c21d38; }
.ab-chat-msg { flex: none; padding: 8px 18px 0; background: #fff; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; }
.ab-chat-msg[hidden] { display: none; }

/* 입력 */
/* 시안 .sheet form { display: grid } 이 더 세서 창 이름을 붙여 누른다 */
.ab-chat .ab-chat-form { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px 14px; background: #fff; border-top: 1px solid var(--line); }
.ab-chat .ab-chat-msg:not([hidden]) + .ab-chat-form { border-top: 0; padding-top: 8px; }
.ab-chat .ab-chat-form[hidden] { display: none; }
.ab-chat-input { flex: 1 1 auto; min-width: 0; height: 48px; min-height: 48px; max-height: 132px; padding: 12px 18px; border-radius: 24px; border: 1.5px solid var(--line); background: var(--sky-0); font: inherit; font-size: 15px; line-height: 1.45; color: var(--ink); resize: none; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; }
.ab-chat-input::placeholder { color: #8090b8; }
.ab-chat-input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(30, 107, 255, 0.14); }
.ab-chat-send { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(180deg, #2f7bff 0%, var(--blue-600) 100%); color: #fff; box-shadow: 0 6px 14px rgba(30, 107, 255, 0.32); transition: transform 0.15s var(--ease), box-shadow 0.2s, opacity 0.2s; }
.ab-chat-send svg { width: 21px; height: 21px; margin-left: 2px; }
.ab-chat-send:hover { transform: translateY(-1px); box-shadow: 0 9px 18px rgba(30, 107, 255, 0.4); }
.ab-chat-send:active { transform: scale(0.95); }
.ab-chat-send:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.ab-chat-send:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* 입금 전 · 문의 막힘 안내 칸(입력 칸 자리) */
.ab-chat-lock { flex: none; display: grid; gap: 12px; padding: 14px 16px 16px; background: #fff; border-top: 1px solid var(--line); }
.ab-chat-lock[hidden] { display: none; }
.ab-chat-lock p { margin: 0; padding: 12px 14px; border-radius: 14px; background: #fff7e2; border: 1px solid #f4d58b; font-size: 14px; font-weight: 700; line-height: 1.55; color: #6f4a00; }
.ab-chat-lock-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ab-chat-lock-acts[hidden] { display: none; }
.ab-chat-lock-acts .btn { height: 48px; padding: 0 12px; }

@media (max-width: 1023px) {
  .ab-chat { width: 100vw; max-width: 100vw; }
  .ab-chat-body { max-height: 56vh; }
  .ab-chat .ab-chat-form, .ab-chat-lock { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 380px) {
  .ab-chat-top { padding-right: 132px; }
  .ab-chat-host { right: 44px; width: 112px; }
}
