/* assets/messages.css — REWRITE v1
   Single source of truth (threads + thread).
   Goal: Instagram-like, no footer scroll, chat-only scroll, composer pinned bottom.
*/

:root{
  /* layout */
  --msg-max: 1120px;
  --msg-pad-x: 12px;

  /* your fixed tabbar from social-tabbar */
    --tabbar-h: 75px;  /* высота social-tabbar */
  --tabbar-gap: 14px;


  /* colors */
  --msg-bg: rgba(255,255,255,.96);
  --msg-bd: rgba(0,0,0,.10);
  --msg-soft: rgba(0,0,0,.04);
  --msg-text: rgba(0,0,0,.92);
  --msg-sub: rgba(0,0,0,.60);

  /* accent */
  --msg-accent: #7c3aed;
  --msg-accent-bg: rgba(124,58,237,.14);
  --msg-accent-bd: rgba(124,58,237,.28);

  /* sizes */
  --r: 16px;
  --r2: 18px;

  /* composer */
  --composer-h: 64px; /* base height of input row */
  --composer-gap: 10px;
}
.c-msg__state[data-msg-state="login"] .c-msg__btn{
  width: 100%;
  height: auto;
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.2;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* ====== RESET / SAFETY ====== */
.c-msg, .c-msg *{ box-sizing: border-box; }
.c-msg{ color: var(--msg-text); }

/* links/buttons baseline */
.c-msg a{ color: inherit; }
.c-msg button{ font: inherit; color: inherit; }

/* =========================================
   THREADS LIST PAGE (data-msg-page="threads")
   ========================================= */
.c-msg[data-msg-page="threads"]{
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  padding: 18px var(--msg-pad-x) calc(18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom));
}


.c-msg__wrap{
  max-width: var(--msg-max);
  margin: 0 auto;
  width: 100%;

  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.c-msg__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 6px 0 14px;
}

.c-msg__title{
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.2px;
}
/* === CLB FIX: message input scrollbar/resize handle === */
.c-msg__inputWrap [data-msg-input],
.c-msg__inputWrap .c-msg__input,
.c-msg textarea,
textarea[data-msg-input]{
  resize:none !important;
  scrollbar-width:none !important;
  -ms-overflow-style:none !important;
}

.c-msg__inputWrap [data-msg-input]::-webkit-scrollbar,
.c-msg__inputWrap .c-msg__input::-webkit-scrollbar,
.c-msg textarea::-webkit-scrollbar,
textarea[data-msg-input]::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}


.c-msg__total{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #111827;
  color:#fff;
  font-size: 12px;
  font-weight: 900;
}

.c-msg__state{
  background: var(--msg-bg);
  border: 1px solid var(--msg-bd);
  border-radius: var(--r2);
  padding: 14px;
}

.c-msg__hint{
  font-size: 14px;
  line-height: 1.45;
  color: var(--msg-sub);
}

.c-msg__btn{
  margin-top: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  border:1px solid var(--msg-bd);
  background: #fff;
  text-decoration:none;
  font-weight: 900;
}

.c-msg__empty{
  flex: 1 1 auto;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}
.c-msg__emptyCard{
  width: 100%;
  max-width: 520px;
  background: var(--msg-bg);
  border: 1px solid var(--msg-bd);
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

.c-msg__emptyIcon{
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.05);
  font-size: 24px;
}

.c-msg__emptyTitle{
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 6px;
}

.c-msg__emptyText{
  font-size: 13px;
  color: var(--msg-sub);
  line-height: 1.45;
}


.c-msg__list{
  display:flex;
  flex-direction:column;
  gap: 3px;
  margin-top: 12px;

  flex: 1 1 auto;
  min-height: 220px; /* чтобы при 1 диалоге не “схлопывалось” */
}


/* conversation row */
.c-msg__item{
  display:flex;
  gap:12px;
  align-items:center;

  background: var(--msg-bg);
  border: 1px solid var(--msg-bd);
  border-radius: 10px;

  padding: 10px 12px;
  text-decoration:none;
}

.c-msg__item:active{ transform: scale(.995); }

.c-msg__ava{
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  object-fit: cover;
  flex: 0 0 auto;
}

.c-msg__mid{
  flex: 1 1 auto;
  min-width: 0;
}

.c-msg__name{
  font-weight: 900;
  font-size: 14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.c-msg__last{
  margin-top: 2px;
  font-size: 13px;
  color: var(--msg-sub);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.c-msg__right{
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    /* align-items: flex-end; */
    gap: 6px;
}

.c-msg__time{
  font-size: 12px;
  color: var(--msg-sub);
}

.c-msg__badge{
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--msg-accent);
  color:#fff;
  font-size: 12px;
  line-height: 18px;
  text-align:center;
  font-weight: 900;
}

.c-msg__dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--msg-accent);
}

/* =========================================
   THREAD PAGE (data-msg-page="thread")
   - no page scroll at all
   - chat-only scroll
   - header built-in
   - composer pinned bottom (above tabbar)
   ========================================= */
.c-msg[data-msg-page="thread"]{
  position: fixed;
  inset: 0;
  z-index: 1001;

  /* takes theme background */
  background: rgba(var(--bg-color));

  padding: 0 var(--msg-pad-x);
  overflow: hidden;
  height: 100dvh;
}

.c-msg__wrap--thread{
  height: 100%;
  max-width: var(--msg-max);
  margin: 0 auto;

  display:flex;
  flex-direction:column;
}

/* top bar: встроенная, не карточка */
.c-msg__bar{
  position: sticky;
  top: 0;
  z-index: 10;

  display:flex;
  align-items:center;
  gap:10px;

  padding: 12px 8px;
  background: var(--msg-bg);
  border-bottom: 1px solid var(--msg-bd);
}

.c-msg__back{
  text-decoration: none;
  font-size: 0;
  line-height: 0;
  color: rgba(255,255,255,.92);

  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
}

.c-msg__back::before{
  content: "";
  width: 20px;
  height: 20px;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' aria-hidden='true' focusable='false'><path d='M15 5l-7 7 7 7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.c-msg__back:active{
  background: var(--msg-soft);
}

.c-msg__peer{
  font-weight: 900;
  font-size: 14px;
  min-width: 0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* optional: right-side menu button if you add it later */
.c-msg__more{
      margin-left: auto;
    width: 15px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.c-msg__more:active{ background: var(--msg-soft); }

/* states */
.c-msg[data-msg-page="thread"] .c-msg__state{
  margin: 10px 0;
}
/* FIX: allow inner scroll inside flex column on mobile */
.c-msg[data-msg-page="thread"] .c-msg__wrap--thread{ min-height: 0; }
.c-msg[data-msg-page="thread"] .c-msg__main{ min-height: 0; }
.c-msg[data-msg-page="thread"] .c-msg__chat{
  min-height: 0;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

/* chat: only scroll area */
.c-msg__chat{
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;

  display:flex;
  flex-direction:column;
  gap:10px;

  padding: 12px 2px;

  /* keep last messages visible above composer */
  padding-bottom: calc(
    12px
    + var(--composer-h)
    + var(--composer-gap)
    + var(--tabbar-h)
    + var(--tabbar-gap)
    + env(safe-area-inset-bottom)
  );
}

/* bubbles */
.c-msg__bubble{
  max-width: 82%;
  border-radius: 24px 18px 18px 0;
  padding: 8px 12px 8px 12px;

  border: 1px solid var(--msg-bd);
  background: #fff;

  word-break: break-word;
}

.c-msg__bubble--me{
  align-self: flex-end;
  background: var(--msg-accent-bg);
  border-color: var(--msg-accent-bd);
border-radius: 18px 24px 0 18px;}
/* group chat: sender avatar + name inside incoming bubble */
.c-msg__bubble--group:not(.c-msg__bubble--me){
  padding-top: 10px;
}

.c-msg__gHead{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0 18px 6px 0; /* запас справа под ⋮ */
}

.c-msg__gAva{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
  background: rgba(0,0,0,.06);
}

.c-msg__gSender{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--msg-sub);
}

.c-msg__bubble--group.c-msg__bubble--bare .c-msg__gHead{
  margin: 0 2px 8px 2px;
}
/* meta line */
.c-msg__metaLine{
  margin-top: 6px;
  font-size: 11px;
  line-height: 1;
  color: var(--msg-sub);
  display:flex;
  gap:6px;
  justify-content:space-between;
  align-items:center;
}

.c-msg__heart{ cursor:pointer; user-select:none; }

/* media */
.c-msg__mediaRow{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top: 8px;
}
.c-msg__img{
  width: 140px;
  height: 140px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--msg-bd);
  background: rgba(0,0,0,.04);
}

.c-msg__mediaRow{
  position: relative;
}
.c-msg__bubble--mediaOnly .c-msg__mediaRow{
  display: inline-flex;
  width: fit-content;
  max-width: min(440px, 78vw);
  margin-top: 0;
}
.c-msg__mediaRow .c-msg__more--media,
.c-msgEmbedCard .c-msg__more--embed{
  position: absolute;
    top: 2px;
    right: 21px;
  left: auto;
  z-index: 4;
}
.c-msgEmbedCard{
  position: relative;
}

/* reply preview — аккуратно, без “уродской обводки” */
.c-msg__reply{ margin: 0; }
.c-msg__replyBox{
  border: 0;
  border-left: 3px solid rgba(124,58,237,.65);
  border-radius: 12px;
  background: var(--msg-soft);
  padding: 8px 10px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.c-msg__replyText{
  font-size: 13px;
  color: var(--msg-text);
  opacity: .9;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.c-msg__replyX{
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
}
.c-msg__replyX:active{ background: rgba(0,0,0,.06); }

/* composer pinned bottom (above tabbar) */
.c-msg__composer{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--msg-max), calc(100% - (var(--msg-pad-x) * 2)));
  z-index: 20;

  bottom: 0%;

  background: #ffffff;
  border-top: 1px solid var(--msg-bd);

  padding:10px 6px 18px 6px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.c-msg__composerRow{
  display:flex;
  gap:8px;
  align-items:flex-end;
}

/* plus photo button — stable file picker */
.c-msg__file{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;

  display:flex;
  align-items:center;
  justify-content:center;

  font-weight: 900;
  font-size: 18px;

  position: relative;
  overflow: hidden;
  user-select: none;
}
.c-msg__file input[type="file"]{
  position:absolute;
  inset:0;
  opacity:0;
  width:100%;
  height:100%;
  cursor:pointer;
}

/* textarea “pill”, grows to limit */
.c-msg__input{
  flex: 1 1 auto;

  min-height: 42px;
  max-height: 140px;
  overflow-y: auto;

  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
 padding: 11px 4px;

  resize: none;
  outline: none;
  background: #fff;

  font-size: 14px;
  line-height: 1.35;
}

/* send button */
.c-msg__send{
 min-width: 92px;
    height: 41px;
    border-radius: 999px;
    border: 0;
    background: #7228ff;
    color: #fff ! IMPORTANT;
    font-weight: 550 ! IMPORTANT;
    font-size: 11px ! IMPORTANT;
}
.c-msg__send:active{ transform: scale(.99); }

/* previews */
.c-msg__previews{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding: 2px 2px 6px;
}
.c-msg__prev{
  position:relative;
  width:68px;
  height:68px;
  flex:0 0 auto;

  border-radius: 14px;
  border:1px solid rgba(0,0,0,.10);
  overflow:hidden;
  background: rgba(0,0,0,.04);
}
.c-msg__prevImg{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.c-msg__prevX{
  position:absolute;
  top:4px;
  right:4px;

  width:22px;
  height:22px;
  border-radius:999px;
  border:0;

  background: rgba(0,0,0,.55);
  color:#fff;
  cursor:pointer;
  line-height:22px;
}

/* ===== Bottom sheet / modal ===== */
.c-msg__sheet, .c-msg__modal{
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.c-msg__sheetBg, .c-msg__modalBg{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.45);
}

.c-msg__sheetCard{
  position:absolute;
  left:12px;
  right:12px;
  bottom: calc(12px + env(safe-area-inset-bottom));

  background:#fff;
  border-radius: 18px;
  padding: 10px;
  border:1px solid rgba(0,0,0,.10);
}

.c-msg__sheetBtn{
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  margin: 6px 0;
  font-weight: 900;
}
.c-msg__sheetBtn--danger{
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.20);
}

.c-msg__modalCard{
  position:absolute;
  left:12px;
  right:12px;
  top: 12%;

  background:#fff;
  border-radius: 18px;
  padding: 12px;

  border:1px solid rgba(0,0,0,.10);
  max-height: 70vh;
  overflow:auto;
}

.c-msg__modalTitle{
  font-weight: 900;
  margin-bottom: 10px;
}

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

/* ===== Responsive ===== */
@media (min-width: 768px){
  .c-msg__img{ width: 160px; height: 160px; }
  .c-msg__bubble{ max-width: 64%; }
}
@media (max-width: 420px){
  .c-msg__send{ min-width: 78px; }
  .c-msg__bubble{ max-width: 88%; }
}



/* === DESKTOP ONLY: Instagram-like threads split + separators (do not touch mobile) === */
@media (min-width: 900px){

  /* 2 columns: left threads list + right panel */
.c-msg__shell{
  max-width: var(--msg-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 0;
}
  .c-msg__left{ min-width: 0; }
  .c-msg__right{ min-width: 0; }

  /* make left side look like a panel and keep it scroll-safe */
  .c-msg__left .c-msg__wrap{
    max-width: none;
    margin: 0;
    background: var(--msg-bg);
    border: 1px solid var(--msg-bd);
    border-radius: 18px;
    padding: 14px 12px;

    height: calc(100dvh - 18px - (18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom)));
    overflow: hidden; /* внутри будет скролл у списка */
  }

  /* list becomes a single container with separators */
  .c-msg[data-msg-page="threads"] .c-msg__list{
    gap: 0 !important;
    margin-top: 10px;

     /*border: 1px solid var(--msg-bd);*/
    border-radius: 16px;
    overflow: auto;                 /* <-- будет скролл ВНИЗ, если диалогов много */
    -webkit-overflow-scrolling: touch;

    background: rgba(255,255,255,.92);

    flex: 1 1 auto;
    min-height: 220px;
  }

  .c-msg[data-msg-page="threads"] .c-msg__item{
    border: 0 !important;
    border-radius: 0 !important;
    background: #f9f9f9 !important;
    margin: 0 !important;
    padding: 12px 12px !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__item + .c-msg__item{
    border-top: 1px solid var(--msg-bd); /* <-- твоя “полоска” */
  }

  .c-msg[data-msg-page="threads"] .c-msg__item:hover{
    background: rgba(0,0,0,.03) !important;
  }

  /* right panel (empty state) */
  .c-msg__panel{
    height: calc(100dvh - 18px - (18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom)));
    min-height: 420px;
    background: var(--msg-bg);
    border: 1px solid var(--msg-bd);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
  }
}
@media (max-width: 899px){
  .c-msg__right .tecst{
    display: none !important;
  }
}

@media (min-width: 900px){
  .c-msg[data-msg-page="threads"]{
    padding-top: 34px;
  }
}


.c-msg__timeRow{
  display:flex;
  align-items:center;
  gap:8px;
  justify-content:flex-end;
}

.c-msg__checks{
  font-size:12px;
  opacity:.75;
  line-height:1;
  user-select:none;
  color: #1873ff;
}



/* clickable reply preview */
.c-msg__replyJump{
  cursor: pointer;
  border-radius: 4px;
  padding-top: 2px;
  padding-bottom: 2px;
}
.c-msg__replyJump:hover{
  background: rgba(124,58,237,.08);
}

/* strong visible jump highlight */
.c-msg__jump{
  animation: clbMsgJumpBubble 1800ms ease;
  position: relative;
  z-index: 2;
}

.c-msg__jumpItem{
  animation: clbMsgJumpItem 1800ms ease;
  border-radius: 18px;
}

@keyframes clbMsgJumpBubble{
  0%{
    box-shadow: 0 0 0 0 rgba(124,58,237,0);
    background: rgba(124,58,237,0);
    transform: scale(1);
  }
  12%{
    box-shadow:
      0 0 0 3px rgba(124,58,237,.38),
      0 0 28px rgba(124,58,237,.22);
    background: rgba(124,58,237,.12);
    transform: scale(1.01);
  }
  45%{
    box-shadow:
      0 0 0 3px rgba(124,58,237,.24),
      0 0 18px rgba(124,58,237,.14);
    background: rgba(124,58,237,.08);
    transform: scale(1);
  }
  100%{
    box-shadow: 0 0 0 0 rgba(124,58,237,0);
    background: rgba(124,58,237,0);
    transform: scale(1);
  }
}

@keyframes clbMsgJumpItem{
  0%{
    background: rgba(124,58,237,0);
  }
  18%{
    background: rgba(124,58,237,.08);
  }
  60%{
    background: rgba(124,58,237,.04);
  }
  100%{
    background: rgba(124,58,237,0);
  }
}



.c-msg__bubble{ position:relative; }

.c-msg__bubble--bare{
  padding-right: 0 !important;
}

/* dots are now inside bottom meta row */
.c-msg__more--top,
.c-msg__more--text,
.c-msg__more--media,
.c-msg__more--embed{
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
}

.c-msg__metaLine{
  margin-top: 6px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

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

.c-msg__metaMenu{
  display:flex;
  align-items:center;
  min-width:18px;
}

.c-msg__metaLine--me .c-msg__metaMenu{
  justify-content:flex-end;
}

.c-msg__metaLine--peer .c-msg__metaMenu{
  justify-content:flex-start;
}

.c-msg__more--meta{
  width:18px;
  height:18px;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  border-radius:0 !important;
  color:rgba(0,0,0,.58);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}

/* heart stays outside bubble */
.c-msg__heart--side{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  z-index:2;
}

.c-msg__bubble--me .c-msg__heart--side.is-me{
  right: calc(100% + 6px);
  left: auto;
  font-size: 14px;
}

.c-msg__bubble:not(.c-msg__bubble--me) .c-msg__heart--side.is-peer{
  left: calc(100% + 6px);
  right: auto;
  font-size: 14px;
}






/* ===== DESKTOP: thread with persistent left threads list (Instagram-like) ===== */
@media (min-width: 900px){

  /* 2 колонки */
  .c-msg.c-msg--desk[data-msg-page="thread"]{
    position: static;     /* на десктопе НЕ full-screen fixed */
    inset: auto;
    height: auto;
    overflow: visible;

    min-height: 100dvh;
    padding: 18px var(--msg-pad-x)
      calc(18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom));
  }

  .c-msg.c-msg--desk[data-msg-page="thread"] .c-msg__shell{
    max-width: var(--msg-max);
    margin: 0 auto;
    width: 100%;

    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
  }

  /* LEFT panel */
  .c-msg.c-msg--desk[data-msg-page="thread"] .c-msg__sidebar{
    background: var(--msg-bg);
    border: 1px solid var(--msg-bd);
    border-radius: 18px;
    overflow: hidden;

    height: calc(100dvh - 18px - (18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom)));
    display: flex;
    flex-direction: column;
  }

  .c-msg.c-msg--desk[data-msg-page="thread"] .c-msg__sideTop{
    padding: 14px 12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    border-bottom: 1px solid var(--msg-bd);
  }

  .c-msg.c-msg--desk[data-msg-page="thread"] .c-msg__sidebar .c-msg__list{
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;

    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--msg-bg);
  }

  .c-msg.c-msg--desk[data-msg-page="thread"] .c-msg__sidebar .c-msg__item{
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 12px 12px !important;
  }

  .c-msg.c-msg--desk[data-msg-page="thread"] .c-msg__sidebar .c-msg__item + .c-msg__item{
    border-top: 1px solid var(--msg-bd);
  }

  .c-msg.c-msg--desk[data-msg-page="thread"] .c-msg__sidebar .c-msg__item:hover{
    background: rgba(0,0,0,.03) !important;
  }

  /* RIGHT panel as a card, chat scroll inside */
  .c-msg.c-msg--desk[data-msg-page="thread"] .c-msg__wrap--thread{
    height: calc(100dvh - 18px - (18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom)));
    overflow: hidden;

    background: var(--msg-bg);
    border: 1px solid var(--msg-bd);
    border-radius: 18px;
    display:flex;
    flex-direction:column;
  }

  /* composer НЕ должен перекрывать левую колонку */
  .c-msg.c-msg--desk[data-msg-page="thread"] .c-msg__composer{
    position: sticky;
    left: auto;
    transform: none;
    width: auto;

   
    z-index: 20;

    border-top: 1px solid var(--msg-bd);
    border-radius: 0 0 18px 18px;
  }

  /* в десктоп-режиме не нужен огромный padding-bottom в чате */
  .c-msg.c-msg--desk[data-msg-page="thread"] .c-msg__chat{
    padding-bottom: 14px;
  }
}

