:root {
  --chat-sidebar-width: 292px;
}

.chat-page-content {
  padding: 22px;
}

.chat-page-content > .chat-page,
.chat-page-content > .chat-gate,
.chat-page-content > .site-footer,
.chat-page-content > .site-live-visitors {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

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

.chat-page__intro {
  margin-bottom: 16px;
}

.chat-page__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;

  
  border: 1px solid var(--border-gold);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.1);
  color: var(--gold);
  font-size: 11px;
  font-weight: 650;

  
}

.chat-page__title {
  margin: 0 0 10px;
  font-size: var(--type-page-title);
  line-height: 1.08;
}

.chat-page__text {

  margin: 0;

  font-size: var(--type-body-lg);
  line-height: 1.7;

  

}

.chat-shell {
  display: grid;
  grid-template-columns: minmax(290px, var(--chat-sidebar-width)) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: clamp(620px, calc(100vh - 218px), 860px);
  box-sizing: border-box;
}

.chat-shell__sidebar,
.chat-shell__main {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.chat-shell__sidebar {
  display: flex;
  overflow: hidden;
}

.chat-sidebar-card,
.chat-shell__main,
.chat-gate {
  border: 1px solid var(--border);
  border-radius: 10px;

  box-shadow: none;
}

.chat-sidebar-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 100%;
  padding: 14px;
  box-sizing: border-box;
  overflow: hidden;
}

.chat-sidebar-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.chat-sidebar-card__eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-sidebar-card__title {
  margin: 6px 0 0;
  font-size: var(--type-card-title);
  line-height: 1.08;
}

.chat-sidebar-card__section-title {
  margin: 18px 0 12px;
  color: rgba(var(--ui-rgb), 0.46);
  font-size: var(--type-body-sm);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-room-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-room-item,
.chat-dialog-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid rgba(var(--ui-rgb), 0.06);
  border-radius: 8px;
  background: rgba(var(--ui-rgb), 0.03);
  color: inherit;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.chat-room-item:hover,
.chat-dialog-item:hover {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.2);
  background: rgba(var(--ui-rgb), 0.045);
  box-shadow: none;
}

.chat-dialog-item:hover {
  transform: none;
}

.chat-room-item:hover {
  transform: none;
}

.chat-room-item--active,
.chat-dialog-item--active {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.26);
  background: rgba(var(--ui-rgb), 0.055);
  box-shadow: none;
}

.chat-room-item__icon,
.chat-dialog-item__avatar,
.chat-message__avatar,
.chat-main-head__icon {
  flex: 0 0 auto;
}

.chat-dialog-item__avatar,
.chat-message__avatar,
.chat-main-head__icon {
  display: grid;
  place-items: center;
}

.chat-dialog-item__avatar,
.chat-message__avatar {
  width: 40px;
}

.chat-main-head__icon {
  width: 44px;
}

.chat-room-item__icon,
.chat-main-head__room-icon,
.chat-avatar,
.chat-main-head__avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), 0.18);

  box-shadow: none;
}

.chat-main-head__room-icon,
.chat-main-head__avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.chat-room-item__icon,
.chat-main-head__room-icon {
  color: var(--accent-light, #e5ca87);
  font-size: 18px;
}

.chat-avatar img,
.chat-main-head__avatar img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent;
  font-size: 0;
}

.chat-avatar__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;

  font-size: 13px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: 0.02em;

}

.chat-avatar--fallback-only {
  background: transparent;
}

.chat-room-item__body,
.chat-dialog-item__body,
.chat-main-head__body {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-room-item__title,
.chat-dialog-item__name,
.chat-main-head__title,
.chat-message__name {
  min-width: 0;
  font-size: var(--type-card-heading);
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-room-item__text,
.chat-main-head__meta,
.chat-main-head__placeholder-text,
.chat-composer__hint,
.chat-gate__text,
.chat-empty {
  color: var(--muted);
  line-height: 1.7;
}

.chat-room-item__text {
  margin-top: 4px;
  font-size: var(--type-body);
}

.chat-room-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  color: rgba(var(--ui-rgb), 0.54);
  font-size: 10px;
}

.chat-room-item__meta strong {
  color: var(--text);
  font-size: 10px;
}

.chat-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  min-height: var(--control-height);
  margin-bottom: 14px;
  border: 1px solid var(--field-border);
  border-radius: var(--control-radius);
  background: var(--field-bg);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.chat-search:focus-within,
.chat-composer__field:focus-within {
  border-color: var(--field-border-focus);
  box-shadow: none;
  background: var(--field-bg-focus);
}

.chat-search > i {
  position: absolute;
  left: 16px;
  color: rgba(var(--ui-rgb), 0.46);
  pointer-events: none;
}

.chat-search input,
.chat-composer__field textarea {
  width: 100%;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.chat-search input {
  height: var(--control-height);
  padding: 0 44px 0 44px;
}

.chat-search__clear {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 0;
  background: rgba(var(--ui-rgb), 0.05);
  color: rgba(var(--ui-rgb), 0.72);
  display: grid;
  place-items: center;
  transition: background .18s ease, color .18s ease, opacity .18s ease;
}

.chat-search__clear:hover {
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.12);
  color: var(--accent-light, #e5ca87);
}

.chat-search__clear[hidden] {
  display: none;
}

.chat-search input::placeholder,
.chat-composer__field textarea::placeholder {
  color: rgba(var(--ui-rgb), 0.36);
}

.chat-search input[type="search"]::-webkit-search-decoration,
.chat-search input[type="search"]::-webkit-search-cancel-button,
.chat-search input[type="search"]::-webkit-search-results-button,
.chat-search input[type="search"]::-webkit-search-results-decoration,
.chat-inline-search input[type="search"]::-webkit-search-decoration,
.chat-inline-search input[type="search"]::-webkit-search-cancel-button,
.chat-inline-search input[type="search"]::-webkit-search-results-button,
.chat-inline-search input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.chat-search input[type="search"],
.chat-inline-search input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

.chat-dialog-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 10px;
  overflow: auto;
  min-height: 0;
  padding-right: 2px;
}

.chat-dialog-item {
  align-items: center;
}

.chat-room-item__top,
.chat-dialog-item__top,
.chat-dialog-item__bottom,
.chat-main-head__title-row,
.chat-message__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-room-item__top,
.chat-dialog-item__top,
.chat-dialog-item__bottom {
  justify-content: space-between;
}

.chat-room-item__top {
  gap: 12px;
}

.chat-dialog-item__time,
.chat-message__time {
  flex: 0 0 auto;
  color: rgba(var(--ui-rgb), 0.42);
  font-size: 10px;
}

.chat-dialog-item__preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(var(--ui-rgb), 0.6);
  font-size: var(--type-body);
}

.chat-dialog-item__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-room-item__unread,
.chat-dialog-item__unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;

  
  font-size: 11px;
  font-weight: 650;
  line-height: 1;

}

.chat-dialog-item__badge,
.chat-main-head__badge {
  flex: 0 0 auto;

  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--ui-rgb),0.08);
  background: rgba(var(--ui-rgb),0.06);
  color: #cfd5df;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.chat-dialog-item__badge.is-admin,
.chat-main-head__badge.is-admin {
  border-color: rgba(255, 106, 106, 0.18);
  background: rgba(255, 106, 106, 0.14);
  color: #ffd4d4;
}

.chat-dialog-item__badge.is-premium,
.chat-main-head__badge.is-premium {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.22);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.18);
  color: var(--accent-light, #e5ca87);
}

.chat-dialog-item__badge.is-user,
.chat-main-head__badge.is-user {
  border-color: rgba(var(--ui-rgb),0.08);
  background: rgba(var(--ui-rgb),0.06);
  color: #cfd5df;
}

.chat-shell__main {
  position: relative;
  display: grid;

  min-height: 0;

}

.chat-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 12px 14px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(var(--ui-rgb), 0.06);

}

.chat-main-head__room {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 320px;
}

.chat-main-head__aside {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
}

.chat-main-head__stats,
.chat-main-head__actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
}

.chat-main-head__actions {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.chat-main-head__stat {
  min-width: 76px;
  padding: 8px 10px;
  border: 1px solid rgba(var(--ui-rgb), 0.06);
  border-radius: 10px;
  background: rgba(var(--ui-rgb), 0.03);
  text-align: center;
}

.chat-main-head__stat span {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.1;
}

.chat-main-head__stat small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.chat-head-btn {
  width: auto;
  min-width: 0;
  min-height: 40px;
  padding-inline: 12px;
  white-space: nowrap;
}

.chat-head-btn--icon {

  

  gap: 0;
}

.chat-slow-menu {
  position: relative;
  display: inline-flex;
}

.chat-slow-menu__toggle {
  position: relative;
}

.chat-slow-menu__toggle.is-active {
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.14);
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.28);
  color: var(--gold);
}

.chat-slow-menu__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 25;
  min-width: 156px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), 0.14);
  background: rgba(18, 18, 18, 0.98);
  box-shadow: none;
  backdrop-filter: none;
}

.chat-slow-menu__option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.chat-slow-menu__option:hover {
  background: rgba(var(--ui-rgb), 0.06);
}

.chat-slow-menu__option.is-active {
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.14);
  color: var(--gold);
}

.chat-main-head__placeholder-title {
  font-size: var(--type-card-title);
  font-weight: 650;
}

.chat-main-head__placeholder-text {
  margin-top: 4px;
  font-size: var(--type-body);
}

.chat-messages {

  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;

}

