/**
 * v7/chat/chat.css — v7 1:1 채팅 스타일
 *
 * Web Awesome Pro 기반, 라이트 모드 전용 (다크 모드 미적용).
 * Bootstrap 미사용. 모든 클래스명은 v7chat- 접두어 사용.
 *
 * 주요 영역:
 * - 컨테이너/레이아웃
 * - 채팅방 목록
 * - 채팅방 뷰 (헤더, 메시지, 입력)
 * - 말풍선 (내/상대)
 * - 첨부파일 (이미지, 비디오, 파일)
 * - 이미지 뷰어 (전체화면)
 * - 업로드 진행률
 * - 검색
 * - 모달/드롭다운
 * - 아바타
 * - 배지/고정/즐겨찾기
 * - 반응형
 */

/* ============================================================
   컨테이너 / 레이아웃
   ============================================================ */

#v7-chat {
    width: 100%;
    /* 높이는 chat-app.js에서 offsetTop 기반으로 동적 계산 */
    height: calc(100dvh - 120px); /* JS 로드 전 폴백 */
    min-height: 400px;
    overflow: hidden;
}

.v7chat-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    color: #212529;
    background-color: #fff;
}

.v7chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    color: #6c757d;
    font-size: 1rem;
}

/* ============================================================
   채팅방 목록
   ============================================================ */

.v7chat-room-list {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.v7chat-list-header {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.v7chat-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.v7chat-header-top h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #212529;
}

.v7chat-header-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* 즐겨찾기 드롭다운 */
.v7chat-fav-dropdown {
    position: relative;
}

.v7chat-fav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    border-radius: 0.375rem;
    transition: background 0.15s;
    white-space: nowrap;
}

.v7chat-fav-toggle:hover {
    background: #f0f0f0;
}

.v7chat-fav-toggle .fa-star {
    color: #ffc107;
}

.v7chat-fav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    min-width: 180px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 0.25rem 0;
    margin-top: 0.25rem;
}

.v7chat-fav-dropdown-menu.show {
    display: block;
}

.v7chat-fav-dropdown-empty {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
}

.v7chat-fav-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    text-align: left;
    transition: background 0.15s;
}

.v7chat-fav-dropdown-item:hover {
    background: #f8f9fa;
}

.v7chat-fav-count {
    font-size: 0.75rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}

/* 즐겨찾기 모달 채팅방 아이템 */
.v7chat-fav-room-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0.375rem;
    transition: background 0.15s;
}

.v7chat-fav-room-item:hover {
    background: #f8f9fa;
}

.v7chat-fav-room-item:last-child {
    border-bottom: none;
}

.v7chat-fav-room-name {
    font-size: 0.9rem;
    color: #333;
}

.v7chat-room-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* 섹션 제목 */
.v7chat-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    padding: 0.5rem 0.5rem 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* 고정 채팅방 가로 스크롤 섹션 */
.v7chat-pinned-scroll-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
    flex-shrink: 0;
}

.v7chat-pinned-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.35rem 0.75rem 0.25rem;
    scrollbar-width: none;
}

.v7chat-pinned-scroll::-webkit-scrollbar {
    display: none;
}

.v7chat-pinned-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    flex-shrink: 0;
    width: 56px;
}

.v7chat-pinned-item:hover .v7chat-pinned-avatar-img,
.v7chat-pinned-item:hover .v7chat-pinned-avatar-text {
    box-shadow: 0 0 0 2px #ffc107;
}

.v7chat-pinned-avatar-wrap {
    position: relative;
    width: 48px;
    height: 48px;
}

.v7chat-pinned-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    transition: box-shadow 0.15s;
}

.v7chat-pinned-avatar-text {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #6c757d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    user-select: none;
    transition: box-shadow 0.15s;
}

