:root {
  color-scheme: light;
  font-family: Roboto, sans-serif;
  background: #f3f6fc;
  color: #111827;
}

html,
body {
  height: 100%;
  touch-action: pan-x pan-y;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f7faff 0%, #eef3fb 100%);
  overflow: hidden;
}

body.googleProfileSetupOpen {
  overflow: hidden;
}

[data-lucide] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.lucide {
  stroke-width: 2;
}

.shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-right: 1px solid #dbe4f0;
  background: #ffffff;
  height: 100%;
  overflow: hidden;
}

.sidebarBackdrop {
  display: none;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.bootPanel,
.chatBootPanel {
  display: none;
}

.bootLoader {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 1000;
}

.bootLoaderInner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.bootLoaderText {
  font-size: 18px;
  line-height: 1.15;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

.bootLoaderSpinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid #dbe4f0;
  border-top-color: #4f39f5;
  animation: bootSpin 0.8s linear infinite;
}

html.has-token body.auth-mode #authPanel {
  display: none;
}

html.has-token body.auth-mode #appPanel {
  display: flex;
}

.bootPanel {
  flex: 1;
  gap: 14px;
  padding-top: 10px;
}

.bootTrendsBar,
.bootSearchBar,
.bootTab,
.bootLine,
.bootChatAvatar,
.chatBootAvatar,
.chatBootBubble {
  background: linear-gradient(90deg, #eef2f9 0%, #f8fbff 50%, #eef2f9 100%);
  background-size: 200% 100%;
  animation: bootPulse 1.2s ease-in-out infinite;
}

.bootTrendsBar {
  height: 44px;
  border-radius: 22px;
}

.bootSearchBar {
  height: 56px;
  border-radius: 28px;
}

.bootTabsRow {
  display: flex;
  gap: 18px;
  padding: 8px 0 4px;
}

.bootTab {
  display: block;
  height: 16px;
  border-radius: 999px;
  flex: 1;
}

.bootTab.active {
  max-width: 120px;
}

.bootChatList {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 6px;
}

.bootChatItem {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bootChatAvatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 50%;
}

.bootChatBody,
.chatBootHeaderText {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.bootLine {
  display: block;
  height: 12px;
  border-radius: 999px;
}

.bootLineTitle {
  width: 58%;
}

.bootLineTitle.short {
  width: 42%;
}

.bootLineText {
  width: 74%;
}

.bootLineText.short {
  width: 52%;
}

.chatBootPanel {
  flex: 1;
  flex-direction: column;
  gap: 24px;
  padding: 26px 28px;
}

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

.chatBootAvatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
}

.chatBootTitle {
  width: 180px;
  height: 18px;
}

.chatBootSubtitle {
  width: 120px;
}

.chatBootMessages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
}

.chatBootBubble {
  height: 54px;
  width: 280px;
  border-radius: 22px;
}

.chatBootBubble.short {
  width: 180px;
}

.chatBootBubble.outgoing {
  align-self: flex-end;
}

@keyframes bootPulse {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes bootSpin {
  0% {
    transform: rotate(0deg);
  }

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

@keyframes voiceRecordPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 57, 245, 0.28);
    transform: scale(1);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(79, 57, 245, 0);
    transform: scale(1.03);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(79, 57, 245, 0);
    transform: scale(1);
  }
}

@keyframes voiceRecordWaveMotion {

  0%,
  100% {
    transform: scaleY(0.78);
    opacity: 0.72;
  }

  50% {
    transform: scaleY(1.12);
    opacity: 1;
  }
}

.panel h2,
.panel h3 {
  margin: 8px 0 4px;
}

#authPanel {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

body.auth-mode .shell {
  display: block;
  height: 100dvh;
  min-height: 100dvh;
}

body.auth-mode .sidebar {
  width: 100%;
  max-width: none;
  height: 100%;
  border-right: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

body.auth-mode .chat,
body.auth-mode #bootPanel,
body.auth-mode #appPanel {
  display: none !important;
}

body.auth-mode #authPanel {
  width: min(420px, 94vw);
  margin: 0 auto;
  padding: 24px 16px;
  overflow: visible;
}

.authPanelV2 {
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 22px 14px;
  overflow: hidden;
}

.authPanelBrand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.authPanelLogoWrap {
  width: 96px;
  height: 96px;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.authPanelLogo {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.authPanelTagline {
  max-width: 300px;
  color: #2f3746;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
}

.googleAuthSection {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.googleAuthDivider {
  position: relative;
  text-align: center;
  color: #98a0ad;
  font-size: 13px;
  font-weight: 600;
}

.googleAuthDivider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #dde4ef;
  transform: translateY(-50%);
}

.googleAuthDivider span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 10px;
  background: #ffffff;
}

.googleAuthButton {
  display: flex;
  justify-content: center;
}

.authGoogleOnlySection {
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
}

.authGoogleOnlySection .googleAuthButton {
  width: 100%;
}

.googleProfileSetupDialog {
  position: fixed;
  inset: 0;
  z-index: 420;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.googleProfileSetupCard {
  width: min(420px, 96vw);
  background: #f7f8fc;
  border: 1px solid #d4dceb;
  border-radius: 20px;
  padding: 18px 16px 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
}

.googleProfileSetupTitle {
  margin: 0;
  color: #111827;
  font-size: 22px;
  font-weight: 800;
}

.googleProfileSetupText {
  margin: 8px 0 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.35;
}

.googleProfileSetupForm {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.googleProfileSetupField {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.googleProfileSetupField span {
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.googleProfileSetupField input {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid #cfd8e3;
  background: #ffffff;
  color: #111827;
}

.googleProfileSetupSubmit {
  margin-top: 4px;
  min-height: 44px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  background: #4f39f5;
  color: #ffffff;
}

#appPanel {
  flex: 1;
  overflow: hidden;
  gap: 0;
}

.sidebarTabsWrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebarPane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.chatListScroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chatListScroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.chatListSection {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chatListDivider {
  display: none;
}

.contactsListScroll::-webkit-scrollbar,
.messages::-webkit-scrollbar {
  width: 6px;
}

.contactsListScroll::-webkit-scrollbar-track,
.messages::-webkit-scrollbar-track {
  background: transparent;
}

.contactsListScroll::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb {
  background: rgba(203, 211, 224, 0.92);
  border-radius: 999px;
}

.contactsListScroll::-webkit-scrollbar-thumb:hover,
.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(176, 186, 202, 0.96);
}

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

.discoverToggleButton {
  flex: 1;
  min-height: 44px;
  border-radius: 22px;
  background: #4f39f5;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1px;
  box-shadow: none;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.discoverToggleButton.active {
  background: #4f39f5;
  box-shadow: none;
}

.discoverToggleButton:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.createGroupIconButton {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  color: #4f39f5;
}

.createGroupIconButton svg {
  width: 20px;
  height: 20px;
}

.createChatMenuWrap {
  position: relative;
}

.createChatMenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  border: 1px solid #d1dbe8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.24);
  padding: 6px;
  z-index: 120;
}

.createChatMenu button {
  width: 100%;
  background: transparent;
  color: #0f172a;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  text-align: left;
}

.createChatMenu button:hover {
  background: #eef2ff;
  opacity: 1;
}

.createChatMenuIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.createChatMenuIcon svg {
  width: 17px;
  height: 17px;
}

.createChatWorkspace {
  flex: 1;
  min-height: 0;
  padding: 16px 18px;
  overflow-y: auto;
  background: #ffffff;
}

.createChatWorkspaceInner {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.createChatPanelHeader {
  display: none;
}

.createChatPanelHeader h3 {
  margin: 0;
}

.createChatBackButton {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
}

.createChatBackButton svg {
  width: 15px;
  height: 15px;
}

.createChatPanelMenu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.createChatTypeButton {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border-radius: 12px;
  padding: 12px 13px;
  background: #eef4ff;
  color: #0f172a;
  text-align: left;
  border: 1px solid #d5e3fa;
}

.createChatTypeButton:hover {
  background: #e2edff;
  opacity: 1;
}

.createChatTypeButton strong {
  font-size: 15px;
}

.createChatTypeButton span {
  font-size: 12px;
  color: #64748b;
}

.createChatForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.createChatForm label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7b7f89;
}

.createChatForm>button[type="submit"] {
  margin-top: 8px;
  min-height: 42px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  align-self: flex-start;
  min-width: 164px;
}

.createTitleRow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  border-radius: 20px;
  background: #f3f4f7;
  padding: 10px 14px;
}

.createChannelAvatarPreviewWrap {
  width: 52px;
  min-width: 52px;
  height: 52px;
}

.createAvatarTrigger {
  width: 52px;
  min-width: 52px;
  height: 52px;
  border: 2px solid #b7bac1;
  border-radius: 50%;
  background: transparent;
  color: #9ea3ad;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.createAvatarTrigger:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.03);
}

.createAvatarCamera {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.createAvatarCamera svg {
  width: 21px;
  height: 21px;
}

.createAvatarMedia {
  display: inline-flex;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

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

.createTitleInput {
  border: 0;
  background: transparent;
  border-radius: 0;
  font-size: 16px;
  line-height: 1.2;
  color: #0f172a;
  padding: 0;
  min-height: auto;
}

.createTitleInput::placeholder {
  color: #9ca3af;
}

.createChatTextarea {
  width: 100%;
  min-height: 56px;
  resize: none;
  padding: 12px 14px;
  border: 0;
  border-radius: 18px;
  background: #f3f4f7;
  font: inherit;
  font-size: 15px;
  color: #0f172a;
}

.createChatTextarea::placeholder {
  color: #98a2b3;
}

.createGroupInterests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.createDescriptionInput {
  min-height: 56px;
}

.createChatHint {
  margin: -2px 0 4px;
  font-size: 13px;
  color: #7b808d;
}

.createMembersSearchInput {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  background: #f3f4f7;
  padding: 0 14px;
  font-size: 14px;
  color: #0f172a;
}

.createMembersSearchInput::placeholder {
  color: #98a2b3;
}

.createGroupMembersList {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  max-height: min(360px, 48vh);
  overflow-y: auto;
  display: block;
  padding-right: 4px;
}

.createGroupMemberItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #d9e2ef;
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  user-select: none;
  width: 100%;
  box-sizing: border-box;
}

.createGroupMembersList li+li {
  margin-top: 8px;
}

.createGroupMemberItem:hover {
  background: #f3f3ff;
}

.createGroupMemberAvatar {
  width: 40px;
  min-width: 40px;
  height: 40px;
  font-size: 14px;
}

.createGroupMemberMain {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.createGroupMemberName {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.createGroupMemberSubline {
  font-size: 11px;
  line-height: 1.2;
  color: #7b879b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.createGroupMemberCheckbox {
  width: 28px;
  height: 28px;
  margin: 0;
  border: 2px solid #7f8694;
  border-radius: 999px;
  background: #ffffff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.createGroupMemberCheckbox:checked {
  border-color: #4f39f5;
}

.createGroupMemberCheckbox:checked::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 999px;
  background: #4f39f5;
}

.createGroupMembersEmpty {
  padding: 12px;
  text-align: center;
  color: #7b879b;
  font-size: 14px;
}

#userSearchResults {
  max-height: 120px;
  overflow-y: auto;
  gap: 0;
  padding: 0;
  display: none;
}

#userSearchResults .userSearchItem {
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #e8edf5;
  background: transparent;
  padding: 9px 2px;
}

#userSearchResults .userSearchItem:hover {
  background: #f3f3ff;
}

.userSearchAvatar {
  width: 40px;
  min-width: 40px;
  height: 40px;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.userSearchMain {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.userSearchName {
  display: block;
  font-weight: 600;
  color: #111827;
}

.userSearchSubtitle {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userSearchKind {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  background: #edf2fa;
  text-transform: capitalize;
}

#userSearchResults .userSearchSectionTitle {
  display: block;
  justify-content: initial;
  align-items: initial;
  gap: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 7px 2px 4px;
  border-radius: 0;
}

#sidebarPaneChats.chatSearchMode #userSearchResults {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

#sidebarPaneChats.chatSearchMode .chatListDivider,
#sidebarPaneChats.chatSearchMode .chatListScroll {
  display: none;
}

.sidebarBottomNav {
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid #e5edf7;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sidebarTabButton {
  position: relative;
  background: transparent;
  color: #9aa0aa;
  border-radius: 16px;
  padding: 6px 8px 7px;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.35px;
}

.sidebarTabButton .sidebarTabIcon,
.sidebarTabButton svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.1;
}

.sidebarTabButton.active {
  background: #eceef2;
  color: #1f2937;
}

.sidebarTabMiggGain {
  position: absolute;
  top: 7px;
  right: 10px;
  font-size: 10px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #9ca3af;
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
}

.sidebarTabMiggGain.flash {
  animation: sidebarTabMiggGainFlash 1.15s ease-out;
}

@keyframes sidebarTabMiggGainFlash {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }

  18% {
    opacity: 1;
    transform: translateY(0);
  }

  70% {
    opacity: 0.95;
    transform: translateY(-1px);
  }

  100% {
    opacity: 0;
    transform: translateY(-3px);
  }
}

.muted {
  color: #6b7280;
}

form {
  display: flex;
  gap: 8px;
}

.userSearchForm {
  display: block;
  margin-top: 2px;
  width: 100%;
  align-self: center;
  position: relative;
  z-index: 1;
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

.chatFeedTabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  width: 100%;
  margin-top: -2px;
  border-bottom: 1px solid #d8dde8;
}

.chatFeedTab {
  position: relative;
  min-height: 42px;
  padding: 10px 12px 12px;
  border-radius: 0;
  background: transparent;
  color: #a0a6b1;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  box-shadow: none;
}

.chatFeedTab:hover {
  opacity: 1;
  color: #707786;
}

.chatFeedTab.active {
  color: #2a2f3a;
}

.chatFeedTab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: #4f39f5;
}

.userSearchInputWrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  width: 100%;
  border: 0;
  border-radius: 20px;
  background: #f3f4f7;
  padding: 0 14px 0 36px;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

.userSearchInputWrap i,
.userSearchInputWrap svg {
  position: absolute;
  left: 8px;
  width: 18px;
  height: 18px;
  color: #9aa1ad;
  pointer-events: none;
}

#userSearchInput {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 12px 0;
  font-size: 15px;
  line-height: 1.2;
  color: #7a808c;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

#userSearchInput::placeholder {
  color: #9a9fa9;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  background: #fff;
}

input:focus,
textarea:focus,
select:focus,
button:focus,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #4f39f5;
  color: #fff;
  cursor: pointer;
}

button.secondary {
  background: #334155;
}

button.secondary.iconButton,
button.secondary.chatActionsButton,
button.secondary.mobileMenuButton,
button.secondary.contactsAddButton {
  background: transparent;
  color: #4f39f5;
}

button:hover {
  opacity: 0.9;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list li {
  border: 1px solid #e2e8f0;
  background: #f8fbff;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.list li.active {
  border-color: #4f39f5;
  background: #eaf3ff;
}

.chatListItem {
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.chatListMain {
  width: 100%;
  min-width: 0;
}

.avatarBase {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--avatar-bg, #64748b);
  color: #ffffff;
  font-weight: 700;
  user-select: none;
}

.avatarWithImage {
  position: relative;
  overflow: hidden;
  background: #e2e8f0;
  font-size: 0;
  line-height: 0;
  color: transparent;
}

.avatarImage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chatListAvatar {
  width: 52px;
  min-width: 52px;
  height: 52px;
  font-size: 20px;
  letter-spacing: 0.3px;
}

.chatListTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.chatListTitle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 700;
}

.chatListTitleText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatListTypeIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.16);
  color: #8b95a7;
  flex-shrink: 0;
}

.chatListTypeIcon svg {
  width: 11px;
  height: 11px;
}

.chatListTypeIcon.telegram {
  background: #e6f4fb;
  color: #229ed9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chatListPinnedMark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4f39f5;
  vertical-align: middle;
  flex-shrink: 0;
}

.chatListPinnedMark svg {
  width: 13px;
  height: 13px;
}

.chatListMeta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
  flex-shrink: 0;
}

.chatListMetaColumn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  min-width: 36px;
  min-height: 0;
  flex-shrink: 0;
  position: relative;
}

.chatListMetaTop {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-height: 16px;
}

.chatListUnreadBadge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d4d4d8;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  align-self: flex-end;
  position: absolute;
  right: 0;
  top: 18px;
  pointer-events: none;
}

.chatListDelivery {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.chatListDelivery.read {
  color: #4f39f5;
}

.chatListDelivery .deliveryIcon {
  width: 14px;
  height: 14px;
}

.chatListTime {
  font-size: 12px;
}

.chatListPreview {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  line-height: 1.25;
}

#chatsList {
  gap: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

#chatsList .chatListItem {
  border: 0;
  border-bottom: 1px solid #edf2f7;
  border-radius: 0;
  background: transparent;
  padding: 12px 10px;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.16s ease;
  position: relative;
}

#chatsList .chatListItem:last-child {
  border-bottom: 0;
}

#chatsList .chatListItem:hover {
  background: #f8fbff;
}

#chatsList .chatListItem.active {
  background: #edf4ff;
}

#chatsList .chatListItem.pinned {
  background: transparent;
}

#chatsList .chatListAvatar {
  width: 58px;
  min-width: 58px;
  height: 58px;
  font-size: 22px;
  letter-spacing: 0.2px;
}

#chatsList .chatListTitle {
  font-size: 18px;
  line-height: 1.25;
}

#chatsList .chatListTop {
  justify-content: flex-start;
  margin-bottom: 2px;
}

#chatsList .chatListMeta {
  font-size: 13px;
}

#chatsList .chatListTime {
  font-size: 13px;
}

#chatsList .chatListMetaColumn {
  position: absolute;
  right: 10px;
  top: 12px;
  gap: 4px;
  min-width: 0;
}

#chatsList .chatListMetaTop {
  gap: 6px;
}

#chatsList .chatListUnreadBadge {
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  position: static;
}

#chatsList .chatListMain {
  padding-right: 64px;
}

#chatsList .chatListPreview {
  font-size: 13px;
  color: #8b95a7;
}

.contactsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5edf7;
}

.contactsHeader h3 {
  margin: 0;
}

.contactsAddButton {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: #4f39f5;
  font-size: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contactsAddButton svg {
  width: 18px;
  height: 18px;
}

.contactsAddMenu {
  border: 1px solid #d8e3f2;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contactsAddMenuTitle {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #64748b;
  padding: 0 2px;
}

.contactsAddList {
  gap: 0;
  max-height: calc(5 * 78px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(203, 211, 224, 0.92) transparent;
}

.contactsAddList::-webkit-scrollbar {
  width: 6px;
}

.contactsAddList::-webkit-scrollbar-track {
  background: transparent;
}

.contactsAddList::-webkit-scrollbar-thumb {
  background: rgba(203, 211, 224, 0.92);
  border-radius: 999px;
}

.contactsAddList::-webkit-scrollbar-thumb:hover {
  background: rgba(176, 186, 202, 0.96);
}

.contactsAddList .contactsAddItem {
  border: 0;
  border-bottom: 1px solid #edf2f7;
  border-radius: 0;
  background: transparent;
  padding: 10px 8px;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.contactsAddList .contactsAddItem:last-child {
  border-bottom: 0;
}

.contactsAddList .contactsAddItem:hover {
  background: #f3f3ff;
}

.contactsAddList .contactsAddItem.disabled {
  opacity: 0.72;
  cursor: default;
}

.contactsAddList .contactsAddItem.loading {
  pointer-events: none;
  opacity: 0.55;
}

.contactsAddEmpty {
  border: 0 !important;
  border-radius: 10px !important;
  background: #f8fbff !important;
  color: #64748b;
  justify-content: center !important;
  padding: 12px 10px !important;
}

.contactsAddMain {
  min-width: 0;
  flex: 1;
}

.contactsAddName {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contactsAddSubline {
  margin-top: 1px;
  font-size: 12px;
  color: #8b95a7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contactsAddAction {
  font-size: 12px;
  font-weight: 700;
  color: #4f39f5;
  background: #eaf1ff;
  border-radius: 999px;
  padding: 4px 9px;
  flex-shrink: 0;
}

.contactsAddItem.disabled .contactsAddAction {
  color: #6b7280;
  background: #eceff4;
}

.contactsAddItem[data-action-type="cancel"] .contactsAddAction {
  color: #b91c1c;
  background: #fee2e2;
}

.contactsAddItem[data-action-type="accept"] .contactsAddAction {
  color: #166534;
  background: #dcfce7;
}

.contactsListScroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(203, 211, 224, 0.92) transparent;
}

#friendsList {
  gap: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

#friendsList .friendListItem {
  border: 0;
  border-bottom: 1px solid #edf2f7;
  border-radius: 0;
  background: transparent;
  padding: 11px 0;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

#friendsList .friendListItem:last-child {
  border-bottom: 0;
}

#friendsList .friendListItem:hover {
  background: #f3f3ff;
}

.contactsAvatar {
  width: 52px;
  min-width: 52px;
  height: 52px;
  font-size: 19px;
  letter-spacing: 0.2px;
}

.friendListMain {
  min-width: 0;
  flex: 1;
}

.friendListName {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friendListStatus {
  margin-top: 2px;
  font-size: 12px;
  color: #8b95a7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friendRemoveButton {
  margin-left: auto;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #fee2e2;
  color: #b91c1c;
  flex-shrink: 0;
}

.friendRemoveButton:hover {
  background: #fecaca;
  opacity: 1;
}

#friendsList .contactsEmpty {
  border: 0;
  border-radius: 10px;
  background: #f8fbff;
  color: #64748b;
  justify-content: center;
  padding: 12px;
}

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: #ffffff;
}

.chatHeader {
  border-bottom: 1px solid #dbe4f0;
  padding: 16px 20px;
  background: #ffffff;
}

.pinnedBar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-bottom: 1px solid #dbe4f0;
  background: #ffffff;
}

.pinnedText {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.pinnedChip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 5px 11px;
  background: #e5e7eb;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.pinnedMessage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #8b95a7;
  font-size: 14px;
  line-height: 1.2;
}

.pinnedMessageText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinnedPreviewIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4f39f5;
}

.pinnedPreviewIcon svg {
  width: 14px;
  height: 14px;
}

.pinnedBarUnpinButton {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: #4f39f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pinnedBarUnpinButton svg {
  width: 19px;
  height: 19px;
}

.discoverPane {
  flex: 1;
  min-height: 0;
  padding: 16px 20px 0;
  background: #ffffff;
  overflow: hidden;
  scrollbar-gutter: stable;
}

.discoverLayout {
  height: 100%;
  display: grid;
  grid-template-columns: 60% 35%;
  column-gap: 5%;
  align-items: stretch;
}

.discoverFeed {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

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

.discoverFeedTabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d6e1ef;
  border-radius: 999px;
  background: #ffffff;
  padding: 4px;
}

.discoverFeedTab {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

.discoverFeedTab.active {
  background: #4f39f5;
  color: #ffffff;
}

.discoverFeedTab:hover {
  opacity: 1;
  background: #eaf1fb;
  color: #1e293b;
}

.discoverFeedTab.active:hover {
  background: #4f39f5;
  color: #ffffff;
}

.discoverRefreshButton {
  margin-left: auto;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border-radius: 10px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #4f39f5;
}

.discoverRefreshButton svg {
  width: 18px;
  height: 18px;
}

.discoverRefreshButton.loading svg {
  animation: discoverRefreshSpin 0.8s linear infinite;
}

@keyframes discoverRefreshSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.discoverFeedList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.discoverFeedList::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.discoverFeedList::-webkit-scrollbar-track {
  background: transparent;
}

.discoverFeedList::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.discoverFeedList.scrolling {
  scrollbar-color: rgba(203, 211, 224, 0.92) transparent;
}

.discoverFeedList.scrolling::-webkit-scrollbar-thumb {
  background: rgba(203, 211, 224, 0.92);
}

.discoverFeedList.scrolling::-webkit-scrollbar-thumb:hover {
  background: rgba(176, 186, 202, 0.96);
}

.discoverFeedEnd {
  margin-top: 14px;
  padding: 14px 0 10px;
  text-align: center;
  border-top: 1px solid rgba(100, 116, 139, 0.16);
  color: #64748b;
}

.discoverFeedEndTitle {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0f172a;
}

.discoverFeedEndText {
  margin-top: 4px;
  font-size: 13px;
}

.discoverCard {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 24px 14px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.16);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: default;
}

.discoverCard:last-child {
  border-bottom: 0;
}

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

.discoverCardOpenTarget {
  cursor: pointer;
  transition: background-color 0.16s ease;
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
  padding: 2px 4px;
  margin: -2px -4px;
}