/* по умолчанию (мобилка/узкие) сайдбар скрыт — мобильная не меняется */
.c-msg__sidebar{ display:none; }
.c-msg__main{ width:100%; }

/* только десктоп: показываем 2 колонки */
@media (min-width: 1000px){
  .c-msg.c-msg--desk .c-msg__shell{
    display:grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap:16px;
    align-items: stretch;
  }
  .c-msg.c-msg--desk .c-msg__sidebar{ display:block; }
}











.c-msg__peerLink{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:inherit;
  min-width:0;
}
.c-msg__peerAva{
  width:30px;
  height:30px;
  border-radius:999px;
  object-fit:cover;
  flex:0 0 auto;
}
.c-msg__topMore{
  margin-left:auto;
  width:36px;
  height:36px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.88);
  font-size:18px;
  line-height:1;
  padding:0;
  cursor:pointer;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 4px 14px rgba(0,0,0,.06);
}
.c-msg__topMore:hover{ background:rgba(0,0,0,.04); }



/* 3) В ОТКРЫТОМ диалоге фон убираем */
.c-msg[data-msg-page="thread"] .c-msg__topMore,
.c-msg[data-msg-page="thread"] .c-msg__topMore:hover,
.c-msg[data-msg-page="thread"] .c-msg__topMore:active{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}



