* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif; background: #36393f; color: #dcddde; height: 100vh; overflow: hidden; touch-action: manipulation; }
.app-container { display: flex; height: 100vh; }

.top-banner { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: #18191c; border: 1px solid #3ba55d; color: #dcddde; padding: 10px 16px; border-radius: 8px; z-index: 3000; display: none; align-items: center; gap: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); font-size: 14px; max-width: 90vw; }
.top-banner.active { display: flex; }
.top-banner b { color: #3ba55d; font-size: 16px; letter-spacing: 2px; }
.top-banner .banner-note { color: #72767d; font-size: 12px; }
.banner-close { background: transparent; border: none; color: #b9bbbe; font-size: 16px; cursor: pointer; line-height: 1; }
.banner-close:hover { color: #fff; }

.auth-screen { position: fixed; inset: 0; background: #121316; display: none; align-items: center; justify-content: center; z-index: 1500; overflow: hidden; }
.auth-screen.active { display: flex; }
.auth-card { position: relative; z-index: 2; background: rgba(47, 49, 54, 0.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 12px; padding: 28px 24px; width: 420px; box-shadow: 0 16px 48px rgba(0,0,0,0.65); max-height: 90vh; overflow-y: auto; }
.auth-title { color: #fff; font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.auth-subtitle { color: #b9bbbe; font-size: 13px; text-align: center; margin-bottom: 16px; }
.auth-tabs { display: flex; margin-bottom: 16px; background: #2f3136; border-radius: 6px; padding: 4px; }
.auth-tab { flex: 1; padding: 8px; border: none; background: transparent; color: #b9bbbe; font-family: inherit; font-size: 14px; font-weight: 600; border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.auth-tab.active { background: #5865f2; color: #fff; }
.auth-field { margin-bottom: 12px; }
.auth-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: #b9bbbe; margin-bottom: 4px; }
.auth-input { width: 100%; background: #202225; border: 1px solid #40444b; border-radius: 4px; color: #dcddde; padding: 10px; font-family: inherit; font-size: 14px; outline: none; }
.auth-input:focus { border-color: #5865f2; }
.auth-row { display: flex; gap: 8px; }
.auth-row .auth-input { flex: 1; }
.auth-code-btn { background: #4f545c; color: #fff; border: none; border-radius: 4px; padding: 0 12px; font-size: 13px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.auth-code-btn:hover { background: #686d73; }
.auth-error { color: #ed4245; font-size: 13px; margin-top: 8px; min-height: 16px; }
.auth-submit { width: 100%; padding: 10px; border: none; border-radius: 4px; background: #5865f2; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; margin-top: 4px; }
.auth-submit:hover { background: #4752c4; }

.server-list { width: 72px; background: #202225; padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.server-icon { width: 48px; height: 48px; border-radius: 50%; background: #36393f; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; color: #fff; font-weight: 600; flex-shrink: 0; }
.server-icon:hover, .server-icon.active { border-radius: 16px; background: #5865f2; }
.server-icon.home { background: #5865f2; }
.server-icon.add-server { background: transparent; border: 2px solid #3ba55d; color: #3ba55d; }
.server-icon.add-server svg { width: 24px; height: 24px; fill: currentColor; }
.server-list .server-icon.add-server:hover { background: #3ba55d; color: #fff; border-radius: 50%; }
.separator { width: 32px; height: 2px; background: #36393f; margin: 4px 0; }

.dm-sidebar { width: 240px; background: #2f3136; display: flex; flex-direction: column; }
.dm-header { padding: 12px 16px 16px; border-bottom: 1px solid #202225; box-shadow: 0 1px 0 rgba(0,0,0,0.2); }
.activity-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
    background: #4f545c; color: #fff; border: none; border-radius: 4px;
    padding: 9px 4px; font-family: inherit; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: background 0.2s; white-space: nowrap; margin-bottom: 8px;
}
.activity-btn:hover { background: #686d73; }
.activity-btn svg { width: 14px; height: 14px; fill: currentColor; }
.activity-badge { background: #ed4245; color: #fff; border-radius: 10px; font-size: 10px; min-width: 16px; height: 16px; display: none; align-items: center; justify-content: center; padding: 0 4px; }
.activity-badge.active { display: flex; }
.search-bar { background: #202225; border: none; border-radius: 4px; padding: 8px; color: #dcddde; width: 100%; font-size: var(--ui-font, 14px); }
.search-bar::placeholder { color: #72767d; }
.dm-section-title { padding: 16px 8px 8px; font-size: var(--ui-font-sm, 12px); font-weight: 700; text-transform: uppercase; color: #96989d; letter-spacing: 0.02em; }
.dm-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.dm-item { display: flex; align-items: center; padding: 10px; border-radius: 4px; cursor: pointer; margin-bottom: 2px; transition: background 0.1s; }
.dm-item:hover { background: #34373c; }
.dm-item.active { background: #393c43; }
.dm-avatar { width: 32px; height: 32px; border-radius: 50%; margin-right: 12px; display: flex; align-items: center; justify-content: center; background: #5865f2; color: #fff; font-size: 14px; flex-shrink: 0; position: relative; }
.dm-avatar.has-img { background: transparent; }
.dm-avatar.has-img img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.dm-info { flex: 1; overflow: hidden; }
.dm-name { font-weight: 500; font-size: var(--ui-font, 14px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-preview { font-size: var(--ui-font-sm, 12px); color: #72767d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-empty-search { text-align: center; color: #72767d; font-size: var(--ui-font, 14px); padding: 16px 8px; }

.user-panel { background: #292b2f; padding: 8px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #202225; }
.user-avatar-wrapper { position: relative; cursor: pointer; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-status-indicator { position: absolute; bottom: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #292b2f; cursor: pointer; }
.user-info { flex: 1; overflow: hidden; cursor: pointer; }
.user-name { font-size: var(--ui-font, 14px); font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-tag { font-size: var(--ui-font-sm, 12px); color: #b9bbbe; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-actions { display: flex; gap: 4px; }
.user-action-btn { width: 32px; height: 32px; border-radius: 4px; background: transparent; border: none; color: #b9bbbe; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: all 0.2s; }
.user-action-btn:hover { background: #36393f; color: #dcddde; }

/* ===== Chat layout: main column + right side panel ===== */
.chat-area { flex: 1; display: flex; flex-direction: row; background: var(--chat-bg, #36393f); min-width: 0; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-header { height: 48px; padding: 0 16px; display: flex; align-items: center; border-bottom: 1px solid #202225; box-shadow: 0 1px 0 rgba(0,0,0,0.2); }
.mobile-back-btn { display: none; }
.chat-header-icon { width: 24px; height: 24px; border-radius: 50%; margin-right: 8px; background: #5865f2; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.chat-header-avatar { width: 24px; height: 24px; border-radius: 50%; margin-right: 8px; object-fit: cover; flex-shrink: 0; }
.chat-header-name { font-weight: 600; font-size: var(--ui-font-lg, 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-status { font-size: var(--ui-font-sm, 12px); color: #b9bbbe; margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-toggle-btn { margin-left: auto; background: transparent; border: none; color: #b9bbbe; font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 4px; flex-shrink: 0; }
.side-toggle-btn:hover { background: rgba(255,255,255,0.06); color: #dcddde; }
.messages-container { flex: 1; overflow-y: auto; padding: 16px 0; }

/* Right side profile panel (desktop only) */
.chat-side { width: 300px; background: #2f3136; border-left: 1px solid #202225; display: none; flex-direction: column; overflow-y: auto; flex-shrink: 0; }
.chat-side.active { display: flex; }
.side-banner { height: 90px; background: linear-gradient(135deg, #5865f2, #eb459e); background-size: cover; background-position: center; flex-shrink: 0; }
.side-body { padding: 0 16px 16px; }
.side-avatar { width: 64px; height: 64px; border-radius: 50%; border: 5px solid #2f3136; margin-top: -32px; object-fit: cover; background: #2f3136; display: block; cursor: pointer; }
.side-name { font-size: 17px; font-weight: 700; color: #fff; margin-top: 8px; }
.side-tag { font-size: 13px; color: #b9bbbe; }
.side-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #b9bbbe; margin-top: 6px; }
.side-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.side-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #b9bbbe; margin-top: 14px; margin-bottom: 4px; border-top: 1px solid #40444b; padding-top: 12px; }
.side-about { font-size: 13px; color: #dcddde; line-height: 1.45; white-space: pre-wrap; }
.side-full-btn { width: 100%; margin-top: 8px; }

.message-group { margin-bottom: 4px; padding: 2px 16px; position: relative; display: flex; }
.message-group:hover { background-color: rgba(255,255,255,0.03); }
.message-group.first-in-group { margin-top: 16px; }
body.compact .message-group { margin-bottom: 0; padding: 1px 16px; }
body.compact .message-group.first-in-group { margin-top: 8px; }
body.compact .message-avatar-img { width: 32px; height: 32px; }
body.compact .message-avatar-col { width: 32px; }
.message-avatar-col { width: 40px; flex-shrink: 0; margin-right: 16px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.message-avatar-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.compact-time { font-size: 10px; color: #72767d; opacity: 0; margin-top: 4px; width: 40px; text-align: center; }
body.compact .compact-time { width: 32px; }
.message-group:hover .compact-time.show-on-hover { opacity: 1; }
.message-group.show-actions .message-actions { display: flex; }
.message-content-col { flex: 1; min-width: 0; }
.message-header-row { display: flex; align-items: baseline; margin-bottom: 2px; }
.message-author { font-weight: 500; font-size: var(--ui-font, 14px); color: #fff; margin-right: 8px; cursor: pointer; }
.message-author:hover { text-decoration: underline; }
.message-time { font-size: var(--ui-font-sm, 12px); color: #72767d; }
.message-text-row { color: #dcddde; line-height: 1.375; word-wrap: break-word; position: relative; display: block; font-size: var(--msg-font, 15px); }
.edited-label { font-size: 10px; color: #72767d; margin-left: 4px; cursor: default; }

.msg-attachments { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.msg-attachment img, .msg-attachment video { max-width: 400px; max-height: 300px; border-radius: 8px; display: block; background: #2f3136; }
.msg-attachment audio { max-width: 400px; }
.file-card { display: flex; align-items: center; gap: 12px; background: #2f3136; border: 1px solid #202225; border-radius: 8px; padding: 12px; max-width: 400px; }
.file-icon { font-size: 28px; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { color: #00b0f4; font-weight: 500; font-size: 14px; text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-name:hover { text-decoration: underline; }
.file-size { font-size: 12px; color: #72767d; margin-top: 2px; }
.download-btn { width: 32px; height: 32px; border-radius: 4px; background: #40444b; display: flex; align-items: center; justify-content: center; color: #dcddde; text-decoration: none; font-size: 16px; flex-shrink: 0; }
.download-btn:hover { background: #4f545c; }

.message-actions { position: absolute; top: -12px; right: 16px; background: #36393f; border: 1px solid #202225; border-radius: 4px; display: none; box-shadow: 0 2px 4px rgba(0,0,0,0.2); z-index: 10; }
.message-group:hover .message-actions { display: flex; }
.action-btn { background: transparent; border: none; color: #b9bbbe; padding: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.action-btn:hover { color: #dcddde; background: #40444b; }
.action-btn svg { width: 20px; height: 20px; fill: currentColor; }

.edit-input-wrapper { background: #40444b; border-radius: 4px; padding: 8px; margin-top: 2px; }
.edit-input { width: 100%; background: transparent; border: none; color: #dcddde; font-size: var(--msg-font, 15px); outline: none; resize: none; font-family: inherit; line-height: 1.375; }
.edit-hint { font-size: 11px; color: #72767d; margin-top: 4px; }
.edit-hint span { color: #fff; cursor: pointer; }
.edit-hint span:hover { text-decoration: underline; }
.edit-attachments { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.edit-attach-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.edit-add-file { background: #4f545c; color: #fff; border: none; border-radius: 4px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.edit-add-file:hover { background: #686d73; }
.edit-attach-counter { font-size: 11px; color: #72767d; }
.edit-att-btn { width: 24px; height: 24px; border-radius: 50%; background: #202225; border: none; color: #dcddde; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.edit-att-btn:hover { background: #5865f2; }

.attachment-item { display: flex; align-items: center; gap: 10px; background: #36393f; border-radius: 6px; padding: 6px 8px; }
.attachment-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.attachment-item .file-icon { font-size: 26px; width: 44px; text-align: center; flex-shrink: 0; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name { font-size: 14px; font-weight: 500; color: #dcddde; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-size { font-size: 12px; color: #72767d; margin-top: 2px; }
.remove-attachment { width: 24px; height: 24px; border-radius: 50%; background: #202225; border: none; color: #dcddde; cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: auto; }
.remove-attachment:hover { background: #ed4245; }

.input-area { padding: 0 16px 24px; position: relative; }
/* ===== Emoji Autocomplete Popup ===== */
.emoji-autocomplete {
    position: absolute;
    bottom: calc(100% - 14px);
    left: 16px;
    background: #2f3136;
    border: 1px solid #202225;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    display: none;
    flex-direction: column;
    max-height: 250px;
    width: min(320px, calc(100vw - 32px));
    z-index: 100;
    overflow: hidden;
}
.emoji-autocomplete.active { display: flex; }
.emoji-ac-header {
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #b9bbbe;
    background: #292b2f;
    border-bottom: 1px solid #202225;
    letter-spacing: 0.03em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.emoji-ac-header span { color: #fff; }
.emoji-ac-hint { font-size: 10px; color: #72767d; text-transform: none; font-weight: normal; }
.emoji-ac-list {
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.emoji-ac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
}
.emoji-ac-item:hover, .emoji-ac-item.selected {
    background: #40444b;
}
.emoji-ac-char {
    font-size: 22px;
    line-height: 1;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.emoji-ac-code {
    font-size: 14px;
    font-weight: 500;
    color: #dcddde;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.emoji-ac-item.selected .emoji-ac-code {
    color: #fff;
    font-weight: 600;
}

.attachment-preview { background: #2f3136; border: 1px solid #202225; border-radius: 8px; padding: 8px; margin-bottom: 8px; display: none; flex-direction: column; gap: 6px; max-width: 400px; }
.attachment-preview.active { display: flex; }
.attachments-counter { font-size: 11px; color: #72767d; padding: 0 2px; }
.message-input-wrapper { background: #40444b; border-radius: 8px; padding: 4px; display: flex; align-items: flex-end; gap: 4px; }
.message-input { flex: 1; background: transparent; border: none; color: #dcddde; font-size: var(--msg-font, 15px); outline: none; resize: none; font-family: inherit; padding: 8px; max-height: 200px; overflow-y: auto; }
.message-input::placeholder { color: #72767d; }
.input-btn { width: 36px; height: 36px; border-radius: 50%; background: transparent; border: none; color: #b9bbbe; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.input-btn:hover { color: #dcddde; background: rgba(255,255,255,0.06); }
.input-btn.send-btn { color: #5865f2; }
.input-btn.send-btn:hover { color: #4752c4; }
.input-btn svg { width: 24px; height: 24px; fill: currentColor; }
.hidden-file-input { display: none; }

.emoji-picker-container { position: absolute; bottom: 70px; right: 24px; background: #18191c; border-radius: 8px; padding: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); display: none; z-index: 100; width: 280px; }
.emoji-picker-container.active { display: block; }
.emoji-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-height: 200px; overflow-y: auto; }
.emoji-item { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; border-radius: 4px; transition: background 0.1s; }
.emoji-item:hover { background: #36393f; }

/* ===== Mini profile popout ===== */
.mini-profile { position: fixed; width: 300px; max-width: 92vw; background: #2f3136; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); z-index: 900; display: none; overflow-y: auto; max-height: 85vh; }
.mini-profile.active { display: block; }
.mp-banner { height: 60px; background: linear-gradient(135deg, #5865f2, #eb459e); background-size: cover; background-position: center; }
.mp-body { padding: 0 14px 14px; }
.mp-avatar { width: 56px; height: 56px; border-radius: 50%; border: 4px solid #2f3136; margin-top: -28px; object-fit: cover; background: #2f3136; display: block; }
.mp-name { font-size: 15px; font-weight: 700; color: #fff; margin-top: 6px; }
.mp-tag { font-size: 12px; color: #b9bbbe; }
.mp-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #b9bbbe; margin-top: 6px; }
.mp-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.mp-about { font-size: 12px; color: #dcddde; margin-top: 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mp-actions { display: flex; gap: 6px; margin-top: 10px; }
.mp-actions .btn { padding: 6px 10px; font-size: 12px; flex: 1; }

.confirm-modal { background: #36393f; border-radius: 8px; width: 440px; padding: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); }
.confirm-title { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.confirm-text { font-size: 14px; color: #b9bbbe; line-height: 1.5; margin-bottom: 16px; }
.confirm-preview { background: #2f3136; border-left: 3px solid #ed4245; border-radius: 4px; padding: 8px 12px; margin-bottom: 16px; font-size: 13px; color: #dcddde; max-height: 80px; overflow: hidden; display: flex; align-items: center; gap: 8px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-danger { background: #ed4245; color: #fff; }
.btn-danger:hover { background: #c0353a; }

.friend-input-row { display: flex; align-items: center; background: #202225; border: 1px solid #40444b; border-radius: 4px; margin-bottom: 8px; }
.friend-input-row:focus-within { border-color: #5865f2; }
.friend-at { padding: 0 4px 0 10px; color: #72767d; font-weight: 600; font-size: 14px; }
.friend-input-row .field-input { border: none; background: transparent; }
.friend-success { color: #3ba55d; font-size: 13px; min-height: 16px; margin-bottom: 8px; font-weight: 600; }

/* ===== Fullscreen windows (Activity & Settings) ===== */
.fullscreen-window { background: #2f3136; width: 100%; height: 100%; display: flex; flex-direction: column; border-radius: 0; box-shadow: none; }
.fw-header { padding: 14px 20px; border-bottom: 1px solid #202225; display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 700; font-size: 17px; background: #292b2f; flex-shrink: 0; }
.fw-body { padding: 20px 16px; overflow-y: auto; flex: 1; }
.fw-content { width: 100%; max-width: 720px; margin: 0 auto; }
.settings-close { background: transparent; border: none; color: #b9bbbe; font-size: 20px; cursor: pointer; line-height: 1; }
.settings-close:hover { color: #fff; }

.activity-add-row { display: flex; gap: 8px; align-items: stretch; }
.activity-add-row .friend-input-row { flex: 1; margin-bottom: 0; }
.activity-add-row .btn { flex-shrink: 0; }
.activity-section { margin-top: 22px; }
.req-row { display: flex; align-items: center; gap: 10px; background: #36393f; border-radius: 6px; padding: 8px; margin-bottom: 6px; }
.req-row.clickable { cursor: pointer; }
.req-row.clickable:hover { background: #393c43; }
.req-row img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.req-info { flex: 1; min-width: 0; }
.req-name { font-weight: 600; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-tag { font-size: 12px; color: #b9bbbe; }
.req-actions { display: flex; gap: 6px; }
.req-btn { width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.req-accept { background: #3ba55d; color: #fff; }
.req-accept:hover { background: #2d7d46; }
.req-decline { background: #4f545c; color: #fff; }
.req-decline:hover { background: #ed4245; }
.empty-state-text { color: #72767d; font-size: 13px; padding: 6px 0; line-height: 1.5; }

.settings-account-card { display: flex; align-items: center; gap: 12px; background: #36393f; border: 1px solid #202225; border-radius: 8px; padding: 12px; max-width: 520px; }
.settings-account-card img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sac-info { flex: 1; min-width: 0; }
.sac-name { font-weight: 600; color: #fff; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sac-tag { font-size: 12px; color: #b9bbbe; }
.sac-email { font-size: 12px; color: #72767d; margin-top: 2px; word-break: break-all; }
.settings-section { margin-top: 26px; }
.settings-section-title { font-size: var(--ui-font-sm, 12px); font-weight: 700; text-transform: uppercase; color: #b9bbbe; margin-bottom: 6px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #40444b; }
.set-info { flex: 1; min-width: 0; }
.set-label { font-size: var(--ui-font, 14px); color: #dcddde; font-weight: 500; }
.set-desc { font-size: var(--ui-font-sm, 12px); color: #72767d; margin-top: 2px; }
.set-range { width: 150px; accent-color: #5865f2; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: #72767d; border-radius: 11px; transition: .2s; cursor: pointer; }
.switch .slider:before { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; }
.switch input:checked + .slider { background: #3ba55d; }
.switch input:checked + .slider:before { transform: translateX(18px); }
.pwd-block { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid #40444b; max-width: 380px; }
.settings-save-row { display: flex; gap: 8px; margin-top: 26px; padding-top: 16px; border-top: 1px solid #40444b; flex-wrap: wrap; }
.settings-footer { margin-top: 28px; padding-top: 16px; border-top: 1px solid #40444b; display: flex; justify-content: flex-end; gap: 8px; }

.avatar-editor-modal { background: #2f3136; border-radius: 8px; width: 360px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); }
.ae-header { padding: 16px; border-bottom: 1px solid #202225; display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 700; font-size: 16px; }
.ae-body { padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ae-viewport { width: 280px; height: 280px; border-radius: 50%; overflow: hidden; position: relative; background: #202225; cursor: grab; touch-action: none; flex-shrink: 0; }
.ae-viewport.dragging { cursor: grabbing; }
.ae-viewport img { position: absolute; top: 0; left: 0; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.ae-controls { width: 100%; display: flex; align-items: center; gap: 8px; }
.ae-zoom-btn { width: 28px; height: 28px; border-radius: 4px; background: #4f545c; border: none; color: #fff; cursor: pointer; font-size: 16px; flex-shrink: 0; }
.ae-zoom-btn:hover { background: #686d73; }
#aeZoomRange { flex: 1; accent-color: #5865f2; }
.ae-hint { font-size: 11px; color: #72767d; text-align: center; }
.ae-actions { padding: 0 16px 16px; display: flex; justify-content: flex-end; gap: 8px; }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
#activityModal { z-index: 1050; background: #2f3136; }
#settingsModal { z-index: 1050; background: #2f3136; }
#profileModal { z-index: 1100; }
#avatarEditorModal { z-index: 1150; }
#unsavedModal { z-index: 1200; }
#genericConfirmModal { z-index: 1250; }
.profile-modal { background: #2f3136; border-radius: 8px; width: 600px; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.4); position: relative; }
.profile-banner { height: 120px; background: linear-gradient(135deg, #5865f2, #eb459e); position: relative; background-size: cover; background-position: center; }
.profile-close { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.5); border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; z-index: 10; }
.profile-body { padding: 0 24px 24px; position: relative; }
.profile-avatar-container { position: relative; width: 80px; height: 80px; margin-top: -40px; z-index: 1; cursor: pointer; }
.profile-avatar-large { width: 80px; height: 80px; border-radius: 50%; border: 6px solid #2f3136; object-fit: cover; background-color: #2f3136; }
.avatar-edit-overlay { position: absolute; top: 0; left: 0; width: 80px; height: 80px; border-radius: 50%; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; border: 6px solid #2f3136; }
.profile-avatar-container:hover .avatar-edit-overlay { opacity: 1; }
.avatar-edit-overlay span { color: #fff; font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; }
.avatar-upload-input { display: none; }
.profile-name-section { margin-top: 12px; }
.profile-display-name { font-size: 20px; font-weight: 600; color: #fff; }
.profile-username { font-size: 14px; color: #b9bbbe; margin-top: 4px; }
.profile-badges { display: flex; gap: 8px; margin-top: 12px; }
.badge { background: #5865f2; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge.creator { background: #faa61a; }
.profile-section { margin-top: 24px; padding-top: 16px; border-top: 1px solid #40444b; }
.profile-section-title { font-size: var(--ui-font-sm, 12px); font-weight: 700; text-transform: uppercase; color: #b9bbbe; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.edit-btn { font-size: 12px; color: #00b0f4; cursor: pointer; text-transform: none; font-weight: 500; background: none; border: none; font-family: inherit; }
.profile-about { font-size: 14px; color: #dcddde; line-height: 1.5; white-space: pre-wrap; }
.field-group { margin-bottom: 12px; }
.field-label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #b9bbbe; margin-bottom: 4px; }
.field-input { width: 100%; background: #202225; border: 1px solid #40444b; border-radius: 4px; color: #dcddde; padding: 8px; font-family: inherit; font-size: 14px; outline: none; }
.about-textarea { width: 100%; min-height: 80px; background: #202225; border: 1px solid #40444b; border-radius: 4px; color: #dcddde; padding: 8px; font-family: inherit; font-size: 14px; resize: vertical; outline: none; line-height: 1.5; }

.banner-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner-color-input { width: 44px; height: 34px; padding: 2px; border: 1px solid #40444b; border-radius: 4px; background: #202225; cursor: pointer; }
.banner-hint { font-size: 11px; color: #72767d; margin-top: 6px; }

.edit-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }
.btn { padding: 8px 16px; border-radius: 4px; border: none; font-size: var(--ui-font, 14px); font-weight: 500; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.btn-primary { background: #5865f2; color: #fff; }
.btn-success { background: #3ba55d; color: #fff; }
.btn-secondary { background: #4f545c; color: #fff; }

.status-modal { background: #18191c; border-radius: 8px; padding: 8px; min-width: 200px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); position: absolute; bottom: 60px; left: 8px; z-index: 1001; }
.status-option { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 4px; cursor: pointer; transition: background 0.1s; }
.status-option:hover { background: #36393f; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-indicator { position: absolute; bottom: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #2f3136; }
.status-online { background: #3ba55d; } .status-idle { background: #faa61a; } .status-dnd { background: #ed4245; } .status-invisible { background: #747f8d; } .status-offline { background: #747f8d; }
.status-text { font-size: 14px; color: #dcddde; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #2f3136; }
::-webkit-scrollbar-thumb { background: #202225; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #1a1c1f; }
.no-chat-selected { flex: 1; display: flex; align-items: center; justify-content: center; color: #72767d; font-size: var(--ui-font-lg, 16px); }

/* ================= MOBILE ================= */
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .server-list { flex-direction: row; width: 100%; height: 56px; padding: 6px 10px; gap: 8px; flex-shrink: 0; overflow-x: auto; align-items: center; }
    .server-icon { width: 40px; height: 40px; font-size: 14px; }
    .server-icon.add-server svg { width: 20px; height: 20px; }
    .separator { width: 2px; height: 32px; margin: 0 2px; }
    .dm-sidebar { width: 100%; flex: 1; min-height: 0; }
    .chat-area { display: none; flex: 1; min-height: 0; }
    body.mobile-chat-open .dm-sidebar { display: none; }
    body.mobile-chat-open .chat-area { display: flex; }
    .mobile-back-btn { display: flex; width: 34px; height: 34px; border-radius: 6px; background: transparent; border: none; color: #dcddde; font-size: 20px; cursor: pointer; margin-right: 10px; align-items: center; justify-content: center; flex-shrink: 0; }
    .mobile-back-btn:active { background: rgba(255,255,255,0.06); }
    .dm-header { padding: 10px 12px 12px; }
    .activity-btn { font-size: 13px; padding: 10px 4px; }
    .dm-section-title { padding: 12px 8px 6px; }
    .message-input { font-size: max(16px, var(--msg-font, 15px)); }
    .auth-input, .field-input, .about-textarea, .search-bar { font-size: 16px; }
    .msg-attachment img, .msg-attachment video { max-width: 100%; max-height: 60vh; }
    .msg-attachment audio { max-width: 100%; }
    .file-card { max-width: 100%; }
    .attachment-preview { max-width: 100%; }
    .input-area { padding: 0 10px calc(14px + env(safe-area-inset-bottom, 0px)); }
    .messages-container { padding: 12px 0; }
    .message-group { padding: 2px 12px; }
    body.compact .message-group { padding: 1px 12px; }
    .message-actions { right: 12px; }
    .profile-modal, .confirm-modal, .avatar-editor-modal { width: calc(100vw - 16px); max-width: 600px; }
    .auth-card { width: calc(100vw - 24px); max-width: 420px; padding: 20px 16px; }
    .profile-body { padding: 0 16px 20px; }
    .fw-body { padding: 14px 12px; }
    .emoji-picker-container { right: 10px; width: min(280px, calc(100vw - 20px)); }
    .status-modal { left: 8px; bottom: 56px; }
    .top-banner { flex-wrap: wrap; justify-content: center; text-align: center; top: 8px; }
    .activity-add-row { flex-direction: column; }
    .activity-add-row .btn { width: 100%; }
    .settings-account-card { max-width: 100%; }
    .set-range { width: 110px; }
    .chat-side, .side-toggle-btn { display: none !important; }
    .mini-profile { width: min(280px, calc(100vw - 16px)); }
}

@media (hover: none) {
    .compact-time.show-on-hover { opacity: 1; }
    .message-group:active { background-color: rgba(255,255,255,0.03); }
    .dm-item:active { background: #393c43; }
}
/* ===== Media Lightbox (приближение файлов) ===== */
.msg-attachment img { cursor: zoom-in; }
.video-thumb { position: relative; width: fit-content; cursor: pointer; }
.video-thumb video { pointer-events: none; }
.video-play-badge {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(0,0,0,0.6); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; pointer-events: none;
}
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 1300; display: none; align-items: center; justify-content: center; }
.lightbox.active { display: flex; }
.lightbox-close {
    position: absolute; top: 12px; right: 16px;
    background: rgba(255,255,255,0.12); border: none; color: #fff;
    width: 40px; height: 40px; border-radius: 50%; font-size: 22px;
    cursor: pointer; z-index: 2; line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#lightboxImg { max-width: 92vw; max-height: 86vh; user-select: none; -webkit-user-drag: none; cursor: zoom-in; will-change: transform; }
#lightboxVideo { max-width: 92vw; max-height: 86vh; }
.lightbox-hint {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    color: #b9bbbe; font-size: 12px; background: rgba(0,0,0,0.55);
    padding: 6px 12px; border-radius: 6px; white-space: nowrap;
}
@media (max-width: 768px) {
    .video-thumb video { max-width: 100%; max-height: 60vh; }
}
@media (hover: none) {
    .lightbox-hint { display: none; }
}
/* ===== Profile menu (3 dots) ===== */
#profileMenuBtn { font-size: 20px; font-weight: 700; line-height: 1; }
.profile-menu {
    position: absolute; top: 48px; right: 12px;
    background: #18191c; border-radius: 6px; padding: 6px;
    min-width: 210px; box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    display: none; z-index: 20;
}
.profile-menu.active { display: block; }
.profile-menu-item { padding: 8px 10px; border-radius: 4px; font-size: 14px; color: #dcddde; cursor: pointer; }
.profile-menu-item:hover { background: #36393f; }
.profile-menu-item.danger { color: #ed4245; }
.profile-menu-item.danger:hover { background: rgba(237,66,69,0.15); }

/* ===== Blocked notice ===== */
.blocked-notice {
    background: rgba(237,66,69,0.12); border: 1px solid rgba(237,66,69,0.4);
    color: #ed4245; border-radius: 8px; padding: 12px;
    font-size: 14px; text-align: center;
}

/* ===== Admin panel ===== */
.admin-subtitle { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #dcddde; margin: 12px 0 6px; }
.admin-report-text { font-size: 12px; color: #b9bbbe; margin-top: 4px; white-space: pre-wrap; }
.req-row.resolved { opacity: 0.55; }
.report-select { margin-bottom: 8px; }
/* ===== Автоскрытие баннера уведомлений ===== */
.top-banner { transition: opacity 0.25s ease, transform 0.25s ease; }
.top-banner.closing { opacity: 0; transform: translateX(-50%) translateY(-10px); }

/* ===== СЕРВЕРЫ И КАНАЛЫ ===== */
.custom-servers-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}
@media (max-width: 768px) {
    .custom-servers-list { flex-direction: row; width: auto; gap: 8px; }
}
.server-icon.custom-server { overflow: hidden; }
.server-icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.server-abbr { font-size: 15px; font-weight: 700; color: #fff; text-transform: uppercase; }

.sidebar-main-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.server-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #202225;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    cursor: pointer;
    position: relative;
    font-weight: 700;
    color: #fff;
    font-size: 15px;
    transition: background 0.15s;
    user-select: none;
}
.server-header:hover { background: rgba(255,255,255,0.04); }
.server-header-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.server-menu-toggle {
    background: transparent;
    border: none;
    color: #b9bbbe;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.server-dropdown-menu {
    position: absolute;
    top: 52px;
    left: 8px;
    right: 8px;
    background: #111214;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 100;
}
.server-dropdown-menu.active {
    display: flex;
    animation: dropdownSlideIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.server-dropdown-item {
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 13.5px;
    color: #dbdee1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
    user-select: none;
}
.server-dropdown-item:hover { background: #5865f2; color: #fff; }
.server-dropdown-item .sdi-icon {
    font-size: 14px;
    width: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.server-dropdown-item .sdi-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.server-dropdown-item.sdi-boost {
    color: #f47fff;
}
.server-dropdown-item.sdi-boost:hover {
    background: #f47fff;
    color: #fff;
}
.server-dropdown-item.danger { color: #ed4245; }
.server-dropdown-item.danger:hover { background: #ed4245; color: #fff; }
.server-dropdown-separator {
    height: 1px;
    background: #232428;
    margin: 4px 2px;
}
.server-dropdown-item.sdi-checkbox-item {
    justify-content: space-between;
}
.sdi-checkbox {
    accent-color: #5865f2;
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-left: 8px;
}

.server-sidebar-banner {
    height: 125px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
    box-shadow: inset 0 -35px 25px -10px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.channels-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 12px 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #96989d;
    letter-spacing: 0.02em;
}
.csh-title { flex: 1; }
.add-channel-btn {
    background: transparent;
    border: none;
    color: #96989d;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    transition: color 0.15s;
}
.add-channel-btn:hover { color: #fff; }

.channels-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
}
.channel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 4px;
    color: #96989d;
    cursor: pointer;
    margin-bottom: 2px;
    transition: all 0.1s;
    position: relative;
    user-select: none;
}
.channel-item:hover { background: #34373c; color: #dcddde; }
.channel-item.active { background: #393c43; color: #fff; font-weight: 500; }
.channel-hash {
    font-size: 18px;
    font-weight: 600;
    color: #72767d;
    line-height: 1;
    width: 18px;
    text-align: center;
}
.channel-item.active .channel-hash { color: #b9bbbe; }
.channel-name {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.channel-delete-btn {
    background: transparent;
    border: none;
    color: #72767d;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}
.channel-item:hover .channel-delete-btn { opacity: 1; }
.channel-delete-btn:hover { color: #ed4245; }

.chat-header-icon.channel-icon {
    font-size: 18px;
    font-weight: 700;
    background: #4f545c;
    color: #fff;
}

/* Модальные окна серверов */
.server-icon-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}
.server-icon-preview-box {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px dashed #5865f2;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: #202225;
    transition: border-color 0.2s;
}
.server-icon-preview-box:hover { border-color: #fff; }
.server-icon-preview-box img { width: 100%; height: 100%; object-fit: cover; }
.server-icon-placeholder {
    text-align: center;
    font-size: 11px;
    color: #b9bbbe;
    font-weight: 600;
    line-height: 1.3;
}
.server-icon-placeholder.large {
    font-size: 32px;
    color: #fff;
}
.server-icon-preview-box.large {
    width: 84px;
    height: 84px;
    border: 4px solid #2f3136;
    flex-shrink: 0;
}
.server-icon-hint { font-size: 11px; color: #72767d; text-align: center; }

.channel-input-wrapper {
    display: flex;
    align-items: center;
    background: #202225;
    border: 1px solid #40444b;
    border-radius: 4px;
}
.channel-hash-prefix {
    padding: 0 8px 0 12px;
    color: #72767d;
    font-size: 18px;
    font-weight: 700;
}
.channel-input-wrapper .field-input {
    border: none;
    background: transparent;
    padding-left: 0;
}

.server-settings-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}
.server-settings-icon-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
#createServerModal, #createChannelModal { z-index: 1150; }
#serverSettingsModal { z-index: 1160; }
#inviteModal { z-index: 1170; }

/* ===== УЧАСТНИКИ СЕРВЕРА (СПИСОК СПРАВА) ===== */
.owner-crown {
    display: inline-block;
    font-size: 13px;
    margin-left: 5px;
    line-height: 1;
    vertical-align: middle;
    cursor: help;
    filter: drop-shadow(0 0 2px rgba(255,215,0,0.6));
}

.server-members-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #2f3136;
}
.server-members-header {
    padding: 14px 16px 10px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #202225;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.smh-title { text-transform: uppercase; font-size: 12px; letter-spacing: 0.03em; color: #b9bbbe; }
.smh-count {
    font-size: 12px;
    background: #202225;
    padding: 2px 8px;
    border-radius: 10px;
    color: #dcddde;
    font-weight: 600;
}
.server-members-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sm-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #96989d;
    letter-spacing: 0.03em;
    padding: 12px 8px 4px;
}
.sm-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
}
.sm-member-row:hover { background: #34373c; }
.sm-avatar-wrap {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.sm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.sm-info {
    flex: 1;
    min-width: 0;
}
.sm-name {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: #dcddde;
}
.sm-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sm-tag {
    font-size: 11px;
    color: #72767d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== ПРИГЛАШЕНИЯ И ССЫЛКИ MEOWCORD.GG ===== */
.invite-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.invite-input-row .field-input {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
    color: #00b0f4;
    font-weight: 600;
}
.invite-friends-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}
.invite-friend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #202225;
    border-radius: 6px;
    padding: 8px 10px;
}
.invite-badge-joined {
    font-size: 12px;
    color: #72767d;
    font-weight: 500;
    padding: 4px 8px;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
}

/* Карточка-приглашение в чате */
.server-invite-card {
    background: #2f3136;
    border: 1px solid #202225;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 8px 0;
    max-width: 440px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.invite-card-subtitle {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #b9bbbe;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}
.invite-card-body {
    display: flex;
    align-items: center;
    gap: 12px;
}
.invite-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}
.invite-card-abbr {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #5865f2;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.invite-card-info {
    flex: 1;
    min-width: 0;
}
.invite-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.invite-card-members {
    font-size: 12px;
    color: #3ba55d;
    font-weight: 500;
    margin-top: 2px;
}
.invite-card-btn {
    padding: 8px 16px;
    font-size: 13px;
    flex-shrink: 0;
}
.server-dropdown-item.invite-action {
    color: #5865f2;
    font-weight: 600;
}
.server-dropdown-item.invite-action:hover {
    background: #5865f2;
    color: #fff;
}

/* ===== LOADING SPLASH OVERLAY ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 19, 23, 0.96);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 32px 40px;
    border-radius: 12px;
    background: #202225;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    animation: loadingPop 0.25s ease-out;
}

@keyframes loadingPop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.loading-spinner-box {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(88, 101, 242, 0.2);
    border-top-color: #5865f2;
    border-right-color: #eb459e;
    animation: loadingRingSpin 0.9s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

@keyframes loadingRingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-icon {
    font-size: 32px;
    user-select: none;
    animation: loadingIconPulse 1.4s ease-in-out infinite;
}

@keyframes loadingIconPulse {
    0%, 100% { transform: scale(0.94); opacity: 0.85; }
    50% { transform: scale(1.15); opacity: 1; }
}

.loading-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.loading-subtitle {
    font-size: 13px;
    color: #b9bbbe;
    max-width: 260px;
}

/* ===== INVITE FRIENDS LIST ===== */
.invite-friends-box {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.invite-friend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #2f3136;
    border-radius: 6px;
}

.invite-badge-joined {
    font-size: 12px;
    font-weight: 600;
    color: #3ba55d;
    background: rgba(59, 165, 93, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
}

/* ===== CROWN & SHIELDS ===== */
.owner-crown {
    display: inline-block;
    font-size: 13px;
    margin-left: 4px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

.admin-shield {
    display: inline-block;
    font-size: 12px;
    margin-left: 4px;
}

.role-shield-icon {
    font-size: 12px;
    margin-left: auto;
}

/* ===== SERVER SETTINGS & ROLES MANAGER ===== */
.server-settings-modal {
    width: 660px;
    max-width: 95vw;
}

.roles-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
}

.roles-manager-layout {
    display: flex;
    gap: 14px;
    height: 380px;
    background: #202225;
    border-radius: 8px;
    border: 1px solid #40444b;
    overflow: hidden;
}

.roles-sidebar-list {
    width: 200px;
    background: #292b2f;
    border-right: 1px solid #202225;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.role-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #dcddde;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.role-sidebar-item:hover {
    background: #36393f;
    color: #fff;
}

.role-sidebar-item.selected {
    background: #393c43;
    color: #fff;
}

.role-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.role-sidebar-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-editor-pane {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.role-editor-card {
    display: flex;
    flex-direction: column;
}

.admin-perm-box {
    background: #2f3136;
    border: 1px solid #40444b;
    border-radius: 8px;
    padding: 14px;
}

.admin-perm-box .set-row {
    border-top: none;
    padding: 0;
}

/* ===== MEMBERS TAB & ROLE ASSIGNMENT ===== */
.server-members-manage-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.member-manage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #202225;
    border-radius: 6px;
    border: 1px solid #2f3136;
    gap: 12px;
}

.member-manage-info {
    display: flex;
    flex-direction: column;
    min-width: 140px;
    flex: 1;
}

.member-roles-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    max-width: 60%;
}

.role-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    background: #2f3136;
    color: #8e9297;
    border: 1px solid #40444b;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.role-pill-badge:hover {
    border-color: #5865f2;
    color: #dcddde;
}

.role-pill-badge.active {
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.role-pill-badge .rpb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== SERVER BANS MANAGEMENT TAB ===== */
.server-bans-manage-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.ban-manage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #202225;
    border-radius: 6px;
    border: 1px solid #2f3136;
    gap: 12px;
    transition: background 0.15s ease;
}

.ban-manage-row:hover {
    background: #282a2e;
}

.ban-manage-info {
    display: flex;
    flex-direction: column;
    min-width: 140px;
    flex: 1;
}

.ban-unban-btn {
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 600;
    transition: all 0.15s ease;
}

.ban-unban-btn:hover {
    background: #3ba55d !important;
    border-color: #3ba55d !important;
    color: #fff !important;
}

/* ===== ACCOUNT SWITCHER POPUP (RIGHT CLICK ON AVATAR) ===== */
.account-switcher-popup {
    position: absolute;
    bottom: 60px;
    left: 8px;
    width: 300px;
    max-width: 92vw;
    background: #18191c;
    border-radius: 8px;
    box-shadow: 0 10px 36px rgba(0,0,0,0.7);
    border: 1px solid #2f3136;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: asPopIn 0.16s ease-out;
    z-index: 1001;
}

@keyframes asPopIn {
    from { transform: scale(0.94) translateY(6px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.as-header {
    padding: 14px 14px 10px;
    border-bottom: 1px solid #202225;
    background: #121316;
}

.as-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.2px;
}

.as-subtitle {
    font-size: 11px;
    color: #8e9297;
    margin-top: 2px;
}

.as-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.as-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
    user-select: none;
}

.as-item:hover {
    background: #2f3136;
}

.as-item.current {
    background: rgba(88, 101, 242, 0.12);
}

.as-item.current:hover {
    background: rgba(88, 101, 242, 0.2);
}

.as-avatar-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.as-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #2f3136;
}

.as-avatar-wrap .status-indicator {
    width: 12px;
    height: 12px;
    border: 2.5px solid #18191c;
    bottom: -1px;
    right: -1px;
}

.as-info {
    flex: 1;
    min-width: 0;
}

.as-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.as-tag {
    font-size: 11px;
    color: #8e9297;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.as-current-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #3ba55d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(59, 165, 93, 0.3);
}

.as-remove-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #72767d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    opacity: 0;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.as-item:hover .as-remove-btn {
    opacity: 1;
}

.as-remove-btn:hover {
    background: #ed4245;
    color: #fff;
}

.as-footer {
    padding: 6px;
    border-top: 1px solid #202225;
    background: #141518;
}

.as-add-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #dcddde;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    font-family: inherit;
}

.as-add-btn:hover {
    background: #2f3136;
    color: #fff;
}

.as-add-icon {
    font-size: 14px;
}

/* Delete button hover in chat messages */
.action-btn.action-btn-delete:hover {
    color: #ed4245;
    background: rgba(237, 66, 69, 0.15);
}

/* ===== JOIN SERVER CONFIRMATION MODAL ===== */
.join-server-card {
    position: relative;
    width: 450px;
    max-width: 92vw;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.75);
    background: #202225;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: joinCardPop 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes joinCardPop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.join-server-banner-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(14px) brightness(0.7);
    transform: scale(1.18);
    z-index: 0;
    opacity: 0.65;
    transition: background-image 0.25s ease;
}

.join-server-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20, 22, 26, 0.4) 0%, rgba(20, 22, 26, 0.94) 75%);
    z-index: 1;
}

.join-server-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.join-server-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.join-server-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 38px 30px 30px;
}

.join-server-subtitle {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b9bbbe;
    margin-bottom: 18px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.join-server-icon-wrap {
    width: 90px;
    height: 90px;
    border-radius: 30px;
    background: #5865f2;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    border: 3px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.join-server-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.join-server-abbr {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.join-server-name {
    font-size: 23px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    word-break: break-word;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.join-server-meta {
    font-size: 13px;
    color: #b9bbbe;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.join-server-members-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3ba55d;
    font-weight: 600;
    background: rgba(59, 165, 93, 0.15);
    padding: 4px 12px;
    border-radius: 12px;
}

.join-server-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.join-server-btn {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    justify-content: center;
    display: flex;
    align-items: center;
    font-family: inherit;
}

.join-server-btn.primary {
    background: #5865f2;
}

.join-server-btn.primary:hover {
    background: #4752c4;
}

/* ===== SERVER ADMIN MODERATION IN MINI-PROFILE ===== */
.mp-server-admin-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #40444b;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mp-admin-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #96989d;
    letter-spacing: 0.03em;
}
.mp-roles-block {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mp-roles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: #b9bbbe;
}
.mp-add-role-btn {
    background: #4f545c;
    border: none;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.mp-add-role-btn:hover {
    background: #5865f2;
}
.mp-roles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 20px;
}
.mp-role-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: opacity 0.15s;
}
.mp-role-pill:hover {
    opacity: 0.8;
}
.mp-role-x {
    font-size: 13px;
    line-height: 1;
    margin-left: 2px;
}
.mp-role-picker-dropdown {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    background: #18191c;
    border: 1px solid #40444b;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 50;
    max-height: 140px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mp-role-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #dcddde;
    cursor: pointer;
}
.mp-role-picker-item:hover {
    background: #2f3136;
}
.mp-role-picker-item.active {
    background: rgba(88, 101, 242, 0.15);
    color: #fff;
    font-weight: 600;
}
.mp-role-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}
.mp-warn-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #b9bbbe;
    background: #202225;
    padding: 6px 10px;
    border-radius: 6px;
}
.mp-admin-actions {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}
.mp-action-btn {
    flex: 1;
    padding: 6px 4px !important;
    font-size: 11px !important;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mp-action-btn.warn:hover {
    background: #faa61a;
    color: #000;
}
.mp-action-btn.kick:hover {
    background: #ed4245;
    color: #fff;
}
.mp-action-btn.ban {
    background: rgba(237, 66, 69, 0.15);
    color: #ed4245;
    border: 1px solid rgba(237, 66, 69, 0.4);
}
.mp-action-btn.ban:hover {
    background: #ed4245;
    color: #fff;
}

/* ===== SERVER CREATION TEMPLATES MODAL (DISCORD STYLE) ===== */
.server-template-modal {
    position: relative;
    width: 440px;
    max-width: 94vw;
    background: #313338;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65);
    border: 1px solid #383a40;
    box-sizing: border-box;
    animation: modalPop 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.server-modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #b5bac1;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    z-index: 10;
}

.server-modal-close-btn:hover {
    color: #f2f3f5;
    background: rgba(255, 255, 255, 0.08);
}

.template-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.template-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #f2f3f5;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.template-modal-desc {
    font-size: 14px;
    color: #b5bac1;
    line-height: 1.4;
    max-width: 380px;
    margin: 0 auto;
}

.template-cards-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 2px;
}

.template-card-btn {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #2b2d31;
    border: 1px solid #383a40;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    user-select: none;
}

.template-card-btn:hover {
    background: #35373c;
    border-color: #4e5058;
    transform: translateY(-1px);
}

.template-card-btn:active {
    transform: translateY(0);
}

.tcb-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 12px;
    flex-shrink: 0;
    background: #1e1f22;
}

.tcb-label {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #f2f3f5;
    text-align: left;
}

.tcb-arrow {
    font-size: 20px;
    color: #949ba4;
    font-weight: 700;
    transition: transform 0.15s ease, color 0.15s ease;
}

.template-card-btn:hover .tcb-arrow {
    color: #f2f3f5;
    transform: translateX(3px);
}

.template-section-label {
    font-size: 11px;
    font-weight: 800;
    color: #949ba4;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 14px;
    margin-bottom: 6px;
    text-align: left;
}

.template-footer {
    margin-top: 20px;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #383a40;
}

.template-footer-title {
    font-size: 18px;
    font-weight: 700;
    color: #f2f3f5;
    margin-bottom: 10px;
}

.template-join-btn {
    width: 100%;
    padding: 12px;
    background: #4e5058;
    color: #f2f3f5;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
}

.template-join-btn:hover {
    background: #6d6f78;
}

.step-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 12px;
}

.step-back-btn {
    padding: 10px 20px !important;
}

.step-next-btn {
    padding: 10px 24px !important;
}

/* ===== CHANNEL CATEGORIES & VOICE CHANNELS ===== */
.channels-category {
    margin-bottom: 12px;
}

.channels-category:last-child {
    margin-bottom: 0;
}

.channel-item.voice {
    position: relative;
}

.channel-voice-speaker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    font-size: 14px;
    margin-right: 6px;
    opacity: 0.8;
}

.channel-item.voice.connected {
    background: rgba(59, 165, 93, 0.15);
    color: #3ba55d;
}

.channel-item.voice.connected .channel-name {
    color: #3ba55d;
    font-weight: 600;
}

.voice-channel-users {
    padding: 2px 4px 6px 28px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.voice-user-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 12px;
    color: #dcddde;
    width: fit-content;
}

.voice-user-pill .vu-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.voice-user-pill .vu-speaking-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3ba55d;
    box-shadow: 0 0 6px #3ba55d;
    display: inline-block;
}

/* ===== VOICE CONNECTION PANEL (RTC CONNECTED) ===== */
.voice-connection-panel {
    background: #111214;
    border-top: 1px solid #1f2023;
    border-bottom: 1px solid #1f2023;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
}

.vcp-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.vcp-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #23a55a;
    letter-spacing: -0.01em;
}

.vcp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #23a55a;
    box-shadow: 0 0 6px rgba(35, 165, 90, 0.8);
    display: inline-block;
    animation: pulse 1.8s infinite;
}

.vcp-channel-info {
    font-size: 11px;
    color: #949ba4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.vcp-disconnect-btn {
    background: rgba(237, 66, 69, 0.15);
    border: 1px solid rgba(237, 66, 69, 0.3);
    color: #ed4245;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.vcp-disconnect-btn:hover {
    background: #ed4245;
    color: #fff;
}

/* ===== CHANNEL TYPE SELECTOR (MODAL) ===== */
.channel-type-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel-type-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #2b2d31;
    border: 1px solid #383a40;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.channel-type-option:hover {
    background: #35373c;
}

.channel-type-option.active {
    border-color: #5865f2;
    background: rgba(88, 101, 242, 0.12);
}

.cto-icon {
    font-size: 20px;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #949ba4;
}

.channel-type-option.active .cto-icon {
    color: #5865f2;
}

.cto-info {
    flex: 1;
}

.cto-title {
    font-size: 14px;
    font-weight: 600;
    color: #f2f3f5;
    margin-bottom: 2px;
}

.cto-desc {
    font-size: 12px;
    color: #949ba4;
    line-height: 1.3;
}

/* ===== VOICE ROOM STAGE VIEW ===== */
.voice-room-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    text-align: center;
}

.voice-stage-card {
    background: #2b2d31;
    border: 1px solid #383a40;
    border-radius: 12px;
    padding: 32px 24px;
    max-width: 440px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.voice-stage-avatar-box {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
}

.voice-stage-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #23a55a;
    box-shadow: 0 0 16px rgba(35, 165, 90, 0.4);
}

.voice-stage-name {
    font-size: 18px;
    font-weight: 700;
    color: #f2f3f5;
    margin-bottom: 6px;
}

.voice-stage-channel {
    font-size: 14px;
    color: #949ba4;
    margin-bottom: 20px;
}

.voice-stage-actions {
    display: flex;
    gap: 12px;
}

/* ================= АНИМАЦИИ ОТКРЫТИЯ ОКОН И ДИАЛОГОВ ================= */
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleIn {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fullscreenWindowIn {
    0% {
        opacity: 0;
        transform: scale(0.985);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes dropdownSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tabPaneFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Применение анимаций ко всем модальным окнам и карточкам */
.modal-overlay.active {
    animation: overlayFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-overlay.active > .confirm-modal,
.modal-overlay.active > .profile-modal,
.modal-overlay.active > .server-template-modal,
.modal-overlay.active > .account-switcher-card,
.modal-overlay.active > .voice-stage-card,
.modal-overlay.active > .invite-modal,
.modal-overlay.active > .user-card,
.modal-overlay.active > .avatar-editor-modal {
    animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-overlay.active > .fullscreen-window,
.modal-overlay.active > .server-settings-app {
    animation: fullscreenWindowIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.status-modal.active,
.status-modal {
    animation: dropdownSlideIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-auto-popup.active {
    animation: dropdownSlideIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ss-tab-pane {
    animation: tabPaneFadeIn 0.18s ease-out;
}

/* ================= ДИСКОРД НАСТРОЙКИ СЕРВЕРА (FULLSCREEN) ================= */
.modal-overlay.server-settings-overlay {
    background: #313338;
    z-index: 1200;
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

.server-settings-app {
    width: 100vw;
    height: 100vh;
    display: flex;
    background: #313338;
    color: #dbdee1;
    overflow: hidden;
    position: relative;
}

/* Левая навигационная панель */
.ss-sidebar {
    width: 250px;
    background: #2b2d31;
    display: flex;
    justify-content: flex-end;
    overflow-y: auto;
    flex-shrink: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.15);
}

.ss-sidebar-inner {
    width: 218px;
    padding: 60px 10px 80px 14px;
    box-sizing: border-box;
}

.ss-sidebar-header {
    font-size: 12px;
    font-weight: 700;
    color: #949ba4;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 10px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ss-sidebar-category {
    font-size: 12px;
    font-weight: 700;
    color: #949ba4;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 16px 10px 6px;
}

.ss-nav-item {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #b5bac1;
    cursor: pointer;
    transition: all 0.12s;
    margin-bottom: 2px;
    user-select: none;
}

.ss-nav-item:hover {
    background: #35373c;
    color: #dbdee1;
}

.ss-nav-item.active {
    background: #3f4147;
    color: #ffffff;
    font-weight: 600;
}

.ss-nav-item.ss-nav-muted {
    color: #949ba4;
}

.ss-nav-item.ss-nav-muted:hover {
    color: #dbdee1;
}

.ss-nav-item.ss-nav-danger {
    color: #ed4245;
}

.ss-nav-item.ss-nav-danger:hover {
    background: rgba(237, 66, 69, 0.15);
    color: #ed4245;
}

.ss-bans-badge {
    background: #ed4245;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    display: none;
}

.ss-sidebar-divider {
    height: 1px;
    background: #35373c;
    margin: 8px 10px;
}

/* Правая область контента */
.ss-main {
    flex: 1;
    min-width: 0;
    height: 100vh;
    position: relative;
    display: flex;
}

/* Кнопка закрытия ESC */
.discord-esc-wrapper {
    position: absolute;
    top: 56px;
    right: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 50;
    user-select: none;
}

.discord-esc-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #b5bac1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #b5bac1;
    transition: all 0.15s;
    background: transparent;
}

.discord-esc-wrapper:hover .discord-esc-btn {
    border-color: #dbdee1;
    color: #ffffff;
    transform: scale(1.06);
}

.esc-kbd-hint {
    font-size: 11px;
    font-weight: 700;
    color: #b5bac1;
    margin-top: 4px;
    letter-spacing: 0.04em;
    transition: color 0.15s;
}

.discord-esc-wrapper:hover .esc-kbd-hint {
    color: #ffffff;
}

/* Скроллируемый контейнер содержимого */
.ss-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 60px 48px 120px 40px;
    max-width: 960px;
    box-sizing: border-box;
}

.ss-header-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.ss-header-desc {
    font-size: 13px;
    color: #949ba4;
    line-height: 1.4;
    margin-bottom: 24px;
}

/* Двухколоночный макет вкладки Обзор */
.ss-two-col {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.ss-form-column {
    flex: 1;
    max-width: 480px;
}

.ss-preview-column {
    width: 310px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
}

.ss-field-block {
    margin-bottom: 2px;
}

.ss-field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #b5bac1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.ss-field-input {
    width: 100%;
    height: 40px;
    background: #1e1f22;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0 12px;
    color: #dbdee1;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
}

.ss-field-input:focus {
    border-color: #5865f2;
}

.ss-field-subtext {
    font-size: 13px;
    color: #949ba4;
    line-height: 1.35;
    margin-bottom: 12px;
}

.ss-field-divider {
    height: 1px;
    background: #3f4147;
    margin: 24px 0;
}

.ss-btn-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ss-btn-blurple {
    background: #5865f2;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.ss-btn-blurple:hover {
    background: #4752c4;
}

.ss-btn-ghost {
    background: #4e5058;
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.ss-btn-ghost:hover {
    background: #6d6f78;
}

/* Сетка палитры баннеров (10 пресетов 2x5 как на референсе) */
.ss-banner-presets-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.ss-banner-swatch {
    height: 44px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.ss-banner-swatch:hover {
    transform: scale(1.05);
}

.ss-banner-swatch.selected {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px #5865f2;
}

.ss-custom-color-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #4e5058;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
}

.ss-custom-color-label {
    font-size: 13px;
    color: #ffffff;
}

/* Сетка особенностей сервера */
.ss-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.ss-feature-chip {
    height: 38px;
    background: #1e1f22;
    border: 1px solid #35373c;
    border-radius: 19px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.ss-feature-chip:hover {
    border-color: #5865f2;
}

.ss-feature-chip.active {
    background: #2b2d31;
    border-color: #5865f2;
}

.ss-feature-emoji {
    font-size: 16px;
}

.ss-feature-text {
    font-size: 13px;
    color: #dbdee1;
    font-weight: 500;
}

/* Интерактивная карточка предпросмотра сервера в Discord */
.dsp-preview-card {
    width: 100%;
    background: #1e1f22;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dsp-card-banner {
    height: 110px;
    background-size: cover;
    background-position: center;
    background-color: #232428;
    transition: background 0.2s;
}

.dsp-card-avatar-wrap {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    border: 4px solid #1e1f22;
    margin-top: -32px;
    margin-left: 16px;
    background: #2b2d31;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dspCardAvatarImg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dsp-card-avatar-ph {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.dsp-card-content {
    padding: 12px 16px 16px;
}

.dsp-card-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dsp-card-stats {
    font-size: 12px;
    color: #b5bac1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.dsp-dot.online {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #23a55a;
    display: inline-block;
}

.dsp-dot.total {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b5bac1;
    display: inline-block;
}

.dsp-sep {
    color: #4e5058;
}

.dsp-card-sub {
    font-size: 11px;
    color: #949ba4;
    margin-bottom: 10px;
}

.dsp-card-features-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.dsp-chip-pill {
    font-size: 11px;
    background: #2b2d31;
    color: #dbdee1;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Плавающая плашка сохранения изменений внизу (Discord style) */
.ss-floating-save-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    opacity: 0;
    pointer-events: none;
    width: 90%;
    max-width: 680px;
    background: #111214;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}

.ss-floating-save-bar.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.ss-save-bar-text {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.ss-save-bar-actions {
    display: flex;
    gap: 12px;
}

.ss-save-reset-btn {
    background: transparent;
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
}

.ss-save-confirm-btn {
    background: #23a55a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.ss-save-confirm-btn:hover {
    background: #1b8747;
}

/* Стили вкладки РОЛИ (Discord Style по референсам 1-5) */
.roles-manager-layout {
    display: flex;
    gap: 0;
    min-height: 560px;
    height: calc(100vh - 220px);
    background: #2b2d31;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.roles-left-col {
    width: 230px;
    background: #1e1f22;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.roles-left-header {
    height: 48px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.roles-back-btn {
    background: transparent;
    border: none;
    color: #dbdee1;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    font-family: inherit;
}

.roles-back-btn:hover {
    background: #35373c;
    color: #ffffff;
}

.roles-add-icon-btn {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #b5bac1;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s;
}

.roles-add-icon-btn:hover {
    background: #35373c;
    color: #ffffff;
}

.roles-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #b5bac1;
    cursor: pointer;
    transition: all 0.12s;
    user-select: none;
}

.role-sidebar-item:hover {
    background: #35373c;
    color: #dbdee1;
}

.role-sidebar-item.selected {
    background: #3f4147;
    color: #ffffff;
    font-weight: 600;
}

.role-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.role-sidebar-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.roles-right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #313338;
}

.roles-discord-header {
    padding: 16px 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.roles-header-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.roles-discord-title {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.roles-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.roles-dots-menu-btn {
    background: transparent;
    border: none;
    color: #b5bac1;
    font-size: 18px;
    letter-spacing: 2px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.roles-dots-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.roles-dots-menu-btn:active {
    transform: scale(0.92);
}

.discord-esc-wrapper.mini {
    position: static;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.discord-esc-wrapper.mini .discord-esc-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.discord-esc-wrapper.mini .esc-kbd-hint {
    font-size: 10px;
}

.roles-discord-subtabs {
    display: flex;
    gap: 24px;
}

.roles-subtab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #b5bac1;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 4px 12px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.roles-subtab:hover {
    color: #ffffff;
}

.roles-subtab.active {
    color: #ffffff;
    border-bottom-color: #5865f2;
}

.role-editor-pane {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px 60px;
}

/* Поиск прав доступа (Screenshot 1) */
.discord-perms-search-box {
    width: 100%;
    height: 40px;
    background: #1e1f22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.discord-perms-search-box:focus-within {
    border-color: #5865f2;
}

.dps-icon {
    font-size: 14px;
    color: #949ba4;
}

.discord-perms-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #dbdee1;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.discord-perms-search-input::placeholder {
    color: #949ba4;
}

/* Заголовки категорий прав */
.perms-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.perms-category-header:first-of-type {
    margin-top: 4px;
}

.pch-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.pch-clear-btn {
    background: transparent;
    border: none;
    color: #00a8fc;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
    font-family: inherit;
}

.pch-clear-btn:hover {
    color: #00b0f4;
    text-decoration: underline;
}

/* Строки прав (Screenshots 1-5) */
.discord-perm-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.12s;
}

.dpr-info {
    flex: 1;
}

.dpr-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dpr-title-ru {
    font-size: 13px;
    font-weight: 400;
    color: #949ba4;
}

.dpr-desc {
    font-size: 13px;
    color: #949ba4;
    line-height: 1.45;
}

.dpr-switch {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Предупреждение для Администратора */
.discord-perm-row.perm-admin-highlight {
    background: rgba(237, 66, 69, 0.08);
    border-radius: 8px;
    padding: 16px 14px;
    border: 1px solid rgba(237, 66, 69, 0.25);
    margin-top: 12px;
}

.discord-perm-row.perm-admin-highlight .dpr-title {
    color: #ed4245;
}

/* Вкладка Manage Members */
.role-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.role-member-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #2b2d31;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.role-member-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.role-member-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.role-member-tag {
    font-size: 12px;
    color: #949ba4;
}

.role-member-remove-btn {
    background: transparent;
    border: none;
    color: #949ba4;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.role-member-remove-btn:hover {
    color: #ed4245;
    background: rgba(237, 66, 69, 0.15);
}

.role-color-swatches-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 8px;
}

.role-color-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.12s, border-color 0.12s;
}

.role-color-circle:hover {
    transform: scale(1.15);
}

.role-color-circle.selected {
    border-color: #ffffff;
}

/* ==================== SELECT & DROPDOWNS ==================== */
.set-select {
    background: #1e1f22;
    color: #dbdee1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 7px 12px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all 0.18s ease;
}
.set-select:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: #2b2d31;
}
.set-select:focus {
    border-color: #5865f2;
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25);
}

/* ==================== DISCORD-STYLE MICRO-ANIMATIONS ==================== */

/* 1. Server List Icons with Discord White Pill Indicator */
.server-list .server-icon {
    position: relative;
    transition: border-radius 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.2s ease,
                transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.server-list .server-icon::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: #ffffff;
    border-radius: 0 4px 4px 0;
    transition: height 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.server-list .server-icon:hover {
    transform: scale(1.04);
}

.server-list .server-icon:hover::before {
    height: 20px;
    opacity: 1;
}

.server-list .server-icon.active::before {
    height: 40px;
    opacity: 1;
}

.server-list .server-icon:active {
    transform: scale(0.94);
}

/* 2. Tactile Click Feedback on Buttons & Controls */
.btn, .input-btn, .user-action-btn, .roles-back-btn, .roles-add-icon-btn,
.server-menu-toggle, .vcp-disconnect-btn {
    transition: transform 0.1s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.15s ease,
                box-shadow 0.15s ease,
                color 0.15s ease;
}

.btn:active, .input-btn:active, .user-action-btn:active,
.roles-back-btn:active, .roles-add-icon-btn:active,
.server-menu-toggle:active, .vcp-disconnect-btn:active {
    transform: scale(0.95);
}

/* 3. Channels Smooth Hover & Active Slide */
.channel-item {
    transition: background 0.15s ease,
                color 0.15s ease,
                transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                padding-left 0.15s ease;
}

.channel-item:hover {
    transform: translateX(4px);
    background: #35373c;
    color: #ffffff;
}

.channel-item.active {
    background: #393c43;
    color: #ffffff;
    border-left: 3px solid #5865f2;
}

.channel-item:active {
    transform: translateX(2px) scale(0.98);
}

/* 4. Chat Messages Fade & Slide-in Animation */
@keyframes messageFadeIn {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-group {
    transition: background-color 0.12s ease;
}

.message-group:hover {
    background-color: rgba(2, 2, 2, 0.08);
}

/* 5. Reaction Items Pop & Bounce */
@keyframes reactionPop {
    0% { transform: scale(0.85); }
    50% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

.reaction-item {
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.12s ease,
                border-color 0.12s ease;
}

.reaction-item:hover {
    transform: scale(1.12);
}

.reaction-item:active {
    transform: scale(0.92);
}

/* 6. Switch Thumb Spring Transition with Glowing Accent */
.switch .slider {
    transition: background-color 0.22s ease, box-shadow 0.22s ease;
}

.switch .slider:before {
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.2s ease;
}

.switch input:checked + .slider {
    background-color: #23a55a;
    box-shadow: 0 0 10px rgba(35, 165, 90, 0.45);
}

/* 7. Roles Sidebar Item Slide & Hover */
.role-sidebar-item {
    transition: background 0.15s ease,
                color 0.15s ease,
                transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.15s ease;
}

.role-sidebar-item:hover {
    transform: translateX(4px);
    background: #35373c;
    color: #ffffff;
}

.role-sidebar-item.selected {
    transform: translateX(4px);
    background: #393c43;
    box-shadow: inset 3px 0 0 #5865f2;
}

/* 8. Voice Connection Pulsing Green Dot */
@keyframes voicePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(35, 165, 90, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(35, 165, 90, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(35, 165, 90, 0);
    }
}

.vcp-dot {
    animation: voicePulse 1.9s infinite ease-in-out;
}

/* 9. Subtabs Hover Lift & Role Pane Transitions */
.roles-subtab {
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.roles-subtab:hover {
    transform: translateY(-1px);
}

.roles-subtab:active {
    transform: translateY(0);
}

.role-editor-pane {
    animation: tabPaneFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 10. Status Indicator Pulse */
@keyframes statusIndicatorPop {
    0% { transform: scale(0.8); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.user-status-indicator {
    animation: statusIndicatorPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==================== DISCORD ROLE DISPLAY (STYLE, PROMO, COLORS, ICON) ==================== */
.role-style-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.role-style-card {
    background: #2b2d31;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.role-style-card:hover {
    background: #313338;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.role-style-card.selected {
    background: #2b2d31;
    border-color: #5865f2;
}

.role-style-card .rsc-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.role-style-card .rsc-icon.standard-disc {
    background: rgba(88, 101, 242, 0.15);
}

.role-style-card .rsc-icon.gradient-disc {
    background: linear-gradient(135deg, #eb459e, #5865f2);
}

.role-style-card .rsc-icon.holo-disc {
    background: linear-gradient(135deg, #fee75c, #57f287, #5865f2);
    animation: holoSpin 4s linear infinite;
}

@keyframes holoSpin {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.role-style-card .rsc-content {
    flex: 1;
    min-width: 0;
}

.role-style-card .rsc-title {
    font-size: 14px;
    font-weight: 600;
    color: #f2f3f5;
    margin-bottom: 2px;
}

.role-style-card .rsc-desc {
    font-size: 12px;
    color: #949ba4;
}

.role-style-card .rsc-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #4e5058;
    position: relative;
    flex-shrink: 0;
}

.role-style-card.selected .rsc-radio {
    border-color: #5865f2;
    background: #5865f2;
}

.role-style-card.selected .rsc-radio::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

/* Role Boost Promo Banner */
.role-boost-banner {
    margin-top: 14px;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.12), rgba(235, 69, 158, 0.12));
    border: 1px solid rgba(235, 69, 158, 0.3);
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.role-boost-banner .rbb-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
}

.role-boost-banner .rbb-desc {
    font-size: 12px;
    color: #b5bac1;
}

.role-boost-banner .rbb-action-btn {
    background: linear-gradient(135deg, #eb459e, #5865f2);
    border: none;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 10px rgba(235, 69, 158, 0.35);
}

.role-boost-banner .rbb-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(235, 69, 158, 0.5);
}

.role-boost-banner .rbb-action-btn:active {
    transform: scale(0.96);
}

/* Role Color Matrix Layout */
.role-color-layout {
    display: flex;
    align-items: center;
    gap: 16px;
}

.role-custom-color-box {
    width: 68px;
    height: 56px;
    background: #2b2d31;
    border: 1px solid #3f4147;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.role-custom-color-box:hover {
    border-color: #5865f2;
    transform: translateY(-1px);
}

.role-custom-color-box .rcc-preview {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.role-custom-color-box .rcc-chevron {
    font-size: 12px;
    color: #949ba4;
}

.role-palette-matrix {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-palette-row {
    display: flex;
    gap: 8px;
}

.role-palette-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s;
    position: relative;
    border: 2px solid transparent;
}

.role-palette-circle:hover {
    transform: scale(1.22);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.role-palette-circle.selected {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px #5865f2;
    transform: scale(1.15);
}

/* Role Icon Uploader */
.role-icon-uploader-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.role-icon-preview-box {
    width: 64px;
    height: 64px;
    background: #2b2d31;
    border: 1px dashed #4e5058;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.role-icon-preview-box .rsc-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.role-icon-preview-box .rsc-icon-ph {
    font-size: 26px;
    color: #80848e;
}
