/* LMe Mobile Stage 2 v568: gestures, sheets, message actions and render budgets. */
@media (pointer: coarse), (max-width: 820px) {
  html.lme-mobile-stage2-v568,
  html.lme-mobile-stage2-v568 body {
    overscroll-behavior-x: none;
  }

  .lme-mobile-stage2-v568 .chat-card,
  .lme-mobile-stage2-v568 .msg {
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
  }

  .lme-mobile-stage2-v568 .chat-card {
    position: relative;
    isolation: isolate;
    transform: translate3d(var(--lme-chat-swipe-x-v568, 0px), 0, 0);
    will-change: transform;
  }

  .lme-mobile-stage2-v568 .chat-card::before,
  .lme-mobile-stage2-v568 .chat-card::after {
    position: absolute;
    z-index: -1;
    top: 5px;
    bottom: 5px;
    display: grid;
    place-items: center;
    width: 88px;
    border-radius: 22px;
    opacity: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .01em;
    pointer-events: none;
    transition: opacity 120ms ease;
  }

  .lme-mobile-stage2-v568 .chat-card::before {
    content: attr(data-lme-swipe-label-v568);
    right: calc(100% + 8px);
    color: #1c1230;
    background: linear-gradient(135deg, #d9c3ff, #b996ff);
  }

  .lme-mobile-stage2-v568 .chat-card::after {
    content: "Действия";
    left: calc(100% + 8px);
    color: #f5edff;
    background: linear-gradient(135deg, #40364f, #28232f);
  }

  .lme-mobile-stage2-v568 .chat-card[data-lme-swipe-direction-v568="right"]::before,
  .lme-mobile-stage2-v568 .chat-card[data-lme-swipe-direction-v568="left"]::after {
    opacity: 1;
  }

  .lme-mobile-stage2-v568 .chat-card[data-lme-swipe-armed-v568]::before,
  .lme-mobile-stage2-v568 .chat-card[data-lme-swipe-armed-v568]::after {
    box-shadow: 0 10px 30px rgba(158, 115, 255, .25);
  }

  .lme-mobile-stage2-v568 .chat-card.is-chat-unread-v568 {
    background: linear-gradient(135deg, rgba(123, 84, 185, .30), rgba(38, 30, 52, .94));
  }

  .lme-mobile-stage2-v568 .chat-card.is-chat-pinned-v568 {
    order: -1;
  }

  .lme-mobile-stage2-v568 .chat-card.is-chat-muted-v568 .chat-snippet,
  .lme-mobile-stage2-v568 .chat-card.is-chat-muted-v568 .chat-presence {
    opacity: .68;
  }

  .lme-mobile-stage2-v568 .chat-card-mobile-state-v568 {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-height: 12px;
  }

  .lme-mobile-stage2-v568 .chat-state-pin-v568,
  .lme-mobile-stage2-v568 .chat-state-muted-v568 {
    display: inline-grid;
    place-items: center;
    width: 13px;
    height: 13px;
    color: rgba(220, 201, 255, .8);
    font-size: 9px;
    line-height: 1;
  }

  .lme-mobile-stage2-v568 .chat-state-unread-v568 {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c7a8ff;
    box-shadow: 0 0 0 4px rgba(190, 154, 255, .12);
  }

  .lme-mobile-stage2-v568 .msg {
    position: relative;
    transform: translate3d(var(--lme-message-reply-x-v568, 0px), 0, 0);
    will-change: transform;
  }

  .lme-mobile-stage2-v568 .msg::before {
    content: "↩";
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #eadfff;
    background: rgba(91, 68, 125, .92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    opacity: clamp(0, calc(var(--lme-message-reply-x-v568, 0px) / 50px), 1);
    transform: translateY(-50%) scale(clamp(.78, calc(var(--lme-message-reply-x-v568, 0px) / 54px), 1));
    pointer-events: none;
  }

  .lme-mobile-stage2-v568 .msg[data-lme-reply-armed-v568]::before {
    color: #231730;
    background: #c8a9ff;
  }

  .lme-mobile-stage2-v568 .chat-card.is-long-pressing-v568,
  .lme-mobile-stage2-v568 .msg.is-long-pressing-v568 {
    filter: brightness(1.08);
  }

  .lme-mobile-stage2-v568 .lme-mobile-snap-v568 {
    transition: transform 190ms cubic-bezier(.16, 1, .3, 1), opacity 190ms ease !important;
  }

  .lme-mobile-stage2-v568 .lme-mobile-action-sheet-v568 {
    position: fixed;
    inset: 0;
    z-index: 12050;
    display: grid;
    align-items: end;
    pointer-events: none;
  }

  .lme-mobile-stage2-v568 .lme-mobile-action-sheet-v568.hidden {
    display: none !important;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-backdrop-v568 {
    position: absolute;
    inset: 0;
    background: rgba(4, 3, 8, .58);
    opacity: 0;
    backdrop-filter: blur(6px);
    transition: opacity 210ms ease;
    pointer-events: auto;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-card-v568 {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(100%, 560px);
    max-height: min(76dvh, 680px);
    margin: 0 auto;
    padding: 8px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    overflow: auto;
    border: 1px solid rgba(195, 169, 238, .22);
    border-radius: 28px 28px 0 0;
    background: linear-gradient(180deg, rgba(33, 28, 43, .99), rgba(18, 16, 24, .995));
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .42);
    opacity: var(--lme-sheet-drag-opacity-v568, 1);
    transform: translate3d(0, calc(100% + var(--lme-sheet-drag-y-v568, 0px)), 0);
    transition: transform 260ms cubic-bezier(.16, 1, .3, 1), opacity 180ms ease;
    pointer-events: auto;
  }

  .lme-mobile-stage2-v568 .lme-mobile-action-sheet-v568.is-open-v568 .lme-mobile-sheet-backdrop-v568 {
    opacity: 1;
  }

  .lme-mobile-stage2-v568 .lme-mobile-action-sheet-v568.is-open-v568 .lme-mobile-sheet-card-v568 {
    transform: translate3d(0, var(--lme-sheet-drag-y-v568, 0px), 0);
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-handle-v568 {
    width: 42px;
    height: 5px;
    margin: 2px auto 10px;
    border-radius: 999px;
    background: rgba(218, 199, 245, .34);
    flex: 0 0 auto;
    touch-action: none;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-head-v568 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 2px 14px;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-head-v568 div {
    display: grid;
    gap: 3px;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-head-v568 small {
    color: rgba(216, 203, 231, .62);
    font-size: 12px;
    font-weight: 700;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-head-v568 strong {
    overflow: hidden;
    color: #fff;
    font-size: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-close-v568 {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(216, 195, 245, .18);
    border-radius: 15px;
    color: #eee7f5;
    background: rgba(255, 255, 255, .055);
    font-size: 25px;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-actions-v568 {
    display: grid;
    gap: 9px;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-actions-v568 > button {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 70px;
    padding: 10px 13px;
    border: 1px solid rgba(210, 189, 238, .15);
    border-radius: 20px;
    color: #f8f4ff;
    text-align: left;
    background: rgba(255, 255, 255, .045);
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-actions-v568 > button:active {
    background: rgba(199, 169, 255, .14);
    transform: scale(.985);
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-actions-v568 > button > span:last-child {
    display: grid;
    min-width: 0;
    gap: 3px;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-actions-v568 strong {
    font-size: 15px;
  }

  .lme-mobile-stage2-v568 .lme-mobile-sheet-actions-v568 small {
    color: rgba(223, 211, 235, .62);
    font-size: 12px;
  }

  .lme-mobile-stage2-v568 .lme-stage2-action-icon-v568 {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    color: #d8c0ff;
    background: rgba(162, 117, 231, .16);
    font-size: 18px;
  }

  .lme-mobile-stage2-v568 #messageContextMenu.mobile-sheet,
  .lme-mobile-stage2-v568 #reactionPicker.reaction-picker-mobile,
  .lme-mobile-stage2-v568 #attachSheet .attach-sheet-card,
  .lme-mobile-stage2-v568 #mediaPanel {
    transform: translate3d(0, var(--lme-sheet-drag-y-v568, 0px), 0) !important;
    opacity: var(--lme-sheet-drag-opacity-v568, 1);
    will-change: transform;
  }

  .lme-mobile-stage2-v568 #messageContextMenu.mobile-sheet {
    inset: auto 8px max(8px, env(safe-area-inset-bottom, 0px)) !important;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: auto !important;
    max-height: min(82dvh, 650px);
    padding: 8px 10px 12px !important;
    overflow: auto;
    border-radius: 26px !important;
  }

  .lme-mobile-stage2-v568 #messageContextMenu.mobile-sheet > .lme-mobile-sheet-handle-v568,
  .lme-mobile-stage2-v568 #messageContextMenu.mobile-sheet > .lme-mobile-quick-reactions-v568 {
    grid-column: 1 / -1;
  }

  .lme-mobile-stage2-v568 #messageContextMenu.mobile-sheet .message-context-item {
    min-height: 54px;
    padding: 10px 11px;
    border-radius: 16px;
  }

  .lme-mobile-stage2-v568 .lme-mobile-quick-reactions-v568 {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    padding: 2px 0 8px;
  }

  .lme-mobile-stage2-v568 .lme-mobile-quick-reactions-v568 button {
    display: grid;
    place-items: center;
    min-width: 0;
    height: 46px;
    border: 1px solid rgba(216, 195, 245, .14);
    border-radius: 15px;
    background: rgba(255, 255, 255, .045);
    font-size: 21px;
  }

  .lme-mobile-stage2-v568 .voice-composer-card {
    transform: translateZ(0);
  }

  .lme-mobile-stage2-v568 .voice-composer-card::after {
    content: "← отмена     ↑ закрепить";
    display: block;
    margin-top: 7px;
    color: rgba(225, 211, 241, .58);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    letter-spacing: .02em;
  }

  .lme-mobile-stage2-v568 .voice-composer-panel[data-voice-state="cancel"] .voice-composer-card,
  .lme-mobile-stage2-v568 .voice-composer-panel[data-voice-state="cancel-armed"] .voice-composer-card {
    border-color: rgba(255, 126, 146, .55);
    background: linear-gradient(135deg, rgba(91, 38, 51, .96), rgba(36, 25, 34, .98));
  }

  .lme-mobile-stage2-v568 .voice-composer-panel[data-voice-state="locked"] .voice-composer-card {
    border-color: rgba(194, 160, 255, .48);
    box-shadow: 0 18px 55px rgba(113, 75, 173, .24);
  }

  .lme-mobile-stage2-v568 #lmeImageViewer,
  .lme-mobile-stage2-v568 #lmeVideoViewerV446 {
    --lme-viewer-dismiss-y-v568: 0px;
    --lme-viewer-dismiss-progress-v568: 0;
    background: rgba(5, 4, 8, calc(.96 - var(--lme-viewer-dismiss-progress-v568) * .62)) !important;
  }

  .lme-mobile-stage2-v568 #lmeImageViewer [data-lme-image-viewer-shell],
  .lme-mobile-stage2-v568 #lmeVideoViewerV446 [data-lme-video-viewer-shell-v446] {
    transform: translate3d(0, var(--lme-viewer-dismiss-y-v568), 0) scale(calc(1 - var(--lme-viewer-dismiss-progress-v568) * .08));
    will-change: transform;
  }

  .lme-mobile-stage2-v568 #lmeImageViewer .lme-image-viewer-hint {
    font-size: 0;
  }

  .lme-mobile-stage2-v568 #lmeImageViewer .lme-image-viewer-hint::after {
    content: "Двумя пальцами — масштаб · свайп вниз — закрыть";
    font-size: 12px;
  }

  .lme-mobile-stage2-v568 #messages .msg-row.lme-content-budget-v568 {
    content-visibility: auto;
    contain: layout paint style;
  }

  .lme-mobile-stage2-v568 #messages .msg-row.lme-content-budget-v568 {
    contain-intrinsic-size: auto 82px;
  }

  .lme-mobile-stage2-v568 #chatList .chat-card {
    contain: layout style;
  }

  .lme-mobile-stage2-v568.lme-mobile-tier-low-v567 #messageContextMenu.mobile-sheet,
  .lme-mobile-stage2-v568.lme-mobile-tier-low-v567 .lme-mobile-sheet-backdrop-v568 {
    backdrop-filter: none !important;
  }

  body.lme-mobile-sheet-open-v568 {
    overflow: hidden !important;
  }
}

@media (max-width: 380px) and (pointer: coarse) {
  .lme-mobile-stage2-v568 #messageContextMenu.mobile-sheet {
    grid-template-columns: 1fr;
  }

  .lme-mobile-stage2-v568 .lme-mobile-quick-reactions-v568 {
    grid-template-columns: repeat(6, 1fr);
  }

  .lme-mobile-stage2-v568 .lme-mobile-quick-reactions-v568 button {
    height: 42px;
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lme-mobile-stage2-v568 .chat-card,
  .lme-mobile-stage2-v568 .msg,
  .lme-mobile-stage2-v568 .lme-mobile-sheet-card-v568,
  .lme-mobile-stage2-v568 #lmeImageViewer [data-lme-image-viewer-shell],
  .lme-mobile-stage2-v568 #lmeVideoViewerV446 [data-lme-video-viewer-shell-v446] {
    transition-duration: 80ms !important;
  }
}