.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: fit-content;
  max-width: min(76%, 620px);
}

.chat-message--own {
  margin-left: auto;
  justify-content: flex-end;
}

.chat-message__bubble {
  min-width: 0;

  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(var(--ui-rgb), 0.06);
  background: rgba(var(--ui-rgb), 0.04);
  box-shadow: none;
}

.chat-message__head {
  margin-bottom: 8px;
  justify-content: space-between;
}

.chat-message__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-message__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;

  
  transition: opacity .18s ease, transform .18s ease;
}

.chat-message:hover .chat-message__actions,
.chat-message:focus-within .chat-message__actions {
  opacity: 1;
  transform: translateY(0);
}

.chat-message__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(var(--ui-rgb), 0.08);
  border-radius: 10px;
  background: rgba(var(--ui-rgb), 0.04);
  color: rgba(var(--ui-rgb), 0.78);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.chat-message__action:hover {
  transform: none;
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.22);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.12);
  color: var(--accent-light, #e5ca87);
}

.chat-message__action--danger:hover {
  border-color: rgba(255, 120, 120, 0.24);
  background: rgba(255, 120, 120, 0.12);
  color: #ffdede;
}

.chat-message__reply {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--ui-rgb), 0.05);
  border-radius: 10px;
  background: rgba(var(--ui-rgb), 0.03);
}

.chat-message__reply-line {
  width: 3px;
  border-radius: 999px;
  background: var(--gold-gradient);
  box-shadow: none;
}

.chat-message__reply-body {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-message__reply-name {
  color: var(--accent-light, #e5ca87);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.chat-message__reply-text {
  margin-top: 4px;
  color: rgba(var(--ui-rgb), 0.62);
  font-size: 10px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-message__text {
  color: #eef1f8;
  font-size: var(--type-body-lg);
  line-height: 1.6;
  word-break: break-word;
}

.chat-message__link {
  color: var(--accent-light, #e5ca87);
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-light-rgb, 229, 202, 135), 0.42);
  text-underline-offset: 3px;
  transition: color .18s ease, text-decoration-color .18s ease, opacity .18s ease;
}

.chat-message__link:hover,
.chat-message__link:focus-visible {
  color: var(--accent-light, #e5ca87);
  text-decoration-color: rgba(var(--accent-light-rgb, 229, 202, 135), 0.72);
}

.chat-message__link:visited {
  color: var(--accent-light, #e5ca87);
}

.chat-composer {
  display: grid;

  
  align-items: end;
  gap: 6px 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(var(--ui-rgb), 0.06);

  backdrop-filter: none;
}

.chat-composer__reply {
  grid-area: reply;
}

.chat-reply-preview {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), 0.16);
  border-radius: 10px;
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.08);
}

.chat-reply-preview__line {
  width: 3px;
  border-radius: 999px;
  background: var(--gold-gradient);
}

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

.chat-reply-preview__label {
  color: var(--accent-light, #e5ca87);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.chat-reply-preview__text {
  margin-top: 4px;
  color: rgba(var(--ui-rgb), 0.66);
  font-size: var(--type-body);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-reply-preview__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(var(--ui-rgb), 0.08);
  border-radius: 10px;
  background: rgba(var(--ui-rgb), 0.05);
  color: rgba(var(--ui-rgb), 0.76);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.chat-reply-preview__close:hover {
  transform: none;
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.22);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.12);
  color: var(--accent-light, #e5ca87);
}

.chat-composer__field {
  grid-area: field;
  display: block;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field-bg);
}

.chat-composer__field textarea {
  display: block;
  min-height: 38px;
  max-height: 132px;
  resize: none;
  padding: 9px 11px;
}

.chat-composer__foot {
  display: contents;
}

.chat-composer__hint {
  grid-area: hint;
  font-size: 10px;
}

.chat-composer__hint.is-error {
  color: #ffb7b7;
}

.chat-composer__submit,
.chat-gate__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.chat-composer__submit {
  grid-area: submit;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: var(--control-radius);
  appearance: none;
  -webkit-appearance: none;
}

.chat-composer__submit--icon i {
  font-size: 15px;
}

.chat-composer__submit:disabled {
  opacity: .56;
  box-shadow: none;
}

.chat-gate {
  max-width: 760px;
  padding: 20px;
}

.chat-gate--wide {
  max-width: 920px;
}

.chat-gate__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.1);
  color: var(--gold);
  font-size: 12px;
  font-weight: 650;
}

.chat-gate__title {
  margin: 16px 0 12px;
  font-size: var(--type-page-title);
  line-height: 1.08;
}

.chat-gate__actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.chat-gate__button {
  width: auto;
}

.chat-empty {
  display: grid;
  place-items: center;

  
  text-align: center;
  border: 1px dashed rgba(var(--ui-rgb), 0.08);
  border-radius: 10px;
  background: rgba(var(--ui-rgb), 0.02);
}

@media (max-width: 1180px) {
  .chat-shell {
    grid-template-columns: minmax(270px, 300px) minmax(0, 1fr);
    height: clamp(620px, calc(100vh - 208px), 820px);
  }

  .chat-main-head {
    flex-wrap: wrap;
  }

  .chat-main-head__aside,
  .chat-main-head__stats,
  .chat-main-head__actions {
    flex-wrap: wrap;
  }

  .chat-message {
    max-width: min(82%, 560px);
  }
}

