@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

#friendModal,
#friendModal *,
#friendModal *::before,
#friendModal *::after {
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =========================
   Modal shell
========================= */
#friendModal {
  width: 95%;
  max-width: 1080px;
  height: 88vh;
  max-height: 820px;
  background: #09090b;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);

  --bg: #09090b;
  --surface: #111113;
  --s1: #111113;
  --s2: #18181b;
  --s3: #232326;
  --line: rgba(255,255,255,0.06);
  --txt: #fafafa;
  --txt2: #a1a1aa;
  --muted: #71717a;
  --accent: #f2c94c;
  --green: #22c55e;
  --red: #ef4444;
  --r: 14px;
}

#friendModal ::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}
#friendModal ::-webkit-scrollbar-track {
  background: transparent;
}
#friendModal ::-webkit-scrollbar-thumb {
  background: #2c2c2c;
  border-radius: 99px;
}

/* =========================
   Top bar
========================= */
.fm-topbar {
  display: flex;
  align-items: center;
  padding: 14px 16px 0;
  gap: 8px;
  flex-shrink: 0;
}

#friendModalTitle {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--txt);
  letter-spacing: -0.4px;
}

#friendSectionTitle {
  font-size: 12px;
  color: var(--txt2);
  font-weight: 500;
}

#friendBadge {
  display: none;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
  margin-left: auto;
  margin-right: 40px;
}

#friendModalClose {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 28px;
  height: 28px;
  background: var(--s2);
  border: none;
  color: var(--txt2);
  font-size: 14px;
  cursor: pointer;
  z-index: 1750;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .12s, color .12s;
}
#friendModalClose:hover {
  background: var(--s3);
  color: var(--txt);
}

/* =========================
   Main layout
========================= */
.content-area {
  display: grid !important;
  grid-template-columns: 350px 1fr !important;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  gap: 0 !important;
  margin-top: 10px;
}

.left-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg);
  padding: 0 !important;
  border-radius: 0 !important;
}

.right-col {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden;
  background: var(--bg);
  border-radius: 0 !important;
  border: none !important;
}

/* =========================
   Tabs
========================= */
.friend-tab-row {
  display: flex;
  gap: 3px;
  padding: 10px 8px 8px;
  margin-bottom: 0 !important;
  overflow-x: auto;
  overflow-y: visible !important;
  scrollbar-width: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.friend-tab-row::-webkit-scrollbar {
  display: none;
}

.friend-tab-btn {
  flex: 1;
  min-width: 46px !important;
  height: 38px !important;
  border: none !important;
  background: transparent !important;
  color: var(--txt2) !important;
  cursor: pointer;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  overflow: visible !important;
  transition: background .12s, color .12s;
  padding: 0 !important;
}

.friend-tab-btn:hover {
  background: var(--s2) !important;
  color: var(--txt) !important;
}
.friend-tab-btn.active {
  background: var(--s2) !important;
  color: var(--accent) !important;
}

.tab-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-sizing: border-box;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.35);
  z-index: 50;
  pointer-events: none;
}

/* =========================
   Panels / lists
========================= */
.friends-list,
#allFriendsList,
#requestsList,
#findList,
#globalUsersList {
  list-style: none !important;
  margin: 0 !important;
  padding: 6px !important;
  overflow-y: auto;
  flex: 1;
}

#friendModal #allFriendsList,
#friendModal #requestsList,
#friendModal #findList,
#friendModal #globalUsersList {
  max-height: none !important;
}

#allPanel,
#requestsPanel,
#findPanel,
#globalUsersPanel {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#allPanel {
  display: flex;
}

#requestsPanel,
#findPanel,
#globalUsersPanel {
  display: none;
}

#requestsPanel > div {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  flex: 1;
}
#requestsPanel > div > div {
  overflow: auto;
  flex: 1;
}
#requestsPanel h4 {
  font-size: 10px;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 8px 0 4px;
  padding: 0 10px;
}

