/* 챗봇 창(744px 이상) - 챗봇 페이지를 iframe 으로 FAB 곁에 띄운다. 여닫기는 fab-chatbot.js.
   Figma 3183:5020: 챗봇 FAB 왼쪽 16, 아래 끝은 챗봇 FAB 윗면. FAB 묶음(.fab-stack__chatbot) 안에 두어 FAB 이 올라가거나 줄어도 따라간다. */
.fab-chatbot-panel {
    --fab-chatbot-panel-h: 563px;
    position: absolute;
    right: calc(100% + 16px);
    /* FAB 위에 창이 다 안 들어가면(낮은 창, 페이지 끝에서 FAB 이 올라감) fab-chatbot.js 가 아래로 내려 둔다 */
    bottom: calc(100% - var(--fab-chatbot-panel-drop, 0px));
    width: 420px;
    height: var(--fab-chatbot-panel-h);
    /* 내려도 모자라면 fab-chatbot.js 가 화면 위 여백까지로 줄이고 챗봇이 그 안에서 스크롤된다 */
    max-height: var(--fab-chatbot-panel-max-h, var(--fab-chatbot-panel-h));
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
    pointer-events: auto;              /* .fab-stack 이 none 이라 되살림 */
    /* 닫힌 동안은 visibility 로 숨겨 탭 순서에서 뺀다 - iframe 을 지우지 않아 다시 열면 대화가 남는다. */
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98);
    transform-origin: right bottom;
    transition: opacity 200ms ease-in, transform 200ms ease-in, visibility 0s linear 200ms;
}
.fab-chatbot-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 200ms ease-out, transform 200ms ease-out, visibility 0s;
}

.fab-chatbot-panel__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 시안 IconButton/닫기 자리(x 372, y 8.5, 48x48) - 챗봇 머리줄 위에 겹쳐 그린다. */
.fab-chatbot-panel__close {
    position: absolute;
    top: 8px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}
.fab-chatbot-panel__close img {
    width: 24px;
    height: 24px;
}
/* 창이 overflow: hidden 이고 버튼이 오른쪽 끝에 붙어 바깥으로 그리면 링 오른쪽이 잘림 */
.fab-chatbot-panel__close:focus-visible {
    outline: revert;
    outline-offset: -4px;
}

/* 챗봇이 그려지기 전의 틀. 블록 자리와 크기는 창 크기(420x563)에서 잰 챗봇 화면을 따름 - 챗봇 화면이 바뀌면 같이 고친다.
   창이 낮아져도 입력 줄이 바닥에 붙게 세로 flex 로 쌓는다. */
.fab-chatbot-skeleton {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    pointer-events: none;
}
/* 걷힐 때만 visibility 를 늦춰 흐려지는 동안 보이게 함. 틀 기본 규칙에 두면 닫힌 창을 다시 열 때
   물려받은 visibility 에도 지연이 걸려 틀이 150ms 늦게 뜸 */
.fab-chatbot-panel.is-loaded .fab-chatbot-skeleton {
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease-out, visibility 0s linear 150ms;
}
/* 숨겨도 애니메이션은 계속 돌아 걷히면 멈춤 */
.fab-chatbot-panel.is-loaded .fab-chatbot-skeleton__block {
    animation: none;
}

.fab-chatbot-skeleton__block {
    display: block;
    flex: none;
    background: linear-gradient(90deg, #eef1f3 0%, #f7f8f9 50%, #eef1f3 100%) 0 0 / 200% 100%;
    animation: fab-chatbot-skeleton-shimmer 1.2s linear infinite;
}
@keyframes fab-chatbot-skeleton-shimmer {
    to { background-position: -200% 0; }
}

/* 머리줄 오른쪽 48 은 닫기 버튼 자리 */
.fab-chatbot-skeleton__header {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 65px;
    padding: 0 48px 0 17px;
    flex: none;
}
.fab-chatbot-skeleton__logo {
    width: 34px;
    height: 34px;
    margin-right: auto;
    border-radius: 50%;
}
.fab-chatbot-skeleton__pill {
    width: 88px;
    height: 30px;
    border-radius: 999px;
}
.fab-chatbot-skeleton__pill:last-child {
    width: 125px;
}

.fab-chatbot-skeleton__notice {
    height: 73px;
    flex: none;
    background: #f3f6f8;
}

.fab-chatbot-skeleton__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px 14px 0 12px;
    overflow: hidden;
}
.fab-chatbot-skeleton__bubble {
    width: 337px;
    height: 92px;
    margin-bottom: 7px;
    border-radius: 18px;
}
.fab-chatbot-skeleton__chip {
    width: 220px;
    height: 34px;
    margin-left: 2px;
    border-radius: 999px;
}
.fab-chatbot-skeleton__chip:nth-child(3) {
    width: 206px;
}
.fab-chatbot-skeleton__chip:nth-child(4) {
    width: 232px;
}

.fab-chatbot-skeleton__form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 90px;
    margin-top: auto;
    padding: 11px 12px 10px;
    flex: none;
    border-top: 1px solid #e5e5ec;
}
/* 챗봇의 전화 버튼 - 입력 줄 위 오른쪽에 떠 있음 */
.fab-chatbot-skeleton__call {
    position: absolute;
    right: 14px;
    bottom: 101px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
}
.fab-chatbot-skeleton__input {
    flex: 1;
    height: 69px;
    border-radius: 16px;
}
.fab-chatbot-skeleton__send {
    width: 62px;
    height: 41px;
    border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
    .fab-chatbot-panel,
    .fab-chatbot-panel.is-open,
    .fab-chatbot-panel.is-loaded .fab-chatbot-skeleton {
        transition: none;
    }
    .fab-chatbot-skeleton__block {
        animation: none;
    }
}
