/* Base Styles from Template */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root,
:root[data-theme="dark"] {
    --server-list-bg: #1e1f22;
    --channel-list-bg: #2b2d31;
    --chat-bg: #313338;
    --header-bg: #1a1a1a;
    /* Top bar matches site theme */
    --text-normal: #dbdee1;
    --text-muted: #949ba4;
    --interactive-normal: #b5bac1;
    --interactive-hover: #dcddde;
    --interactive-active: #fff;
    --brand-color: #5865F2;
    --brand-hover: #4752C4;
    --danger-color: #f23f42;
    --mention-text: #c9cdfb;
    --mention-bg: rgba(88, 101, 242, 0.15);
    --message-hover-bg: rgba(0, 0, 0, 0.07);
    --border-color: #1f2023;
}

:root[data-theme="darker"] {
    --server-list-bg: #000000;
    --channel-list-bg: #060607;
    --chat-bg: #0d0d0d;
    --header-bg: #000000;
    --text-normal: #dbdee1;
    --text-muted: #80848e;
    --interactive-normal: #b5bac1;
    --interactive-hover: #dcddde;
    --interactive-active: #fff;
    --brand-color: #5865F2;
    --brand-hover: #4752C4;
    --danger-color: #f23f42;
    --mention-text: #c9cdfb;
    --mention-bg: rgba(88, 101, 242, 0.18);
    --message-hover-bg: rgba(255, 255, 255, 0.02);
    --border-color: #1a1a1a;
}

html,
body {
    height: 100%;
    overflow: hidden;
    /* Prevent full page scroll, handle in containers */
}

body {
    font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--chat-bg);
    color: var(--text-normal);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Top Navigation Bar - Keeping Site Standard */
.top-bar {
    background-color: var(--header-bg);
    padding: 8.5px 20px;
    height: 50px;
    flex-shrink: 0;
    border-bottom: 1px solid #000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links li a {
    text-decoration: none;
    color: #eee;
    font-weight: bold;
    font-size: 0.9em;
}

.nav-links li a.active-link {
    color: #4bc0c0;
}

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

.user-account button {
    padding: 4px 10px;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
}

/* Main App Layout */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Server Sidebar */
.server-sidebar {
    width: 72px;
    background-color: var(--server-list-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
    overflow-y: auto;
    flex-shrink: 0;
}

.server-sidebar::-webkit-scrollbar {
    display: none;
}

.server-item {
    width: 48px;
    height: 48px;
    background-color: #36393f;
    border-radius: 50%;
    transition: border-radius 0.2s, background-color 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-normal);
    overflow: hidden;
    position: relative;
}

.server-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-item:hover,
.server-item.active {
    border-radius: 16px;
    background-color: var(--brand-color);
    color: #fff;
}

.server-item.placeholder {
    animation: pulse 1.5s infinite;
}