@media (max-width: 900px) {
  .chat-page-content {
    padding: 16px 14px 20px;
  }

  .chat-page__intro {
    margin-bottom: 14px;
  }

  .chat-page__title {
    font-size: var(--type-page-title);
    line-height: 1.08;
  }

  .chat-page__text {
    font-size: var(--type-body-lg);
    line-height: 1.6;
  }

  .chat-shell {
    grid-template-columns: 1fr;
    gap: 12px;
    height: auto;
  }

  .chat-sidebar-card {
    min-height: auto;
    padding: 14px;
  }

  .chat-sidebar-card__head {
    margin-bottom: 12px;
  }

  .chat-sidebar-card__section-title {
    margin: 14px 0 8px;
  }

  .chat-search {
    min-height: 44px;
    margin-bottom: 10px;
  }

  .chat-search input {
    height: 44px;
  }

  .chat-dialog-list {
    max-height: 260px;
    gap: 8px;
  }

  .chat-shell__main {
    min-height: 68vh;
  }

  .chat-main-head {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    gap: 12px;
  }

  .chat-main-head__room {
    gap: 12px;
  }

  .chat-main-head__room-icon,
  .chat-main-head__avatar {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }

  .chat-main-head__aside,
  .chat-main-head__stats,
  .chat-main-head__actions {
    justify-content: flex-start;
  }

  .chat-main-head__aside {
    width: 100%;
    row-gap: 8px;
  }

  .chat-dialog-item,
  .chat-room-item {
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
  }

  .chat-dialog-item__avatar,
  .chat-room-item__icon,
  .chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .chat-dialog-item__bottom {
    align-items: flex-start;
  }

  .chat-dialog-item__meta {
    width: 100%;
    justify-content: space-between;
  }

  .chat-messages {
    padding: 18px 16px;
    gap: 12px;
  }

  .chat-message {
    gap: 8px;
    max-width: 92%;
  }

  .chat-message__avatar {
    width: 38px;
  }

  .chat-message__bubble {
    padding: 12px 14px;
    border-radius: 8px;
  }

  .chat-message__text {
    font-size: var(--type-body);
    line-height: 1.58;
  }

  .chat-message__actions {
    gap: 5px;
  }

  .chat-message__action {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .chat-composer {
    padding: 8px 12px 9px;
    gap: 6px 8px;
  }

  .chat-composer__field textarea {
    min-height: 42px;
    padding: 11px 13px;
    font-size: var(--type-body);
  }

  .chat-composer__hint {
    display: none;
  }
}

@media (max-width: 640px) {
  .chat-page-content {
    padding: 12px 12px 16px;
  }

  .chat-page__intro {
    margin-bottom: 10px;
  }

  .chat-page__eyebrow {
    margin-bottom: 10px;
    padding: 6px 10px;
    font-size: 10px;
  }

  .chat-page__title {
    margin-bottom: 8px;
    font-size: var(--type-page-title);
  }

  .chat-page__text {
    font-size: var(--type-body);
    line-height: 1.55;
  }

  .chat-shell {
    gap: 10px;
  }

  .chat-main-head,
  .chat-messages,
  .chat-composer,
  .chat-sidebar-card,
  .chat-gate {
    padding-left: 12px;
    padding-right: 12px;
  }

  .chat-sidebar-card {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .chat-sidebar-card__head {
    margin-bottom: 10px;
  }

  .chat-sidebar-card__section-title {
    margin: 12px 0 8px;
    font-size: 10px;
  }

  .chat-dialog-list {
    max-height: 220px;
  }

  .chat-main-head {
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 10px;
  }

  .chat-main-head__room {
    gap: 10px;
    flex: 1 1 auto;
  }

  .chat-main-head__room-icon,
  .chat-main-head__avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .chat-main-head__title-row {
    gap: 6px;
    flex-wrap: wrap;
  }

  .chat-main-head__title {
    font-size: var(--type-card-heading);
    line-height: 1.18;
  }

  .chat-main-head__meta {
    font-size: 11px;
    line-height: 1.42;
  }

  .chat-main-head__badge {
    padding: 3px 7px;
    font-size: 10px;
  }

  .chat-main-head__aside {
    width: 100%;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
  }

  .chat-main-head__stats {
    display: none;
  }

  .chat-main-head__actions {
    margin-left: auto;
    gap: 6px;
  }

  .chat-main-head__actions .chat-head-btn--icon,
  .chat-slow-menu__toggle {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 8px;
  }

  .chat-inline-search {
    min-height: 40px;
    border-radius: 8px;
  }

  .chat-inline-search input {
    height: 40px;
    padding-left: 38px;
    padding-right: 36px;
    font-size: 13px;
  }

  .chat-inline-search > i {
    left: 13px;
  }

  .chat-slow-menu {
    justify-content: flex-end;
  }

  .chat-slow-menu__dropdown {
    left: auto;
    right: 0;
    min-width: 140px;
    max-width: calc(100vw - 76px);
    border-radius: 10px;
  }

  .chat-shell__main--has-pins .chat-messages {
    padding-top: 72px;
  }

  .chat-messages {
    padding-top: 14px;
    padding-bottom: 16px;
    gap: 10px;
  }

  .chat-message {
    max-width: 96%;
  }

  .chat-message__actions {
    opacity: 1;
    transform: none;
  }

  .chat-message__head {
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 6px;
  }

  .chat-message__meta {
    flex-wrap: wrap;
    gap: 5px 8px;
  }

  .chat-message__reply,
  .chat-reply-preview {
    gap: 8px;
    padding: 9px 11px;
    border-radius: 8px;
  }

  .chat-dialog-item,
  .chat-room-item {
    padding: 10px 11px;
    border-radius: 10px;
  }

  .chat-room-item__title,
  .chat-dialog-item__name {
    font-size: var(--type-card-heading);
  }

  .chat-room-item__text,
  .chat-dialog-item__preview {
    font-size: 12px;
    line-height: 1.42;
  }

  .chat-room-item__meta {
    flex-direction: row;
    gap: 6px;
    align-items: center;
  }

  .chat-room-item__unread,
  .chat-dialog-item__unread {
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    font-size: 10px;
  }

  .chat-search {
    min-height: 42px;
  }

  .chat-search input {
    height: 42px;
    padding-left: 40px;
    padding-right: 38px;
    font-size: var(--type-body);
  }

  .chat-search > i {
    left: 14px;
  }

  .chat-pins {
    top: 72px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .chat-pin {
    width: 100%;
    max-width: none;
    padding: 7px 9px;
    border-radius: 8px;
  }

  .chat-pin__icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .chat-pin__text {
    font-size: 11px;
  }

  .chat-composer {
    grid-template-columns: minmax(0, 1fr) 42px;
    grid-template-areas:
      "reply reply"
      "field submit";
    padding-top: 8px;
    padding-bottom: 9px;
  }

  .chat-composer__submit {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .chat-composer__field {
    border-radius: 10px;
  }

  .chat-composer__field textarea {
    min-height: 42px;
    max-height: 120px;
    padding: 11px 13px;
  }

  .chat-empty {
    min-height: 120px;
    padding: 14px;
    border-radius: 8px;
  }
}

@media (max-width: 420px) {
  .chat-page-content {
    padding: 10px 8px 14px;
  }

  .chat-page__eyebrow {
    margin-bottom: 8px;
  }

  .chat-page__title {
    font-size: var(--type-page-title);
  }

  .chat-page__text {
    display: none;
  }

  .chat-shell {
    gap: 8px;
  }

  .chat-sidebar-card,
  .chat-shell__main,
  .chat-gate {
    border-radius: 8px;
  }

  .chat-main-head,
  .chat-messages,
  .chat-composer,
  .chat-sidebar-card,
  .chat-gate {
    padding-left: 10px;
    padding-right: 10px;
  }

  .chat-sidebar-card {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .chat-main-head {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .chat-main-head__room {
    align-items: flex-start;
    gap: 9px;
  }

  .chat-main-head__room-icon,
  .chat-main-head__avatar,
  .chat-room-item__icon,
  .chat-dialog-item__avatar,
  .chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .chat-main-head__meta {
    max-width: 100%;
  }

  .chat-main-head__aside {
    gap: 6px;
  }

  .chat-main-head__actions .chat-head-btn--icon,
  .chat-slow-menu__toggle {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 8px;
  }

  .chat-slow-menu__dropdown {
    min-width: 132px;
    max-width: calc(100vw - 72px);
  }

  .chat-dialog-list {
    max-height: 204px;
  }

  .chat-shell__main--has-pins .chat-messages {
    padding-top: 68px;
  }

  .chat-pin {
    max-width: calc(100vw - 28px);
  }

  .chat-message__bubble {
    padding: 11px 12px;
    border-radius: 10px;
  }

  .chat-composer {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .chat-composer__submit {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }
}

.chat-pins__inner::-webkit-scrollbar {
  display: none;
}

.chat-pin {
  display: flex;

  

  min-width: 0;

  
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), 0.16);

  
  box-shadow: none;
  backdrop-filter: none;
  cursor: pointer;
  pointer-events: auto;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.chat-pin:hover {

  
  box-shadow: none;
}

.chat-pin__icon {

  

  display: grid;
  place-items: center;
  color: var(--accent-light, #e5ca87);
  background: rgba(var(--ui-rgb), 0.06);
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), 0.18);
  flex: 0 0 auto;
}

.chat-pin__title {
  color: var(--accent-light, #e5ca87);

  font-weight: 650;

}

.chat-pin__text {

  color: rgba(var(--ui-rgb), 0.72);

  

  

}

.chat-pin__remove {

  

  border: 1px solid rgba(var(--ui-rgb), 0.08);
  background: rgba(var(--ui-rgb), 0.04);
  color: rgba(var(--ui-rgb), 0.78);
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.chat-pin__remove:hover {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.26);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.12);
  color: var(--accent-light, #e5ca87);
}

.chat-inline-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;

  min-height: 44px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field-bg);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.chat-inline-search:focus-within {
  border-color: var(--field-border-focus);
  box-shadow: none;
  background: var(--field-bg-focus);
}

.chat-inline-search > i {
  position: absolute;
  left: 14px;
  color: rgba(var(--ui-rgb), 0.46);
  pointer-events: none;
}

.chat-inline-search input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 40px;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.chat-inline-search__clear {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 0;
  background: rgba(var(--ui-rgb), 0.05);
  color: rgba(var(--ui-rgb), 0.72);
  display: grid;
  place-items: center;
  transition: background .18s ease, color .18s ease;
}

.chat-inline-search__clear:hover {
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.12);
  color: var(--accent-light, #e5ca87);
}

.chat-presence {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(var(--ui-rgb), 0.48);
  font-size: 10px;
  font-weight: 600;
}

.chat-presence::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(var(--ui-rgb), 0.24);
  box-shadow: none;
}

.chat-presence.is-online {
  color: #9be4a1;
}

.chat-presence.is-online::before {
  background: #79db82;
  box-shadow: none;
}

.chat-dialog-item__name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-dialog-item__online-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #79db82;
  box-shadow: none;
  flex: 0 0 auto;
}

.chat-main-head__aside {
  row-gap: 10px;
}

.chat-main-head__aside .chat-inline-search {
  align-self: center;
}

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

.chat-day-separator span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(var(--ui-rgb), 0.04);
  border: 1px solid rgba(var(--ui-rgb), 0.06);
  color: rgba(var(--ui-rgb), 0.58);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.chat-message.is-highlighted .chat-message__bubble {
  box-shadow: none;
}

.chat-message__action.is-active {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.24);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.12);
  color: var(--accent-light, #e5ca87);
}

.chat-message__text mark {
  padding: 0 .15em;
  border-radius: 6px;
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.24);
  color: inherit;
}

@media (max-width: 900px) {
  .chat-main-head__aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    gap: 8px;
  }

  .chat-main-head__aside .chat-inline-search {
    width: auto;
    min-width: 0;
    max-width: none;
    order: 0;
  }

  .chat-main-head__actions {
    width: auto;
    min-width: max-content;
    margin-left: 0;
    flex-wrap: nowrap;
  }
}

