.menu-messenger {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  color: #d4d4d4 !important;
}

.menu-messenger:hover,
.menu-messenger.is-active {
  border-color: rgba(255, 255, 255, 0.22) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.45) !important;
}

.msgr-page {
  padding: 0;
  min-height: 100vh;
  background: #050505;
  overflow-x: hidden;
}

.msgr-standalone-body {
  margin: 0;
  background: #050505;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.msgr-app {
  min-height: 100vh;
  color: #e5e5e5;
  font-family: inherit;
  overflow-x: hidden;
}

.msgr-app button,
.msgr-app input,
.msgr-app textarea,
.msgr-app select {
  font-family: inherit;
}

.msgr-shell {
  display: grid;
  grid-template-columns: 248px 300px minmax(0, 1fr);
  min-height: 100vh;
  background: #050505;
  min-width: 0;
}

.msgr-shell--no-list {
  grid-template-columns: 248px minmax(0, 1fr);
}

.msgr-rail {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background: #0a0a0a;
}

.msgr-rail-head {
  padding: 22px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.msgr-rail-head h2 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fafafa;
}

.msgr-rail-head p {
  margin: 0;
  color: #737373;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-all;
}

.msgr-rail-nav {
  flex: 1;
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 2px;
  align-content: start;
}

.msgr-rail-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #a3a3a3;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.msgr-rail-link:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
  color: #fafafa;
}

.msgr-rail-link.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.msgr-rail-link__label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.msgr-rail-link__icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #a3a3a3;
}

.msgr-rail-link.is-active .msgr-rail-link__icon {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.msgr-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.msgr-badge {
  min-width: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fafafa;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.msgr-rail-foot {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 8px;
}

.msgr-list-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: #080808;
  min-height: 100vh;
}

.msgr-list-panel__head {
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.msgr-list-panel__head h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 650;
}

.msgr-list-panel__head p {
  margin: 0;
  color: #737373;
  font-size: 12px;
}

.msgr-list-panel__body {
  flex: 1;
  overflow: auto;
  padding: 8px;
}

.msgr-chat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.msgr-chat-item:hover,
.msgr-chat-item.is-active {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.msgr-chat-item strong {
  font-size: 13px;
  font-weight: 600;
}

.msgr-chat-item span {
  color: #737373;
  font-size: 12px;
  line-height: 1.4;
}

.msgr-chat-item--saved strong {
  color: #fafafa;
}

.msgr-chat-item__type {
  font-size: 10px;
  color: #525252;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.msgr-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: #050505;
}

.msgr-workspace__head {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #0a0a0a;
}

.msgr-workspace__head h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 650;
}

.msgr-workspace__head p {
  margin: 0;
  color: #737373;
  font-size: 13px;
}

.msgr-workspace__body {
  flex: 1;
  overflow: auto;
  padding: 20px 24px 28px;
  min-width: 0;
}

.msgr-workspace__body--chat {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.msgr-blocks {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.msgr-blocks--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.msgr-block {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #0a0a0a;
  overflow: hidden;
  min-width: 0;
}

.msgr-block--accent {
  border-color: rgba(255, 255, 255, 0.14);
}

.msgr-block--warn {
  border-color: rgba(255, 255, 255, 0.12);
}

.msgr-block__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.msgr-block__head h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 650;
}

.msgr-block__head p {
  margin: 0;
  color: #737373;
  font-size: 12px;
  line-height: 1.5;
}

.msgr-block__body {
  padding: 16px 18px 18px;
  min-width: 0;
  overflow-x: hidden;
}

.msgr-block__body--flush {
  padding: 0;
}

.msgr-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
  padding: 20px 24px;
  overflow: auto;
}

.msgr-msg {
  max-width: min(78%, 560px);
  padding: 11px 14px;
  border-radius: 12px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.msgr-msg--mine {
  align-self: flex-end;
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.14);
}

.msgr-msg time {
  display: block;
  margin-top: 6px;
  color: #525252;
  font-size: 11px;
}

.msgr-compose {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #0a0a0a;
}

.msgr-compose textarea,
.msgr-compose input[type="text"] {
  flex: 1 1 180px;
  min-width: 0;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #262626;
  border-radius: 10px;
  background: #050505;
  color: #f5f5f5;
  font: inherit;
  resize: vertical;
}

.msgr-compose textarea:focus,
.msgr-compose input[type="text"]:focus,
.msgr-field input:focus,
.msgr-field textarea:focus,
.msgr-field select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.msgr-btn {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #111;
  color: #fafafa;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.msgr-btn:hover {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.22);
}

.msgr-btn--primary {
  border-color: rgba(255, 255, 255, 0.22);
  background: #fafafa;
  color: #0a0a0a;
}

.msgr-btn--primary:hover {
  background: #e5e5e5;
  color: #0a0a0a;
}

.msgr-btn--danger {
  border-color: rgba(255, 255, 255, 0.12);
  background: #111;
  color: #a3a3a3;
}

.msgr-btn--danger:hover {
  background: #1a1a1a;
  color: #fafafa;
}

.msgr-btn--ghost {
  background: transparent;
}

.msgr-btn--compact {
  padding: 7px 12px;
  font-size: 12px;
}

.msgr-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.msgr-field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.msgr-field:last-child {
  margin-bottom: 0;
}

.msgr-field label {
  font-size: 12px;
  font-weight: 600;
  color: #d4d4d4;
  letter-spacing: 0.02em;
}

.msgr-field input,
.msgr-field textarea,
.msgr-field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #262626;
  border-radius: 10px;
  background: #050505;
  color: #f5f5f5;
  font: inherit;
  box-sizing: border-box;
}