.c-msg__emojiRow{
  display:flex;
  gap:8px;
  align-items:center;
  margin:0 0 0px;
  padding:4px 2px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.c-msg__emojiBtn{
  border:0;
  background:rgba(0,0,0,.05);
  border-radius:12px;
  padding:6px 10px;
  font-size:18px;
  line-height:1;
  cursor:pointer;
}

.c-msg__emojiBtn:active{
  transform:scale(.96);
}





/* пузырь должен подстраиваться под контент */
.c-msg__bubble{

  width: fit-content;        /* не 100% */
  max-width: 40%;            /* подстрой: 65–80% */
}
/* отдельно для мобильной версии */
@media (max-width: 767px){
  .c-msg__bubble{
    width: fit-content;
    max-width: 78%;
  }
}

.c-msg__bubble--me{
  margin-left: auto;         /* мои справа */
}

.c-msg__bubble--bare{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.c-msg__bubble--bare .c-msg__metaLine{
  margin-top: 8px;
  padding: 0 6px;
}

.c-msg__bubble--bare .c-msg__replyJump{
  margin: 0 0 8px !important;
}

.c-msg__bubble--mediaOnly .c-msg__more--media,
.c-msg__bubble--embedOnly .c-msg__more--embed{
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-radius: 999px;
}

.c-msg__bubble .c-msg__more--text{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.c-msg__bubble--bare .c-msg__img{
  width: min(420px, 72vw);
  height: auto;
  max-height: 520px;
  border-radius: 18px;
}

.c-msg__bubble--embedOnly,
.c-msg__bubble--mediaOnly{
  width: auto;
  max-width: min(440px, 78vw);
}

.c-msg__bubble--embedOnly .c-msgEmbedCard,
.c-msg__bubble--mediaOnly .c-msgEmbedCard{
  margin-top: 0;
}










/* =========================
   SKELETONS (threads + chat)
   ========================= */
@keyframes clbSk {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.c-msg__skAva,
.c-msg__skLine,
.c-msg__skTiny,
.c-msg__skBubble{
  position: relative;
  overflow: hidden;
  background: rgba(0,0,0,.10);
}

.c-msg__skAva::after,
.c-msg__skLine::after,
.c-msg__skTiny::after,
.c-msg__skBubble::after{
  content:"";
  position:absolute;
  inset:0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: clbSk 1.15s linear infinite;
}

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

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

.c-msg__skAva{
  width:46px;
  height:46px;
  border-radius:999px;
  flex:0 0 auto;
}

.c-msg__skMid{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.c-msg__skLine{
  height:10px;
  border-radius:999px;
}

.c-msg__skLine--w70{ width:70%; }
.c-msg__skLine--w45{ width:45%; }

.c-msg__skRight{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

.c-msg__skTiny{
  width:52px;
  height:10px;
  border-radius:999px;
}

/* chat skeleton */
.c-msg__skChat{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding: 12px 2px;
}

.c-msg__skBubble{
  height:44px;
  width:62%;
  border-radius: 24px;
}

.c-msg__skBubble--me{
  margin-left:auto;
  width:54%;
  border-radius: 24px;
}

.c-msg__skBubble--peer{
  margin-right:auto;
  width:64%;
  border-radius: 24px;
}

/* overlay states so nothing "pushes" layout */
.c-msg__threadBody{
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display:flex;
  flex-direction:column;
}

.c-msg__state--overlay{
  position:absolute;
  inset:0;
  z-index:5;
  background: transparent !important;
  border:0 !important;
  border-radius:0 !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events:none;
}

.c-msg__state--overlay[data-msg-state="error"]{
  pointer-events:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 12px !important;
}

.c-msg__state--overlay[data-msg-state="error"] .c-msg__hint{
  background: var(--msg-bg);
  border: 1px solid var(--msg-bd);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

/* =========================
   THREAD PAGE: desktop split
   ========================= */

/* mobile: sidebar hidden (so you don't touch mobile UX) */
.c-msg[data-msg-page="thread"] .c-msg__sidebar{
  display:none;
}

/* desktop only */
@media (min-width: 900px){
  .c-msg[data-msg-page="thread"]{
    padding: 18px var(--msg-pad-x) calc(18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom));
  }

  .c-msg[data-msg-page="thread"] .c-msg__shell--thread{
    max-width: var(--msg-max);
    margin: 0 auto;
    height: 100%;
    display:grid;
    grid-template-columns: 380px 1fr;
    gap: 16px;
    align-items: stretch;
  }

  /* show sidebar on desktop */
  .c-msg[data-msg-page="thread"] .c-msg__sidebar{
    display:flex;
    flex-direction:column;
    min-height:0;
    background: var(--msg-bg);
    border: 1px solid var(--msg-bd);
    border-radius: 18px;
    padding: 14px 12px;
    overflow:hidden;
  }

  .c-msg[data-msg-page="thread"] .c-msg__sidebar .c-msg__state{
    border:0;
    padding:0;
    background: transparent;
  }

  .c-msg[data-msg-page="thread"] .c-msg__sidebar .c-msg__list{
    margin-top: 10px;
    overflow:auto;
    flex:1 1 auto;
    gap: 0;
    border-radius: 16px;
    background: rgba(255,255,255,.92);
  }

  .c-msg[data-msg-page="thread"] .c-msg__sidebar .c-msg__item{
    border:0 !important;
    border-radius:0 !important;
    background: #f9f9f9 !important;
    margin:0 !important;
    padding: 12px 12px !important;
  }
  .c-msg[data-msg-page="thread"] .c-msg__sidebar .c-msg__item + .c-msg__item{
    border-top: 1px solid var(--msg-bd);
  }

  /* right panel (chat) as a card */
  .c-msg[data-msg-page="thread"] .c-msg__main{
    max-width: none;
    margin: 0;
    background: var(--msg-bg);
    border: 1px solid var(--msg-bd);
    border-radius: 18px;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    min-height:0;
    height: 100%;
  }


  /* chat scroll area */
  .c-msg[data-msg-page="thread"] .c-msg__chat{
    padding: 12px 12px;
    padding-bottom: 12px; /* no need huge padding on desktop */
  }

  /* composer becomes normal (not fixed), stays above tabbar */
  .c-msg[data-msg-page="thread"] .c-msg__composer{
    position: static;
    left: auto;
    transform: none;
    width: auto;
    border-top: 1px solid var(--msg-bd);
    padding: 10px 12px 12px;
    margin-bottom:3px;
  }
}



/* Hide bottom social tabbar ONLY on messages-thread on mobile */
@media (max-width: 899px){
  .c-social__tabbar.is-hide-mobile-thread,
  .c-social__tabHaze.is-hide-mobile-thread{
    display: none !important;
   
  }

 
}





/* FIX: mobile thread must scroll INSIDE chat (not page) */
@media (max-width: 899px){
  /* главный контейнер треда должен быть flex-колонкой */
  .c-msg[data-msg-page="thread"] .c-msg__wrap--thread{
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0; /* ключевой момент для overflow в flex */
  }

  /* тело треда занимает всё место и НЕ даёт странице скроллиться */
  .c-msg[data-msg-page="thread"] .c-msg__threadBody{
    flex: 1 1 auto;
    min-height: 0; /* ключевой момент */
    overflow: hidden; /* скролл только внутри .c-msg__chat */
  }

  /* а вот здесь скролл включаем */
  .c-msg[data-msg-page="thread"] .c-msg__chat{
    flex: 1 1 auto;
    min-height: 0; /* ключевой момент */
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}




/* === Voice: mic button inside textarea === */
.c-msg__inputWrap{ position: relative; }
.c-msg__inputWrap [data-msg-input]{ padding-right: 46px !important; } /* место под mic */

.c-msg__micBtn{
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,.14);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.c-msg__micBtn svg{ width: 18px; height: 18px; }
.c-msg__micBtn.is-rec{
  border-color: rgba(220,38,38,.35);
  box-shadow: 0 0 0 4px rgba(220,38,38,.12);
}

/* === Audio inside message bubble === */
.c-msg__audio{
  width: min(320px, 78vw);
  height: 36px;
  margin-top: 6px;
}


/* === Desktop: компактные модалки (меню ⋮ и "Удалить диалог") === */
@media (min-width: 900px){
  /* Нижнее меню действий (Ответить / Переслать / ...) */
  .c-msg__sheetCard{
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(460px, calc(100% - 48px));
    bottom: calc(100px + env(safe-area-inset-bottom));
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0,0,0,.18);
  }

  /* Окно подтверждения (например "Удалить этот диалог?") */
  .c-msg__modalCard{
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 48px));
    top: 18%;
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0,0,0,.18);
  }
}

/* Убираем внешний дубль длительности у аудио (если он где-то ещё создаётся) */
.c-msg__audioDur{ display:none !important; }

/* === FINAL OVERRIDE: scroll-to-bottom like ChatGPT (bottom-center inside dialog) === */
.c-msg[data-msg-page="thread"] .c-msg__main{ position: relative; }

.c-msg[data-msg-page="thread"] .c-msg__toBottom{
  position: absolute !important;
  left: 50% !important;
  right: auto !important;

bottom: calc(135px + env(safe-area-inset-bottom)) !important;

  transform: translateX(-50%) translateY(10px) scale(.96) !important;

  width: 35px !important;
  height: 35px !important;
  border-radius: 999px !important;
      border: 1px solid rgb(176 176 176) !important;
  /*background: rgba(255,255,255,0.96) !important;*/
  box-shadow: 0 10px 26px rgba(0,0,0,0.14) !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  cursor:pointer !important;
  z-index: 60 !important;

  opacity:0 !important;
  pointer-events:none !important;
  transition: opacity .22s ease,
              transform .22s cubic-bezier(.16,1,.3,1) !important;
}

.c-msg[data-msg-page="thread"] .c-msg__toBottom.is-on{
  opacity:1 !important;
  pointer-events:auto !important;
  transform: translateX(-50%) translateY(0) scale(1) !important;
}

/* “красивый стоп” в конце */
.c-msg[data-msg-page="thread"] .c-msg__toBottom.is-bounce{
  animation: cmsgToBottomBounce 420ms cubic-bezier(.16,1,.3,1);
}
@keyframes cmsgToBottomBounce{
  0%   { transform: translateX(-50%) translateY(0) scale(1); }
  55%  { transform: translateX(-50%) translateY(0) scale(.90); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

.c-msg[data-msg-page="thread"] .c-msg__toBottom svg{ width:18px; height:18px; }

@media (max-width:768px){
  .c-msg[data-msg-page="thread"] .c-msg__toBottom{
    width: 30px !important;
    height: 30px !important;
  }
}
/* =========================================================
   DARK THEME PATCH (messages) — ONLY COLORS (no layout)
   Put this block at the VERY END of assets/messages.css
   ========================================================= */

html[data-clb-theme="dark"]{
  /* base surface */
  --msg-bg: rgba(10,12,20,.86);
  --msg-bd: rgba(255,255,255,.10);
  --msg-soft: rgba(255,255,255,.06);
  --msg-text: rgba(255,255,255,.92);
  --msg-sub: rgba(255,255,255,.62);

  /* accent stays purple but nicer on dark */
  --msg-accent: #8b5cf6;
  --msg-accent-bg: rgba(139,92,246,.20);
  --msg-accent-bd: rgba(139,92,246,.34);

  color-scheme: dark;
}

html[data-clb-theme="dark"] .c-msg[data-msg-page="threads"],
html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"]{
  background: #0b0d12 !important; /* чтобы не было белого полотна */
}

/* top bar / header */
html[data-clb-theme="dark"] .c-msg__bar{
  background: rgba(10,12,20,.78) !important;
  border-bottom-color: rgba(255,255,255,.10) !important;
  backdrop-filter: blur(10px);
}
html[data-clb-theme="dark"] .c-msg__back,
html[data-clb-theme="dark"] .c-msg__peer,
html[data-clb-theme="dark"] .c-msg__peerLink{
  color: rgba(255,255,255,.92) !important;
}
html[data-clb-theme="dark"] .c-msg__topMore{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.35) !important;
}

/* bubbles */
html[data-clb-theme="dark"] .c-msg__bubble{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.92) !important;
}
html[data-clb-theme="dark"] .c-msg__metaLine{
  color: rgba(255,255,255,.55) !important;
}
html[data-clb-theme="dark"] .c-msg__more--meta{
  color: rgba(255,255,255,.58) !important;
}

/* media/embeds "..." pill on images (it was white) */
html[data-clb-theme="dark"] .c-msg__bubble--mediaOnly .c-msg__more--media,
html[data-clb-theme="dark"] .c-msg__bubble--embedOnly .c-msg__more--embed{
  background: rgba(10,12,20,.88) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.35) !important;
}

/* emoji row */


/* reply preview */
html[data-clb-theme="dark"] .c-msg__replyBox{
  background: rgba(255,255,255,.06) !important;
}
html[data-clb-theme="dark"] .c-msg__replyX:active{
  background: rgba(255,255,255,.10) !important;
}

/* composer (bottom) */
html[data-clb-theme="dark"] .c-msg__composer{
  background: rgba(10,12,20,.92) !important;
  border-top-color: rgba(255,255,255,.10) !important;
  box-shadow: 0 -10px 30px rgba(0,0,0,.35) !important;
  backdrop-filter: blur(10px);
}
html[data-clb-theme="dark"] .c-msg__file{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: rgba(255,255,255,.92) !important;
}
html[data-clb-theme="dark"] .c-msg__input{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: rgba(255,255,255,.92) !important;
}
html[data-clb-theme="dark"] .c-msg__input::placeholder{
  color: rgba(255,255,255,.45) !important;
}

/* mic button + recording overlay (it becomes invisible without this) */
html[data-clb-theme="dark"] .c-msg__micBtn{
  color: rgba(255,255,255,.92) !important;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
}
html[data-clb-theme="dark"] .c-msg__micBtn.is-rec{
  border-color: rgba(244,63,94,.55) !important;
  box-shadow: 0 0 0 4px rgba(244,63,94,.18) !important;
}
html[data-clb-theme="dark"] .c-msg__recTime{
  color: rgba(255,255,255,.78) !important;
}
html[data-clb-theme="dark"] .c-msg__recBars i{
  background: rgba(255,255,255,.42) !important;
}

/* small notices (uploading / error) */
html[data-clb-theme="dark"] .c-msg__notice{
  color: rgba(254,202,202,.95) !important;
  background: rgba(220,38,38,.22) !important;
  border-color: rgba(220,38,38,.35) !important;
}
html[data-clb-theme="dark"] .c-msg__uploading{
  color: rgba(255,255,255,.80) !important;
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.14) !important;
}
html[data-clb-theme="dark"] .c-msg__uploading .c-msg__spin{
  border-color: rgba(255,255,255,.25) !important;
  border-top-color: rgba(255,255,255,.75) !important;
}

/* long-press sheet + forward modal (they are white by default) */
html[data-clb-theme="dark"] .c-msg__sheetBg,
html[data-clb-theme="dark"] .c-msg__modalBg{
  background: rgba(0,0,0,.55) !important;
}
html[data-clb-theme="dark"] .c-msg__sheetCard,
html[data-clb-theme="dark"] .c-msg__modalCard{
  background: rgba(10,12,20,.96) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 18px 60px rgba(0,0,0,.55) !important;
}
html[data-clb-theme="dark"] .c-msg__sheetBtn,
html[data-clb-theme="dark"] .c-msg__btn{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.92) !important;
}
html[data-clb-theme="dark"] .c-msg__sheetBtn--danger{
  background: rgba(220,38,38,.18) !important;
  border-color: rgba(220,38,38,.30) !important;
  color: #fff !important;
}




/* =========================================================
   FIX: Messages DESKTOP list in DARK (white->dark correctly)
   Paste at END of assets/messages.css
   ========================================================= */

@media (min-width: 900px){

  /* Общее "окошко" (рамка/панель) */
  html[data-clb-theme="dark"] .c-msg__shell{
    background: rgba(10,12,20,.86) !important;
    border-color: rgba(255,255,255,.10) !important;
  }

  /* Левая колонка (список диалогов) */
  html[data-clb-theme="dark"] .c-msg[data-msg-page="threads"] .c-msg__list{
    background: rgba(10,12,20,.86) !important;
    border-color: rgba(255,255,255,.10) !important;
  }

  /* Один диалог (убираем #fff9f9 и другие светлые фоны) */
  html[data-clb-theme="dark"] .c-msg[data-msg-page="threads"] .c-msg__item{
    background: rgba(255,255,255,.05) !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
  }
  html[data-clb-theme="dark"] .c-msg[data-msg-page="threads"] .c-msg__item:hover{
    background: rgba(255,255,255,.08) !important;
  }

  /* Активный/выбранный диалог (если есть такой класс) */
  html[data-clb-theme="dark"] .c-msg[data-msg-page="threads"] .c-msg__item.is-active,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="threads"] .c-msg__item--saved{
    background: rgba(255,255,255,.10) !important;
  }

  /* Текст внутри диалогов (имя/превью/время) */
  html[data-clb-theme="dark"] .c-msg[data-msg-page="threads"] .c-msg__item,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="threads"] .c-msg__item *{
    color: rgba(255,255,255,.92) !important;
  }

  html[data-clb-theme="dark"] .c-msg[data-msg-page="threads"] .c-msg__last{
    color: rgba(255,255,255,.70) !important;
  }
  html[data-clb-theme="dark"] .c-msg[data-msg-page="threads"] .c-msg__time{
    color: rgba(255,255,255,.55) !important;
  }
}
/* =========================================================
   ADDON: Messages THREAD page (open dialog) sidebar -> DARK
   Paste at END of assets/messages.css
   ========================================================= */

@media (min-width: 900px){

  /* Общий shell в открытом диалоге */
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__shell,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_shell{
    background: rgba(10,12,20,.86) !important;
    border-color: rgba(255,255,255,.10) !important;
  }

  /* ЛЕВЫЙ САЙДБАР в открытом диалоге (именно он у тебя белый) */
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__sidebar,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_sidebar{
    background: rgba(10,12,20,.86) !important;
    border-color: rgba(255,255,255,.10) !important;
  }

  /* Список диалогов внутри sidebar (thread page) */
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__list,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_list{
    background: rgba(10,12,20,.86) !important;
    border-color: rgba(255,255,255,.10) !important;
  }

  /* КАЖДЫЙ ЭЛЕМЕНТ списка в sidebar (перебиваем #fff9f9) */
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__item,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_item{
    background: rgba(255,255,255,.05) !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
  }
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__item:hover,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_item:hover{
    background: rgba(255,255,255,.08) !important;
  }

  /* выбранный/сохранённый диалог */
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__item.is-active,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__item--saved,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_item.is-active,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_item--saved{
    background: rgba(255,255,255,.10) !important;
  }

  /* текст внутри элементов списка (чтобы не был “белым по белому”) */
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__item,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__item *,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_item,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_item *{
    color: rgba(255,255,255,.92) !important;
  }
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__last,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_last{
    color: rgba(255,255,255,.70) !important;
  }
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg__time,
  html[data-clb-theme="dark"] .c-msg[data-msg-page="thread"] .c-msg_time{
    color: rgba(255,255,255,.55) !important;
  }
}