@media (max-width: 640px) {
  .chat-shell__main--has-pins .chat-messages {
    padding-top: 96px;
  }

  .chat-pins {
    top: 74px;
    padding: 8px 12px 0;
  }

  .chat-pin {
    width: 100%;
    max-width: none;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .chat-main-head__aside {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .chat-main-head__aside .chat-inline-search {
    min-width: 0;
  }

  .chat-main-head__actions {
    gap: 6px;
  }

  .chat-day-separator span {
    font-size: 10px;
    padding: 5px 10px;
  }
}

@media (max-width: 420px) {
  .chat-shell__main--has-pins .chat-messages {
    padding-top: 92px;
  }

  .chat-pins {
    top: 72px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .chat-pin {
    padding: 8px 9px;
  }

  .chat-pin__title {
    font-size: 10px;
  }

}

@media (max-width: 360px) {
  .chat-main-head__actions {
    gap: 5px;
  }

  .chat-main-head__actions .chat-head-btn--icon,
  .chat-slow-menu__toggle,
  .chat-composer__submit {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 10px;
  }

  .chat-inline-search input,
  .chat-search input,
  .chat-composer__field textarea {
    font-size: 12px;
  }
}

/* Chat cleanup: mobile pins, common unread dot and header counters */
.chat-room-item__unread[data-chat-common-unread] {
  display: none !important;
}

@media (max-width: 640px) {
  .chat-shell__main--has-pins .chat-messages {
    padding-top: 14px;
  }

  .chat-pins {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 2;
    padding: 8px 10px 0;
    pointer-events: auto;
  }

  .chat-pins__inner {
    width: 100%;
  }

  .chat-pin {
    width: 100%;
    max-width: none;
    min-height: 48px;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .chat-pin__body {
    min-width: 0;
  }

  .chat-pin__title {
    font-size: 10px;
    line-height: 1.25;
  }

  .chat-pin__text {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.35;
  }

  .chat-pin__remove {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }
}

@media (max-width: 420px) {
  .chat-pins {
    padding-left: 8px;
    padding-right: 8px;
  }

  .chat-pin {
    padding: 8px 9px;
    gap: 8px;
  }

  .chat-pin__icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }
}


/* Chat avatar image fallback fix */
.chat-avatar--has-image .chat-avatar__fallback,
.chat-main-head__avatar.chat-avatar--has-image .chat-avatar__fallback {
  display: none;
}

.chat-avatar--fallback-only .chat-avatar__fallback,
.chat-main-head__avatar.chat-avatar--fallback-only .chat-avatar__fallback {
  display: grid;
}

.chat-avatar--has-image img,
.chat-main-head__avatar.chat-avatar--has-image img {
  z-index: 1;
}

.chat-avatar--fallback-only img,
.chat-main-head__avatar.chat-avatar--fallback-only img {
  display: none;
}

/* Compact chat UI pack. */
.chat-sidebar-card,
.chat-main,
.chat-dialog-item,
.chat-message,
.chat-gate {
  border-radius: 10px;
}

.chat-dialog-item {
  padding: 12px;
}

.chat-dialog-item__badge,
.chat-main-head__badge,
.chat-gate__badge {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  line-height: 1;
}

.chat-head-btn,
.chat-gate__button,
.chat-send button,
.chat-inline-search button {
  min-height: 42px;
  border-radius: 10px;
  gap: 8px;
  line-height: 1;
}

.chat-head-btn--icon {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
}

.chat-message {
  padding: 0;
}

body {
  background: var(--bg-main) !important;
  background-image: none !important;
}

.product-panel,
.product-main-card,
.product-sidebar-card,
.product-section,
.product-description,
.product-review-card,
.product-question-card,
.admin-card,
.admin-panel,
.admin-section,
.admin-table-wrap,
.admin-stat-card,
.chat-panel,
.chat-card,
.premium-card,
.premium-panel,
.legal-footer,
.legal-footer__inner {
  background: var(--panel-bg) !important;
  background-image: none !important;
  border-color: rgba(var(--ui-rgb),0.10) !important;
}

.product-meta,
.product-action-row,
.product-info-row,
.admin-toolbar,
.admin-filter-row,
.chat-toolbar,
.premium-feature,
.legal-footer__link {
  background: var(--field-bg) !important;
  background-image: none !important;
  border-color: rgba(var(--ui-rgb),0.10) !important;
}

/* NeoMarket chat gray-black audit */
.chat-page-content {
  background: transparent;
}

.chat-sidebar-card,
.chat-shell__main,
.chat-gate {
  border-color: var(--border);
  background: var(--panel-bg);
}

.chat-room-item,
.chat-dialog-item,
.chat-main-head__stat,
.chat-search,
.chat-inline-search,
.chat-composer__field,
.chat-message__bubble,
.chat-message__reply,
.chat-reply-preview,
.chat-empty,
.chat-day-separator span {
  background: var(--field-bg);
  border-color: var(--border);
}

.chat-room-item:hover,
.chat-dialog-item:hover,
.chat-room-item--active,
.chat-dialog-item--active {
  background: var(--surface-hover);
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.28);
}

.chat-page__eyebrow,
.chat-gate__badge,
.chat-dialog-item__badge,
.chat-main-head__badge {
  background: rgba(var(--ui-rgb), 0.045);
  border-color: rgba(var(--ui-rgb), 0.075);
  color: #d8dde5;
}

.chat-page__eyebrow i,
.chat-gate__badge i,
.chat-sidebar-card__eyebrow,
.chat-room-item__icon i,
.chat-main-head__room-icon i {
  color: var(--gold);
}

.chat-room-item__icon,
.chat-main-head__room-icon,
.chat-avatar,
.chat-main-head__avatar {
  background: rgba(var(--ui-rgb), 0.045);
  border-color: rgba(var(--ui-rgb), 0.075);
}

.chat-avatar__fallback {
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.92);
  color: #121212;
}

.chat-main-head {
  background: var(--panel-bg);
}

.chat-messages {
  background: var(--panel-bg-strong);
}

.chat-message--own .chat-message__bubble {
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.095);
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.19);
}

.chat-composer {
  background: var(--panel-bg);
}

.chat-slow-menu__dropdown,
.chat-pin {
  background: rgba(18, 18, 18, 0.96);
  border-color: rgba(var(--ui-rgb), 0.075);
}

.chat-pin:hover {
  background: rgba(25, 25, 25, 0.96);
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.18);
}

.chat-pin__icon,
.chat-message__action,
.chat-reply-preview__close,
.chat-pin__remove,
.chat-search__clear,
.chat-inline-search__clear {
  background: rgba(var(--ui-rgb), 0.045);
  border-color: rgba(var(--ui-rgb), 0.075);
}

.chat-pin__title,
.chat-message__reply-name,
.chat-reply-preview__label {
  color: var(--accent-light, #e5ca87);
}

.chat-search:focus-within,
.chat-composer__field:focus-within,
.chat-inline-search:focus-within {
  background: var(--field-bg-focus);
  border-color: var(--field-border-focus);
  box-shadow: none;
}

.chat-room-item,
.chat-dialog-item,
.chat-message__action,
.chat-reply-preview__close,
.chat-pin__remove {
  transform: none !important;
}

/* Chat UX Pack: compact stats, empty states, counter and scroll button */
.chat-page__intro {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(220px, .62fr) minmax(0, 1.38fr);
  grid-template-areas:
    "eyebrow stats"
    "title stats"
    "text stats";
  align-items: center;
  gap: 0 28px;
  min-height: 150px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    radial-gradient(circle at 92% 16%, rgba(var(--accent-rgb, 214, 179, 106), .09), transparent 24%),
    #0f0f0f;
  isolation: isolate;
}

.chat-page__intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -54px;
  bottom: -130px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), .14);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(var(--accent-rgb, 214, 179, 106), .018);
  animation: chat-orbit 17s linear infinite;
}

.chat-page__eyebrow { grid-area: eyebrow; align-self: end; }
.chat-page__title { grid-area: title; }
.chat-page__text { grid-area: text; align-self: start; }

@keyframes chat-orbit {
  to { transform: rotate(360deg); }
}

.chat-page__stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0;
  max-width: none;
  margin-top: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--ui-rgb),.07);
  border-radius: 9px;
  background: rgba(0,0,0,.18);
}

.chat-page__stat {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-areas:
    "icon value"
    "icon label";
  align-items: center;
  column-gap: 10px;
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 0;
  border: 0;
  border-right: 1px solid rgba(var(--ui-rgb),.07);
  background: transparent;
}

.chat-page__stat:last-child {
  border-right: 0;
}

.chat-page__stat-icon {
  grid-area: icon;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.10);
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), 0.16);
}

.chat-page__stat-value {
  grid-area: value;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  line-height: 1;
}

.chat-page__stat-label {
  grid-area: label;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.chat-main-head__chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chat-main-head__chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(var(--ui-rgb),0.07);
  background: rgba(var(--ui-rgb),0.04);
  color: rgba(var(--ui-rgb),.76);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}

.chat-main-head__chips i {
  color: var(--gold);
  font-size: 10px;
}

.chat-empty {
  align-content: center;
  gap: 8px;
  min-height: 180px;
  padding: 22px;
}

.chat-empty__icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 2px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), 0.16);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.08);
  color: var(--gold);
  font-size: 17px;
}

.chat-empty__title {
  color: var(--text);
  font-size: var(--type-card-heading);
  font-weight: 650;
  line-height: 1.25;
}

.chat-empty__text {
  max-width: 320px;
  margin: 0 auto;
  color: var(--muted);
  font-size: var(--type-body);
  line-height: 1.55;
}

.chat-empty--sidebar {
  min-height: 136px;
  padding: 16px;
}

.chat-empty--sidebar .chat-empty__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 15px;
}

.chat-composer__counter {
  grid-area: counter;
  align-self: center;
  justify-self: end;
  min-width: 62px;
  padding: 0 4px;
  color: rgba(var(--ui-rgb),.46);
  font-size: 9px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.chat-composer__counter.is-warning {
  color: var(--accent-light, #e5ca87);
}

.chat-scroll-bottom {

  

  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), 0.18);
  background: rgba(24,24,24,0.94);
  color: var(--accent-light, #e5ca87);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: none;
  backdrop-filter: none;
}

.chat-scroll-bottom span {
  display: none;
}

.chat-scroll-bottom:hover,
.chat-scroll-bottom:focus-visible {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.30);
  background: rgba(32,32,32,0.96);
}

.chat-scroll-bottom[hidden] {
  display: none;
}

.chat-message__bubble {
  position: relative;
}

.chat-message--own .chat-message__bubble::after,
.chat-message:not(.chat-message--own) .chat-message__bubble::after {
  content: none;
  display: none;
}