.discoverCardOpenTarget:hover {
  background: #f3f3ff;
}

.discoverCardAvatar {
  width: 44px;
  min-width: 44px;
  height: 44px;
  font-size: 16px;
}

.discoverCardMain {
  min-width: 0;
  flex: 1;
}

.discoverCardBody {
  margin-left: 54px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discoverCardTitleRow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.discoverCardTitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.discoverCardViewsRow {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  flex-wrap: wrap;
}

.discoverCardPosted {
  line-height: 1;
}

.discoverCardPosted::after {
  content: "•";
  margin-left: 6px;
  opacity: 0.55;
}

.discoverCardViewsIcon {
  width: 13px;
  height: 13px;
}

.discoverCardViewsCount {
  line-height: 1;
}

.discoverCardBadge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.discoverCardBadge.chat {
  background: #e0edff;
  color: #4f39f5;
}

.discoverCardBadge.channel {
  background: #dcfce7;
  color: #166534;
}

.discoverCardSubtitle {
  margin-top: 2px;
  font-size: 13px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discoverCardScore {
  border-radius: 999px;
  background: #eff6ff;
  color: #4f39f5;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  flex-shrink: 0;
}

.discoverCardDescription {
  margin: 0;
  color: #1f2937;
  line-height: 1.35;
  font-size: 14px;
}

.discoverCardMessageWrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discoverMessageText {
  white-space: pre-wrap;
  word-break: break-word;
  color: #0f172a;
  line-height: 1.4;
}

.discoverMessageImage {
  max-width: min(420px, calc(100vw - 130px));
}

.discoverCardReactions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discoverCardReactions .messageReactions {
  margin-top: 0;
}

.discoverReactionPicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.discoverReactionButton {
  border-radius: 999px;
  border: 1px solid #d4deee;
  background: #ffffff;
  color: #0f172a;
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  font-size: 15px;
  line-height: 1;
}

.discoverCardBottom {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.discoverCardMetric {
  font-size: 12px;
  color: #64748b;
}

.discoverOpenButton {
  border-radius: 999px;
  padding: 7px 11px;
  background: #4f39f5;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.discoverChannelMark {
  border-radius: 999px;
  padding: 6px 10px;
  background: #ecfdf3;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.discoverEmptyState {
  border: 1px dashed #bfd1ea;
  border-radius: 14px;
  background: #ffffff;
  padding: 18px;
  text-align: center;
}

.discoverEmptyTitle {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.discoverEmptyText {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

.discoverTrends {
  min-height: auto;
  border: 1px solid #d9e2ef;
  border-radius: 22px;
  background: transparent;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
}

.discoverTrendsHeader {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-left: 10px;
}

.discoverTrends h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.discoverPreferencesButton {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaf1fb;
  color: #334155;
  padding: 0;
}

.discoverPreferencesButton svg {
  width: 18px;
  height: 18px;
}

.discoverPreferencesPanel {
  position: fixed;
  top: 72px;
  right: 12px;
  z-index: 240;
  width: min(420px, calc(100vw - 24px));
  max-height: min(72vh, 560px);
  overflow-y: auto;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.discoverPreferencesTitle {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.discoverPreferencesList,
.createChannelInterests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.discoverInterestOption {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9e2ef;
  border-radius: 999px;
  background: #f8fbff;
  padding: 6px 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.discoverInterestOption input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.createChannelInterestOption {
  font-size: 13px;
}

.discoverPreferencesActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.discoverInterestEmpty {
  color: #64748b;
  font-size: 13px;
}

.discoverTrendList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: auto;
  max-height: min(64vh, 720px);
}

.discoverTrendItem {
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.discoverTrendItem:hover {
  background: #f3f3ff;
}

.discoverTrendAvatar {
  width: 58px;
  min-width: 58px;
  height: 58px;
  font-size: 22px;
}

.discoverTrendMain {
  min-width: 0;
  flex: 1;
}

.discoverTrendTitle {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discoverTrendSubtitle {
  margin-top: 2px;
  font-size: 13px;
  color: #8a919b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discoverTrendFollowButton {
  border-radius: 999px;
  padding: 10px 20px;
  min-width: 104px;
  background: #020b16;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.discoverTrendFollowButton:hover {
  opacity: 0.95;
}

.discoverTrendEmpty {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.chatHeaderTop {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatHeaderAvatar {
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatarHeader {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.chatHeaderText h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
}

.chatHeaderText p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.25;
}

.chatHeaderText p.typingNow {
  color: #5c738f;
  font-weight: 500;
}

.chatHeaderActions {
  margin-left: auto;
  position: relative;
}

.chatHeader.chatHeaderInfoAvailable .chatHeaderAvatar,
.chatHeader.chatHeaderInfoAvailable .chatHeaderText {
  cursor: pointer;
}

.chatHeader.chatHeaderUserPreviewAvailable .chatHeaderAvatar,
.chatHeader.chatHeaderUserPreviewAvailable #chatTitle {
  cursor: pointer;
}

.chatHeader.chatHeaderUserPreviewAvailable #chatTitle:focus-visible,
.chatHeader.chatHeaderUserPreviewAvailable .chatHeaderAvatar:focus-visible {
  outline: 2px solid rgba(91, 72, 255, 0.42);
  outline-offset: 3px;
  border-radius: 10px;
}

.chatActionsButton {
  width: 38px;
  min-width: 38px;
  height: 38px;
  border-radius: 999px;
  padding: 0;
  font-size: 0;
  line-height: 1;
  background: transparent;
  color: #4f39f5;
}

.chatActionsButton svg {
  width: 19px;
  height: 19px;
}

.discoverHeaderPreferencesButton {
  border-radius: 10px;
  font-size: 0;
}

.discoverHeaderPreferencesButton svg {
  width: 18px;
  height: 18px;
}

.chatActionsMenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 110;
  min-width: 230px;
  border: 1px solid #d1dbe8;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.2);
  padding: 6px;
}

.chatActionsMenu button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #0f172a;
  border-radius: 8px;
  padding: 9px 10px;
}

.chatActionsMenu button:hover {
  background: #eef2ff;
  opacity: 1;
}

.chatActionsMenu button:disabled {
  opacity: 0.55;
  cursor: default;
}

.chatActionsMenu button.danger {
  color: #dc2626;
}

.mobileMenuButton {
  display: none;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 0;
  line-height: 1;
  padding: 0;
  background: transparent;
  color: #4f39f5;
}

.mobileMenuButton svg {
  width: 20px;
  height: 20px;
}

.messages {
  flex: 1;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(203, 211, 224, 0.92) transparent;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #ffffff;
}

.messages.dragOver {
  outline: 2px dashed #4f39f5;
  outline-offset: -8px;
  background: #eff6ff;
}

.messages.chatInfoMode {
  display: block;
  padding: 12px 14px 18px;
}

.chatInfoScreen {
  width: min(100%, 600px);
  margin: 0 auto;
}

.chatInfoHead {
  display: flex;
  justify-content: flex-end;
  min-height: 24px;
  margin-bottom: 4px;
}

.chatInfoEditSpacer {
  width: 24px;
  height: 24px;
}

.chatInfoEditButton {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: #111827;
}

.chatInfoEditButton svg {
  width: 13px;
  height: 13px;
}

.chatInfoHero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.chatInfoAvatar {
  width: 88px;
  height: 88px;
  font-size: 24px;
}

.chatInfoTitle {
  margin: 2px 0 0;
  font-size: clamp(18px, 2.6vw, 24px);
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
}

.chatInfoCounter {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #94a3b8;
}

.chatInfoAboutCard {
  margin-top: 14px;
  border-radius: 14px;
  padding: 12px 12px;
  background: #eef0ff;
  text-align: center;
}

.chatInfoAboutLabel {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  color: #6f6af8;
}

.chatInfoAboutText {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #0f172a;
  white-space: pre-wrap;
}

.chatInfoInterestPill {
  width: fit-content;
  min-width: 120px;
  max-width: 100%;
  margin: 10px auto 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: #4f39f5;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
}

.chatInfoActionGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.chatInfoActionButton {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #111827;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
}

.chatInfoActionButton svg {
  width: 20px;
  height: 20px;
}

.chatInfoActionButton.active,
.chatInfoActionButton:disabled {
  background: #4f39f5;
  border-color: #4f39f5;
  color: #ffffff;
  opacity: 1;
}

.chatInfoActionButton.dangerAction {
  background: #ffe1e1;
  border-color: #ffe1e1;
  color: #dc2626;
}

.chatInfoActionButton.dangerAction:hover {
  background: #ffd3d3;
  border-color: #ffd3d3;
}

.chatInfoActionButton:hover {
  opacity: 1;
}

.chatInfoModerationCard {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

.chatInfoModerationRow {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
}

.chatInfoModerationRow+.chatInfoModerationRow {
  border-top: 1px solid #eef2f7;
}

.chatInfoModerationRow:hover {
  opacity: 1;
  background: #f8fafc;
}

.chatInfoModerationIcon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chatInfoModerationIcon svg {
  width: 18px;
  height: 18px;
}

.chatInfoModerationIcon.edit {
  background: #eef2ff;
  color: #4f39f5;
}

.chatInfoModerationIcon.subscriptions {
  background: #e9f7ef;
  color: #16a34a;
}

.chatInfoModerationIcon.admins {
  background: #eff6ff;
  color: #2563eb;
}

.chatInfoModerationIcon.blacklist {
  background: #fee2e2;
  color: #dc2626;
}

.chatInfoModerationLabel {
  flex: 1;
  min-width: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 500;
  color: #0f172a;
}

.chatInfoModerationMeta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #9ca3af;
  font-size: 19px;
  line-height: 1;
  font-weight: 500;
}

.chatInfoModerationMeta svg {
  width: 18px;
  height: 18px;
}

.chatInfoMembersBlock {
  margin-top: 34px;
}

.chatInfoMembersTitle {
  margin-bottom: 12px;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 600;
  color: #64748b;
}

.chatInfoMembersList {
  border-top: 1px solid #e2e8f0;
}

.chatInfoMemberRow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #e2e8f0;
}

.chatInfoMemberRow.clickable {
  cursor: pointer;
}

.chatInfoMemberRow.clickable:hover {
  background: #f8fafc;
}

.chatInfoMemberAvatar {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.chatInfoMemberText {
  min-width: 0;
  flex: 1;
}

.chatInfoMemberName {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  color: #0f172a;
}

.chatInfoMemberStatus {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.3;
  color: #64748b;
}

.chatInfoMemberYou {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f39f5;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}

.chatInfoRemoveButton {
  padding: 8px 12px;
  border-radius: 999px;
  border: 0;
  background: #ffe5e5;
  color: #dc2626;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}

.message {
  max-width: 70%;
  width: fit-content;
  min-width: 0;
  align-self: flex-start;
  position: relative;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 0;
  cursor: context-menu;
}

.messageDayDivider {
  align-self: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: #eef2f7;
  color: #8e98a8;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  user-select: none;
  -webkit-user-select: none;
}

.message.withAvatar {
  margin-left: 52px;
}

.message.withAvatar::before {
  content: attr(data-avatar);
  position: absolute;
  left: -52px;
  top: -1px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--message-avatar-bg, #64748b);
  background-image: var(--message-avatar-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--message-avatar-fg, #ffffff);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.message.mine {
  align-self: flex-end;
  background: #f3f3ff;
  border: 0;
}

.message.directMessage {
  background: #ffffff;
  border-radius: 22px;
  padding: 12px 14px 10px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.message.communityMessage {
  background: #ffffff;
  border-radius: 22px;
  padding: 12px 14px 10px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  color: #111827;
}

.message.communityMessage.mine {
  background: #f3f3ff;
  color: #111827;
  box-shadow: none;
}

.message.directMessage.mine {
  background: #f3f3ff;
  color: #111827;
  box-shadow: none;
}

.message.directMessage .messageMeta {
  margin-top: 8px;
  margin-bottom: 0;
  justify-content: flex-start;
  gap: 5px;
  font-size: 12px;
  color: #7b8697;
}

.message.directMessage .messageMetaCompact {
  justify-content: flex-start;
}

.message.directMessage.mine .messageMeta {
  justify-content: flex-end;
  color: #7b8697;
}

.message.directMessage.mine .deliveryStatus {
  color: #64748b;
}

.message.directMessage.mine .deliveryStatus.read {
  color: #4f39f5;
}

.message.directMessage.mine .editedMark {
  color: #64748b;
}

.message.directMessage.mine .messageText a,
.message.directMessage.mine .messageImageCaption a {
  color: #1d4ed8;
}

.message.directMessage.mine .replyRef {
  background: #ffffff;
  border-left-color: #4f46e5;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.1);
}

.message.directMessage.mine .replyRefAuthor {
  color: #4f39f5;
}

.message.directMessage.mine .replyRefText {
  color: #334155;
}

.message.voiceMessage {
  min-width: min(220px, 58vw);
  max-width: min(300px, 64vw);
  padding: 8px 10px 7px;
}

.voicePlayer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: min(200px, 52vw);
}

.voicePlayerToggle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(180deg, #5f47ff 0%, #4f39f5 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(79, 57, 245, 0.18);
  flex: 0 0 auto;
}

.voicePlayerToggle svg {
  width: 18px;
  height: 18px;
}

.voicePlayerMain {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.voicePlayerWave {
  --voice-progress: 0;
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.voicePlayerWaveBars {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
}

.voiceWaveBar {
  width: 2px;
  min-height: 5px;
  height: min(var(--voice-bar-height, 16px), 15px);
  border-radius: 999px;
  background: #c8ced8;
  transition: background-color 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.voicePlayer.playing .voiceWaveBar {
  opacity: 0.96;
}

.voiceWaveBar.played {
  background: #4f39f5;
}

.voicePlayerMeta {
  display: flex;
  align-items: center;
  gap: 5px;
}

.voicePlayerTime,
.voicePlayerDuration {
  font-size: 11px;
  line-height: 1;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.voicePlayerTime {
  font-size: 11px;
  color: #8b909b;
}

.voicePlayerActions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.voicePlayerAction {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 12px;
  border: 0;
  background: #f2f5fb;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.voicePlayerAction svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

.voicePlayerMute svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.8;
}

.voicePlayerSpeed {
  width: 34px;
  min-width: 34px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  color: #475569;
}

.voicePlayerAudio {
  display: none;
}

.discoverVoicePlayer {
  min-width: 0;
}

.discoverVoicePlayer .voicePlayerToggle {
  width: 36px;
  height: 36px;
}

.message.withAvatar.mine {
  margin-left: 0;
  margin-right: 52px;
}

.message.withAvatar.mine::before {
  display: none;
}

.message.withAvatar.mine::after {
  content: attr(data-avatar);
  position: absolute;
  right: -52px;
  top: -1px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--message-avatar-bg, #64748b);
  background-image: var(--message-avatar-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--message-avatar-fg, #ffffff);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.message.selectionEligible {
  cursor: pointer;
}

.message.selectionEligible::before,
.message.selectionEligible::after {
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.messageSelectionControl {
  position: absolute;
  left: -46px;
  top: 12px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 2;
  cursor: pointer;
}

.messageSelectionCircle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  pointer-events: auto;
  cursor: pointer;
}

.messageSelectionCircle svg {
  width: 15px;
  height: 15px;
  stroke-width: 3;
}

.message.selected {
  box-shadow: 0 0 0 2px rgba(79, 57, 245, 0.22), 0 8px 24px rgba(79, 57, 245, 0.08);
}

.message.selected .messageSelectionCircle {
  border-color: #4f39f5;
  background: #4f39f5;
  color: #ffffff;
}

.messageText {
  white-space: pre-wrap;
  word-break: break-word;
}

.messageLinkPreview {
  margin-top: 7px;
  max-width: min(420px, 62vw);
}

.messageLinkPreview.media {
  max-width: min(560px, 68vw);
}

.messageLinkPreviewCard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
  border: 1px solid #c7d7eb;
  border-left: 4px solid #4f39f5;
  border-radius: 12px;
  background: #f8fbff;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
}

.messageLinkPreviewCard.media {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.messageLinkPreviewMain {
  min-width: 0;
}

.messageLinkPreviewSite {
  font-size: 12px;
  color: #4f39f5;
  font-weight: 700;
  margin-bottom: 2px;
}

.messageLinkPreviewTitle {
  font-size: 16px;
  line-height: 1.2;
  color: #0f172a;
  font-weight: 600;
}

.messageLinkPreviewDescription {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.3;
  color: #334155;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.messageLinkPreview.media .messageLinkPreviewDescription {
  -webkit-line-clamp: 4;
}

.messageLinkPreviewMediaWrap {
  position: relative;
}

.messageLinkPreviewImage {
  width: 72px;
  min-width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #dbe4f0;
}

.messageLinkPreviewImage.media {
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
}

.messageLinkPreviewPlayBadge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 44px;
  margin-left: -32px;
  margin-top: -22px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
}

.messageLinkPreviewPlayTriangle {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid #ffffff;
  margin-left: 2px;
}

.messageLinkPreviewSkeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
  background-size: 200% 100%;
  animation: previewPulse 1.2s linear infinite;
}

.messageLinkPreviewSkeleton.line1 {
  height: 16px;
  width: 52%;
  margin-bottom: 7px;
}

.messageLinkPreviewSkeleton.line2 {
  height: 13px;
  width: 82%;
}

@keyframes previewPulse {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.friendRequestBanner {
  align-self: center;
  width: min(560px, calc(100% - 20px));
  border: 1px solid #c7d7eb;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px 12px;
  margin-bottom: 2px;
}

.friendRequestBanner.incoming {
  border-color: #4f39f5;
  background: #eff6ff;
}

.friendRequestBanner.outgoing {
  border-color: #fbcfe8;
  background: #fff7fb;
}

.friendRequestBannerTitle {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 2px;
}

.friendRequestBannerText {
  font-size: 13px;
  color: #475569;
}

.friendRequestBannerActions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.friendRequestBannerButton {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #4f39f5;
  color: #ffffff;
}

.friendRequestBannerButton.danger {
  background: #dc2626;
}

.messageText a,
.messageImageCaption a {
  color: inherit;
  text-decoration: underline;
}

.message.emojiOnlyMessage {
  background: transparent;
  border-color: transparent;
  padding: 4px 6px;
  box-shadow: none;
}

.message.directMessage.emojiOnlyMessage,
.message.communityMessage.emojiOnlyMessage,
.message.mine.emojiOnlyMessage,
.message.directMessage.mine.emojiOnlyMessage,
.message.communityMessage.mine.emojiOnlyMessage {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.message.emojiOnlyMessage .messageMeta {
  margin-bottom: 2px;
}

.message.emojiOnlyMessage .messageText {
  line-height: 1.05;
  font-size: 62px;
}

.message.emojiOnlyMessage .messageText.emojiCount2 {
  font-size: 50px;
}

.message.emojiOnlyMessage .messageText.emojiCount3 {
  font-size: 40px;
}

.messageImageLink {
  display: inline-block;
  margin-top: 2px;
  position: relative;
}

.messageUploadMediaWrap {
  position: relative;
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin-top: 2px;
  border-radius: 12px;
  overflow: hidden;
}

.messageUploadMediaWrap .messageImageLink {
  margin-top: 0;
}

.message.mediaMessage .messageUploadMediaWrap .messageImageLink {
  margin-top: 0;
}

.messageImage {
  display: block;
  width: auto;
  max-width: min(360px, 60vw);
  max-height: 360px;
  border-radius: 10px;
  object-fit: cover;
  background: #e2e8f0;
  transition: opacity 180ms ease, filter 180ms ease, transform 180ms ease;
}

.messageImage.imageFadePending {
  opacity: 0;
  filter: blur(3px);
  transform: scale(1.008);
}

.messageVideo {
  display: block;
  width: 100%;
  max-width: min(360px, 60vw);
  max-height: 360px;
  border-radius: 12px;
  background: #020617;
  object-fit: contain;
}

.messageVideo.uploading {
  filter: saturate(0.9) brightness(0.86);
}

.messageUploadMediaWrap.uploading .messageImageLink,
.messageUploadMediaWrap.uploading .messageVideo {
  pointer-events: none;
}

.messageUploadOverlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.messageUploadOverlay::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(2, 6, 23, 0.22);
}

.messageUploadProgressLabel {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  color: #f8fafc;
  background: rgba(2, 6, 23, 0.72);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.3);
}

.messageUploadSpinner {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 54px;
  height: 54px;
  margin-left: -27px;
  margin-top: -27px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  animation: imageLoaderSpin 0.78s linear infinite;
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.35);
}

.discoverMessageImageWrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.discoverMessageVideoWrap {
  position: relative;
  display: block;
  margin-top: 4px;
  max-width: min(100%, 540px);
}

.discoverMessageVideo {
  width: 100%;
  max-height: 420px;
  border-radius: 12px;
  background: #020617;
  object-fit: contain;
}

.messageImageLink.imageLoading::after,
.discoverMessageImageWrap.imageLoading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.45);
  border-top-color: #4f39f5;
  animation: imageLoaderSpin 0.8s linear infinite;
  pointer-events: none;
}

@keyframes imageLoaderSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.messageImageCaption {
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.mediaMessage {
  max-width: min(320px, 72vw);
  width: fit-content;
}

.message.mediaMessage .messageImageLink {
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin-top: 4px;
}

.message.mediaMessage .messageImage {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 320px;
  border-radius: 12px;
  object-fit: contain;
  background: transparent;
}

.message.mediaMessage .messageVideo {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 320px;
  border-radius: 12px;
}

.message.mediaMessage .messageImageCaption {
  margin-top: 10px;
  max-width: 100%;
}

.message.mediaMessageCaptioned {
  width: fit-content;
  max-width: min(320px, 72vw);
}

.message.mediaMessageCaptioned .messageImageLink {
  display: inline-block;
  width: auto;
  max-width: 100%;
}

.message.mediaMessageCaptioned .messageImageCaption {
  width: fit-content;
  max-width: 100%;
}

.message.mediaGroupMessage {
  max-width: min(420px, 78vw);
}

.messageMediaGroupSingle {
  width: min(360px, 68vw);
  max-width: 100%;
}

.messageMediaGroupSingle .messageMediaGroupTile {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
}

.messageMediaGroupMosaic {
  width: min(360px, 68vw);
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 6px;
  aspect-ratio: 4 / 3;
}

.messageMediaGroupPrimary,
.messageMediaGroupStack {
  min-width: 0;
  min-height: 0;
}

.messageMediaGroupStack {
  display: grid;
  gap: 6px;
  grid-template-rows: repeat(var(--stack-count, 1), minmax(0, 1fr));
}

.messageMediaGroupTile {
  display: block;
  position: relative;
  margin-top: 0 !important;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #d7deea;
}

.messageMediaGroupTile.uploading {
  pointer-events: none;
}

.messageMediaGroupImage,
.messageMediaGroupVideo {
  width: 100%;
  height: 100%;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0;
  object-fit: cover !important;
  display: block;
}

.messageMediaGroupVideo {
  background: #020617;
}

.messageMediaGroupVideoBadge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.35);
  pointer-events: none;
}

.messageMediaGroupVideoBadge svg {
  width: 14px;
  height: 14px;
  margin-left: 1px;
}

.messageMediaGroupUploadingDot {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4f39f5;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.94);
  pointer-events: none;
}

.messageReactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.messageReactionChip {
  border: 0;
  border-radius: 999px;
  padding: 3px 9px;
  background: #ffffff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.messageReactionChip:hover {
  background: #ffffff;
  opacity: 1;
}

.messageReactionChip.mine {
  background: #4f39f5;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(79, 57, 245, 0.28);
}

.messageReactionChip.mine .messageReactionCount {
  color: #ffffff;
}

.messageReactionEmoji {
  font-size: 16px;
}

.messageReactionCount {
  font-weight: 700;
  font-size: 12px;
}

.replyRef {
  border-left: 4px solid #4f39f5;
  background: #f3f3ff;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.replyRefLink {
  cursor: pointer;
}

.replyRefLink:hover {
  filter: brightness(0.98);
}

.replyRefAuthor {
  font-size: 14px;
  font-weight: 700;
  color: #4f39f5;
  margin-bottom: 2px;
}

.replyRefText {
  font-size: 14px;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message.mine .replyRef {
  border-left-color: #4f39f5;
  background: #cbe1ff;
}

.message.mine .replyRefAuthor {
  color: #4f39f5;
}

.messageMeta {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.deliveryStatus {
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.deliveryStatus.uploading {
  color: #94a3b8;
}

.deliveryIcon {
  width: 14px;
  height: 14px;
}

.deliveryIconClock {
  width: 13px;
  height: 13px;
}

.deliveryIconDouble {
  width: 16px;
  height: 16px;
}

.deliveryDouble {
  display: inline-flex;
  align-items: center;
}

.deliveryDouble .deliveryIcon+.deliveryIcon {
  margin-left: -5px;
}

.editedMark {
  font-size: 11px;
  text-transform: lowercase;
  color: #64748b;
}

.messageViews {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: #475569;
}

.messageViewsIcon {
  width: 12px;
  height: 12px;
}

.deliveryStatus.read {
  color: #4f39f5;
}

.composer {
  border-top: 1px solid #dbe4f0;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: end;
  gap: 8px;
  background: #fff;
  position: relative;
}

.messageSelectionBar {
  border-top: 1px solid #dbe4f0;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr minmax(0, auto);
  align-items: center;
  gap: 10px;
}

.messageSelectionAction {
  min-height: 42px;
  border-radius: 14px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.messageSelectionAction svg {
  width: 18px;
  height: 18px;
}

.messageSelectionAction.delete {
  background: #fff1f1;
  color: #dc2626;
}

.messageSelectionAction.delete:disabled {
  opacity: 0.45;
  cursor: default;
}

.messageSelectionAction.cancel {
  background: #eef2ff;
  color: #4f39f5;
}

.messageSelectionCount {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.composer,
.composer *,
.channelActionBar,
.channelActionBar *,
.emojiPicker,
.emojiPicker *,
.replyPreview,
.replyPreview *,
.editPreview,
.editPreview *,
.typing,
.typing *,
.iconButton,
.iconButton * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.composer .messageComposerInput,
.composer .messageComposerInput *,
.mediaComposerCaption,
.mediaComposerCaption * {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

.channelActionBar {
  border-top: 1px solid #dbe4f0;
  padding: 10px 12px;
  background: #fff;
}

#channelSubscribeToggle {
  width: 100%;
  border-radius: 12px;
  padding: 11px 14px;
  background: #4f39f5;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.iconButton {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #4f39f5;
}

.iconButton svg {
  width: 20px;
  height: 20px;
}

.iconButton.createGroupIconButton {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
}

.iconButton.recording {
  background: #dc2626;
  color: #ffffff;
}

.voiceRecordPanel {
  min-height: 36px;
  border-radius: 14px;
  border: 1px solid #d9def0;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / 4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.voiceRecordPulse {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4f39f5;
  box-shadow: 0 0 0 0 rgba(79, 57, 245, 0.28);
  animation: voiceRecordPulse 1.2s ease infinite;
  flex: 0 0 auto;
}

.voiceRecordWave {
  flex: 1;
  min-width: 0;
  height: 20px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.voiceRecordTime {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.voiceRecordWave .voiceWaveBar {
  width: 2px;
  min-height: 5px;
  height: min(var(--voice-bar-height, 16px), 14px);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(79, 57, 245, 0.38) 0%, rgba(79, 57, 245, 0.85) 100%);
  transform-origin: center;
  animation: voiceRecordWaveMotion 1.05s ease-in-out infinite;
}

.voiceRecordWave .voiceWaveBar:nth-child(3n) {
  animation-duration: 1.2s;
}

.voiceRecordWave .voiceWaveBar:nth-child(4n) {
  animation-duration: 0.92s;
}

.emojiButton {
  font-size: 0;
}

.emojiButton svg {
  width: 20px;
  height: 20px;
}

.messageComposerInput {
  min-height: 42px;
  max-height: 180px;
  resize: none;
  overflow-y: hidden;
  border-radius: 18px;
  padding: 10px 12px;
  line-height: 1.4;
}

.composerActionButton {
  min-height: 42px;
  height: 42px;
  align-self: end;
  width: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 999px;
}

.composer.voiceRecordingMode .composerActionButton {
  border-radius: 14px;
}

.composer.voiceRecordingMode .composerActionButton.recording {
  background: #4f39f5;
  box-shadow: 0 12px 28px rgba(79, 57, 245, 0.22);
}

.composerActionButton.composerActionSend {
  background: #4f39f5;
  color: #ffffff;
}

.composerActionButton.composerActionSend:hover {
  opacity: 0.92;
}

.emojiPicker {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 8px);
  width: min(320px, calc(100vw - 24px));
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid #c7d7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
  padding: 8px;
  z-index: 95;
}

.emojiGrid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
}

.emojiItem {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111827;
  font-size: 20px;
  line-height: 1;
  padding: 7px 0;
}

.emojiItem:hover {
  background: #eef2ff;
  opacity: 1;
}

.replyPreview {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #c7d7eb;
  border-radius: 10px;
  background: #eff6ff;
  padding: 8px 10px;
  color: #334155;
}

.replyPreviewText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.replyPreview button {
  padding: 6px 8px;
  font-size: 12px;
}

.editPreview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #efc9c9;
  border-radius: 10px;
  background: #fff1f1;
  padding: 8px 10px;
  color: #7f1d1d;
}

.editPreviewIcon {
  width: 15px;
  height: 15px;
  opacity: 0.9;
}

.editPreviewText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.editPreview button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
  background: #f3caca;
  color: #9f1239;
}

.editPreview button svg {
  width: 14px;
  height: 14px;
}

.typing {
  margin: 0;
  min-height: 20px;
  padding: 0 20px;
  color: #64748b;
  font-size: 13px;
}

.scrollToBottomButton {
  position: absolute;
  right: 18px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #4f39f5;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 98, 254, 0.35);
  z-index: 80;
}

.scrollToBottomButton:hover {
  transform: translateY(-1px);
}

.scrollToBottomIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.scrollToBottomIcon svg {
  width: 24px;
  height: 24px;
  transform: translateY(-1px);
}

.scrollToBottomBadge {
  position: absolute;
  top: -7px;
  right: -4px;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #22c55e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border: 2px solid #f8fbff;
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.3);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
}

#sidebarPaneProfile {
  justify-content: flex-start;
  gap: 10px;
  overflow: hidden;
}

.profileView {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.profileMainView {
  padding-top: 0;
  overflow: hidden;
  gap: 0;
}

.accountHero {
  position: relative;
  z-index: 8;
  flex-shrink: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.accountHeroBanner {
  position: relative;
  z-index: 1;
  height: 104px;
  background: linear-gradient(135deg, #5f47ff 0%, #4f39f5 100%);
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid #e6ebf4;
}

.accountHeroBanner.hasImage {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.accountHeroBanner svg {
  position: absolute;
  top: 46%;
  left: 56%;
  width: 156px;
  height: 156px;
  color: #ffffff;
  transform: translate(-50%, -50%) rotate(-13deg);
  opacity: 0.95;
  stroke-width: 1.8;
}

.accountHeroBanner.hasImage svg {
  display: none;
}

.accountIdentityRow {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: -34px;
  padding: 0 14px 10px;
}

.accountAvatar {
  width: 82px;
  min-width: 82px;
  height: 82px;
  border-radius: 999px;
  background: #5dd16f;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.6px;
  border: 5px solid #ffffff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.18);
  z-index: 3;
}

.accountAvatar.hasImage {
  background: #e2e8f0;
  color: transparent;
  overflow: hidden;
}

.accountAvatar.hasImage > span {
  display: none;
}

.accountAvatarImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.accountIdentityMain {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  align-items: center;
  text-align: center;
}

.accountIdentityName {
  max-width: 100%;
  font-size: 32px;
  line-height: 1.08;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accountIdentityHandle {
  max-width: 100%;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 500;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#wsStatus {
  display: none !important;
}

.accountBalanceCard {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px 0 10px;
  border-radius: 17px;
  background: #eeedf8;
}

.accountBalanceLabel {
  font-size: 11px;
  line-height: 1;
  color: #9ca3af;
}

.accountBalanceValue {
  margin-left: auto;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  color: #4b5563;
  letter-spacing: 0.2px;
}

.accountBalanceBadge {
  width: 13px;
  min-width: 13px;
  height: 13px;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.accountBalanceBadgeIcon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.accountMenuList {
  margin-top: 8px;
  padding-top: 0;
  border-top: 1px solid #e9edf4;
  border-bottom: 1px solid #e9edf4;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  position: relative;
  z-index: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.accountMenuList::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.accountMenuRow {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid #e9edf4;
  border-radius: 0;
  background: transparent;
  color: #1f2937;
  text-align: left;
}

.accountMenuRow:last-child {
  border-bottom: 0;
}

.accountMenuRow:hover {
  background: #f7f8fc;
}

.accountMenuRowActive:hover {
  background: #f7f8fc;
  color: #1f2937;
}

.accountMenuRowActive {
  background: transparent;
  color: #1f2937;
}

.accountMenuIcon {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.accountMenuIcon svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.1;
}

.accountMenuRowActive .accountMenuIcon {
  color: #9ca3af;
}

.accountMenuIconAccent {
  color: #4f39f5;
}

.accountMenuText {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
  color: inherit;
}

.accountMenuCount {
  margin-left: auto;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  color: #6b7280;
}

.accountMenuRowDanger {
  color: #c22c2c;
}

.accountMenuIconDanger {
  color: #c22c2c;
}

.accountMenuRowDisabled {
  opacity: 0.55;
}

#profileMiggButton .accountMenuIcon {
  color: #9ca3af;
}

#sidebarPaneProfile .dot {
  padding: 0;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0;
  background: transparent;
}

#sidebarPaneProfile .dot.online {
  color: #6b7280;
  background: transparent;
}

#sidebarPaneProfile .dot.offline {
  color: #9ca3af;
  background: transparent;
}

.profileEditForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 2px;
  padding-bottom: 14px;
}

.profileEditForm::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#profileEditView {
  overflow: hidden;
}

.profileEditHero {
  position: relative;
  margin-top: 2px;
  padding-bottom: 56px;
}

.profileEditCover {
  position: relative;
  height: 146px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #5f47ff 0%, #4f39f5 100%);
  border: 1px solid #dadff1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profileEditCover.hasImage {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.profileEditCover > i {
  width: 168px;
  height: 168px;
  color: #ffffff;
  transform: rotate(-13deg);
  opacity: 0.96;
  stroke-width: 1.8;
}

.profileEditCover.hasImage > i {
  display: none;
}

.profileEditCoverCamera,
.profileEditAvatarCamera {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #5b46f8;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(64, 44, 198, 0.36);
}

.profileEditCoverCamera {
  position: absolute;
  right: 14px;
  bottom: 14px;
}

.profileEditAvatar {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 18%);
  width: 104px;
  min-width: 104px;
  height: 104px;
  border-radius: 999px;
  background: #5dd16f;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 800;
  border: 5px solid #ffffff;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.2);
  overflow: hidden;
}

.profileEditAvatar.hasImage {
  background: #e2e8f0;
  color: transparent;
}

.profileEditAvatar.hasImage > span {
  display: none;
}

.profileEditAvatarCamera {
  position: absolute;
  left: calc(50% + 34px);
  bottom: 0;
  transform: translateY(44%);
}

.profileEditCoverCamera svg,
.profileEditAvatarCamera svg {
  width: 20px;
  height: 20px;
}

.profileEditField {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.profileEditForm > .profileEditField:first-of-type {
  margin-top: 10px;
}

.profileEditField > span {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
}

.profileEditField > input,
.profileEditField > textarea {
  width: 100%;
  border: 1px solid #dde4f2;
  border-radius: 14px;
  background: #ffffff;
  color: #111827;
  font-size: 16px;
  line-height: 1.3;
  padding: 12px 14px;
  outline: none;
}

.profileEditField > textarea {
  min-height: 88px;
  resize: vertical;
}

.profileEditField > input:focus,
.profileEditField > textarea:focus {
  border-color: #7466fb;
  box-shadow: 0 0 0 4px rgba(116, 102, 251, 0.12);
}

.profileEditInterestsField {
  margin-top: 2px;
}

.profileEditInterestsList {
  border-top: 1px solid #dde4f2;
  border-right: 0;
  border-bottom: 1px solid #dde4f2;
  border-left: 0;
  border-radius: 0;
  padding: 10px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.profileEditInterestsList::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.profileEditInterestsList .discoverInterestOption {
  min-height: 38px;
  border-radius: 10px;
  padding: 8px 10px;
}

.profileEditSaveButton {
  margin-top: 2px;
  min-height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6353fa 0%, #4f39f5 100%);
  color: #ffffff;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.profileEditSaveButton svg {
  width: 22px;
  height: 22px;
}

.profileEditSaveButton:disabled {
  opacity: 0.68;
}

.profileSubpageHeader {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profileSubpageHeaderMain {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profileSubpageHeader {
  margin-bottom: 2px;
}

.profileSubpageTitle {
  margin: 0;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 800;
  color: #111827;
}

.profileSubpageBackButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5a43f7;
  flex-shrink: 0;
}

.profileSubpageBackButton svg {
  width: 24px;
  height: 24px;
}

.telegramConnectPanel {
  width: 100%;
  flex: 1;
}

.telegramConnectCard {
  min-height: 100%;
  padding: 6px 0 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.telegramConnectField {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.telegramConnectField span {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #94a3b8;
}

.telegramConnectInput {
  width: 100%;
  min-height: 50px;
  border: 1px solid #d7dff0;
  border-radius: 16px;
  background: #ffffff;
  padding: 0 15px;
  font-size: 14px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.telegramConnectInput:focus {
  border-color: #6d5efc;
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.12);
}

.telegramConnectActions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.telegramConnectActions button {
  flex: 1;
  min-height: 46px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
}

.telegramDisconnectButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.telegramDisconnectButton svg {
  width: 16px;
  height: 16px;
}

.telegramConnectNotice {
  margin-bottom: 14px;
  border-radius: 16px;
  padding: 12px 13px;
  font-size: 13px;
  line-height: 1.45;
}

.telegramConnectNotice.neutral {
  background: #eef2f7;
  color: #475569;
}

.telegramConnectNotice.success {
  background: #dcfce7;
  color: #166534;
}

.telegramConnectNotice.error {
  background: #fee2e2;
  color: #991b1b;
}

.telegramConnectSummary {
  border-radius: 16px;
  padding: 13px;
  background: #f8fbff;
  border: 1px solid #dbe4f1;
}

.telegramConnectSummaryLabel {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  color: #6b7280;
}

.telegramConnectSummaryValue {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
  color: #111827;
}

.telegramConnectSummaryMeta {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #667085;
}

.dot {
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 99px;
  letter-spacing: 0.2px;
}

.dot.online {
  color: #166534;
  background: #dcfce7;
}

.dot.offline {
  color: #7f1d1d;
  background: #fee2e2;
}

.hidden {
  display: none !important;
}

.messageMenu {
  position: fixed;
  z-index: 120;
  width: max-content;
  max-width: calc(100vw - 16px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.messageMenu,
.messageMenu *,
.chatListSection,
.chatListSection *,
#chatsList,
#chatsList * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.menuReactions {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(4px);
}

.messageMenuActions {
  width: min(220px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fbfcfe;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.menuReactions .menuReactionButton {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf1f6;
  color: #111827;
  transition: transform 0.14s ease, background-color 0.14s ease;
}

.menuReactions .menuReactionButton:hover {
  background: #e0e7ef;
  transform: translateY(-1px);
  opacity: 1;
}

.menuReactions .menuReactionButton.active {
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px #4f39f5;
}

.messageMenu button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #111827;
  border-radius: 0;
  padding: 11px 14px;
  font-size: 16px;
  line-height: 1.1;
  border-bottom: 1px solid #eef2f7;
}

.messageMenu button:hover {
  background: #f1f5f9;
  opacity: 1;
}

.messageMenuActions button:last-child {
  border-bottom: 0;
}

.messageMenu button:disabled {
  color: #aeb7c5;
  opacity: 1 !important;
}

.messageMenu button.danger {
  color: #ef9a9a;
}

.chatListMenu {
  position: fixed;
  z-index: 125;
  width: min(260px, calc(100vw - 24px));
  border: 1px solid #d1dbe8;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
  padding: 4px;
}

.chatListMenu button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #0f172a;
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 15px;
}

.chatListMenu button:hover {
  background: #eef2ff;
  opacity: 1;
}

.chatListMenu button:disabled {
  opacity: 0.55;
  cursor: default;
}

.chatListMenu button.danger {
  color: #dc2626;
}

.discoverReactionMenu {
  position: fixed;
  z-index: 126;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #d1dbe8;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  padding: 5px;
}

.discoverReactionMenuButton {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #0f172a;
  font-size: 20px;
  line-height: 1;
}

.discoverReactionMenuButton:hover {
  background: #eef2ff;
  opacity: 1;
}

.forwardPicker {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.34);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 18px 14px;
}

.forwardPickerCard {
  width: min(520px, 96vw);
  max-height: min(88vh, 820px);
  border: 1px solid #d7e2f0;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.forwardPickerHeader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.forwardPickerClose {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #eef2ff;
  color: #334155;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
}

.forwardPickerClose svg {
  width: 18px;
  height: 18px;
}

.forwardPickerSearch {
  border-radius: 999px;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 15px;
}

.forwardPickerList {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.forwardPickerItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
  background: #ffffff;
}

.forwardPickerItem:hover {
  background: #f6f9ff;
}

.forwardPickerAvatar {
  width: 46px;
  min-width: 46px;
  height: 46px;
  font-size: 16px;
}

.forwardPickerMain {
  min-width: 0;
}

.forwardPickerName {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forwardPickerSubline {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forwardPickerEmpty {
  padding: 14px 12px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

body.forwardPickerOpen {
  overflow: hidden;
}

.imageViewer {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.imageViewerCard {
  position: relative;
  max-width: min(92vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.imageViewerImage {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 90px);
  border-radius: 12px;
  object-fit: contain;
  background: #0f172a;
}

.imageViewerClose {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
  background: #111827;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.imageViewerClose svg {
  width: 17px;
  height: 17px;
}

.imageViewerDownload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: #4f39f5;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

#imageViewerDownload {
  display: none !important;
}

body.imageViewerOpen {
  overflow: hidden;
}

.videoViewer {
  position: fixed;
  inset: 0;
  z-index: 145;
  background: rgba(15, 23, 42, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.videoViewerCard {
  position: relative;
  width: min(96vw, 1220px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.videoViewerVideo {
  width: min(96vw, 1220px);
  max-height: calc(92vh - 90px);
  border-radius: 12px;
  background: #020617;
}

.videoViewerClose {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
  background: #111827;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.videoViewerClose svg {
  width: 18px;
  height: 18px;
}

.videoViewerActions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

#videoViewerFullscreen,
#videoViewerDownload,
.videoViewerActions {
  display: none !important;
}

.videoViewerActionButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(15, 23, 42, 0.65);
  color: #f8fafc;
  font-weight: 600;
  text-decoration: none;
}

.videoViewerActionButton.primary {
  background: #4f39f5;
  border-color: #4f39f5;
}

body.videoViewerOpen {
  overflow: hidden;
}

.mediaComposer {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.mediaComposerCard {
  width: min(680px, 96vw);
  max-height: min(92vh, 900px);
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mediaComposerHeader {
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mediaComposerHeaderActions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.mediaComposerClose {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  padding: 0;
  background: #eef2f7;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
}

.mediaComposerClose svg {
  width: 19px;
  height: 19px;
}

.mediaComposerTitle {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  line-height: 1.15;
}

.mediaComposerAdd {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  padding: 0;
  background: #eef2f7;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
}

.mediaComposerAdd svg {
  width: 19px;
  height: 19px;
}

.mediaComposerPreview {
  position: relative;
  width: calc(100% - 28px);
  margin: 0 14px;
}

.mediaComposerImage {
  display: block;
  width: 100%;
  max-height: min(62vh, 620px);
  object-fit: contain;
  border-radius: 18px;
  background: #eef2f7;
}

.mediaComposerVideo {
  display: block;
  width: 100%;
  max-height: min(62vh, 620px);
  object-fit: contain;
  border-radius: 18px;
  background: #0f172a;
}

.mediaComposerProgress {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  min-width: 170px;
  max-width: calc(100% - 24px);
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  border-radius: 12px;
  padding: 8px 10px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.mediaComposerProgressText {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
}

.mediaComposerProgressTrack {
  margin-top: 6px;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.mediaComposerProgressBar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f39f5 0%, #4f39f5 100%);
  transition: width 140ms ease;
}

.mediaComposerThumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(203, 211, 224, 0.92) transparent;
}

.mediaComposerThumbs::-webkit-scrollbar {
  height: 6px;
}

.mediaComposerThumbs::-webkit-scrollbar-track {
  background: transparent;
}

.mediaComposerThumbs::-webkit-scrollbar-thumb {
  background: rgba(203, 211, 224, 0.92);
  border-radius: 999px;
}

.mediaComposerThumbItem {
  position: relative;
  width: 84px;
  min-width: 84px;
  height: 84px;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  background: #eef2f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mediaComposerThumbItem.active {
  border-color: #4f39f5;
}

.mediaComposerThumbItem img,
.mediaComposerThumbItem video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mediaComposerThumbVideoBadge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0 6px;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

.mediaComposerThumbRemove {
  position: absolute;
  right: 4px;
  top: 4px;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.66);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.mediaComposerFooter {
  padding: 12px 14px 14px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.mediaComposerCaption {
  min-height: 52px;
  max-height: 220px;
  resize: none;
  overflow-y: hidden;
  border-radius: 18px;
  padding: 13px 16px;
  font-size: 18px;
  line-height: 1.35;
}

.mediaComposerSend {
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #5b9bf5;
  color: #ffffff;
}

.mediaComposerSend svg {
  width: 23px;
  height: 23px;
}

body.mediaComposerOpen {
  overflow: hidden;
}

.messageDeleteConfirm {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.messageDeleteConfirmCard {
  width: min(420px, 94vw);
  border-radius: 20px;
  border: 1px solid #d4dce8;
  background: #f4f6fb;
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.28);
  padding: 16px 14px 14px;
}

.messageDeleteConfirmTitle {
  margin: 0;
  text-align: center;
  font-size: 18px;
  line-height: 1.2;
  color: #0f172a;
  font-weight: 700;
}

.messageDeleteConfirmText {
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  color: #3f4b5f;
}

.messageDeleteConfirmActions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.messageDeleteConfirmButton {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.messageDeleteConfirmButton.cancel {
  background: #ffffff;
  color: #1f2937;
  border-color: #e2e8f0;
}

.messageDeleteConfirmButton.delete {
  background: #d14343;
  color: #ffffff;
}

.messageDeleteConfirmButton:hover {
  transform: translateY(-1px);
  opacity: 1;
}

body.messageDeleteConfirmOpen {
  overflow: hidden;
}

.systemDialog {
  position: fixed;
  inset: 0;
  z-index: 162;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.systemDialogCard {
  width: min(400px, 94vw);
  border-radius: 18px;
  border: 1px solid #d4dce8;
  background: #f4f6fb;
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.28);
  padding: 14px;
}

.systemDialogTitle {
  margin: 0;
  text-align: center;
  font-size: 17px;
  line-height: 1.2;
  color: #0f172a;
  font-weight: 700;
}

.systemDialogText {
  margin: 8px 0 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  color: #3f4b5f;
  white-space: pre-wrap;
}

.systemDialogInputWrap {
  margin-top: 10px;
}

.systemDialogInput {
  width: 100%;
  min-height: 84px;
  border-radius: 12px;
  border: 1px solid #cad5e7;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.35;
  color: #0f172a;
  padding: 10px 12px;
  resize: vertical;
}

.systemDialogInput:focus {
  outline: none;
  border-color: #6b7dff;
  box-shadow: 0 0 0 3px rgba(84, 62, 248, 0.14);
}

.systemDialogInput[readonly] {
  background: #f8fafc;
  color: #334155;
}

.systemDialogActions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.systemDialogActions.single {
  grid-template-columns: 1fr;
}

.systemDialogButton {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.systemDialogButton:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.systemDialogButton.cancel {
  background: #ffffff;
  color: #1f2937;
  border-color: #e2e8f0;
}

.systemDialogButton.confirm {
  color: #ffffff;
}

.systemDialogButton.confirm.primary {
  background: #4f39f5;
}

.systemDialogButton.confirm.danger {
  background: #d14343;
}

.systemDialogButton.confirm.neutral {
  background: #475569;
}

body.systemDialogOpen {
  overflow: hidden;
}

.userPreviewDialog {
  position: fixed;
  inset: 0;
  z-index: 166;
  background: rgba(15, 23, 42, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.userPreviewDialogCard {
  width: min(520px, 94vw);
  min-height: 360px;
  border-radius: 28px;
  border: 1px solid #d6ddeb;
  background: #ffffff;
  box-shadow: 0 26px 52px rgba(15, 23, 42, 0.24);
  overflow: hidden;
  position: relative;
}

.userPreviewDialogClose {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #ffffff;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.userPreviewDialogClose svg {
  width: 22px;
  height: 22px;
}

.userPreviewDialogBanner {
  height: 170px;
  background: #543ef8;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.userPreviewDialogBanner.hasImage {
  background-color: #543ef8;
}

.userPreviewAvatar {
  width: 156px;
  height: 156px;
  margin: -78px auto 0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  border: 7px solid #ffffff;
  overflow: hidden;
}

.userPreviewAvatarCircle {
  width: 100%;
  height: 100%;
  font-size: 42px;
  font-weight: 800;
}

.userPreviewDialogBody {
  padding: 12px 28px 34px;
  text-align: center;
}

.userPreviewName {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  color: #111827;
  font-weight: 700;
  letter-spacing: 0;
}

.userPreviewHandle {
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.2;
  color: #9ca3af;
  font-weight: 500;
}

.userPreviewStatus {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.3;
  color: #6b7190;
  font-weight: 500;
}

.userPreviewStatus a {
  color: #4f39f5;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.userPreviewDonateButton {
  margin: 20px auto 0;
  width: min(390px, 100%);
  min-height: 108px;
  border-radius: 24px;
  border: 1px solid #d9e1ee;
  background: #ffffff;
  color: #111827;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.userPreviewDonateButton:hover {
  transform: translateY(-1px);
  background: #f8fafc;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.userPreviewDonateIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
}

.userPreviewDonateIcon svg {
  width: 30px;
  height: 30px;
  stroke-width: 2.3;
}

.userPreviewDonateLabel {
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

body.userPreviewDialogOpen {
  overflow: hidden;
}

@media (max-width: 640px) {
  .authPanelLogoWrap {
    width: 84px;
    height: 84px;
    padding: 0;
  }

  .authPanelTagline {
    max-width: 240px;
    font-size: 16px;
  }

  .authGoogleOnlySection {
    max-width: 288px;
  }

  .messageDayDivider {
    font-size: 12px;
    padding: 5px 12px;
  }

  .userPreviewDialogCard {
    width: min(420px, 94vw);
    min-height: 320px;
    border-radius: 24px;
  }

  .userPreviewDialogBanner {
    height: 150px;
  }

  .userPreviewAvatar {
    width: 126px;
    height: 126px;
    margin-top: -63px;
    border-width: 6px;
  }

  .userPreviewAvatarCircle {
    font-size: 36px;
  }

  .userPreviewDialogBody {
    padding: 10px 18px 28px;
  }

  .userPreviewName {
    font-size: 22px;
  }

  .userPreviewHandle {
    margin-top: 8px;
    font-size: 18px;
  }

  .userPreviewStatus {
    margin-top: 12px;
    font-size: 16px;
  }

  .userPreviewDonateButton {
    margin-top: 16px;
    min-height: 92px;
    border-radius: 20px;
  }

  .userPreviewDonateIcon svg {
    width: 26px;
    height: 26px;
  }

  .userPreviewDonateLabel {
    font-size: 18px;
  }
}

.donateDialog {
  position: fixed;
  inset: 0;
  z-index: 165;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.donateDialogCard {
  width: min(360px, 92vw);
  border-radius: 24px;
  border: 1px solid #d6ddeb;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8ff 100%);
  box-shadow: 0 26px 52px rgba(15, 23, 42, 0.22);
  padding: 20px 18px 16px;
}

.donateDialogTitle {
  margin: 0;
  text-align: center;
  font-size: 20px;
  line-height: 1.15;
  color: #0f172a;
  font-weight: 800;
}

.donateDialogText {
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  color: #475569;
}

#donateDialogAmount {
  margin-top: 14px;
  height: 42px;
  border-radius: 12px;
  border-color: #d5dcf3;
  text-align: center;
  font-size: 15px;
}

.donateDialogActions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.donateDialogActions.single {
  grid-template-columns: 1fr;
}

.donateDialogHistory {
  margin-top: 14px;
  max-height: min(320px, 52vh);
  overflow: auto;
  border: 1px solid #dbe2ef;
  border-radius: 14px;
  background: #ffffff;
  padding: 8px;
}

.donateDialogHistoryLoading,
.donateDialogHistoryEmpty {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.donateHistoryRow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
}

.donateHistoryRow + .donateHistoryRow {
  border-top: 1px solid #eef2ff;
}

.donateHistoryAvatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
  flex: 0 0 36px;
}

.donateHistoryMeta {
  min-width: 0;
  flex: 1;
}

.donateHistorySender {
  font-size: 14px;
  line-height: 1.15;
  font-weight: 700;
  color: #0f172a;
}

.donateHistorySubline {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.donateHistoryHandle,
.donateHistoryDate {
  font-size: 12px;
  line-height: 1.2;
  color: #94a3b8;
}

.donateHistoryAmount {
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  color: #4f39f5;
}

.donateDialogButton {
  min-height: 42px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.donateDialogButton.cancel {
  background: #ffffff;
  color: #334155;
  border: 1px solid #dbe2ef;
}

.donateDialogButton.send {
  background: #4f39f5;
  color: #ffffff;
  border: 1px solid #4f39f5;
}

body.donateDialogOpen {
  overflow: hidden;
}

.telegramImportDialog {
  position: fixed;
  inset: 0;
  z-index: 166;
  background: rgba(15, 23, 42, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.telegramImportDialogCard {
  width: min(380px, 92vw);
  border-radius: 24px;
  border: 1px solid #d6ddeb;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 26px 52px rgba(15, 23, 42, 0.22);
  padding: 20px 18px 16px;
}

.telegramImportDialogTitle {
  margin: 0;
  text-align: center;
  font-size: 20px;
  line-height: 1.15;
  color: #0f172a;
  font-weight: 800;
}

.telegramImportDialogText {
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  color: #475569;
}

.telegramImportField {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
}

.telegramImportField span {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
  color: #334155;
}

#telegramImportSource,
#telegramImportLimit {
  height: 44px;
  border-radius: 12px;
  border: 1px solid #d5dcf3;
  background: #ffffff;
  font-size: 15px;
  color: #0f172a;
  padding: 0 14px;
}

#telegramImportSource:focus,
#telegramImportLimit:focus {
  border-color: #6d5efc;
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.12);
  outline: none;
}

.telegramImportDialogActions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.telegramImportDialogButton {
  min-height: 42px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.telegramImportDialogButton.cancel {
  background: #ffffff;
  color: #334155;
  border: 1px solid #dbe2ef;
}

.telegramImportDialogButton.submit {
  background: #4f39f5;
  color: #ffffff;
  border: 1px solid #4f39f5;
}

body.telegramImportDialogOpen {
  overflow: hidden;
}

.messageJump {
  background: #f3efff;
  box-shadow: 0 0 0 2px #cfc4ff inset, 0 10px 28px rgba(111, 76, 255, 0.14);
  outline: 2px solid #d8ccff;
  outline-offset: 2px;
  animation: jumpFlash 1.8s ease;
}

.messageJump.mine,
.message.directMessage.mine.messageJump,
.message.communityMessage.mine.messageJump {
  background: #ebe4ff;
}

.message.withAvatar.messageJump::before,
.message.withAvatar.mine.messageJump::after {
  box-shadow: 0 0 0 3px #e2d9ff;
}

@keyframes jumpFlash {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(111, 76, 255, 0);
  }

  20% {
    transform: scale(1.018);
    box-shadow: 0 0 0 2px #cfc4ff inset, 0 0 0 8px rgba(216, 204, 255, 0.42), 0 14px 34px rgba(111, 76, 255, 0.18);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 2px #cfc4ff inset, 0 10px 28px rgba(111, 76, 255, 0.14);
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    z-index: 50;
    border-right: 1px solid #dbe4f0;
    border-bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  }

  #chatsList .chatListItem {
    padding: 10px 8px;
  }

  #chatsList .chatListAvatar {
    width: 52px;
    min-width: 52px;
    height: 52px;
    font-size: 20px;
  }

  #chatsList .chatListTitle {
    font-size: 17px;
  }

  #chatsList .chatListPreview {
    font-size: 13px;
  }

  #friendsList .friendListItem {
    padding: 10px 0;
  }

  .contactsAvatar {
    width: 48px;
    min-width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .friendListName {
    font-size: 15px;
  }

  .friendListStatus {
    font-size: 11px;
  }

  .friendRemoveButton {
    padding: 5px 9px;
    font-size: 11px;
  }

  .accountHeroBanner {
    height: 94px;
    border-radius: 20px;
    border: 1px solid #e6ebf4;
  }

  .accountHeroBanner svg {
    width: 150px;
    height: 150px;
    transform: translate(-50%, -43%) rotate(-13deg);
  }

  .accountAvatar {
    width: 72px;
    min-width: 72px;
    height: 72px;
    font-size: 29px;
  }

  #sidebarPaneProfile {
    overflow: hidden;
  }

  .profileMainView {
    overflow: hidden;
    gap: 0;
  }

  .accountHero {
    flex-shrink: 0;
    z-index: 6;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .accountIdentityRow {
    margin-top: -34px;
    padding: 0 14px 10px;
  }

  .accountMenuList {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 8px;
    padding-top: 0;
    position: relative;
    z-index: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .accountMenuList::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .accountIdentityName {
    font-size: 28px;
  }

  .accountIdentityHandle {
    font-size: 14px;
  }

  .accountBalanceCard {
    min-height: 30px;
  }

  .accountBalanceValue {
    font-size: 11px;
  }

  .accountMenuRow {
    min-height: 52px;
  }

  .accountMenuText {
    font-size: 14px;
  }

  .accountMenuCount {
    font-size: 14px;
  }

  #sidebarPaneProfile .dot {
    font-size: 13px;
  }

  .profileSubpageTitle {
    font-size: 20px;
  }

  .profileEditForm {
    gap: 12px;
  }

  .profileEditCover {
    height: 132px;
  }

  .profileEditCover > i {
    width: 150px;
    height: 150px;
  }

  .profileEditAvatar {
    width: 90px;
    min-width: 90px;
    height: 90px;
    font-size: 34px;
  }

  .profileEditCoverCamera,
  .profileEditAvatarCamera {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }

  .profileEditAvatarCamera {
    left: calc(50% + 28px);
  }

  .profileEditField > input,
  .profileEditField > textarea {
    font-size: 15px;
  }

  .profileEditInterestsList {
    grid-template-columns: 1fr;
    max-height: 170px;
  }

  .profileEditSaveButton {
    min-height: 48px;
    font-size: 11px;
  }

  .telegramConnectCard {
    padding: 4px 0 0;
  }

  .contactsAddList .contactsAddItem {
    padding: 9px 6px;
  }

  .sidebarBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    z-index: 40;
    transition: opacity 0.2s ease;
  }

  .mobileMenuButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* .chat height managed via JS/shell */

  .imageViewer {
    padding: 14px;
  }

  .imageViewerClose {
    top: -10px;
    right: -10px;
  }

  .videoViewer {
    padding: 10px;
  }

  .videoViewerCard {
    width: 100%;
    max-height: calc(100dvh - 20px);
    gap: 10px;
  }

  .videoViewerVideo {
    width: 100%;
    max-height: calc(100dvh - 136px);
    border-radius: 10px;
  }

  .videoViewerClose {
    top: -8px;
    right: -8px;
    width: 34px;
    height: 34px;
  }

  .videoViewerActionButton {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .chatHeader {
    padding: 12px 14px;
  }

  .pinnedBar {
    padding: 8px 14px;
  }

  .chatHeaderAvatar {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }

  .chatActionsButton {
    width: 34px;
    min-width: 34px;
    height: 34px;
    font-size: 22px;
  }

  .chatActionsMenu {
    min-width: 210px;
  }

  .messages.chatInfoMode {
    padding: 10px 10px 14px;
  }

  .chatInfoAvatar {
    width: 84px;
    height: 84px;
    font-size: 22px;
  }

  .chatInfoTitle {
    font-size: 18px;
  }

  .chatInfoCounter {
    font-size: 12px;
  }

  .chatInfoAboutCard {
    margin-top: 12px;
    padding: 10px;
    border-radius: 12px;
  }

  .chatInfoAboutText {
    font-size: 12px;
  }

  .chatInfoInterestPill {
    min-width: 0;
    width: 100%;
    padding: 8px 10px;
  }

  .chatInfoActionGrid {
    gap: 8px;
  }

  .chatInfoActionButton {
    min-height: 62px;
    font-size: 12px;
    padding: 10px 8px;
    gap: 5px;
  }

  .chatInfoActionButton svg {
    width: 17px;
    height: 17px;
  }

  .chatInfoModerationCard {
    margin-top: 12px;
    border-radius: 14px;
  }

  .chatInfoModerationRow {
    padding: 12px 12px;
    gap: 10px;
  }

  .chatInfoModerationIcon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .chatInfoModerationIcon svg {
    width: 16px;
    height: 16px;
  }

  .chatInfoModerationLabel {
    font-size: 16px;
  }

  .chatInfoModerationMeta {
    font-size: 15px;
  }

  .chatInfoMemberRow {
    gap: 10px;
    padding: 14px 0;
  }

  .chatInfoMemberAvatar {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .chatInfoMemberName {
    font-size: 16px;
  }

  .chatInfoRemoveButton {
    padding: 7px 10px;
  }

  .messageMenu {
    gap: 6px;
  }

  .messageMenuActions {
    width: min(210px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
  }

  .menuReactions {
    gap: 5px;
    padding: 6px 8px;
  }

  .menuReactions .menuReactionButton {
    width: 34px;
    height: 34px;
    font-size: 21px;
  }

  .messageMenu button {
    padding: 10px 12px;
    font-size: 15px;
  }

  .chatListControls {
    gap: 8px;
  }

  .discoverToggleButton {
    min-height: 40px;
    font-size: 14px;
  }

  .iconButton.createGroupIconButton {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .voiceRecordPanel {
    grid-column: 1 / 4;
    padding: 0 8px;
    gap: 7px;
  }

  .voiceRecordWave {
    gap: 2px;
  }

  .voiceRecordWave .voiceWaveBar {
    width: 2px;
  }

  .message.voiceMessage {
    min-width: min(185px, 72vw);
    max-width: min(250px, 78vw);
    padding: 7px 8px 6px;
  }

  .voicePlayer {
    min-width: 0;
    gap: 6px;
  }

  .voicePlayerToggle {
    width: 36px;
    height: 36px;
  }

  .voicePlayerToggle svg {
    width: 16px;
    height: 16px;
  }

  .voicePlayerWaveBars {
    gap: 2px;
  }

  .voiceWaveBar {
    width: 2px;
  }

  .voicePlayerAction {
    width: 32px;
    height: 32px;
    border-radius: 11px;
  }

  .voicePlayerAction svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
  }

  .voicePlayerMute svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.8;
  }

  .voicePlayerSpeed {
    min-width: 32px;
    width: 32px;
    padding: 0;
    font-size: 12px;
    line-height: 1;
  }

  .voicePlayerTime {
    font-size: 10px;
  }

  .createChatMenu {
    min-width: min(290px, calc(100vw - 34px));
    right: -4px;
  }

  .createChatMenu button {
    font-size: 14px;
    padding: 9px 10px;
  }

  .createChatWorkspace {
    padding: 12px;
  }

  .createChatWorkspaceInner {
    width: 100%;
  }

  .createChatForm {
    padding: 0;
  }

  .createTitleRow {
    min-height: 70px;
    border-radius: 18px;
    padding: 9px 12px;
    gap: 10px;
  }

  .createAvatarTrigger {
    width: 48px;
    min-width: 48px;
    height: 48px;
  }

  .createAvatarCamera svg {
    width: 18px;
    height: 18px;
  }

  .createTitleInput {
    font-size: 15px;
  }

  .createMembersSearchInput {
    min-height: 42px;
    font-size: 14px;
  }

  .createChatTextarea {
    min-height: 52px;
  }

  .createChatTextarea.createDescriptionInput {
    min-height: 52px;
    border-radius: 16px;
    font-size: 14px;
  }

  .avatarHeader {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .messages {
    padding: 14px;
  }

  .discoverPane {
    padding: 0 12px 12px;
    overflow-y: auto;
  }

  .discoverLayout {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .discoverFeed {
    order: 1;
    display: contents;
  }

  .discoverSectionHead {
    order: 1;
    position: sticky;
    top: 0;
    z-index: 16;
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    backdrop-filter: blur(14px) saturate(145%);
    padding: 6px 2px 10px;
    margin: 0 -2px 2px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  }

  .discoverTrends {
    order: 2;
    width: 100%;
    align-self: stretch;
    max-height: none;
  }

  .discoverTrendList {
    overflow: visible;
    max-height: none;
  }

  .discoverFeedList {
    order: 3;
    min-height: auto;
    overflow: visible;
    padding: 0;
  }

  .discoverCard {
    padding: 18px 10px;
  }

  .discoverFeedTabs {
    width: calc(100% - 52px);
    justify-content: space-between;
  }

  .discoverFeedTab {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 13px;
  }

  .discoverTrends h3 {
    font-size: 22px;
  }

  .discoverTrendAvatar {
    width: 48px;
    min-width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .discoverTrendFollowButton {
    min-width: 88px;
    padding: 8px 15px;
    font-size: 13px;
  }

  .message.emojiOnlyMessage .messageText {
    font-size: 52px;
  }

  .message.emojiOnlyMessage .messageText.emojiCount2 {
    font-size: 42px;
  }

  .message.emojiOnlyMessage .messageText.emojiCount3 {
    font-size: 34px;
  }

  .messageImage {
    max-width: min(75vw, 320px);
    max-height: 320px;
  }

  .message.mediaMessage {
    max-width: min(320px, 82vw);
    width: fit-content;
  }

  .message.mediaMessage .messageImage,
  .message.mediaMessage .messageVideo,
  .message.mediaMessage .messageImageCaption {
    max-width: 100%;
  }

  .message.mediaMessageCaptioned {
    width: fit-content;
    max-width: min(320px, 82vw);
  }

  .message.mediaGroupMessage {
    max-width: min(340px, 86vw);
  }

  .messageMediaGroupSingle,
  .messageMediaGroupMosaic {
    width: min(320px, 82vw);
  }

  .messageUploadProgressLabel {
    left: 8px;
    top: 8px;
    padding: 5px 9px;
    font-size: 12px;
  }

  .messageUploadSpinner {
    width: 44px;
    height: 44px;
    margin-left: -22px;
    margin-top: -22px;
  }

  .messageLinkPreview {
    max-width: min(78vw, 340px);
  }

  .messageLinkPreview.media {
    max-width: min(86vw, 420px);
  }

  .messageLinkPreviewImage {
    width: 64px;
    min-width: 64px;
    height: 64px;
  }

  .messageLinkPreviewPlayBadge {
    width: 56px;
    height: 38px;
    margin-left: -28px;
    margin-top: -19px;
  }

  .messageLinkPreviewPlayTriangle {
    border-top-width: 8px;
    border-bottom-width: 8px;
    border-left-width: 13px;
  }

  .message.withAvatar {
    margin-left: 0;
  }

  .message.withAvatar::before {
    display: none;
  }

  .message.withAvatar.mine {
    margin-left: 0;
    margin-right: 0;
  }

  .message.withAvatar.mine::after {
    display: none;
  }

  .messageSelectionControl {
    left: -38px;
    top: 10px;
  }

  .messageSelectionCircle {
    width: 24px;
    height: 24px;
  }

  .mediaComposer {
    padding: 10px;
  }

  .mediaComposerCard {
    width: min(100vw, 520px);
    max-height: calc(100dvh - 20px);
    border-radius: 20px;
  }

  .mediaComposerHeader {
    padding: 10px 12px 8px;
  }

  .mediaComposerTitle {
    font-size: 22px;
  }

  .mediaComposerPreview {
    width: calc(100% - 18px);
    margin: 0 9px;
  }

  .mediaComposerImage {
    width: 100%;
    border-radius: 14px;
    max-height: min(64vh, 520px);
  }

  .mediaComposerVideo {
    max-height: min(64vh, 520px);
    border-radius: 14px;
  }

  .mediaComposerProgress {
    left: 9px;
    top: 9px;
    border-radius: 11px;
    padding: 7px 9px;
    min-width: 150px;
  }

  .mediaComposerProgressText {
    font-size: 13px;
  }

  .mediaComposerThumbs {
    gap: 6px;
    padding: 8px 10px 2px;
  }

  .mediaComposerThumbItem {
    width: 68px;
    min-width: 68px;
    height: 68px;
    border-radius: 12px;
  }

  .mediaComposerThumbVideoBadge {
    left: 4px;
    bottom: 4px;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    padding: 0 5px;
  }

  .mediaComposerThumbRemove {
    right: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    font-size: 12px;
  }

  .mediaComposerFooter {
    padding: 10px 10px 12px;
  }

  .mediaComposerCaption {
    font-size: 17px;
    padding: 12px 16px;
  }

  .mediaComposerSend {
    width: 50px;
    min-width: 50px;
    height: 50px;
  }

  .messageDeleteConfirm {
    padding: 12px;
  }

  .messageDeleteConfirmCard {
    width: min(360px, 94vw);
    border-radius: 16px;
    padding: 14px 12px 12px;
  }

  .messageDeleteConfirmTitle {
    font-size: 16px;
  }

  .messageDeleteConfirmText {
    margin-top: 8px;
    font-size: 14px;
  }

  .messageDeleteConfirmActions {
    margin-top: 12px;
    gap: 8px;
  }

  .messageDeleteConfirmButton {
    min-height: 42px;
    font-size: 14px;
  }

  .systemDialog {
    padding: 12px;
  }

  .systemDialogCard {
    width: min(340px, 94vw);
    border-radius: 14px;
    padding: 12px;
  }

  .systemDialogTitle {
    font-size: 16px;
  }

  .systemDialogText {
    margin-top: 8px;
    font-size: 13px;
  }

  .systemDialogInput {
    min-height: 72px;
    font-size: 13px;
    padding: 9px 10px;
  }

  .systemDialogActions {
    margin-top: 12px;
    gap: 8px;
  }

  .systemDialogButton {
    min-height: 40px;
    font-size: 13px;
  }

  .typing {
    padding: 0 14px;
  }

  .composer {
    padding: 10px;
    grid-template-columns: auto 1fr auto auto;
  }

  .messageSelectionBar {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }

  .messageSelectionAction {
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  .messageSelectionCount {
    font-size: 14px;
  }

  .emojiPicker {
    left: 10px;
    width: min(340px, calc(100vw - 20px));
  }

  .scrollToBottomButton {
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebarBackdrop {
    opacity: 0;
    pointer-events: none;
  }

  body.auth-mode .chat {
    display: none;
  }

  body.auth-mode .sidebar {
    width: 100vw;
    max-width: none;
    transform: translateX(0);
    box-shadow: none;
  }

  body.auth-mode .sidebarBackdrop {
    opacity: 0;
    pointer-events: none;
  }

  html.has-token body.auth-mode #authPanel {
    display: none;
  }

  html.has-token body.auth-mode #appPanel {
    display: flex;
  }
}


/* =========================================================
   UNIVERSAL MOBILE FIX
   Approach: .shell { position: fixed } + visualViewport JS
   This is the correct approach used by Telegram, WhatsApp etc.
   Works on:
   - iOS Safari browser (URL bar shows/hides)
   - iOS PWA (no URL bar)  
   - Android Chrome browser
   - Android system navigation bar
   ========================================================= */
@media (max-width: 980px) {

  /* html/body: just ensure no rogue scrolling */
  html {
    overflow: hidden;
  }

  body {
    overflow: hidden;
    /* NOT position:fixed - that breaks iOS browser */
  }

  /* Shell: position fixed so JS can set exact visualViewport height.
     When keyboard appears, JS syncs shell height to visualViewport.height
     so header stays at top and composer stays just above keyboard. */
  .shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* Initial height - JS will override synchronously on first paint */
    height: 100dvh;
    height: 100svh;
    /* svh = stable vh (excludes iOS URL bar) on supported browsers */
    min-height: 0;
    overflow: hidden;
    /* grid-template-columns: 1fr already set in existing @media above */
  }

  /* Chat fills the shell completely */
  .chat {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Header and pinned bar must not shrink */
  .chatHeader {
    flex-shrink: 0;
  }

  .pinnedBar {
    flex-shrink: 0;
  }

  /* Messages fill ALL remaining space */
  .messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Composer stays at bottom, accounts for Android nav bar */
  .composer {
    flex-shrink: 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .channelActionBar {
    flex-shrink: 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .typing {
    flex-shrink: 0;
  }

  /* Bottom tabs: add padding for Android system nav bar */
  .sidebarBottomNav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Sidebar fill shell height (sidebar is position:fixed so relative to viewport) */
  .sidebar {
    height: 100svh;
    height: 100dvh;
  }
}

width: 100%;
}
