.bcm-open-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:42px;
    height:42px;
    min-width:42px;
    padding:0;
    border:1px solid rgba(255,255,255,.12);
    border-radius:12px;
    background:#232733;
    color:#dfe8ff;
    cursor:pointer;
    font-size:18px;
    line-height:1;
    box-shadow:none;
    transition:.15s;
}
.bcm-open-btn:hover{
    background:#2c3242;
    border-color:rgba(47,144,255,.45);
    color:#fff;
}

.bcm-modal{
    position:fixed;
    inset:0;
    z-index:99999;
    display:none;
    pointer-events:none;
    background:transparent;
}
.bcm-modal.active{
    display:block;
}
.bcm-box{
    position:fixed;
    width:390px;
    max-width:calc(100vw - 16px);
    max-height:410px;
    display:flex;
    flex-direction:column;
    background:#242424;
    color:#e8e8e8;
    border:1px solid rgba(255,255,255,.08);
    border-radius:10px;
    box-shadow:0 18px 45px rgba(0,0,0,.55);
    overflow:hidden;
    pointer-events:auto;
    transform:none;
}
.bcm-box:after{
    content:"";
    position:absolute;
    left:18px;
    width:12px;
    height:12px;
    background:#242424;
    border-right:1px solid rgba(255,255,255,.08);
    border-bottom:1px solid rgba(255,255,255,.08);
    transform:rotate(45deg);
}
.bcm-pos-top .bcm-box:after{
    bottom:-7px;
}
.bcm-pos-bottom .bcm-box:after{
    top:-7px;
    transform:rotate(225deg);
}

.bcm-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:10px 12px 6px;
    background:#242424;
    border-bottom:0;
    flex-shrink:0;
}
.bcm-title b{
    display:block;
    font-size:13px;
    font-weight:700;
    color:#aeb0b6;
    line-height:1.25;
}
.bcm-title span{
    display:block;
    margin-top:2px;
    font-size:10px;
    color:#74777e;
    line-height:1.15;
}
.bcm-close{
    width:26px;
    height:26px;
    min-width:26px;
    border:0;
    border-radius:7px;
    background:transparent;
    color:#8e9299;
    font-size:22px;
    line-height:22px;
    cursor:pointer;
    transition:.12s;
}
.bcm-close:hover{
    background:rgba(255,255,255,.07);
    color:#fff;
}

.bcm-body{
    padding:0 10px 8px;
    overflow:auto;
    flex:1 1 auto;
    min-height:230px;
    max-height:330px;
    scrollbar-width:thin;
    scrollbar-color:#666 transparent;
}
.bcm-body::-webkit-scrollbar{
    width:6px;
}
.bcm-body::-webkit-scrollbar-track{
    background:transparent;
}
.bcm-body::-webkit-scrollbar-thumb{
    background:#5f6268;
    border-radius:10px;
}

.bcm-panel{
    display:none;
    grid-template-columns:repeat(auto-fill, minmax(34px, 1fr));
    gap:4px;
    align-items:start;
}
.bcm-panel.active{
    display:grid;
}
.bcm-section-title{
    grid-column:1/-1;
    padding:7px 3px 5px;
    color:#92959c;
    font-size:13px;
    font-weight:600;
    line-height:1.2;
}

.bcm-item{
    position:relative;
    width:34px;
    height:34px;
    border:0;
    border-radius:7px;
    background:transparent;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    overflow:hidden;
    padding:2px;
    transition:.1s;
}
.bcm-item:hover{
    background:rgba(255,255,255,.08);
    transform:none;
}
.bcm-item img{
    max-width:30px;
    max-height:30px;
    object-fit:contain;
    display:block;
}
.bcm-item-sticker,
.bcm-item-gif{
    width:44px;
    height:44px;
    border-radius:8px;
}
.bcm-item-sticker img,
.bcm-item-gif img{
    max-width:40px;
    max-height:40px;
}
.bcm-item-smile{
    font-size:22px;
}
.bcm-item em{
    position:absolute;
    right:1px;
    top:1px;
    background:#e53935;
    color:#fff;
    font-style:normal;
    font-size:8px;
    line-height:1;
    padding:2px 3px;
    border-radius:4px;
}
.bcm-locked img{
    filter:blur(4px) grayscale(.25);
    opacity:.7;
}
.bcm-empty{
    grid-column:1/-1;
    padding:35px 10px;
    text-align:center;
    color:#8f939a;
    font-size:13px;
}

