/* Compact profile block in the left column, in every theme. */
.col-user .col-user-profile-v37 {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  justify-items: start;
  height: auto !important;
  min-height: 0 !important;
  width: 100% !important;
  box-sizing: border-box;
  margin-top: 2px !important;
  padding: 14px !important;
  border-radius: 16px;
  text-align: left;
}
.col-user .col-user-profile-v37 #colUserAvatarWrap {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px;
  margin: 0 !important;
}
.col-user .col-user-profile-v37 #colUserAvatarWrap .profile-modal__avatar-ring,
.col-user .col-user-profile-v37 #colUserAvatarWrap .profile-modal__avatar-inner,
.col-user .col-user-profile-v37 #colUserAvatarWrap .profile-nitro-avatar-btn {
  width: 100% !important;
  height: 100% !important;
  inset: auto !important;
}
.col-user .col-user-profile-v37 #colUserNickname {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  max-width: 100%;
  margin: 0 !important;
  font-size: 15px !important;
  line-height: 1.2;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.col-user .col-user-profile-v37 #colUserPremium {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  font-size: 12px !important;
}
.col-user .col-user-profile-v37 #colUserRep,
.col-user .col-user-profile-v37 #colUserStreak {
  display: none !important;
}
.col-user-chips {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.col-user-chip {
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.col-user-chip--good {
  color: #2fbf71;
}
.col-user-chip--bad {
  color: #ef5f5f;
}
.col-user-chip--streak {
  color: #e8863a;
}
[data-theme="dark"] .col-user-chip {
  background: rgba(5, 8, 18, 0.5);
}
[data-theme="dark"] .col-user-chip--good {
  color: #6ff0a0;
}
[data-theme="dark"] .col-user-chip--streak {
  color: #ffc48a;
}

/* Premium cover fills the whole compact block, darkened so light text reads on any picture. */
.col-user .col-user-profile-v37.profile-viewer-cover {
  overflow: hidden !important;
  border-radius: 16px !important;
}
.col-user .col-user-profile-v37.profile-viewer-cover::before {
  height: 100% !important;
  opacity: 1 !important;
  filter: saturate(1.1) !important;
  mix-blend-mode: normal !important;
  border-radius: 0 !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}
.col-user .col-user-profile-v37.profile-viewer-cover::after {
  height: 100% !important;
  border-radius: 0 !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  background: linear-gradient(180deg, rgba(8, 11, 22, 0.28), rgba(8, 11, 22, 0.74)) !important;
}
.col-user .col-user-profile-v37.profile-viewer-cover #colUserNickname {
  color: #fff !important;
}
.col-user .col-user-profile-v37.profile-viewer-cover #colUserPremium {
  color: #ffdc62 !important;
}
.col-user .col-user-profile-v37.profile-viewer-cover .col-user-chip {
  background: rgba(255, 255, 255, 0.14);
  color: #e4e9f3;
}

/* The rail header agreed with the owner: a bold title and tabs as one full-width switch. */
.col-dialogs:not(.col-dialogs--gc-topics) #leftRailTitle .left-rail-title-text {
  font-size: 22px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}