/* === FIX: "Новое сообщение" divider readable in DARK === */
html[data-clb-theme="dark"] .c-msg__newDivider{
  color: rgba(255,255,255,.88) !important;
  background: rgba(255,255,255,.10) !important;   /* плашка заметнее */
  border: 1px solid rgba(255,255,255,.16) !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.45) !important; /* чтобы не сливалось */
}

/* если у divider есть линии по бокам через ::before/::after */
html[data-clb-theme="dark"] .c-msg__newDivider::before,
html[data-clb-theme="dark"] .c-msg__newDivider::after{
  background: rgba(255,255,255,.16) !important;
}






/* =========================================================
   FIX: active dialog row + no ugly outer strip under media/audio/embed
   ========================================================= */

/* --- ACTIVE DIALOG: light + dark, threads page + sidebar in thread page --- */
.c-msg__item.is-active,
.c-msg__item[aria-current="page"]{
  background: rgba(124,58,237,.10) !important;
  box-shadow: inset 3px 0 0 rgba(124,58,237,.92);
}

.c-msg__item.is-active .c-msg__name,
.c-msg__item[aria-current="page"] .c-msg__name{
  color: #5b21b6 !important;
}

.c-msg__item.is-active .c-msg__last,
.c-msg__item[aria-current="page"] .c-msg__last{
  color: rgba(76,29,149,.82) !important;
}

.c-msg__item.is-active .c-msg__time,
.c-msg__item[aria-current="page"] .c-msg__time{
  color: rgba(76,29,149,.68) !important;
}

html[data-clb-theme="dark"] .c-msg__item.is-active,
html[data-clb-theme="dark"] .c-msg__item[aria-current="page"]{
  background: rgba(139,92,246,.18) !important;
  box-shadow: inset 3px 0 0 rgba(167,139,250,.96);
}

html[data-clb-theme="dark"] .c-msg__item.is-active .c-msg__name,
html[data-clb-theme="dark"] .c-msg__item[aria-current="page"] .c-msg__name{
  color: rgba(255,255,255,.96) !important;
}

html[data-clb-theme="dark"] .c-msg__item.is-active .c-msg__last,
html[data-clb-theme="dark"] .c-msg__item[aria-current="page"] .c-msg__last{
  color: rgba(255,255,255,.82) !important;
}

html[data-clb-theme="dark"] .c-msg__item.is-active .c-msg__time,
html[data-clb-theme="dark"] .c-msg__item[aria-current="page"] .c-msg__time{
  color: rgba(255,255,255,.66) !important;
}

/* --- REMOVE ONLY THE OUTER RECTANGLE UNDER MEDIA / AUDIO / EMBED --- */
/* Не трогаем .c-msg__item, чтобы не ломать полоски/подсветку списка диалогов */
.c-msg__bubble--audioSide,
.c-msg__bubble--mediaOnly,
.c-msg__bubble--embedOnly{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.c-msg__bubble--audioSide .c-msg__metaLine,
.c-msg__bubble--mediaOnly .c-msg__metaLine,
.c-msg__bubble--embedOnly .c-msg__metaLine{
  margin-top: 8px;
  padding: 0 6px;
}

.c-msg__bubble--audioSide .c-msg__replyJump,
.c-msg__bubble--mediaOnly .c-msg__replyJump,
.c-msg__bubble--embedOnly .c-msg__replyJump{
  margin: 0 0 8px !important;
}

html[data-clb-theme="dark"] .c-msg__bubble--audioSide,
html[data-clb-theme="dark"] .c-msg__bubble--mediaOnly,
html[data-clb-theme="dark"] .c-msg__bubble--embedOnly{
  background: transparent !important;
  border-color: transparent !important;
}



/* === POST MODAL: visible close button in dark + unified eggplant icons === */

html[data-clb-theme="dark"] .c-msgPostModal__close{
  color: #4c1d95 !important;
  background: rgba(111,87,255,.12) !important;
  border: 1px solid rgba(111,87,255,.22) !important;
  box-shadow: 0 4px 14px rgba(15,23,42,.12) !important;
}

html[data-clb-theme="dark"] .c-msgPostModal__close:hover{
  color: #3b146f !important;
  background: rgba(111,87,255,.18) !important;
}

html[data-clb-theme="dark"] .c-msgPostModal__close:active{
  transform: scale(.98);
}

/* нижние иконки: комментарии + самолётик */
.c-msgPostModal__iconBtn[data-comment-jump],
.c-msgPostModal__iconBtn[data-open-post]{
  color: #6f57ff !important;
}

.c-msgPostModal__iconBtn[data-comment-jump]:hover,
.c-msgPostModal__iconBtn[data-open-post]:hover{
  background: rgba(111,87,255,.10) !important;
}

/* цифры рядом с ними тоже тем же цветом */
.c-msgPostModal__iconStat > .c-msgPostModal__iconBtn[data-comment-jump] + .c-msgPostModal__iconCount,
.c-msgPostModal__iconStat > .c-msgPostModal__iconBtn[data-open-post] + .c-msgPostModal__iconCount{
  color: #6f57ff !important;
  font-weight: 600 !important;
}

/* кнопка отправки комментария — оставляем в том же цвете */
.c-msgPostModal__commentSend{
  background: #6f57ff !important;
  border-color: #6f57ff !important;
}

.c-msgPostModal__commentSend:hover{
  filter: brightness(.97);
}



/* === SHARE MODAL: FIX REAL SELECTORS (__), dark theme, normal buttons === */

html[data-clb-theme="dark"] .c-socialShare__panel{
  background: rgba(10,12,20,.96) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 18px 60px rgba(0,0,0,.55) !important;
}

html[data-clb-theme="dark"] .c-socialShare__head,
html[data-clb-theme="dark"] .c-socialShare__foot{
  background: transparent !important;
  border-color: rgba(255,255,255,.10) !important;
}

html[data-clb-theme="dark"] .c-socialShare__title,
html[data-clb-theme="dark"] .c-socialShare__hint,
html[data-clb-theme="dark"] .c-socialShare__name,
html[data-clb-theme="dark"] .c-socialShare__id{
  color: rgba(255,255,255,.92) !important;
}

html[data-clb-theme="dark"] .c-socialShare__close{
  color: #c4b5fd !important;
  background: rgba(111,87,255,.14) !important;
  border: 1px solid rgba(111,87,255,.22) !important;
  border-radius: 10px !important;
  opacity: 1 !important;
}

html[data-clb-theme="dark"] .c-socialShare__close:hover{
  background: rgba(111,87,255,.22) !important;
  color: #fff !important;
}

/* поиск */
html[data-clb-theme="dark"] .c-socialShare__search{
  background: transparent !important;
  border-bottom-color: rgba(255,255,255,.08) !important;
}

html[data-clb-theme="dark"] .c-socialShare__search input{
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: rgba(255,255,255,.92) !important;
}

html[data-clb-theme="dark"] .c-socialShare__search input::placeholder{
  color: rgba(255,255,255,.45) !important;
}

/* список пользователей */
html[data-clb-theme="dark"] .c-socialShare__list{
  background: transparent !important;
}

html[data-clb-theme="dark"] .c-socialShare__row{
  background: transparent !important;
}

html[data-clb-theme="dark"] .c-socialShare__row:hover{
  background: rgba(255,255,255,.06) !important;
}

html[data-clb-theme="dark"] .c-socialShare__row[data-on="1"]{
  background: rgba(111,87,255,.14) !important;
}

html[data-clb-theme="dark"] .c-socialShare__av{
  background: rgba(255,255,255,.08) !important;
}

html[data-clb-theme="dark"] .c-socialShare__check{
  border-color: rgba(255,255,255,.18) !important;
  color: rgba(255,255,255,.82) !important;
  background: transparent !important;
}

html[data-clb-theme="dark"] .c-socialShare__row[data-on="1"] .c-socialShare__check{
  background: #6f57ff !important;
  border-color: #6f57ff !important;
  color: #fff !important;
}

/* нижние кнопки */
.c-socialShare__copy,
.c-socialShare__send{
  min-height: 38px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease !important;
}

html[data-clb-theme="dark"] .c-socialShare__copy{
  color: #c4b5fd !important;
  background: rgba(111,87,255,.14) !important;
  border: 1px solid rgba(111,87,255,.26) !important;
}

html[data-clb-theme="dark"] .c-socialShare__copy:hover{
  background: rgba(111,87,255,.22) !important;
  color: #fff !important;
}

html[data-clb-theme="dark"] .c-socialShare__send{
  color: #fff !important;
  background: #6f57ff !important;
  border: 1px solid #6f57ff !important;
}

html[data-clb-theme="dark"] .c-socialShare__send:hover{
  background: #5b45ea !important;
  border-color: #5b45ea !important;
}

html[data-clb-theme="dark"] .c-socialShare__send[disabled]{
  opacity: .55 !important;
  color: rgba(255,255,255,.92) !important;
  background: rgba(111,87,255,.45) !important;
  border-color: rgba(111,87,255,.45) !important;
}

.c-socialShare__copy:active,
.c-socialShare__send:active{
  transform: scale(.98) !important;
}






/* === FINAL OVERRIDE: clearer dots + wider desktop thread === */

/* bubble menu dots */
.c-msg__metaMenu{
  min-width: 30px !important;
}

.c-msg__more--meta{
  width: 30px !important;
  height: 22px !important;
  min-width: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: rgba(0,0,0,.78) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.c-msg__moreGlyph{
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
  transform: translateY(-1px);
  pointer-events: none;
}

.c-msg__metaLine{
  gap: 12px !important;
}

/* top-right thread menu button on desktop/header */
.c-msg__topMore{
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
  font-size: 20px !important;
  color: rgba(0,0,0,.82) !important;
}

/* desktop thread: make layout much wider */
@media (min-width: 900px){
  .c-msg[data-msg-page="thread"]{
    padding: 5px 3px calc(-30px  + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom)) !important;
  }

  .c-msg[data-msg-page="thread"] .c-msg__shell--thread{
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    grid-template-columns: 380px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .c-msg[data-msg-page="thread"] .c-msg__sidebar{
    border-radius: 14px !important;
    padding: 12px 10px !important;
  }

  .c-msg[data-msg-page="thread"] .c-msg__main{
    border-radius: 14px !important;
  }
}

@media (min-width: 1280px){
  .c-msg[data-msg-page="thread"] .c-msg__shell--thread{
    grid-template-columns: 430px minmax(0, 1fr) !important;
  }
}

/* dark theme */
html[data-clb-theme="dark"] .c-msg__more--meta{
  color: rgba(255,255,255,.82) !important;
}

html[data-clb-theme="dark"] .c-msg__topMore{
  color: rgba(255,255,255,.88) !important;
}








/* ===== Telegram-like reactions ===== */

.c-msg__bubble{
  overflow: visible;
}

.c-msg__reactPill{
  position: absolute;
  bottom: -14px;
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
  z-index: 6;
  cursor: pointer;
}

.c-msg__bubble--me .c-msg__reactPill{
  right: 8px;
  left: auto;
}

.c-msg__bubble:not(.c-msg__bubble--me) .c-msg__reactPill{
  left: 8px;
  right: auto;
}

.c-msg__reactPill.is-mine{
  border-color: rgba(111,87,255,.32);
  box-shadow: 0 6px 18px rgba(111,87,255,.14);
}

.c-msg__reactEmoji{
  font-size: 15px;
  line-height: 1;
}

.c-msg__reactCount{
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  color: rgba(0,0,0,.72);
}

.c-msg__reactUsers{
  display: flex;
  align-items: center;
  margin-left: 2px;
  padding-left: 2px;
}

.c-msg__reactUser{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #fff;
  margin-left: -5px;
  background: #ececf1;
}

.c-msg__reactUsers .c-msg__reactUser:first-child{
  margin-left: 0;
}

/* smaller sheet like Telegram */
.c-msg__sheetCard{
  padding: 8px !important;
  border-radius: 16px !important;
}

.c-msg__reactBar{
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin-bottom: 2px;
   justify-content: center !important;
  align-items: center !important;
}

.c-msg__reactBar::-webkit-scrollbar{
  display: none;
}

.c-msg__reactPick{
  flex: 0 0 auto;
  min-width: 42px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  font-size: 18px;
  cursor: pointer;
}

.c-msg__reactPick.is-active{
  border-color: rgba(111,87,255,.35);
  background: rgba(111,87,255,.10);
  box-shadow: inset 0 0 0 1px rgba(111,87,255,.10);
}

.c-msg__sheetBtn{
  min-height: 40px !important;
  margin: 4px 0 !important;
  border-radius: 12px !important;
}

html[data-clb-theme="dark"] .c-msg__reactPill{
  background: rgba(10,12,20,.96);
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 10px 24px rgba(0,0,0,.38);
}

html[data-clb-theme="dark"] .c-msg__reactCount{
  color: rgba(255,255,255,.88);
}

html[data-clb-theme="dark"] .c-msg__reactUser{
  border-color: rgba(10,12,20,.96);
  background: rgba(255,255,255,.08);
}

html[data-clb-theme="dark"] .c-msg__reactPick{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.10);
  color: rgba(255,255,255,.95);
}

html[data-clb-theme="dark"] .c-msg__reactPick.is-active{
  background: rgba(111,87,255,.24);
  border-color: rgba(167,139,250,.36);
}






/* === stable under-message reactions === */
.c-msg__msgWrap{
  display:flex;
  flex-direction:column;
  width:100%;
}

.c-msg__msgWrap--me{
  align-items:flex-end;
}

.c-msg__msgWrap--peer{
  align-items:flex-start;
}

.c-msg__reactDock{
  display:none;
  width:100%;
  margin-top:6px;
  pointer-events:none;
}

.c-msg__msgWrap--me .c-msg__reactDock{
  display:flex;
  justify-content:flex-end;
}

.c-msg__msgWrap--peer .c-msg__reactDock{
  display:flex;
  justify-content:flex-start;
}

.c-msg__reactDock .c-msg__reactPill{
  position:static !important;
  left:auto !important;
  right:auto !important;
  bottom:auto !important;
  top:auto !important;
  transform:none !important;

  display:inline-flex !important;
  align-items:center;
  gap:6px;
  min-height:24px;
  padding:2px 8px 2px 6px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(10,12,20,.96);
  box-shadow:0 6px 18px rgba(0,0,0,.28);
  z-index:6;
  cursor:pointer;
  pointer-events:auto;
}

.c-msg__reactDock .c-msg__reactUser{
  width:18px;
  height:18px;
  border-radius:999px;
  object-fit:cover;
  border:2px solid rgba(10,12,20,.96);
  margin-left:-5px;
  background:#ececf1;
}

.c-msg__reactDock .c-msg__reactUsers .c-msg__reactUser:first-child{
  margin-left:0;
}



/* ===== Online presence in thread header ===== */
.c-msg__peerMeta{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.c-msg__peerStatus{
  min-width:0;
  display:none;
  align-items:center;
  gap:6px;
  font-size:10px;
  line-height:1.2;
  color:var(--msg-sub);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.c-msg__peerStatus.is-online{
  color:#22c55e;
}

.c-msg__presenceDot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#22c55e;
  box-shadow:0 0 0 3px rgba(34,197,94,.16);
  flex:0 0 auto;
}

/* ===== Thread menu online toggle ===== */
.c-msg__presenceRow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin:10px 0 12px;
  padding:12px;
  border-radius:16px;
  border:1px solid var(--msg-bd);
  background:rgba(255,255,255,.04);
}

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

.c-msg__presenceTitle{
  font-weight:900;
  line-height:1.2;
}

.c-msg__presenceHint{
  font-size:12px;
  line-height:1.35;
  color:var(--msg-sub);
}

.c-msg__switchWrap{
  position:relative;
  width:46px;
  height:28px;
  flex:0 0 auto;
  display:inline-block;
}

.c-msg__switchInput{
  position:absolute;
  inset:0;
  margin:0;
  opacity:0;
  cursor:pointer;
}

.c-msg__switch{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:rgba(148,163,184,.38);
  transition:background .2s ease;
}

.c-msg__switch::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:22px;
  height:22px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
  transition:transform .2s ease;
}

