/* ============================================
   WP Realtime Secure Chat - 3단 모던 UI 스타일
   ============================================ */

#wprc-chat-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    font-size: 14px;
    color: #1a1a2e;
    line-height: 1.5;
    box-sizing: border-box;
    border: 2px solid #3ea6ff;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    width: 100%; /* 반응형 꽉 차게 */
    max-width: 1400px; /* 너무 넓어지는 것 방지 */
    margin: 0 auto;
}

#wprc-chat-app *, #wprc-chat-app *::before, #wprc-chat-app *::after { box-sizing: inherit; }

/* (중간 생략: 로그인 폼, 버튼, 좌측 사이드바는 기존 코드와 동일) */
.wprc-login-required, .wprc-guest-form { display: flex; align-items: center; justify-content: center; min-height: 400px; background: #f8f9fb; }
.wprc-login-box { text-align: center; padding: 40px; max-width: 360px; }
.wprc-login-box h3 { font-size: 20px; margin: 0 0 8px; color: #1a1a2e; }
.wprc-login-box p { color: #64748b; margin: 0 0 20px; }
.wprc-note { font-size: 12px; color: #94a3b8; margin-top: 12px; }
.wprc-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #374151; font-size: 13px; cursor: pointer; transition: all 0.15s ease; text-decoration: none; gap: 4px; }
.wprc-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.wprc-btn-primary { background: #8b5cf6; color: #fff; border-color: #8b5cf6; }
.wprc-btn-primary:hover { background: #7c3aed; border-color: #7c3aed; }
.wprc-btn-danger { color: #dc2626; border-color: #fca5a5; }
.wprc-btn-danger:hover { background: #fef2f2; }
.wprc-btn-sm { padding: 4px 10px; font-size: 12px; }
.wprc-form-group { margin-bottom: 14px; text-align: left; }
.wprc-form-group label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 4px; }
.wprc-form-group input[type="text"], .wprc-form-group select { width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.15s; }
.wprc-form-group input[type="text"]:focus, .wprc-form-group select:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1); }

.wprc-modern-ui { display: flex; flex-direction: row; width: 100%; background: #f5f5f5; }

.wprc-left-sidebar { width: 280px; min-width: 280px; background: #ffffff; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; padding: 20px; }
.wprc-sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.wprc-btn-light { background: #e5e7eb; border: none; padding: 6px 12px; border-radius: 12px; font-size: 12px; cursor: pointer; color: #374151; }
.wprc-search-bar input { width: 100%; background: #e5e7eb; border: none; padding: 10px 15px; border-radius: 8px; outline: none; }
.wprc-tabs { display: flex; padding: 0; background: #fff; }
.wprc-tab { flex: 1; padding: 10px 8px; border: none; background: none; font-size: 12px; font-weight: 600; color: #94a3b8; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.wprc-tab:hover { color: #475569; }
.wprc-tab.active { color: #8b5cf6; border-bottom-color: #8b5cf6; }
.wprc-tab-content { display: none; flex: 1; overflow-y: auto; padding-top: 15px; }
.wprc-tab-content.active { display: flex; flex-direction: column; }
.wprc-list { list-style: none; margin: 0; padding: 0; }
.wprc-list li { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer; transition: background 0.15s; }
.wprc-list li:hover { background: #f3f4f6; }
.wprc-list li.active { background: #ede9fe; }
.wprc-room-icon, .wprc-user-avatar { width: 40px; height: 40px; border-radius: 50%; background: #d1d5db; color: transparent; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wprc-room-info { flex: 1; min-width: 0; }
.wprc-room-name { font-weight: 600; font-size: 14px; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wprc-room-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* ---- 2. 중앙 채팅 영역 ---- */
.wprc-center-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.wprc-no-room { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; color: #94a3b8; }
.wprc-chat-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 30px; border-bottom: 1px solid #e5e7eb; }

/* i 버튼 (폰트어썸 아이콘용) */
.btn-info-toggle {
    background: #8b5cf6; color: white; border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: transform 0.2s;
}
.btn-info-toggle:hover { transform: scale(1.1); }

.wprc-secure-notice { text-align: center; font-size: 12px; color: #6b7280; margin: 10px 20px 30px; line-height: 1.6; }
.wprc-messages { flex: 1; overflow-y: auto; padding: 20px 30px; display: flex; flex-direction: column; gap: 15px; }
.wprc-msg { display: flex; gap: 10px; max-width: 80%; animation: wprc-fadeIn 0.2s ease; align-items: flex-end; }
@keyframes wprc-fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.wprc-msg.wprc-msg-mine { align-self: flex-end; flex-direction: row-reverse; }
.wprc-msg-avatar { width: 36px; height: 36px; border-radius: 50%; background: #d1d5db; flex-shrink: 0; }
.wprc-msg-body { display: flex; flex-direction: column; gap: 4px; }
.wprc-msg-sender { font-size: 12px; color: #6b7280; display: none; }
.wprc-msg-bubble { padding: 12px 18px; border-radius: 20px; background: #e5e7eb; color: #1f2937; font-size: 14px; line-height: 1.4; word-break: break-word; }
.wprc-msg-mine .wprc-msg-bubble { background: #8b5cf6; color: #fff; }

/* 👇 [핵심] 입력 영역 반응형 가로너비 및 세로 높이 완벽 정렬 최적화 👇 */
.wprc-input-area { 
    padding: 20px 30px; 
    width: 100%; 
    box-sizing: border-box;
    background: #f5f5f5; /* 중앙 배경색과 통일 */
}

.wprc-input-row { 
    display: flex; 
    gap: 10px; 
    width: 100%; 
    height: 50px; /* 👈 전체 높이 기준점을 50px로 명시 */
    align-items: stretch; /* 👈 자식들이 부모 높이를 꽉 채우도록 강제 */
}

.wprc-input-row input {
    flex: 1;
    height: 50px !important; /* 👈 높이 강제 고정 */
    padding: 0 20px; 
    margin: 0; /* 기본 마진 제거 */
    border: none; 
    border-radius: 12px; 
    font-size: 15px; 
    outline: none; 
    background: #ffffff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    box-sizing: border-box; /* 패딩이 높이에 영향을 주지 않도록 설정 */
    display: block;
}

.wprc-input-row button {
    height: 50px !important; /* 👈 입력창과 동일한 높이 강제 고정 */
    background: #8b5cf6; 
    color: white; 
    border: none; 
    border-radius: 12px; 
    padding: 0 28px; 
    font-weight: 600; 
    font-size: 15px;
    cursor: pointer; 
    transition: background 0.2s; 
    white-space: nowrap;
    margin: 0; /* 기본 마진 제거 */
    box-sizing: border-box;
    
    /* 👇 버튼 내부 텍스트 수직/수평 정렬 최적화 */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1; 
}

/* 크롬/사파리 등에서 input 내부 텍스트가 위로 쏠리는 현상 방지 */
.wprc-input-row input::placeholder {
    line-height: normal;
    display: flex;
    align-items: center;
}

.wprc-input-row button:hover { background: #7c3aed; }

/* ---- 3. 우측 정보 탭 영역 ---- */
.wprc-right-panel {
    width: 280px; min-width: 280px; background: #ebebeb; border-left: 1px solid #d1d5db; display: none !important; flex-direction: column; align-items: center; padding: 40px 20px 20px; transition: all 0.3s ease-in-out;
}
.wprc-right-panel.active { display: flex !important; animation: slideInRight 0.3s ease forwards; }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.wprc-user-profile-large { text-align: center; width: 100%; }
.avatar-large { width: 90px; height: 90px; border-radius: 50%; background: #d1d5db; margin: 0 auto 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.wprc-user-profile-large h3 { margin: 0; font-size: 18px; color: #1f2937; }

.wprc-action-buttons { display: flex; gap: 20px; margin: 30px 0 50px; justify-content: center; width: 100%; }
.action-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* 👇 [핵심] 폰트어썸 아이콘 중앙 정렬 및 링크 스타일 해제 👇 */
.icon-btn {
    width: 45px; height: 45px; 
    border-radius: 50%; 
    background: #d1d5db; 
    border: none; 
    cursor: pointer; 
    transition: transform 0.2s, background 0.2s;
    display: flex; /* 내부 아이콘 중앙 정렬 */
    align-items: center; 
    justify-content: center;
    color: #4b5563; /* 아이콘 색상 */
    font-size: 16px;
    text-decoration: none; /* a 태그 밑줄 제거 */
}
.icon-btn:hover { transform: scale(1.05); background: #c1c5cb; color: #1f2937; }
.action-item span { font-size: 11px; color: #6b7280; font-weight: 600; }

.btn-leave-chat { width: 100%; text-align: left; background: none; border: none; padding: 15px 10px; font-size: 15px; color: #374151; cursor: pointer; border-top: 1px solid #d1d5db; }
.btn-leave-chat:hover { color: #dc2626; }

/* 모달 */
.wprc-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); display: flex; align-items: center; justify-content: center; z-index: 100000; }
.wprc-modal-content { background: #fff; border-radius: 12px; padding: 24px; width: 90%; max-width: 400px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); }

@media (max-width: 768px) {
    .wprc-modern-ui { flex-direction: column; height: 100dvh !important; height: var(--wprc-vh, 100vh) !important; }
    .wprc-left-sidebar { width: 100%; min-width: 100%; max-height: 250px; border-right: none; border-bottom: 1px solid #e2e8f0; }
    .wprc-right-panel { width: 100%; border-left: none; border-top: 1px solid #e2e8f0; position: absolute; top: 0; height: 100%; z-index: 10; }
}

/* ============================================
   WP Realtime Chat - Mobile Exclusive UI
   ============================================ */

/* 1. 기본 레이아웃 및 배경 */
.wprc-is-mobile {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    height: var(--wprc-vh, 100vh);
    background: #fff;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
}

.wprc-mobile-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 2. 모바일 헤더 */
.wprc-mobile-header {
    height: 60px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}
.wprc-mobile-header h2 { font-size: 22px; font-weight: 700; margin: 0; color: #1a1a2e; }

/* 3. 컨텐츠 및 리스트 (친구/채팅목록) */
#wprc-mobile-main { flex: 1; overflow-y: auto; background: #fff; }
.wprc-mobile-tab-content { display: none; }
.wprc-mobile-tab-content.active { display: block; }

.wprc-mobile-list-header {
    padding: 12px 20px; font-size: 13px; color: #94a3b8; background: #f9fafb;
}

.wprc-mobile-list { list-style: none; margin: 0; padding: 0; }
.wprc-mobile-list li {
    padding: 15px 20px;
    display: flex; align-items: center; gap: 15px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
}
.wprc-mobile-list li:active { background: #f3f4f6; }

/* 4. 하단 네비게이션 (디자인 포인트) */
.wprc-mobile-nav {
    height: 70px;
    border-top: 1px solid #eee;
    display: flex;
    background: #fff;
    padding-bottom: env(safe-area-inset-bottom);
}
.wprc-nav-item {
    flex: 1; border: none; background: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #1a1a2e; /* 진한 남색 아이콘 */
    gap: 4px;
    transition: transform 0.1s;
}
.wprc-nav-item i { font-size: 24px; }
.wprc-nav-item span { font-size: 11px; font-weight: 500; }
.wprc-nav-item.active { color: #8b5cf6; } /* 활성 상태 보라색 */

/* 5. 채팅창 오버레이 (Slide-in) */
.wprc-mobile-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #F3E8FF; /* 💜 디자인 핵심: 연보라 배경 */
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
    z-index: 100000;
}
.wprc-mobile-overlay.active { transform: translateX(0); }

.wprc-mobile-chat-header {
    background: #fff;
    height: 60px; padding: 0 15px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 6. 모바일 전용 말풍선 디자인 (디자인 반영) */
.wprc-messages-mobile-container {
    flex: 1; overflow-y: auto;
    padding: 20px 15px;
    display: flex; flex-direction: column; gap: 15px;
}

/* 상대방 메시지 */
.wprc-is-mobile .wprc-msg:not(.wprc-msg-mine) .wprc-msg-bubble {
    background: #fff;
    color: #000;
    border-radius: 4px 15px 15px 15px; /* 왼쪽 위만 뾰족하게 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 내 메시지 */
.wprc-is-mobile .wprc-msg-mine .wprc-msg-bubble {
    background: #E114E5; /* 💖 디자인 포인트: 진한 보라/핑크 */
    color: #fff;
    border-radius: 15px 4px 15px 15px; /* 오른쪽 위만 뾰족하게 */
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

/* 7. 모바일 전용 입력창 */
.wprc-mobile-input-area {
    padding: 10px 15px;
    background: #f8f9fa;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.wprc-mobile-input-row {
    display: flex; gap: 8px; align-items: center;
}

.wprc-mobile-input-row input {
    flex: 1;
    height: 44px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 0 18px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.wprc-mobile-input-row button {
    width: 60px; height: 44px;
    background: #8b5cf6;
    color: white; border: none;
    border-radius: 15px;
    font-weight: 700;
}

/* 8. 설정 탭 프로필 섹션 */
.wprc-mobile-profile-section {
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(to bottom, #f3e8ff, #fff);
}
.wprc-mobile-profile-section img {
    width: 100px; height: 100px;
    border-radius: 50%; border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.wprc-mobile-profile-section h3 { margin-top: 15px; font-size: 20px; }

/* 기타 유틸리티 */
.wprc-icon-btn {
    background: none; border: none; font-size: 20px; color: #1a1a2e; padding: 10px; cursor: pointer;
}
/* ============================================
   Mobile UI — 디자인 기획안 반영 추가 스타일
   ============================================ */

/* ── 탭별 헤더 전환 ── */
.wprc-mob-tab-header {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}
.wprc-mob-tab-header.active { display: flex; }
.wprc-mob-tab-header h2 { font-size: 22px; font-weight: 700; margin: 0; color: #1a1a2e; }

/* ── 채팅탭 헤더 "+ 새 채팅방" 버튼 (pill outline) ── */
.wprc-mob-new-room-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 20px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.wprc-mob-new-room-btn:hover { background: #f3f4f6; border-color: #9ca3af; }

/* ── 친구탭: 내 프로필 카드 ── */
.wprc-mob-my-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #f3f4f6;
}
.wprc-mob-my-avatar {
    width: 52px; height: 52px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
}
.wprc-mob-avatar-placeholder {
    display: flex; align-items: center; justify-content: center;
    color: #9ca3af; font-size: 22px;
}
.wprc-mob-my-name {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ── 친구탭: 정렬 옵션 바 ── */
.wprc-mob-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    font-size: 13px;
    color: #94a3b8;
    background: #f9fafb;
}
.wprc-mob-sort-bar strong { color: #374151; font-weight: 600; }
.wprc-mob-sort-options { font-size: 12px; color: #94a3b8; }

/* ── 친구/채팅 목록 아이템: 2줄 구성 (이름 + 상태 메시지) ── */
.wprc-mobile-list .wprc-mob-item-name {
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
    line-height: 1.3;
}
.wprc-mobile-list .wprc-mob-item-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ── 채팅창 헤더: 방 이름 중앙 정렬 (3열 grid) ── */
.wprc-mobile-chat-header {
    display: grid !important;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
}
.wprc-mobile-chat-header h2 {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── 채팅창: 날짜 구분선 pill ── */
.wprc-mob-date-separator {
    text-align: center;
    margin: 8px 0;
}
.wprc-mob-date-separator span {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

/* ── 전송 버튼: 아이콘 전용 ── */
.wprc-mobile-input-row button#wprc-send-btn-mob {
    width: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 15px;
}

/* ── 설정 탭 ── */
.wprc-mob-settings {
    padding: 8px 0;
}
.wprc-mob-setting-row {
    padding: 18px 20px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wprc-mob-setting-row--between {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}
.wprc-mob-setting-row--block {
    flex-direction: column;
    align-items: flex-start;
}
.wprc-mob-setting-label {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    display: block;
}
.wprc-mob-setting-desc {
    font-size: 13px;
    color: #94a3b8;
    margin: 4px 0 0;
    line-height: 1.6;
}
.wprc-mob-setting-control {
    display: flex;
    align-items: center;
    gap: 10px;
}
.wprc-mob-setting-control input[type="text"] {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #f9fafb;
}
.wprc-mob-setting-control input[type="text"]:focus {
    border-color: #8b5cf6;
    background: #fff;
}
.wprc-mob-btn-change {
    padding: 9px 16px;
    background: #8b5cf6;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.wprc-mob-btn-change:hover { background: #7c3aed; }

/* 토글 스위치 */
.wprc-mob-toggle { position: relative; display: inline-block; width: 48px; height: 27px; flex-shrink: 0; }
.wprc-mob-toggle input { opacity: 0; width: 0; height: 0; }
.wprc-mob-toggle-track {
    position: absolute; inset: 0;
    background: #d1d5db;
    border-radius: 27px;
    cursor: pointer;
    transition: background 0.2s;
}
.wprc-mob-toggle-track::after {
    content: '';
    position: absolute;
    width: 21px; height: 21px;
    background: #fff;
    border-radius: 50%;
    top: 3px; left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.wprc-mob-toggle input:checked + .wprc-mob-toggle-track { background: #8b5cf6; }
.wprc-mob-toggle input:checked + .wprc-mob-toggle-track::after { transform: translateX(21px); }

/* ── 상태 메시지 프리뷰 ── */
#wprc-status-preview em {
    font-style: normal;
    color: #8b5cf6;
    font-weight: 500;
}

/* ── 저장 완료 토스트 알림 ── */
.wprc-mob-toast {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1f2937;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 400000;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
}
.wprc-mob-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── 내 프로필 카드: 이름 + 상태 메시지 2줄 ── */
.wprc-mob-my-profile-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.wprc-mob-my-status {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.wprc-mob-my-status.has-status {
    color: #8b5cf6;
}

/* ============================================
   Mobile — 파일 첨부 / 이미지 업로드 UI
   ============================================ */

/* 첨부 버튼 */
.wprc-mob-attach-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.wprc-mob-attach-btn:hover,
.wprc-mob-attach-btn.has-file {
    background: #ede9fe;
    color: #8b5cf6;
}

/* 이미지 미리보기 영역 */
.wprc-mob-img-preview {
    padding: 8px 0 6px;
}
.wprc-mob-img-preview-inner {
    position: relative;
    display: inline-block;
}
.wprc-mob-img-preview-inner img {
    height: 80px;
    max-width: 160px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #ede9fe;
    display: block;
}
.wprc-mob-img-cancel {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: none;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

/* 업로드 중 오버레이 */
.wprc-mob-uploading {
    position: absolute;
    inset: 0;
    background: rgba(139,92,246,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #8b5cf6;
    font-weight: 600;
}

/* 채팅 말풍선 안 이미지 */
.wprc-msg-bubble img.wprc-chat-img {
    max-width: 220px;
    max-height: 260px;
    border-radius: 12px;
    display: block;
    cursor: pointer;
    object-fit: cover;
}
/* 내 말풍선 이미지 → 배경 제거 */
.wprc-msg-mine .wprc-msg-bubble:has(img.wprc-chat-img) {
    background: transparent;
    padding: 0;
}
.wprc-msg:not(.wprc-msg-mine) .wprc-msg-bubble:has(img.wprc-chat-img) {
    background: transparent;
    padding: 0;
    box-shadow: none;
}

/* 이미지 전체화면 라이트박스 */
.wprc-mob-lightbox {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 500000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.wprc-mob-lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
}
.wprc-mob-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}