/* ===== Multi-Popup Chat Container ===== */
#chat-popups-container {
    position: fixed;
    top: 0; left: 0;
    width: 0; height: 0;
    pointer-events: none;
    z-index: 1000;
}
.chat-popup-wrap {
    pointer-events: all;
    filter: drop-shadow(0 4px 24px rgba(0,0,0,0.22));
}

/* ===== Messages Page ===== */
.messages-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px;
}

.messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.messages-header h2 {
    font-family: 'Engravers Gothic', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}

.messages-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0;
    gap: 0;
}

.messages-tabs .tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #868e96;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.messages-tabs .tab-btn.active {
    color: #222;
    border-bottom-color: #222;
}

.messages-tabs .tab-btn:hover {
    color: #222;
}

/* ===== Conversation List ===== */
.conversation-list {
    border-top: 0;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 14px 4px;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.conversation-item:hover {
    background: #f8f9fa;
}

.conversation-item.unread {
    background: #f8f9ff;
}

.conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #e9ecef;
    flex-shrink: 0;
    background-image: url('https://d2dmyh35ffsxbl.cloudfront.net/assets/defaults/no-avatar-100-b164b29ca37cbce6b6dbcf4d61d40ba7a3081dfd121a32e2a773eb8f018f0a1f.png');
}

.conversation-body {
    flex: 1;
    min-width: 0;
}

.conversation-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.conversation-name {
    font-family: 'Pretendard', sans-serif;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-name-link:hover {
    text-decoration: underline;
}
.conversation-name-sep {
    color: #888;
}

.conversation-group-label {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 6px;
    background: #000;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
}

.conversation-time {
    font-size: 11px;
    color: #adb5bd;
    flex-shrink: 0;
}

.conversation-preview {
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    color: #818080;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.conversation-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #228be6;
    flex-shrink: 0;
}
.conversation-unread-badge {
    flex-shrink: 0;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16.5px;
    height: 16.5px;
    padding: 0 4px;
    border-radius: 8px;
    background-color: rgb(244, 54, 30);
    color: #fff;
    font-family: 'Pretendard', sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 14px;
    letter-spacing: -0.3px;
    box-sizing: border-box;
}

/* ===== Chat Modal / Detail ===== */
.chat-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1050;
    justify-content: center;
    align-items: center;
}

.chat-overlay.active {
    display: flex;
}

.chat-modal {
    background: #fff;
    border-radius: 16px;
    width: 380px;
    height: 640px;
    min-height: 300px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}
.chat-resize-handle {
    height: 6px;
    cursor: ns-resize;
    background: transparent;
    position: relative;
    flex-shrink: 0;
}
.chat-resize-handle::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: #ccc;
    border-radius: 2px;
    margin: 0 auto;
    position: relative;
    top: 2px;
}
.chat-modal.dark .chat-resize-handle::after {
    background: #555;
}

.chat-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 13px 0 9px;
    border-bottom: none;
    cursor: grab;
    user-select: none;
}
.chat-modal-header:active {
    cursor: grabbing;
}

.chat-header-avatar {
    width: 43px;
    height: 43px;
    border-radius: 50%;
    background: #e9ecef;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.chat-modal.dark .chat-header-avatar {
    background-color: #333;
}

.chat-member-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #8A8A8A;
    background: none;
    padding: 0;
    border-radius: 0;
    position: relative;
    cursor: pointer;
}
.member-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: #222;
    color: #fff;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 100;
    font-size: 12px;
}
.member-tooltip-item {
    padding: 5px 14px;
    white-space: nowrap;
}
.member-tooltip-item:hover {
    background: #333;
}
.chat-member-count svg {
    vertical-align: -1px;
}
.chat-member-count [data-eid="memberNum"] {
    font-size: 14px;
    font-weight: 600;
}
.chat-modal.dark .chat-member-count {
    background: none;
    color: #8A8A8A;
}