/* Channel Sidebar */
.channel-sidebar {
    width: 240px;
    background-color: var(--channel-list-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 0 rgba(4, 4, 5, 0.2), 0 1.5px 0 rgba(6, 6, 7, 0.05), 0 2px 0 rgba(4, 4, 5, 0.05);
    flex-shrink: 0;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-normal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.channel-item {
    padding: 6px 8px;
    margin: 1px 0;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.channel-item:hover {
    background-color: rgba(79, 84, 92, 0.32);
    color: var(--interactive-hover);
}

.channel-item.active {
    background-color: rgba(79, 84, 92, 0.48);
    color: var(--interactive-active);
}

.channel-hash {
    color: var(--text-muted);
    font-size: 20px;
    line-height: 20px;
}

/* Channel-list nesting: indent items inside a category and threads further still. */
.category-children .channel-item {
    padding-left: 16px;
}
.channel-item.channel-thread {
    padding-left: 28px;
    font-size: 0.92em;
    color: var(--text-muted);
    opacity: 0.85;
}
.category-children .channel-item.channel-thread {
    padding-left: 36px;
}
.channel-item.channel-thread .channel-hash {
    font-size: 14px;
    opacity: 0.6;
}

/* Chat Area */
.chat-area {
    flex: 1;
    background-color: var(--chat-bg);
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Enable shrinking */
}

.chat-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 0 rgba(4, 4, 5, 0.2), 0 1.5px 0 rgba(6, 6, 7, 0.05), 0 2px 0 rgba(4, 4, 5, 0.05);
    flex-shrink: 0;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.channel-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-normal);
    white-space: nowrap;
}

.channel-topic {
    color: var(--text-muted);
    font-size: 14px;
    border-left: 1px solid rgba(79, 84, 92, 0.48);
    padding-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tool-btn {
    background: none;
    border: none;
    color: var(--interactive-normal);
    cursor: pointer;
    padding: 0;
    line-height: 0;
}

.tool-btn:hover {
    color: var(--interactive-hover);
}

.spinning svg {
    animation: spin 1s linear infinite;
}

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

.search-container {
    display: flex;
    background-color: #1e1f22;
    border-radius: 4px;
    height: 24px;
    align-items: center;
}

.search-box {
    position: relative;
    padding: 0 8px;
    width: 144px;
    /* Default width */
    height: 100%;
    display: flex;
    align-items: center;
}

.search-options select {
    background-color: #1e1f22;
    color: var(--text-muted);
    border: none;
    border-left: 1px solid #333;
    font-size: 12px;
    height: 24px;
    outline: none;
    cursor: pointer;
    padding: 0 4px;
}

.search-options select:hover {
    color: var(--text-normal);
}

.search-icon {
    color: var(--text-muted);
    cursor: pointer;
}

/* Deleted/Edited Styles */
.message-deleted {
    opacity: 0.7;
}

.deleted-tag {
    color: #f23f42;
    font-size: 10px;
    font-weight: bold;
    margin-right: 6px;
}

.deleted-text {
    font-style: italic;
    color: var(--text-muted);
}

.message-edited {
    color: var(--text-muted);
    font-size: 10px;
    margin-left: 4px;
    cursor: pointer;
}

.message-edited:hover {
    text-decoration: underline;
}

#statsButton {
    background: none;
    border: none;
    padding: 0;
    color: var(--interactive-normal);
    cursor: pointer;
}

#statsButton:hover {
    color: var(--interactive-hover);
}

.messages-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column-reverse;
    /* Bottom up? Or standard top down with scroll to bottom? Standard usually. Discord uses column-reverse for rendering but simpler to use column + scrollTop */
    /* Let's stick to standard column and manage scroll for now, unless we want to do the flex-direction: column-reverse trick for keeping scroll at bottom. */
    flex-direction: column;
    /* Browser scroll anchoring: if content is added above the viewport, keep
       what the user is currently looking at visually stable. */
    overflow-anchor: auto;
    position: relative; /* anchor for the .jump-to-present floating button */
}

.messages-list {
    padding: 16px 0;
    padding-bottom: 30px;
}

.message-item {
    padding: 2px 16px;
    margin-top: 17px;
    display: flex;
    position: relative;
}

.message-item:hover {
    background-color: rgba(4, 4, 5, 0.07);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    background-color: #5865F2;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
}