@media (max-width: 900px) {
  .chat-page__intro {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "eyebrow"
      "title"
      "text"
      "stats";
  }

  .chat-page__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
    margin-top: 16px;
  }

  .chat-page__stat:nth-child(2) {
    border-right: 0;
  }

  .chat-page__stat:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(var(--ui-rgb),.07);
  }

  .chat-composer {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "reply reply"
      "field submit"
      "counter counter";
  }

  .chat-composer__counter {
    justify-self: end;
    padding-right: 2px;
  }

  .chat-scroll-bottom {
    right: 16px;
    bottom: 112px;
  }
}

@media (max-width: 520px) {
  .chat-page__stats {
    gap: 8px;
  }

  .chat-page__stat {
    min-height: 52px;
    padding: 9px 10px;
    grid-template-columns: 30px 1fr;
    column-gap: 8px;
  }

  .chat-page__stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .chat-page__stat-value {
    font-size: 16px;
  }

  .chat-page__stat-label {
    font-size: 10px;
  }

  .chat-scroll-bottom {
    right: 14px;
    bottom: 104px;
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 10px;
  }

  .chat-scroll-bottom.has-new-messages {
    width: auto;
    min-width: 0;
    padding: 0 12px;
    border-radius: 999px;
  }
}

/* Chat intro compact user-facing cleanup */
.chat-page__intro {
  gap: 10px;
}

.chat-page__eyebrow {
  width: fit-content;
  max-width: max-content;
  white-space: nowrap;
  padding: 7px 11px;
  border-radius: 999px;
  text-transform: none;
  letter-spacing: 0;
}

.chat-page__eyebrow span {
  display: inline;
}

.chat-page__title {
  margin-bottom: 4px;
}

.chat-page__text {
  max-width: 420px;
  font-size: var(--type-body-lg);
  line-height: 1.55;
  color: rgba(var(--ui-rgb), 0.68);
}

@media (max-width: 640px) {
  .chat-page__eyebrow {
    padding: 6px 9px;
  }

  .chat-page__text {
    max-width: none;
  }
}

/* Chat Live Pack: adaptive new-message pill */
.chat-scroll-bottom.has-new-messages {
  width: auto;
  min-width: 0;
  padding: 0 14px;
  border-radius: 999px;
  border-color: rgba(65, 176, 112, 0.36);
  background: rgba(18, 36, 25, 0.94);
  color: #bff2ce;
}

.chat-scroll-bottom.has-new-messages span {
  display: inline;
}

.chat-scroll-bottom.has-new-messages i {
  color: #82df9b;
}

.chat-scroll-bottom.has-new-messages:hover,
.chat-scroll-bottom.has-new-messages:focus-visible {
  border-color: rgba(65, 176, 112, 0.50);
  background: rgba(20, 44, 29, 0.97);
}

.chat-message__bubble {
  overflow-wrap: anywhere;
}

.chat-composer__hint.is-error,
[data-chat-status].is-error {
  color: #ff9f9f;
}

/* Chat Reactions Pack */
.chat-message__reactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chat-reaction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 30px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(var(--ui-rgb), 0.075);
  background: rgba(var(--ui-rgb), 0.035);
  color: rgba(var(--ui-rgb), 0.66);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, opacity .18s ease;
}

.chat-reaction i {
  font-size: 12px;
  color: currentColor;
}

.chat-reaction__count {
  min-width: 8px;
  color: currentColor;
  font-size: 11px;
  font-weight: 650;
}

.chat-reaction:not(:disabled):hover,
.chat-reaction:not(:disabled):focus-visible {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.28);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.10);
  color: var(--accent-light, #e5ca87);
  outline: none;
}

.chat-reaction.is-active {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.42);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.16);
  color: var(--accent-light, #e5ca87);
}

.chat-reaction.has-count:not(.is-active) {
  color: rgba(var(--accent-light-rgb, 229, 202, 135), 0.82);
  background: rgba(var(--ui-rgb), 0.055);
}

.chat-reaction:disabled {
  cursor: default;
  opacity: 1;
  pointer-events: none;
}

.chat-message--own .chat-reaction {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.16);
  background: rgba(0, 0, 0, 0.12);
}

@media (max-width: 640px) {
  .chat-message__reactions {
    gap: 5px;
    margin-top: 8px;
  }

  .chat-reaction {
    min-width: 28px;
    min-height: 26px;
    padding-inline: 8px;
  }
}

/* Chat Reactions Pack: one reaction + emotion burst */
.chat-reaction[data-chat-reaction="like"].is-active,
.chat-reaction[data-chat-reaction="laugh"].is-active {
  border-color: rgba(75, 213, 139, 0.40);
  background: rgba(75, 213, 139, 0.14);
  color: #88f0b7;
}

.chat-reaction[data-chat-reaction="dislike"].is-active,
.chat-reaction[data-chat-reaction="sad"].is-active {
  border-color: rgba(255, 126, 126, 0.40);
  background: rgba(255, 126, 126, 0.13);
  color: #ff9f9f;
}

.chat-reaction-burst {
  position: fixed;
  z-index: 9999;
  width: 1px;
  height: 1px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  color: var(--accent-light, #e5ca87);
}

.chat-reaction-burst i {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 18px;
  transform: translate(-50%, -50%) scale(.65);
  animation: chatReactionPop .72s cubic-bezier(.18, .9, .24, 1) forwards;
}

.chat-reaction-burst span {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: .92;
}

.chat-reaction-burst span:nth-child(2) {
  animation: chatReactionParticleOne .66s ease-out forwards;
}

.chat-reaction-burst span:nth-child(3) {
  animation: chatReactionParticleTwo .66s ease-out forwards;
}

.chat-reaction-burst span:nth-child(4) {
  animation: chatReactionParticleThree .66s ease-out forwards;
}

.chat-reaction-burst.is-like,
.chat-reaction-burst.is-laugh {
  color: #88f0b7;
}

.chat-reaction-burst.is-dislike,
.chat-reaction-burst.is-sad {
  color: #ff9f9f;
}

@keyframes chatReactionPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.45) rotate(-8deg);
  }
  22% {
    opacity: 1;
    transform: translate(-50%, -88%) scale(1.28) rotate(5deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -142%) scale(.96) rotate(0deg);
  }
}

@keyframes chatReactionParticleOne {
  0% { opacity: .95; transform: translate(-50%, -50%) scale(.45); }
  100% { opacity: 0; transform: translate(-27px, -31px) scale(.15); }
}

@keyframes chatReactionParticleTwo {
  0% { opacity: .95; transform: translate(-50%, -50%) scale(.45); }
  100% { opacity: 0; transform: translate(24px, -28px) scale(.15); }
}

@keyframes chatReactionParticleThree {
  0% { opacity: .95; transform: translate(-50%, -50%) scale(.45); }
  100% { opacity: 0; transform: translate(0, -42px) scale(.15); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-reaction-burst {
    display: none;
  }
}

/* Chat Social Pack: компактные действия сообщений */
.chat-message__actions {

  justify-content: flex-end;

}

.chat-message__action.is-active,
.chat-message__action[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.35);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.14);
  color: var(--accent-light, #e5ca87);
}

.chat-message__action .fa-copy {
  font-size: 12px;
}

@media (max-width: 720px) {
  .chat-message__actions {
    opacity: 1;
    transform: none;
    gap: 5px;
    max-width: 176px;
  }
}

/* Chat pinned message placement fix */

.chat-shell__main--has-pins .chat-messages {
  padding-top: 18px !important;
}

.chat-pins {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: 3;
  padding: 10px 18px 0 !important;
  pointer-events: auto;
}

.chat-pins__inner {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  min-width: 0;
}

.chat-pin {
  width: auto !important;
  max-width: min(620px, 100%) !important;
  min-height: 42px;
  padding: 8px 10px !important;
  gap: 9px;
  align-items: center;
  border-radius: 10px !important;
  background: rgba(18, 18, 18, 0.96);
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.16);
}

.chat-pin__icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

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

