html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: #eef2f5;
  color: #1f2937;
  height: 100%;
}

body {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.muted {
  color: #6b7280;
}

.small {
  font-size: 12px;
}



.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(0,0,0,.08);
  padding: 28px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.auth-brand__logo {
  width: 52px;
  height: 52px;
  min-width: 52px;
  object-fit: contain;
  display: block;
}

.auth-brand__title {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  color: #1f2937;
}

@media (max-width: 480px) {
  .auth-brand {
    gap: 10px;
  }

  .auth-brand__logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .auth-brand__title {
    font-size: 24px;
  }
}

.form-row {
  margin-top: 14px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

input, textarea, select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d8dde3;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

textarea {
  resize: none;
  min-height: 72px;
}

html {
  -webkit-text-size-adjust: 100%;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary {
  background: #3390ec;
  color: #fff;
}

.btn-light {
  background: #f3f4f6;
  color: #111827;
}

.message {
  margin-top: 14px;
  min-height: 18px;
  font-size: 14px;
}


.layout {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 360px;
  min-width: 320px;
  max-width: 420px;
  background: #fff;
  border-right: 1px solid #dde3e8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-top {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid #eef2f5;
}

.brand {
  font-size: 18px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tabs {
  display: flex;
  padding: 12px 16px 8px;
  gap: 8px;
}

.tab {
  flex: 1;
  background: #f3f4f6;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.tab.is-active {
  background: #dbeafe;
  color: #1d4ed8;
}

.tab.tab--icon {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tab.tab--notifications .bi {
  color: #9ca3af;
}

.tab.tab--notifications.has-unread .bi {
  color: #1d4ed8;
}

.notifications-pane {
  padding-top: 4px;
}

.notifications-empty {
  margin: 6px 8px;
}

.notifications-hint {
  margin: 6px 8px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.4;
}

/* TALK_NOTIFICATIONS_MODERN_SOFT_SURFACE_V1_START */
.notification-card {
  position: relative;
  display: block;
  margin: 8px;
  padding: 15px 16px 14px;
  border:
    1px solid rgba(203, 213, 225, .68);
  border-radius: 16px;
  background: rgba(252, 253, 254, .94);
  box-shadow:
    0 2px 8px rgba(15, 23, 42, .035);
  color: #475569;
  cursor: pointer;
  opacity: 1;
  transform: none;
  transition:
    background-color .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.notification-card.has-avatar {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.notification-card:hover {
  opacity: 1;
  border-color: rgba(148, 163, 184, .56);
  background: #ffffff;
  box-shadow:
    0 5px 16px rgba(15, 23, 42, .05);
  transform: none;
}

.notification-card.is-unread {
  border-color: rgba(96, 165, 250, .38);
  background:
    linear-gradient(
      145deg,
      rgba(249, 252, 255, .98) 0%,
      rgba(244, 248, 253, .96) 100%
    );
  box-shadow:
    0 2px 8px rgba(37, 99, 235, .035);
}

.notification-card.is-unread:hover {
  border-color: rgba(59, 130, 246, .46);
  background:
    linear-gradient(
      145deg,
      #fbfdff 0%,
      #f2f7fc 100%
    );
  box-shadow:
    0 5px 17px rgba(37, 99, 235, .055);
}

.notification-card__avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  box-shadow: none;
  opacity: 1;
  filter: none;
}

.notification-card__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notification-card:not(.is-unread)
.notification-card__avatar {
  opacity: 1;
  filter: none;
}

.notification-card__content {
  position: relative;
  min-width: 0;
}

.notification-card.is-unread
.notification-card__content::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 34px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #2583e3;
  box-shadow:
    0 0 0 2px rgba(37, 131, 227, .08);
}

.notification-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notification-card__title {
  min-width: 0;
  color: #4f5f73;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -.012em;
  overflow-wrap: anywhere;
}

.notification-card.is-unread
.notification-card__title {
  color: #182433;
  font-weight: 700;
}

.notification-card__delete {
  width: 28px;
  height: 28px;
  min-width: 28px;
  margin: -6px -7px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a1acb8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: none;
  transition:
    color .14s ease,
    background-color .14s ease;
}

.notification-card__delete:hover {
  color: #526174;
  background: rgba(226, 232, 240, .68);
  box-shadow: none;
}

.notification-card__delete .bi {
  font-size: 12px;
  line-height: 1;
}

.notification-card__text {
  margin-top: 6px;
  color: #6c7a8b;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.52;
  overflow-wrap: anywhere;
}

.notification-card.is-unread
.notification-card__text {
  color: #43566c;
}

.notification-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: #95a1af;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.35;
}

.notification-card.is-unread
.notification-card__meta {
  color: #74869a;
}

.notification-card__meta-divider {
  color: #c3ccd6;
}

.notification-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 12px 8px;
  color: #8b98a8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  user-select: none;
  pointer-events: none;
}

.notifications-toolbar
+ .notification-section-divider {
  margin-top: 10px;
}

.notification-section-divider::before,
.notification-section-divider::after {
  content: '';
  height: 1px;
  flex: 1 1 auto;
  background:
    linear-gradient(
      90deg,
      rgba(203, 213, 225, 0),
      rgba(203, 213, 225, .88)
    );
}

.notification-section-divider::after {
  background:
    linear-gradient(
      90deg,
      rgba(203, 213, 225, .88),
      rgba(203, 213, 225, 0)
    );
}

.notification-section-divider--attention {
  color: #71849a;
}

.notification-section-divider--attention::before,
.notification-section-divider--attention::after {
  background:
    linear-gradient(
      90deg,
      rgba(147, 197, 253, 0),
      rgba(147, 197, 253, .74)
    );
}

.notification-section-divider--attention::after {
  background:
    linear-gradient(
      90deg,
      rgba(147, 197, 253, .74),
      rgba(147, 197, 253, 0)
    );
}

@media (max-width: 540px) {
  .notification-card {
    padding: 14px;
  }

  .notification-card.has-avatar {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .notification-card__avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .notification-card__title {
    font-size: 13px;
  }

  .notification-card__text {
    font-size: 12px;
  }

  .notification-section-divider {
    margin-right: 10px;
    margin-left: 10px;
  }
}
/* TALK_NOTIFICATIONS_MODERN_SOFT_SURFACE_V1_END */

.search-wrap {
  padding: 0 16px 12px;
}

.pane {
  display: none;
  overflow: auto;
  padding: 0 8px 12px;
  flex: 1;
}

.pane.is-active {
  display: block;
}

.list-item {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin: 6px 8px;
  border: 1px solid #eef2f5;
  cursor: pointer;
}

.list-item:hover {
  background: #f8fafc;
}

.list-item.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.item-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.item-sub {
  font-size: 13px;
  color: #6b7280;
}

.chat-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  text-align: center;
}

.placeholder-title {
  font-size: 22px;
  font-weight: 700;
}

.chat-wrap {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-head {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid #dde3e8;
  padding: 16px 20px;
  flex: 0 0 auto;
  backdrop-filter: blur(10px);
}

.chat-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.chat-head-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 0;
}

.chat-head-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-title,
#chatSubTitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title {
  font-size: 18px;
  font-weight: 700;
}

.btn-back {
  white-space: nowrap;
}

.messages-box {
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at top left, rgba(13, 110, 253, 0.04), transparent 26%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

.messages-empty {
  align-self: center;
  margin: auto 0;
  background: rgba(255,255,255,0.88);
  border: 1px solid #dbe4ef;
  border-radius: 16px;
  padding: 12px 16px;
  backdrop-filter: blur(6px);
}

.msg {
  width: 100%;
  display: flex;
}

.msg.in {
  justify-content: flex-start;
}

.msg.out {
  justify-content: flex-end;
}

.msg-bubble {
  display: inline-flex;
  flex-direction: column;
  position: relative;
  align-items: flex-start;
  width: auto;
  max-width: min(560px, 72%);
  min-width: 96px;
  padding: 12px 14px 10px;
  border-radius: 16px;
  box-sizing: border-box;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.msg.in .msg-bubble {
  background: #ffffff;
  border: 1px solid #dbe4ef;
  color: #0f172a;
  border-top-left-radius: 8px;
}

.msg.out .msg-bubble {
  background: linear-gradient(135deg, #0d6efd 0%, #228be6 100%);
  border: 1px solid rgba(13, 110, 253, 0.22);
  color: #ffffff;
  border-top-right-radius: 8px;
}

.msg-text {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  word-break: break-word;
}

.msg-link:hover {
  opacity: 0.88;
}

.msg-inline-copy {
  display: inline;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  word-break: break-word;
  -webkit-tap-highlight-color: rgba(0,0,0,0.08);
}

.msg-inline-copy:hover {
  opacity: 0.86;
}

.msg-inline-copy:active {
  opacity: 0.72;
}

.msg.in .msg-link,
.msg.in .msg-inline-copy {
  color: #0d6efd;
}

.msg.out .msg-link,
.msg.out .msg-inline-copy {
  color: rgba(255,255,255,0.96);
}

.msg-bubble--payment .msg-link,
.msg-bubble--payment .msg-inline-copy {
  color: #7a5a00;
}

.msg-bubble--payment {
  max-width: min(620px, 76%);
}

.msg.in .msg-bubble.msg-bubble--payment,
.msg.out .msg-bubble.msg-bubble--payment {
  background: linear-gradient(180deg, rgba(231, 197, 92, 0.30) 0%, rgba(196, 154, 44, 0.22) 100%);
  border: 1px solid rgba(184, 134, 11, 0.30);
  color: #5e4700;
  box-shadow:
    0 10px 26px rgba(140, 101, 0, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.24);
}

.msg-payment-notice {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.msg-payment-notice__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
  color: #7a5a00;
  font-size: 18px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.32);
}

.msg-payment-notice__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.msg-payment-notice__amount {
  min-width: 0;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-payment-notice__org {
  min-width: 0;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 500;
  opacity: 0.82;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.in .msg-bubble.msg-bubble--payment .msg-meta,
.msg.out .msg-bubble.msg-bubble--payment .msg-meta,
.msg.in .msg-bubble.msg-bubble--payment .msg-status,
.msg.out .msg-bubble.msg-bubble--payment .msg-status {
  color: rgba(94, 71, 0, 0.78);
}

.msg.in .msg-bubble.msg-bubble--payment .msg-status--read,
.msg.out .msg-bubble.msg-bubble--payment .msg-status--read {
  color: #8a6700;
  text-shadow: none;
}

.msg-meta {
  margin-top: 8px;
  align-self: flex-end;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: right;
}

.msg.in .msg-meta {
  color: #64748b;
}

.msg.out .msg-meta {
  color: rgba(255,255,255,0.86);
}

.composer {
  background: rgba(255,255,255,0.96);
  border-top: 1px solid #dbe4ef;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  flex: 0 0 auto;
  backdrop-filter: blur(10px);
}

.composer-top {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  min-width: 0;
}

.composer-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  min-width: 0;
}

.composer-actions-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}

.composer textarea {
  flex: 1;
  min-height: 52px;
  max-height: 180px;
  border: 1px solid #cfd8e3;
  border-radius: 16px;
  padding: 14px 16px;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.composer textarea:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.composer-send {
  flex: 0 0 auto;
  min-width: 52px;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #0d6efd 0%, #228be6 100%);
  box-shadow: 0 10px 24px rgba(13, 110, 253, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
}

.composer-send .bi {
  font-size: 20px;
  line-height: 1;
  color: #ffffff;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.modal-card {
  background: #fff;
  width: 100%;
  max-width: 720px;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
  padding: 18px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modal-card--wide {
  max-width: 980px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-subhead {
  margin-top: 18px;
  margin-bottom: 10px;
  font-weight: 700;
}

.profile-box {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.profile-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.sessions-box {
  display: grid;
  gap: 10px;
}

.session-row {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
}

.admin-create {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 160px 140px;
  gap: 10px;
}

.admin-users-box {
  margin-top: 14px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 110px 110px 160px 140px 260px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #eef2f5;
  padding: 10px 0;
  font-size: 14px;
}

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

@media (max-width: 1100px) {
  .admin-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 0;
  }

  .admin-create {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 320px;
    min-width: 280px;
  }

  .msg-bubble {
    max-width: 82%;
  }
}

@media (max-width: 720px) {
  .layout {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    max-width: none;
    border-right: 0;
    min-height: 100%;
    height: 100%;
    overflow: hidden;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .chat-area {
    position: absolute;
    inset: 0;
    background: #eef2f5;
    min-height: 100%;
    height: 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .layout.mobile-chat-open .chat-area {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .layout.mobile-chat-open .sidebar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .btn-back {
    display: inline-flex !important;
  }

  .chat-wrap {
    min-height: 100%;
    height: 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    overflow-x: hidden;
  }

  .chat-head {
    position: sticky;
    top: 0;
    z-index: 35;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding-top: max(12px, env(safe-area-inset-top));
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid #dde3e8;
    backdrop-filter: blur(10px);
  }

  .chat-head-left {
    min-width: 0;
    flex: 1 1 auto;
  }

  .chat-head-right {
    flex: 0 0 auto;
  }

  .chat-head-meta {
    min-width: 0;
    flex: 1 1 auto;
  }

  .messages-box {
    min-height: 0;
    height: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .msg {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .msg-bubble {
    min-width: 0;
    max-width: min(88%, 560px);
  }

  .msg-text,
  .msg-attachment,
  .msg-attachment__meta,
  .msg-attachment__name,
  .msg-reply-ref,
  .msg-reply-ref__content,
  .msg-forward-ref {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .composer {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    position: relative;
    z-index: 35;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    gap: 12px;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .btn {
    padding: 8px 10px;
    font-size: 13px;
  }

  .admin-create {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 12px;
  }

  .modal-card {
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 480px) {
  .sidebar-top {
    padding: 12px;
  }

  .tabs {
    padding: 10px 12px 8px;
  }

  .search-wrap {
    padding: 0 12px 10px;
  }

  .chat-head {
    padding: 12px 14px;
    gap: 10px;
  }

  .chat-head-left {
    gap: 10px;
  }

  .messages-box {
    padding: 12px;
  }

  .composer {
    padding: 10px 12px;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
  }

  .composer-main {
    min-width: 0;
    width: 90%;
    max-width: 90%;
  }

  .composer-actions {
    width: 90%;
    max-width: 90%;
    gap: 8px;
  }

  .composer-actions-left {
    gap: 8px;
  }

  .file-draft {
    padding: 8px 10px;
  }

  .msg-bubble {
    max-width: 90%;
    min-width: 0;
    padding: 10px 12px 9px;
  }

  .composer-send {
    min-width: 48px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .placeholder-title {
    font-size: 20px;
  }
}


.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #f3f4f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.icon-btn:hover {
  background: #e5e7eb;
}

@media (max-width: 480px) {
  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}


.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #f3f4f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.icon-btn:hover {
  background: #e5e7eb;
}

.icon-btn .bi {
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 480px) {
  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .icon-btn .bi {
    font-size: 16px;
  }
}


.item-sub--presence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.presence-dot {
  width: 5px;
  height: 5px;
  min-width: 5px;
  border-radius: 50%;
  display: inline-block;
}

.presence-dot.is-online {
  background: #0d6efd;
}

.presence-dot.is-offline {
  background: #9ca3af;
}


.list-item__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.list-item__meta {
  min-width: 0;
  flex: 1;
}

.avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  user-select: none;
}

.avatar--list {
  width: 42px;
  height: 42px;
  min-width: 42px;
  font-size: 15px;
}

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

.chat-head-meta {
  min-width: 0;
}

.avatar-color-0 { background: linear-gradient(135deg, #5b8def, #7b61ff); }
.avatar-color-1 { background: linear-gradient(135deg, #12b886, #2f9e44); }
.avatar-color-2 { background: linear-gradient(135deg, #f76707, #f59f00); }
.avatar-color-3 { background: linear-gradient(135deg, #e64980, #be4bdb); }
.avatar-color-4 { background: linear-gradient(135deg, #228be6, #15aabf); }
.avatar-color-5 { background: linear-gradient(135deg, #7950f2, #4c6ef5); }
.avatar-color-6 { background: linear-gradient(135deg, #fa5252, #f06595); }
.avatar-color-7 { background: linear-gradient(135deg, #40c057, #12b886); }

@media (max-width: 480px) {
  .avatar--list {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 14px;
  }

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

  .list-item__row {
    gap: 10px;
  }
}

.msg-day-divider {
  display: flex;
  justify-content: center;
  margin: 4px 0 2px;
}

.msg-day-divider__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  border: 1px solid #dbe4ef;
  color: #64748b;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(6px);
}

.msg-system {
  display: flex;
  justify-content: center;
  margin: 2px 0 6px;
}

.msg-system-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: min(92%, 520px);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  border: 1px solid #dbe4ef;
  color: #475569;
  font-size: 12px;
  line-height: 1.2;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(6px);
}

.msg-system-note .bi {
  font-size: 13px;
  line-height: 1;
  color: #0d6efd;
}

.msg-system-note--missed .bi {
  color: #dc3545;
}

.msg-system-note__text {
  white-space: nowrap;
}

.msg-system-note__time {
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.composer-attach {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 16px;
  flex: 0 0 auto;
}

.composer-voice {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 16px;
  flex: 0 0 auto;
}

.composer-voice.is-recording {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.28);
}

.composer-voice.is-recording .bi {
  color: #ffffff !important;
}

.composer-main {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-draft {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid #dbe4ef;
  border-radius: 16px;
  background: rgba(255,255,255,0.96);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.file-draft__icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef4ff;
  color: #0d6efd;
  font-size: 18px;
}

.file-draft__meta {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.file-draft__name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.file-draft__sub {
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-draft__remove {
  border: 0;
  background: transparent;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.file-draft__remove:hover {
  background: #f1f5f9;
}

.file-draft__progress {
  margin-top: 8px;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.file-draft__progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2296f3 0%, #0d6efd 100%);
  transition: width .18s ease;
}

.msg-meta-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.msg-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 14px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.msg-status .bi {
  display: inline-block;
  line-height: 1;
}

.msg.out .msg-status {
  color: rgba(255,255,255,0.72);
}

.msg.out .msg-status--delivered {
  color: rgba(255,255,255,0.70);
}

.msg.out .msg-status--read {
  color: #00eaff;
  text-shadow:
    0 0 4px rgba(0, 234, 255, 0.90),
    0 0 10px rgba(0, 234, 255, 0.55);
}

.msg-delete-btn {
  border: 0;
  background: transparent;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: inherit;
  opacity: 0.7;
}

.msg-delete-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.14);
}

.msg.in .msg-delete-btn:hover {
  background: #eef2f7;
}

.msg-attachment {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 2px;
  text-align: left;
}

.msg.in .msg-attachment {
  background: #f8fafc;
}

.msg.out .msg-attachment {
  background: rgba(255,255,255,0.16);
}

.msg-attachment__icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.msg.in .msg-attachment__icon {
  background: #eaf1fb;
  color: #0d6efd;
}

.msg.out .msg-attachment__icon {
  background: rgba(255,255,255,0.18);
  color: #ffffff;
}

.msg-attachment__meta {
  min-width: 0;
  flex: 1 1 auto;
}

.msg-attachment__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-attachment__sub {
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.86;
}

.msg.out .msg-attachment__name {
  color: #ffffff;
}

.msg.out .msg-attachment__sub {
  color: rgba(255,255,255,0.72);
  opacity: 1;
}

.file-draft--recording {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(255,255,255,0.98);
}

.file-draft__record-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dc2626;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35);
  animation: talk-voice-record-pulse 1.3s ease-out infinite;
}

.msg--audio-only {
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.msg.in.msg--audio-only {
  justify-content: flex-start;
}

.msg.out.msg--audio-only {
  justify-content: flex-end;
}

.msg-audio-only-wrap {
  display: inline-flex;
  width: auto;
  min-width: 0;
  max-width: min(240px, 58vw);
  overflow: hidden;
}

.msg-audio-min {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  width: auto;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  overflow: hidden;
}

.msg.in .msg-audio-min {
  background: #ffffff;
  border: 1px solid #dbe4ef;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.msg.out .msg-audio-min {
  background: linear-gradient(135deg, #0d6efd 0%, #228be6 100%);
  border: 1px solid rgba(13, 110, 253, 0.22);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.msg-audio-min__toggle {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.msg.in .msg-audio-min__toggle {
  background: #eaf1fb;
  color: #0d6efd;
}

.msg.out .msg-audio-min__toggle {
  background: rgba(255,255,255,0.18);
  color: #ffffff;
}

.msg-audio-min__toggle .bi {
  font-size: 18px;
  line-height: 1;
}

.msg-audio-min__time {
  min-width: 0;
  flex: 0 1 auto;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.msg.in .msg-audio-min__time {
  color: #475569;
}

.msg.out .msg-audio-min__time {
  color: rgba(255,255,255,0.94);
}

.msg-audio__player {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .composer {
    align-items: stretch;
  }

  .composer-send,
  .composer-attach,
  .composer-voice,
  .composer-sticker-btn,
  .composer-template-btn {
    height: 48px;
    min-width: 48px;
    width: 48px;
  }
}

.list-item__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.item-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.item-title-wrap .presence-dot {
  flex: 0 0 auto;
}

.item-title-wrap .item-title {
  min-width: 0;
  margin-bottom: 0;
}

.item-sub--last-message {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
  max-height: calc(1.35em * 2);
}

.dialog-unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0d6efd;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}

.context-menu {
  position: fixed;
  z-index: 3000;
  min-width: 220px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,0.98);
  border: 1px solid #dbe4ef;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(12px);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.context-menu__item {
  width: 100%;
  min-height: 36px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: #0f172a;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.context-menu__item:hover {
  background: #f1f5f9;
}

#messageContextMenu,
#messageContextMenu *,
#messageContextMenu .context-menu__item,
#messageContextMenu .context-menu__item span,
#messageContextMenu .context-menu__item i {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent;
  caret-color: transparent;
}

#messageContextMenu .context-menu__item {
  touch-action: manipulation;
}


.context-menu__item--danger {
  color: #dc2626;
}

.msg-bubble--media {
  position: relative;
  padding: 6px;
  max-width: 360px;
  overflow: hidden;
}

.msg-media {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
}

.msg-media__img-wrap,
.msg-media__video-wrap {
  position: relative;
  width: 100%;
  min-height: 180px;
  border-radius: 18px;
  overflow: hidden;
}

.msg-media__img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
  max-height: 420px;
  object-fit: cover;
  background: #dbe4ef;
}

.msg-media__video-wrap {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #172033, #0f172a);
}

.msg-media__video-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.18)),
    radial-gradient(circle at 30% 30%, rgba(59,130,246,0.25), transparent 35%),
    radial-gradient(circle at 70% 70%, rgba(16,185,129,0.22), transparent 32%);
}

.msg-media__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 48px;
  text-shadow: 0 4px 18px rgba(0,0,0,0.45);
}

.msg-media__video-meta {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
}

.msg-meta-row--overlay {
  margin-top: 0;
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
}

.msg-bubble--media .msg-meta {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff !important;
  backdrop-filter: blur(6px);
}

.msg-bubble--media .msg-text {
  margin-top: 8px;
  padding: 0 6px 2px;
}

@media (max-width: 640px) {
  .msg-bubble--media {
    max-width: min(82vw, 360px);
  }

  .msg-media__img {
    max-height: 320px;
  }
}

.media-viewer-open {
  overflow: hidden;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 4000;
}

.media-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.88);
  backdrop-filter: blur(6px);
}

.media-viewer__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-viewer__close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px) + 12px);
  right: max(12px, env(safe-area-inset-right, 0px) + 12px);
  z-index: 4100;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.media-viewer__close:hover {
  background: rgba(255,255,255,0.22);
}

.media-viewer__content {
  max-width: min(92vw, 1280px);
  max-height: 90vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-viewer__stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.media-viewer__image {
  max-width: 100%;
  max-height: calc(90vh - 64px);
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}

.media-viewer__video {
  max-width: 100%;
  max-height: calc(90vh - 64px);
  border-radius: 14px;
  background: #000;
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}

.media-viewer__caption {
  max-width: min(92vw, 900px);
  padding: 8px 12px;
  border-radius: 12px;
  color: #fff;
  background: rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 640px) {
  .media-viewer__dialog {
    padding: 12px;
  }

  .media-viewer__close {
    top: max(10px, env(safe-area-inset-top, 0px) + 10px);
    right: max(10px, env(safe-area-inset-right, 0px) + 10px);
  }
}

.msg-media__video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-bubble--video .msg-meta-row--overlay {
  left: 14px;
  right: auto;
  bottom: 14px;
}

.msg-bubble--video .msg-meta-row--overlay .msg-meta {
  background: rgba(15, 23, 42, 0.72);
}


.msg-edit-history {
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
}

.msg-edit-history__label {
  font-weight: 600;
}

.msg-edit-history__text {
  text-decoration: line-through;
}

.msg-edit-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.msg-edit-toggle:hover {
  opacity: 0.9;
}

.msg-edit-toggle.is-open {
  font-weight: 600;
}

.msg.in .msg-edit-toggle {
  color: #64748b;
}

.msg.out .msg-edit-toggle {
  color: rgba(255,255,255,0.92);
}

.admin-settings-box {
  margin: 14px 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #f8fafc;
}

.admin-settings-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.admin-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.admin-switch input {
  display: none;
}

.admin-switch__slider {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .2s ease;
  flex: 0 0 auto;
}

.admin-switch__slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}

.admin-switch input:checked + .admin-switch__slider {
  background: #0d6efd;
}

.admin-switch input:checked + .admin-switch__slider::after {
  transform: translateX(20px);
}

.admin-switch__label {
  font-size: 14px;
  color: #0f172a;
}

.message-reply-box {
  margin-bottom: 2px;
}

.reply-compose {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #f8fafc;
}

.reply-compose__bar {
  width: 4px;
  border-radius: 999px;
  background: #0d6efd;
  flex: 0 0 auto;
}

.reply-compose__content {
  min-width: 0;
  flex: 1 1 auto;
}

.reply-compose__title {
  font-size: 12px;
  font-weight: 700;
  color: #0d6efd;
  margin-bottom: 2px;
}

.reply-compose__text {
  font-size: 13px;
  color: #475569;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-compose__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  flex: 0 0 auto;
}

.reply-compose__close:hover {
  background: #e2e8f0;
}

.msg-reply-ref {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.msg-reply-ref__bar {
  width: 4px;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.85);
  flex: 0 0 auto;
}

.msg-reply-ref__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg-reply-ref__title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.msg-reply-ref__text {
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg.in .msg-reply-ref {
  color: #0f172a;
}

.msg.out .msg-reply-ref {
  color: #ffffff;
}

.msg.in .msg-reply-ref__bar {
  background: #0d6efd;
}

.msg.out .msg-reply-ref__bar {
  background: rgba(255,255,255,0.88);
}

.msg--reply-target .msg-bubble {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.24), 0 8px 24px rgba(15, 23, 42, 0.08);
}

.message-reply-box {
  margin-bottom: 2px;
}

.reply-compose {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #f8fafc;
}

.reply-compose__bar {
  width: 4px;
  border-radius: 999px;
  background: #0d6efd;
  flex: 0 0 auto;
}

.reply-compose__content {
  min-width: 0;
  flex: 1 1 auto;
}

.reply-compose__title {
  font-size: 12px;
  font-weight: 700;
  color: #0d6efd;
  margin-bottom: 2px;
}

.reply-compose__text {
  font-size: 13px;
  color: #475569;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-compose__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  flex: 0 0 auto;
}

.reply-compose__close:hover {
  background: #e2e8f0;
}

.msg-reply-ref {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.msg-reply-ref__bar {
  width: 4px;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.85);
  flex: 0 0 auto;
}

.msg-reply-ref__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg-reply-ref__title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.msg-reply-ref__text {
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg.in .msg-reply-ref {
  color: #0f172a;
}

.msg.out .msg-reply-ref {
  color: #ffffff;
}

.msg.in .msg-reply-ref__bar {
  background: #0d6efd;
}

.msg.out .msg-reply-ref__bar {
  background: rgba(255,255,255,0.88);
}

.msg--reply-target .msg-bubble {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.24), 0 8px 24px rgba(15, 23, 42, 0.08);
}

.msg-forward-ref {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 8px;
  min-width: 0;
}

.msg-forward-ref__label {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  opacity: 0.92;
}

.msg-forward-ref__name {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.msg.in .msg-forward-ref {
  color: #0d6efd;
}

.msg.out .msg-forward-ref {
  color: rgba(255,255,255,0.96);
}

.forward-modal-card {
  max-width: 620px;
}

/*
 * TALK_FORWARD_PREVIEW_COMIC_BUBBLE_V1
 * Аватар автора и прямоугольное комикс-облако
 */

/*
 * TALK_FORWARD_PREVIEW_COMIC_RESTYLE_NO_NAME_V1
 * Компактный комикс-спич без имени автора
 */

/*
 * TALK_FORWARD_MODAL_COMPACT_CONTROLS_V1
 * Компактный спич и строка управления
 */

.forward-modal-card {
  width: min(980px, calc(100vw - 48px));
  max-width: 980px;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.forward-modal-card,
.forward-modal-card * {
  box-sizing: border-box;
}

.forward-modal-head {
  min-width: 0;
}

.forward-modal-head h2 {
  min-width: 0;
  margin: 0;
}

.forward-modal-close {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition:
    color 0.15s ease,
    opacity 0.15s ease,
    transform 0.15s ease;
}

.forward-modal-close:hover {
  color: #0f172a;
  transform: scale(1.06);
}

.forward-modal-close:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.30);
  outline-offset: 2px;
}

.forward-modal-close .bi {
  font-size: 22px;
  line-height: 1;
}

.forward-preview-box {
  width: 100%;
  min-width: 0;
  margin-top: 14px;
  overflow: visible;
}

.forward-preview-comic {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 2px;
}

.forward-preview-comic__avatar {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
}

.avatar--forward-preview-author {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  font-size: 17px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(13, 110, 253, 0.20),
    0 6px 16px rgba(15, 23, 42, 0.12);
}

.avatar--forward-preview-author
.avatar__img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.forward-preview-comic__bubble {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 64px);
  padding: 10px 14px;
  border: 1px solid #cfe0f4;
  border-radius: 7px 17px 17px 17px;
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #f8fbff 100%
    );
  color: #334155;
  box-shadow:
    0 7px 20px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.forward-preview-comic__bubble::before {
  content: "";
  position: absolute;
  top: 14px;
  left: -11px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 11px solid #cfe0f4;
}

.forward-preview-comic__bubble::after {
  content: "";
  position: absolute;
  top: 15px;
  left: -9px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid #ffffff;
}

.forward-preview-comic__text {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.forward-preview-empty {
  padding: 16px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.forward-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin-top: 14px;
}

.forward-search-panel {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.forward-search-field {
  flex: 0 1 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(10px);
  transition:
    width 0.22s ease,
    flex-basis 0.22s ease,
    opacity 0.16s ease,
    transform 0.22s ease;
}

.forward-controls.is-search-open
.forward-search-field {
  flex-basis: min(320px, 100%);
  width: min(320px, 100%);
  opacity: 1;
  transform: translateX(0);
}

.forward-search-field input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  outline: none;
}

.forward-search-field input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.10);
}

.forward-search-toggle {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.forward-search-toggle:hover,
.forward-controls.is-search-open
.forward-search-toggle {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #0d6efd;
}

.forward-search-toggle:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.25);
  outline-offset: 2px;
}

.forward-search-toggle .bi {
  font-size: 15px;
  line-height: 1;
}

.forward-controls.is-search-open
.forward-search-toggle .bi::before {
  content: "\f659";
}

.forward-tabs {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #f1f5f9;
}

.forward-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.forward-tab:hover {
  color: #334155;
}

.forward-tab.is-active {
  background: #ffffff;
  color: #0d6efd;
  box-shadow:
    0 1px 4px rgba(15, 23, 42, 0.10),
    inset 0 0 0 1px rgba(13, 110, 253, 0.08);
}

.forward-targets-box {
  max-width: 100%;
  min-width: 0;
}

.forward-modal-actions {
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 720px) {
  .forward-modal-card {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding: 16px;
  }

  .forward-modal-head h2 {
    font-size: 22px;
  }

  .forward-preview-comic {
    gap: 8px;
  }

  .avatar--forward-preview-author {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-width: 2px;
    font-size: 15px;
  }

  .forward-preview-comic__bubble {
    max-width: calc(100% - 54px);
    padding: 8px 11px;
    border-radius: 6px 14px 14px 14px;
  }

  .forward-preview-comic__bubble::before {
    top: 11px;
    left: -9px;
    border-top-width: 8px;
    border-bottom-width: 8px;
    border-right-width: 9px;
  }

  .forward-preview-comic__bubble::after {
    top: 12px;
    left: -7px;
    border-top-width: 7px;
    border-bottom-width: 7px;
    border-right-width: 8px;
  }

  .forward-preview-comic__text {
    font-size: 12px;
    line-height: 1.35;
  }

  .forward-controls {
    gap: 6px;
  }

  .forward-controls.is-search-open {
    align-items: stretch;
  }

  .forward-controls.is-search-open
  .forward-search-field {
    flex-basis: 100%;
    width: 100%;
  }

  .forward-tab {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .forward-modal-card {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    padding: 14px;
    border-radius: 16px;
  }

  .forward-modal-head h2 {
    font-size: 20px;
  }

  .forward-controls {
    flex-wrap: nowrap;
  }

  .forward-controls.is-search-open
  .forward-tabs {
    flex: 0 0 auto;
  }

  .forward-search-field input {
    padding-left: 9px;
    padding-right: 9px;
    font-size: 12px;
  }
}

.forward-targets-box {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 6px 4px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.forward-targets-box::-webkit-scrollbar {
  height: 8px;
}

.forward-targets-box::-webkit-scrollbar-track {
  background: transparent;
}

.forward-targets-box::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.28);
}

.forward-target-card {
  appearance: none;
  position: relative;
  flex: 0 0 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 126px;
  min-width: 126px;
  height: 158px;
  min-height: 158px;
  padding: 4px 4px 6px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #0f172a;
  box-sizing: border-box;
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.forward-target-card:hover {
  transform: translateY(-2px);
  background: rgba(248, 250, 252, 0.92);
}

.forward-target-card:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.22);
  outline-offset: 2px;
}

.forward-target-card__visual {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  border: 3px solid #dbe4ef;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
  overflow: hidden;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.forward-target-card:hover
.forward-target-card__visual {
  border-color: #bfdbfe;
  box-shadow: 0 9px 24px rgba(15, 23, 42, 0.12);
}

.forward-target-card .avatar--forward-target {
  width: 100%;
  height: 100%;
  min-width: 100%;
  border-radius: 50%;
  font-size: 28px;
  overflow: hidden;
}

.forward-target-card
.avatar--forward-target
.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.forward-target-card__badge {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 118px;
  min-height: 30px;
  margin-top: 8px;
  padding: 5px 8px;
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
  box-sizing: border-box;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.forward-target-card__title {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-target-card__selected-mark {
  position: absolute;
  z-index: 4;
  top: 5px;
  right: 7px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #0d6efd;
  color: #ffffff;
  font-size: 13px;
  box-shadow: 0 5px 14px rgba(13, 110, 253, 0.38);
  box-sizing: border-box;
}

.forward-target-card.is-selected {
  background: rgba(239, 246, 255, 0.72);
  transform: translateY(-2px);
}

.forward-target-card.is-selected
.forward-target-card__visual {
  border-color: #0d6efd;
  box-shadow:
    0 0 0 4px rgba(13, 110, 253, 0.17),
    0 10px 26px rgba(13, 110, 253, 0.22);
}

.forward-target-card.is-selected
.forward-target-card__badge {
  border-color: #0d6efd;
  background: #0d6efd;
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.22);
}

.forward-target-card.is-selected
.forward-target-card__title {
  color: #ffffff;
}

.forward-target-card.is-selected
.forward-target-card__selected-mark {
  display: inline-flex;
}

.forward-targets-empty {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 22px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  text-align: center;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .forward-targets-box {
    gap: 12px;
    margin-right: -2px;
    padding: 5px 2px 12px;
  }

  .forward-target-card {
    flex-basis: 104px;
    width: 104px;
    min-width: 104px;
    height: 134px;
    min-height: 134px;
    padding-left: 2px;
    padding-right: 2px;
  }

  .forward-target-card__visual {
    width: 90px;
    height: 90px;
    border-width: 3px;
  }

  .forward-target-card
  .avatar--forward-target {
    font-size: 23px;
  }

  .forward-target-card__badge {
    width: 100px;
    min-height: 28px;
    margin-top: 7px;
    padding: 4px 7px;
  }

  .forward-target-card__title {
    font-size: 10px;
  }

  .forward-target-card__selected-mark {
    top: 2px;
    right: 3px;
    width: 25px;
    height: 25px;
  }
}

.forward-modal-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}


.sidebar-top__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.current-user-avatar-btn,
.profile-avatar-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.avatar--sidebar-self {
  width: 42px;
  height: 42px;
  min-width: 42px;
  overflow: hidden;
}

.avatar--profile-preview {
  width: 84px;
  height: 84px;
  min-width: 84px;
  font-size: 30px;
  overflow: hidden;
}

.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.profile-avatar-editor {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar-editor__meta {
  min-width: 0;
}

@media (max-width: 720px) {
  .profile-avatar-editor {
    align-items: flex-start;
  }
}


.talk-toast-root {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: calc(100vw - 24px);
  max-width: 100vw;
  z-index: 5000;
  pointer-events: none;
}

.talk-toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  width: fit-content;
  max-width: min(420px, calc(100vw - 24px));
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.72);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
  transition: opacity .18s ease, transform .18s ease;
}

.talk-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.talk-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
}

.talk-toast__body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
}

.talk-toast__text {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  text-align: center;
  word-break: break-word;
}

.talk-toast__close {
  display: none;
}

.talk-toast__progress {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  transform-origin: left center;
  transform: scaleX(1);
  opacity: 0.45;
}

.talk-toast__progress.is-running {
  animation-name: talk-toast-progress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.talk-toast--info .talk-toast__progress,
.talk-toast--success .talk-toast__progress,
.talk-toast--warning .talk-toast__progress,
.talk-toast--error .talk-toast__progress {
  background: rgba(255, 255, 255, 0.72);
}

@keyframes talk-toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 720px) {
  .talk-toast-root {
    top: max(10px, env(safe-area-inset-top));
    width: calc(100vw - 20px);
  }

  .talk-toast {
    max-width: calc(100vw - 20px);
  }

  .talk-toast__body {
    padding: 10px 13px;
  }

  .talk-toast__text {
    font-size: 13px;
  }
}

@media (max-width: 720px) {
  #messageInput,
  .composer textarea,
  input,
  textarea,
  select {
    font-size: 16px;
  }

  .composer {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .composer-top {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .composer-main {
    flex: 0 0 90%;
    width: 90%;
    max-width: 90%;
    min-width: 0;
    overflow: hidden;
  }

  .composer textarea {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .composer-actions {
    width: 90%;
    max-width: 90%;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .composer-actions-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 0 1 auto;
  }

  .composer-attach,
  .composer-voice,
  .composer-send,
  .composer-sticker-btn,
  .composer-template-btn {
    flex: 0 0 auto;
  }

  .composer-send {
    margin-left: auto;
    align-self: auto;
  }
}

/* TALK_SCREEN_SAFE_MESSAGES_V1_START */
@media (max-width: 720px) {
  .chat-area,
  .chat-wrap,
  .messages-box {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .messages-box {
    padding-left: calc(12px + env(safe-area-inset-left));
    padding-right: calc(12px + env(safe-area-inset-right));
  }

  .messages-box > * {
    max-width: 100%;
    box-sizing: border-box;
  }

  .msg {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 0;
    padding-right: 0;
  }

  .msg.in,
  .msg.out {
    padding-left: 0;
    padding-right: 0;
  }

  .msg-bubble {
    min-width: 0;
    width: auto;
    max-width: min(calc(100% - 28px), 560px);
    box-sizing: border-box;
  }

  .msg-text,
  .msg-link,
  .msg-inline-copy,
  .msg-meta-row,
  .msg-attachment,
  .msg-attachment__meta,
  .msg-attachment__name,
  .msg-reply-ref,
  .msg-reply-ref__content,
  .msg-forward-ref,
  .msg-forward-ref__name {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .msg-bubble--media {
    max-width: min(calc(100% - 28px), 360px);
  }

  .msg-media,
  .msg-media__img-wrap,
  .msg-media__video-wrap,
  .msg-media__img {
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .messages-box {
    padding-left: calc(10px + env(safe-area-inset-left));
    padding-right: calc(10px + env(safe-area-inset-right));
  }

  .msg.in,
  .msg.out {
    padding-left: 0;
    padding-right: 0;
  }

  .msg-bubble {
    max-width: calc(100% - 20px);
  }

  .msg-bubble--media {
    max-width: min(calc(100% - 20px), 320px);
  }
}
/* TALK_SCREEN_SAFE_MESSAGES_V1_END */


/* TALK_UPLOAD_OPTIMIZE_V1_START */
.file-draft__optimize {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-draft__optimize-text {
  font-size: 12px;
  color: #475569;
  line-height: 1;
}

.file-draft__switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  line-height: 1;
}

.file-draft__switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-draft__switch-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #0d6efd;
  position: relative;
  transition: background .18s ease;
  display: inline-block;
}

.file-draft__switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .18s ease;
}

.file-draft__switch input:checked + .file-draft__switch-track {
  background: #94a3b8;
}

.file-draft__switch input:checked + .file-draft__switch-track .file-draft__switch-thumb {
  transform: translateX(18px);
}
/* TALK_UPLOAD_OPTIMIZE_V1_END */


/* TALK_ATTACHMENT_PROCESSING_V1_START */
.msg-attachment--processing,
.msg-attachment--failed {
  cursor: default;
}

.msg-attachment__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(13, 110, 253, 0.20);
  border-top-color: #0d6efd;
  display: inline-block;
  animation: talk-attachment-spin .9s linear infinite;
}

.msg.out .msg-attachment__spinner {
  border-color: rgba(255,255,255,0.24);
  border-top-color: #ffffff;
}

.msg-attachment--processing .msg-attachment__sub,
.msg-attachment--failed .msg-attachment__sub {
  font-weight: 600;
}

.msg-attachment--failed .msg-attachment__icon {
  color: #dc2626;
}

@keyframes talk-attachment-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes talk-voice-record-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}
/* TALK_ATTACHMENT_PROCESSING_V1_END */

.composer-template-btn {
  width: 52px;
  height: 52px;
  min-width: 52px;
  padding: 0;
  border-radius: 16px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.composer-template-btn .bi {
  font-size: 20px;
  line-height: 1;
}

.template-modal-card {
  max-width: 460px;
}

.template-form {
  margin-top: 8px;
}

.template-modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .composer-top {
    gap: 10px;
  }

  .composer-actions {
    gap: 8px;
  }

  .composer-template-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }
}



/* PROFILE_REDESIGN_V1_START */
.modal-card--profile {
  max-width: 860px;
  width: min(860px, calc(100vw - 32px));
  padding: 22px;
  border-radius: 24px;
}

.modal-head--profile {
  align-items: flex-start;
  margin-bottom: 18px;
}

.profile-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.profile-hero {
  position: relative;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #dbe4ef;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.profile-hero__main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.profile-hero__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-hero__name {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
  word-break: break-word;
}

.profile-hero__email {
  font-size: 14px;
  color: #475569;
  word-break: break-word;
}

.profile-hero__badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.10);
  color: #0d6efd;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.profile-hero__hint,
.profile-help-text {
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.profile-panel {
  border: 1px solid #dbe4ef;
  border-radius: 22px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.profile-panel--sessions {
  padding-top: 16px;
}

.profile-panel__head {
  margin-bottom: 14px;
}

.profile-panel__title {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.profile-panel__sub {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: #64748b;
}

.profile-info-list {
  display: grid;
  gap: 12px;
}

.profile-info-item {
  padding: 12px 14px;
  border: 1px solid #e5edf7;
  border-radius: 16px;
  background: #f8fbff;
}

.profile-info-item__label {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
}

.profile-info-item__value {
  font-size: 14px;
  line-height: 1.45;
  color: #0f172a;
  font-weight: 600;
  word-break: break-word;
}

.profile-actions--stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.profile-actions--stack .btn {
  justify-content: center;
  min-height: 44px;
}

.sessions-box {
  margin-top: 0;
  min-height: 72px;
  border: 1px dashed #dbe4ef;
  border-radius: 18px;
  background: #f8fbff;
  padding: 10px;
}

.profile-avatar-button {
  width: 112px;
  height: 112px;
  min-width: 112px;
  border-radius: 28px;
  border: 1px solid #d6e2f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.72);
}

.avatar--profile-preview {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  font-size: 24px;
}

@media (max-width: 820px) {
  .modal-card--profile {
    width: min(100vw - 20px, 860px);
    padding: 18px;
    border-radius: 20px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .profile-hero__main {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-avatar-button {
    width: 96px;
    height: 96px;
    min-width: 96px;
    border-radius: 24px;
  }

  .avatar--profile-preview {
    width: 82px;
    height: 82px;
    border-radius: 20px;
    font-size: 24px;
  }

  .profile-hero__name {
    font-size: 21px;
  }
}
/* PROFILE_REDESIGN_V1_END */


.msg-purchase-action-wrap {
  margin-top: 8px;
}

.msg-purchase-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1;
}

.msg-purchase-action-btn .bi {
  font-size: 13px;
}

.msg.out .msg-purchase-action-btn {
  background: #ffffff;
  color: #0d6efd;
  border-color: rgba(13, 110, 253, 0.18);
}


.media-viewer__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4100;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

.media-viewer__nav:hover {
  background: rgba(255,255,255,0.24);
}

.media-viewer__nav .bi {
  font-size: 28px;
  line-height: 1;
}

.media-viewer__nav--prev {
  left: max(12px, env(safe-area-inset-left, 0px) + 12px);
}

.media-viewer__nav--next {
  right: max(12px, env(safe-area-inset-right, 0px) + 12px);
}

.media-viewer__counter {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4100;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  backdrop-filter: blur(8px);
}

@media (max-width: 640px) {
  .media-viewer__nav {
    width: 42px;
    height: 42px;
  }

  .media-viewer__nav .bi {
    font-size: 24px;
  }
}


/* TALK_COMPOSER_DRAG_DROP_V1_START */
.composer {
  position: relative;
}

.composer::after {
  content: "Отпустите файл, чтобы прикрепить";
  position: absolute;
  inset: 8px;
  z-index: 3;
  border: 2px dashed rgba(13, 110, 253, 0.45);
  border-radius: 18px;
  background: rgba(239, 246, 255, 0.82);
  color: #0d6efd;
  font-size: 14px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.composer.composer--drag-over::after {
  display: flex;
}

.composer.composer--drag-over .composer-main,
.composer.composer--drag-over .composer-actions {
  opacity: 0.38;
}

@media (max-width: 720px) {
  .composer::after {
    inset: 6px;
    border-radius: 16px;
    font-size: 13px;
  }
}
/* TALK_COMPOSER_DRAG_DROP_V1_END */


/* TALK_MULTI_ATTACHMENTS_V1_START */
.file-draft {
  flex-direction: column;
  align-items: stretch;
}

.file-draft__summary {
  padding: 0 2px 2px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.file-draft__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.file-draft__item + .file-draft__item {
  padding-top: 8px;
  border-top: 1px solid #eef2f7;
}

.msg-bubble--album {
  padding: 6px;
  max-width: min(360px, 72%);
  overflow: hidden;
}

.msg-album {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 220px;
  max-width: 360px;
  overflow: hidden;
  border-radius: 18px;
}

.msg-album--count-1 {
  grid-template-columns: 1fr;
}

.msg-album--count-2,
.msg-album--count-3,
.msg-album--count-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.msg-album__item {
  position: relative;
  display: block;
  width: 100%;
  min-height: 128px;
  aspect-ratio: 1 / 1;
  border: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #dbe4ef;
  cursor: pointer;
}

.msg-album--count-3 .msg-album__item:first-child {
  grid-row: span 2;
  aspect-ratio: auto;
}

.msg-album__img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
}

.msg-album__play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 34px;
  text-shadow: 0 4px 18px rgba(0,0,0,0.45);
}

.msg-album__more {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.58);
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
}

.msg-attachments-list {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.msg-bubble--album .msg-text {
  margin-top: 8px;
  padding: 0 6px 2px;
}

.msg-bubble--album .msg-meta-row--overlay {
  right: 12px;
  bottom: 12px;
}

@media (max-width: 640px) {
  .msg-bubble--album {
    max-width: min(82vw, 360px);
  }

  .msg-album {
    min-width: min(220px, 76vw);
    max-width: min(360px, 82vw);
  }

  .msg-album__item {
    min-height: 112px;
  }
}
/* TALK_MULTI_ATTACHMENTS_V1_END */


/* TALK_MESSAGE_REACTIONS_V1_START */
.msg-reaction-open-btn {
  position: absolute;
  right: -11px;
  bottom: -11px;
  z-index: 6;
  width: 25px;
  height: 25px;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #f1f5f9;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.10);
  cursor: pointer;
  opacity: 0.86;
}

.msg-reaction-open-btn:hover,
.msg-reaction-open-btn:focus {
  opacity: 1;
  color: #64748b;
  background: #e9eef5;
}

.msg-reaction-open-btn .bi {
  font-size: 15px;
  line-height: 1;
}

.msg-reaction-picker {
  position: absolute;
  right: -2px;
  bottom: 24px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(203, 213, 225, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.msg-reaction-picker__item {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}

.msg-reaction-picker__item:hover,
.msg-reaction-picker__item:focus {
  background: #eef2f7;
  transform: translateY(-2px) scale(1.04);
}

.msg-reaction-picker__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.msg-reactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  padding-right: 18px;
}

.msg-reaction-chip {
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.94);
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 25px;
  padding: 2px 7px 2px 4px;
  cursor: pointer;
}

.msg-reaction-chip.is-own {
  border-color: rgba(13, 110, 253, 0.30);
  background: rgba(219, 234, 254, 0.96);
}

.msg-reaction-chip__img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  display: block;
}

.msg-reaction-chip__count {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.msg.out .msg-reactions {
  justify-content: flex-end;
  padding-right: 0;
}

.msg.out .msg-reaction-chip {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.msg.out .msg-reaction-chip.is-own {
  background: rgba(255, 255, 255, 0.26);
}

@media (max-width: 640px) {
  .msg-reaction-picker {
    right: -6px;
    max-width: min(88vw, 390px);
    overflow-x: auto;
    border-radius: 18px;
  }

  .msg-reaction-picker__item {
    min-width: 34px;
  }
}
/* TALK_MESSAGE_REACTIONS_V1_END */


/* TALK_MESSAGE_REACTIONS_POSITION_FIX_V2_START */
.msg.in .msg-bubble {
  padding-right: 38px;
}

.msg-reaction-open-btn {
  right: 7px !important;
  bottom: 7px !important;
  z-index: 12 !important;
  width: 26px !important;
  height: 26px !important;
  background: #f1f5f9 !important;
  border: 1px solid #d6dde7 !important;
  color: #94a3b8 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.msg-reaction-open-btn .bi {
  display: inline-block !important;
  color: #94a3b8 !important;
}

.msg.in .msg-bubble--media,
.msg.in .msg-bubble--album {
  overflow: visible;
}

.msg.in .msg-bubble--media .msg-reaction-open-btn,
.msg.in .msg-bubble--album .msg-reaction-open-btn {
  right: 8px !important;
  bottom: 8px !important;
}

.msg.in .msg-bubble--media .msg-meta-row--overlay,
.msg.in .msg-bubble--album .msg-meta-row--overlay {
  right: 42px;
}

.msg-reaction-picker {
  right: 0 !important;
  bottom: 38px !important;
}
/* TALK_MESSAGE_REACTIONS_POSITION_FIX_V2_END */


/* TALK_MESSAGE_REACTIONS_BUTTON_CLEAN_V1_START */
.msg-reaction-open-btn {
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}

.msg-reaction-open-btn:hover,
.msg-reaction-open-btn:focus {
  background: none !important;
  box-shadow: none !important;
}
/* TALK_MESSAGE_REACTIONS_BUTTON_CLEAN_V1_END */


/* TALK_MESSAGE_REACTIONS_PICKER_RIGHT_V1_START */
.msg-reaction-picker {
  left: calc(100% - 12px) !important;
  right: auto !important;
  bottom: 0 !important;
  border-radius: 22px !important;
  gap: 8px !important;
  padding: 9px !important;
}

.msg-reaction-picker__item {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  padding: 4px !important;
}

.msg-reaction-picker__img {
  width: 38px !important;
  height: 38px !important;
}

@media (max-width: 640px) {
  .msg-reaction-picker {
    left: 28px !important;
    right: auto !important;
    bottom: 34px !important;
    max-width: min(88vw, 390px);
    overflow-x: auto;
  }
}
/* TALK_MESSAGE_REACTIONS_PICKER_RIGHT_V1_END */


/* TALK_REACTION_HOVER_ZOOM_V1_START */
.msg-reaction-picker {
  overflow: visible !important;
}

.msg-reaction-picker__item {
  position: relative;
  overflow: visible !important;
  transform-origin: center center;
  transition:
    transform .14s ease,
    background .14s ease,
    filter .14s ease;
}

@media (hover: hover) and (pointer: fine) {
  .msg-reaction-picker__item:hover,
  .msg-reaction-picker__item:focus {
    z-index: 80;
    transform: translateY(-8px) scale(1.72) !important;
    background: transparent !important;
    filter: drop-shadow(0 10px 16px rgba(15, 23, 42, 0.22));
  }
}

.msg-reaction-picker__item.is-long-press-preview {
  z-index: 80;
  transform: translateY(-8px) scale(1.72) !important;
  background: transparent !important;
  filter: drop-shadow(0 10px 16px rgba(15, 23, 42, 0.22));
}
/* TALK_REACTION_HOVER_ZOOM_V1_END */


/* TALK_REACTION_NO_COUNTER_BUTTON_IMAGE_V1_START */
.msg-reaction-chip {
  min-width: 27px;
  width: 27px;
  height: 25px;
  justify-content: center;
  gap: 0 !important;
  padding: 2px 4px !important;
}

.msg-reaction-chip__count {
  display: none !important;
}

.msg-reaction-open-btn.has-reaction {
  width: 30px !important;
  height: 30px !important;
}

.msg-reaction-open-btn__img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.msg-reaction-open-btn.has-reaction .bi {
  display: none !important;
}
/* TALK_REACTION_NO_COUNTER_BUTTON_IMAGE_V1_END */


/* TALK_REACTIONS_GROUP_CHIPS_VISIBLE_V1_START */
.msg-reactions {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  padding-right: 36px;
}

.msg.out .msg-reactions {
  justify-content: flex-end;
  padding-right: 0;
  padding-left: 36px;
}

.msg-reaction-chip {
  width: auto !important;
  min-width: 32px !important;
  height: 25px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px !important;
  padding: 2px 7px 2px 4px !important;
}

.msg-reactions .msg-reaction-chip__count {
  display: inline-block !important;
}

.msg-reaction-open-btn.has-reaction {
  width: 30px !important;
  height: 30px !important;
}

.msg-reaction-open-btn.has-reaction .msg-reaction-open-btn__img {
  width: 22px !important;
  height: 22px !important;
}
/* TALK_REACTIONS_GROUP_CHIPS_VISIBLE_V1_END */


/* TALK_REACTION_SELECTED_TOP_50_V1_START */
.msg-reaction-open-btn.has-reaction {
  width: 56px !important;
  height: 56px !important;
  right: -2px !important;
  top: -18px !important;
  bottom: auto !important;
  padding: 0 !important;
  z-index: 18 !important;
}

.msg-reaction-open-btn__img {
  width: 50px !important;
  height: 50px !important;
  object-fit: contain;
  display: block;
}

.msg.in .msg-bubble--media .msg-reaction-open-btn.has-reaction,
.msg.in .msg-bubble--album .msg-reaction-open-btn.has-reaction {
  right: -2px !important;
  top: -18px !important;
  bottom: auto !important;
}

.msg-reaction-open-btn.has-reaction + .msg-reaction-picker,
.msg-reaction-open-btn.has-reaction ~ .msg-reaction-picker {
  top: 42px !important;
  bottom: auto !important;
}
/* TALK_REACTION_SELECTED_TOP_50_V1_END */


/* TALK_REACTION_SELECTED_BOTTOM_50_V1_START */
.msg-reaction-open-btn.has-reaction {
  width: 56px !important;
  height: 56px !important;
  right: -2px !important;
  top: auto !important;
  bottom: -18px !important;
  padding: 0 !important;
  z-index: 18 !important;
}

.msg-reaction-open-btn.has-reaction .msg-reaction-open-btn__img {
  width: 50px !important;
  height: 50px !important;
  object-fit: contain;
  display: block;
}

.msg.in .msg-bubble--media .msg-reaction-open-btn.has-reaction,
.msg.in .msg-bubble--album .msg-reaction-open-btn.has-reaction {
  right: -2px !important;
  top: auto !important;
  bottom: -18px !important;
}

.msg-reaction-open-btn.has-reaction + .msg-reaction-picker,
.msg-reaction-open-btn.has-reaction ~ .msg-reaction-picker {
  top: auto !important;
  bottom: 46px !important;
}
/* TALK_REACTION_SELECTED_BOTTOM_50_V1_END */


/* TALK_REACTION_DELETE_AND_MOBILE_WRAP_V1_START */
.msg-reaction-picker__item.is-selected {
  background: rgba(219, 234, 254, 0.96) !important;
  box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.28);
}

.msg-reaction-picker__delete {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 0;
  border-radius: 999px;
  background: #fee2e2;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  margin-left: 2px;
}

.msg-reaction-picker__delete:hover,
.msg-reaction-picker__delete:focus {
  background: #fecaca;
}

.msg-reaction-picker__delete .bi {
  font-size: 20px;
  line-height: 1;
}

@media (max-width: 640px) {
  .msg-reaction-picker {
    position: absolute !important;
    left: auto !important;
    right: 0 !important;
    top: auto !important;
    bottom: 46px !important;
    width: min(276px, calc(100vw - 36px)) !important;
    max-width: min(276px, calc(100vw - 36px)) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px !important;
    border-radius: 22px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .msg.in .msg-reaction-picker {
    left: 0 !important;
    right: auto !important;
  }

  .msg.out .msg-reaction-picker {
    right: 0 !important;
    left: auto !important;
  }

  .msg-reaction-picker__item,
  .msg-reaction-picker__delete {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    flex: 0 0 46px !important;
    margin: 0 !important;
  }

  .msg-reaction-picker__img {
    width: 38px !important;
    height: 38px !important;
  }
}

@media (max-width: 380px) {
  .msg-reaction-picker {
    width: min(224px, calc(100vw - 28px)) !important;
    max-width: min(224px, calc(100vw - 28px)) !important;
    gap: 7px !important;
    padding: 9px !important;
  }

  .msg-reaction-picker__item,
  .msg-reaction-picker__delete {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    flex-basis: 42px !important;
  }

  .msg-reaction-picker__img {
    width: 34px !important;
    height: 34px !important;
  }
}
/* TALK_REACTION_DELETE_AND_MOBILE_WRAP_V1_END */


/* TALK_REACTION_SELECTED_BUTTON_HOVER_ZOOM_V1_START */
.msg-reaction-open-btn.has-reaction {
  overflow: visible !important;
}

.msg-reaction-open-btn.has-reaction .msg-reaction-open-btn__img {
  transform-origin: center center;
  transition:
    transform .14s ease,
    filter .14s ease;
}

@media (hover: hover) and (pointer: fine) {
  .msg-reaction-open-btn.has-reaction:hover .msg-reaction-open-btn__img,
  .msg-reaction-open-btn.has-reaction:focus .msg-reaction-open-btn__img {
    transform: scale(1.34) !important;
    filter: drop-shadow(0 10px 16px rgba(15, 23, 42, 0.24));
  }
}
/* TALK_REACTION_SELECTED_BUTTON_HOVER_ZOOM_V1_END */


/* TALK_REACTION_MOBILE_LONG_PREVIEW_V2_START */
.msg-reaction-long-preview {
  position: fixed;
  left: 50%;
  top: 34%;
  z-index: 6000;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) scale(0.72);
  opacity: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    opacity .12s ease,
    transform .14s ease;
}

.msg-reaction-long-preview.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.msg-reaction-long-preview__img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 12px 18px rgba(15, 23, 42, 0.22));
}

@media (hover: none), (pointer: coarse) {
  .msg-reaction-picker__item.is-long-press-preview {
    transform: none !important;
    filter: none !important;
    background: rgba(219, 234, 254, 0.96) !important;
  }

  .msg-reaction-picker {
    touch-action: manipulation;
  }
}

@media (max-width: 420px) {
  .msg-reaction-long-preview {
    top: 30%;
    width: 108px;
    height: 108px;
  }

  .msg-reaction-long-preview__img {
    width: 90px;
    height: 90px;
  }
}
/* TALK_REACTION_MOBILE_LONG_PREVIEW_V2_END */


/* TALK_REACTION_MOBILE_PICKER_LARGE_V1_START */
@media (max-width: 640px) {
  .msg-reaction-picker {
    width: min(330px, calc(100vw - 28px)) !important;
    max-width: min(330px, calc(100vw - 28px)) !important;
    gap: 10px !important;
    padding: 12px !important;
    border-radius: 24px !important;
  }

  .msg-reaction-picker__item,
  .msg-reaction-picker__delete {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    flex: 0 0 58px !important;
  }

  .msg-reaction-picker__img {
    width: 50px !important;
    height: 50px !important;
  }

  .msg-reaction-picker__delete .bi {
    font-size: 24px !important;
  }
}

@media (max-width: 380px) {
  .msg-reaction-picker {
    width: min(292px, calc(100vw - 24px)) !important;
    max-width: min(292px, calc(100vw - 24px)) !important;
    gap: 9px !important;
    padding: 10px !important;
  }

  .msg-reaction-picker__item,
  .msg-reaction-picker__delete {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    flex-basis: 52px !important;
  }

  .msg-reaction-picker__img {
    width: 46px !important;
    height: 46px !important;
  }
}
/* TALK_REACTION_MOBILE_PICKER_LARGE_V1_END */


/* TALK_REACTION_AUTHOR_VISIBLE_V1_START */
.msg-reaction-open-btn.is-readonly {
  cursor: default !important;
  pointer-events: none !important;
}

.msg.out .msg-reaction-open-btn.is-readonly {
  color: inherit;
}
/* TALK_REACTION_AUTHOR_VISIBLE_V1_END */


/* TALK_REACTION_READONLY_HOVER_ZOOM_V1_START */
.msg-reaction-open-btn.is-readonly {
  pointer-events: auto !important;
  cursor: default !important;
  overflow: visible !important;
}

@media (hover: hover) and (pointer: fine) {
  .msg-reaction-open-btn.is-readonly:hover .msg-reaction-open-btn__img,
  .msg-reaction-open-btn.is-readonly:focus .msg-reaction-open-btn__img {
    transform: scale(1.34) !important;
    filter: drop-shadow(0 10px 16px rgba(15, 23, 42, 0.24));
  }
}
/* TALK_REACTION_READONLY_HOVER_ZOOM_V1_END */


/* TALK_REACTION_DESKTOP_PICKER_GRID_LARGE_V1_START */
@media (min-width: 641px) {
  .msg-reaction-picker {
    width: 368px !important;
    max-width: 368px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 14px !important;
    border-radius: 26px !important;
    overflow: visible !important;
  }

  .msg-reaction-picker__item,
  .msg-reaction-picker__delete {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    flex: 0 0 64px !important;
    padding: 5px !important;
    margin: 0 !important;
  }

  .msg-reaction-picker__img {
    width: 56px !important;
    height: 56px !important;
  }

  .msg-reaction-picker__delete .bi {
    font-size: 28px !important;
  }

  .msg-reaction-picker__item:hover,
  .msg-reaction-picker__item:focus {
    z-index: 80 !important;
    transform: translateY(-8px) scale(1.32) !important;
  }
}
/* TALK_REACTION_DESKTOP_PICKER_GRID_LARGE_V1_END */

/* TALK_REACTION_FLOATING_PICKER_MODAL_V1_START */
.msg-reaction-picker--floating {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  z-index: 6100 !important;
  width: min(430px, calc(100vw - 32px)) !important;
  max-width: min(430px, calc(100vw - 32px)) !important;
  max-height: min(78vh, 560px) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 16px !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.26) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden !important;
  box-sizing: border-box !important;
}
.msg-reaction-picker--floating .msg-reaction-picker__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px 0;
}

.msg-reaction-picker--floating .msg-reaction-picker__title {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  color: #334155;
  text-align: center;
}

.msg-reaction-picker--floating .msg-reaction-picker__grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  justify-items: center;
  align-items: center;
  gap: 14px;
  padding: 4px 4px 6px;
}

.msg-reaction-picker--floating .msg-reaction-picker__item,
.msg-reaction-picker--floating .msg-reaction-picker__delete {
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;
  flex: none !important;
  margin: 0 !important;
  padding: 6px !important;
  border-radius: 22px !important;
}

.msg-reaction-picker--floating .msg-reaction-picker__img {
  width: 62px !important;
  height: 62px !important;
}

.msg-reaction-picker--floating .msg-reaction-picker__delete {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

.msg-reaction-picker--floating .msg-reaction-picker__delete .bi {
  font-size: 30px !important;
}

.msg-reaction-picker--floating .msg-reaction-picker__item:hover,
.msg-reaction-picker--floating .msg-reaction-picker__item:focus {
  transform: scale(1.16) !important;
}

@media (max-width: 720px) {
  .msg-reaction-picker--floating {
    width: min(350px, calc(100vw - 24px)) !important;
    max-width: min(350px, calc(100vw - 24px)) !important;
    max-height: min(72vh, 520px) !important;
    padding: 14px !important;
    border-radius: 26px !important;
  }

  .msg-reaction-picker--floating .msg-reaction-picker__grid {
    grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
    gap: 12px;
  }

  .msg-reaction-picker--floating .msg-reaction-picker__item,
  .msg-reaction-picker--floating .msg-reaction-picker__delete {
    width: 66px !important;
    height: 66px !important;
    min-width: 66px !important;
  }

  .msg-reaction-picker--floating .msg-reaction-picker__img {
    width: 58px !important;
    height: 58px !important;
  }
}

@media (max-width: 380px) {
  .msg-reaction-picker--floating {
    width: min(318px, calc(100vw - 18px)) !important;
    max-width: min(318px, calc(100vw - 18px)) !important;
  }

  .msg-reaction-picker--floating .msg-reaction-picker__grid {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
  }

  .msg-reaction-picker--floating .msg-reaction-picker__item,
  .msg-reaction-picker--floating .msg-reaction-picker__delete {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
  }

  .msg-reaction-picker--floating .msg-reaction-picker__img {
    width: 52px !important;
    height: 52px !important;
  }
}
/* TALK_REACTION_FLOATING_PICKER_MODAL_V1_END */


/* TALK_REACTION_FLOATING_PICKER_TWO_ROWS_V1_START */
.msg-reaction-picker--floating {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: 12px !important;
}

.msg-reaction-picker--floating .msg-reaction-picker__head {
  grid-row: 1 !important;
  min-height: 30px !important;
  padding: 0 8px 4px !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
}

.msg-reaction-picker--floating .msg-reaction-picker__title {
  width: 100% !important;
  font-size: 15px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  text-align: center !important;
}

.msg-reaction-picker--floating .msg-reaction-picker__grid {
  grid-row: 2 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(72px, 1fr)) !important;
  justify-items: center !important;
  align-items: start !important;
  gap: 14px !important;
  padding: 4px 6px 8px !important;
}

@media (max-width: 720px) {
  .msg-reaction-picker--floating {
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .msg-reaction-picker--floating .msg-reaction-picker__head {
    min-height: 28px !important;
    padding-bottom: 4px !important;
  }

  .msg-reaction-picker--floating .msg-reaction-picker__title {
    font-size: 14px !important;
  }

  .msg-reaction-picker--floating .msg-reaction-picker__grid {
    grid-template-columns: repeat(3, minmax(66px, 1fr)) !important;
    gap: 12px !important;
    padding: 4px 4px 6px !important;
  }
}

@media (max-width: 380px) {
  .msg-reaction-picker--floating .msg-reaction-picker__grid {
    grid-template-columns: repeat(3, minmax(60px, 1fr)) !important;
    gap: 10px !important;
  }
}
/* TALK_REACTION_FLOATING_PICKER_TWO_ROWS_V1_END */

/* TALK_NOTIFICATIONS_TAB_BADGE_V2_START */
.tab.tab--notifications {
  position: relative;
}

.tab.tab--notifications.has-unread {
  color: #2563eb;
}

.notifications-tab-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 11px;
  line-height: 17px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 0 0 2px #ffffff;
  pointer-events: none;
  z-index: 2;
}
/* TALK_NOTIFICATIONS_TAB_BADGE_V2_END */

/* TALK_NOTIFICATION_ACTION_LINK_MODERN_V1_START */
.notification-card__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
}

.notification-card__action-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #7a8a9c;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  transition:
    color .14s ease,
    opacity .14s ease;
}

.notification-card.is-unread
.notification-card__action-link {
  color: #1976d2;
  font-weight: 600;
}

.notification-card__action-link:hover,
.notification-card__action-link:focus-visible {
  color: #0d63b8;
  background: transparent;
  text-decoration: none;
  opacity: .84;
  outline: none;
}

.notification-card__action-link .bi {
  font-size: 12px;
  line-height: 1;
}
/* TALK_NOTIFICATION_ACTION_LINK_MODERN_V1_END */

/* TALK_ATTACHMENT_FILENAME_ELLIPSIS_V1 */
.msg-bubble--album .msg-attachments-list,
.msg-attachments-list {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.msg-attachment {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.msg-attachment__meta {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.msg-attachment__name {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-attachment__sub {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* MESSAGE_MEDIA_LOADER_V1 */
.msg-media__img-wrap.is-loading,
.msg-media__video-wrap.is-loading,
.msg-album__item.is-loading {
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.32), transparent 28%),
    linear-gradient(135deg, #dbe4ef, #eef3f8);
}

.msg-media__loader,
.msg-media__error {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
}

.msg-media__img-wrap.is-loading .msg-media__loader,
.msg-media__video-wrap.is-loading .msg-media__loader,
.msg-album__item.is-loading .msg-media__loader {
  display: flex;
}

.msg-media__img-wrap.is-error .msg-media__error,
.msg-media__video-wrap.is-error .msg-media__error,
.msg-album__item.is-error .msg-media__error {
  display: flex;
  color: #64748b;
  font-size: 28px;
  background: rgba(226, 232, 240, 0.82);
}

.msg-media__spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(37, 99, 235, 0.18);
  border-top-color: #2563eb;
  animation: talk-message-media-spin .85s linear infinite;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.48);
}

.msg.out .msg-media__spinner {
  border-color: rgba(255, 255, 255, 0.32);
  border-top-color: #ffffff;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.16);
}

.msg-media__img-wrap.is-loading .msg-media__img,
.msg-media__video-wrap.is-loading .msg-media__video-poster,
.msg-album__item.is-loading .msg-album__img {
  opacity: 0.28;
}

.msg-media__img-wrap.is-loaded .msg-media__img,
.msg-media__video-wrap.is-loaded .msg-media__video-poster,
.msg-album__item.is-loaded .msg-album__img {
  opacity: 1;
  transition: opacity .16s ease;
}

@keyframes talk-message-media-spin {
  to {
    transform: rotate(360deg);
  }
}


/* TALK_CONNECTION_STATUS_V1 */
.talk-connection-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 9999;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 560px);
  padding: 12px 16px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 16px;
  background: rgba(127, 29, 29, 0.94);
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  font-size: 14px;
  line-height: 1.35;
}

.talk-connection-banner.hidden {
  display: none;
}

.talk-connection-banner__dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fca5a5;
  box-shadow: 0 0 0 0 rgba(252, 165, 165, 0.7);
  animation: talk-connection-pulse 1.4s ease-out infinite;
}

@keyframes talk-connection-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(252, 165, 165, 0.7);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(252, 165, 165, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(252, 165, 165, 0);
  }
}

@media (max-width: 720px) {
  .talk-connection-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
    max-width: none;
    align-items: flex-start;
  }
}


/* FAST_SEND_BUTTON_LOADER_V1 */
.composer-send.is-sending {
  cursor: wait;
}

.composer-send__spinner {
  width: 18px;
  height: 18px;
  display: inline-block;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: composer-send-spin .8s linear infinite;
}

@keyframes composer-send-spin {
  to {
    transform: rotate(360deg);
  }
}
/* TALK_GROUP_MESSAGE_AVATARS_V1 */
.msg--with-sender-avatar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.msg--with-sender-avatar.in {
  justify-content: flex-start;
}

.msg--with-sender-avatar.out {
  justify-content: flex-end;
}

.msg--with-sender-avatar.out .msg-sender-avatar-slot {
  order: 2;
}

.msg--with-sender-avatar.out .msg-content-stack {
  order: 1;
  align-items: flex-end;
}

.msg--with-sender-avatar.in .msg-content-stack {
  align-items: flex-start;
}

.msg-sender-avatar-slot {
  width: 30px;
  min-width: 30px;
  height: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 2px;
}

.avatar--message {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
}

.avatar--message .avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-content-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: min(76%, 680px);
}

.msg--with-sender-avatar .msg-bubble,
.msg--with-sender-avatar .msg-audio-only-wrap {
  max-width: 100%;
}

@media (max-width: 760px) {
  .msg--with-sender-avatar {
    gap: 6px;
  }

  .msg-sender-avatar-slot {
    width: 26px;
    min-width: 26px;
    height: 26px;
  }

  .avatar--message {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 10px;
  }

  .msg-content-stack {
    max-width: calc(100% - 34px);
  }
}
/* TALK_GROUP_HEADER_MEMBER_AVATARS_V1 */
#chatSubTitle.chat-subtitle--group-members {
  display: flex;
  align-items: center;
  min-height: 24px;
  margin-top: 2px;
}

.chat-group-subtitle {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  line-height: 1.2;
}

.chat-group-subtitle__label {
  white-space: nowrap;
}

.chat-group-subtitle__dot {
  opacity: .7;
}

.chat-group-members-avatars {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-left: 2px;
}

.chat-group-member-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -6px;
}

.chat-group-member-avatar:first-child {
  margin-left: 0;
}

.avatar--header-member {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  overflow: hidden;
  font-size: 8px;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .95);
}

.avatar--header-member .avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-group-members-extra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 22px;
  padding: 0 6px;
  margin-left: -4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .08);
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .95);
}

@media (max-width: 760px) {
  .chat-group-subtitle {
    gap: 4px;
  }

  .avatar--header-member {
    width: 20px;
    height: 20px;
    min-width: 20px;
    font-size: 8px;
  }

  .chat-group-members-extra {
    height: 20px;
    min-width: 20px;
    font-size: 9px;
  }
}

/* TALK_CHAT_HEAD_RIGHT_GAP_V1 */
.chat-head-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.chat-head-right > .btn {
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .chat-head-right {
    gap: 6px;
  }
}

/* TALK_MESSAGE_STACK_WIDTH_FIX_V1 */
.msg-content-stack {
  width: fit-content;
  max-width: min(560px, 72%);
}

.msg-content-stack .msg-bubble,
.msg-content-stack .msg-audio-only-wrap {
  max-width: 100%;
}

.msg.in .msg-content-stack {
  align-items: flex-start;
}

.msg.out .msg-content-stack {
  align-items: flex-end;
}

@media (max-width: 760px) {
  .msg-content-stack {
    max-width: min(560px, 82%);
  }

  .msg--with-sender-avatar .msg-content-stack {
    max-width: calc(100% - 34px);
  }
}


/* TALK_MOBILE_GROUP_HEADER_AVATARS_CAROUSEL_V1 */
.chat-group-members-avatars {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chat-group-members-avatars::-webkit-scrollbar {
  display: none;
}

.chat-group-member-avatar {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .chat-head-left {
    min-width: 0;
    flex: 1 1 auto;
  }

  .chat-head-meta {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  #chatSubTitle.chat-subtitle--group-members {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  #chatSubTitle.chat-subtitle--group-members .chat-group-subtitle {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
  }

  #chatSubTitle.chat-subtitle--group-members .chat-group-subtitle__label,
  #chatSubTitle.chat-subtitle--group-members .chat-group-subtitle__dot {
    display: none !important;
  }

  #chatSubTitle.chat-subtitle--group-members .chat-group-members-avatars {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 4px;
    scroll-snap-type: x proximity;
  }

  #chatSubTitle.chat-subtitle--group-members .chat-group-member-avatar {
    margin-left: -3px;
    scroll-snap-align: start;
  }

  #chatSubTitle.chat-subtitle--group-members .chat-group-member-avatar:first-child {
    margin-left: 0;
  }

  #chatSubTitle.chat-subtitle--group-members .avatar--header-member {
    width: 22px;
    height: 22px;
    min-width: 22px;
    font-size: 9px;
  }

  #chatSubTitle.chat-subtitle--group-members .avatar--header-member .avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}


