html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ── Splash / WASM loading screen ── */
.rupor-splash {
    position: fixed; inset: 0;
    background: #1e1f22;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    z-index: 9999;
}

/* Logo */
.rupor-splash__logo {
    width: 88px; height: 88px;
    animation: splash-pulse 2s ease-in-out infinite;
    margin-bottom: 20px;
}
.rupor-splash__logo svg {
    width: 100%; height: 100%;
    filter: drop-shadow(0 0 24px rgba(88,101,242,.55));
}
@keyframes splash-pulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%       { transform: scale(1.08); opacity: .85; }
}

/* App name */
.rupor-splash__title {
    font-size: 26px; font-weight: 700;
    color: #fff; letter-spacing: .5px;
    margin-bottom: 32px;
}

/* Animated dots */
.rupor-splash__dots {
    display: flex; gap: 8px;
    margin-bottom: 48px;
}
.rupor-splash__dots span {
    width: 8px; height: 8px; border-radius: 50%;
    background: #5865f2;
    animation: splash-dot 1.2s ease-in-out infinite;
}
.rupor-splash__dots span:nth-child(1) { animation-delay: 0s; }
.rupor-splash__dots span:nth-child(2) { animation-delay: .2s; }
.rupor-splash__dots span:nth-child(3) { animation-delay: .4s; }
@keyframes splash-dot {
    0%, 80%, 100% { transform: scale(.7); opacity: .35; }
    40%           { transform: scale(1.2); opacity: 1; }
}