/* =========================
   Friend rows
========================= */
.friend-row,
#allFriendsList li,
#requestsList li,
#findList li,
#globalUsersList li {
  list-style: none !important;
  padding: 8px 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: none !important;
  border-radius: var(--r) !important;
  cursor: pointer;
  transition: background .1s, transform .08s;
  position: relative;
  gap: 10px;
}

.friend-row:hover,
#allFriendsList li:hover,
#requestsList li:hover,
#findList li:hover,
#globalUsersList li:hover {
  background: var(--s2) !important;
}

.friend-row img,
#allFriendsList img,
#requestsList img,
#findList img,
#globalUsersList img {
  border-radius: 50% !important;
  object-fit: cover;
}

/* unread badge: only top-right, on PC and mobile */
.row-unread-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.35);
  z-index: 10;
  pointer-events: none;
}

.friend-row.has-unread-dm {
  background: rgba(240, 64, 64, 0.08) !important;
  border-left: 3px solid var(--red) !important;
  padding-right: 46px !important;
}

.friend-row.has-unread-dm .row-unread-dot {
  display: inline-flex !important;
}

.friend-row.has-unread-dm .bio {
  color: #9fbfe6 !important;
}

.row-dots-btn, .row-view-btn {
  background: var(--s2) !important;
  color: var(--txt2);
  font-size: 14px;
  cursor: pointer;
  padding: 0 !important;
  border-radius: 8px;
  opacity: 1;
  transition: background .12s, color .12s, transform .08s;
  width: 32px !important;
  height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
}
.row-dots-btn:hover, .row-view-btn:hover {
  background: var(--s3) !important;
  color: var(--txt) !important;
  transform: translateY(-1px);
}

/* =========================
   Find
========================= */
#findSearchInput,
.find-search {
  width: calc(100% - 12px) !important;
  margin: 8px 6px 6px !important;
  padding: 9px 12px !important;
  border-radius: var(--r) !important;
  background: var(--s2) !important;
  border: none !important;
  color: var(--txt) !important;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: background .12s;
  display: block;
  flex-shrink: 0;
}
#findSearchInput::placeholder,
.find-search::placeholder {
  color: var(--txt2);
}
#findSearchInput:focus,
.find-search:focus {
  background: var(--s3) !important;
}
#findPanel {
  padding: 0 !important;
}
#findPanel > div {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#globalUsersPanel .gp-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 10px 14px 6px;
  flex-shrink: 0;
}

/* =========================
   Mobile chat controls
========================= */
#mobileChatBackBtn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}

#mobileOnlineStrip {
  display: none;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--s1);
  border-bottom: 1px solid var(--line);
}
#mobileOnlineStrip .mos-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 8px 12px 4px;
}
#mobileOnlineStripList {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 4px 6px 6px;
}
#mobileOnlineStripList li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .1s;
  list-style: none;
}
#mobileOnlineStripList li:hover {
  background: var(--s2);
}
#mobileOnlineStripList img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
#mobileOnlineStripList .mos-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#mobileOnlineStripList button {
  margin-left: auto;
  flex-shrink: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

#mobileChatBackInlineBtn {
  display: none;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: var(--s2);
  color: var(--txt);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
#mobileChatBackInlineBtn:hover {
  background: var(--s3);
}

/* =========================
   Chat header / body
========================= */
.chat-header {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--line) !important;
  background: transparent !important;
  flex-shrink: 0;
}
.chat-header .avatar {
  position: relative;
  flex-shrink: 0;
}
#chatHeaderAvatar {
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  object-fit: cover;
  display: block;
  background: var(--s2);
}
.chat-header .online-dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--bg);
  position: absolute;
  bottom: -1px;
  right: -1px;
}
#chatHeaderName {
  font-weight: 800 !important;
  font-size: 15px !important;
  color: var(--txt) !important;
}
#chatHeaderBio {
  font-size: 12px !important;
  color: var(--txt2) !important;
  margin-top: 2px;
}
#onlineStats {
  margin-left: auto;
  font-size: 12px;
  color: var(--txt2);
  text-align: right;
}