/* TALK_MEDIA_PRELOADER_BUBBLES_V1 */
.msg-media__img-wrap,
.msg-media__video-wrap,
.msg-album__item {
  overflow: hidden;
}

.msg-media__img-wrap.is-loading,
.msg-media__video-wrap.is-loading,
.msg-album__item.is-loading {
  position: relative;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), rgba(255,255,255,0) 36%),
    linear-gradient(135deg, rgba(148,163,184,0.20), rgba(226,232,240,0.36));
}

.msg-media__img-wrap.is-loading::after,
.msg-media__video-wrap.is-loading::after,
.msg-album__item.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.30) 45%,
    rgba(255,255,255,0) 80%
  );
  transform: translateX(-120%);
  animation: talk-media-preloader-shimmer 1.15s ease-in-out infinite;
}

.msg-media__img-wrap.is-loading .msg-media__loader,
.msg-media__video-wrap.is-loading .msg-media__loader,
.msg-album__item.is-loading .msg-media__loader {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 4;
}

.msg-media__img-wrap.is-loading .msg-media__img,
.msg-media__video-wrap.is-loading .msg-media__video-poster,
.msg-album__item.is-loading .msg-album__img {
  opacity: 0.18 !important;
  filter: blur(1.5px);
  transform: scale(1.01);
}

