.chat-wrap {
    width:100%;
    height:590px;
    border-radius:5px;
    overflow:hidden;
    margin-bottom:15px;
    background:#202020;
    display:flex;
    flex-direction:column;
    color:#ddd;
}

.chat-header {
    background:#3a3a3a;
    padding:6px 12px;
    font-weight:bold;
    display:flex;
    justify-content:space-between;
    align-items:center;
    color:#fff;
    border-bottom:1px solid #4c4c4c;
}

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

.chat-users {
    font-size:13px;
    color:#bbb;
}

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

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

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

.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;
}

.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:#fff; }
.admin { color:#ff4d4d; }

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

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

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

.msg-actions {
    display:flex;
    align-items:center;
    gap:4px;
    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:#777;
}

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

.ban-btn {
    color:#ffb84d;
}

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

.chat-input {
    display:flex;
    background:#3a3a3a;
    border-top:1px solid #4c4c4c;
}

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

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

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

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

.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:#bbb;
}

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

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

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

.admin-item:hover {
    background:#4c4c4c;
}

.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.6);
}

.chat-admin-layer-box {
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%, -50%);
    width:90%;
    max-width:520px;
    max-height:80vh;
    background:#2b2b2b;
    border:1px solid #4c4c4c;
    border-radius:10px;
    overflow:hidden;
    color:#fff;
}

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

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

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

.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 #444;
    border-radius:8px;
    background:#333;
}

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

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

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

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

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

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

.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 {
    background:#e6345c;
}

#noticeCancelBtn {
    background:#555;
}

#userCountOffsetSaveBtn {
    background:#e6345c;
}

#userCountOffsetCancelBtn {
    background:#555;
}

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

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

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

#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(255,255,255,0.45);
    outline-offset:2px;
}