.col-dialogs:not(.col-dialogs--gc-topics) #leftRailTitle .left-rail-title-line {
  display: none !important;
}
.profile-tabs.dialogs-filter-pills {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 3px;
  border-radius: 12px;
  border: 0;
  background: rgba(6, 9, 18, 0.5);
}
/* A call card has its own frame: the theme's bubble colors drew a second box around it. */
.bubble.bubble--dm-call,
.bubble.bubble--dm-call:hover {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Invite to a chat or channel: a compact card like the call cards, one clear button. */
.bubble.bubble--invite,
.bubble.bubble--invite:hover,
.bubble.bubble--invite .gc-message-bubble {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.message-invite-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  width: min(340px, 100%);
  min-height: 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(30, 36, 56, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}
.message-invite-card__visual {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
}
.message-invite-card__visual-ring {
  width: 44px;
  height: 44px;
  border: 0;
  background: rgba(91, 141, 239, 0.18);
  box-shadow: none;
}
.message-invite-card__chat-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
  filter: none;
}
.message-invite-card__mic-badge {
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  color: #fff;
  background: #5b8def;
  border: 2px solid rgb(30, 36, 56);
  box-shadow: none;
}
.message-invite-card__mic-badge svg {
  width: 10px;
  height: 10px;
}
.message-invite-card__content {
  display: contents;
}
.message-invite-card__badge {
  display: none;
}
.message-invite-card__title {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding-right: 44px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0;
}
.message-invite-card__description {
  grid-column: 2;
  grid-row: 2;
  max-width: none;
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: #b4c0d6;
}
.message-invite-card__open {
  grid-column: 1 / -1;
  grid-row: 3;
  min-height: 38px;
  margin-top: 12px;
  border: 0;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  background: #5b8def;
  box-shadow: none;
}
.message-invite-card__time {
  top: 12px;
  bottom: auto;
  right: 12px;
  font-size: 11px;
  color: #93a0b6;
}

.message-invite-card .channel-invite-card__icon {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  flex-basis: 44px !important;
  border: 0 !important;
  background: rgba(91, 141, 239, 0.18) !important;
  box-shadow: none !important;
}
.message-invite-card .channel-invite-card__icon::before,
.message-invite-card .channel-invite-card__icon::after {
  display: none !important;
}
.message-invite-card .channel-invite-card__icon-image,
.message-invite-card .channel-invite-card__megaphone {
  width: 22px !important;
  height: 22px !important;
  filter: none !important;
}
.message-invite-card .message-invite-card__visual-ring {
  width: 44px !important;
  height: 44px !important;
  border: 0 !important;
  background: rgba(91, 141, 239, 0.18) !important;
  box-shadow: none !important;
}
.message-invite-card .message-invite-card__chat-icon,
.message-invite-card .message-invite-card__channel-icon {
  width: 22px !important;
  height: 22px !important;
  color: #8eb4f8;
  filter: none !important;
}

/* The window an invite opens: the size of its content and in the theme's colors. */
#invitePreviewModal .invite-preview-modal__panel {
  width: min(900px, calc(100vw - 24px)) !important;
  max-width: 900px !important;
  height: min(620px, calc(100dvh - 24px)) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: linear-gradient(155deg, #1c2a5e 0%, #161b3c 55%, #2a1d52 100%) !important;
}
html:not(.olone-glass) #invitePreviewModal .invite-preview-modal__panel {
  background: #181d24 !important;
}
#invitePreviewModal .invite-preview-modal__sidebar,
#invitePreviewModal .invite-preview-modal__main {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}
#invitePreviewModal .invite-preview-modal__avatar {
  width: 96px !important;
  height: 96px !important;
  min-width: 96px;
}
#invitePreviewModal .invite-preview-modal__chat-title {
  font-size: 20px !important;
}
#invitePreviewModal .invite-preview-modal__primary {
  background: #5b8def !important;
  border: 0 !important;
  box-shadow: none !important;
  min-height: 44px !important;
  height: auto !important;
  border-radius: 12px !important;
}

/* The official channel must not look selected before anyone opens it. */
.channel-rail-item--official-news:not(.active)::before {
  display: none !important;
}

/* The search row and the list start at the same height on every tab. */
.dialogs-rail-search-wrap:not(.hidden) ~ .profile-tab-panels--aux {
  display: none !important;
}
.profile-tabs.dialogs-filter-pills .profile-tab {
  border-radius: 9px !important;
  transition: none !important;
  display: flex !important;
  align-items: center;
  justify-content: center !important;
  width: 100%;
  text-align: center;
  min-height: 36px;
  min-width: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
}
.profile-tabs.dialogs-filter-pills .profile-tab-icon-wrap {
  display: none;
}
.profile-tabs.dialogs-filter-pills .profile-tab-label {
  font-size: 13px;
  color: #a6b2c6;
}
.profile-tabs.dialogs-filter-pills .profile-tab.profile-tab-active {
  background: rgba(107, 157, 245, 0.26);
}
.profile-tabs.dialogs-filter-pills .profile-tab.profile-tab-active .profile-tab-label {
  color: #dbe7ff;
  font-weight: 500;
}

/* With a mouse the "⋮" appears on hover, so it stops taking the name's width in a narrow column. */
@media (hover: hover) and (min-width: 921px) {
  .col-dialogs .dialog-item {
    position: relative;
  }
  .col-dialogs .dialog-item .rail-comm-actions {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.12s;
  }
  .col-dialogs .dialog-item:hover .rail-comm-actions,
  .col-dialogs .dialog-item .rail-comm-actions:focus-within {
    opacity: 1;
  }
  .col-dialogs .dialog-item:hover .unread-badge-container {
    opacity: 0;
  }
}

