/* admin-chat-sidebar-search */
.admin-chat-sidebar .sidebar-search-wrap {
  padding: 8px 12px 6px;
  flex-shrink: 0;
}

.admin-chat-sidebar .sidebar-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.38) !important;
  border-radius: 8px;
  background: rgba(28, 28, 28, 0.98) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;
  font-size: 14px;
  outline: none;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.45);
}

.admin-chat-sidebar .sidebar-search-input::placeholder {
  color: rgba(255, 255, 255, 0.55) !important;
  opacity: 1;
}

.admin-chat-sidebar .sidebar-search-input:focus {
  border-color: rgba(51, 144, 236, 0.85) !important;
  box-shadow: 0 0 0 2px rgba(51, 144, 236, 0.28), inset 0 1px 4px rgba(0, 0, 0, 0.45);
}

.admin-chat-sidebar .sidebar-search-input:-webkit-autofill,
.admin-chat-sidebar .sidebar-search-input:-webkit-autofill:hover,
.admin-chat-sidebar .sidebar-search-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(28, 28, 28, 0.98) inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;
}

.admin-chat-sidebar .sidebar-search-empty {
  padding: 12px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}


/* Admin chat — desktop size override (1game.su) */
@media (min-width: 769px) {.admin-chat-panel.open {
    width: 92vw !important;
    max-width: 1280px !important;
    height: 88vh !important;
    max-height: min(88vh, calc(100vh - 40px)) !important;
    margin-top: 10px !important;
    border-radius: 14px !important;
  }

  .admin-chat-sidebar {
    width: 460px !important;
    min-width: 460px !important;
  }

  .admin-chat-head {
    min-height: 52px !important;
    font-size: 18px !important;
    padding: 0 16px 0 20px !important;
  }

  .admin-chat-head .chat-title-text {
    font-size: 18px !important;
  }

  .admin-chat-sidebar .sidebar-header .admin-title-gold {
    font-size: 22px !important;
  }

  .admin-chat-sidebar .sidebar-header .sidebar-title-row span:first-child {
    font-size: 19px !important;
  }

  .admin-chat-sidebar .user-item {
    padding: 10px 14px !important;
    min-height: 56px !important;
  }

  .admin-chat-sidebar .user-item .user-avatar {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    font-size: 15px !important;
  }

  .admin-chat-sidebar .user-item .user-name {
    font-size: 16px !important;
  }

  .admin-messages {
    padding: 12px 20px !important;
  }

  .admin-messages .msg {
    font-size: 15px !important;
    padding: 8px 12px !important;
    max-width: 72% !important;
  }

  .admin-messages .msg-text {
    font-size: 15px !important;
    line-height: 1.45 !important;
  }

  .admin-messages .msg-meta,
  .admin-messages .msg-time {
    font-size: 12px !important;
  }

  .admin-messages .msg-img {
    max-height: 320px !important;
  }

  .admin-chat-foot {
    padding: 10px 14px !important;
  }

  .admin-chat-input-row input {
    height: 44px !important;
    min-height: 44px !important;
    font-size: 16px !important;
    padding: 8px 14px !important;
  }

  .admin-chat-input-row .admin-chat-img-btn,
  .admin-chat-input-row .send-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .admin-chat-btn {
    padding: 12px 20px !important;
    font-size: 15px !important;
  }

  .admin-chat-btn svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* admin-chat-dialog-wallet */
  .admin-chat-wallet-bar {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #252525;
    flex-shrink: 0;
  }

  .admin-chat-wallet-bar.visible {
    display: flex;
  }

  .admin-chat-wallet-bar .wallet-bar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .admin-chat-wallet-bar .wallet-bar-balance {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
  }

  .admin-chat-wallet-bar .wallet-bar-balance strong {
    color: #9bd0ff;
    font-size: 16px;
  }

  .admin-chat-wallet-bar .wallet-bar-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }

  .admin-chat-wallet-bar input {
    width: 110px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 14px;
  }

  .admin-chat-wallet-bar button {
    height: 36px;
    padding: 0 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }

  .admin-chat-wallet-bar button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .admin-chat-wallet-bar .wallet-credit {
    background: #2ecc71;
    color: #fff;
  }

  .admin-chat-wallet-bar .wallet-debit {
    background: #e74c3c;
    color: #fff;
  }

  .admin-chat-wallet-bar .wallet-refresh {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .admin-chat-wallet-bar .wallet-bar-msg {
    font-size: 12px;
    min-height: 16px;
  }

  .admin-chat-wallet-bar .wallet-bar-msg.ok {
    color: #6ee7a0;
  }

  .admin-chat-wallet-bar .wallet-bar-msg.err {
    color: #ff8a8a;
  }

/* admin-chat-pro-ui */
/* admin-chat-pro-ui */
.admin-chat-panel.open {
  border-radius: 22px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset !important;
  overflow: hidden !important;
  backdrop-filter: blur(12px);
}

@media (max-width: 768px) {
  .admin-chat-panel.open {
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
}

.admin-chat-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(180deg, rgba(22, 24, 30, 0.98), rgba(16, 17, 22, 0.98)) !important;
}

.admin-chat-main {
  background: linear-gradient(180deg, rgba(18, 19, 24, 0.98), rgba(12, 13, 17, 0.98)) !important;
}

.admin-chat-sidebar .user-item {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto;
  gap: 1px 10px !important;
  align-items: center !important;
  border-radius: 14px !important;
  margin: 4px 10px !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background 0.18s ease, border-color 0.18s ease;
  min-height: 68px !important;
  height: auto !important;
  overflow: hidden !important;
  position: relative !important;
  flex-wrap: nowrap !important;
}

.admin-chat-sidebar .user-item .user-avatar {
  grid-row: 1 / 3;
  grid-column: 1;
  align-self: start;
  margin-top: 2px;
}

.admin-chat-sidebar .user-item .user-name {
  grid-row: 1;
  grid-column: 2;
  font-weight: 600 !important;
  min-width: 0 !important;
  padding-right: 4px;
}

.admin-chat-sidebar .user-item .user-unread-badge {
  grid-row: 1;
  grid-column: 3;
}

.admin-chat-sidebar .user-item .user-profile-btn {
  grid-row: 1;
  grid-column: 4;
}

@media (min-width: 769px) {
  .admin-chat-sidebar .user-item {
    min-height: 72px !important;
    padding: 10px 12px !important;
  }
}

.admin-chat-sidebar .user-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.admin-chat-sidebar .user-item.active {
  background: rgba(51, 144, 236, 0.14) !important;
  border-color: rgba(51, 144, 236, 0.32) !important;
}

.admin-chat-sidebar .user-item .user-chat-preview {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex !important;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  width: 100%;
  margin: 4px 0 0 0;
  padding: 0 0 0 42px;
  box-sizing: border-box;
  visibility: visible !important;
  opacity: 1 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.admin-chat-sidebar .user-item .user-chat-preview-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-chat-sidebar .user-item .user-chat-preview-time {
  flex: 0 0 auto;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
  white-space: nowrap;
  position: static !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

.admin-chat-sidebar .user-item .user-chat-preview-text.unread {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

.admin-chat-sidebar .user-item .user-chat-preview-time.unread {
  color: #6ab3ff;
  font-weight: 600;
}

/* iPhone / мобильный — на весь экран с safe-area, без «уезжания» за край */
@media (max-width: 768px) {
  .admin-chat-panel.open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    max-height: -webkit-fill-available !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 10050 !important;
  }

  .admin-chat-sidebar,
  .admin-chat-main {
    height: 100% !important;
    min-height: 0 !important;
  }

  .admin-chat-sidebar .sidebar-header {
    padding-top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    padding-left: calc(14px + env(safe-area-inset-left, 0px)) !important;
    padding-right: calc(14px + env(safe-area-inset-right, 0px)) !important;
  }

  .admin-chat-sidebar .sidebar-close-btn {
    top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  }

  .admin-chat-head {
    padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
    padding-left: calc(10px + env(safe-area-inset-left, 0px)) !important;
    padding-right: calc(10px + env(safe-area-inset-right, 0px)) !important;
    min-height: calc(44px + env(safe-area-inset-top, 0px)) !important;
  }

  .admin-chat-foot {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: calc(10px + env(safe-area-inset-left, 0px)) !important;
    padding-right: calc(10px + env(safe-area-inset-right, 0px)) !important;
  }

  .admin-chat-sidebar .users-list {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
}

@media (min-width: 769px) {
  .admin-chat-panel.open {
    border-radius: 22px !important;
  }
}

.admin-chat-body .msg-meta,
.admin-chat-body .msg-time,
.chat-messages-wrap .msg-meta,
.chat-messages-wrap .msg-time {
  font-size: 11px !important;
  opacity: 0.72 !important;
  letter-spacing: 0.01em;
}

.admin-chat-head,
.admin-chat-foot {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.admin-chat-input-row input {
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* Диалог — один скролл-контейнер, прокрутка к последним */
.admin-chat-main .admin-chat-body {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  background: linear-gradient(180deg, rgba(14, 15, 20, 0.6), rgba(10, 11, 15, 0.85)) !important;
}

.admin-chat-main .admin-messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 16px 18px 20px !important;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(51, 144, 236, 0.06), transparent 70%),
    linear-gradient(180deg, rgba(18, 19, 24, 0.98), rgba(12, 13, 17, 0.98)) !important;
  scroll-behavior: auto !important;
}

.admin-chat-main .admin-messages::-webkit-scrollbar {
  width: 6px;
}

.admin-chat-main .admin-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

.admin-chat-head {
  background: rgba(22, 24, 30, 0.92) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.admin-chat-head .chat-title-text {
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

.admin-chat-foot {
  background: rgba(22, 24, 30, 0.95) !important;
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
  padding: 10px 14px !important;
}

.admin-chat-main .msg-group {
  margin-bottom: 10px !important;
}

.admin-chat-main .msg-group .msg-bubbles {
  max-width: 78% !important;
}

.admin-chat-main .msg-group.group-contact .msg {
  background: rgba(38, 40, 48, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 18px 18px 18px 6px !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  padding: 8px 12px 8px 14px !important;
}

.admin-chat-main .msg-group.group-me .msg {
  background: linear-gradient(135deg, #3d9aed 0%, #2b7fd4 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 18px 18px 6px 18px !important;
  box-shadow: 0 4px 16px rgba(51, 144, 236, 0.28);
  padding: 8px 14px 8px 12px !important;
}

.admin-chat-main .msg .msg-text {
  line-height: 1.45 !important;
  font-size: 14px !important;
}

.admin-chat-main .msg .msg-meta {
  font-size: 11px !important;
  opacity: 0.75 !important;
  margin-bottom: 3px !important;
}

.admin-chat-main .msg .msg-footer {
  margin-top: 4px !important;
  gap: 4px !important;
}

.admin-chat-main .msg .msg-time {
  font-size: 11px !important;
  opacity: 0.8 !important;
}

.admin-chat-main .msg .msg-img {
  border-radius: 12px !important;
  margin-top: 6px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.admin-chat-main .chat-placeholder {
  color: rgba(255, 255, 255, 0.45) !important;
  font-size: 14px !important;
}

.admin-chat-input-row .send-btn {
  box-shadow: 0 4px 14px rgba(51, 144, 236, 0.35) !important;
}

.admin-chat-input-row .admin-chat-img-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.admin-chat-main .msg .msg-meta .msg-persona-arrow {
  color: #7eb8ff;
  font-weight: 600;
}

.admin-chat-head .chat-persona-hint {
  display: block;
  font-size: 11px;
  color: #7eb8ff;
  font-weight: 500;
  margin-top: 2px;
  opacity: 0.95;
}

.admin-chat-foot .admin-persona-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-chat-foot .admin-persona-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.admin-chat-foot .admin-persona-btn.active {
  background: rgba(51, 144, 236, 0.22);
  border-color: rgba(51, 144, 236, 0.45);
  color: #fff;
  font-weight: 600;
}

/* Индикаторы персоны в чате игрока */
.chat-messages-wrap .msg-group.group-contact {
  border-left: 3px solid rgba(255, 255, 255, 0.12);
  padding-left: 8px;
  margin-left: 2px;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Артур"] {
  border-left-color: #3d9aed;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Наталья"] {
  border-left-color: #a78bfa;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Ольга"] {
  border-left-color: #34d399;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Анастасия"] {
  border-left-color: #fb923c;
}

.chat-messages-wrap .msg-sender {
  margin-bottom: 4px !important;
}

.chat-messages-wrap .msg-sender-name {
  display: inline-block;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8eaed !important;
  opacity: 1 !important;
}

.chat-messages-wrap .msg-group[data-persona="Артур"] .msg-sender-name {
  background: rgba(61, 154, 237, 0.22);
  color: #9fd0ff !important;
}

.chat-messages-wrap .msg-group[data-persona="Наталья"] .msg-sender-name {
  background: rgba(167, 139, 250, 0.22);
  color: #d4c4ff !important;
}

.chat-messages-wrap .msg-group[data-persona="Ольга"] .msg-sender-name {
  background: rgba(52, 211, 153, 0.2);
  color: #9af0c8 !important;
}

.chat-messages-wrap .msg-group[data-persona="Анастасия"] .msg-sender-name {
  background: rgba(251, 146, 60, 0.22);
  color: #ffd0a8 !important;
}

.chat-messages-wrap .user-persona-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.chat-messages-wrap .user-persona-badge[data-persona="Артур"] {
  background: rgba(61, 154, 237, 0.28);
  color: #b8dcff;
}

.chat-messages-wrap .user-persona-badge[data-persona="Наталья"] {
  background: rgba(167, 139, 250, 0.28);
  color: #e0d4ff;
}

.chat-messages-wrap .user-persona-badge[data-persona="Ольга"] {
  background: rgba(52, 211, 153, 0.26);
  color: #b8f5d8;
}

.chat-messages-wrap .user-persona-badge[data-persona="Анастасия"] {
  background: rgba(251, 146, 60, 0.28);
  color: #ffe0c2;
}

.chat-users-sidebar .chat-user-item {
  border-left: 3px solid transparent;
  transition: border-color 0.15s ease;
}

.chat-users-sidebar .chat-user-item[data-persona="Артур"] {
  border-left-color: #3d9aed;
}

.chat-users-sidebar .chat-user-item[data-persona="Наталья"] {
  border-left-color: #a78bfa;
}

.chat-users-sidebar .chat-user-item[data-persona="Ольга"] {
  border-left-color: #34d399;
}

.chat-users-sidebar .chat-user-item[data-persona="Анастасия"] {
  border-left-color: #fb923c;
}

.chat-users-sidebar .chat-user-item-label::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0.85;
}

.chat-users-sidebar .chat-user-item[data-persona="Артур"] .chat-user-item-label::after {
  background: #3d9aed;
}

.chat-users-sidebar .chat-user-item[data-persona="Наталья"] .chat-user-item-label::after {
  background: #a78bfa;
}

.chat-users-sidebar .chat-user-item[data-persona="Ольга"] .chat-user-item-label::after {
  background: #34d399;
}

.chat-users-sidebar .chat-user-item[data-persona="Анастасия"] .chat-user-item-label::after {
  background: #fb923c;
}
/* user-chat-notify */
/* user-chat-notify */
.chat-users-sidebar .chat-user-item {
  position: relative;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  padding-right: 8px !important;
}

.chat-users-sidebar .chat-user-item-label {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-label {
  font-weight: 700;
  color: #fff !important;
}

.chat-users-sidebar .chat-user-item-preview {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-left: 36px;
  margin-top: -2px;
}

.chat-users-sidebar .chat-user-item-preview-text {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-preview-text {
  color: #9fd0ff;
  font-weight: 600;
}

.chat-users-sidebar .chat-user-item-preview-time {
  flex-shrink: 0;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.38);
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-preview-time {
  color: #7eb8ff;
}

.chat-users-sidebar .chat-user-unread-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(18, 19, 24, 0.9);
}

.chat-users-sidebar .chat-user-item[data-persona="Артур"] {
  border-left: 3px solid #3d9aed;
}

.chat-users-sidebar .chat-user-item[data-persona="Наталья"] {
  border-left: 3px solid #a78bfa;
}

.chat-users-sidebar .chat-user-item[data-persona="Ольга"] {
  border-left: 3px solid #34d399;
}

.chat-users-sidebar .chat-user-item[data-persona="Анастасия"] {
  border-left: 3px solid #fb923c;
}

.chat-messages-wrap .msg-group.group-contact .msg p {
  white-space: pre-wrap;
}

.chat-messages-wrap .msg-group.group-contact .msg p::first-line {
  font-weight: inherit;
}

.chat-btn .unread-badge {
  animation: userChatPulse 1.6s ease-in-out infinite;
}

@keyframes userChatPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}


/* user-chat-notify */
.chat-users-sidebar .chat-user-item {
  position: relative;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  padding-right: 8px !important;
}

.chat-users-sidebar .chat-user-item-label {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-label {
  font-weight: 700;
  color: #fff !important;
}

.chat-users-sidebar .chat-user-item-preview {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-left: 36px;
  margin-top: -2px;
}

.chat-users-sidebar .chat-user-item-preview-text {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-preview-text {
  color: #9fd0ff;
  font-weight: 600;
}

.chat-users-sidebar .chat-user-item-preview-time {
  flex-shrink: 0;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.38);
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-preview-time {
  color: #7eb8ff;
}

.chat-users-sidebar .chat-user-unread-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(18, 19, 24, 0.9);
}

.chat-users-sidebar .chat-user-item[data-persona="Артур"] {
  border-left: 3px solid #3d9aed;
}

.chat-users-sidebar .chat-user-item[data-persona="Наталья"] {
  border-left: 3px solid #a78bfa;
}

.chat-users-sidebar .chat-user-item[data-persona="Ольга"] {
  border-left: 3px solid #34d399;
}

.chat-users-sidebar .chat-user-item[data-persona="Анастасия"] {
  border-left: 3px solid #fb923c;
}

.chat-messages-wrap .msg-group.group-contact .msg p {
  white-space: pre-wrap;
}

.chat-messages-wrap .msg-group.group-contact .msg p::first-line {
  font-weight: inherit;
}

.chat-btn .unread-badge {
  animation: userChatPulse 1.6s ease-in-out infinite;
}

@keyframes userChatPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}


/* user-chat-notify */
.chat-users-sidebar .chat-user-item {
  position: relative;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  padding-right: 8px !important;
}

.chat-users-sidebar .chat-user-item-label {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-label {
  font-weight: 700;
  color: #fff !important;
}

.chat-users-sidebar .chat-user-item-preview {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-left: 36px;
  margin-top: -2px;
}

.chat-users-sidebar .chat-user-item-preview-text {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-preview-text {
  color: #9fd0ff;
  font-weight: 600;
}

.chat-users-sidebar .chat-user-item-preview-time {
  flex-shrink: 0;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.38);
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-preview-time {
  color: #7eb8ff;
}

.chat-users-sidebar .chat-user-unread-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(18, 19, 24, 0.9);
}

.chat-users-sidebar .chat-user-item[data-persona="Артур"] {
  border-left: 3px solid #3d9aed;
}

.chat-users-sidebar .chat-user-item[data-persona="Наталья"] {
  border-left: 3px solid #a78bfa;
}

.chat-users-sidebar .chat-user-item[data-persona="Ольга"] {
  border-left: 3px solid #34d399;
}

.chat-users-sidebar .chat-user-item[data-persona="Анастасия"] {
  border-left: 3px solid #fb923c;
}

.chat-messages-wrap .msg-group.group-contact .msg p {
  white-space: pre-wrap;
}

.chat-messages-wrap .msg-group.group-contact .msg p::first-line {
  font-weight: inherit;
}

.chat-btn .unread-badge {
  animation: userChatPulse 1.6s ease-in-out infinite;
}

@keyframes userChatPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* chat-persona-avatar-natalya */
.chat-users-sidebar .chat-user-item[data-persona="Наталья"] .chat-user-item-icon {
  background: #2b2b2b url("/assets/chat-personas/natalya.png") center top / cover no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  overflow: hidden;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Наталья"] .msg-avatar {
  background: #2b2b2b url("/assets/chat-personas/natalya.png") center top / cover no-repeat !important;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Наталья"] .msg-avatar-initials {
  opacity: 0;
  font-size: 0;
  line-height: 0;
}

/* chat-persona-avatar-olga */
.chat-users-sidebar .chat-user-item[data-persona="Ольга"] .chat-user-item-icon,
.chat-users-sidebar .chat-user-item[data-persona="Ирина"] .chat-user-item-icon {
  background: #2b2b2b url("/assets/chat-personas/olga.png") center center / cover no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  overflow: hidden;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Ольга"] .msg-avatar,
.chat-messages-wrap .msg-group.group-contact[data-persona="Ирина"] .msg-avatar {
  background: #2b2b2b url("/assets/chat-personas/olga.png") center center / cover no-repeat !important;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Ольга"] .msg-avatar-initials,
.chat-messages-wrap .msg-group.group-contact[data-persona="Ирина"] .msg-avatar-initials {
  opacity: 0;
  font-size: 0;
  line-height: 0;
}

/* chat-persona-avatar-anastasia */
.chat-users-sidebar .chat-user-item[data-persona="Анастасия"] .chat-user-item-icon {
  background: #2b2b2b url("/assets/chat-personas/anastasia.png") center top / cover no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  overflow: hidden;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Анастасия"] .msg-avatar {
  background: #2b2b2b url("/assets/chat-personas/anastasia.png") center top / cover no-repeat !important;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Анастасия"] .msg-avatar-initials {
  opacity: 0;
  font-size: 0;
  line-height: 0;
}

/* chat-persona-avatar-artur */
.chat-users-sidebar .chat-user-item[data-persona="Артур"] .chat-user-item-icon {
  background: #2b2b2b url("/assets/chat-personas/artur.png") center top / cover no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  overflow: hidden;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Артур"] .msg-avatar {
  background: #2b2b2b url("/assets/chat-personas/artur.png") center top / cover no-repeat !important;
}

.chat-messages-wrap .msg-group.group-contact[data-persona="Артур"] .msg-avatar-initials {
  opacity: 0;
  font-size: 0;
  line-height: 0;
}

/* user-chat-ux-fixes */
.chat-panel .chat-messages-wrap .msg .msg-text,
.chat-panel .chat-messages-wrap .msg p {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 1.45 !important;
}

.chat-panel .chat-messages-wrap .msg-group .msg-bubbles {
  max-width: min(88%, 560px) !important;
}

.chat-users-sidebar .chat-user-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 8px;
}

.chat-users-sidebar .chat-user-item-label {
  min-width: 0;
  font-weight: 600;
}

.chat-users-sidebar .chat-user-item-preview {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.chat-users-sidebar .chat-user-item-preview-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.66);
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chat-users-sidebar .chat-user-item-preview-time {
  flex: 0 0 auto;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.42);
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-label {
  color: #fff !important;
}

.chat-users-sidebar .chat-user-item.has-unread .chat-user-item-preview-text {
  color: #b7dbff !important;
  font-weight: 600;
}

.chat-users-sidebar .chat-user-unread-dot {
  grid-column: 2;
  grid-row: 1;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  line-height: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(18, 19, 24, 0.9);
}

.chat-btn.has-unread {
  animation: user-chat-btn-pulse 1.6s ease-in-out infinite;
}

@keyframes user-chat-btn-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
