/**
 * 고객상담 채팅 위젯 스타일
 * 채널톡 스타일 플로팅 위젯 (우측 하단)
 */

/* ===== 플로팅 버튼 ===== */
.support-chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.support-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.support-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(6, 182, 212, 0.5);
}

.support-chat-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.support-chat-btn .close-icon {
    display: none;
}

.support-chat-btn.active .chat-icon {
    display: none;
}

.support-chat-btn.active .close-icon {
    display: block;
}

/* 안 읽은 메시지 배지 */
.support-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.support-chat-badge.show {
    opacity: 1;
    transform: scale(1);
}

/* ===== 채팅 윈도우 ===== */
.support-chat-window {
    position: fixed;
    right: 24px;
    bottom: 100px;
    width: 380px;
    height: min(650px, calc(100vh - 140px)); /* 반응형: 화면 높이에 맞춤 */
    min-height: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
}

.support-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 헤더 */
.support-chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.support-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-chat-avatar svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.support-chat-title {
    font-size: 16px;
    font-weight: 600;
}

.support-chat-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.support-chat-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.support-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.support-chat-close svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* 뒤로가기 버튼 */
.support-chat-back {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
    margin-right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-chat-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

.support-chat-back svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* 메시지 영역 */
.support-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
    /* 스크롤바 표시 */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #c1c1c1 transparent; /* Firefox */
}

/* Chrome/Safari 스크롤바 스타일 */
.support-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.support-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.support-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.support-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 웰컴 메시지 */
.support-chat-welcome {
    text-align: center;
    padding: 24px 16px;
}

.support-chat-welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-chat-welcome-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.support-chat-welcome h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.support-chat-welcome p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* 메시지 버블 */
.support-chat-message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.support-chat-message.user,
.support-chat-message.guest {
    align-self: flex-end;
}

.support-chat-message.admin {
    align-self: flex-start;
}

.support-chat-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.support-chat-message.user .support-chat-bubble,
.support-chat-message.guest .support-chat-bubble {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.support-chat-message.admin .support-chat-bubble {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.support-chat-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

.support-chat-message.user .support-chat-time,
.support-chat-message.guest .support-chat-time {
    text-align: right;
}

/* 파일/이미지 메시지 */
.support-chat-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.support-chat-file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-chat-file-info {
    flex: 1;
    min-width: 0;
}

.support-chat-file-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.support-chat-file-size {
    font-size: 11px;
    opacity: 0.8;
}

.support-chat-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.support-chat-image:hover {
    transform: scale(1.02);
}

.support-chat-bubble-image {
    padding: 4px !important;
    background: transparent !important;
    box-shadow: none !important;
}

.support-chat-message.user .support-chat-bubble-image,
.support-chat-message.guest .support-chat-bubble-image {
    background: transparent !important;
}

.support-chat-message.admin .support-chat-bubble-image {
    background: transparent !important;
}

/* 시스템 메시지 */
.support-chat-message.system {
    align-self: center;
    max-width: 100%;
}

.support-chat-message.system .support-chat-bubble {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    padding: 8px 16px;
    border-radius: 20px;
    text-align: center;
}

/* 채팅 종료 UI */
.support-chat-closed {
    padding: 16px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.support-chat-closed-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

.support-chat-closed-message svg {
    fill: #10b981;
}

.support-chat-new-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.support-chat-new-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.support-chat-new-btn svg {
    fill: white;
}

/* 타이핑 인디케이터 */
.support-chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    align-self: flex-start;
}

.support-chat-typing-dots {
    display: flex;
    gap: 4px;
}

.support-chat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.support-chat-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.support-chat-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.support-chat-typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* 입력 영역 */
.support-chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.support-chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.support-chat-textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    min-height: 44px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.support-chat-textarea:focus {
    border-color: #06b6d4;
}

.support-chat-textarea::placeholder {
    color: #9ca3af;
}

.support-chat-attach-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.support-chat-attach-btn:hover {
    background: #e5e7eb;
}

.support-chat-attach-btn svg {
    width: 20px;
    height: 20px;
    fill: #6b7280;
}

.support-chat-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.support-chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.support-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.support-chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* ===== 비회원 폼 ===== */
.support-chat-guest-form {
    padding: 24px 20px;
    background: white;
}

.support-chat-guest-form h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.support-chat-guest-form p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}

.support-chat-form-group {
    margin-bottom: 12px;
}

.support-chat-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.support-chat-form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.support-chat-form-group input:focus {
    border-color: #06b6d4;
}

.support-chat-guest-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 8px;
}

.support-chat-guest-submit:hover {
    opacity: 0.9;
}

.support-chat-guest-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 파일 업로드 프리뷰 ===== */
.support-chat-upload-preview {
    display: none;
    padding: 8px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}

.support-chat-upload-preview.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

.support-chat-upload-preview img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.support-chat-upload-preview-info {
    flex: 1;
    min-width: 0;
}