.msg-media__img-wrap.is-loaded .msg-media__img,
.msg-media__video-wrap.is-loaded .msg-media__video-poster,
.msg-album__item.is-loaded .msg-album__img {
  opacity: 1;
  filter: none;
  transform: none;
  transition: opacity .18s ease, filter .18s ease, transform .18s ease;
}

.msg-media__spinner {
  animation: talk-media-preloader-spin .78s linear infinite;
}

@keyframes talk-media-preloader-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes talk-media-preloader-shimmer {
  100% {
    transform: translateX(120%);
  }
}

/* TALK_REACTIONS_RIGHT_FOOTER_V2_START */
.msg-footer-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
}

.msg-footer-left {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 6px !important;
  min-width: 0;
}

.msg-footer-right {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 5px !important;
  min-width: 0;
  margin-left: auto !important;
}

.msg-footer-row .msg-status {
  flex: 0 0 auto;
}

.msg-footer-row .msg-meta {
  flex: 0 0 auto;
  margin: 0 !important;
  white-space: nowrap;
}

.msg-footer-right .msg-reactions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 4px !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
}

.msg.out .msg-footer-right .msg-reactions {
  justify-content: flex-end !important;
  padding: 0 !important;
}

.msg-footer-row .msg-reaction-chip {
  margin: 0 !important;
}