.v7chat-pinned-remove {
    position: absolute;
    top: -3px;
    left: -3px;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-radius: 50%;
    background-color: #6c757d;
    color: #fff;
    font-size: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.v7chat-pinned-item:hover .v7chat-pinned-remove {
    opacity: 1;
}

.v7chat-pinned-remove:hover {
    background-color: #dc3545;
}

.v7chat-pinned-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    font-size: 0.6rem;
    font-weight: 600;
    color: #fff;
    background-color: #dc3545;
    border-radius: 8px;
    border: 2px solid #fff;
    line-height: 1;
}

.v7chat-pinned-name {
    font-size: 0.7rem;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.2;
}

/* 채팅방 아이템 */
.v7chat-room-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.25rem;
    border: 1px solid #eee;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s, box-shadow 0.15s;
    position: relative;
}

.v7chat-room-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* 고정된 채팅방 — 노란색 배경 + 왼쪽 테두리 (v6 스타일) */
.v7chat-room-item.pinned {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding-left: calc(0.75rem - 4px);
}

.v7chat-room-item.pinned:hover {
    background-color: rgba(255, 193, 7, 0.18);
}

/* 메타 영역 아이콘 행 */
.v7chat-meta-icons {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    justify-content: flex-end;
}

/* 즐겨찾기 별 아이콘 */
.v7chat-fav-star {
    color: #ffc107;
    font-size: 0.8rem;
}

/* 고정 핀 버튼 */
.v7chat-pin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: none;
    cursor: pointer;
    color: #ccc;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    transition: color 0.15s, background 0.15s;
    padding: 0;
}

.v7chat-pin-btn:hover {
    background: #f0f0f0;
    color: #6c757d;
}

.v7chat-pin-btn.pinned {
    color: #FFB300;
}

.v7chat-pin-btn.pinned:hover {
    color: #e6a200;
}

.v7chat-room-content {
    flex: 1;
    min-width: 0;
}

.v7chat-room-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
}

.v7chat-last-message {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.v7chat-room-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.v7chat-time {
    font-size: 0.7rem;
    color: #adb5bd;
    white-space: nowrap;
}

/* 배지 (읽지 않은 메시지 수) */
.v7chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background-color: #dc3545;
    border-radius: 0.75rem;
    line-height: 1;
}

/* .v7chat-unpin-btn — 고정 해제는 가로 스크롤 섹션의 .v7chat-pinned-remove로 대체 */

/* 빈 상태 / 로딩 */
.v7chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    color: #adb5bd;
}

.v7chat-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.v7chat-loading-more {
    text-align: center;
    padding: 1rem;
    color: #6c757d;
    font-size: 0.85rem;
}

/* ============================================================
   채팅방 뷰 (1:1)
   ============================================================ */

.v7chat-single-room {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background-color: #fff;
}

/* 헤더 */
.v7chat-room-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.v7chat-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    color: #212529;
    font-size: 1rem;
    transition: background-color 0.15s;
}

.v7chat-back-btn:hover {
    background-color: #f0f0f0;
}

.v7chat-room-title {
    flex: 1;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v7chat-header-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 메시지 영역 */
.v7chat-messages {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 0.75rem;
    min-height: 0;
    background-color: #fafafa;
}

.v7chat-no-messages {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #adb5bd;
    font-size: 0.9rem;
}

.v7chat-load-more {
    text-align: center;
    padding: 0.75rem;
    font-size: 0.8rem;
    color: #6c757d;
}

/* ============================================================
   말풍선
   ============================================================ */

.v7chat-bubble-wrap {
    display: flex;
    margin-bottom: 0.75rem;
}

.v7chat-bubble-wrap.mine {
    justify-content: flex-end;
}

.v7chat-bubble-wrap.other {
    justify-content: flex-start;
}

.v7chat-bubble-group {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.v7chat-bubble-wrap.mine .v7chat-bubble-group {
    align-items: flex-end;
}

.v7chat-bubble-wrap.other .v7chat-bubble-group {
    align-items: flex-start;
}

.v7chat-bubble-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
}

.v7chat-bubble-wrap.mine .v7chat-bubble-header {
    flex-direction: row-reverse;
}

.v7chat-bubble-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
}

