/* 상담 도우미 위젯(_Ask.cshtml) — 오른쪽 아래 떠 있는 버튼 + 비모달 창. 토큰은 front.tokens.css. Design Ref: caretalk-renewal §7.4 · Figma 22:19/22:28/22:52 */
/* 26.11.17 Figma 재대조 — 468:1420(버튼) · 468:1429(메뉴) · 468:1453(창) · 468:1533(모바일 전체 화면). 글자 크기 = Figma 값 */
.ct-ask { position: fixed; right: 24px; bottom: 24px; z-index: 1000; font-family: var(--pm-font-family); }
.ct-ask-fab {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 22px 14px 14px; border: 0; border-radius: 999px; cursor: pointer; text-align: left;
    color: #fff; background: var(--pm-color-green); box-shadow: var(--wd-float-shadow);
}
.ct-ask-fab-icon { display: block; flex: none; }
.ct-ask-fab-text { display: flex; flex-direction: column; line-height: 1.3; white-space: nowrap; }
.ct-ask-fab strong { font-size: 1.25rem; font-weight: 700; }
.ct-ask-fab-text span { font-size: 1rem; color: rgba(255, 255, 255, 0.8); }
.ct-ask-panel {
    position: absolute; right: 0; bottom: calc(100% + 12px);
    width: min(320px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 120px));   /* 메뉴 = Figma 320, 채팅 창 = 400 */
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border-radius: 22px; box-shadow: var(--wd-float-shadow);
}
.ct-ask-panel[hidden], .ct-ask [hidden] { display: none !important; }
.ct-ask-panel:has(> .ct-ask-chat:not([hidden])) { width: min(400px, calc(100vw - 32px)); border-radius: 24px; }