.msg-footer-row .msg-reaction-open-btn,
.msg-footer-row .msg-reaction-open-btn.has-reaction {
  position: static !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 6 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 24px !important;
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #94a3b8 !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.msg-footer-row .msg-reaction-open-btn:hover,
.msg-footer-row .msg-reaction-open-btn:focus {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #64748b !important;
  box-shadow: none !important;
}

.msg-footer-row .msg-reaction-open-btn .bi {
  display: inline-block !important;
  color: inherit !important;
  font-size: 15px !important;
  line-height: 1 !important;
}

.msg-footer-row .msg-reaction-open-btn__img {
  display: none !important;
}

.msg.in .msg-bubble:not(.msg-bubble--media):not(.msg-bubble--album):not(.msg-bubble--payment) {
  padding-right: 12px !important;
}

.msg-footer-row.msg-meta-row--overlay,
.msg-footer-row--overlay {
  display: flex !important;
  align-items: center !important;
  width: auto;
  max-width: calc(100% - 16px);
  margin-top: 0;
}

.msg-footer-row--overlay .msg-footer-left {
  flex: 0 0 auto;
}

.msg-footer-row--overlay .msg-footer-right {
  flex: 0 1 auto;
  margin-left: 6px !important;
}

.msg-footer-row--overlay .msg-reaction-open-btn {
  flex-basis: 24px !important;
  background: rgba(15, 23, 42, 0.36) !important;
  color: #ffffff !important;
}

@media (max-width: 640px) {
  .msg-footer-row {
    gap: 6px !important;
  }

  .msg-footer-left {
    gap: 5px !important;
  }

  .msg-footer-right {
    gap: 4px !important;
  }

  .msg-footer-row .msg-reaction-open-btn,
  .msg-footer-row .msg-reaction-open-btn.has-reaction {
    flex-basis: 23px !important;
    width: 23px !important;
    min-width: 23px !important;
    height: 23px !important;
    min-height: 23px !important;
  }
}
/* TALK_REACTIONS_RIGHT_FOOTER_V2_END */

/* TALK_HIDE_DEACTIVATED_DIALOGS_V1_START */
.profile-setting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.82);
}

