/* 클라우드러닝 AI 상담 대화창 — 포털 리뉴얼 (2026.11.03)
   지금 사이트의 portal-chat.css 자리를 이 파일로 바꾼다. chat.js · 서버(/api/chatbot/*) 는 그대로 둔다.
   chat.js 가 만드는 화면 구조 · 클래스(.cl-chat__*) 를 하나도 바꾸지 않고 모양만 리뉴얼 디자인에 맞췄다.
   색은 site.css 토큰(--pri · --ink · --soft …)을 쓴다. 이 파일만 따로 쓸 때를 위해 아래 :where(:root) 에 같은 값을 둔다(우선순위 0 — site.css 가 있으면 그쪽이 이김).
   JS 가 루트에 붙이는 상태: .is-compact (떠 있는 패널 · 시트 · 640 이하), .is-touch (640 이하, 누르는 칸 44) */

:where(:root) { --pri: #904ae8; --pri-d: #7a35d0; --tint: #f3ecfd; --lav: #e2d3fb; --ink: #1d1d1f; --ink-2: #3a3a3f; --mut: #5e5e63; --soft: #f5f5f7; --gray: #eef0f2;
    --ok: #137333; --ok-bg: #e6f4ea; --warn: #9a5200; --warn-bg: #fef3e0; --err: #c5221f; --err-bg: #fce8e6; --line: #e6e6e9; --line-2: #f0f0f2; --track: #ececef; --line-input: #d2d2d7; }

@keyframes clChatIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes clChatPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
/* 떠 있는 창이 열릴 때(사용자 2026.11.04 — 바로 뜨기보다 "뿅"): 오른쪽 아래 [AI 상담] 버튼 쪽에서 작게 시작해 살짝 넘쳤다 제자리로 */
@keyframes clChatPanelIn { 0% { opacity: 0; transform: translateY(24px) scale(.72); } 55% { opacity: 1; transform: translateY(-4px) scale(1.02); } 100% { opacity: 1; transform: none; } }

.cl-chat { --chat-hit: 40px; --chat-hit-sm: 32px; --chat-chip: 40px; --chat-small: 40px; --chat-action: 36px;
    --chat-float: 0 0 0 1px #ececf0, 0 18px 40px rgba(29, 29, 31, .10);
    container: clchat / inline-size;
    position: relative; box-sizing: border-box; height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
    background: #ffffff; border: 1px solid var(--line); border-radius: 32px;
    color: var(--ink); font-family: 'Pretendard Variable','Pretendard', sans-serif; font-size: 16px; line-height: 1.6; letter-spacing: -0.01em; word-break: keep-all; overflow-wrap: break-word; }
.cl-chat.is-touch { --chat-hit: 44px; --chat-hit-sm: 44px; --chat-chip: 44px; --chat-small: 44px; --chat-action: 44px; }
.cl-chat--float { border: 0; border-radius: 24px; box-shadow: var(--chat-float); }
.cl-chat--sheet { border: 0; border-radius: 0; box-shadow: none; }
.cl-chat *, .cl-chat *::before, .cl-chat *::after { box-sizing: border-box; }
/* chat.js 는 hidden 속성으로 숨긴다 — display 를 정한 클래스보다 이기게 */
.cl-chat [hidden] { display: none !important; }
/* 버튼 기본값은 :where 로 0 점수 — 클래스별 글자 크기 · 굵기 · 색이 이기도록 */
:where(.cl-chat) button { font: inherit; color: inherit; }
:where(.cl-chat) :is(h2, h3, p, dl, dd, ol, ul) { margin: 0; }
/* 상태 규칙은 site.css 와 같다(DESIGN.md 7-2): 채운 버튼은 바탕색만, 선 버튼 · 칩은 회색 선 → 검정 선, 연한 칸은 바탕 한 단계 진하게, 누름은 0.97 */
.cl-chat button:not(:disabled):active { transform: scale(.97); }
.cl-chat :is(button, a, input, textarea):focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
.cl-chat textarea::placeholder, .cl-chat input::placeholder { color: var(--mut); opacity: .8; }
.cl-chat .cl-chat__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cl-chat svg { display: block; flex: none; }

/* ---------- 머리: 한 줄 ---------- */
.cl-chat__head { flex: none; position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 14px 16px 14px 24px; background: #ffffff; border-bottom: 1px solid var(--line-2); }
.cl-chat.is-compact .cl-chat__head { min-height: 60px; padding: 10px 10px 10px 16px; gap: 10px; }
.cl-chat__head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-chat__title { font-size: 17px; font-weight: 800; line-height: 1.35; letter-spacing: -0.02em; white-space: nowrap; }
.cl-chat__sub { font-size: 13px; line-height: 1.4; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-chat__status { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 1.4; font-weight: 700; color: var(--ok); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cl-chat__icon-btn { width: var(--chat-hit); height: var(--chat-hit); flex: none; border: 0; border-radius: 99px; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; transition: background-color .2s ease, color .2s ease, transform .2s var(--ease, ease); }
.cl-chat__icon-btn:hover { background: var(--soft); color: var(--ink); }
.cl-chat__close { background: var(--soft); }
.cl-chat__close:hover { background: var(--gray); }

/* 새 대화 확인: 머리 아래 떠 있는 작은 카드 */
.cl-chat__confirm { position: absolute; z-index: 5; top: 76px; right: 12px; width: min(320px, calc(100% - 24px)); padding: 20px; border-radius: 20px; background: #ffffff; box-shadow: var(--chat-float); display: flex; flex-direction: column; gap: 6px; animation: clChatIn .18s ease-out both; }
.cl-chat.is-compact .cl-chat__confirm { top: 64px; }
.cl-chat__confirm strong { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.cl-chat__confirm p { font-size: 14px; line-height: 1.6; color: var(--mut); }
.cl-chat__confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.cl-chat__confirm-actions button { height: var(--chat-small); padding: 0 18px; font-size: 14px; }

/* ---------- 버튼 (리뉴얼 주 버튼 · 보조 버튼과 같은 모양, 크기만 대화창에 맞춤) ---------- */
.cl-chat__btn-secondary { align-self: flex-start; height: var(--chat-chip); padding: 0 18px; border: 0; border-radius: 99px; background: #ffffff; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; transition: background-color .2s ease, box-shadow .2s ease, transform .2s var(--ease, ease); }
.cl-chat__btn-secondary:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cl-chat__btn-primary { height: 48px; padding: 0 28px; border: 0; border-radius: 99px; background: var(--pri); color: #ffffff; font-size: 16px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background-color .2s ease, transform .2s var(--ease, ease); }
.cl-chat__btn-primary:hover { background: var(--pri-d); }
.cl-chat__btn-primary:disabled { background: var(--track); color: var(--mut); box-shadow: none; cursor: not-allowed; }
.cl-chat__confirm-actions .cl-chat__btn-secondary { align-self: auto; }

/* ---------- 대화 ---------- */
.cl-chat__log { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 24px; overscroll-behavior: contain; }
.cl-chat.is-compact .cl-chat__log { padding: 20px 16px; gap: 20px; }
.cl-chat__msg { display: flex; flex-direction: column; gap: 10px; animation: clChatIn .22s ease-out both; }
.cl-chat__user { align-self: flex-end; max-width: min(80%, 520px); padding: 12px 18px; border-radius: 22px 22px 6px 22px; background: var(--pri); color: #ffffff; font-weight: 500; white-space: pre-wrap; }
.cl-chat__bot { display: flex; gap: 12px; align-items: flex-start; }
.cl-chat__avatar { width: 36px; height: 36px; flex: none; border-radius: 99px; background: var(--pri); display: grid; place-items: center; }
.cl-chat__avatar img { width: 21px; margin-top: 2px; display: block; }
.cl-chat__head .cl-chat__avatar { width: 44px; height: 44px; }
.cl-chat__head .cl-chat__avatar img { width: 26px; }
.cl-chat.is-compact .cl-chat__head .cl-chat__avatar { width: 36px; height: 36px; }
.cl-chat.is-compact .cl-chat__head .cl-chat__avatar img { width: 21px; }
.cl-chat__content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cl-chat__surface { padding: 18px 22px; border-radius: 6px 22px 22px 22px; background: var(--soft); }
.cl-chat.is-compact .cl-chat__surface { padding: 14px 16px; }
.cl-chat__content p { color: var(--ink-2); text-wrap: pretty; white-space: pre-line; }
.cl-chat__content strong { font-weight: 700; color: var(--ink); }
.cl-chat__inline-link { color: var(--pri-d); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }
.cl-chat__ol { padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cl-chat__ol li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cl-chat__ol-num { width: 24px; height: 24px; margin-top: 1px; flex: none; border-radius: 99px; background: var(--ink); color: #ffffff; font-family: 'Outfit', 'Pretendard Variable','Pretendard', sans-serif; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.cl-chat__link { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; height: var(--chat-chip); padding: 0 16px; border-radius: 99px; background: #ffffff; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; transition: box-shadow .2s ease, transform .2s var(--ease, ease); }
.cl-chat__link:active { transform: scale(.97); }
.cl-chat__link:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }

/* 요금 견적 (답변 면 안의 흰 판, 서버 계산) */
.cl-chat__quote { padding: 18px 20px; border-radius: 20px; background: #ffffff; display: flex; flex-direction: column; gap: 12px; }
.cl-chat__quote-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.cl-chat__quote dl { display: flex; flex-direction: column; gap: 6px; }
.cl-chat__quote dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cl-chat__quote dt { color: var(--mut); font-size: 15px; }
.cl-chat__quote dd { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-chat__quote-totals { padding-top: 12px; border-top: 1px solid var(--line); }
.cl-chat__quote-totals dt, .cl-chat__quote-totals dd { font-weight: 700; color: var(--ink); }
.cl-chat__quote-totals > div:last-child dd { font-size: 18px; font-weight: 800; color: var(--pri-d); }
.cl-chat__quote-notes { padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.55; color: var(--mut); }

/* 복사 버튼 (접수 번호) */
.cl-chat__copy { height: var(--chat-hit-sm); padding: 0 12px; border: 0; border-radius: 99px; background: #ffffff; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; flex: none; white-space: nowrap; }
.cl-chat__copy { transition: box-shadow .2s ease, transform .2s var(--ease, ease); }
.cl-chat__copy:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cl-chat__copy.is-copied { color: var(--ok); }

/* 첫 화면: 제목 + 자주 찾는 주제 (넓을 때 2칸 카드, 좁을 때 한 줄 목록) */
.cl-chat__welcome { display: flex; flex-direction: column; gap: 32px; padding-top: 16px; }
.cl-chat__hero { display: flex; flex-direction: column; gap: 10px; }
.cl-chat__hero h3 { font-size: 32px; font-weight: 800; line-height: 1.3; letter-spacing: -0.03em; color: var(--ink); }
.cl-chat.is-compact .cl-chat__hero h3 { font-size: 26px; }
.cl-chat__hero p { font-size: 17px; color: var(--mut); text-wrap: pretty; }
.cl-chat.is-compact .cl-chat__hero p { font-size: 15px; }
.cl-chat__topics { display: flex; flex-direction: column; gap: 12px; }
.cl-chat__topics-label { font-size: 14px; font-weight: 700; color: var(--mut); }
.cl-chat__topic-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cl-chat__topic { min-height: 88px; padding: 16px 16px 16px 18px; border: 0; border-radius: 20px; background: var(--soft); display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; transition: background-color .2s ease; }
.cl-chat .cl-chat__topic:active { transform: none; background: var(--track); }
.cl-chat__topic:hover { background: var(--gray); }
.cl-chat__topic > svg { width: 44px; height: 44px; padding: 11px; border-radius: 14px; background: #ffffff; color: var(--pri); }
.cl-chat__topic-row { flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 10px; }
.cl-chat__topic-row > svg { color: var(--mut); }
.cl-chat__topic-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-chat__topic-label { font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.cl-chat__topic-desc { font-size: 14px; line-height: 1.45; color: var(--mut); }
.cl-chat .cl-chat__topic:focus-visible { outline-offset: 2px; }
.cl-chat.is-compact .cl-chat__topic-list { grid-template-columns: minmax(0, 1fr); gap: 0; border-radius: 20px; background: var(--soft); overflow: hidden; }
.cl-chat.is-compact .cl-chat__topic { min-height: 64px; padding: 0 0 0 14px; border-radius: 0; }
.cl-chat.is-compact .cl-chat__topic > svg { width: 36px; height: 36px; padding: 8px; border-radius: 12px; }
.cl-chat.is-compact .cl-chat__topic-row { padding: 12px 14px 12px 0; }
.cl-chat.is-compact .cl-chat__topic + .cl-chat__topic .cl-chat__topic-row { border-top: 1px solid var(--line); }
.cl-chat.is-compact .cl-chat__topic:focus-visible { outline-offset: -2px; }
/* 대화창 폭이 600px 이하면(메인 CONTACT 처럼 옆에 글이 있을 때) 2칸 카드 대신 한 줄 목록 */
@container clchat (max-width: 600px) {
    .cl-chat__topic-list { grid-template-columns: minmax(0, 1fr); gap: 0; border-radius: 20px; background: var(--soft); overflow: hidden; }
    .cl-chat__topic { min-height: 68px; padding: 0 0 0 16px; border-radius: 0; }
    .cl-chat__topic-row { padding: 12px 16px 12px 0; }
    .cl-chat__topic + .cl-chat__topic .cl-chat__topic-row { border-top: 1px solid var(--line); }
    .cl-chat .cl-chat__topic:focus-visible { outline-offset: -2px; }
}

/* 빠른 답 */
.cl-chat__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-chat__chip { height: var(--chat-chip); padding: 0 16px; border: 0; border-radius: 99px; background: #ffffff; box-shadow: inset 0 0 0 1.5px var(--lav); color: var(--pri-d); font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; cursor: pointer; white-space: nowrap; transition: box-shadow .2s ease, transform .2s var(--ease, ease); }
.cl-chat__chip:hover { box-shadow: inset 0 0 0 1.5px var(--pri); }

/* 답변 평가 */
.cl-chat__rate { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.cl-chat__rate button { width: var(--chat-hit-sm); height: var(--chat-hit-sm); border: 0; border-radius: 99px; background: transparent; color: var(--mut); display: grid; place-items: center; cursor: pointer; transition: background-color .2s ease; }
.cl-chat__rate button:hover { background: var(--track); color: var(--ink); }
.cl-chat__rate button[aria-pressed="true"] { background: var(--tint); color: var(--pri-d); }
.cl-chat__rate-down svg { transform: scaleY(-1); }
.cl-chat__rate-thanks { margin-left: 6px; font-size: 13px; color: var(--mut); }

/* 답변 실패 */
.cl-chat__err { display: flex; gap: 12px; align-items: flex-start; }
.cl-chat__err-icon { width: 36px; height: 36px; flex: none; border-radius: 99px; background: var(--err-bg); color: var(--err); display: grid; place-items: center; }
.cl-chat__err .cl-chat__content { gap: 12px; color: var(--ink-2); }
.cl-chat__err .cl-chat__btn-secondary { padding: 0 16px; }

/* 대기: 답변 면과 같은 모양 */
.cl-chat__pending { display: flex; gap: 12px; align-items: flex-start; animation: clChatIn .22s ease-out both; }
.cl-chat__pending-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.cl-chat__pending-label { font-size: 14px; font-weight: 700; color: var(--mut); }
.cl-chat__bar { display: block; height: 12px; border-radius: 99px; background: var(--lav); animation: clChatPulse 1.6s ease-in-out infinite; }
.cl-chat__bar:nth-of-type(2) { width: 92%; }
.cl-chat__bar:nth-of-type(3) { width: 76%; animation-delay: .2s; }
.cl-chat__bar:nth-of-type(4) { width: 48%; animation-delay: .4s; }

/* ---------- 접수 카드 (답변 면 안의 흰 판) ---------- */
.cl-chat__card { display: flex; flex-direction: column; gap: 18px; padding: 22px; border-radius: 20px; background: #ffffff; }
.cl-chat.is-compact .cl-chat__card { padding: 18px 16px; }
.cl-chat__card-head { display: flex; flex-direction: column; gap: 4px; }
.cl-chat__card-head strong { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.cl-chat__card-head span { font-size: 14px; line-height: 1.6; color: var(--mut); }
.cl-chat__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cl-chat.is-compact .cl-chat__fields { grid-template-columns: minmax(0, 1fr); }
.cl-chat__field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cl-chat__field label { display: flex; align-items: baseline; gap: 4px; font-size: 14px; font-weight: 700; color: var(--ink); }
.cl-chat__req { color: var(--pri); }
.cl-chat__opt { font-size: 13px; font-weight: 500; color: var(--mut); }
.cl-chat__input { height: 48px; width: 100%; padding: 0 18px; border: 0; border-radius: 99px; background: #ffffff; box-shadow: inset 0 0 0 1px var(--line-input); font: inherit; font-size: 16px; letter-spacing: normal; color: inherit; outline: none; transition: box-shadow .2s ease; }
.cl-chat__input:focus { box-shadow: 0 0 0 2px var(--pri), 0 0 0 7px rgba(144, 74, 232, .12); }
.cl-chat .cl-chat__input:focus-visible { outline: none; }
.cl-chat__input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--err); }
.cl-chat__textarea { height: auto; min-height: 120px; padding: 14px 18px; border-radius: 20px; resize: vertical; line-height: 1.6; }
.cl-chat__field-err { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--err); }
.cl-chat__attach { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1.5px dashed var(--line-input); background: #ffffff; color: var(--mut); }
.cl-chat__attach-text { flex: 1; display: flex; flex-direction: column; }
.cl-chat__attach-text b { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.cl-chat__attach-text span { font-size: 13px; }
.cl-chat__badge { height: 22px; padding: 0 9px; border-radius: 99px; background: var(--soft); color: var(--mut); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; white-space: nowrap; }
.cl-chat__agree { display: flex; flex-direction: column; gap: 4px; }
.cl-chat__agree-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.cl-chat__check { min-height: 44px; padding: 0; border: 0; background: transparent; font-size: 15px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; }
.cl-chat .cl-chat__check:active { transform: none; }
.cl-chat__check-box { width: 22px; height: 22px; flex: none; border-radius: 7px; background: #ffffff; box-shadow: inset 0 0 0 1.5px var(--line-input); display: grid; place-items: center; color: #ffffff; transition: background-color .15s ease; }
.cl-chat__check[aria-checked="true"] .cl-chat__check-box { background: var(--pri); box-shadow: none; }
.cl-chat__check[aria-checked="false"] .cl-chat__check-box svg { visibility: hidden; }
.cl-chat__check.is-invalid .cl-chat__check-box { box-shadow: inset 0 0 0 1.5px var(--err); }
.cl-chat__terms { font-size: 14px; color: var(--mut); text-decoration: underline; text-underline-offset: 3px; }
.cl-chat__card-foot { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cl-chat.is-compact .cl-chat__card-foot { align-items: stretch; }
.cl-chat__card-error { font-size: 13px; color: var(--err); }

/* 접수 완료 */
.cl-chat__done { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: 20px; background: #ffffff; }
.cl-chat__done-head { display: flex; align-items: center; gap: 10px; color: var(--ok); }
.cl-chat__done-head strong { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.cl-chat__done-no { display: flex; align-items: center; gap: 12px; min-height: var(--chat-hit); padding: 4px 6px 4px 18px; border-radius: 99px; background: var(--soft); }
.cl-chat__done-no > span { flex: none; font-size: 13px; color: var(--mut); }
.cl-chat__done-no b { flex: 1; font-family: 'Outfit', 'Pretendard Variable','Pretendard', sans-serif; font-size: 16px; font-weight: 600; letter-spacing: .01em; font-variant-numeric: tabular-nums; user-select: all; }
.cl-chat__done p { font-size: 15px; line-height: 1.65; color: var(--ink-2); }

/* ---------- 아래: 행동 줄 · 요청 제한 띠 · 입력창 · 안내 ---------- */
.cl-chat__foot { flex: none; padding: 14px 24px 18px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line-2); background: #ffffff; }
.cl-chat.is-compact .cl-chat__foot { padding: 10px 12px 12px; }
.cl-chat__actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cl-chat__handoff { flex: none; height: var(--chat-action); padding: 0 14px 0 10px; border: 0; border-radius: 99px; background: var(--tint); color: var(--pri-d); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; transition: background-color .2s ease, transform .2s var(--ease, ease); }
.cl-chat__handoff:hover { background: var(--lav); }
.cl-chat__divider { width: 1px; height: 20px; flex: none; background: var(--line); }
/* padding 4 + margin -4: 칩 포커스 링(2px + 간격 2px)이 줄 끝에서 잘리지 않게 */
.cl-chat__follow { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px; margin: -4px; cursor: grab; user-select: none; }
.cl-chat__follow.is-dragging { cursor: grabbing; }
.cl-chat__follow.is-dragging .cl-chat__follow-chip { pointer-events: none; }
.cl-chat__follow::-webkit-scrollbar { display: none; }
.cl-chat__follow-chip { flex: none; height: var(--chat-action); padding: 0 14px; border: 0; border-radius: 99px; background: #ffffff; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-2); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: box-shadow .2s ease, color .2s ease, transform .2s var(--ease, ease); }
.cl-chat__follow-chip:hover { box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); }
.cl-chat__banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px; background: var(--warn-bg); color: var(--warn); font-size: 14px; font-weight: 700; }
.cl-chat__composer { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 22px; border-radius: 28px; background: var(--soft); transition: box-shadow .2s ease, background-color .2s ease; }
.cl-chat__composer:focus-within { background: #ffffff; box-shadow: 0 0 0 2px var(--pri), 0 0 0 7px rgba(144, 74, 232, .12); }
.cl-chat__composer.is-over { box-shadow: inset 0 0 0 1.5px var(--err); }
.cl-chat__composer textarea { flex: 1; min-width: 0; height: 40px; max-height: 144px; padding: 8px 0; overflow-y: hidden; border: 0; outline: none !important; resize: none; background: transparent; font: inherit; font-size: 16px; line-height: 1.5; letter-spacing: normal; color: inherit; }
.cl-chat__send { width: var(--chat-hit); height: var(--chat-hit); flex: none; border: 0; border-radius: 99px; background: var(--pri); color: #ffffff; display: grid; place-items: center; cursor: pointer; transition: background-color .2s ease, transform .2s var(--ease, ease); }
.cl-chat__send:hover:not(:disabled) { background: var(--pri-d); }
.cl-chat__send:disabled { background: var(--track); color: var(--mut); cursor: not-allowed; }
.cl-chat__hint { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 0 8px; }
.cl-chat__hint p { font-size: 13px; line-height: 1.5; color: var(--mut); text-wrap: pretty; }
.cl-chat__count { flex: none; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--warn); white-space: nowrap; }
.cl-chat__count.is-over { color: var(--err); }

/* ---------- 장애: 기존 문의 폼 ---------- */
.cl-chat__outage { flex: 1; min-height: 0; overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.cl-chat.is-compact .cl-chat__outage { padding: 20px 16px; }
.cl-chat__outage-alert { display: flex; gap: 12px; padding: 18px 20px; border-radius: 20px; background: var(--warn-bg); color: var(--warn); }
.cl-chat__outage-alert div { display: flex; flex-direction: column; gap: 4px; }
.cl-chat__outage-alert strong { font-size: 16px; font-weight: 800; }
.cl-chat__outage-alert span { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.cl-chat__outage form { display: flex; flex-direction: column; gap: 16px; }
.cl-chat__outage .cl-chat__card-foot { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
    .cl-chat *, .cl-chat-float { animation: none !important; transition: none !important; }
    .cl-chat button:active { transform: none !important; }
}

/* ---------- 떠 있는 패널 (다른 화면의 [AI 상담] 버튼으로 여는 창) ----------
   패널 위치 · 크기만 정한다. 여는 버튼은 리뉴얼 공용 .fab .f-ai(site.css) */
.cl-chat-float { position: fixed; z-index: 70; right: 24px; bottom: 92px; width: 480px; height: min(760px, calc(100vh - 188px)); transform-origin: bottom right; animation: clChatPanelIn .42s cubic-bezier(.2,.8,.2,1) both; }
.cl-chat-float[hidden] { display: none; }
/* 떠 있는 창(PC): 400 × 660 · 좁은 여백이라 답답해 보였다(사용자 2026.11.05) → 480 × 760, 안 여백은 메인 아래 상담창(넓은 창)과 같게.
   chat.js 는 떠 있는 창에 .is-compact 를 붙이므로 그 값을 여기서 넓은 창 값으로 되돌린다. 휴대폰(전체 화면)은 그대로 */
@media (min-width: 641px) {
    .cl-chat-float .cl-chat.is-compact .cl-chat__head { min-height: 72px; padding: 14px 16px 14px 24px; gap: 12px; }
    .cl-chat-float .cl-chat.is-compact .cl-chat__head .cl-chat__avatar { width: 40px; height: 40px; }
    .cl-chat-float .cl-chat.is-compact .cl-chat__log { padding: 28px 28px 24px; gap: 24px; }
    .cl-chat-float .cl-chat.is-compact .cl-chat__surface { padding: 18px 22px; }
    .cl-chat-float .cl-chat.is-compact .cl-chat__card { padding: 22px; }
    .cl-chat-float .cl-chat.is-compact .cl-chat__outage { padding: 28px; }
    .cl-chat-float .cl-chat.is-compact .cl-chat__foot { padding: 14px 24px 18px; }
    .cl-chat-float .cl-chat.is-compact .cl-chat__hero h3 { font-size: 28px; }
}
@media (max-width: 640px) {
    .cl-chat-float { inset: 0; z-index: 80; width: auto; height: 100%; max-height: none; animation: none; }
}