.v7chat-bubble-content {
    padding: 0.6rem 0.85rem;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.5;
    font-size: 0.875rem;
}

.v7chat-bubble-content a {
    color: #0d6efd;
    text-decoration: underline;
}

.v7chat-bubble-wrap.mine .v7chat-bubble-content {
    background-color: #fff3cd;
    color: #000;
    border-radius: 1rem 1rem 0.25rem 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.v7chat-bubble-wrap.other .v7chat-bubble-content {
    background-color: #f1f3f5;
    color: #212529;
    border-radius: 1rem 1rem 1rem 0.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.v7chat-bubble-time {
    font-size: 0.65rem;
    color: #adb5bd;
    margin-top: 0.2rem;
}

.v7chat-bubble-deleted {
    font-style: italic;
    color: #adb5bd;
}

.v7chat-bubble-edited {
    font-size: 0.65rem;
    color: #adb5bd;
    font-style: italic;
}

/* 차단된 사용자 메시지 */
.v7chat-blocked-msg {
    font-style: italic;
    color: #adb5bd;
    font-size: 0.8rem;
}

/* ============================================================
   첨부파일
   ============================================================ */

.v7chat-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.v7chat-attach-image {
    position: relative;
    cursor: pointer;
}

.v7chat-attach-image img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 0.5rem;
    object-fit: cover;
    display: block;
}

.v7chat-attach-video video {
    max-width: 250px;
    max-height: 200px;
    border-radius: 0.5rem;
    display: block;
}

.v7chat-attach-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    color: #212529;
    font-size: 0.8rem;
    transition: background-color 0.15s;
}

.v7chat-attach-file:hover {
    background-color: #e9ecef;
}

.v7chat-attach-file i {
    font-size: 1.25rem;
    color: #0d6efd;
}

.v7chat-file-ext {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
}

.v7chat-fullscreen-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.v7chat-attach-image:hover .v7chat-fullscreen-btn {
    opacity: 1;
}

/* ============================================================
   이미지 전체화면 뷰어
   ============================================================ */

.v7chat-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.v7chat-viewer img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    cursor: default;
    user-select: none;
}

.v7chat-viewer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.v7chat-viewer-close:hover {
    background: rgba(255,255,255,0.25);
}

.v7chat-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: background-color 0.2s;
}

.v7chat-viewer-nav:hover {
    background: rgba(0,0,0,0.7);
}

.v7chat-viewer-prev {
    left: 1.5rem;
}

.v7chat-viewer-next {
    right: 1.5rem;
}

.v7chat-viewer-counter {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.5);
    padding: 0.3rem 0.75rem;
    border-radius: 1rem;
    z-index: 10001;
}

/* 썸네일 네비게이션 */
.v7chat-viewer-thumbs {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 10001;
}

.v7chat-thumb-list {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(0,0,0,0.5);
    border-radius: 0.75rem;
    overflow-x: auto;
    max-width: 90%;
}

.v7chat-thumb-item {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.v7chat-thumb-item.active {
    border-color: #fff;
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

.v7chat-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   입력 영역
   ============================================================ */

.v7chat-input-area {
    flex-shrink: 0;
    border-top: 2px solid #e9ecef;
    background-color: #fff;
}

/* 업로드 미리보기 */
.v7chat-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem 0;
}

.v7chat-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 0.375rem;
    overflow: hidden;
}

.v7chat-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v7chat-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(220,53,69,0.85);
    color: #fff;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v7chat-preview-file {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
    background: #f0f0f0;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    height: 80px;
    width: 80px;
    flex-direction: column;
    justify-content: center;
}

/* 입력 박스 */
.v7chat-input-box {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.v7chat-input-box textarea {
    flex: 1;
    resize: none;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    font-family: inherit;
    min-height: 38px;
    max-height: 120px;
    outline: none;
    transition: border-color 0.15s;
}

.v7chat-input-box textarea:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 2px rgba(13,110,253,0.15);
}