.support-chat-upload-preview-name {
    font-size: 13px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.support-chat-upload-preview-size {
    font-size: 11px;
    color: #6b7280;
}

.support-chat-upload-cancel {
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
}

/* ===== 이미지 라이트박스 ===== */
.support-chat-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.support-chat-lightbox.open {
    display: flex;
}

.support-chat-lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.support-chat-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-chat-lightbox-close svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* ===== 반응형 - 태블릿 ===== */
@media (max-width: 768px) {
    .support-chat-window {
        width: 340px;
        height: min(580px, calc(100vh - 120px));
        min-height: 380px;
    }

    .support-chat-header {
        padding: 14px 16px;
    }

    .support-chat-title {
        font-size: 15px;
    }

    .support-chat-messages {
        padding: 12px;
    }

    .support-chat-bubble {
        padding: 10px 14px;
        font-size: 13px;
    }

    .support-chat-input-area {
        padding: 12px;
    }
}

/* ===== 반응형 - 모바일 ===== */
@media (max-width: 480px) {
    .support-chat-window {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .support-chat-launcher {
        right: 12px;
        bottom: 12px;
    }

    .support-chat-btn {
        width: 52px;
        height: 52px;
    }

    .support-chat-btn svg {
        width: 24px;
        height: 24px;
    }

    /* JS가 .mobile-chat-open 클래스를 추가하면 런처를 헤더 우측 상단으로 이동 */
    .support-chat-launcher.mobile-chat-open {
        position: fixed;
        top: calc(6px + env(safe-area-inset-top, 0px));
        right: 8px;
        bottom: auto;
        z-index: 10001;
    }

    .support-chat-launcher.mobile-chat-open .support-chat-btn {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.25);
        box-shadow: none;
    }

    .support-chat-launcher.mobile-chat-open .support-chat-btn svg {
        width: 22px;
        height: 22px;
    }

    .support-chat-header {
        padding: 14px 16px;
        border-radius: 0;
        padding-top: calc(14px + env(safe-area-inset-top, 0px));
    }

    /* 모바일 헤더: 런처 X 버튼 공간 확보 */
    .mobile-chat-open ~ .support-chat-window .support-chat-header {
        padding-right: 56px;
    }

    .support-chat-avatar {
        width: 36px;
        height: 36px;
    }

    .support-chat-avatar svg {
        width: 20px;
        height: 20px;
    }

    .support-chat-title {
        font-size: 14px;
    }

    .support-chat-subtitle {
        font-size: 11px;
    }

    .support-chat-messages {
        padding: 10px;
        gap: 10px;
    }

    .support-chat-message {
        max-width: 90%;
    }

    .support-chat-bubble {
        padding: 10px 12px;
        font-size: 14px;
        border-radius: 14px;
    }

    .support-chat-time {
        font-size: 10px;
    }

    .support-chat-welcome {
        padding: 20px 12px;
    }

    .support-chat-welcome-icon {
        width: 56px;
        height: 56px;
    }

    .support-chat-welcome-icon svg {
        width: 28px;
        height: 28px;
    }

    .support-chat-welcome h3 {
        font-size: 16px;
    }

    .support-chat-welcome p {
        font-size: 13px;
    }

    .support-chat-input-area {
        padding: 10px 12px;
        /* iOS 하단 Safe Area 대응 */
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .support-chat-textarea {
        padding: 10px 14px;
        font-size: 16px; /* iOS 확대 방지 */
        min-height: 40px;
    }

    .support-chat-attach-btn,
    .support-chat-send-btn {
        width: 40px;
        height: 40px;
    }

    .support-chat-attach-btn svg,
    .support-chat-send-btn svg {
        width: 18px;
        height: 18px;
    }

    .support-chat-guest-form {
        padding: 20px 16px;
    }

    .support-chat-guest-form h3 {
        font-size: 15px;
    }

    .support-chat-guest-form p {
        font-size: 12px;
    }

    .support-chat-form-group input {
        padding: 12px 14px;
        font-size: 16px; /* iOS 확대 방지 */
    }

    .support-chat-image {
        max-width: 160px;
    }
}

/* ===== 소형 모바일 ===== */
@media (max-width: 360px) {
    .support-chat-btn {
        width: 48px;
        height: 48px;
    }

    .support-chat-bubble {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* ===== 탭 컨텐츠 영역 ===== */
.support-chat-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#supportChatHomeTab .support-chat-messages {
    flex: 1;
}

/* ===== 하단 탭 바 ===== */
.support-chat-tab-bar {
    display: flex;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

.support-chat-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.support-chat-tab:hover {
    color: #6b7280;
}

.support-chat-tab.active {
    color: #06b6d4;
}

.support-chat-tab svg {
    fill: currentColor;
    transition: fill 0.2s ease;
}

.support-chat-tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 채팅 이력 목록 ===== */
.support-chat-history-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    padding: 12px;
    /* 스크롤바 표시 */
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 transparent;
}

/* Chrome/Safari 스크롤바 스타일 */
.support-chat-history-list::-webkit-scrollbar {
    width: 6px;
}

.support-chat-history-list::-webkit-scrollbar-track {
    background: transparent;
}

.support-chat-history-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.support-chat-history-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 로딩 스피너 */
.support-chat-history-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 12px;
    color: #9ca3af;
    font-size: 13px;
}

.support-chat-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #06b6d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 빈 목록 */
.support-chat-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.support-chat-history-empty p {
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    margin-top: 16px;
    margin-bottom: 4px;
}

.support-chat-history-empty span {
    font-size: 13px;
    color: #9ca3af;
}

/* 채팅 이력 아이템 */
.support-chat-history-item {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.support-chat-history-item:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.support-chat-history-item:last-child {
    margin-bottom: 0;
}

.support-chat-history-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.support-chat-history-item-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
}

.support-chat-history-item-status.open {
    background: #dcfce7;
    color: #16a34a;
}

.support-chat-history-item-status.closed {
    background: #f3f4f6;
    color: #6b7280;
}

.support-chat-history-item-date {
    font-size: 11px;
    color: #9ca3af;
}

.support-chat-history-item-message {
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.support-chat-history-item-count {
    font-size: 11px;
    color: #9ca3af;
}

/* 반응형 - 탭 바 모바일 */
@media (max-width: 480px) {
    .support-chat-tab-bar {
        padding: 6px 0;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    }

    .support-chat-tab {
        padding: 6px 0;
        font-size: 10px;
    }

    .support-chat-tab svg {
        width: 20px;
        height: 20px;
    }

    .support-chat-history-list {
        padding: 10px;
    }

    .support-chat-history-item {
        padding: 12px 14px;
        margin-bottom: 8px;
    }

    .support-chat-history-item-message {
        font-size: 13px;
    }
}

/* ============================================
   빠른 문의 버튼 섹션
   ============================================ */

.support-chat-quick-buttons {
    padding: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.support-chat-quick-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.support-chat-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.support-chat-quick-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.support-chat-quick-btn:hover {
    background: #e8f4fd;
    border-color: #06b6d4;
}

.quick-btn-icon {
    font-size: 18px;
}

.quick-btn-text {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

/* ============================================
   FAQ 섹션
   ============================================ */

.support-chat-faq-section {
    padding: 16px;
}

.support-chat-faq-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.faq-header-icon {
    font-size: 16px;
}

.faq-header-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.support-chat-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.support-chat-faq-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: #666;
    font-size: 13px;
}

.support-chat-faq-item {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.support-chat-faq-item:hover {
    border-color: #06b6d4;
}

.faq-question {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 10px;
}

.faq-q-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #06b6d4;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.faq-q-text {
    flex: 1;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.faq-arrow {
    flex-shrink: 0;
    color: #999;
    transition: transform 0.2s ease;
}

.faq-arrow svg {
    display: block;
}

.support-chat-faq-item.expanded .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 0 12px 12px 12px;
    gap: 10px;
}

.support-chat-faq-item.expanded .faq-answer {
    display: flex;
}

.faq-a-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.faq-a-text {
    flex: 1;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ============================================
   운영 안내
   ============================================ */

.support-chat-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    margin: 16px;
    background: #fef3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
}

.notice-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.notice-text {
    font-size: 12px;
    color: #856404;
    line-height: 1.5;
}

.notice-text strong {
    color: #664d03;
}

/* ============================================
   모바일 반응형 (빠른 버튼, FAQ)
   ============================================ */

@media (max-width: 480px) {
    .support-chat-quick-buttons {
        padding: 12px;
    }

    .support-chat-quick-grid {
        grid-template-columns: 1fr;
    }

    .support-chat-quick-btn {
        padding: 10px;
    }

    .support-chat-faq-section {
        padding: 12px;
    }

    .faq-question {
        padding: 10px;
    }

    .faq-answer {
        padding: 0 10px 10px 10px;
    }

    .support-chat-notice {
        margin: 12px;
        padding: 12px;
    }
}

/* ============================================
   봇 메시지 및 버튼 스타일
   ============================================ */

.bot-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #0891b2;
    color: white;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 4px;
}

.support-chat-bot-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    margin: 8px 0;
}

.support-chat-bot-btn {
    display: inline-block;
    padding: 10px 16px;
    background: #f0f4ff;
    border: 1px solid #3b82f6;
    border-radius: 20px;
    color: #06b6d4;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.support-chat-bot-btn:hover {
    background: #06b6d4;
    color: white;
}

.support-chat-bot-btn:active {
    transform: scale(0.98);
}

/* ============================================
   FAQ 자동 제안 스타일
   ============================================ */

.support-chat-faq-suggestion {
    margin: 12px 16px;
    padding: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.faq-suggestion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.faq-suggestion-icon {
    font-size: 16px;
}

.faq-suggestion-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #0284c7;
}

.faq-suggestion-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 4px;
}

.faq-suggestion-close:hover {
    background: #e0f2fe;
    color: #0284c7;
}

.faq-suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.faq-suggestion-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e0f2fe;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.faq-suggestion-item:hover {
    background: #e0f2fe;
    border-color: #0284c7;
}

.faq-suggestion-q {
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
}