.profile-setting-card__main {
  min-width: 0;
}

.profile-setting-card__title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.profile-setting-card__sub {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
}

.profile-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  cursor: pointer;
  user-select: none;
}

.profile-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-switch__slider {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
  transition: background .16s ease, box-shadow .16s ease;
}

.profile-switch__slider::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.22);
  transition: transform .16s ease;
}

.profile-switch input:checked + .profile-switch__slider {
  background: #0d6efd;
  box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.18);
}

.profile-switch input:checked + .profile-switch__slider::after {
  transform: translateX(20px);
}

.profile-switch__label {
  min-width: 76px;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
}

.profile-switch.is-saving {
  opacity: 0.62;
  cursor: wait;
}

@media (max-width: 640px) {
  .profile-setting-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-switch {
    width: 100%;
    justify-content: space-between;
  }
}
/* TALK_HIDE_DEACTIVATED_DIALOGS_V1_END */


/* TALK_MESSAGE_READERS_POPOVER_V1 */
.msg-status.msg-status--read {
  cursor: pointer;
}

.talk-readers-popover {
  position: fixed;
  z-index: 9999;
  display: none;
  width: 280px;
  max-width: calc(100vw - 20px);
  max-height: min(360px, calc(100vh - 24px));
  overflow: hidden;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.talk-readers-popover.is-open {
  display: block;
}

.talk-readers-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px;
}