.msgr-field input[readonly] {
  color: #a3a3a3;
}

.msgr-field small {
  color: #737373;
  font-size: 11px;
  line-height: 1.45;
}

.msgr-field small a {
  color: #a3a3a3;
  text-decoration: none;
}

.msgr-field small a:hover {
  color: #e5e5e5;
}

.msgr-pin-input {
  letter-spacing: 0.35em;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.msgr-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.msgr-row-item:last-child {
  border-bottom: none;
}

.msgr-session-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.msgr-session-item:last-child {
  border-bottom: none;
}

.msgr-session-item strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.msgr-session-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #d4d4d4;
}

.msgr-session-tag.is-current {
  background: rgba(255, 255, 255, 0.1);
}

.msgr-session-tag.is-revoked {
  color: #737373;
  border-color: rgba(255, 255, 255, 0.08);
}

.msgr-id {
  color: #fafafa;
  font-weight: 650;
  word-break: break-all;
}

.msgr-meta {
  color: #737373;
  font-size: 12px;
}

.msgr-error {
  margin: 0;
  color: #fca5a5;
  font-size: 13px;
}

.msgr-success {
  margin: 0;
  color: #d4d4d4;
  font-size: 13px;
}

.msgr-empty {
  color: #737373;
  font-size: 13px;
  line-height: 1.55;
}

.msgr-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.msgr-stat {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: #050505;
}

.msgr-stat span {
  display: block;
  margin-bottom: 4px;
  color: #737373;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.msgr-stat strong {
  font-size: 18px;
}

.msgr-post {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.msgr-post:last-child {
  border-bottom: none;
}

.msgr-post__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #737373;
  font-size: 12px;
}