/* Gradient theme everywhere: the background and windows; blur on desktop only (below). */
html.olone-glass[data-theme="dark"] body {
  background:
    radial-gradient(620px 560px at 6% -6%, rgba(47, 107, 255, 0.3), transparent 72%),
    radial-gradient(640px 620px at 96% 34%, rgba(122, 77, 255, 0.18), transparent 72%),
    radial-gradient(620px 460px at 42% 108%, rgba(20, 184, 200, 0.14), transparent 72%),
    #070a14 !important;
  background-attachment: fixed !important;
}
html.olone-glass[data-theme="dark"] .messenger-shell {
  --bg: transparent;
  background: transparent !important;
  border-top-color: transparent;
}
html.olone-glass[data-theme="dark"] .col-user.panel-card,
html.olone-glass[data-theme="dark"] .col-dialogs.panel-card {
  background: rgba(19, 24, 42, 0.86) !important;
}
html.olone-glass[data-theme="dark"] .col-chat {
  background: rgba(10, 13, 26, 0.8) !important;
}
html.olone-glass[data-theme="dark"] .modal {
  --panel: rgba(21, 26, 46, 0.97);
  background: var(--panel);
  border-color: rgba(255, 255, 255, 0.12);
}
html.olone-glass[data-theme="dark"] .modal-backdrop--glass {
  background: rgba(6, 8, 18, 0.5);
}
html.olone-glass[data-theme="dark"] #profileViewerModal .profile-modal {
  background: linear-gradient(150deg, #1a2858 0%, #151a38 52%, #2a1d52 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 80px rgba(0, 0, 0, 0.6);
}
html.olone-glass[data-theme="dark"] #profileViewerModal #profileNitroCard.profile-viewer-cover::after {
  --profile-v37-cover-dissolve-bg: #18214a;
}
html.olone-glass[data-theme="dark"] #profileViewerModal .profile-modal .profile-card {
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
.col-user .col-user-profile-v37.profile-viewer-cover .col-user-chip--good {
  color: #6ff0a0;
}
.col-user .col-user-profile-v37.profile-viewer-cover .col-user-chip--bad {
  color: #ff9a9a;
}
.col-user .col-user-profile-v37.profile-viewer-cover .col-user-chip--streak {
  color: #ffc48a;
}

/*
 * Glass panels: desktop only, since blur costs battery on phones.
 * Messages and inputs stay solid so that text stays easy to read.
 */
@media (min-width: 921px) {
  html.olone-glass[data-theme="dark"] .col-user.panel-card,
  html.olone-glass[data-theme="dark"] .col-dialogs.panel-card {
    background: rgba(255, 255, 255, 0.055) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    /* No backdrop blur on the columns: it puts all their text on a separate layer, and Windows then
       draws that text without ClearType, so it looks pixelated. Over the smooth page gradient the blur
       was not visible anyway. */
  }
  html.olone-glass[data-theme="dark"] .col-chat {
    background: rgba(9, 12, 24, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  html.olone-glass[data-theme="dark"] .dialogs-nav-sticky {
    background: transparent !important;
  }
  /* A background the user picked for the chat stays: only the plain system one becomes glass. */
  html.olone-glass[data-theme="dark"] .col-chat .chat-main,
  html.olone-glass[data-theme="dark"] .col-chat .composer,
  html.olone-glass[data-theme="dark"] .col-chat .messages.olone-chat-bg--system {
    background: transparent !important;
  }
  html.olone-glass[data-theme="dark"] .col-chat .chat-header {
    background: rgba(255, 255, 255, 0.03) !important;
  }
  html.olone-glass[data-theme="dark"] .col-chat .composer-inner {
    background: rgba(6, 9, 18, 0.6) !important;
  }
  /* Call cards draw their own frame, so the bubble behind them must stay empty. */
  html.olone-glass[data-theme="dark"] .bubble.out:not(.bubble--gc-layout):not(.bubble--dm-call):not(.bubble--invite),
  html.olone-glass[data-theme="dark"] .bubble--gc-layout.out:not(.bubble--invite) .gc-message-bubble {
    background: linear-gradient(135deg, #2f62d9, #3b48c4) !important;
    border-color: transparent !important;
    color: #fff;
  }
  html.olone-glass[data-theme="dark"] .bubble.in:not(.bubble--gc-layout):not(.bubble--dm-call):not(.bubble--invite),
  html.olone-glass[data-theme="dark"] .bubble--gc-layout.in:not(.bubble--invite) .gc-message-bubble {
    background: rgba(32, 38, 54, 0.94) !important;
  }
  html.olone-glass[data-theme="dark"] .col-user .col-user-profile-v37 {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}