.chat-pin__title {
  display: block;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-pin__text {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-pin__remove {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-left: 4px;
  border-radius: 9px;
}

.chat-message__bubble::before,
.chat-message__bubble::after {
  display: none !important;
}

@media (max-width: 720px) {
  .chat-pins {
    padding: 8px 12px 0 !important;
  }

  .chat-pins__inner {
    justify-content: stretch;
  }

  .chat-pin {
    width: 100% !important;
    max-width: none !important;
    min-height: 42px;
  }
}

@media (max-width: 420px) {
  .chat-pins {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .chat-pin {
    padding: 7px 9px !important;
  }

  .chat-pin__icon {
    width: 25px;
    height: 25px;
  }

  .chat-pin__remove {
    width: 26px;
    height: 26px;
  }
}

/* Chat grid stability after removing pinned message */
.chat-shell__main {
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  grid-template-areas:
    "chat-head"
    "chat-pins"
    "chat-messages"
    "chat-composer";
}

.chat-main-head {
  grid-area: chat-head;
}

.chat-pins {
  grid-area: chat-pins;
}

.chat-pins[hidden] {
  display: none !important;
}

.chat-messages {
  grid-area: chat-messages;
  min-height: 0;
}

.chat-composer {
  grid-area: chat-composer;
  align-self: end;
}

.chat-scroll-bottom {
  position: absolute;
  right: 22px;
  bottom: 120px;
  z-index: 8;
}

@media (max-width: 720px) {
  .chat-scroll-bottom {
    right: 14px;
    bottom: 104px;
  }
}

/* Chat message search polish */
.chat-inline-search {
  min-width: min(300px, 36vw);
  padding-right: 5px;
}

.chat-inline-search input {
  padding-right: 38px;
}

.chat-inline-search__clear,
.chat-inline-search button.chat-inline-search__clear {
  right: 7px;
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(var(--ui-rgb), 0.075);
  background: rgba(var(--ui-rgb), 0.045);
  color: rgba(var(--ui-rgb), 0.58);
  display: grid;
  place-items: center;
  line-height: 1;
}

.chat-inline-search__clear i,
.chat-inline-search button.chat-inline-search__clear i {
  font-size: 12px;
  line-height: 1;
}

.chat-inline-search__clear:hover,
.chat-inline-search button.chat-inline-search__clear:hover {
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.12);
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.22);
  color: var(--accent-light, #e5ca87);
  transform: none;
}

.chat-inline-search__clear[hidden],
.chat-inline-search button.chat-inline-search__clear[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .chat-inline-search {
    min-width: 0;
  }
}

/* Chat Polish Pack: message menu, unread polish and typing indicator */
.chat-message__actions {

  flex-wrap: nowrap;
  max-width: none;
  opacity: 0;
  transform: none;
  z-index: 5;
}

.chat-message:hover .chat-message__actions,
.chat-message:focus-within .chat-message__actions,
.chat-message__actions.is-open {
  opacity: 1;
  transform: none;
}

.chat-message__action--menu {
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.chat-message__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 188px;
  padding: 6px;
  border: 1px solid rgba(var(--ui-rgb),0.09);
  border-radius: 10px;
  background: rgba(22,22,22,0.98);
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px) scale(.98);
  transform-origin: top right;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.chat-message__actions.is-open .chat-message__menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-message__menu::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 13px;
  width: 9px;
  height: 9px;
  border-left: 1px solid rgba(var(--ui-rgb),0.09);
  border-top: 1px solid rgba(var(--ui-rgb),0.09);
  background: rgba(22,22,22,0.98);
  transform: rotate(45deg);
}

.chat-message__menu-item {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(var(--ui-rgb),0.86);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.chat-message__menu-item i {
  width: 16px;
  color: rgba(var(--accent-rgb, 214, 179, 106), 0.88);
  text-align: center;
}

.chat-message__menu-item:hover,
.chat-message__menu-item:focus-visible,
.chat-message__menu-item.is-active {
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.12);
  color: var(--accent-light, #e5ca87);
  outline: none;
}

.chat-message__menu-item--danger i,
.chat-message__menu-item--danger:hover,
.chat-message__menu-item--danger:focus-visible {
  color: #ffb5b5;
}

.chat-message__menu-item--danger:hover,
.chat-message__menu-item--danger:focus-visible {
  background: rgba(255,95,95,0.12);
}

.chat-message--own .chat-message__menu {
  right: auto;
  left: 0;
  transform-origin: top left;
}

.chat-message--own .chat-message__menu::before {
  right: auto;
  left: 13px;
}

.chat-room-item__unread,
.chat-dialog-item__unread {
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), 0.34);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.16);
  color: var(--accent-light, #e5ca87);
  box-shadow: none;
}

.chat-dialog-item:has(.chat-dialog-item__unread),
.chat-room-item:has(.chat-room-item__unread) {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.22);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.055);
}

[data-chat-status].is-typing {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-light, #e5ca87);
}

.chat-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transform: translateY(1px);
}

.chat-typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: .55;
  animation: chatTypingDot 1s ease-in-out infinite;
}

.chat-typing-dots i:nth-child(2) { animation-delay: .15s; }
.chat-typing-dots i:nth-child(3) { animation-delay: .3s; }

/* Chat realtime: online chip and read receipts */
.chat-main-head__chip-online {
  color: #9ff0b8;
  border-color: rgba(91, 220, 132, 0.2);
  background: rgba(91, 220, 132, 0.08);
}

.chat-main-head__chip-online i {
  font-size: 7px;
  color: #5bdc84;
  filter: drop-shadow(0 0 8px rgba(91, 220, 132, 0.45));
}

.chat-message__receipt {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: rgba(var(--ui-rgb),0.34);
  font-size: 10px;
  line-height: 1;
  vertical-align: middle;
}

.chat-message__receipt.is-read {
  color: var(--accent-color, #d6b36a);
}

.chat-message--own .chat-message__time {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

@keyframes chatTypingDot {
  0%, 80%, 100% { opacity: .35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 720px) {
  .chat-message__actions {
    opacity: 1;
  }

  .chat-message__menu {
    min-width: 178px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-typing-dots i,
  .chat-page__intro::after {
    animation: none;
  }
}

/* Chat menu viewport containment fix */
.chat-shell,
.chat-shell__main,
.chat-messages {
  min-width: 0;
}

.chat-shell__main {
  overflow: hidden;
}

.chat-messages {
  overflow-x: hidden;
}

.chat-message__head,
.chat-message__actions {
  min-width: 0;
}

.chat-message__actions {
  position: relative;
  flex: 0 0 auto;
}

.chat-message__menu,
.chat-message--own .chat-message__menu {
  left: auto !important;
  right: 0 !important;
  max-width: min(220px, calc(100vw - 32px));
  transform-origin: top right;
}

.chat-message__menu::before,
.chat-message--own .chat-message__menu::before {
  left: auto !important;
  right: 13px !important;
}

.chat-message__menu-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .chat-message__menu,
  .chat-message--own .chat-message__menu {
    min-width: 168px;
    max-width: calc(100vw - 28px);
  }
}

/* Dialog activity polish */
.chat-dialog-item--unread {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.28);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.065);
}

.chat-dialog-item--unread .chat-dialog-item__name {
  color: var(--accent-light, #e5ca87);
}

.chat-dialog-item__receipt {
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  color: rgba(var(--ui-rgb),0.36);
  font-size: 10px;
  vertical-align: middle;
}

.chat-dialog-item__receipt.is-read {
  color: var(--accent-color, #d6b36a);
}

.chat-dialog-item__preview-label {
  color: rgba(var(--accent-rgb, 214, 179, 106), 0.92);
  font-weight: 650;
}

.chat-dialog-item--unread .chat-dialog-item__preview {
  color: rgba(var(--ui-rgb),0.82);
  font-weight: 650;
}

.chat-dialog-item__unread {
  min-width: 24px;
  height: 24px;
  padding-inline: 8px;
  border-color: rgba(var(--accent-rgb, 214, 179, 106), 0.42);
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.22);
  color: var(--accent-light, #e5ca87);
}

.chat-dialog-item__time {
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-dialog-item__bottom {
  gap: 8px;
}

.chat-dialog-item__preview {
  flex: 1 1 auto;
}

.chat-dialog-item__meta {
  max-width: 45%;
}

@media (max-width: 760px) {
  .chat-dialog-item__time {
    max-width: 60px;
    font-size: 11px;
  }

  .chat-dialog-item__badge {
    display: none;
  }

  .chat-dialog-item__meta {
    max-width: 36%;
  }
}

/* Compact role badges near avatars */
.chat-avatar,
.chat-main-head__avatar {
  overflow: visible;
}

.chat-avatar img,
.chat-main-head__avatar img,
.chat-avatar__fallback {
  border-radius: inherit;
  overflow: hidden;
}

.chat-avatar__role-mini {
  position: absolute;
  right: -5px;
  bottom: -5px;
  z-index: 3;
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid #111111;
  background: var(--surface-hover);
  color: rgba(var(--ui-rgb), 0.78);
  font-size: 8px;
  line-height: 1;
  box-shadow: none;
  pointer-events: none;
}

.chat-avatar__role-mini.is-premium {
  border-color: #111111;
  background: rgba(var(--accent-rgb, 214, 179, 106), 0.96);
  color: #111111;
}

.chat-avatar__role-mini.is-admin {
  border-color: #111111;
  background: rgba(255, 125, 125, 0.95);
  color: #1a0d0d;
}

.chat-avatar__role-mini.is-user {
  border-color: #111111;
  background: #252525;
  color: rgba(var(--ui-rgb), 0.78);
}

.chat-main-head__avatar .chat-avatar__role-mini {
  width: 21px;
  height: 21px;
  right: -6px;
  bottom: -6px;
  font-size: 9px;
}

.chat-dialog-item__badge,
.chat-main-head__badge {
  display: none !important;
}

.chat-dialog-item__meta:empty {
  display: none;
}

.chat-dialog-item__avatar,
.chat-message__avatar,
.chat-main-head__icon {
  overflow: visible;
}

@media (max-width: 760px) {
  .chat-avatar__role-mini {
    width: 18px;
    height: 18px;
    right: -4px;
    bottom: -4px;
    font-size: 7.5px;
  }

  .chat-main-head__avatar .chat-avatar__role-mini {
    width: 19px;
    height: 19px;
    right: -5px;
    bottom: -5px;
    font-size: 8px;
  }
}

/* Chat temporary image attachments */
.chat-composer {
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "reply reply reply reply reply"
    "attachment attachment attachment attachment attachment"
    "stickers stickers stickers stickers stickers"
    "attach sticker field counter submit"
    "hint hint hint hint hint";
}

.chat-composer__attachment {
  grid-area: attachment;
}

.chat-composer__attach {
  grid-area: attach;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(var(--ui-rgb),.08);
  border-radius: 10px;
  background: rgba(var(--ui-rgb),.045);
  color: rgba(var(--accent-light-rgb, 229, 202, 135), .88);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, opacity .18s ease;
}

.chat-composer__attach:hover,
.chat-composer__attach:focus-visible {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), .28);
  background: rgba(var(--accent-rgb, 214, 179, 106), .10);
  color: var(--accent-light, #e5ca87);
}

.chat-composer__attach:disabled {
  cursor: default;
  opacity: .48;
}

.chat-composer__sticker-toggle {
  grid-area: sticker;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(var(--ui-rgb),.08);
  border-radius: 10px;
  background: rgba(var(--ui-rgb),.045);
  color: rgba(var(--accent-light-rgb, 229, 202, 135), .88);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, opacity .18s ease;
}

.chat-composer__sticker-toggle:hover,
.chat-composer__sticker-toggle:focus-visible,
.chat-composer__sticker-toggle[aria-expanded="true"] {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), .28);
  background: rgba(var(--accent-rgb, 214, 179, 106), .10);
  color: var(--accent-light, #e5ca87);
}

.chat-composer__sticker-toggle:disabled {
  cursor: default;
  opacity: .48;
}

.chat-composer__stickers {
  grid-area: stickers;
  min-width: 0;
}

.chat-sticker-panel {
  padding: 12px;
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), .16);
  border-radius: 8px;
  background: rgba(18,18,18,.94);
  backdrop-filter: none;
}