.talk-readers-popover__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
}

.talk-readers-popover__close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 20px;
  line-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.talk-readers-popover__close:hover {
  background: rgba(255,255,255,.18);
}

.talk-readers-popover__summary {
  padding: 0 12px 9px;
  font-size: 12px;
  color: rgba(255,255,255,.72);
}

.talk-readers-popover__body {
  padding: 12px;
}

.talk-readers-popover__loading {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: rgba(255,255,255,.82);
}

.talk-readers-popover__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.28);
  border-top-color: #fff;
  border-radius: 999px;
  animation: talk-readers-spin .8s linear infinite;
}

.talk-readers-popover__list {
  max-height: 240px;
  overflow: auto;
  padding: 0 6px 10px 12px;
}

.talk-readers-popover__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}

.talk-readers-popover__avatar {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.talk-readers-popover__meta {
  min-width: 0;
}

.talk-readers-popover__name {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talk-readers-popover__sub {
  margin-top: 1px;
  font-size: 11px;
  color: rgba(255,255,255,.64);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talk-readers-popover__empty {
  padding: 2px 12px 14px;
  font-size: 13px;
  color: rgba(255,255,255,.78);
}

@keyframes talk-readers-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .talk-readers-popover {
    width: calc(100vw - 24px) !important;
    left: 12px !important;
    right: 12px;
    border-radius: 18px;
  }

  .talk-readers-popover__list {
    max-height: 300px;
  }
}


/* TALK_MESSAGE_READERS_AVATARS_V1 */
.talk-readers-popover__avatar--img {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.10);
}

.talk-readers-popover__avatar--img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.talk-readers-popover__avatar-fallback {
  display: none;
}

.talk-readers-popover__avatar--img.is-avatar-error img {
  display: none;
}

.talk-readers-popover__avatar--img.is-avatar-error .talk-readers-popover__avatar-fallback {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

/* TALK_ALBUM_DOWNLOAD_EACH_ATTACHMENT_V3 */
.msg-album__cell {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.msg-album__cell > .msg-album__item {
  width: 100%;
  height: 100%;
}

.msg-album--count-3 .msg-album__cell:first-child {
  grid-row: span 2;
}

.msg-album__download {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 6;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.74);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  opacity: 0.92;
}

.msg-album__download:hover,
.msg-album__download:focus-visible {
  opacity: 1;
  background: rgba(15, 23, 42, 0.9);
}

.msg-album__download i {
  font-size: 15px;
  line-height: 1;
}


/* TALK_COMPOSER_FILE_DRAFT_SCROLL_V1 */
.composer {
  flex: 0 0 auto;
}

.composer-main {
  min-height: 0;
}

.file-draft:not(.hidden) {
  max-height: min(34vh, 320px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.file-draft__summary {
  position: sticky;
  top: 0;
  z-index: 2;
  background: inherit;
  padding-bottom: 6px;
}

.composer-actions {
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .composer {
    max-height: min(58dvh, 430px);
    overflow: hidden;
  }

  .composer-top {
    min-height: 0;
  }

  .composer-main {
    min-height: 0;
    overflow: hidden;
  }

  .file-draft:not(.hidden) {
    max-height: min(34dvh, 260px);
    padding-right: 6px;
  }

  .composer-actions {
    position: relative;
    z-index: 3;
    background: #ffffff;
  }
}

@media (max-width: 420px) {
  .file-draft:not(.hidden) {
    max-height: min(30dvh, 220px);
  }
}
/* TALK_COMPOSER_FILE_DRAFT_SCROLL_V1_END */

/* TALK_USER_SOFT_DELETE_ADMIN_HARD_DELETE_V2 */
.msg-bubble--deleted {
  opacity: 0.62;
  filter: grayscale(0.35);
  border-style: dashed;
  cursor: default;
}

.msg-bubble--deleted .msg-attachment,
.msg-bubble--deleted .msg-album,
.msg-bubble--deleted .msg-media,
.msg-bubble--deleted .msg-payment-notice {
  pointer-events: none;
}

.msg-deleted-marker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px dashed currentColor;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  opacity: 0.82;
}

.msg-deleted-marker .bi {
  font-size: 13px;
}

/* TALK_EDIT_CANCEL_V1 */
.message-edit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid #dbe3eb;
  border-left: 3px solid #2563eb;
  border-radius: 10px;
  background: #f8fafc;
}

.message-edit-bar__main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.message-edit-bar__icon {
  flex: 0 0 auto;
  font-size: 16px;
  color: #2563eb;
}

.message-edit-bar__content {
  min-width: 0;
}

.message-edit-bar__title {
  overflow: hidden;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-edit-bar__hint {
  overflow: hidden;
  margin-top: 2px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-edit-bar__cancel {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
}

.message-edit-bar__cancel:hover,
.message-edit-bar__cancel:focus-visible {
  background: #e5e7eb;
  color: #111827;
}

.message-edit-bar__cancel .bi {
  font-size: 15px;
}

@media (max-width: 640px) {
  .message-edit-bar {
    gap: 8px;
    padding: 8px 9px;
  }

  .message-edit-bar__hint {
    display: none;
  }
}

/* TALK_COMPOSER_ADAPTIVE_TEXTAREA_V1 */
#messageInput,
.composer textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 52px;
  height: 52px;
  max-height: min(24dvh, 220px);
  overflow-x: hidden;
  overflow-y: hidden;
  resize: none;
  line-height: 1.42;
  scrollbar-width: thin;
  overscroll-behavior: contain;
  transition:
    height 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

#messageInput.message-input--scrollable {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#messageInput::-webkit-scrollbar {
  width: 7px;
}

#messageInput::-webkit-scrollbar-track {
  background: transparent;
}

#messageInput::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.48);
  background-clip: padding-box;
}

#messageInput::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 0.65);
  background-clip: padding-box;
}