.msgr-post__text {
  margin: 0 0 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.msgr-comments {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.msgr-comment {
  padding: 10px 12px;
  border-radius: 10px;
  background: #111;
  font-size: 13px;
  line-height: 1.5;
}

.msgr-comment strong {
  color: #fafafa;
}

.msgr-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.msgr-switch {
  position: relative;
  width: 48px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: #171717;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.msgr-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.msgr-switch[aria-checked="true"] {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}

.msgr-switch[aria-checked="true"] span {
  transform: translateX(20px);
}

.msgr-profile-card {
  display: flex;
  gap: 16px;
  align-items: center;
}

.msgr-profile-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #262626, #171717);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fafafa;
  font-size: 22px;
  font-weight: 700;
}

.msgr-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 650;
  color: #a3a3a3;
}

.msgr-status-pill.is-on {
  color: #fafafa;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.msgr-totp-qr {
  display: block;
  width: min(160px, 100%);
  height: auto;
  aspect-ratio: 1;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
}

.msgr-totp-secret {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  background: #050505;
  border: 1px solid #262626;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  word-break: break-all;
  overflow-wrap: anywhere;
  color: #d4d4d4;
}

.msgr-auth,
.msgr-blocked {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  background: #050505;
}

.msgr-auth-card,
.msgr-blocked-card {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: #0a0a0a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.msgr-auth-card h2,
.msgr-blocked-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
}

.msgr-auth-card p,
.msgr-blocked-card p {
  margin: 0 0 18px;
  color: #737373;
  line-height: 1.6;
  font-size: 14px;
}

.msgr-auth-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.msgr-auth-step {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #050505;
  color: #525252;
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.msgr-auth-step.is-done {
  color: #a3a3a3;
}

.msgr-auth-step.is-active {
  color: #fafafa;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.msgr-blocked-card {
  border-color: rgba(255, 255, 255, 0.14);
}

.msgr-auth-switch {
  margin-top: 12px;
  padding: 0;
  border: none;
  background: none;
  color: #737373;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.msgr-auth-switch:hover {
  color: #fafafa;
}

.msgr-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: #737373;
  background: #050505;
}

@media (max-width: 1100px) {
  .msgr-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .msgr-shell:not(.msgr-shell--no-list) {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .msgr-shell--list-only {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .msgr-shell--list-only .msgr-workspace {
    display: none;
  }

  .msgr-shell--chat-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .msgr-shell--chat-open .msgr-rail,
  .msgr-shell--chat-open .msgr-list-panel {
    display: none;
  }

  .msgr-shell--chat-open .msgr-workspace {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 52px);
  }

  .msgr-chat-back {
    flex-shrink: 0;
    margin-right: 8px;
  }

  .msgr-chat-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }

  .msgr-blocks--two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .msgr-app,
  .msgr-shell,
  .msgr-shell--no-list {
    min-height: 100dvh;
  }

  .msgr-topbar {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 10px;
  }

  .msgr-shell,
  .msgr-shell--no-list {
    grid-template-columns: 1fr;
  }

  .msgr-shell--list-only .msgr-rail {
    display: flex;
  }

  .msgr-shell--list-only .msgr-list-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    max-height: none;
    order: 1;
  }

  .msgr-shell--list-only {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 52px);
  }

  .msgr-shell--list-only .msgr-rail {
    order: 2;
    flex-shrink: 0;
  }

  .msgr-rail-head--vk {
    padding: 14px 12px 10px;
  }

  .msgr-rail {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .msgr-rail-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .msgr-rail-foot {
    display: none;
  }

  .msgr-list-panel {
    max-height: none;
    min-height: 0;
    flex: 1;
  }

  .msgr-workspace {
    min-height: 0;
  }

  .msgr-compose {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .msgr-stat-grid {
    grid-template-columns: 1fr;
  }

  .msgr-profile-hero__body {
    grid-template-columns: 1fr;
  }

  .msgr-profile-hero__form {
    padding-top: 0;
  }
}

/* --- Extended messenger UI (profile, chat, presence, topbar) --- */

.msgr-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #0a0a0a;
}

.msgr-back-btn {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d4;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.msgr-topbar-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fafafa;
}

.msgr-topbar-settings {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.msgr-topbar .lang-picker--fab-inline {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}

@media (max-width: 720px) {
  .msgr-topbar {
    flex-wrap: nowrap;
    align-items: center;
  }

  .msgr-topbar-settings {
    margin-left: auto;
    flex-shrink: 0;
  }

  .msgr-topbar .lang-picker--fab-inline {
    position: relative;
    top: auto;
    right: auto;
  }
}

.msgr-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
}

.msgr-transition.is-active {
  display: flex;
}

.msgr-transition__panel {
  text-align: center;
  color: #a3a3a3;
}

.msgr-transition__spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: #fafafa;
  border-radius: 50%;
  animation: msgr-spin 0.8s linear infinite;
}

