/* Mobile landscape overlap fixes: Messages FAB, Squad tabs and Inbox actions. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 760px) and (max-width: 1200px) {
  html.gfm-mobile-landscape body #gfmDmDock {
    position: fixed !important;
    top: auto !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    z-index: 100002 !important;
  }

  html.gfm-mobile-landscape body #gfmDmOpen {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 !important;
    border: 1px solid rgba(103, 232, 249, .75) !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    line-height: 1 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .48) !important;
    touch-action: manipulation !important;
  }

  html.gfm-mobile-landscape body #gfmDmOpen::before {
    content: "\2709" !important;
    display: block !important;
    color: #fff !important;
    font-size: 18px !important;
    line-height: 17px !important;
  }

  html.gfm-mobile-landscape body #gfmDmOpen::after {
    content: "MSG" !important;
    display: block !important;
    margin-top: 2px !important;
    color: #dffaff !important;
    font-size: 7px !important;
    font-weight: 900 !important;
    letter-spacing: .08em !important;
  }

  html.gfm-mobile-landscape body #gfmDmBadge {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    min-width: 17px !important;
    height: 17px !important;
    padding: 0 4px !important;
    font-size: 9px !important;
    line-height: 17px !important;
  }

  html.gfm-mobile-landscape body #gfmDmPanel {
    position: absolute !important;
    top: auto !important;
    right: 0 !important;
    bottom: 54px !important;
    width: min(390px, calc(100vw - 20px)) !important;
    height: min(430px, calc(100dvh - 66px)) !important;
    max-height: calc(100dvh - 66px) !important;
    overflow: hidden !important;
  }

  html.gfm-mobile-landscape body #gfmDmBody {
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  html.gfm-mobile-landscape body .gfm-fm-squad-hero {
    padding-right: 8px !important;
  }

  html.gfm-mobile-landscape body .gfm-fm-tabbar {
    max-width: min(100%, 360px) !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
  }

  html.gfm-mobile-landscape body .gfm-fm-tabbar::-webkit-scrollbar {
    display: none !important;
  }

  html.gfm-mobile-landscape body .gfm-fm-tabbar button {
    flex: 0 0 auto !important;
    min-width: 88px !important;
    min-height: 34px !important;
    height: 34px !important;
    padding: 4px 9px !important;
    touch-action: manipulation !important;
  }

  html.gfm-mobile-landscape body .gfm-ib-detail-inner {
    padding-bottom: 68px !important;
  }

  html.gfm-mobile-landscape body .gfm-ib-wactions {
    position: sticky !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 20 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 7px 56px 7px 7px !important;
    border: 1px solid rgba(34, 197, 94, .25) !important;
    border-radius: 11px !important;
    background: rgba(5, 15, 25, .96) !important;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .42) !important;
    box-sizing: border-box !important;
  }

  html.gfm-mobile-landscape body .gfm-ib-wactions button {
    min-width: 0 !important;
    min-height: 40px !important;
    padding: 6px 5px !important;
    font-size: 9px !important;
    line-height: 1.12 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    touch-action: manipulation !important;
  }

  html.gfm-mobile-landscape body .gfm-ib-wactions button:only-child {
    grid-column: 1 / -1 !important;
  }

  html.gfm-mobile-landscape body .gfm-ib-wactions:has(> button:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (pointer: coarse) and (orientation: landscape) and (max-width: 680px) {
  html.gfm-mobile-landscape body .gfm-fm-squad-hero {
    display: grid !important;
    grid-template-columns: minmax(120px, 1fr) minmax(0, auto) !important;
  }

  html.gfm-mobile-landscape body .gfm-fm-tabbar {
    max-width: 292px !important;
  }

  html.gfm-mobile-landscape body .gfm-fm-tabbar button {
    min-width: 82px !important;
    font-size: 10px !important;
  }
}