/* Progress bar */
.rupor-splash__bar-wrap {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 3px; background: rgba(255,255,255,.07);
}
.rupor-splash__bar {
    height: 100%;
    background: linear-gradient(90deg, #5865f2, #7289da);
    transition: width .08s ease-out;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(88,101,242,.7);
}

/* Percentage text */
.rupor-splash__percent {
    position: fixed; bottom: 12px;
    font-size: 12px; color: rgba(255,255,255,.3);
    letter-spacing: .5px;
}
.rupor-splash__percent::after {
    content: var(--blazor-load-percentage-text, "Загрузка...");
}

/* Keep legacy class names harmless (Blazor may still write them) */
.loading-progress { display: none; }
.loading-progress-text { display: none; }

code {
    color: #c02d76;
}


/* ── Chat PWA additions ── */
html, body { height: 100%; margin: 0; background: #313338; }
#app { height: 100%; }

.chat-empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%; color: #949ba4;
}
.chat-empty-icon { font-size: 48px; margin-bottom: 12px; }
.chat-empty-text { font-size: 16px; }

.chat-loading, .chat-no-msgs {
    text-align: center; padding: 40px 0; color: #949ba4; font-size: 14px;
}

/* Индикатор подгрузки старых сообщений (scroll-up infinite load) */
.chat-load-more {
    display: flex; justify-content: center; align-items: center;
    padding: 12px 0;
}
.chat-load-more-spinner {
    width: 22px; height: 22px;
    border: 2px solid #4e5058;
    border-top-color: #5865f2;
    border-radius: 50%;
    animation: chat-spin 0.7s linear infinite;
}
@keyframes chat-spin {
    to { transform: rotate(360deg); }
}
.chat-load-more-hint {
    text-align: center; padding: 8px 0; color: #4e5058; font-size: 12px;
}

.chat-panel-hdr-av { margin-right: 8px; flex-shrink: 0; }

/* ── App Shell ── */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #313338;
}
.app-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* ── App Rail ── */
.app-rail {
    width: 72px;
    min-width: 72px;
    background: #1e1f22;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.app-rail-top { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.app-rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.app-rail-sep { width: 32px; height: 2px; background: rgba(255,255,255,.1); border-radius: 1px; margin: 4px 0; }

.app-rail-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #313338;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dbdee1;
    text-decoration: none;
    font-size: 18px;
    transition: border-radius .15s, background .15s;
    flex-shrink: 0;
    overflow: hidden;
    border: none;
    cursor: pointer;
}
.app-rail-item:hover,
.app-rail-item--active {
    border-radius: 16px;
    background: #5865f2;
    color: #fff;
}
.app-rail-item--add { color: #3ba55d; background: #313338; }
.app-rail-item--add:hover { background: #3ba55d; color: #fff; }

.app-rail-srv-img { width: 100%; height: 100%; object-fit: cover; }
.app-rail-srv-initials { font-size: 14px; font-weight: 600; }

.app-rail-profile {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #5865f2;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    transition: border-radius .15s;
}
.app-rail-profile:hover { border-radius: 16px; }
.app-rail-av { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* ── Modals ── */
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-modal {
    background: #2b2d31;
    border-radius: 8px;
    padding: 24px;
    width: 380px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    color: #dbdee1;
}
.app-modal-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
}
.app-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}
.app-modal-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    background: #4e5058;
    color: #fff;
}
.app-modal-btn:hover { background: #5d6069; }
.app-modal-btn--primary { background: #5865f2; }
.app-modal-btn--primary:hover { background: #4752c4; }
.app-modal-btn--danger { background: #da373c; }
.app-modal-btn--danger:hover { background: #c03034; }
.app-modal-btn:disabled { opacity: .5; cursor: not-allowed; }
.app-modal-title { color: #f2f3f5; font-size: 20px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.app-modal-hint  { color: #949ba4; font-size: 13px; text-align: center; margin-bottom: 20px; }
.app-modal-field { margin-bottom: 16px; }
.app-modal-label { display: block; color: #b5bac1; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.app-modal-input { width: 100%; padding: 10px 14px; background: #1e1f22; border: 1px solid #3f4147; border-radius: 6px; color: #f2f3f5; font-size: 14px; outline: none; box-sizing: border-box; transition: border-color .15s; }
.app-modal-input:focus { border-color: #5865f2; }
.app-modal-input::placeholder { color: #72767d; }

/* ── Server choice modal ── */
.app-srv-choice-box {
    background: #313338; border-radius: 12px;
    padding: 28px; min-width: 340px; max-width: 460px; width: 90%;
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.app-srv-choice-btns { display: flex; gap: 14px; }
.app-srv-choice-btn {
    flex: 1; padding: 20px 16px; border-radius: 10px;
    background: #2b2d31; border: 2px solid transparent;
    cursor: pointer; display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    transition: border-color .15s, background .15s;
}
.app-srv-choice-btn:hover { border-color: #5865f2; background: #232428; }
.app-srv-choice-label { color: #f2f3f5; font-weight: 600; font-size: 14px; }
.app-srv-choice-hint  { color: #949ba4; font-size: 12px; }

/* ── Create server modal ── */
.app-create-srv-modal {
    background: #313338; border-radius: 12px;
    padding: 28px; min-width: 320px; max-width: 440px; width: 90%;
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.app-create-srv-img {
    width: 80px; height: 80px; border-radius: 50%;
    border: 2px dashed #4e5058; background: #2b2d31;
    margin: 0 auto 20px; cursor: pointer;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    overflow: hidden; position: relative;
    transition: border-color .15s;
}
.app-create-srv-img:hover { border-color: #5865f2; }
.app-create-srv-img-preview { width: 100%; height: 100%; object-fit: cover; }
.app-create-srv-img-hover {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.6); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; opacity: 0;
    transition: opacity .15s;
}
.app-create-srv-img:hover .app-create-srv-img-hover { opacity: 1; }

/* ── Profile modal ── */
.app-profile-modal {
    background: #2b2d31;
    border-radius: 12px;
    width: 420px; max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,.6);
    display: flex; flex-direction: column;
}
.app-profile-banner {
    height: 72px;
    background: linear-gradient(135deg, #5865f2 0%, #3ba55d 100%);
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}
.app-profile-av-section {
    display: flex; align-items: flex-end; gap: 14px;
    padding: 0 24px 12px;
    margin-top: -36px;
}
.app-profile-av-wrap {
    position: relative;
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 4px solid #2b2d31;
    overflow: hidden;
    flex-shrink: 0;
    background: #5865f2;
}
.app-profile-av-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-profile-av-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700; color: #fff;
}
.app-profile-av-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .15s; cursor: pointer;
    border-radius: 50%;
}
.app-profile-av-wrap:hover .app-profile-av-overlay { opacity: 1; }
.app-profile-status-dot {
    position: absolute; bottom: 4px; right: 4px;
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid #2b2d31;
}
.app-profile-status-dot--online { background: #23a55a; }
.app-profile-status-dot--away   { background: #f0b232; }
.app-profile-status-dot--dnd    { background: #ed4245; }
.app-profile-username {
    font-size: 18px; font-weight: 700; color: #f2f3f5;
    padding-bottom: 6px;
}
.app-profile-body {
    padding: 8px 24px 24px;
}
.app-profile-about { resize: vertical; min-height: 72px; font-family: inherit; }
.app-profile-error { color: #ed4245; font-size: 13px; margin-bottom: 10px; }

/* Status picker */
.app-status-row { display: flex; gap: 8px; }
.app-status-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 6px; border-radius: 8px;
    background: #1e1f22; border: 2px solid transparent;
    color: #b5bac1; font-size: 13px; font-weight: 500; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.app-status-btn:hover { background: #2e2f34; color: #f2f3f5; }
.app-status-btn--active { border-color: #5865f2; color: #f2f3f5; background: #2e2f34; }
.app-status-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.app-status-dot--online { background: #23a55a; }
.app-status-dot--away   { background: #f0b232; }
.app-status-dot--dnd    {
    background: #ed4245;
    /* DND = красный круг с чёрточкой внутри */
    position: relative;
}
.app-status-dot--dnd::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 5px; height: 2px;
    background: #fff; border-radius: 1px;
}

/* Rail profile with status dot */
.app-rail-profile-wrap {
    position: relative; cursor: pointer;
    width: 48px; height: 48px;
    flex-shrink: 0;
}
.app-rail-status-dot {
    position: absolute; bottom: 0; right: 0;
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid #1e1f22;
    pointer-events: none;
}
.app-rail-status-dot--online { background: #23a55a; }
.app-rail-status-dot--away   { background: #f0b232; }
.app-rail-status-dot--dnd    { background: #ed4245; }

/* Legacy - keep for existing markup */
.app-profile-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.app-profile-field label { font-size: 11px; font-weight: 600; color: #b5bac1; text-transform: uppercase; }

/* Универсальный тёмный input — используется в модалах, редактировании, приглашениях */
.pm-edit-input {
    width: 100%;
    padding: 9px 12px;
    background: #1e1f22;
    border: 1px solid #3f4147;
    border-radius: 4px;
    color: #f2f3f5;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s;
}
.pm-edit-input:focus { border-color: #5865f2; }
.pm-edit-input::placeholder { color: #72767d; }
.pm-edit-input[readonly] { opacity: .75; cursor: default; }
.pm-edit-input[type="number"] { -moz-appearance: textfield; }
.pm-edit-input[type="number"]::-webkit-inner-spin-button,
.pm-edit-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ─── Bot badge in member list ─────────────────────────────── */
.srv-bot-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #f0b232;
    background: rgba(240,178,50,.15);
    border: 1px solid rgba(240,178,50,.4);
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.4;
}

/* ─── Server rail item wrapper + gear + dropdown ───────────── */
.app-rail-srv-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-rail-srv-gear {
    display: none;
    position: absolute;
    right: -4px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    background: #2b2d31;
    border: 1px solid #40444b;
    border-radius: 50%;
    color: #b9bbbe;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
    transition: color .15s, background .15s;
}
.app-rail-srv-gear:hover { background: #5865f2; color: #fff; border-color: #5865f2; }
.app-rail-srv-wrap:hover .app-rail-srv-gear { display: flex; }

.app-rail-muted-icon {
    position: absolute;
    bottom: 0; left: 0;
    font-size: 9px;
    line-height: 1;
    pointer-events: none;
    opacity: .8;
}

.app-rail-srv-dd-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.app-rail-srv-dropdown {
    position: absolute;
    left: calc(100% + 10px);
    top: 0;
    z-index: 1000;
    background: #18191c;
    border: 1px solid #040405;
    border-radius: 6px;
    padding: 4px 0;
    min-width: 190px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

.app-rail-srv-dd-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #dcddde;
    font-size: 13px;
    text-align: left;
    padding: 8px 12px;
    cursor: pointer;
    transition: background .1s, color .1s;
}
.app-rail-srv-dd-item:hover { background: #5865f2; color: #fff; }
.app-rail-srv-dd-item--danger { color: #ed4245; }
.app-rail-srv-dd-item--danger:hover { background: #ed4245; color: #fff; }

.app-rail-srv-dd-sep {
    height: 1px;
    background: #3f4147;
    margin: 4px 0;
}

/* ─── Server rail mention badge ─────────────────────────────── */
.app-rail-mention-badge {
    position: absolute;
    bottom: 2px; right: 2px;
    min-width: 16px; height: 16px;
    background: #ed4245;
    color: #fff;
    font-size: 10px; font-weight: 700;
    border-radius: 8px;
    padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    border: 2px solid #1e1f22;
    pointer-events: none;
}

/* ─── PM rail notification avatars ──────────────────────────── */
.app-rail-pm-notif {
    position: relative;
    width: 44px; height: 44px;
    border-radius: 50%;
    cursor: pointer;
    margin: 2px auto;
    flex-shrink: 0;
    animation: pm-notif-pop 0.35s cubic-bezier(.34,1.56,.64,1) both;
    transition: transform 0.15s;
}
.app-rail-pm-notif:hover { transform: scale(1.12); }

@keyframes pm-notif-pop {
    from { transform: scale(0) rotate(-15deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

.app-rail-pm-av {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #5865f2;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 2px solid #ed4245;
    box-shadow: 0 0 0 2px rgba(237,66,69,0.35);
}

.app-rail-pm-av-img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.app-rail-pm-av-initials {
    font-size: 14px; font-weight: 700;
    color: #fff;
    user-select: none;
}

.app-rail-pm-badge {
    position: absolute;
    bottom: -2px; right: -2px;
    min-width: 16px; height: 16px;
    background: #ed4245;
    color: #fff;
    font-size: 10px; font-weight: 700;
    border-radius: 8px;
    padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    border: 2px solid #1e1f22;
    pointer-events: none;
}

/* ─── Channel sidebar mention badge ─────────────────────────── */
.srv-ch-mention-badge {
    min-width: 16px; height: 16px;
    background: #ed4245;
    color: #fff;
    font-size: 10px; font-weight: 700;
    border-radius: 8px;
    padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: 4px;
    line-height: 1;
}

/* ─── Server header settings dropdown ───────────────────────── */
.srv-hdr-dd-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.srv-hdr-dropdown {
    position: absolute;
    right: 0; top: calc(100% + 6px);
    z-index: 1000;
    background: #18191c;
    border: 1px solid #040405;
    border-radius: 6px;
    padding: 4px 0;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

.srv-hdr-dd-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #dcddde;
    font-size: 13px;
    text-align: left;
    padding: 8px 12px;
    cursor: pointer;
    transition: background .1s, color .1s;
}
.srv-hdr-dd-item:hover { background: #5865f2; color: #fff; }
.srv-hdr-dd-item--danger { color: #ed4245; }
.srv-hdr-dd-item--danger:hover { background: #ed4245; color: #fff; }

.srv-hdr-dd-sep {
    height: 1px;
    background: #3f4147;
    margin: 4px 0;
}

/* ─── Moderator assigned banner ─────────────────────────────── */
.srv-moderator-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #5865f2;
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}

.srv-moderator-banner span { flex: 1; }

.srv-moderator-banner-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    padding: 0 4px;
    line-height: 1;
}

.srv-moderator-banner-close:hover { opacity: 1; }

/* ─── Guest channel page ────────────────────────────────────── */
.guest-shell {
    min-height: 100vh;
    background: #313338;
    color: #dcddde;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.guest-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 860px;
    margin: 0 auto;
}

.guest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #2b2d31;
    border-bottom: 1px solid #1e1f22;
    flex-shrink: 0;
}

.guest-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.guest-server-name {
    font-size: 14px;
    font-weight: 600;
    color: #b9bbbe;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guest-channel-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guest-login-btn {
    background: #5865f2;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}
.guest-login-btn:hover { background: #4752c4; color: #fff; }

.guest-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.guest-msg {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 0;
}

.guest-msg-av {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #5865f2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.guest-msg-body { flex: 1; min-width: 0; }

.guest-msg-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.guest-msg-author {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.guest-msg-time {
    font-size: 11px;
    color: #72767d;
}

.guest-msg-edited {
    font-size: 11px;
    color: #72767d;
    font-style: italic;
}

.guest-msg-content {
    font-size: 14px;
    color: #dcddde;
    line-height: 1.5;
    word-break: break-word;
}

.guest-msg-attachments {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.guest-msg-img {
    max-width: 320px;
    max-height: 240px;
    border-radius: 6px;
    object-fit: cover;
}

.guest-msg-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2b2d31;
    border: 1px solid #1e1f22;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: #00b0f4;
    text-decoration: none;
}
.guest-msg-file:hover { text-decoration: underline; }

.guest-footer {
    padding: 12px 20px;
    background: #2b2d31;
    border-top: 1px solid #1e1f22;
    flex-shrink: 0;
}

.guest-footer-text {
    font-size: 13px;
    color: #949ba4;
    text-align: center;
}

.guest-footer-text a {
    color: #5865f2;
    text-decoration: none;
    font-weight: 600;
}
.guest-footer-text a:hover { text-decoration: underline; }

.guest-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #72767d;
    font-size: 14px;
}

.guest-loading, .guest-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #949ba4;
}

.guest-loading-spinner {
    width: 32px; height: 32px;
    border: 3px solid #3f4147;
    border-top-color: #5865f2;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Guest link in channel settings ───────────────────────── */
.ch-guest-link-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    padding: 12px;
    background: #1e1f22;
    border-radius: 6px;
    border: 1px solid #3f4147;
}

.ch-guest-link-label {
    font-size: 12px;
    font-weight: 600;
    color: #b9bbbe;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.ch-guest-link-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ch-guest-link-input {
    flex: 1;
    background: #2b2d31;
    border: 1px solid #3f4147;
    border-radius: 4px;
    color: #dcddde;
    font-size: 12px;
    padding: 6px 8px;
    min-width: 0;
}

.ch-guest-link-copy {
    background: #4e5058;
    border: none;
    border-radius: 4px;
    color: #b9bbbe;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.ch-guest-link-copy:hover { background: #5865f2; color: #fff; }

/* ─── Profile modal tabs ─────────────────────────────────────── */
.prof-modal-tabs {
    display: flex;
    gap: 4px;
    margin: 8px 0 12px;
    border-bottom: 2px solid #2e3035;
    padding-bottom: 0;
}
.prof-modal-tab {
    padding: 6px 14px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #949ba4;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.prof-modal-tab:hover { color: #dcddde; }
.prof-modal-tab--active { color: #fff; border-bottom-color: #5865f2; }

.prof-privacy-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    color: #dcddde;
    font-size: 13px;
    cursor: pointer;
}
.prof-privacy-row span { flex: 1; }

/* ─── Profile public page ────────────────────────────────────── */
.prof-page {
    flex: 1;
    overflow-y: auto;
    background: #313338;
    min-height: 100%;
}
.prof-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}
.prof-loading-spinner {
    width: 36px; height: 36px;
    border: 3px solid #4f545c;
    border-top-color: #5865f2;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.prof-error {
    padding: 40px;
    text-align: center;
    color: #949ba4;
    font-size: 15px;
}

.prof-header {
    position: relative;
    background: #2b2d31;
}
.prof-banner {
    height: 120px;
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
}
.prof-header-body {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 0 24px 16px;
}
.prof-av-wrap {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 4px solid #2b2d31;
    margin-top: -40px;
    flex-shrink: 0;
    background: #5865f2;
    overflow: hidden;
}
.prof-av-img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.prof-av-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}
.prof-header-info {
    flex: 1;
    padding-bottom: 4px;
}
.prof-username {
    font-size: 20px;
    font-weight: 700;
    color: #f2f3f5;
}
.prof-reg-date {
    font-size: 12px;
    color: #949ba4;
    margin-top: 2px;
}
.prof-msg-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #5865f2;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.prof-msg-btn:hover { background: #4752c4; }

.prof-body {
    display: flex;
    gap: 20px;
    padding: 20px 24px;
    max-width: 960px;
    margin: 0 auto;
}
.prof-left { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.prof-right { flex: 1; min-width: 0; }

.prof-card {
    background: #2b2d31;
    border-radius: 8px;
    padding: 16px;
}
.prof-card-title {
    font-size: 11px;
    font-weight: 700;
    color: #949ba4;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
}
.prof-card-text {
    font-size: 14px;
    color: #dcddde;
    white-space: pre-wrap;
    word-break: break-word;
}

.prof-servers-list { display: flex; flex-direction: column; gap: 6px; }
.prof-server-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    text-decoration: none;
    color: #dcddde;
    font-size: 13px;
    transition: background .12s;
}
.prof-server-item:hover { background: #393c43; }
.prof-server-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #5865f2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* Wall */
.prof-wall { display: flex; flex-direction: column; gap: 12px; }
.prof-wall-disabled { font-size: 13px; color: #72767d; text-align: center; padding: 8px 0; }
.prof-wall-empty    { font-size: 13px; color: #72767d; text-align: center; padding: 8px 0; }

.prof-wall-input-wrap {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #313338;
    border-radius: 6px;
}
.prof-wall-input-av {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #5865f2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.prof-wall-av-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.prof-wall-input-right { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.prof-wall-textarea {
    width: 100%;
    background: #404249;
    border: 1px solid #4f545c;
    border-radius: 4px;
    color: #dcddde;
    font-size: 14px;
    padding: 8px 10px;
    resize: vertical;
    box-sizing: border-box;
}
.prof-wall-textarea:focus { outline: none; border-color: #5865f2; }
.prof-wall-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.prof-wall-counter { font-size: 11px; color: #72767d; }
.prof-wall-send-btn {
    padding: 6px 16px;
    background: #5865f2;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.prof-wall-send-btn:hover:not(:disabled) { background: #4752c4; }
.prof-wall-send-btn:disabled { opacity: .5; cursor: not-allowed; }

.prof-wall-post {
    background: #313338;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.prof-wall-post-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
}
.prof-wall-post-av {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #5865f2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.prof-wall-post-meta { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.prof-wall-post-author {
    font-size: 13px;
    font-weight: 600;
    color: #f2f3f5;
    text-decoration: none;
}
.prof-wall-post-author:hover { text-decoration: underline; color: #5865f2; }
.prof-wall-post-date { font-size: 11px; color: #72767d; }
.prof-wall-post-content {
    font-size: 14px;
    color: #dcddde;
    white-space: pre-wrap;
    word-break: break-word;
}
.prof-wall-del-btn {
    background: none;
    border: none;
    color: #72767d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color .12s, background .12s;
}
.prof-wall-del-btn:hover { color: #ed4245; background: rgba(237,66,69,.1); }

@media (max-width: 700px) {
    .prof-body { flex-direction: column; padding: 12px; }
    .prof-left { width: 100%; }
}

/* ── Sound picker ─────────────────────────────────────────── */
.sound-pick-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}
.sound-pick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 6px;
    background: #2f3136;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: border-color .12s, background .12s;
}
.sound-pick-row:hover { background: #36393f; }
.sound-pick-row--active {
    border-color: #5865f2;
    background: rgba(88,101,242,.12);
}
.sound-pick-name {
    font-size: 13px;
    color: #dcddde;
}
.sound-pick-row--active .sound-pick-name { color: #fff; font-weight: 600; }
.sound-preview-btn {
    background: none;
    border: none;
    color: #72767d;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color .12s, background .12s;
}
.sound-preview-btn:hover { color: #5865f2; background: rgba(88,101,242,.15); }

/* ── Wall badge on profile rail icon ─────────────────────── */
.app-rail-wall-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #5865f2;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
}

/* ── Plan badge ──────────────────────────────────────────────── */
.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    cursor: default;
    user-select: none;
}
.plan-badge--free     { background: rgba(114,118,125,.18); color: #b9bbbe; border: 1px solid #72767d; }
.plan-badge--ads      { background: rgba(88,101,242,.18);  color: #8892f8; border: 1px solid #5865f2; }
.plan-badge--vip      { background: rgba(240,178,50,.18);  color: #f0b232; border: 1px solid #f0b232; }
.plan-badge--business { background: rgba(185,131,255,.18); color: #c9a0ff; border: 1px solid #b983ff; }

/* clickable badge in own profile */
.app-profile-av-section .plan-badge { cursor: pointer; margin-top: 4px; transition: opacity .12s; }
.app-profile-av-section .plan-badge:hover { opacity: .8; }

/* ── Plan picker modal ───────────────────────────────────────── */
.plan-picker {
    background: #2f3136;
    border-radius: 12px;
    width: min(800px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.plan-picker-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.plan-picker-title { font-size: 18px; font-weight: 700; color: #f2f3f5; }
.plan-picker-close {
    background: none; border: none; color: #72767d; cursor: pointer;
    padding: 4px; border-radius: 4px; display: flex; align-items: center;
    transition: color .12s;
}
.plan-picker-close:hover { color: #f2f3f5; }

/* Period toggle */
.plan-period-row { display: flex; justify-content: center; }
.plan-period-toggle {
    display: flex;
    background: #202225;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.plan-period-btn {
    flex: 1;
    padding: 7px 20px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #72767d;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.plan-period-btn--active { background: #5865f2; color: #fff; }
.plan-period-save {
    font-size: 10px;
    background: #3ba55d;
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* Grid */
.plan-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 680px) { .plan-picker-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .plan-picker-grid { grid-template-columns: 1fr; } }

/* Card */
.plan-card {
    background: #202225;
    border-radius: 10px;
    padding: 16px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1.5px solid transparent;
    transition: border-color .15s;
}
.plan-card--active  { border-color: #5865f2; }
.plan-card--blocked { opacity: .7; }

.plan-card-top { display: flex; flex-direction: column; gap: 6px; }

.plan-card-price-block { display: flex; flex-direction: column; gap: 2px; }
.plan-card-price-main  { font-size: 16px; font-weight: 700; color: #f2f3f5; }
.plan-card-price-save  {
    font-size: 11px; font-weight: 700;
    color: #3ba55d; letter-spacing: .3px;
}

.plan-card-features {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 6px; flex: 1;
}
.plan-card-feature {
    display: flex; align-items: flex-start; gap: 6px;
    font-size: 12px; color: #b9bbbe; line-height: 1.4;
}
.plan-card-feature svg { flex-shrink: 0; color: #43b581; margin-top: 1px; }

/* Blocked downgrade hint */
.plan-card-blocked-msg {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: #f0b232;
    background: rgba(240,178,50,.1);
    border-radius: 4px;
    padding: 5px 8px;
}
.plan-card-blocked-msg svg { flex-shrink: 0; }

/* Expiry date */
.plan-card-expiry {
    text-align: center;
    font-size: 11px;
    color: #72767d;
    margin-top: -4px;
}

/* Buttons */
.plan-card-btn {
    width: 100%; padding: 9px 8px;
    border-radius: 6px; border: none;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    background: #5865f2; color: #fff;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: background .12s, opacity .12s;
}
.plan-card-btn:hover:not(:disabled) { background: #4752c4; }
.plan-card-btn:disabled             { cursor: not-allowed; opacity: .55; }
.plan-card-btn--active              { background: #3ba55d; }
.plan-card-btn--extend              { background: #f0b232; color: #1e1e1e; }
.plan-card-btn--extend:hover:not(:disabled) { background: #d9a020; }
.plan-card-btn--disabled            { background: #36393f; color: #72767d; }
.plan-card-btn--contact             { background: #b983ff; color: #fff; }
.plan-card-btn--contact:hover:not(:disabled) { background: #a06ae0; }

.plan-card-btn-spin {
    width: 12px; height: 12px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Secret chat rail icons ─────────────────────────────────── */
.app-rail-sc-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px auto;
}

.sc-rail-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #57f287;
    cursor: pointer;
    text-decoration: none;
    background: transparent;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 0 0 1px rgba(87,242,135,.25);
    animation: sc-icon-pop .35s cubic-bezier(.34,1.56,.64,1) both;
    overflow: visible;
}
.sc-rail-icon:hover { transform: scale(1.1); box-shadow: 0 0 0 3px rgba(87,242,135,.4); }
.sc-rail-icon--active { box-shadow: 0 0 0 3px rgba(87,242,135,.6); }
.sc-rail-icon--unread {
    box-shadow: 0 0 0 2px #57f287, 0 0 8px 2px rgba(87,242,135,.35);
    animation: sc-unread-pulse 1.6s ease-in-out infinite;
}
@keyframes sc-unread-pulse {
    0%,100% { box-shadow: 0 0 0 2px #57f287, 0 0 8px 2px rgba(87,242,135,.35); }
    50%      { box-shadow: 0 0 0 3px #57f287, 0 0 18px 5px rgba(87,242,135,.65); }
}

.sc-rail-menu-btn {
    display: none;
    position: absolute;
    right: -4px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    background: #2b2d31;
    border: 1px solid #40444b;
    border-radius: 50%;
    color: #b9bbbe;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    z-index: 2;
    transition: color .15s, background .15s, border-color .15s;
}
.sc-rail-menu-btn:hover { background: #57f287; color: #1e1f22; border-color: #57f287; }
.app-rail-sc-wrap:hover .sc-rail-menu-btn { display: flex; }

@keyframes sc-icon-pop {
    from { transform: scale(0) rotate(-10deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

.sc-rail-icon-av {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #5865f2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    user-select: none;
}
.sc-rail-icon-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.sc-lock-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    background: #1e1f22;
    border: 2px solid #57f287;
    border-radius: 50%;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #57f287;
    pointer-events: none;
    z-index: 1;
}

/* Счётчик непрочитанных сообщений секретного чата — зелёный, сверху-справа */
.sc-unread-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 16px; height: 16px;
    background: #57f287;
    color: #1e1f22;
    font-size: 10px; font-weight: 700;
    border-radius: 8px;
    padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    border: 2px solid #1e1f22;
    pointer-events: none;
    z-index: 2;
}
/* Бейдж «новый секретный чат» — красный с ! */
.sc-new-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 16px; height: 16px;
    background: #ed4245;
    color: #fff;
    font-size: 11px; font-weight: 900;
    border-radius: 8px;
    padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    border: 2px solid #1e1f22;
    pointer-events: none;
    z-index: 2;
    animation: sc-new-badge-pulse 1.4s ease-in-out infinite;
}
@keyframes sc-new-badge-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.2); }
}

/* ─── Rail context menu (server + secret chat) ───────────────── */
.rail-ctx-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1999;
}

.rail-ctx-menu {
    position: fixed;
    z-index: 2000;
    background: #18191c;
    border: 1px solid #040405;
    border-radius: 6px;
    padding: 4px 0;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,.6);
}

.rail-ctx-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #dcddde;
    font-size: 13px;
    text-align: left;
    padding: 8px 14px;
    cursor: pointer;
    transition: background .1s, color .1s;
}
.rail-ctx-item:hover { background: #5865f2; color: #fff; }
.rail-ctx-item--danger { color: #ed4245; }
.rail-ctx-item--danger:hover { background: #ed4245; color: #fff; }

.rail-ctx-sep {
    height: 1px;
    background: #3f4147;
    margin: 4px 0;
}
