body.messages-screen-active #message-screen {
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  background: var(--background-color);
}

body.messages-screen-active #messages-app {
  width: min(1200px, 100%);
  height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border: 1px solid #27272a;
  background: #09090b;
}

#messages-list-panel {
  overflow-y: auto;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #09090b;
  border-right: 1px solid #27272a;
}

#messages-list-header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #27272a;
  background: #09090b;
  flex-shrink: 0;
}

#messages-list-header-text {
  color: var(--text-color);
  font-weight: 600;
  font-size: 1rem;
}

#message-screen-chats {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  overflow-x: hidden;
  padding: 0.45rem;
  -webkit-overflow-scrolling: touch;
}

#message-screen-chats-list {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.message-screen-chats-chat {
  position: relative;
  width: 100%;
  min-height: 4.9rem;
  display: flex;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 1rem;
  border: 1px solid #27272a;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.message-screen-chats-chat:hover {
  background: #18181b;
  border-color: #3f3f46;
}

.message-screen-chats-chat.active {
  background: #202024;
  border-color: #52525b;
}

.message-screen-chats-chat-avatar {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border-radius: 999px;
  margin-right: 0.75rem;
  background: #18181b;
  position: relative;
}

.message-screen-chats-chat-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-screen-chats-chat-avatar .chat-avatar-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #3bd671;
  border: 2px solid #0b0b0f;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 140ms ease, transform 140ms ease;
}

.message-screen-chats-chat-avatar.online .chat-avatar-status {
  opacity: 1;
  transform: scale(1);
}

.right-side {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
}

.nick-text-div {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.message-screen-chats-chat-username {
  color: #fafafa;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-profile-button {
  margin-left: auto;
  flex-shrink: 0;
  border: 1px solid #3f3f46;
  background: #18181b;
  color: #e4e4e7;
  border-radius: 0.65rem;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.1;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
  position: relative;
}

.friend-profile-button:hover {
  background: #27272a;
  border-color: #52525b;
}

.friend-profile-button::after {
  content: "";
  position: absolute;
  inset: -6px;
}

.message-screen-chats-chat-message-text {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.6rem;
  color: var(--text-secondary-color);
  font-size: 0.85rem;
}

.bottom-line {
  display: none;
}

.stat-div {
  border: 1px solid #3f3f46;
  border-radius: 0.6rem;
  background-color: #18181b;
  padding: 0.18rem 0.34rem;
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
}

.stat-img {
  width: 0.9rem;
  height: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-img-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.stat-text {
  color: #d4d4d8;
  font-weight: 500;
  line-height: 1;
  display: flex;
  align-items: center;
}

.new-marker {
  color: #09090b;
  font-weight: 700;
  background-color: #e4e4e7;
  padding: 0.05rem 0.55rem;
  font-size: 0.72rem;
  border-radius: 999px;
  white-space: nowrap;
}

.new-marker.fade-out {
  animation: fadeOut 0.15s ease forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.div-for-space {
  height: 0.3rem;
}

.empty-friends-div {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.empty-friends-c-div {
  width: min(22rem, 82%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid #27272a;
  border-radius: 1rem;
  background: #0f0f12;
}

.empty-friends-img {
  width: 2.2rem;
  height: 2.2rem;
  opacity: 0.9;
}

.empty-friends-text {
  color: var(--text-secondary-color);
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
}

@media (min-width: 1025px) {
  body.messages-screen-active #messages-app {
    grid-template-columns: 320px minmax(0, 1fr);
    border-radius: 1.25rem;
    overflow: hidden;
    max-height: calc(100dvh - 32px);
  }

  body.messages-screen-active #message-screen {
    padding: 0.35rem 0.5rem;
  }
}

@media (max-width: 1024px) {
  #messages-app,
  #messages-list-panel,
  #messages-chat-panel,
  #message-screen {
    border: none !important;
  }

  .message-screen-chats-chat {
    border: none !important;
  }
}