.v7chat-input-box textarea::placeholder {
    color: #adb5bd;
}

/* 업로드 진행률 */
.v7chat-upload-progress {
    padding: 0.4rem 0.75rem;
}

.v7chat-progress-bar {
    height: 6px;
    border-radius: 3px;
    background-color: #e9ecef;
    overflow: hidden;
}

.v7chat-progress-fill {
    height: 100%;
    background-color: #0d6efd;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.v7chat-progress-text {
    font-size: 0.7rem;
    color: #6c757d;
    text-align: center;
    margin-top: 0.15rem;
}

/* 차단됨 안내 */
.v7chat-blocked-input {
    text-align: center;
    padding: 0.75rem;
    color: #dc3545;
    font-size: 0.85rem;
    border-top: 2px solid #e9ecef;
    background: #fff;
}

.v7chat-blocked-input button {
    margin-top: 0.35rem;
}

/* ============================================================
   아이콘 버튼
   ============================================================ */

.v7chat-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    color: #495057;
    font-size: 0.9rem;
    transition: background-color 0.15s;
    padding: 0;
}

.v7chat-icon-btn:hover {
    background-color: rgba(0,0,0,0.06);
}

.v7chat-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background-color: #0d6efd;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s;
    flex-shrink: 0;
}

.v7chat-send-btn:hover {
    background-color: #0b5ed7;
}

.v7chat-send-btn:disabled {
    background-color: #adb5bd;
    cursor: default;
}

/* ============================================================
   아바타
   ============================================================ */

.v7chat-avatar-wrap {
    flex-shrink: 0;
    position: relative;
}

.v7chat-avatar-img {
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.v7chat-avatar-text {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #6c757d;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    user-select: none;
}

/* ============================================================
   드롭다운
   ============================================================ */

.v7chat-dropdown {
    position: relative;
    display: inline-block;
}

.v7chat-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
    min-width: 11rem;
    padding: 0.4rem 0;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.6rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    display: none;
    text-align: left;
}

.v7chat-dropdown-menu.show {
    display: block;
}

.v7chat-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    color: #333;
    cursor: pointer;
    transition: background-color 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.v7chat-dropdown-item i {
    width: 1.2em;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.v7chat-dropdown-item:hover {
    background-color: #f5f6f8;
}

.v7chat-dropdown-item.danger {
    color: #dc3545;
}

.v7chat-dropdown-divider {
    height: 1px;
    margin: 0.35rem 0.6rem;
    background-color: #eee;
}

/* ============================================================
   검색 페이지
   ============================================================ */

.v7chat-search-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.v7chat-search-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.v7chat-search-header h3 {
    margin: 0 0 0.15rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.v7chat-search-header p {
    margin: 0;
    font-size: 0.8rem;
    color: #6c757d;
}

.v7chat-search-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    flex-shrink: 0;
}

.v7chat-search-input input {
    flex: 1;
    padding: 0.45rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.v7chat-search-input input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 2px rgba(13,110,253,0.15);
}

.v7chat-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem;
}

.v7chat-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.35rem;
    border: 1px solid #eee;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.v7chat-user-item:hover {
    background-color: #f8f9fa;
}

.v7chat-user-info {
    flex: 1;
    min-width: 0;
}

.v7chat-user-info strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #212529;
}

.v7chat-user-info span {
    font-size: 0.8rem;
    color: #6c757d;
}

.v7chat-search-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #adb5bd;
    font-size: 0.9rem;
}

/* ============================================================
   모달 (wa-dialog 대체용 커스텀 모달)
   ============================================================ */

.v7chat-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v7chat-modal {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
}

.v7chat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.v7chat-modal-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.v7chat-modal-body {
    padding: 1rem;
}

.v7chat-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e9ecef;
}

/* 폴더 목록 아이템 */
.v7chat-folder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border: 1px solid #eee;
    border-radius: 0.375rem;
    margin-bottom: 0.35rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.v7chat-folder-item:hover {
    background-color: #f0f7ff;
}

