.global-chat{
    margin:0 0 34px;
    border:1px solid var(--border);
    border-radius:18px;
    overflow:hidden;
    background:
        radial-gradient(circle at 82% -20%,rgba(255,106,0,.12),transparent 36%),
        #111114;
    box-shadow:0 15px 45px rgba(0,0,0,.10)
}
.global-chat-head{
    display:flex;align-items:center;justify-content:space-between;gap:20px;
    padding:20px 22px 17px;border-bottom:1px solid var(--border)
}
.global-chat-head .eyebrow{margin-bottom:4px}
.global-chat-title-row{display:flex;align-items:center;gap:10px}
.global-chat-title-row h2{margin:0;font-size:23px}
.global-chat-head p{margin:4px 0 0;color:var(--muted);font-size:12px}
.global-chat-live{
    display:inline-flex;align-items:center;gap:5px;padding:4px 7px;
    border:1px solid rgba(34,197,94,.2);border-radius:99px;
    color:#70e597;background:rgba(34,197,94,.06);
    font-size:8px;font-weight:900;letter-spacing:.08em
}
.global-chat-live i{
    width:6px;height:6px;border-radius:50%;background:#22c55e;
    box-shadow:0 0 0 4px rgba(34,197,94,.1)
}
.global-chat-online{
    min-width:75px;padding:9px 13px;text-align:center;border-radius:11px;
    background:#ffffff04;border:1px solid var(--border)
}
.global-chat-online b{display:block;font-size:19px}
.global-chat-online span{display:block;color:var(--muted);font-size:9px}
.global-chat-body{
    display:grid;grid-template-columns:minmax(0,1fr) 210px;
    min-height:330px;max-height:430px
}
.global-chat-messages{
    overflow-y:auto;padding:16px 18px;display:flex;flex-direction:column;gap:8px;
    scrollbar-width:thin;scrollbar-color:#34343a transparent
}
.global-chat-loading{
    margin:auto;color:#777;font-size:12px
}
.global-chat-message{
    display:grid;grid-template-columns:38px minmax(0,1fr) auto;
    gap:10px;align-items:start;padding:8px 9px;border-radius:11px;
    transition:background .15s ease
}
.global-chat-message:hover{background:#ffffff03}
.global-chat-avatar{
    position:relative;width:38px;height:38px;display:grid;place-items:center;
    border-radius:10px;background:linear-gradient(145deg,#25252b,#17171b);
    border:1px solid var(--border);font-weight:900;overflow:visible
}
.global-chat-avatar img{
    width:38px;height:38px;object-fit:cover;border-radius:10px
}
.global-chat-avatar .status-dot{
    position:absolute;right:-2px;bottom:-2px;border:2px solid #111114
}
.global-chat-message-main{min-width:0}
.global-chat-message-meta{
    display:flex;align-items:center;gap:7px;min-width:0
}
.global-chat-username{
    font-size:12px;font-weight:850;white-space:nowrap;
    overflow:hidden;text-overflow:ellipsis
}
.global-chat-group{
    max-width:120px;padding:2px 5px;border-radius:6px;
    background:#ffffff06;font-size:8px;white-space:nowrap;
    overflow:hidden;text-overflow:ellipsis
}
.global-chat-time{
    color:#64646d;font-size:9px;white-space:nowrap
}
.global-chat-text{
    margin:3px 0 0;color:#d8d8dc;font-size:13px;line-height:1.42;
    white-space:pre-wrap;overflow-wrap:anywhere
}
.global-chat-delete{
    opacity:0;border:0;background:transparent;color:#686872;
    font-size:11px;cursor:pointer;padding:5px;border-radius:6px;
    transition:.15s
}
.global-chat-message:hover .global-chat-delete{opacity:1}
.global-chat-delete:hover{background:#ef444414;color:#f87171}
.global-chat-side{
    border-left:1px solid var(--border);padding:15px;
    background:#0e0e11;display:grid;align-content:start;gap:11px
}
.global-chat-side-card{
    display:grid;gap:4px;padding:13px;border-radius:12px;
    border:1px solid var(--border);background:#ffffff03
}
.global-chat-side-icon{font-size:26px;margin-bottom:4px}
.global-chat-side-card b{font-size:12px}
.global-chat-side-card p{
    margin:0;color:#7f7f89;font-size:10px;line-height:1.5
}
.global-chat-rules{
    display:grid;gap:5px;padding:12px;color:#85858e;font-size:10px
}
.global-chat-rules b{color:#bdbdc4;font-size:11px;margin-bottom:2px}
.global-chat-rules span::before{content:"•";color:var(--accent);margin-right:6px}
.global-chat-form{
    display:grid;grid-template-columns:38px minmax(0,1fr) auto;
    gap:9px;align-items:center;padding:12px 16px;
    border-top:1px solid var(--border);background:#151518
}
.global-chat-me img,.global-chat-me span{
    width:38px;height:38px;border-radius:10px;object-fit:cover;
    display:grid;place-items:center;background:#25252b;font-weight:900
}
.global-chat-form textarea{
    min-height:42px;max-height:100px;resize:none;padding:10px 12px;
    line-height:1.35
}
.global-chat-form .btn{min-height:42px}
.global-chat-login{
    display:flex;align-items:center;gap:8px;padding:13px 16px;
    border-top:1px solid var(--border);background:#151518
}
.global-chat-login>span{margin-right:auto;color:#9b9ba5;font-size:12px}
.global-chat-bottom{
    display:flex;justify-content:space-between;gap:15px;
    padding:0 17px 10px;background:#151518;color:#5f5f68;font-size:9px
}
.global-chat-bottom .ok{color:#61db8c}
.global-chat-bottom .error{color:#f87171}
.global-chat-empty{
    margin:auto;text-align:center;color:#75757f;font-size:12px
}
@media(max-width:800px){
    .global-chat-body{grid-template-columns:1fr;max-height:none}
    .global-chat-messages{height:330px}
    .global-chat-side{display:none}
}
@media(max-width:600px){
    .global-chat-head{align-items:flex-start}
    .global-chat-head p{max-width:260px}
    .global-chat-form{grid-template-columns:1fr auto}
    .global-chat-me{display:none}
    .global-chat-bottom{display:grid}
    .global-chat-message{grid-template-columns:34px minmax(0,1fr) auto;gap:8px;padding:7px 3px}
    .global-chat-avatar,.global-chat-avatar img{width:34px;height:34px}
    .global-chat-group{display:none}
}


/* FIX: длинная история скроллится внутри чата и не залезает под форму */
.global-chat-body{
    height:390px;
    min-height:0;
    max-height:none;
    overflow:hidden
}
.global-chat-messages{
    height:100%;
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    padding-bottom:18px;
    overscroll-behavior:contain
}
.global-chat-side{
    height:100%;
    min-height:0;
    overflow-y:auto
}
.global-chat-form{
    position:relative;
    z-index:10;
    align-items:end
}
.global-chat-form .chat-media-editor{
    min-width:0
}
.global-chat-form textarea{
    width:100%;
    min-height:42px
}
.global-chat-bottom{
    position:relative;
    z-index:10
}
.global-chat-messages::-webkit-scrollbar{width:6px}
.global-chat-messages::-webkit-scrollbar-track{background:transparent}
.global-chat-messages::-webkit-scrollbar-thumb{background:#303035;border-radius:10px}
.global-chat-messages::-webkit-scrollbar-thumb:hover{background:#45454c}

@media(max-width:800px){
    .global-chat-body{height:350px}
    .global-chat-messages{height:100%}
}
@media(max-width:600px){
    .global-chat-form{
        grid-template-columns:minmax(0,1fr) auto
    }
    .global-chat-form .global-chat-me{display:none}
}
