/* v571: hard-lock the mobile chat header and hamburger geometry.
   Android/WebView must not rely on inline-grid baseline calculations for the three bars. */

@media (max-width: 920px), (pointer: coarse) {
  html.lme-platform-mobile body #chatSidebar .sidebar-top.lme-chat-topbar,
  html[data-lme-platform="mobile"] body #chatSidebar .sidebar-top.lme-chat-topbar,
  body.mobile-ui.mobile-chat-list-mode #chatSidebar .sidebar-top.lme-chat-topbar {
    align-items: center !important;
  }

  html.lme-platform-mobile body #sidebarMenuBtn.lme-burger-btn,
  html[data-lme-platform="mobile"] body #sidebarMenuBtn.lme-burger-btn,
  body.mobile-ui.mobile-chat-list-mode #sidebarMenuBtn.lme-burger-btn {
    position: relative !important;
    align-self: center !important;
    justify-self: center !important;
    display: block !important;
    padding: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
    transform: translate3d(0, 0, 0) !important;
  }

  /* Fixed coordinate system: center of the icon is always the center of the button. */
  html.lme-platform-mobile body #sidebarMenuBtn .lme-burger-lines,
  html[data-lme-platform="mobile"] body #sidebarMenuBtn .lme-burger-lines,
  body.mobile-ui.mobile-chat-list-mode #sidebarMenuBtn .lme-burger-lines {
    position: absolute !important;
    inset: 50% auto auto 50% !important;
    width: 22px !important;
    height: 17px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    line-height: 0 !important;
    transform: translate3d(-50%, -50%, 0) !important;
    transform-origin: center !important;
    pointer-events: none !important;
    overflow: visible !important;
  }

  html.lme-platform-mobile body #sidebarMenuBtn .lme-burger-lines > span,
  html[data-lme-platform="mobile"] body #sidebarMenuBtn .lme-burger-lines > span,
  body.mobile-ui.mobile-chat-list-mode #sidebarMenuBtn .lme-burger-lines > span,
  body.main-menu-popover-open #sidebarMenuBtn .lme-burger-lines > span,
  body.menu-drawer-open #sidebarMenuBtn .lme-burger-lines > span {
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 2.5px !important;
    border-radius: 999px !important;
    opacity: 1 !important;
    transform: translate3d(-50%, 0, 0) rotate(0deg) scale(1) !important;
    transform-origin: center !important;
    will-change: width !important;
  }

  html.lme-platform-mobile body #sidebarMenuBtn .lme-burger-lines > span:nth-child(1),
  html[data-lme-platform="mobile"] body #sidebarMenuBtn .lme-burger-lines > span:nth-child(1),
  body.mobile-ui.mobile-chat-list-mode #sidebarMenuBtn .lme-burger-lines > span:nth-child(1) {
    top: 0 !important;
  }

  html.lme-platform-mobile body #sidebarMenuBtn .lme-burger-lines > span:nth-child(2),
  html[data-lme-platform="mobile"] body #sidebarMenuBtn .lme-burger-lines > span:nth-child(2),
  body.mobile-ui.mobile-chat-list-mode #sidebarMenuBtn .lme-burger-lines > span:nth-child(2) {
    top: 7.25px !important;
  }

  html.lme-platform-mobile body #sidebarMenuBtn .lme-burger-lines > span:nth-child(3),
  html[data-lme-platform="mobile"] body #sidebarMenuBtn .lme-burger-lines > span:nth-child(3),
  body.mobile-ui.mobile-chat-list-mode #sidebarMenuBtn .lme-burger-lines > span:nth-child(3) {
    top: 14.5px !important;
  }

  /* Closed state: equal centered bars. */
  body:not(.main-menu-popover-open):not(.menu-drawer-open) #sidebarMenuBtn .lme-burger-lines > span {
    width: 22px !important;
  }

  /* Open state may change only lengths, never vertical coordinates. */
  body.main-menu-popover-open #sidebarMenuBtn .lme-burger-lines > span:nth-child(1),
  body.menu-drawer-open #sidebarMenuBtn .lme-burger-lines > span:nth-child(1) {
    top: 0 !important;
    width: 15px !important;
  }
  body.main-menu-popover-open #sidebarMenuBtn .lme-burger-lines > span:nth-child(2),
  body.menu-drawer-open #sidebarMenuBtn .lme-burger-lines > span:nth-child(2) {
    top: 7.25px !important;
    width: 22px !important;
  }
  body.main-menu-popover-open #sidebarMenuBtn .lme-burger-lines > span:nth-child(3),
  body.menu-drawer-open #sidebarMenuBtn .lme-burger-lines > span:nth-child(3) {
    top: 14.5px !important;
    width: 18px !important;
  }

  html.lme-platform-mobile body #chatSidebar .lme-chat-title-wrap,
  html[data-lme-platform="mobile"] body #chatSidebar .lme-chat-title-wrap,
  body.mobile-ui.mobile-chat-list-mode #chatSidebar .lme-chat-title-wrap {
    align-self: center !important;
    margin: 0 !important;
    transform: none !important;
  }
}

@media (max-width: 380px) {
  html.lme-platform-mobile body #sidebarMenuBtn .lme-burger-lines,
  html[data-lme-platform="mobile"] body #sidebarMenuBtn .lme-burger-lines {
    width: 20px !important;
    height: 16px !important;
  }
  html.lme-platform-mobile body #sidebarMenuBtn .lme-burger-lines > span,
  html[data-lme-platform="mobile"] body #sidebarMenuBtn .lme-burger-lines > span {
    height: 2.25px !important;
  }
  html.lme-platform-mobile body #sidebarMenuBtn .lme-burger-lines > span:nth-child(2),
  html[data-lme-platform="mobile"] body #sidebarMenuBtn .lme-burger-lines > span:nth-child(2) {
    top: 6.875px !important;
  }
  html.lme-platform-mobile body #sidebarMenuBtn .lme-burger-lines > span:nth-child(3),
  html[data-lme-platform="mobile"] body #sidebarMenuBtn .lme-burger-lines > span:nth-child(3) {
    top: 13.75px !important;
  }
  body:not(.main-menu-popover-open):not(.menu-drawer-open) #sidebarMenuBtn .lme-burger-lines > span {
    width: 20px !important;
  }
}