.v7chat-folder-item.active {
    background-color: #e7f1ff;
    border-color: #0d6efd;
}

/* 신고 사유 라디오 */
.v7chat-report-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0;
    font-size: 0.9rem;
    cursor: pointer;
}

.v7chat-report-option input[type="radio"] {
    accent-color: #0d6efd;
}

/* ============================================================
   온라인 상태 (Presence)
   ============================================================ */

.v7chat-presence-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #adb5bd;
    border: 2px solid #fff;
    z-index: 1;
}

.v7chat-presence-dot.online {
    background-color: #28a745;
}

.v7chat-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.v7chat-presence-text {
    font-size: 0.7rem;
    color: #adb5bd;
    line-height: 1.2;
}

.v7chat-presence-text.online {
    color: #28a745;
}

/* ============================================================
   관리자 배지
   ============================================================ */

.v7chat-admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 0.8rem;
}

/* ============================================================
   메시지 수정/삭제 메뉴
   ============================================================ */

.v7chat-bubble-content {
    position: relative;
}

.v7chat-msg-menu {
    position: absolute;
    top: 2px;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}

/* 내 메시지: 왼쪽에 메뉴 */
.v7chat-bubble-wrap.mine .v7chat-msg-menu {
    left: -28px;
}

/* 상대방 메시지: 오른쪽에 메뉴 */
.v7chat-bubble-wrap.other .v7chat-msg-menu {
    right: -28px;
}

.v7chat-bubble-content:hover .v7chat-msg-menu,
.v7chat-msg-menu:hover {
    opacity: 1;
}

.v7chat-msg-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    color: #6c757d;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s;
}

.v7chat-msg-menu-btn:hover {
    background: rgba(0,0,0,0.12);
}

.v7chat-msg-menu-dropdown {
    position: absolute;
    top: 100%;
    min-width: 6rem;
    padding: 0.25rem 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    display: none;
    z-index: 100;
}

.v7chat-bubble-wrap.mine .v7chat-msg-menu-dropdown {
    right: 0;
}

.v7chat-bubble-wrap.other .v7chat-msg-menu-dropdown {
    left: 0;
}

.v7chat-msg-menu-dropdown.show {
    display: block;
}

.v7chat-msg-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    color: #212529;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background-color 0.1s;
}

.v7chat-msg-menu-dropdown button:hover {
    background-color: #f8f9fa;
}

.v7chat-msg-menu-dropdown button.danger {
    color: #dc3545;
}

/* ============================================================
   메시지 수정 모드
   ============================================================ */

.v7chat-edit-area {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.v7chat-edit-input {
    width: 100%;
    resize: none;
    border: 1px solid #86b7fe;
    border-radius: 0.375rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(13,110,253,0.15);
    min-height: 40px;
    max-height: 100px;
}

.v7chat-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

.v7chat-edit-cancel,
.v7chat-edit-save {
    border: none;
    border-radius: 0.25rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.v7chat-edit-cancel {
    background-color: #e9ecef;
    color: #495057;
}

.v7chat-edit-cancel:hover {
    background-color: #dee2e6;
}

.v7chat-edit-save {
    background-color: #0d6efd;
    color: #fff;
}

.v7chat-edit-save:hover {
    background-color: #0b5ed7;
}

/* ============================================================
   반응형
   ============================================================ */

/* ── 날짜 구분선 ── */
.v7chat-date-sep {
    text-align: center;
    margin: 1rem 0;
    position: relative;
}

.v7chat-date-sep::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dee2e6;
}

.v7chat-date-sep span {
    position: relative;
    background: #fff;
    padding: 0 0.75rem;
    font-size: 0.75rem;
    color: #868e96;
}

@media (max-width: 768px) {
    #v7-chat {
        height: calc(100dvh - 80px);
    }

    .v7chat-bubble-group {
        max-width: 85%;
    }

    .v7chat-attach-image img {
        max-width: 160px;
        max-height: 160px;
    }

    .v7chat-viewer-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .v7chat-viewer-prev {
        left: 0.5rem;
    }

    .v7chat-viewer-next {
        right: 0.5rem;
    }

    .v7chat-thumb-item {
        width: 48px;
        height: 48px;
    }
}