@keyframes msgr-spin {
  to {
    transform: rotate(360deg);
  }
}

.msgr-rail-head--vk {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.msgr-rail-head__avatar {
  position: relative;
  flex-shrink: 0;
}

.msgr-avatar-wrap {
  position: relative;
  display: inline-flex;
}

.msgr-avatar-wrap--presence .msgr-avatar {
  position: relative;
}

.msgr-presence-dot-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}

.msgr-presence-dot-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.msgr-rail-head__avatar .msgr-presence-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 160px;
}

.msgr-rail-head__info {
  min-width: 0;
  flex: 1;
}

.msgr-rail-head__name {
  color: #fafafa !important;
  font-size: 13px !important;
  font-weight: 650;
}

.msgr-rail-head__id {
  margin-top: 2px !important;
}

.msgr-rail-head__info .msgr-presence {
  margin-top: 6px;
  font-size: 11px;
}

.msgr-rail-presence {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 11px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.msgr-rail-presence:hover {
  opacity: 0.82;
}

.msgr-profile-edit {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.msgr-profile-edit__avatar {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.msgr-profile-edit__avatar-actions {
  display: grid;
  gap: 8px;
  width: 100%;
}

.msgr-profile-edit__form {
  min-width: 0;
}

@media (max-width: 720px) {
  .msgr-topbar {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 12px 10px;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  .msgr-back-btn {
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 12px;
  }

  .msgr-topbar-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .msgr-topbar-settings {
    margin-left: auto;
    flex-shrink: 0;
  }

  .msgr-topbar .lang-picker--fab-inline {
    position: relative;
    top: auto;
    right: auto;
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .msgr-rail-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .msgr-rail-link {
    font-size: 11px;
    padding: 8px 4px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
  }

  .msgr-rail-link__label {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    line-height: 1.2;
  }

  .msgr-rail-link__icon {
    font-size: 18px;
    line-height: 1;
  }

  .msgr-workspace__head h3 {
    font-size: 16px;
  }

  .msgr-auth-card {
    padding: 18px 14px;
  }

  .msgr-modal__panel,
  .msgr-blocked-card {
    width: min(100%, calc(100vw - 16px));
    margin: 8px;
  }
}

@media (max-width: 720px) {
  .msgr-profile-edit {
    grid-template-columns: 1fr;
  }
}

.msgr-chat-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0 12px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.msgr-chat-search input {
  width: 100%;
  border: none;
  background: transparent;
  color: #f5f5f5;
  font: inherit;
  outline: none;
}

.msgr-chat-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.msgr-chat-item__body {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.msgr-chat-item__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.msgr-chat-item__top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msgr-chat-item__preview {
  color: #737373;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msgr-search-form {
  display: grid;
  gap: 12px;
}

.msgr-search-form__field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.msgr-search-form__field input {
  width: 100%;
  border: none;
  background: transparent;
  color: #f5f5f5;
  font: inherit;
  outline: none;
}

.msgr-search-results {
  margin-top: 14px;
}

.msgr-row-item--vk {
  align-items: flex-start;
  flex-wrap: wrap;
}

.msgr-row-item__main {
  min-width: 0;
  flex: 1;
}

.msgr-notify-item {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.msgr-notify-item--unread {
  background: rgba(255, 255, 255, 0.03);
}

.msgr-notify-item__body {
  min-width: 0;
  flex: 1;
}

.msgr-auth-form {
  display: grid;
  gap: 12px;
}

.msgr-auth-form .msgr-field {
  margin-bottom: 0;
}

.msgr-auth-form .msgr-auth-note,
.msgr-auth-form .msgr-error {
  margin: 0;
}

.msgr-auth-note {
  margin: 0 0 12px;
  color: #737373;
  font-size: 12px;
  line-height: 1.5;
}

.msgr-auth-submit {
  width: 100%;
}

.msgr-auth-nav {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.msgr-auth-nav__btn {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d4;
  font: inherit;
  cursor: pointer;
}

.msgr-recovery-stack {
  display: grid;
  gap: 14px;
}

.msgr-recovery-stack .msgr-seed-vault {
  margin-bottom: 0;
}

.msgr-seed-warn {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #a3a3a3;
  font-size: 13px;
  line-height: 1.5;
}

.msgr-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  user-select: none;
}

.msgr-check:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.msgr-check__input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: #0a0a0a;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.msgr-check__input:checked {
  border-color: #fafafa;
  background-color: #fafafa;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23050505' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 6l3 3 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

.msgr-check__input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(250, 250, 250, 0.14);
}

.msgr-check__text {
  color: #d4d4d4;
  font-size: 13px;
  line-height: 1.4;
}

.msgr-denied-badge {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fafafa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.msgr-denied-actions,
.msgr-denied-foot {
  margin-top: 14px;
}

.msgr-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(145deg, #262626, #171717);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fafafa;
  font-weight: 700;
  flex-shrink: 0;
}

.msgr-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msgr-avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.msgr-avatar--md {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.msgr-avatar--xl {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  font-size: 28px;
  border: 3px solid #0a0a0a;
}

.msgr-avatar--rail {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 18px;
}

.msgr-avatar--group {
  background: #171717;
}

.msgr-avatar--presence-online::after,
.msgr-avatar--presence-away::after,
.msgr-avatar--presence-busy::after,
.msgr-avatar--presence-invisible::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border: 2px solid #0a0a0a;
  border-radius: 999px;
}

.msgr-avatar--presence-online::after {
  background: #39d98a;
  box-shadow: 0 0 8px rgba(57, 217, 138, 0.55);
}

.msgr-avatar--presence-away::after {
  background: #f5c518;
  box-shadow: 0 0 8px rgba(245, 197, 24, 0.45);
}

.msgr-avatar--presence-busy::after {
  background: #ff4d4d;
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.45);
}

.msgr-avatar--presence-invisible::after {
  background: #737373;
}

.msgr-presence {
  font-size: 12px;
}

.msgr-presence--online {
  color: #39d98a;
}

.msgr-presence--away {
  color: #f5c518;
}

.msgr-presence--busy {
  color: #ff4d4d;
}

.msgr-presence--invisible {
  color: #737373;
}

.msgr-presence--offline {
  color: #737373;
}

.msgr-profile-layout {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.msgr-profile-hero {
  overflow: hidden;
}

.msgr-profile-cover {
  position: relative;
  min-height: 140px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    #111;
  background-size: cover;
  background-position: center;
}

.msgr-profile-cover__actions {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.msgr-profile-hero__body {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 20px;
  padding: 0 18px 18px;
  margin-top: -36px;
}

.msgr-profile-hero__avatar-col {
  display: grid;
  gap: 14px;
  align-content: start;
}

.msgr-profile-hero__avatar {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.msgr-profile-presence {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.msgr-profile-hero__form {
  padding-top: 42px;
  min-width: 0;
}

.msgr-profile-card {
  flex-wrap: wrap;
}

.msgr-profile-card > div:last-child {
  min-width: 0;
  flex: 1;
}

.msgr-toggle-row {
  flex-wrap: wrap;
}

.msgr-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #0a0a0a;
}

.msgr-chat-head__info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.msgr-chat-head__text {
  min-width: 0;
}

.msgr-chat-head__text strong {
  display: block;
  font-size: 15px;
}

.msgr-chat-head__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.msgr-chat-translate {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.msgr-chat-translate__label {
  color: #737373;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.msgr-chip {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: transparent;
  color: #a3a3a3;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.msgr-chip.is-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.msgr-msg__body {
  position: relative;
  overflow: hidden;
}

.msgr-msg__cipher {
  display: none;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.04em;
  color: #737373;
  word-break: break-word;
}

.msgr-msg__plain {
  word-break: break-word;
}

.msgr-msg__decrypt-bar {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(57, 217, 138, 0.35), rgba(57, 217, 138, 0.65));
  pointer-events: none;
}

.msgr-msg--sealed .msgr-msg__cipher {
  display: block;
}

.msgr-msg--sealed .msgr-msg__plain {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.msgr-msg--decrypting .msgr-msg__decrypt-bar {
  display: block;
  animation: msgr-decrypt-sweep 2s ease-out forwards;
}

.msgr-msg--decrypting .msgr-msg__cipher {
  animation: msgr-decrypt-fade 2s ease-out forwards;
}

.msgr-msg--decrypting .msgr-msg__plain {
  position: static;
  opacity: 1;
}

@keyframes msgr-decrypt-sweep {
  from {
    right: 0;
    width: 100%;
  }
  to {
    right: 100%;
    width: 0;
  }
}

@keyframes msgr-decrypt-fade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.msgr-messages {
  min-height: 0;
}

.msgr-block__head {
  min-width: 0;
}

.msgr-block__head > div:first-child {
  min-width: 0;
}

.msgr-list-panel,
.msgr-rail,
.msgr-workspace {
  min-width: 0;
}

.msgr-id {
  word-break: break-all;
}

.msgr-btn {
  flex-shrink: 0;
}

.msgr-badge--accent {
  background: rgba(57, 217, 138, 0.18);
  color: #39d98a;
}

.msgr-wall-card {
  overflow: hidden;
}

.msgr-profile-cover--wall {
  min-height: 120px;
}

.msgr-profile-card--wall {
  padding: 0 18px 18px;
  margin-top: -32px;
  align-items: flex-end;
}

.msgr-standalone-body .msgr-shell {
  background: transparent;
}

.msgr-standalone-body .msgr-rail {
  background: rgba(10, 10, 10, 0.74);
}

.msgr-standalone-body .msgr-list-panel {
  background: rgba(8, 8, 8, 0.78);
}

.msgr-standalone-body .msgr-workspace {
  background: rgba(5, 5, 5, 0.84);
}

.msgr-standalone-body .msgr-workspace__body--chat {
  background: #050505;
}

.msgr-standalone-body .msgr-chat-head,
.msgr-standalone-body .msgr-messages,
.msgr-standalone-body .msgr-compose {
  background: #050505;
}

.msgr-standalone-body {
  position: relative;
}

.msgr-standalone-body .cosmos-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #000;
}

.msgr-standalone-body .cosmos-stars {
  position: absolute;
  inset: 0;
}

.msgr-standalone-body .cosmos-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.msgr-standalone-body .msgr-topbar,
.msgr-standalone-body .msgr-app,
.msgr-standalone-body .msgr-profile-shell {
  position: relative;
  z-index: 1;
}

.msgr-standalone-body .msgr-topbar {
  background: rgba(10, 10, 10, 0.72);
}

body.msgr-hide-cosmos .cosmos-bg {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
}

.msgr-rail-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 12px 0;
}

.msgr-rail-search input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #262626;
  border-radius: 12px;
  background: #050505;
  color: #f5f5f5;
}

.msgr-presence-menu[hidden] {
  display: none !important;
}

.msgr-presence-menu {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #262626;
  border-radius: 12px;
  background: rgba(8, 8, 8, 0.96);
}

.msgr-presence-menu__item {
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #d4d4d4;
  text-align: left;
  cursor: pointer;
}

.msgr-presence-menu__item:hover,
.msgr-presence-menu__item.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.msgr-avatar-link {
  display: inline-flex;
  text-decoration: none;
  color: inherit;
}

.msgr-chat-head__link {
  color: inherit;
  text-decoration: none;
}

.msgr-chat-head__link:hover {
  color: #fff;
}

.msgr-profile-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.msgr-profile-card--page {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid #262626;
  border-radius: 18px;
  background: rgba(8, 8, 8, 0.72);
}

.msgr-profile-card__body h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.msgr-profile-card__id {
  margin: 0 0 8px;
  color: #737373;
  font-size: 13px;
}

.msgr-profile-card__bio {
  margin: 12px 0 0;
  color: #a3a3a3;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .msgr-profile-shell {
    padding: calc(12px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }

  .msgr-profile-card--page {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 14px;
  }

  .msgr-profile-card__body h1 {
    font-size: 20px;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  .msgr-shell--list-only {
    min-height: calc(100dvh - 48px);
  }

  .msgr-shell--chat-open .msgr-workspace {
    min-height: calc(100dvh - 48px);
  }
}