.message-content-wrapper {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.message-author {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
}

.message-author:hover {
    text-decoration: underline;
}

.message-timestamp {
    font-size: 12px;
    color: var(--text-muted);
}

.message-body {
    font-size: 16px;
    color: var(--text-normal);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.empty-state {
    text-align: center;
    margin-top: 50px;
    color: var(--text-muted);
}

/* Stats Panel (Overlay) */
.stats-panel {
    width: 300px;
    background-color: var(--channel-list-bg);
    border-left: 1px solid rgba(4, 4, 5, 0.2);
    display: flex;
    flex-direction: column;
}

.close-stats {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.stats-content {
    padding: 16px;
    overflow-y: auto;
}

.stat-item {
    margin-bottom: 12px;
    padding: 8px;
    background-color: #1e1f22;
    border-radius: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.stat-value {
    font-size: 16px;
    color: var(--text-normal);
    font-weight: 500;
}

/* Modals */
.modal,
.auth-modal,
.sync-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
}

.modal-content,
.auth-modal-content,
.sync-modal-content {
    background-color: #313338;
    color: var(--text-normal);
    padding: 24px;
    /* Increased padding */
    border-radius: 5px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
}

.auth-modal-content h2,
.sync-modal-content h2 {
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
    /* More spacing */
}

input[type="text"],
input[type="password"] {
    background-color: #1e1f22;
    border: none;
    padding: 10px;
    color: var(--text-normal);
    border-radius: 3px;
    width: 100%;
}

button[type="submit"] {
    width: 100%;
    background-color: var(--brand-color);
    padding: 10px;
    font-size: 16px;
    font-weight: 500;
}

button[type="submit"]:hover {
    background-color: var(--brand-hover);
}

.close-auth-modal,
.close-sync-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.error-message {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 8px;
}

/* Scrollbar styling for everything */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background-color: #2b2d31;
}

*::-webkit-scrollbar-thumb {
    background-color: #1a1b1e;
    border-radius: 4px;
}

*::-webkit-scrollbar-track {
    background-color: #2b2d31;
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Sync Choice Modal Styles */
.sync-choice-modal .auth-modal-content {
    max-width: 550px;
}

.comparison-container {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    justify-content: center;
}

.data-column {
    flex: 1;
    background: #1e1f22;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.data-column h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 14px;
}

.data-column p {
    color: var(--text-muted);
    font-size: 12px;
    margin: 5px 0;
}

.sync-choice-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-upload,
.btn-download {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.btn-upload {
    background-color: var(--brand-color);
    color: #fff;
}

.btn-upload:hover {
    background-color: var(--brand-hover);
}

.btn-download {
    background-color: #3ba55c;
    color: #fff;
}

.btn-download:hover {
    background-color: #2d8e4a;
}

/* Modal buttons */
.close-auth-modal-button,
.close-sync-modal-button,
.close-modal-button {
    margin-top: 15px;
    padding: 8px 16px;
    background-color: #4f545c;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.close-auth-modal-button:hover,
.close-sync-modal-button:hover,
.close-modal-button:hover {
    background-color: #686d75;
}

/* Close button in modals */
.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

/* Modal content for settings */
.modal .modal-content {
    background-color: #313338;
    color: var(--text-normal);
    padding: 24px;
    border-radius: 5px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal .modal-content h2 {
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
}

/* Attachments */
.message-attachments {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-image img {
    max-width: 400px;
    max-height: 300px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.attachment-image img:hover {
    opacity: 0.9;
}

.attachment-video video {
    max-width: 400px;
    max-height: 300px;
    border-radius: 4px;
}

.attachment-file {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 4px;
}

.attachment-file a {
    color: #00b0f4;
    text-decoration: none;
}

.attachment-file a:hover {
    text-decoration: underline;
}

.attachment-error {
    color: var(--text-muted);
    font-style: italic;
    padding: 8px;
    display: block;
}

/* Rich Embeds (Discord Style) */
.embed-card {
    background-color: #2b2d31;
    border-left: 4px solid #202225;
    padding: 10px;
    border-radius: 4px;
    max-width: 520px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.embed-provider {
    font-size: 12px;
    color: var(--text-muted);
}

.embed-title {
    font-size: 16px;
    font-weight: 600;
    color: #00b0f4;
    text-decoration: none;
    display: block;
}

.embed-title:hover {
    text-decoration: underline;
}

.embed-author {
    font-size: 14px;
    color: var(--text-normal);
    font-weight: 500;
}

.embed-media {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
}

.embed-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}


/* YouTube Specifics */
.embed-youtube-container {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
}

.youtube-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    transition: background 0.2s;
    z-index: 2;
}

.youtube-play-overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-left: 15px solid white;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
}

.embed-youtube-container:hover .youtube-play-overlay {
    background: #FF0000;
}

/* Tenor/GIF Specifics */
.embed-gif-container {
    max-width: 300px;
}

.edit-history-container {
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border-left: 2px solid var(--brand-color);
}

.edit-history {
    font-size: 13px;
}

.edit-entry {
    margin: 8px 0;
    padding: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.edit-timestamp {
    font-size: 11px;
    color: var(--text-muted);
}

.edit-old-content {
    color: #999;
    margin-top: 4px;
    white-space: pre-wrap;
}

/* Deleted Messages */
.message-deleted {
    opacity: 0.6;
}

.message-deleted-badge {
    color: var(--danger-color);
    font-size: 11px;
    font-weight: bold;
    margin-right: 8px;
}

.deleted-content-wrapper {
    display: inline;
}

.deleted-tag {
    color: var(--danger-color);
    font-size: 11px;
    font-weight: bold;
    margin-right: 6px;
}

.deleted-text {
    color: var(--text-muted);
    font-style: italic;
}

.deleted-content {
    color: var(--text-muted);
}

/* Channel Categories */
.channel-category {
    padding: 16px 8px 4px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.channel-category:hover {
    color: var(--text-normal);
}

.category-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.category-collapsed .category-arrow {
    transform: rotate(-90deg);
}

/* Loading indicator */
.loading-more {
    text-align: center;
    padding: 10px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Mentions, custom emoji, reply previews ===== */

.mention {
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.1s, filter 0.1s, color 0.1s;
}
.mention-user,
.mention-channel {
    color: var(--mention-text);
    background-color: var(--mention-bg);
}
.mention-user:hover,
.mention-channel:hover {
    color: #fff;
    background-color: var(--brand-color);
}
.mention-role:hover {
    filter: brightness(1.25);
}
.mention-unknown {
    color: var(--text-muted);
    background-color: rgba(128, 128, 128, 0.15);
    font-style: italic;
}
.custom-emoji {
    width: 1.375em;
    height: 1.375em;
    vertical-align: bottom;
    margin: 0 1px;
}

/* Reply previews (Discord-style) — full-width row that sits above the message. */
.message-item.message-with-reply {
    flex-wrap: wrap;
}
.reply-preview {
    flex: 0 0 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875em;
    color: var(--text-muted);
    margin-bottom: 2px;
    padding-left: 56px;
    position: relative;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reply-preview:hover .reply-content,
.reply-preview:hover .reply-author {
    color: var(--interactive-hover);
}
.reply-connector {
    position: absolute;
    left: 28px;
    top: 50%;
    width: 24px;
    height: 14px;
    border-left: 2px solid var(--border-color);
    border-top: 2px solid var(--border-color);
    border-top-left-radius: 6px;
}
.reply-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}
.reply-avatar-placeholder {
    background-color: var(--border-color);
    display: inline-block;
}
.reply-author {
    font-weight: 600;
    color: var(--text-normal);
    flex-shrink: 0;
}
.reply-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reply-content .custom-emoji {
    width: 1em;
    height: 1em;
}
.reply-missing {
    font-style: italic;
}

/* Click-to-jump flash highlight on the target message */
.message-flash {
    animation: reply-flash 1.5s ease-out;
}
@keyframes reply-flash {
    0%   { background-color: rgba(88, 101, 242, 0.30); }
    100% { background-color: transparent; }
}

/* Jump-to-Present banner — shown when viewing a past window */
.jump-to-present {
    position: sticky;
    bottom: 12px;
    align-self: center;
    margin: 0 auto;
    z-index: 5;
    background-color: var(--brand-color);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.875em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    transition: background-color 0.15s, transform 0.1s;
}
.jump-to-present:hover {
    background-color: var(--brand-hover);
}
.jump-to-present:active {
    transform: translateY(1px);
}
.jump-to-present[hidden] {
    display: none;
}

/* Settings: theme picker row */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
}
.setting-row label {
    color: var(--text-normal);
    font-weight: 500;
}
.setting-row select {
    background-color: var(--channel-list-bg);
    color: var(--text-normal);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
}

/* ===== Members side panel ===== */

.members-panel {
    width: 240px;
    background-color: var(--channel-list-bg);
    border-left: 1px solid rgba(4, 4, 5, 0.2);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.members-panel[hidden] {
    display: none;
}
.members-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.muted-count {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.875em;
    margin-left: 4px;
}
.close-members {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}
.close-members:hover {
    color: var(--interactive-hover);
}

.member-group-header {
    padding: 16px 16px 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.member-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px;
    margin: 1px 0;
    cursor: pointer;
    border-radius: 4px;
    color: var(--interactive-normal);
}
.member-row:hover {
    background-color: rgba(79, 84, 92, 0.32);
    color: var(--interactive-hover);
}
.member-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background-color: var(--server-list-bg);
}
.member-avatar-placeholder {
    background-color: var(--brand-color);
}
.member-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
}
.member-bot-tag {
    font-size: 10px;
    background-color: var(--brand-color);
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    flex-shrink: 0;
}

#membersButton {
    background: none;
    border: none;
    color: var(--interactive-normal);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
}
#membersButton:hover {
    color: var(--interactive-hover);
    background-color: rgba(79, 84, 92, 0.32);
}

/* Member profile modal */
.member-profile {
    max-width: 440px;
    padding: 0;
    overflow: hidden;
}
.member-profile-header {
    display: flex;
    gap: 16px;
    padding: 24px;
    background-color: var(--server-list-bg);
    align-items: center;
}
.member-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--brand-color);
    flex-shrink: 0;
}
.member-profile-names h2 {
    color: var(--text-normal);
    margin: 0;
    font-size: 20px;
}
.member-profile-names p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}
.member-profile-body {
    padding: 16px 24px 24px;
}
.member-profile-section {
    margin-bottom: 12px;
}
.member-profile-section h4 {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin: 0 0 6px;
    letter-spacing: 0.02em;
}
.member-profile-section p {
    margin: 0;
    color: var(--text-normal);
    font-size: 14px;
}
.member-profile-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.role-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-normal);
    background-color: rgba(255, 255, 255, 0.04);
}