@media (max-width: 720px) {
  #messageInput,
  .composer textarea {
    max-height: min(22dvh, 160px);
    transition:
      height 90ms ease,
      border-color 120ms ease,
      box-shadow 120ms ease;
  }
}

@media (max-height: 620px) {
  #messageInput,
  .composer textarea {
    max-height: min(18dvh, 120px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #messageInput,
  .composer textarea {
    transition: none;
  }
}

/* TALK_COMPOSER_TEXTAREA_FLEX_SHRINK_FIX_V1 */
#messageInput,
.composer textarea {
  /*
   * Старое flex: 1 1 0% сжимало textarea до высоты
   * родителя, несмотря на inline height из JavaScript.
   */
  flex: 0 0 auto;
  align-self: stretch;
  min-width: 0;
}

.composer-main {
  /*
   * Контейнер должен принимать фактическую высоту
   * textarea, панели редактирования и файлового черновика.
   */
  height: auto;
  flex: 1 1 auto;
}

.composer-top {
  height: auto;
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .composer-main {
    /*
     * Сохраняем существующую ширину 90%, но запрещаем
     * вертикальное сжатие растущего textarea.
     */
    flex: 0 0 auto;
  }
}

/* TALK_MOBILE_VISUAL_VIEWPORT_KEYBOARD_V1
   Мобильный интерфейс использует фактическую высоту visualViewport.
   Внешняя страница не прокручивается, но body не фиксируется:
   это позволяет браузеру корректно показать экранную клавиатуру.
   Единственный вертикальный scroll-контейнер — messagesBox.
*/
@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body {
    position: relative;
    inset: auto;
    touch-action: manipulation;
  }

  .layout {
    position: fixed;
    top: var(
      --talk-mobile-viewport-offset-top,
      0px
    );
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: var(
      --talk-mobile-viewport-height,
      100dvh
    );
    min-height: 0;
    max-height: var(
      --talk-mobile-viewport-height,
      100dvh
    );
    overflow: hidden;
    overscroll-behavior: none;
  }

  .chat-area {
    position: absolute;
    inset: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .chat-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    display: grid;
    grid-template-rows:
      auto
      minmax(0, 1fr)
      auto;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .chat-head {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 35;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
    align-self: stretch;
    transform: none;
  }

  .messages-box {
    position: relative;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    contain: layout paint;
  }

  .composer {
    position: relative;
    grid-row: 3;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
    align-self: stretch;
    transform: none;
  }
}




/* =========================================================
   TALK_NOTIFICATIONS_MARK_ALL_READ_V1
   Панель массового прочтения оповещений
   ========================================================= */

.notifications-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.notifications-toolbar .notifications-hint {
  min-width: 0;
  margin: 0;
}

.notifications-read-all {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(13, 110, 253, 0.22);
  border-radius: 8px;
  background: rgba(13, 110, 253, 0.07);
  color: #0d6efd;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.notifications-read-all:hover {
  background: rgba(13, 110, 253, 0.12);
  border-color: rgba(13, 110, 253, 0.34);
}

.notifications-read-all:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.28);
  outline-offset: 2px;
}

