* { box-sizing: border-box; }

/* Themed scrollbar, applied everywhere by default. .chat-box below overrides
   this with its own thinner hover-reveal version; everything else (GIF
   picker, settings panels, member/DM lists, dropdowns, etc.) just gets this. */
* { scrollbar-width: thin; scrollbar-color: #1a1b1e transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background-color: #1a1b1e; border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background-color: #232428; }
*::-webkit-scrollbar-corner { background: transparent; }

body { margin: 0; display: flex; height: 100vh; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; background: #26272b; color: white; overflow: hidden; }

/* Loading splash (shown briefly while auth/state resolves, then fades out) */
#app-loading-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: #26272b; z-index: 5000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
#app-loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-logo-wrap { width: 72px; height: 72px; border-radius: 20px; overflow: hidden; animation: loading-pulse 1.4s ease-in-out infinite; }
.loading-logo { width: 100%; height: 100%; object-fit: cover; }
@keyframes loading-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.92); opacity: 0.75; }
}
.loading-dots { display: flex; gap: 6px; }
.loading-dots span { width: 8px; height: 8px; border-radius: 50%; background-color: #5865F2; display: inline-block; animation: typing-bounce 1.2s infinite ease-in-out; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Sidebars */
.servers { width: 72px; background: #16171a; padding: 12px 0; display: flex; flex-direction: column; gap: 10px; align-items: center; z-index: 10; }
.server-icon { width: 48px; height: 48px; border-radius: 50%; background: #26272b; display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: bold; transition: all 0.2s; color: #dbdee1; position: relative; overflow: visible; }
.server-icon:hover, .server-icon.active { border-radius: 16px; background-color: #5865F2; color: white; }
.server-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; transition: border-radius 0.2s; }
.server-icon:hover .server-logo-img, .server-icon.active .server-logo-img { border-radius: 16px; }
.add-server-btn { background-color: #202225; color: #23a55a; font-size: 22px; }
.add-server-btn:hover { background-color: #23a55a; color: white; }

.channels { width: 240px; background: #202225; display: flex; flex-direction: column; }
.header { height: 48px; padding: 12px; font-weight: bold; border-bottom: 1px solid #1f2023; display: flex; align-items: center; color: white; }
.channel-list { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.channel { padding: 8px 12px; border-radius: 4px; color: #949ba4; cursor: pointer; font-weight: 500; font-size: 15px; display: flex; align-items: center; gap: 6px; transition: background-color 0.15s ease, color 0.15s ease; }
.channel:hover, .channel.active { background: #2a2c30; color: #dbdee1; }

/* Dedicated Control Core Framework Bars */
.user-bar { height: 52px; background: #1c1d20; padding: 8px; display: flex; align-items: center; justify-content: space-between; position: relative; cursor: pointer; }
.user-bar:hover { background-color: #202225; }
.user-info { display: flex; align-items: center; gap: 8px; position: relative; }
.user-info .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.status-indicator { width: 14px; height: 14px; border-radius: 50%; position: absolute; bottom: -2px; left: 22px; border: 3px solid #1c1d20; }
.status-indicator.online { background: #23a55a; }
.status-indicator.idle { background: #f0b232; }
.status-indicator.dnd { background: #f23f43; }
.status-indicator.invisible { background: #80848e; }

.name-stack { display: flex; flex-direction: column; max-width: 110px; overflow: hidden; }
.name-stack .username { font-weight: 600; font-size: 13px; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-stack .tag { font-size: 11px; color: #b5bac1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controls { display: flex; align-items: center; }
.control-btn { background: transparent; border: none; color: #b5bac1; font-size: 18px; cursor: pointer; padding: 4px; border-radius: 4px; }
.control-btn:hover { color: #dbdee1; background-color: #2a2c30; }

/* Center Chat Workspace View Components */
.chat { flex: 1; display: flex; flex-direction: column; background: #26272b; }
.top-bar { height: 48px; border-bottom: 1px solid #1f2023; padding: 12px 16px; display: flex; align-items: center; }
.channel-name { font-weight: bold; font-size: 16px; color: white; }
.chat-box { flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; scroll-behavior: smooth; }
.chat-box:hover { scrollbar-width: thin; scrollbar-color: #1a1b1e transparent; }
.chat-box::-webkit-scrollbar { width: 0px; }
.chat-box:hover::-webkit-scrollbar { width: 8px; }
.chat-box::-webkit-scrollbar-track { background: transparent; }
.chat-box::-webkit-scrollbar-thumb { background-color: #1a1b1e; border-radius: 4px; }

.message { display: flex; gap: 16px; align-items: flex-start; max-width: 100%; word-break: break-word; animation: messageIn 0.15s ease-out; position: relative; padding: 1px 0; border-radius: 4px; transition: background-color 0.1s ease; }
.message:hover { background-color: rgba(46,47,54,0.4); }
@keyframes messageIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.message .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background-color: #16171a; flex-shrink: 0; }
.message-content { display: flex; flex-direction: column; min-width: 0; }

/* Grouped (consecutive, same sender, within a few minutes) messages skip the
   repeated avatar/name row and sit tighter together, like Discord — the exact
   time still shows, just tucked into the avatar gutter on hover instead. */
.message + .message { margin-top: 15px; }
.message.grouped + .message.grouped,
.message + .message.grouped { margin-top: 0; }
.message.grouped .avatar { visibility: hidden; }
.message.grouped .message-content .text { margin-top: 0; }
.message-hover-time {
  position: absolute; left: 0; top: 2px; width: 40px; text-align: center;
  font-size: 10px; color: #949ba4; opacity: 0; pointer-events: none;
  transition: opacity 0.1s ease;
}
.message.grouped:hover .message-hover-time { opacity: 1; }
/* ==========================================
   SKELETON LOADING STATES
   Pure CSS — a shimmer sweep on plain gray blocks. No extra data, no extra
   network calls; just a nicer placeholder than a "Loading…" string while a
   Firestore listener's first snapshot is still in flight. ========================================== */
@keyframes skeletonShimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.skeleton-block {
  background: linear-gradient(90deg, #2a2c30 25%, #333539 37%, #2a2c30 63%);
  background-size: 400px 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
.skeleton-msg { display: flex; gap: 16px; align-items: flex-start; padding: 4px 0; }
.skeleton-msg .skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skeleton-msg .skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.skeleton-msg .skeleton-line { height: 12px; }
.skeleton-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.skeleton-row .skeleton-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.skeleton-row .skeleton-line { height: 11px; flex: 1; max-width: 140px; }
#image-lightbox {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 3000;
  background: rgba(0,0,0,0.9); flex-direction: column; align-items: center; justify-content: center;
}
.lightbox-toolbar {
  position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 3001;
}
.lightbox-toolbar button, .lightbox-toolbar a {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.1); border: none;
  color: white; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.lightbox-toolbar button:hover, .lightbox-toolbar a:hover { background: rgba(255,255,255,0.2); }
.lightbox-image-wrap { max-width: 90vw; max-height: 90vh; overflow: auto; display: flex; align-items: center; justify-content: center; }
#lightbox-image { max-width: 90vw; max-height: 90vh; transition: transform 0.15s ease; cursor: zoom-in; }

.day-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px 0; padding: 0 4px; }
.day-divider-line { flex: 1; height: 1px; background-color: #333539; }
.day-divider-label { font-size: 12px; font-weight: 600; color: #949ba4; white-space: nowrap; }

/* Reply banner shown above the composer while replying to a message */
.attachment-preview { display: flex; align-items: center; gap: 10px; padding: 8px 16px; margin: 0 16px; background-color: #202225; border-radius: 8px 8px 0 0; }
.attachment-preview-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.attachment-preview-name { flex: 1; font-size: 13px; color: #b5bac1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-preview-remove { background: none; border: none; color: #949ba4; font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.attachment-preview-remove:hover { color: white; background-color: #43444b; }

.reply-banner { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; margin: 0 16px; background-color: #202225; border-radius: 8px 8px 0 0; font-size: 13px; color: #b5bac1; }
.reply-banner-name { font-weight: 600; color: #dbdee1; }
.reply-banner-cancel { background: none; border: none; color: #949ba4; font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.reply-banner-cancel:hover { color: white; background-color: #43444b; }

/* Small quoted preview line shown above a reply message */
.reply-preview-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #949ba4; margin-bottom: 2px; }
.reply-arrow { color: #6d6f78; }
.reply-author { font-weight: 600; color: #b5bac1; }
.reply-snippet { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }

/* Right-click message context menu */
#server-icon-context-menu {
  position: fixed; z-index: 2000; min-width: 160px; background-color: #0c0d0f;
  border: 1px solid #1c1d20; border-radius: 6px; padding: 6px; box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  animation: fadeIn 0.12s ease-out;
}

/* This one never had its own container styling — just its items — so it was
   rendering as a bare unstyled box. Matches the other right-click menus now. */
#member-actions-menu {
  position: fixed; z-index: 2000; min-width: 170px; background-color: #0c0d0f;
  border: 1px solid #1c1d20; border-radius: 6px; padding: 6px; box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  animation: fadeIn 0.12s ease-out;
}

.invite-friend-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 4px; cursor: pointer; }
.invite-friend-row:hover { background-color: #2a2c30; }
.invite-friend-row .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.invite-friend-row-name { flex: 1; font-size: 14px; font-weight: 500; color: #dbdee1; }
.invite-friend-row-btn { background-color: #5865F2; color: white; border: none; padding: 6px 14px; border-radius: 4px; font-weight: 600; font-size: 13px; cursor: pointer; }
.invite-friend-row-btn:hover { background-color: #4752c4; }
.invite-friend-row-btn:disabled { background-color: #43454b; cursor: default; }

/* Server invite card, sent as a DM message */
.server-invite-card { width: 300px; border-radius: 8px; overflow: hidden; background-color: #16171a; border: 1px solid #1c1d20; margin-top: 6px; }
.server-invite-banner { height: 60px; background: linear-gradient(135deg, #5865F2, #7289da); }
.server-invite-body { padding: 12px; }
.server-invite-header { display: flex; align-items: center; gap: 10px; margin-top: -30px; margin-bottom: 8px; }
.server-invite-icon { width: 48px; height: 48px; border-radius: 50%; border: 4px solid #16171a; background-color: #202225; object-fit: cover; }
.server-invite-name { font-weight: 700; font-size: 15px; color: white; margin-top: 14px; }
.server-invite-meta { font-size: 12px; color: #949ba4; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.server-invite-join-btn { width: 100%; background-color: #23a55a; color: white; border: none; padding: 8px; border-radius: 4px; font-weight: 600; font-size: 14px; cursor: pointer; }
.server-invite-join-btn:hover { background-color: #1e8f4d; }
.server-invite-join-btn:disabled { background-color: #43454b; cursor: default; }

#message-context-menu {
  position: fixed; z-index: 2000; min-width: 170px; background-color: #0c0d0f;
  border: 1px solid #1c1d20; border-radius: 6px; padding: 6px; box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  animation: fadeIn 0.12s ease-out;
}
.msg-context-item { padding: 8px 10px; border-radius: 4px; font-size: 14px; font-weight: 500; color: #dbdee1; cursor: pointer; }
.msg-context-item:hover { background-color: #2a2c30; }
.msg-context-item.danger { color: #f23f43; }
.msg-context-item.danger:hover { background-color: rgba(240,71,71,0.15); }

.message-content .username { font-weight: 500; color: white; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.message-content .msg-username-name { cursor: pointer; }
.message-content .msg-username-name:hover { text-decoration: underline; }
.message-content .timestamp { font-size: 11px; color: #949ba4; font-weight: normal; }
.message-content .text { color: #dbdee1; font-size: 15px; margin-top: 4px; line-height: 1.375; transition: color 0.2s ease; }
.message.pending .message-content .text { color: #80848e; }
.message.pending .message-content .timestamp { font-style: italic; }
.message.pending .message-image { opacity: 0.55; filter: grayscale(40%); transition: opacity 0.2s ease, filter 0.2s ease; }

/* Input field styles */
.input-area { padding: 0 16px 24px 16px; position: relative; }
.composer-bar { display: flex; align-items: center; gap: 4px; background: #383a40; border-radius: 8px; padding: 4px 8px; }
.composer-bar input { width: 100%; background: transparent; border: none; padding: 10px 4px; color: white; font-size: 15px; outline: none; }

.composer-attach-btn { background: none; border: none; color: #b5bac1; font-size: 22px; font-weight: bold; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; flex-shrink: 0; line-height: 1; display: flex; align-items: center; justify-content: center; }
.composer-attach-btn:hover { background-color: #43444b; color: white; }
.composer-gif-btn { background: none; border: 2px solid #6d6f78; color: #b5bac1; font-size: 11px; font-weight: 800; letter-spacing: 0.5px; padding: 3px 6px; border-radius: 4px; cursor: pointer; flex-shrink: 0; }
.composer-gif-btn:hover { border-color: white; color: white; }

.message-image { display: block; max-width: 320px; max-height: 320px; border-radius: 8px; margin-top: 6px; cursor: pointer; object-fit: contain; }
video.message-image { cursor: default; background: #000; }

#gif-picker-panel {
  position: fixed; width: 400px; max-width: calc(100vw - 32px); max-height: 380px;
  background-color: #0c0d0f; border: 1px solid #1c1d20;
  border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,0.4); z-index: 60;
  flex-direction: column; padding: 10px; animation: fadeIn 0.12s ease-out;
}
#gif-picker-search { width: 100%; padding: 10px; border-radius: 6px; border: none; background: #16171a; color: white; font-size: 14px; outline: none; box-sizing: border-box; }
#gif-picker-label { margin: 10px 2px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: #949ba4; }
#gif-picker-results { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); align-content: start; gap: 8px; overflow-y: auto; height: 280px; }
.gif-picker-item { width: 100%; border-radius: 6px; cursor: pointer; transition: transform 0.15s ease; display: block; }
.gif-picker-item:hover { transform: scale(1.04); }
.gif-picker-status { grid-column: 1 / -1; text-align: center; color: #949ba4; font-size: 13px; padding: 20px 0; }
.gif-category-tile.active { outline: 2px solid #5865F2; outline-offset: -2px; }
.gif-category-tile.active .gif-category-label { color: white; }

.gif-category-tile {
  position: relative; height: 80px; border-radius: 8px; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, #5865F2, #7289da); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; transition: transform 0.15s ease;
}
.gif-category-tile:hover { transform: scale(1.03); }
.gif-category-tile::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.25); }
.gif-category-label { position: relative; z-index: 1; color: white; font-weight: 700; font-size: 14px; text-shadow: 0 1px 4px rgba(0,0,0,0.6); text-align: center; padding: 0 8px; }
.composer-icon-btn { background: transparent; border: none; color: #b5bac1; font-size: 20px; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: color 0.15s, background 0.15s; }
.composer-icon-btn:hover { color: white; background: rgba(255,255,255,0.06); }

/* Interactive Profile Cards */
.profile-popout { position: fixed; bottom: 60px; left: 80px; width: 300px; background: #16171a; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 16px rgba(0,0,0,0.3); border: 1px solid #1c1d20; z-index: 100; animation: fadeIn 0.15s ease-out; }
.popout-banner { height: 60px; background: #4752c4; }
.popout-avatar-wrap { position: relative; margin-top: -32px; margin-left: 16px; display: inline-block; }
.popout-avatar { width: 64px; height: 64px; border-radius: 50%; border: 6px solid #16171a; background: #202225; object-fit: cover; }
.popout-avatar-wrap .status-indicator { width: 22px; height: 22px; border: 4px solid #16171a; left: 44px; bottom: 0px; }

.popout-body { padding: 12px 16px 16px 16px; }
.popout-names { background-color: #0c0d0f; border-radius: 8px; padding: 12px; text-align: left; }
.popout-names .displayname { font-size: 18px; font-weight: bold; color: white; }
.popout-names .username { font-size: 13px; color: #b5bac1; margin-top: 2px; }

.popout-divider { border: none; border-top: 1px solid #202225; margin: 12px 0; }
.popout-edit-btn { width: 100%; background: #5865f2; color: white; border: none; padding: 8px; border-radius: 4px; font-weight: 500; cursor: pointer; transition: background 0.2s; margin-top: 12px; }
.popout-edit-btn:hover { background: #4752c4; }

/* Settings Structure Model Layers */
.settings-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #26272b; z-index: 500; display: flex; animation: scaleUp 0.2s ease-out; }
.settings-sidebar { width: 240px; background: #202225; padding: 60px 20px 20px 40px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.sidebar-item { width: 192px; padding: 6px 10px; border-radius: 4px; color: #b5bac1; cursor: pointer; font-size: 15px; font-weight: 500; text-align: left; }
.sidebar-item:hover, .sidebar-item.active { background: #2a2c30; color: #dbdee1; }
.sidebar-item.active { background-color: #404249; color: white; }

.sidebar-item.logout-item { border-top: 1px solid #333539; margin-top: 8px; padding-top: 14px; color: #f04747; }
.sidebar-item.logout-item:hover { background: rgba(240,71,71,0.1); color: #f04747; }
.sidebar-item.delete-account-item { color: #f04747; margin-top: 12px; }
.sidebar-item.delete-account-item:hover { background: rgba(240,71,71,0.1); }

.settings-content { flex: 1; padding: 60px 40px 45px 40px; max-width: 740px; display: flex; flex-direction: column; position: relative; height: 100%; overflow-y: auto; box-sizing: border-box; }
.settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.settings-header h2 { margin: 0; font-size: 20px; color: white; }
.close-btn { background: transparent; border: 2px solid #b5bac1; color: #b5bac1; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; position: absolute; right: 40px; top: 60px; }
.close-btn:hover { color: white; border-color: white; transform: scale(1.05); }

.profile-edit-container { display: flex; gap: 40px; background: #16171a; padding: 16px; border-radius: 8px; }
.edit-fields { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-group label { font-size: 12px; font-weight: bold; color: #b5bac1; text-transform: uppercase; }
.input-group input { background: #16171a; border: 1px solid #0c0d0f; padding: 10px; border-radius: 4px; color: #dbdee1; font-size: 15px; outline: none; background-color: #16171a; }
.input-group input:focus { border-color: #5865f2; }

.avatar-preview-section { display: flex; flex-direction: column; align-items: center; width: 140px; }
.avatar-preview-section label { font-size: 12px; font-weight: bold; color: #b5bac1; text-transform: uppercase; margin-bottom: 8px; align-self: flex-start; }
.avatar-container-preview { width: 100px; height: 100px; border-radius: 50%; position: relative; overflow: hidden; cursor: pointer; background: #202225; }
.avatar-container-preview img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; }
.avatar-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.avatar-container-preview:hover .avatar-overlay { opacity: 1; }
.avatar-overlay span { color: white; font-size: 10px; font-weight: bold; text-align: center; padding: 4px; }

.status-msg { font-size: 14px; font-weight: 500; }
.status-msg.success { color: #23a55a; }
.status-msg.error { color: #f23f43; }

/* Discord-style Account Info card (Username / Email rows) */
.account-info-card { background-color: #202225; border-radius: 8px; margin-bottom: 24px; }
.account-info-title { padding: 16px 16px 4px 16px; font-size: 20px; font-weight: 600; color: white; }
.account-info-row { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-top: 1px solid #1f2023; }
.account-info-row:first-of-type { border-top: none; }
.account-info-label { font-size: 14px; font-weight: 600; color: #dbdee1; }
.account-info-right { display: flex; align-items: center; gap: 14px; }
.account-info-value { font-size: 14px; color: #dbdee1; }
.reveal-link { font-size: 14px; color: #00aff4; cursor: pointer; font-weight: 500; }
.reveal-link:hover { text-decoration: underline; }
.account-info-input { background: #16171a; border: 1px solid #0c0d0f; padding: 8px 10px; border-radius: 4px; color: #dbdee1; font-size: 14px; outline: none; min-width: 200px; }
.account-info-input:focus { border-color: #5865f2; }
.account-edit-btn { background-color: #43454b; color: white; border: none; padding: 8px 16px; border-radius: 4px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.account-edit-btn:hover { background-color: #6d6f78; }

/* Floating unsaved-changes prompt, mirrors Discord's "Careful — you have unsaved changes!" bar */
.unsaved-bar { position: sticky; bottom: 24px; margin-top: auto; background-color: #0c0d0f; border-radius: 8px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.4); z-index: 20; animation: fadeIn 0.15s ease-out; flex-shrink: 0; }
.unsaved-bar-text { font-size: 14px; font-weight: 600; color: white; }
.unsaved-bar-text.error { color: #f23f43; }
.unsaved-bar-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.unsaved-reset-btn { font-size: 14px; font-weight: 500; color: #dbdee1; cursor: pointer; }
.unsaved-reset-btn:hover { text-decoration: underline; }
.unsaved-save-btn { background: #23a55a; color: white; border: none; padding: 8px 16px; border-radius: 4px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.unsaved-save-btn:hover { background: #1a7f43; }
.unsaved-save-btn:disabled { background: #333539; color: #72767d; cursor: not-allowed; }

/* Brand header (logo + title) */
.brand-bar { height: 48px; padding: 0 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #1f2023; background-color: #202225; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.brand-name { font-weight: bold; font-size: 16px; color: white; letter-spacing: 0.3px; }

/* Dashboard Module Configuration Panels */
.friends-dashboard { display: flex; flex: 1; background-color: #26272b; height: 100%; }
.friends-sidebar { width: 240px; background-color: #202225; display: flex; flex-direction: column; height: 100%; border-right: 1px solid #1f2023; position: relative; }
.search-bar { height: 48px; padding: 0 10px; display: flex; align-items: center; border-bottom: 1px solid #1f2023; }
.search-input-btn { width: 100%; background-color: #16171a; border: none; border-radius: 4px; color: #949ba4; text-align: left; padding: 8px 10px; font-size: 13px; cursor: pointer; }
.dm-navigation-header { padding: 18px 10px 8px 18px; font-size: 12px; font-weight: bold; color: #949ba4; letter-spacing: 0.5px; }

.dm-list { flex: 1; padding: 0 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-nav-list { padding: 8px 8px 4px 8px; }
.sidebar-nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; cursor: pointer; color: #949ba4; font-weight: 500; font-size: 15px; }
.sidebar-nav-item:hover { background-color: #2a2c30; color: #dbdee1; }
.sidebar-nav-item.active { background-color: #404249; color: white; }
.sidebar-nav-icon { font-size: 16px; }

.dm-user-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 4px; cursor: pointer; color: #949ba4; position: relative; transition: background-color 0.15s ease, color 0.15s ease; }
.dm-user-item:hover, .dm-user-item.active { background-color: #2a2c30; color: #dbdee1; }
.dm-user-item .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.dm-user-item .username { font-weight: 500; font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-close-btn { display: none; background: none; border: none; color: #949ba4; font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 4px; flex-shrink: 0; }
.dm-user-item:hover .dm-close-btn { display: block; }
.dm-close-btn:hover { color: white; background-color: #43444b; }
.dm-user-avatar-wrap { position: relative; flex-shrink: 0; }
.dm-user-avatar-wrap .status-indicator { border-color: #202225; }
.unread-ping { position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background-color: #f23f43; border: 2px solid #202225; }

/* Search bar -> live friend search */
.search-results-dropdown { position: absolute; top: 96px; left: 8px; width: 224px; max-height: 320px; overflow-y: auto; background-color: #0c0d0f; border: 1px solid #1c1d20; border-radius: 8px; box-shadow: 0 8px 16px rgba(0,0,0,0.3); z-index: 50; animation: fadeIn 0.12s ease-out; }
.search-result-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; }
.search-result-item:hover { background-color: #202225; }
.search-result-avatar-wrap { position: relative; flex-shrink: 0; }
.search-result-avatar-wrap .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.search-result-avatar-wrap .status-indicator { width: 11px; height: 11px; border-width: 2px; left: 18px; bottom: -1px; border-color: #0c0d0f; }
.search-result-info { display: flex; flex-direction: column; overflow: hidden; }
.search-result-name { font-weight: 500; font-size: 14px; color: #dbdee1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-status { font-size: 12px; color: #949ba4; }
.search-result-empty { padding: 12px; font-size: 13px; color: #949ba4; font-style: italic; }

.friends-main-view { flex: 1; display: flex; flex-direction: column; height: 100%; }
.friends-top-nav { height: 48px; border-bottom: 1px solid #1f2023; background-color: #26272b; display: flex; align-items: center; padding: 0 16px; justify-content: space-between; }
.nav-left { display: flex; align-items: center; gap: 8px; }
.section-icon { font-size: 20px; color: #80848e; margin-right: 4px; }
.section-title { font-weight: bold; color: white; font-size: 16px; margin-right: 8px; }
.nav-divider { width: 1px; height: 16px; background-color: #333539; margin: 0 8px; }

.tab-link { padding: 4px 8px; border-radius: 4px; color: #b5bac1; cursor: pointer; font-size: 15px; font-weight: 500; position: relative; }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 6px; background-color: #f23f43; color: white; font-size: 11px; font-weight: 700; border-radius: 8px; vertical-align: middle; }
.server-badge { position: absolute; top: -5px; right: -5px; margin-left: 0; border: 2px solid #16171a; }
.tab-link:hover { background-color: #2a2c30; color: #dbdee1; }
.tab-link.active { background-color: #404249; color: white; pointer-events: none; }
.add-friend-action { padding: 4px 8px; border-radius: 4px; background-color: #248046; color: white; cursor: pointer; font-size: 15px; font-weight: 500; }
.add-friend-action.active { background-color: transparent; color: #23a55a; pointer-events: none; }

.friends-list-body { flex: 1; background-color: #26272b; display: flex; justify-content: center; align-items: center; height: 100%; overflow-y: auto; }
.empty-state-fallback { text-align: center; display: flex; flex-direction: column; align-items: center; }

.friends-list-header { padding: 20px 16px 8px 16px; font-size: 12px; font-weight: 700; color: #949ba4; letter-spacing: 0.3px; border-bottom: 1px solid #333539; }
.friends-rows { display: flex; flex-direction: column; padding: 0 8px; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid #333539; cursor: pointer; transition: background-color 0.15s ease; }
.friend-row:first-child { border-top: none; }
.friend-row:hover { background-color: #2a2c30; border-radius: 4px; }
.friend-row-avatar-wrap { position: relative; flex-shrink: 0; }
.friend-row-avatar-wrap .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.friend-row-avatar-wrap .status-indicator { border-color: #26272b; }
.friend-row-info { display: flex; flex-direction: column; overflow: hidden; }
.friend-row-name { font-weight: 600; font-size: 15px; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-row-status { font-size: 13px; color: #949ba4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pending-request-card { display: flex; justify-content: space-between; align-items: center; background-color: #202225; padding: 12px; border-radius: 8px; width: 100%; max-width: 600px; border-top: 1px solid #333539; }
.pending-user-info { display: flex; align-items: center; gap: 12px; }
.pending-user-info img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.pending-user-info .details { display: flex; flex-direction: column; }
.pending-user-info .username { font-weight: bold; color: white; }
.pending-user-info .type { font-size: 12px; color: #b5bac1; margin-top: 2px; }

.action-btns { display: flex; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; background-color: #202225; color: #b5bac1; }
.icon-btn:hover { background-color: #2a2c30; color: white; }
.icon-btn.accept:hover { background-color: #23a55a; color: white; }
.icon-btn.cancel:hover { background-color: #f23f43; color: white; }


/* ========================================================
   FIXED STATUS HOVER DRAWER - TARGETING THE LAYOUT MOCKUP
   ======================================================== */

.popout-status-container {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  cursor: pointer;
  z-index: 15;
}

/* Hidden flyout that opens to the right, avoiding overlapping structural frames */
.popout-status-container:hover .status-flyout-menu {
  display: flex;
}

.status-flyout-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: -10px;
  left: 28px;               /* Pushes menu cleanly outside the avatar circle edge */
  background-color: #0c0d0f;
  border: 1px solid #1c1d20;
  border-radius: 4px;
  padding: 6px;
  width: 140px;            /* Set exact sizing width for rows */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  gap: 4px;
}

/* Individual Status Options Rows */
.status-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 3px;
  color: #b5bac1;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.1s, color 0.1s;
}

.status-option-item:hover {
  background-color: #4752c4;
  color: white;
}

/* Sizing definitions for internal status colors */
.status-circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;          /* Keeps circle perfectly round */
}
.status-circle.online { background-color: #23a55a; }
.status-circle.idle { background-color: #f0b232; }
.status-circle.dnd { background-color: #f23f43; }
.status-circle.invisible { background-color: #80848e; }

/* BIO DISPLAY LAYOUT */
.popout-bio-section {
  background-color: #0c0d0f;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
  text-align: left;
}

.popout-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #949ba4;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.popout-bio-text {
  font-size: 13px;
  color: #dbdee1;
  white-space: pre-wrap;
  line-height: 1.4;
}

.dm-chat-back { cursor: pointer; margin-right: 12px; color: #b5bac1; font-size: 18px; font-weight: bold; }
.dm-chat-back:hover { color: white; }

.dm-chat-avatar-wrap { position: relative; width: 24px; height: 24px; margin-right: 8px; flex-shrink: 0; }
.dm-chat-avatar-wrap .avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.dm-chat-avatar-wrap .status-indicator { width: 11px; height: 11px; border-width: 2px; left: 15px; bottom: -2px; border-color: #26272b; }

.typing-indicator { display: flex; align-items: center; gap: 8px; padding: 4px 16px 10px 16px; font-size: 13px; color: #949ba4; min-height: 18px; }
.typing-dots { display: inline-flex; align-items: center; gap: 3px; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background-color: #949ba4; display: inline-block; animation: typing-bounce 1.2s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ========================================================
   SERVER VIEW: left channel sidebar (matches Public Room), message
   area, member list
   ======================================================== */
.server-view { display: flex; flex-direction: row; }
.server-channels-sidebar { position: relative; display: flex; flex-direction: column; }
.server-chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.server-name-dropdown { justify-content: space-between; cursor: pointer; }
.server-name-dropdown:hover { background-color: #2a2c30; }
.server-dropdown-chevron { color: #949ba4; font-size: 14px; }
.server-dropdown-menu {
  position: absolute; top: 52px; left: 8px; min-width: 220px; background-color: #0c0d0f;
  border: 1px solid #1c1d20; border-radius: 6px; padding: 6px; box-shadow: 0 8px 20px rgba(0,0,0,0.4); z-index: 60;
  animation: fadeIn 0.12s ease-out;
}
.server-dropdown-item { padding: 8px 10px; border-radius: 4px; font-size: 14px; font-weight: 500; color: #dbdee1; cursor: pointer; }
.server-dropdown-item:hover { background-color: #2a2c30; }
.server-dropdown-item.danger { color: #f23f43; }
.server-dropdown-item.danger:hover { background-color: rgba(240,71,71,0.15); }

.channel-list-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 4px 12px; font-size: 11px; font-weight: 700; color: #949ba4; letter-spacing: 0.4px; }
.channel-list-header button { background: none; border: none; color: #949ba4; font-size: 16px; font-weight: bold; cursor: pointer; line-height: 1; padding: 0 4px; }
.channel-list-header button:hover { color: white; }

.server-member-list { width: 240px; flex-shrink: 0; background-color: #202225; border-left: 1px solid #1f2023; padding: 16px 8px; overflow-y: auto; }
.server-member-group-label { font-size: 12px; font-weight: 700; color: #949ba4; text-transform: uppercase; padding: 8px 8px 4px 8px; letter-spacing: 0.3px; }
.server-member-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; }
.server-member-row:hover { background-color: #2a2c30; }
.server-member-row.offline-row { opacity: 0.5; }
.server-member-avatar-wrap { position: relative; flex-shrink: 0; }
.server-member-avatar-wrap .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.server-member-avatar-wrap .status-indicator { border-color: #202225; }
.server-member-name { font-size: 14px; font-weight: 500; color: #dbdee1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.server-owner-crown { font-size: 12px; }
.full-profile-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.75); z-index: 800; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.15s ease-out; }
.full-profile-card { position: relative; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; background: #16171a; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,0.5); animation: scaleUp 0.15s ease-out; }
.full-profile-close { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.4); border: none; color: white; width: 32px; height: 32px; border-radius: 50%; font-size: 15px; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; }
.full-profile-close:hover { background: rgba(0,0,0,0.6); }

.full-profile-banner { height: 100px; background: #4752c4; }
.full-profile-avatar-wrap { position: relative; margin-top: -48px; margin-left: 24px; display: inline-block; }
.full-profile-avatar { width: 92px; height: 92px; border-radius: 50%; border: 6px solid #16171a; background: #202225; object-fit: cover; }
.full-profile-avatar-wrap .status-indicator { width: 26px; height: 26px; border: 5px solid #16171a; left: 62px; bottom: 4px; }

.full-profile-body { padding: 16px 24px 24px 24px; }
.full-profile-names { background-color: #0c0d0f; border-radius: 8px; padding: 14px; }
.full-profile-names .displayname { font-size: 22px; }
.full-profile-joined { font-size: 12px; color: #949ba4; margin-top: 8px; }
.full-profile-friends-since { font-size: 12px; color: #949ba4; margin-top: 4px; }

.full-profile-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.full-profile-message-btn { flex: 1; background: #5865f2; color: white; border: none; padding: 10px; border-radius: 4px; font-weight: 600; font-size: 14px; cursor: pointer; transition: background 0.2s; }
.full-profile-message-btn:hover { background: #4752c4; }

.full-profile-more-wrap { position: relative; }
.full-profile-more-btn { background: #202225; color: #dbdee1; border: none; width: 40px; height: 40px; border-radius: 4px; font-size: 18px; font-weight: bold; cursor: pointer; letter-spacing: 1px; }
.full-profile-more-btn:hover { background: #2a2c30; }
.full-profile-more-menu { position: absolute; bottom: 46px; right: 0; background-color: #0c0d0f; border: 1px solid #1c1d20; border-radius: 6px; padding: 6px; width: 170px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); z-index: 5; animation: fadeIn 0.12s ease-out; }
.full-profile-more-item { padding: 8px 10px; border-radius: 4px; font-size: 14px; font-weight: 500; cursor: pointer; color: #dbdee1; }
.full-profile-more-item:hover { background-color: #2a2c30; }
.full-profile-more-item.danger { color: #f23f43; }
.full-profile-more-item.danger:hover { background-color: rgba(240,71,71,0.15); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
/* Popup modals (Create Channel, Add Server, Delete/Remove confirmations, etc.)
   are built with inline styles rather than a shared class, so this targets
   their single content box by id instead — same pop-in every other modal
   already gets, without touching the JS that opens each one. */
#create-channel-modal > div,
#add-server-modal > div,
#delete-server-confirm-modal > div,
#invite-friend-modal > div,
#remove-friend-confirm-modal > div,
#close-dm-confirm-modal > div,
#image-select-modal > div,
#delete-confirm-modal > div,
#delete-message-confirm-modal > div {
  animation: scaleUp 0.15s ease-out;
}

@keyframes scaleUp { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* =========================================================
   MINKI v15 — social/chat polish
   ========================================================= */
.minki-server-disabled { opacity:.45; cursor:not-allowed !important; }
.minki-server-disabled:hover { background:#202225 !important; color:#23a55a !important; border-radius:50% !important; }

.friend-row { position:relative; min-height:64px; padding:8px 12px; border-radius:8px; display:flex; align-items:center; gap:12px; cursor:pointer; transition:background .12s ease; }
.friend-row:hover { background:#2b2d31; }
.friend-row-avatar-wrap { position:relative; flex:0 0 auto; }
.friend-row-avatar-wrap .avatar { width:42px; height:42px; border-radius:50%; object-fit:cover; }
.friend-row-avatar-wrap .status-indicator { left:28px; bottom:-1px; }
.friend-row-info { min-width:0; flex:1; }
.friend-row-name { color:#f2f3f5; font-size:15px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.friend-row-status { color:#949ba4; font-size:12px; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.minki-friend-actions { display:flex; gap:6px; opacity:0; transition:opacity .12s ease; }
.friend-row:hover .minki-friend-actions { opacity:1; }
.minki-friend-actions button { width:34px; height:34px; border:0; border-radius:50%; background:#1e1f22; color:#dbdee1; cursor:pointer; }
.minki-friend-actions button:hover { background:#5865f2; color:white; }

.minki-message-actions { position:absolute; right:8px; top:-12px; display:flex; gap:3px; padding:4px; border:1px solid #1c1d20; border-radius:7px; background:#111214; box-shadow:0 5px 18px rgba(0,0,0,.35); opacity:0; pointer-events:none; transform:translateY(2px); transition:opacity .12s ease,transform .12s ease; z-index:4; }
.message:hover .minki-message-actions, body.minki-actions-always .minki-message-actions { opacity:1; pointer-events:auto; transform:translateY(0); }
.minki-message-actions button { border:0; background:transparent; color:#b5bac1; min-width:28px; height:28px; border-radius:5px; cursor:pointer; font-size:14px; }
.minki-message-actions button:hover { background:#2b2d31; color:white; }
.minki-reaction-row { display:flex; flex-wrap:wrap; gap:5px; margin-top:5px; }
.minki-reaction-chip { border:1px solid #3a3c43; background:#1f2024; color:#dbdee1; border-radius:10px; padding:3px 7px; cursor:pointer; font-size:13px; }
.minki-reaction-chip:hover,.minki-reaction-chip.mine { border-color:#5865f2; background:rgba(88,101,242,.18); }
.minki-reaction-chip span { color:#b5bac1; margin-left:2px; }
.message-edited { color:#72767d; font-size:10px; font-weight:400; }
.minki-inline-editor { width:min(620px,100%); }
.minki-inline-editor textarea { width:100%; min-height:48px; resize:vertical; box-sizing:border-box; background:#1e1f22; color:#f2f3f5; border:1px solid #5865f2; border-radius:6px; padding:9px 10px; font:inherit; outline:none; }
.minki-inline-editor-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:6px; }
.minki-inline-editor-actions button { border:0; border-radius:5px; padding:6px 12px; background:#2b2d31; color:#dbdee1; cursor:pointer; }
.minki-inline-editor-actions button.primary { background:#5865f2; color:#fff; }

.minki-drop-active { outline:2px dashed #5865f2; outline-offset:-5px; background:rgba(88,101,242,.08) !important; }
.minki-custom-status, .popout-custom-status { color:#b5bac1; font-size:13px; margin:0 0 10px; white-space:pre-wrap; word-break:break-word; }
.popout-custom-status::before { content:'✦ '; color:#f0b232; }

.minki-v15-settings { margin:24px 0 70px; padding:18px; border:1px solid #303238; border-radius:10px; background:#1e1f22; }
.minki-settings-nav { display:flex; flex-wrap:wrap; gap:6px; border-bottom:1px solid #303238; padding-bottom:10px; margin-bottom:16px; }
.minki-settings-tab { border:0; background:transparent; color:#949ba4; padding:8px 11px; border-radius:5px; cursor:pointer; font-weight:600; }
.minki-settings-tab:hover { background:#2b2d31; color:#dbdee1; }
.minki-settings-tab.active { background:#5865f2; color:#fff; }
.minki-settings-panel { display:none; }
.minki-settings-panel.active { display:block; }
.minki-settings-panel h3 { margin:0 0 5px; color:#fff; font-size:18px; }
.minki-settings-panel p { color:#949ba4; font-size:13px; margin:0 0 16px; line-height:1.5; }
.minki-banner-editor { max-width:560px; padding:0 0 15px; }
.minki-banner-preview { height:120px; border-radius:8px; background:#111214 center/cover no-repeat; border:1px solid #303238; margin-bottom:9px; }
.minki-secondary-btn,.minki-primary-btn { border:0; border-radius:5px; padding:9px 14px; font-weight:700; cursor:pointer; }
.minki-secondary-btn { background:#2b2d31; color:#dbdee1; }
.minki-secondary-btn:hover { background:#35373c; }
.minki-primary-btn { background:#5865f2; color:#fff; margin-top:8px; }
.minki-primary-btn:hover { background:#4752c4; }
.minki-danger-link { background:transparent; border:0; color:#f23f43; margin-left:10px; cursor:pointer; }
.minki-inline-fields { display:grid; grid-template-columns:minmax(0,2fr) minmax(150px,1fr); gap:12px; max-width:560px; }
.minki-inline-fields select { width:100%; background:#16171a; color:#dbdee1; border:0; border-radius:5px; padding:10px; }
.minki-settings-status { margin-left:10px; color:#23a55a; font-size:13px; }
.minki-settings-status.error { color:#f23f43; }
.minki-status-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; max-width:520px; }
.minki-status-grid button { display:flex; align-items:center; gap:10px; background:#1c1d20; border:1px solid #303238; color:#dbdee1; border-radius:7px; padding:11px; cursor:pointer; text-align:left; }
.minki-status-grid button:hover { border-color:#5865f2; background:#25272b; }
.minki-toggle-row { display:flex; align-items:center; justify-content:space-between; max-width:560px; padding:12px 0; border-bottom:1px solid #303238; color:#dbdee1; font-size:14px; }
.minki-toggle-row input { width:18px; height:18px; accent-color:#5865f2; }
.minki-blocked-list { display:flex; flex-direction:column; gap:7px; max-width:560px; }
.minki-blocked-row { display:flex; align-items:center; gap:10px; padding:8px; background:#1c1d20; border-radius:7px; }
.minki-blocked-row img { width:36px; height:36px; border-radius:50%; object-fit:cover; }
.minki-blocked-row div { min-width:0; flex:1; display:flex; flex-direction:column; }
.minki-blocked-row strong { color:#dbdee1; font-size:14px; }
.minki-blocked-row span { color:#72767d; font-size:12px; }
.minki-blocked-row button { background:transparent; border:1px solid #43454b; color:#dbdee1; border-radius:5px; padding:6px 9px; cursor:pointer; }
.minki-blocked-row button:hover { border-color:#23a55a; color:#23a55a; }
.minki-muted { color:#72767d; font-size:13px; padding:8px 0; }
body.minki-compact .message { margin-top:7px; }
body.minki-compact .message + .message { margin-top:7px; }
body.minki-compact .message.grouped + .message.grouped, body.minki-compact .message + .message.grouped { margin-top:0; }

.minki-embed-mode .servers { width:58px; }
.minki-embed-mode #home-nav-btn, .minki-embed-mode #public-room-nav-btn { display:none; }
.minki-embed-mode .friends-sidebar { width:260px; }
.minki-embed-mode .friends-main-view { min-width:0; }
.minki-embed-mode .minki-v15-settings { display:none; }

@media (max-width:700px) {
  .minki-inline-fields,.minki-status-grid { grid-template-columns:1fr; }
  .minki-message-actions { right:2px; }
  .minki-message-actions button { min-width:26px; }
  .minki-v15-settings { margin:12px 0 60px; padding:12px; }
}

/* Servers are intentionally hidden while server creation is disabled. Public Room remains available. */
#dynamic-servers-list, #add-server-trigger { display:none !important; }

body.minki-hide-unread #home-badge, body.minki-hide-unread #pending-badge, body.minki-hide-unread .unread-ping { display:none !important; }

/* =========================================================
   MINKI v16 — Discord-inspired User Settings redesign
   ========================================================= */
.settings-modal {
  background: #313338;
  color: #dbdee1;
  animation: none;
}
.settings-sidebar {
  width: 250px;
  min-width: 250px;
  box-sizing: border-box;
  background: #2b2d31;
  padding: 54px 12px 28px;
  align-items: stretch;
  overflow-y: auto;
}
.settings-sidebar-inner {
  width: 100%;
  max-width: 220px;
  margin-left: auto;
  margin-right: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.settings-sidebar-title {
  color: #949ba4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 0 10px 8px;
}
.settings-sidebar .sidebar-item {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 4px;
  color: #b5bac1;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.settings-sidebar .sidebar-item:hover {
  background: #35373c;
  color: #dbdee1;
}
.settings-sidebar .sidebar-item.active {
  background: #404249;
  color: #fff;
  font-weight: 600;
}
.settings-sidebar-divider {
  height: 1px;
  background: #3b3d42;
  margin: 12px 10px;
}
.settings-sidebar .delete-account-item {
  color: #f23f43;
  margin-top: 0;
}
.settings-sidebar .delete-account-item:hover {
  color: #fff;
  background: #4b292c;
}
.settings-sidebar .logout-item {
  color: #f23f43;
  border-top: 0;
  margin-top: auto;
  padding-top: 9px;
}
.settings-sidebar .logout-item:hover {
  color: #fff;
  background: #4b292c;
}

.settings-content {
  width: min(100%, 980px);
  max-width: 980px;
  padding: 54px 48px 96px;
  margin: 0;
  box-sizing: border-box;
  overflow-y: auto;
  background: #313338;
}
.settings-header {
  max-width: 740px;
  margin-bottom: 30px;
  align-items: flex-start;
}
.settings-breadcrumb {
  color: #949ba4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  margin-bottom: 7px;
}
.settings-header h2 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0;
  color: #f2f3f5;
}
.settings-header .close-btn {
  position: fixed;
  right: 30px;
  top: 26px;
  width: 36px;
  height: 36px;
  border: 0;
  background: #2b2d31;
  color: #b5bac1;
  font-size: 16px;
}
.settings-header .close-btn:hover {
  background: #404249;
  color: #fff;
  transform: none;
}

.minki-settings-panels {
  width: 100%;
  max-width: 740px;
}
.minki-settings-panel {
  display: none;
}
.minki-settings-panel.active {
  display: block;
}
.settings-section-heading {
  margin-bottom: 18px;
}
.settings-section-heading h3 {
  margin: 0 0 6px;
  color: #f2f3f5;
  font-size: 20px;
  line-height: 1.25;
}
.settings-section-heading p {
  margin: 0;
  color: #949ba4;
  font-size: 13px;
  line-height: 1.5;
}
.settings-card {
  background: #2b2d31;
  border: 1px solid #1e1f22;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}
.settings-card-title {
  color: #f2f3f5;
  font-size: 15px;
  font-weight: 700;
  padding: 18px 20px 10px;
}
.settings-card-description,
.settings-info-card p {
  margin: 0;
  padding: 0 20px 18px;
  color: #949ba4;
  font-size: 13px;
  line-height: 1.55;
}

.account-profile-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: #232428;
  border-bottom: 1px solid #1e1f22;
}
.settings-account-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #111214;
  flex: 0 0 auto;
}
.account-profile-summary-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.account-profile-summary-text strong {
  color: #f2f3f5;
  font-size: 17px;
}
.account-profile-summary-text span {
  color: #949ba4;
  font-size: 13px;
}
.settings-row {
  min-height: 72px;
  padding: 15px 20px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #1e1f22;
}
.settings-row-label {
  color: #949ba4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.settings-row-value {
  color: #f2f3f5;
  font-size: 14px;
  word-break: break-word;
}
.settings-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-secondary-btn,
.account-edit-btn {
  border: 0;
  border-radius: 4px;
  background: #4e5058;
  color: #fff;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.settings-secondary-btn:hover,
.account-edit-btn:hover {
  background: #686b74;
}
.settings-secondary-btn:disabled {
  opacity: .6;
  cursor: wait;
}
.settings-danger-zone {
  border: 1px solid #5c2528;
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #2b2d31;
}
.settings-danger-zone h3 {
  margin: 0 0 5px;
  color: #f23f43;
  font-size: 15px;
}
.settings-danger-zone p {
  margin: 0;
  color: #949ba4;
  font-size: 13px;
}
.settings-danger-btn {
  flex: 0 0 auto;
  border: 1px solid #f23f43;
  border-radius: 4px;
  background: transparent;
  color: #f23f43;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.settings-danger-btn:hover { background: #f23f43; color: #fff; }

.profile-settings-card { overflow: visible; }
.profile-settings-preview {
  background: #1e1f22;
  border-bottom: 1px solid #1e1f22;
  position: relative;
}
.profile-settings-banner {
  height: 150px;
  background: #5865f2;
  background-size: cover;
  background-position: center;
}
.profile-settings-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 24px;
}
.profile-settings-avatar-wrap > img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid #1e1f22;
  background: #111214;
  box-sizing: border-box;
}
.profile-avatar-change {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0;
  cursor: pointer;
  transition: opacity .12s ease;
}
.profile-settings-avatar-wrap:hover .profile-avatar-change { opacity: 1; }
.profile-settings-preview-body { padding: 10px 24px 20px; }
.profile-settings-preview-name { color: #f2f3f5; font-size: 19px; font-weight: 700; }
.profile-settings-preview-username { color: #b5bac1; font-size: 13px; margin-top: 2px; }
.profile-settings-preview-note { color: #72767d; font-size: 12px; margin-top: 12px; }
.profile-settings-fields { padding: 22px 20px 20px; }
.settings-field { margin-bottom: 20px; }
.settings-field:last-child { margin-bottom: 0; }
.settings-field label {
  display: block;
  color: #b5bac1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.settings-field input,
.settings-field textarea,
.account-info-input {
  width: 100%;
  box-sizing: border-box;
  background: #1e1f22;
  color: #f2f3f5;
  border: 1px solid #111214;
  border-radius: 4px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.settings-field input:focus,
.settings-field textarea:focus,
.account-info-input:focus { border-color: #5865f2; }
.settings-field textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
.settings-field small { display: block; margin-top: 6px; color: #72767d; font-size: 11px; line-height: 1.4; }
.banner-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-danger-link { border: 0; background: transparent; color: #f23f43; font-size: 13px; font-weight: 600; cursor: pointer; padding: 8px 0; }
.settings-danger-link:hover { text-decoration: underline; }

.settings-toggle-row {
  min-height: 68px;
  padding: 14px 20px;
  border-top: 1px solid #1e1f22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
}
.settings-toggle-row:first-of-type { border-top: 0; }
.settings-toggle-row > span { display: flex; flex-direction: column; gap: 4px; }
.settings-toggle-row strong { color: #f2f3f5; font-size: 14px; font-weight: 600; }
.settings-toggle-row small { color: #949ba4; font-size: 12px; line-height: 1.4; }
.settings-toggle-row input {
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #4e5058;
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
  transition: background .15s ease;
}
.settings-toggle-row input::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #f2f3f5;
  transition: transform .15s ease;
}
.settings-toggle-row input:checked { background: #23a55a; }
.settings-toggle-row input:checked::after { transform: translateX(20px); }

.minki-settings-status { margin-left: 10px; color: #23a55a; font-size: 13px; }
.minki-settings-status.error { color: #f23f43; }
.unsaved-bar {
  position: fixed;
  left: 298px;
  right: 28px;
  bottom: 18px;
  max-width: 740px;
  margin: 0;
  background: #111214;
  border: 1px solid #1e1f22;
  border-radius: 8px;
  padding: 12px 16px;
  box-sizing: border-box;
  z-index: 20;
}

@media (max-width: 760px) {
  .settings-sidebar { width: 190px; min-width: 190px; padding-left: 8px; padding-right: 8px; }
  .settings-content { padding: 42px 24px 96px; }
  .settings-header .close-btn { right: 14px; top: 14px; }
  .unsaved-bar { left: 206px; right: 12px; }
}

/* =========================================================
   MINKI v18 — Discord-like polish
   Inspired by the spacing, surfaces, controls and profile-card patterns
   used in Discord's public UI kit; this is an independent implementation.
   ========================================================= */
.settings-modal {
  background: #313338 !important;
  font-family: "gg sans", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
.settings-sidebar {
  width: 218px !important;
  min-width: 218px !important;
  background: #2b2d31 !important;
  padding: 60px 10px 24px 16px !important;
}
.settings-sidebar-inner {
  max-width: 190px !important;
  margin: 0 !important;
}
.settings-sidebar-title {
  padding: 0 10px 8px !important;
  font-size: 11px !important;
  letter-spacing: .05em !important;
}
.settings-sidebar .sidebar-item {
  min-height: 34px;
  padding: 8px 10px !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  line-height: 18px;
}
.settings-content {
  width: auto !important;
  max-width: none !important;
  flex: 1 1 auto !important;
  padding: 60px 48px 96px 42px !important;
  background: #313338 !important;
}
.settings-header,
.minki-settings-panels {
  width: min(740px, 100%) !important;
  max-width: 740px !important;
}
.settings-header {
  margin-bottom: 28px !important;
}
.settings-breadcrumb { display: none !important; }
.settings-header h2 {
  font-size: 20px !important;
  font-weight: 700 !important;
}
.settings-header .close-btn {
  position: fixed !important;
  right: 32px !important;
  top: 28px !important;
  width: 40px !important;
  height: 40px !important;
  background: transparent !important;
  border: 2px solid #b5bac1 !important;
  border-radius: 50% !important;
  font-size: 17px !important;
}
.settings-header .close-btn::after {
  content: "ESC";
  position: absolute;
  top: 43px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #949ba4;
  font-weight: 700;
}
.settings-header .close-btn:hover {
  background: #404249 !important;
  border-color: #f2f3f5 !important;
}
.settings-section-heading { margin-bottom: 16px !important; }
.settings-section-heading h3 {
  font-size: 20px !important;
  margin-bottom: 6px !important;
}
.settings-section-heading p { font-size: 13px !important; }
.settings-card {
  background: #2b2d31 !important;
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

/* Profile editor: closer to Discord's profile customization card. */
.profile-settings-card {
  overflow: hidden !important;
  background: #2b2d31 !important;
}
.profile-settings-preview {
  background: #2b2d31 !important;
  border: 0 !important;
}
.profile-settings-banner {
  height: 180px !important;
  background-color: #5865f2 !important;
  background-size: cover !important;
  background-position: center !important;
  cursor: pointer !important;
  position: relative;
  transition: filter .12s ease;
}
.profile-settings-banner:hover { filter: brightness(.92); }
.profile-settings-avatar-wrap {
  width: 96px !important;
  height: 96px !important;
  margin: -48px 0 0 24px !important;
  z-index: 2;
}
.profile-settings-avatar-wrap > img {
  cursor: pointer !important;
  border: 6px solid #2b2d31 !important;
}
.profile-settings-preview-body {
  padding: 10px 24px 22px !important;
}
.profile-settings-preview-name { font-size: 20px !important; }
.profile-settings-preview-username { font-size: 13px !important; }
.profile-settings-preview-note { display: none !important; }
.profile-settings-fields {
  padding: 24px !important;
  background: #232428;
  border-top: 1px solid #1e1f22;
}
.settings-field { margin-bottom: 22px !important; }
.settings-field label {
  color: #b5bac1 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}
.settings-field input,
.settings-field textarea {
  background: #1e1f22 !important;
  border: 1px solid #1e1f22 !important;
  border-radius: 4px !important;
  min-height: 40px;
}
.settings-field textarea { min-height: 92px; }
.settings-field input:focus,
.settings-field textarea:focus {
  border-color: #5865f2 !important;
}
.banner-controls {
  padding-top: 4px;
}

/* Attachment previews and sent images feel like Discord media cards. */
.message-image {
  max-width: 420px !important;
  max-height: 420px !important;
  border-radius: 8px !important;
  transition: filter .12s ease, transform .12s ease;
}
.message-image:hover { filter: brightness(.92); }
video.message-image { cursor: default !important; }

/* Explicit DM timestamp gutter — always readable, even for grouped messages. */
.day-divider {
  margin: 22px 0 14px !important;
  gap: 10px !important;
}
.day-divider-line { background: #3f4147 !important; }
.day-divider-label {
  color: #949ba4 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

/* Profile clicks remain intentional and visually discoverable. */
[data-viewprofile] { cursor: pointer !important; }
[data-viewprofile]:hover { filter: brightness(1.08); }

@media (max-width: 760px) {
  .settings-sidebar { width: 190px !important; min-width: 190px !important; }
  .settings-content { padding: 48px 22px 96px !important; }
  .settings-header .close-btn { right: 16px !important; top: 16px !important; }
  .settings-header .close-btn::after { display: none; }
}

/* MINKI v22 requested fixes — no v19 visual override layer */
.popout-action-row { display:flex; gap:8px; margin-top:16px; }
.popout-action-row .popout-edit-btn { margin-top:0; flex:1; }
.message .timestamp { white-space:nowrap; }
.profile-popout .popout-banner, .full-profile-banner { background-size:cover; background-position:center; }
.profile-settings-banner { cursor:pointer; background-size:cover; background-position:center; }

.minki-toast { position:fixed; left:50%; bottom:28px; transform:translate(-50%,16px); max-width:min(520px,calc(100vw - 32px)); padding:11px 15px; border:1px solid #3f4148; border-radius:8px; background:#18191c; color:#f2f3f5; box-shadow:0 10px 30px rgba(0,0,0,.35); font-size:13px; line-height:1.4; opacity:0; pointer-events:none; transition:opacity .16s ease,transform .16s ease; z-index:10000; }
.minki-toast.show { opacity:1; transform:translate(-50%,0); }
.minki-toast[data-kind="error"] { border-color:#ed4245; }
.minki-reaction-picker { position:fixed; display:flex; flex-wrap:wrap; gap:3px; width:220px; padding:6px; border:1px solid #3f4148; border-radius:8px; background:#18191c; box-shadow:0 10px 30px rgba(0,0,0,.45); z-index:10001; }
.minki-reaction-picker button { width:38px; height:38px; border:0; border-radius:6px; background:transparent; cursor:pointer; font-size:21px; }
.minki-reaction-picker button:hover { background:#2b2d31; transform:scale(1.05); }


/* MINKI v31 — profile badges + reaction polish */
.minki-profile-badges { display:inline-flex; align-items:center; gap:3px; vertical-align:middle; margin-left:4px; }
.minki-profile-badge { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 4px; box-sizing:border-box; border-radius:5px; background:#3f4148; color:#f2f3f5; font-size:11px; line-height:1; font-weight:700; cursor:default; }
.minki-popout-badges { display:flex; flex-wrap:wrap; gap:4px; margin-top:5px; }
.minki-popout-badges .minki-profile-badge { min-width:22px; height:20px; border-radius:6px; font-size:12px; }
.minki-reaction-row { min-height:0; align-items:center; }
.minki-reaction-chip { min-height:26px; display:inline-flex; align-items:center; justify-content:center; gap:2px; border-radius:8px; padding:3px 8px; font-size:14px; line-height:1; }
.minki-reaction-chip span { font-size:12px; }

/* MINKI v32 — badges are intentionally shown only in the full profile modal. */
.message .minki-profile-badges, .profile-popout .minki-popout-badges, #other-profile-popout .minki-popout-badges { display:none !important; }
.full-profile-modal .minki-popout-badges { display:flex; }