@media (min-width: 992px) {
    #v7-chat {
        height: calc(100dvh - 180px);
    }

    .v7chat-container {
        max-width: 100%;
    }
}

/* ============================================================
   사이드바 채팅 친구 목록 (v7sb-chat- 접두어)
   ============================================================ */

.v7sb-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.v7sb-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 1.1em;
    border-bottom: 1px solid #eee;
}

.v7sb-chat-new-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 4px;
}

.v7sb-chat-new-btn:hover {
    color: #333;
    background: #f0f0f0;
}

.v7sb-chat-search {
    padding: 0.5rem 0.75rem;
}

.v7sb-chat-search-btn {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 0.82em;
    color: #666;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.v7sb-chat-search-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

/* 사이드바 고정 채팅방 가로 스크롤 */
.v7sb-chat-pinned-section {
    border-bottom: 1px solid #eee;
    padding: 0.4rem 0;
    flex-shrink: 0;
}

.v7sb-chat-pinned-scroll {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.25rem 0.75rem;
    scrollbar-width: none;
}

.v7sb-chat-pinned-scroll::-webkit-scrollbar {
    display: none;
}

.v7sb-chat-pinned-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    cursor: pointer;
    flex-shrink: 0;
    width: 48px;
}

.v7sb-chat-pinned-item:hover .v7sb-chat-pinned-avatar-img,
.v7sb-chat-pinned-item:hover .v7sb-chat-pinned-avatar-text {
    box-shadow: 0 0 0 2px #ffc107;
}

.v7sb-chat-pinned-item.active .v7sb-chat-pinned-avatar-img,
.v7sb-chat-pinned-item.active .v7sb-chat-pinned-avatar-text {
    box-shadow: 0 0 0 2px #1a73e8;
}

.v7sb-chat-pinned-avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
}

.v7sb-chat-pinned-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    transition: box-shadow 0.15s;
}

.v7sb-chat-pinned-avatar-text {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85em;
    user-select: none;
    transition: box-shadow 0.15s;
}

.v7sb-chat-pinned-remove {
    position: absolute;
    top: -3px;
    left: -3px;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    background-color: #6c757d;
    color: #fff;
    font-size: 0.45rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.v7sb-chat-pinned-item:hover .v7sb-chat-pinned-remove {
    opacity: 1;
}

.v7sb-chat-pinned-remove:hover {
    background-color: #dc3545;
}

.v7sb-chat-pinned-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    height: 14px;
    padding: 0 2px;
    font-size: 0.55rem;
    font-weight: 600;
    color: #fff;
    background-color: #e74c3c;
    border-radius: 7px;
    border: 2px solid #fff;
    line-height: 1;
}

.v7sb-chat-pinned-name {
    font-size: 0.65em;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.2;
}

.v7sb-chat-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.v7sb-chat-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #999;
    font-size: 0.85em;
}

.v7sb-chat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s;
}

.v7sb-chat-item:hover {
    background: #f5f6f7;
}

.v7sb-chat-item.active {
    background: #e8f0fe;
    border-left-color: #1a73e8;
}

/* .v7sb-chat-item.pinned — 고정 채팅방은 가로 스크롤 섹션에서 별도 표시 */

/* 아바타 */
.v7sb-chat-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v7sb-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.v7sb-chat-initial {
    font-size: 0.85em;
    font-weight: 600;
    color: #666;
}

/* 정보 */
.v7sb-chat-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.v7sb-chat-name {
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.v7sb-chat-preview {
    font-size: 0.75em;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* 메타 */
.v7sb-chat-meta {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.v7sb-chat-time {
    font-size: 0.7em;
    color: #aaa;
    white-space: nowrap;
}

.v7sb-chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.65em;
    font-weight: 600;
}