.notifications-read-all:disabled,
.notifications-read-all.is-loading {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.notifications-read-all.is-loading .bi {
  animation: notifications-read-all-spin 0.8s linear infinite;
}

@keyframes notifications-read-all-spin {
  to {
    transform: rotate(360deg);
  }
}

/*
 * TALK_GROUP_BUTTON_DIALOGS_ONLY_NOTIFICATIONS_ROW_V2
 * Подсказка и кнопка массового прочтения
 * остаются в одной строке на узких экранах.
 */
@media (max-width: 520px) {
  .notifications-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .notifications-toolbar .notifications-hint {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 10px;
    line-height: 1.2;
  }

  .notifications-read-all {
    flex: 0 0 auto;
    align-self: auto;
    min-height: 28px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .notifications-read-all .bi {
    display: none;
  }
}


/* =========================================================
   TALK_GROUP_BUTTON_DIALOGS_ONLY_NOTIFICATIONS_ROW_V2
   Вкладки и строка управления оповещениями
   ========================================================= */

.group-chat-actions[hidden],
#groupChatCreateBtn[hidden] {
  display: none !important;
}

.notifications-toolbar {
  flex-wrap: nowrap;
}

.notifications-toolbar .notifications-hint {
  flex: 1 1 auto;
  min-width: 0;
}

.notifications-read-all {
  flex: 0 0 auto;
  white-space: nowrap;
}


/* =========================================================
   TALK_NOTIFICATIONS_TOOLBAR_EQUAL_HEIGHT_V1
   Одинаковая высота подсказки и кнопки
   ========================================================= */

.notifications-toolbar {
  align-items: stretch;
}

.notifications-toolbar .notifications-hint,
.notifications-toolbar .notifications-read-all {
  min-height: 38px;
  box-sizing: border-box;
}

.notifications-toolbar .notifications-hint {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  line-height: 1.2;
}

.notifications-toolbar .notifications-read-all {
  height: auto;
  padding-top: 5px;
  padding-bottom: 5px;
}

@media (max-width: 520px) {
  .notifications-toolbar {
    align-items: stretch;
  }

  .notifications-toolbar .notifications-hint,
  .notifications-toolbar .notifications-read-all {
    min-height: 32px;
  }

  .notifications-toolbar .notifications-hint {
    padding: 4px 7px;
  }

  .notifications-toolbar .notifications-read-all {
    padding-top: 4px;
    padding-bottom: 4px;
  }
}


/* =========================================================
   TALK_FORWARD_MOBILE_COMPACT_ACTIONS_V1
   Компактное окно пересылки на мобильных устройствах
   ========================================================= */

@media (max-width: 720px) {
  .forward-modal-card {
    position: relative;
    padding-top: 16px;
  }

  .forward-modal-head {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: auto;
    min-width: 0;
  }

  .forward-modal-head h2 {
    display: none;
  }

  .forward-preview-box {
    display: none;
  }

  .forward-modal-close {
    width: 38px;
    height: 38px;
  }

  .forward-modal-close .bi {
    font-size: 23px;
  }

  .forward-controls {
    margin-top: 34px;
  }

  .forward-modal-actions {
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 1.35fr);
    gap: 10px;
    width: 100%;
    margin-top: 16px;
  }

  .forward-modal-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.15;
  }

  #forwardMessageCancelBtn {
    background: #f1f5f9;
    color: #334155;
  }

  #forwardMessageSubmitBtn {
    box-shadow:
      0 8px 20px rgba(51, 144, 236, 0.22);
  }

  #forwardMessageSubmitBtn:disabled {
    box-shadow: none;
  }
}

@media (max-width: 420px) {
  .forward-modal-actions {
    grid-template-columns:
      minmax(0, 0.9fr)
      minmax(0, 1.25fr);
    gap: 8px;
  }

  .forward-modal-actions .btn {
    min-height: 52px;
    padding-left: 12px;
    padding-right: 12px;
    font-size: 14px;
  }
}


/* =========================================================
   TALK_FORWARD_SUBMIT_BLUE_0D6EFD_V1
   Основной цвет кнопки пересылки
   ========================================================= */

#forwardMessageSubmitBtn {
  border-color: #0d6efd;
  background: #0d6efd;
  color: #ffffff;
  box-shadow:
    0 8px 20px rgba(13, 110, 253, 0.24);
}

#forwardMessageSubmitBtn:hover:not(:disabled) {
  border-color: #0b5ed7;
  background: #0b5ed7;
  color: #ffffff;
  box-shadow:
    0 10px 24px rgba(13, 110, 253, 0.30);
}

#forwardMessageSubmitBtn:active:not(:disabled) {
  border-color: #0a58ca;
  background: #0a58ca;
  color: #ffffff;
  box-shadow:
    0 5px 14px rgba(13, 110, 253, 0.24);
  transform: translateY(1px);
}

#forwardMessageSubmitBtn:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.24);
  outline-offset: 2px;
}

#forwardMessageSubmitBtn:disabled {
  border-color: #a9c7f7;
  background: #a9c7f7;
  color: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

/* TALK_READ_ALL_FULL_WIDTH_V1_START */
.notifications-toolbar--read-all-only {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: auto;
  margin: 0 8px 6px;
}

.notifications-toolbar--read-all-only
.notifications-read-all {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 38px;
  height: auto;
  padding: 7px 12px;
  box-sizing: border-box;
  white-space: nowrap;
}

.notifications-toolbar--read-all-only
.notifications-read-all span {
  display: inline-block;
  white-space: nowrap;
}

.notification-attention-hint {
  margin: -1px 14px 9px;
  padding: 0;
  color: #8a98a8;
  font-size: 11.5px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .notifications-toolbar--read-all-only {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    width: auto;
    margin-right: 8px;
    margin-left: 8px;
    gap: 0;
  }

  .notifications-toolbar--read-all-only
  .notifications-read-all {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  .notifications-toolbar--read-all-only
  .notifications-read-all .bi {
    display: inline-block;
  }

  .notification-attention-hint {
    margin-right: 12px;
    margin-left: 12px;
    font-size: 11px;
  }
}
/* TALK_READ_ALL_FULL_WIDTH_V1_END */



/* TALK_SCHEDULED_MESSAGES_FRONTEND_V1_START */

.scheduled-send-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 8px 0 2px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 14px;
  background: rgba(255, 251, 235, 0.98);
  box-sizing: border-box;
}

.scheduled-send-panel__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #b45309;
  font-size: 13px;
  font-weight: 700;
}

.scheduled-send-panel__controls {
  display: flex;
  align-items: end;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

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

.scheduled-send-field__label {
  color: #78716c;
  font-size: 11px;
  font-weight: 600;
}

.scheduled-send-field__input {
  height: 34px;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #d6d3d1;
  border-radius: 9px;
  background: #ffffff;
  color: #1c1917;
  font: inherit;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.scheduled-send-field__input:focus {
  border-color: #f59e0b;
  box-shadow:
    0 0 0 3px rgba(245, 158, 11, 0.14);
}

.scheduled-send-summary {
  min-width: 180px;
  padding: 0 2px 7px;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.composer-send.is-scheduled-mode {
  border-color: #f59e0b !important;
  background: #f59e0b !important;
  color: #ffffff !important;
  box-shadow:
    0 7px 18px rgba(245, 158, 11, 0.28) !important;
}

.composer-send.is-scheduled-mode:hover,
.composer-send.is-scheduled-mode:focus {
  border-color: #d97706 !important;
  background: #d97706 !important;
}

.composer-send.is-scheduled-mode:disabled {
  opacity: 0.76;
}

/* TALK_SCHEDULED_MOBILE_WIDTH_V2 */
@media (max-width: 720px) {
  .scheduled-send-panel {
    width: 90%;
    min-width: 0;
    max-width: 90%;
    margin: 7px 0 2px;
    padding: 9px 10px;
    align-self: center;
    box-sizing: border-box;
  }

  .scheduled-send-panel__controls {
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 0.72fr);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    gap: 7px;
    box-sizing: border-box;
  }

  .scheduled-send-field {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .scheduled-send-field__input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .scheduled-send-summary {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 1px 1px 0;
    box-sizing: border-box;
    white-space: normal;
  }

  .composer-send.is-scheduled-mode {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
  }
}

/* TALK_SCHEDULED_MESSAGES_FRONTEND_V1_END */

/* TALK_SCHEDULED_PENDING_BUBBLE_V2_START */

.scheduled-pending-root {
  display: contents;
}

.msg.out.msg--scheduled-pending {
  width: 100%;
  justify-content: flex-end;
}

.msg.out.msg--scheduled-pending
.msg-bubble.msg-bubble--scheduled-pending {
  position: relative;
  width: auto;
  min-width: 96px;
  max-width: min(560px, 72%);
  padding: 10px 12px 9px;

  border:
    1px solid rgba(
      217,
      119,
      6,
      0.28
    );

  border-top-right-radius: 8px;

  background:
    linear-gradient(
      180deg,
      #fff8eb 0%,
      #ffedcf 100%
    );

  color: #3f2d18;

  box-shadow:
    0 7px 20px
      rgba(180, 83, 9, 0.09);

  box-sizing: border-box;
}

.scheduled-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin: 0 0 7px;
}

.scheduled-pending-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;

  color: #b45309;

  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
}

.scheduled-pending-state .bi {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
}

.scheduled-pending-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.scheduled-pending-action {
  appearance: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;

  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 7px;

  background: transparent;
  color: #a16207;

  box-shadow: none;
  cursor: pointer;

  transition:
    background 0.14s ease,
    color 0.14s ease;
}

.scheduled-pending-action .bi {
  font-size: 13px;
  line-height: 1;
}

.scheduled-pending-action:hover,
.scheduled-pending-action:focus-visible {
  background:
    rgba(
      180,
      83,
      9,
      0.09
    );

  color: #92400e;
  outline: none;
}

.scheduled-pending-action--delete {
  color: #b45309;
}

.scheduled-pending-action--delete:hover,
.scheduled-pending-action--delete:focus-visible {
  background:
    rgba(
      220,
      38,
      38,
      0.08
    );

  color: #dc2626;
}

.msg.out.msg--scheduled-pending
.msg-bubble.msg-bubble--scheduled-pending
.msg-text {
  width: 100%;
  min-width: 0;
  max-width: 100%;

  color: #3f2d18;

  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;

  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg.out.msg--scheduled-pending
.msg-bubble.msg-bubble--scheduled-pending
.msg-link,
.msg.out.msg--scheduled-pending
.msg-bubble.msg-bubble--scheduled-pending
.msg-inline-copy {
  color: #92400e;
}

.scheduled-pending-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;

  width: 100%;
  min-width: 0;

  margin-top: 7px;

  color: #a16207;

  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 500;

  font-variant-numeric:
    tabular-nums;
}

.scheduled-pending-meta .bi {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
}

.scheduled-pending-reply {
  display: flex;
  align-items: center;
  gap: 5px;

  width: 100%;
  min-width: 0;

  margin: 0 0 7px;
  padding: 6px 8px;

  border-left:
    3px solid
      rgba(
        217,
        119,
        6,
        0.48
      );

  border-radius: 7px;

  background:
    rgba(
      255,
      255,
      255,
      0.52
    );

  color: #92400e;

  font-size: 11px;
  line-height: 1.25;

  box-sizing: border-box;
}

@media (max-width: 760px) {
  .msg.out.msg--scheduled-pending
  .msg-bubble.msg-bubble--scheduled-pending {
    max-width:
      min(
        calc(100% - 28px),
        560px
      );

    padding:
      10px 12px 9px;
  }

  .scheduled-pending-action {
    width: 26px;
    min-width: 26px;
    height: 26px;
    min-height: 26px;
  }
}

@media (max-width: 480px) {
  .msg.out.msg--scheduled-pending
  .msg-bubble.msg-bubble--scheduled-pending {
    max-width:
      calc(100% - 20px);
  }
}

/* TALK_SCHEDULED_PENDING_BUBBLE_V2_END */
