.chat-wrap {
    width:100%;
    height:590px;
    border-radius:8px;
    overflow:hidden;
    margin-bottom:15px;
    background:#fff;
    border:1px solid #e5e5e5;
    display:flex;
    flex-direction:column;
    color:#222;
}

.chat-header {
    background:#f8f9fa;
    padding:8px 12px;
    font-weight:bold;
    display:flex;
    justify-content:space-between;
    align-items:center;
    color:#111;
    border-bottom:1px solid #e5e5e5;
}

.chat-right {
    display:flex;
    align-items:center;
    gap:10px;
}

.chat-users {
    font-size:13px;
    color:#333;
    display:flex;
    align-items:center;
}

.chat-box {
    flex:1;
    overflow-y:auto;
    padding:12px;
    background:#fff;
    -ms-overflow-style:none;
    scrollbar-width:none;
}

.chat-box::-webkit-scrollbar {
    display:none;
}

.msg {
    margin-bottom:10px;
    font-size:14px;
    color:#222;
}

.msg-row {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:8px;
}

.msg-main {
    min-width:0;
    flex:1;
    word-break:break-all;
    line-height:1.5;
    color:#222;
}

.msg-main img {
    width:22px;
    height:22px;
    vertical-align:middle;
    margin-right:6px;
    border-radius:4px;
}

.msg-meta-time {
    display:inline-block;
    margin-left:8px;
    font-size:11px;
    color:#888;
    vertical-align:middle;
    white-space:nowrap;
}

.msg.system .msg-meta-time {
    color:#c9a94a;
}

.nick {
    color:#111;
    font-weight:500;
}

.admin {
    color:#e53935;
    font-weight:700;
}

.msg.system {
    color:#d60000;
    font-weight:700;
}

.msg.system .system-label {
    color:#d60000;
    margin-right:6px;
}

.msg.system .system-text {
    color:#d60000;
}

.msg-actions {
    display:flex;
    align-items:center;
    gap:6px;
    flex-shrink:0;
    opacity:0;
    transition:opacity .15s ease;
}

.msg:hover .msg-actions {
    opacity:1;
}

.del-btn,
.ban-btn {
    position:static;
    font-size:11px;
    border:none;
    background:none;
    cursor:pointer;
    padding:0;
    line-height:1.2;
}

.del-btn {
    color:#999;
}

.del-btn:hover {
    color:#e53935;
}

.ban-btn {
    color:#d08a00;
}

.ban-btn:hover {
    color:#e53935;
}

.chat-input {
    display:flex;
    background:#fafafa;
    border-top:1px solid #e5e5e5;
}

.chat-input input {
    flex:1;
    padding:8px 12px;
    border:none;
    outline:none;
    background:#fff;
    color:#222;
}

.chat-input input::placeholder {
    color:#999;
}

.chat-input button {
    width:70px;
    border:none;
    background:#1e2a44;
    color:#fff;
    cursor:pointer;
    transition:0.2s;
}

.chat-input button:hover {
    background:#2b3b60;
}

.chat-input input:disabled,
.chat-input button:disabled {
    opacity:0.6;
    cursor:not-allowed;
}

.chat-admin-menu {
    position:relative;
}

.chat-admin-menu i {
    cursor:pointer;
    font-size:16px;
    color:#444;
}

.chat-admin-menu i:hover {
    color:#1e2a44;
}

.admin-dropdown {
    position:absolute;
    top:25px;
    right:0;
    background:#fff;
    border:1px solid #ddd;
    border-radius:6px;
    box-shadow:0 2px 10px rgba(0,0,0,0.1);
    display:none;
    min-width:140px;
    z-index:999;
}

.admin-item {
    padding:8px 10px;
    font-size:13px;
    cursor:pointer;
    color:#222;
}

.admin-item:hover {
    background:#f5f5f5;
}

.chat-notice {
    display:none;
    background:linear-gradient(90deg,#ffbc00,#ffd95e);
    margin:10px;
    border-radius:5px;
    padding:7px 10px;
    font-weight:bold;
    color:#000;
}

.chat-notice a {
    text-decoration:none !important;
    color:#000 !important;
    cursor:pointer;
}

.chat-notice:hover {
    filter:brightness(1.05);
}

#chatAdminLayer {
    position:fixed;
    inset:0;
    z-index:99999;
}