.chat-sticker-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.chat-sticker-panel__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-light, #e5ca87);
  font-size: 11px;
  font-weight: 650;
}

.chat-sticker-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(var(--ui-rgb),.08);
  border-radius: 10px;
  background: rgba(var(--ui-rgb),.045);
  color: rgba(var(--ui-rgb),.72);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.chat-sticker-panel__close:hover,
.chat-sticker-panel__close:focus-visible {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), .25);
  background: rgba(var(--accent-rgb, 214, 179, 106), .10);
  color: var(--accent-light, #e5ca87);
}

.chat-sticker-panel__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.chat-sticker-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 72px;
  padding: 9px 7px;
  border: 1px solid rgba(var(--ui-rgb),.08);
  border-radius: 10px;
  background: rgba(var(--ui-rgb),.045);
  color: rgba(var(--ui-rgb),.82);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.chat-sticker-option:hover,
.chat-sticker-option:focus-visible {
  transform: none;
  border-color: rgba(var(--accent-rgb, 214, 179, 106), .25);
  background: rgba(var(--accent-rgb, 214, 179, 106), .10);
  color: var(--accent-light, #e5ca87);
}

.chat-sticker-option__emoji {
  font-size: 27px;
  line-height: 1;
}

.chat-sticker-option__title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.chat-message-sticker {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 122px;
  padding: 12px 14px 13px;
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), .16);
  border-radius: 8px;
  background: rgba(var(--accent-rgb, 214, 179, 106), .08);
}

.chat-message-sticker__emoji {
  font-size: 56px;
  line-height: 1;
}

.chat-message-sticker__title {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(var(--accent-light-rgb, 229, 202, 135), .94);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.chat-message--sticker .chat-message__bubble {
  width: auto;
}

.chat-message--sticker .chat-message__head {
  width: 100%;
}

.chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), .16);
  border-radius: 10px;
  background: rgba(var(--accent-rgb, 214, 179, 106), .075);
}

.chat-attachment-preview__media {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(var(--ui-rgb),.08);
  background: rgba(var(--ui-rgb),.055);
  color: var(--accent-light, #e5ca87);
}

.chat-attachment-preview__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-attachment-preview__body {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-attachment-preview__title {
  color: var(--accent-light, #e5ca87);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.chat-attachment-preview__text {
  margin-top: 3px;
  color: rgba(var(--ui-rgb),.62);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-attachment-preview__remove {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(var(--ui-rgb),.08);
  border-radius: 8px;
  background: rgba(var(--ui-rgb),.05);
  color: rgba(var(--ui-rgb),.75);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.chat-attachment-preview__remove:hover,
.chat-attachment-preview__remove:focus-visible {
  border-color: rgba(255,115,115,.25);
  background: rgba(255,82,82,.10);
  color: #ffc5c5;
}

.chat-message-attachment {
  display: block;
  margin-top: 10px;
  text-decoration: none;
}

.chat-message__bubble > .chat-message-attachment:first-child {
  margin-top: 2px;
}

.chat-message-attachment--image {
  position: relative;
  overflow: hidden;
  max-width: min(340px, 100%);
  border: 1px solid rgba(var(--ui-rgb),.08);
  border-radius: 8px;
  background: rgba(var(--ui-rgb),.045);
}

.chat-message-attachment--image img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.chat-message-attachment__meta {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 20px);
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(var(--ui-rgb),.10);
  border-radius: 999px;
  background: rgba(10,10,10,.74);
  color: rgba(var(--accent-light-rgb, 229, 202, 135), .94);
  font-size: 11px;
  font-weight: 650;
  backdrop-filter: none;
}

.chat-message-attachment--expired {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  padding: 13px 14px;
  border: 1px dashed rgba(var(--ui-rgb),.14);
  border-radius: 10px;
  background: rgba(var(--ui-rgb),.04);
  color: rgba(var(--ui-rgb),.78);
}

.chat-message-attachment__expired-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(var(--ui-rgb),.055);
  color: var(--accent-light, #e5ca87);
}

.chat-message-attachment__expired-body {
  min-width: 0;
}

.chat-message-attachment__expired-title {
  color: #f2f4f8;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.chat-message-attachment__expired-text {
  margin-top: 2px;
  color: rgba(var(--ui-rgb),.58);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .chat-composer {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "reply reply reply reply"
      "attachment attachment attachment attachment"
      "stickers stickers stickers stickers"
      "attach sticker field submit"
      "hint hint hint hint";
  }

  .chat-composer__counter {
    display: none;
  }

  .chat-composer__attach,
  .chat-composer__sticker-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .chat-sticker-panel__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chat-sticker-option {
    min-height: 66px;
  }

  .chat-message-attachment--image {
    max-width: 100%;
  }

  .chat-message-attachment--image img {
    max-height: 260px;
  }
}

/* Compact attachment message bubbles */
.chat-message__bubble {
  width: auto;
  max-width: 100%;
}

.chat-message--has-attachment .chat-message__bubble {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
}

.chat-message--attachment-only .chat-message__bubble {
  width: auto;
}

.chat-message--attachment-only .chat-message__head {
  width: 100%;
}

.chat-message--attachment-only .chat-message-attachment--image {
  width: min(340px, calc(100vw - 96px));
  max-width: 100%;
}

@media (max-width: 640px) {
  .chat-message--attachment-only .chat-message-attachment--image {
    width: min(320px, calc(100vw - 64px));
  }
}

@media (max-width: 420px) {
  .chat-sticker-panel {
    padding: 10px;
    border-radius: 10px;
  }

  .chat-sticker-panel__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .chat-sticker-option {
    min-height: 62px;
    border-radius: 8px;
  }

  .chat-sticker-option__emoji {
    font-size: 24px;
  }

  .chat-message-sticker {
    min-width: 108px;
    padding: 11px 12px 12px;
    border-radius: 8px;
  }

  .chat-message-sticker__emoji {
    font-size: 48px;
  }
}

/* Chat mentions */
.chat-message__mention {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 .28em;
  border-radius: 999px;
  background: rgba(var(--accent-rgb, 214, 179, 106), .16);
  color: var(--accent-light, #e5ca87);
  font-weight: 650;
  box-shadow: none;
}

.chat-message__mention mark {
  color: inherit;
}

/* Chat moderation action sheet */
.chat-moderation-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.chat-moderation-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.chat-moderation-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: none;
}

.chat-moderation-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid rgba(var(--accent-rgb, 214, 179, 106), .18);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(30, 30, 30, .98), rgba(17, 17, 17, .98));
  box-shadow: none;
  transform: translateY(10px) scale(.98);
  transition: transform .18s ease;
}

.chat-moderation-modal.is-open .chat-moderation-modal__dialog {
  transform: translateY(0) scale(1);
}

.chat-moderation-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--ui-rgb), .1);
  border-radius: 999px;
  background: rgba(var(--ui-rgb), .055);
  color: rgba(var(--ui-rgb), .78);
  cursor: pointer;
}

.chat-moderation-modal__close:hover,
.chat-moderation-modal__close:focus-visible {
  color: var(--accent-light, #e5ca87);
  border-color: rgba(var(--accent-rgb, 214, 179, 106), .35);
  outline: none;
}

.chat-moderation-modal__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 24px 58px 18px 22px;
  border-bottom: 1px solid rgba(var(--ui-rgb), .07);
}

.chat-moderation-modal__icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(var(--accent-rgb, 214, 179, 106), .13);
  color: var(--accent-light, #e5ca87);
}