.c-msg__switchInput:checked + .c-msg__switch{
  background:#22c55e;
}

.c-msg__switchInput:checked + .c-msg__switch::after{
  transform:translateX(18px);
}

.c-msg__switchInput:disabled + .c-msg__switch{
  opacity:.65;
}

html[data-clb-theme="dark"] .c-msg__presenceRow{
  background:rgba(255,255,255,.04);
  border-color:rgba(255,255,255,.10);
}

html[data-clb-theme="dark"] .c-msg__switch{
  background:rgba(255,255,255,.18);
}/* online dot near name in header */
.c-msg__peer{
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.c-msg__peer.is-online::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background:#22c55e;
  box-shadow:0 0 0 3px rgba(34,197,94,.16);
  flex:0 0 auto;
}

/* online dot in threads list */
.c-msg__name{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}

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

.c-msg__onlineDot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#22c55e;
  box-shadow:0 0 0 3px rgba(34,197,94,.16);
  flex:0 0 auto;
}

/* online dot on header avatar */
.c-msg__peerLink{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.c-msg__peerAvaDot{
  position: absolute;
  left: 24px;
  top: 24px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid var(--msg-bg);
  box-shadow: 0 0 0 2px rgba(34,197,94,.18);
  display: none;
  pointer-events: none;
  z-index: 2;
}/* online dot on thread-list avatar */
.c-msg__avaWrap{
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

.c-msg__avaWrap .c-msg__ava{
  width: 100%;
  height: 100%;
  display: block;
}

.c-msg__avaOnlineDot{
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid var(--msg-bg);
  box-shadow: 0 0 0 2px rgba(34,197,94,.18);
  pointer-events: none;
  z-index: 2;
}


/* === message privacy / block / desktop widen === */

.c-msg__privacyOption{
  width:100%;
  min-height:54px;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  text-align:left;
  font-weight:900;
  cursor:pointer;
}

.c-msg__privacyOption.is-active{
  border-color: rgba(124,58,237,.45);
  background: rgba(124,58,237,.06);
  box-shadow: inset 0 0 0 2px rgba(124,58,237,.12);
}

.c-msg__privacyActions{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:12px;
}

.c-msg__composerLock{
  display:none;
  align-items:center;
  justify-content:center;
  text-align:center;

  margin: 8px 10px 10px;
  padding: 14px 16px;
  min-height: 54px;

  border-radius: 16px;
  border: 1px solid rgba(239,68,68,.20);
      background: #673AB7;
  color: rgba(255,255,255,.92);

  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
}

.c-msg__composerLock.is-on{
  display:flex;
}

.c-msg__composer.is-locked{
  display:none !important;
}

html[data-clb-theme="dark"] .c-msg__privacyOption{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.92) !important;
}

html[data-clb-theme="dark"] .c-msg__privacyOption.is-active{
  background: rgba(124,58,237,.18) !important;
  border-color: rgba(167,139,250,.44) !important;
}

html[data-clb-theme="dark"] .c-msg__composerLock{
    background: #57488e !important;
    border-color: #7271f84d !important;
    color: #fff !important;
}

@media (min-width: 900px){
  .c-msg[data-msg-page="threads"] .c-msg__shell{
    max-width: none !important;
    width: 100% !important;
    grid-template-columns: 380px minmax(0, 1fr) !important;
    gap: 8px !important;
   
  }
}

@media (min-width: 1280px){
  .c-msg[data-msg-page="threads"] .c-msg__shell{
    grid-template-columns: 430px minmax(0, 1fr) !important;
          
  }
}

/* =========================
   RIGHT EMPTY PANEL — desktop prettier
   вставить В САМЫЙ КОНЕЦ assets/messages.css
   ========================= */

@media (min-width: 900px){
  .c-msg[data-msg-page="threads"] .c-msg__right{
    display:flex;
    min-width:0;
    background:
      radial-gradient(1200px 420px at 50% -10%, rgba(124,58,237,.12), transparent 58%),
      linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
    
  }

  .c-msg[data-msg-page="threads"] .c-msg__panel{
    flex:1 1 auto;
    min-height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:32px;
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelCard{
    width:min(520px, 92%);
    padding:34px 30px;
    border-radius:28px;
    text-align:center;
    background:
      linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
    border:1px solid rgba(255,255,255,.10);
    box-shadow:
      0 24px 60px rgba(0,0,0,.28),
      inset 0 1px 0 rgba(255,255,255,.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelIcon{
    width:72px;
    height:72px;
    margin:0 auto 18px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:30px;
    line-height:1;
    background:
      radial-gradient(circle at 30% 30%, rgba(139,92,246,.38), rgba(139,92,246,.12));
    border:1px solid rgba(255,255,255,.12);
    box-shadow:
      0 14px 34px rgba(76,29,149,.24),
      inset 0 1px 0 rgba(255,255,255,.08);
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelTitle{
    margin:0 0 10px;
    font-size:28px;
    line-height:1.12;
    font-weight:800;
    letter-spacing:-.02em;
    color:#fff;
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelText{
    max-width:420px;
    margin:0 auto;
    font-size:15px;
    line-height:1.6;
    color:rgba(255,255,255,.72);
  }
}

/* mobile/tablet — просто чуть аккуратнее */
@media (max-width: 899px){
  .c-msg[data-msg-page="threads"] .c-msg__panel{
    padding:20px 16px;
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelCard{
    padding:22px 18px;
    border-radius:22px;
    text-align:center;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.08);
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelIcon{
    width:58px;
    height:58px;
    margin:0 auto 14px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    background:rgba(139,92,246,.16);
    border:1px solid rgba(255,255,255,.08);
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelTitle{
    margin:0 0 8px;
    font-size:22px;
    line-height:1.16;
    font-weight:800;
    color:#fff;
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelText{
    font-size:14px;
    line-height:1.5;
    color:rgba(255,255,255,.72);
  }
}.c-msg[data-msg-page="threads"] .c-msg__item .c-msg__right,
.c-msg[data-msg-page="threads"] .c-msg__item .c-msg__timeRow{
  background: transparent !important;
}



@media (max-width: 775px) {
   .c-social__tabHaze {

    height: 57px !important;
 
}
}
/* === THREAD DESKTOP: hide bottom tabbar, push composer down, center emojis === */
@media (min-width: 900px){

  /* больше не резервируем место под нижний social-tabbar */
  .c-msg[data-msg-page="thread"]{
    padding: 18px var(--msg-pad-x) 18px !important;
  }

  /* высота рабочей области без нижней панели */
  .c-msg[data-msg-page="thread"] .c-msg__shell--thread{
    height: calc(100dvh - 36px) !important;
  }

  /* скрываем нижнюю панель и haze именно на desktop thread */
  body:has(.c-msg[data-msg-page="thread"]) .c-social__tabbar,
  body:has(.c-msg[data-msg-page="thread"]) .c-social__tabHaze,
  .c-msg[data-msg-page="thread"] ~ .c-social__tabbar,
  .c-msg[data-msg-page="thread"] ~ .c-social__tabHaze{
    display: none !important;
  }

  /* правая колонка чата */
  .c-msg[data-msg-page="thread"] .c-msg__main{
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .c-msg[data-msg-page="thread"] .c-msg__threadBody{
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .c-msg[data-msg-page="thread"] .c-msg__chat{
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
    padding-bottom: 12px !important;
  }

  /* блок ввода — в самый низ */
  .c-msg[data-msg-page="thread"] .c-msg__composer{
    position: static !important;
    left: auto !important;
    transform: none !important;
    width: auto !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    padding: 10px 12px 12px !important;
    border-top: 1px solid var(--msg-bd) !important;
    border-radius: 0 0 18px 18px !important;
  }

  /* смайлики по центру */
  .c-msg[data-msg-page="thread"] .c-msg__emojiRow{
    justify-content: center !important;
    flex-wrap: wrap;
    margin: 0 0 6px !important;
  }
}

/* FIX: unread badge width must not depend on time/date width */
.c-msg__item > .c-msg__right{
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.c-msg__item > .c-msg__right .c-msg__timeRow{
  width: auto;
  justify-content: flex-end;
}

.c-msg__item > .c-msg__right .c-msg__badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  flex: 0 0 auto;
  width: auto;
  min-width: 18px;
  padding: 0 6px;
  white-space: nowrap;
}


/* === MESSAGES DESKTOP: bottom social tabbar only on messages list === */
@media (min-width: 990px) {
  body:has(.c-msg[data-msg-page="threads"]) {
    padding-left: 0 !important;
  }

  body:has(.c-msg[data-msg-page="threads"]) #main-content {
    margin-left: 0 !important;
    width: auto !important;
    max-width: none !important;
  }

  /* показываем haze только на списке сообщений */
  body:has(.c-msg[data-msg-page="threads"]) .c-social__tabHaze,
  .c-msg[data-msg-page="threads"] ~ .c-social__tabHaze {
    display: block !important;
  }

  /* нижняя панель только на /pages/messages */
  body:has(.c-msg[data-msg-page="threads"]) .c-social__tabbar,
  .c-msg[data-msg-page="threads"] ~ .c-social__tabbar {
    display: grid !important;
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 14px !important;
    transform: translateX(-50%) !important;

    width: min(420px, calc(100vw - 22px)) !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
    z-index: 12900 !important;
  }

  /* снизу место под нижнюю панель только на списке */
  body:has(.c-msg[data-msg-page="threads"]) .c-msg[data-msg-page="threads"] {
    padding-bottom: calc(18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom)) !important;
  }

  /* на открытом диалоге вообще не трогаем нижнюю панель этим блоком */
  body:has(.c-msg[data-msg-page="thread"]) .c-social__tabHaze,
  body:has(.c-msg[data-msg-page="thread"]) .c-social__tabbar,
  .c-msg[data-msg-page="thread"] ~ .c-social__tabHaze,
  .c-msg[data-msg-page="thread"] ~ .c-social__tabbar {
    display: none !important;
  }
}
/* =========================================================
   MESSAGES PAGE ONLY:
   tabbar must stay at the bottom, never on the left side
   ========================================================= */
@media (min-width: 776px) {
  body:has(.c-msg[data-msg-page="threads"]) .c-social__tabbar,
  .c-msg[data-msg-page="threads"] ~ .c-social__tabbar {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: 14px !important;
    transform: translateX(-50%) !important;

    width: min(420px, calc(100vw - 22px)) !important;
    min-width: 0 !important;
    height: auto !important;

    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
    padding: 2px 2px !important;

    flex-direction: unset !important;
    align-items: unset !important;
    justify-content: unset !important;

    z-index: 12900 !important;
  }

  body:has(.c-msg[data-msg-page="threads"]) .c-social__tabHaze,
  .c-msg[data-msg-page="threads"] ~ .c-social__tabHaze {
    display: block !important;
  }

  body:has(.c-msg[data-msg-page="threads"]) {
    padding-left: 0 !important;
  }

  body:has(.c-msg[data-msg-page="threads"]) #main-content {
    margin-left: 0 !important;
    width: auto !important;
    max-width: none !important;
  }

  body:has(.c-msg[data-msg-page="threads"]) .c-msg[data-msg-page="threads"] {
    padding-bottom: calc(18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom)) !important;
  }
}


/* ===== thread composer: mic <-> send like Telegram ===== */
.c-msg__composerRow,
.c-msg__composerLine{
  display:flex;
  align-items:center !important;
  gap:8px;
}

.c-msg__inputWrap{
  position:relative;
  flex:1 1 auto;
  min-width:0;
}

.c-msg__inputWrap [data-msg-input]{
  width:100% !important;
  box-sizing:border-box;
  min-height:42px;
  max-height:140px;
  padding:11px 12px !important;
}

.c-msg__send,
.c-msg__micBtn{
  flex:0 0 42px;
  width:42px !important;
  min-width:42px !important;
  height:42px !important;
  border-radius:999px !important;
  border:0 !important;
  background:#7228ff !important;
  color:#fff !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 !important;
  margin:0 !important;
  box-shadow:none !important;
}

.c-msg__send{
  font-size:0 !important;
  line-height:0 !important;
}

.c-msg__send svg,
.c-msg__micBtn svg{
  width:20px;
  height:20px;
  display:block;
}

.c-msg__micBtn{
  position:static !important;
  top:auto !important;
  right:auto !important;
  bottom:auto !important;
  left:auto !important;
  transform:none !important;
  opacity:1 !important;
}

.c-msg__send:disabled{
  opacity:.55 !important;
}

@media (max-width: 420px){
  .c-msg__send,
  .c-msg__micBtn{
    width:40px !important;
    min-width:40px !important;
    height:40px !important;
    flex-basis:40px;
  }

  .c-msg__send svg,
  .c-msg__micBtn svg{
    width:18px;
    height:18px;
  }
}


/* ===== FINAL EMOJI POSITION: INSIDE INPUT, RIGHT EDGE ===== */

/* само поле */
.c-msg__inputWrap{
  position: relative !important;
}

/* освобождаем место справа ВНУТРИ поля под emoji */
.c-msg__inputWrap.is-emoji-ready [data-msg-input],
.c-msg__inputWrap.is-emoji-ready .c-msg__input{
  padding-right: 44px !important;
  padding-left: 12px !important;
}

/* контейнер emoji-кнопки — ВНУТРИ поля */
.c-msg__emojiDock{
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  left: auto !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;

  width: 22px !important;
  height: 22px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  margin: 0 !important;
  padding: 0 !important;
  z-index: 50 !important;
  pointer-events: auto !important;
}

/* сама кнопка */
.c-msg__emojiToggle{
  position: static !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  padding: 0 !important;
  margin: 0 !important;

  cursor: pointer !important;
  line-height: 0 !important;
  color: rgba(255,255,255,.72) !important;
}

.c-msg__emojiToggle svg{
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

/* popup выходит от самой кнопки */
.c-msg__emojiPopover{
  position: absolute !important;
  right: -10px !important;
  left: auto !important;
  bottom: calc(100% + 8px) !important;

  width: 340px !important;
  max-width: min(340px, calc(100vw - 28px)) !important;

  padding: 10px 12px 12px !important;
  border-radius: 18px !important;

  background: #171b22 !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.34) !important;

  display: none;
  z-index: 60 !important;
}

.c-msg__emojiPopover.is-open{
  display: block !important;
}

/* мостик для hover */
.c-msg__emojiPopover::before{
  content: "" !important;
  position: absolute !important;
  right: 0 !important;
  bottom: -22px !important;
  width: 90px !important;
  height: 24px !important;
  background: transparent !important;
}

/* хвостик */
.c-msg__emojiPopover::after{
  content: "" !important;
  position: absolute !important;
  right: 14px !important;
  left: auto !important;
  bottom: -7px !important;

  width: 14px !important;
  height: 14px !important;

  background: #171b22 !important;
  border-right: 1px solid rgba(255,255,255,.08) !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  transform: rotate(45deg) !important;
}

.c-msg__emojiPopoverHead{
  margin: 0 0 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: rgba(255,255,255,.88) !important;
}

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

.c-msg__emojiPick{
  min-height: 34px !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 10px !important;

  font-size: 24px !important;
  line-height: 1 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  cursor: pointer !important;
  padding: 0 !important;
  color: rgba(255,255,255,.96) !important;
}

.c-msg__emojiPick:hover{
  background: rgba(255,255,255,.08) !important;
}

/* recent row */
.c-msg__emojiRow{
  display: flex !important;
  gap: 8px !important;
  overflow-x: auto !important;
  padding: 0 2px 6px !important;
  justify-content: center !important;
  align-items: center !important;
}

.c-msg__emojiBtn{
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 auto !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  font-size: 20px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  padding: 0 !important;
  color: rgba(255,255,255,.96) !important;
}

@media (max-width: 899px){
  .c-msg__emojiDock{
    right: 10px !important;
  }

  .c-msg__emojiPopover{
    right: -6px !important;
    left: auto !important;
    width: 300px !important;
    max-width: min(300px, calc(100vw - 20px)) !important;
    bottom: calc(100% + 6px) !important;
  }

  .c-msg__emojiPopover::before{
    display: none !important;
  }

  .c-msg__emojiPickerGrid{
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}/* ===== HARD FIX: emoji strictly inside input on the right ===== */

.c-msg__inputWrap{
  position: relative !important;
}

.c-msg__inputWrap.is-emoji-ready [data-msg-input],
.c-msg__inputWrap.is-emoji-ready .c-msg__input{
  padding-right: 44px !important;
  padding-left: 12px !important;
}

.c-msg__inputWrap > .c-msg__emojiDock{
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  left: auto !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;

  width: 22px !important;
  height: 22px !important;
  margin: 0 !important;
  padding: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 50 !important;
}

/* если где-то старый dock остался снаружи строки — прячем */
.c-msg__composerLine > .c-msg__emojiDock{
  display: none !important;
}

.c-msg__inputWrap > .c-msg__emojiDock .c-msg__emojiToggle{
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 0 !important;
}

.c-msg__inputWrap > .c-msg__emojiDock .c-msg__emojiToggle svg{
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

.c-msg__inputWrap > .c-msg__emojiDock .c-msg__emojiPopover{
  position: absolute !important;
  right: -10px !important;
  left: auto !important;
  bottom: calc(100% + 8px) !important;
  z-index: 60 !important;
}

@media (max-width: 899px){
  .c-msg__inputWrap > .c-msg__emojiDock{
    right: 10px !important;
  }

  .c-msg__inputWrap > .c-msg__emojiDock .c-msg__emojiPopover{
    right: -6px !important;
    left: auto !important;
  }
}




/* ===== MOBILE LOCK WHEN EMOJI POPOVER IS OPEN ===== */

.c-msg__emojiShield{
  display: none;
}

@media (max-width: 899px){
  body.c-msg--emoji-open{
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }

  .c-msg[data-msg-page="thread"].c-msg--emoji-open{
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }

  .c-msg[data-msg-page="thread"].c-msg--emoji-open .c-msg__chat{
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }

  .c-msg[data-msg-page="thread"].c-msg--emoji-open .c-msg__emojiShield{
    display: block;
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 55;
  }

  /* composer и emoji выше shield */
  .c-msg[data-msg-page="thread"].c-msg--emoji-open .c-msg__composer{
    z-index: 56 !important;
  }

  .c-msg[data-msg-page="thread"].c-msg--emoji-open .c-msg__emojiDock{
    z-index: 57 !important;
  }

  .c-msg[data-msg-page="thread"].c-msg--emoji-open .c-msg__emojiPopover{
    z-index: 58 !important;
    touch-action: manipulation !important;
    overscroll-behavior: contain !important;
  }
}





/* =========================================================
   PEER INFO SCREEN — BIG HERO + COLLAPSE ON SCROLL
   ========================================================= */

.c-msgPeerInfo{
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  background: #0b0f17;
  color: #fff;
}

.c-msgPeerInfo.is-open{
  display: block;
}

.c-msgPeerInfo__top{
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px calc(8px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(3,7,16,.72), rgba(3,7,16,0));
  pointer-events: none;
}

.c-msgPeerInfo__topBtn{
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.c-msgPeerInfo__topBtn:active{
  transform: scale(.96);
}

.c-msgPeerInfo__topTitle{
  min-width: 0;
  flex: 1 1 auto;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .22s ease, transform .22s ease;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__topTitle{
  opacity: 1;
  transform: translateY(0);
}

.c-msgPeerInfo__scroll{
  position: absolute;
  inset: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.c-msgPeerInfo__hero{
  position: relative;
  min-height: 420px;
  transition: min-height .28s ease;
  overflow: hidden;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__hero{
  min-height: 132px;
}

.c-msgPeerInfo__heroBg{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  transition: transform .28s ease, filter .28s ease;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroBg{
  transform: scale(1.05);
  filter: brightness(.72);
}

.c-msgPeerInfo__heroShade{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5,8,15,.18) 0%, rgba(5,8,15,.28) 28%, rgba(5,8,15,.72) 72%, rgba(5,8,15,.96) 100%);
}

.c-msgPeerInfo__heroInner{
  position: relative;
  z-index: 1;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  padding: 0 16px 18px;
  transition: min-height .28s ease, padding .28s ease;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroInner{
  min-height: 132px;
  padding: 0 12px 12px 62px;
}

.c-msgPeerInfo__heroHead{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroHead{
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.c-msgPeerInfo__ava{
  width: 118px;
  height: 118px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.18);
  box-shadow: 0 14px 38px rgba(0,0,0,.30);
  background: rgba(255,255,255,.10);
  transition: width .28s ease, height .28s ease, border-radius .28s ease;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__ava{
  width: 44px;
  height: 44px;
  border-width: 2px;
}

.c-msgPeerInfo__meta{
  min-width: 0;
}

.c-msgPeerInfo__name{
  font-size: 28px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  word-break: break-word;
  transition: font-size .28s ease;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__name{
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.c-msgPeerInfo__sub{
  margin-top: 6px;
  font-size: 14px;
  color: rgba(255,255,255,.78);
  transition: opacity .22s ease;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__sub{
  opacity: .88;
}

.c-msgPeerInfo__content{
  padding: 14px 12px 0;
}

.c-msgPeerInfo__actions{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.c-msgPeerInfo__action{
  min-height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.08);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 10px 8px;
}

.c-msgPeerInfo__action:active{
  transform: scale(.985);
}

.c-msgPeerInfo__cards{
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.c-msgPeerInfo__card{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(16,22,34,.92);
  padding: 14px 16px;
}

.c-msgPeerInfo__cardValue{
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  color: #fff;
}

.c-msgPeerInfo__cardLabel{
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.58);
}

.c-msgPeerInfo__tabs{
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.c-msgPeerInfo__tab{
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.84);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.c-msgPeerInfo__tab.is-active{
  background: rgba(92,146,255,.20);
  color: #8fc0ff;
  border-color: rgba(92,146,255,.20);
}

.c-msgPeerInfo__gallery{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 3px;
  padding-bottom: 10px;
}

.c-msgPeerInfo__thumb{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0;
  background: rgba(255,255,255,.05);
  display: block;
}

.c-msgPeerInfo__empty{
  padding: 16px 8px 30px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.56);
}

@media (min-width: 900px){
  .c-msgPeerInfo__scroll{
    left: 50%;
    transform: translateX(-50%);
    width: min(880px, 100vw);
    border-left: 1px solid rgba(255,255,255,.06);
    border-right: 1px solid rgba(255,255,255,.06);
    background: #0b0f17;
  }

  .c-msgPeerInfo__hero,
  .c-msgPeerInfo__heroInner{
    min-height: 480px;
  }

  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__hero{
    min-height: 148px;
  }

  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroInner{
    min-height: 148px;
  }

  .c-msgPeerInfo__ava{
    width: 132px;
    height: 132px;
  }

  .c-msgPeerInfo__name{
    font-size: 34px;
  }

  .c-msgPeerInfo__gallery{
    grid-template-columns: repeat(4, minmax(0,1fr));
  }
}


/* =========================================
   PEER INFO HERO — no round avatar, no jump
   ========================================= */

.c-msgPeerInfo__ava{
  display: none !important;
}

.c-msgPeerInfo__hero{
  min-height: 420px;
  overflow: hidden;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__hero{
  min-height: 132px;
}

.c-msgPeerInfo__heroInner{
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  padding: 0 16px 18px;
  transition: min-height .26s ease, padding .26s ease;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroInner{
  min-height: 132px;
  padding: 0 16px 12px;
}

.c-msgPeerInfo__heroHead{
  width: 100%;
  display: block;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroHead{
  display: block;
}

.c-msgPeerInfo__meta{
  width: 100%;
  min-width: 0;
}

.c-msgPeerInfo__name{
  max-width: 100%;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  word-break: break-word;
  transition: font-size .26s ease, opacity .26s ease;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__name{
  font-size: 18px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.c-msgPeerInfo__sub{
  margin-top: 6px;
  font-size: 14px;
  color: rgba(255,255,255,.78);
  transition: opacity .22s ease;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__sub{
  opacity: .9;
}

.c-msgPeerInfo__heroBg{
  background-size: cover;
  background-position: center;
  transform: scale(1);
  transition: transform .26s ease, filter .26s ease;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroBg{
  transform: scale(1.03);
  filter: brightness(.78);
}

@media (min-width: 900px){
  .c-msgPeerInfo__hero{
    min-height: 480px;
  }

  .c-msgPeerInfo__heroInner{
    min-height: 480px;
  }

  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__hero{
    min-height: 148px;
  }

  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroInner{
    min-height: 148px;
  }

  .c-msgPeerInfo__name{
    font-size: 34px;
  }

  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__name{
    font-size: 20px;
  }
}


/* =========================================
   PEER INFO HERO — disable collapse on scroll
   ========================================= */

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__topTitle{
  opacity: 0 !important;
  transform: none !important;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__hero{
  min-height: 420px !important;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroInner{
  min-height: 420px !important;
  padding: 0 16px 18px !important;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroHead{
  display: block !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0 !important;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroBg{
  transform: none !important;
  filter: none !important;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__name{
  font-size: 28px !important;
  line-height: 1.12 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: 100% !important;
}

.c-msgPeerInfo.is-collapsed .c-msgPeerInfo__sub{
  opacity: 1 !important;
}

@media (min-width: 900px){
  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__hero{
    min-height: 480px !important;
  }

  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroInner{
    min-height: 480px !important;
  }

  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__name{
    font-size: 34px !important;
  }
}


.c-msg__sheetCard--attach{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.c-msg__sheetBtn--attach{
  min-height:54px;
  font-weight:800;
  justify-content:flex-start;
  padding:0 16px;
}

.c-msg__prevVideo,
.c-msg__video{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  background:#000;
  border-radius:14px;
}

.c-msg__video{
  width:min(320px, 78vw);
  height:auto;
  max-height:420px;
}

.c-msg__prev.is-file{
  width:180px;
  height:68px;
}

.c-msg__prevFile{
  width:100%;
  height:100%;
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  background: rgba(0,0,0,.03);
}



.c-msg__prevFileMeta,
.c-msg__fileCardMeta{
  font-size:11px;
  color: var(--msg-sub);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.c-msg__prevFileName,
.c-msg__fileCardTitle{
  font-size:13px;
  font-weight:800;
  line-height:1.25;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.c-msg__prevFileMeta,
.c-msg__fileCardMeta{
  font-size:11px;
  color: var(--msg-sub);
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.c-msg__fileCard{
  width:min(320px, 78vw);
  max-width:100%;
  min-width:0;
  min-height:72px;
  border-radius:16px;
  border:1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.03);
  padding:12px 14px;
  text-align:left;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:6px;
  box-sizing:border-box;
}
.c-msg__bubble,
.c-msg__mediaRow{
  min-width:0;
}

.c-msg__bubble .c-msg__fileCard{
  max-width:100%;
}
.c-msg__ttlNote{
  margin-top:8px;
  font-size:12px;
  line-height:1.35;
  color: var(--msg-sub);
  padding:8px 10px;
  border-radius:12px;
  background: rgba(124,58,237,.08);
  border:1px solid rgba(124,58,237,.14);
}

html[data-clb-theme="dark"] .c-msg__fileCard,
html[data-clb-theme="dark"] .c-msg__prevFile{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.10);
}

html[data-clb-theme="dark"] .c-msg__ttlNote{
  background: rgba(124,58,237,.16);
  border-color: rgba(167,139,250,.24);
  color: rgba(255,255,255,.86);
}













/* ===== Small attach popup above plus ===== */
.c-msg__sheet--attach{
  position: fixed;
  inset: 0;
  z-index: 10030;
}

.c-msg__sheet--attach .c-msg__sheetBg{
  position: absolute;
  inset: 0;
  background: transparent !important;
  backdrop-filter: none !important;
}

.c-msg__sheet--attach .c-msg__sheetCard{
  position: absolute;
  left: 12px;
  right: auto;
  bottom: 80px;
  width: 220px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(17,20,29,.98);
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
  transform: translateY(6px) scale(.98);
  transform-origin: left bottom;
  opacity: 0;
  animation: clbAttachPopoverIn .14s ease-out forwards;
}

@keyframes clbAttachPopoverIn{
  to{
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.c-msg__sheetCard--attach{
  display:flex;
  flex-direction:column;
  gap:4px;
  position: relative;
}

.c-msg__sheetCard--attach::after{
  content:"";
  position:absolute;
  left: var(--attach-tail-x, 26px);
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: rgba(17,20,29,.98);
  border-right: 1px solid rgba(255,255,255,.10);
  border-bottom: 1px solid rgba(255,255,255,.10);
  transform: translateX(-50%) rotate(45deg);
  border-bottom-right-radius: 3px;
}

.c-msg__sheetBtn--attach{
  min-height: 44px;
  justify-content:flex-start;
  align-items:center;
  padding: 0 12px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.94);
  font-weight: 700;
  font-size: 15px;
}

.c-msg__sheetBtn--attach:hover{
  background: rgba(255,255,255,.06);
}

.c-msg__sheetBtn--attach::before{
  content:'';
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-right: 12px;
  opacity: .90;
  background-repeat:no-repeat;
  background-position:center;
  background-size:20px 20px;
}

.c-msg__sheetBtn--attach[data-kind="media"]::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='16' rx='3'/><circle cx='8.5' cy='9' r='1.5'/><path d='M21 15l-5-5L5 20'/></svg>");
}

.c-msg__sheetBtn--attach[data-kind="file"]::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/><path d='M14 3v5h5'/></svg>");
}

.c-msg__sheetBtn--attach[data-kind="audio"]::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M9 18V5l10-2v13'/><circle cx='6' cy='18' r='3'/><circle cx='16' cy='16' r='3'/></svg>");
}

/* ===== Upload progress ===== */
.c-msg__uploading{
  margin-top:8px;
  display:none;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(17,24,39,.06);
  border:1px solid rgba(17,24,39,.12);
}

.c-msg__uploading.is-on{
  display:block;
}

.c-msg__uploadingHead{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  line-height:1.2;
}

.c-msg__uploadingText{
  flex:1 1 auto;
  min-width:0;
}

.c-msg__uploadingPct{
  flex:0 0 auto;
  font-weight:700;
  opacity:.78;
}

.c-msg__uploadingBar{
  margin-top:8px;
  width:100%;
  height:8px;
  border-radius:999px;
  background: rgba(17,24,39,.10);
  overflow:hidden;
  position:relative;
}

.c-msg__uploadingFill{
  display:block;
  height:100%;
  width:0%;
  border-radius:999px;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  transition: width .16s linear;
}

.c-msg__uploading.is-indeterminate .c-msg__uploadingFill{
  width:35%;
  animation: clbUploadIndeterminate 1s linear infinite;
}

@keyframes clbUploadIndeterminate{
  0%{ transform: translateX(-120%); }
  100%{ transform: translateX(320%); }
}




.c-msg__previews{
  display:none !important;
}

.c-msg__previews.is-voice-draft{
  display:flex !important;
}
.c-msg__uploading{
  display:none !important;
}

.c-msg__bubble--pending{
  opacity:.96;
}

.c-msg__pendingCard{
  min-width: 220px;
  width: min(340px, 68vw);
  max-width: min(340px, 68vw);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,.24);
}

.c-msg__pendingCard--image,
.c-msg__pendingCard--video{
  background: rgba(0,0,0,.10);
}
.c-msg__pendingCard--image,
.c-msg__pendingCard--video{
  aspect-ratio: var(--pending-ar, 1 / 1);
}

.c-msg__pendingVisualBox{
  width: 100%;
  height: 100%;
  min-height: 140px;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.06);
}
.c-msg__pendingImg,
.c-msg__pendingVideo{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  background:#000;
}

.c-msg__pendingCard--audio,
.c-msg__pendingCard--file{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
}

.c-msg__pendingFileIcon{
  width:42px;
  height:42px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.18);
  flex:0 0 42px;
  font-size:20px;
}

.c-msg__pendingMeta{
  min-width:0;
  flex:1 1 auto;
}

.c-msg__pendingName{
  font-size:13px;
  font-weight:800;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.c-msg__pendingSub{
  margin-top:4px;
  font-size:11px;
  opacity:.78;
}

.c-msg__pendingProg{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:10px;
}

.c-msg__pendingBar{
  flex:1 1 auto;
  height:8px;
  border-radius:999px;
  overflow:hidden;
  background: rgba(255,255,255,.20);
}

.c-msg__pendingFill{
  display:block;
  width:0%;
  height:100%;
  border-radius:999px;
  background: linear-gradient(90deg, #ffffff, #d8b4fe);
  transition: width .18s linear;
}

.c-msg__pendingPct{
  flex:0 0 auto;
  font-size:12px;
  font-weight:700;
}

.c-msg__pendingFail{
  margin-top:8px;
  font-size:12px;
  color:#fecaca;
}

.c-msg__bubble--pending.is-failed .c-msg__pendingFill{
  background: linear-gradient(90deg, #ef4444, #fca5a5);
}

.c-msg__threadNotice{
  display:none;
  margin: 8px 0 10px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.35;
  color: #7c2d12;
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.22);
  border-radius: 12px;
}

.c-msg__threadNotice.is-on{
  display:block;
}
.c-msg__threadNoticeInner{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.c-msg__threadNoticeText{
  flex:1 1 auto;
  min-width:0;
  overflow-wrap:anywhere;
}

.c-msg__threadNoticeClose{
  flex:0 0 auto;
  width:24px;
  height:24px;
  margin:-2px -2px 0 0;
  border:0;
  border-radius:999px;
  background:transparent;
  color:#92400e;
  font-size:18px;
  line-height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.c-msg__threadNoticeClose:hover{
  background: rgba(245,158,11,.14);
}
.c-msg__pendingCancel{
  position:absolute;
  top:8px;
  right:8px;
  width:24px;
  height:24px;
  border:0;
  border-radius:999px;
  background: rgba(0,0,0,.58);
  color:#fff;
  font-size:18px;
  line-height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:3;
}

.c-msg__pendingCancel:hover{
  background: rgba(0,0,0,.72);
}


.c-msg__bubble--temporary{
  background: rgba(245,158,11,.10) !important;
  border-color: rgba(245,158,11,.28) !important;
}

.c-msg__ttlNote{
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.3;
  color: #92400e;
  background: rgba(245,158,11,.14);
  border: 1px solid rgba(245,158,11,.22);
}



.c-msg__bubble--temporary .c-msg__fileCard{
  background: rgba(245,158,11,.16) !important;
  border-color: rgba(245,158,11,.38) !important;
  box-shadow: inset 0 0 0 1px rgba(245,158,11,.10);
}

.c-msg__bubble--temporary .c-msg__fileCardTitle{
  color: #7c2d12 !important;
}

.c-msg__bubble--temporary .c-msg__fileCardMeta{
  color: #92400e !important;
}

html[data-clb-theme="dark"] .c-msg__bubble--temporary .c-msg__fileCard{
  background: rgba(245,158,11,.18) !important;
  border-color: rgba(251,191,36,.34) !important;
}

html[data-clb-theme="dark"] .c-msg__bubble--temporary .c-msg__fileCardTitle{
  color: #fde68a !important;
}

html[data-clb-theme="dark"] .c-msg__bubble--temporary .c-msg__fileCardMeta{
  color: #fcd34d !important;
}








/* =========================================================
   LIGHT THEME PATCH (messages) — only white theme fixes
   Paste at VERY END of messages (32).css
   ========================================================= */

html:not([data-clb-theme="dark"]) .c-msg{
  --msg-text: rgba(17,24,39,.94);
  --msg-sub: rgba(17,24,39,.62);
  --msg-bd: rgba(17,24,39,.10);
  --msg-soft: rgba(17,24,39,.05);
}

/* 1) Back button near avatar */
html:not([data-clb-theme="dark"]) .c-msg__back{
  color: rgba(17,24,39,.92) !important;
}
html:not([data-clb-theme="dark"]) .c-msg__back::before{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' aria-hidden='true' focusable='false'><path d='M15 5l-7 7 7 7' fill='none' stroke='%23111827' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
}

/* 2) Empty right panel text on white theme */
html:not([data-clb-theme="dark"]) .c-msg[data-msg-page="threads"] .c-msg__right{
  background:
    radial-gradient(1200px 420px at 50% -10%, rgba(124,58,237,.08), transparent 58%),
    linear-gradient(180deg, rgba(17,24,39,.02), rgba(17,24,39,.01)) !important;
  border-left: 1px solid rgba(17,24,39,.08) !important;
}

html:not([data-clb-theme="dark"]) .c-msg[data-msg-page="threads"] .c-msg__panelCard{
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,250,252,.92)) !important;
  border: 1px solid rgba(17,24,39,.08) !important;
  box-shadow:
    0 20px 48px rgba(15,23,42,.08),
    inset 0 1px 0 rgba(255,255,255,.7) !important;
}

html:not([data-clb-theme="dark"]) .c-msg[data-msg-page="threads"] .c-msg__panelIcon{
  border-color: rgba(124,58,237,.14) !important;
  box-shadow:
    0 14px 34px rgba(76,29,149,.12),
    inset 0 1px 0 rgba(255,255,255,.65) !important;
}

html:not([data-clb-theme="dark"]) .c-msg[data-msg-page="threads"] .c-msg__panelTitle{
  color: rgba(17,24,39,.94) !important;
}

html:not([data-clb-theme="dark"]) .c-msg[data-msg-page="threads"] .c-msg__panelText{
  color: rgba(17,24,39,.62) !important;
}

/* 3) Plus attach popup — light version */
html:not([data-clb-theme="dark"]) .c-msg__sheet--attach .c-msg__sheetCard{
  border: 1px solid rgba(17,24,39,.10) !important;
  background: rgba(255,255,255,.98) !important;
  box-shadow: 0 18px 40px rgba(15,23,42,.14) !important;
}

html:not([data-clb-theme="dark"]) .c-msg__sheet--attach .c-msg__sheetCard::after,
html:not([data-clb-theme="dark"]) .c-msg__sheetCard--attach::after{
  background: rgba(255,255,255,.98) !important;
  border-right: 1px solid rgba(17,24,39,.10) !important;
  border-bottom: 1px solid rgba(17,24,39,.10) !important;
}

html:not([data-clb-theme="dark"]) .c-msg__sheetBtn--attach{
  color: rgba(17,24,39,.92) !important;
}

html:not([data-clb-theme="dark"]) .c-msg__sheetBtn--attach:hover{
  background: rgba(17,24,39,.05) !important;
}

html:not([data-clb-theme="dark"]) .c-msg__sheetBtn--attach + .c-msg__sheetBtn--attach{
  border-top: 1px solid rgba(17,24,39,.08) !important;
}

html:not([data-clb-theme="dark"]) .c-msg__sheetBtn--attach[data-kind="media"]::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='16' rx='3'/><circle cx='8.5' cy='9' r='1.5'/><path d='M21 15l-5-5L5 20'/></svg>") !important;
}

html:not([data-clb-theme="dark"]) .c-msg__sheetBtn--attach[data-kind="file"]::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/><path d='M14 3v5h5'/></svg>") !important;
}

html:not([data-clb-theme="dark"]) .c-msg__sheetBtn--attach[data-kind="audio"]::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M9 18V5l10-2v13'/><circle cx='6' cy='18' r='3'/><circle cx='16' cy='16' r='3'/></svg>") !important;
}

/* 4) Emoji button + emoji popup on white theme */
html:not([data-clb-theme="dark"]) .c-msg__emojiToggle,
html:not([data-clb-theme="dark"]) .c-msg__inputWrap > .c-msg__emojiDock .c-msg__emojiToggle{
  color: rgba(17,24,39,.62) !important;
}

html:not([data-clb-theme="dark"]) .c-msg__emojiToggle:hover,
html:not([data-clb-theme="dark"]) .c-msg__inputWrap > .c-msg__emojiDock .c-msg__emojiToggle:hover{
  color: rgba(17,24,39,.88) !important;
}

html:not([data-clb-theme="dark"]) .c-msg__emojiPopover,
html:not([data-clb-theme="dark"]) .c-msg__inputWrap > .c-msg__emojiDock .c-msg__emojiPopover{
  background: rgba(255,255,255,.98) !important;
  border: 1px solid rgba(17,24,39,.10) !important;
  box-shadow: 0 18px 48px rgba(15,23,42,.14) !important;
  color: rgba(17,24,39,.92) !important;
}

html:not([data-clb-theme="dark"]) .c-msg__emojiPopover::after,
html:not([data-clb-theme="dark"]) .c-msg__inputWrap > .c-msg__emojiDock .c-msg__emojiPopover::after{
  background: rgba(255,255,255,.98) !important;
  border-right: 1px solid rgba(17,24,39,.10) !important;
  border-bottom: 1px solid rgba(17,24,39,.10) !important;
}

/* 5) Small extra polish for thread header/icons in white theme */
html:not([data-clb-theme="dark"]) .c-msg__bar{
  background: rgba(255,255,255,.96) !important;
  border-bottom-color: rgba(17,24,39,.08) !important;
}

html:not([data-clb-theme="dark"]) .c-msg__peer,
html:not([data-clb-theme="dark"]) .c-msg__more{
  color: rgba(17,24,39,.92) !important;
}








/* ===== audio/video media fix ===== */

.c-msg__audioLine{
  width: min(320px, 78vw);
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.c-msg__audio{
  display: block;
  width: 100%;
  max-width: 100%;
  height: 42px;
  background: transparent;
  border-radius: 14px;
}

.c-msg__prevVideo,
.c-msg__video{
  background: transparent !important;
  object-fit: contain !important;
}

.c-msg__video{
  display: block;
  width: min(320px, 78vw);
  max-width: 100%;
  height: auto;
  min-height: 42px;
  max-height: 420px;
  border-radius: 14px;
}

.c-msg__mediaRow > .c-msg__video:only-child,
.c-msg__mediaRow > .c-msg__audioLine:only-child{
  margin-right: auto;
}

.c-msg__bubble--audioSide{
  min-width: 0;
}

.c-msg__bubble--audioSide .c-msg__mediaRow{
  min-width: 0;
  width: auto;
  max-width: 100%;
}

.c-msg[data-msg-page="thread"] .c-msg__main{
  position: relative;
}

.c-msg[data-msg-page="thread"] .c-msg__audioDock{
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  flex: 0 0 auto;
  overflow: visible;
}

.c-msg[data-msg-page="thread"] .clb-msg-top-player{
  position: relative;
  z-index: 31;
  width: 100%;
  margin: 0;
}


html, body {
  min-height: 100%;
}

body {
  margin: 0;
}

.c-msg {
  min-height: 100vh;
  box-sizing: border-box;
  padding-bottom: 96px;
}

.c-msg__shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
 
  align-items: stretch;
}

.c-msg__sidebar,
.c-msg__main {
  min-height: 0;
}

.c-msg__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.c-msg__chatWrap,
.c-msg__thread,
.c-msg__panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

[data-msg-chat] {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.c-msg__composer,
[data-msg-composer] {
  margin-top: auto;
}

@media (max-width: 900px) {
  .c-msg__shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 92px);
  }

  .c-msg__sidebar {
    display: none;
  }

  .c-msg[data-msg-mode="threads"] .c-msg__sidebar {
    display: block;
  }
}


@media (min-width: 900px){
  .c-msg[data-msg-page="threads"] .c-msg__panel{
    align-items: center !important;
    justify-content: center !important;
    padding: 18px !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelCard{
    width: min(100%, 440px) !important;
    max-width: 440px !important;
    margin: auto !important;
    text-align: center !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelTitle,
  .c-msg[data-msg-page="threads"] .c-msg__panelText{
    text-align: center !important;
  }
}

.c-msg textarea,
.c-msg__input,
textarea[data-msg-input]{
  resize: none !important;
}





@media (max-width: 899px){
  .c-msg,
  .c-msg__shell,
  .c-msg__left,
  .c-msg__right,
  .c-msg__wrap,
  .c-msg__main,
  .c-msg__threadBody,
  .c-msg__chat,
  .c-msg__list,
  .c-msg__modalCard,
  .c-msg__sheetCard,
  .c-msg__previews,
  .c-msg__emojiRow,
  [data-msg-chat],
  [data-msg-list]{
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .c-msg::-webkit-scrollbar,
  .c-msg__shell::-webkit-scrollbar,
  .c-msg__left::-webkit-scrollbar,
  .c-msg__right::-webkit-scrollbar,
  .c-msg__wrap::-webkit-scrollbar,
  .c-msg__main::-webkit-scrollbar,
  .c-msg__threadBody::-webkit-scrollbar,
  .c-msg__chat::-webkit-scrollbar,
  .c-msg__list::-webkit-scrollbar,
  .c-msg__modalCard::-webkit-scrollbar,
  .c-msg__sheetCard::-webkit-scrollbar,
  .c-msg__previews::-webkit-scrollbar,
  .c-msg__emojiRow::-webkit-scrollbar,
  [data-msg-chat]::-webkit-scrollbar,
  [data-msg-list]::-webkit-scrollbar{
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }

  .c-msg__input,
  textarea[data-msg-input]{
    resize: none !important;
  }

  .c-msg__more,
  .c-msg__topMore{
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
  }
}






/* === CLB CLEAN FIX: messages layout, textarea, mobile scrollbars === */

@media (min-width: 900px){
  .c-msg[data-msg-page="threads"] .c-msg__panel{
    align-items: center !important;
    justify-content: center !important;
    padding: 18px !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelCard{
    width: min(100%, 440px) !important;
    max-width: 440px !important;
    margin: auto !important;
    text-align: center !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__panelTitle,
  .c-msg[data-msg-page="threads"] .c-msg__panelText{
    text-align: center !important;
  }
}

.c-msg__inputWrap{
  overflow: visible !important;
}

.c-msg__inputWrap [data-msg-input],
.c-msg__inputWrap .c-msg__input,
.c-msg textarea,
textarea[data-msg-input]{
  resize: none !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.c-msg__inputWrap [data-msg-input]::-webkit-scrollbar,
.c-msg__inputWrap .c-msg__input::-webkit-scrollbar,
.c-msg textarea::-webkit-scrollbar,
textarea[data-msg-input]::-webkit-scrollbar{
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

@media (max-width: 899px){
  .c-msg,
  .c-msg__shell,
  .c-msg__main,
  .c-msg__threadBody,
  .c-msg__chat,
  .c-msg__list,
  [data-msg-chat],
  [data-msg-list]{
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .c-msg::-webkit-scrollbar,
  .c-msg__shell::-webkit-scrollbar,
  .c-msg__main::-webkit-scrollbar,
  .c-msg__threadBody::-webkit-scrollbar,
  .c-msg__chat::-webkit-scrollbar,
  .c-msg__list::-webkit-scrollbar,
  [data-msg-chat]::-webkit-scrollbar,
  [data-msg-list]::-webkit-scrollbar{
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }
}




/* === CLB FIX: desktop messages page must not scroll as whole page === */
/* /social_app/messages: fixed desktop layout, only thread list scrolls */
@media (min-width: 900px){

  html:has(.c-msg[data-msg-page="threads"]),
  body:has(.c-msg[data-msg-page="threads"]){
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  .c-msg[data-msg-page="threads"]{
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    overflow: hidden !important;

    display: flex !important;
    flex-direction: column !important;

    padding-top: 18px !important;
    padding-bottom: calc(18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom)) !important;
  }

  .c-msg[data-msg-page="threads"] > .c-msg__wrap,
  .c-msg[data-msg-page="threads"] .c-msg__shell{
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__shell{
    align-items: stretch !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__left,
  .c-msg[data-msg-page="threads"] .c-msg__right{
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__left .c-msg__wrap{
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;

    display: flex !important;
    flex-direction: column !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__top{
    flex: 0 0 auto !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__list{
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
  }

  .c-msg[data-msg-page="threads"] .c-msg__panel{
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }
}  

/* === CLB FIX: desktop messages page must not scroll as whole page === */
/* /social_app/messages: fixed desktop layout, only thread list scrolls */
@media (min-width: 900px){

  html:has(.c-msg[data-msg-page="threads"]),
  body:has(.c-msg[data-msg-page="threads"]){
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  .c-msg[data-msg-page="threads"]{
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    overflow: hidden !important;

    display: flex !important;
    flex-direction: column !important;

    padding-top: 18px !important;
    padding-bottom: calc(18px + var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom)) !important;
  }

  .c-msg[data-msg-page="threads"] > .c-msg__wrap,
  .c-msg[data-msg-page="threads"] .c-msg__shell{
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__shell{
    align-items: stretch !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__left,
  .c-msg[data-msg-page="threads"] .c-msg__right{
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__left .c-msg__wrap{
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;

    display: flex !important;
    flex-direction: column !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__top{
    flex: 0 0 auto !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__list{
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
  }

  .c-msg[data-msg-page="threads"] .c-msg__panel{
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }
}


/* =========================================================
   CLB FIX: mobile messages list width/top buttons
   Only /social_app/messages list, not opened thread
   ========================================================= */
@media (max-width: 899px){

  html:has(.c-msg[data-msg-page="threads"]),
  body:has(.c-msg[data-msg-page="threads"]){
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body:has(.c-msg[data-msg-page="threads"]) #main-content{
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    overflow-x: hidden !important;
  }

  .c-msg[data-msg-page="threads"]{
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    box-sizing: border-box !important;
  }

  .c-msg[data-msg-page="threads"] > .c-msg__wrap,
  .c-msg[data-msg-page="threads"] .c-msg__shell,
  .c-msg[data-msg-page="threads"] .c-msg__left,
  .c-msg[data-msg-page="threads"] .c-msg__left .c-msg__wrap{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__shell{
    display: block !important;
    grid-template-columns: none !important;
  }

.c-msg[data-msg-page="threads"] .c-msg__shell > .c-msg__right,
.c-msg[data-msg-page="threads"] .c-msg__panel{
  display: none !important;
}

  .c-msg[data-msg-page="threads"] .c-msg__top{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 40 !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__title{
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__topMore,
  .c-msg[data-msg-page="threads"] [data-msg-settings]{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;

    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;

    margin-left: 0 !important;
    position: relative !important;
    z-index: 45 !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__list{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__item{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .c-msg[data-msg-page="threads"] .c-msg__mid{
    min-width: 0 !important;
  }
}



.c-msgPeerInfo__tab{
  border: 1px solid rgba(255,255,255,.07);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.c-msgPeerInfo__tabPanel{
  min-height: 160px;
}

.c-msgPeerInfo__thumbBtn{
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(255,255,255,.05);
  overflow: hidden;
  cursor: pointer;
}

.c-msgPeerInfo__video{
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  object-fit: cover;
  display: block;
}

.c-msgPeerInfo__list{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 14px;
}

.c-msgPeerInfo__row{
  width: 100%;
  min-height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.c-msgPeerInfo__row:active{
  transform: scale(.99);
}

.c-msgPeerInfo__rowIcon{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.c-msgPeerInfo__rowMain{
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.c-msgPeerInfo__rowTitle{
  min-width: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.c-msgPeerInfo__rowSub{
  min-width: 0;
  color: rgba(255,255,255,.58);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.c-msgPeerInfo__rowAction,
.c-msgPeerInfo__audioDownload{
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(92,146,255,.18);
  color: #9dc7ff;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.c-msgPeerInfo__audioItem{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.06);
  padding: 10px;
}

.c-msgPeerInfo__audioTop{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.c-msgPeerInfo__audioTop .c-msgPeerInfo__rowTitle{
  flex: 1 1 auto;
}

.c-msgPeerInfo__audio{
  display: block;
  width: 100%;
  height: 38px;
}

@media (min-width: 900px){
  .c-msgPeerInfo{
    display: block !important;
    inset: 18px 18px 18px auto !important;
    width: min(430px, calc(100vw - 36px)) !important;
    border-radius: 22px !important;
    overflow: hidden !important;
    background: #0b0f17 !important;
    box-shadow: 0 24px 70px rgba(0,0,0,.42) !important;
    transform: translateX(calc(100% + 28px));
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
  }

  .c-msgPeerInfo.is-open{
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .c-msgPeerInfo__top{
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    padding: 12px !important;
  }

  .c-msgPeerInfo__scroll{
    position: absolute !important;
    inset: 0 !important;
    left: 0 !important;
    width: 100% !important;
    transform: none !important;
    border-left: 0 !important;
    border-right: 0 !important;
    background: #0b0f17 !important;
  }

  .c-msgPeerInfo__hero,
  .c-msgPeerInfo__heroInner,
  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__hero,
  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__heroInner{
    min-height: 290px !important;
  }

  .c-msgPeerInfo__name,
  .c-msgPeerInfo.is-collapsed .c-msgPeerInfo__name{
    font-size: 25px !important;
  }

  .c-msgPeerInfo__actions{
    grid-template-columns: repeat(3, minmax(0,1fr));
  }

  .c-msgPeerInfo__action{
    min-height: 54px;
    border-radius: 15px;
  }

  .c-msgPeerInfo__gallery{
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
  }
}