.chat-admin-layer-bg {
    position:absolute;
    inset:0;
    background:rgba(0,0,0,0.45);
}

.chat-admin-layer-box {
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%, -50%);
    width:90%;
    max-width:520px;
    max-height:80vh;
    background:#fff;
    border:1px solid #ddd;
    border-radius:10px;
    overflow:hidden;
    color:#222;
    box-shadow:0 10px 30px rgba(0,0,0,0.15);
}

.chat-admin-layer-head {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px 15px;
    background:#f8f9fa;
    border-bottom:1px solid #e5e5e5;
}

.chat-admin-layer-head button {
    background:#1e2a44;
    color:#fff;
    border:none;
    padding:6px 10px;
    border-radius:6px;
    cursor:pointer;
}

.chat-admin-layer-body {
    padding:15px;
    max-height:60vh;
    overflow:auto;
    background:#fff;
}

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

.chat-admin-item-row {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    padding:10px;
    border:1px solid #e5e5e5;
    border-radius:8px;
    background:#fafafa;
}

.chat-admin-item-meta {
    font-size:12px;
    color:#666;
    margin-top:4px;
}

.chat-admin-item-row button {
    background:#d9534f;
    color:#fff;
    border:none;
    padding:6px 10px;
    border-radius:6px;
    cursor:pointer;
    white-space:nowrap;
}

.chat-admin-empty {
    color:#777;
    text-align:center;
    padding:20px 10px;
}

.chat-notice-form label {
    display:block;
    margin:10px 0 6px;
    font-size:13px;
    color:#333;
}

.chat-notice-form input[type="text"] {
    width:100%;
    height:38px;
    padding:0 10px;
    border:1px solid #ddd;
    border-radius:6px;
    background:#fff;
    color:#222;
    outline:none;
}

.chat-notice-form input[type="text"]:focus {
    border-color:#1e2a44;
}

.notice-check {
    display:flex !important;
    align-items:center;
    gap:8px;
    margin-top:12px !important;
}

.notice-form-btns {
    display:flex;
    gap:8px;
    margin-top:15px;
}

.notice-form-btns button {
    flex:1;
    height:38px;
    border:none;
    border-radius:6px;
    cursor:pointer;
    color:#fff;
}

#noticeSaveBtn,
#userCountOffsetSaveBtn {
    background:#1e2a44;
}

#noticeSaveBtn:hover,
#userCountOffsetSaveBtn:hover {
    background:#2b3b60;
}

#noticeCancelBtn,
#userCountOffsetCancelBtn {
    background:#999;
}

#noticeCancelBtn:hover,
#userCountOffsetCancelBtn:hover {
    background:#777;
}

.chat-setting-desc {
    margin:12px 0 0;
    padding:10px;
    border:1px solid #e5e5e5;
    border-radius:6px;
    background:#fafafa;
    color:#555;
    font-size:13px;
    line-height:1.6;
}

/* 비회원채팅 설정 버튼: 허용/금지 색상 구분 */
.guest-chat-btns button {
    height:42px;
    font-weight:700;
    font-size:14px;
    border:1px solid rgba(0,0,0,0.08);
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
}

#guestChatAllowBtn,
.guest-chat-allow {
    background:#198754 !important;
    color:#fff !important;
}

#guestChatAllowBtn:hover,
.guest-chat-allow:hover {
    background:#157347 !important;
}

#guestChatDenyBtn,
.guest-chat-deny {
    background:#dc3545 !important;
    color:#fff !important;
}

#guestChatDenyBtn:hover,
.guest-chat-deny:hover {
    background:#bb2d3b !important;
}

.guest-chat-current {
    outline:3px solid rgba(30,42,68,0.35);
    outline-offset:2px;
}

@media (max-width:768px){
    .chat-wrap {
        height:400px;
        border-radius:0;
    }

    .msg-actions {
        opacity:1;
    }
}