.chat-moderation-modal__eyebrow {
  margin-bottom: 5px;
  color: rgba(var(--accent-rgb, 214, 179, 106), .92);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chat-moderation-modal__head h3 {
  margin: 0;
  color: var(--accent-light, #e5ca87);
  font-size: var(--type-card-title);
  line-height: 1.2;
}

.chat-moderation-modal__head p {
  margin: 7px 0 0;
  color: rgba(var(--ui-rgb), .62);
  font-size: var(--type-body);
  line-height: 1.45;
}

.chat-moderation-modal__actions {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.chat-moderation-option {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(var(--ui-rgb), .075);
  border-radius: 10px;
  background: rgba(var(--ui-rgb), .035);
  color: rgba(var(--ui-rgb), .9);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.chat-moderation-option:hover,
.chat-moderation-option:focus-visible {
  border-color: rgba(var(--accent-rgb, 214, 179, 106), .3);
  background: rgba(var(--accent-rgb, 214, 179, 106), .09);
  transform: none;
  outline: none;
}

.chat-moderation-option:disabled {
  opacity: .72;
  cursor: progress;
  transform: none;
}

.chat-moderation-option__icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(var(--accent-rgb, 214, 179, 106), .11);
  color: var(--accent-light, #e5ca87);
}

.chat-moderation-option__body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-moderation-option__label {
  color: var(--accent-light, #e5ca87);
  font-size: 12px;
  font-weight: 650;
}

.chat-moderation-option__hint {
  color: rgba(var(--ui-rgb), .56);
  font-size: 10px;
  line-height: 1.35;
}

.chat-moderation-option--danger:hover,
.chat-moderation-option--danger:focus-visible {
  border-color: rgba(255, 128, 128, .3);
  background: rgba(255, 95, 95, .09);
}

.chat-moderation-option--danger .chat-moderation-option__icon {
  background: rgba(255, 95, 95, .12);
  color: #ffb5b5;
}

.chat-moderation-option.is-loading .chat-moderation-option__icon i {
  animation: chatModerationSpin .8s linear infinite;
}

@keyframes chatModerationSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 560px) {
  .chat-moderation-modal {
    align-items: flex-end;
    padding: 10px;
  }

  .chat-moderation-modal__dialog {
    width: 100%;
    border-radius: 10px 10px 8px 8px;
  }

  .chat-moderation-modal__head {
    padding: 22px 54px 16px 18px;
  }

  .chat-moderation-modal__actions {
    padding: 12px;
  }
}

/* Live presence stage */
.chat-main-head__chip-online i {
  color: #79db82;
  filter: drop-shadow(0 0 6px rgba(121, 219, 130, .45));
}

@media (prefers-reduced-motion: no-preference) {
  .chat-main-head__chip-online i {
    animation: chatLiveDotPulse 1.8s ease-in-out infinite;
  }
}

@keyframes chatLiveDotPulse {
  0%, 100% { opacity: .78; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.12); }
}

/* Stage 4 live chat polish */
.chat-message.is-fresh .chat-message__bubble {
  animation: chatFreshMessage .42s ease both;
}

.chat-message--pending .chat-message__bubble {
  opacity: .78;
  border-style: dashed;
}

.chat-message--error .chat-message__bubble {
  border-color: rgba(255, 106, 106, .28);
  background: rgba(255, 106, 106, .075);
}

.chat-message__delivery-error {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: #ffd0d0;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
}

.chat-message__receipt.is-pending {
  color: rgba(var(--ui-rgb), .58);
}

.chat-message__receipt.is-error {
  color: #ff8f8f;
}

.chat-composer.is-typing-local {
  /* Typing should not recolor the ordinary outer composer divider. */
  border-color: rgba(var(--ui-rgb), 0.06);
  box-shadow: none;
}

@keyframes chatFreshMessage {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(.985);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-message.is-fresh .chat-message__bubble {
    animation: none;
  }
}


/* Stage 5: smooth loading and live-performance helpers */
.nm-perf-observe {
  opacity: .001;
  transform: translate3d(0, 10px, 0);
  transition: opacity .34s ease, transform .34s ease;
}

.nm-perf-observe.is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

:is(button, a, .btn, .admin-mini-btn, .admin-ghost, .admin-submit, .premium-btn).is-pressed {
  transform: scale(.985);
}

@media (prefers-reduced-motion: reduce) {
  .nm-perf-observe,
  .nm-perf-observe.is-inview,
  :is(button, a, .btn, .admin-mini-btn, .admin-ghost, .admin-submit, .premium-btn).is-pressed {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* NeoHelper typography harmonization: chat */
.chat-page__text,
.chat-main-head__placeholder-text,
.chat-empty__text,
.chat-room-item__text,
.chat-dialog-item__preview,
.chat-message__reply-text,
.chat-reply-preview__text,
.chat-pin__text,
.chat-composer__hint {
  color: var(--muted) !important;
  font-size: var(--type-body) !important;
  font-weight: 400 !important;
  line-height: 1.58;
}

.chat-room-item__meta,
.chat-dialog-item__meta,
.chat-message__time,
.chat-message__meta,
.chat-main-head__stat small,
.chat-page__stat-label,
.chat-composer__counter,
.chat-presence,
.chat-day-separator span {
  color: rgba(152, 160, 173, .76) !important;
  font-size: var(--type-body-sm) !important;
  font-weight: 400 !important;
}

.chat-sidebar-card__title,
.chat-main-head__room,
.chat-message__name,
.chat-empty__title,
.chat-pin__title,
.chat-reply-preview__label,
.chat-message__reply-name {
  font-size: var(--type-card-heading) !important;
  font-weight: 600 !important;
}

.chat-message__text {
  color: rgba(var(--ui-rgb), .88) !important;
  font-size: var(--type-body) !important;
  font-weight: 400 !important;
  line-height: 1.58;
}

.chat-page__eyebrow,
.chat-sidebar-card__eyebrow,
.chat-gate__badge {
  font-size: var(--type-label) !important;
  font-weight: 600 !important;
}

.chat-head-btn,
.chat-slow-menu__option,
.chat-gate__button,
.chat-composer__submit {
  font-size: 11px !important;
  font-weight: 600 !important;
}

:root[data-theme="light"] .chat-page__intro,
:root[data-theme="light"] .chat-sidebar-card,
:root[data-theme="light"] .chat-shell__main,
:root[data-theme="light"] .chat-gate,
:root[data-theme="light"] .chat-main-head,
:root[data-theme="light"] .chat-composer,
:root[data-theme="light"] .chat-slow-menu__dropdown,
:root[data-theme="light"] .chat-pin,
:root[data-theme="light"] .chat-message__menu,
:root[data-theme="light"] .chat-sticker-panel,
:root[data-theme="light"] .chat-moderation-modal__dialog {
  background: var(--panel-bg) !important;
  background-image: none !important;
  border-color: var(--border) !important;
  color: var(--text);
}

:root[data-theme="light"] .chat-message__menu::before {
  background: var(--panel-bg) !important;
  border-color: var(--border) !important;
}

:root[data-theme="light"] .chat-messages {
  background: var(--panel-bg-strong) !important;
}

:root[data-theme="light"] .chat-room-item,
:root[data-theme="light"] .chat-dialog-item,
:root[data-theme="light"] .chat-message__bubble,
:root[data-theme="light"] .chat-message__reply,
:root[data-theme="light"] .chat-reply-preview,
:root[data-theme="light"] .chat-empty,
:root[data-theme="light"] .chat-day-separator span,
:root[data-theme="light"] .chat-search,
:root[data-theme="light"] .chat-inline-search,
:root[data-theme="light"] .chat-composer__field {
  background: var(--field-bg) !important;
  border-color: var(--border) !important;
  color: var(--text);
}

:root[data-theme="light"] .chat-scroll-bottom {
  background: var(--panel-bg) !important;
  border-color: var(--border) !important;
  color: var(--text);
}

:root[data-theme="light"] .chat-avatar__role-mini,
:root[data-theme="light"] .chat-avatar__role-mini.is-user {
  background: var(--gray-control);
  border-color: var(--panel-bg);
  color: var(--text);
}

:root[data-theme="light"] .chat-avatar__role-mini.is-premium {
  background: var(--gold-button-bg, var(--gold-gradient));
  border-color: var(--panel-bg);
  color: var(--gold-button-text, #111111);
}

:root[data-theme="light"] .chat-avatar__role-mini.is-admin {
  background: #ef7d7d;
  border-color: var(--panel-bg);
  color: #351313;
}

:root[data-theme="light"] .chat-search input,
:root[data-theme="light"] .chat-inline-search input,
:root[data-theme="light"] .chat-composer__field textarea {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--accent-dark, #9a6d24) !important;
}

:root[data-theme="light"] .chat-search input::placeholder,
:root[data-theme="light"] .chat-inline-search input::placeholder,
:root[data-theme="light"] .chat-composer__field textarea::placeholder {
  color: var(--ui-text-faint) !important;
  -webkit-text-fill-color: var(--ui-text-faint) !important;
  opacity: 1;
}

/* Light chat intro: statistics and section badge. */
:root[data-theme="light"] .chat-page__stats {
  background: var(--panel-bg-strong) !important;
  border-color: var(--border) !important;
  color: var(--text);
}

:root[data-theme="light"] .chat-page__stat {
  background: transparent !important;
  border-right-color: var(--border) !important;
}

:root[data-theme="light"] .chat-page__stat-icon {
  background: rgba(var(--accent-rgb, 214, 179, 106), .13) !important;
  border-color: rgba(var(--accent-rgb, 214, 179, 106), .28) !important;
  color: var(--accent-dark, #9a6d24) !important;
}

:root[data-theme="light"] .chat-page__stat-value {
  color: var(--text) !important;
}

:root[data-theme="light"] .chat-page__stat-label {
  color: var(--muted) !important;
}

:root[data-theme="light"] .chat-page__eyebrow,
:root[data-theme="light"] .chat-gate__badge {
  background: rgba(var(--accent-rgb, 214, 179, 106), .12) !important;
  border-color: rgba(var(--accent-rgb, 214, 179, 106), .28) !important;
  color: var(--accent-dark, #9a6d24) !important;
}

:root[data-theme="light"] .chat-page__eyebrow i,
:root[data-theme="light"] .chat-gate__badge i {
  color: var(--accent-dark, #9a6d24) !important;
}