/* 메뉴 — 흰 카드 · 회색 항목 · 아이콘 타일 */
.ct-ask-menu { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.ct-ask-menu-title { margin: 0; font-size: 1.3125rem; font-weight: 700; line-height: 1.4; color: var(--pm-color-text); }
.ct-ask .ct-ask-item {   /* .front a(초록) 보다 우선 */
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: left; cursor: pointer;
    font: inherit; color: var(--pm-color-text); text-decoration: none; background: var(--wd-gray-card); border: 0; border-radius: 16px;
}
.ct-ask-item:hover { box-shadow: inset 0 0 0 2px var(--pm-color-green); }
.ct-ask-tile { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; }
.ct-ask-tile img { display: block; }
.ct-ask-tile-green { background: var(--pm-color-green); }
.ct-ask-tile-yellow { background: var(--pm-color-accent); }
.ct-ask-tile-mint { background: var(--pm-color-mint); }
.ct-ask-item-text { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.35; }
.ct-ask-item strong { font-size: 1.1875rem; font-weight: 700; }
.ct-ask-item-sub { font-size: 1.125rem; font-weight: 500; color: var(--pm-color-body); }
.ct-ask-item-sub-muted { font-size: 1.0625rem; font-weight: 400; color: var(--pm-color-muted); }

/* 창 머리 — 초록 · 아이콘 · 상태 점 · 닫기 원 · 언어 바꾸기 알약 */
.ct-ask-chat { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ct-ask-head { display: flex; flex-direction: column; gap: 12px; padding: 18px; color: #fff; background: var(--pm-color-green); }
.ct-ask-head-row { display: flex; align-items: center; gap: 12px; }
.ct-ask-head-row > img { display: block; flex: none; }
.ct-ask-head-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.ct-ask-title { margin: 0; font-size: 1.3125rem; font-weight: 700; line-height: 1.35; color: #fff; }
.ct-ask-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 1.125rem; font-weight: 500; line-height: 1.35; color: rgba(255, 255, 255, 0.85); }
.ct-ask-sub img { display: block; flex: none; }
.ct-ask-x { display: flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; cursor: pointer; background: rgba(255, 255, 255, 0.15); border: 0; border-radius: 999px; }
.ct-ask-x img { display: block; }
.ct-ask-lang { position: relative; align-self: flex-start; }
.ct-ask-lang summary { display: inline-flex; padding: 6px 14px; font-size: 1.125rem; font-weight: 700; line-height: 1.3; color: var(--pm-color-green); list-style: none; cursor: pointer; background: #fff; border-radius: 999px; }
.ct-ask-lang summary::-webkit-details-marker { display: none; }
.ct-ask-lang summary::after { content: " ▾"; font-size: 0.75rem; white-space: pre; align-self: center; }
.ct-ask-lang-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 2; display: flex; flex-direction: column; gap: 2px; min-width: 10rem; padding: 6px; background: #fff; border: 1px solid var(--wd-pop-border); border-radius: 14px; box-shadow: var(--wd-pop-shadow); }
.ct-ask-lang-list button { padding: 10px 12px; font: inherit; font-size: 1.125rem; text-align: left; color: var(--pm-color-text); cursor: pointer; background: none; border: 0; border-radius: 10px; }
.ct-ask-lang-list button[aria-pressed="true"] { font-weight: 700; color: var(--pm-color-green); background: var(--pm-color-mint); }

/* 대화 — 회색 바탕 · 안내 · 말풍선(도우미 아이콘 30) · 빠른 질문 알약 · 직원 연결 */
.ct-ask-scroll { display: flex; flex: 1; flex-direction: column; gap: 14px; min-height: 120px; overflow-y: auto; padding: 16px; background: var(--wd-gray-card); }
.ct-ask-disclaimer { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; font-size: 1.0625rem; font-weight: 500; line-height: 1.45; color: var(--wd-text-strong); background: var(--pm-color-mint-pale); border-radius: 12px; }
.ct-ask-disclaimer img { display: block; flex: none; margin-top: 3px; }
.ct-ask-log { display: flex; flex-direction: column; gap: 14px; }
.ct-ask-msg { margin: 0; padding: 12px 14px; font-size: 1.1875rem; font-weight: 500; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ct-ask-bot { position: relative; align-self: stretch; margin-left: 38px; color: var(--pm-color-text); background: #fff; border-radius: 4px 18px 18px 18px; box-shadow: 0 2px 8px rgba(26, 26, 26, 0.07); }
.ct-ask-bot::before { content: ""; position: absolute; top: 0; left: -38px; width: 30px; height: 30px; background: url("../img/ask-avatar.svg") no-repeat; }
.ct-ask-user { align-self: flex-end; max-width: calc(100% - 48px); color: #fff; background: var(--pm-color-green); border-radius: 18px 4px 18px 18px; }
.ct-ask-error { background: #fff7e8; box-shadow: inset 0 0 0 1px #e0a64a; }
.ct-ask-chips { display: flex; flex-direction: column; gap: 8px; padding-left: 38px; }
.ct-ask-chip { display: block; width: 100%; padding: 10px 16px; font: inherit; font-size: 1.1875rem; font-weight: 600; line-height: 1.35; text-align: left; color: var(--pm-color-green); text-decoration: none; cursor: pointer; background: #fff; border: 1.5px solid var(--pm-color-green); border-radius: 999px; }
.ct-ask-chip:hover { background: var(--pm-color-mint-pale); }
.ct-ask-log .ct-ask-chips { margin-top: -6px; }
.ct-ask-call { width: auto; align-self: flex-start; }
.ct-ask-typing { margin: 0 0 0 38px; color: var(--pm-color-body); }
.ct-ask-handoff { display: flex; justify-content: center; }
.ct-ask-person { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font: inherit; font-size: 1.1875rem; font-weight: 600; line-height: 1.3; color: var(--wd-text-strong); cursor: pointer; background: #fff; border: 1px solid var(--pm-color-border); border-radius: 999px; }
.ct-ask-person img { display: block; }
.ct-ask-handoff-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; font-size: 1.0625rem; background: #fff; border-radius: 16px; }
.ct-ask-handoff-form p { margin: 0; }
.ct-ask-handoff-form label { display: flex; flex-direction: column; gap: 4px; font-size: 1rem; font-weight: 600; }
.ct-ask-field { width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; font-size: 1.0625rem; border: 1px solid var(--pm-color-input-border); border-radius: 12px; }
.ct-ask-submit { min-height: 48px; padding: 11px 14px; font: inherit; font-size: 1.1875rem; font-weight: 700; color: #fff; cursor: pointer; background: var(--pm-color-green); border: 0; border-radius: 999px; }

/* 입력줄 — 흰 바탕 · 회색 알약 입력칸 · 초록 원 보내기 50 · 아래 안내 */
.ct-ask-bottom { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; background: #fff; border-top: 1px solid var(--pm-color-border); }
.ct-ask-form { display: flex; align-items: center; gap: 8px; }
.ct-ask-input { flex: 1; min-width: 0; min-height: 52px; padding: 14px 18px; font: inherit; font-size: 1.1875rem; font-weight: 500; line-height: 1.3; color: var(--pm-color-text); background: var(--wd-gray-card); border: 0; border-radius: 999px; resize: none; }
.ct-ask-input::placeholder { color: var(--pm-color-body); }
.ct-ask-send { display: flex; flex: none; align-items: center; justify-content: center; width: 50px; height: 50px; padding: 0; cursor: pointer; background: var(--pm-color-green); border: 0; border-radius: 999px; }
.ct-ask-send img { display: block; }
.ct-ask-note { margin: 0; font-size: 1.0625rem; font-weight: 500; line-height: 1.4; text-align: center; color: var(--pm-color-body); }

/* 모바일 — 버튼은 아이콘 + 제목만, 창은 전체 화면(468:1533) */
@media (max-width: 480px) {
    .ct-ask { right: 12px; bottom: 12px; }
    .ct-ask-fab-text span { display: none; }
    .ct-ask-panel:has(> .ct-ask-chat:not([hidden])) { position: fixed; inset: 0; width: auto; max-height: none; border-radius: 0; }
    .ct-ask-panel { width: calc(100vw - 24px); }
}