.chat-tz-toggle {
    font-size: 11px;
    color: #868e96;
    text-decoration: none;
}
.chat-tz-toggle:hover {
    color: #495057;
}
.chat-modal.dark .chat-tz-toggle { color: #666; }
.chat-modal.dark .chat-tz-toggle:hover { color: #aaa; }

.chat-name-input {
    font-size: 15px;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 2px 8px;
    outline: none;
    width: 160px;
}
.chat-name-input:focus {
    border-color: #333;
}
.chat-modal.dark .chat-name-input {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #555;
}
.chat-modal.dark .chat-name-input:focus {
    border-color: #888;
}

.chat-modal-header h5 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.chat-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #868e96;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chat-notice {
    padding: 8px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
    color: #868e96;
}

.chat-notice .text-red {
    color: #e03131;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 7px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

/* Capture selection mode */
.chat-body.capturing .chat-item { cursor: pointer; }
.chat-body.capturing .chat-item:hover { background: rgba(255,255,255,0.04); border-radius: 6px; }
.capture-select-overlay {
    position: absolute;
    border: 2px dashed #ffffff;
    border-radius: 8px;
    pointer-events: none;
    z-index: 5;
    left: 4px;
    right: 4px;
}
.capture-select-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #2a2a2a;
    border-top: 1px solid #333;
    z-index: 20;
    color: #fff;
    font-size: 13px;
}
.capture-select-msg { color: #ddd; }
.capture-select-actions { display: flex; gap: 6px; align-items: center; }
.capture-select-btn {
    background: none;
    border: none;
    color: #ddd;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.capture-select-btn:hover { background: #333; }
.capture-select-btn.capture {
    background: #FBE43E;
    color: #000;
    font-weight: 600;
}
.capture-select-btn.capture:hover { background: #f5d900; }
.capture-select-btn.capture:disabled { opacity: 0.4; cursor: not-allowed; background: #666; color: #222; }

/* Hamburger menu */
.chat-hamburger-wrap {
    position: relative;
}
.chat-hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-hamburger-btn img {
    filter: brightness(0) invert(1);
}
.chat-hamburger-btn:hover { opacity: 0.8; }
.chat-hamburger-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 6px 0;
    min-width: 150px;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.chat-settings-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 6px 0;
    min-width: 170px;
    z-index: 201;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.chat-settings-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px 8px;
    color: #ddd;
    font-family: 'Pretendard', sans-serif;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid #333;
    margin-bottom: 4px;
}
.chat-settings-menu-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
}
.chat-settings-menu-close:hover { background: #2a2a2a; color: #ddd; }
.chat-hamburger-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    background: none;
    border: none;
    color: #ddd;
    font-family: 'Pretendard', sans-serif;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.chat-hamburger-item:hover { background: #2a2a2a; }
.chat-hamburger-item svg { flex-shrink: 0; }
.chat-hamburger-divider {
    height: 1px;
    background: #333;
    margin: 4px 0;
}
.chat-hamburger-leave { color: #e03131; }
.chat-hamburger-leave:hover { background: #2a1a1a; }

/* Leave button */
.chat-leave-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}
.chat-leave-btn:hover { color: #e03131; }

/* Leave popup (1:1) */
.chat-leave-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;
}
.chat-leave-popup {
    background: #1e1e1e;
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.chat-leave-popup-icon { font-size: 36px; }
.chat-leave-popup-title {
    font-family: 'Pretendard', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}
.chat-leave-popup-desc {
    font-family: 'Pretendard', sans-serif;
    font-size: 13px;
    color: #999;
}
.chat-leave-popup-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.chat-leave-popup-cancel {
    padding: 8px 24px;
    border: 1px solid #555;
    border-radius: 8px;
    background: transparent;
    color: #ccc;
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.chat-leave-popup-cancel:hover { background: #333; }
.chat-leave-popup-confirm {
    padding: 8px 24px;
    border: none;
    border-radius: 8px;
    background: #e03131;
    color: #fff;
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.chat-leave-popup-confirm:hover { opacity: 0.9; }

.chat-item-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: fit-content;
}

/* Date divider */
.chat-date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 16px 0;
}
.chat-date-divider span {
    font-family: 'Pretendard', sans-serif;
    font-size: 12px;
    color: #FFFFFF;
    background: #2a2a2a;
    padding: 4px 12px;
    border-radius: 12px;
}
.chat-modal.dark .chat-date-divider span {
    background: #2a2a2a;
    color: #FFFFFF;
}

/* Read badge */
.chat-read-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 12px 0;
}
.chat-read-badge span {
    font-family: 'Pretendard', sans-serif;
    font-size: 11px;
    color: #aaa;
    background: #252525;
    padding: 3px 14px;
    border-radius: 12px;
    border: 1px solid #333;
}
.chat-modal.dark .chat-read-badge span {
    background: #252525;
    color: #aaa;
    border-color: #333;
}

.chat-sender-gap {
    margin-top: 0;
}

/* Chat Bubble */
.chat-item {
    display: flex;
    gap: 8px;
    max-width: 85%;
}

.chat-item.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
    gap: 3px;
}

.chat-item:not(.mine) {
    align-self: flex-start;
    flex-direction: row;
    gap: 7px;
}

.chat-other-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #333;
    align-self: flex-start;
}

.chat-other-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    align-self: flex-end;
    gap: 4px;
    margin-left: -4px;
}

.chat-other-time {
    font-size: 11px;
    color: #adb5bd;
    letter-spacing: -0.5px;
}
.chat-modal.dark .chat-other-time { color: #D0D0D0; }

.chat-translate-inline {
    display: inline-flex;
    align-items: flex-end;
    align-self: flex-end;
    margin-left: 0;
    color: #adb5bd;
}
.chat-translate-inline:hover { color: #495057; }
.chat-modal.dark .chat-translate-inline { color: #666; }
.chat-modal.dark .chat-translate-inline:hover { color: #aaa; }

.chat-report-inline {
    display: inline-flex;
    align-items: flex-end;
    align-self: flex-end;
    color: #ccc;
}
.chat-report-inline:hover { color: #e03131; }
.chat-modal.dark .chat-report-inline { color: #555; }
.chat-modal.dark .chat-report-inline:hover { color: #e03131; }

.chat-mine-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 2px;
    min-width: 50px;
    position: relative;
    top: 2px;
}
.chat-item.mine .chat-bubble-line {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 6px;
}
.chat-item.mine .chat-item-content { align-items: flex-end; }

.chat-mine-read {
    font-size: 11px;
    color: #666666;
}

.chat-mine-unread {
    font-size: 11px;
    color: #666666;
    position: relative;
    top: 6px;
}

.read-count {
    font-size: 10px;
}

.chat-bubble.scheduled-pending {
    opacity: 0.45;
}

.chat-mine-scheduled {
    font-size: 11px;
    color: #fab005;
}
.chat-modal.dark .chat-mine-scheduled { color: #fab005; }

.sched-edit-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    color: #868e96;
    display: flex;
    align-items: flex-end;
    align-self: flex-end;
}
.sched-edit-btn:hover { background: #f1f3f5; color: #495057; }
.chat-modal.dark .sched-edit-btn { border-color: #444; color: #888; }
.chat-modal.dark .sched-edit-btn:hover { background: #333; color: #ccc; }

.chat-toast {
    display: none;
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 30;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    white-space: nowrap;
}
.chat-toast.active {
    display: block;
    animation: toastFade 2.5s ease;
}
@keyframes toastFade {
    0% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.chat-mine-time {
    font-family: 'Pretendard', sans-serif;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.5px;
    color: #adb5bd;
}

.chat-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #e9ecef;
    flex-shrink: 0;
    background-image: url('https://d2dmyh35ffsxbl.cloudfront.net/assets/defaults/no-avatar-100-b164b29ca37cbce6b6dbcf4d61d40ba7a3081dfd121a32e2a773eb8f018f0a1f.png');
}

.chat-bubble {
    padding: 8px 10px 6px;
    border-radius: 8px;
    word-break: break-word;
}
.chat-bubble-edited {
    display: block;
    text-align: right;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    margin-top: 3px;
    font-weight: 400;
}
.chat-item:not(.mine) .chat-bubble-edited {
    color: rgba(255, 255, 255, 0.55);
}

/* 내 메시지 폰트 스타일 */
.chat-item.mine .chat-bubble {
    font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
    font-size: 14.6px;
    font-weight: 400;
    line-height: 1.26;
    color: #000000;
    background: #e7f5ff;
    transform: scaleY(1.03);
    max-width: 273px;
}

/* 상대 메시지 폰트 스타일 */
.chat-item:not(.mine) .chat-bubble {
    font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
    font-size: 14.6px;
    font-weight: 400;
    line-height: 1.26;
    color: #FFFFFF;
    transform: scaleY(1.03);
    max-width: 231px;
    background: #f1f3f5;
}

.chat-sender-name {
    font-family: 'Pretendard', sans-serif;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 17px;
    letter-spacing: 0.15px;
    color: #EDEDED;
    -webkit-font-smoothing: antialiased;
    margin-top: 6px;
    margin-bottom: 0;
    display: inline-block;
    text-transform: uppercase;
}
.chat-sender-name.mine-sender {
    text-align: right;
}
.chat-sender-name.other-sender {
    text-align: left;
    height: 18px;
}

/* Unsend button */
.chat-bubble-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
    max-width: 100%;
}

.unsend-btn {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: -90px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
    color: #e03131;
    cursor: pointer;
    white-space: nowrap;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 5;
}

.unsend-btn::after {
    content: '';
    position: absolute;
    top: 0;
    right: -20px;
    width: 20px;
    height: 100%;
}

.unsend-btn svg {
    vertical-align: -2px;
}

.chat-bubble-wrap:hover .unsend-btn {
    display: inline-flex;
}

.chat-meta-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #fab005;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    font-style: normal;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 0 4px;
}

.chat-item.mine .chat-meta {
    justify-content: flex-end;
}

.chat-item:not(.mine) .chat-meta {
    justify-content: flex-start;
}

.chat-meta-time {
    font-size: 11px;
    color: #adb5bd;
}

.chat-meta-read {
    font-size: 13px;
    color: #228be6;
}

.chat-meta-report {
    font-size: 11px;
    color: #adb5bd;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.chat-meta-report:hover {
    color: #e03131;
}

/* Chat Footer / Input */
.chat-footer {
    padding: 2px 6px 6px;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #222222;
    border-top: 1px solid #333;
    height: 120px;
    flex-shrink: 0;
}

.chat-input-area {
    background: transparent;
    padding: 3px 0 8px;
    height: 85px;
    display: flex;
}

.chat-edit-banner {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 120px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: #222222;
    z-index: 5;
}
.chat-edit-banner-content { flex: 1; min-width: 0; }

.chat-mention-dropdown {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 124px;
    max-height: 200px;
    overflow-y: auto;
    background: #262626;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    z-index: 30;
    padding: 4px 0;
}
.chat-mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: #e6e6e6;
    font-size: 13px;
}
.chat-mention-item.active,
.chat-mention-item:hover { background: #3a3a3a; }
.chat-mention-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    background: #444;
}
.chat-mention-avatar-default { background: #444; }
.chat-mention-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-mention {
    color: #4a90ff;
    background: rgba(74,144,255,0.12);
    border-radius: 4px;
    padding: 0 3px;
    font-weight: 500;
}
.chat-mention-me {
    color: #000;
    background: #FBE43E;
    font-weight: 600;
}

.chat-search-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}
.chat-search-icon { color: #888; flex: 0 0 auto; }
.chat-search-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #eee;
    font-size: 13px;
    font-family: inherit;
    padding: 4px 2px;
}
.chat-search-input::placeholder { color: #666; }
.chat-search-count {
    color: #888;
    font-size: 12px;
    min-width: 40px;
    text-align: right;
    flex: 0 0 auto;
}
.chat-search-nav {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.chat-search-nav:hover { background: #2c2c2c; color: #fff; }
.chat-search-nav:disabled { opacity: 0.4; cursor: not-allowed; }

mark.chat-search-mark {
    background: #FBE43E;
    color: #000;
    padding: 0 1px;
    border-radius: 2px;
}
.chat-bubble.chat-search-match-active {
    box-shadow: 0 0 0 2px #FBE43E;
}
.chat-edit-banner-label { color: #4a90ff; font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.chat-edit-banner-orig {
    color: #fff;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-edit-banner-close {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.chat-edit-banner-close:hover { color: #fff; }
.chat-send-btn-new.editing { background: #FBE43E; color: #000; }
.chat-send-btn-new.editing:hover { background: #f5d900; }

.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    height: 34px;
}
.chat-toolbar-left {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-send-btn-new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 75px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: #FBE43E;
    color: #000;
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.chat-send-btn-new:hover { opacity: 0.9; }
.chat-send-btn-new svg { stroke: #000; }

.chat-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-container {
    flex: 1;
    background: #f1f3f5;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    min-height: 38px;
}

.chat-input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Pretendard', sans-serif;
    font-size: 14.6px;
    font-weight: 400;
    padding: 4px 0 4px 10px;
    outline: none;
    resize: none;
    line-height: 20px;
    min-height: 24px;
    max-height: 80px;
    overflow-y: auto;
    color: #fff;
}
.chat-input::placeholder {
    color: #838383;
    font-size: 14.6px;
    font-weight: 400;
}

.chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #dee2e6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.chat-send-btn.active {
    background: #222;
}

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

/* Empty State */
.messages-empty {
    text-align: center;
    padding: 60px 20px;
    color: #adb5bd;
}

.messages-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    stroke: #dee2e6;
}

.messages-empty p {
    font-size: 14px;
    margin: 0;
}

/* Badge */
.msg-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #e03131;
    border-radius: 50%;
    border: 1.5px solid #fff;
}
.msg-badge--mobile {
    top: 2px;
    right: -2px;
    width: 7px;
    height: 7px;
}
.notif-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    background: #e03131;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    border: 1.5px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.notif-badge--mobile {
    top: 0px;
    right: -4px;
    min-width: 14px;
    height: 14px;
    font-size: 9px;
    padding: 0 3px;
}
/* Global Search in header */
.global-search-wrap {
    position: relative;
    display: inline-block;
}
.global-search-input {
    width: 160px;
    height: 26px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    background: #fafafa;
    border-radius: 4px;
    padding: 0 8px;
    color: #111;
    outline: none;
    transition: width 0.15s;
}
.global-search-input:focus {
    width: 220px;
    background: #fff;
    border-color: #111;
}
.global-search-panel {
    position: absolute;
    top: 32px;
    right: 0;
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    z-index: 10001;
    padding: 6px 0;
}
.gs-section-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #888;
    padding: 8px 12px 4px;
    text-transform: uppercase;
    border-top: 1px solid #f3f4f6;
}
.gs-section-label:first-child { border-top: none; }
.gs-item {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    color: #111;
    text-decoration: none;
    transition: background 0.08s;
}
.gs-item:hover { background: #f5f5f5; text-decoration: none; color: #111; }
.gs-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gs-sub {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.gs-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 12px;
}

/* Compose Button */
.compose-btn {
    background: #222;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.compose-btn:hover {
    background: #333;
}

/* Compose Modal */
.compose-receiver {
    padding: 12px 20px;
    border-bottom: 1px solid #e9ecef;
}

.compose-receiver input {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
}

.compose-receiver input:focus {
    border-color: #228be6;
}

/* ===== Avatar with status dot ===== */
.conversation-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.conversation-avatar-wrap .status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.search-result-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.search-result-avatar-wrap .status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot-inline {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #40c057;
}

/* ===== Availability Badge (text) ===== */
.availability-badge {
    font-size: 11px;
    font-weight: 500;
}

/* ===== My Status Selector ===== */
.my-status-selector {
    position: relative;
}

.my-status-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 12px;
    color: #495057;
    cursor: pointer;
}

.my-status-btn:hover {
    background: #e9ecef;
}

.status-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 10;
    min-width: 180px;
    overflow: hidden;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #333;
}

.status-option:hover {
    background: #f8f9fa;
}

.status-desc {
    font-size: 11px;
    color: #adb5bd;
    margin-left: auto;
}

/* ===== Inline Translation ===== */
.chat-translated {
    padding: 6px 14px;
    margin-top: 2px;
    font-size: 12px;
    color: #1c7ed6;
    background: #e7f5ff;
    border-radius: 12px;
    line-height: 1.4;
}

.translated-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #74b9ff;
    letter-spacing: 0.03em;
}

.chat-meta-translate {
    display: inline-flex;
    align-items: center;
    color: #adb5bd;
    cursor: pointer;
    text-decoration: none;
    padding: 1px 2px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}

.chat-meta-translate:hover {
    color: #228be6;
    background: #e7f5ff;
}

.chat-meta-translate.active {
    color: #228be6;
}

.chat-meta-translate.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Introduction Button ===== */
.intro-btn {
    background: none;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 5px 8px;
    cursor: pointer;
    color: #868e96;
    display: flex;
    align-items: center;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.intro-btn:hover {
    color: #228be6;
    border-color: #228be6;
    background: #e7f5ff;
}

/* ===== Intro Card (top of conversation) ===== */
.intro-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fff9db 0%, #fff3bf 100%);
    border-bottom: 1px solid #ffe066;
}

.intro-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.intro-card-body {
    flex: 1;
    min-width: 0;
}

.intro-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #e67700;
}

.intro-card-msg {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    line-height: 1.4;
}

.intro-card-toggle {
    background: none;
    border: none;
    color: #e67700;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    flex-shrink: 0;
}

.intro-card-toggle:hover {
    opacity: 1;
}

/* ===== Introduction Modal ===== */
.intro-modal {
    max-width: 480px;
}

.intro-form {
    padding: 20px;
}

.intro-form-section {
    margin-bottom: 16px;
}

.intro-form-section label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.intro-person-fixed {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.intro-form-options {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.intro-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
}

.intro-option input[type="checkbox"] {
    accent-color: #228be6;
    width: 16px;
    height: 16px;
}

.intro-option-hint {
    width: 100%;
    font-size: 11px;
    color: #adb5bd;
    padding-left: 22px;
}

.intro-confirm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: #228be6;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.intro-confirm-btn:hover {
    background: #1c7ed6;
}

.intro-person-selected {
    margin-top: 6px;
}

/* ===== Schedule Button ===== */
.chat-schedule-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #868e96;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s;
}

.chat-schedule-btn:hover {
    color: #fab005;
}

/* ===== Scheduled Tab Badge ===== */
.scheduled-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fab005;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    margin-left: 4px;
}

/* ===== Scheduled List Item ===== */
.scheduled-item {
    position: relative;
}

.scheduled-clock-icon {
    position: absolute;
    bottom: 0;
    right: 0;
}

.scheduled-time-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #fab005;
    margin-top: 4px;
}

.scheduled-countdown {
    color: #868e96;
}

.scheduled-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}

.scheduled-edit-btn,
.scheduled-delete-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #868e96;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.scheduled-edit-btn:hover {
    color: #228be6;
    background: #e7f5ff;
}

.scheduled-delete-btn:hover {
    color: #e03131;
    background: #fff5f5;
}

/* ===== Schedule Modal ===== */
.schedule-modal {
    max-width: 400px;
    height: 310px;
}

.schedule-datetime-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.schedule-datetime-row .schedule-field label {
    text-align: center;
}
.schedule-datetime-row .schedule-field input[type="date"] {
    height: 82px;
    display: flex;
    align-items: center;
}
.schedule-datetime-row .schedule-field {
    margin-bottom: 0;
}

.schedule-form {
    padding: 16px;
}

.schedule-fields-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.schedule-fields-row .schedule-field {
    flex: 1;
    margin-bottom: 0;
}

.schedule-field {
    margin-bottom: 12px;
}

.schedule-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.schedule-field input[type="date"],
.schedule-field input[type="time"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.schedule-field input:focus {
    border-color: #228be6;
}

.schedule-edit-content {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
    resize: vertical;
    outline: none;
    min-height: 60px;
}

.schedule-edit-content:focus {
    border-color: #228be6;
}

/* Time Spinner */
.time-spinner {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}
.time-spin-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.time-spin-btn {
    width: 36px;
    height: 24px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 10px;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
}
.time-spin-btn:hover { background: #e9ecef; }
.time-spin-btn:active { background: #dee2e6; }
.time-spin-input {
    width: 36px;
    height: 32px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    background: #fff;
    color: #222;
}
.time-spin-ampm {
    width: 36px;
    font-size: 12px;
}
.time-spin-sep {
    font-size: 18px;
    font-weight: 700;
    color: #495057;
    padding: 0 2px;
    align-self: center;
}
.dark .time-spin-btn {
    background: #333;
    border-color: #555;
    color: #ccc;
}
.dark .time-spin-btn:hover { background: #444; }
.dark .time-spin-input {
    background: #2a2a2a;
    border-color: #555;
    color: #e0e0e0;
}
.dark .time-spin-sep { color: #999; }

.schedule-preview {
    font-size: 13px;
    color: #228be6;
    font-weight: 500;
    padding: 8px 0 4px;
}

.schedule-tz-hint {
    font-size: 11px;
    color: #868e96;
    padding-bottom: 12px;
}

.schedule-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

.schedule-cancel-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    color: #495057;
    font-size: 13px;
    cursor: pointer;
}

.schedule-cancel-btn:hover {
    background: #f8f9fa;
}

.schedule-confirm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: #fab005;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.schedule-confirm-btn:hover {
    background: #f59f00;
}

/* Schedule modal dark mode */
.chat-modal.dark .schedule-modal,
.dark .schedule-modal {
    background: #1e1e1e;
}
.chat-modal.dark .schedule-form,
.dark .schedule-form {
    background: #1e1e1e;
}
.dark .schedule-field label {
    color: #aaa;
}
.dark .schedule-field input[type="date"],
.dark .schedule-field input[type="time"] {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
    color-scheme: dark;
}
.dark .schedule-field input:focus {
    border-color: #FBE43E;
}
.dark .schedule-preview {
    color: #FBE43E;
}
.dark .schedule-tz-hint {
    color: #888;
    border-color: #333;
}
.dark .schedule-actions {
    border-color: #333;
}
.dark .schedule-cancel-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}
.dark .schedule-cancel-btn:hover {
    background: #333;
}
.dark .schedule-confirm-btn {
    background: #FBE43E;
    color: #000;
}
.dark .schedule-confirm-btn:hover {
    background: #e8d235;
}
.dark .chat-modal-header {
    border-color: #333;
}
.dark .chat-modal-header h5 {
    color: #e0e0e0;
}
.dark .chat-modal-close {
    color: #999;
}

/* ===== Link Preview Card ===== */
.link-preview-card {
    display: flex;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    margin-top: 6px;
    max-width: 340px;
    background: #fff;
    transition: box-shadow 0.15s;
}

.link-preview-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.link-preview-card.loading {
    opacity: 0.6;
}

.link-preview-image {
    width: 100px;
    min-height: 80px;
    background-size: cover;
    background-position: center;
    background-color: #f1f3f5;
    flex-shrink: 0;
}

.link-preview-body {
    flex: 1;
    padding: 8px 10px;
    min-width: 0;
}

.link-preview-site {
    font-size: 11px;
    color: #868e96;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
}

.link-preview-site img {
    border-radius: 2px;
}

.link-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-desc {
    font-size: 11px;
    color: #868e96;
    margin-top: 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-url {
    font-size: 11px;
    color: #adb5bd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Chat Inline Link ===== */
.chat-link {
    color: #228be6;
    text-decoration: underline;
    word-break: break-all;
}

.chat-link:hover {
    color: #1971c2;
}

/* ===== Attachment in chat bubble ===== */
.chat-attachment-img {
    margin-top: 6px;
    max-width: 240px;
}

.chat-attachment-img img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.chat-attachment-img img:hover {
    opacity: 0.85;
}

.chat-attachment-file {
    margin-top: 6px;
}

.chat-attachment-file a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 12px;
    color: #495057;
    text-decoration: none;
    transition: background 0.15s;
}

.chat-attachment-file a:hover {
    background: #e9ecef;
}

/* ===== Attach Button ===== */
.chat-attach-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #868e96;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s;
}

.chat-attach-btn:hover {
    color: #228be6;
}

/* ===== Attachment Preview (pending upload) ===== */
.chat-attachment-preview {
    padding: 8px 16px;
    border-top: 1px solid #e9ecef;
}
.chat-modal.drag-over { outline: 2px dashed #FBE43E; outline-offset: -6px; }

/* ===== File/Media Panel ===== */
.chat-media-panel {
    position: absolute;
    inset: 0;
    background: var(--chat-bg, #151515);
    z-index: 25;
    display: flex;
    flex-direction: column;
}
.chat-media-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.chat-media-back {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    border-radius: 6px;
}
.chat-media-back:hover { background: rgba(255,255,255,0.06); }
.chat-media-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}
.chat-media-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.chat-media-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    color: #888;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border-bottom: 2px solid transparent;
}
.chat-media-tab.active {
    color: #FBE43E;
    border-bottom-color: #FBE43E;
}
.chat-media-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
.chat-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.chat-media-thumb {
    aspect-ratio: 1;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}
.chat-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.chat-media-filelist {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-media-fileitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #2a2a2a;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
}
.chat-media-fileitem:hover { background: #333; }
.chat-media-fileicon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #bbb;
}
.chat-media-fileinfo { flex: 1; min-width: 0; }
.chat-media-filename {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-media-filemeta {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.chat-media-empty {
    text-align: center;
    color: #666;
    padding: 50px 20px;
    font-size: 13px;
}

/* ===== Code block / inline code in chat bubbles ===== */
.chat-inline-code {
    font-family: 'SF Mono', 'Menlo', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(0,0,0,0.08);
    color: inherit;
    white-space: break-spaces;
}
.chat-item:not(.mine) .chat-bubble .chat-inline-code {
    background: rgba(255,255,255,0.08);
}
.chat-bubble .chat-code-block {
    position: relative;
    margin: 6px 0 2px;
    padding: 28px 12px 10px;
    background: #1e1e1e;
    color: #eaeaea;
    border-radius: 8px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    max-width: 100%;
}
.chat-bubble .chat-code-block code {
    font-family: inherit;
    color: inherit;
    background: transparent;
    padding: 0;
    white-space: pre;
}
.chat-code-lang {
    position: absolute;
    top: 6px;
    left: 10px;
    font-size: 10px;
    color: #9a9a9e;
    text-transform: lowercase;
    letter-spacing: 0.3px;
}
.chat-code-copy {
    position: absolute;
    top: 4px;
    right: 6px;
    background: rgba(255,255,255,0.06);
    color: #ddd;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 10px;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.4;
}
.chat-code-copy:hover { background: rgba(255,255,255,0.12); color: #fff; }
.attachment-send-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}
.attachment-cancel-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 8px;
}
.attachment-cancel-btn:hover { color: #e03131; }
.attachment-send-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: #FBE43E;
    color: #000;
    font-family: 'Pretendard', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.attachment-send-btn:hover { opacity: 0.9; }
.attachment-send-count {
    font-weight: 700;
}

.attachment-preview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    color: #495057;
}

.attachment-preview-name {
    display: flex;
    align-items: center;
    gap: 4px;
}

.attachment-preview-remove {
    background: none;
    border: none;
    font-size: 16px;
    color: #adb5bd;
    cursor: pointer;
    line-height: 1;
}

.attachment-preview-remove:hover {
    color: #e03131;
}

.attachment-preview-thumb {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: #2c2c2c;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    flex: 0 0 auto;
}
.attachment-preview-thumb.uploading { opacity: 0.55; }
.attachment-preview-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.attachment-preview-thumb-icon { opacity: 0.75; }
.attachment-preview-thumb-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 13px;
    line-height: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.attachment-preview-thumb-remove:hover { background: #e03131; }

.attachment-preview-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 10px;
    background: #2c2c2c;
    border-radius: 8px;
    color: #ddd;
    font-size: 12px;
    max-width: 100%;
}
.attachment-preview-file.uploading { opacity: 0.55; }
.attachment-preview-file-icon { flex: 0 0 auto; opacity: 0.8; }
.attachment-preview-file-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-preview-file-remove {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.attachment-preview-file-remove:hover { color: #e03131; }

.attachment-progress {
    height: 3px;
    background: #e9ecef;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.attachment-progress-bar {
    height: 100%;
    background: #228be6;
    border-radius: 2px;
    transition: width 0.2s;
}

/* ===== Timezone badge in conversation list ===== */
.conversation-tz-badge {
    font-size: 11px;
    color: #868e96;
    flex-shrink: 0;
}

.conversation-mute-btn {
    background: none;
    border: none;
    padding: 2px;
    margin-left: 2px;
    color: #c0c0c0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.conversation-item:hover .conversation-mute-btn { opacity: 0.7; }
.conversation-mute-btn:hover { opacity: 1; background: rgba(0,0,0,0.06); }
.conversation-mute-btn.active { opacity: 1; color: #adb5bd; }
.conversation-item.muted .conversation-name,
.conversation-item.muted .conversation-preview,
.conversation-item.muted .conversation-tz-badge { opacity: 0.55; }
.conversation-item.muted .conversation-unread-badge { display: none; }

/* ===== Chat partner timezone (header) ===== */
.chat-partner-tz {
    font-size: 12px;
    color: #868e96;
    margin-top: 2px;
}

/* ===== Mutual Availability Panel ===== */
.availability-panel {
    margin-top: 6px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}
.chat-modal.dark .availability-panel {
    background: #1e1e1e;
    border-color: #333;
}
.availability-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}
.availability-panel-title {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}
.chat-modal.dark .availability-panel-title { color: #ccc; }
.availability-hours-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #868e96;
}
.availability-hours-selector select {
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    color: #495057;
    cursor: pointer;
}
.chat-modal.dark .availability-hours-selector select {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}
.availability-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.avail-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.avail-label {
    font-size: 11px;
    color: #495057;
    width: 50px;
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-modal.dark .avail-label { color: #aaa; }
.avail-bar-wrap {
    flex: 1;
    height: 22px;
    background: #e9ecef;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
}
.chat-modal.dark .avail-bar-wrap { background: #2a2a2a; }
.avail-hour-cell {
    flex: 1;
    height: 100%;
    border-right: 1px solid rgba(0,0,0,0.06);
    position: relative;
    transition: background 0.2s;
}
.avail-hour-cell:last-child { border-right: none; }
.avail-hour-cell.active {
    background: #b2f2bb;
}
.avail-hour-cell.sleep {
    background: #e9ecef;
}
.chat-modal.dark .avail-hour-cell.sleep { background: #2a2a2a; }
.chat-modal.dark .avail-hour-cell.active { background: #2b8a3e; }
.avail-hour-cell.now {
    box-shadow: inset 0 0 0 2px #fa5252;
}
.avail-hour-cell .avail-hour-tip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}
.avail-hour-cell:hover .avail-hour-tip { display: block; }

/* Overlap row */
.avail-hour-cell.overlap {
    background: #FBE43E;
}
.chat-modal.dark .avail-hour-cell.overlap { background: #c59f00; }

/* Hour labels row */
.avail-hours-labels {
    display: flex;
    gap: 0;
    margin-left: 58px;
    margin-top: 2px;
}
.avail-hours-labels span {
    flex: 1;
    font-size: 9px;
    color: #adb5bd;
    text-align: center;
}

.availability-overlap {
    margin-top: 8px;
    font-size: 12px;
    color: #495057;
    text-align: center;
}
.chat-modal.dark .availability-overlap { color: #aaa; }
.availability-overlap .overlap-good {
    color: #2b8a3e;
    font-weight: 600;
}
.chat-modal.dark .availability-overlap .overlap-good { color: #69db7c; }
.availability-overlap .overlap-bad {
    color: #e03131;
    font-weight: 600;
}

/* ===== Message Templates ===== */
.template-modal {
    max-width: 420px;
}
.tpl-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}
.tpl-empty {
    text-align: center;
    color: #868e96;
    font-size: 13px;
    padding: 24px 16px;
}
.tpl-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.1s;
}
.tpl-item:hover {
    background: #f8f9fa;
}
.tpl-item:last-child {
    border-bottom: none;
}
.tpl-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.tpl-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #111;
}
.tpl-item-preview {
    font-size: 12px;
    color: #868e96;
    line-height: 1.4;
}
.tpl-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.tpl-item:hover .tpl-item-actions {
    opacity: 1;
}
.tpl-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #868e96;
    padding: 2px 6px;
    border-radius: 4px;
}
.tpl-action-btn:hover {
    background: #e9ecef;
    color: #111;
}
.tpl-action-del:hover {
    background: #ffe3e3;
    color: #e03131;
}
.tpl-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    transition: all 0.15s;
}
.tpl-add-btn:hover {
    background: #f1f3f5;
    border-color: #111;
}
.tpl-form {
    padding: 16px 20px;
    border-top: 1px solid #f1f3f5;
}

/* Dark mode templates */
.chat-modal.dark .tpl-item:hover { background: #252525; }
.chat-modal.dark .tpl-item-title { color: #eee; }
.chat-modal.dark .tpl-item-preview { color: #888; }
.chat-modal.dark .tpl-item { border-color: #333; }
.chat-modal.dark .tpl-action-btn:hover { background: #333; color: #ccc; }
.chat-modal.dark .tpl-form { border-color: #333; }

/* ===== Deck Viewer (PDF / Figma / Slides) ===== */
.deck-viewer {
    margin-top: 6px;
    width: 100%;
    max-width: 320px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
}
.chat-item.mine .deck-viewer {
    margin-right: 0;
    margin-left: auto;
}
.deck-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f1f3f5;
    border-bottom: 1px solid #e9ecef;
}
.deck-viewer-title {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}
.deck-viewer-download {
    font-size: 14px;
    color: #868e96;
    text-decoration: none;
    font-weight: 700;
}
.deck-viewer-download:hover {
    color: #111;
}
.deck-viewer-canvas-wrap {
    width: 100%;
    background: #fff;
    display: flex;
    justify-content: center;
    min-height: 180px;
    position: relative;
}
.deck-viewer-canvas {
    width: 100%;
    display: block;
}
.deck-viewer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-top: 1px solid #e9ecef;
}
.deck-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    transition: all 0.15s;
}
.deck-nav-btn:hover {
    background: #f1f3f5;
    border-color: #adb5bd;
}
.deck-page-info {
    font-size: 12px;
    color: #868e96;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}
.deck-error {
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: #e03131;
}

/* Figma / Google Slides embed */
.deck-iframe-wrap {
    position: relative;
    min-height: 60px;
}
.deck-iframe-loading {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: #adb5bd;
}
.deck-embed-iframe {
    width: 100%;
    height: 220px;
    border: none;
    background: #f8f9fa;
}
.deck-iframe-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.chat-modal.dark .deck-embed-iframe {
    background: #2a2a2a;
}
.chat-modal.dark .deck-iframe-loading {
    color: #666;
}
.deck-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: #f8f9fa;
    margin-top: 6px;
    max-width: 280px;
}
.deck-card-icon {
    font-size: 28px;
    flex-shrink: 0;
}
.deck-card-body {
    flex: 1;
    min-width: 0;
}
.deck-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 6px;
}
.deck-card-actions {
    display: flex;
    gap: 6px;
}
.deck-card-btn {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.deck-card-btn:hover {
    background: #e9ecef;
}
.deck-card.expanded {
    flex-wrap: wrap;
}
.deck-card .deck-embed-iframe {
    width: 100%;
    height: 200px;
    border: none;
    border-radius: 8px;
    margin-top: 8px;
    flex-basis: 100%;
}
.chat-modal.dark .deck-card {
    border-color: #333;
    background: #1e1e1e;
}
.chat-modal.dark .deck-card-title {
    color: #e0e0e0;
}
.chat-modal.dark .deck-card-btn {
    border-color: #444;
    background: #2a2a2a;
    color: #ccc;
}
.chat-modal.dark .deck-card-btn:hover {
    background: #333;
}
.deck-embed-fallback {
    padding: 20px;
    text-align: center;
    font-size: 13px;
}
.deck-embed-fallback a {
    color: #228be6;
    text-decoration: none;
    font-weight: 600;
}
.deck-embed-fallback a:hover {
    text-decoration: underline;
}

/* Dark mode */
.chat-modal.dark .deck-viewer {
    border-color: #333;
    background: #1e1e1e;
}
.chat-modal.dark .deck-viewer-header {
    background: #252525;
    border-color: #333;
}
.chat-modal.dark .deck-viewer-title { color: #ccc; }
.chat-modal.dark .deck-viewer-canvas-wrap { background: #1a1a1a; }
.chat-modal.dark .deck-viewer-controls { border-color: #333; }
.chat-modal.dark .deck-nav-btn {
    border-color: #444;
    background: #252525;
    color: #ccc;
}
.chat-modal.dark .deck-nav-btn:hover { background: #333; }

/* ===== Poll Card ===== */
.poll-card {
    margin-top: 6px;
    width: 100%;
    max-width: 300px;
}
.chat-item.mine .poll-card {
    margin-left: auto;
}
.poll-card-loading {
    font-size: 12px;
    color: #868e96;
    padding: 8px 0;
}
.poll-card-question {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}
.chat-modal.dark .poll-card-question { color: #eee; }
.poll-card-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.poll-vote-option {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    text-align: left;
    overflow: hidden;
    transition: border-color 0.15s;
}
.poll-vote-option:hover:not([disabled]) {
    border-color: #adb5bd;
}
.poll-vote-option.voted {
    border-color: #FBE43E;
    background: #fffde0;
}
.poll-vote-option[disabled] {
    cursor: default;
    opacity: 0.8;
}
.poll-vote-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #f1f3f5;
    border-radius: 8px;
    transition: width 0.4s ease;
    z-index: 0;
}
.poll-vote-option.voted .poll-vote-bar {
    background: #fff3bf;
}
.poll-vote-text {
    position: relative;
    z-index: 1;
    flex: 1;
}
.poll-vote-pct {
    position: relative;
    z-index: 1;
    font-size: 12px;
    font-weight: 600;
    color: #868e96;
    margin-left: 8px;
}
.poll-vote-count {
    position: relative;
    z-index: 1;
    font-size: 11px;
    color: #adb5bd;
    margin-left: 4px;
}
.poll-card-footer {
    font-size: 11px;
    color: #868e96;
    margin-top: 6px;
}

/* Poll Creator Modal */
.poll-modal {
    max-width: 400px;
}
.poll-form {
    padding: 20px;
}
.poll-field {
    margin-bottom: 14px;
}
.poll-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}
.poll-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}
.poll-field input:focus {
    border-color: #111;
}
.poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.poll-option-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.poll-option-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}
.poll-option-input:focus {
    border-color: #111;
}
.poll-option-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: #adb5bd;
    cursor: pointer;
    padding: 4px;
}
.poll-option-remove:hover {
    color: #e03131;
}
.poll-add-option {
    background: none;
    border: none;
    font-size: 13px;
    color: #868e96;
    cursor: pointer;
    padding: 6px 0;
    margin-bottom: 10px;
}
.poll-add-option:hover {
    color: #111;
}
.poll-multi-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #495057;
    margin-bottom: 14px;
    cursor: pointer;
}

/* Dark mode poll */
.chat-modal.dark .poll-vote-option {
    border-color: #333;
    background: #1e1e1e;
    color: #ccc;
}
.chat-modal.dark .poll-vote-option.voted {
    border-color: #8a7a00;
    background: #2a2500;
}
.chat-modal.dark .poll-vote-bar {
    background: #2a2a2a;
}
.chat-modal.dark .poll-vote-option.voted .poll-vote-bar {
    background: #3a3000;
}

/* ===== Plus Menu (chat input) ===== */
.chat-plus-wrap {
    position: relative;
}
.chat-plus-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #868e96;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.chat-plus-btn:hover {
    background: #f1f3f5;
    color: #495057;
}
.chat-plus-btn .material-symbols-outlined {
    font-size: 22px;
    width: auto;
    height: auto;
    line-height: 1;
    color: #D3D3D3;
    font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 24;
}
.chat-plus-btn[title="More"] .material-symbols-outlined {
    font-size: 31px;
    width: auto;
    height: auto;
    line-height: 1;
}
.chat-plus-btn[title="파일 첨부"] .material-symbols-outlined {
    font-size: 21.5px;
}
.chat-plus-btn[title="파일 첨부"] {
    position: relative;
    left: -3px;
}
.chat-help-btn {
    position: relative;
    left: 1px;
}
.chat-modal.dark .chat-plus-btn { color: #666; }
.chat-modal.dark .chat-plus-btn:hover { background: #2a2a2a; color: #ccc; }

.chat-plus-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    min-width: 160px;
    padding: 4px 0;
    z-index: 100;
    animation: plusMenuIn 0.12s ease;
}
@keyframes plusMenuIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-plus-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    font-size: 13px;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}
.chat-plus-item:hover {
    background: #f8f9fa;
}
.chat-modal.dark .chat-plus-menu {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.chat-modal.dark .chat-plus-item { color: #ccc; }
.chat-modal.dark .chat-plus-item:hover { background: #2a2a2a; }
html.dark-mode .chat-plus-menu { background: #1e1e1e; border-color: #333; }
html.dark-mode .chat-plus-item { color: #ccc; }
html.dark-mode .chat-plus-item:hover { background: #2a2a2a; }

/* ===== Message Reactions ===== */
.reaction-add-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    opacity: 0;
    transition: opacity 0.15s;
    color: #adb5bd;
    flex-shrink: 0;
}
.chat-bubble-wrap:hover .reaction-add-btn {
    opacity: 1;
}
.reaction-add-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.reaction-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
    min-height: 0;
}
.chat-item.mine .reaction-row {
    justify-content: flex-end;
}

.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    line-height: 1.4;
}
.reaction-chip:hover {
    border-color: #adb5bd;
    background: #e9ecef;
}
.reaction-chip.mine {
    border-color: #FBE43E;
    background: #fffde0;
}
.reaction-chip.mine:hover {
    background: #fff9b0;
}
.reaction-emoji {
    font-size: 14px;
}
.reaction-count {
    font-size: 11px;
    color: #868e96;
    font-weight: 600;
}

/* Reaction Picker */
.reaction-picker {
    position: fixed;
    z-index: 10000;
    display: flex;
    gap: 2px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 24px;
    padding: 4px 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    animation: rpFadeIn 0.15s ease;
}
@keyframes rpFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.reaction-picker-emoji {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background 0.1s, transform 0.1s;
    line-height: 1;
}
.reaction-picker-emoji:hover {
    background: #f1f3f5;
    transform: scale(1.25);
}

/* Dark mode */
.chat-modal.dark .reaction-chip {
    border-color: #333;
    background: #252525;
}
.chat-modal.dark .reaction-chip:hover {
    border-color: #555;
    background: #333;
}
.chat-modal.dark .reaction-chip.mine {
    border-color: #8a7a00;
    background: #2a2500;
}
.chat-modal.dark .reaction-chip.mine:hover {
    background: #3a3500;
}
.chat-modal.dark .reaction-count {
    color: #888;
}
.chat-modal.dark .reaction-add-btn {
    color: #666;
}
html.dark-mode .reaction-picker {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
html.dark-mode .reaction-picker-emoji:hover {
    background: #333;
}
html.dark-mode .reaction-chip {
    border-color: #333;
    background: #252525;
}
html.dark-mode .reaction-chip.mine {
    border-color: #8a7a00;
    background: #2a2500;
}

/* ===== Mutual Info Card ===== */
.mutual-info-card {
    margin: 0 16px 4px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}
.chat-modal.dark .mutual-info-card {
    background: #1e1e1e;
    border-color: #333;
}
.mutual-info-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.mutual-info-toggle:hover {
    background: #f1f3f5;
}
.chat-modal.dark .mutual-info-toggle:hover { background: #252525; }
.mutual-info-icon {
    font-size: 14px;
    flex-shrink: 0;
}
.mutual-info-summary {
    font-size: 12px;
    color: #495057;
    flex: 1;
}
.chat-modal.dark .mutual-info-summary { color: #ccc; }
.mutual-info-chevron {
    color: #868e96;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.mutual-info-chevron.expanded {
    transform: rotate(180deg);
}
.mutual-info-detail {
    padding: 0 14px 12px;
}
.mutual-info-section {
    margin-bottom: 10px;
}
.mutual-info-section:last-child { margin-bottom: 0; }
.mutual-info-label {
    font-size: 11px;
    font-weight: 600;
    color: #868e96;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.chat-modal.dark .mutual-info-label { color: #666; }
.mutual-info-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.mutual-info-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    border-radius: 12px;
    background: #e9ecef;
    color: #495057;
}
.chat-modal.dark .mutual-info-chip {
    background: #2a2a2a;
    color: #ccc;
}
.mutual-info-chip.interest { background: #fff3bf; color: #866a00; }
.mutual-info-chip.skill { background: #d3f9d8; color: #2b6e2b; }
.mutual-info-chip.tech { background: #d0ebff; color: #1864ab; }
.mutual-info-chip.help { background: #ffe3e3; color: #c92a2a; }
.chat-modal.dark .mutual-info-chip.interest { background: #3d3000; color: #ffd43b; }
.chat-modal.dark .mutual-info-chip.skill { background: #003d00; color: #69db7c; }
.chat-modal.dark .mutual-info-chip.tech { background: #00264d; color: #74c0fc; }
.chat-modal.dark .mutual-info-chip.help { background: #3d0000; color: #ff8787; }

.mutual-info-person {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    background: #e9ecef;
    border-radius: 16px;
    font-size: 11px;
    color: #495057;
}
.chat-modal.dark .mutual-info-person { background: #2a2a2a; color: #ccc; }
.mutual-info-person-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dee2e6;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.mutual-info-projects {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mutual-info-project {
    padding: 6px 10px;
    background: #e9ecef;
    border-radius: 8px;
    font-size: 11px;
}
.chat-modal.dark .mutual-info-project { background: #2a2a2a; }
.mutual-info-project-name {
    font-weight: 600;
    color: #333;
}
.chat-modal.dark .mutual-info-project-name { color: #ddd; }
.mutual-info-project-tagline {
    color: #868e96;
    margin-top: 1px;
}
.mutual-info-roles {
    font-size: 12px;
    color: #495057;
    line-height: 1.6;
}
.chat-modal.dark .mutual-info-roles { color: #aaa; }
.mutual-info-roles .role-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #f1f3f5;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.chat-modal.dark .mutual-info-roles .role-tag { background: #2a2a2a; color: #ccc; }
.mutual-info-empty {
    font-size: 12px;
    color: #adb5bd;
    text-align: center;
    padding: 8px 0;
}

/* ===== Compose: Search Dropdown ===== */
.compose-search-wrap {
    position: relative;
}

.compose-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #e9ecef;
    flex-shrink: 0;
}

.search-result-body {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.search-result-realname {
    font-weight: 400;
    color: #868e96;
    font-size: 12px;
}

.search-result-role {
    font-size: 11px;
    color: #868e96;
    margin-top: 1px;
}

.search-result-tz {
    font-size: 11px;
    color: #228be6;
    margin-top: 2px;
}

.search-result-empty {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #adb5bd;
}

/* ===== Compose: Selected User Card ===== */
.compose-selected-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f0f7ff;
    border-radius: 8px;
    border: 1px solid #d0ebff;
}

.compose-selected-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #e9ecef;
    flex-shrink: 0;
}

.compose-selected-info {
    flex: 1;
    min-width: 0;
}

.compose-selected-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.compose-selected-role {
    font-size: 11px;
    color: #868e96;
    margin-top: 1px;
}

.compose-selected-tz {
    font-size: 11px;
    color: #228be6;
    margin-top: 2px;
}

.compose-selected-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: #adb5bd;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.compose-selected-remove:hover {
    color: #e03131;
}

/* Dark mode */
html.dark-mode .conversation-item:hover { background: #2c2c2c; }
html.dark-mode .conversation-item.unread { background: #1a1a2e; }
html.dark-mode .conversation-name { color: #ccc; }
html.dark-mode .conversation-item.unread .conversation-name { color: #fff; }
html.dark-mode .conversation-preview { color: #888; }
html.dark-mode .chat-modal { background: #1e1e1e; }
html.dark-mode .chat-modal-header { border-color: #333; }
html.dark-mode .chat-bubble { background: #2c2c2c; color: #ccc; }
html.dark-mode .chat-item.mine .chat-bubble { background: var(--chat-mine-bg, #1a3a5c); color: #7db8e8; }
html.dark-mode .chat-input-container { background: #2c2c2c; }
html.dark-mode .chat-input { color: #ccc; }
html.dark-mode .chat-notice { background: #252525; border-color: #333; }
html.dark-mode .compose-btn { background: #eee; color: #222; }
html.dark-mode .compose-search-results { background: #1e1e1e; border-color: #333; }
html.dark-mode .search-result-item:hover { background: #2c2c2c; }
html.dark-mode .search-result-name { color: #ccc; }
html.dark-mode .compose-selected-card { background: #1a2a3a; border-color: #2a4a6a; }
html.dark-mode .compose-selected-name { color: #ccc; }
html.dark-mode .chat-partner-tz { color: #888; }
html.dark-mode .availability-panel { background: #1a1a1a; border-color: #333; }
html.dark-mode .availability-panel-title { color: #ccc; }
html.dark-mode .availability-overlap { color: #aaa; }
html.dark-mode .avail-label { color: #aaa; }
html.dark-mode .avail-bar-wrap { background: #2a2a2a; }
html.dark-mode .avail-hour-cell.sleep { background: #2a2a2a; }
html.dark-mode .avail-hour-cell.active { background: #2b8a3e; }
html.dark-mode .avail-hour-cell.overlap { background: #c59f00; }
html.dark-mode .availability-hours-selector select { background: #2a2a2a; border-color: #444; color: #ccc; }
html.dark-mode .mutual-info-card { background: #1a1a1a; border-color: #333; }
html.dark-mode .mutual-info-summary { color: #ccc; }
html.dark-mode .mutual-info-toggle:hover { background: #222; }
html.dark-mode .conversation-tz-badge { color: #666; }
html.dark-mode .my-status-btn { background: #2c2c2c; border-color: #444; color: #ccc; }
html.dark-mode .status-dropdown { background: #1e1e1e; border-color: #333; }
html.dark-mode .status-option { color: #ccc; }
html.dark-mode .status-option:hover { background: #2c2c2c; }
html.dark-mode .chat-translated { background: #1a2a3a; color: #7db8e8; }
html.dark-mode .translated-label { color: #4a7ab5; }
html.dark-mode .conversation-avatar-wrap .status-dot { border-color: #1e1e1e; }
html.dark-mode .chat-meta-translate:hover { background: #1a2a3a; }
html.dark-mode .link-preview-card { background: #2c2c2c; border-color: #444; }
html.dark-mode .link-preview-title { color: #ccc; }
html.dark-mode .link-preview-desc { color: #888; }
html.dark-mode .chat-attachment-file a { background: #2c2c2c; border-color: #444; color: #ccc; }
html.dark-mode .chat-attachment-file a:hover { background: #333; }
html.dark-mode .attachment-preview-card { background: #2c2c2c; color: #ccc; }
html.dark-mode .chat-attach-btn { color: #666; }
html.dark-mode .chat-attach-btn:hover { color: #228be6; }
html.dark-mode .schedule-field input { background: #2c2c2c; border-color: #444; color: #ccc; }
html.dark-mode .schedule-edit-content { background: #2c2c2c; border-color: #444; color: #ccc; }
html.dark-mode .schedule-cancel-btn { background: #2c2c2c; border-color: #444; color: #ccc; }
html.dark-mode .scheduled-edit-btn:hover { background: #1a2a3a; }
html.dark-mode .scheduled-delete-btn:hover { background: #2a1a1a; }
html.dark-mode .unsend-btn { background: #2c2c2c; border-color: #444; color: #e03131; }
html.dark-mode .intro-btn { border-color: #444; color: #888; }
html.dark-mode .intro-btn:hover { border-color: #228be6; background: #1a2a3a; color: #228be6; }
html.dark-mode .intro-card { background: linear-gradient(135deg, #2a2500 0%, #332d00 100%); border-color: #5a4d00; }
html.dark-mode .intro-card-title { color: #fab005; }
html.dark-mode .intro-card-msg { color: #aaa; }
html.dark-mode .intro-person-fixed { background: #2c2c2c; color: #ccc; }
html.dark-mode .intro-option { color: #ccc; }
html.dark-mode .intro-confirm-btn { background: #1971c2; }

/* Intro modal scoped dark mode */
.intro-modal.dark {
    background: #1e1e1e;
    color: #e0e0e0;
}
.intro-modal.dark .chat-modal-header {
    border-color: #333;
}
.intro-modal.dark .chat-modal-header h5 { color: #f0f0f0; }
.intro-modal.dark .chat-modal-close { color: #999; }
.intro-modal.dark .intro-form-section label { color: #aaa; }
.intro-modal.dark .intro-person-fixed {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}
.intro-modal.dark #introSearchInput {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}
.intro-modal.dark #introSearchInput::placeholder { color: #666; }
.intro-modal.dark .compose-search-results {
    background: #2a2a2a;
    border-color: #444;
}
.intro-modal.dark .search-result-item:hover { background: #333; }
.intro-modal.dark .search-result-name { color: #e0e0e0; }
.intro-modal.dark .search-result-role { color: #888; }
.intro-modal.dark .compose-selected-card {
    background: #2a2a2a;
    border-color: #444;
}
.intro-modal.dark .compose-selected-name { color: #e0e0e0; }
.intro-modal.dark .compose-selected-role { color: #888; }
.intro-modal.dark #introMessage {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}
.intro-modal.dark #introMessage::placeholder { color: #666; }
.intro-modal.dark .intro-option { color: #ccc; }
.intro-modal.dark .intro-option-hint { color: #777; }
.intro-modal.dark .schedule-actions { border-color: #333; }
.intro-modal.dark .schedule-cancel-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}
.intro-modal.dark .schedule-cancel-btn:hover { background: #333; }
.intro-modal.dark .intro-confirm-btn {
    background: #FBE43E;
    color: #000;
}
.intro-modal.dark .intro-confirm-btn:hover { background: #e8d235; }

@media (max-width: 576px) {
    .messages-container { padding: 16px 8px; }
    .chat-modal {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
}

/* 모바일: 채팅 팝업을 전체 화면으로 표시 (팝업 대신 페이지처럼 동작) */
@media (max-width: 768px) {
    .chat-popup-wrap {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 10000 !important;
        filter: none !important;
    }
    .chat-popup-wrap .chat-modal {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
    }
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 3.125rem;
    padding: 0 1.5625rem;
    background-color: #000;
    border: 1px solid #000;
    border-radius: 0;
    color: #f9f9f9;
    font-family: Helvetica, "Apple SD Gothic Neo", Arial, "Malgun Gothic", sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04375rem;
    line-height: 1.5;
    text-align: center;
    text-transform: lowercase;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.btn-comment-submit {
    width: 180px;
    height: 43.5px;
    font-size: 13px;
    font-weight: 600;
}

/* Confirm Modal */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
.confirm-overlay.active {
    display: flex !important;
    z-index: 2147483647 !important;
}
.confirm-modal {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px 20px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.confirm-modal p {
    margin: 0 0 20px;
    font-size: 14px;
    color: #000;
    line-height: 1.5;
}
.confirm-actions {
    display: flex;
    gap: 10px;
}
.confirm-cancel-btn, .confirm-ok-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.confirm-cancel-btn {
    background: #fff;
    color: #000;
    border: 1px solid #000;
}
.confirm-cancel-btn:hover {
    background: #f5f5f5;
}
.confirm-ok-btn {
    background: #000;
    color: #fff;
}
.confirm-ok-btn:hover {
    background: #333;
}
html.dark-mode .confirm-modal { background: #1e1e1e; }
html.dark-mode .confirm-modal p { color: #ddd; }
html.dark-mode .confirm-cancel-btn { background: #333; color: #ccc; }
html.dark-mode .confirm-cancel-btn:hover { background: #444; }
html.dark-mode .confirm-ok-btn { background: #e03131; }

/* Delete-me Confirm Modal */
.dm-confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2100;
    justify-content: center;
    align-items: center;
}
.dm-confirm-overlay.active { display: flex; }
.dm-confirm-modal {
    background: #2a2a2a;
    border-radius: 16px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.dm-confirm-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}
.dm-confirm-desc {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 20px;
    line-height: 1.4;
}
.dm-confirm-actions {
    display: flex;
    gap: 10px;
}
.dm-confirm-cancel, .dm-confirm-ok {
    flex: 1;
    padding: 12px 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}
.dm-confirm-cancel {
    background: transparent;
    color: #fff;
    border: 1px solid #555;
}
.dm-confirm-cancel:hover { background: #333; }
.dm-confirm-ok {
    background: #FBE43E;
    color: #000;
}
.dm-confirm-ok:hover { background: #f5d900; }

/* Chat Bubble Context Menu */
.chat-context-menu {
    position: fixed;
    width: 118px;
    background: #000;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    z-index: 10000;
    padding: 2px 1.5px;
    box-sizing: border-box;
}
.chat-context-item {
    display: flex;
    align-items: center;
    width: 115px;
    height: 30px;
    padding: 0 14px;
    margin: 0 auto;
    background: none;
    border: none;
    color: #fff;
    font-family: 'Pretendard', sans-serif;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    border-radius: 6px;
}
.chat-context-item:hover { background: rgba(255,255,255,0.08); }
.chat-context-item[data-action="capture-all"] { font-size: 12.5px; }
.chat-context-divider {
    height: 1px;
    background: rgba(255,255,255,0.12);
    margin: 4px 8px;
}

/* Inline comment thread under message */
.chat-bubble-comments {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 273px;
    width: 100%;
    box-sizing: border-box;
    align-self: flex-start;
}
.chat-item.mine .chat-bubble-comments { align-self: flex-end; }

.yt-comment {
    display: flex;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}
.yt-comment-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #555;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.yt-comment-main {
    flex: 1;
    min-width: 0;
}
.yt-comment-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}
.yt-comment-actions {
    display: inline-flex;
    gap: 2px;
    margin-left: auto;
}
.yt-comment-icon {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
}
.yt-comment-icon:hover { background: rgba(255,255,255,0.08); color: #fff; }
.yt-comment-edit-input {
    width: 70%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 4px 8px;
    color: #fff;
    font-size: 13px;
    font-family: 'Pretendard', sans-serif;
    outline: none;
    margin-right: 4px;
}
.yt-comment-edit-save, .yt-comment-edit-cancel {
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    color: #ddd;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 2px;
}
.yt-comment-edit-save { background: #FBE43E; color: #000; border-color: transparent; font-weight: 600; }
.yt-comment-edit-cancel:hover { background: rgba(255,255,255,0.08); }
.yt-comment-author {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.yt-comment-time {
    color: #999;
    font-size: 11px;
    white-space: nowrap;
}
.yt-comment-content {
    color: #ddd;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    white-space: pre-wrap;
}
.yt-thread {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}
/* 1. 컨테이너: 여백만, border 강제 제거 */
.yt-thread-replies {
    position: relative;
    margin-left: 18px;
    padding-left: 20px;
    box-sizing: border-box;
    border-left: none !important;
}

.yt-thread-replies .yt-comment.is-reply {
    position: relative;
    margin-top: 15px;
}

/* 2. ::before 하나가 수직 직선 + L자 곡선 통합 — top: -60으로 이전 댓글과 강제 중첩 */
.yt-thread-replies .yt-comment.is-reply::before {
    content: '';
    position: absolute;
    left: -20px;
    top: -60px;
    width: 20px;
    height: 78px;
    border-left: 2px solid rgba(255,255,255,0.15);
    border-bottom: 2px solid rgba(255,255,255,0.15);
    border-bottom-left-radius: 12px;
    pointer-events: none;
    z-index: 1;
    transition: border-color 0.18s ease, filter 0.18s ease;
}

/* 3. 첫 답글: 부모 아바타 바로 밑까지만 */
.yt-thread-replies .yt-comment.is-reply:first-child::before {
    top: -25px;
    height: 43px;
}

.yt-thread:hover .yt-comment.is-reply::before {
    border-left-color: #fff;
    border-bottom-color: #fff;
    filter: brightness(1.3);
}
.yt-comment {
    display: flex;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}
.yt-comment-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}
.yt-comment-reply {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 14px;
}
.yt-comment-reply:hover { background: rgba(255,255,255,0.08); color: #fff; }
.yt-comment.is-reply .yt-comment-avatar {
    width: 24px;
    height: 24px;
    font-size: 11px;
}
.chat-bubble-comment {
    background: rgba(255,255,255,0.06);
    color: #ddd;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 10px;
    max-width: 80%;
    word-break: break-word;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.chat-bubble-comment-delete {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
}
.chat-bubble-comment-delete:hover { color: #fff; }
.chat-bubble-comment-form {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    padding-left: 12px;
    max-width: 273px;
    width: 100%;
    box-sizing: border-box;
    align-self: flex-start;
}
.chat-item.mine .chat-bubble-comment-form { align-self: flex-end; }
.chat-bubble-comment-input {
    flex: 1;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    border-radius: 0;
    padding: 5px 4px;
    color: #fff;
    font-size: 12px;
    font-family: 'Pretendard', sans-serif;
    outline: none;
}
.chat-bubble-comment-input:focus { border-bottom-color: #fff; }
.chat-bubble-comment-input::placeholder { color: #888; }
.chat-bubble-comment-submit {
    background: #FBE43E;
    color: #000;
    border: none;
    border-radius: 14px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* File Transfer Modal */
.file-transfer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2100;
    justify-content: center;
    align-items: center;
    padding: 16px;
}
.file-transfer-overlay.active { display: flex; }
.file-transfer-modal {
    background: #2c2c2e;
    border-radius: 18px;
    padding: 20px;
    width: 305px;
    height: 172px;
    box-sizing: border-box;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.file-transfer-title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 18px;
}
.file-transfer-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0 18px;
}
.file-transfer-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3a3a3c;
    border-radius: 8px;
}
.file-transfer-icon-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    padding: 3px 5px;
    border-radius: 3px;
    border: 1.5px solid currentColor;
}
.file-transfer-info {
    flex: 1;
    min-width: 0;
}
.file-transfer-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-transfer-size {
    color: #9a9a9e;
    font-size: 12px;
    margin-top: 3px;
}
.file-transfer-more-wrap {
    position: relative;
    flex-shrink: 0;
}
.file-transfer-more {
    background: none;
    border: none;
    color: #9a9a9e;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.file-transfer-more:hover { background: rgba(255,255,255,0.06); }
.file-transfer-more-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #3a3a3c;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    z-index: 10;
    padding: 0;
}
.file-transfer-more-menu button {
    width: 70px;
    height: 35px;
    padding: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Pretendard', sans-serif;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-transfer-more-menu button:hover { background: rgba(255,255,255,0.08); }
.file-transfer-actions {
    display: flex;
    gap: 8px;
}
.file-transfer-cancel {
    width: 125px;
    height: 30px;
    padding: 0;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.28);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}
.file-transfer-cancel:hover { background: rgba(255,255,255,0.06); }
.file-transfer-send {
    width: 125px;
    height: 30px;
    padding: 0;
    border-radius: 10px;
    background: #fee500;
    color: #000;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
}
.file-transfer-send:hover { background: #ffd900; }
.file-transfer-send:disabled { opacity: 0.65; cursor: default; }
.file-transfer-send-divider {
    width: 1px;
    height: 14px;
    background: rgba(0,0,0,0.25);
}

/* Reject modal (unsupported / folder bundle / oversize) */
.file-reject-modal { height: auto; max-height: 80vh; display: flex; flex-direction: column; }
.file-reject-summary { color: #9a9a9e; font-size: 12px; margin-bottom: 12px; }
.file-reject-list { max-height: 260px; overflow-y: auto; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.file-reject-row { display: flex; align-items: center; gap: 12px; }
.file-reject-fileicon {
    width: 46px; height: 46px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #4a4a4c; border-radius: 8px;
}
.file-reject-info { flex: 1; min-width: 0; }
.file-reject-name {
    color: #ff6b4a; font-size: 14px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
}
.file-reject-warn { color: #ff4a3a; font-size: 14px; }
.file-reject-reason { color: #9a9a9e; font-size: 12px; margin-top: 3px; }
.file-reject-actions { justify-content: stretch; }
.file-reject-ok { width: 100%; height: 38px; }

/* Chat dark mode toggle button */
.chat-dark-toggle {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 5px 7px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
}
.chat-dark-toggle:hover { background: #f1f3f5; }
.chat-modal.dark .chat-dark-toggle { border-color: #555; color: #ffd43b; }
.chat-modal.dark .chat-dark-toggle:hover { background: #333; }

/* Chat modal scoped dark mode */
.chat-modal.dark {
    background: var(--chat-bg, #202020);
    color: #e0e0e0;
}
.chat-modal.dark .chat-modal-header {
    background: var(--chat-bg, #151515);
    border-bottom-color: #333;
}
.chat-modal.dark .chat-modal-header h5 { color: #f0f0f0; }
.chat-modal.dark .chat-partner-tz { color: #999; }
.chat-modal.dark .chat-modal-close { color: #999; }
.chat-modal.dark .chat-modal-close:hover { color: #fff; }
.chat-modal.dark .intro-btn { color: #999; border-color: #555; }
.chat-modal.dark .intro-btn:hover { background: #333; }
.chat-modal.dark .chat-notice {
    background: #222;
    color: #888;
    border-color: #333;
}
.chat-modal.dark .chat-body {
    background: var(--chat-body-bg, #151515);
}
.chat-modal.dark .chat-body::-webkit-scrollbar {
    width: 6px;
}
.chat-modal.dark .chat-body::-webkit-scrollbar-track {
    background: transparent;
}
.chat-modal.dark .chat-body::-webkit-scrollbar-thumb {
    background: #9A9A9A;
    border-radius: 3px;
}
.chat-modal.dark .chat-body::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}
.chat-modal.dark .chat-bubble {
    background: var(--chat-other-bg, #2a2a2a);
    color: #e0e0e0;
}
.chat-modal.dark .chat-item.mine .chat-bubble {
    background: var(--chat-mine-bg, #1a3a5c);
    color: #e0e0e0;
}
.chat-modal.dark .chat-meta-time { color: #777; }
.chat-modal.dark .chat-meta-read { color: #4dabf7; }
.chat-modal.dark .chat-meta-translate { color: #777; }
.chat-modal.dark .chat-meta-translate:hover { color: #aaa; }
.chat-modal.dark .chat-meta-translate.active { color: #4dabf7; }
.chat-modal.dark .chat-meta-report { color: #666; }
.chat-modal.dark .chat-translated {
    background: #353535;
    color: #bbb;
    border-color: #444;
}
.chat-modal.dark .chat-footer {
    background: var(--chat-bg, #151515);
    border-top-color: #333;
}
.chat-modal.dark .chat-input-container {
    background: var(--chat-input-bg, #212222);
}
.chat-modal.dark .chat-input {
    background: transparent;
    color: #e0e0e0;
    border-color: #444;
}
.chat-modal.dark .chat-input::placeholder { color: #666; }
.chat-modal.dark .chat-attach-btn,
.chat-modal.dark .chat-schedule-btn { color: #888; }
.chat-modal.dark .chat-attach-btn:hover,
.chat-modal.dark .chat-schedule-btn:hover { color: #ccc; background: #333; }
.chat-modal.dark .chat-send-btn,
.chat-modal.dark .chat-send-btn.active {
    background: var(--chat-send-bg, #FBE43E) !important;
    color: var(--chat-send-color, #000) !important;
}
.chat-modal.dark .unsend-btn {
    background: var(--chat-other-bg, #2a2a2a);
    border-color: #444;
    color: var(--chat-unsend-color, #FBE43E);
}
.chat-modal.dark .chat-sender-name { color: #ccc; }
.chat-modal.dark .chat-mine-read { color: #666666; }
.chat-modal.dark .chat-mine-unread { color: #666666; }
.chat-modal.dark .chat-mine-time { color: #D0D0D0; }
.chat-modal.dark .chat-item.mine .system-bubble {
    background: var(--chat-system-bg, #2D2D2D);
}
.chat-modal.dark .chat-item.mine .chat-bubble:not(.system-bubble) {
    background: var(--chat-mine-bg, #FBE43E);
    color: var(--chat-mine-color, #151305);
}
.chat-modal.dark .chat-item:not(.mine) .chat-bubble {
    background: var(--chat-other-bg, #353535);
    color: #FFFFFF;
}
.chat-modal.dark .intro-card {
    background: #222;
    border-color: #333;
    color: #ccc;
}
.chat-modal.dark .chat-attachment-preview { background: #222; border-color: #333; }
.chat-modal.dark .availability-badge { opacity: 0.9; }
.chat-modal.dark .link-preview-card {
    background: #222;
    border-color: #333;
}
.chat-modal.dark .link-preview-title { color: #ddd; }
.chat-modal.dark .link-preview-desc { color: #999; }
.chat-modal.dark .link-preview-site { color: #777; }

/* Chat settings button & panel */
.chat-settings-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 5px 7px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    position: relative;
}
.chat-settings-btn:hover { background: #f1f3f5; }
.chat-modal.dark .chat-settings-btn { border-color: #555; color: #aaa; }
.chat-modal.dark .chat-settings-btn:hover { background: #333; }

.chat-settings-panel {
    display: none;
    position: absolute;
    top: 52px;
    right: 40px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    z-index: 20;
    min-width: 180px;
}
.chat-settings-panel.active { display: block; }
.chat-modal.dark .chat-settings-panel {
    background: #222;
    border-color: #444;
}
.chat-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.chat-settings-title {
    font-size: 12px;
    font-weight: 700;
    color: #333;
}
.chat-settings-close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
}
.chat-settings-close:hover { background: #f1f3f5; color: #333; }
.chat-modal.dark .chat-settings-title { color: #ddd; }
.chat-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.chat-settings-row label {
    font-size: 12px;
    color: #555;
}
.chat-modal.dark .chat-settings-row label { color: #aaa; }
.chat-settings-row input[type=color] {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1px;
    cursor: pointer;
    background: none;
}
.chat-settings-reset {
    width: 100%;
    margin-top: 6px;
    padding: 6px 0;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: none;
    font-size: 11px;
    color: #888;
    cursor: pointer;
}
.chat-settings-reset:hover { background: #f5f5f5; }
.chat-modal.dark .chat-settings-reset { border-color: #444; color: #888; }
.chat-modal.dark .chat-settings-reset:hover { background: #333; }

/* ===== Chat Help Modal ===== */
.chat-help-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    border-radius: inherit;
}
.chat-help-overlay.active {
    display: flex;
}
.chat-help-modal {
    width: 480px;
    max-height: 581px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 14px;
    padding: 28px 24px 20px;
    position: relative;
    overflow-y: auto;
    color: #e0e0e0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.chat-help-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
}
.chat-help-close:hover {
    background: #333;
    color: #fff;
}
.chat-help-title {
    margin: 0 0 18px 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}
.chat-help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.chat-help-table thead th {
    text-align: left;
    padding: 10px 12px;
    background: #252525;
    color: #aaa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333;
}
.chat-help-table thead th:first-child {
    border-radius: 8px 0 0 0;
    width: 40%;
}
.chat-help-table thead th:last-child {
    border-radius: 0 8px 0 0;
}
.chat-help-table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid #2a2a2a;
    vertical-align: middle;
}
.chat-help-table tbody tr:last-child td {
    border-bottom: none;
}
.chat-help-table tbody tr:hover {
    background: #222;
}
.chat-help-cmd {
    display: inline-block;
    font-weight: 600;
    color: #FBE43E;
    font-size: 13px;
}
/* Light mode overrides */
.chat-modal:not(.dark) .chat-help-modal {
    background: #fff;
    border-color: #e0e0e0;
    color: #333;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.chat-modal:not(.dark) .chat-help-title { color: #111; }
.chat-modal:not(.dark) .chat-help-close { color: #999; }
.chat-modal:not(.dark) .chat-help-close:hover { background: #f0f0f0; color: #333; }
.chat-modal:not(.dark) .chat-help-table thead th { background: #f5f5f5; color: #666; border-color: #e0e0e0; }
.chat-modal:not(.dark) .chat-help-table tbody td { border-color: #eee; }
.chat-modal:not(.dark) .chat-help-table tbody tr:hover { background: #f9f9f9; }
.chat-modal:not(.dark) .chat-help-cmd { color: #b8860b; }
.chat-modal:not(.dark) .chat-help-overlay { background: rgba(0,0,0,0.3); }