.bcm-tabs{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    padding:8px 10px;
    border-top:1px solid rgba(255,255,255,.06);
    background:#202020;
    flex-shrink:0;
    overflow:auto;
}
.bcm-tab{
    position:relative;
    width:42px;
    height:34px;
    min-width:42px;
    padding:0;
    border:0;
    border-radius:8px;
    background:transparent;
    color:#7c8088;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    transition:.12s;
}
.bcm-tab:hover{
    background:rgba(255,255,255,.06);
    color:#d8dbe2;
}
.bcm-tab.active{
    background:transparent;
    color:#4fa0ff;
}
.bcm-tab.active:after{
    content:"";
    position:absolute;
    left:50%;
    bottom:-8px;
    width:22px;
    height:2px;
    border-radius:2px;
    background:#4fa0ff;
    transform:translateX(-50%);
}
.bcm-tab-icon{
    display:block;
    font-size:18px;
    line-height:1;
}
.bcm-tab-name{
    display:none;
}

.bcm-media-msg{
    display:block;
    object-fit:contain;
    border-radius:10px;
    margin:4px 0;
}

/*  фиксированный размер стикеров и GIF в сообщениях чата */
.bcm-media-sticker,
.bcm-media-gif{
    width:100px!important;
    height:100px!important;
    max-width:100px!important;
    max-height:100px!important;
    object-fit:contain!important;
}
.bcm-media-smile{
    max-width:42px;
    max-height:42px;
    display:inline-block;
    vertical-align:middle;
}
.bcm-smile-code{
    font-size:22px;
    display:inline-block;
    padding:2px 4px;
}

.bcm-admin-stats{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:12px;
}
.bcm-admin-stats>div{
    background:rgba(0,0,0,.18);
    border-radius:12px;
    padding:16px;
    text-align:center;
}
.bcm-admin-stats b{
    display:block;
    font-size:28px;
}
.bcm-admin-stats span{
    opacity:.75;
}
.bcm-admin-preview{
    max-width:64px;
    max-height:64px;
    object-fit:contain;
}
.bcm-help-box{
    background:rgba(52,84,255,.08);
    border:1px solid rgba(52,84,255,.25);
    border-radius:12px;
    padding:12px;
    margin-top:10px;
}
.bcm-copy-code{
    font-family:monospace;
    background:rgba(0,0,0,.25);
    border-radius:8px;
    padding:9px;
    display:block;
    white-space:pre-wrap;
    color:#dbe6ff;
}

@media(max-width:600px){
    .bcm-box{
        width:calc(100vw - 18px)!important;
        max-height:72vh!important;
    }
    .bcm-body{
        max-height:calc(72vh - 92px);
    }
    .bcm-panel{
        grid-template-columns:repeat(auto-fill, minmax(32px, 1fr));
        gap:4px;
    }
    .bcm-item{
        width:32px;
        height:32px;
    }
    .bcm-item img{
        max-width:28px;
        max-height:28px;
    }
    .bcm-item-sticker,
    .bcm-item-gif{
        width:40px;
        height:40px;
    }
    .bcm-item-sticker img,
    .bcm-item-gif img{
        max-width:36px;
        max-height:36px;
    }
}

.bcm-tab-img{
    width:24px;
    height:24px;
    object-fit:contain;
    display:block;
    border-radius:5px;
}
.bcm-tab.active .bcm-tab-img{
    filter:drop-shadow(0 0 5px rgba(79,160,255,.55));
}

/*  fix: корректное отображение нижних групп в окне смайлов/стикеров */
.bcm-tabs{
    justify-content:flex-start;
    min-height:58px;
    height:58px;
    padding:10px 12px 14px;
    overflow-x:auto;
    overflow-y:hidden;
    box-sizing:border-box;
    scrollbar-width:thin;
}
.bcm-tabs::-webkit-scrollbar{
    height:5px;
}
.bcm-tabs::-webkit-scrollbar-track{
    background:transparent;
}
.bcm-tabs::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.18);
    border-radius:10px;
}
.bcm-tab{
    flex:0 0 42px;
    width:42px;
    min-width:42px;
    height:34px;
    overflow:visible;
}
.bcm-tab.active:after{
    bottom:-6px;
}
.bcm-tab-img{
    flex:0 0 auto;
}
.bcm-body{
    min-height:0;
}

@media(max-width:600px){
    .bcm-tabs{
        min-height:56px;
        height:56px;
        padding:9px 10px 13px;
    }
}
