/* LMe mobile premium stage 3 — v569 */
@media (pointer: coarse), (max-width: 760px) {
  html.lme-mobile-stage3-v569 {
    --lme-stage3-ease: cubic-bezier(.2,.8,.2,1);
    --lme-stage3-spring: cubic-bezier(.16,1,.3,1);
    --lme-stage3-fast: 150ms;
    --lme-stage3-normal: 230ms;
    --lme-stage3-slow: 320ms;
  }

  html.lme-mobile-stage3-v569,
  html.lme-mobile-stage3-v569 body {
    overscroll-behavior-x: none;
  }

  /* Profile: direct manipulation, parallax and compact header */
  .lme-mobile-stage3-v569 #participantProfileModal,
  .lme-mobile-stage3-v569 #communityProfileModal {
    --lme-stage3-profile-backdrop: 1;
    background: rgb(0 0 0 / calc(.56 * var(--lme-stage3-profile-backdrop)));
    transition: background-color var(--lme-stage3-normal) var(--lme-stage3-ease);
  }

  .lme-mobile-stage3-v569 #participantProfileCard,
  .lme-mobile-stage3-v569 #communityProfileCard {
    --lme-stage3-profile-y: 0px;
    --lme-stage3-profile-scale: 1;
    transform: translate3d(0,var(--lme-stage3-profile-y),0) scale(var(--lme-stage3-profile-scale)) !important;
    transform-origin: 50% 100%;
    will-change: transform;
    contain: layout style;
  }

  .lme-mobile-stage3-v569 .is-stage3-profile-dragging-v569 #participantProfileCard,
  .lme-mobile-stage3-v569 .is-stage3-profile-dragging-v569 #communityProfileCard,
  .lme-mobile-stage3-v569 #participantProfileCard.is-stage3-profile-dragging-v569,
  .lme-mobile-stage3-v569 #communityProfileCard.is-stage3-profile-dragging-v569 {
    transition: none !important;
  }

  .lme-mobile-stage3-v569 .is-stage3-profile-snap-v569,
  .lme-mobile-stage3-v569 .is-stage3-profile-finishing-v569 {
    transition: transform var(--lme-stage3-normal) var(--lme-stage3-spring) !important;
  }

  .lme-mobile-stage3-v569 .profile-sheet-handle {
    width: 42px !important;
    height: 5px !important;
    border-radius: 999px !important;
    opacity: .58;
  }

  .lme-mobile-stage3-v569 .profile-modal-cover {
    transform: translate3d(0, calc(var(--lme-stage3-profile-scroll, 0px) * -.18), 0);
    transform-origin: 50% 0;
    transition: border-radius var(--lme-stage3-normal) var(--lme-stage3-ease);
    will-change: transform;
  }

  .lme-mobile-stage3-v569 .profile-modal-avatar-shell {
    transform: translate3d(0, calc(var(--lme-stage3-profile-scroll, 0px) * -.10), 0)
      scale(var(--lme-stage3-profile-avatar-scale, 1));
    transform-origin: 50% 100%;
    will-change: transform;
  }

  .lme-mobile-stage3-v569 .is-stage3-profile-condensed-v569 .profile-modal-cover {
    border-radius: 0 0 24px 24px !important;
  }

  .lme-mobile-stage3-v569 .profile-modal-nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 8 !important;
    background: color-mix(in srgb, var(--surface-container, #19191f) 88%, transparent) !important;
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    backdrop-filter: blur(16px) saturate(1.15);
  }

  .lme-mobile-stage3-v569 .profile-modal-panels {
    --lme-stage3-tab-x: 0px;
    --lme-stage3-tab-opacity: 1;
    transform: translate3d(var(--lme-stage3-tab-x),0,0);
    opacity: var(--lme-stage3-tab-opacity);
    will-change: transform, opacity;
  }

  .lme-mobile-stage3-v569 .profile-modal-panels.is-stage3-tab-dragging-v569 { transition: none !important; }
  .lme-mobile-stage3-v569 .profile-modal-panels.is-stage3-tab-snap-v569 {
    transition: transform var(--lme-stage3-normal) var(--lme-stage3-spring), opacity var(--lme-stage3-fast) linear !important;
  }

  /* Main menu becomes a proper edge drawer */
  .lme-mobile-stage3-v569 #mainMenuPopover {
    --lme-stage3-menu-x: 0%;
    position: fixed !important;
    inset: max(8px, env(safe-area-inset-top)) auto max(8px, env(safe-area-inset-bottom)) 8px !important;
    width: min(86vw, 348px) !important;
    max-width: calc(100vw - 28px) !important;
    max-height: none !important;
    height: auto !important;
    border-radius: 26px !important;
    transform: translate3d(var(--lme-stage3-menu-x),0,0) !important;
    transform-origin: 0 50%;
    z-index: 10030 !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    box-shadow: 0 24px 70px rgb(0 0 0 / .40), 0 0 0 1px rgb(255 255 255 / .07) !important;
    will-change: transform;
  }

  .lme-mobile-stage3-v569 #mainMenuPopover.is-stage3-dragging-v569 { transition: none !important; }
  .lme-mobile-stage3-v569 #mainMenuPopover.is-stage3-menu-snap-v569 {
    transition: transform var(--lme-stage3-normal) var(--lme-stage3-spring) !important;
  }

  .lme-mobile-stage3-v569 #lmeMobileStage3BackdropV569 {
    --lme-stage3-backdrop-opacity: 1;
    position: fixed;
    inset: 0;
    z-index: 10020;
    border: 0;
    padding: 0;
    background: rgb(0 0 0 / calc(.48 * var(--lme-stage3-backdrop-opacity)));
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 1;
    touch-action: none;
    transition: opacity var(--lme-stage3-normal) var(--lme-stage3-ease);
  }

  .lme-mobile-stage3-v569 #lmeMobileStage3BackdropV569.hidden {
    display: none !important;
    opacity: 0;
  }

  .lme-mobile-stage3-v569 body.lme-stage3-menu-open-v569 #sidebarMenuBtn {
    background: color-mix(in srgb, var(--primary, #9d8cff) 20%, transparent) !important;
  }

  /* Call panel gestures and premium mobile call layout */
  .lme-mobile-stage3-v569 #callPanel {
    --lme-stage3-call-y: 0px;
    --lme-stage3-call-scale: 1;
    --lme-stage3-call-opacity: 1;
    transform: translate3d(0,var(--lme-stage3-call-y),0) scale(var(--lme-stage3-call-scale)) !important;
    opacity: var(--lme-stage3-call-opacity);
    transform-origin: 50% 100%;
    will-change: transform, opacity;
  }

  .lme-mobile-stage3-v569 #callPanel.is-stage3-call-dragging-v569 { transition: none !important; }
  .lme-mobile-stage3-v569 #callPanel.is-stage3-call-snap-v569 {
    transition: transform var(--lme-stage3-normal) var(--lme-stage3-spring), opacity var(--lme-stage3-fast) linear !important;
  }

  .lme-mobile-stage3-v569 #callPanel .call-panel-top::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 8px;
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: currentColor;
    opacity: .24;
    transform: translateX(-50%);
  }

  .lme-mobile-stage3-v569 #callPanel .call-stage-main {
    --lme-stage3-call-decision-x: 0px;
    transform: translate3d(var(--lme-stage3-call-decision-x),0,0);
    will-change: transform;
  }

  .lme-mobile-stage3-v569 #callPanel.is-stage3-call-decision-v569 .call-stage-main { transition: none !important; }
  .lme-mobile-stage3-v569 #callPanel .call-stage-main.is-stage3-call-decision-snap-v569 {
    transition: transform var(--lme-stage3-normal) var(--lme-stage3-spring) !important;
  }

  .lme-mobile-stage3-v569 #callPanel[data-stage3-call-decision='accept']::before,
  .lme-mobile-stage3-v569 #callPanel[data-stage3-call-decision='reject']::after {
    position: absolute;
    top: 50%;
    z-index: 12;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 900;
    opacity: var(--lme-stage3-call-decision-progress, 0);
    transform: translateY(-50%) scale(calc(.72 + var(--lme-stage3-call-decision-progress, 0) * .28));
    pointer-events: none;
  }

  .lme-mobile-stage3-v569 #callPanel[data-stage3-call-decision='accept']::before {
    content: '✓';
    left: 18px;
    color: #d8ffe5;
    background: rgb(31 176 91 / .86);
  }

  .lme-mobile-stage3-v569 #callPanel[data-stage3-call-decision='reject']::after {
    content: '×';
    right: 18px;
    color: #ffe6e6;
    background: rgb(215 66 72 / .88);
  }

  .lme-mobile-stage3-v569 #callAudioControls {
    --lme-stage3-settings-y: 0px;
    transform: translate3d(0,var(--lme-stage3-settings-y),0) !important;
    will-change: transform;
  }
  .lme-mobile-stage3-v569 #callAudioControls.is-stage3-settings-dragging-v569 { transition: none !important; }
  .lme-mobile-stage3-v569 #callAudioControls.is-stage3-settings-snap-v569 {
    transition: transform var(--lme-stage3-normal) var(--lme-stage3-spring) !important;
  }
  .lme-mobile-stage3-v569 #callAudioControls::before {
    content: '';
    display: block;
    width: 42px;
    height: 5px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: currentColor;
    opacity: .22;
  }

  .lme-mobile-stage3-v569 #callMiniBar {
    --lme-stage3-mini-x: 0px;
    --lme-stage3-mini-y: 0px;
    transform: translate3d(var(--lme-stage3-mini-x),var(--lme-stage3-mini-y),0) !important;
    touch-action: none;
    will-change: transform;
    max-width: min(92vw, 420px) !important;
    box-shadow: 0 16px 42px rgb(0 0 0 / .34), 0 0 0 1px rgb(255 255 255 / .08) !important;
  }
  .lme-mobile-stage3-v569 #callMiniBar.is-stage3-mini-dragging-v569 { transition: none !important; cursor: grabbing; }
  .lme-mobile-stage3-v569 #callMiniBar.is-stage3-mini-snap-v569 {
    transition: transform var(--lme-stage3-normal) var(--lme-stage3-spring) !important;
  }

  .lme-mobile-stage3-v569 #callCameraPip {
    --lme-stage3-pip-x: 0px;
    --lme-stage3-pip-y: 0px;
    transform: translate3d(var(--lme-stage3-pip-x),var(--lme-stage3-pip-y),0) !important;
    touch-action: none;
    will-change: transform;
  }
  .lme-mobile-stage3-v569 #callCameraPip.is-stage3-pip-dragging-v569 { transition: none !important; }
  .lme-mobile-stage3-v569 #callCameraPip.is-stage3-pip-snap-v569 {
    transition: transform var(--lme-stage3-normal) var(--lme-stage3-spring) !important;
  }

  /* Archive direct manipulation, search and list budget */
  .lme-mobile-stage3-v569 #lmeArchiveViewer {
    --lme-stage3-archive-backdrop: 1;
    background: rgb(0 0 0 / calc(.56 * var(--lme-stage3-archive-backdrop)));
  }
  .lme-mobile-stage3-v569 #lmeArchiveViewer .lme-archive-panel {
    --lme-stage3-archive-y: 0px;
    transform: translate3d(0,var(--lme-stage3-archive-y),0) !important;
    transform-origin: 50% 100%;
    will-change: transform;
  }
  .lme-mobile-stage3-v569 #lmeArchiveViewer .lme-archive-panel.is-stage3-archive-dragging-v569 { transition: none !important; }
  .lme-mobile-stage3-v569 #lmeArchiveViewer .lme-archive-panel.is-stage3-archive-snap-v569 {
    transition: transform var(--lme-stage3-normal) var(--lme-stage3-spring) !important;
  }
  .lme-mobile-stage3-v569 .lme-archive-head::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 8px;
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: currentColor;
    opacity: .22;
    transform: translateX(-50%);
  }

  .lme-mobile-stage3-v569 .lme-stage3-archive-search-v569 {
    display: grid;
    grid-template-columns: 22px minmax(0,1fr) 34px;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    margin: 0 12px 8px;
    padding: 0 8px 0 13px;
    border: 1px solid rgb(255 255 255 / .08);
    border-radius: 16px;
    background: rgb(255 255 255 / .055);
  }
  .lme-mobile-stage3-v569 .lme-stage3-archive-search-v569 input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
  }
  .lme-mobile-stage3-v569 .lme-stage3-archive-search-v569 button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 21px;
  }
  .lme-mobile-stage3-v569 .lme-stage3-archive-results-v569 {
    display: grid;
    gap: 6px;
    padding: 4px 10px 18px;
  }
  .lme-mobile-stage3-v569 .lme-archive-list.is-stage3-virtual-v569 > .lme-stage3-virtual-spacer-v569 {
    display: block;
    width: 100%;
    pointer-events: none;
  }
  .lme-mobile-stage3-v569 .lme-archive-list.is-stage3-virtual-v569 .lme-archive-entry {
    min-height: 58px !important;
    max-height: 58px !important;
  }

  /* Toasts follow the finger */
  .lme-mobile-stage3-v569 .toast,
  .lme-mobile-stage3-v569 .app-toast,
  .lme-mobile-stage3-v569 .notification-toast,
  .lme-mobile-stage3-v569 #toast {
    --lme-stage3-toast-x: 0px;
    --lme-stage3-toast-opacity: 1;
    transform: translate3d(var(--lme-stage3-toast-x),0,0) !important;
    opacity: var(--lme-stage3-toast-opacity) !important;
    will-change: transform, opacity;
  }
  .lme-mobile-stage3-v569 .is-stage3-toast-dragging-v569 { transition: none !important; }
  .lme-mobile-stage3-v569 .is-stage3-toast-snap-v569 {
    transition: transform var(--lme-stage3-normal) var(--lme-stage3-spring), opacity var(--lme-stage3-fast) linear !important;
  }

  /* Paint/memory budget for very deep chat history */
  .lme-mobile-stage3-v569 #messages .msg-row.lme-stage3-deep-history-v569 {
    content-visibility: auto;
    contain-intrinsic-size: auto 86px;
  }

  /* Adaptive quality: keep interaction, remove only expensive decoration. */
  .lme-mobile-stage3-v569[data-lme-stage3-quality='balanced'] #mainMenuPopover,
  .lme-mobile-stage3-v569[data-lme-stage3-quality='balanced'] .profile-modal-nav {
    -webkit-backdrop-filter: blur(10px) !important;
    backdrop-filter: blur(10px) !important;
  }

  .lme-mobile-stage3-v569[data-lme-stage3-quality='low'] #mainMenuPopover,
  .lme-mobile-stage3-v569[data-lme-stage3-quality='low'] #lmeMobileStage3BackdropV569,
  .lme-mobile-stage3-v569[data-lme-stage3-quality='low'] .profile-modal-nav {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .lme-mobile-stage3-v569[data-lme-stage3-quality='low'] .profile-modal-cover,
  .lme-mobile-stage3-v569[data-lme-stage3-quality='low'] .profile-modal-avatar-shell {
    transform: none !important;
  }

  @media (orientation: landscape) and (max-height: 520px) {
    .lme-mobile-stage3-v569 #mainMenuPopover {
      width: min(52vw, 340px) !important;
      inset-block: 6px !important;
    }
    .lme-mobile-stage3-v569 #callPanel .call-stage {
      min-height: 0 !important;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .lme-mobile-stage3-v569 #participantProfileCard,
  .lme-mobile-stage3-v569 #communityProfileCard,
  .lme-mobile-stage3-v569 #callPanel,
  .lme-mobile-stage3-v569 #callMiniBar,
  .lme-mobile-stage3-v569 #mainMenuPopover,
  .lme-mobile-stage3-v569 #lmeArchiveViewer .lme-archive-panel {
    transition-duration: 1ms !important;
  }
}