#chatMessages {
  flex: 1 1 auto !important;
  padding: 12px 14px !important;
  overflow-y: auto !important;
  background: var(--bg) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  color: var(--txt);
}

.date-sep {
  text-align: center !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--txt2) !important;
  margin: 10px 0 !important;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: transparent !important;
  display: block;
}

/* =========================
   Message bubbles
========================= */
.bubble {
  position: relative;
  padding: 9px 12px 26px !important;
  border-radius: 14px;
  display: inline-block;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 72%;
  min-width: 8ch;
  box-sizing: border-box;
  overflow: hidden;
}
.bubble.me {
  background: #0096FF !important;
  color: #fff !important;
  border: none !important;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}
.bubble.them {
  background: var(--s2) !important;
  color: var(--txt) !important;
  border: none !important;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 14px;
}
.msg-text {
  white-space: pre-wrap;
  line-height: 1.45;
  word-break: break-word;
  color: inherit !important;
}
.msg-time {
  position: absolute;
  bottom: 6px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  opacity: .65;
}
.bubble.me .msg-time {
  right: 10px;
  color: rgba(255,255,255,.9) !important;
}
.bubble.them .msg-time {
  right: 10px;
  color: var(--txt2) !important;
}

/* Mention highlight bubble — ONLY for received messages */
.bubble.them.mentioned {
  background: #261a00 !important;
}
/* Mention autocomplete dropdown */
#mentionDropdown {
  position: absolute;
  min-width: 200px;
  max-width: 280px;
  max-height: 220px;
  overflow-y: auto;
  background: #18181b;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  z-index: 1900;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
}
#mentionDropdown .mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .1s;
}
#mentionDropdown .mention-item:hover,
#mentionDropdown .mention-item.active {
  background: var(--s3);
}
#mentionDropdown .mention-item img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
#mentionDropdown .mention-item span {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sender-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--txt2);
  margin-bottom: 3px;
}
.chat-link {
  color: #60a5fa;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.chat-link:hover {
  color: #93c5fd;
}

/* bubble images */
.bubble img.chat-img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 200px;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
  box-sizing: border-box;
}
.bubble.image-only {
  position: relative;
  display: inline-block;
  padding: 6px !important;
  background: var(--s2) !important;
  border-radius: 12px;
  box-shadow: none !important;
  max-width: max-content;
}
.bubble.image-only img.chat-img {
  max-width: 72px;
  max-height: 120px;
  border-radius: 8px;
}
.bubble.image-only .img-controls-bottom {
  display: none !important;
}

.image-fullscreen-overlay {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80vw;
  max-width: 1200px;
  height: 80vh;
  background: rgba(4,4,4,.97);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 18px;
  box-sizing: border-box;
  gap: 12px;
}
.image-fullscreen-overlay img {
  max-width: 100%;
  max-height: calc(100% - 48px);
  border-radius: 8px;
  object-fit: contain;
}
.image-fullscreen-close {
  color: #fff;
  position: absolute;
  right: 18px;
  top: 18px;
  background: rgba(255,255,255,.06);
  border-radius: 8px;
  border: none;
  padding: 8px;
  cursor: pointer;
}

/* =========================
   Bubble Invite
========================= */

/* Game Invite Bubble Styles */
.bubble.game-invite-bubble {
  padding: 6px !important;
  max-width: 340px !important;
}

.bubble.game-invite-bubble .msg-text {
  width: 100%;
}

.game-invite-card {
  animation: inviteSlideIn 0.3s ease;
}

@keyframes inviteSlideIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.game-invite-join-btn:hover {
  background: #007fd4 !important;
  transform: translateY(-1px);
}

.game-invite-join-btn:active {
  transform: translateY(0);
}

/* =========================
   Composer
========================= */
#chatComposerWrapper {
  padding: 8px 12px 12px !important;
  border-top: 1px solid var(--line) !important;
  background: var(--bg) !important;
  flex-shrink: 0;
}

