/* ═══ Сообщения в личном кабинете (messages.js) ═══ */
.lbp .msg { --m-blue: #2563eb; --m-blue2: #1d4ed8; --m-line: rgba(15, 23, 42, .07); --m-muted: #64748b;
  position: relative; display: grid; grid-template-columns: 330px minmax(0, 1fr); height: 100%; min-height: 460px;
  border-radius: 24px; overflow: hidden; background: #fff; box-shadow: 0 10px 40px -18px rgba(15, 23, 42, .25), 0 0 0 1px var(--m-line); }
.lbp .lbp-body.is-msgs { padding-bottom: 24px; }
@media (min-width: 760px) { .lbp .lbp-body.is-msgs { overflow: hidden; display: flex; flex-direction: column; } .lbp .lbp-body.is-msgs > #lbpMsgs { flex: 1 1 auto; min-height: 0; } }

/* ── левая колонка: список чатов ── */
.msg-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--m-line); background: #f8fafd; }
.msg-side-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 16px 10px; }
.msg-side-h b { font: 800 1.25rem var(--font-display, inherit); color: var(--text-primary, #0f172a); }
.msg-new { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 99px; cursor: pointer;
  font: 700 .8rem var(--font-body, inherit); color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 8px 18px -10px rgba(37, 99, 235, .9);
  transition: transform .2s, box-shadow .2s; }
.msg-new:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -10px rgba(37, 99, 235, .9); }
.msg-search { display: flex; align-items: center; gap: 8px; margin: 0 14px 8px; padding: 0 12px; height: 40px; border-radius: 14px; background: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(200, 210, 230, .7); color: #94a3b8; transition: box-shadow .2s; }
.msg-search:focus-within { box-shadow: inset 0 0 0 1.5px #3b82f6, 0 0 0 4px rgba(59, 130, 246, .12); color: var(--m-blue); }
.msg-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 500 .9rem var(--font-body, inherit); color: var(--text-primary, #0f172a); }
.msg-search input::-webkit-search-cancel-button { cursor: pointer; }
.msg-rooms { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 8px 14px; overscroll-behavior: contain; scrollbar-width: thin; }
.msg-sec { padding: 12px 10px 6px; font: 800 .64rem var(--font-body, inherit); letter-spacing: .14em; text-transform: uppercase; color: #94a3b8; }
.msg-room { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 16px; background: none;
  text-align: left; cursor: pointer; transition: background .15s; color: inherit; font: inherit; }
.msg-room:hover { background: rgba(37, 99, 235, .06); }
.msg-room.on { background: linear-gradient(90deg, #dbeafe, #eef4ff); }
.msg-room.on::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--m-blue); }
.msg-room-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msg-room-t b { font: 700 .93rem var(--font-body, inherit); color: var(--text-primary, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-room-t small { font-size: .8rem; color: var(--m-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-room-t small em { font-style: normal; color: #94a3b8; }
.msg-room.has-new .msg-room-t b { font-weight: 800; }
.msg-room.has-new .msg-room-t small { color: #1e293b; font-weight: 600; }
.msg-room-m { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; align-self: stretch; justify-content: center; }
.msg-room-m time { font-size: .7rem; color: #94a3b8; white-space: nowrap; }
.msg-room.has-new .msg-room-m time { color: var(--m-blue); font-weight: 700; }
.msg-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font: 800 .68rem var(--font-body, inherit);
  color: #fff; background: #f97316; box-shadow: 0 4px 10px -4px rgba(249, 115, 22, .9); }
.msg-room--add .msg-room-t b { color: var(--m-blue); }
.msg-go { flex: 0 0 auto; font-size: 1.4rem; color: #cbd5e1; }
.msg-person.is-busy { opacity: .5; pointer-events: none; }

/* аватары */
.msg-ava { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; overflow: hidden;
  font: 800 .92rem var(--font-display, inherit); color: #fff; background: linear-gradient(135deg, hsl(var(--h, 220) 70% 60%), hsl(calc(var(--h, 220) + 30) 70% 45%)); }
.msg-ava img { width: 100%; height: 100%; object-fit: cover; }
.msg-ava--room { font-size: 1.35rem; }
.msg-ava--club { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.msg-ava--parents { background: linear-gradient(135deg, #fb923c, #ea580c); }
.msg-ava--staff { background: linear-gradient(135deg, #334155, #0f172a); }
.msg-ava--add { background: #e0ecff; color: var(--m-blue); font-size: 1.3rem; }

/* ── правая колонка: переписка ── */
.msg-chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(219, 234, 254, .55), transparent 60%), #f5f8fe; }
.msg-empty { margin: auto; max-width: 320px; padding: 30px; text-align: center; color: var(--m-muted); }
.msg-empty[hidden] { display: none; }
.msg-empty-ic { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 26px; display: grid; place-items: center; font-size: 2rem;
  background: linear-gradient(135deg, #dbeafe, #eff6ff); box-shadow: inset 0 0 0 1px #dbeafe; }
.msg-empty b { display: block; font: 800 1.1rem var(--font-display, inherit); color: var(--text-primary, #0f172a); margin-bottom: 6px; }
.msg-empty p { font-size: .88rem; line-height: 1.5; margin: 0; }
.msg-ch { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--m-line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.msg-ch[hidden], .msg-list[hidden], .msg-foot[hidden] { display: none; }
.msg-ch .msg-ava { width: 42px; height: 42px; border-radius: 14px; }
.msg-ttl { flex: 1; min-width: 0; }
.msg-ttl b { display: block; font: 800 1rem/1.2 var(--font-display, inherit); color: var(--text-primary, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-ttl small { display: flex; align-items: center; gap: 10px; font-size: .76rem; color: var(--m-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; }
.msg-ttl small > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.msg-online { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; color: #16a34a; font-weight: 700; }
.msg-online i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.msg-online em { font-style: normal; }
.msg-back, .msg-close { display: none; flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 12px; cursor: pointer; place-items: center;
  background: #eff6ff; color: var(--m-blue2); font-size: 1.4rem; line-height: 1; }

.msg-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 18px 8px; overscroll-behavior: contain; scrollbar-width: thin; display: flex; flex-direction: column; gap: 3px; }
.msg-day { align-self: center; margin: 12px 0 8px; }
.msg-day span { display: inline-block; padding: 4px 12px; border-radius: 99px; font: 700 .7rem var(--font-body, inherit); color: var(--m-muted); background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px var(--m-line); }
.msg-more { align-self: center; margin: 4px 0 8px; }
.msg-more button { padding: 6px 14px; border: 0; border-radius: 99px; background: #e0ecff; color: var(--m-blue2); font: 700 .76rem var(--font-body, inherit); cursor: pointer; }

.msg-m { position: relative; display: flex; align-items: flex-end; gap: 8px; max-width: 78%; margin-top: 8px; animation: msgIn .28s cubic-bezier(.16, 1, .3, 1); }
.msg-m.grp { margin-top: 0; }
.msg-m.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-m .msg-ava { width: 32px; height: 32px; border-radius: 11px; font-size: .7rem; }
.msg-ava--sp { background: none !important; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.msg-bub { position: relative; min-width: 0; padding: 8px 12px 6px; border-radius: 18px 18px 18px 6px; background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 0 0 1px rgba(15, 23, 42, .04); color: var(--text-primary, #0f172a); }
.msg-m.grp:not(.me) .msg-bub { border-top-left-radius: 8px; }
.msg-m.me .msg-bub { border-radius: 18px 18px 6px 18px; color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 6px 16px -10px rgba(29, 78, 216, .9); }
.msg-m.me.grp .msg-bub { border-top-right-radius: 8px; }
.msg-name { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; font: 800 .76rem var(--font-body, inherit); color: hsl(var(--h, 220) 60% 42%); }
.msg-tag { padding: 1px 7px; border-radius: 99px; font: 800 .6rem var(--font-body, inherit); letter-spacing: .04em; color: #475569; background: #f1f5f9; }
.msg-tag--coach { color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.msg-tag--coach { background: linear-gradient(135deg, #fb923c, #ea580c); }
.msg-tag--admin { color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.msg-tag--parent { color: #9a3412; background: #ffedd5; }
.msg-txt { font-size: .93rem; line-height: 1.42; overflow-wrap: anywhere; white-space: normal; }
.msg-txt a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg-time { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -2px 10px; font-size: .64rem; color: #94a3b8; line-height: 1; }
.msg-m.me .msg-time { color: rgba(255, 255, 255, .75); }
.msg-tick { font-style: normal; font-weight: 800; letter-spacing: -2px; }
.msg-tick.read { color: #bbf7d0; }
.msg-m.emo .msg-bub { background: none !important; box-shadow: none !important; padding: 0; }
.msg-m.emo .msg-txt { font-size: 2.2rem; line-height: 1.15; }
.msg-m.emo .msg-time { color: #94a3b8; }
.msg-q { display: block; width: 100%; margin: 2px 0 6px; padding: 5px 10px; border: 0; border-left: 3px solid #3b82f6; border-radius: 8px; text-align: left; cursor: pointer;
  background: rgba(59, 130, 246, .08); font: inherit; color: inherit; }
.msg-q b { display: block; font-size: .72rem; color: var(--m-blue2); }
.msg-q span { display: block; font-size: .78rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-m.me .msg-q { background: rgba(255, 255, 255, .16); border-left-color: #fff; }
.msg-m.me .msg-q b { color: #fff; }
.msg-m.flash .msg-bub { animation: msgFlash 1.2s; }
@keyframes msgFlash { 30% { box-shadow: 0 0 0 4px rgba(249, 115, 22, .5); } }
.msg-m.is-gone { opacity: 0; transform: scale(.94); transition: .2s; }
.msg-acts { align-self: center; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.msg-acts button { width: 30px; height: 30px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
  cursor: pointer; font-size: .85rem; color: var(--m-blue2); display: grid; place-items: center; }
.msg-acts button:hover { background: #eff6ff; }
@media (hover: hover) { .msg-m:hover .msg-acts { opacity: 1; } }
.msg-m.act .msg-acts { opacity: 1; }

.msg-typing { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 2px 20px 6px; font-size: .76rem; color: var(--m-muted); }
.msg-typing[hidden] { display: none; }
.msg-dots { display: inline-flex; gap: 3px; }
.msg-dots i, .msg-load i { width: 6px; height: 6px; border-radius: 50%; background: #93c5fd; animation: msgDot 1s infinite; }
.msg-dots i:nth-child(2), .msg-load i:nth-child(2) { animation-delay: .15s; }
.msg-dots i:nth-child(3), .msg-load i:nth-child(3) { animation-delay: .3s; }
@keyframes msgDot { 50% { transform: translateY(-4px); background: #2563eb; } }
.msg-load { display: flex; justify-content: center; gap: 5px; padding: 30px; margin: auto; }

.msg-foot { flex: 0 0 auto; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .92); border-top: 1px solid var(--m-line); }
.msg-reply { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px 8px 6px 12px; border-radius: 12px; background: #eff6ff; }
.msg-reply[hidden] { display: none; }
.msg-reply-ic { color: var(--m-blue); font-weight: 800; }
.msg-reply-t { flex: 1; min-width: 0; border-left: 3px solid #3b82f6; padding-left: 8px; }
.msg-reply-t b { display: block; font-size: .74rem; color: var(--m-blue2); }
.msg-reply-t span { display: block; font-size: .8rem; color: var(--m-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-reply button { width: 28px; height: 28px; border: 0; border-radius: 9px; background: #fff; color: var(--m-muted); font-size: 1.1rem; cursor: pointer; }
.msg-form { position: relative; display: flex; align-items: flex-end; gap: 8px; }
.msg-form textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; resize: none; padding: 11px 16px; border: 0; border-radius: 22px; outline: 0;
  background: #f1f5fb; box-shadow: inset 0 0 0 1.5px transparent; font: 500 16px/1.4 var(--font-body, inherit); color: var(--text-primary, #0f172a); transition: box-shadow .2s, background .2s; }
.msg-form textarea:focus { background: #fff; box-shadow: inset 0 0 0 1.5px #3b82f6, 0 0 0 4px rgba(59, 130, 246, .12); }
.msg-left { position: absolute; right: 62px; bottom: 13px; font-size: .68rem; color: #f97316; font-weight: 700; }
.msg-send { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 10px 20px -10px rgba(29, 78, 216, .9); transition: transform .2s, opacity .2s; }
.msg-send:disabled { opacity: .4; cursor: default; box-shadow: none; }
.msg-send:not(:disabled):hover { transform: scale(1.06); }
.msg-send.is-busy { opacity: .6; pointer-events: none; }

/* ── стикеры и GIF в переписке ── */
.msg-m.stk .msg-bub { background: none !important; box-shadow: none !important; padding: 0; }
.msg-m.stk .msg-txt { position: relative; line-height: 0; }
.msg-stk-img { display: block; width: 150px; height: 150px; animation: stkIn .45s cubic-bezier(.2, 1.5, .4, 1); }
.msg-stk-img--g { width: 200px; height: 200px; border-radius: 22px; box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .6); }
@keyframes stkIn { from { transform: scale(.5) rotate(-8deg); opacity: 0; } }
.msg-gif-tag { position: absolute; left: 10px; top: 10px; padding: 2px 7px; border-radius: 7px; font: 800 .62rem/1.4 var(--font-body, inherit); font-style: normal; letter-spacing: .06em;
  color: #fff; background: rgba(15, 23, 42, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.msg-m.stk .msg-time { float: none; display: inline-flex; margin: 4px 6px 0; padding: 2px 7px; border-radius: 99px; background: rgba(15, 23, 42, .45); color: #fff !important; }
.msg-m.stk.me .msg-txt { text-align: right; }
.msg-m.stk .msg-q { background: #fff; box-shadow: 0 0 0 1px var(--m-line); color: var(--text-primary, #0f172a); }
.msg-m.stk.me .msg-q b { color: var(--m-blue2); }

/* ── кнопка 😊 и панель эмодзи / стикеров / GIF ── */
.msg-emo-btn { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f1f5fb; font-size: 1.35rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: background .15s, transform .2s; filter: grayscale(.25); }
.msg-emo-btn:hover { background: #e0ecff; transform: scale(1.06); filter: none; }
.msg-emo-btn.on { background: #dbeafe; filter: none; box-shadow: inset 0 0 0 1.5px #3b82f6; }
.msg-emo { display: flex; flex-direction: column; height: 340px; margin: 0 0 10px; border-radius: 20px; background: #fff; overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .45), 0 0 0 1px var(--m-line); opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .22s cubic-bezier(.16, 1, .3, 1); }
.msg-emo[hidden] { display: none; }
.msg-emo.in { opacity: 1; transform: none; }
.msg-emo-tabs { flex: 0 0 auto; display: flex; gap: 4px; padding: 8px 8px 6px; border-bottom: 1px solid var(--m-line); overflow-x: auto; scrollbar-width: none; }
.msg-emo-tabs::-webkit-scrollbar { display: none; }
.msg-emo-tabs button { flex: 1 0 auto; padding: 8px 6px; border: 0; border-radius: 12px; background: none; font: 700 .8rem var(--font-body, inherit); color: var(--m-muted); cursor: pointer; white-space: nowrap; }
.msg-emo-tabs button:hover { background: #f1f5f9; }
.msg-emo-tabs button.on { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; box-shadow: 0 6px 14px -8px rgba(29, 78, 216, .9); }
.msg-emo-pane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.msg-emo-q { margin: 8px 10px 4px; height: 36px; }
.msg-emo-list, .msg-stk-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 8px 8px; overscroll-behavior: contain; scrollbar-width: thin; position: relative; }
.msg-emo-h { position: sticky; top: 0; z-index: 1; padding: 8px 6px 4px; font: 800 .62rem var(--font-body, inherit); letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; background: rgba(255, 255, 255, .96); }
.msg-emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
.msg-emo-grid button { aspect-ratio: 1; border: 0; border-radius: 10px; background: none; font-size: 1.55rem; line-height: 1; cursor: pointer; padding: 0;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; transition: background .1s, transform .12s; }
.msg-emo-grid button:hover { background: #eff6ff; transform: scale(1.18); }
.msg-emo-cats { flex: 0 0 auto; display: flex; justify-content: space-between; padding: 4px 6px; border-top: 1px solid var(--m-line); background: #f8fafd; overflow-x: auto; scrollbar-width: none; }
.msg-emo-cats:empty { display: none; }
.msg-emo-cats button { flex: 0 0 auto; width: 34px; height: 30px; border: 0; border-radius: 9px; background: none; font-size: 1.05rem; cursor: pointer; filter: grayscale(.6); opacity: .8; }
.msg-emo-cats button:hover { background: #e0ecff; filter: none; opacity: 1; }
.msg-stk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; padding: 2px 2px 6px; }
.msg-stk-grid.is-gif { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.msg-stk-cell { aspect-ratio: 1; padding: 6px; border: 0; border-radius: 16px; background: none; cursor: pointer; transition: background .12s, transform .15s; }
.msg-stk-cell img { width: 100%; height: 100%; display: block; }
.msg-stk-cell--g { padding: 3px; }
.msg-stk-cell--g img { border-radius: 16px; }
.msg-stk-cell:hover { background: #eff6ff; transform: scale(1.06); }
.msg-stk-cell:active { transform: scale(.94); }

/* заглушки */
.msg-gate { margin: auto; max-width: 340px; padding: 28px 18px; text-align: center; color: var(--m-muted, #64748b); }
.msg-gate-ic { font-size: 2.2rem; margin-bottom: 8px; }
.msg-gate b { display: block; font: 800 1.02rem var(--font-display, inherit); color: var(--text-primary, #0f172a); margin-bottom: 6px; }
.msg-gate p { margin: 0; font-size: .86rem; line-height: 1.5; }
.msg-gate-act { margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#lbpMsgs > .msg-gate { padding: 60px 20px; }

/* ── «Кому написать» ── */
.msg-pick { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .32);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.msg-pick[hidden] { display: none; }
.msg-pick.on { opacity: 1; }
.msg-pick-in { display: flex; flex-direction: column; width: min(440px, 100%); max-height: min(620px, 100%); border-radius: 24px; background: #fff;
  box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .5); overflow: hidden; transform: translateY(12px) scale(.98); transition: transform .25s cubic-bezier(.16, 1, .3, 1); }
.msg-pick.on .msg-pick-in { transform: none; }
.msg-pick-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px 20px; }
.msg-pick-h b { font: 800 1.15rem var(--font-display, inherit); color: var(--text-primary, #0f172a); }
.msg-pick-x { width: 36px; height: 36px; border: 0; border-radius: 12px; background: #f1f5f9; color: #475569; font-size: 1.3rem; cursor: pointer; }
.msg-pick-list { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 0 8px 8px; overscroll-behavior: contain; }
.msg-pick-note { margin: 0; padding: 10px 20px 16px; font-size: .74rem; color: #94a3b8; border-top: 1px solid var(--m-line); }

/* меню сайта: непрочитанные рядом с «Профиль» */
.nav-account[data-unread] { position: relative; }
.nav-account[data-unread]::after { content: attr(data-unread); position: absolute; top: -8px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  display: grid; place-items: center; font: 800 .62rem/1 var(--font-body, inherit); color: #fff; background: #f97316; box-shadow: 0 0 0 2px #fff; }

/* ═══ планшет ═══ */
/* планшет: список и переписка по очереди, но внутри окна */
@media (min-width: 760px) and (max-width: 1099px) {
  .lbp .msg { grid-template-columns: minmax(0, 1fr); }
  .msg[data-view="list"] .msg-chat { display: none; }
  .msg[data-view="chat"] .msg-side { display: none; }
  .msg-back { display: grid; }
  .msg-side { border-right: 0; }
  .msg-m { max-width: 80%; }
}

/* ═══ телефон: список чатов — в кабинете, открытая переписка — на весь экран ═══ */
@media (max-width: 759px) {
  .lbp .msg { display: block; height: auto; min-height: 0; border-radius: 22px; }
  .msg-side { border-right: 0; background: #fff; }
  .msg-side-h { padding: 16px 14px 8px; }
  .msg-rooms { overflow: visible; padding: 2px 6px 10px; }
  .msg .msg-chat { display: none; }
  .lbp-sheet.msg-full { overflow: hidden !important; transform: none !important; }
  .lbp-sheet.msg-full .msg[data-view="chat"] .msg-chat { display: flex; position: fixed; inset: 0; z-index: 60; height: 100%; height: 100dvh; }
  .msg-ch { padding: calc(8px + env(safe-area-inset-top)) 10px 8px; gap: 10px; }
  .msg-back, .msg-close { display: grid; }
  .msg-close { background: #f1f5f9; color: #475569; }
  .msg-list { padding: 10px 12px 6px; }
  .msg-m { max-width: 88%; }
  .msg-foot { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .msg-form { gap: 6px; }
  .msg-emo { height: min(46dvh, 360px); margin: 0 -10px 8px; border-radius: 18px 18px 0 0; box-shadow: 0 -1px 0 var(--m-line); }
  .msg-emo-grid { grid-template-columns: repeat(8, 1fr); }
  .msg-stk-grid { grid-template-columns: repeat(3, 1fr); }
  .msg-stk-grid.is-gif { grid-template-columns: repeat(2, 1fr); }
  .msg-stk-img { width: 132px; height: 132px; }
  .msg-stk-img--g { width: 180px; height: 180px; }
  .msg-pick { position: fixed; z-index: 70; padding: 0; place-items: end stretch; }
  .msg-pick-in { width: 100%; max-height: 86dvh; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); transform: translateY(40px); }
}

/* ── реакции, «изменено», меню сообщения, свайп ── */
.msg-rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; clear: both; }
.msg-rx button { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 0; border-radius: 99px; cursor: pointer;
  font-size: .92rem; line-height: 1; background: #eef4ff; box-shadow: inset 0 0 0 1px #dbeafe; transition: transform .15s, background .15s; }
.msg-rx button b { font: 800 .72rem var(--font-body, inherit); color: var(--m-blue2); }
.msg-rx button.on { background: #dbeafe; box-shadow: inset 0 0 0 1.5px #3b82f6; }
.msg-rx button:hover { transform: scale(1.06); }
.msg-m.me .msg-rx button { background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.msg-m.me .msg-rx button b { color: #fff; }
.msg-m.me .msg-rx button.on { background: rgba(255, 255, 255, .34); box-shadow: inset 0 0 0 1.5px #fff; }
.msg-m.stk .msg-rx button, .msg-m.emo .msg-rx button { background: #fff; box-shadow: 0 0 0 1px var(--m-line); }
.msg-m.stk .msg-rx button b, .msg-m.emo .msg-rx button b { color: var(--m-blue2); }
.msg-ed { font-style: normal; margin-right: 4px; opacity: .85; }
.msg-m.menu-on .msg-bub { box-shadow: 0 0 0 3px rgba(59, 130, 246, .35); }
.msg-m.stk.menu-on .msg-bub { box-shadow: none; filter: drop-shadow(0 0 6px rgba(59, 130, 246, .5)); }
.msg-menu { position: absolute; z-index: 20; width: 248px; padding: 8px; border-radius: 18px; background: #fff;
  box-shadow: 0 24px 50px -16px rgba(15, 23, 42, .45), 0 0 0 1px rgba(15, 23, 42, .06); opacity: 0; transform: scale(.94); transform-origin: top center; transition: opacity .14s, transform .18s cubic-bezier(.16, 1, .3, 1); }
.msg-menu.on { opacity: 1; transform: none; }
.msg-menu-rx { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 2px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--m-line); }
.msg-menu-rx button { aspect-ratio: 1; border: 0; border-radius: 10px; background: none; font-size: 1.15rem; cursor: pointer; padding: 0; transition: transform .12s, background .12s; }
.msg-menu-rx button:hover { transform: scale(1.25); background: #eff6ff; }
.msg-menu-rx button.on { background: #dbeafe; }
.msg-menu-it { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 11px; background: none; cursor: pointer; text-align: left;
  font: 600 .88rem var(--font-body, inherit); color: var(--text-primary, #0f172a); }
.msg-menu-it i { font-style: normal; width: 20px; text-align: center; }
.msg-menu-it:hover { background: #f1f5f9; }
.msg-menu-it.is-danger { color: #ea580c; }
.msg-menu-it.is-danger:hover { background: #fff7ed; }
.msg-menu-foot { padding: 6px 10px 2px; font-size: .7rem; color: #94a3b8; }
.msg-acts button[data-m="menu"] { font-weight: 900; letter-spacing: 1px; }
.msg-m.swipe-ok::before { content: '↩'; position: absolute; left: -34px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: #dbeafe; color: var(--m-blue2); font-weight: 900; }
.msg-reply.is-edit { background: #fff7ed; }
.msg-reply.is-edit .msg-reply-t { border-left-color: #f97316; }
.msg-reply.is-edit .msg-reply-t b { color: #c2410c; }
.msg-send.is-edit { background: linear-gradient(135deg, #f97316, #ea580c); }
.msg-ttl small > span.is-typing, .msg-typ-s { color: var(--m-blue); font-weight: 700; font-style: normal; display: inline-flex; align-items: center; gap: 6px; }
.msg-ttl small > span.is-typing .msg-dots i { width: 4px; height: 4px; }
@media (pointer: coarse) {
  .msg-bub { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  .msg-acts { display: none; }
  .msg-m { touch-action: pan-y; }
}

/* ═══ Мессенджер 2.0 ═══ */
/* галочки: 🕓 · ✓ · ✓✓ · ✓✓ синие (на синем пузыре — светлые) */
.msg-tick { display: inline-flex; align-items: center; letter-spacing: 0; line-height: 0; }
.msg-tick svg { display: block; }
.msg-m.me .msg-tick.t-sent, .msg-m.me .msg-tick.t-deliv { color: rgba(255, 255, 255, .78); }
.msg-m.me .msg-tick.t-read { color: #a5f3fc; filter: drop-shadow(0 0 3px rgba(165, 243, 252, .6)); }
.msg-m.me.stk .msg-tick, .msg-m.me.md .msg-tick, .msg-m.me.emo .msg-tick { color: #64748b; }
.msg-m.me.stk .msg-tick.t-read, .msg-m.me.md .msg-tick.t-read, .msg-m.me.emo .msg-tick.t-read { color: #0ea5e9; filter: none; }
.msg-room-m .msg-tick { color: #94a3b8; margin-right: 3px; vertical-align: -1px; }
.msg-room-m .msg-tick.t-read { color: #0ea5e9; }
.msg-clock { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid currentColor; position: relative; display: inline-block; }
.msg-clock::after { content: ''; position: absolute; left: 50%; top: 1.5px; width: 1.5px; height: 4px; margin-left: -.75px; background: currentColor; transform-origin: 50% 100%; animation: msgClock 1s linear infinite; }
@keyframes msgClock { to { transform: rotate(360deg); } }
.msg-tick.t-fail { width: 16px; height: 16px; border-radius: 50%; background: #f97316; color: #fff !important; font: 900 .7rem/16px var(--font-body, inherit); justify-content: center; cursor: pointer; }
.msg-m.is-pending .msg-bub { opacity: .78; }
.msg-m.is-failed .msg-bub { box-shadow: 0 0 0 2px rgba(249, 115, 22, .5) !important; }

/* поле ввода: микрофон и кружок вместо «Отправить», пока пусто */
.msg-send[hidden], .msg-mic[hidden] { display: none !important; }
.msg-mic { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #1d4ed8; background: #eff6ff; transition: transform .15s, background .15s; }
.msg-mic:hover { background: #dbeafe; transform: scale(1.06); }
.msg-mic:active { transform: scale(.94); }
.msg-bell { flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #fff7ed; cursor: pointer; font-size: 1rem; margin-left: auto; margin-right: 6px; animation: msgBell 2.4s ease-in-out infinite; }
.msg-bell[hidden] { display: none; }
@keyframes msgBell { 0%, 80%, 100% { transform: none; } 84% { transform: rotate(14deg); } 88% { transform: rotate(-12deg); } 92% { transform: rotate(8deg); } }

/* запись голосового */
.msg-rec { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.msg-rec[hidden] { display: none; }
.msg-rec-x { flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff7ed; cursor: pointer; font-size: 1.05rem; }
.msg-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #f97316; animation: msgRecDot 1s ease-in-out infinite; flex: none; }
@keyframes msgRecDot { 50% { opacity: .25; } }
.msg-rec-t { font: 800 .9rem var(--font-body, inherit); font-variant-numeric: tabular-nums; min-width: 38px; }
.msg-rec-wave { flex: 1; min-width: 0; height: 32px; display: flex; align-items: center; gap: 2px; overflow: hidden; justify-content: flex-end; }
.msg-rec-wave i { flex: 0 0 3px; height: calc(4px + var(--v) * 28px); border-radius: 2px; background: #3b82f6; }

/* запись кружка */
.msg-vrec { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(8, 18, 48, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.msg-vrec[hidden] { display: none; }
.msg-vrec.on { opacity: 1; }
.msg-vrec-in { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.msg-vrec-circle { position: relative; width: min(64vw, 280px); aspect-ratio: 1; }
.msg-vrec-circle video { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; transform: scaleX(-1); background: #0f172a; box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .7); }
.msg-vrec-ring { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); }
.msg-vrec-ring circle { fill: none; stroke-width: 3; }
.msg-vrec-ring circle:first-child { stroke: rgba(255, 255, 255, .25); }
.msg-vrec-ring circle + circle { stroke: #f97316; stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; transition: stroke-dashoffset .2s linear; }
.msg-vrec-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 99px; background: #fff; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); }
.msg-vrec-bar small { color: #94a3b8; font-size: .72rem; }

/* голосовое в переписке */
.msg-voice { display: flex; align-items: center; gap: 10px; min-width: 200px; padding: 2px 0 4px; --p: 0; }
.msg-vplay { flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.msg-m.me .msg-vplay { color: #1d4ed8; background: #fff; }
.msg-vplay .pa, .msg-voice.is-playing .msg-vplay .pl { display: none; }
.msg-voice.is-playing .msg-vplay .pa { display: block; }
.msg-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; }
.msg-wave i { flex: 1; max-width: 3px; min-width: 2px; height: calc(3px + var(--v) * 26px); border-radius: 2px; background: #bfdbfe; }
.msg-m.me .msg-wave i { background: rgba(255, 255, 255, .45); }
.msg-wave i.on { background: #2563eb; }
.msg-m.me .msg-wave i.on { background: #fff; }
.msg-vdur { font: 700 .74rem var(--font-body, inherit); font-variant-numeric: tabular-nums; opacity: .8; min-width: 32px; }

/* кружок в переписке */
.msg-m.md-v .msg-bub, .msg-m.md-gy .msg-bub, .msg-m.md-gs .msg-bub { background: none !important; box-shadow: none !important; padding: 0; }
.msg-circle { position: relative; width: 220px; height: 220px; --p: 0; }
.msg-circle video { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #0f172a; display: block; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6); }
.msg-circle-ring { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); transform: rotate(-90deg); pointer-events: none; opacity: 0; transition: opacity .2s; }
.msg-circle-ring circle { fill: none; stroke: #3b82f6; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p) * 100); }
.msg-circle.is-playing .msg-circle-ring { opacity: 1; }
.msg-cplay { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 0; }
.msg-cplay::after { content: '🔊'; position: absolute; right: 14px; bottom: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .9rem; background: rgba(15, 23, 42, .55); color: #fff; }
.msg-circle.is-playing .msg-cplay::after { content: '⏸'; }
.msg-cdur { position: absolute; left: 12px; bottom: 14px; padding: 2px 8px; border-radius: 99px; font: 700 .7rem var(--font-body, inherit); color: #fff; background: rgba(15, 23, 42, .55); }
.msg-m.md-v .msg-time, .msg-m.md-gy .msg-time, .msg-m.md-gs .msg-time { float: none; display: flex; justify-content: flex-end; margin-top: 4px; color: #94a3b8; }
.msg-gy { display: block; max-width: 260px; height: auto; border-radius: 16px; background: #e2e8f0; }
.msg-m.md-gy .msg-txt { position: relative; }

/* выбор стикеров: категории, избранное; GIPHY */
.msg-stk-cats { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.msg-stk-cats::-webkit-scrollbar { display: none; }
.msg-stk-cats button { flex: 0 0 auto; padding: 6px 11px; border: 0; border-radius: 99px; background: #f1f5f9; font: 700 .76rem var(--font-body, inherit); color: #334155; cursor: pointer; white-space: nowrap; }
.msg-stk-cats button.on { background: #1d4ed8; color: #fff; }
.msg-stk-cell { position: relative; }
.msg-stk-cell.is-fav::after { content: '⭐'; position: absolute; top: 2px; right: 2px; font-size: .7rem; }
.msg-emo-tabs button { font-size: .76rem; }
.msg-gy-grid { columns: 3 110px; column-gap: 6px; }
.msg-gy-cell { display: block; width: 100%; margin: 0 0 6px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #e2e8f0; cursor: pointer; break-inside: avoid; }
.msg-gy-cell img { width: 100%; height: auto; display: block; }
.msg-gy-cell.is-st { background: #f1f5f9; padding: 6px; }
.msg-gs { display: block; max-width: 180px; height: auto; background: none; }
.msg-camhelp { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
body > .msg-camhelp { position: fixed; z-index: 3000; }
.msg-camhelp-box { width: min(360px, 100%); padding: 20px 18px 16px; border-radius: 22px; background: #fff; box-shadow: 0 20px 60px rgba(15,23,42,.3); font: 500 .9rem/1.45 var(--font-body, inherit); color: #334155; text-align: left; }
.msg-camhelp-ic { width: 48px; height: 48px; margin-bottom: 10px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: #eff6ff; }
.msg-camhelp-box b { display: block; margin-bottom: 4px; font: 800 1.05rem var(--font-display, inherit); color: #0f172a; }
.msg-camhelp-box p { margin: 0 0 8px; }
.msg-camhelp-box ol { margin: 0 0 12px; padding-left: 20px; }
.msg-camhelp-box li { margin: 4px 0; }
.msg-camhelp-row { display: flex; gap: 8px; }
.msg-camhelp-row button { flex: 1; padding: 11px 12px; border: 0; border-radius: 12px; font: 700 .86rem var(--font-body, inherit); cursor: pointer; }
.msg-camhelp-ok { background: #2563eb; color: #fff; }
.msg-camhelp-x { background: #f1f5f9; color: #334155; }
.msg-gs-note { margin: 0 2px 8px; font: 700 .72rem var(--font-body, inherit); color: #64748b; }
.msg-gy-cell:hover { outline: 3px solid #3b82f6; }
.msg-gy-more { display: block; margin: 6px auto; padding: 8px 16px; border: 0; border-radius: 99px; background: #eff6ff; color: #1d4ed8; font: 700 .8rem var(--font-body, inherit); cursor: pointer; }
.msg-gy-more[hidden] { display: none; }
.msg-gy-attr { margin: 6px 0 2px; text-align: center; font: 800 .66rem var(--font-body, inherit); letter-spacing: .08em; text-transform: uppercase; color: #64748b; }

/* статус «записывает / выбирает» — точки другого цвета */
.msg-dots--voice i, .msg-dots--video i { background: #fb923c; }
.msg-dots--sticker i, .msg-dots--gif i, .msg-dots--emoji i { background: #fb923c; }

/* кнопка мессенджера — всегда на экране */
.msg-fab { position: fixed; right: 20px; bottom: 22px; z-index: 900; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 18px 0 15px; border: 0; border-radius: 99px; cursor: pointer;
  color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 14px 30px -12px rgba(29, 78, 216, .85), 0 0 0 1px rgba(255, 255, 255, .25) inset; transition: transform .2s, box-shadow .2s; }
.msg-fab[hidden] { display: none; }
.msg-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(29, 78, 216, .95); }
.msg-fab-t { font: 800 .86rem var(--font-body, inherit); }
.msg-fab b { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; display: none; place-items: center; font: 900 .72rem var(--font-body, inherit); color: #fff; background: #f97316; box-shadow: 0 0 0 2px #fff; }
.msg-fab.has-new b { display: grid; }
.msg-fab.has-new { animation: msgFab 2.6s ease-in-out infinite; }
@keyframes msgFab { 0%, 86%, 100% { transform: none; } 90% { transform: translateY(-4px); } 94% { transform: none; } 97% { transform: translateY(-2px); } }
@media (max-width: 1024px) { .msg-fab { width: 54px; height: 54px; padding: 0; justify-content: center; } .msg-fab-t { display: none; } }
@media (max-width: 760px) { .msg-fab { right: 14px; bottom: calc(var(--m-tabbar-h, 64px) + 14px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .msg-fab.has-new, .msg-bell, .msg-rec-dot { animation: none; } }
/* непрочитанные — и на значке кабинета в меню (телефон, планшет) */
.m-nav-account[data-unread], .t-acc[data-unread] { position: relative; }
.m-nav-account[data-unread]::after, .t-acc[data-unread]::after { content: attr(data-unread); position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  display: grid; place-items: center; font: 900 .62rem var(--font-body, inherit); color: #fff; background: #f97316; box-shadow: 0 0 0 2px #fff; }
.msg-form[hidden] { display: none !important; }
@media (max-width: 760px) { .msg-circle { width: 200px; height: 200px; } }

/* ═══ отдельное окно мессенджера ═══ */
.msgw { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 24px; background: rgba(8, 18, 48, .45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .25s ease; }
.msgw[hidden] { display: none; }
.msgw.show { opacity: 1; }
.msgw-in { width: min(1100px, 100%); height: min(800px, calc(100dvh - 48px)); transform: translateY(14px) scale(.98); transition: transform .32s cubic-bezier(.2, .9, .3, 1); }
.msgw.show .msgw-in { transform: none; }
.msgw-body { height: 100%; }
.msgw-body > .msg-gate { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 24px; background: #fff; }
.msgw .msg { --m-blue: #2563eb; --m-blue2: #1d4ed8; --m-line: rgba(15, 23, 42, .07); --m-muted: #64748b;
  position: relative; display: grid; grid-template-columns: 340px minmax(0, 1fr); height: 100%; min-height: 0;
  border-radius: 24px; overflow: hidden; background: #fff; box-shadow: 0 30px 80px -24px rgba(8, 18, 48, .6), 0 0 0 1px var(--m-line); }
.msg-winx { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #eef2f8; color: #475569; font-size: 1.35rem; line-height: 1; cursor: pointer; transition: background .15s; }
.msg-winx:hover { background: #e2e8f0; color: #0f172a; }
.msg-side-h .msg-new { margin-left: auto; }
.msg-side-h .msg-bell + .msg-new { margin-left: 0; }
html.msgw-open .msg-fab { display: none; }
@media (max-width: 1099px) and (min-width: 760px) { .msgw .msg { grid-template-columns: minmax(0, 1fr); } .msgw-in { width: min(720px, 100%); } }
@media (max-width: 759px) {
  .msgw { padding: 0; place-items: stretch; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .msgw-in { width: 100%; height: 100%; height: 100dvh; transform: translateY(24px); }
  .msgw .msg { grid-template-columns: minmax(0, 1fr); border-radius: 0; box-shadow: none; padding-top: env(safe-area-inset-top); }
  .msgw .msg-rooms { overflow-y: auto; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .msgw .msg-side { min-height: 0; height: 100%; }
  .msgw .msg[data-view="chat"] .msg-side { display: none; }
  .msgw .msg[data-view="chat"] .msg-chat { display: flex; height: 100%; min-height: 0; }
  .msgw .msg-ch { padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .msgw, .msgw-in { transition: none; } }
.msgw-in { position: relative; }
.msgw-x { position: absolute; top: 14px; right: 14px; z-index: 40; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f1f5f9; color: #475569; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: background .15s, transform .15s; }
.msgw-x:hover { background: #e2e8f0; color: #0f172a; transform: rotate(90deg); }
.msg-winx { display: none; }
.msgw .msg-ch { padding-right: 64px; }
@media (max-width: 759px) {
  .msgw-x { display: none; }
  .msg-winx { display: grid; place-items: center; }
  .msgw .msg-ch { padding-right: 10px; }
}

/* кружок: кадр-превью + большая кнопка ▶ по центру */
.msg-circle video { background: linear-gradient(135deg, #1e3a8a, #0f172a); }
.msg-cplay { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 0; display: grid; place-items: center; }
.msg-cplay::after { content: none !important; }
.msg-cplay-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(15, 23, 42, .5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transition: transform .18s, opacity .2s, background .2s; }
.msg-cplay:hover .msg-cplay-ic { transform: scale(1.08); background: rgba(37, 99, 235, .75); }
.msg-cplay-ic .pa { display: none; }
.msg-circle.is-playing .msg-cplay-ic { opacity: 0; transform: scale(.8); }
.msg-circle.is-playing:hover .msg-cplay-ic { opacity: 1; transform: none; }
.msg-circle.is-playing .msg-cplay-ic .pl { display: none; }
.msg-circle.is-playing .msg-cplay-ic .pa { display: block; }
.msg-circle.is-loading video { animation: msgCircLoad 1.4s ease-in-out infinite; }
@keyframes msgCircLoad { 50% { filter: brightness(1.35); } }
.msg-cerr { display: none; position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); white-space: nowrap; font: 700 .72rem var(--font-body, inherit); color: #ea580c; text-decoration: underline; }
.msg-circle.is-err .msg-cerr { display: block; }
.msg-circle.is-err { margin-bottom: 26px; }

/* ═══ кнопки — скруглённые квадраты (как в верхнем меню), кружок видеосообщения остаётся кругом ═══ */
.msg-send, .msg-emo-btn, .msg-mic { border-radius: 15px; }
.msg-bell, .msg-winx { border-radius: 12px; }
.msg-rec-x, .msg-vplay, .msgw-x { border-radius: 14px; }
.msg-fab { border-radius: 18px; }

/* поле ввода: без полосы прокрутки справа (она выглядела как разделитель и залезала на поле) */
.msg-form textarea { scrollbar-width: none; -ms-overflow-style: none; border-radius: 15px; }
.msg-form textarea::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* крестик закрытия: иконка-рисунок строго по центру — поворот при наведении больше не «гуляет» */
.msgw-x, .lbp-x { display: grid !important; place-items: center; padding: 0 !important; font-size: 0 !important; line-height: 0 !important; }
.msgw-x svg, .lbp-x svg { width: 18px; height: 18px; display: block; }
.msgw-x { border-radius: 14px; }
/* мессенджер внутри кабинета: закрывается вместе с кабинетом, отдельный крестик не нужен */
#lbpMsgs .msg-winx, #lbpMsgs .msg-close { display: none !important; }
.msg-camhelp-box { text-align: center; }
.msg-camhelp-ic { margin: 0 auto 10px; }
.msg-camhelp-row--col { flex-direction: column; }
.msg-camhelp-row--col button { flex: none; width: 100%; padding: 13px 12px; font-size: .92rem; }
.msg-camhelp-ok { background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 10px 20px -12px rgba(37, 99, 235, .9); }
.msg-camhelp-man { margin: 0 0 12px; text-align: left; font-size: .8rem; color: #64748b; }
.msg-camhelp-man summary { cursor: pointer; font-weight: 700; color: #2563eb; text-align: center; list-style: none; }
.msg-camhelp-man summary::-webkit-details-marker { display: none; }
.msg-camhelp-man p { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: #f8fafc; }
/* стрелка на значок разрешений у адреса (Chrome помнит запрет) */
.lb-permpt { position: fixed; top: 6px; left: 12px; z-index: 13000; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; animation: lbPpIn .3s ease; }
.lb-permpt-arr { font: 900 2.2rem/1 var(--font-display, system-ui); color: #fb923c; text-shadow: 0 4px 14px rgba(234,88,12,.5); margin-left: 18px; animation: lbPpBob 1s ease-in-out infinite; }
.lb-permpt-card { pointer-events: auto; max-width: min(320px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 16px; background: #0f172a; color: #fff; box-shadow: 0 16px 40px -12px rgba(8,18,48,.6); font: 600 .86rem/1.4 var(--font-body, system-ui); display: grid; gap: 6px; }
.lb-permpt-card b { font-weight: 800; }
.lb-permpt-card span { color: #cbd5e1; font-size: .78rem; }
.lb-permpt-card button { justify-self: start; border: 0; border-radius: 11px; padding: 8px 14px; font: 800 .82rem var(--font-body, system-ui); color: #fff; background: linear-gradient(135deg, #fb923c, #ea580c); cursor: pointer; }
@keyframes lbPpBob { 50% { transform: translateY(-6px); } }
@keyframes lbPpIn { from { opacity: 0; transform: translateY(-8px); } }
.lb-permpt.is-right { left: auto; right: 12px; align-items: flex-end; }
.lb-permpt.is-right .lb-permpt-arr { margin: 0 18px 0 0; }
.lb-permpt.is-center { top: 50%; left: 50%; transform: translate(-50%, -50%); align-items: center; }
.msg-camhelp-code { display: block; margin: -2px 0 10px; font: 500 .68rem/1.3 ui-monospace, monospace; color: #94a3b8; word-break: break-word; }

/* ═══ v3: истории, поиск, группы ═══ */
.msg-stories { margin: -4px 0 4px; }
.msg-stories[hidden] { display: none; }
.msg-ava--group { background: linear-gradient(135deg, #fb923c, #ea580c 45%, #2563eb) !important; font-size: .9rem !important; }
.msg-ttl[data-m="info"] { cursor: pointer; }
.msg-hbtn { flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 12px; display: grid; place-items: center; background: #f1f5f9; color: #475569; font: 800 1.1rem/1 var(--font-body, inherit); cursor: pointer; }
.msg-hbtn:hover { background: #e2e8f0; color: var(--m-blue); }
.msg-hbtn[hidden] { display: none; }
.msg mark { background: #fde68a; color: inherit; border-radius: 4px; padding: 0 1px; }
.msg-s-note { padding: 10px 12px 14px; font-size: .82rem; color: #94a3b8; }
.msg-hit .msg-room-t small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* поиск в открытом чате */
.msg-cs { flex: 0 0 auto; position: relative; z-index: 3; border-bottom: 1px solid var(--m-line); background: rgba(255, 255, 255, .96); }
.msg-cs[hidden] { display: none; }
.msg-cs-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.msg-cs-bar .msg-search { flex: 1; margin: 0; }
.msg-cs-x { flex: 0 0 auto; border: 0; background: none; color: var(--m-blue); font: 700 .88rem var(--font-body, inherit); cursor: pointer; padding: 8px; }
.msg-cs-res { max-height: min(46vh, 360px); overflow-y: auto; padding: 0 8px 8px; }
.msg-cs-res:empty { display: none; }
.msg-cs-n { padding: 2px 8px 6px; font: 700 .72rem var(--font-body, inherit); color: #94a3b8; }
.msg-cs-hit { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.msg-cs-hit:hover { background: rgba(37, 99, 235, .06); }
.msg-cs-hit b { font: 700 .82rem var(--font-body, inherit); color: #0f172a; }
.msg-cs-hit time { font-size: .7rem; color: #94a3b8; }
.msg-cs-hit span { grid-column: 1 / -1; font-size: .84rem; color: #475569; line-height: 1.4; }
/* новый чат / группа */
.msg-pick-tabs { display: flex; gap: 6px; margin: 0 14px 10px; padding: 4px; border-radius: 14px; background: #f1f5f9; }
.msg-pick-tabs[hidden] { display: none; }
.msg-pick-tabs button { flex: 1; border: 0; border-radius: 11px; padding: 9px 8px; background: none; font: 700 .85rem var(--font-body, inherit); color: #475569; cursor: pointer; }
.msg-pick-tabs button.on { background: #fff; color: var(--m-blue); box-shadow: 0 2px 8px -3px rgba(15, 23, 42, .25); }
.msg-grp-f { padding: 0 14px 8px; }
.msg-grp-f[hidden] { display: none; }
.msg-grp-f input { width: 100%; height: 44px; border: 0; border-radius: 14px; padding: 0 14px; background: #fff; box-shadow: inset 0 0 0 1.5px #e2e8f0; font: 600 .92rem var(--font-body, inherit); outline: none; }
.msg-grp-f input:focus { box-shadow: inset 0 0 0 1.5px #3b82f6, 0 0 0 4px rgba(59, 130, 246, .12); }
.msg-pick label.msg-search[hidden] { display: none; }
.msg-grp-go { padding: 10px 14px; border-top: 1px solid var(--m-line); }
.msg-grp-go[hidden] { display: none; }
.msg-grp-go .btn { width: 100%; justify-content: center; }
.msg-grp-go .btn:disabled { opacity: .55; cursor: default; }
.msg-picked { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 10px; scrollbar-width: none; }
.msg-picked button { flex: none; display: grid; justify-items: center; gap: 3px; width: 56px; position: relative; border: 0; background: none; cursor: pointer; font: 600 .68rem var(--font-body, inherit); color: #334155; }
.msg-picked .msg-ava { width: 42px; height: 42px; border-radius: 14px; }
.msg-picked span { max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-picked i { position: absolute; top: -2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: #64748b; color: #fff; font: 800 .7rem/1 system-ui; font-style: normal; border: 2px solid #fff; }
.msg-chk { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cbd5e1; transition: .15s; }
.msg-person.is-on .msg-chk { border-color: var(--m-blue); background: var(--m-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.msg-person.is-on { background: rgba(37, 99, 235, .06); }
/* о группе */
.msg-ginfo { padding: 4px 6px 6px; }
.msg-ginfo-top { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; }
.msg-ginfo-top .msg-ava { width: 56px; height: 56px; border-radius: 18px; font-size: 1.1rem !important; }
.msg-ginfo-top b { display: block; font: 800 1.1rem var(--font-display, inherit); color: #0f172a; }
.msg-ginfo-top small { color: var(--m-muted); font-size: .8rem; }
.msg-ginfo-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.msg-gbtn { flex: 1; min-width: 110px; border: 0; border-radius: 12px; padding: 10px 12px; background: #eff6ff; color: var(--m-blue); font: 700 .84rem var(--font-body, inherit); cursor: pointer; }
.msg-gbtn--warn { background: #fef2f2; color: #dc2626; }
.msg-mem { cursor: default; }
.msg-mem em { font-style: normal; font-weight: 600; color: #94a3b8; font-size: .78rem; }
.msg-mem-x { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 10px; background: #f1f5f9; color: #64748b; font-size: 1.1rem; cursor: pointer; }
.msg-mem-x:hover { background: #fee2e2; color: #dc2626; }

/* плавная полоса проигрывания голосового */
.msg-wave { position: relative; }
.msg-wave-hl { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; pointer-events: none; clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0); }
.msg-wave-hl i { background: #2563eb !important; }
.msg-m.me .msg-wave-hl i { background: #fff !important; }
/* игра в чате */
.msg-pg-btn { font-size: 1.15rem; }
.msg-m.md-pg .msg-bub { padding: 6px; }
.msg-pg-c { display: grid; gap: 6px; width: 100%; box-sizing: border-box; padding: 12px 14px; border: 0; border-radius: 16px; text-align: left; cursor: pointer; font: inherit; color: #fff;
  background: radial-gradient(circle at 100% 0%, rgba(251,146,60,.55), transparent 55%), linear-gradient(135deg, #1e3a8a, #0f172a); box-shadow: 0 12px 26px -14px rgba(15,23,42,.8); }
.msg-pg-c:hover { transform: translateY(-1px); }
.msg-pg-c.is-load { color: #cbd5e1; }
.msg-pg-c.is-off { filter: grayscale(.8); opacity: .75; }
.msg-pg-c.is-live { box-shadow: 0 0 0 2px #22c55e, 0 12px 26px -14px rgba(15,23,42,.8); }
.msg-pg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-pg-top b { font: 800 1rem var(--font-display, inherit); }
.msg-pg-ball { font-size: 1.3rem; }
.msg-pg-priv { font-style: normal; font: 700 .66rem var(--font-body, inherit); padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.14); }
.msg-pg-row { font-size: .84rem; color: #e2e8f0; }
.msg-pg-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.15); overflow: hidden; }
.msg-pg-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #fb923c, #f97316); }
.msg-pg-foot { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: #cbd5e1; }
.msg-pg-foot em { font-style: normal; font-weight: 800; color: #fdba74; }
.msg-m.md-pg .msg-bub { width: 290px !important; max-width: calc(100vw - 80px) !important; }
.msg-m.md-pg .msg-txt { width: 100%; }
.msg-m.md-pg { max-width: 92%; }
.msg-m.md-pg .msg-bub { flex: 0 1 300px; }

/* ═══ анимированные эмодзи (emofx.js) ═══ */
.msg-m.emo .emo-a { position: relative; display: inline-grid; place-items: center; vertical-align: bottom; cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none; }
.msg-m.emo .emo-a > b { font-weight: 400; display: block; line-height: 1; transition: opacity .15s; }
.msg-m.emo-big .msg-txt { font-size: 0; line-height: 0; display: flex; gap: 2px; flex-wrap: wrap; }
.msg-m.emo-big .emo-a { width: 112px; height: 112px; }
.msg-m.emo-big.emo-n2 .emo-a { width: 88px; height: 88px; }
.msg-m.emo-big.emo-n3 .emo-a { width: 72px; height: 72px; }
.msg-m.emo-big .emo-a > b { font-size: 80px; }
.msg-m.emo-big.emo-n2 .emo-a > b { font-size: 62px; }
.msg-m.emo-big.emo-n3 .emo-a > b { font-size: 50px; }
.msg-m.emo-mid .emo-a > b { font-size: 2.2rem; }
.emo-a .emo-lt { position: absolute; inset: 0; display: block; pointer-events: none; }
.emo-a .emo-lt svg { display: block; width: 100% !important; height: 100% !important; }
.emo-a.emo-live > b { opacity: 0; }
.emo-bnc > b { animation: emoBnc .9s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes emoBnc { 0% { transform: scale(.4) translateY(10px); } 45% { transform: scale(1.18) translateY(-10px) rotate(-6deg); } 70% { transform: scale(.94) rotate(4deg); } 100% { transform: none; } }
@media (max-width: 600px) { .msg-m.emo-big .emo-a { width: 96px; height: 96px; } .msg-m.emo-big .emo-a > b { font-size: 68px; } }
/* слой эффектов поверх всего */
.emo-fx { position: fixed; inset: 0; pointer-events: none; z-index: 16000; overflow: hidden; }
.emo-fx .emo-huge, .emo-fx .emo-rx { position: fixed; display: block; transition: opacity .25s, transform .25s; filter: drop-shadow(0 18px 30px rgba(15, 23, 42, .25)); }
.emo-fx .emo-huge { animation: emoIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.emo-fx .out { opacity: 0; transform: scale(.85); }
.emo-fx .emo-a > b { display: none; }
@keyframes emoIn { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.emo-p { position: fixed; display: block; font-style: normal; font-size: 30px; line-height: 1; margin: -15px 0 0 -15px; opacity: 0;
  animation: emoP var(--t, 1.2s) cubic-bezier(.15, .7, .3, 1) var(--dl, 0s) forwards; }
.emo-p.sm { font-size: 18px; margin: -9px 0 0 -9px; }
.emo-p.conf { width: 9px; height: 14px; border-radius: 2px; margin: -7px 0 0 -4px; }
@keyframes emoP { 0% { opacity: 1; transform: translate(0, 0) scale(.3) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 60px)) scale(var(--s)) rotate(var(--r)); } }
.msg-rx button.rx-pop { animation: rxPop .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes rxPop { 0% { transform: scale(.6); } 50% { transform: scale(1.25); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .emo-bnc > b, .emo-p, .msg-rx button.rx-pop, .emo-fx .emo-huge { animation: none !important; } }
/* эмодзи Google Noto — картинками, одинаково на всех устройствах */
img.emj { display: inline-block; width: 1.22em; height: 1.22em; margin: 0 .04em; vertical-align: -.24em; object-fit: contain; pointer-events: none; user-select: none; }
.emo-a > b > img.emj-big { display: block; width: 100%; height: 100%; margin: 0; vertical-align: 0; }
.msg-m.emo-big .emo-a > b { width: 100%; height: 100%; font-size: 0 !important; }
.msg-m.emo-mid .emo-a > b { font-size: 2.2rem; }
/* иконки Phosphor в мессенджере: значки чатов клуба, карточка игры */
.msg-ava--room .lbi-ic { width: 55%; height: 55%; color: #fff; }
.msg-pg-priv { display: inline-flex; align-items: center; gap: 4px; }
.msg-pg-priv .lbi-ic { width: 12px; height: 12px; }
.msg-pg-row { display: flex; align-items: center; gap: 6px; }
.msg-pg-row .lbi-ic { width: 16px; height: 16px; flex: none; opacity: .9; }
.msg-gate-ic .lbi-ic { width: 40px; height: 40px; color: #2563eb; }
.msg-pg-ball .lb-ball { width: 26px; height: 26px; display: block; }
.msg-pg-btn .lb-ball { width: 24px; height: 24px; }
.msg-ava--room .lb-ball { width: 62%; height: 62%; }
/* иконки Lucide: значки чатов клуба, пустой экран */
.msg-ava--room .luc-ic { width: 52%; height: 52%; color: #fff; }
.msg-empty-ic .luc-ic { width: 36px; height: 36px; color: #2563eb; }
.msg-mic .luc-ic { width: 21px; height: 21px; }
.msg-emo-btn .luc-ic { width: 22px; height: 22px; }
.msg-gate-ic .luc-ic { width: 36px; height: 36px; color: #2563eb; }

/* ═══ наш набор стикеров (stickers/p-*.webp) и анимация отправки ═══ */
.msg-stk-cell--p img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(15, 23, 42, .18)); transition: transform .18s cubic-bezier(.34, 1.56, .64, 1); }
.msg-stk-cell--p:hover img { transform: scale(1.08) rotate(-3deg); }
.msg-stk-w { position: relative; display: inline-block; cursor: pointer; line-height: 0; }
.msg-stk-w .msg-stk-img--p { position: relative; z-index: 2; width: 200px; height: 200px; max-width: 58vw; max-height: 58vw; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(15, 23, 42, .25)); transform-origin: 50% 80%; }
.msg-m.stk-p .msg-bub { background: none !important; box-shadow: none !important; padding: 0 !important; }
.msg-stk-w .stk-ring, .msg-stk-w .stk-burst { position: absolute; left: 50%; top: 50%; pointer-events: none; z-index: 1; opacity: 0; }
.msg-stk-w .stk-ring { width: 70%; height: 70%; margin: -35% 0 0 -35%; border-radius: 50%; border: 6px solid #f97316; box-shadow: 0 0 0 4px rgba(37, 99, 235, .45), 0 0 30px rgba(249, 115, 22, .6); }
.msg-stk-w .stk-burst { width: 0; height: 0; z-index: 3; }
.msg-stk-w .stk-burst b { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fdba74, #f97316 55%, #c2410c); box-shadow: 0 0 10px rgba(249, 115, 22, .7); transform: rotate(var(--a)) translateY(0) scale(0); }
.msg-stk-w .stk-burst b:nth-child(3n) { background: radial-gradient(circle, #fff, #93c5fd 50%, #2563eb); box-shadow: 0 0 10px rgba(37, 99, 235, .8); width: 13px; height: 13px; left: -6px; top: -6px; }
.msg-stk-w .stk-burst b:nth-child(4n) { background: #fde047; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); box-shadow: none; }
/* сама анимация: стикер «вылетает» с поворотом и отскоком, кольцо расходится, искры разлетаются, потом лёгкое покачивание */
.msg-stk-w.is-new .msg-stk-img--p { animation: stkPop .9s cubic-bezier(.2, 1.4, .4, 1) both, stkWiggle .9s .9s ease-in-out 1; }
.msg-stk-w.is-new .stk-ring { animation: stkRing .7s .12s ease-out both; }
.msg-stk-w.is-new .stk-burst { opacity: 1; }
.msg-stk-w.is-new .stk-burst b { animation: stkSpark .85s .15s cubic-bezier(.15, .8, .3, 1) both; }
.msg-m.me .msg-stk-w.is-new .msg-stk-img--p { animation-name: stkPopMe, stkWiggle; }
@keyframes stkPop { 0% { opacity: 0; transform: translate(-40px, 60px) scale(.15) rotate(-35deg); } 55% { opacity: 1; transform: translate(0, -10px) scale(1.18) rotate(8deg); } 75% { transform: scale(.94) rotate(-4deg); } 100% { opacity: 1; transform: none; } }
@keyframes stkPopMe { 0% { opacity: 0; transform: translate(40px, 60px) scale(.15) rotate(35deg); } 55% { opacity: 1; transform: translate(0, -10px) scale(1.18) rotate(-8deg); } 75% { transform: scale(.94) rotate(4deg); } 100% { opacity: 1; transform: none; } }
@keyframes stkWiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-4deg) scale(1.02); } 50% { transform: rotate(3deg); } 75% { transform: rotate(-1.5deg); } }
@keyframes stkRing { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes stkSpark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(0); } 30% { opacity: 1; transform: rotate(var(--a)) translateY(calc(var(--d) * -.6)) scale(var(--s)); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(.2); } }
@media (prefers-reduced-motion: reduce) { .msg-stk-w.is-new .msg-stk-img--p, .msg-stk-w.is-new .stk-ring, .msg-stk-w.is-new .stk-burst b { animation: none !important; } }
/* телефон: переписка в кабинете на весь экран — кнопки шапки кабинета (Выйти, ×) прятались под шапкой чата и давали «двойной крестик».
   Теперь их нет, а свой крестик (закрыть кабинет) — в шапке чата */
.lbp-sheet.msg-full .lbp-head-btns { display: none !important; }
.lbp-sheet.msg-full #lbpMsgs .msg-close { display: grid !important; }
/* телефон: у окна мессенджера свой крестик в шапке (список чатов — .msg-winx, переписка — .msg-close);
   общий плавающий крестик окна (.msgw-x) не показываем — раньше правило «display: grid !important» выше возвращало его, и крестиков было два */
@media (max-width: 759px) { .msgw .msgw-x { display: none !important; } }