#chatComposer.chat-composer {
  display: none;
  align-items: flex-end;
  gap: 5px;
  background: var(--s2) !important;
  border-radius: 16px;
  padding: 6px 6px 6px 14px !important;
}

.composer-input-wrap {
  width: 100%;
  position: relative;
}
.composer-input-wrap textarea#chatInput {
  width: 100% !important;
  padding: 6px 0 !important;
  box-sizing: border-box !important;
  display: block !important;
  min-height: 30px !important;
  max-height: 130px !important;
  overflow-y: auto !important;
  resize: none !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  color: var(--txt) !important;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  font-family: inherit;
}
#chatInput::placeholder {
  color: var(--txt2);
}

.composer-buttons {
  position: static !important;
  display: flex !important;
  gap: 4px !important;
  align-items: flex-end !important;
  flex-shrink: 0;
  z-index: auto !important;
}
.composer-buttons .btn-emoji,
.composer-buttons #emojiBtn,
.composer-buttons #uploadBtn,
.composer-buttons .btn-send,
.composer-buttons #sendChatBtn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 99px !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  transition: background .12s, transform .08s;
  padding: 0 !important;
  flex-shrink: 0;
}
.composer-buttons .btn-emoji,
.composer-buttons #emojiBtn,
.composer-buttons #uploadBtn {
  background: transparent !important;
  color: var(--txt2);
}
.composer-buttons .btn-emoji:hover,
.composer-buttons #emojiBtn:hover,
.composer-buttons #uploadBtn:hover {
  background: var(--s3) !important;
}
.composer-buttons .btn-send,
.composer-buttons #sendChatBtn {
  background: #0096FF !important;
}
.composer-buttons #sendChatBtn:hover {
  background: #007fd4 !important;
  transform: scale(1.05);
}

.right-col > #chatComposerWrapper p {
  font-size: 11px !important;
  color: var(--red) !important;
  text-align: center;
  margin: 5px 0 0 !important;
  padding: 0 !important;
}

/* =========================
   Notices / overlays
========================= */
.unblock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: rgba(240,64,64,.08) !important;
  margin-bottom: 8px;
}
.unblock-msg {
  color: #ff8080;
  font-size: 13px;
  font-weight: 600;
}
.btn-unblock-red {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 99px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.btn-unblock-red:hover {
  background: #d43232;
}

#blockedByOtherNotice {
  font-weight: 700;
  color: #ff6b6b;
  padding: 10px 12px;
  border-radius: var(--r);
  background: rgba(240,64,64,.08) !important;
  text-align: center;
  display: none;
  margin-bottom: 8px;
  font-size: 13px;
}

/* =========================
   Emoji / upload UI
========================= */
.emoji-picker {
  position: absolute;
  min-width: 220px;
  max-width: 300px;
  padding: 8px;
  border-radius: 16px;
  background: #1c1c1c;
  border: none !important;
  box-shadow: none !important;
  display: grid;
  grid-template-columns: repeat(8,1fr);
  gap: 3px;
  z-index: 1800;
  transform-origin: bottom right;
}
.emoji-picker.hidden {
  display: none;
}
.emoji-picker .emo {
  font-size: 18px;
  padding: 7px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  background: transparent;
  transition: background .1s;
}
.emoji-picker .emo:hover {
  background: #2a2a2a;
}

.image-upload-preview {
  position: absolute;
  min-width: 180px;
  max-width: 280px;
  padding: 10px;
  border-radius: 16px;
  background: #1c1c1c;
  border: none !important;
  box-shadow: none !important;
  z-index: 1850;
  display: grid;
  gap: 8px;
}
.image-upload-preview img.preview-thumb {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: none !important;
}
.image-upload-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.image-upload-actions button {
  padding: 6px 12px;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  font-family: inherit;
}

.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}

#friendModalAuthOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 1760;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  padding: 20px;
}
#friendModalAuthOverlay .auth-card {
  max-width: 380px;
  width: 100%;
  background: #161616;
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  color: var(--txt);
  border: none !important;
  box-shadow: none !important;
}
#friendModalAuthOverlay .auth-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
}
#friendModalAuthOverlay .auth-card p {
  margin: 0 0 16px;
  color: var(--txt2);
  font-size: 14px;
}
.auth-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.btn-login {
  background: #ffd54a;
  color: #111;
  border: none;
  padding: 10px 20px;
  border-radius: 99px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
}
.btn-nothanks {
  background: transparent;
  color: var(--txt);
  border: 1px solid #2a2a2a;
  padding: 10px 20px;
  border-radius: 99px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* =========================
   Row menu
========================= */
.row-dots-menu {
  background: #18181b !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  border: none !important;
}
.row-dots-menu button {
  font-family: inherit !important;
  border-radius: 8px !important;
  transition: background .1s !important;
}
.row-dots-menu button:hover {
  background: var(--s3) !important;
}

/* =========================
   Hidden chats row
========================= */
.hidden-chat-item {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .12s;
  border: 1px solid var(--line);
}
.hidden-chat-item:hover {
  border-color: var(--accent);
}
.hidden-chat-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hidden-chat-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #18181b;
  color: var(--txt);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  border: 1px solid var(--line);
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.hidden-chat-item:hover .hidden-chat-tooltip {
  opacity: 1;
}

/* =========================
   Mobile
========================= */
@media (max-width: 720px) {
  #friendModalBackdrop {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 0 !important;
  }

  #friendModal {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .content-area {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden;
    flex: 1;
    min-height: 0;
  }

  .left-col {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    border-right: none !important;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .right-col {
    display: none !important;
    flex-direction: column !important;
    background: var(--bg) !important;
    border-radius: 0 !important;
    border: none !important;
    overflow: hidden;
    min-height: 0;
    position: static !important;
    z-index: auto !important;
  }

  #friendModal.mobile-global-active .left-col {
    flex: 0 0 30dvh !important;
    min-height: 140px;
    max-height: 30dvh;
    overflow: hidden !important;
  }

  #friendModal.mobile-global-active #globalUsersPanel {
    display: flex !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  #friendModal.mobile-global-active .right-col {
    display: flex !important;
    flex: 1 !important;
    min-height: 0 !important;
  }

  #friendModal.mobile-chat-open .left-col {
    flex: 0 0 auto !important;
    overflow: visible !important;
    min-height: 0;
  }

  #friendModal.mobile-chat-open #allPanel,
  #friendModal.mobile-chat-open #requestsPanel,
  #friendModal.mobile-chat-open #findPanel,
  #friendModal.mobile-chat-open #globalUsersPanel {
    display: none !important;
  }

  #friendModal.mobile-chat-open .right-col {
    display: flex !important;
    flex: 1 !important;
    min-height: 0 !important;
  }

  .friend-tab-btn {
    min-width: 50px !important;
    height: 44px !important;
  }

  .bubble {
    max-width: 85%;
  }

  .btn-emoji,
  #emojiBtn {
    display: none !important;
  }

  body.modal-friends-open {
    overflow: hidden !important;
    touch-action: none;
  }

  #chatMessages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  #mobileChatBackInlineBtn {
    display: inline-flex;
  }

  #friendModal.mobile-chat-open #onlineStats {
    display: none;
  }

  .row-unread-dot {
    top: 8px;
    right: 8px;
  }

  .friend-row.has-unread-dm {
    padding-right: 46px !important;
  }
  
  #friendModal.mobile-chat-open #hiddenChatsPanel {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .bubble img.chat-img {
    max-width: 80px;
    max-height: 80px;
  }

  .bubble.image-only img.chat-img {
    max-width: 56px;
    max-height: 80px;
  }

  #friendModalTitle {
    font-size: 15px;
  }

  #chatHeaderName {
    font-size: 14px !important;
  }

  #chatHeaderBio {
    font-size: 11px !important;
  }
}
